@desplega.ai/agent-swarm 1.105.0 → 1.107.0

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 (181) hide show
  1. package/README.md +3 -2
  2. package/dist/{actions-45g8tvc8.js → actions-q3hcb6ea.js} +7 -7
  3. package/dist/{anthropic-messages-8q7p5vyq.js → anthropic-messages-8nc6r2dw.js} +10 -4
  4. package/dist/{app-18x5k1cj.js → app-4r3mstc2.js} +3 -3
  5. package/dist/{assistant-ka281qe8.js → assistant-a6vp3nv8.js} +10 -10
  6. package/dist/{azure-openai-responses-0dmr2hzc.js → azure-openai-responses-6yfzw3qw.js} +10 -18
  7. package/dist/{boot-reembed-f38vbxw8.js → boot-reembed-cnsk021h.js} +3 -3
  8. package/dist/{boot-reembed-rp2gba79.js → boot-reembed-gaxjq6ds.js} +4 -4
  9. package/dist/{boot-scrub-logs-nsnc9f1a.js → boot-scrub-logs-sm0m581p.js} +2 -2
  10. package/dist/{claude-adapter-e3dhkq85.js → claude-adapter-hw0wsvpj.js} +3 -2
  11. package/dist/{claude-managed-adapter-z29hjgzz.js → claude-managed-adapter-vj9kzegz.js} +4 -4
  12. package/dist/{claude-managed-setup-ftbmvmvx.js → claude-managed-setup-yhbcx0bz.js} +2 -2
  13. package/dist/{cli-92fqyjcv.js → cli-07er7wrs.js} +1 -1
  14. package/dist/{cli-vpwffend.js → cli-2yn35y8c.js} +5 -4
  15. package/dist/{cli-0s37sw3k.js → cli-3jcx2wmm.js} +1 -1
  16. package/dist/{cli-p04j6hjv.js → cli-4r9m8f3t.js} +11 -2
  17. package/dist/{cli-87fj1jk4.js → cli-4rx7v585.js} +1 -1
  18. package/dist/{cli-4df7btj0.js → cli-5nt81kzd.js} +1 -1
  19. package/dist/{cli-c4h8m0m3.js → cli-5s8hgqmd.js} +1 -1
  20. package/dist/{cli-gzmv1371.js → cli-61hj3yzp.js} +5 -5
  21. package/dist/{cli-7b9ctyfq.js → cli-8da61htc.js} +1 -1
  22. package/dist/{cli-0e24r2b6.js → cli-8p36pjyp.js} +346 -201
  23. package/dist/{cli-sm9yseh1.js → cli-938phztx.js} +1 -1
  24. package/dist/{cli-yfyqsqzj.js → cli-9xjc8dt2.js} +1 -1
  25. package/dist/{cli-4wmnp8q3.js → cli-amncg1dq.js} +108 -21
  26. package/dist/{cli-yzr0qxx1.js → cli-awqz8v9k.js} +101 -43
  27. package/dist/{cli-ncg70f07.js → cli-bk526b46.js} +30 -4
  28. package/dist/{cli-2q1ct4en.js → cli-bsyka9ta.js} +104 -3
  29. package/dist/{cli-ehcjr5vs.js → cli-ccre5q9r.js} +9 -7
  30. package/dist/{cli-ba47wf2q.js → cli-f8cdgmdk.js} +3 -3
  31. package/dist/{cli-zmta7t3y.js → cli-heavyg0w.js} +4 -4
  32. package/dist/{cli-dd6tegmp.js → cli-hn38x1bp.js} +2 -2
  33. package/dist/{cli-p03mawph.js → cli-hr69yv51.js} +929 -336
  34. package/dist/{cli-yp2krx5r.js → cli-jk4tj5m6.js} +9 -3
  35. package/dist/{cli-v2fb1fxf.js → cli-kgr1cazt.js} +1105 -18
  36. package/dist/{cli-0n4xxmy0.js → cli-n4qvvhy0.js} +1 -1
  37. package/dist/cli-pscrc6tw.js +73 -0
  38. package/dist/{cli-2hg6bj31.js → cli-r0nfastp.js} +64 -30
  39. package/dist/{cli-634jy7sa.js → cli-rpjrpkzy.js} +1 -1
  40. package/dist/{cli-0fxvpa2q.js → cli-sdpnhajn.js} +150 -163
  41. package/dist/{cli-yd29d4n4.js → cli-t6r1ex00.js} +2 -2
  42. package/dist/{cli-8y7y1vmp.js → cli-t7cyte2g.js} +2 -2
  43. package/dist/{cli-7esh9fda.js → cli-tda8d5q0.js} +2 -2
  44. package/dist/{cli-0k9dc6ks.js → cli-tghre7g6.js} +1 -0
  45. package/dist/cli-tkmm5nf9.js +4178 -0
  46. package/dist/{cli-wztagmpk.js → cli-wb4j4tfe.js} +98 -15
  47. package/dist/{cli-khe4x17a.js → cli-wnkwyhmw.js} +35 -16
  48. package/dist/{cli-sdf2qwkt.js → cli-xaht317v.js} +548 -152
  49. package/dist/{cli-jntqphs0.js → cli-ygcrdkqt.js} +15 -9
  50. package/dist/{cli-2957pqpj.js → cli-yv9dttkh.js} +32 -9
  51. package/dist/cli.js +22 -19
  52. package/dist/{codex-adapter-w0xharsg.js → codex-adapter-wer4en6f.js} +9 -6
  53. package/dist/{codex-login-27ea9qfw.js → codex-login-4sywkz6v.js} +1 -1
  54. package/dist/{codex-session-runner-kzbjcm2k.js → codex-session-runner-b199pwwr.js} +7 -6
  55. package/dist/{commands-tn8zj0an.js → commands-ys948zs2.js} +2 -2
  56. package/dist/{db-gtqymk7r.js → db-sy3tqg9d.js} +4 -2
  57. package/dist/{google-generative-ai-mdn340ga.js → google-generative-ai-rf42vj2h.js} +9 -4
  58. package/dist/{google-vertex-mkdewpwe.js → google-vertex-m92pj5fb.js} +9 -4
  59. package/dist/{handlers-5xdqk40d.js → handlers-h9vh0t22.js} +10 -10
  60. package/dist/{hook-gj6j6zwj.js → hook-06rfe1bc.js} +4 -4
  61. package/dist/{http-4pceba9h.js → http-fk80h22g.js} +710 -140
  62. package/dist/{index-as4evz9g.js → index-0krvvan6.js} +9 -10
  63. package/dist/{index-paaw4xt5.js → index-40wjvdfg.js} +12 -14
  64. package/dist/index-bb95344w.js +30 -0
  65. package/dist/{index-wf0q4k03.js → index-pq2d08xe.js} +10 -6
  66. package/dist/{keepalive-akbzjt41.js → keepalive-np0ham11.js} +4 -4
  67. package/dist/{lead-g8v85nf4.js → lead-gf7sa5vn.js} +28 -28
  68. package/dist/{maintenance-9yrzmrh8.js → maintenance-38n2z7p9.js} +4 -4
  69. package/dist/{mistral-conversations-j380wd2q.js → mistral-conversations-26yrnbf1.js} +2 -2
  70. package/dist/{onboard-v5bx0kpy.js → onboard-63r24gwq.js} +2 -2
  71. package/dist/{openai-codex-responses-v80z7kgx.js → openai-codex-responses-8h6kvfv8.js} +16 -25
  72. package/dist/{openai-completions-39vefwrq.js → openai-completions-x6kjnqjd.js} +11 -5
  73. package/dist/{openai-responses-dp5bkm3q.js → openai-responses-7jwyz3ds.js} +8 -16
  74. package/dist/{opencode-adapter-s8vsmzpy.js → opencode-adapter-5jxw9cv8.js} +3 -2
  75. package/dist/{openrouter-images-54cva05t.js → openrouter-images-537nmn1r.js} +5 -1
  76. package/dist/{otel-impl-530442da.js → otel-impl-18fxmezz.js} +1 -1
  77. package/dist/{pi-mono-adapter-zf7dt1wg.js → pi-mono-adapter-5bbyymfw.js} +615 -304
  78. package/dist/{pricing-refresh-dt289v11.js → pricing-refresh-x7b6rjxy.js} +4 -4
  79. package/dist/{seed-pricing-183er9b3.js → seed-pricing-8hdb1xyg.js} +3 -3
  80. package/dist/{setup-tjgsvznx.js → setup-prqde3h7.js} +2 -2
  81. package/dist/{worker-nxcxk5pb.js → worker-34hev47c.js} +28 -28
  82. package/openapi.json +575 -7
  83. package/package.json +9 -7
  84. package/src/be/db.ts +115 -10
  85. package/src/be/memory/access.ts +5 -0
  86. package/src/be/migrations/102_script_apis.sql +31 -0
  87. package/src/be/migrations/103_schedule_target_type.sql +79 -0
  88. package/src/be/migrations/104_task_reasoning_effort.sql +1 -0
  89. package/src/be/modelsdev-cache.json +22170 -7247
  90. package/src/be/scripts/db.ts +214 -1
  91. package/src/be/seed-pricing.ts +1 -1
  92. package/src/commands/claude-managed-setup.ts +1 -1
  93. package/src/commands/provider-credentials.ts +10 -1
  94. package/src/commands/runner.ts +57 -2
  95. package/src/heartbeat/heartbeat.ts +8 -1
  96. package/src/hooks/tool-loop-detection.test.ts +81 -1
  97. package/src/hooks/tool-loop-detection.ts +53 -10
  98. package/src/http/agents.ts +76 -16
  99. package/src/http/index.ts +13 -1
  100. package/src/http/mcp.ts +49 -0
  101. package/src/http/memory.ts +21 -11
  102. package/src/http/oauth-locks.ts +90 -0
  103. package/src/http/schedules.ts +102 -61
  104. package/src/http/scripts.ts +213 -0
  105. package/src/http/stats.ts +6 -0
  106. package/src/http/tasks.ts +3 -0
  107. package/src/http/x.ts +244 -0
  108. package/src/prompts/session-templates.ts +5 -1
  109. package/src/providers/claude-adapter.ts +13 -0
  110. package/src/providers/claude-managed-models.ts +9 -0
  111. package/src/providers/codex-adapter.ts +75 -11
  112. package/src/providers/codex-oauth/auth-json-fs.ts +9 -1
  113. package/src/providers/codex-oauth/auth-json.ts +24 -2
  114. package/src/providers/codex-oauth/storage.ts +184 -23
  115. package/src/providers/modelsdev-reasoning.json +4034 -0
  116. package/src/providers/opencode-adapter.ts +38 -1
  117. package/src/providers/pi-mono-adapter.ts +21 -3
  118. package/src/providers/reasoning-effort.ts +299 -0
  119. package/src/providers/types.ts +18 -0
  120. package/src/scheduler/index.ts +8 -1
  121. package/src/scheduler/scheduler.test.ts +1 -0
  122. package/src/scheduler/scheduler.ts +144 -53
  123. package/src/server.ts +2 -0
  124. package/src/tests/agents-harness-provider.test.ts +294 -0
  125. package/src/tests/agents-list-model-display.test.ts +12 -0
  126. package/src/tests/bedrock-model-groups.test.ts +3 -0
  127. package/src/tests/claude-adapter.test.ts +65 -1
  128. package/src/tests/claude-managed-adapter.test.ts +14 -0
  129. package/src/tests/claude-managed-setup.test.ts +3 -3
  130. package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +406 -0
  131. package/src/tests/codex-adapter.test.ts +40 -0
  132. package/src/tests/codex-oauth-refresh-lock.test.ts +321 -0
  133. package/src/tests/codex-oauth-storage.test.ts +20 -1
  134. package/src/tests/context-window.test.ts +1 -0
  135. package/src/tests/credential-status-routing.test.ts +57 -0
  136. package/src/tests/harness-provider-resolution.test.ts +39 -0
  137. package/src/tests/heartbeat.test.ts +17 -0
  138. package/src/tests/http-api-integration.test.ts +1 -1
  139. package/src/tests/mcp-user-route.test.ts +70 -5
  140. package/src/tests/memory-get-tool.test.ts +132 -0
  141. package/src/tests/memory-http-recall-gating.test.ts +17 -1
  142. package/src/tests/migration-046-budgets.test.ts +32 -0
  143. package/src/tests/model-control.test.ts +136 -0
  144. package/src/tests/opencode-adapter.test.ts +55 -0
  145. package/src/tests/pi-mono-adapter.test.ts +68 -2
  146. package/src/tests/preload.ts +26 -0
  147. package/src/tests/reasoning-effort.test.ts +203 -0
  148. package/src/tests/register-service-security.test.ts +194 -0
  149. package/src/tests/schedule-target-type.test.ts +472 -0
  150. package/src/tests/script-apis-mcp.test.ts +308 -0
  151. package/src/tests/scripts-external-api.test.ts +449 -0
  152. package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
  153. package/src/tests/update-profile-auth.test.ts +35 -1
  154. package/src/tests/workflow-agent-task.test.ts +2 -0
  155. package/src/tools/memory-get.ts +17 -2
  156. package/src/tools/register-service.ts +68 -4
  157. package/src/tools/schedules/create-schedule.ts +85 -4
  158. package/src/tools/schedules/update-schedule.ts +81 -2
  159. package/src/tools/script-apis.ts +158 -0
  160. package/src/tools/script-common.ts +1 -1
  161. package/src/tools/send-task.ts +8 -0
  162. package/src/tools/task-action.ts +5 -0
  163. package/src/tools/tool-config.ts +2 -1
  164. package/src/tools/update-profile.ts +84 -1
  165. package/src/types.ts +67 -2
  166. package/src/utils/context-window.ts +1 -0
  167. package/src/utils/harness-provider.ts +35 -6
  168. package/src/utils/short-id.ts +44 -0
  169. package/src/workflows/executors/agent-task.ts +8 -1
  170. package/templates/community/code-health-reports/run.sh +12 -6
  171. package/templates/community/dora-metrics/run.sh +10 -2
  172. package/templates/official/coder/start-up.sh +2 -2
  173. package/templates/official/content-reviewer/start-up.sh +2 -2
  174. package/templates/official/content-strategist/start-up.sh +2 -2
  175. package/templates/official/content-writer/start-up.sh +2 -2
  176. package/templates/official/discoverability-optimizer/start-up.sh +2 -2
  177. package/templates/official/ux-principles/start-up.sh +5 -5
  178. package/templates/skills/swarm-scripts/SKILL.md +4 -0
  179. package/templates/skills/swarm-scripts/content.md +4 -0
  180. package/dist/cli-gq7gvvrn.js +0 -1112
  181. package/dist/index-0rfp6wh2.js +0 -21
package/README.md CHANGED
@@ -126,11 +126,12 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
126
126
  - **Hybrid memory recall + in-place edits** — memory retrieval can blend vector and full-text ranking, and agents can correct an existing memory without losing its ID or history. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools#memory-tools)
127
127
  - **Multi-channel inputs** — Slack, GitHub, GitLab, email, WhatsApp, Linear, Jira, and the HTTP API all create tasks. [Integrations](#integrations)
128
128
  - **Workflow engine with Human-in-the-Loop** — DAG-based automation with approval gates, retries, and structured I/O. [Workflows →](https://docs.agent-swarm.dev/docs/concepts/workflows)
129
- - **Scheduled & recurring tasks** — cron-based automation for standing work. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
129
+ - **Scheduled & recurring tasks** — cron-based automation for standing work, with schedules that can target agent tasks, workflows, or catalog scripts. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
130
130
  - **Durable script workflows** — launch background script runs, inspect their journals, and track them from the dashboard when a one-shot `script-run` is too small. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-workflow-runs)
131
+ - **Scripts as external APIs** — expose a saved script as a public `POST /api/x/script/<id>` endpoint with optional bearer auth, typed input validation, and per-endpoint usage tracking. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-external-apis)
131
132
  - **Typed script API connections** — lead-managed OpenAPI connections let scripts call approved external APIs through generated `ctx.api.*` clients while credential bindings keep raw secrets out of source and args. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-credential-broker)
132
133
  - **E2B-backed eval harness** — run a scenario × harness-config matrix against real swarm stacks, capture transcripts/artifacts, and grade outcomes with deterministic checks plus LLM or agentic judges. [Guide →](https://docs.agent-swarm.dev/docs/guides/evals-harness)
133
- - **Harness & LLM agnostic** — run with Claude Code, Claude Bridge, OpenAI Codex, pi-mono (Anthropic, OpenRouter, or Amazon Bedrock), Devin, Claude Managed Agents, raw LLMs, or opencode. Tasks, schedules, and workflow agent-task nodes can use portable `modelTier` intent (`smol`, `regular`, `smart`, `ultra`) and resolve it per worker/provider at run time. [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
134
+ - **Harness & LLM agnostic** — run with Claude Code, Claude Bridge, OpenAI Codex, pi-mono (Anthropic, OpenRouter, or Amazon Bedrock), Devin, Claude Managed Agents, raw LLMs, or opencode. Tasks, schedules, and workflow agent-task nodes can use portable `modelTier` intent (`smol`, `regular`, `smart`, `ultra`), and operators can set per-agent reasoning effort (`off` → `xhigh`) without changing task payloads. [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
134
135
  - **OpenTelemetry traces plus OTLP cost/token metrics** — export API + worker traces and finalized session cost/token counters through the same OTLP pipeline for dashboarding in SigNoz, Datadog, Tempo, or another compatible backend. [Observability →](https://docs.agent-swarm.dev/docs/guides/observability-opentelemetry)
135
136
  - **Follow-up continuity across all harnesses** — child tasks inherit a bounded prior-task context preamble built from the task chain, so continuity survives restarts and works the same across every provider. [Task lifecycle →](https://docs.agent-swarm.dev/docs/concepts/task-lifecycle)
136
137
  - **Skills & MCP servers** — reusable procedural knowledge, bundled skill reference files, and per-agent MCP servers with scope cascade. [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools)
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-ba47wf2q.js";
4
- import"./cli-c4h8m0m3.js";
5
- import"./cli-yfyqsqzj.js";
3
+ } from "./cli-f8cdgmdk.js";
4
+ import"./cli-5s8hgqmd.js";
5
+ import"./cli-9xjc8dt2.js";
6
6
  import {
7
7
  buildCancelledBlocks,
8
8
  getTaskLink
9
9
  } from "./cli-z92pkwzn.js";
10
- import"./cli-dh55d5fg.js";
11
10
  import {
12
11
  createTaskWithSiblingAwareness,
13
12
  slackContextKey
14
- } from "./cli-0s37sw3k.js";
13
+ } from "./cli-3jcx2wmm.js";
14
+ import"./cli-dh55d5fg.js";
15
15
  import {
16
16
  cancelTask,
17
17
  getAgentById,
18
18
  getLeadAgent,
19
19
  getTaskById,
20
20
  init_db
21
- } from "./cli-wztagmpk.js";
21
+ } from "./cli-wb4j4tfe.js";
22
22
  import"./cli-z2zcxes1.js";
23
23
  import"./cli-q21d49ac.js";
24
24
  import"./cli-anrj584m.js";
25
- import"./cli-ehcjr5vs.js";
25
+ import"./cli-ccre5q9r.js";
26
26
  import"./cli-3pp1362w.js";
27
27
  import"./cli-p9swy5t3.js";
28
28
 
@@ -15,8 +15,9 @@ import {
15
15
  import {
16
16
  adjustMaxTokensForThinking,
17
17
  buildBaseOptions,
18
+ clampMaxTokensToContext,
18
19
  transformMessages
19
- } from "./cli-2q1ct4en.js";
20
+ } from "./cli-bsyka9ta.js";
20
21
  import {
21
22
  sanitizeSurrogates
22
23
  } from "./cli-y2apkfe2.js";
@@ -5295,6 +5296,10 @@ var stream = (model, context, options) => {
5295
5296
  if (event.usage.cache_creation_input_tokens != null) {
5296
5297
  output.usage.cacheWrite = event.usage.cache_creation_input_tokens;
5297
5298
  }
5299
+ const thinkingTokens = event.usage.output_tokens_details?.thinking_tokens;
5300
+ if (thinkingTokens != null) {
5301
+ output.usage.reasoning = thinkingTokens;
5302
+ }
5298
5303
  output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
5299
5304
  calculateCost(model, output.usage);
5300
5305
  }
@@ -5338,7 +5343,7 @@ function mapThinkingLevelToEffort(model, level) {
5338
5343
  }
5339
5344
  var streamSimple = (model, context, options) => {
5340
5345
  assertRequestAuth(model.provider, options?.apiKey, options?.headers);
5341
- const base = buildBaseOptions(model, options, options?.apiKey);
5346
+ const base = buildBaseOptions(model, context, options, options?.apiKey);
5342
5347
  if (!options?.reasoning) {
5343
5348
  return stream(model, context, { ...base, thinkingEnabled: false });
5344
5349
  }
@@ -5351,11 +5356,12 @@ var streamSimple = (model, context, options) => {
5351
5356
  });
5352
5357
  }
5353
5358
  const adjusted = adjustMaxTokensForThinking(base.maxTokens, model.maxTokens, options.reasoning, options.thinkingBudgets);
5359
+ const maxTokens = clampMaxTokensToContext(model, context, adjusted.maxTokens);
5354
5360
  return stream(model, context, {
5355
5361
  ...base,
5356
- maxTokens: adjusted.maxTokens,
5362
+ maxTokens,
5357
5363
  thinkingEnabled: true,
5358
- thinkingBudgetTokens: adjusted.thinkingBudget
5364
+ thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024))
5359
5365
  });
5360
5366
  };
5361
5367
  function isOAuthToken(apiKey) {
@@ -3,16 +3,16 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-gzmv1371.js";
6
+ } from "./cli-61hj3yzp.js";
7
7
  import"./cli-fete3y1e.js";
8
8
  import"./cli-b0p7rfnd.js";
9
9
  import"./cli-z92pkwzn.js";
10
10
  import"./cli-dh55d5fg.js";
11
- import"./cli-wztagmpk.js";
11
+ import"./cli-wb4j4tfe.js";
12
12
  import"./cli-z2zcxes1.js";
13
13
  import"./cli-q21d49ac.js";
14
14
  import"./cli-anrj584m.js";
15
- import"./cli-ehcjr5vs.js";
15
+ import"./cli-ccre5q9r.js";
16
16
  import"./cli-3pp1362w.js";
17
17
  import"./cli-e15jhafb.js";
18
18
  import"./cli-p9swy5t3.js";
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  bufferThreadMessage,
3
3
  wasEventSeen
4
- } from "./cli-zmta7t3y.js";
4
+ } from "./cli-heavyg0w.js";
5
5
  import {
6
6
  hasOtherUserMention
7
- } from "./cli-0n4xxmy0.js";
7
+ } from "./cli-n4qvvhy0.js";
8
8
  import {
9
9
  require_dist
10
- } from "./cli-gzmv1371.js";
10
+ } from "./cli-61hj3yzp.js";
11
11
  import"./cli-fete3y1e.js";
12
12
  import"./cli-b0p7rfnd.js";
13
13
  import {
14
14
  resolveSlackUserId
15
- } from "./cli-ba47wf2q.js";
16
- import"./cli-c4h8m0m3.js";
17
- import"./cli-yfyqsqzj.js";
15
+ } from "./cli-f8cdgmdk.js";
16
+ import"./cli-5s8hgqmd.js";
17
+ import"./cli-9xjc8dt2.js";
18
18
  import"./cli-z92pkwzn.js";
19
- import"./cli-dh55d5fg.js";
20
19
  import {
21
20
  createTaskWithSiblingAwareness,
22
21
  slackContextKey
23
- } from "./cli-0s37sw3k.js";
22
+ } from "./cli-3jcx2wmm.js";
23
+ import"./cli-dh55d5fg.js";
24
24
  import {
25
25
  getAgentWorkingOnThread,
26
26
  getLeadAgent,
@@ -28,11 +28,11 @@ import {
28
28
  init_db,
29
29
  init_resolver,
30
30
  resolveTemplate
31
- } from "./cli-wztagmpk.js";
31
+ } from "./cli-wb4j4tfe.js";
32
32
  import"./cli-z2zcxes1.js";
33
33
  import"./cli-q21d49ac.js";
34
34
  import"./cli-anrj584m.js";
35
- import"./cli-ehcjr5vs.js";
35
+ import"./cli-ccre5q9r.js";
36
36
  import"./cli-3pp1362w.js";
37
37
  import"./cli-e15jhafb.js";
38
38
  import {
@@ -2,7 +2,7 @@ import {
2
2
  convertResponsesMessages,
3
3
  convertResponsesTools,
4
4
  processResponsesStream
5
- } from "./cli-0fxvpa2q.js";
5
+ } from "./cli-sdpnhajn.js";
6
6
  import"./cli-5m9j2spm.js";
7
7
  import {
8
8
  AzureOpenAI
@@ -10,6 +10,10 @@ import {
10
10
  import {
11
11
  clampOpenAIPromptCacheKey
12
12
  } from "./cli-mrptpp86.js";
13
+ import {
14
+ formatProviderError,
15
+ normalizeProviderError
16
+ } from "./cli-pscrc6tw.js";
13
17
  import {
14
18
  getProviderEnvValue
15
19
  } from "./cli-4wgngmwv.js";
@@ -19,7 +23,7 @@ import {
19
23
  import"./cli-zyxs93y9.js";
20
24
  import {
21
25
  buildBaseOptions
22
- } from "./cli-2q1ct4en.js";
26
+ } from "./cli-bsyka9ta.js";
23
27
  import"./cli-y2apkfe2.js";
24
28
  import {
25
29
  AssistantMessageEventStream,
@@ -53,19 +57,7 @@ function resolveDeploymentName(model, options) {
53
57
  return mappedDeployment || model.id;
54
58
  }
55
59
  function formatAzureOpenAIError(error) {
56
- if (error instanceof Error) {
57
- const status = error.status;
58
- const statusCode = typeof status === "number" ? status : undefined;
59
- if (statusCode !== undefined) {
60
- return `Azure OpenAI API error (${statusCode}): ${error.message}`;
61
- }
62
- return error.message;
63
- }
64
- try {
65
- return JSON.stringify(error);
66
- } catch {
67
- return String(error);
68
- }
60
+ return formatProviderError(normalizeProviderError(error), "Azure OpenAI API error");
69
61
  }
70
62
  var stream = (model, context, options) => {
71
63
  const stream2 = new AssistantMessageEventStream;
@@ -134,7 +126,7 @@ var streamSimple = (model, context, options) => {
134
126
  if (!apiKey) {
135
127
  throw new Error(`No API key for provider: ${model.provider}`);
136
128
  }
137
- const base = buildBaseOptions(model, options, apiKey);
129
+ const base = buildBaseOptions(model, context, options, apiKey);
138
130
  const clampedReasoning = options?.reasoning ? clampThinkingLevel(model, options.reasoning) : undefined;
139
131
  const reasoningEffort = clampedReasoning === "off" ? undefined : clampedReasoning;
140
132
  return stream(model, context, {
@@ -150,9 +142,9 @@ function normalizeAzureBaseUrl(baseUrl) {
150
142
  } catch {
151
143
  throw new Error(`Invalid Azure OpenAI base URL: ${baseUrl}`);
152
144
  }
153
- const isAzureHost = url.hostname.endsWith(".openai.azure.com") || url.hostname.endsWith(".cognitiveservices.azure.com");
145
+ const isAzureHost = url.hostname.endsWith(".openai.azure.com") || url.hostname.endsWith(".cognitiveservices.azure.com") || url.hostname.endsWith(".ai.azure.com");
154
146
  const normalizedPath = url.pathname.replace(/\/+$/, "");
155
- if (isAzureHost && (normalizedPath === "" || normalizedPath === "/" || normalizedPath === "/openai")) {
147
+ if (isAzureHost && (normalizedPath === "" || normalizedPath === "/" || normalizedPath === "/openai" || normalizedPath === "/openai/v1/responses")) {
156
148
  url.pathname = "/openai/v1";
157
149
  url.search = "";
158
150
  }
@@ -3,16 +3,16 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-634jy7sa.js";
6
+ } from "./cli-rpjrpkzy.js";
7
7
  import"./cli-3j01d33e.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-wztagmpk.js";
11
+ } from "./cli-wb4j4tfe.js";
12
12
  import"./cli-z2zcxes1.js";
13
13
  import"./cli-q21d49ac.js";
14
14
  import"./cli-anrj584m.js";
15
- import"./cli-ehcjr5vs.js";
15
+ import"./cli-ccre5q9r.js";
16
16
  import"./cli-3pp1362w.js";
17
17
  import"./cli-p9swy5t3.js";
18
18
 
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-dd6tegmp.js";
5
- import"./cli-634jy7sa.js";
4
+ } from "./cli-hn38x1bp.js";
5
+ import"./cli-rpjrpkzy.js";
6
6
  import"./cli-3j01d33e.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-wztagmpk.js";
10
+ } from "./cli-wb4j4tfe.js";
11
11
  import"./cli-z2zcxes1.js";
12
12
  import"./cli-q21d49ac.js";
13
13
  import"./cli-anrj584m.js";
14
- import"./cli-ehcjr5vs.js";
14
+ import"./cli-ccre5q9r.js";
15
15
  import"./cli-3pp1362w.js";
16
16
  import"./cli-p9swy5t3.js";
17
17
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-wztagmpk.js";
4
+ } from "./cli-wb4j4tfe.js";
5
5
  import"./cli-z2zcxes1.js";
6
6
  import"./cli-q21d49ac.js";
7
7
  import"./cli-anrj584m.js";
8
- import"./cli-ehcjr5vs.js";
8
+ import"./cli-ccre5q9r.js";
9
9
  import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
@@ -12,11 +12,12 @@ import {
12
12
  resolveClaudeBinary,
13
13
  resolveClaudeBinaryArgv,
14
14
  resolveClaudeBridgeEnabled
15
- } from "./cli-p04j6hjv.js";
15
+ } from "./cli-4r9m8f3t.js";
16
16
  import"./cli-psrqtw2m.js";
17
17
  import"./cli-tng3131n.js";
18
18
  import"./cli-zm7njwzd.js";
19
- import"./cli-0k9dc6ks.js";
19
+ import"./cli-tghre7g6.js";
20
+ import"./cli-tkmm5nf9.js";
20
21
  import"./cli-z2zcxes1.js";
21
22
  import"./cli-3pp1362w.js";
22
23
  import"./cli-7zd05xb4.js";
@@ -3,12 +3,12 @@ import {
3
3
  checkClaudeManagedCredentials,
4
4
  composeManagedUserMessage,
5
5
  normalizeRepoUrl
6
- } from "./cli-yp2krx5r.js";
7
- import"./cli-92fqyjcv.js";
8
- import"./cli-2957pqpj.js";
6
+ } from "./cli-jk4tj5m6.js";
7
+ import"./cli-07er7wrs.js";
8
+ import"./cli-yv9dttkh.js";
9
9
  import"./cli-d6n0thxw.js";
10
10
  import"./cli-gz9sbyk3.js";
11
- import"./cli-0k9dc6ks.js";
11
+ import"./cli-tghre7g6.js";
12
12
  import"./cli-3pp1362w.js";
13
13
  import"./cli-p9swy5t3.js";
14
14
  export {
@@ -1,4 +1,4 @@
1
- import"./cli-4wmnp8q3.js";
1
+ import"./cli-amncg1dq.js";
2
2
  import {
3
3
  Anthropic,
4
4
  BadRequestError,
@@ -83,7 +83,7 @@ async function promptHiddenInput(label, _defaultValue, helpText) {
83
83
  }
84
84
 
85
85
  // src/commands/claude-managed-setup.ts
86
- var DEFAULT_AGENT_MODEL = "claude-sonnet-4-6";
86
+ var DEFAULT_AGENT_MODEL = "claude-sonnet-5";
87
87
  var SKILLS_DIR_RELATIVE = "plugin/commands";
88
88
  var SKILLS_BETA_HEADER = "skills-2025-10-02";
89
89
  var CONFIG_KEY_AGENT_ID = "managed_agent_id";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  checkToolLoop
3
- } from "./cli-2957pqpj.js";
3
+ } from "./cli-yv9dttkh.js";
4
4
 
5
5
  // src/providers/swarm-events-shared.ts
6
6
  var CANCELLATION_THROTTLE_MS = 500;
@@ -4,12 +4,13 @@ import {
4
4
  getNextResumeGeneration,
5
5
  getResumeGeneration,
6
6
  repointTrackerSyncBySwarmId
7
- } from "./cli-87fj1jk4.js";
7
+ } from "./cli-4rx7v585.js";
8
8
  import {
9
9
  getExecutorRegistry,
10
10
  recoverIncompleteRuns
11
- } from "./cli-v2fb1fxf.js";
11
+ } from "./cli-kgr1cazt.js";
12
12
  import {
13
+ MAX_EMPTY_POLLS,
13
14
  assignUnassignedTaskPending,
14
15
  backfillSupersedeTaskResumeTaskId,
15
16
  cleanupStaleSessions,
@@ -43,7 +44,7 @@ import {
43
44
  resolveTemplate,
44
45
  supersedeTask,
45
46
  updateAgentStatus
46
- } from "./cli-wztagmpk.js";
47
+ } from "./cli-wb4j4tfe.js";
47
48
 
48
49
  // src/heartbeat/heartbeat.ts
49
50
  init_db();
@@ -457,7 +458,7 @@ function checkWorkerHealth(findings) {
457
458
  }
458
459
  function autoAssignPoolTasks(findings) {
459
460
  getDb().transaction(() => {
460
- const idleWorkers = getIdleWorkersWithCapacity();
461
+ const idleWorkers = getIdleWorkersWithCapacity().filter((w) => (w.emptyPollCount ?? 0) < MAX_EMPTY_POLLS);
461
462
  if (idleWorkers.length === 0)
462
463
  return;
463
464
  const poolTasks = getUnassignedPoolTasks(MAX_AUTO_ASSIGN_PER_SWEEP);
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-wztagmpk.js";
6
+ } from "./cli-wb4j4tfe.js";
7
7
 
8
8
  // src/tasks/context-key.ts
9
9
  var SEPARATOR = ":";
@@ -16,7 +16,10 @@ import {
16
16
  clampContextPercent,
17
17
  computeContextUsedUnified,
18
18
  getContextWindowSize
19
- } from "./cli-0k9dc6ks.js";
19
+ } from "./cli-tghre7g6.js";
20
+ import {
21
+ applyReasoningEffort
22
+ } from "./cli-tkmm5nf9.js";
20
23
  import {
21
24
  init_credentials,
22
25
  validateClaudeCredentials
@@ -253,6 +256,7 @@ class ClaudeSession {
253
256
  taskFilePid;
254
257
  contextWindowSize;
255
258
  systemPromptFile;
259
+ appliedReasoningEffort;
256
260
  constructor(config, model, taskFilePath, taskFilePid, sessionMcpConfig = null, claudeBinaryArgv = ["claude"], systemPromptFile = null, harnessVariant, harnessVariantMeta) {
257
261
  this.config = config;
258
262
  this.model = model;
@@ -268,6 +272,9 @@ class ClaudeSession {
268
272
  const sourceEnv = config.env || process.env;
269
273
  const otelEnv = buildClaudeCodeOtelEnv(sourceEnv);
270
274
  const runtimeEnv = buildClaudeCodeRuntimeEnv(sourceEnv);
275
+ const reasoningApplication = applyReasoningEffort("claude", model, config.reasoningEffort);
276
+ const reasoningEnv = reasoningApplication.kind === "claude-env" ? reasoningApplication.env : {};
277
+ this.appliedReasoningEffort = reasoningApplication.kind === "claude-env" ? config.reasoningEffort ?? null : null;
271
278
  this.proc = Bun.spawn(cmd, {
272
279
  cwd: this.config.cwd,
273
280
  env: {
@@ -275,6 +282,7 @@ class ClaudeSession {
275
282
  ...sourceEnv,
276
283
  ...runtimeEnv,
277
284
  ...otelEnv,
285
+ ...reasoningEnv,
278
286
  TASK_FILE: taskFilePath,
279
287
  AGENT_SWARM_TASK_ID: config.taskId,
280
288
  AGENT_SWARM_AGENT_ID: config.agentId,
@@ -407,7 +415,8 @@ ${scrubSecrets(stderrOutput)}`);
407
415
  isError: (exitCode ?? 1) !== 0,
408
416
  failureReason,
409
417
  rateLimitResetAt: this.errorTracker.getRateLimitResetAt(),
410
- rateLimitWindows: this.errorTracker.getRateLimitWindows()
418
+ rateLimitWindows: this.errorTracker.getRateLimitWindows(),
419
+ appliedReasoningEffort: this.appliedReasoningEffort
411
420
  };
412
421
  }
413
422
  processJsonLine(trimmed, setCost) {
@@ -14,7 +14,7 @@ import {
14
14
  init_templates1 as init_templates,
15
15
  normalizeDateRequired,
16
16
  resolveTemplate
17
- } from "./cli-wztagmpk.js";
17
+ } from "./cli-wb4j4tfe.js";
18
18
 
19
19
  // src/be/db-queries/tracker.ts
20
20
  init_date_utils();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_package,
3
3
  package_default
4
- } from "./cli-ehcjr5vs.js";
4
+ } from "./cli-ccre5q9r.js";
5
5
 
6
6
  // src/commands/shared/client-config.ts
7
7
  init_package();
@@ -3,7 +3,7 @@ import {
3
3
  incrKv,
4
4
  init_db,
5
5
  upsertKv
6
- } from "./cli-wztagmpk.js";
6
+ } from "./cli-wb4j4tfe.js";
7
7
 
8
8
  // src/be/unmapped-identities.ts
9
9
  init_db();
@@ -25,7 +25,7 @@ import {
25
25
  getTaskById,
26
26
  init_db,
27
27
  setSlackMessageTracking
28
- } from "./cli-wztagmpk.js";
28
+ } from "./cli-wb4j4tfe.js";
29
29
  import {
30
30
  require_receiver,
31
31
  require_sender,
@@ -54980,13 +54980,13 @@ async function initSlackApp() {
54980
54980
  socketMode: true,
54981
54981
  logLevel: import_bolt.LogLevel.DEBUG
54982
54982
  });
54983
- const { registerMessageHandler } = await import("./handlers-5xdqk40d.js");
54984
- const { registerCommandHandler } = await import("./commands-tn8zj0an.js");
54985
- const { registerActionHandlers } = await import("./actions-45g8tvc8.js");
54983
+ const { registerMessageHandler } = await import("./handlers-h9vh0t22.js");
54984
+ const { registerCommandHandler } = await import("./commands-ys948zs2.js");
54985
+ const { registerActionHandlers } = await import("./actions-q3hcb6ea.js");
54986
54986
  registerMessageHandler(app);
54987
54987
  registerCommandHandler(app);
54988
54988
  registerActionHandlers(app);
54989
- const { createAssistant } = await import("./assistant-ka281qe8.js");
54989
+ const { createAssistant } = await import("./assistant-a6vp3nv8.js");
54990
54990
  app.assistant(createAssistant());
54991
54991
  return app;
54992
54992
  }
@@ -8,7 +8,7 @@ import {
8
8
  } from "./cli-4w4fmq9x.js";
9
9
  import {
10
10
  transformMessages
11
- } from "./cli-2q1ct4en.js";
11
+ } from "./cli-bsyka9ta.js";
12
12
  import {
13
13
  sanitizeSurrogates
14
14
  } from "./cli-y2apkfe2.js";