@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,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
renderSteeringDelivery
|
|
3
|
-
} from "./cli-y95wp3tg.js";
|
|
4
|
-
import {
|
|
5
|
-
checkDevinCredentials
|
|
6
|
-
} from "./cli-9b13ggd1.js";
|
|
7
|
-
import {
|
|
8
|
-
checkOpencodeCredentials
|
|
9
|
-
} from "./cli-1hkrch3k.js";
|
|
10
1
|
import {
|
|
11
2
|
checkDshCredentials
|
|
12
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-e0ndxhtk.js";
|
|
4
|
+
import {
|
|
5
|
+
renderSteeringDelivery
|
|
6
|
+
} from "./cli-96qd5psa.js";
|
|
13
7
|
import {
|
|
14
8
|
checkCodexCredentials,
|
|
15
9
|
codexUserHome
|
|
16
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-xgpf00sk.js";
|
|
17
11
|
import {
|
|
18
12
|
checkClaudeManagedCredentials
|
|
19
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-vn0qv9cj.js";
|
|
20
14
|
import {
|
|
15
|
+
checkDevinCredentials
|
|
16
|
+
} from "./cli-9b13ggd1.js";
|
|
17
|
+
import {
|
|
18
|
+
checkOpencodeCredentials
|
|
19
|
+
} from "./cli-zw65mab6.js";
|
|
20
|
+
import {
|
|
21
|
+
isUnknownModelError,
|
|
21
22
|
renderMemoriesPrompt,
|
|
22
23
|
writeSkillsToFilesystem
|
|
23
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-phsaj4xq.js";
|
|
24
25
|
import {
|
|
25
26
|
checkClaudeCredentials
|
|
26
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-4tvgz99m.js";
|
|
27
28
|
import {
|
|
28
29
|
getContextWindowSize
|
|
29
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-wd9hz40d.js";
|
|
30
31
|
import {
|
|
31
32
|
CODEX_CREDITS_EXHAUSTED_COOLDOWN_MS,
|
|
32
33
|
MAX_RATE_LIMIT_RESET_MS,
|
|
@@ -38,7 +39,16 @@ import {
|
|
|
38
39
|
import {
|
|
39
40
|
resolveScriptsOnlyMode,
|
|
40
41
|
validateJsonSchema
|
|
41
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-79aq9cgb.js";
|
|
43
|
+
import {
|
|
44
|
+
refreshRuntimeModelCatalog
|
|
45
|
+
} from "./cli-m4excttz.js";
|
|
46
|
+
import {
|
|
47
|
+
terminateRegisteredProcessGroups
|
|
48
|
+
} from "./cli-y89t4nca.js";
|
|
49
|
+
import {
|
|
50
|
+
getApiKey
|
|
51
|
+
} from "./cli-f14fvzag.js";
|
|
42
52
|
import {
|
|
43
53
|
authJsonToCredentialSelection,
|
|
44
54
|
credentialsToAuthJson,
|
|
@@ -47,12 +57,6 @@ import {
|
|
|
47
57
|
import {
|
|
48
58
|
getOpenRouterBaseUrl
|
|
49
59
|
} from "./cli-3dpj7atn.js";
|
|
50
|
-
import {
|
|
51
|
-
terminateRegisteredProcessGroups
|
|
52
|
-
} from "./cli-y89t4nca.js";
|
|
53
|
-
import {
|
|
54
|
-
getApiKey
|
|
55
|
-
} from "./cli-f14fvzag.js";
|
|
56
60
|
import {
|
|
57
61
|
buildContextPreamble,
|
|
58
62
|
buildResumeContextPreamble,
|
|
@@ -65,7 +69,7 @@ import {
|
|
|
65
69
|
syncProfileFilesToServer,
|
|
66
70
|
writeIdentityBaselines,
|
|
67
71
|
writeProfileFileFromDb
|
|
68
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-10ym38qc.js";
|
|
69
73
|
import {
|
|
70
74
|
ensure,
|
|
71
75
|
initOtel,
|
|
@@ -75,7 +79,7 @@ import {
|
|
|
75
79
|
startSpan,
|
|
76
80
|
withSpan,
|
|
77
81
|
withSpanContext
|
|
78
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-wgjx0q33.js";
|
|
79
83
|
import {
|
|
80
84
|
init_task_attachment_links,
|
|
81
85
|
taskAttachmentFetchCommand
|
|
@@ -84,12 +88,13 @@ import {
|
|
|
84
88
|
initTelemetry,
|
|
85
89
|
init_telemetry,
|
|
86
90
|
telemetry
|
|
87
|
-
} from "./cli-
|
|
91
|
+
} from "./cli-g9df2m37.js";
|
|
88
92
|
import {
|
|
89
93
|
ProviderNameSchema,
|
|
90
94
|
init_types,
|
|
95
|
+
parseWorkerModelTierOverrides,
|
|
91
96
|
resolveTaskModelSelection
|
|
92
|
-
} from "./cli-
|
|
97
|
+
} from "./cli-e4xnc0qp.js";
|
|
93
98
|
import {
|
|
94
99
|
generateDefaultClaudeMd,
|
|
95
100
|
generateDefaultIdentityMd,
|
|
@@ -99,7 +104,7 @@ import {
|
|
|
99
104
|
init_base_prompt,
|
|
100
105
|
init_defaults,
|
|
101
106
|
init_templates
|
|
102
|
-
} from "./cli-
|
|
107
|
+
} from "./cli-ardpzhjm.js";
|
|
103
108
|
import {
|
|
104
109
|
configureHttpResolver,
|
|
105
110
|
init_resolver,
|
|
@@ -108,16 +113,16 @@ import {
|
|
|
108
113
|
interpolate,
|
|
109
114
|
isSteeringEnabled,
|
|
110
115
|
resolveTemplateAsync
|
|
111
|
-
} from "./cli-
|
|
116
|
+
} from "./cli-rgjprct3.js";
|
|
117
|
+
import {
|
|
118
|
+
getMcpBaseUrl,
|
|
119
|
+
init_constants
|
|
120
|
+
} from "./cli-dv6cdjs2.js";
|
|
112
121
|
import {
|
|
113
122
|
ModelWindowExhaustedError,
|
|
114
123
|
init_credentials,
|
|
115
124
|
resolveCredentialPools
|
|
116
125
|
} from "./cli-19jenss3.js";
|
|
117
|
-
import {
|
|
118
|
-
getMcpBaseUrl,
|
|
119
|
-
init_constants
|
|
120
|
-
} from "./cli-dv6cdjs2.js";
|
|
121
126
|
import {
|
|
122
127
|
init_model_rate_limit_windows,
|
|
123
128
|
parseModelLimitMessage,
|
|
@@ -163,19 +168,19 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
|
|
|
163
168
|
async function createProviderAdapter(provider) {
|
|
164
169
|
switch (provider) {
|
|
165
170
|
case "claude": {
|
|
166
|
-
const { ClaudeAdapter } = await import("./claude-adapter-
|
|
171
|
+
const { ClaudeAdapter } = await import("./claude-adapter-1t6611ne.js");
|
|
167
172
|
return new ClaudeAdapter;
|
|
168
173
|
}
|
|
169
174
|
case "pi": {
|
|
170
|
-
const { PiMonoAdapter } = await import("./pi-mono-adapter-
|
|
175
|
+
const { PiMonoAdapter } = await import("./pi-mono-adapter-n0me28wt.js");
|
|
171
176
|
return new PiMonoAdapter;
|
|
172
177
|
}
|
|
173
178
|
case "codex": {
|
|
174
|
-
const { CodexAdapter } = await import("./codex-adapter-
|
|
179
|
+
const { CodexAdapter } = await import("./codex-adapter-jqfqqa21.js");
|
|
175
180
|
return new CodexAdapter;
|
|
176
181
|
}
|
|
177
182
|
case "claude-managed": {
|
|
178
|
-
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-
|
|
183
|
+
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-werp659j.js");
|
|
179
184
|
return new ClaudeManagedAdapter;
|
|
180
185
|
}
|
|
181
186
|
case "devin": {
|
|
@@ -183,15 +188,15 @@ async function createProviderAdapter(provider) {
|
|
|
183
188
|
return new DevinAdapter;
|
|
184
189
|
}
|
|
185
190
|
case "opencode": {
|
|
186
|
-
const { OpencodeAdapter } = await import("./opencode-adapter-
|
|
191
|
+
const { OpencodeAdapter } = await import("./opencode-adapter-zz7xvjj6.js");
|
|
187
192
|
return new OpencodeAdapter;
|
|
188
193
|
}
|
|
189
194
|
case "dsh": {
|
|
190
|
-
const { DshAdapter } = await import("./dsh-adapter-
|
|
195
|
+
const { DshAdapter } = await import("./dsh-adapter-894mgfvs.js");
|
|
191
196
|
return new DshAdapter;
|
|
192
197
|
}
|
|
193
198
|
case "acp": {
|
|
194
|
-
const { ACPAdapter } = await import("./acp-adapter-
|
|
199
|
+
const { ACPAdapter } = await import("./acp-adapter-qhch0n2v.js");
|
|
195
200
|
return new ACPAdapter;
|
|
196
201
|
}
|
|
197
202
|
default:
|
|
@@ -216,6 +221,82 @@ function computeBudgetBackoffMs(consecutiveRefusals, basePollMs) {
|
|
|
216
221
|
init_constants();
|
|
217
222
|
init_credentials();
|
|
218
223
|
|
|
224
|
+
// src/utils/harness-cli-version.ts
|
|
225
|
+
init_secret_scrubber();
|
|
226
|
+
var CLI_BINARY = { claude: "claude", codex: "codex" };
|
|
227
|
+
var PROBE_TIMEOUT_MS = 1e4;
|
|
228
|
+
var VERSION_RE = /\d+\.\d+\.\d+(?:[-+][\w.]+)?/;
|
|
229
|
+
var probed = new Map;
|
|
230
|
+
function parseCliVersion(output) {
|
|
231
|
+
return VERSION_RE.exec(output)?.[0] ?? null;
|
|
232
|
+
}
|
|
233
|
+
function probeHarnessCliVersion(harness) {
|
|
234
|
+
const binary = CLI_BINARY[harness];
|
|
235
|
+
if (!binary)
|
|
236
|
+
return Promise.resolve(null);
|
|
237
|
+
let pending = probed.get(harness);
|
|
238
|
+
if (!pending) {
|
|
239
|
+
pending = (async () => {
|
|
240
|
+
try {
|
|
241
|
+
const proc = Bun.spawn([binary, "--version"], {
|
|
242
|
+
stdin: "ignore",
|
|
243
|
+
stdout: "pipe",
|
|
244
|
+
stderr: "pipe",
|
|
245
|
+
timeout: PROBE_TIMEOUT_MS,
|
|
246
|
+
killSignal: "SIGKILL"
|
|
247
|
+
});
|
|
248
|
+
const [stdout, exitCode] = await Promise.all([
|
|
249
|
+
new Response(proc.stdout).text(),
|
|
250
|
+
proc.exited
|
|
251
|
+
]);
|
|
252
|
+
return exitCode === 0 ? parseCliVersion(stdout) : null;
|
|
253
|
+
} catch {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
})();
|
|
257
|
+
probed.set(harness, pending);
|
|
258
|
+
}
|
|
259
|
+
return pending;
|
|
260
|
+
}
|
|
261
|
+
async function cachedHarnessCliVersion(harness) {
|
|
262
|
+
return await probed.get(harness) ?? null;
|
|
263
|
+
}
|
|
264
|
+
var reported = new Set;
|
|
265
|
+
async function reportHarnessModelOutcome(opts) {
|
|
266
|
+
if (!opts.model || !CLI_BINARY[opts.harness])
|
|
267
|
+
return;
|
|
268
|
+
const cliVersion = await cachedHarnessCliVersion(opts.harness);
|
|
269
|
+
if (!cliVersion)
|
|
270
|
+
return;
|
|
271
|
+
const status = opts.exitCode === 0 ? "ok" : isUnknownModelError(opts.failureReason, opts.model) ? "unsupported" : null;
|
|
272
|
+
if (!status)
|
|
273
|
+
return;
|
|
274
|
+
const key = `${opts.harness}|${cliVersion}|${opts.model}`;
|
|
275
|
+
if (status === "ok" && reported.has(key))
|
|
276
|
+
return;
|
|
277
|
+
try {
|
|
278
|
+
const headers = {
|
|
279
|
+
"Content-Type": "application/json",
|
|
280
|
+
"X-Agent-ID": opts.agentId
|
|
281
|
+
};
|
|
282
|
+
if (opts.apiKey)
|
|
283
|
+
headers.Authorization = `Bearer ${opts.apiKey}`;
|
|
284
|
+
const res = await (opts.fetchImpl ?? fetch)(`${opts.apiUrl}/api/models-catalog/harness-support`, {
|
|
285
|
+
method: "PUT",
|
|
286
|
+
headers,
|
|
287
|
+
body: JSON.stringify({
|
|
288
|
+
harness: opts.harness,
|
|
289
|
+
cliVersion,
|
|
290
|
+
modelId: opts.model,
|
|
291
|
+
status,
|
|
292
|
+
...status === "unsupported" && opts.failureReason ? { error: scrubSecrets(opts.failureReason).slice(0, 2000) } : {}
|
|
293
|
+
})
|
|
294
|
+
});
|
|
295
|
+
if (res.ok && status === "ok")
|
|
296
|
+
reported.add(key);
|
|
297
|
+
} catch {}
|
|
298
|
+
}
|
|
299
|
+
|
|
219
300
|
// src/utils/harness-provider.ts
|
|
220
301
|
init_types();
|
|
221
302
|
var SUPPORTED_PROVIDERS = ProviderNameSchema.options;
|
|
@@ -605,7 +686,7 @@ var CREDENTIAL_PROVIDER_CHECKERS = {
|
|
|
605
686
|
devin: (env) => checkDevinCredentials(env),
|
|
606
687
|
opencode: (env, opts) => checkOpencodeCredentials(env, opts),
|
|
607
688
|
pi: async (env, opts) => {
|
|
608
|
-
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-
|
|
689
|
+
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-n0me28wt.js");
|
|
609
690
|
return checkPiMonoCredentials(env, opts);
|
|
610
691
|
},
|
|
611
692
|
acp: () => ({ ready: true, missing: [], satisfiedBy: "sdk-delegated" })
|
|
@@ -1769,6 +1850,8 @@ var SWARM_TOOL_LABELS = {
|
|
|
1769
1850
|
"set-config": "⚙️ Setting config",
|
|
1770
1851
|
"list-config": "⚙️ Listing config",
|
|
1771
1852
|
"delete-config": "⚙️ Deleting config",
|
|
1853
|
+
"model-catalog-refresh": "\uD83E\uDDE0 Refreshing model catalog",
|
|
1854
|
+
"model-catalog-overlay-upsert": "\uD83E\uDDE0 Updating model catalog overlay",
|
|
1772
1855
|
"create-schedule": "\uD83D\uDCC5 Creating schedule",
|
|
1773
1856
|
"list-schedules": "\uD83D\uDCC5 Listing schedules",
|
|
1774
1857
|
"run-schedule-now": "\uD83D\uDCC5 Running schedule",
|
|
@@ -2705,6 +2788,9 @@ async function triggerHeartbeatSweep(config) {
|
|
|
2705
2788
|
return false;
|
|
2706
2789
|
}
|
|
2707
2790
|
}
|
|
2791
|
+
function workerModelTierOverrides(provider) {
|
|
2792
|
+
return parseWorkerModelTierOverrides(process.env, provider);
|
|
2793
|
+
}
|
|
2708
2794
|
async function buildRequesterProfilePrompt(requestedBy) {
|
|
2709
2795
|
const comms = requestedBy?.comms;
|
|
2710
2796
|
const commsParts = [
|
|
@@ -2749,7 +2835,9 @@ async function registerAgent(opts) {
|
|
|
2749
2835
|
maxTasks: opts.maxTasks,
|
|
2750
2836
|
provider,
|
|
2751
2837
|
harness_provider: harnessProvider,
|
|
2752
|
-
runtimeInstanceId: opts.runtimeInstanceId
|
|
2838
|
+
runtimeInstanceId: opts.runtimeInstanceId,
|
|
2839
|
+
modelTierOverrides: workerModelTierOverrides(harnessProvider),
|
|
2840
|
+
harnessCliVersion: await probeHarnessCliVersion(harnessProvider) ?? undefined
|
|
2753
2841
|
})
|
|
2754
2842
|
});
|
|
2755
2843
|
if (!response.ok) {
|
|
@@ -2781,6 +2869,11 @@ async function pollForTrigger(opts) {
|
|
|
2781
2869
|
}
|
|
2782
2870
|
async function pollForTriggerOnce(opts) {
|
|
2783
2871
|
const startTime = Date.now();
|
|
2872
|
+
refreshRuntimeModelCatalog({
|
|
2873
|
+
apiUrl: opts.apiUrl,
|
|
2874
|
+
apiKey: opts.apiKey,
|
|
2875
|
+
agentId: opts.agentId
|
|
2876
|
+
});
|
|
2784
2877
|
const headers = {
|
|
2785
2878
|
"X-Agent-ID": opts.agentId
|
|
2786
2879
|
};
|
|
@@ -2791,6 +2884,9 @@ async function pollForTriggerOnce(opts) {
|
|
|
2791
2884
|
headers.Authorization = `Bearer ${opts.apiKey}`;
|
|
2792
2885
|
}
|
|
2793
2886
|
injectTraceContext(headers);
|
|
2887
|
+
if (opts.harnessProvider) {
|
|
2888
|
+
headers["X-Model-Tier-Overrides"] = encodeURIComponent(JSON.stringify(workerModelTierOverrides(opts.harnessProvider)));
|
|
2889
|
+
}
|
|
2794
2890
|
while (Date.now() - startTime < opts.pollTimeout) {
|
|
2795
2891
|
try {
|
|
2796
2892
|
let url = `${opts.apiUrl}/api/poll`;
|
|
@@ -3133,7 +3229,7 @@ async function spawnProviderProcess(adapter, opts, logDir, isYolo) {
|
|
|
3133
3229
|
let freshEnv;
|
|
3134
3230
|
let credentialSelections;
|
|
3135
3231
|
try {
|
|
3136
|
-
({ env: freshEnv, credentialSelections } = await fetchResolvedEnv(opts.apiUrl, opts.apiKey, opts.agentId, process.env, opts.model, {
|
|
3232
|
+
({ env: freshEnv, credentialSelections } = await fetchResolvedEnv(opts.apiUrl, opts.apiKey, opts.agentId, process.env, opts.resolvedModel || opts.model, {
|
|
3137
3233
|
repoId: sessionRepo?.id,
|
|
3138
3234
|
provider: adapter.name,
|
|
3139
3235
|
modelTier: opts.modelTier,
|
|
@@ -3166,7 +3262,10 @@ async function spawnProviderProcess(adapter, opts, logDir, isYolo) {
|
|
|
3166
3262
|
harnessProvider: opts.harnessProvider,
|
|
3167
3263
|
env: freshEnv
|
|
3168
3264
|
});
|
|
3169
|
-
|
|
3265
|
+
if (opts.resolvedModel && taskModelSelection.model && taskModelSelection.model !== opts.resolvedModel) {
|
|
3266
|
+
console.log(`[${opts.role}] model resolution mismatch for task ${opts.taskId ?? "?"}: server=${opts.resolvedModel} (${opts.modelSource ?? "?"}) local=${taskModelSelection.model}; using server value`);
|
|
3267
|
+
}
|
|
3268
|
+
const taskModel = opts.resolvedModel || taskModelSelection.model || "";
|
|
3170
3269
|
const model = taskModel || configModel || "";
|
|
3171
3270
|
let oauthSelection;
|
|
3172
3271
|
let oauthIsPoolBacked = false;
|
|
@@ -3777,6 +3876,15 @@ async function checkCompletedProcesses(state, role, apiConfig, cancelledSignaled
|
|
|
3777
3876
|
failureReason = result.failureReason;
|
|
3778
3877
|
console.log(`[${role}] Detected error for task ${taskId.slice(0, 8)}: ${failureReason}`);
|
|
3779
3878
|
}
|
|
3879
|
+
reportHarnessModelOutcome({
|
|
3880
|
+
apiUrl: apiConfig.apiUrl,
|
|
3881
|
+
apiKey: apiConfig.apiKey,
|
|
3882
|
+
agentId: apiConfig.agentId,
|
|
3883
|
+
harness: harnessProvider,
|
|
3884
|
+
model,
|
|
3885
|
+
exitCode: result.exitCode,
|
|
3886
|
+
failureReason
|
|
3887
|
+
});
|
|
3780
3888
|
if (credentialInfo) {
|
|
3781
3889
|
const outcome = classifyRateLimitOutcome(result, failureReason, Date.now(), state.codexCreditsExhaustedCooldownMs);
|
|
3782
3890
|
const keyRateLimitedUntil = outcome.kind === "key" ? outcome.rateLimitedUntil : outcome.kind === "model" ? outcome.keyRateLimitedUntil : undefined;
|
|
@@ -4664,6 +4772,8 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
4664
4772
|
taskId: task.id,
|
|
4665
4773
|
model: task.model,
|
|
4666
4774
|
modelTier: task.modelTier,
|
|
4775
|
+
resolvedModel: task.resolvedModel,
|
|
4776
|
+
modelSource: task.modelSource,
|
|
4667
4777
|
effort: task.effort,
|
|
4668
4778
|
harnessProvider: state.harnessProvider,
|
|
4669
4779
|
cwd: resumeCwd,
|
|
@@ -4782,7 +4892,8 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
4782
4892
|
agentId,
|
|
4783
4893
|
pollInterval: PollIntervalMs,
|
|
4784
4894
|
runtimeInstanceId,
|
|
4785
|
-
pollTimeout: effectiveTimeout
|
|
4895
|
+
pollTimeout: effectiveTimeout,
|
|
4896
|
+
harnessProvider: state.harnessProvider
|
|
4786
4897
|
});
|
|
4787
4898
|
if (trigger) {
|
|
4788
4899
|
if (trigger.type === "budget_refused") {
|
|
@@ -4958,6 +5069,12 @@ Note: The task requested working directory "${taskDir}" but it does not exist. F
|
|
|
4958
5069
|
|
|
4959
5070
|
`);
|
|
4960
5071
|
const taskSystemPrompt = taskPromptParts + cwdWarning;
|
|
5072
|
+
const modelUnsupported = trigger.task?.modelUnsupported;
|
|
5073
|
+
if (trigger.taskId && modelUnsupported) {
|
|
5074
|
+
console.log(`[${role}] ${modelUnsupported}`);
|
|
5075
|
+
await ensureTaskFinished(apiConfig, role, trigger.taskId, 1, modelUnsupported);
|
|
5076
|
+
continue;
|
|
5077
|
+
}
|
|
4961
5078
|
iteration++;
|
|
4962
5079
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
4963
5080
|
const taskIdSlice = trigger.taskId?.slice(0, 8) || "notask";
|
|
@@ -5007,6 +5124,8 @@ Note: The task requested working directory "${taskDir}" but it does not exist. F
|
|
|
5007
5124
|
taskId: trigger.taskId,
|
|
5008
5125
|
model: taskModel,
|
|
5009
5126
|
modelTier: taskModelTier,
|
|
5127
|
+
resolvedModel: trigger.task?.resolvedModel,
|
|
5128
|
+
modelSource: trigger.task?.modelSource,
|
|
5010
5129
|
effort: taskEffort,
|
|
5011
5130
|
harnessProvider: state.harnessProvider,
|
|
5012
5131
|
cwd: effectiveCwd,
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runtimeCatalogModel,
|
|
3
|
+
runtimeCatalogSection
|
|
4
|
+
} from "./cli-m4excttz.js";
|
|
5
|
+
import {
|
|
6
|
+
claudeCatalogModelId,
|
|
7
|
+
init_src,
|
|
8
|
+
reasoningLevelsFor
|
|
9
|
+
} from "./cli-7zttzetj.js";
|
|
10
|
+
|
|
11
|
+
// src/providers/reasoning-effort.ts
|
|
12
|
+
init_src();
|
|
13
|
+
function splitProviderModel(model) {
|
|
14
|
+
const slash = model.indexOf("/");
|
|
15
|
+
if (slash === -1)
|
|
16
|
+
return { providerId: "", modelId: model };
|
|
17
|
+
return { providerId: model.slice(0, slash), modelId: model.slice(slash + 1) };
|
|
18
|
+
}
|
|
19
|
+
function lookupModel(harness, model) {
|
|
20
|
+
if (!model)
|
|
21
|
+
return;
|
|
22
|
+
let providerId;
|
|
23
|
+
let modelId;
|
|
24
|
+
if (harness === "claude") {
|
|
25
|
+
providerId = "anthropic";
|
|
26
|
+
modelId = claudeCatalogModelId(model, runtimeCatalogSection("anthropic"));
|
|
27
|
+
} else if (harness === "codex") {
|
|
28
|
+
providerId = "openai";
|
|
29
|
+
modelId = model;
|
|
30
|
+
} else {
|
|
31
|
+
({ providerId, modelId } = splitProviderModel(model));
|
|
32
|
+
if (!providerId)
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const facts = runtimeCatalogModel(providerId, modelId);
|
|
36
|
+
return facts ? { id: modelId, facts } : undefined;
|
|
37
|
+
}
|
|
38
|
+
function pickDefault(levels) {
|
|
39
|
+
if (levels.length === 0)
|
|
40
|
+
return null;
|
|
41
|
+
return levels.includes("medium") ? "medium" : levels[0] ?? null;
|
|
42
|
+
}
|
|
43
|
+
function reasoningCapability(harness, model) {
|
|
44
|
+
const entry = lookupModel(harness, model);
|
|
45
|
+
const levels = entry ? reasoningLevelsFor(harness, entry.id, entry.facts) : [];
|
|
46
|
+
if (levels.length === 0)
|
|
47
|
+
return { supported: false, levels: [], default: null };
|
|
48
|
+
return { supported: true, levels, default: pickDefault(levels) };
|
|
49
|
+
}
|
|
50
|
+
function applyClaudeEffort(level) {
|
|
51
|
+
if (level === "off") {
|
|
52
|
+
return { kind: "claude-env", env: { MAX_THINKING_TOKENS: "0" } };
|
|
53
|
+
}
|
|
54
|
+
return { kind: "claude-env", env: { CLAUDE_CODE_EFFORT_LEVEL: level } };
|
|
55
|
+
}
|
|
56
|
+
function applyCodexEffort(level) {
|
|
57
|
+
const value = level === "off" ? "none" : level;
|
|
58
|
+
return { kind: "codex-config", config: { model_reasoning_effort: value } };
|
|
59
|
+
}
|
|
60
|
+
function applyPiEffort(level) {
|
|
61
|
+
return { kind: "pi-session", sessionOptions: { thinkingLevel: level } };
|
|
62
|
+
}
|
|
63
|
+
var ANTHROPIC_BUDGET_TOKENS_BY_LEVEL = {
|
|
64
|
+
low: 4096,
|
|
65
|
+
medium: 10240,
|
|
66
|
+
high: 32768,
|
|
67
|
+
xhigh: 65536
|
|
68
|
+
};
|
|
69
|
+
function buildOpencodeReasoningOptions(providerId, level) {
|
|
70
|
+
if (providerId === "anthropic") {
|
|
71
|
+
if (level === "max")
|
|
72
|
+
return { reasoningEffort: level };
|
|
73
|
+
return { thinking: { type: "enabled", budgetTokens: ANTHROPIC_BUDGET_TOKENS_BY_LEVEL[level] } };
|
|
74
|
+
}
|
|
75
|
+
if (providerId === "openrouter") {
|
|
76
|
+
return { reasoning: { effort: level } };
|
|
77
|
+
}
|
|
78
|
+
return { reasoningEffort: level };
|
|
79
|
+
}
|
|
80
|
+
function applyOpencodeEffort(model, level) {
|
|
81
|
+
if (level === "off") {
|
|
82
|
+
return { kind: "noop" };
|
|
83
|
+
}
|
|
84
|
+
const { providerId, modelId } = splitProviderModel(model);
|
|
85
|
+
return {
|
|
86
|
+
kind: "opencode-options",
|
|
87
|
+
providerId,
|
|
88
|
+
modelId,
|
|
89
|
+
options: buildOpencodeReasoningOptions(providerId, level)
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function applyReasoningEffort(harness, model, level) {
|
|
93
|
+
if (level === undefined)
|
|
94
|
+
return { kind: "noop" };
|
|
95
|
+
const capability = reasoningCapability(harness, model);
|
|
96
|
+
if (!capability.supported || !capability.levels.includes(level)) {
|
|
97
|
+
return { kind: "noop" };
|
|
98
|
+
}
|
|
99
|
+
switch (harness) {
|
|
100
|
+
case "claude":
|
|
101
|
+
return applyClaudeEffort(level);
|
|
102
|
+
case "codex":
|
|
103
|
+
return applyCodexEffort(level);
|
|
104
|
+
case "pi":
|
|
105
|
+
return applyPiEffort(level);
|
|
106
|
+
case "opencode":
|
|
107
|
+
return applyOpencodeEffort(model, level);
|
|
108
|
+
default: {
|
|
109
|
+
const _exhaustive = harness;
|
|
110
|
+
return _exhaustive;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { reasoningCapability, applyReasoningEffort };
|