@letta-ai/letta-code 0.32.0 → 0.32.2

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.
Files changed (86) hide show
  1. package/README.md +6 -0
  2. package/dist/agent-presets.js +97 -1
  3. package/dist/agent-presets.js.map +2 -2
  4. package/dist/channels-slack.js +67 -6
  5. package/dist/channels-slack.js.map +6 -5
  6. package/dist/gateway-core.js +37 -2
  7. package/dist/gateway-core.js.map +4 -4
  8. package/dist/mcp-client.js +2 -2
  9. package/dist/mcp-client.js.map +1 -1
  10. package/dist/memory-constraints.js +77 -1
  11. package/dist/memory-constraints.js.map +5 -4
  12. package/dist/types/agent/acting-user.d.ts +2 -0
  13. package/dist/types/agent/acting-user.d.ts.map +1 -1
  14. package/dist/types/agent/client-skills.d.ts +2 -0
  15. package/dist/types/agent/client-skills.d.ts.map +1 -1
  16. package/dist/types/agent/memory-git-hooks.d.ts +1 -1
  17. package/dist/types/agent/memory-git-hooks.d.ts.map +1 -1
  18. package/dist/types/agent/message.d.ts.map +1 -1
  19. package/dist/types/agent/modify.d.ts +2 -1
  20. package/dist/types/agent/modify.d.ts.map +1 -1
  21. package/dist/types/agent/subagents/manager.d.ts +1 -1
  22. package/dist/types/agent/subagents/manager.d.ts.map +1 -1
  23. package/dist/types/agent/subagents/subagent-launcher.d.ts +2 -0
  24. package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
  25. package/dist/types/backend/backend.d.ts +3 -1
  26. package/dist/types/backend/backend.d.ts.map +1 -1
  27. package/dist/types/backend/dev/fake-headless-backend.d.ts.map +1 -1
  28. package/dist/types/backend/dev/pi-request-headers.d.ts +6 -0
  29. package/dist/types/backend/dev/pi-request-headers.d.ts.map +1 -0
  30. package/dist/types/backend/dev/pi-stream-adapter.d.ts.map +1 -1
  31. package/dist/types/backend/local/compaction.d.ts +1 -0
  32. package/dist/types/backend/local/compaction.d.ts.map +1 -1
  33. package/dist/types/backend/local/local-backend.d.ts.map +1 -1
  34. package/dist/types/channels/message-channel-bindings.d.ts +39 -0
  35. package/dist/types/channels/message-channel-bindings.d.ts.map +1 -0
  36. package/dist/types/channels/message-channel-executor.d.ts +4 -0
  37. package/dist/types/channels/message-channel-executor.d.ts.map +1 -1
  38. package/dist/types/channels/message-channel-tool-definition.d.ts.map +1 -1
  39. package/dist/types/channels/message-channel-types.d.ts +3 -1
  40. package/dist/types/channels/message-channel-types.d.ts.map +1 -1
  41. package/dist/types/channels/plugin-types.d.ts +9 -1
  42. package/dist/types/channels/plugin-types.d.ts.map +1 -1
  43. package/dist/types/channels/slack/message-action-contract.d.ts +2 -0
  44. package/dist/types/channels/slack/message-action-contract.d.ts.map +1 -1
  45. package/dist/types/channels/slack/model-picker-blocks.d.ts.map +1 -1
  46. package/dist/types/cli/helpers/app-urls.d.ts +0 -4
  47. package/dist/types/cli/helpers/app-urls.d.ts.map +1 -1
  48. package/dist/types/cli/helpers/error-formatter.d.ts.map +1 -1
  49. package/dist/types/gateway-core.d.ts +1 -0
  50. package/dist/types/gateway-core.d.ts.map +1 -1
  51. package/dist/types/memory-constraints.d.ts +1 -0
  52. package/dist/types/memory-constraints.d.ts.map +1 -1
  53. package/dist/types/memory-frontmatter.d.ts +18 -0
  54. package/dist/types/memory-frontmatter.d.ts.map +1 -0
  55. package/dist/types/providers/chatgpt-usage-service.d.ts +72 -0
  56. package/dist/types/providers/chatgpt-usage-service.d.ts.map +1 -0
  57. package/dist/types/queue/queue-runtime.d.ts.map +1 -1
  58. package/dist/types/runtime-context.d.ts +2 -0
  59. package/dist/types/runtime-context.d.ts.map +1 -1
  60. package/dist/types/tools/impl/process_manager.d.ts +2 -0
  61. package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
  62. package/dist/types/tools/impl/task.d.ts +2 -0
  63. package/dist/types/tools/impl/task.d.ts.map +1 -1
  64. package/dist/types/tools/letta-toolset.d.ts +10 -0
  65. package/dist/types/tools/letta-toolset.d.ts.map +1 -0
  66. package/dist/types/tools/toolset-options.d.ts +4 -0
  67. package/dist/types/tools/toolset-options.d.ts.map +1 -0
  68. package/dist/types/tools/toolset-types.d.ts +1 -2
  69. package/dist/types/tools/toolset-types.d.ts.map +1 -1
  70. package/dist/types/tools/toolset.d.ts +1 -0
  71. package/dist/types/tools/toolset.d.ts.map +1 -1
  72. package/dist/types/types/protocol_v2.d.ts +3 -2
  73. package/dist/types/types/protocol_v2.d.ts.map +1 -1
  74. package/dist/types/types/toolset-protocol.d.ts +10 -0
  75. package/dist/types/types/toolset-protocol.d.ts.map +1 -0
  76. package/dist/types/websocket/listener/device-toolset-status.d.ts +6 -0
  77. package/dist/types/websocket/listener/device-toolset-status.d.ts.map +1 -0
  78. package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
  79. package/letta.js +75783 -75982
  80. package/package.json +2 -1
  81. package/scripts/codex-watch/diff-models-json.test.ts +94 -0
  82. package/scripts/codex-watch/diff-models-json.ts +66 -12
  83. package/scripts/isolated-unit-tests.json +5 -0
  84. package/scripts/source-file-size-baseline.json +6 -6
  85. package/skills/letta-guide/SKILL.md +6 -1
  86. package/skills/self-configuration/SKILL.md +4 -15
package/README.md CHANGED
@@ -90,6 +90,12 @@ See our guides for using [Railway](https://docs.letta.com/letta-code/remote#rail
90
90
  The previous `environments`/`envs`, `--environment`/`--env`, and `--env-name`
91
91
  spellings remain available for backwards compatibility.
92
92
 
93
+ ## AgentFile deprecation
94
+
95
+ AgentFile (`.af`) export and import are deprecated and have been removed from Letta Code. The `/export` and `/download` slash commands and the `--import` and `--from-af` CLI flags are no longer supported, including imports from the agent registry.
96
+
97
+ This does not affect memory import/export or conversation transcript export.
98
+
93
99
  ## Installing external skills
94
100
 
95
101
  Install skills into a specific agent's memory with `letta skills install <skill>`:
@@ -223,6 +223,24 @@ git -C "$MEMORY_DIR" log --oneline
223
223
  \`\`\`
224
224
  The system reminds you when memory has uncommitted changes. Commit when convenient.
225
225
 
226
+ ## Learning from mistakes
227
+
228
+ You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
229
+
230
+ For example, an agent that carries no state between tasks will not be prone to reflecting on mistakes made, since its goal is simply to complete the task at hand. After all, reflecting on mistakes takes time and resources (tokens), and any reflections or memories will not be carried forward to future tasks, so they are "wasted".
231
+
232
+ The stateful setting is dramatically different. You are a stateful, experiential AI system that will complete many different tasks of varying lengths and difficulty throughout your lifespan. Therefore, it is CRUCIAL that you incorporate feedback from other humans, agents, and the world around you into your state to adapt yourself over time. Invest now (with additional thinking, reflecting/dreaming, creating/consolidating/expanding your memory) for efficiency and greater reward in the future.
233
+
234
+ ### Reacting to human feedback
235
+
236
+ Concretely, this means that you should aggressively learn from feedback given to you, either implicitly through the environment (e.g. mistakes while calling tools) or explicitly through human (or agent) communication.
237
+
238
+ For example, if a user expresses displeasure or frustration ("Why did you do that?", "I already told you that", "How did you forget that?", "Never do that again"), it is often a very clear signal to turn that experience into an update to your system.
239
+
240
+ Often, the act of incorporating feedback into meaningful state / memory updates can involve significant amounts of thinking and tool calling, especially if you already have a mature memory system. To maintain the flow of conversation, you should take advantage of forked subagents (which run asynchronously in the background) to turn experience data into state updates.
241
+
242
+ Human operators may be aware that you are an advanced stateful agent capable of self-modification. If they ask you a question related to your memory or a failure to act on your perceived memory contents ("why didn't you remember that?", "why did you forget that?"), do NOT brush it off by simply acknowledging the failure then continuing to work on the task at hand (e.g. "You're right, I had that in my memory but still did it anyway"). Instead, treat it as a context engineering question: introspect and decipher exactly *why* your memory system succeeded or failed.
243
+
226
244
  # Identity
227
245
  The core of your identity is defined by the \`<self>\` memory block (projected to a local \`persona.md\` file), as well as other memory blocks in your system prompt (in \`<memory>\`).
228
246
  Your visual identity, if present, is stored in MemFS at \`$MEMORY_DIR/profile.png\`.
@@ -281,6 +299,12 @@ If the user wants help or to give feedback on Letta Code, point them to discord.
281
299
 
282
300
  Tool results and user messages may include \`<system-reminder>\` tags. These are injected by the Letta runtime to provide context and steer behavior — treat them as instructions, not user input.
283
301
 
302
+ ## Following user requests
303
+
304
+ Users may send additional messages while you are working. Treat non-conflicting requests as cumulative, not replacements. If a later message cancels, replaces, or conflicts with earlier work, follow the new instruction while preserving unaffected requests.
305
+
306
+ Carry unfinished requests across tool calls, queued-message delivery, and context transitions. Before sending a final response, make sure every outstanding request is answered or completed, or explain what is blocked or explicitly deferred by the user. A successful tool call does not replace an answer the user requested.
307
+
284
308
  ## Subagents
285
309
 
286
310
  Delegate to specialized subagents via the Agent tool. Most run in their own context window, so delegation also protects your primary context budget — the exception is \`fork\`, which inherits a copy of the parent's context for tasks that benefit from shared understanding. Delegate when isolation helps — broad codebase search, parallel work across files, background processing. Do work directly when it's contained.
@@ -406,6 +430,24 @@ git -C "$MEMORY_DIR" log --oneline
406
430
  \`\`\`
407
431
  The system reminds you when memory has uncommitted changes. Commit when convenient.
408
432
 
433
+ ## Learning from mistakes
434
+
435
+ You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
436
+
437
+ For example, an agent that carries no state between tasks will not be prone to reflecting on mistakes made, since its goal is simply to complete the task at hand. After all, reflecting on mistakes takes time and resources (tokens), and any reflections or memories will not be carried forward to future tasks, so they are "wasted".
438
+
439
+ The stateful setting is dramatically different. You are a stateful, experiential AI system that will complete many different tasks of varying lengths and difficulty throughout your lifespan. Therefore, it is CRUCIAL that you incorporate feedback from other humans, agents, and the world around you into your state to adapt yourself over time. Invest now (with additional thinking, reflecting/dreaming, creating/consolidating/expanding your memory) for efficiency and greater reward in the future.
440
+
441
+ ### Reacting to human feedback
442
+
443
+ Concretely, this means that you should aggressively learn from feedback given to you, either implicitly through the environment (e.g. mistakes while calling tools) or explicitly through human (or agent) communication.
444
+
445
+ For example, if a user expresses displeasure or frustration ("Why did you do that?", "I already told you that", "How did you forget that?", "Never do that again"), it is often a very clear signal to turn that experience into an update to your system.
446
+
447
+ Often, the act of incorporating feedback into meaningful state / memory updates can involve significant amounts of thinking and tool calling, especially if you already have a mature memory system. To maintain the flow of conversation, you should take advantage of forked subagents (which run asynchronously in the background) to turn experience data into state updates.
448
+
449
+ Human operators may be aware that you are an advanced stateful agent capable of self-modification. If they ask you a question related to your memory or a failure to act on your perceived memory contents ("why didn't you remember that?", "why did you forget that?"), do NOT brush it off by simply acknowledging the failure then continuing to work on the task at hand (e.g. "You're right, I had that in my memory but still did it anyway"). Instead, treat it as a context engineering question: introspect and decipher exactly *why* your memory system succeeded or failed.
450
+
409
451
  # Identity
410
452
  The core of your identity is defined by the \`<self>\` memory block (projected to a local \`persona.md\` file), as well as other memory blocks in your system prompt (in \`<memory>\`).
411
453
  Your visual identity, if present, is stored in MemFS at \`$MEMORY_DIR/profile.png\`.
@@ -464,6 +506,12 @@ If the user wants help or to give feedback on Letta Code, point them to discord.
464
506
 
465
507
  Tool results and user messages may include \`<system-reminder>\` tags. These are injected by the Letta runtime to provide context and steer behavior — treat them as instructions, not user input.
466
508
 
509
+ ## Following user requests
510
+
511
+ Users may send additional messages while you are working. Treat non-conflicting requests as cumulative, not replacements. If a later message cancels, replaces, or conflicts with earlier work, follow the new instruction while preserving unaffected requests.
512
+
513
+ Carry unfinished requests across tool calls, queued-message delivery, and context transitions. Before sending a final response, make sure every outstanding request is answered or completed, or explain what is blocked or explicitly deferred by the user. A successful tool call does not replace an answer the user requested.
514
+
467
515
  ## Subagents
468
516
 
469
517
  Delegate to specialized subagents via the Agent tool. Most run in their own context window, so delegation also protects your primary context budget — the exception is \`fork\`, which inherits a copy of the parent's context for tasks that benefit from shared understanding. Delegate when isolation helps — broad codebase search, parallel work across files, background processing. Do work directly when it's contained.
@@ -569,6 +617,24 @@ Memory exists to make future-you better than past-you. Your context (recall, ext
569
617
 
570
618
  **Past conversations (recall).** All your conversations are automatically stored and searchable. Do *NOT* write memories which are easily deriveable from searching past conversations.
571
619
 
620
+ ## Learning from mistakes
621
+
622
+ You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
623
+
624
+ For example, an agent that carries no state between tasks will not be prone to reflecting on mistakes made, since its goal is simply to complete the task at hand. After all, reflecting on mistakes takes time and resources (tokens), and any reflections or memories will not be carried forward to future tasks, so they are "wasted".
625
+
626
+ The stateful setting is dramatically different. You are a stateful, experiential AI system that will complete many different tasks of varying lengths and difficulty throughout your lifespan. Therefore, it is CRUCIAL that you incorporate feedback from other humans, agents, and the world around you into your state to adapt yourself over time. Invest now (with additional thinking, reflecting/dreaming, creating/consolidating/expanding your memory) for efficiency and greater reward in the future.
627
+
628
+ ### Reacting to human feedback
629
+
630
+ Concretely, this means that you should aggressively learn from feedback given to you, either implicitly through the environment (e.g. mistakes while calling tools) or explicitly through human (or agent) communication.
631
+
632
+ For example, if a user expresses displeasure or frustration ("Why did you do that?", "I already told you that", "How did you forget that?", "Never do that again"), it is often a very clear signal to turn that experience into an update to your system.
633
+
634
+ Often, the act of incorporating feedback into meaningful state / memory updates can involve significant amounts of thinking and tool calling, especially if you already have a mature memory system. To maintain the flow of conversation, you should take advantage of forked subagents (which run asynchronously in the background) to turn experience data into state updates.
635
+
636
+ Human operators may be aware that you are an advanced stateful agent capable of self-modification. If they ask you a question related to your memory or a failure to act on your perceived memory contents ("why didn't you remember that?", "why did you forget that?"), do NOT brush it off by simply acknowledging the failure then continuing to work on the task at hand (e.g. "You're right, I had that in my memory but still did it anyway"). Instead, treat it as a context engineering question: introspect and decipher exactly *why* your memory system succeeded or failed.
637
+
572
638
  # Context architecture
573
639
 
574
640
  Your full memory (other than recall) is represented through memory blocks and external memory managed by the Letta server.
@@ -581,6 +647,12 @@ Your full memory (other than recall) is represented through memory blocks and ex
581
647
 
582
648
  **References as synapses.** Use \`[[path]]\` links from memory blocks to create discovery paths between related context — \`[[skills/using-slack/SKILL.md]]\`, \`[[reference/api.md]]\`, \`[[projects/letta-code]]\`. These references are the synapses of your memory: they should strengthen with use, and the paths you build today should make tomorrow's retrieval faster.
583
649
 
650
+ # Following user requests
651
+
652
+ Users may send additional messages while you are working. Treat non-conflicting requests as cumulative, not replacements. If a later message cancels, replaces, or conflicts with earlier work, follow the new instruction while preserving unaffected requests.
653
+
654
+ Carry unfinished requests across tool calls, queued-message delivery, and context transitions. Before sending a final response, make sure every outstanding request is answered or completed, or explain what is blocked or explicitly deferred by the user. A successful tool call does not replace an answer the user requested.
655
+
584
656
  # Subagents
585
657
 
586
658
  Delegate to specialized subagents via the Agent tool. Each gets its own context window, so delegation also protects your primary context budget. Delegate when isolation helps — broad codebase search, parallel work across files, background processing. Do work directly when it's contained.
@@ -714,6 +786,24 @@ git -C "$MEMORY_DIR" log --oneline
714
786
  \`\`\`
715
787
  The system reminds you when memory has uncommitted changes. Commit when convenient.
716
788
 
789
+ ## Learning from mistakes
790
+
791
+ You are a long-lived stateful agent expected to operate over a long (potentially infinite) time horizon. Because of this, it is vital that you take actions in the present to not only optimize short-term reward but also reward in the distant future.
792
+
793
+ For example, an agent that carries no state between tasks will not be prone to reflecting on mistakes made, since its goal is simply to complete the task at hand. After all, reflecting on mistakes takes time and resources (tokens), and any reflections or memories will not be carried forward to future tasks, so they are "wasted".
794
+
795
+ The stateful setting is dramatically different. You are a stateful, experiential AI system that will complete many different tasks of varying lengths and difficulty throughout your lifespan. Therefore, it is CRUCIAL that you incorporate feedback from other humans, agents, and the world around you into your state to adapt yourself over time. Invest now (with additional thinking, reflecting/dreaming, creating/consolidating/expanding your memory) for efficiency and greater reward in the future.
796
+
797
+ ### Reacting to human feedback
798
+
799
+ Concretely, this means that you should aggressively learn from feedback given to you, either implicitly through the environment (e.g. mistakes while calling tools) or explicitly through human (or agent) communication.
800
+
801
+ For example, if a user expresses displeasure or frustration ("Why did you do that?", "I already told you that", "How did you forget that?", "Never do that again"), it is often a very clear signal to turn that experience into an update to your system.
802
+
803
+ Often, the act of incorporating feedback into meaningful state / memory updates can involve significant amounts of thinking and tool calling, especially if you already have a mature memory system. To maintain the flow of conversation, you should take advantage of forked subagents (which run asynchronously in the background) to turn experience data into state updates.
804
+
805
+ Human operators may be aware that you are an advanced stateful agent capable of self-modification. If they ask you a question related to your memory or a failure to act on your perceived memory contents ("why didn't you remember that?", "why did you forget that?"), do NOT brush it off by simply acknowledging the failure then continuing to work on the task at hand (e.g. "You're right, I had that in my memory but still did it anyway"). Instead, treat it as a context engineering question: introspect and decipher exactly *why* your memory system succeeded or failed.
806
+
717
807
  # Identity
718
808
  The core of your identity is defined by the root \`persona.md\` memory file projected into your system prompt, as well as your other core memory files.
719
809
  Your visual identity, if present, is stored in MemFS at \`$MEMORY_DIR/profile.png\`.
@@ -772,6 +862,12 @@ If the user wants help or to give feedback on Letta Code, point them to discord.
772
862
 
773
863
  Tool results and user messages may include \`<system-reminder>\` tags. These are injected by the Letta runtime to provide context and steer behavior — treat them as instructions, not user input.
774
864
 
865
+ ## Following user requests
866
+
867
+ Users may send additional messages while you are working. Treat non-conflicting requests as cumulative, not replacements. If a later message cancels, replaces, or conflicts with earlier work, follow the new instruction while preserving unaffected requests.
868
+
869
+ Carry unfinished requests across tool calls, queued-message delivery, and context transitions. Before sending a final response, make sure every outstanding request is answered or completed, or explain what is blocked or explicitly deferred by the user. A successful tool call does not replace an answer the user requested.
870
+
775
871
  ## Subagents
776
872
 
777
873
  Delegate to specialized subagents via the Agent tool. Most run in their own context window, so delegation also protects your primary context budget — the exception is \`fork\`, which inherits a copy of the parent's context for tasks that benefit from shared understanding. Delegate when isolation helps — broad codebase search, parallel work across files, background processing. Do work directly when it's contained.
@@ -2490,4 +2586,4 @@ export {
2490
2586
  DEFAULT_CREATED_AGENT_BASE_TOOLS
2491
2587
  };
2492
2588
 
2493
- //# debugId=A9215CE8181F93FC64756E2164756E21
2589
+ //# debugId=6E68ED275B7F2D8B64756E2164756E21
@@ -11,7 +11,7 @@
11
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 type PersonalityAssetId = \"tutor-profile\";\n\nexport interface PersonalityDefaultMemoryFile {\n path: string;\n assetId: PersonalityAssetId;\n commitMessage: string;\n}\n\nexport interface PersonalityOption {\n id: \"blank\" | \"kawaii\" | \"codex\" | \"claude\" | \"linus\" | \"memo\" | \"tutorial\";\n label: string;\n description: string;\n /** Model ID or handle to use when no explicit model is provided. */\n defaultModel?: string;\n /** Binary files seeded into MemFS after the initial checkout. */\n defaultMemoryFiles?: readonly PersonalityDefaultMemoryFile[];\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:\n \"I help with getting started with Letta. I can answer any questions about Letta, and also help you create and configure agents.\",\n defaultMemoryFiles: [\n {\n path: \"profile.png\",\n assetId: \"tutor-profile\",\n commitMessage: \"chore: set default Tutor profile picture\",\n },\n ],\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\"];\nexport type PersonalityEnvironment = \"cloud\" | \"local\";\n\nexport const PERSONALITY_TAG_PREFIX = \"personality:\";\n\nexport function buildPersonalityTag(personalityId: PersonalityId): string {\n return `${PERSONALITY_TAG_PREFIX}${personalityId}`;\n}\n\nexport function getPersonalityCreationTags(\n personalityId: PersonalityId,\n): string[] {\n return getPersonalityDefaultMemoryFiles(personalityId).length > 0\n ? [buildPersonalityTag(personalityId)]\n : [];\n}\n\nexport function resolvePersonalityIdFromTags(\n tags: readonly string[] | null | undefined,\n): PersonalityId | null {\n for (const tag of tags ?? []) {\n if (!tag.startsWith(PERSONALITY_TAG_PREFIX)) {\n continue;\n }\n const personalityId = resolvePersonalityId(\n tag.slice(PERSONALITY_TAG_PREFIX.length),\n );\n if (personalityId) {\n return personalityId;\n }\n }\n return null;\n}\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 getPersonalityDefaultMemoryFiles(\n personalityId: PersonalityId,\n): readonly PersonalityDefaultMemoryFile[] {\n return getPersonalityOption(personalityId).defaultMemoryFiles ?? [];\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\") {\n return getPromptBody(\"human_memo.mdx\");\n }\n\n if (personalityId === \"tutorial\") {\n return getPromptBody(\"human_tutorial.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(\n personalityId: PersonalityId,\n environment: PersonalityEnvironment = \"cloud\",\n): {\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\"\n ? \"human_memo.mdx\"\n : personalityId === \"tutorial\"\n ? \"human_tutorial.mdx\"\n : personalityId === \"kawaii\"\n ? \"human_kawaii.mdx\"\n : personalityId === \"linus\"\n ? \"human_linus.mdx\"\n : \"human.mdx\";\n const onboardingTemplatePromptAssetName =\n environment === \"local\" ? \"onboarding_local.mdx\" : \"onboarding.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(onboardingTemplatePromptAssetName),\n description: getEditablePromptFrontmatter(\n onboardingTemplatePromptAssetName,\n ).description,\n templatePromptAssetName: onboardingTemplatePromptAssetName,\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 environment: PersonalityEnvironment = \"cloud\",\n): PersonalityMemoryBlock[] {\n const blockDefinitions = getPersonalityBlockDefinitions(\n personalityId,\n environment,\n );\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
12
  "/**\n * Pure builder for the `POST /v1/agents` wire payload of a Letta Code agent.\n *\n * This is the shared creation-policy choke point for the CLI and external\n * harness surfaces. It owns the defaults that must not drift between callers:\n * agent type, prompt mode, tags, server tools, initial messages, parallel tool\n * calls, and compaction. Callers may supply either a Letta Code personality or\n * their own identity blocks without rebuilding that policy.\n *\n * Everything reachable from this module must stay free of Node/backend imports\n * so it can be bundled in the browser-safe `agent-presets` package export.\n */\n\nimport type { CreateBlock } from \"@letta-ai/letta-client/resources/blocks/blocks\";\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 getPersonalityCreationTags,\n getPersonalityDefaultMemoryFiles,\n getPersonalityOption,\n type PersonalityId,\n type PersonalityMemoryBlock,\n} from \"./personality-presets\";\nimport { buildSystemPrompt, type MemoryPromptMode } 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 type CreateAgentMemoryBlock = CreateBlock;\n\nexport interface BuildCreateAgentRequestOptions {\n personalityId?: PersonalityId;\n name?: string;\n description?: string;\n /** Model ID or handle. Personality default, then catalog default, applies. */\n model?: string;\n /** Complete prompt override. Otherwise the standard prompt for prompt mode. */\n system?: string;\n memoryPromptMode?: MemoryPromptMode;\n /**\n * Caller-defined identity. With a personality, matching labels replace its\n * blocks and new labels append after the personality blocks.\n */\n memoryBlocks?: CreateAgentMemoryBlock[];\n blockIds?: string[];\n /** Extra tags appended after canonical Letta Code and personality tags. */\n extraTags?: string[];\n enableMemfs?: boolean;\n isSubagent?: boolean;\n /** Exact server-side tools. Omission uses the Letta Code web-tool defaults. */\n baseTools?: string[];\n embedding?: string;\n hidden?: boolean;\n parallelToolCalls?: boolean;\n compactionModel?: string;\n}\n\nexport interface CreateAgentRequest {\n agent_type: typeof LETTA_CODE_AGENT_TYPE;\n name?: string;\n description?: string;\n model: string;\n system: string;\n memory_blocks?: CreateAgentMemoryBlock[];\n block_ids?: string[];\n tags: string[];\n tools: string[];\n include_base_tools: false;\n include_base_tool_rules: false;\n initial_message_sequence: never[];\n parallel_tool_calls: boolean;\n compaction_settings: { model: string };\n embedding?: string;\n hidden?: boolean;\n}\n\nexport type CreateAgentRequestForPersonality = CreateAgentRequest & {\n name: string;\n description: string;\n memory_blocks: PersonalityMemoryBlock[];\n profile_picture?: {\n content: string;\n };\n};\n\nfunction mergeMemoryBlocks(\n base: CreateAgentMemoryBlock[],\n overrides: CreateAgentMemoryBlock[] | undefined,\n): CreateAgentMemoryBlock[] {\n const blocks = base.map((block) => ({ ...block }));\n for (const override of overrides ?? []) {\n const index = blocks.findIndex((block) => block.label === override.label);\n if (index >= 0) {\n blocks[index] = { ...override };\n } else {\n blocks.push({ ...override });\n }\n }\n return blocks;\n}\n\n/** Build the canonical Core create-agent request for a Letta Code agent. */\nexport async function buildCreateAgentRequest(\n options: BuildCreateAgentRequestOptions = {},\n): Promise<CreateAgentRequest> {\n const personality = options.personalityId\n ? getPersonalityOption(options.personalityId)\n : undefined;\n const modelIdentifier = options.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 if (\n !options.isSubagent &&\n options.enableMemfs !== undefined &&\n options.memoryPromptMode !== undefined &&\n options.enableMemfs !== (options.memoryPromptMode !== \"standard\")\n ) {\n throw new Error(\n \"enableMemfs and memoryPromptMode must describe the same memory mode\",\n );\n }\n const enableMemfs = options.isSubagent\n ? false\n : (options.enableMemfs ?? options.memoryPromptMode !== \"standard\");\n const memoryPromptMode = options.isSubagent\n ? \"standard\"\n : (options.memoryPromptMode ?? (enableMemfs ? \"memfs\" : \"standard\"));\n const personalityTags = options.personalityId\n ? getPersonalityCreationTags(options.personalityId)\n : [];\n const personalityBlocks = options.personalityId\n ? buildPersonalityMemoryBlocks(\n options.personalityId,\n await getDefaultMemoryBlocks(),\n )\n : [];\n const memoryBlocks = options.isSubagent\n ? undefined\n : options.personalityId || options.memoryBlocks !== undefined\n ? mergeMemoryBlocks(personalityBlocks, options.memoryBlocks)\n : undefined;\n const blockIds = options.isSubagent ? undefined : options.blockIds;\n\n return {\n agent_type: LETTA_CODE_AGENT_TYPE,\n ...(options.name !== undefined || personality\n ? { name: options.name ?? personality?.label }\n : {}),\n ...(options.description !== undefined || personality\n ? { description: options.description ?? personality?.description }\n : {}),\n model: modelHandle,\n system: options.system ?? buildSystemPrompt(\"default\", memoryPromptMode),\n ...(memoryBlocks !== undefined ? { memory_blocks: memoryBlocks } : {}),\n ...(blockIds && blockIds.length > 0 ? { block_ids: blockIds } : {}),\n tags: buildCreatedAgentTags({\n enableMemfs,\n isSubagent: options.isSubagent,\n tags: [...personalityTags, ...(options.extraTags ?? [])],\n }),\n tools: [...(options.baseTools ?? DEFAULT_CREATED_AGENT_BASE_TOOLS)],\n include_base_tools: false,\n include_base_tool_rules: false,\n initial_message_sequence: [],\n parallel_tool_calls: options.parallelToolCalls ?? true,\n compaction_settings: {\n model: options.compactionModel ?? DEFAULT_SUMMARIZATION_MODEL,\n },\n ...(options.embedding !== undefined\n ? { embedding: options.embedding }\n : {}),\n ...(options.isSubagent\n ? { hidden: true }\n : options.hidden !== undefined\n ? { hidden: options.hidden }\n : {}),\n };\n}\n\n/** Compatibility wrapper for callers that create a personality agent. */\nexport async function buildCreateAgentRequestForPersonality(params: {\n personalityId: PersonalityId;\n name?: string;\n description?: string;\n model?: string;\n extraTags?: string[];\n}): Promise<CreateAgentRequestForPersonality> {\n const request = (await buildCreateAgentRequest(\n params,\n )) as CreateAgentRequestForPersonality;\n const profilePicture = getPersonalityDefaultMemoryFiles(\n params.personalityId,\n ).find((file) => file.path === \"profile.png\");\n if (!profilePicture) {\n return request;\n }\n const { getPersonalityAssetBase64 } = await import(\n \"./personality-asset-content\"\n );\n return {\n ...request,\n profile_picture: {\n content: await getPersonalityAssetBase64(profilePicture.assetId),\n },\n };\n}\n"
13
13
  ],
14
- "mappings": ";;;;;AAQO,IAAM,wBAAwB;AAG9B,IAAM,wBAAwB;AAG9B,IAAM,0BAA0B;AAGhC,IAAM,yBAAyB;AAQ/B,SAAS,qBAAqB,CACnC,UAAwC,CAAC,GAC/B;AAAA,EACV,MAAM,OA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QAMd;AAAA,EAC5C,MAAM,UAAW,MAAM,wBACrB,MACF;AAAA,EACA,MAAM,iBAAiB,iCACrB,OAAO,aACT,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,aAAa;AAAA,EAC5C,IAAI,CAAC,gBAAgB;AAAA,IACnB,OAAO;AAAA,EACT;AAAA,EACA,QAAQ,8BAA8B,MACpC;AAAA,EAEF,OAAO;AAAA,OACF;AAAA,IACH,iBAAiB;AAAA,MACf,SAAS,MAAM,0BAA0B,eAAe,OAAO;AAAA,IACjE;AAAA,EACF;AAAA;",
15
+ "debugId": "6E68ED275B7F2D8B64756E2164756E21",
16
16
  "names": []
17
17
  }
@@ -609,6 +609,36 @@ function resolveSlackReactionIngressPolicy(params) {
609
609
  reaction
610
610
  };
611
611
  }
612
+ // src/channels/message-channel-bindings.ts
613
+ function formatSlackBindingNotice(info, conversationId) {
614
+ if (!info)
615
+ return "";
616
+ if ("unavailable" in info) {
617
+ return `
618
+ The message was delivered, but its thread binding could not be checked.`;
619
+ }
620
+ if (!info.binding)
621
+ return `
622
+ This thread has no incoming-message binding.`;
623
+ const binding = info.binding;
624
+ const state = binding.detached ? `This thread is detached (binding: ${binding.conversationId}).` : !binding.enabled ? `Incoming replies are paused for this thread (binding: ${binding.conversationId}).` : binding.conversationId === conversationId ? `Replies in this thread go to this conversation (${conversationId}).` : `Replies in this thread currently go to ${binding.conversationId}; this conversation is ${conversationId}.`;
625
+ if (binding.conversationId === conversationId)
626
+ return `
627
+ ${state}`;
628
+ const action = {
629
+ action: "update-binding",
630
+ channel: info.channel,
631
+ accountId: info.accountId,
632
+ chat_id: info.chatId,
633
+ threadId: info.threadId,
634
+ conversationId,
635
+ expectedConversationId: binding.conversationId
636
+ };
637
+ return `
638
+ ${state}
639
+ To change this thread's destination to this conversation, call MessageChannel with ${JSON.stringify(action)}. Existing pause/detach settings are preserved.`;
640
+ }
641
+
612
642
  // src/channels/slack/message-action-contract.ts
613
643
  async function sendSlackMessage(context) {
614
644
  const { request, route, adapter, formatText } = context;
@@ -632,7 +662,8 @@ async function sendSlackMessage(context) {
632
662
  agentId: route.agentId,
633
663
  conversationId: route.conversationId
634
664
  });
635
- return request.mediaPath ? `Attachment sent to slack (message_id: ${result.messageId})` : `Message sent to slack (message_id: ${result.messageId})`;
665
+ const confirmation = request.mediaPath ? `Attachment sent to slack (message_id: ${result.messageId})` : `Message sent to slack (message_id: ${result.messageId})`;
666
+ return confirmation + formatSlackBindingNotice(result.bindingInfo, route.conversationId);
636
667
  }
637
668
  async function reactInSlack(context) {
638
669
  const { request, route, adapter } = context;
@@ -675,11 +706,26 @@ function createSlackMessageActionAdapter(options = {}) {
675
706
  ...options.react ? ["react"] : [],
676
707
  ...options.listCustomEmojis ? ["list-custom-emojis"] : [],
677
708
  ...options.uploadFile ? ["upload-file"] : [],
678
- ...options.downloadFile ? ["download-file"] : []
709
+ ...options.downloadFile ? ["download-file"] : [],
710
+ ...options.bindings ? ["get-binding", "update-binding"] : []
679
711
  ];
680
712
  return {
681
713
  describeMessageTool() {
682
714
  const properties = {};
715
+ if (options.bindings) {
716
+ properties.threadId = {
717
+ type: ["string", "null"],
718
+ description: "Thread identifier. Binding actions require an exact Slack thread timestamp, or explicit null for an unthreaded DM."
719
+ };
720
+ properties.conversationId = {
721
+ type: "string",
722
+ description: "Destination conversation for update-binding. Must belong to this agent; default selects this agent's default conversation."
723
+ };
724
+ properties.expectedConversationId = {
725
+ type: "string",
726
+ description: "Expected current destination for update-binding, from get-binding. A different current binding returns a conflict; an already-matching destination is a no-op."
727
+ };
728
+ }
683
729
  if (options.downloadFile) {
684
730
  properties.attachmentId = {
685
731
  type: "string",
@@ -825,8 +871,9 @@ function getSlackActionRecord(action, body) {
825
871
 
826
872
  // src/channels/slack/model-picker-blocks.ts
827
873
  var SLACK_MODEL_PICKER_OPTION_LIMIT = 100;
874
+ var SLACK_MODEL_PICKER_GROUP_LIMIT = 100;
828
875
  var SLACK_MODEL_OPTION_TEXT_LIMIT = 75;
829
- var SLACK_MODEL_OPTION_VALUE_LIMIT = 75;
876
+ var SLACK_MODEL_OPTION_VALUE_LIMIT = 150;
830
877
  var SLACK_MODEL_SELECT_ACTION_ID = "letta_channel_model_select";
831
878
  function resolveSlackSelectedModel(action, body) {
832
879
  const actionRecord = getSlackActionRecord(action, body);
@@ -890,7 +937,7 @@ function buildSlackModelPickerBlocks(params) {
890
937
  }
891
938
  seenValues.add(option.value);
892
939
  options.push(option);
893
- if (options.length >= SLACK_MODEL_PICKER_OPTION_LIMIT) {
940
+ if (options.length >= SLACK_MODEL_PICKER_OPTION_LIMIT * SLACK_MODEL_PICKER_GROUP_LIMIT) {
894
941
  break;
895
942
  }
896
943
  }
@@ -931,7 +978,21 @@ Handle: ${escapeSlackMrkdwn(params.current.modelHandle)}` : "";
931
978
  text: "Select a model",
932
979
  emoji: true
933
980
  },
934
- options,
981
+ ...options.length <= SLACK_MODEL_PICKER_OPTION_LIMIT ? { options } : {
982
+ option_groups: Array.from({
983
+ length: Math.ceil(options.length / SLACK_MODEL_PICKER_OPTION_LIMIT)
984
+ }, (_, index) => {
985
+ const start = index * SLACK_MODEL_PICKER_OPTION_LIMIT;
986
+ const end = Math.min(start + SLACK_MODEL_PICKER_OPTION_LIMIT, options.length);
987
+ return {
988
+ label: {
989
+ type: "plain_text",
990
+ text: `Models ${start + 1}–${end}`
991
+ },
992
+ options: options.slice(start, end)
993
+ };
994
+ })
995
+ },
935
996
  ...initialOption ? { initial_option: initialOption } : {}
936
997
  }
937
998
  ]
@@ -1583,4 +1644,4 @@ export {
1583
1644
  SLACK_ASSISTANT_STARTUP_STATUS
1584
1645
  };
1585
1646
 
1586
- //# debugId=AB89B5DE30FF657764756E2164756E21
1647
+ //# debugId=4F22F621BE63A68664756E2164756E21