@desplega.ai/agent-swarm 1.152.2 → 1.154.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.
- package/README.md +2 -2
- package/dist/{acp-adapter-pfeje2v5.js → acp-adapter-eb2aj8xy.js} +4 -4
- package/dist/{actions-0sttc7f5.js → actions-kpnwp1kz.js} +31 -27
- package/dist/{anthropic-messages-2y8nktar.js → anthropic-messages-9vqsbznt.js} +112 -84
- package/dist/{app-p8teva95.js → app-zk1apkf6.js} +10 -7
- package/dist/{assistant-r45jnsrt.js → assistant-kwq4y50q.js} +32 -28
- package/dist/{azure-openai-responses-f38x2avq.js → azure-openai-responses-04qwdwfq.js} +27 -13
- package/dist/{boot-reembed-je26h5y7.js → boot-reembed-22hd3jjn.js} +9 -7
- package/dist/{boot-reembed-1qmybsd4.js → boot-reembed-qe168424.js} +10 -8
- package/dist/{boot-scrub-logs-gte3h1mm.js → boot-scrub-logs-pkdpsrjd.js} +7 -5
- package/dist/{claude-adapter-csc1mzka.js → claude-adapter-3fx90nww.js} +18 -16
- package/dist/{claude-managed-adapter-dsmkcrjy.js → claude-managed-adapter-ea2aga6w.js} +3 -3
- package/dist/{claude-sdk-session-fcd6f078.js → claude-sdk-session-z7fahf1k.js} +18 -16
- package/dist/{cli-r2fpe7cx.js → cli-00w2c66p.js} +61 -55
- package/dist/{cli-wbyk465z.js → cli-09y3tjxz.js} +1 -1
- package/dist/{cli-ht5rs63n.js → cli-0e31nm4n.js} +16 -7
- package/dist/cli-0x5qzvkg.js +4279 -0
- package/dist/{cli-d3p82erb.js → cli-18amys3y.js} +9 -9
- package/dist/{cli-4ahpr4sw.js → cli-1jpjafw4.js} +5 -5
- package/dist/{cli-jbmc0r7r.js → cli-243tzws8.js} +1 -1
- package/dist/{cli-ch38q5z4.js → cli-24k806sc.js} +6789 -2542
- package/dist/cli-3bkz2p7j.js +2828 -0
- package/dist/cli-3er6gcsn.js +1849 -0
- package/dist/cli-4k7jazkq.js +3339 -0
- package/dist/{cli-c4eeb5q2.js → cli-5b6b62tz.js} +1 -1
- package/dist/{cli-qd65dvr6.js → cli-5vs0nh43.js} +65 -44
- package/dist/{cli-z3wkng35.js → cli-6r3cgpk2.js} +224 -156
- package/dist/{cli-pgj4a5fb.js → cli-71cj99hx.js} +4 -3
- package/dist/cli-8sea27q4.js +14075 -0
- package/dist/{cli-jvy9qgjs.js → cli-913yakhv.js} +22 -7
- package/dist/{cli-pf9q3696.js → cli-927erqqt.js} +5 -2
- package/dist/cli-95jnpnqg.js +230 -0
- package/dist/{cli-wpv5rgg2.js → cli-abp3g4ax.js} +15 -2
- package/dist/{cli-ckz5t2hb.js → cli-acy6bfhr.js} +10 -7
- package/dist/{cli-4yc5d8fk.js → cli-avkd6mqv.js} +50 -0
- package/dist/{cli-8wrympd7.js → cli-bzr0ftht.js} +26 -7
- package/dist/{cli-qn042eh7.js → cli-c1v10xb2.js} +194 -1913
- package/dist/cli-cgj4hc12.js +18902 -0
- package/dist/{cli-2nnd56zt.js → cli-e0pg4zeh.js} +3 -2
- package/dist/{cli-r84ctdxn.js → cli-e31ehqwy.js} +2 -2
- package/dist/{cli-gphgnvpf.js → cli-e3229na9.js} +3 -3
- package/dist/{cli-gpqcs935.js → cli-e3cyf59d.js} +2 -2
- package/dist/{cli-s25avqg9.js → cli-e781c6f9.js} +1 -0
- package/dist/{cli-s2qjdd6z.js → cli-eetrvv91.js} +1 -1
- package/dist/{cli-j4nv2wqy.js → cli-fdzg6jhf.js} +10 -4
- package/dist/{cli-fm4ytsdk.js → cli-g2h29qar.js} +2 -2
- package/dist/{cli-zvgj5zg8.js → cli-ge67p080.js} +302 -3497
- package/dist/cli-h38x0qhg.js +6912 -0
- package/dist/{cli-9xvdm3bx.js → cli-h60qfasa.js} +742 -278
- package/dist/{cli-jew3jda5.js → cli-hws0vn86.js} +2 -2
- package/dist/{cli-j8dggbcr.js → cli-k0g1sjzm.js} +23 -31
- package/dist/{cli-xw7vak96.js → cli-kp3qs53m.js} +5 -5
- package/dist/{cli-rgvp6r2x.js → cli-mcnhgnn1.js} +193 -4
- package/dist/{cli-zvkq5csn.js → cli-myaxtgh8.js} +7 -6
- package/dist/{cli-56h18ng2.js → cli-n62atwh9.js} +1 -1
- package/dist/cli-n7h1kqpf.js +29 -0
- package/dist/{cli-fmy65jdn.js → cli-pf1v8xhb.js} +7 -5
- package/dist/{cli-xy1cchaf.js → cli-q85qhckh.js} +238 -11
- package/dist/{cli-3bpzj8me.js → cli-r1d3dzt6.js} +2 -2
- package/dist/{pi-mono-adapter-jcqt71cg.js → cli-rxkqvngf.js} +67343 -101083
- package/dist/{cli-kj76p1ez.js → cli-scwq51gn.js} +13 -7
- package/dist/{cli-b9dd0h3k.js → cli-stwsmd6k.js} +3 -2
- package/dist/{cli-c2mk1kgf.js → cli-v4en75c5.js} +8 -1
- package/dist/{cli-z61ykvam.js → cli-wg04s9kr.js} +4 -3
- package/dist/cli-yn0a417a.js +4069 -0
- package/dist/{cli-zfzznn7c.js → cli-ytxs7mn1.js} +26 -2
- package/dist/{cli-4j8k1m4w.js → cli-zt1227k1.js} +1162 -192
- package/dist/cli.js +28 -35
- package/dist/{codex-adapter-fxmpsabw.js → codex-adapter-ttdm995v.js} +12 -11
- package/dist/{codex-hook-8jexc34x.js → codex-hook-8gx7bcz0.js} +3 -3
- package/dist/{codex-session-runner-rr1e47ea.js → codex-session-runner-3v8nh4c8.js} +12 -11
- package/dist/{commands-0f5rxz51.js → commands-1cxwbhhq.js} +7 -5
- package/dist/{db-r3jxf3wy.js → db-y9zwsr79.js} +25 -5
- package/dist/{dispatcher-06vph6q4.js → dispatcher-9m9zss36.js} +30 -26
- package/dist/dsh-adapter-gsb2qqf9.js +19 -0
- package/dist/{e2b-413b8t4v.js → e2b-93x1k0j5.js} +6 -7
- package/dist/{google-generative-ai-ndjmj5fa.js → google-generative-ai-gwwrnzqn.js} +33 -73
- package/dist/{google-vertex-fr665tqs.js → google-vertex-5wfawpwz.js} +38 -68
- package/dist/{handlers-0hgtc910.js → handlers-36fm1bwn.js} +33 -29
- package/dist/{hook-9kvrv1er.js → hook-pntw4r8h.js} +12 -10
- package/dist/{hook-fbfhkat3.js → hook-vwq8y26p.js} +13 -11
- package/dist/{http-xbyx8k5j.js → http-20jesakk.js} +357 -261
- package/dist/{index-jsw3aynb.js → index-6artrehg.js} +30 -26
- package/dist/{cli-pdz9qde4.js → index-9ch1n761.js} +10 -11
- package/dist/{index-rnyahfn5.js → index-9n5z2492.js} +30 -26
- package/dist/{index-66xz5e9j.js → index-h5gs261z.js} +521 -9
- package/dist/{index-tfsdxyv6.js → index-j5wrf1yw.js} +40 -25
- package/dist/{index-2sp0384z.js → index-kkeftv5h.js} +738 -21
- package/dist/{index-sgk50mbg.js → index-m2xqpz5r.js} +31 -27
- package/dist/{index-gpfn1741.js → index-m9ks8a7t.js} +9 -7
- package/dist/index-w097eg0x.js +5 -0
- package/dist/jiti-loader-b4837mtm.js +34 -0
- package/dist/jiti-static-loader-q2g5ds0y.js +31267 -0
- package/dist/{keepalive-s3xpr7sw.js → keepalive-pwxvxd2c.js} +9 -7
- package/dist/{lead-rq4n5r16.js → lead-m789wqa3.js} +46 -41
- package/dist/{maintenance-f0atj1ab.js → maintenance-bvg6w7e2.js} +10 -8
- package/dist/{mistral-conversations-qhr84ph3.js → mistral-conversations-zx0kn554.js} +24 -18
- package/dist/{node-x1g4v0pq.js → node-5qtycf6a.js} +16 -11
- package/dist/{oauth-refresh-sweep-q0t3bxre.js → oauth-refresh-sweep-6v4bd737.js} +8 -6
- package/dist/{onboard-br5j1kch.js → onboard-snckpcj1.js} +115 -35
- package/dist/{openai-codex-responses-wy6a43wd.js → openai-codex-responses-4vjqzvjp.js} +33 -27
- package/dist/{openai-completions-32rdwmze.js → openai-completions-pxsmym7g.js} +52 -64
- package/dist/{openai-responses-6xwf7bzg.js → openai-responses-tmn0rqp0.js} +23 -24
- package/dist/{opencode-adapter-28axqa09.js → opencode-adapter-qbmv4tpy.js} +6 -6
- package/dist/{otel-impl-vdqge2nt.js → otel-impl-e0ytens5.js} +4 -4
- package/dist/{pi-messages-b1mbr6gp.js → pi-messages-txpjj39q.js} +3 -3
- package/dist/pi-mono-adapter-c4ggemhz.js +1316 -0
- package/dist/{pricing-refresh-hb3691fd.js → pricing-refresh-52g2ywrw.js} +9 -7
- package/dist/{rbac-roles-t78xt39b.js → rbac-roles-5455kfdn.js} +8 -6
- package/dist/{rbac-roles-jh280k9g.js → rbac-roles-hbf0xa52.js} +9 -7
- package/dist/{render-v2-7p8r2ymg.js → render-v2-npm8xdzh.js} +16 -9
- package/dist/{seed-pricing-hf889enh.js → seed-pricing-650wbr1n.js} +8 -6
- package/dist/{setup-w6mb03jv.js → setup-k1mew5rf.js} +4 -5
- package/dist/virtual-modules-2q5b2pk4.js +54 -0
- package/dist/{work-objects-nt8gy1kj.js → work-objects-2ea3kvwg.js} +33 -29
- package/dist/{worker-dwy617t0.js → worker-ec6hvc4m.js} +46 -41
- package/openapi.json +109 -16
- package/package.json +7 -6
- package/plugin/opencode-plugins/lib/memory-raters.ts +7 -0
- package/src/be/automation-preflight.ts +6 -4
- package/src/be/db/agents.ts +75 -2
- package/src/be/db/tasks/read.ts +2 -0
- package/src/be/db/tasks/write.ts +7 -1
- package/src/be/db.ts +140 -18
- package/src/be/extensions/db.ts +35 -4
- package/src/be/memory/raters/llm.ts +2 -6
- package/src/be/memory/raters/noop.ts +2 -3
- package/src/be/memory/raters/registry.ts +4 -10
- package/src/be/migrations/157_defer_provenance_and_marker.sql +27 -0
- package/src/be/models-catalog.ts +2 -0
- package/src/be/modelsdev-cache.json +213 -0
- package/src/be/rbac-audit.ts +2 -0
- package/src/be/seed/agent-fs-provision.ts +23 -0
- package/src/be/seed-pricing.ts +3 -1
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/onboard/compose-generator.ts +16 -1
- package/src/commands/onboard/env-generator.ts +14 -1
- package/src/commands/onboard/manifest.ts +1 -0
- package/src/commands/onboard/steps/integration-slack.tsx +56 -16
- package/src/commands/onboard/steps/review.tsx +5 -0
- package/src/commands/onboard/types.ts +6 -0
- package/src/commands/onboard.tsx +5 -1
- package/src/commands/provider-credentials.ts +14 -2
- package/src/commands/runner.ts +18 -2
- package/src/extensions/identity.ts +15 -7
- package/src/extensions/lifecycle.ts +15 -21
- package/src/hooks/codex-hook.ts +7 -1
- package/src/http/agents.ts +12 -4
- package/src/http/config.ts +1 -1
- package/src/http/core.ts +5 -3
- package/src/http/extensions.ts +108 -34
- package/src/http/poll.ts +7 -0
- package/src/http/schedules.ts +10 -0
- package/src/http/script-runs.ts +35 -26
- package/src/http/status.ts +24 -11
- package/src/http/tasks.ts +6 -1
- package/src/prompts/base-prompt.ts +15 -7
- package/src/prompts/memories.ts +5 -7
- package/src/prompts/session-templates.ts +3 -2
- package/src/prompts/steering-delivery.ts +2 -0
- package/src/providers/claude-managed-models.ts +8 -0
- package/src/providers/codex-adapter.ts +3 -6
- package/src/providers/codex-models.ts +15 -1
- package/src/providers/dsh-adapter.ts +248 -0
- package/src/providers/index.ts +5 -1
- package/src/providers/modelsdev-reasoning.json +50 -0
- package/src/providers/pi-mono-extension.ts +2 -5
- package/src/rbac/legacy-policy.ts +15 -1
- package/src/rbac/types.ts +2 -0
- package/src/server.ts +7 -1
- package/src/slack/ack.ts +43 -8
- package/src/slack/app.ts +32 -10
- package/src/slack/config.ts +29 -0
- package/src/slack/handlers.ts +7 -1
- package/src/slack/render-v2.ts +186 -17
- package/src/slack/responses.ts +1 -3
- package/src/slack/task-output.ts +66 -8
- package/src/slack/thread-buffer.ts +27 -3
- package/src/telemetry.ts +2 -3
- package/src/tests/agent-fs-provision-seeder.test.ts +56 -2
- package/src/tests/agents-harness-provider.test.ts +19 -0
- package/src/tests/agents-list-model-display.test.ts +60 -1
- package/src/tests/base-prompt.test.ts +25 -0
- package/src/tests/claude-managed-adapter.test.ts +6 -0
- package/src/tests/codex-gpt6-release.test.ts +97 -0
- package/src/tests/codex-steering-hook.test.ts +2 -2
- package/src/tests/config-api-only-keys.test.ts +9 -0
- package/src/tests/context-window.test.ts +1 -0
- package/src/tests/db-task-read-contract.test.ts +9 -0
- package/src/tests/db-task-write-contract.test.ts +9 -0
- package/src/tests/defer-task.test.ts +115 -16
- package/src/tests/dsh-adapter.test.ts +276 -0
- package/src/tests/e2e-nightly-report.test.ts +3 -3
- package/src/tests/e2e-redact.test.ts +2 -0
- package/src/tests/env-flag.test.ts +6 -0
- package/src/tests/extension-agent-visibility.test.ts +474 -0
- package/src/tests/extensions-db.test.ts +41 -0
- package/src/tests/extensions-http.test.ts +148 -4
- package/src/tests/extensions-lifecycle.test.ts +21 -1
- package/src/tests/extensions-mcp-tools.test.ts +9 -5
- package/src/tests/fetch-resolved-env.test.ts +43 -0
- package/src/tests/internal-ai/complete-structured.test.ts +32 -9
- package/src/tests/internal-ai/credentials.test.ts +4 -4
- package/src/tests/internal-ai/models.test.ts +20 -0
- package/src/tests/memory-rate-tool.test.ts +7 -10
- package/src/tests/memory-rater-defaults.test.ts +23 -0
- package/src/tests/memory-rater-e2e.test.ts +2 -3
- package/src/tests/migration-046-budgets.test.ts +2 -0
- package/src/tests/model-control.test.ts +2 -2
- package/src/tests/onboard-compose.test.ts +14 -0
- package/src/tests/onboard-env.test.ts +17 -0
- package/src/tests/onboard-manifest.test.ts +12 -0
- package/src/tests/opus-5-5-registry.test.ts +48 -0
- package/src/tests/pricing-refresh.test.ts +1 -1
- package/src/tests/pricing-routes.test.ts +15 -3
- package/src/tests/provider-registration.test.ts +5 -2
- package/src/tests/rbac-admission-e2e.test.ts +54 -0
- package/src/tests/rbac-e2e-helpers.ts +2 -0
- package/src/tests/rbac-engine.test.ts +32 -0
- package/src/tests/rbac-wire-e2e.test.ts +33 -0
- package/src/tests/reasoning-effort.test.ts +8 -0
- package/src/tests/reload-config.test.ts +33 -0
- package/src/tests/script-connections.test.ts +3 -0
- package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
- package/src/tests/slack-config.test.ts +136 -0
- package/src/tests/slack-mode-lifecycle.test.ts +69 -0
- package/src/tests/slack-render-v2.test.ts +446 -16
- package/src/tests/slack-steering.test.ts +69 -1
- package/src/tests/slack-task-output.test.ts +33 -12
- package/src/tests/status.test.ts +22 -2
- package/src/tests/steering-core.test.ts +35 -0
- package/src/tests/steering-delivery.test.ts +39 -0
- package/src/tests/steering-transport.test.ts +2 -2
- package/src/tests/task-tool-preload-mcp.test.ts +3 -1
- package/src/tests/telemetry-init.test.ts +18 -0
- package/src/tests/workflow-live-recovery.test.ts +126 -0
- package/src/tests/workflow-llm.test.ts +3 -3
- package/src/tools/defer-task.ts +64 -26
- package/src/tools/extension-common.ts +4 -0
- package/src/tools/extension-install.ts +1 -1
- package/src/tools/extension-list.ts +4 -3
- package/src/tools/join-swarm.ts +1 -1
- package/src/tools/schedules/create-schedule.ts +11 -1
- package/src/tools/schedules/patch-schedule.ts +5 -0
- package/src/tools/schedules/update-schedule.ts +5 -0
- package/src/tools/send-task.ts +6 -0
- package/src/tools/utils.ts +1 -1
- package/src/types.ts +30 -8
- package/src/utils/context-window.ts +1 -0
- package/src/utils/credentials.ts +8 -0
- package/src/utils/internal-ai/complete-structured.ts +8 -0
- package/src/utils/internal-ai/models.ts +5 -5
- package/src/utils/memory-raters.ts +3 -0
- package/src/workflows/engine.ts +28 -0
- package/src/workflows/recovery.ts +7 -4
- package/templates/schedules/daily-status-report/content.md +25 -12
- package/templates/schedules/daily-workflow-health-audit/content.md +1 -1
- package/templates/skills/swarm-extensions/content.md +9 -5
- package/dist/cli-4wppfkcm.js +0 -16384
- package/dist/cli-55qrx3q8.js +0 -6041
- package/dist/cli-cg4vnyh4.js +0 -305
- package/dist/cli-jyetr64j.js +0 -52
- package/dist/cli-pp9ax9pa.js +0 -520
- package/dist/cli-qa66qaf0.js +0 -6076
- package/dist/cli-qghpvca2.js +0 -590
- package/dist/cli-rembwgt8.js +0 -861
- package/dist/cli-tcvj7j2r.js +0 -1971
- package/dist/cli-vfcth11k.js +0 -36
- package/dist/cli-w1d1bgkk.js +0 -1422
- package/dist/cli-y6x0gqtg.js +0 -5977
- package/dist/es5-tj3tn4jj.js +0 -844
- package/dist/index-1kq5hw2p.js +0 -467
- package/dist/index-1p8wdstt.js +0 -7
- package/dist/index-8fdjzb2f.js +0 -100
- package/dist/index-bxmwzbgw.js +0 -365
- package/dist/index-nzerxd5z.js +0 -7
- package/dist/index-pyymnzat.js +0 -1168
- package/dist/index-qv6atbab.js +0 -619
- package/dist/index-rja32qa7.js +0 -801
- package/dist/index-tzg5srfp.js +0 -211
- package/dist/index-vhncw983.js +0 -90
- package/dist/index-xk036zsk.js +0 -859
- package/dist/index-zyazbzcb.js +0 -6
- package/dist/{claude-managed-setup-48dwg9bv.js → claude-managed-setup-f5pmsyrp.js} +3 -3
|
@@ -2,49 +2,51 @@ import {
|
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
getBufferMessageCount,
|
|
4
4
|
wasEventSeen
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-913yakhv.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveSlackUserId,
|
|
8
8
|
rewriteSlackMentions
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-r1d3dzt6.js";
|
|
10
10
|
import {
|
|
11
11
|
buildEffectiveText,
|
|
12
12
|
createSlackTaskWithFiles,
|
|
13
13
|
fetchSlackFiles,
|
|
14
14
|
hasOtherUserMention,
|
|
15
15
|
notifySlackFileFailures
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-6r3cgpk2.js";
|
|
17
17
|
import"./cli-0z2v4nhw.js";
|
|
18
|
-
import"./cli-
|
|
18
|
+
import"./cli-3bkz2p7j.js";
|
|
19
19
|
import"./cli-e7d20cty.js";
|
|
20
20
|
import"./cli-re8z5p8p.js";
|
|
21
21
|
import"./cli-3dpj7atn.js";
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
22
|
+
import"./cli-8sea27q4.js";
|
|
23
|
+
import"./cli-stwsmd6k.js";
|
|
24
|
+
import"./cli-e0pg4zeh.js";
|
|
25
|
+
import"./cli-e31ehqwy.js";
|
|
26
|
+
import"./cli-ytxs7mn1.js";
|
|
27
|
+
import"./cli-pf1v8xhb.js";
|
|
26
28
|
import"./cli-epan13p1.js";
|
|
27
29
|
import"./cli-y89t4nca.js";
|
|
28
30
|
import"./cli-f14fvzag.js";
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-56h18ng2.js";
|
|
31
|
-
import"./cli-2nnd56zt.js";
|
|
31
|
+
import"./cli-n62atwh9.js";
|
|
32
32
|
import"./cli-bsakbbkm.js";
|
|
33
|
-
import"./cli-
|
|
33
|
+
import"./cli-fad8m16k.js";
|
|
34
|
+
import"./cli-jsp14b6c.js";
|
|
35
|
+
import"./cli-e3cyf59d.js";
|
|
36
|
+
import"./cli-hws0vn86.js";
|
|
37
|
+
import"./cli-g2h29qar.js";
|
|
38
|
+
import"./cli-aehm1rbq.js";
|
|
34
39
|
import"./cli-51tf7ac3.js";
|
|
35
40
|
import {
|
|
36
41
|
ackSlackMessage,
|
|
37
42
|
ensureSlackThreadTree,
|
|
38
43
|
isSlackRenderV2Enabled,
|
|
39
44
|
require_dist
|
|
40
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-c1v10xb2.js";
|
|
41
46
|
import"./cli-q51yprfq.js";
|
|
47
|
+
import"./cli-3er6gcsn.js";
|
|
42
48
|
import"./cli-yatxqynm.js";
|
|
43
|
-
import"./cli-jew3jda5.js";
|
|
44
|
-
import"./cli-fm4ytsdk.js";
|
|
45
|
-
import"./cli-aehm1rbq.js";
|
|
46
49
|
import"./cli-2658f6at.js";
|
|
47
|
-
import"./cli-jsp14b6c.js";
|
|
48
50
|
import {
|
|
49
51
|
getAgentWorkingOnThread,
|
|
50
52
|
getLeadAgent,
|
|
@@ -53,31 +55,33 @@ import {
|
|
|
53
55
|
init_db,
|
|
54
56
|
reactionName,
|
|
55
57
|
slackContextKey
|
|
56
|
-
} from "./cli-
|
|
57
|
-
import"./cli-
|
|
58
|
+
} from "./cli-ge67p080.js";
|
|
59
|
+
import"./cli-4k7jazkq.js";
|
|
60
|
+
import"./cli-0e31nm4n.js";
|
|
58
61
|
import {
|
|
59
62
|
init_resolver,
|
|
60
63
|
resolveTemplate
|
|
61
|
-
} from "./cli-
|
|
64
|
+
} from "./cli-wg04s9kr.js";
|
|
65
|
+
import"./cli-v4en75c5.js";
|
|
62
66
|
import"./cli-dv6cdjs2.js";
|
|
63
|
-
import"./cli-
|
|
67
|
+
import"./cli-n7h1kqpf.js";
|
|
64
68
|
import {
|
|
65
69
|
init_env_flag,
|
|
66
70
|
isEnvFlagEnabled
|
|
67
71
|
} from "./cli-ej6gbxfb.js";
|
|
68
72
|
import"./cli-sd0mxa3c.js";
|
|
69
73
|
import"./cli-w5e1d1vv.js";
|
|
70
|
-
import"./cli-
|
|
74
|
+
import"./cli-myaxtgh8.js";
|
|
71
75
|
import"./cli-r2ap2czm.js";
|
|
72
|
-
import"./cli-
|
|
73
|
-
import"./cli-f7kvq46p.js";
|
|
74
|
-
import"./cli-zf8jjwex.js";
|
|
75
|
-
import"./cli-c4eeb5q2.js";
|
|
76
|
-
import"./cli-rgvp6r2x.js";
|
|
76
|
+
import"./cli-5b6b62tz.js";
|
|
77
77
|
import"./cli-btbzvq95.js";
|
|
78
78
|
import"./cli-1m2e086m.js";
|
|
79
|
-
import"./cli-
|
|
79
|
+
import"./cli-mcnhgnn1.js";
|
|
80
|
+
import"./cli-bzr0ftht.js";
|
|
80
81
|
import"./cli-bd957dgb.js";
|
|
82
|
+
import"./cli-pzxba7gw.js";
|
|
83
|
+
import"./cli-f7kvq46p.js";
|
|
84
|
+
import"./cli-zf8jjwex.js";
|
|
81
85
|
import {
|
|
82
86
|
__callDispose,
|
|
83
87
|
__toESM,
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
convertResponsesMessages,
|
|
3
3
|
convertResponsesTools,
|
|
4
4
|
processResponsesStream
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-00w2c66p.js";
|
|
6
6
|
import {
|
|
7
7
|
clampOpenAIPromptCacheKey
|
|
8
8
|
} from "./cli-mrptpp86.js";
|
|
9
|
-
import"./cli-5m9j2spm.js";
|
|
10
9
|
import {
|
|
11
10
|
retryProviderRequest
|
|
12
11
|
} from "./cli-s8s499xy.js";
|
|
12
|
+
import"./cli-5m9j2spm.js";
|
|
13
13
|
import {
|
|
14
14
|
getPiUserAgent
|
|
15
15
|
} from "./cli-et1bbwqf.js";
|
|
@@ -24,21 +24,24 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
buildBaseOptions,
|
|
26
26
|
createGrammarToolInputProperties
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-k0g1sjzm.js";
|
|
28
28
|
import"./cli-y2apkfe2.js";
|
|
29
29
|
import {
|
|
30
30
|
headersToRecord
|
|
31
31
|
} from "./cli-vapyk8sw.js";
|
|
32
|
-
import {
|
|
33
|
-
clampThinkingLevel
|
|
34
|
-
} from "./cli-rgvp6r2x.js";
|
|
35
32
|
import {
|
|
36
33
|
getProviderEnvValue
|
|
37
34
|
} from "./cli-btbzvq95.js";
|
|
38
35
|
import"./cli-1m2e086m.js";
|
|
36
|
+
import {
|
|
37
|
+
clampThinkingLevel,
|
|
38
|
+
getDeclaredTools,
|
|
39
|
+
resolveTranscript,
|
|
40
|
+
resolveTranscriptTools
|
|
41
|
+
} from "./cli-mcnhgnn1.js";
|
|
39
42
|
import {
|
|
40
43
|
AssistantMessageEventStream
|
|
41
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-bzr0ftht.js";
|
|
42
45
|
import"./cli-bc05qbss.js";
|
|
43
46
|
|
|
44
47
|
// node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js
|
|
@@ -73,6 +76,7 @@ function formatAzureOpenAIError(error) {
|
|
|
73
76
|
}
|
|
74
77
|
var stream = (model, context, options) => {
|
|
75
78
|
const stream2 = new AssistantMessageEventStream;
|
|
79
|
+
const normalizedContext = resolveTranscript(context, model.compat?.supportsMidConvoSystemMessages);
|
|
76
80
|
(async () => {
|
|
77
81
|
const deploymentName = resolveDeploymentName(model, options);
|
|
78
82
|
const output = {
|
|
@@ -98,8 +102,8 @@ var stream = (model, context, options) => {
|
|
|
98
102
|
throw new Error(`No API key for provider: ${model.provider}`);
|
|
99
103
|
}
|
|
100
104
|
const client = createClient(model, apiKey, options);
|
|
101
|
-
const grammarToolInputProperties = createGrammarToolInputProperties(
|
|
102
|
-
let params = buildParams(model,
|
|
105
|
+
const grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(normalizedContext.messages), model.compat?.supportsOpenAIGrammarTools ?? false);
|
|
106
|
+
let params = buildParams(model, normalizedContext, options, deploymentName, grammarToolInputProperties);
|
|
103
107
|
const nextParams = await options?.onPayload?.(params, model);
|
|
104
108
|
if (nextParams !== undefined) {
|
|
105
109
|
params = nextParams;
|
|
@@ -211,9 +215,19 @@ function createClient(model, apiKey, options) {
|
|
|
211
215
|
baseURL: baseUrl
|
|
212
216
|
});
|
|
213
217
|
}
|
|
214
|
-
function buildParams(model, context, options, deploymentName, grammarToolInputProperties = createGrammarToolInputProperties(context.
|
|
218
|
+
function buildParams(model, context, options, deploymentName, grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(context.messages), model.compat?.supportsOpenAIGrammarTools ?? false)) {
|
|
219
|
+
const supportsAdditionalTools = model.compat?.supportsAdditionalTools ?? false;
|
|
220
|
+
const supportsToolSearch = model.compat?.supportsToolSearch ?? false;
|
|
221
|
+
const transcriptTools = resolveTranscriptTools(context.messages, supportsAdditionalTools || supportsToolSearch);
|
|
215
222
|
const messages = convertResponsesMessages(model, context, AZURE_TOOL_CALL_PROVIDERS, {
|
|
216
|
-
grammarToolInputProperties
|
|
223
|
+
grammarToolInputProperties,
|
|
224
|
+
supportsMidConvoSystemMessages: model.compat?.supportsMidConvoSystemMessages ?? false,
|
|
225
|
+
supportsAdditionalTools,
|
|
226
|
+
supportsToolSearch,
|
|
227
|
+
toolOptions: {
|
|
228
|
+
supportsStrictMode: model.compat?.supportsStrictMode ?? true,
|
|
229
|
+
supportsOpenAIGrammarTools: model.compat?.supportsOpenAIGrammarTools ?? false
|
|
230
|
+
}
|
|
217
231
|
});
|
|
218
232
|
const params = {
|
|
219
233
|
model: deploymentName,
|
|
@@ -228,8 +242,8 @@ function buildParams(model, context, options, deploymentName, grammarToolInputPr
|
|
|
228
242
|
if (options?.temperature !== undefined) {
|
|
229
243
|
params.temperature = options?.temperature;
|
|
230
244
|
}
|
|
231
|
-
if (
|
|
232
|
-
params.tools = convertResponsesTools(
|
|
245
|
+
if (transcriptTools.requestTools.length > 0) {
|
|
246
|
+
params.tools = convertResponsesTools(transcriptTools.requestTools, {
|
|
233
247
|
supportsStrictMode: model.compat?.supportsStrictMode ?? true,
|
|
234
248
|
supportsOpenAIGrammarTools: model.compat?.supportsOpenAIGrammarTools ?? false
|
|
235
249
|
});
|
|
@@ -3,22 +3,24 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-hws0vn86.js";
|
|
7
|
+
import"./cli-g2h29qar.js";
|
|
8
8
|
import"./cli-aehm1rbq.js";
|
|
9
9
|
import"./cli-2658f6at.js";
|
|
10
10
|
import {
|
|
11
11
|
getDbClient,
|
|
12
12
|
init_db
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
13
|
+
} from "./cli-ge67p080.js";
|
|
14
|
+
import"./cli-4k7jazkq.js";
|
|
15
|
+
import"./cli-0e31nm4n.js";
|
|
16
|
+
import"./cli-wg04s9kr.js";
|
|
17
|
+
import"./cli-v4en75c5.js";
|
|
16
18
|
import"./cli-dv6cdjs2.js";
|
|
17
|
-
import"./cli-
|
|
19
|
+
import"./cli-n7h1kqpf.js";
|
|
18
20
|
import"./cli-ej6gbxfb.js";
|
|
19
21
|
import"./cli-sd0mxa3c.js";
|
|
20
22
|
import"./cli-w5e1d1vv.js";
|
|
21
|
-
import"./cli-
|
|
23
|
+
import"./cli-myaxtgh8.js";
|
|
22
24
|
import"./cli-r2ap2czm.js";
|
|
23
25
|
import"./cli-zf8jjwex.js";
|
|
24
26
|
import"./cli-bc05qbss.js";
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
4
|
+
} from "./cli-e3cyf59d.js";
|
|
5
|
+
import"./cli-hws0vn86.js";
|
|
6
|
+
import"./cli-g2h29qar.js";
|
|
7
7
|
import"./cli-aehm1rbq.js";
|
|
8
8
|
import"./cli-2658f6at.js";
|
|
9
9
|
import {
|
|
10
10
|
getDbClient,
|
|
11
11
|
init_db
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
12
|
+
} from "./cli-ge67p080.js";
|
|
13
|
+
import"./cli-4k7jazkq.js";
|
|
14
|
+
import"./cli-0e31nm4n.js";
|
|
15
|
+
import"./cli-wg04s9kr.js";
|
|
16
|
+
import"./cli-v4en75c5.js";
|
|
15
17
|
import"./cli-dv6cdjs2.js";
|
|
16
|
-
import"./cli-
|
|
18
|
+
import"./cli-n7h1kqpf.js";
|
|
17
19
|
import"./cli-ej6gbxfb.js";
|
|
18
20
|
import"./cli-sd0mxa3c.js";
|
|
19
21
|
import"./cli-w5e1d1vv.js";
|
|
20
|
-
import"./cli-
|
|
22
|
+
import"./cli-myaxtgh8.js";
|
|
21
23
|
import"./cli-r2ap2czm.js";
|
|
22
24
|
import"./cli-zf8jjwex.js";
|
|
23
25
|
import"./cli-bc05qbss.js";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDbClient,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
4
|
+
} from "./cli-ge67p080.js";
|
|
5
|
+
import"./cli-4k7jazkq.js";
|
|
6
|
+
import"./cli-0e31nm4n.js";
|
|
7
|
+
import"./cli-wg04s9kr.js";
|
|
8
|
+
import"./cli-v4en75c5.js";
|
|
7
9
|
import"./cli-dv6cdjs2.js";
|
|
8
|
-
import"./cli-
|
|
10
|
+
import"./cli-n7h1kqpf.js";
|
|
9
11
|
import"./cli-ej6gbxfb.js";
|
|
10
12
|
import"./cli-sd0mxa3c.js";
|
|
11
13
|
import"./cli-w5e1d1vv.js";
|
|
12
|
-
import"./cli-
|
|
14
|
+
import"./cli-myaxtgh8.js";
|
|
13
15
|
import {
|
|
14
16
|
init_secret_scrubber,
|
|
15
17
|
scrubSecrets
|
|
@@ -17,41 +17,43 @@ import {
|
|
|
17
17
|
resolveClaudeBridgeEnabled,
|
|
18
18
|
resolveClaudeQueueSteeringOverride,
|
|
19
19
|
runClaudeSessionSummary
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
20
|
+
} from "./cli-kp3qs53m.js";
|
|
21
|
+
import"./cli-1jpjafw4.js";
|
|
22
|
+
import"./cli-09y3tjxz.js";
|
|
23
23
|
import"./cli-tng3131n.js";
|
|
24
24
|
import"./cli-b5b30yzk.js";
|
|
25
25
|
import"./cli-zm7njwzd.js";
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
26
|
+
import"./cli-e781c6f9.js";
|
|
27
|
+
import"./cli-fdzg6jhf.js";
|
|
28
28
|
import"./cli-hp1n6zq3.js";
|
|
29
29
|
import"./cli-eree7rnv.js";
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
30
|
+
import"./cli-avkd6mqv.js";
|
|
31
|
+
import"./cli-3bkz2p7j.js";
|
|
32
32
|
import"./cli-e7d20cty.js";
|
|
33
33
|
import"./cli-re8z5p8p.js";
|
|
34
34
|
import"./cli-3dpj7atn.js";
|
|
35
|
+
import"./cli-8sea27q4.js";
|
|
35
36
|
import"./cli-y89t4nca.js";
|
|
36
37
|
import"./cli-f14fvzag.js";
|
|
37
38
|
import"./cli-bsakbbkm.js";
|
|
38
|
-
import"./cli-
|
|
39
|
+
import"./cli-g2h29qar.js";
|
|
39
40
|
import"./cli-2658f6at.js";
|
|
40
|
-
import"./cli-
|
|
41
|
-
import"./cli-
|
|
41
|
+
import"./cli-0e31nm4n.js";
|
|
42
|
+
import"./cli-wg04s9kr.js";
|
|
43
|
+
import"./cli-v4en75c5.js";
|
|
42
44
|
import"./cli-dv6cdjs2.js";
|
|
43
|
-
import"./cli-
|
|
45
|
+
import"./cli-n7h1kqpf.js";
|
|
44
46
|
import"./cli-ej6gbxfb.js";
|
|
45
47
|
import"./cli-sd0mxa3c.js";
|
|
46
48
|
import"./cli-w5e1d1vv.js";
|
|
47
|
-
import"./cli-
|
|
49
|
+
import"./cli-myaxtgh8.js";
|
|
48
50
|
import"./cli-r2ap2czm.js";
|
|
49
|
-
import"./cli-
|
|
50
|
-
import"./cli-c4eeb5q2.js";
|
|
51
|
-
import"./cli-rgvp6r2x.js";
|
|
51
|
+
import"./cli-5b6b62tz.js";
|
|
52
52
|
import"./cli-btbzvq95.js";
|
|
53
53
|
import"./cli-1m2e086m.js";
|
|
54
|
-
import"./cli-
|
|
54
|
+
import"./cli-mcnhgnn1.js";
|
|
55
|
+
import"./cli-bzr0ftht.js";
|
|
56
|
+
import"./cli-knd276ed.js";
|
|
55
57
|
import"./cli-bc05qbss.js";
|
|
56
58
|
export {
|
|
57
59
|
ClaudeAdapter,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
checkClaudeManagedCredentials,
|
|
4
4
|
composeManagedUserMessage,
|
|
5
5
|
normalizeRepoUrl
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-scwq51gn.js";
|
|
7
7
|
import"./cli-hsxj0yar.js";
|
|
8
|
-
import"./cli-s25avqg9.js";
|
|
9
8
|
import"./cli-2djtr51b.js";
|
|
10
|
-
import"./cli-hp1n6zq3.js";
|
|
11
9
|
import"./cli-j490egb5.js";
|
|
10
|
+
import"./cli-e781c6f9.js";
|
|
11
|
+
import"./cli-hp1n6zq3.js";
|
|
12
12
|
import"./cli-r2ap2czm.js";
|
|
13
13
|
import"./cli-bc05qbss.js";
|
|
14
14
|
export {
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
cleanupTaskFile,
|
|
4
4
|
normalizeClaudeMessage,
|
|
5
5
|
runClaudeSessionSummary
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
6
|
+
} from "./cli-kp3qs53m.js";
|
|
7
|
+
import"./cli-1jpjafw4.js";
|
|
8
|
+
import"./cli-09y3tjxz.js";
|
|
9
9
|
import"./cli-tng3131n.js";
|
|
10
10
|
import {
|
|
11
11
|
SessionErrorTracker,
|
|
@@ -15,15 +15,16 @@ import {
|
|
|
15
15
|
import"./cli-zm7njwzd.js";
|
|
16
16
|
import {
|
|
17
17
|
getContextWindowSize
|
|
18
|
-
} from "./cli-
|
|
19
|
-
import"./cli-
|
|
18
|
+
} from "./cli-e781c6f9.js";
|
|
19
|
+
import"./cli-fdzg6jhf.js";
|
|
20
20
|
import"./cli-hp1n6zq3.js";
|
|
21
21
|
import"./cli-eree7rnv.js";
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
22
|
+
import"./cli-avkd6mqv.js";
|
|
23
|
+
import"./cli-3bkz2p7j.js";
|
|
24
24
|
import"./cli-e7d20cty.js";
|
|
25
25
|
import"./cli-re8z5p8p.js";
|
|
26
26
|
import"./cli-3dpj7atn.js";
|
|
27
|
+
import"./cli-8sea27q4.js";
|
|
27
28
|
import {
|
|
28
29
|
detachedProcessGroup,
|
|
29
30
|
registerProcessGroup,
|
|
@@ -32,26 +33,27 @@ import {
|
|
|
32
33
|
} from "./cli-y89t4nca.js";
|
|
33
34
|
import"./cli-f14fvzag.js";
|
|
34
35
|
import"./cli-bsakbbkm.js";
|
|
35
|
-
import"./cli-
|
|
36
|
+
import"./cli-g2h29qar.js";
|
|
36
37
|
import"./cli-2658f6at.js";
|
|
37
|
-
import"./cli-
|
|
38
|
-
import"./cli-
|
|
38
|
+
import"./cli-0e31nm4n.js";
|
|
39
|
+
import"./cli-wg04s9kr.js";
|
|
40
|
+
import"./cli-v4en75c5.js";
|
|
39
41
|
import"./cli-dv6cdjs2.js";
|
|
40
|
-
import"./cli-
|
|
42
|
+
import"./cli-n7h1kqpf.js";
|
|
41
43
|
import"./cli-ej6gbxfb.js";
|
|
42
44
|
import"./cli-sd0mxa3c.js";
|
|
43
45
|
import"./cli-w5e1d1vv.js";
|
|
44
|
-
import"./cli-
|
|
46
|
+
import"./cli-myaxtgh8.js";
|
|
45
47
|
import {
|
|
46
48
|
init_secret_scrubber,
|
|
47
49
|
scrubSecrets
|
|
48
50
|
} from "./cli-r2ap2czm.js";
|
|
49
|
-
import"./cli-
|
|
50
|
-
import"./cli-c4eeb5q2.js";
|
|
51
|
-
import"./cli-rgvp6r2x.js";
|
|
51
|
+
import"./cli-5b6b62tz.js";
|
|
52
52
|
import"./cli-btbzvq95.js";
|
|
53
53
|
import"./cli-1m2e086m.js";
|
|
54
|
-
import"./cli-
|
|
54
|
+
import"./cli-mcnhgnn1.js";
|
|
55
|
+
import"./cli-bzr0ftht.js";
|
|
56
|
+
import"./cli-knd276ed.js";
|
|
55
57
|
import {
|
|
56
58
|
__require
|
|
57
59
|
} from "./cli-bc05qbss.js";
|
|
@@ -8,16 +8,20 @@ import {
|
|
|
8
8
|
resolveGrammarConstrainedSampling,
|
|
9
9
|
resolveJsonSchemaStrictSampling,
|
|
10
10
|
transformMessages
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-k0g1sjzm.js";
|
|
12
12
|
import {
|
|
13
13
|
sanitizeSurrogates
|
|
14
14
|
} from "./cli-y2apkfe2.js";
|
|
15
|
-
import {
|
|
16
|
-
calculateCost
|
|
17
|
-
} from "./cli-rgvp6r2x.js";
|
|
18
15
|
import {
|
|
19
16
|
parseStreamingJson
|
|
20
17
|
} from "./cli-1m2e086m.js";
|
|
18
|
+
import {
|
|
19
|
+
calculateCost,
|
|
20
|
+
getSystemMessageText,
|
|
21
|
+
renderSystemMessageUpdate,
|
|
22
|
+
resolveTranscript,
|
|
23
|
+
resolveTranscriptTools
|
|
24
|
+
} from "./cli-mcnhgnn1.js";
|
|
21
25
|
|
|
22
26
|
// node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js
|
|
23
27
|
function encodeTextSignatureV1(id, phase) {
|
|
@@ -64,8 +68,8 @@ function convertToolResultOutput(model, content) {
|
|
|
64
68
|
return output;
|
|
65
69
|
}
|
|
66
70
|
function convertResponsesMessages(model, context, allowedToolCallProviders, options) {
|
|
71
|
+
const normalizedContext = resolveTranscript(context, options?.supportsMidConvoSystemMessages);
|
|
67
72
|
const messages = [];
|
|
68
|
-
const loadedToolNames = new Set;
|
|
69
73
|
const normalizeIdPart = (part) => {
|
|
70
74
|
const sanitized = part.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
71
75
|
const normalized = sanitized.length > 64 ? sanitized.slice(0, 64) : sanitized;
|
|
@@ -89,19 +93,56 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
89
93
|
}
|
|
90
94
|
return `${normalizedCallId}|${normalizedItemId}`;
|
|
91
95
|
};
|
|
92
|
-
const transformedMessages = transformMessages(
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
96
|
+
const transformedMessages = transformMessages(normalizedContext.messages, model, normalizeToolCallId);
|
|
97
|
+
const transcriptTools = resolveTranscriptTools(normalizedContext.messages, (options?.supportsAdditionalTools ?? false) || (options?.supportsToolSearch ?? false));
|
|
98
|
+
const appendSystemToolAdditions = (message, seed) => {
|
|
99
|
+
const tools = transcriptTools.anchorsAdditions ? message.toolsAdded ?? [] : [];
|
|
100
|
+
if (tools.length === 0)
|
|
101
|
+
return;
|
|
102
|
+
if (options?.supportsAdditionalTools) {
|
|
103
|
+
messages.push({
|
|
104
|
+
type: "additional_tools",
|
|
105
|
+
role: "developer",
|
|
106
|
+
tools: convertResponsesTools(tools, options.toolOptions)
|
|
107
|
+
});
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!options?.supportsToolSearch)
|
|
111
|
+
return;
|
|
112
|
+
const names = tools.map((tool) => tool.name);
|
|
113
|
+
const callId = `pi_tool_load_${shortHash(`${seed}:${names.join(",")}`)}`;
|
|
97
114
|
messages.push({
|
|
98
|
-
|
|
99
|
-
|
|
115
|
+
type: "tool_search_call",
|
|
116
|
+
call_id: callId,
|
|
117
|
+
execution: "client",
|
|
118
|
+
status: "completed",
|
|
119
|
+
arguments: { query: names.join(" "), limit: names.length }
|
|
100
120
|
});
|
|
101
|
-
|
|
121
|
+
messages.push({
|
|
122
|
+
type: "tool_search_output",
|
|
123
|
+
call_id: callId,
|
|
124
|
+
execution: "client",
|
|
125
|
+
status: "completed",
|
|
126
|
+
tools: convertResponsesTools(tools, { ...options.toolOptions, toolSearchResult: true })
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
const includeInitialSystemMessage = options?.includeSystemPrompt ?? true;
|
|
130
|
+
const compat = model.compat;
|
|
131
|
+
const instructionRole = model.reasoning && compat?.supportsDeveloperRole !== false ? "developer" : "system";
|
|
102
132
|
let msgIndex = 0;
|
|
133
|
+
let sourceIndex = 0;
|
|
103
134
|
for (const msg of transformedMessages) {
|
|
104
|
-
|
|
135
|
+
const isLeadingSystemMessage = sourceIndex++ === 0 && msg.role === "system";
|
|
136
|
+
if (msg.role === "system") {
|
|
137
|
+
if (!isLeadingSystemMessage)
|
|
138
|
+
appendSystemToolAdditions(msg, `system:${msgIndex}`);
|
|
139
|
+
if (!isLeadingSystemMessage || includeInitialSystemMessage) {
|
|
140
|
+
const text = isLeadingSystemMessage ? getSystemMessageText(msg) : renderSystemMessageUpdate(msg);
|
|
141
|
+
if (text.length > 0) {
|
|
142
|
+
messages.push({ role: instructionRole, content: sanitizeSurrogates(text) });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} else if (msg.role === "user") {
|
|
105
146
|
if (typeof msg.content === "string") {
|
|
106
147
|
messages.push({
|
|
107
148
|
role: "user",
|
|
@@ -168,7 +209,6 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
168
209
|
if (isDifferentModel && itemId?.startsWith("fc_") || customInputProperty === undefined && !itemId?.startsWith("fc_")) {
|
|
169
210
|
itemId = undefined;
|
|
170
211
|
}
|
|
171
|
-
const canReplayNamespace = isSameModel || options?.deferredTools?.has(toolCall.name) === true;
|
|
172
212
|
if (customInputProperty !== undefined) {
|
|
173
213
|
output.push({
|
|
174
214
|
type: "custom_tool_call",
|
|
@@ -176,7 +216,7 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
176
216
|
call_id: callId,
|
|
177
217
|
name: toolCall.name,
|
|
178
218
|
input: sanitizeSurrogates(getGrammarToolInput(toolCall.name, toolCall.arguments, customInputProperty)),
|
|
179
|
-
...
|
|
219
|
+
...isSameModel && toolCall.namespace !== undefined ? { namespace: toolCall.namespace } : {}
|
|
180
220
|
});
|
|
181
221
|
} else {
|
|
182
222
|
output.push({
|
|
@@ -185,7 +225,7 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
185
225
|
call_id: callId,
|
|
186
226
|
name: toolCall.name,
|
|
187
227
|
arguments: JSON.stringify(toolCall.arguments),
|
|
188
|
-
...
|
|
228
|
+
...isSameModel && toolCall.namespace !== undefined ? { namespace: toolCall.namespace } : {}
|
|
189
229
|
});
|
|
190
230
|
}
|
|
191
231
|
}
|
|
@@ -209,43 +249,9 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
209
249
|
output
|
|
210
250
|
});
|
|
211
251
|
}
|
|
212
|
-
const deferredTools = [];
|
|
213
|
-
for (const name of msg.addedToolNames ?? []) {
|
|
214
|
-
const tool = options?.deferredTools?.get(name);
|
|
215
|
-
if (!tool || loadedToolNames.has(name))
|
|
216
|
-
continue;
|
|
217
|
-
loadedToolNames.add(name);
|
|
218
|
-
deferredTools.push(tool);
|
|
219
|
-
}
|
|
220
|
-
if (deferredTools.length > 0 && options?.deferredToolsMode === "additional-tools") {
|
|
221
|
-
messages.push({
|
|
222
|
-
type: "additional_tools",
|
|
223
|
-
role: "developer",
|
|
224
|
-
tools: convertResponsesTools(deferredTools, options.toolOptions)
|
|
225
|
-
});
|
|
226
|
-
} else if (deferredTools.length > 0 && options?.deferredToolsMode === "tool-search") {
|
|
227
|
-
const names = deferredTools.map((tool) => tool.name);
|
|
228
|
-
const searchCallId = `pi_tool_load_${shortHash(`${msg.toolCallId}:${names.join(",")}`)}`;
|
|
229
|
-
messages.push({
|
|
230
|
-
type: "tool_search_call",
|
|
231
|
-
call_id: searchCallId,
|
|
232
|
-
execution: "client",
|
|
233
|
-
status: "completed",
|
|
234
|
-
arguments: { query: names.join(" "), limit: names.length }
|
|
235
|
-
});
|
|
236
|
-
messages.push({
|
|
237
|
-
type: "tool_search_output",
|
|
238
|
-
call_id: searchCallId,
|
|
239
|
-
execution: "client",
|
|
240
|
-
status: "completed",
|
|
241
|
-
tools: convertResponsesTools(deferredTools, {
|
|
242
|
-
...options.toolOptions,
|
|
243
|
-
deferLoading: true
|
|
244
|
-
})
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
252
|
}
|
|
248
|
-
|
|
253
|
+
if (!isLeadingSystemMessage)
|
|
254
|
+
msgIndex++;
|
|
249
255
|
}
|
|
250
256
|
return messages;
|
|
251
257
|
}
|
|
@@ -265,7 +271,7 @@ function convertResponsesTools(tools, options) {
|
|
|
265
271
|
syntax: grammar.format,
|
|
266
272
|
definition: grammar.definition
|
|
267
273
|
},
|
|
268
|
-
...options?.
|
|
274
|
+
...options?.toolSearchResult ? { defer_loading: true } : {}
|
|
269
275
|
};
|
|
270
276
|
}
|
|
271
277
|
const constrainedStrict = resolveJsonSchemaStrictSampling(tool, supportsStrictMode);
|
|
@@ -275,7 +281,7 @@ function convertResponsesTools(tools, options) {
|
|
|
275
281
|
name: tool.name,
|
|
276
282
|
description: tool.description,
|
|
277
283
|
parameters: getJsonSchemaToolParameters(tool, strict === true),
|
|
278
|
-
...options?.
|
|
284
|
+
...options?.toolSearchResult ? { defer_loading: true } : {}
|
|
279
285
|
};
|
|
280
286
|
if (supportsStrictMode) {
|
|
281
287
|
functionTool.strict = strict;
|