@desplega.ai/agent-swarm 1.120.0 → 1.121.1

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 (149) hide show
  1. package/README.md +2 -2
  2. package/dist/{actions-rym7jyg2.js → actions-99h2dh5e.js} +6 -6
  3. package/dist/{anthropic-messages-qjxzsabf.js → anthropic-messages-4gn944cn.js} +29 -13
  4. package/dist/{app-ss3a0nfj.js → app-9gfdk9me.js} +4 -4
  5. package/dist/{assistant-8sd2b21b.js → assistant-mabq9kz7.js} +13 -13
  6. package/dist/{azure-openai-responses-ntfd05zd.js → azure-openai-responses-79zc0wyy.js} +28 -13
  7. package/dist/{boot-reembed-7bs0d0sj.js → boot-reembed-3vr2amzp.js} +5 -5
  8. package/dist/{boot-reembed-eh18r04f.js → boot-reembed-ya33nge3.js} +4 -4
  9. package/dist/{boot-scrub-logs-v8ch000n.js → boot-scrub-logs-2nmz7fzw.js} +4 -4
  10. package/dist/{claude-adapter-9n3nzt65.js → claude-adapter-vxvcym3r.js} +3 -3
  11. package/dist/{claude-managed-adapter-pv2nbqy4.js → claude-managed-adapter-g807894s.js} +2 -2
  12. package/dist/{cli-sbh0b9r1.js → cli-02m8v96c.js} +5 -4
  13. package/dist/{cli-branks1w.js → cli-16dv125e.js} +28 -3
  14. package/dist/{cli-383wyw2f.js → cli-2846g99z.js} +61 -17
  15. package/dist/cli-3dpj7atn.js +11 -0
  16. package/dist/{cli-w6rhc30s.js → cli-3jrdwnn9.js} +20 -5
  17. package/dist/{cli-kyfx7z3d.js → cli-3t4nvx1x.js} +4 -4
  18. package/dist/{cli-2r7s8jhp.js → cli-5c4327dx.js} +7 -1
  19. package/dist/{cli-84j2vp67.js → cli-5jd04m23.js} +1 -1
  20. package/dist/{cli-d2eyq90a.js → cli-7bk7s2sx.js} +1 -1
  21. package/dist/{cli-qs7nb3zn.js → cli-8wrympd7.js} +27 -1
  22. package/dist/{cli-0ap79nha.js → cli-9hewdgzb.js} +5 -5
  23. package/dist/{cli-wr706gez.js → cli-av2s7my4.js} +167 -66
  24. package/dist/{cli-zxnp21rf.js → cli-avxs2rp9.js} +18 -15
  25. package/dist/{cli-1arw00dp.js → cli-ccjwgarc.js} +12 -3
  26. package/dist/{cli-pscrc6tw.js → cli-ch7t5v7n.js} +5 -0
  27. package/dist/{cli-tghre7g6.js → cli-cw70hymf.js} +1 -0
  28. package/dist/{cli-gq12jc1m.js → cli-dn5ycmtw.js} +7 -5
  29. package/dist/{cli-kyqs14qe.js → cli-dwqakg2b.js} +5 -5
  30. package/dist/{cli-py8z9bjq.js → cli-e0zbndab.js} +9 -9
  31. package/dist/{cli-zxeb2qe3.js → cli-fxdhzkqx.js} +1 -1
  32. package/dist/{cli-f6c6y7fw.js → cli-gahmct71.js} +2 -2
  33. package/dist/{cli-n745f8e5.js → cli-kwjx3f1v.js} +1 -1
  34. package/dist/{cli-0kkggfr9.js → cli-kx7vsvg0.js} +2 -2
  35. package/dist/{cli-t91zbm2s.js → cli-msyrqt1f.js} +59 -22
  36. package/dist/{cli-shdvvj0n.js → cli-ng0gr9rz.js} +2 -2
  37. package/dist/{cli-th08nm8p.js → cli-p8qcm631.js} +1 -1
  38. package/dist/{cli-gad984jj.js → cli-qfh6pmvm.js} +1 -1
  39. package/dist/{cli-v65h59hn.js → cli-rjn06qph.js} +1 -1
  40. package/dist/{cli-xeatwfbe.js → cli-ry656xem.js} +24 -17
  41. package/dist/cli-s8s499xy.js +81 -0
  42. package/dist/{cli-n61x2aph.js → cli-vh3h1grg.js} +826 -1336
  43. package/dist/{cli-vmhqfnp1.js → cli-w4crd8gx.js} +2 -2
  44. package/dist/{cli-mg280wsv.js → cli-we156bmz.js} +1 -1
  45. package/dist/{cli-e0y603nn.js → cli-x0e0yvnq.js} +101 -1
  46. package/dist/{cli-mw3xpgwb.js → cli-x4apc9t3.js} +4 -4
  47. package/dist/{cli-dnx98dwa.js → cli-yhwn2vjm.js} +38185 -38141
  48. package/dist/{cli-j59bj3vs.js → cli-yy9sm7c1.js} +8 -8
  49. package/dist/{cli-4cb3p8pj.js → cli-yyqpn0gc.js} +2 -2
  50. package/dist/{cli-w5em21am.js → cli-zm78xp1y.js} +3 -3
  51. package/dist/{cli-da3x3btq.js → cli-zweca3q3.js} +4 -3
  52. package/dist/cli.js +23 -21
  53. package/dist/{codex-adapter-6j2b38tg.js → codex-adapter-0kv2meed.js} +9 -9
  54. package/dist/{codex-session-runner-vz215wgw.js → codex-session-runner-m1e1v4r0.js} +9 -9
  55. package/dist/{commands-w1swgcgg.js → commands-hty4156r.js} +3 -3
  56. package/dist/{db-yv6y0fxw.js → db-kyeq3t7h.js} +5 -3
  57. package/dist/{google-generative-ai-n1d3xt4n.js → google-generative-ai-wwa2ked5.js} +14 -18
  58. package/dist/{google-vertex-mxst23gy.js → google-vertex-71xmdd7n.js} +14 -18
  59. package/dist/{handlers-yjyafdwk.js → handlers-fxvqnp6s.js} +13 -13
  60. package/dist/{hook-6nvc6p19.js → hook-j4ksm2fy.js} +8 -8
  61. package/dist/{http-g6j8rc6h.js → http-m7fq6kbc.js} +143 -64
  62. package/dist/{index-7betnvg6.js → index-62g7ym5y.js} +9 -9
  63. package/dist/{index-b2rarbkn.js → index-mbaa4yn7.js} +12 -11
  64. package/dist/{index-64th6eqs.js → index-r2tmg4ts.js} +11 -10
  65. package/dist/{index-cbknx39k.js → index-rqxt0515.js} +13 -12
  66. package/dist/{keepalive-j8c99r3m.js → keepalive-acgfgbk8.js} +6 -6
  67. package/dist/{lead-8xe71m3s.js → lead-r3pnbky3.js} +31 -31
  68. package/dist/{maintenance-eqnmrwb2.js → maintenance-4tqr6va0.js} +5 -5
  69. package/dist/{mistral-conversations-ykcg66za.js → mistral-conversations-26ya4yah.js} +17 -13
  70. package/dist/{oauth-refresh-sweep-c5dy1653.js → oauth-refresh-sweep-5714hq77.js} +6 -6
  71. package/dist/{onboard-4avg01c1.js → onboard-s5x8zjqd.js} +2 -2
  72. package/dist/{openai-codex-responses-zy0907j9.js → openai-codex-responses-6rr2ye0s.js} +78 -38
  73. package/dist/{openai-completions-xk4p56n9.js → openai-completions-zfa9nkvt.js} +130 -33
  74. package/dist/{openai-responses-4gv3ca5d.js → openai-responses-9wmdks0g.js} +38 -14
  75. package/dist/{opencode-adapter-5bwzvbwj.js → opencode-adapter-s3nhtp9m.js} +5 -2
  76. package/dist/{openrouter-images-4fsrrzes.js → openrouter-images-dgq98729.js} +10 -3
  77. package/dist/{otel-impl-z4cwkp40.js → otel-impl-8g0741yr.js} +4 -4
  78. package/dist/{pi-messages-zb8v76wx.js → pi-messages-nzjbbz47.js} +4 -6
  79. package/dist/{pi-mono-adapter-9sg69kg3.js → pi-mono-adapter-k3z6e5fn.js} +5666 -4521
  80. package/dist/{pricing-refresh-dts9429d.js → pricing-refresh-09ty42xr.js} +5 -5
  81. package/dist/{rbac-roles-4f64wch6.js → rbac-roles-2hjvj3q0.js} +4 -4
  82. package/dist/{rbac-roles-24cvsejy.js → rbac-roles-q38w8rne.js} +3 -3
  83. package/dist/{seed-pricing-74ph9wap.js → seed-pricing-wzx03625.js} +4 -4
  84. package/dist/{setup-9q0n8rvd.js → setup-4hmnc9fz.js} +2 -2
  85. package/dist/{worker-x7g344z8.js → worker-efef96pc.js} +31 -31
  86. package/openapi.json +169 -85
  87. package/package.json +7 -5
  88. package/plugin/commands/swarm-chat.md +2 -0
  89. package/plugin/pi-skills/swarm-chat/SKILL.md +2 -0
  90. package/src/be/db.ts +61 -5
  91. package/src/be/memory/constants.ts +7 -6
  92. package/src/be/memory/graph-expansion.ts +3 -3
  93. package/src/be/memory/raters/llm-summarizer.ts +10 -2
  94. package/src/be/migrations/119_agent_avatar.sql +7 -0
  95. package/src/be/migrations/120_task_title.sql +3 -0
  96. package/src/be/scripts/typecheck.ts +3 -2
  97. package/src/be/seed-capabilities.ts +62 -0
  98. package/src/be/seed-pricing.ts +1 -1
  99. package/src/be/seed-scripts/catalog/ops-catalog-audit.inline.ts +1 -1
  100. package/src/be/seed-scripts/catalog/ops-catalog-audit.ts +1 -1
  101. package/src/commands/provider-credentials.ts +2 -1
  102. package/src/commands/runner.ts +69 -6
  103. package/src/http/agents.ts +23 -5
  104. package/src/http/core.ts +8 -5
  105. package/src/http/index.ts +11 -0
  106. package/src/http/mcp-bridge.ts +5 -2
  107. package/src/http/memory.ts +2 -1
  108. package/src/http/poll.ts +5 -1
  109. package/src/http/sessions.ts +1 -1
  110. package/src/http/tasks.ts +35 -0
  111. package/src/prompts/base-prompt.ts +48 -4
  112. package/src/prompts/session-templates.ts +13 -1
  113. package/src/providers/claude-managed-models.ts +8 -0
  114. package/src/providers/codex-adapter.ts +3 -0
  115. package/src/providers/opencode-adapter.ts +40 -0
  116. package/src/providers/pi-mono-adapter.ts +179 -1
  117. package/src/providers/pi-mono-extension.ts +9 -0
  118. package/src/scripts-runtime/types/stdlib.d.ts +11 -0
  119. package/src/server.ts +230 -126
  120. package/src/tests/agent-avatar-resolution.test.ts +293 -0
  121. package/src/tests/agents-list-model-display.test.ts +10 -0
  122. package/src/tests/base-prompt.test.ts +72 -0
  123. package/src/tests/claude-managed-adapter.test.ts +6 -0
  124. package/src/tests/context-window.test.ts +1 -0
  125. package/src/tests/list-endpoint-slimming.test.ts +45 -0
  126. package/src/tests/memory-feature-flags.test.ts +45 -0
  127. package/src/tests/memory-rater-llm-summarizer.test.ts +24 -0
  128. package/src/tests/opencode-plugin.test.ts +43 -0
  129. package/src/tests/openrouter-base-url.test.ts +256 -0
  130. package/src/tests/pi-mono-adapter.test.ts +90 -0
  131. package/src/tests/prompt-template-session.test.ts +6 -5
  132. package/src/tests/script-connections.test.ts +1 -0
  133. package/src/tests/sdk-allowlist.test.ts +4 -1
  134. package/src/tests/seed-capabilities.test.ts +92 -0
  135. package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
  136. package/src/tests/sessions.test.ts +46 -0
  137. package/src/tests/task-title-route.test.ts +106 -0
  138. package/src/tests/tool-annotations.test.ts +6 -3
  139. package/src/tools/memory-search.ts +2 -1
  140. package/src/tools/update-profile.ts +15 -5
  141. package/src/types.ts +29 -0
  142. package/src/utils/context-window.ts +1 -0
  143. package/src/utils/internal-ai/complete-structured.ts +19 -1
  144. package/src/utils/internal-ai/summarize-session.ts +7 -0
  145. package/src/utils/openrouter-base-url.ts +28 -0
  146. package/src/workflows/executors/raw-llm.ts +2 -1
  147. package/src/workflows/executors/validate.ts +2 -1
  148. package/dist/cli-z9gzq07x.js +0 -27
  149. package/dist/{otel-g299k41b.js → otel-63jr5v38.js} +1 -1
@@ -2,6 +2,14 @@ import {
2
2
  deriveProviderFromKeyType,
3
3
  init_credentials
4
4
  } from "./cli-z2zcxes1.js";
5
+ import {
6
+ init_package,
7
+ package_default
8
+ } from "./cli-dn5ycmtw.js";
9
+ import {
10
+ init_secret_scrubber,
11
+ scrubSecrets
12
+ } from "./cli-4j2mrzag.js";
5
13
  import {
6
14
  init_zod
7
15
  } from "./cli-bw80ck94.js";
@@ -23,14 +31,6 @@ import {
23
31
  unknown,
24
32
  uuid
25
33
  } from "./cli-xz9aq0rf.js";
26
- import {
27
- init_package,
28
- package_default
29
- } from "./cli-gq12jc1m.js";
30
- import {
31
- init_secret_scrubber,
32
- scrubSecrets
33
- } from "./cli-4j2mrzag.js";
34
34
  import {
35
35
  __commonJS,
36
36
  __esm,
@@ -803,7 +803,7 @@ function resolveTaskModelSelection(opts) {
803
803
  function isTerminalTaskStatus(status) {
804
804
  return TERMINAL_TASK_STATUSES.includes(status);
805
805
  }
806
- var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, TaskAttachmentKindSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, RetryPolicySchema, ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
806
+ var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, TaskAttachmentKindSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AgentSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, RetryPolicySchema, ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
807
807
  var init_types = __esm(() => {
808
808
  init_zod();
809
809
  init_key();
@@ -968,6 +968,7 @@ var init_types = __esm(() => {
968
968
  agentId: uuid().nullable(),
969
969
  creatorAgentId: uuid().optional(),
970
970
  task: string().min(1),
971
+ title: string().optional(),
971
972
  status: AgentTaskStatusSchema,
972
973
  source: AgentTaskSourceSchema.default("mcp"),
973
974
  taskType: string().max(50).optional(),
@@ -1166,6 +1167,13 @@ var init_types = __esm(() => {
1166
1167
  createdAt: string()
1167
1168
  });
1168
1169
  AgentStatusSchema = _enum(["idle", "busy", "offline", "waiting_for_credentials"]);
1170
+ AgentAvatarSchema = discriminatedUnion("type", [
1171
+ object({
1172
+ type: literal("lucide"),
1173
+ icon: string().regex(/^[a-z0-9-]+$/).max(64),
1174
+ color: string().regex(/^#[0-9a-fA-F]{6}$/).optional()
1175
+ })
1176
+ ]);
1169
1177
  AgentSchema = object({
1170
1178
  id: uuid(),
1171
1179
  name: string().min(1),
@@ -1187,6 +1195,7 @@ var init_types = __esm(() => {
1187
1195
  harnessProvider: ProviderNameSchema.nullable().optional(),
1188
1196
  credentialMissing: array(string()).nullable().optional(),
1189
1197
  credStatus: lazy(() => AgentCredStatusSchema).nullable().optional(),
1198
+ avatar: lazy(() => AgentAvatarSchema).nullable().optional(),
1190
1199
  createdAt: exports_iso.datetime().default(() => new Date().toISOString()),
1191
1200
  lastUpdatedAt: exports_iso.datetime().default(() => new Date().toISOString())
1192
1201
  });
@@ -3078,7 +3087,6 @@ As a worker agent of the swarm, you are responsible for executing tasks assigned
3078
3087
 
3079
3088
  - \`store-progress\`: Save your work progress on tasks (critical!)
3080
3089
  - \`task-action\`: Manage tasks - claim from pool, release, accept/reject offered tasks
3081
- - \`read-messages\`: Read messages from the lead or other workers
3082
3090
 
3083
3091
  #### Completing Tasks
3084
3092
 
@@ -3108,6 +3116,18 @@ curl -H "Authorization: Bearer lin_oauth_abc123..." https://api.example.com
3108
3116
  \`\`\`
3109
3117
 
3110
3118
  The same applies to \`store-progress\` output — never include raw secret values in progress text, output, or failure reasons.
3119
+ `,
3120
+ variables: [],
3121
+ category: "system"
3122
+ });
3123
+ registerTemplate({
3124
+ eventType: "system.agent.messaging",
3125
+ header: "",
3126
+ defaultBody: `
3127
+ #### Swarm Messaging
3128
+
3129
+ - \`post-message\`: Post a message to a swarm channel (use \`mentions\` to notify specific agents, \`replyTo\` to thread)
3130
+ - \`read-messages\`: Read messages from the lead or other agents (filters: \`unreadOnly\`, \`mentionsOnly\`)
3111
3131
  `,
3112
3132
  variables: [],
3113
3133
  category: "system"
@@ -4417,6 +4437,7 @@ __export(exports_db, {
4417
4437
  updateWorkflow: () => updateWorkflow,
4418
4438
  updateUser: () => updateUser,
4419
4439
  updateTaskVcs: () => updateTaskVcs,
4440
+ updateTaskTitle: () => updateTaskTitle,
4420
4441
  updateTaskProgress: () => updateTaskProgress,
4421
4442
  updateTaskClaudeSessionId: () => updateTaskClaudeSessionId,
4422
4443
  updateSwarmRepo: () => updateSwarmRepo,
@@ -5035,6 +5056,16 @@ function seedContextVersions() {
5035
5056
  }
5036
5057
  }
5037
5058
  }
5059
+ function parseAgentAvatar(raw) {
5060
+ if (!raw)
5061
+ return null;
5062
+ try {
5063
+ const parsed = AgentAvatarSchema.safeParse(JSON.parse(raw));
5064
+ return parsed.success ? parsed.data : null;
5065
+ } catch {
5066
+ return null;
5067
+ }
5068
+ }
5038
5069
  function rowToAgent(row, slim = false) {
5039
5070
  const base = {
5040
5071
  id: row.id,
@@ -5052,7 +5083,8 @@ function rowToAgent(row, slim = false) {
5052
5083
  createdAt: row.createdAt,
5053
5084
  lastUpdatedAt: row.lastUpdatedAt,
5054
5085
  credentialMissing: row.credentialMissing ? JSON.parse(row.credentialMissing) : null,
5055
- credStatus: row.cred_status ? JSON.parse(row.cred_status) : null
5086
+ credStatus: row.cred_status ? JSON.parse(row.cred_status) : null,
5087
+ avatar: parseAgentAvatar(row.avatar)
5056
5088
  };
5057
5089
  if (slim)
5058
5090
  return base;
@@ -5279,6 +5311,7 @@ function rowToAgentTask(row) {
5279
5311
  agentId: row.agentId,
5280
5312
  creatorAgentId: row.creatorAgentId ?? undefined,
5281
5313
  task: row.task,
5314
+ title: row.title ?? undefined,
5282
5315
  status: row.status,
5283
5316
  source: row.source,
5284
5317
  taskType: row.taskType ?? undefined,
@@ -5353,6 +5386,7 @@ function rowToAgentTaskSummary(row) {
5353
5386
  agentId: t.agentId,
5354
5387
  creatorAgentId: t.creatorAgentId,
5355
5388
  task: previewText(t.task, TASK_PREVIEW_LENGTH),
5389
+ title: t.title,
5356
5390
  status: t.status,
5357
5391
  source: t.source,
5358
5392
  taskType: t.taskType,
@@ -5535,6 +5569,11 @@ function updateTaskClaudeSessionId(taskId, claudeSessionId, provider, providerMe
5535
5569
  const row = getDb().prepare(`UPDATE agent_tasks SET ${setClauses.join(", ")} WHERE id = ? RETURNING *`).get(...params);
5536
5570
  return row ? rowToAgentTask(row) : null;
5537
5571
  }
5572
+ function updateTaskTitle(taskId, title) {
5573
+ const normalized = title === null ? null : title.trim() || null;
5574
+ const row = getDb().prepare("UPDATE agent_tasks SET title = ? WHERE id = ? RETURNING *").get(normalized, taskId);
5575
+ return row ? rowToAgentTask(row) : null;
5576
+ }
5538
5577
  function updateTaskVcs(taskId, vcs) {
5539
5578
  const row = getDb().prepare(`UPDATE agent_tasks
5540
5579
  SET vcsProvider = ?, vcsRepo = ?, vcsNumber = ?, vcsUrl = ?, lastUpdatedAt = ?
@@ -7182,6 +7221,8 @@ function updateAgentProfile(id, updates, meta) {
7182
7221
  previousVersionId: latestVersion?.id ?? null
7183
7222
  });
7184
7223
  }
7224
+ const avatarProvided = Object.hasOwn(updates, "avatar");
7225
+ const avatarJson = updates.avatar ? JSON.stringify(updates.avatar) : null;
7185
7226
  const now = new Date().toISOString();
7186
7227
  const row = database.prepare(`UPDATE agents SET
7187
7228
  description = COALESCE(?, description),
@@ -7193,8 +7234,9 @@ function updateAgentProfile(id, updates, meta) {
7193
7234
  setupScript = COALESCE(?, setupScript),
7194
7235
  toolsMd = COALESCE(?, toolsMd),
7195
7236
  heartbeatMd = COALESCE(?, heartbeatMd),
7237
+ avatar = CASE WHEN ? = 1 THEN ? ELSE avatar END,
7196
7238
  lastUpdatedAt = ?
7197
- WHERE id = ? RETURNING *`).get(updates.description ?? null, updates.role ?? null, updates.capabilities ? JSON.stringify(updates.capabilities) : null, updates.claudeMd ?? null, updates.soulMd ?? null, updates.identityMd ?? null, updates.setupScript ?? null, updates.toolsMd ?? null, updates.heartbeatMd ?? null, now, id);
7239
+ WHERE id = ? RETURNING *`).get(updates.description ?? null, updates.role ?? null, updates.capabilities ? JSON.stringify(updates.capabilities) : null, updates.claudeMd ?? null, updates.soulMd ?? null, updates.identityMd ?? null, updates.setupScript ?? null, updates.toolsMd ?? null, updates.heartbeatMd ?? null, avatarProvided ? 1 : 0, avatarJson, now, id);
7198
7240
  return row ? rowToAgent(row) : null;
7199
7241
  })();
7200
7242
  }
@@ -10762,8 +10804,9 @@ function listRecentSessions(opts) {
10762
10804
  params.push(...sources);
10763
10805
  }
10764
10806
  if (q && q.length > 0) {
10765
- conditions.push("lower(r.task) LIKE ?");
10766
- params.push(`%${q.toLowerCase()}%`);
10807
+ conditions.push("(lower(r.task) LIKE ? OR lower(COALESCE(r.title, '')) LIKE ?)");
10808
+ const like = `%${q.toLowerCase()}%`;
10809
+ params.push(like, like);
10767
10810
  }
10768
10811
  if (requestedByUserId) {
10769
10812
  conditions.push("r.requestedByUserId = ?");
@@ -10835,8 +10878,9 @@ function countSessions(opts) {
10835
10878
  params.push(...sources);
10836
10879
  }
10837
10880
  if (q && q.length > 0) {
10838
- conditions.push("lower(task) LIKE ?");
10839
- params.push(`%${q.toLowerCase()}%`);
10881
+ conditions.push("(lower(task) LIKE ? OR lower(COALESCE(title, '')) LIKE ?)");
10882
+ const like = `%${q.toLowerCase()}%`;
10883
+ params.push(like, like);
10840
10884
  }
10841
10885
  if (requestedByUserId) {
10842
10886
  conditions.push("requestedByUserId = ?");
@@ -11517,4 +11561,4 @@ var init_db = __esm(() => {
11517
11561
  };
11518
11562
  });
11519
11563
 
11520
- export { normalizeAssetKey, parseAssetKey, canWriteAssetKey, init_key, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, initTelemetry, telemetry, init_telemetry, AssetKeySchema, AssetEntityTypeSchema, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getAssetKeyMappingByProvider, upsertAssetKeyMapping, getAssetKeyMapping, listAssetSummaries, moveAssetKey, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listFavorites, listUserFavorites, getFavoriteItemIdSet, setFavorite, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
11564
+ export { normalizeAssetKey, parseAssetKey, canWriteAssetKey, init_key, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, initTelemetry, telemetry, init_telemetry, AssetKeySchema, AssetEntityTypeSchema, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentAvatarSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskTitle, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getAssetKeyMappingByProvider, upsertAssetKeyMapping, getAssetKeyMapping, listAssetSummaries, moveAssetKey, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listFavorites, listUserFavorites, getFavoriteItemIdSet, setFavorite, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
@@ -0,0 +1,11 @@
1
+ // src/utils/openrouter-base-url.ts
2
+ var DEFAULT_OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
3
+ function getOpenRouterBaseUrl(env = process.env) {
4
+ const raw = env.OPENROUTER_BASE_URL;
5
+ if (typeof raw === "string" && raw.trim().length > 0) {
6
+ return raw.trim().replace(/\/+$/, "");
7
+ }
8
+ return DEFAULT_OPENROUTER_BASE_URL;
9
+ }
10
+
11
+ export { DEFAULT_OPENROUTER_BASE_URL, getOpenRouterBaseUrl };
@@ -1,14 +1,15 @@
1
+ import {
2
+ import_websocket
3
+ } from "./cli-4w4fmq9x.js";
1
4
  import {
2
5
  require_ecdsa_sig_formatter,
3
6
  require_jws,
4
7
  require_p_retry
5
8
  } from "./cli-b0p7rfnd.js";
6
9
  import {
7
- import_websocket
8
- } from "./cli-4w4fmq9x.js";
9
- import {
10
+ resolveJsonSchemaStrictSampling,
10
11
  transformMessages
11
- } from "./cli-e0y603nn.js";
12
+ } from "./cli-x0e0yvnq.js";
12
13
  import {
13
14
  sanitizeSurrogates
14
15
  } from "./cli-y2apkfe2.js";
@@ -25227,6 +25228,10 @@ function convertTools(tools, useParameters = false) {
25227
25228
  }
25228
25229
  ];
25229
25230
  }
25231
+ function supportsGoogleStrictToolSampling(modelId) {
25232
+ const majorVersion = getGeminiMajorVersion(modelId);
25233
+ return majorVersion !== undefined && majorVersion >= 3;
25234
+ }
25230
25235
  function mapToolChoice(choice) {
25231
25236
  switch (choice) {
25232
25237
  case "auto":
@@ -25239,6 +25244,16 @@ function mapToolChoice(choice) {
25239
25244
  return FunctionCallingConfigMode.AUTO;
25240
25245
  }
25241
25246
  }
25247
+ function resolveGoogleFunctionCallingMode(tools, toolChoice, supportsStrictMode) {
25248
+ const useStrictMode = tools.some((tool) => resolveJsonSchemaStrictSampling(tool, supportsStrictMode) === true);
25249
+ if (toolChoice === "none" || toolChoice === "any") {
25250
+ return mapToolChoice(toolChoice);
25251
+ }
25252
+ if (useStrictMode) {
25253
+ return FunctionCallingConfigMode.VALIDATED;
25254
+ }
25255
+ return toolChoice ? mapToolChoice(toolChoice) : undefined;
25256
+ }
25242
25257
  function mapStopReason(reason) {
25243
25258
  switch (reason) {
25244
25259
  case FinishReason.STOP:
@@ -25268,4 +25283,4 @@ function mapStopReason(reason) {
25268
25283
  }
25269
25284
  }
25270
25285
 
25271
- export { ThinkingLevel, ResourceScope, GoogleGenAI, isThinkingPart, retainThoughtSignature, convertMessages, convertTools, mapToolChoice, mapStopReason };
25286
+ export { ThinkingLevel, ResourceScope, GoogleGenAI, isThinkingPart, retainThoughtSignature, convertMessages, convertTools, supportsGoogleStrictToolSampling, resolveGoogleFunctionCallingMode, mapStopReason };
@@ -4,15 +4,15 @@ import {
4
4
  handleScheduleTrigger,
5
5
  runScript,
6
6
  startWorkflowExecution
7
- } from "./cli-zxnp21rf.js";
7
+ } from "./cli-avxs2rp9.js";
8
8
  import {
9
9
  getScript,
10
10
  getScriptApiConnectionDescriptors,
11
11
  getScriptMcpConnectionDescriptors
12
- } from "./cli-py8z9bjq.js";
12
+ } from "./cli-e0zbndab.js";
13
13
  import {
14
14
  createTaskWithSiblingAwareness
15
- } from "./cli-th08nm8p.js";
15
+ } from "./cli-p8qcm631.js";
16
16
  import {
17
17
  getDb,
18
18
  getDueScheduledTasks,
@@ -24,7 +24,7 @@ import {
24
24
  scheduleContextKey,
25
25
  telemetry,
26
26
  updateScheduledTask
27
- } from "./cli-383wyw2f.js";
27
+ } from "./cli-2846g99z.js";
28
28
  import {
29
29
  __commonJS,
30
30
  __require,
@@ -15,7 +15,7 @@ import {
15
15
  clampContextPercent,
16
16
  computeContextUsedUnified,
17
17
  getContextWindowSize
18
- } from "./cli-tghre7g6.js";
18
+ } from "./cli-cw70hymf.js";
19
19
  import {
20
20
  init_secret_scrubber,
21
21
  scrubSecrets
@@ -26,6 +26,12 @@ init_secret_scrubber();
26
26
 
27
27
  // src/providers/claude-managed-models.ts
28
28
  var CLAUDE_MANAGED_MODEL_PRICING = {
29
+ "claude-opus-5": {
30
+ inputPerMillion: 5,
31
+ outputPerMillion: 25,
32
+ cacheReadPerMillion: 0.5,
33
+ cacheWritePerMillion: 6.25
34
+ },
29
35
  "claude-fable-5": {
30
36
  inputPerMillion: 10,
31
37
  outputPerMillion: 50,
@@ -7,7 +7,7 @@ import {
7
7
  init_date_utils,
8
8
  init_db,
9
9
  normalizeDateRequired
10
- } from "./cli-383wyw2f.js";
10
+ } from "./cli-2846g99z.js";
11
11
 
12
12
  // src/be/db-queries/oauth.ts
13
13
  init_crypto();
@@ -4,7 +4,7 @@ import {
4
4
  incrKv,
5
5
  init_db,
6
6
  upsertKv
7
- } from "./cli-383wyw2f.js";
7
+ } from "./cli-2846g99z.js";
8
8
 
9
9
  // src/be/users.ts
10
10
  init_db();
@@ -73,4 +73,30 @@ function createAssistantMessageEventStream() {
73
73
  return new AssistantMessageEventStream;
74
74
  }
75
75
 
76
- export { EventStream, AssistantMessageEventStream, createAssistantMessageEventStream };
76
+ // node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js
77
+ function formatThrownValue(value) {
78
+ if (value instanceof Error)
79
+ return value.message || value.name;
80
+ if (typeof value === "string")
81
+ return value;
82
+ return String(value);
83
+ }
84
+ function extractDiagnosticError(error) {
85
+ if (!(error instanceof Error))
86
+ return { name: "ThrownValue", message: formatThrownValue(error) };
87
+ const code = error.code;
88
+ return {
89
+ name: error.name || undefined,
90
+ message: error.message || error.name,
91
+ stack: error.stack,
92
+ code: typeof code === "string" || typeof code === "number" ? code : undefined
93
+ };
94
+ }
95
+ function createAssistantMessageDiagnostic(type, error, details) {
96
+ return { type, timestamp: Date.now(), error: extractDiagnosticError(error), details };
97
+ }
98
+ function appendAssistantMessageDiagnostic(message, diagnostic) {
99
+ message.diagnostics = [...message.diagnostics ?? [], diagnostic];
100
+ }
101
+
102
+ export { EventStream, AssistantMessageEventStream, createAssistantMessageEventStream, formatThrownValue, extractDiagnosticError, createAssistantMessageDiagnostic, appendAssistantMessageDiagnostic };
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-383wyw2f.js";
9
+ } from "./cli-2846g99z.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -22,12 +22,12 @@ function numEnv(key, fallback) {
22
22
  return Number.isNaN(parsed) ? fallback : parsed;
23
23
  }
24
24
  function isHybridSearchEnabled() {
25
- const val = process.env.MEMORY_HYBRID_SEARCH ?? "0";
26
- return val === "1" || val.toLowerCase() === "true";
25
+ const val = process.env.MEMORY_HYBRID_SEARCH?.trim().toLowerCase();
26
+ return val !== "0" && val !== "false";
27
27
  }
28
28
  function isGraphExpansionEnabled() {
29
- const val = process.env.MEMORY_GRAPH_EXPANSION ?? "0";
30
- return val === "1" || val.toLowerCase() === "true";
29
+ const val = process.env.MEMORY_GRAPH_EXPANSION?.trim().toLowerCase();
30
+ return val !== "0" && val !== "false";
31
31
  }
32
32
  var TTL_DEFAULTS, GLOBAL_HALF_LIFE_OVERRIDE, GLOBAL_HALF_LIFE, RECENCY_DECAY_HALF_LIFE, RECENCY_DECAY_HALF_LIFE_DAYS, SOURCE_QUALITY_MULTIPLIER, MIN_SIMILARITY, ACCESS_BOOST_MAX_MULTIPLIER, ACCESS_BOOST_RECENCY_WINDOW_HOURS, CANDIDATE_SET_MULTIPLIER, EMBEDDING_DIMENSIONS, DEFAULT_EMBEDDING_MODEL = "openai/text-embedding-3-small", PROTECTED_SOURCES;
33
33
  var init_constants = __esm(() => {