mirror of
https://github.com/severian-dev/sucker.severian.dev.git
synced 2026-10-18 01:20:29 +00:00
Compare commits
5 Commits
sonia
..
225c2e3c4f
| Author | SHA1 | Date | |
|---|---|---|---|
| 225c2e3c4f | |||
| a66a46fc4a | |||
| d42d13e7f0 | |||
| b252df5591 | |||
| 75a16b6ece |
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
# Disable Discord community banner (optional)
|
# Disable Discord community banner (optional)
|
||||||
# Uncomment the line below to hide the Discord banner
|
# Uncomment the line below to hide the Discord banner
|
||||||
NEXT_PUBLIC_DISABLE_DISCORD_BANNER=true
|
# NEXT_PUBLIC_DISABLE_DISCORD_BANNER=true
|
||||||
+1
-6
@@ -1,9 +1,4 @@
|
|||||||
.idea/
|
|
||||||
bun.lock
|
|
||||||
.env
|
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
.next
|
.next
|
||||||
.env.local
|
.env.local
|
||||||
.env*.local
|
.env*.local
|
||||||
.env
|
|
||||||
@@ -17,6 +17,7 @@ You can also build and run Sucker as a Docker container with `docker compose bui
|
|||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
|
- 2.3: ECHO. Put ECHO: anywhere in a message and sucker repeats whatever comes after it in the reply — for triggering char-side script and lorebook keywords.
|
||||||
- 2.2: Added support for directly inputting webp file names or character image links when creating PNG character cards
|
- 2.2: Added support for directly inputting webp file names or character image links when creating PNG character cards
|
||||||
- 2.1: updated deps, note about image fetching, list of mirrors
|
- 2.1: updated deps, note about image fetching, list of mirrors
|
||||||
- 2.0: from Tui: Multimessage support! Tracks changes to character descriptions and scenarios across multiple extractions. Shows version badges, message counts, and provides detailed change history viewer.
|
- 2.0: from Tui: Multimessage support! Tracks changes to character descriptions and scenarios across multiple extractions. Shows version badges, message counts, and provides detailed change history viewer.
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ services:
|
|||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
image: sucker
|
image: sucker
|
||||||
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
@@ -93,6 +93,15 @@ function parseConversationToken(content: string | undefined | null): string | nu
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseEchoText(content: string | undefined | null): string | null {
|
||||||
|
if (!content) return null;
|
||||||
|
const match = content.match(/ECHO:\s*([\s\S]+)/i);
|
||||||
|
if (match && match[1].trim()) {
|
||||||
|
return match[1].trim();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function removePersonaTags(content: string): string {
|
function removePersonaTags(content: string): string {
|
||||||
let result = content;
|
let result = content;
|
||||||
const openingMatch = result.match(/<[^<>]+?\s*'s\s+Persona>/i);
|
const openingMatch = result.match(/<[^<>]+?\s*'s\s+Persona>/i);
|
||||||
@@ -487,6 +496,18 @@ export async function POST(request: NextRequest) {
|
|||||||
responseMessage = `New character "${extracted.data.name}" created (v1).${tokenNote}`;
|
responseMessage = `New character "${extracted.data.name}" created (v1).${tokenNote}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Echo back anything the user sent after an "ECHO:" marker in their
|
||||||
|
// latest message, appended after the normal status message
|
||||||
|
const lastUserMessage =
|
||||||
|
[...body.messages]
|
||||||
|
.reverse()
|
||||||
|
.find((m: { role?: string }) => m?.role === "user") ??
|
||||||
|
body.messages[body.messages.length - 1];
|
||||||
|
const echoText = parseEchoText(lastUserMessage?.content);
|
||||||
|
if (echoText) {
|
||||||
|
responseMessage += `\n\n${echoText}`;
|
||||||
|
}
|
||||||
|
|
||||||
cleanupExpiredCards();
|
cleanupExpiredCards();
|
||||||
|
|
||||||
// Return SSE response if requested, otherwise JSON
|
// Return SSE response if requested, otherwise JSON
|
||||||
@@ -528,7 +549,7 @@ export async function POST(request: NextRequest) {
|
|||||||
console.error("Error processing request:", error);
|
console.error("Error processing request:", error);
|
||||||
|
|
||||||
const errorMessage =
|
const errorMessage =
|
||||||
"You dingus, read the directions on sucker before trying again.";
|
"You dingus, read the directions on sucker before trying again. If you're trying to suck a bot with more tokens than your current context limit, try bumping your Context Size setting up on Generation Settings.";
|
||||||
|
|
||||||
// Check if this was a streaming request
|
// Check if this was a streaming request
|
||||||
const acceptHeader = request.headers.get("accept");
|
const acceptHeader = request.headers.get("accept");
|
||||||
|
|||||||
+924
-869
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ interface DiscordBannerPermanentProps {
|
|||||||
export function DiscordBannerPermanent({
|
export function DiscordBannerPermanent({
|
||||||
inviteLink,
|
inviteLink,
|
||||||
serverName = "Avalon",
|
serverName = "Avalon",
|
||||||
description = "Looking for somewhere more... interesting? Avalon's an enchanted collective of botmakers who refuse to be boring 🌿 Come play with us~ (18+ only, darling)",
|
description = "Avalon is an enchanted creative haven for a growing collective of botmakers and users—part workshop, part myth, part digital forest where strange and beautiful ideas come to life. Enter our little woodland here:",
|
||||||
ctaText = "Join Server",
|
ctaText = "Join Server",
|
||||||
}: DiscordBannerPermanentProps) {
|
}: DiscordBannerPermanentProps) {
|
||||||
return (
|
return (
|
||||||
@@ -69,7 +69,7 @@ export function DiscordBannerPermanent({
|
|||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<div className="text-white font-semibold text-base mb-0.5">{serverName}</div>
|
<div className="text-white font-semibold text-base mb-0.5">{serverName}</div>
|
||||||
<div className="text-[#b9bbbe] text-sm space-y-0.5">
|
<div className="text-[#b9bbbe] text-sm space-y-0.5">
|
||||||
<div className="font-medium">67 members</div>
|
<div className="font-medium">295 members</div>
|
||||||
<a
|
<a
|
||||||
href="https://from-avalon.com"
|
href="https://from-avalon.com"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
Reference in New Issue
Block a user