@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
|
@@ -380,7 +380,7 @@ class InMemoryCredentialStore {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
// node_modules/@earendil-works/pi-ai/dist/
|
|
383
|
+
// node_modules/@earendil-works/pi-ai/dist/utils/models-error.js
|
|
384
384
|
class ModelsError extends Error {
|
|
385
385
|
code;
|
|
386
386
|
constructor(code, message, options) {
|
|
@@ -397,6 +397,8 @@ function withCauseDetail(message, cause) {
|
|
|
397
397
|
return message;
|
|
398
398
|
return `${message}: ${detail}`;
|
|
399
399
|
}
|
|
400
|
+
|
|
401
|
+
// node_modules/@earendil-works/pi-ai/dist/auth/resolve.js
|
|
400
402
|
function resolveProviderAuth(provider, credentials, authContext, overrides) {
|
|
401
403
|
const signal = operationSignal(overrides?.signal);
|
|
402
404
|
return raceWithAbortSignal(resolveProviderAuthWithSignal(provider, credentials, authContext, overrides, signal), signal);
|
|
@@ -505,7 +507,59 @@ class InMemoryModelsStore {
|
|
|
505
507
|
}
|
|
506
508
|
}
|
|
507
509
|
|
|
510
|
+
// node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js
|
|
511
|
+
function getModelType(model) {
|
|
512
|
+
return model.type ?? "chat";
|
|
513
|
+
}
|
|
514
|
+
function isModelType(model, type) {
|
|
515
|
+
return getModelType(model) === type;
|
|
516
|
+
}
|
|
517
|
+
function assertChatModel(model) {
|
|
518
|
+
if (!isModelType(model, "chat")) {
|
|
519
|
+
throw new ModelsError("provider", `Model ${model.provider}/${model.id} is not a chat model`);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
function assertImageModel(model) {
|
|
523
|
+
if (!isModelType(model, "image")) {
|
|
524
|
+
throw new ModelsError("provider", `Model ${model.provider}/${model.id} is not an image model`);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
function assertClassifierModel(model) {
|
|
528
|
+
if (!isModelType(model, "classifier")) {
|
|
529
|
+
throw new ModelsError("provider", `Model ${model.provider}/${model.id} is not a classifier model`);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function imageErrorResult(model, error, aborted = false) {
|
|
533
|
+
return {
|
|
534
|
+
api: model.api,
|
|
535
|
+
provider: model.provider,
|
|
536
|
+
model: model.id,
|
|
537
|
+
output: [],
|
|
538
|
+
stopReason: aborted ? "aborted" : "error",
|
|
539
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
540
|
+
timestamp: Date.now()
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function classifierErrorResult(model, error, aborted = false) {
|
|
544
|
+
return {
|
|
545
|
+
api: model.api,
|
|
546
|
+
provider: model.provider,
|
|
547
|
+
model: model.id,
|
|
548
|
+
answers: {},
|
|
549
|
+
stopReason: aborted ? "aborted" : "error",
|
|
550
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
551
|
+
timestamp: Date.now()
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
|
|
508
555
|
// node_modules/@earendil-works/pi-ai/dist/models.js
|
|
556
|
+
var KNOWN_MODEL_TYPES = { chat: true, image: true, classifier: true };
|
|
557
|
+
function hasKnownModelType(model) {
|
|
558
|
+
return Object.hasOwn(KNOWN_MODEL_TYPES, getModelType(model));
|
|
559
|
+
}
|
|
560
|
+
function withKnownModelTypes(entry) {
|
|
561
|
+
return { ...entry, models: entry.models.filter(hasKnownModelType) };
|
|
562
|
+
}
|
|
509
563
|
function mergeHeaders(base, override) {
|
|
510
564
|
if (!base && !override)
|
|
511
565
|
return;
|
|
@@ -573,9 +627,34 @@ class ModelsImpl {
|
|
|
573
627
|
}
|
|
574
628
|
return models;
|
|
575
629
|
}
|
|
630
|
+
getAllModels(provider) {
|
|
631
|
+
if (provider !== undefined) {
|
|
632
|
+
const entry = this.providers.get(provider);
|
|
633
|
+
if (!entry)
|
|
634
|
+
return [];
|
|
635
|
+
try {
|
|
636
|
+
return entry.getAllModels?.() ?? entry.getModels();
|
|
637
|
+
} catch {
|
|
638
|
+
return [];
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
const models = [];
|
|
642
|
+
for (const entry of this.providers.values()) {
|
|
643
|
+
try {
|
|
644
|
+
models.push(...entry.getAllModels?.() ?? entry.getModels());
|
|
645
|
+
} catch {}
|
|
646
|
+
}
|
|
647
|
+
return models;
|
|
648
|
+
}
|
|
649
|
+
getModelsOfType(type, provider) {
|
|
650
|
+
return this.getAllModels(provider).filter((model) => isModelType(model, type));
|
|
651
|
+
}
|
|
576
652
|
getModel(provider, id) {
|
|
577
653
|
return this.getModels(provider).find((model) => model.id === id);
|
|
578
654
|
}
|
|
655
|
+
getModelOfType(type, provider, id) {
|
|
656
|
+
return this.getModelsOfType(type, provider).find((model) => model.id === id);
|
|
657
|
+
}
|
|
579
658
|
supersedeProviderRefresh(providerId) {
|
|
580
659
|
const generation = (this.refreshGenerations.get(providerId) ?? 0) + 1;
|
|
581
660
|
this.refreshGenerations.set(providerId, generation);
|
|
@@ -620,7 +699,7 @@ class ModelsImpl {
|
|
|
620
699
|
const stored = await this.modelsStore.read(provider.id, { signal });
|
|
621
700
|
await provider.refreshModels({
|
|
622
701
|
credential,
|
|
623
|
-
stored: stored ? structuredClone(stored) : undefined,
|
|
702
|
+
stored: stored ? withKnownModelTypes(structuredClone(stored)) : undefined,
|
|
624
703
|
publish: (publication) => this.publishProviderModels(provider.id, generation, signal, publication),
|
|
625
704
|
allowNetwork,
|
|
626
705
|
force: allowNetwork ? force : undefined,
|
|
@@ -740,24 +819,45 @@ class ModelsImpl {
|
|
|
740
819
|
})();
|
|
741
820
|
return raceWithAbortSignal(check, signal);
|
|
742
821
|
}
|
|
822
|
+
async getAuthenticatedProviders(providerId, signal) {
|
|
823
|
+
signal.throwIfAborted();
|
|
824
|
+
const providers = providerId ? [this.providers.get(providerId)].filter((entry) => entry !== undefined) : this.getProviders();
|
|
825
|
+
const checks = await Promise.all(providers.map(async (provider) => {
|
|
826
|
+
const credential = await this.readCredential(provider.id, signal);
|
|
827
|
+
return { provider, credential, auth: await this.checkProviderAuth(provider, credential, signal) };
|
|
828
|
+
}));
|
|
829
|
+
return checks.filter((entry) => entry.auth !== undefined);
|
|
830
|
+
}
|
|
743
831
|
getAvailable(providerId, options) {
|
|
744
832
|
const signal = operationSignal(options?.signal);
|
|
745
833
|
const available = (async () => {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const checks = await Promise.all(providers.map(async (provider) => {
|
|
749
|
-
const credential = await this.readCredential(provider.id, signal);
|
|
750
|
-
return { provider, credential, auth: await this.checkProviderAuth(provider, credential, signal) };
|
|
751
|
-
}));
|
|
752
|
-
return checks.flatMap(({ provider, credential, auth }) => {
|
|
753
|
-
if (!auth)
|
|
754
|
-
return [];
|
|
834
|
+
const providers = await this.getAuthenticatedProviders(providerId, signal);
|
|
835
|
+
return providers.flatMap(({ provider, credential }) => {
|
|
755
836
|
const models = provider.getModels();
|
|
756
837
|
return provider.filterModels?.(models, credential) ?? models;
|
|
757
838
|
});
|
|
758
839
|
})();
|
|
759
840
|
return raceWithAbortSignal(available, signal);
|
|
760
841
|
}
|
|
842
|
+
async getAvailableOfType(type, providerId, options) {
|
|
843
|
+
return (await this.getAllAvailable(providerId, options)).filter((model) => isModelType(model, type));
|
|
844
|
+
}
|
|
845
|
+
getAllAvailable(providerId, options) {
|
|
846
|
+
const signal = operationSignal(options?.signal);
|
|
847
|
+
const available = (async () => {
|
|
848
|
+
const providers = await this.getAuthenticatedProviders(providerId, signal);
|
|
849
|
+
return providers.flatMap(({ provider, credential }) => {
|
|
850
|
+
const models = provider.getAllModels?.() ?? provider.getModels();
|
|
851
|
+
if (provider.filterAllModels)
|
|
852
|
+
return provider.filterAllModels(models, credential);
|
|
853
|
+
if (!provider.filterModels)
|
|
854
|
+
return models;
|
|
855
|
+
const availableChatIds = new Set(provider.filterModels(provider.getModels(), credential).map((model) => model.id));
|
|
856
|
+
return models.filter((model) => !isModelType(model, "chat") || availableChatIds.has(model.id));
|
|
857
|
+
});
|
|
858
|
+
})();
|
|
859
|
+
return raceWithAbortSignal(available, signal);
|
|
860
|
+
}
|
|
761
861
|
async getAuth(providerOrModel, overrides) {
|
|
762
862
|
const signal = operationSignal(overrides?.signal);
|
|
763
863
|
const providerId = typeof providerOrModel === "string" ? providerOrModel : providerOrModel.provider;
|
|
@@ -775,7 +875,7 @@ class ModelsImpl {
|
|
|
775
875
|
}
|
|
776
876
|
};
|
|
777
877
|
}
|
|
778
|
-
async login(providerId, type, interaction) {
|
|
878
|
+
async login(providerId, type, interaction, options) {
|
|
779
879
|
const signal = operationSignal(interaction.signal);
|
|
780
880
|
signal.throwIfAborted();
|
|
781
881
|
const provider = this.providers.get(providerId);
|
|
@@ -785,7 +885,7 @@ class ModelsImpl {
|
|
|
785
885
|
if (!method?.login) {
|
|
786
886
|
throw new ModelsError("auth", `${provider.name} does not support ${type} login`);
|
|
787
887
|
}
|
|
788
|
-
const loginOperation = method.login({ ...interaction, signal });
|
|
888
|
+
const loginOperation = method.login({ ...interaction, signal }, options);
|
|
789
889
|
const credential = await raceWithAbortSignal(loginOperation, signal);
|
|
790
890
|
let mutationStarted = false;
|
|
791
891
|
let markMutationStarted;
|
|
@@ -839,6 +939,10 @@ class ModelsImpl {
|
|
|
839
939
|
}
|
|
840
940
|
return provider;
|
|
841
941
|
}
|
|
942
|
+
requireChatProvider(model) {
|
|
943
|
+
assertChatModel(model);
|
|
944
|
+
return this.requireProvider(model);
|
|
945
|
+
}
|
|
842
946
|
async applyAuth(model, options) {
|
|
843
947
|
this.requireProvider(model);
|
|
844
948
|
const resolution = await this.getAuth(model, {
|
|
@@ -863,7 +967,7 @@ class ModelsImpl {
|
|
|
863
967
|
stream(model, context, options) {
|
|
864
968
|
const transcript = normalizeContext(context);
|
|
865
969
|
return lazyStream(model, async () => {
|
|
866
|
-
const provider = this.
|
|
970
|
+
const provider = this.requireChatProvider(model);
|
|
867
971
|
const { requestModel, requestOptions } = await this.applyAuth(model, options);
|
|
868
972
|
return provider.stream(requestModel, transcript, requestOptions);
|
|
869
973
|
});
|
|
@@ -874,7 +978,7 @@ class ModelsImpl {
|
|
|
874
978
|
streamSimple(model, context, options) {
|
|
875
979
|
const transcript = normalizeContext(context);
|
|
876
980
|
return lazyStream(model, async () => {
|
|
877
|
-
const provider = this.
|
|
981
|
+
const provider = this.requireChatProvider(model);
|
|
878
982
|
const { requestModel, requestOptions } = await this.applyAuth(model, options);
|
|
879
983
|
return provider.streamSimple(requestModel, transcript, requestOptions);
|
|
880
984
|
});
|
|
@@ -884,7 +988,7 @@ class ModelsImpl {
|
|
|
884
988
|
}
|
|
885
989
|
streamDeferred(model, handle, options) {
|
|
886
990
|
return lazyStream(model, async () => {
|
|
887
|
-
const provider = this.
|
|
991
|
+
const provider = this.requireChatProvider(model);
|
|
888
992
|
if (!provider.fetchDeferred) {
|
|
889
993
|
throw new ModelsError("provider", `Provider ${model.provider} does not support deferred responses`);
|
|
890
994
|
}
|
|
@@ -896,25 +1000,61 @@ class ModelsImpl {
|
|
|
896
1000
|
return this.streamDeferred(model, handle, options).result();
|
|
897
1001
|
}
|
|
898
1002
|
async cancelDeferred(model, handle, options) {
|
|
899
|
-
const provider = this.
|
|
1003
|
+
const provider = this.requireChatProvider(model);
|
|
900
1004
|
if (!provider.cancelDeferred) {
|
|
901
1005
|
throw new ModelsError("provider", `Provider ${model.provider} does not support deferred responses`);
|
|
902
1006
|
}
|
|
903
1007
|
const { requestModel, requestOptions } = await this.applyAuth(model, options);
|
|
904
1008
|
await provider.cancelDeferred(requestModel, handle, requestOptions);
|
|
905
1009
|
}
|
|
1010
|
+
async generateImages(model, context, options) {
|
|
1011
|
+
try {
|
|
1012
|
+
assertImageModel(model);
|
|
1013
|
+
const provider = this.requireProvider(model);
|
|
1014
|
+
if (!provider.generateImages) {
|
|
1015
|
+
throw new ModelsError("provider", `Provider ${model.provider} does not support image generation`);
|
|
1016
|
+
}
|
|
1017
|
+
const { requestModel, requestOptions } = await this.applyAuth(model, options);
|
|
1018
|
+
return await provider.generateImages(requestModel, context, requestOptions);
|
|
1019
|
+
} catch (error) {
|
|
1020
|
+
return imageErrorResult(model, error, options?.signal?.aborted);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
async classify(model, context, options) {
|
|
1024
|
+
try {
|
|
1025
|
+
assertClassifierModel(model);
|
|
1026
|
+
const provider = this.requireProvider(model);
|
|
1027
|
+
if (!provider.classify) {
|
|
1028
|
+
throw new ModelsError("provider", `Provider ${model.provider} does not support classification`);
|
|
1029
|
+
}
|
|
1030
|
+
const { requestModel, requestOptions } = await this.applyAuth(model, options);
|
|
1031
|
+
return await provider.classify(requestModel, context, requestOptions);
|
|
1032
|
+
} catch (error) {
|
|
1033
|
+
return classifierErrorResult(model, error, options?.signal?.aborted);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
906
1036
|
}
|
|
907
1037
|
function createModels(options) {
|
|
908
1038
|
return new ModelsImpl(options);
|
|
909
1039
|
}
|
|
910
1040
|
function createProvider(input) {
|
|
1041
|
+
const single = input.api && typeof input.api.stream === "function" ? input.api : undefined;
|
|
1042
|
+
const byApi = single || !input.api ? undefined : input.api;
|
|
1043
|
+
const images = input.images;
|
|
1044
|
+
const classifiers = input.classifiers;
|
|
1045
|
+
const streams = single ? [single] : Object.values(byApi ?? {}).filter((entry) => entry !== undefined);
|
|
1046
|
+
const imageImplementations = Object.values(images ?? {}).filter((entry) => entry !== undefined);
|
|
1047
|
+
const classifierImplementations = Object.values(classifiers ?? {}).filter((entry) => entry !== undefined);
|
|
1048
|
+
if (streams.length === 0 && imageImplementations.length === 0 && classifierImplementations.length === 0) {
|
|
1049
|
+
throw new Error(`Provider ${input.id}: at least one of "api", "images", or "classifiers" is required.`);
|
|
1050
|
+
}
|
|
911
1051
|
const baselineModels = input.models;
|
|
912
1052
|
let dynamicModels = [];
|
|
913
1053
|
const fetchModels = input.fetchModels;
|
|
914
1054
|
const currentModels = () => {
|
|
915
1055
|
const merged = [...baselineModels];
|
|
916
1056
|
for (const model of dynamicModels) {
|
|
917
|
-
const index = merged.findIndex((entry) => entry.id === model.id);
|
|
1057
|
+
const index = merged.findIndex((entry) => getModelType(entry) === getModelType(model) && entry.id === model.id);
|
|
918
1058
|
if (index >= 0)
|
|
919
1059
|
merged[index] = model;
|
|
920
1060
|
else
|
|
@@ -922,8 +1062,6 @@ function createProvider(input) {
|
|
|
922
1062
|
}
|
|
923
1063
|
return merged;
|
|
924
1064
|
};
|
|
925
|
-
const single = typeof input.api.stream === "function" ? input.api : undefined;
|
|
926
|
-
const byApi = single ? undefined : input.api;
|
|
927
1065
|
const apiFor = (model) => single ?? byApi?.[model.api];
|
|
928
1066
|
const dispatch = (model, run) => {
|
|
929
1067
|
const streams2 = apiFor(model);
|
|
@@ -940,7 +1078,8 @@ function createProvider(input) {
|
|
|
940
1078
|
baseUrl: input.baseUrl,
|
|
941
1079
|
headers: input.headers,
|
|
942
1080
|
auth: input.auth,
|
|
943
|
-
getModels: currentModels,
|
|
1081
|
+
getModels: () => currentModels().filter((model) => isModelType(model, "chat")),
|
|
1082
|
+
getAllModels: currentModels,
|
|
944
1083
|
refreshModels: fetchModels ? async (context) => {
|
|
945
1084
|
if (context.stored) {
|
|
946
1085
|
const restored = context.stored.models.filter((model) => model.provider === input.id).map((model) => model);
|
|
@@ -954,9 +1093,10 @@ function createProvider(input) {
|
|
|
954
1093
|
}
|
|
955
1094
|
if (!context.allowNetwork || context.signal.aborted)
|
|
956
1095
|
return;
|
|
957
|
-
const
|
|
1096
|
+
const fetched = await fetchModels(context);
|
|
958
1097
|
if (context.signal.aborted)
|
|
959
1098
|
return;
|
|
1099
|
+
const refreshed = fetched.filter(hasKnownModelType);
|
|
960
1100
|
await context.publish({
|
|
961
1101
|
persist: { models: refreshed, checkedAt: Date.now() },
|
|
962
1102
|
update: () => {
|
|
@@ -965,10 +1105,10 @@ function createProvider(input) {
|
|
|
965
1105
|
});
|
|
966
1106
|
} : undefined,
|
|
967
1107
|
filterModels: input.filterModels,
|
|
1108
|
+
filterAllModels: input.filterAllModels,
|
|
968
1109
|
stream: (model, context, options) => dispatch(model, (streams2) => streams2.stream(model, context, options)),
|
|
969
1110
|
streamSimple: (model, context, options) => dispatch(model, (streams2) => streams2.streamSimple(model, context, options))
|
|
970
1111
|
};
|
|
971
|
-
const streams = single ? [single] : Object.values(byApi ?? {}).filter((entry) => entry !== undefined);
|
|
972
1112
|
if (streams.some((entry) => entry.fetchDeferred !== undefined)) {
|
|
973
1113
|
provider.fetchDeferred = (model, handle, options) => lazyStream(model, async () => {
|
|
974
1114
|
const implementation = apiFor(model);
|
|
@@ -987,10 +1127,28 @@ function createProvider(input) {
|
|
|
987
1127
|
await implementation.cancelDeferred(model, handle, options);
|
|
988
1128
|
};
|
|
989
1129
|
}
|
|
1130
|
+
if (images && imageImplementations.length > 0) {
|
|
1131
|
+
provider.generateImages = async (model, context, options) => {
|
|
1132
|
+
const implementation = images[model.api];
|
|
1133
|
+
if (!implementation) {
|
|
1134
|
+
return imageErrorResult(model, new ModelsError("provider", `Provider ${input.id} has no image generation implementation for "${model.api}"`));
|
|
1135
|
+
}
|
|
1136
|
+
return implementation.generateImages(model, context, options);
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
if (classifiers && classifierImplementations.length > 0) {
|
|
1140
|
+
provider.classify = async (model, context, options) => {
|
|
1141
|
+
const implementation = classifiers[model.api];
|
|
1142
|
+
if (!implementation) {
|
|
1143
|
+
return classifierErrorResult(model, new ModelsError("provider", `Provider ${input.id} has no classifier implementation for "${model.api}"`));
|
|
1144
|
+
}
|
|
1145
|
+
return implementation.classify(model, context, options);
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
990
1148
|
return provider;
|
|
991
1149
|
}
|
|
992
1150
|
function hasApi(model, api) {
|
|
993
|
-
return model.api === api;
|
|
1151
|
+
return isModelType(model, "chat") && model.api === api;
|
|
994
1152
|
}
|
|
995
1153
|
function calculateCost(model, usage) {
|
|
996
1154
|
const inputTokens = usage.input + usage.cacheRead + usage.cacheWrite;
|
|
@@ -1046,7 +1204,7 @@ function clampThinkingLevel(model, level) {
|
|
|
1046
1204
|
function modelsAreEqual(a, b) {
|
|
1047
1205
|
if (!a || !b)
|
|
1048
1206
|
return false;
|
|
1049
|
-
return a.id === b.id && a.provider === b.provider;
|
|
1207
|
+
return getModelType(a) === getModelType(b) && a.id === b.id && a.provider === b.provider;
|
|
1050
1208
|
}
|
|
1051
1209
|
|
|
1052
|
-
export { lazyStream, lazyApi, defaultProviderAuthContext, InMemoryCredentialStore, ModelsError,
|
|
1210
|
+
export { lazyStream, lazyApi, defaultProviderAuthContext, InMemoryCredentialStore, ModelsError, InMemoryModelsStore, getModelType, isModelType, assertChatModel, assertImageModel, assertClassifierModel, imageErrorResult, classifierErrorResult, contentText, getSystemMessageText, renderSystemMessageUpdate, createInitialSystemMessage, normalizeContext, getInitialSystemMessage, withoutInitialSystemMessage, getCurrentTools, getCurrentSystemMessage, getCurrentSystemPrompt, collapseSystemMessages, resolveTranscript, toToolDeclaration, declarationsEqual, getToolStateChanges, getDeclaredTools, hasToolRedefinitions, hasNonAdditiveToolChanges, resolveTranscriptTools, createModels, createProvider, hasApi, calculateCost, getSupportedThinkingLevels, clampThinkingLevel, modelsAreEqual };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PermissionVerbSchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-9yg65c1j.js";
|
|
4
4
|
import {
|
|
5
5
|
seedPricingFromModelsDev
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-0n2e4x49.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb,
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-g9df2m37.js";
|
|
12
12
|
import {
|
|
13
13
|
init_env_flag
|
|
14
14
|
} from "./cli-ej6gbxfb.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
require_cross_spawn
|
|
3
|
-
} from "./cli-5bfdm1ah.js";
|
|
4
1
|
import {
|
|
5
2
|
resolveSlashSkillPrompt
|
|
6
3
|
} from "./cli-r94z9p1z.js";
|
|
7
4
|
import {
|
|
8
5
|
readPkgVersion
|
|
9
6
|
} from "./cli-2djtr51b.js";
|
|
7
|
+
import {
|
|
8
|
+
require_cross_spawn
|
|
9
|
+
} from "./cli-5bfdm1ah.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchInstalledMcpServers
|
|
12
12
|
} from "./cli-tng3131n.js";
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
CONTEXT_FORMULA,
|
|
18
18
|
clampContextPercent,
|
|
19
19
|
getContextWindowSize
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-wd9hz40d.js";
|
|
21
21
|
import {
|
|
22
22
|
applyReasoningEffort
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-ca2w7zv7.js";
|
|
24
24
|
import {
|
|
25
25
|
swarmRuntimeInstanceId
|
|
26
26
|
} from "./cli-re8z5p8p.js";
|
package/dist/cli.js
CHANGED
|
@@ -8,24 +8,25 @@ import {
|
|
|
8
8
|
require_react_development,
|
|
9
9
|
require_react_jsx_dev_runtime_development,
|
|
10
10
|
use_app_default
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-fkqhbg8g.js";
|
|
12
|
+
import"./cli-0xqde53b.js";
|
|
13
|
+
import"./cli-pqetb83f.js";
|
|
13
14
|
import {
|
|
14
15
|
bedrockProviderModule
|
|
15
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-kdnehe0t.js";
|
|
16
17
|
import"./cli-yn0a417a.js";
|
|
17
18
|
import"./cli-cgj4hc12.js";
|
|
18
19
|
import"./cli-txgcknmy.js";
|
|
19
20
|
import"./cli-6map995v.js";
|
|
20
|
-
import"./cli-
|
|
21
|
+
import"./cli-31nkw3g3.js";
|
|
21
22
|
import"./cli-y2apkfe2.js";
|
|
22
|
-
import"./cli-
|
|
23
|
+
import"./cli-7kyk9jr3.js";
|
|
23
24
|
import {
|
|
24
25
|
setBedrockProviderModule
|
|
25
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-13hw4z91.js";
|
|
26
27
|
import"./cli-btbzvq95.js";
|
|
27
28
|
import"./cli-1m2e086m.js";
|
|
28
|
-
import"./cli-
|
|
29
|
+
import"./cli-ykk5jaax.js";
|
|
29
30
|
import"./cli-bzr0ftht.js";
|
|
30
31
|
import"./cli-bd957dgb.js";
|
|
31
32
|
import {
|
|
@@ -57,7 +58,7 @@ var import_react = __toESM(require_react(), 1);
|
|
|
57
58
|
// package.json
|
|
58
59
|
var package_default = {
|
|
59
60
|
name: "@desplega.ai/agent-swarm",
|
|
60
|
-
version: "1.
|
|
61
|
+
version: "1.159.0",
|
|
61
62
|
description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
|
|
62
63
|
keywords: [
|
|
63
64
|
"agent-swarm.dev",
|
|
@@ -226,8 +227,9 @@ var package_default = {
|
|
|
226
227
|
devDependencies: {
|
|
227
228
|
"@biomejs/biome": "^2.3.10",
|
|
228
229
|
"@desplega.ai/slack-mock": "^0.4.0",
|
|
230
|
+
"@desplega/model-catalog": "workspace:*",
|
|
229
231
|
"@faker-js/faker": "^10.4.0",
|
|
230
|
-
"@opencode-ai/plugin": "1.
|
|
232
|
+
"@opencode-ai/plugin": "1.18.33",
|
|
231
233
|
"@types/bun": "latest",
|
|
232
234
|
"dependency-cruiser": "^18.0.0",
|
|
233
235
|
konsistent: "1.0.0-beta.1",
|
|
@@ -244,20 +246,20 @@ var package_default = {
|
|
|
244
246
|
dependencies: {
|
|
245
247
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
246
248
|
"@ai-sdk/openai": "^3.0.41",
|
|
247
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
249
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.285",
|
|
248
250
|
"@anthropic-ai/sdk": "^0.93.0",
|
|
249
251
|
"@asteasolutions/zod-to-openapi": "^8.0.0",
|
|
250
252
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
251
253
|
"@desplega.ai/business-use": "^0.4.2",
|
|
252
254
|
"@desplega.ai/localtunnel": "^2.2.0",
|
|
253
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
254
|
-
"@earendil-works/pi-ai": "^0.
|
|
255
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
255
|
+
"@earendil-works/pi-agent-core": "^0.99.1",
|
|
256
|
+
"@earendil-works/pi-ai": "^0.99.1",
|
|
257
|
+
"@earendil-works/pi-coding-agent": "^0.99.1",
|
|
256
258
|
"@inkjs/ui": "^2.0.0",
|
|
257
259
|
"@linear/sdk": "^77.0.0",
|
|
258
260
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
259
|
-
"@openai/codex": "0.
|
|
260
|
-
"@opencode-ai/sdk": "^1.18.
|
|
261
|
+
"@openai/codex": "0.159.1",
|
|
262
|
+
"@opencode-ai/sdk": "^1.18.33",
|
|
261
263
|
"@openfort/openfort-node": "^0.9.1",
|
|
262
264
|
"@opentelemetry/api": "^1.9.1",
|
|
263
265
|
"@opentelemetry/api-logs": "^0.218.0",
|
|
@@ -751,7 +753,7 @@ function McpServer({ port, apiKey, dbPath }) {
|
|
|
751
753
|
if (dbPath) {
|
|
752
754
|
process.env.DATABASE_PATH = dbPath;
|
|
753
755
|
}
|
|
754
|
-
import("./http-
|
|
756
|
+
import("./http-akc3wy3m.js").then(() => {
|
|
755
757
|
setStatus("running");
|
|
756
758
|
}).catch((err) => {
|
|
757
759
|
setStatus("error");
|
|
@@ -837,7 +839,7 @@ function WorkerRunner({
|
|
|
837
839
|
}) {
|
|
838
840
|
const { exit } = use_app_default();
|
|
839
841
|
import_react.useEffect(() => {
|
|
840
|
-
import("./worker-
|
|
842
|
+
import("./worker-85testgj.js").then(({ runWorker }) => runWorker({
|
|
841
843
|
prompt: prompt || undefined,
|
|
842
844
|
yolo,
|
|
843
845
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -854,7 +856,7 @@ function WorkerRunner({
|
|
|
854
856
|
function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
|
|
855
857
|
const { exit } = use_app_default();
|
|
856
858
|
import_react.useEffect(() => {
|
|
857
|
-
import("./lead-
|
|
859
|
+
import("./lead-jp69z5h3.js").then(({ runLead }) => runLead({
|
|
858
860
|
prompt: prompt || undefined,
|
|
859
861
|
yolo,
|
|
860
862
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -894,8 +896,8 @@ function LazyComponent({
|
|
|
894
896
|
}
|
|
895
897
|
return import_react.createElement(Component, props);
|
|
896
898
|
}
|
|
897
|
-
var loadOnboard = () => import("./onboard-
|
|
898
|
-
var loadConnect = () => import("./setup-
|
|
899
|
+
var loadOnboard = () => import("./onboard-2b4q0t84.js").then(({ Onboard }) => Onboard);
|
|
900
|
+
var loadConnect = () => import("./setup-yeqryke6.js").then(({ Setup }) => Setup);
|
|
899
901
|
function UnknownCommand({ command }) {
|
|
900
902
|
const { exit } = use_app_default();
|
|
901
903
|
import_react.useEffect(() => {
|
|
@@ -1001,6 +1003,13 @@ if (args.showHelp || args.command === "help" || args.command === undefined) {
|
|
|
1001
1003
|
} else if (args.command === "version") {
|
|
1002
1004
|
console.log(`${binName} v${package_default.version}`);
|
|
1003
1005
|
process.exit(0);
|
|
1006
|
+
} else if (args.command === "onboard" && !process.versions.bun) {
|
|
1007
|
+
const { spawnSync } = await import("child_process");
|
|
1008
|
+
const result = spawnSync("bun", process.argv.slice(1), { stdio: "inherit" });
|
|
1009
|
+
if (result.error) {
|
|
1010
|
+
console.error("Onboarding requires Bun. Install Bun from https://bun.sh, then retry this command.");
|
|
1011
|
+
}
|
|
1012
|
+
process.exit(result.status ?? 1);
|
|
1004
1013
|
} else if (args.command === "docs") {
|
|
1005
1014
|
const docsUrl = "https://docs.agent-swarm.dev";
|
|
1006
1015
|
console.log(`
|
|
@@ -1018,14 +1027,14 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1018
1027
|
}
|
|
1019
1028
|
process.exit(0);
|
|
1020
1029
|
} else if (args.command === "hook") {
|
|
1021
|
-
const { runHook } = await import("./hook-
|
|
1030
|
+
const { runHook } = await import("./hook-z0hbxj85.js");
|
|
1022
1031
|
await runHook();
|
|
1023
1032
|
} else if (args.command === "codex-hook") {
|
|
1024
|
-
const { handleCodexHook } = await import("./codex-hook-
|
|
1033
|
+
const { handleCodexHook } = await import("./codex-hook-5eys3dya.js");
|
|
1025
1034
|
await handleCodexHook();
|
|
1026
1035
|
process.exit(0);
|
|
1027
1036
|
} else if (args.command === "session-summary-stdin") {
|
|
1028
|
-
const { runSessionSummaryFromStdin } = await import("./hook-
|
|
1037
|
+
const { runSessionSummaryFromStdin } = await import("./hook-853bxrr6.js");
|
|
1029
1038
|
await runSessionSummaryFromStdin();
|
|
1030
1039
|
process.exit(process.exitCode ?? 0);
|
|
1031
1040
|
} else if (args.command === "artifact") {
|
|
@@ -1046,7 +1055,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1046
1055
|
printHelp("scripts");
|
|
1047
1056
|
process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
|
|
1048
1057
|
}
|
|
1049
|
-
const { runScriptsMaintenanceCommand } = await import("./maintenance-
|
|
1058
|
+
const { runScriptsMaintenanceCommand } = await import("./maintenance-fwx4ev0k.js");
|
|
1050
1059
|
await runScriptsMaintenanceCommand(scriptsArgs);
|
|
1051
1060
|
console.log("Scripts re-embedded.");
|
|
1052
1061
|
} else if (args.command === "rbac") {
|
|
@@ -1056,21 +1065,21 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1056
1065
|
printHelp("rbac");
|
|
1057
1066
|
process.exit(args.showHelp ? 0 : 1);
|
|
1058
1067
|
}
|
|
1059
|
-
const { runRbacCliCommand } = await import("./rbac-roles-
|
|
1068
|
+
const { runRbacCliCommand } = await import("./rbac-roles-krjyazbj.js");
|
|
1060
1069
|
await runRbacCliCommand(rbacArgs);
|
|
1061
1070
|
} else if (args.command === "codex-login") {
|
|
1062
|
-
const { runCodexLogin } = await import("./codex-login-
|
|
1071
|
+
const { runCodexLogin } = await import("./codex-login-he9vrn90.js");
|
|
1063
1072
|
const codexLoginArgs = process.argv.slice(process.argv.indexOf("codex-login") + 1);
|
|
1064
1073
|
await runCodexLogin(codexLoginArgs);
|
|
1065
1074
|
} else if (args.command === "codex-session-runner") {
|
|
1066
|
-
const { runCodexSessionRunner } = await import("./codex-session-runner-
|
|
1075
|
+
const { runCodexSessionRunner } = await import("./codex-session-runner-zd341dsm.js");
|
|
1067
1076
|
await runCodexSessionRunner();
|
|
1068
1077
|
} else if (args.command === "claude-managed-setup") {
|
|
1069
|
-
const { runClaudeManagedSetup } = await import("./claude-managed-setup-
|
|
1078
|
+
const { runClaudeManagedSetup } = await import("./claude-managed-setup-y6rdgbc1.js");
|
|
1070
1079
|
const setupArgs = process.argv.slice(process.argv.indexOf("claude-managed-setup") + 1);
|
|
1071
1080
|
await runClaudeManagedSetup(setupArgs);
|
|
1072
1081
|
} else if (args.command === "e2b") {
|
|
1073
|
-
const { runE2BCommand } = await import("./e2b-
|
|
1082
|
+
const { runE2BCommand } = await import("./e2b-ez07znam.js");
|
|
1074
1083
|
const e2bArgs = process.argv.slice(process.argv.indexOf("e2b") + 1);
|
|
1075
1084
|
await runE2BCommand(e2bArgs);
|
|
1076
1085
|
} else {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classifySystemOne,
|
|
3
|
+
isRecord
|
|
4
|
+
} from "./cli-hgqfttfc.js";
|
|
5
|
+
import"./cli-s8s499xy.js";
|
|
6
|
+
import"./cli-6map995v.js";
|
|
7
|
+
import"./cli-7kyk9jr3.js";
|
|
8
|
+
import"./cli-ykk5jaax.js";
|
|
9
|
+
import"./cli-bzr0ftht.js";
|
|
10
|
+
import"./cli-bc05qbss.js";
|
|
11
|
+
|
|
12
|
+
// node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js
|
|
13
|
+
var LABEL = "Cloudflare Workers AI";
|
|
14
|
+
function cloudflareErrorMessage(errors) {
|
|
15
|
+
if (Array.isArray(errors)) {
|
|
16
|
+
const messages = errors.map((error) => isRecord(error) && typeof error.message === "string" ? error.message : undefined).filter((message) => message !== undefined);
|
|
17
|
+
if (messages.length > 0)
|
|
18
|
+
return `${LABEL} error: ${messages.join("; ")}`;
|
|
19
|
+
}
|
|
20
|
+
return `${LABEL} request failed`;
|
|
21
|
+
}
|
|
22
|
+
var transport = {
|
|
23
|
+
api: "cloudflare-workers-ai-system-one",
|
|
24
|
+
label: LABEL,
|
|
25
|
+
url: (model) => new URL("run", `${model.baseUrl.replace(/\/+$/u, "")}/`),
|
|
26
|
+
payload: (model, request) => ({ model: model.id, input: request }),
|
|
27
|
+
output: (body) => {
|
|
28
|
+
if (!isRecord(body))
|
|
29
|
+
throw new Error(`${LABEL} returned an unexpected response`);
|
|
30
|
+
if (body.success === false)
|
|
31
|
+
throw new Error(cloudflareErrorMessage(body.errors));
|
|
32
|
+
const run = body.result;
|
|
33
|
+
if (!isRecord(run))
|
|
34
|
+
throw new Error(`${LABEL} returned an unexpected response`);
|
|
35
|
+
if (run.state !== "Completed") {
|
|
36
|
+
throw new Error(`${LABEL} run did not complete (state: ${String(run.state)})`);
|
|
37
|
+
}
|
|
38
|
+
if (!isRecord(run.result))
|
|
39
|
+
throw new Error(`${LABEL} returned an unexpected response`);
|
|
40
|
+
return run.result;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var classify = (model, context, options) => classifySystemOne(transport, model, context, options);
|
|
44
|
+
export {
|
|
45
|
+
classify
|
|
46
|
+
};
|