@letta-ai/letta-code 0.27.20 → 0.27.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-presets.js +3768 -0
- package/dist/agent-presets.js.map +17 -0
- package/dist/types/agent/agent-tags.d.ts +19 -0
- package/dist/types/agent/agent-tags.d.ts.map +1 -0
- package/dist/types/agent/create-agent-request.d.ts +55 -0
- package/dist/types/agent/create-agent-request.d.ts.map +1 -0
- package/dist/types/agent/memory-constants.d.ts +2 -0
- package/dist/types/agent/memory-constants.d.ts.map +1 -0
- package/dist/types/agent/memory.d.ts +29 -0
- package/dist/types/agent/memory.d.ts.map +1 -0
- package/dist/types/agent/model-catalog.d.ts +362 -0
- package/dist/types/agent/model-catalog.d.ts.map +1 -0
- package/dist/types/agent/personality-presets.d.ts +64 -0
- package/dist/types/agent/personality-presets.d.ts.map +1 -0
- package/dist/types/agent/prompt-assets.d.ts +32 -0
- package/dist/types/agent/prompt-assets.d.ts.map +1 -0
- package/dist/types/agent-presets.d.ts +16 -0
- package/dist/types/agent-presets.d.ts.map +1 -0
- package/dist/types/constants.d.ts +53 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/types/protocol_v2.d.ts +3 -1
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/letta.js +2029 -3395
- package/package.json +23 -1
- package/scripts/codex-watch/agent-watch.ts +186 -0
- package/scripts/codex-watch/check-release.ts +18 -316
- package/scripts/codex-watch/github.ts +121 -0
- package/scripts/codex-watch/release-analysis.ts +288 -0
- package/scripts/codex-watch/tracker.test.ts +127 -0
- package/scripts/codex-watch/tracker.ts +238 -0
- package/scripts/codex-watch/update-tracker.ts +131 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/agent/agent-tags.ts", "../src/constants.ts", "../src/agent/memory-constants.ts", "../src/agent/prompt-assets.ts", "../src/agent/memory.ts", "../src/agent/model-catalog.ts", "../src/agent/personality-presets.ts", "../src/agent/create-agent-request.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Tags that identify Letta Code agents and their capabilities.\n *\n * This module must stay free of Node/backend imports: it is bundled into the\n * browser-safe `@letta-ai/letta-code/agent-presets` package export.\n */\n\n/** Marks an agent as created/managed by Letta Code. */\nexport const LETTA_CODE_ORIGIN_TAG = \"origin:letta-code\";\n\n/** Marks an agent as a Letta Code subagent (excluded from prompt management). */\nexport const LETTA_CODE_SUBAGENT_TAG = \"role:subagent\";\n\n/** Marks an agent as using git-backed memory (MemFS). */\nexport const GIT_MEMORY_ENABLED_TAG = \"git-memory-enabled\";\n\nexport interface BuildCreatedAgentTagsOptions {\n tags?: string[] | null;\n isSubagent?: boolean;\n enableMemfs?: boolean;\n}\n\nexport function buildCreatedAgentTags(\n options: BuildCreatedAgentTagsOptions = {},\n): string[] {\n const tags = [LETTA_CODE_ORIGIN_TAG];\n if (options.isSubagent) {\n tags.push(LETTA_CODE_SUBAGENT_TAG);\n }\n if (options.enableMemfs) {\n tags.push(GIT_MEMORY_ENABLED_TAG);\n }\n if (options.tags && Array.isArray(options.tags)) {\n tags.push(...options.tags);\n }\n return Array.from(new Set(tags));\n}\n",
|
|
6
|
+
"/**\n * Application-wide constants\n */\n\n/**\n * Default model ID to use when no model is specified\n */\nexport const DEFAULT_MODEL_ID = \"auto\";\n\n/**\n * Default model handle to use for conversation compaction / summarization.\n */\nexport const DEFAULT_SUMMARIZATION_MODEL = \"letta/auto\";\n\n/**\n * Default model handle for lightweight conversation title generation.\n */\nexport const DEFAULT_TITLE_SUMMARIZATION_MODEL = \"letta/auto-fast\";\n\n/**\n * Default agent name when creating a new agent\n */\nexport const DEFAULT_AGENT_NAME = \"Letta Code\";\n\n/**\n * Message displayed when user interrupts tool execution\n */\nexport const INTERRUPTED_BY_USER = \"Interrupted by user\";\n\n/**\n * Synthetic tool result injected when a turn ended without completing all tool calls\n * (e.g. process crash or unhandled stream error). Settled automatically at the start\n * of the next turn so the conversation history stays valid for the provider.\n */\nexport const TURN_DID_NOT_COMPLETE = \"Turn did not complete\";\n\n/**\n * XML tag used to wrap system reminder content injected into messages\n */\nexport const SYSTEM_REMINDER_TAG = \"system-reminder\";\nexport const SYSTEM_REMINDER_OPEN = `<${SYSTEM_REMINDER_TAG}>`;\nexport const SYSTEM_REMINDER_CLOSE = `</${SYSTEM_REMINDER_TAG}>`;\n// Legacy tag kept for parsing/backward compatibility with older saved messages.\nexport const SYSTEM_ALERT_TAG = \"system-alert\";\nexport const SYSTEM_ALERT_OPEN = `<${SYSTEM_ALERT_TAG}>`;\nexport const SYSTEM_ALERT_CLOSE = `</${SYSTEM_ALERT_TAG}>`;\n\n/**\n * How often (in turns) to check for memfs sync conflicts, even without\n * filesystem change events. Catches block-only changes (e.g. ADE/API edits).\n */\nexport const MEMFS_CONFLICT_CHECK_INTERVAL = 5;\n\n/**\n * Header displayed before compaction summary when conversation context is truncated\n */\nexport const COMPACTION_SUMMARY_HEADER =\n \"(Earlier messages in this conversation have been compacted to free up context, summarized below)\";\n\n/**\n * Status bar thresholds - only show indicators when values exceed these\n */\n// Show token count after 100 estimated tokens (shows exact count until 1k, then compact)\nexport const TOKEN_DISPLAY_THRESHOLD = 100;\n// Show elapsed time after 2 minutes (in ms)\nexport const ELAPSED_DISPLAY_THRESHOLD_MS = 60 * 1000;\n",
|
|
7
|
+
"export const READ_ONLY_BLOCK_LABELS = [\"memory_filesystem\"] as const;\n",
|
|
8
|
+
"// Additional system prompts for /system command\n\nimport approvalRecoveryAlert from \"./prompts/approval_recovery_alert.txt\";\nimport humanPrompt from \"./prompts/human.mdx\";\nimport humanKawaiiPrompt from \"./prompts/human_kawaii.mdx\";\nimport humanLinusPrompt from \"./prompts/human_linus.mdx\";\nimport humanMemoPrompt from \"./prompts/human_memo.mdx\";\nimport interruptRecoveryAlert from \"./prompts/interrupt_recovery_alert.txt\";\nimport lettaMemfsPrompt from \"./prompts/letta.md\";\nimport lettaNoMemfsPrompt from \"./prompts/letta_no_memfs.md\";\nimport memoryFilesystemPrompt from \"./prompts/memory_filesystem.mdx\";\nimport onboardingPrompt from \"./prompts/onboarding.mdx\";\nimport personaPrompt from \"./prompts/persona.mdx\";\nimport personaBlankPrompt from \"./prompts/persona_blank.mdx\";\nimport personaKawaiiPrompt from \"./prompts/persona_kawaii.mdx\";\nimport personaLinusPrompt from \"./prompts/persona_linus.mdx\";\nimport personaMemoPrompt from \"./prompts/persona_memo.mdx\";\nimport personaTutorialPrompt from \"./prompts/persona_tutorial.mdx\";\nimport projectPrompt from \"./prompts/project.mdx\";\nimport rememberPrompt from \"./prompts/remember.md\";\nimport skillCreatorModePrompt from \"./prompts/skill_creator_mode.md\";\nimport sourceClaudePrompt from \"./prompts/source_claude.md\";\nimport sourceCodexPrompt from \"./prompts/source_codex.md\";\nimport sourceGeminiPrompt from \"./prompts/source_gemini.md\";\n\nimport stylePrompt from \"./prompts/style.mdx\";\n\nexport const SYSTEM_PROMPT = lettaNoMemfsPrompt;\n\nexport const SKILL_CREATOR_PROMPT = skillCreatorModePrompt;\nexport const REMEMBER_PROMPT = rememberPrompt;\nexport const APPROVAL_RECOVERY_PROMPT = approvalRecoveryAlert;\nexport const INTERRUPT_RECOVERY_ALERT = interruptRecoveryAlert;\n\nexport const MEMORY_PROMPTS: Record<string, string> = {\n \"persona.mdx\": personaPrompt,\n \"persona_blank.mdx\": personaBlankPrompt,\n \"persona_kawaii.mdx\": personaKawaiiPrompt,\n \"persona_linus.mdx\": personaLinusPrompt,\n \"persona_memo.mdx\": personaMemoPrompt,\n \"persona_tutorial.mdx\": personaTutorialPrompt,\n \"human.mdx\": humanPrompt,\n \"human_kawaii.mdx\": humanKawaiiPrompt,\n \"human_linus.mdx\": humanLinusPrompt,\n \"human_memo.mdx\": humanMemoPrompt,\n \"project.mdx\": projectPrompt,\n\n \"memory_filesystem.mdx\": memoryFilesystemPrompt,\n \"onboarding.mdx\": onboardingPrompt,\n \"style.mdx\": stylePrompt,\n};\n\n// System prompt options for /system command\nexport interface SystemPromptOption {\n id: string;\n label: string;\n description: string;\n content: string;\n memfsContent?: string;\n isDefault?: boolean;\n isFeatured?: boolean;\n}\n\nexport const SYSTEM_PROMPTS: SystemPromptOption[] = [\n {\n id: \"default\",\n label: \"Default\",\n description: \"Alias for letta\",\n content: lettaNoMemfsPrompt,\n memfsContent: lettaMemfsPrompt,\n isDefault: true,\n isFeatured: true,\n },\n {\n id: \"letta\",\n label: \"Letta Code\",\n description: \"Full Letta Code system prompt\",\n content: lettaNoMemfsPrompt,\n memfsContent: lettaMemfsPrompt,\n isFeatured: true,\n },\n {\n id: \"source-claude\",\n label: \"Claude Code\",\n description: \"Source-faithful Claude Code prompt (for benchmarking)\",\n content: sourceClaudePrompt,\n },\n {\n id: \"source-codex\",\n label: \"Codex\",\n description: \"Source-faithful OpenAI Codex prompt (for benchmarking)\",\n content: sourceCodexPrompt,\n },\n {\n id: \"source-gemini\",\n label: \"Gemini CLI\",\n description: \"Source-faithful Gemini CLI prompt (for benchmarking)\",\n content: sourceGeminiPrompt,\n },\n];\n\nexport type MemoryPromptMode = \"standard\" | \"memfs\" | \"local-memfs\";\n\n/**\n * Check if a preset ID exists in SYSTEM_PROMPTS.\n */\nexport function isKnownPreset(id: string): boolean {\n return SYSTEM_PROMPTS.some((p) => p.id === id);\n}\n\n/**\n * Deterministic rebuild of a system prompt from a known preset + memory mode.\n * Throws on unknown preset (prevents stale/renamed presets from silently rewriting prompts).\n */\nexport function buildSystemPrompt(\n presetId: string,\n memoryMode: MemoryPromptMode,\n): string {\n const preset = SYSTEM_PROMPTS.find((p) => p.id === presetId);\n if (!preset) {\n throw new Error(\n `Unknown preset \"${presetId}\" — cannot rebuild system prompt`,\n );\n }\n if (memoryMode === \"memfs\" || memoryMode === \"local-memfs\") {\n return (preset.memfsContent ?? preset.content).trim();\n }\n\n return preset.content.trim();\n}\n\n/**\n * Returns true if the agent is not on the current default preset\n * and would benefit from switching to `/system default`.\n */\nexport function shouldRecommendDefaultPrompt(\n currentPrompt: string,\n memoryMode: MemoryPromptMode,\n): boolean {\n const defaultPrompt = buildSystemPrompt(\"default\", memoryMode);\n return currentPrompt !== defaultPrompt;\n}\n",
|
|
9
|
+
"/**\n * Agent memory block management\n * Loads memory blocks from .mdx files in src/agent/prompts\n */\n\nimport type { CreateBlock } from \"@letta-ai/letta-client/resources/blocks/blocks\";\nimport { READ_ONLY_BLOCK_LABELS } from \"./memory-constants\";\nimport { MEMORY_PROMPTS } from \"./prompt-assets\";\n\n/**\n * The memory block labels every standard (non-MemFS) agent is created with.\n * Each maps to a `<label>.mdx` file in src/agent/prompts. Per-project blocks\n * (skills/loaded_skills) were removed in LET-7353 — skills are now injected\n * via system reminders, leaving only these defaults.\n */\nexport const MEMORY_BLOCK_LABELS = [\"persona\", \"human\"] as const;\n\n/**\n * Block labels that should be read-only (agent cannot modify via memory tools).\n */\nexport { READ_ONLY_BLOCK_LABELS };\n\n/**\n * Parse frontmatter and content from an .mdx file\n */\nexport function parseMdxFrontmatter(content: string): {\n frontmatter: Record<string, string>;\n body: string;\n} {\n const frontmatterRegex = /^---\\n([\\s\\S]*?)\\n---\\n([\\s\\S]*)$/;\n const match = content.match(frontmatterRegex);\n\n if (!match || !match[1] || !match[2]) {\n return { frontmatter: {}, body: content };\n }\n\n const frontmatterText = match[1];\n const body = match[2];\n const frontmatter: Record<string, string> = {};\n\n // Parse YAML-like frontmatter (simple key: value pairs)\n for (const line of frontmatterText.split(\"\\n\")) {\n const colonIndex = line.indexOf(\":\");\n if (colonIndex > 0) {\n const key = line.slice(0, colonIndex).trim();\n const value = line.slice(colonIndex + 1).trim();\n frontmatter[key] = value;\n }\n }\n\n return { frontmatter, body: body.trim() };\n}\n\n/**\n * Load memory blocks from .mdx files in src/agent/prompts\n */\nasync function loadMemoryBlocksFromMdx(): Promise<CreateBlock[]> {\n const memoryBlocks: CreateBlock[] = [];\n\n const mdxFiles = MEMORY_BLOCK_LABELS.map((label) => `${label}.mdx`);\n\n for (const filename of mdxFiles) {\n try {\n const content = MEMORY_PROMPTS[filename];\n if (!content) {\n console.warn(`Missing embedded prompt file: ${filename}`);\n continue;\n }\n const { frontmatter, body } = parseMdxFrontmatter(content);\n\n const label = frontmatter.label || filename.replace(\".mdx\", \"\");\n const block: CreateBlock = {\n label,\n value: body,\n };\n\n if (frontmatter.description) {\n block.description = frontmatter.description;\n }\n\n // Set read-only for blocks managed by specific tools (not memory tools)\n if ((READ_ONLY_BLOCK_LABELS as readonly string[]).includes(label)) {\n block.read_only = true;\n }\n\n memoryBlocks.push(block);\n } catch (error) {\n console.error(`Error loading ${filename}:`, error);\n }\n }\n\n return memoryBlocks;\n}\n\n// Cache for loaded memory blocks\nlet cachedMemoryBlocks: CreateBlock[] | null = null;\n\n/**\n * Get default starter memory blocks for new agents\n */\nexport async function getDefaultMemoryBlocks(): Promise<CreateBlock[]> {\n if (!cachedMemoryBlocks) {\n cachedMemoryBlocks = await loadMemoryBlocksFromMdx();\n }\n return cachedMemoryBlocks;\n}\n",
|
|
10
|
+
"/**\n * The static model catalog (models.json) and pure handle resolution.\n *\n * Split from `model.ts` so the catalog can be bundled into the browser-safe\n * `@letta-ai/letta-code/agent-presets` package export without dragging in\n * provider/backend modules. CLI code should keep importing from\n * `@/agent/model`, which re-exports this module.\n */\n\nimport modelsData from \"@/models.json\";\n\nexport const models = modelsData.models;\n\n/**\n * Resolve a model by ID or handle\n * @param modelIdentifier - Can be either a model ID (e.g., \"opus-4.5\") or a full handle (e.g., \"anthropic/claude-opus-4-5\")\n * @returns The model handle if found, null otherwise\n */\nexport function resolveModel(modelIdentifier: string): string | null {\n const byId = models.find((m) => m.id === modelIdentifier);\n if (byId) return byId.handle;\n\n const byHandle = models.find((m) => m.handle === modelIdentifier);\n if (byHandle) return byHandle.handle;\n\n // For self-hosted servers: if it looks like a handle (contains /), pass it through\n // This allows using models not in models.json (e.g., from server's /v1/models)\n if (modelIdentifier.includes(\"/\")) {\n return modelIdentifier;\n }\n\n return null;\n}\n\n/**\n * Get the default model handle\n */\nexport function getDefaultModel(): string {\n // Prefer Auto when available in models.json.\n const autoModel = resolveModel(\"auto\");\n if (autoModel) return autoModel;\n\n const defaultModel = models.find((m) => m.isDefault);\n if (defaultModel) return defaultModel.handle;\n\n const firstModel = models[0];\n if (!firstModel) {\n throw new Error(\"No models available in models.json\");\n }\n return firstModel.handle;\n}\n",
|
|
11
|
+
"/**\n * Pure personality preset definitions and content builders.\n *\n * This module must stay free of Node/backend imports: it is bundled into the\n * browser-safe `@letta-ai/letta-code/agent-presets` package export so that\n * other surfaces (e.g. the chat web app) can build byte-identical agent\n * creation payloads. Filesystem application of personalities lives in\n * `personality.ts`.\n */\n\nimport { parseMdxFrontmatter } from \"./memory\";\nimport { MEMORY_PROMPTS, SYSTEM_PROMPTS } from \"./prompt-assets\";\n\nexport interface PersonalityOption {\n id: \"blank\" | \"kawaii\" | \"codex\" | \"claude\" | \"linus\" | \"memo\" | \"tutorial\";\n label: string;\n description: string;\n /** Model ID from models.json to use when no explicit model is provided. */\n defaultModel?: string;\n}\n\nexport const PERSONALITY_OPTIONS: PersonalityOption[] = [\n {\n id: \"memo\",\n label: \"Letta Code\",\n description: \"The memory-first agent\",\n },\n {\n id: \"tutorial\",\n label: \"Tutor\",\n description: \"A tutor-guide that teaches Letta through real work\",\n },\n {\n id: \"blank\",\n label: \"Blank\",\n description: \"Blank starter — you provide the personality\",\n },\n {\n id: \"linus\",\n label: \"Linus\",\n description: \"Code with a stern hand\",\n },\n {\n id: \"kawaii\",\n label: \"Letta-Chan\",\n description: \"sugoi~ (◕‿◕)✨\",\n defaultModel: \"auto-chat\",\n },\n {\n id: \"claude\",\n label: \"Letta Code\",\n description: \"Vanilla Claude flavors\",\n },\n {\n id: \"codex\",\n label: \"Letta Code\",\n description: \"Vanilla Codex flavors\",\n },\n];\n\nexport type PersonalityId = PersonalityOption[\"id\"];\n\nexport const DEFAULT_CREATE_AGENT_PERSONALITIES = [\n \"memo\",\n \"tutorial\",\n \"blank\",\n \"linus\",\n \"kawaii\",\n] as const;\n\nexport type DefaultCreateAgentPersonalityId =\n (typeof DEFAULT_CREATE_AGENT_PERSONALITIES)[number];\n\nconst PERSONALITY_ALIASES: Record<string, PersonalityId> = {\n \"letta-code\": \"memo\",\n lettacode: \"memo\",\n memo: \"memo\",\n};\n\nexport interface PersonalityBlockDefinition {\n value: string;\n description?: string;\n templatePromptAssetName: string;\n}\n\nexport const ONBOARDING_PERSONALITIES = [\n \"tutorial\",\n] as const satisfies readonly PersonalityId[];\n\nexport function supportsOnboardingBlock(\n personalityId: PersonalityId,\n): personalityId is (typeof ONBOARDING_PERSONALITIES)[number] {\n return (ONBOARDING_PERSONALITIES as readonly PersonalityId[]).includes(\n personalityId,\n );\n}\n\nexport const FRONTMATTER_REGEX = /^(---\\n[\\s\\S]*?\\n---)\\n*/;\nconst EDITABLE_FRONTMATTER_KEYS = [\n \"description\",\n \"limit\",\n \"read_only\",\n] as const;\n\nexport function normalizeComparableContent(content: string): string {\n return content.replace(/\\r\\n/g, \"\\n\").trim();\n}\n\nfunction ensureTrailingNewline(content: string): string {\n return `${content.trimEnd()}\\n`;\n}\n\nfunction getPromptTemplate(promptAssetName: string): {\n frontmatter: Record<string, string>;\n body: string;\n} {\n const rawPrompt = MEMORY_PROMPTS[promptAssetName];\n if (!rawPrompt) {\n throw new Error(`Missing built-in prompt content for ${promptAssetName}`);\n }\n\n return parseMdxFrontmatter(rawPrompt);\n}\n\nfunction getPromptBody(promptAssetName: string): string {\n const { body } = getPromptTemplate(promptAssetName);\n if (!body.trim()) {\n throw new Error(`${promptAssetName} has empty body content`);\n }\n\n return ensureTrailingNewline(body);\n}\n\nfunction getEditablePromptFrontmatter(\n promptAssetName: string,\n): Record<string, string> {\n const { frontmatter } = getPromptTemplate(promptAssetName);\n return Object.fromEntries(\n Object.entries(frontmatter).filter(([key]) =>\n (EDITABLE_FRONTMATTER_KEYS as readonly string[]).includes(key),\n ),\n );\n}\n\nexport function serializeFrontmatter(\n frontmatter: Record<string, string>,\n): string {\n const orderedKeys = [\n ...EDITABLE_FRONTMATTER_KEYS,\n ...Object.keys(frontmatter).filter(\n (key) => !(EDITABLE_FRONTMATTER_KEYS as readonly string[]).includes(key),\n ),\n ];\n const lines: string[] = [];\n\n for (const key of orderedKeys) {\n const value = frontmatter[key];\n if (value === undefined) {\n continue;\n }\n lines.push(`${key}: ${value}`);\n }\n\n return `---\\n${lines.join(\"\\n\")}\\n---`;\n}\n\nexport function buildDefaultMemoryFile(\n templatePromptAssetName: string,\n body: string,\n description?: string,\n): string {\n const normalizedBody = ensureTrailingNewline(body.trim());\n if (!normalizedBody.trim()) {\n throw new Error(\"Memory content cannot be empty\");\n }\n\n const frontmatter = getEditablePromptFrontmatter(templatePromptAssetName);\n if (description !== undefined) {\n frontmatter.description = description;\n }\n\n if (Object.keys(frontmatter).length === 0) {\n return normalizedBody;\n }\n\n return `${serializeFrontmatter(frontmatter)}\\n\\n${normalizedBody}`;\n}\n\nfunction getSystemPromptById(systemPromptId: string): string {\n const prompt = SYSTEM_PROMPTS.find(\n (candidate) => candidate.id === systemPromptId,\n );\n if (!prompt || !prompt.content.trim()) {\n throw new Error(`Missing built-in prompt content for ${systemPromptId}`);\n }\n return prompt.content;\n}\n\nexport function getPersonalityOption(\n personalityId: PersonalityId,\n): PersonalityOption {\n const option = PERSONALITY_OPTIONS.find(\n (candidate) => candidate.id === personalityId,\n );\n if (!option) {\n throw new Error(`Unknown personality: ${personalityId}`);\n }\n return option;\n}\n\nexport function resolvePersonalityId(input: string): PersonalityId | null {\n const normalized = input.trim().toLowerCase();\n if (!normalized) {\n return null;\n }\n\n const direct = PERSONALITY_OPTIONS.find(\n (candidate) => candidate.id === normalized,\n );\n if (direct) {\n return direct.id;\n }\n\n return PERSONALITY_ALIASES[normalized] ?? null;\n}\n\nexport function getPersonalityContent(personalityId: PersonalityId): string {\n if (personalityId === \"memo\") {\n return getPromptBody(\"persona_memo.mdx\");\n }\n\n if (personalityId === \"tutorial\") {\n return getPromptBody(\"persona_tutorial.mdx\");\n }\n\n if (personalityId === \"blank\") {\n return getPromptBody(\"persona_blank.mdx\");\n }\n\n if (personalityId === \"kawaii\") {\n return getPromptBody(\"persona_kawaii.mdx\");\n }\n\n if (personalityId === \"codex\") {\n return ensureTrailingNewline(getSystemPromptById(\"source-codex\"));\n }\n\n if (personalityId === \"linus\") {\n return getPromptBody(\"persona_linus.mdx\");\n }\n\n return ensureTrailingNewline(getSystemPromptById(\"source-claude\"));\n}\n\nexport function getDefaultHumanContent(): string {\n return getPromptBody(\"human.mdx\");\n}\n\nexport function getPersonalityHumanContent(\n personalityId: PersonalityId,\n): string {\n if (personalityId === \"memo\" || personalityId === \"tutorial\") {\n return getPromptBody(\"human_memo.mdx\");\n }\n\n if (personalityId === \"linus\") {\n return getPromptBody(\"human_linus.mdx\");\n }\n\n if (personalityId === \"kawaii\") {\n return getPromptBody(\"human_kawaii.mdx\");\n }\n\n if (personalityId === \"blank\") {\n return getDefaultHumanContent();\n }\n\n return getDefaultHumanContent();\n}\n\nexport function getPersonalityBlockValues(personalityId: PersonalityId): {\n persona: string;\n human: string;\n} {\n const overrides = getPersonalityBlockDefinitions(personalityId);\n return {\n persona: overrides.persona.value,\n human: overrides.human.value,\n };\n}\n\nexport function getPersonalityBlockDefinitions(personalityId: PersonalityId): {\n persona: PersonalityBlockDefinition;\n human: PersonalityBlockDefinition;\n onboarding?: PersonalityBlockDefinition;\n} {\n const personaTemplatePromptAssetName =\n personalityId === \"memo\"\n ? \"persona_memo.mdx\"\n : personalityId === \"tutorial\"\n ? \"persona_tutorial.mdx\"\n : personalityId === \"blank\"\n ? \"persona_blank.mdx\"\n : personalityId === \"kawaii\"\n ? \"persona_kawaii.mdx\"\n : personalityId === \"linus\"\n ? \"persona_linus.mdx\"\n : \"persona.mdx\";\n const humanTemplatePromptAssetName =\n personalityId === \"memo\" || personalityId === \"tutorial\"\n ? \"human_memo.mdx\"\n : personalityId === \"kawaii\"\n ? \"human_kawaii.mdx\"\n : personalityId === \"linus\"\n ? \"human_linus.mdx\"\n : \"human.mdx\";\n\n return {\n persona: {\n value: getPersonalityContent(personalityId),\n description: getEditablePromptFrontmatter(personaTemplatePromptAssetName)\n .description,\n templatePromptAssetName: personaTemplatePromptAssetName,\n },\n human: {\n value: getPersonalityHumanContent(personalityId),\n description: getEditablePromptFrontmatter(humanTemplatePromptAssetName)\n .description,\n templatePromptAssetName: humanTemplatePromptAssetName,\n },\n ...(supportsOnboardingBlock(personalityId)\n ? {\n onboarding: {\n value: getPromptBody(\"onboarding.mdx\"),\n description:\n getEditablePromptFrontmatter(\"onboarding.mdx\").description,\n templatePromptAssetName: \"onboarding.mdx\",\n },\n }\n : {}),\n };\n}\n\nexport interface PersonalityMemoryBlock {\n label: string;\n value: string;\n description?: string;\n}\n\n/**\n * Build the memory blocks a new agent gets for a personality: the default\n * blocks with persona/human values replaced by the personality's content,\n * plus the onboarding block for personalities that support it.\n *\n * Shared by the CLI create path (`buildCreateAgentOptionsForPersonality`) and\n * the exported wire payload builder (`buildCreateAgentRequestForPersonality`).\n */\nexport function buildPersonalityMemoryBlocks(\n personalityId: PersonalityId,\n defaultMemoryBlocks: Array<{\n label: string;\n value: string;\n description?: string | null;\n }>,\n): PersonalityMemoryBlock[] {\n const blockDefinitions = getPersonalityBlockDefinitions(personalityId);\n\n const memoryBlocks = defaultMemoryBlocks.map((block) => {\n if (block.label === \"persona\") {\n return {\n label: block.label,\n value: blockDefinitions.persona.value,\n description:\n blockDefinitions.persona.description ??\n block.description ??\n undefined,\n };\n }\n\n if (block.label === \"human\") {\n return {\n label: block.label,\n value: blockDefinitions.human.value,\n description:\n blockDefinitions.human.description ?? block.description ?? undefined,\n };\n }\n\n return {\n label: block.label,\n value: block.value,\n description: block.description ?? undefined,\n };\n });\n\n if (blockDefinitions.onboarding) {\n memoryBlocks.push({\n label: \"onboarding\",\n value: blockDefinitions.onboarding.value,\n description: blockDefinitions.onboarding.description,\n });\n }\n\n return memoryBlocks;\n}\n",
|
|
12
|
+
"/**\n * Pure builder for the `POST /v1/agents` wire payload of a Letta Code\n * personality agent.\n *\n * This is the shared source of truth between the CLI create path\n * (`createAgentForPersonality` → `createAgent`) and external surfaces that\n * create Letta Code agents directly through Core (e.g. the chat web app via\n * the `@letta-ai/letta-code/agent-presets` package export). It must stay free\n * of Node/backend imports so it can be bundled for the browser.\n *\n * Intentional differences from the CLI's `createAgent`:\n * - `context_window_limit` is omitted (the CLI resolves it via the models\n * API at runtime); Core applies the default for the model handle.\n * - `embedding` is omitted (CLI only sets it when explicitly configured).\n */\n\nimport { DEFAULT_SUMMARIZATION_MODEL } from \"@/constants\";\nimport { buildCreatedAgentTags } from \"./agent-tags\";\nimport { getDefaultMemoryBlocks } from \"./memory\";\nimport { getDefaultModel, resolveModel } from \"./model-catalog\";\nimport {\n buildPersonalityMemoryBlocks,\n getPersonalityOption,\n type PersonalityId,\n type PersonalityMemoryBlock,\n} from \"./personality-presets\";\nimport { buildSystemPrompt } from \"./prompt-assets\";\n\n/** Agent type used for all Letta Code agents. */\nexport const LETTA_CODE_AGENT_TYPE = \"letta_v1_agent\";\n\n/**\n * Server-side tools attached to created agents. Client-side tools (Read,\n * Write, Bash, etc.) are passed via client_tools at runtime instead.\n */\nexport const DEFAULT_CREATED_AGENT_BASE_TOOLS = [\"web_search\", \"fetch_webpage\"];\n\nexport interface CreateAgentRequestForPersonality {\n agent_type: string;\n name: string;\n description: string;\n model: string;\n system: string;\n memory_blocks: PersonalityMemoryBlock[];\n tags: string[];\n tools: string[];\n include_base_tools: boolean;\n include_base_tool_rules: boolean;\n initial_message_sequence: never[];\n parallel_tool_calls: boolean;\n compaction_settings: { model: string };\n}\n\n/**\n * Build the Core create-agent request body for a Letta Code personality\n * agent with git-backed (MemFS) memory — byte-identical content to what the\n * CLI sends when creating the same personality against the Letta API.\n */\nexport async function buildCreateAgentRequestForPersonality(params: {\n personalityId: PersonalityId;\n name?: string;\n description?: string;\n /** Model ID or handle; defaults to the personality's default model. */\n model?: string;\n /** Extra tags (e.g. a favorite tag) appended to the Letta Code tags. */\n extraTags?: string[];\n}): Promise<CreateAgentRequestForPersonality> {\n const { personalityId, name, description, model, extraTags } = params;\n const personality = getPersonalityOption(personalityId);\n\n const modelIdentifier = model ?? personality.defaultModel;\n const modelHandle = modelIdentifier\n ? resolveModel(modelIdentifier)\n : getDefaultModel();\n if (!modelHandle) {\n throw new Error(`Unknown model: ${modelIdentifier}`);\n }\n\n const defaultMemoryBlocks = await getDefaultMemoryBlocks();\n\n return {\n agent_type: LETTA_CODE_AGENT_TYPE,\n name: name ?? personality.label,\n description: description ?? personality.description,\n model: modelHandle,\n system: buildSystemPrompt(\"default\", \"memfs\"),\n memory_blocks: buildPersonalityMemoryBlocks(\n personalityId,\n defaultMemoryBlocks,\n ),\n tags: buildCreatedAgentTags({ enableMemfs: true, tags: extraTags }),\n tools: [...DEFAULT_CREATED_AGENT_BASE_TOOLS],\n include_base_tools: false,\n include_base_tool_rules: false,\n initial_message_sequence: [],\n parallel_tool_calls: true,\n compaction_settings: { model: DEFAULT_SUMMARIZATION_MODEL },\n };\n}\n"
|
|
13
|
+
],
|
|
14
|
+
"mappings": ";AAQO,IAAM,wBAAwB;AAG9B,IAAM,0BAA0B;AAGhC,IAAM,yBAAyB;AAQ/B,SAAS,qBAAqB,CACnC,UAAwC,CAAC,GAC/B;AAAA,EACV,MAAM,OAAO,CAAC,qBAAqB;AAAA,EACnC,IAAI,QAAQ,YAAY;AAAA,IACtB,KAAK,KAAK,uBAAuB;AAAA,EACnC;AAAA,EACA,IAAI,QAAQ,aAAa;AAAA,IACvB,KAAK,KAAK,sBAAsB;AAAA,EAClC;AAAA,EACA,IAAI,QAAQ,QAAQ,MAAM,QAAQ,QAAQ,IAAI,GAAG;AAAA,IAC/C,KAAK,KAAK,GAAG,QAAQ,IAAI;AAAA,EAC3B;AAAA,EACA,OAAO,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC;AAAA;;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,IACrB,qBAAqB,EAAE,OAAO,4BAA4B;AAAA,EAC5D;AAAA;",
|
|
15
|
+
"debugId": "CBBF7FD8794E919564756E2164756E21",
|
|
16
|
+
"names": []
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tags that identify Letta Code agents and their capabilities.
|
|
3
|
+
*
|
|
4
|
+
* This module must stay free of Node/backend imports: it is bundled into the
|
|
5
|
+
* browser-safe `@letta-ai/letta-code/agent-presets` package export.
|
|
6
|
+
*/
|
|
7
|
+
/** Marks an agent as created/managed by Letta Code. */
|
|
8
|
+
export declare const LETTA_CODE_ORIGIN_TAG = "origin:letta-code";
|
|
9
|
+
/** Marks an agent as a Letta Code subagent (excluded from prompt management). */
|
|
10
|
+
export declare const LETTA_CODE_SUBAGENT_TAG = "role:subagent";
|
|
11
|
+
/** Marks an agent as using git-backed memory (MemFS). */
|
|
12
|
+
export declare const GIT_MEMORY_ENABLED_TAG = "git-memory-enabled";
|
|
13
|
+
export interface BuildCreatedAgentTagsOptions {
|
|
14
|
+
tags?: string[] | null;
|
|
15
|
+
isSubagent?: boolean;
|
|
16
|
+
enableMemfs?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function buildCreatedAgentTags(options?: BuildCreatedAgentTagsOptions): string[];
|
|
19
|
+
//# sourceMappingURL=agent-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-tags.d.ts","sourceRoot":"","sources":["../../../src/agent/agent-tags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,4BAAiC,GACzC,MAAM,EAAE,CAYV"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure builder for the `POST /v1/agents` wire payload of a Letta Code
|
|
3
|
+
* personality agent.
|
|
4
|
+
*
|
|
5
|
+
* This is the shared source of truth between the CLI create path
|
|
6
|
+
* (`createAgentForPersonality` → `createAgent`) and external surfaces that
|
|
7
|
+
* create Letta Code agents directly through Core (e.g. the chat web app via
|
|
8
|
+
* the `@letta-ai/letta-code/agent-presets` package export). It must stay free
|
|
9
|
+
* of Node/backend imports so it can be bundled for the browser.
|
|
10
|
+
*
|
|
11
|
+
* Intentional differences from the CLI's `createAgent`:
|
|
12
|
+
* - `context_window_limit` is omitted (the CLI resolves it via the models
|
|
13
|
+
* API at runtime); Core applies the default for the model handle.
|
|
14
|
+
* - `embedding` is omitted (CLI only sets it when explicitly configured).
|
|
15
|
+
*/
|
|
16
|
+
import { type PersonalityId, type PersonalityMemoryBlock } from "./personality-presets";
|
|
17
|
+
/** Agent type used for all Letta Code agents. */
|
|
18
|
+
export declare const LETTA_CODE_AGENT_TYPE = "letta_v1_agent";
|
|
19
|
+
/**
|
|
20
|
+
* Server-side tools attached to created agents. Client-side tools (Read,
|
|
21
|
+
* Write, Bash, etc.) are passed via client_tools at runtime instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_CREATED_AGENT_BASE_TOOLS: string[];
|
|
24
|
+
export interface CreateAgentRequestForPersonality {
|
|
25
|
+
agent_type: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
model: string;
|
|
29
|
+
system: string;
|
|
30
|
+
memory_blocks: PersonalityMemoryBlock[];
|
|
31
|
+
tags: string[];
|
|
32
|
+
tools: string[];
|
|
33
|
+
include_base_tools: boolean;
|
|
34
|
+
include_base_tool_rules: boolean;
|
|
35
|
+
initial_message_sequence: never[];
|
|
36
|
+
parallel_tool_calls: boolean;
|
|
37
|
+
compaction_settings: {
|
|
38
|
+
model: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build the Core create-agent request body for a Letta Code personality
|
|
43
|
+
* agent with git-backed (MemFS) memory — byte-identical content to what the
|
|
44
|
+
* CLI sends when creating the same personality against the Letta API.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildCreateAgentRequestForPersonality(params: {
|
|
47
|
+
personalityId: PersonalityId;
|
|
48
|
+
name?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
/** Model ID or handle; defaults to the personality's default model. */
|
|
51
|
+
model?: string;
|
|
52
|
+
/** Extra tags (e.g. a favorite tag) appended to the Letta Code tags. */
|
|
53
|
+
extraTags?: string[];
|
|
54
|
+
}): Promise<CreateAgentRequestForPersonality>;
|
|
55
|
+
//# sourceMappingURL=create-agent-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-agent-request.d.ts","sourceRoot":"","sources":["../../../src/agent/create-agent-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAG/B,iDAAiD;AACjD,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,gCAAgC,UAAkC,CAAC;AAEhF,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,wBAAwB,EAAE,KAAK,EAAE,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAsB,qCAAqC,CAAC,MAAM,EAAE;IAClE,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAgC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-constants.d.ts","sourceRoot":"","sources":["../../../src/agent/memory-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,gCAAiC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent memory block management
|
|
3
|
+
* Loads memory blocks from .mdx files in src/agent/prompts
|
|
4
|
+
*/
|
|
5
|
+
import type { CreateBlock } from "@letta-ai/letta-client/resources/blocks/blocks";
|
|
6
|
+
import { READ_ONLY_BLOCK_LABELS } from "./memory-constants";
|
|
7
|
+
/**
|
|
8
|
+
* The memory block labels every standard (non-MemFS) agent is created with.
|
|
9
|
+
* Each maps to a `<label>.mdx` file in src/agent/prompts. Per-project blocks
|
|
10
|
+
* (skills/loaded_skills) were removed in LET-7353 — skills are now injected
|
|
11
|
+
* via system reminders, leaving only these defaults.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MEMORY_BLOCK_LABELS: readonly ["persona", "human"];
|
|
14
|
+
/**
|
|
15
|
+
* Block labels that should be read-only (agent cannot modify via memory tools).
|
|
16
|
+
*/
|
|
17
|
+
export { READ_ONLY_BLOCK_LABELS };
|
|
18
|
+
/**
|
|
19
|
+
* Parse frontmatter and content from an .mdx file
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseMdxFrontmatter(content: string): {
|
|
22
|
+
frontmatter: Record<string, string>;
|
|
23
|
+
body: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get default starter memory blocks for new agents
|
|
27
|
+
*/
|
|
28
|
+
export declare function getDefaultMemoryBlocks(): Promise<CreateBlock[]>;
|
|
29
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/agent/memory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG5D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,+BAAgC,CAAC;AAEjE;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IACpD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;CACd,CAuBA;AA8CD;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAKrE"}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The static model catalog (models.json) and pure handle resolution.
|
|
3
|
+
*
|
|
4
|
+
* Split from `model.ts` so the catalog can be bundled into the browser-safe
|
|
5
|
+
* `@letta-ai/letta-code/agent-presets` package export without dragging in
|
|
6
|
+
* provider/backend modules. CLI code should keep importing from
|
|
7
|
+
* `@/agent/model`, which re-exports this module.
|
|
8
|
+
*/
|
|
9
|
+
export declare const models: ({
|
|
10
|
+
id: string;
|
|
11
|
+
isDefault: boolean;
|
|
12
|
+
handle: string;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
free: boolean;
|
|
16
|
+
updateArgs: {
|
|
17
|
+
context_window: number;
|
|
18
|
+
max_output_tokens: number;
|
|
19
|
+
parallel_tool_calls: boolean;
|
|
20
|
+
enable_reasoner?: undefined;
|
|
21
|
+
reasoning_effort?: undefined;
|
|
22
|
+
max_reasoning_tokens?: undefined;
|
|
23
|
+
verbosity?: undefined;
|
|
24
|
+
temperature?: undefined;
|
|
25
|
+
};
|
|
26
|
+
isFeatured: boolean;
|
|
27
|
+
shortLabel?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
id: string;
|
|
30
|
+
handle: string;
|
|
31
|
+
label: string;
|
|
32
|
+
description: string;
|
|
33
|
+
free: boolean;
|
|
34
|
+
updateArgs: {
|
|
35
|
+
context_window: number;
|
|
36
|
+
max_output_tokens: number;
|
|
37
|
+
parallel_tool_calls: boolean;
|
|
38
|
+
enable_reasoner?: undefined;
|
|
39
|
+
reasoning_effort?: undefined;
|
|
40
|
+
max_reasoning_tokens?: undefined;
|
|
41
|
+
verbosity?: undefined;
|
|
42
|
+
temperature?: undefined;
|
|
43
|
+
};
|
|
44
|
+
isDefault?: undefined;
|
|
45
|
+
isFeatured?: undefined;
|
|
46
|
+
shortLabel?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
id: string;
|
|
49
|
+
handle: string;
|
|
50
|
+
label: string;
|
|
51
|
+
description: string;
|
|
52
|
+
free: boolean;
|
|
53
|
+
updateArgs: {
|
|
54
|
+
context_window: number;
|
|
55
|
+
max_output_tokens: number;
|
|
56
|
+
parallel_tool_calls: boolean;
|
|
57
|
+
enable_reasoner?: undefined;
|
|
58
|
+
reasoning_effort?: undefined;
|
|
59
|
+
max_reasoning_tokens?: undefined;
|
|
60
|
+
verbosity?: undefined;
|
|
61
|
+
temperature?: undefined;
|
|
62
|
+
};
|
|
63
|
+
isFeatured: boolean;
|
|
64
|
+
isDefault?: undefined;
|
|
65
|
+
shortLabel?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
id: string;
|
|
68
|
+
handle: string;
|
|
69
|
+
label: string;
|
|
70
|
+
description: string;
|
|
71
|
+
isFeatured: boolean;
|
|
72
|
+
updateArgs: {
|
|
73
|
+
context_window: number;
|
|
74
|
+
max_output_tokens: number;
|
|
75
|
+
enable_reasoner: boolean;
|
|
76
|
+
reasoning_effort: string;
|
|
77
|
+
parallel_tool_calls: boolean;
|
|
78
|
+
max_reasoning_tokens?: undefined;
|
|
79
|
+
verbosity?: undefined;
|
|
80
|
+
temperature?: undefined;
|
|
81
|
+
};
|
|
82
|
+
isDefault?: undefined;
|
|
83
|
+
free?: undefined;
|
|
84
|
+
shortLabel?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
id: string;
|
|
87
|
+
handle: string;
|
|
88
|
+
label: string;
|
|
89
|
+
description: string;
|
|
90
|
+
updateArgs: {
|
|
91
|
+
context_window: number;
|
|
92
|
+
max_output_tokens: number;
|
|
93
|
+
enable_reasoner: boolean;
|
|
94
|
+
reasoning_effort: string;
|
|
95
|
+
max_reasoning_tokens: number;
|
|
96
|
+
parallel_tool_calls: boolean;
|
|
97
|
+
verbosity?: undefined;
|
|
98
|
+
temperature?: undefined;
|
|
99
|
+
};
|
|
100
|
+
isDefault?: undefined;
|
|
101
|
+
free?: undefined;
|
|
102
|
+
isFeatured?: undefined;
|
|
103
|
+
shortLabel?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
id: string;
|
|
106
|
+
handle: string;
|
|
107
|
+
label: string;
|
|
108
|
+
description: string;
|
|
109
|
+
updateArgs: {
|
|
110
|
+
context_window: number;
|
|
111
|
+
max_output_tokens: number;
|
|
112
|
+
enable_reasoner: boolean;
|
|
113
|
+
reasoning_effort: string;
|
|
114
|
+
parallel_tool_calls: boolean;
|
|
115
|
+
max_reasoning_tokens?: undefined;
|
|
116
|
+
verbosity?: undefined;
|
|
117
|
+
temperature?: undefined;
|
|
118
|
+
};
|
|
119
|
+
isDefault?: undefined;
|
|
120
|
+
free?: undefined;
|
|
121
|
+
isFeatured?: undefined;
|
|
122
|
+
shortLabel?: undefined;
|
|
123
|
+
} | {
|
|
124
|
+
id: string;
|
|
125
|
+
handle: string;
|
|
126
|
+
label: string;
|
|
127
|
+
shortLabel: string;
|
|
128
|
+
description: string;
|
|
129
|
+
updateArgs: {
|
|
130
|
+
context_window: number;
|
|
131
|
+
max_output_tokens: number;
|
|
132
|
+
max_reasoning_tokens: number;
|
|
133
|
+
parallel_tool_calls: boolean;
|
|
134
|
+
enable_reasoner?: undefined;
|
|
135
|
+
reasoning_effort?: undefined;
|
|
136
|
+
verbosity?: undefined;
|
|
137
|
+
temperature?: undefined;
|
|
138
|
+
};
|
|
139
|
+
isDefault?: undefined;
|
|
140
|
+
free?: undefined;
|
|
141
|
+
isFeatured?: undefined;
|
|
142
|
+
} | {
|
|
143
|
+
id: string;
|
|
144
|
+
handle: string;
|
|
145
|
+
label: string;
|
|
146
|
+
shortLabel: string;
|
|
147
|
+
description: string;
|
|
148
|
+
updateArgs: {
|
|
149
|
+
context_window: number;
|
|
150
|
+
max_output_tokens: number;
|
|
151
|
+
reasoning_effort: string;
|
|
152
|
+
enable_reasoner: boolean;
|
|
153
|
+
parallel_tool_calls: boolean;
|
|
154
|
+
max_reasoning_tokens?: undefined;
|
|
155
|
+
verbosity?: undefined;
|
|
156
|
+
temperature?: undefined;
|
|
157
|
+
};
|
|
158
|
+
isDefault?: undefined;
|
|
159
|
+
free?: undefined;
|
|
160
|
+
isFeatured?: undefined;
|
|
161
|
+
} | {
|
|
162
|
+
id: string;
|
|
163
|
+
handle: string;
|
|
164
|
+
label: string;
|
|
165
|
+
description: string;
|
|
166
|
+
updateArgs: {
|
|
167
|
+
context_window: number;
|
|
168
|
+
max_output_tokens: number;
|
|
169
|
+
parallel_tool_calls: boolean;
|
|
170
|
+
enable_reasoner?: undefined;
|
|
171
|
+
reasoning_effort?: undefined;
|
|
172
|
+
max_reasoning_tokens?: undefined;
|
|
173
|
+
verbosity?: undefined;
|
|
174
|
+
temperature?: undefined;
|
|
175
|
+
};
|
|
176
|
+
isDefault?: undefined;
|
|
177
|
+
free?: undefined;
|
|
178
|
+
isFeatured?: undefined;
|
|
179
|
+
shortLabel?: undefined;
|
|
180
|
+
} | {
|
|
181
|
+
id: string;
|
|
182
|
+
handle: string;
|
|
183
|
+
label: string;
|
|
184
|
+
description: string;
|
|
185
|
+
updateArgs: {
|
|
186
|
+
reasoning_effort: string;
|
|
187
|
+
verbosity: string;
|
|
188
|
+
context_window: number;
|
|
189
|
+
max_output_tokens: number;
|
|
190
|
+
parallel_tool_calls: boolean;
|
|
191
|
+
enable_reasoner?: undefined;
|
|
192
|
+
max_reasoning_tokens?: undefined;
|
|
193
|
+
temperature?: undefined;
|
|
194
|
+
};
|
|
195
|
+
isDefault?: undefined;
|
|
196
|
+
free?: undefined;
|
|
197
|
+
isFeatured?: undefined;
|
|
198
|
+
shortLabel?: undefined;
|
|
199
|
+
} | {
|
|
200
|
+
id: string;
|
|
201
|
+
handle: string;
|
|
202
|
+
label: string;
|
|
203
|
+
description: string;
|
|
204
|
+
isFeatured: boolean;
|
|
205
|
+
updateArgs: {
|
|
206
|
+
reasoning_effort: string;
|
|
207
|
+
verbosity: string;
|
|
208
|
+
context_window: number;
|
|
209
|
+
max_output_tokens: number;
|
|
210
|
+
parallel_tool_calls: boolean;
|
|
211
|
+
enable_reasoner?: undefined;
|
|
212
|
+
max_reasoning_tokens?: undefined;
|
|
213
|
+
temperature?: undefined;
|
|
214
|
+
};
|
|
215
|
+
isDefault?: undefined;
|
|
216
|
+
free?: undefined;
|
|
217
|
+
shortLabel?: undefined;
|
|
218
|
+
} | {
|
|
219
|
+
id: string;
|
|
220
|
+
handle: string;
|
|
221
|
+
label: string;
|
|
222
|
+
description: string;
|
|
223
|
+
updateArgs: {
|
|
224
|
+
reasoning_effort: string;
|
|
225
|
+
verbosity: string;
|
|
226
|
+
context_window: number;
|
|
227
|
+
max_output_tokens: null;
|
|
228
|
+
parallel_tool_calls: boolean;
|
|
229
|
+
enable_reasoner?: undefined;
|
|
230
|
+
max_reasoning_tokens?: undefined;
|
|
231
|
+
temperature?: undefined;
|
|
232
|
+
};
|
|
233
|
+
isDefault?: undefined;
|
|
234
|
+
free?: undefined;
|
|
235
|
+
isFeatured?: undefined;
|
|
236
|
+
shortLabel?: undefined;
|
|
237
|
+
} | {
|
|
238
|
+
id: string;
|
|
239
|
+
handle: string;
|
|
240
|
+
label: string;
|
|
241
|
+
description: string;
|
|
242
|
+
isFeatured: boolean;
|
|
243
|
+
updateArgs: {
|
|
244
|
+
reasoning_effort: string;
|
|
245
|
+
verbosity: string;
|
|
246
|
+
context_window: number;
|
|
247
|
+
max_output_tokens: null;
|
|
248
|
+
parallel_tool_calls: boolean;
|
|
249
|
+
enable_reasoner?: undefined;
|
|
250
|
+
max_reasoning_tokens?: undefined;
|
|
251
|
+
temperature?: undefined;
|
|
252
|
+
};
|
|
253
|
+
isDefault?: undefined;
|
|
254
|
+
free?: undefined;
|
|
255
|
+
shortLabel?: undefined;
|
|
256
|
+
} | {
|
|
257
|
+
id: string;
|
|
258
|
+
handle: string;
|
|
259
|
+
label: string;
|
|
260
|
+
description: string;
|
|
261
|
+
isFeatured: boolean;
|
|
262
|
+
updateArgs: {
|
|
263
|
+
context_window: number;
|
|
264
|
+
parallel_tool_calls: boolean;
|
|
265
|
+
max_output_tokens?: undefined;
|
|
266
|
+
enable_reasoner?: undefined;
|
|
267
|
+
reasoning_effort?: undefined;
|
|
268
|
+
max_reasoning_tokens?: undefined;
|
|
269
|
+
verbosity?: undefined;
|
|
270
|
+
temperature?: undefined;
|
|
271
|
+
};
|
|
272
|
+
isDefault?: undefined;
|
|
273
|
+
free?: undefined;
|
|
274
|
+
shortLabel?: undefined;
|
|
275
|
+
} | {
|
|
276
|
+
id: string;
|
|
277
|
+
handle: string;
|
|
278
|
+
label: string;
|
|
279
|
+
description: string;
|
|
280
|
+
isFeatured: boolean;
|
|
281
|
+
updateArgs: {
|
|
282
|
+
context_window: number;
|
|
283
|
+
max_output_tokens: number;
|
|
284
|
+
parallel_tool_calls: boolean;
|
|
285
|
+
enable_reasoner?: undefined;
|
|
286
|
+
reasoning_effort?: undefined;
|
|
287
|
+
max_reasoning_tokens?: undefined;
|
|
288
|
+
verbosity?: undefined;
|
|
289
|
+
temperature?: undefined;
|
|
290
|
+
};
|
|
291
|
+
isDefault?: undefined;
|
|
292
|
+
free?: undefined;
|
|
293
|
+
shortLabel?: undefined;
|
|
294
|
+
} | {
|
|
295
|
+
id: string;
|
|
296
|
+
handle: string;
|
|
297
|
+
label: string;
|
|
298
|
+
description: string;
|
|
299
|
+
updateArgs: {
|
|
300
|
+
context_window: number;
|
|
301
|
+
parallel_tool_calls: boolean;
|
|
302
|
+
max_output_tokens?: undefined;
|
|
303
|
+
enable_reasoner?: undefined;
|
|
304
|
+
reasoning_effort?: undefined;
|
|
305
|
+
max_reasoning_tokens?: undefined;
|
|
306
|
+
verbosity?: undefined;
|
|
307
|
+
temperature?: undefined;
|
|
308
|
+
};
|
|
309
|
+
isDefault?: undefined;
|
|
310
|
+
free?: undefined;
|
|
311
|
+
isFeatured?: undefined;
|
|
312
|
+
shortLabel?: undefined;
|
|
313
|
+
} | {
|
|
314
|
+
id: string;
|
|
315
|
+
handle: string;
|
|
316
|
+
label: string;
|
|
317
|
+
description: string;
|
|
318
|
+
isFeatured: boolean;
|
|
319
|
+
updateArgs: {
|
|
320
|
+
context_window: number;
|
|
321
|
+
temperature: number;
|
|
322
|
+
parallel_tool_calls: boolean;
|
|
323
|
+
max_output_tokens?: undefined;
|
|
324
|
+
enable_reasoner?: undefined;
|
|
325
|
+
reasoning_effort?: undefined;
|
|
326
|
+
max_reasoning_tokens?: undefined;
|
|
327
|
+
verbosity?: undefined;
|
|
328
|
+
};
|
|
329
|
+
isDefault?: undefined;
|
|
330
|
+
free?: undefined;
|
|
331
|
+
shortLabel?: undefined;
|
|
332
|
+
} | {
|
|
333
|
+
id: string;
|
|
334
|
+
handle: string;
|
|
335
|
+
label: string;
|
|
336
|
+
description: string;
|
|
337
|
+
updateArgs: {
|
|
338
|
+
context_window: number;
|
|
339
|
+
temperature: number;
|
|
340
|
+
parallel_tool_calls: boolean;
|
|
341
|
+
max_output_tokens?: undefined;
|
|
342
|
+
enable_reasoner?: undefined;
|
|
343
|
+
reasoning_effort?: undefined;
|
|
344
|
+
max_reasoning_tokens?: undefined;
|
|
345
|
+
verbosity?: undefined;
|
|
346
|
+
};
|
|
347
|
+
isDefault?: undefined;
|
|
348
|
+
free?: undefined;
|
|
349
|
+
isFeatured?: undefined;
|
|
350
|
+
shortLabel?: undefined;
|
|
351
|
+
})[];
|
|
352
|
+
/**
|
|
353
|
+
* Resolve a model by ID or handle
|
|
354
|
+
* @param modelIdentifier - Can be either a model ID (e.g., "opus-4.5") or a full handle (e.g., "anthropic/claude-opus-4-5")
|
|
355
|
+
* @returns The model handle if found, null otherwise
|
|
356
|
+
*/
|
|
357
|
+
export declare function resolveModel(modelIdentifier: string): string | null;
|
|
358
|
+
/**
|
|
359
|
+
* Get the default model handle
|
|
360
|
+
*/
|
|
361
|
+
export declare function getDefaultModel(): string;
|
|
362
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../src/agent/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAoB,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAcnE;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAaxC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure personality preset definitions and content builders.
|
|
3
|
+
*
|
|
4
|
+
* This module must stay free of Node/backend imports: it is bundled into the
|
|
5
|
+
* browser-safe `@letta-ai/letta-code/agent-presets` package export so that
|
|
6
|
+
* other surfaces (e.g. the chat web app) can build byte-identical agent
|
|
7
|
+
* creation payloads. Filesystem application of personalities lives in
|
|
8
|
+
* `personality.ts`.
|
|
9
|
+
*/
|
|
10
|
+
export interface PersonalityOption {
|
|
11
|
+
id: "blank" | "kawaii" | "codex" | "claude" | "linus" | "memo" | "tutorial";
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
/** Model ID from models.json to use when no explicit model is provided. */
|
|
15
|
+
defaultModel?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const PERSONALITY_OPTIONS: PersonalityOption[];
|
|
18
|
+
export type PersonalityId = PersonalityOption["id"];
|
|
19
|
+
export declare const DEFAULT_CREATE_AGENT_PERSONALITIES: readonly ["memo", "tutorial", "blank", "linus", "kawaii"];
|
|
20
|
+
export type DefaultCreateAgentPersonalityId = (typeof DEFAULT_CREATE_AGENT_PERSONALITIES)[number];
|
|
21
|
+
export interface PersonalityBlockDefinition {
|
|
22
|
+
value: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
templatePromptAssetName: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const ONBOARDING_PERSONALITIES: readonly ["tutorial"];
|
|
27
|
+
export declare function supportsOnboardingBlock(personalityId: PersonalityId): personalityId is (typeof ONBOARDING_PERSONALITIES)[number];
|
|
28
|
+
export declare const FRONTMATTER_REGEX: RegExp;
|
|
29
|
+
export declare function normalizeComparableContent(content: string): string;
|
|
30
|
+
export declare function serializeFrontmatter(frontmatter: Record<string, string>): string;
|
|
31
|
+
export declare function buildDefaultMemoryFile(templatePromptAssetName: string, body: string, description?: string): string;
|
|
32
|
+
export declare function getPersonalityOption(personalityId: PersonalityId): PersonalityOption;
|
|
33
|
+
export declare function resolvePersonalityId(input: string): PersonalityId | null;
|
|
34
|
+
export declare function getPersonalityContent(personalityId: PersonalityId): string;
|
|
35
|
+
export declare function getDefaultHumanContent(): string;
|
|
36
|
+
export declare function getPersonalityHumanContent(personalityId: PersonalityId): string;
|
|
37
|
+
export declare function getPersonalityBlockValues(personalityId: PersonalityId): {
|
|
38
|
+
persona: string;
|
|
39
|
+
human: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function getPersonalityBlockDefinitions(personalityId: PersonalityId): {
|
|
42
|
+
persona: PersonalityBlockDefinition;
|
|
43
|
+
human: PersonalityBlockDefinition;
|
|
44
|
+
onboarding?: PersonalityBlockDefinition;
|
|
45
|
+
};
|
|
46
|
+
export interface PersonalityMemoryBlock {
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build the memory blocks a new agent gets for a personality: the default
|
|
53
|
+
* blocks with persona/human values replaced by the personality's content,
|
|
54
|
+
* plus the onboarding block for personalities that support it.
|
|
55
|
+
*
|
|
56
|
+
* Shared by the CLI create path (`buildCreateAgentOptionsForPersonality`) and
|
|
57
|
+
* the exported wire payload builder (`buildCreateAgentRequestForPersonality`).
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildPersonalityMemoryBlocks(personalityId: PersonalityId, defaultMemoryBlocks: Array<{
|
|
60
|
+
label: string;
|
|
61
|
+
value: string;
|
|
62
|
+
description?: string | null;
|
|
63
|
+
}>): PersonalityMemoryBlock[];
|
|
64
|
+
//# sourceMappingURL=personality-presets.d.ts.map
|