Initial commit: Discord-Claude Gateway with event-driven agent runtime

This commit is contained in:
2026-02-22 00:31:25 -05:00
commit 77d7c74909
58 changed files with 11772 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import type { MarkdownConfigs } from "./markdown-config-loader.js";
const PREAMBLE =
"You may update your long-term memory by writing to memory.md using the Write tool. Use this to persist important facts, lessons learned, and context across sessions.";
interface SectionDef {
key: keyof MarkdownConfigs;
header: string;
}
const SECTIONS: SectionDef[] = [
{ key: "identity", header: "## Identity" },
{ key: "soul", header: "## Personality" },
{ key: "agents", header: "## Operating Rules" },
{ key: "user", header: "## User Context" },
{ key: "memory", header: "## Long-Term Memory" },
{ key: "tools", header: "## Tool Configuration" },
];
export class SystemPromptAssembler {
assemble(configs: MarkdownConfigs): string {
const parts: string[] = [PREAMBLE, ""];
for (const { key, header } of SECTIONS) {
const content = configs[key];
if (content != null && content !== "") {
parts.push(`${header}\n\n${content}\n`);
}
}
return parts.join("\n");
}
}