@desplega.ai/agent-swarm 1.119.6 → 1.121.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 (207) hide show
  1. package/README.md +2 -2
  2. package/dist/{actions-qe5zjcbr.js → actions-mwshtkf7.js} +6 -6
  3. package/dist/{anthropic-messages-qjxzsabf.js → anthropic-messages-4gn944cn.js} +29 -13
  4. package/dist/{app-31x7k3vj.js → app-skbty91x.js} +4 -4
  5. package/dist/{assistant-4crt9dve.js → assistant-tg7dhfj8.js} +13 -13
  6. package/dist/{azure-openai-responses-ntfd05zd.js → azure-openai-responses-79zc0wyy.js} +28 -13
  7. package/dist/{boot-reembed-8g69ttz4.js → boot-reembed-ntjmeyh2.js} +4 -4
  8. package/dist/{boot-reembed-q648j733.js → boot-reembed-q5x0xpcp.js} +5 -5
  9. package/dist/{boot-scrub-logs-sfmzd2hj.js → boot-scrub-logs-5gznsfbe.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-bpvgs2y6.js → cli-072t49hf.js} +2123 -1533
  13. package/dist/{cli-g6qz2kts.js → cli-0df2g86x.js} +336 -18
  14. package/dist/cli-1728qh70.js +791 -0
  15. package/dist/{cli-vg1jxfqz.js → cli-3b1ayz83.js} +5 -5
  16. package/dist/{cli-r93nz80j.js → cli-3fxqwfh3.js} +1 -1
  17. package/dist/{cli-w6rhc30s.js → cli-3jrdwnn9.js} +20 -5
  18. package/dist/{cli-pasyk3vc.js → cli-46etyprn.js} +10 -5
  19. package/dist/{cli-433c0f4b.js → cli-4pfweq4x.js} +8 -8
  20. package/dist/{cli-2r7s8jhp.js → cli-5c4327dx.js} +7 -1
  21. package/dist/{cli-4s84mw72.js → cli-5hpvd15x.js} +2 -2
  22. package/dist/{cli-branks1w.js → cli-6s3ytc5x.js} +1 -1
  23. package/dist/{cli-da3x3btq.js → cli-7pt9sc83.js} +2 -2
  24. package/dist/{cli-2gv8ygwr.js → cli-7pzae66m.js} +2 -2
  25. package/dist/{cli-qs7nb3zn.js → cli-8wrympd7.js} +27 -1
  26. package/dist/{cli-qw1ccvxm.js → cli-95rbe11h.js} +70 -51
  27. package/dist/{cli-6rvm3jkk.js → cli-agdrxyex.js} +1 -1
  28. package/dist/{cli-wr706gez.js → cli-av2s7my4.js} +167 -66
  29. package/dist/{cli-59jy217p.js → cli-avw9ev3x.js} +55 -21
  30. package/dist/{cli-fkxxh5d4.js → cli-b2mqkg1h.js} +2 -2
  31. package/dist/{cli-1arw00dp.js → cli-ccjwgarc.js} +12 -3
  32. package/dist/{cli-pscrc6tw.js → cli-ch7t5v7n.js} +5 -0
  33. package/dist/{cli-tghre7g6.js → cli-cw70hymf.js} +1 -0
  34. package/dist/{cli-n61x2aph.js → cli-dmzv0986.js} +816 -1335
  35. package/dist/{cli-d1reabed.js → cli-g9vva2qh.js} +2 -2
  36. package/dist/{cli-ner6af7m.js → cli-gdpx70nc.js} +24048 -23715
  37. package/dist/{cli-96feg24n.js → cli-ghq3v4c9.js} +2 -2
  38. package/dist/{cli-wxbnjgce.js → cli-ky8esb8t.js} +3 -3
  39. package/dist/{cli-gdqdkr3j.js → cli-nf7sadev.js} +2 -2
  40. package/dist/{cli-h6cf69x5.js → cli-p9w7kb3h.js} +1 -1
  41. package/dist/{cli-xeatwfbe.js → cli-ry656xem.js} +24 -17
  42. package/dist/{cli-q8dway4w.js → cli-s8bdcke2.js} +1 -1
  43. package/dist/cli-s8s499xy.js +81 -0
  44. package/dist/{cli-sbkwvn5e.js → cli-srjqn7fd.js} +1 -1
  45. package/dist/cli-tv7vekye.js +367 -0
  46. package/dist/{cli-gg5bd32n.js → cli-vg3zrw6h.js} +4 -4
  47. package/dist/{cli-vx0y68jv.js → cli-vp9r4ap4.js} +5 -4
  48. package/dist/{cli-mg280wsv.js → cli-we156bmz.js} +1 -1
  49. package/dist/{cli-86fdnerz.js → cli-wwsaj97q.js} +9 -4
  50. package/dist/{cli-e0y603nn.js → cli-x0e0yvnq.js} +101 -1
  51. package/dist/{cli-mw3xpgwb.js → cli-x4apc9t3.js} +4 -4
  52. package/dist/cli.js +26 -21
  53. package/dist/{codex-adapter-6j2b38tg.js → codex-adapter-mmy741zd.js} +8 -9
  54. package/dist/{codex-session-runner-vz215wgw.js → codex-session-runner-sazmx9zt.js} +8 -9
  55. package/dist/{commands-6xr20jbe.js → commands-cxxye5e4.js} +3 -3
  56. package/dist/{db-1mmvk1z4.js → db-ab1954b7.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-xvrknk8w.js → handlers-fmfe2343.js} +13 -13
  60. package/dist/{hook-qm7he8wn.js → hook-ygnw3cvt.js} +7 -8
  61. package/dist/{http-hj08zq67.js → http-kactcc0z.js} +1128 -536
  62. package/dist/{index-688jph6a.js → index-6erq0wvk.js} +11 -11
  63. package/dist/{index-gze4fg2w.js → index-g86j2yt5.js} +9 -9
  64. package/dist/{index-etz7d8md.js → index-gmzs6a2q.js} +10 -10
  65. package/dist/{index-wj8dfpwh.js → index-hmp82wn0.js} +12 -12
  66. package/dist/{keepalive-94wn9yxw.js → keepalive-3cvt26dw.js} +18 -14
  67. package/dist/{lead-rvcqkp11.js → lead-ysf26cjr.js} +31 -32
  68. package/dist/{maintenance-qhfc4dnp.js → maintenance-9npwptbb.js} +5 -5
  69. package/dist/{mistral-conversations-ykcg66za.js → mistral-conversations-26ya4yah.js} +17 -13
  70. package/dist/{oauth-refresh-sweep-rj8wgvsw.js → oauth-refresh-sweep-0r2v76vw.js} +23 -17
  71. package/dist/{onboard-8bv8q1wc.js → onboard-ddb1674a.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-h6rkxwrk.js} +2 -2
  76. package/dist/{openrouter-images-4fsrrzes.js → openrouter-images-dgq98729.js} +10 -3
  77. package/dist/{otel-impl-1kf6fr2m.js → otel-impl-b43bkq8e.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-ke789738.js} +2328 -1281
  80. package/dist/{pricing-refresh-e84tar2s.js → pricing-refresh-2rqf114z.js} +5 -5
  81. package/dist/{rbac-roles-atytq5ch.js → rbac-roles-5wkhc8xv.js} +5 -5
  82. package/dist/{rbac-roles-pg0zvnwn.js → rbac-roles-6vtafvzb.js} +4 -4
  83. package/dist/{seed-pricing-xd6nxq7k.js → seed-pricing-23wrb873.js} +4 -4
  84. package/dist/{setup-4z389yk0.js → setup-6rny4fk6.js} +2 -2
  85. package/dist/{worker-m61r0t7m.js → worker-yapewe14.js} +31 -32
  86. package/openapi.json +2671 -1811
  87. package/package.json +10 -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/connection-bindings-blob-migration.ts +123 -0
  91. package/src/be/db-queries/mcp-oauth.ts +409 -247
  92. package/src/be/db-queries/oauth.ts +813 -131
  93. package/src/be/db.ts +97 -6
  94. package/src/be/migrations/117_unified_oauth.sql +624 -0
  95. package/src/be/migrations/119_agent_avatar.sql +7 -0
  96. package/src/be/migrations/120_task_title.sql +3 -0
  97. package/src/be/oauth-credential-bindings.ts +48 -14
  98. package/src/be/oauth-encryption-backfill.ts +84 -0
  99. package/src/be/oauth-refresh-sweep.ts +38 -23
  100. package/src/be/script-connections.ts +1130 -163
  101. package/src/be/script-credential-broker.ts +37 -27
  102. package/src/be/scripts/typecheck.ts +3 -2
  103. package/src/be/seed-capabilities.ts +62 -0
  104. package/src/be/seed-pricing.ts +1 -1
  105. package/src/be/seed-scripts/catalog/ops-catalog-audit.inline.ts +1 -1
  106. package/src/be/seed-scripts/catalog/ops-catalog-audit.ts +1 -1
  107. package/src/be/vendored-openapi.ts +98 -0
  108. package/src/commands/runner.ts +69 -6
  109. package/src/http/agents.ts +23 -5
  110. package/src/http/all-routes.ts +1 -0
  111. package/src/http/core.ts +8 -5
  112. package/src/http/index.ts +18 -5
  113. package/src/http/mcp-bridge.ts +5 -2
  114. package/src/http/mcp-oauth.ts +103 -101
  115. package/src/http/oauth-callback.ts +332 -0
  116. package/src/http/oauth-generic.ts +14 -54
  117. package/src/http/poll.ts +5 -1
  118. package/src/http/script-connections.ts +651 -170
  119. package/src/http/scripts.ts +4 -2
  120. package/src/http/sessions.ts +1 -1
  121. package/src/http/tasks.ts +35 -0
  122. package/src/http/trackers/jira.ts +22 -34
  123. package/src/http/trackers/linear.ts +21 -36
  124. package/src/http/x.ts +6 -2
  125. package/src/jira/app.ts +12 -6
  126. package/src/jira/oauth.ts +48 -48
  127. package/src/linear/app.ts +44 -2
  128. package/src/linear/oauth.ts +12 -37
  129. package/src/oauth/app-validation.ts +27 -9
  130. package/src/oauth/ensure-mcp-token.ts +1 -0
  131. package/src/oauth/ensure-token.ts +331 -108
  132. package/src/oauth/identity-capture.ts +103 -0
  133. package/src/oauth/keepalive.ts +14 -9
  134. package/src/oauth/presets.ts +242 -0
  135. package/src/oauth/wrapper.ts +197 -76
  136. package/src/prompts/base-prompt.ts +48 -4
  137. package/src/prompts/session-templates.ts +13 -1
  138. package/src/providers/claude-managed-models.ts +8 -0
  139. package/src/rbac/legacy-policy.ts +2 -1
  140. package/src/rbac/permissions.ts +7 -3
  141. package/src/scripts-runtime/credential-broker/broker.ts +51 -8
  142. package/src/scripts-runtime/credential-broker/fetch-patch.ts +30 -3
  143. package/src/scripts-runtime/credential-broker/index.ts +1 -1
  144. package/src/scripts-runtime/credential-broker/types.ts +55 -8
  145. package/src/scripts-runtime/egress-secrets.ts +6 -2
  146. package/src/scripts-runtime/eval-harness.ts +2 -2
  147. package/src/scripts-runtime/executors/types.ts +2 -1
  148. package/src/scripts-runtime/loader.ts +3 -0
  149. package/src/scripts-runtime/types/stdlib.d.ts +11 -0
  150. package/src/server.ts +230 -126
  151. package/src/tests/agent-avatar-resolution.test.ts +123 -0
  152. package/src/tests/agents-list-model-display.test.ts +10 -0
  153. package/src/tests/base-prompt.test.ts +72 -0
  154. package/src/tests/claude-managed-adapter.test.ts +6 -0
  155. package/src/tests/connection-embedded-auth.test.ts +709 -0
  156. package/src/tests/context-window.test.ts +1 -0
  157. package/src/tests/credential-broker.test.ts +123 -125
  158. package/src/tests/db-queries-oauth.test.ts +126 -1
  159. package/src/tests/ensure-token.test.ts +44 -2
  160. package/src/tests/list-endpoint-slimming.test.ts +45 -0
  161. package/src/tests/mcp-oauth-manual-client.test.ts +20 -1
  162. package/src/tests/mcp-oauth-queries.test.ts +154 -8
  163. package/src/tests/oauth-access-token-tool.test.ts +37 -1
  164. package/src/tests/oauth-callback-flow.test.ts +534 -0
  165. package/src/tests/oauth-credential-bindings.test.ts +50 -22
  166. package/src/tests/oauth-presets.test.ts +275 -0
  167. package/src/tests/oauth-refresh-failure.test.ts +263 -0
  168. package/src/tests/oauth-refresh-sweep.test.ts +83 -3
  169. package/src/tests/oauth-wrapper.test.ts +77 -55
  170. package/src/tests/prompt-template-session.test.ts +6 -5
  171. package/src/tests/rbac-charact-misc-tools.test.ts +60 -0
  172. package/src/tests/rbac-engine.test.ts +2 -1
  173. package/src/tests/script-connections-http.test.ts +356 -11
  174. package/src/tests/script-connections.test.ts +102 -0
  175. package/src/tests/sdk-allowlist.test.ts +4 -1
  176. package/src/tests/seed-capabilities.test.ts +92 -0
  177. package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
  178. package/src/tests/sessions.test.ts +46 -0
  179. package/src/tests/spec-base-url.test.ts +266 -0
  180. package/src/tests/status.test.ts +3 -4
  181. package/src/tests/swarm-config-reserved-keys.test.ts +4 -2
  182. package/src/tests/task-title-route.test.ts +106 -0
  183. package/src/tests/tool-annotations.test.ts +6 -3
  184. package/src/tests/tracker-fold.test.ts +412 -0
  185. package/src/tests/unified-oauth-migration.test.ts +455 -0
  186. package/src/tests/vendored-openapi.test.ts +263 -0
  187. package/src/tools/credential-bindings/tool.ts +232 -77
  188. package/src/tools/oauth-access-token.ts +55 -6
  189. package/src/tools/script-connections/tool.ts +73 -53
  190. package/src/tools/swarm-config/set-config.ts +24 -50
  191. package/src/tools/update-profile.ts +15 -5
  192. package/src/tracker/types.ts +12 -0
  193. package/src/types.ts +29 -0
  194. package/src/utils/context-window.ts +1 -0
  195. package/src/workflows/executors/swarm-script.ts +6 -2
  196. package/vendored-openapi/README.md +22 -0
  197. package/vendored-openapi/github.json +7759 -0
  198. package/vendored-openapi/gmail.json +393 -0
  199. package/vendored-openapi/jira.json +3396 -0
  200. package/vendored-openapi/linear.json +252 -0
  201. package/vendored-openapi/manifest.json +128 -0
  202. package/vendored-openapi/slack.json +2895 -0
  203. package/dist/cli-0pygq9r1.js +0 -429
  204. package/dist/cli-8hhms4hp.js +0 -393
  205. package/dist/cli-z9gzq07x.js +0 -27
  206. package/src/scripts-runtime/credential-broker/store.ts +0 -72
  207. package/dist/{otel-g299k41b.js → otel-63jr5v38.js} +1 -1
package/README.md CHANGED
@@ -142,7 +142,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
142
142
  - **Config-driven metrics dashboards** — define read-only SQL widgets, version them, and render them in the dashboard without shipping custom frontend code. [Metrics API →](https://docs.agent-swarm.dev/docs/api-reference/stats)
143
143
  - **DB-backed pages** — agents publish HTML or JSON pages (reports, dashboards, action specs) via `create_page`, remove stale pages with `delete-page`, and share them with public / authed / password modes, version history, view counters, diff helpers, and PDF export. [MCP tools → Pages](https://docs.agent-swarm.dev/docs/reference/mcp-tools#pages-tools)
144
144
  - **KV store** — Redis-like namespaced key/value store with auto-scoped context (Slack thread / PR / Linear issue / page). [MCP tools → KV](https://docs.agent-swarm.dev/docs/reference/mcp-tools#kv-tools)
145
- - **Real-time dashboard + task attachments** — monitor agents, tasks, and inter-agent chat, filter Pages, Approval Requests, and workflow definitions with URL-backed search/facets, create tasks with uploaded files from the sessions composer, and preview task attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
145
+ - **Real-time dashboard + task attachments** — monitor agents, tasks, and inter-agent chat; rename sessions inline; customize each agent's icon and color; filter Pages, Approval Requests, and workflow definitions with URL-backed search/facets; create tasks with uploaded files from the sessions composer; and preview task attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
146
146
 
147
147
  ## Quick Start
148
148
 
@@ -217,7 +217,7 @@ Missing one? Ask the swarm to build it.
217
217
 
218
218
  ## Dashboard
219
219
 
220
- Real-time monitoring of agents, tasks, and inter-agent chat. Use the hosted version at [app.agent-swarm.dev](https://app.agent-swarm.dev), or run locally:
220
+ Real-time monitoring of agents, tasks, and inter-agent chat. Session titles can be renamed inline, and agent profiles can use a custom Lucide icon and color while retaining deterministic defaults. Use the hosted version at [app.agent-swarm.dev](https://app.agent-swarm.dev), or run locally:
221
221
 
222
222
  ```bash
223
223
  cd apps/ui && bun install && bun run dev
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-gdqdkr3j.js";
4
- import"./cli-sbkwvn5e.js";
3
+ } from "./cli-nf7sadev.js";
4
+ import"./cli-srjqn7fd.js";
5
5
  import {
6
6
  createTaskWithSiblingAwareness
7
- } from "./cli-q8dway4w.js";
7
+ } from "./cli-s8bdcke2.js";
8
8
  import {
9
9
  buildCancelledBlocks,
10
10
  getTaskLink
@@ -19,12 +19,12 @@ import {
19
19
  init_context_key,
20
20
  init_db,
21
21
  slackContextKey
22
- } from "./cli-g6qz2kts.js";
22
+ } from "./cli-0df2g86x.js";
23
23
  import"./cli-z2zcxes1.js";
24
+ import"./cli-46etyprn.js";
25
+ import"./cli-4j2mrzag.js";
24
26
  import"./cli-bw80ck94.js";
25
27
  import"./cli-xz9aq0rf.js";
26
- import"./cli-pasyk3vc.js";
27
- import"./cli-4j2mrzag.js";
28
28
  import"./cli-p9swy5t3.js";
29
29
 
30
30
  // src/slack/actions.ts
@@ -5,6 +5,9 @@ import {
5
5
  buildCopilotDynamicHeaders,
6
6
  hasCopilotVisionInput
7
7
  } from "./cli-67bad0ze.js";
8
+ import {
9
+ retryProviderRequest
10
+ } from "./cli-s8s499xy.js";
8
11
  import {
9
12
  parseJsonWithRepair,
10
13
  parseStreamingJson
@@ -16,8 +19,9 @@ import {
16
19
  adjustMaxTokensForThinking,
17
20
  buildBaseOptions,
18
21
  clampMaxTokensToContext,
22
+ resolveJsonSchemaStrictSampling,
19
23
  transformMessages
20
- } from "./cli-e0y603nn.js";
24
+ } from "./cli-x0e0yvnq.js";
21
25
  import {
22
26
  sanitizeSurrogates
23
27
  } from "./cli-y2apkfe2.js";
@@ -26,10 +30,10 @@ import {
26
30
  } from "./cli-vapyk8sw.js";
27
31
  import {
28
32
  calculateCost
29
- } from "./cli-1arw00dp.js";
33
+ } from "./cli-ccjwgarc.js";
30
34
  import {
31
35
  AssistantMessageEventStream
32
- } from "./cli-qs7nb3zn.js";
36
+ } from "./cli-8wrympd7.js";
33
37
  import"./cli-p9swy5t3.js";
34
38
 
35
39
  // node_modules/@earendil-works/pi-ai/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
@@ -4919,6 +4923,7 @@ function getAnthropicCompat(model) {
4919
4923
  supportsCacheControlOnTools: model.compat?.supportsCacheControlOnTools ?? true,
4920
4924
  supportsTemperature: model.compat?.supportsTemperature ?? true,
4921
4925
  allowEmptySignature: model.compat?.allowEmptySignature ?? false,
4926
+ supportsStrictTools: model.compat?.supportsStrictTools ?? false,
4922
4927
  supportsToolReferences: model.compat?.supportsToolReferences ?? defaultSupportsToolReferences(model)
4923
4928
  };
4924
4929
  }
@@ -5160,9 +5165,13 @@ var stream = (model, context, options) => {
5160
5165
  const requestOptions = {
5161
5166
  ...options?.signal ? { signal: options.signal } : {},
5162
5167
  ...options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {},
5163
- maxRetries: options?.maxRetries ?? 0
5168
+ maxRetries: 0
5164
5169
  };
5165
- const response = await client.messages.create({ ...params, stream: true }, requestOptions).asResponse();
5170
+ const response = await retryProviderRequest(() => client.messages.create({ ...params, stream: true }, requestOptions).asResponse(), {
5171
+ maxRetries: options?.maxRetries,
5172
+ maxRetryDelayMs: options?.maxRetryDelayMs,
5173
+ signal: options?.signal
5174
+ });
5166
5175
  await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model);
5167
5176
  stream2.push({ type: "start", partial: output });
5168
5177
  const blocks = output.content;
@@ -5487,8 +5496,8 @@ function buildParams(model, context, isOAuthToken2, options) {
5487
5496
  }
5488
5497
  if (immediateTools.length > 0 || deferredTools.length > 0) {
5489
5498
  params.tools = [
5490
- ...convertTools(immediateTools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsCacheControlOnTools ? cacheControl : undefined),
5491
- ...convertTools(deferredTools, isOAuthToken2, compat.supportsEagerToolInputStreaming, undefined, true)
5499
+ ...convertTools(immediateTools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, compat.supportsCacheControlOnTools ? cacheControl : undefined),
5500
+ ...convertTools(deferredTools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, undefined, true)
5492
5501
  ];
5493
5502
  }
5494
5503
  if (model.reasoning) {
@@ -5689,20 +5698,27 @@ function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allow
5689
5698
  function shouldUseFineGrainedToolStreamingBeta(model, context) {
5690
5699
  return !!context.tools?.length && !getAnthropicCompat(model).supportsEagerToolInputStreaming;
5691
5700
  }
5692
- function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, cacheControl, deferLoading = false) {
5701
+ function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, supportsStrictTools, cacheControl, deferLoading = false) {
5693
5702
  if (!tools)
5694
5703
  return [];
5695
5704
  return tools.map((tool, index) => {
5705
+ const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictTools);
5696
5706
  const schema = tool.parameters;
5707
+ const legacyInputSchema = {
5708
+ type: "object",
5709
+ properties: schema.properties ?? {},
5710
+ required: schema.required ?? []
5711
+ };
5712
+ const inputSchema = strict === true ? {
5713
+ ...tool.parameters,
5714
+ ...legacyInputSchema
5715
+ } : legacyInputSchema;
5697
5716
  return {
5698
5717
  name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name,
5699
5718
  description: tool.description,
5700
5719
  ...supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {},
5701
- input_schema: {
5702
- type: "object",
5703
- properties: schema.properties ?? {},
5704
- required: schema.required ?? []
5705
- },
5720
+ ...strict === true ? { strict: true } : {},
5721
+ input_schema: inputSchema,
5706
5722
  ...deferLoading ? { defer_loading: true } : {},
5707
5723
  ...cacheControl && index === tools.length - 1 ? { cache_control: cacheControl } : {}
5708
5724
  };
@@ -3,18 +3,18 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-vg1jxfqz.js";
6
+ } from "./cli-3b1ayz83.js";
7
7
  import"./cli-rkndnn90.js";
8
8
  import"./cli-b0p7rfnd.js";
9
9
  import"./cli-ma04faw5.js";
10
10
  import"./cli-wspgs9bt.js";
11
11
  import"./cli-dh55d5fg.js";
12
- import"./cli-g6qz2kts.js";
12
+ import"./cli-0df2g86x.js";
13
13
  import"./cli-z2zcxes1.js";
14
+ import"./cli-46etyprn.js";
15
+ import"./cli-4j2mrzag.js";
14
16
  import"./cli-bw80ck94.js";
15
17
  import"./cli-xz9aq0rf.js";
16
- import"./cli-pasyk3vc.js";
17
- import"./cli-4j2mrzag.js";
18
18
  import"./cli-e15jhafb.js";
19
19
  import"./cli-7wmybrt5.js";
20
20
  import"./cli-p9swy5t3.js";
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  bufferThreadMessage,
3
3
  wasEventSeen
4
- } from "./cli-433c0f4b.js";
4
+ } from "./cli-4pfweq4x.js";
5
5
  import {
6
6
  hasOtherUserMention
7
- } from "./cli-d1reabed.js";
8
- import {
9
- require_dist
10
- } from "./cli-vg1jxfqz.js";
11
- import"./cli-rkndnn90.js";
12
- import"./cli-b0p7rfnd.js";
7
+ } from "./cli-g9vva2qh.js";
13
8
  import {
14
9
  resolveSlackUserId,
15
10
  rewriteSlackMentions
16
- } from "./cli-gdqdkr3j.js";
17
- import"./cli-sbkwvn5e.js";
11
+ } from "./cli-nf7sadev.js";
12
+ import"./cli-srjqn7fd.js";
18
13
  import {
19
14
  createTaskWithSiblingAwareness
20
- } from "./cli-q8dway4w.js";
15
+ } from "./cli-s8bdcke2.js";
16
+ import {
17
+ require_dist
18
+ } from "./cli-3b1ayz83.js";
19
+ import"./cli-rkndnn90.js";
20
+ import"./cli-b0p7rfnd.js";
21
21
  import"./cli-ma04faw5.js";
22
22
  import"./cli-wspgs9bt.js";
23
23
  import"./cli-dh55d5fg.js";
@@ -30,12 +30,12 @@ import {
30
30
  init_resolver,
31
31
  resolveTemplate,
32
32
  slackContextKey
33
- } from "./cli-g6qz2kts.js";
33
+ } from "./cli-0df2g86x.js";
34
34
  import"./cli-z2zcxes1.js";
35
+ import"./cli-46etyprn.js";
36
+ import"./cli-4j2mrzag.js";
35
37
  import"./cli-bw80ck94.js";
36
38
  import"./cli-xz9aq0rf.js";
37
- import"./cli-pasyk3vc.js";
38
- import"./cli-4j2mrzag.js";
39
39
  import"./cli-e15jhafb.js";
40
40
  import"./cli-7wmybrt5.js";
41
41
  import {
@@ -2,7 +2,7 @@ import {
2
2
  convertResponsesMessages,
3
3
  convertResponsesTools,
4
4
  processResponsesStream
5
- } from "./cli-wr706gez.js";
5
+ } from "./cli-av2s7my4.js";
6
6
  import {
7
7
  clampOpenAIPromptCacheKey
8
8
  } from "./cli-mrptpp86.js";
@@ -10,6 +10,9 @@ import"./cli-5m9j2spm.js";
10
10
  import {
11
11
  AzureOpenAI
12
12
  } from "./cli-sajgpkqg.js";
13
+ import {
14
+ retryProviderRequest
15
+ } from "./cli-s8s499xy.js";
13
16
  import"./cli-zyxs93y9.js";
14
17
  import {
15
18
  getProviderEnvValue
@@ -17,20 +20,21 @@ import {
17
20
  import {
18
21
  formatProviderError,
19
22
  normalizeProviderError
20
- } from "./cli-pscrc6tw.js";
23
+ } from "./cli-ch7t5v7n.js";
21
24
  import {
22
- buildBaseOptions
23
- } from "./cli-e0y603nn.js";
25
+ buildBaseOptions,
26
+ createGrammarToolInputProperties
27
+ } from "./cli-x0e0yvnq.js";
24
28
  import"./cli-y2apkfe2.js";
25
29
  import {
26
30
  headersToRecord
27
31
  } from "./cli-vapyk8sw.js";
28
32
  import {
29
33
  clampThinkingLevel
30
- } from "./cli-1arw00dp.js";
34
+ } from "./cli-ccjwgarc.js";
31
35
  import {
32
36
  AssistantMessageEventStream
33
- } from "./cli-qs7nb3zn.js";
37
+ } from "./cli-8wrympd7.js";
34
38
  import"./cli-p9swy5t3.js";
35
39
 
36
40
  // node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js
@@ -89,7 +93,8 @@ var stream = (model, context, options) => {
89
93
  throw new Error(`No API key for provider: ${model.provider}`);
90
94
  }
91
95
  const client = createClient(model, apiKey, options);
92
- let params = buildParams(model, context, options, deploymentName);
96
+ const grammarToolInputProperties = createGrammarToolInputProperties(context.tools, model.compat?.supportsOpenAIGrammarTools ?? false);
97
+ let params = buildParams(model, context, options, deploymentName, grammarToolInputProperties);
93
98
  const nextParams = await options?.onPayload?.(params, model);
94
99
  if (nextParams !== undefined) {
95
100
  params = nextParams;
@@ -97,12 +102,16 @@ var stream = (model, context, options) => {
97
102
  const requestOptions = {
98
103
  ...options?.signal ? { signal: options.signal } : {},
99
104
  ...options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {},
100
- maxRetries: options?.maxRetries ?? 0
105
+ maxRetries: 0
101
106
  };
102
- const { data: openaiStream, response } = await client.responses.create(params, requestOptions).withResponse();
107
+ const { data: openaiStream, response } = await retryProviderRequest(() => client.responses.create(params, requestOptions).withResponse(), {
108
+ maxRetries: options?.maxRetries,
109
+ maxRetryDelayMs: options?.maxRetryDelayMs,
110
+ signal: options?.signal
111
+ });
103
112
  await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model);
104
113
  stream2.push({ type: "start", partial: output });
105
- await processResponsesStream(openaiStream, output, stream2, model);
114
+ await processResponsesStream(openaiStream, output, stream2, model, { grammarToolInputProperties });
106
115
  if (options?.signal?.aborted) {
107
116
  throw new Error("Request was aborted");
108
117
  }
@@ -115,6 +124,7 @@ var stream = (model, context, options) => {
115
124
  for (const block of output.content) {
116
125
  delete block.index;
117
126
  delete block.partialJson;
127
+ delete block.customInput;
118
128
  }
119
129
  output.stopReason = options?.signal?.aborted ? "aborted" : "error";
120
130
  output.errorMessage = formatAzureOpenAIError(error);
@@ -189,8 +199,10 @@ function createClient(model, apiKey, options) {
189
199
  baseURL: baseUrl
190
200
  });
191
201
  }
192
- function buildParams(model, context, options, deploymentName) {
193
- const messages = convertResponsesMessages(model, context, AZURE_TOOL_CALL_PROVIDERS);
202
+ function buildParams(model, context, options, deploymentName, grammarToolInputProperties = createGrammarToolInputProperties(context.tools, model.compat?.supportsOpenAIGrammarTools ?? false)) {
203
+ const messages = convertResponsesMessages(model, context, AZURE_TOOL_CALL_PROVIDERS, {
204
+ grammarToolInputProperties
205
+ });
194
206
  const params = {
195
207
  model: deploymentName,
196
208
  input: messages,
@@ -205,7 +217,10 @@ function buildParams(model, context, options, deploymentName) {
205
217
  params.temperature = options?.temperature;
206
218
  }
207
219
  if (context.tools && context.tools.length > 0) {
208
- params.tools = convertResponsesTools(context.tools);
220
+ params.tools = convertResponsesTools(context.tools, {
221
+ supportsStrictMode: model.compat?.supportsStrictMode ?? true,
222
+ supportsOpenAIGrammarTools: model.compat?.supportsOpenAIGrammarTools ?? false
223
+ });
209
224
  }
210
225
  if (model.reasoning) {
211
226
  if (options?.reasoningEffort || options?.reasoningSummary) {
@@ -3,17 +3,17 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-r93nz80j.js";
6
+ } from "./cli-3fxqwfh3.js";
7
7
  import"./cli-q25ejbyn.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-g6qz2kts.js";
11
+ } from "./cli-0df2g86x.js";
12
12
  import"./cli-z2zcxes1.js";
13
+ import"./cli-46etyprn.js";
14
+ import"./cli-4j2mrzag.js";
13
15
  import"./cli-bw80ck94.js";
14
16
  import"./cli-xz9aq0rf.js";
15
- import"./cli-pasyk3vc.js";
16
- import"./cli-4j2mrzag.js";
17
17
  import"./cli-p9swy5t3.js";
18
18
 
19
19
  // src/be/memory/boot-reembed.ts
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-4s84mw72.js";
5
- import"./cli-r93nz80j.js";
4
+ } from "./cli-5hpvd15x.js";
5
+ import"./cli-3fxqwfh3.js";
6
6
  import"./cli-q25ejbyn.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-g6qz2kts.js";
10
+ } from "./cli-0df2g86x.js";
11
11
  import"./cli-z2zcxes1.js";
12
+ import"./cli-46etyprn.js";
13
+ import"./cli-4j2mrzag.js";
12
14
  import"./cli-bw80ck94.js";
13
15
  import"./cli-xz9aq0rf.js";
14
- import"./cli-pasyk3vc.js";
15
- import"./cli-4j2mrzag.js";
16
16
  import"./cli-p9swy5t3.js";
17
17
 
18
18
  // src/be/scripts/boot-reembed.ts
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-g6qz2kts.js";
4
+ } from "./cli-0df2g86x.js";
5
5
  import"./cli-z2zcxes1.js";
6
- import"./cli-bw80ck94.js";
7
- import"./cli-xz9aq0rf.js";
8
- import"./cli-pasyk3vc.js";
6
+ import"./cli-46etyprn.js";
9
7
  import {
10
8
  init_secret_scrubber,
11
9
  scrubSecrets
12
10
  } from "./cli-4j2mrzag.js";
11
+ import"./cli-bw80ck94.js";
12
+ import"./cli-xz9aq0rf.js";
13
13
  import"./cli-p9swy5t3.js";
14
14
 
15
15
  // src/be/boot-scrub-logs.ts
@@ -12,15 +12,15 @@ import {
12
12
  resolveClaudeBinary,
13
13
  resolveClaudeBinaryArgv,
14
14
  resolveClaudeBridgeEnabled
15
- } from "./cli-mw3xpgwb.js";
15
+ } from "./cli-x4apc9t3.js";
16
16
  import"./cli-psrqtw2m.js";
17
17
  import"./cli-tng3131n.js";
18
18
  import"./cli-zm7njwzd.js";
19
- import"./cli-tghre7g6.js";
19
+ import"./cli-cw70hymf.js";
20
20
  import"./cli-e61fs2hp.js";
21
+ import"./cli-7zd05xb4.js";
21
22
  import"./cli-z2zcxes1.js";
22
23
  import"./cli-4j2mrzag.js";
23
- import"./cli-7zd05xb4.js";
24
24
  import"./cli-p9swy5t3.js";
25
25
  export {
26
26
  resolveClaudeBridgeEnabled,
@@ -3,12 +3,12 @@ import {
3
3
  checkClaudeManagedCredentials,
4
4
  composeManagedUserMessage,
5
5
  normalizeRepoUrl
6
- } from "./cli-2r7s8jhp.js";
6
+ } from "./cli-5c4327dx.js";
7
7
  import"./cli-07er7wrs.js";
8
8
  import"./cli-yv9dttkh.js";
9
9
  import"./cli-d6n0thxw.js";
10
10
  import"./cli-gz9sbyk3.js";
11
- import"./cli-tghre7g6.js";
11
+ import"./cli-cw70hymf.js";
12
12
  import"./cli-4j2mrzag.js";
13
13
  import"./cli-p9swy5t3.js";
14
14
  export {