@desplega.ai/agent-swarm 1.158.0 → 1.159.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/dist/{acp-adapter-xaq4n6pc.js → acp-adapter-qhch0n2v.js} +1 -1
- package/dist/{actions-p9hz5yat.js → actions-dtsh1mfb.js} +33 -29
- package/dist/{anthropic-messages-51pz26qe.js → anthropic-messages-f2h06k64.js} +8 -3
- package/dist/{app-g26wdcz6.js → app-y1b9srva.js} +10 -9
- package/dist/{assistant-wydfqkb3.js → assistant-31hwy5xj.js} +34 -30
- package/dist/{azure-openai-responses-8gksqtmz.js → azure-openai-responses-0k1mfax5.js} +12 -13
- package/dist/{boot-reembed-se8zmdcp.js → boot-reembed-48d2qpkt.js} +11 -11
- package/dist/{boot-reembed-g5ckg9yb.js → boot-reembed-w0bryhkr.js} +12 -12
- package/dist/{boot-scrub-logs-wfxqan61.js → boot-scrub-logs-t65wbrn7.js} +9 -8
- package/dist/{boot-seeds-s3q01xj3.js → boot-seeds-h7c32hvm.js} +12 -11
- package/dist/{claude-adapter-tv2x4f36.js → claude-adapter-1t6611ne.js} +26 -21
- package/dist/{claude-managed-adapter-41b2s7fd.js → claude-managed-adapter-werp659j.js} +4 -2
- package/dist/{claude-managed-setup-60g8aazx.js → claude-managed-setup-y6rdgbc1.js} +11 -2
- package/dist/claude-sdk-session-zhkyk8yw.js +29319 -0
- package/dist/{cli-vj6h9kc2.js → cli-0m7wct0d.js} +59 -1
- package/dist/{cli-wscdvcqz.js → cli-0n2e4x49.js} +1 -1
- package/dist/cli-0xqde53b.js +176 -0
- package/dist/{cli-xberxa1r.js → cli-10ym38qc.js} +2 -2
- package/dist/{cli-5b6b62tz.js → cli-13hw4z91.js} +1 -1
- package/dist/{cli-rqz8qbw7.js → cli-20035trh.js} +50 -18
- package/dist/{cli-k0g1sjzm.js → cli-31nkw3g3.js} +3 -3
- package/dist/cli-3gvrr8vj.js +1422 -0
- package/dist/{cli-c07r9a2m.js → cli-48527fpw.js} +9 -8
- package/dist/{cli-24k806sc.js → cli-4aj25szq.js} +2 -2
- package/dist/{cli-7gtvvpbh.js → cli-4tvgz99m.js} +7 -7
- package/dist/cli-503ya656.js +455 -0
- package/dist/{cli-cw9zck8j.js → cli-5f2hq128.js} +8 -4
- package/dist/{cli-s8eet254.js → cli-68bmme5p.js} +11078 -27833
- package/dist/{cli-ftfvggzx.js → cli-79aq9cgb.js} +794 -563
- package/dist/cli-7cxw8b60.js +14910 -0
- package/dist/cli-7kyk9jr3.js +22 -0
- package/dist/cli-7zttzetj.js +324 -0
- package/dist/{cli-y95wp3tg.js → cli-96qd5psa.js} +1 -1
- package/dist/{cli-g8djp6qe.js → cli-9yg65c1j.js} +22 -0
- package/dist/{cli-3gmcwfyx.js → cli-ardpzhjm.js} +5 -5
- package/dist/{cli-7s3syk22.js → cli-b6thtzac.js} +5 -5
- package/dist/{cli-00w2c66p.js → cli-bgv70kym.js} +13 -2
- package/dist/{cli-j55n64b6.js → cli-bv0a38v9.js} +163 -44
- package/dist/cli-ca2w7zv7.js +115 -0
- package/dist/cli-cpvsaqsw.js +333 -0
- package/dist/cli-cygyqj3b.js +754 -0
- package/dist/{cli-x24pshtq.js → cli-dvjpkkjd.js} +6 -6
- package/dist/{cli-5d10vd2m.js → cli-e0ndxhtk.js} +4 -4
- package/dist/{cli-4198qc9v.js → cli-e4xnc0qp.js} +15 -3
- package/dist/{cli-rjehvrts.js → cli-eg7cdg68.js} +8 -8
- package/dist/cli-ejpygnqz.js +3815 -0
- package/dist/{cli-fgqxwrpv.js → cli-fjtp3463.js} +1631 -127
- package/dist/{cli-zt1227k1.js → cli-fkqhbg8g.js} +5 -3
- package/dist/{cli-47m6dkd3.js → cli-g9df2m37.js} +409 -168
- package/dist/cli-gzyh0j0g.js +8455 -0
- package/dist/cli-hgqfttfc.js +183 -0
- package/dist/cli-hj65wsts.js +17755 -0
- package/dist/cli-j9z8mfx3.js +476 -0
- package/dist/{cli-aehm1rbq.js → cli-kc3dp84d.js} +1135 -61
- package/dist/{cli-h38x0qhg.js → cli-kdnehe0t.js} +4 -3
- package/dist/{cli-20cj37vt.js → cli-m4excttz.js} +136 -2216
- package/dist/{cli-8qmme6vd.js → cli-mg24hkt4.js} +2 -2
- package/dist/{cli-xhaeg2nc.js → cli-mzkqpxee.js} +1 -1
- package/dist/{cli-q67y4wzm.js → cli-phsaj4xq.js} +24 -2
- package/dist/{cli-pw9rj5t9.js → cli-pqetb83f.js} +1 -176
- package/dist/{cli-rj19hc34.js → cli-qjxy52w7.js} +1 -1
- package/dist/{cli-53sz8gkz.js → cli-qv4jv8bx.js} +1 -1
- package/dist/cli-qvnnx4ct.js +1051 -0
- package/dist/cli-rb9m6rpe.js +4980 -0
- package/dist/{cli-tt9k8r35.js → cli-rfezr056.js} +476 -909
- package/dist/{cli-ggm92wcn.js → cli-rgjprct3.js} +1 -0
- package/dist/{cli-9httdpyq.js → cli-rrqmqr1s.js} +1 -1
- package/dist/cli-rykfmgwg.js +102 -0
- package/dist/{cli-eetrvv91.js → cli-t3p77qk1.js} +1 -1
- package/dist/{cli-68w09sjw.js → cli-vn0qv9cj.js} +25 -88
- package/dist/{cli-987hg0aa.js → cli-vwbbaecp.js} +2 -2
- package/dist/cli-wd9hz40d.js +69 -0
- package/dist/{cli-j57qkrpq.js → cli-wgjx0q33.js} +13 -13
- package/dist/cli-xgpf00sk.js +2149 -0
- package/dist/{cli-mcnhgnn1.js → cli-ykk5jaax.js} +184 -26
- package/dist/{cli-aky8tctm.js → cli-z9x0sh1t.js} +3 -3
- package/dist/{cli-1hkrch3k.js → cli-zw65mab6.js} +5 -5
- package/dist/cli.js +38 -29
- package/dist/cloudflare-workers-ai-system-one-1sg586qv.js +46 -0
- package/dist/{codex-adapter-cnm8wk11.js → codex-adapter-jqfqqa21.js} +21 -14
- package/dist/{codex-hook-9hptmdhj.js → codex-hook-5eys3dya.js} +2 -2
- package/dist/{codex-session-runner-gfg547zj.js → codex-session-runner-zd341dsm.js} +21 -14
- package/dist/{commands-e3bn0p75.js → commands-vfsysz4s.js} +9 -8
- package/dist/{db-03v9kzr2.js → db-s3znhvbn.js} +15 -10
- package/dist/{dispatcher-nrmg8yht.js → dispatcher-5xn0c7rf.js} +32 -28
- package/dist/{dsh-adapter-k03nfqa6.js → dsh-adapter-894mgfvs.js} +3 -3
- package/dist/{e2b-93x1k0j5.js → e2b-ez07znam.js} +4 -3
- package/dist/execute-71ysgv35.js +965 -0
- package/dist/{google-generative-ai-bxmv50nc.js → google-generative-ai-1nfcdphp.js} +5 -4
- package/dist/{google-vertex-809af514.js → google-vertex-1tqcd7b1.js} +5 -4
- package/dist/{handlers-aqcedbyb.js → handlers-5w4jwycr.js} +35 -31
- package/dist/{hook-7vkskkre.js → hook-853bxrr6.js} +16 -13
- package/dist/{hook-ybvmrmhq.js → hook-z0hbxj85.js} +16 -13
- package/dist/{http-2eqa8t24.js → http-akc3wy3m.js} +600 -123
- package/dist/{index-f6cryxwe.js → index-4a5njnm1.js} +2 -59
- package/dist/{index-a3vn96n8.js → index-5sz16ksh.js} +187 -47
- package/dist/{index-c6zsv1bd.js → index-bjmjh9h4.js} +11 -11
- package/dist/{index-chgdkq36.js → index-cd151qkq.js} +32 -28
- package/dist/{index-x71bvq0p.js → index-k661dzzr.js} +33 -29
- package/dist/{index-1yks3qcr.js → index-ttpbhnjg.js} +32 -28
- package/dist/{keepalive-vtkf5n99.js → keepalive-8p9rpvz5.js} +11 -10
- package/dist/{lead-h3sp357x.js → lead-jp69z5h3.js} +49 -45
- package/dist/llama-cpp-classify-t2tccams.js +335 -0
- package/dist/{maintenance-jzeqtk3q.js → maintenance-fwx4ev0k.js} +12 -12
- package/dist/{mistral-conversations-zx0kn554.js → mistral-conversations-bhvwqcnk.js} +14 -17
- package/dist/{oauth-refresh-sweep-qp3dzmdp.js → oauth-refresh-sweep-cwcq1ctx.js} +10 -9
- package/dist/{onboard-tmsp0qbz.js → onboard-2b4q0t84.js} +6 -5
- package/dist/{openai-codex-responses-4vjqzvjp.js → openai-codex-responses-nekthgks.js} +21 -8
- package/dist/{openai-completions-9hjrqbw8.js → openai-completions-hxtzwj0s.js} +8 -11
- package/dist/{openai-responses-7b1pn0xt.js → openai-responses-w4r118w7.js} +22 -17
- package/dist/{opencode-adapter-x6x2da1z.js → opencode-adapter-zz7xvjj6.js} +6 -4
- package/dist/{openrouter-images-9f9ek4rw.js → openrouter-images-b6sqqjgn.js} +4 -6
- package/dist/{otel-impl-9mz73q65.js → otel-impl-g8rs4vwr.js} +1 -1
- package/dist/{pi-messages-txpjj39q.js → pi-messages-vxdt8v7j.js} +2 -1
- package/dist/{pi-mono-adapter-m6dvv0dz.js → pi-mono-adapter-n0me28wt.js} +29 -17
- package/dist/pricing-refresh-0v77385v.js +39 -0
- package/dist/{rbac-roles-c9wqz83x.js → rbac-roles-krjyazbj.js} +10 -9
- package/dist/{render-v2-gryrh9h8.js → render-v2-3wjsp9aw.js} +10 -9
- package/dist/runtime-ktjysacx.js +24 -0
- package/dist/{setup-q9720bt6.js → setup-yeqryke6.js} +6 -5
- package/dist/typesafe-system-one-96960jxp.js +27 -0
- package/dist/{virtual-modules-3htpgn8x.js → virtual-modules-dzdeq1sf.js} +21 -13
- package/dist/{work-objects-b76x7deb.js → work-objects-3pakpkw0.js} +35 -31
- package/dist/{worker-6vrxbv41.js → worker-85testgj.js} +49 -45
- package/openapi.json +863 -14
- package/package.json +9 -8
- package/src/be/db/agents.ts +20 -0
- package/src/be/db/tasks/human-free.ts +442 -0
- package/src/be/db/tasks/read.ts +56 -1
- package/src/be/db/tasks/write.ts +107 -11
- package/src/be/db.ts +89 -165
- package/src/be/harness-model-support.ts +182 -0
- package/src/be/human-free-drain.ts +67 -0
- package/src/be/migrations/182_task_human_free_flag.sql +63 -0
- package/src/be/migrations/183_human_free_reclassify_queue.sql +25 -0
- package/src/be/migrations/184_model_catalog.sql +120 -0
- package/src/be/model-catalog-store.ts +644 -0
- package/src/be/model-tier-keys.ts +31 -0
- package/src/be/model-tier-resolution.ts +489 -0
- package/src/be/model-validation.ts +112 -0
- package/src/be/models-catalog.ts +61 -7
- package/src/be/modelsdev-cache.json +82 -0
- package/src/be/modelsdev-cache.ts +2 -0
- package/src/be/pricing-refresh.ts +154 -12
- package/src/be/scripts/typecheck.ts +15 -0
- package/src/be/seed-scripts/catalog/task-failure-audit.ts +61 -9
- package/src/be/swarm-config-guard.ts +6 -0
- package/src/cli.tsx +10 -0
- package/src/commands/claude-managed-setup.ts +3 -1
- package/src/commands/runner.ts +76 -2
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/heartbeat/heartbeat.ts +64 -15
- package/src/heartbeat/templates.ts +2 -2
- package/src/http/agents.ts +49 -1
- package/src/http/index.ts +8 -0
- package/src/http/models-catalog.ts +357 -8
- package/src/http/poll.ts +45 -2
- package/src/http/schedules.ts +36 -6
- package/src/http/session-data.ts +2 -5
- package/src/http/stats.ts +6 -8
- package/src/http/tasks.ts +26 -1
- package/src/http/usage-cache.ts +56 -15
- package/src/http/workflows.ts +35 -8
- package/src/prompts/session-templates.ts +1 -0
- package/src/providers/claude-managed-models.ts +47 -161
- package/src/providers/codex-adapter.ts +4 -4
- package/src/providers/codex-models.ts +65 -198
- package/src/providers/reasoning-effort.ts +44 -140
- package/src/rbac/legacy-policy.ts +25 -0
- package/src/rbac/permissions.ts +10 -0
- package/src/scripts-runtime/sdk-allowlist.ts +4 -0
- package/src/scripts-runtime/types/stdlib.d.ts +15 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +3 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +15 -0
- package/src/server.ts +6 -0
- package/src/slack/message-text.ts +56 -2
- package/src/slack/thread-buffer.ts +10 -2
- package/src/tests/agents-list-model-display.test.ts +4 -6
- package/src/tests/base-prompt.test.ts +3 -0
- package/src/tests/claude-adapter.test.ts +10 -0
- package/src/tests/claude-managed-adapter.test.ts +12 -18
- package/src/tests/codex-adapter.test.ts +2 -1
- package/src/tests/codex-gpt6-release.test.ts +66 -5
- package/src/tests/context-window.test.ts +7 -5
- package/src/tests/db-extraction-contract.test.ts +1 -0
- package/src/tests/db-task-read-contract.test.ts +5 -1
- package/src/tests/db-task-write-contract.test.ts +4 -1
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/explicit-model-validation.test.ts +332 -0
- package/src/tests/harness-model-support.test.ts +374 -0
- package/src/tests/heartbeat-checklist-config.test.ts +71 -0
- package/src/tests/heartbeat-checklist.test.ts +4 -2
- package/src/tests/heartbeat-orphan-resume.test.ts +48 -0
- package/src/tests/human-free-flag.test.ts +279 -0
- package/src/tests/human-free-oracle.ts +57 -0
- package/src/tests/human-free-reclassify.test.ts +669 -0
- package/src/tests/migration-046-budgets.test.ts +3 -3
- package/src/tests/model-catalog-migration.test.ts +134 -0
- package/src/tests/model-catalog-table.test.ts +249 -0
- package/src/tests/model-catalog-write-access.test.ts +387 -0
- package/src/tests/model-tier-resolution.test.ts +519 -0
- package/src/tests/models-catalog.test.ts +1 -1
- package/src/tests/multi-runtime-enabled-stats.test.ts +65 -1
- package/src/tests/package-publish.test.ts +137 -36
- package/src/tests/pricing-routes.test.ts +2 -2
- package/src/tests/rbac-engine.test.ts +42 -2
- package/src/tests/reasoning-effort.test.ts +109 -0
- package/src/tests/refresh-modelsdev-carryforward.test.ts +5 -5
- package/src/tests/runtime-model-catalog.test.ts +86 -0
- package/src/tests/script-connections.test.ts +5 -0
- package/src/tests/seed-scripts.test.ts +89 -0
- package/src/tests/session-costs.test.ts +14 -11
- package/src/tests/slack-message-text.test.ts +101 -0
- package/src/tests/slack-thread-buffer-context.test.ts +93 -0
- package/src/tests/task-cascade-fail.test.ts +148 -2
- package/src/tests/tool-annotations.test.ts +1 -1
- package/src/tests/usage-cache.test.ts +166 -0
- package/src/tests/workflow-executors.test.ts +5 -2
- package/src/tests/workflow-system-one-decision-review.test.ts +1021 -0
- package/src/tests/workflow-system-one-decision-save-warnings.test.ts +365 -0
- package/src/tests/workflow-system-one-decision.test.ts +2063 -0
- package/src/tools/model-catalog/index.ts +137 -0
- package/src/tools/schedules/create-schedule.ts +16 -1
- package/src/tools/schedules/patch-schedule.ts +17 -0
- package/src/tools/schedules/update-schedule.ts +17 -0
- package/src/tools/send-task.ts +14 -0
- package/src/tools/task-action.ts +12 -0
- package/src/tools/tool-config.ts +3 -1
- package/src/tools/workflows/create-workflow.ts +9 -2
- package/src/tools/workflows/patch-workflow-node.ts +17 -7
- package/src/tools/workflows/patch-workflow.ts +9 -2
- package/src/tools/workflows/update-workflow.ts +9 -2
- package/src/types.ts +30 -1
- package/src/utils/context-window.ts +47 -53
- package/src/utils/harness-cli-version.ts +115 -0
- package/src/utils/harness-model-error.ts +33 -0
- package/src/utils/runtime-model-catalog.ts +137 -0
- package/src/workflows/approval-resolution.ts +39 -0
- package/src/workflows/definition.ts +7 -0
- package/src/workflows/engine.ts +69 -1
- package/src/workflows/executors/agent-task.ts +9 -0
- package/src/workflows/executors/base.ts +53 -0
- package/src/workflows/executors/human-in-the-loop.ts +8 -8
- package/src/workflows/executors/index.ts +1 -0
- package/src/workflows/executors/registry.ts +2 -0
- package/src/workflows/executors/system-one-decision.ts +1232 -0
- package/src/workflows/executors/system-one-providers.ts +301 -0
- package/src/workflows/executors/workflow-llm.ts +13 -1
- package/src/workflows/readiness.ts +86 -0
- package/src/workflows/recovery.ts +12 -12
- package/src/workflows/resume.ts +23 -9
- package/templates/schedules/daily-blocker-digest/content.md +4 -5
- package/templates/skills/agent-browser/SKILL.md +6 -5
- package/templates/skills/agent-browser/content.md +6 -5
- package/templates/skills/heartbeat-runbook/config.json +1 -1
- package/templates/skills/heartbeat-runbook/content.md +2 -2
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/templates/skills/workflow-iterate/content.md +81 -1
- package/templates/workflows/claude-code-changelog-watch/content.md +2 -0
- package/templates/workflows/pr-review-status-sweep/content.md +2 -0
- package/dist/claude-sdk-session-t442qz6f.js +0 -39108
- package/dist/cli-0xjkj1j7.js +0 -61
- package/dist/cli-65hjmev5.js +0 -1141
- package/dist/cli-aw1jwp1r.js +0 -14075
- package/dist/cli-h967nb6r.js +0 -6603
- package/dist/cli-vapyk8sw.js +0 -20
- package/dist/cli-ws6rqycm.js +0 -247
- package/dist/pricing-refresh-v1cbr9te.js +0 -27
- package/src/providers/modelsdev-reasoning.json +0 -6453
- package/dist/{codex-login-x3jk4etn.js → codex-login-he9vrn90.js} +3 -3
- package/dist/{index-f24115ge.js → index-2wsdsnmm.js} +3 -3
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reembedAllScripts
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-aehm1rbq.js";
|
|
3
|
+
} from "./cli-vwbbaecp.js";
|
|
4
|
+
import"./cli-kc3dp84d.js";
|
|
5
|
+
import"./cli-10ym38qc.js";
|
|
7
6
|
import"./cli-2658f6at.js";
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-ggm92wcn.js";
|
|
12
|
-
import"./cli-19jenss3.js";
|
|
13
|
-
import"./cli-dv6cdjs2.js";
|
|
7
|
+
import"./cli-g9df2m37.js";
|
|
8
|
+
import"./cli-e4xnc0qp.js";
|
|
9
|
+
import"./cli-ardpzhjm.js";
|
|
14
10
|
import"./cli-n7h1kqpf.js";
|
|
15
|
-
import"./cli-
|
|
11
|
+
import"./cli-rgjprct3.js";
|
|
12
|
+
import"./cli-dv6cdjs2.js";
|
|
16
13
|
import"./cli-cqt19wg6.js";
|
|
14
|
+
import"./cli-19jenss3.js";
|
|
15
|
+
import"./cli-de1396j2.js";
|
|
17
16
|
import"./cli-ej6gbxfb.js";
|
|
17
|
+
import"./cli-7zttzetj.js";
|
|
18
18
|
import"./cli-sd0mxa3c.js";
|
|
19
19
|
import"./cli-w5e1d1vv.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-48527fpw.js";
|
|
21
21
|
import"./cli-r2ap2czm.js";
|
|
22
22
|
import"./cli-zf8jjwex.js";
|
|
23
23
|
import"./cli-bc05qbss.js";
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
getJsonSchemaToolParameters,
|
|
10
10
|
resolveJsonSchemaStrictSampling,
|
|
11
11
|
transformMessages
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-31nkw3g3.js";
|
|
13
13
|
import {
|
|
14
14
|
sanitizeSurrogates
|
|
15
15
|
} from "./cli-y2apkfe2.js";
|
|
16
16
|
import {
|
|
17
17
|
headersToRecord
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-7kyk9jr3.js";
|
|
19
19
|
import {
|
|
20
20
|
parseStreamingJson
|
|
21
21
|
} from "./cli-1m2e086m.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
getSystemMessageText,
|
|
27
27
|
renderSystemMessageUpdate,
|
|
28
28
|
resolveTranscript
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-ykk5jaax.js";
|
|
30
30
|
import {
|
|
31
31
|
AssistantMessageEventStream
|
|
32
32
|
} from "./cli-bzr0ftht.js";
|
|
@@ -54,7 +54,7 @@ var stream = (model, context, options) => {
|
|
|
54
54
|
}
|
|
55
55
|
const mistralStream = await requestMistralStream(model, payload, apiKey, options);
|
|
56
56
|
stream2.push({ type: "start", partial: output });
|
|
57
|
-
await consumeChatStream(model, output, stream2, mistralStream);
|
|
57
|
+
await consumeChatStream(model, output, stream2, mistralStream, options?.onProviderStreamEvent);
|
|
58
58
|
if (options?.signal?.aborted) {
|
|
59
59
|
throw new Error("Request was aborted");
|
|
60
60
|
}
|
|
@@ -89,11 +89,12 @@ var streamSimple = (model, context, options) => {
|
|
|
89
89
|
};
|
|
90
90
|
const clampedReasoning = options?.reasoning ? clampThinkingLevel(model, options.reasoning) : undefined;
|
|
91
91
|
const reasoning = clampedReasoning === "off" ? undefined : clampedReasoning;
|
|
92
|
-
const
|
|
92
|
+
const effortMap = model.reasoning ? model.thinkingLevelMap : undefined;
|
|
93
|
+
const reasoningEffort = effortMap ? reasoning ? effortMap[reasoning] ?? "high" : effortMap.off ?? undefined : undefined;
|
|
93
94
|
return stream(model, context, {
|
|
94
95
|
...base,
|
|
95
|
-
promptMode:
|
|
96
|
-
reasoningEffort
|
|
96
|
+
promptMode: model.reasoning && !effortMap && reasoning ? "reasoning" : undefined,
|
|
97
|
+
reasoningEffort
|
|
97
98
|
});
|
|
98
99
|
};
|
|
99
100
|
function createOutput(model) {
|
|
@@ -391,7 +392,7 @@ function getMistralCachedPromptTokens(usage, promptTokens) {
|
|
|
391
392
|
const cachedTokens = typeof rawCachedTokens === "number" && Number.isFinite(rawCachedTokens) ? rawCachedTokens : 0;
|
|
392
393
|
return Math.min(promptTokens, Math.max(0, cachedTokens));
|
|
393
394
|
}
|
|
394
|
-
async function consumeChatStream(model, output, stream2, mistralStream) {
|
|
395
|
+
async function consumeChatStream(model, output, stream2, mistralStream, onProviderStreamEvent) {
|
|
395
396
|
let currentBlock = null;
|
|
396
397
|
const blocks = output.content;
|
|
397
398
|
const blockIndex = () => blocks.length - 1;
|
|
@@ -419,6 +420,7 @@ async function consumeChatStream(model, output, stream2, mistralStream) {
|
|
|
419
420
|
};
|
|
420
421
|
for await (const event of mistralStream) {
|
|
421
422
|
const chunk = event.data;
|
|
423
|
+
await onProviderStreamEvent?.(chunk, model);
|
|
422
424
|
output.responseId ||= chunk.id;
|
|
423
425
|
if (chunk.usage) {
|
|
424
426
|
const promptTokens = chunk.usage.prompt_tokens || 0;
|
|
@@ -447,6 +449,8 @@ async function consumeChatStream(model, output, stream2, mistralStream) {
|
|
|
447
449
|
for (const item of contentItems) {
|
|
448
450
|
if (typeof item === "string") {
|
|
449
451
|
const textDelta = sanitizeSurrogates(item);
|
|
452
|
+
if (!textDelta)
|
|
453
|
+
continue;
|
|
450
454
|
if (!currentBlock || currentBlock.type !== "text") {
|
|
451
455
|
finishCurrentBlock(currentBlock);
|
|
452
456
|
currentBlock = { type: "text", text: "" };
|
|
@@ -484,6 +488,8 @@ async function consumeChatStream(model, output, stream2, mistralStream) {
|
|
|
484
488
|
}
|
|
485
489
|
if (item.type === "text") {
|
|
486
490
|
const textDelta = sanitizeSurrogates(item.text ?? "");
|
|
491
|
+
if (!textDelta)
|
|
492
|
+
continue;
|
|
487
493
|
if (!currentBlock || currentBlock.type !== "text") {
|
|
488
494
|
finishCurrentBlock(currentBlock);
|
|
489
495
|
currentBlock = { type: "text", text: "" };
|
|
@@ -687,15 +693,6 @@ function buildToolResultText(text, hasImages, supportsImages, isError) {
|
|
|
687
693
|
}
|
|
688
694
|
return isError ? "[tool error] (no tool output)" : "(no tool output)";
|
|
689
695
|
}
|
|
690
|
-
function usesReasoningEffort(model) {
|
|
691
|
-
return model.id === "mistral-small-2603" || model.id === "mistral-small-latest" || model.id.startsWith("mistral-medium-") || model.id === "zai-glm-5-2";
|
|
692
|
-
}
|
|
693
|
-
function usesPromptModeReasoning(model) {
|
|
694
|
-
return model.reasoning && !usesReasoningEffort(model);
|
|
695
|
-
}
|
|
696
|
-
function mapReasoningEffort(model, level) {
|
|
697
|
-
return model.thinkingLevelMap?.[level] ?? "high";
|
|
698
|
-
}
|
|
699
696
|
function mapToolChoice(choice) {
|
|
700
697
|
if (!choice)
|
|
701
698
|
return;
|
|
@@ -2,20 +2,21 @@ import {
|
|
|
2
2
|
forceRefreshAuthorizationOrThrow,
|
|
3
3
|
getAuthorizationById,
|
|
4
4
|
listAuthorizationSweepRows
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-ggm92wcn.js";
|
|
10
|
-
import"./cli-19jenss3.js";
|
|
11
|
-
import"./cli-dv6cdjs2.js";
|
|
5
|
+
} from "./cli-qv4jv8bx.js";
|
|
6
|
+
import"./cli-g9df2m37.js";
|
|
7
|
+
import"./cli-e4xnc0qp.js";
|
|
8
|
+
import"./cli-ardpzhjm.js";
|
|
12
9
|
import"./cli-n7h1kqpf.js";
|
|
13
|
-
import"./cli-
|
|
10
|
+
import"./cli-rgjprct3.js";
|
|
11
|
+
import"./cli-dv6cdjs2.js";
|
|
14
12
|
import"./cli-cqt19wg6.js";
|
|
13
|
+
import"./cli-19jenss3.js";
|
|
14
|
+
import"./cli-de1396j2.js";
|
|
15
15
|
import"./cli-ej6gbxfb.js";
|
|
16
|
+
import"./cli-7zttzetj.js";
|
|
16
17
|
import"./cli-sd0mxa3c.js";
|
|
17
18
|
import"./cli-w5e1d1vv.js";
|
|
18
|
-
import"./cli-
|
|
19
|
+
import"./cli-48527fpw.js";
|
|
19
20
|
import {
|
|
20
21
|
init_secret_scrubber,
|
|
21
22
|
scrubSecrets
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
createDefaultMcpJson,
|
|
4
4
|
createDefaultSettingsLocal,
|
|
5
5
|
createHooksConfig
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-rrqmqr1s.js";
|
|
7
7
|
import {
|
|
8
8
|
require_jsx_dev_runtime
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-t3p77qk1.js";
|
|
10
10
|
import {
|
|
11
11
|
getApiKey
|
|
12
12
|
} from "./cli-f14fvzag.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
init_package,
|
|
20
20
|
package_default
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-48527fpw.js";
|
|
22
22
|
import {
|
|
23
23
|
Box_default,
|
|
24
24
|
Select,
|
|
@@ -28,8 +28,9 @@ import {
|
|
|
28
28
|
require_react,
|
|
29
29
|
use_app_default,
|
|
30
30
|
use_input_default
|
|
31
|
-
} from "./cli-
|
|
32
|
-
import"./cli-
|
|
31
|
+
} from "./cli-fkqhbg8g.js";
|
|
32
|
+
import"./cli-0xqde53b.js";
|
|
33
|
+
import"./cli-pqetb83f.js";
|
|
33
34
|
import {
|
|
34
35
|
__toESM
|
|
35
36
|
} from "./cli-bc05qbss.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
convertResponsesMessages,
|
|
3
3
|
convertResponsesTools,
|
|
4
4
|
processResponsesStream
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-bgv70kym.js";
|
|
6
6
|
import {
|
|
7
7
|
clampOpenAIPromptCacheKey
|
|
8
8
|
} from "./cli-mrptpp86.js";
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
buildBaseOptions,
|
|
26
26
|
createGrammarToolInputProperties
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-31nkw3g3.js";
|
|
28
28
|
import"./cli-y2apkfe2.js";
|
|
29
29
|
import {
|
|
30
30
|
headersToRecord
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-7kyk9jr3.js";
|
|
32
32
|
import"./cli-btbzvq95.js";
|
|
33
33
|
import"./cli-1m2e086m.js";
|
|
34
34
|
import {
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
normalizeContext,
|
|
40
40
|
resolveTranscript,
|
|
41
41
|
resolveTranscriptTools
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-ykk5jaax.js";
|
|
43
43
|
import {
|
|
44
44
|
AssistantMessageEventStream,
|
|
45
45
|
appendAssistantMessageDiagnostic,
|
|
@@ -505,7 +505,7 @@ function resolveCodexWebSocketUrl(baseUrl) {
|
|
|
505
505
|
return url.toString();
|
|
506
506
|
}
|
|
507
507
|
async function processStream(response, output, stream2, model, grammarToolInputProperties, options) {
|
|
508
|
-
await processResponsesStream(mapCodexEvents(parseSSE(response, options?.signal), output), output, stream2, model, {
|
|
508
|
+
await processResponsesStream(mapCodexEvents(parseSSE(response, options?.signal), output, model, options?.onProviderStreamEvent), output, stream2, model, {
|
|
509
509
|
serviceTier: options?.serviceTier,
|
|
510
510
|
grammarToolInputProperties,
|
|
511
511
|
resolveServiceTier: resolveCodexServiceTier,
|
|
@@ -534,8 +534,16 @@ class CodexProtocolError extends Error {
|
|
|
534
534
|
this.cause = options?.cause;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
+
|
|
538
|
+
class ProviderStreamEventCallbackError extends Error {
|
|
539
|
+
constructor(cause) {
|
|
540
|
+
super(formatThrownValue(cause));
|
|
541
|
+
this.name = "ProviderStreamEventCallbackError";
|
|
542
|
+
this.cause = cause;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
537
545
|
function isCodexNonTransportError(error) {
|
|
538
|
-
return error instanceof CodexApiError || error instanceof CodexProtocolError;
|
|
546
|
+
return error instanceof CodexApiError || error instanceof CodexProtocolError || error instanceof ProviderStreamEventCallbackError;
|
|
539
547
|
}
|
|
540
548
|
function isWebSocketConnectionLimitReachedError(error) {
|
|
541
549
|
return error instanceof CodexApiError && error.code === WEBSOCKET_CONNECTION_LIMIT_REACHED_CODE;
|
|
@@ -550,8 +558,13 @@ function extractCodexEventError(event) {
|
|
|
550
558
|
message: typeof event.message === "string" ? event.message : typeof nested?.message === "string" ? nested.message : undefined
|
|
551
559
|
};
|
|
552
560
|
}
|
|
553
|
-
async function* mapCodexEvents(events, output) {
|
|
561
|
+
async function* mapCodexEvents(events, output, model, onProviderStreamEvent) {
|
|
554
562
|
for await (const event of events) {
|
|
563
|
+
try {
|
|
564
|
+
await onProviderStreamEvent?.(event, model);
|
|
565
|
+
} catch (error) {
|
|
566
|
+
throw new ProviderStreamEventCallbackError(error);
|
|
567
|
+
}
|
|
555
568
|
const type = typeof event.type === "string" ? event.type : undefined;
|
|
556
569
|
if (!type)
|
|
557
570
|
continue;
|
|
@@ -1194,7 +1207,7 @@ async function processWebSocketStream(url, body, headers, output, stream2, model
|
|
|
1194
1207
|
}
|
|
1195
1208
|
try {
|
|
1196
1209
|
socket.send(JSON.stringify({ type: "response.create", ...requestBody }));
|
|
1197
|
-
await processResponsesStream(startWebSocketOutputOnFirstEvent(mapCodexEvents(parseWebSocket(socket, options?.signal, idleTimeoutMs), output), onStart), output, stream2, model, {
|
|
1210
|
+
await processResponsesStream(startWebSocketOutputOnFirstEvent(mapCodexEvents(parseWebSocket(socket, options?.signal, idleTimeoutMs), output, model, options?.onProviderStreamEvent), onStart), output, stream2, model, {
|
|
1198
1211
|
serviceTier: options?.serviceTier,
|
|
1199
1212
|
grammarToolInputProperties,
|
|
1200
1213
|
resolveServiceTier: resolveCodexServiceTier,
|
|
@@ -8,16 +8,15 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
shortHash
|
|
10
10
|
} from "./cli-5m9j2spm.js";
|
|
11
|
+
import {
|
|
12
|
+
OpenAI
|
|
13
|
+
} from "./cli-7cxw8b60.js";
|
|
11
14
|
import {
|
|
12
15
|
getPiUserAgent
|
|
13
16
|
} from "./cli-et1bbwqf.js";
|
|
14
17
|
import {
|
|
15
18
|
retryProviderRequest
|
|
16
19
|
} from "./cli-s8s499xy.js";
|
|
17
|
-
import {
|
|
18
|
-
OpenAI,
|
|
19
|
-
init_openai
|
|
20
|
-
} from "./cli-aehm1rbq.js";
|
|
21
20
|
import {
|
|
22
21
|
formatProviderError,
|
|
23
22
|
normalizeProviderError
|
|
@@ -33,13 +32,13 @@ import {
|
|
|
33
32
|
resolveJsonSchemaStrictSampling,
|
|
34
33
|
thinkingBudgetForLevel,
|
|
35
34
|
transformMessages
|
|
36
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-31nkw3g3.js";
|
|
37
36
|
import {
|
|
38
37
|
sanitizeSurrogates
|
|
39
38
|
} from "./cli-y2apkfe2.js";
|
|
40
39
|
import {
|
|
41
40
|
headersToRecord
|
|
42
|
-
} from "./cli-
|
|
41
|
+
} from "./cli-7kyk9jr3.js";
|
|
43
42
|
import {
|
|
44
43
|
getProviderEnvValue
|
|
45
44
|
} from "./cli-btbzvq95.js";
|
|
@@ -54,14 +53,13 @@ import {
|
|
|
54
53
|
renderSystemMessageUpdate,
|
|
55
54
|
resolveTranscript,
|
|
56
55
|
resolveTranscriptTools
|
|
57
|
-
} from "./cli-
|
|
56
|
+
} from "./cli-ykk5jaax.js";
|
|
58
57
|
import {
|
|
59
58
|
AssistantMessageEventStream
|
|
60
59
|
} from "./cli-bzr0ftht.js";
|
|
61
60
|
import"./cli-bc05qbss.js";
|
|
62
61
|
|
|
63
62
|
// node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js
|
|
64
|
-
init_openai();
|
|
65
63
|
function hasHeader(headers, name) {
|
|
66
64
|
if (!headers)
|
|
67
65
|
return false;
|
|
@@ -370,6 +368,7 @@ var stream = (model, context, options) => {
|
|
|
370
368
|
return block;
|
|
371
369
|
};
|
|
372
370
|
for await (const chunk of openaiStream) {
|
|
371
|
+
await options?.onProviderStreamEvent?.(chunk, model);
|
|
373
372
|
if (!chunk || typeof chunk !== "object")
|
|
374
373
|
continue;
|
|
375
374
|
output.responseId ||= chunk.id;
|
|
@@ -709,9 +708,7 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
|
|
|
709
708
|
params.providerOptions = { gateway: gatewayOptions };
|
|
710
709
|
}
|
|
711
710
|
}
|
|
712
|
-
|
|
713
|
-
Object.assign(params, options.samplingParams);
|
|
714
|
-
}
|
|
711
|
+
Object.assign(params, model.samplingParams, options?.samplingParams);
|
|
715
712
|
return params;
|
|
716
713
|
}
|
|
717
714
|
function resolveThinkingTokenBudgetField(compat) {
|
|
@@ -6,21 +6,20 @@ import {
|
|
|
6
6
|
convertResponsesMessages,
|
|
7
7
|
convertResponsesTools,
|
|
8
8
|
processResponsesStream
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-bgv70kym.js";
|
|
10
10
|
import {
|
|
11
11
|
clampOpenAIPromptCacheKey
|
|
12
12
|
} from "./cli-mrptpp86.js";
|
|
13
13
|
import"./cli-5m9j2spm.js";
|
|
14
|
+
import {
|
|
15
|
+
OpenAI
|
|
16
|
+
} from "./cli-7cxw8b60.js";
|
|
14
17
|
import {
|
|
15
18
|
getPiUserAgent
|
|
16
19
|
} from "./cli-et1bbwqf.js";
|
|
17
20
|
import {
|
|
18
21
|
retryProviderRequest
|
|
19
22
|
} from "./cli-s8s499xy.js";
|
|
20
|
-
import {
|
|
21
|
-
OpenAI,
|
|
22
|
-
init_openai
|
|
23
|
-
} from "./cli-aehm1rbq.js";
|
|
24
23
|
import {
|
|
25
24
|
formatProviderError,
|
|
26
25
|
normalizeProviderError
|
|
@@ -28,11 +27,11 @@ import {
|
|
|
28
27
|
import {
|
|
29
28
|
buildBaseOptions,
|
|
30
29
|
createGrammarToolInputProperties
|
|
31
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-31nkw3g3.js";
|
|
32
31
|
import"./cli-y2apkfe2.js";
|
|
33
32
|
import {
|
|
34
33
|
headersToRecord
|
|
35
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-7kyk9jr3.js";
|
|
36
35
|
import {
|
|
37
36
|
getProviderEnvValue
|
|
38
37
|
} from "./cli-btbzvq95.js";
|
|
@@ -42,16 +41,19 @@ import {
|
|
|
42
41
|
getDeclaredTools,
|
|
43
42
|
resolveTranscript,
|
|
44
43
|
resolveTranscriptTools
|
|
45
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-ykk5jaax.js";
|
|
46
45
|
import {
|
|
47
46
|
AssistantMessageEventStream
|
|
48
47
|
} from "./cli-bzr0ftht.js";
|
|
49
48
|
import"./cli-bc05qbss.js";
|
|
50
49
|
|
|
51
50
|
// node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js
|
|
52
|
-
init_openai();
|
|
53
51
|
var OPENAI_TOOL_CALL_PROVIDERS = new Set(["openai", "openai-codex", "opencode"]);
|
|
54
52
|
var OPENAI_RESPONSES_MIN_OUTPUT_TOKENS = 16;
|
|
53
|
+
var CHATGPT_USAGE_URL = "https://chatgpt.com/settings/usage";
|
|
54
|
+
function isChatGPTSignIn(model, apiKey) {
|
|
55
|
+
return model.provider === "openai" && model.baseUrl === "https://api.openai.com/v1" && apiKey !== undefined && !apiKey.startsWith("sk-");
|
|
56
|
+
}
|
|
55
57
|
function hasHeader(headers, name) {
|
|
56
58
|
if (!headers)
|
|
57
59
|
return false;
|
|
@@ -153,6 +155,7 @@ var stream = (model, context, options) => {
|
|
|
153
155
|
await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model);
|
|
154
156
|
stream2.push({ type: "start", partial: output });
|
|
155
157
|
await processResponsesStream(openaiStream, output, stream2, model, {
|
|
158
|
+
onProviderStreamEvent: options?.onProviderStreamEvent,
|
|
156
159
|
serviceTier: options?.serviceTier,
|
|
157
160
|
grammarToolInputProperties,
|
|
158
161
|
applyServiceTierPricing: (usage, serviceTier) => applyServiceTierPricing(usage, serviceTier, model)
|
|
@@ -175,7 +178,9 @@ var stream = (model, context, options) => {
|
|
|
175
178
|
delete block.customInput;
|
|
176
179
|
}
|
|
177
180
|
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
178
|
-
|
|
181
|
+
const errorMessage = formatProviderError(normalizeProviderError(error), `${model.provider === "openai" ? "OpenAI" : model.provider} API error`);
|
|
182
|
+
output.errorMessage = errorMessage.includes("subscription_sharing_usage_limit_exceeded") ? `${errorMessage}
|
|
183
|
+
Check your ChatGPT usage: ${CHATGPT_USAGE_URL}` : errorMessage;
|
|
179
184
|
stream2.push({ type: "error", reason: output.stopReason, error: output });
|
|
180
185
|
stream2.end();
|
|
181
186
|
}
|
|
@@ -240,19 +245,20 @@ function buildParams(model, context, options, compat = getCompat(model), grammar
|
|
|
240
245
|
}
|
|
241
246
|
});
|
|
242
247
|
const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env);
|
|
248
|
+
const omitUnsupportedFields = isChatGPTSignIn(model, options?.apiKey);
|
|
243
249
|
const params = {
|
|
244
250
|
model: model.id,
|
|
245
251
|
input: messages,
|
|
246
252
|
stream: true,
|
|
247
253
|
prompt_cache_key: cacheRetention === "none" ? undefined : clampOpenAIPromptCacheKey(options?.sessionId),
|
|
248
|
-
prompt_cache_retention: getPromptCacheRetention(compat, cacheRetention),
|
|
249
|
-
prompt_cache_options: getPromptCacheOptions(compat, cacheRetention),
|
|
254
|
+
prompt_cache_retention: omitUnsupportedFields ? undefined : getPromptCacheRetention(compat, cacheRetention),
|
|
255
|
+
prompt_cache_options: omitUnsupportedFields ? undefined : getPromptCacheOptions(compat, cacheRetention),
|
|
250
256
|
store: false
|
|
251
257
|
};
|
|
252
|
-
if (options?.maxTokens && compat.supportsMaxOutputTokens) {
|
|
258
|
+
if (options?.maxTokens && compat.supportsMaxOutputTokens && !omitUnsupportedFields) {
|
|
253
259
|
params.max_output_tokens = Math.max(options.maxTokens, OPENAI_RESPONSES_MIN_OUTPUT_TOKENS);
|
|
254
260
|
}
|
|
255
|
-
if (options?.temperature !== undefined) {
|
|
261
|
+
if (options?.temperature !== undefined && !omitUnsupportedFields) {
|
|
256
262
|
params.temperature = options?.temperature;
|
|
257
263
|
}
|
|
258
264
|
if (options?.serviceTier !== undefined) {
|
|
@@ -283,9 +289,7 @@ function buildParams(model, context, options, compat = getCompat(model), grammar
|
|
|
283
289
|
if (model.provider === "xai")
|
|
284
290
|
params.include = ["reasoning.encrypted_content"];
|
|
285
291
|
}
|
|
286
|
-
|
|
287
|
-
Object.assign(params, options.samplingParams);
|
|
288
|
-
}
|
|
292
|
+
Object.assign(params, model.samplingParams, options?.samplingParams);
|
|
289
293
|
return params;
|
|
290
294
|
}
|
|
291
295
|
function getServiceTierCostMultiplier(model, serviceTier) {
|
|
@@ -293,6 +297,7 @@ function getServiceTierCostMultiplier(model, serviceTier) {
|
|
|
293
297
|
case "flex":
|
|
294
298
|
return 0.5;
|
|
295
299
|
case "priority":
|
|
300
|
+
case "fast":
|
|
296
301
|
return model.id === "gpt-5.5" ? 2.5 : 2;
|
|
297
302
|
default:
|
|
298
303
|
return 1;
|
|
@@ -5,19 +5,21 @@ import {
|
|
|
5
5
|
applyOpenRouterBaseUrlOverride,
|
|
6
6
|
checkOpencodeCredentials,
|
|
7
7
|
resolveContextModePluginPath
|
|
8
|
-
} from "./cli-
|
|
9
|
-
import"./cli-5bfdm1ah.js";
|
|
8
|
+
} from "./cli-zw65mab6.js";
|
|
10
9
|
import"./cli-r94z9p1z.js";
|
|
11
10
|
import"./cli-2djtr51b.js";
|
|
11
|
+
import"./cli-5bfdm1ah.js";
|
|
12
12
|
import"./cli-tng3131n.js";
|
|
13
13
|
import"./cli-zm7njwzd.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
14
|
+
import"./cli-wd9hz40d.js";
|
|
15
|
+
import"./cli-ca2w7zv7.js";
|
|
16
16
|
import"./cli-re8z5p8p.js";
|
|
17
|
+
import"./cli-m4excttz.js";
|
|
17
18
|
import"./cli-3dpj7atn.js";
|
|
18
19
|
import"./cli-19jenss3.js";
|
|
19
20
|
import"./cli-de1396j2.js";
|
|
20
21
|
import"./cli-ej6gbxfb.js";
|
|
22
|
+
import"./cli-7zttzetj.js";
|
|
21
23
|
import"./cli-r2ap2czm.js";
|
|
22
24
|
import"./cli-bc05qbss.js";
|
|
23
25
|
export {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OpenAI
|
|
3
|
+
} from "./cli-7cxw8b60.js";
|
|
1
4
|
import {
|
|
2
5
|
retryProviderRequest
|
|
3
6
|
} from "./cli-s8s499xy.js";
|
|
4
|
-
import {
|
|
5
|
-
OpenAI,
|
|
6
|
-
init_openai
|
|
7
|
-
} from "./cli-aehm1rbq.js";
|
|
8
7
|
import {
|
|
9
8
|
formatProviderError,
|
|
10
9
|
normalizeProviderError
|
|
@@ -15,11 +14,10 @@ import {
|
|
|
15
14
|
import {
|
|
16
15
|
headersToRecord,
|
|
17
16
|
providerHeadersToRecord
|
|
18
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-7kyk9jr3.js";
|
|
19
18
|
import"./cli-bc05qbss.js";
|
|
20
19
|
|
|
21
20
|
// node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js
|
|
22
|
-
init_openai();
|
|
23
21
|
var generateImages = async (model, context, options) => {
|
|
24
22
|
const output = {
|
|
25
23
|
api: model.api,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
headersToRecord,
|
|
3
3
|
providerHeadersToRecord
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-7kyk9jr3.js";
|
|
5
5
|
import {
|
|
6
6
|
getProviderEnvValue
|
|
7
7
|
} from "./cli-btbzvq95.js";
|
|
@@ -288,6 +288,7 @@ var stream = (model, context, options) => {
|
|
|
288
288
|
throw new Error(`${model.provider} response has no body`);
|
|
289
289
|
}
|
|
290
290
|
for await (const piEvent of readPiMessagesEvents(response.body)) {
|
|
291
|
+
await options?.onProviderStreamEvent?.(piEvent, model);
|
|
291
292
|
const event = convertEvent(piEvent);
|
|
292
293
|
eventStream.push(event);
|
|
293
294
|
if (event.type === "done" || event.type === "error") {
|
|
@@ -1,63 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readPkgVersion
|
|
3
|
+
} from "./cli-2djtr51b.js";
|
|
1
4
|
import {
|
|
2
5
|
DefaultResourceLoader,
|
|
3
6
|
ModelRuntime,
|
|
4
7
|
SessionManager,
|
|
5
|
-
createAgentSession
|
|
8
|
+
createAgentSession
|
|
9
|
+
} from "./cli-68bmme5p.js";
|
|
10
|
+
import"./cli-503ya656.js";
|
|
11
|
+
import"./cli-qvnnx4ct.js";
|
|
12
|
+
import"./cli-ejpygnqz.js";
|
|
13
|
+
import {
|
|
6
14
|
getAgentDir
|
|
7
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-hj65wsts.js";
|
|
8
16
|
import"./cli-5bfdm1ah.js";
|
|
9
|
-
import
|
|
10
|
-
readPkgVersion
|
|
11
|
-
} from "./cli-2djtr51b.js";
|
|
17
|
+
import"./cli-0m7wct0d.js";
|
|
12
18
|
import {
|
|
13
19
|
summarizeSession
|
|
14
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-5f2hq128.js";
|
|
15
21
|
import {
|
|
16
22
|
checkToolLoop,
|
|
17
23
|
clearToolHistory
|
|
18
24
|
} from "./cli-hp1n6zq3.js";
|
|
19
25
|
import {
|
|
20
26
|
applyReasoningEffort
|
|
21
|
-
} from "./cli-
|
|
22
|
-
import"./cli-vj6h9kc2.js";
|
|
27
|
+
} from "./cli-ca2w7zv7.js";
|
|
23
28
|
import"./cli-7nxes1hs.js";
|
|
24
29
|
import {
|
|
25
30
|
buildRatingsFromLlm,
|
|
26
31
|
fetchRetrievalsForTask,
|
|
27
32
|
getMemoryRaterNames,
|
|
28
33
|
postRatings
|
|
29
|
-
} from "./cli-
|
|
30
|
-
import"./cli-vhjwh6cz.js";
|
|
34
|
+
} from "./cli-cpvsaqsw.js";
|
|
31
35
|
import {
|
|
32
36
|
swarmRuntimeInstanceId
|
|
33
37
|
} from "./cli-re8z5p8p.js";
|
|
38
|
+
import"./cli-m4excttz.js";
|
|
39
|
+
import {
|
|
40
|
+
McpHttpClient
|
|
41
|
+
} from "./cli-epan13p1.js";
|
|
42
|
+
import"./cli-rfezr056.js";
|
|
43
|
+
import"./cli-vhjwh6cz.js";
|
|
34
44
|
import {
|
|
35
45
|
DEFAULT_OPENROUTER_BASE_URL,
|
|
36
46
|
getOpenRouterBaseUrl
|
|
37
47
|
} from "./cli-3dpj7atn.js";
|
|
38
48
|
import {
|
|
39
|
-
exports_typebox,
|
|
40
49
|
getBuiltinModel,
|
|
41
50
|
getBuiltinModels
|
|
42
|
-
} from "./cli-
|
|
51
|
+
} from "./cli-gzyh0j0g.js";
|
|
43
52
|
import {
|
|
44
|
-
|
|
45
|
-
} from "./cli-
|
|
53
|
+
exports_typebox
|
|
54
|
+
} from "./cli-rb9m6rpe.js";
|
|
55
|
+
import"./cli-rykfmgwg.js";
|
|
46
56
|
import"./cli-bsakbbkm.js";
|
|
47
57
|
import"./cli-3er6gcsn.js";
|
|
48
58
|
import"./cli-cqt19wg6.js";
|
|
49
59
|
import"./cli-ej6gbxfb.js";
|
|
60
|
+
import"./cli-7zttzetj.js";
|
|
50
61
|
import"./cli-sd0mxa3c.js";
|
|
51
62
|
import"./cli-w5e1d1vv.js";
|
|
52
63
|
import {
|
|
53
64
|
init_secret_scrubber,
|
|
54
65
|
scrubSecrets
|
|
55
66
|
} from "./cli-r2ap2czm.js";
|
|
56
|
-
import"./cli-
|
|
57
|
-
import"./cli-
|
|
67
|
+
import"./cli-0xqde53b.js";
|
|
68
|
+
import"./cli-pqetb83f.js";
|
|
69
|
+
import"./cli-13hw4z91.js";
|
|
58
70
|
import"./cli-btbzvq95.js";
|
|
59
71
|
import"./cli-1m2e086m.js";
|
|
60
|
-
import"./cli-
|
|
72
|
+
import"./cli-ykk5jaax.js";
|
|
61
73
|
import"./cli-bzr0ftht.js";
|
|
62
74
|
import {
|
|
63
75
|
__require,
|