@desplega.ai/agent-swarm 2.6.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{acp-adapter-dgfakfpw.js → acp-adapter-8dn5tq56.js} +6 -6
- package/dist/{actions-fbqma8aa.js → actions-3r6gw7dy.js} +18 -18
- package/dist/{amp-adapter-en0jy6hs.js → amp-adapter-wjtq413p.js} +3 -3
- package/dist/{anthropic-messages-txs190dd.js → anthropic-messages-n4cby1rz.js} +4 -4
- package/dist/{app-k8a5cgpp.js → app-d53yhykk.js} +3 -3
- package/dist/{assistant-a16433gr.js → assistant-ksrawj3k.js} +20 -20
- package/dist/{boot-reembed-6c1sjfnr.js → boot-reembed-fxfw17m2.js} +11 -3
- package/dist/{boot-reembed-f4nn561n.js → boot-reembed-k5y5xbj0.js} +15 -8
- package/dist/{boot-scrub-sweep-d4w9gajf.js → boot-scrub-sweep-se41j9fd.js} +3 -3
- package/dist/{boot-seeds-9bmkspyw.js → boot-seeds-r3kwwv8b.js} +4 -4
- package/dist/{claude-adapter-nys1kjxa.js → claude-adapter-ahmyf231.js} +8 -8
- package/dist/{claude-managed-adapter-55207973.js → claude-managed-adapter-5knamegc.js} +3 -3
- package/dist/{claude-managed-setup-3cm35gey.js → claude-managed-setup-mdc7dy6b.js} +3 -3
- package/dist/{claude-sdk-session-nw5yd8cp.js → claude-sdk-session-n5wen9zk.js} +8729 -8600
- package/dist/{cli-683y0b3a.js → cli-0dqtv2jg.js} +2 -2
- package/dist/{cli-a34pr3w1.js → cli-0tww7dnz.js} +2 -2
- package/dist/{cli-w2656ka1.js → cli-0w4e4v58.js} +7 -7
- package/dist/{cli-5sckpqcx.js → cli-2sjm3t4r.js} +1 -1
- package/dist/{cli-gf2850q7.js → cli-3cywb44q.js} +18 -1
- package/dist/{cli-8wkb09q5.js → cli-3k9jej0c.js} +2 -2
- package/dist/{cli-3aqd4jaa.js → cli-3v2cyqb8.js} +3 -3
- package/dist/{cli-emhjcj2y.js → cli-5qt9vzmq.js} +89 -20
- package/dist/{cli-abkm71vr.js → cli-5rp1w4cr.js} +1 -1
- package/dist/{cli-gf95q3bm.js → cli-6vwjsetx.js} +4 -4
- package/dist/{cli-k21gx5ht.js → cli-6w2yrrc0.js} +10 -10
- package/dist/{cli-m70bajzr.js → cli-75tdydgv.js} +1 -1
- package/dist/{cli-5rj83bam.js → cli-8feswf2v.js} +47 -36
- package/dist/{cli-sxgtf5fw.js → cli-8wd3mbyj.js} +1 -1
- package/dist/{cli-ca6banwz.js → cli-9csfthbw.js} +10 -8
- package/dist/{cli-dqygeeh5.js → cli-b41p764a.js} +31 -3
- package/dist/{cli-m5a9m0ak.js → cli-c1t533hh.js} +3 -3
- package/dist/{cli-2sjhpsns.js → cli-c28jxpcv.js} +1 -1
- package/dist/{cli-bqztfyve.js → cli-cb50g9cd.js} +1 -1
- package/dist/{cli-ag2yrnt5.js → cli-d8gaphtr.js} +2 -2
- package/dist/{cli-9abdgn5t.js → cli-dgtfysne.js} +3 -3
- package/dist/{cli-nq677csy.js → cli-dscnhn18.js} +1 -1
- package/dist/{cli-3fwqy71j.js → cli-dv11pgpv.js} +39 -32
- package/dist/{cli-v49fkghp.js → cli-ekptgk2m.js} +6 -6
- package/dist/{cli-c2habvsf.js → cli-f3mzy662.js} +17 -17
- package/dist/{cli-zqne1qcj.js → cli-fk7k8s9x.js} +2 -2
- package/dist/{cli-1tem6ns9.js → cli-gt4h8cxw.js} +3 -2
- package/dist/{cli-vbhgkw9h.js → cli-h3e7bhvn.js} +3 -3
- package/dist/{cli-ffvsj2qw.js → cli-hkxqdmnb.js} +3 -3
- package/dist/{cli-a2rr0fmg.js → cli-hpkvgdad.js} +7 -4
- package/dist/{cli-art7c1zh.js → cli-hq2v4rr5.js} +37 -9
- package/dist/{cli-sqma6vw1.js → cli-k1zb7raw.js} +5 -5
- package/dist/{cli-4rvr7zfx.js → cli-k4awgvzm.js} +5 -0
- package/dist/{cli-3ndmpxxv.js → cli-k7d3hvya.js} +2 -2
- package/dist/{cli-3gfvmzht.js → cli-kbtdftbw.js} +74 -26
- package/dist/{cli-hfeb68z4.js → cli-kj69b9tw.js} +34 -6
- package/dist/{cli-az25fn5f.js → cli-kk9jy4nm.js} +2 -2
- package/dist/{cli-39aet655.js → cli-m52t4cta.js} +1 -1
- package/dist/{cli-cz37jqss.js → cli-mdadewqp.js} +5 -5
- package/dist/{cli-esakngh8.js → cli-nf6k60sn.js} +1 -1
- package/dist/{cli-j6rktc91.js → cli-nzdf09js.js} +1 -1
- package/dist/{cli-rr7zx19j.js → cli-prcyzecg.js} +12 -12
- package/dist/{cli-4hxrf0p4.js → cli-pzafyqtk.js} +393 -62
- package/dist/{cli-g8ka5j4j.js → cli-qvaa1gjp.js} +173 -52
- package/dist/{cli-d2dpf95n.js → cli-rg4b2g6j.js} +1 -1
- package/dist/{cli-kf4jree9.js → cli-rm66vqdz.js} +1 -1
- package/dist/{cli-4rf0f5vg.js → cli-s504c3w7.js} +5 -3
- package/dist/{cli-nn6vx2mq.js → cli-swkx9jm2.js} +7 -5
- package/dist/{cli-g20jjwt4.js → cli-thsaq4pd.js} +16 -16
- package/dist/{cli-aj8djyqt.js → cli-twjnyvs8.js} +2 -2
- package/dist/{cli-03gg9pd1.js → cli-typdpe8g.js} +4 -4
- package/dist/{cli-mtnj4fwa.js → cli-vg8pwmsd.js} +6 -6
- package/dist/{cli-gnsb1zxa.js → cli-vhpckzvp.js} +1 -1
- package/dist/{cli-7enjwya9.js → cli-vz78s5wm.js} +1 -1
- package/dist/{cli-dv97kdzv.js → cli-wdxgsdz5.js} +2 -2
- package/dist/{cli-7a6p4e65.js → cli-wtjg6je3.js} +1 -1
- package/dist/{cli-6y51ryva.js → cli-x3cngb1h.js} +44 -12
- package/dist/{cli-n7asmce6.js → cli-xbz6mcg4.js} +3 -3
- package/dist/{cli-24j1jeeb.js → cli-y4tdxsqb.js} +3 -3
- package/dist/{cli-mvjz5an3.js → cli-yqrsp3ny.js} +7 -7
- package/dist/cli.js +31 -21
- package/dist/{codex-adapter-d95q4qsn.js → codex-adapter-7wepzq15.js} +6 -6
- package/dist/{codex-hook-brpnycn5.js → codex-hook-pbdh4xhx.js} +2 -2
- package/dist/{codex-session-runner-gdwd8h0c.js → codex-session-runner-02sb49e4.js} +6 -6
- package/dist/{commands-jqmgk54b.js → commands-3rcspxct.js} +2 -2
- package/dist/{controller-z3jq589f.js → controller-8ar4avd6.js} +3 -3
- package/dist/{controllers-connect-r2za39ef.js → controllers-connect-ajvh9h0v.js} +19 -19
- package/dist/{cursor-adapter-4mr4jgkw.js → cursor-adapter-gd0sa7bh.js} +1 -1
- package/dist/{db-w36wwb5g.js → db-dv9j7ts5.js} +2 -2
- package/dist/{db-ppv2tze7.js → db-z26vgdvj.js} +3 -3
- package/dist/{dispatcher-pv5h77vf.js → dispatcher-8m0htjq8.js} +17 -17
- package/dist/{dsh-adapter-d4pdpb3r.js → dsh-adapter-y8gyk130.js} +1 -1
- package/dist/{e2b-fn3zacvt.js → e2b-74vg9b7e.js} +1 -1
- package/dist/{e2b-222hsajc.js → e2b-jyay8wzn.js} +1 -1
- package/dist/{easter-egg-3d-4sp4dvmc.js → easter-egg-3d-28f880xx.js} +1 -1
- package/dist/{execute-jev839y1.js → execute-9seb79vh.js} +1 -1
- package/dist/{external-channel-y6nkzhnn.js → external-channel-smz7jyth.js} +2 -2
- package/dist/{getMachineId-bsd-brn0xym3.js → getMachineId-bsd-whfre6gr.js} +3 -3
- package/dist/{getMachineId-darwin-t339sfxm.js → getMachineId-darwin-5zjynb19.js} +3 -3
- package/dist/{getMachineId-linux-5eq95d8b.js → getMachineId-linux-8mksrrsq.js} +3 -3
- package/dist/{getMachineId-unsupported-qavrtc7j.js → getMachineId-unsupported-fxtqsdt2.js} +3 -3
- package/dist/{getMachineId-win-q7fe1wx7.js → getMachineId-win-nzfmz857.js} +3 -3
- package/dist/{grok-adapter-t08b9ntm.js → grok-adapter-z0nnvtbn.js} +7 -7
- package/dist/handlers-pspryh6g.js +41 -0
- package/dist/{heartbeat-vn31xwdk.js → heartbeat-f928aqyp.js} +20 -20
- package/dist/{hook-cpjs8q51.js → hook-d7c605r4.js} +7 -7
- package/dist/{hook-6d0zbvvt.js → hook-q9hv5xf9.js} +5 -5
- package/dist/{http-9c6medda.js → http-q6j4k989.js} +1000 -251
- package/dist/{index-k0yt1tvq.js → index-5nb266jr.js} +17 -17
- package/dist/{index-ysd45kgc.js → index-8fxt5eah.js} +10 -10
- package/dist/{index-zgvqzjsw.js → index-cekzwhez.js} +5 -5
- package/dist/{index-38t35h0n.js → index-ch0c1xff.js} +17 -17
- package/dist/{index-pkma1yf8.js → index-ebnjhxh1.js} +1 -1
- package/dist/{index-yqgbfgaj.js → index-ed8dy8rn.js} +20 -20
- package/dist/{index-qhjf2htm.js → index-ejqdkkqx.js} +262 -96
- package/dist/{index-dr94zbnh.js → index-farm1zsn.js} +32661 -29443
- package/dist/{index-g6k9tctj.js → index-yn1yxg85.js} +1 -1
- package/dist/{keepalive-em0117bp.js → keepalive-zzc3hks1.js} +3 -3
- package/dist/lead-c0pjcaw4.js +79 -0
- package/dist/{maintenance-kbme3qy9.js → maintenance-kqsxzpzx.js} +1 -1
- package/dist/{oauth-refresh-sweep-xysj4yse.js → oauth-refresh-sweep-7qt0g55z.js} +8 -3
- package/dist/{onboard-p6q0vz97.js → onboard-k7x13fqg.js} +121 -8
- package/dist/{opencode-adapter-esv3k9yn.js → opencode-adapter-tqvrtter.js} +5 -5
- package/dist/{otel-impl-54qhqh1z.js → otel-impl-sqkf6k3b.js} +97 -97
- package/dist/{pi-mono-adapter-mymbwhj0.js → pi-mono-adapter-m2qnafxm.js} +89 -14
- package/dist/{pricing-refresh-yb75wv33.js → pricing-refresh-wkpwhgvs.js} +3 -3
- package/dist/{rbac-roles-dexhc9x8.js → rbac-roles-dpn0c0wj.js} +7 -4
- package/dist/{rbac-roles-1vp2mw4p.js → rbac-roles-wk7xd6a6.js} +2 -2
- package/dist/{render-v2-tjay5hhf.js → render-v2-ex2m4g2k.js} +3 -3
- package/dist/{resume-8ayf37g5.js → resume-725g9b0b.js} +7 -7
- package/dist/{runtime-hqe5cqcd.js → runtime-kajas15g.js} +1 -1
- package/dist/{session-access-fdhp987s.js → session-access-0j2ezjje.js} +8 -4
- package/dist/{session-source-backfill-qgtc86z1.js → session-source-backfill-62202awe.js} +2 -2
- package/dist/{setup-4rrmqcq3.js → setup-9sj11ax6.js} +1 -1
- package/dist/{virtual-modules-52km00d6.js → virtual-modules-c6fcq6zr.js} +2 -2
- package/dist/{work-objects-p28fgd70.js → work-objects-0y07495y.js} +20 -20
- package/dist/worker-d4q9sqbc.js +79 -0
- package/openapi.json +1536 -407
- package/package.json +7 -5
- package/src/be/automation-preflight.ts +2 -0
- package/src/be/connector-codes.ts +65 -22
- package/src/be/db/api-keys.ts +9 -0
- package/src/be/db/workflow-runs.ts +36 -5
- package/src/be/db.ts +80 -22
- package/src/be/memory/boot-reembed.ts +4 -1
- package/src/be/memory/constants.ts +6 -0
- package/src/be/memory/embedding-recovery.ts +48 -0
- package/src/be/memory/index-content.ts +5 -2
- package/src/be/memory/providers/openai-embedding.ts +65 -14
- package/src/be/memory/task-learning.ts +257 -0
- package/src/be/memory/types.ts +13 -2
- package/src/be/migrations/245_script_executor.sql +3 -0
- package/src/be/migrations/246_connector_code_kind.sql +11 -0
- package/src/be/oauth-refresh-sweep.ts +2 -1
- package/src/be/onboarding.ts +125 -15
- package/src/be/rbac-roles.ts +4 -1
- package/src/be/scripts/boot-reembed.ts +2 -0
- package/src/be/scripts/db.ts +14 -4
- package/src/be/scripts/embeddings.ts +4 -2
- package/src/be/scripts/run-saved.ts +1 -0
- package/src/be/scripts/typecheck.ts +9 -3
- package/src/be/seed/agent-fs-provision.ts +75 -14
- package/src/be/seed-skills/index.ts +7 -0
- package/src/be/swarm-config-guard.ts +3 -0
- package/src/cli.tsx +9 -0
- package/src/comb/config.ts +6 -1
- package/src/commands/onboard/agent-fs-version.ts +5 -0
- package/src/commands/onboard/compose-generator.ts +117 -4
- package/src/commands/onboard/env-generator.ts +9 -0
- package/src/commands/onboard/tei-image.ts +12 -0
- package/src/commands/onboard/types.ts +7 -0
- package/src/commands/onboard.tsx +11 -1
- package/src/commands/provider-credentials.ts +2 -1
- package/src/commands/runner.ts +14 -1
- package/src/heartbeat/heartbeat.ts +14 -1
- package/src/heartbeat/script-runner-probe.ts +47 -0
- package/src/http/agentfs-proxy.ts +369 -0
- package/src/http/all-routes.ts +1 -0
- package/src/http/api-keys.ts +24 -9
- package/src/http/codex-oauth-device.ts +8 -1
- package/src/http/fs.ts +64 -10
- package/src/http/idempotency-key.ts +1 -1
- package/src/http/inbox-state.ts +27 -1
- package/src/http/index.ts +7 -4
- package/src/http/memory.ts +7 -4
- package/src/http/onboarding.ts +139 -11
- package/src/http/pages-public.ts +38 -5
- package/src/http/scripts.ts +27 -0
- package/src/http/session-access.ts +24 -0
- package/src/http/sessions.ts +10 -6
- package/src/http/tasks.ts +85 -11
- package/src/http/telemetry-ui.ts +1 -1
- package/src/http/user-roles.ts +4 -1
- package/src/http/users.ts +272 -3
- package/src/http/utils.ts +22 -3
- package/src/http/workflows.ts +10 -0
- package/src/http/x.ts +5 -0
- package/src/prompts/base-prompt.ts +45 -10
- package/src/prompts/session-templates.ts +43 -5
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +6 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/pi-mono-adapter.ts +99 -14
- package/src/rbac/legacy-policy.ts +1 -0
- package/src/rbac/permissions.ts +4 -0
- package/src/scheduler/scheduler.ts +2 -1
- package/src/scripts-runtime/eval-harness.ts +8 -1
- package/src/scripts-runtime/executors/native.ts +22 -16
- package/src/scripts-runtime/executors/quickjs-prelude.ts +103 -1
- package/src/scripts-runtime/executors/quickjs-runner.ts +2 -1
- package/src/scripts-runtime/executors/quickjs.ts +7 -0
- package/src/scripts-runtime/executors/registry.ts +32 -0
- package/src/scripts-runtime/executors/types.ts +7 -0
- package/src/scripts-runtime/host-validated-args.ts +133 -0
- package/src/scripts-runtime/loader.ts +30 -3
- package/src/scripts-runtime/swarm-sdk.ts +9 -2
- package/src/scripts-runtime/types/stdlib.d.ts +9 -1
- package/src/scripts-runtime/types/swarm-sdk.d.ts +9 -1
- package/src/tests/agent-fs-provision-seeder.test.ts +261 -92
- package/src/tests/agentfs-proxy.test.ts +1106 -0
- package/src/tests/api-key-status-by-suffix.test.ts +242 -0
- package/src/tests/base-prompt.test.ts +139 -4
- package/src/tests/codex-adapter.test.ts +46 -8
- package/src/tests/codex-oauth-device.test.ts +12 -1
- package/src/tests/comb-config-guard.test.ts +20 -0
- package/src/tests/comb-links.test.ts +79 -1
- package/src/tests/comb-status.test.ts +44 -0
- package/src/tests/community-linear-delivery-loop.test.ts +2099 -0
- package/src/tests/credential-check.test.ts +4 -2
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/docs-index.test.ts +135 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/fetch-resolved-env.test.ts +16 -2
- package/src/tests/fixtures/onboard/baseline-states.ts +68 -0
- package/src/tests/fixtures/onboard/content.compose.yml.txt +190 -0
- package/src/tests/fixtures/onboard/content.env.txt +29 -0
- package/src/tests/fixtures/onboard/dev.compose.yml.txt +155 -0
- package/src/tests/fixtures/onboard/dev.env.txt +28 -0
- package/src/tests/fixtures/onboard/full-all.compose.yml.txt +582 -0
- package/src/tests/fixtures/onboard/full-all.env.txt +59 -0
- package/src/tests/fixtures/onboard/full.compose.yml.txt +435 -0
- package/src/tests/fixtures/onboard/full.env.txt +36 -0
- package/src/tests/fixtures/onboard/research.compose.yml.txt +155 -0
- package/src/tests/fixtures/onboard/research.env.txt +28 -0
- package/src/tests/fixtures/onboard/solo.compose.yml.txt +85 -0
- package/src/tests/fixtures/onboard/solo.env.txt +26 -0
- package/src/tests/heartbeat-checklist.test.ts +89 -0
- package/src/tests/heartbeat-script-runner-probe.test.ts +83 -0
- package/src/tests/http-log-scrubbing.test.ts +34 -1
- package/src/tests/http-task-write-ownership.test.ts +5 -1
- package/src/tests/invites-http.test.ts +464 -0
- package/src/tests/memory-embedding-input-cap.test.ts +122 -1
- package/src/tests/memory-embedding-recovery.test.ts +137 -0
- package/src/tests/oauth-refresh-sweep.test.ts +34 -1
- package/src/tests/onboard-compose.test.ts +162 -0
- package/src/tests/onboard-env.test.ts +24 -0
- package/src/tests/onboard-non-interactive.test.ts +29 -0
- package/src/tests/onboard-tei-image.test.ts +36 -0
- package/src/tests/onboarding.test.ts +451 -4
- package/src/tests/openai-embedding-provider.test.ts +105 -2
- package/src/tests/opencode-adapter.test.ts +2 -1
- package/src/tests/pages-frame-ancestors.test.ts +162 -0
- package/src/tests/pi-codemode.test.ts +2 -1
- package/src/tests/pi-mono-adapter.test.ts +54 -0
- package/src/tests/pi-mono-session-cost-on-abort.test.ts +270 -0
- package/src/tests/pi-native-mcp.test.ts +13 -1
- package/src/tests/pi-tool-exposure.test.ts +8 -8
- package/src/tests/preload-env.test.ts +4 -0
- package/src/tests/preload.ts +4 -0
- package/src/tests/probe-tool-schema-tokens.test.ts +144 -0
- package/src/tests/prompt-template-session.test.ts +20 -3
- package/src/tests/rbac-admission-e2e.test.ts +22 -6
- package/src/tests/rbac-admission.test.ts +342 -4
- package/src/tests/rbac-engine.test.ts +1 -0
- package/src/tests/rbac-roles.test.ts +9 -1
- package/src/tests/request-composition-derive.test.ts +329 -0
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-executor-conformance.test.ts +36 -1
- package/src/tests/script-executor-quickjs-pool.test.ts +50 -0
- package/src/tests/script-executor-quickjs.test.ts +140 -0
- package/src/tests/script-host-validated-args-native.test.ts +196 -0
- package/src/tests/script-per-script-executor.test.ts +415 -0
- package/src/tests/scripts-external-api.test.ts +45 -0
- package/src/tests/sdk-allowlist.test.ts +3 -2
- package/src/tests/self-improvement.test.ts +4 -4
- package/src/tests/send-task-requester-gate.test.ts +64 -3
- package/src/tests/sessions-move.test.ts +39 -1
- package/src/tests/store-progress-learning.test.ts +381 -0
- package/src/tests/ui-logs-parser.test.ts +180 -0
- package/src/tests/whoami-route.test.ts +41 -0
- package/src/tests/workflow-engine-v2.test.ts +116 -1
- package/src/tests/workflow-mcp-trigger-schema.test.ts +209 -0
- package/src/tests/workflow-run-finished-event.test.ts +263 -0
- package/src/tests/workflow-swarm-script.test.ts +34 -0
- package/src/tools/inject-learning.ts +1 -1
- package/src/tools/memory-edit.ts +1 -1
- package/src/tools/memory-search.ts +1 -1
- package/src/tools/script-common.ts +1 -0
- package/src/tools/script-run.ts +7 -0
- package/src/tools/script-upsert.ts +7 -0
- package/src/tools/store-progress.ts +71 -1
- package/src/tools/utils.ts +12 -1
- package/src/tools/workflows/trigger-workflow.ts +104 -10
- package/src/types.ts +12 -1
- package/src/utils/constants.ts +39 -0
- package/src/utils/credentials.ts +5 -2
- package/src/utils/task-attachment-links.ts +15 -3
- package/src/workflows/engine.ts +18 -16
- package/src/workflows/executors/swarm-script.ts +5 -0
- package/src/workflows/foreach-driver.ts +5 -11
- package/src/workflows/node-timeout.ts +30 -0
- package/templates/community/linear-delivery-loop/PLAYBOOK.md +323 -0
- package/templates/community/linear-delivery-loop/README.md +38 -0
- package/templates/community/linear-delivery-loop/config.example.json +31 -0
- package/templates/community/linear-delivery-loop/lead-prompt.md +34 -0
- package/templates/community/linear-delivery-loop/schedule.json +10 -0
- package/templates/community/linear-delivery-loop/scripts/linear-delivery-setup.ts +148 -0
- package/templates/community/linear-delivery-loop/scripts/linear-delivery-tick.ts +1781 -0
- package/templates/skills/swarm-docs/config.json +14 -0
- package/templates/skills/swarm-docs/content.md +144 -0
- package/dist/handlers-eqsnmv95.js +0 -41
- package/dist/lead-23e7z59t.js +0 -79
- package/dist/worker-e3w7vye1.js +0 -79
- package/dist/{azure-openai-responses-9kfwhmn7.js → azure-openai-responses-43asa23s.js} +0 -0
- package/dist/{node-vxx896fa.js → node-t28cc56b.js} +0 -0
- package/dist/{openai-codex-responses-79s8xnbh.js → openai-codex-responses-jhr3sjtm.js} +3 -3
- package/dist/{openai-completions-tdbyts0x.js → openai-completions-gs6yn37k.js} +3 -3
- /package/dist/{openai-responses-dm3t5vqp.js → openai-responses-jqm9vwwk.js} +0 -0
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
getResolvedConfig2,
|
|
41
41
|
getMcpServerById2,
|
|
42
42
|
init_db3
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-qvaa1gjp.js";
|
|
44
44
|
import {
|
|
45
45
|
generateRandomCodeVerifier,
|
|
46
46
|
generateRandomState,
|
|
47
47
|
calculatePKCECodeChallenge,
|
|
48
48
|
oauthAppRowToProviderConfig,
|
|
49
49
|
ensureAuthorizationTokenOrThrow
|
|
50
|
-
} from "./cli-
|
|
50
|
+
} from "./cli-rm66vqdz.js";
|
|
51
51
|
import {
|
|
52
52
|
detachedProcessGroup,
|
|
53
53
|
registerProcessGroup,
|
|
@@ -60,11 +60,11 @@ import {
|
|
|
60
60
|
mintScriptRunToken,
|
|
61
61
|
revokeSessionToken,
|
|
62
62
|
init_users
|
|
63
|
-
} from "./cli-
|
|
63
|
+
} from "./cli-nf6k60sn.js";
|
|
64
64
|
import {
|
|
65
65
|
defaultAssetKey,
|
|
66
66
|
init_key
|
|
67
|
-
} from "./cli-
|
|
67
|
+
} from "./cli-s504c3w7.js";
|
|
68
68
|
import {
|
|
69
69
|
init_zod
|
|
70
70
|
} from "./cli-4chz1hye.js";
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
import {
|
|
90
90
|
getMcpBaseUrl,
|
|
91
91
|
init_constants2
|
|
92
|
-
} from "./cli-
|
|
92
|
+
} from "./cli-3cywb44q.js";
|
|
93
93
|
import {
|
|
94
94
|
isEnvFlagEnabled,
|
|
95
95
|
init_env_flag
|
|
@@ -177950,21 +177950,18 @@ class NativeScriptExecutor {
|
|
|
177950
177950
|
let killed = input.signal?.aborted ?? false;
|
|
177951
177951
|
let removeAbortListener;
|
|
177952
177952
|
let proc;
|
|
177953
|
+
const killedOutput = () => ({
|
|
177954
|
+
result: undefined,
|
|
177955
|
+
stdout: "",
|
|
177956
|
+
stderr: "",
|
|
177957
|
+
truncated: { stdout: false, stderr: false },
|
|
177958
|
+
durationMs: Date.now() - start,
|
|
177959
|
+
exitCode: 1,
|
|
177960
|
+
error: "killed"
|
|
177961
|
+
});
|
|
177953
177962
|
try {
|
|
177954
|
-
if (killed)
|
|
177955
|
-
return
|
|
177956
|
-
result: undefined,
|
|
177957
|
-
stdout: "",
|
|
177958
|
-
stderr: "",
|
|
177959
|
-
truncated: { stdout: false, stderr: false },
|
|
177960
|
-
durationMs: Date.now() - start,
|
|
177961
|
-
exitCode: 1,
|
|
177962
|
-
error: "killed"
|
|
177963
|
-
};
|
|
177964
|
-
}
|
|
177965
|
-
await Bun.write(argsFile, JSON.stringify(input.args ?? null));
|
|
177966
|
-
await Bun.write(sourceFile, input.source);
|
|
177967
|
-
await writeBareImportShims(tmpdir);
|
|
177963
|
+
if (killed)
|
|
177964
|
+
return killedOutput();
|
|
177968
177965
|
const onExternalAbort = () => {
|
|
177969
177966
|
killed = true;
|
|
177970
177967
|
if (proc)
|
|
@@ -177972,6 +177969,11 @@ class NativeScriptExecutor {
|
|
|
177972
177969
|
};
|
|
177973
177970
|
input.signal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
177974
177971
|
removeAbortListener = () => input.signal?.removeEventListener("abort", onExternalAbort);
|
|
177972
|
+
await Bun.write(argsFile, JSON.stringify(input.args ?? null));
|
|
177973
|
+
await Bun.write(sourceFile, input.source);
|
|
177974
|
+
await writeBareImportShims(tmpdir);
|
|
177975
|
+
if (killed)
|
|
177976
|
+
return killedOutput();
|
|
177975
177977
|
const timeout = setTimeout(() => {
|
|
177976
177978
|
timedOut = true;
|
|
177977
177979
|
if (proc)
|
|
@@ -177988,7 +177990,8 @@ class NativeScriptExecutor {
|
|
|
177988
177990
|
SWARM_SCRIPT_SOURCE_FILE: sourceFile,
|
|
177989
177991
|
SWARM_SCRIPT_RESULT_FILE: resultFile,
|
|
177990
177992
|
SWARM_SCRIPT_ERROR_FILE: errorFile,
|
|
177991
|
-
SWARM_SCRIPT_STARTED_FILE: startedFile
|
|
177993
|
+
SWARM_SCRIPT_STARTED_FILE: startedFile,
|
|
177994
|
+
...input.hostValidatedArgs ? { SWARM_SCRIPT_HOST_VALIDATED_ARGS: "1" } : {}
|
|
177992
177995
|
};
|
|
177993
177996
|
proc = registerProcessGroup(Bun.spawn(harnessCommand(harnessPath, input, harnessEnv), {
|
|
177994
177997
|
env: sandboxSpawnEnv(harnessEnv),
|
|
@@ -178145,6 +178148,10 @@ class QuickJSScriptExecutor {
|
|
|
178145
178148
|
pool.discard(slot);
|
|
178146
178149
|
return emptyOutput("executor_error", `quickjs worker failed to start: ${error instanceof Error ? error.message : String(error)}`);
|
|
178147
178150
|
}
|
|
178151
|
+
if (input.signal?.aborted) {
|
|
178152
|
+
pool.release(slot);
|
|
178153
|
+
return emptyOutput("killed");
|
|
178154
|
+
}
|
|
178148
178155
|
const id = ++requestSeq;
|
|
178149
178156
|
const start = performance.now();
|
|
178150
178157
|
return await new Promise((resolve) => {
|
|
@@ -178186,6 +178193,7 @@ class QuickJSScriptExecutor {
|
|
|
178186
178193
|
job: {
|
|
178187
178194
|
source: input.source,
|
|
178188
178195
|
args: input.args,
|
|
178196
|
+
...input.hostValidatedArgs ? { hostValidatedArgs: true } : {},
|
|
178189
178197
|
configPayload: input.configPayload,
|
|
178190
178198
|
resources: input.resources,
|
|
178191
178199
|
network: input.network
|
|
@@ -178200,6 +178208,17 @@ var EXECUTORS = {
|
|
|
178200
178208
|
native: () => new NativeScriptExecutor,
|
|
178201
178209
|
quickjs: () => new QuickJSScriptExecutor
|
|
178202
178210
|
};
|
|
178211
|
+
function getDeploymentScriptExecutorName(env = process.env) {
|
|
178212
|
+
return (env.SCRIPT_EXECUTOR ?? "native").trim();
|
|
178213
|
+
}
|
|
178214
|
+
function isExecutorAllowedByDeployment(requested, env = process.env) {
|
|
178215
|
+
if (!requested)
|
|
178216
|
+
return true;
|
|
178217
|
+
if (getDeploymentScriptExecutorName(env) === "quickjs" && requested.trim() === "native") {
|
|
178218
|
+
return false;
|
|
178219
|
+
}
|
|
178220
|
+
return true;
|
|
178221
|
+
}
|
|
178203
178222
|
function getScriptExecutor(name = process.env.SCRIPT_EXECUTOR ?? "native") {
|
|
178204
178223
|
const factory = EXECUTORS[name.trim()];
|
|
178205
178224
|
if (!factory) {
|
|
@@ -178207,6 +178226,13 @@ function getScriptExecutor(name = process.env.SCRIPT_EXECUTOR ?? "native") {
|
|
|
178207
178226
|
}
|
|
178208
178227
|
return factory();
|
|
178209
178228
|
}
|
|
178229
|
+
function resolveScriptExecutor(requested, env = process.env) {
|
|
178230
|
+
if (!isExecutorAllowedByDeployment(requested, env)) {
|
|
178231
|
+
throw new Error('Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"');
|
|
178232
|
+
}
|
|
178233
|
+
const effective = requested ?? env.SCRIPT_EXECUTOR ?? "native";
|
|
178234
|
+
return getScriptExecutor(effective);
|
|
178235
|
+
}
|
|
178210
178236
|
|
|
178211
178237
|
// src/scripts-runtime/executors/types.ts
|
|
178212
178238
|
var MIN_SCRIPT_WALL_CLOCK_MS = 1000;
|
|
@@ -178222,6 +178248,9 @@ var DEFAULT_SCRIPT_RESOURCES = {
|
|
|
178222
178248
|
maxStdoutBytes: 1048576
|
|
178223
178249
|
};
|
|
178224
178250
|
|
|
178251
|
+
// src/scripts-runtime/host-validated-args.ts
|
|
178252
|
+
var HOST_VALIDATED_ARGS = Symbol("swarm.hostValidatedArgs");
|
|
178253
|
+
|
|
178225
178254
|
// src/scripts-runtime/import-allowlist.ts
|
|
178226
178255
|
var import_typescript = __toESM(require_typescript2(), 1);
|
|
178227
178256
|
var SCRIPT_ALLOWED_BARE_IMPORTS = ["swarm-sdk", "stdlib", "zod", "zod/mini"];
|
|
@@ -178365,6 +178394,17 @@ async function runScript(input) {
|
|
|
178365
178394
|
error: "executor_error"
|
|
178366
178395
|
};
|
|
178367
178396
|
}
|
|
178397
|
+
if (!isExecutorAllowedByDeployment(input.executor)) {
|
|
178398
|
+
return {
|
|
178399
|
+
result: undefined,
|
|
178400
|
+
stdout: "",
|
|
178401
|
+
stderr: 'Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"',
|
|
178402
|
+
truncated: { stdout: false, stderr: false },
|
|
178403
|
+
durationMs: 0,
|
|
178404
|
+
exitCode: 1,
|
|
178405
|
+
error: "executor_error"
|
|
178406
|
+
};
|
|
178407
|
+
}
|
|
178368
178408
|
const runSecrets = createValueScrubber(Object.entries(input.userConfig ?? {}).filter(([, entry]) => entry.isSecret).map(([key, entry]) => ({ value: entry.value, name: `config:${key}` })));
|
|
178369
178409
|
const imports = validateScriptImports(input.source);
|
|
178370
178410
|
if (!imports.ok) {
|
|
@@ -178387,18 +178427,19 @@ async function runScript(input) {
|
|
|
178387
178427
|
const executorInput = {
|
|
178388
178428
|
source: input.source,
|
|
178389
178429
|
args: input.args ?? null,
|
|
178430
|
+
...input[HOST_VALIDATED_ARGS] === true ? { hostValidatedArgs: true } : {},
|
|
178390
178431
|
configPayload,
|
|
178391
178432
|
resources,
|
|
178392
178433
|
fsMode: input.fsMode ?? "none",
|
|
178393
178434
|
network: scriptEgressPolicy(),
|
|
178394
178435
|
signal: input.signal
|
|
178395
178436
|
};
|
|
178396
|
-
let output = await
|
|
178437
|
+
let output = await resolveScriptExecutor(input.executor).run(executorInput);
|
|
178397
178438
|
for (const delayMs of CAPACITY_EXCEEDED_RETRY_DELAYS_MS) {
|
|
178398
178439
|
if (output.error !== "capacity_exceeded" || input.signal?.aborted)
|
|
178399
178440
|
break;
|
|
178400
178441
|
await Bun.sleep(delayMs);
|
|
178401
|
-
output = await
|
|
178442
|
+
output = await resolveScriptExecutor(input.executor).run(executorInput);
|
|
178402
178443
|
}
|
|
178403
178444
|
return {
|
|
178404
178445
|
...output,
|
|
@@ -178571,6 +178612,7 @@ async function runSavedScriptAsAgent(args, deps = {}) {
|
|
|
178571
178612
|
source: args.script.source,
|
|
178572
178613
|
args: args.input,
|
|
178573
178614
|
fsMode: args.script.fsMode,
|
|
178615
|
+
executor: args.script.executor,
|
|
178574
178616
|
agentId: args.agentId,
|
|
178575
178617
|
egressSecrets: credentials.egressSecrets,
|
|
178576
178618
|
failedBindings: credentials.failedBindings,
|
|
@@ -184019,6 +184061,7 @@ var SCRIPT_SDK_TYPES = `
|
|
|
184019
184061
|
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
184020
184062
|
export type ScriptScope = "agent" | "global";
|
|
184021
184063
|
export type ScriptFsMode = "none" | "workspace-rw";
|
|
184064
|
+
export type ScriptExecutorName = "native" | "quickjs";
|
|
184022
184065
|
export type ScriptApiRawOptions = { raw: true };
|
|
184023
184066
|
export type ScriptApiDefaultOptions = { raw?: false };
|
|
184024
184067
|
export type RoutingReason = "skill" | "continuity" | "overflow" | "human_pinned" | "reroute_fault";
|
|
@@ -184210,7 +184253,7 @@ export interface SwarmSdk {
|
|
|
184210
184253
|
schedule_list(args?: { enabled?: boolean; name?: string; scheduleType?: "recurring" | "one_time"; targetType?: "agent-task" | "workflow" | "script"; workflowId?: string; scriptName?: string; hideCompleted?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "failed" | "succeeded"; includeFull?: boolean }): Promise<unknown>;
|
|
184211
184254
|
// --- scripts ---
|
|
184212
184255
|
script_search(args: { query?: string; scope?: ScriptScope; limit?: number }): Promise<unknown>;
|
|
184213
|
-
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; idempotencyKey?: string }): Promise<unknown>;
|
|
184256
|
+
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null; idempotencyKey?: string }): Promise<unknown>;
|
|
184214
184257
|
// --- swarm / agent ---
|
|
184215
184258
|
swarm_get(args?: { includeFull?: boolean }): Promise<unknown>;
|
|
184216
184259
|
agent_info(args?: Record<string, unknown>): Promise<unknown>;
|
|
@@ -184327,7 +184370,12 @@ export interface SwarmSdk {
|
|
|
184327
184370
|
workflow_patch(args: Record<string, unknown>): Promise<unknown>;
|
|
184328
184371
|
workflow_patchNode(args: Record<string, unknown>): Promise<unknown>;
|
|
184329
184372
|
workflow_delete(args: { id: string }): Promise<unknown>;
|
|
184330
|
-
workflow_trigger(args: {
|
|
184373
|
+
workflow_trigger(args: {
|
|
184374
|
+
id: string;
|
|
184375
|
+
triggerData?: Record<string, unknown>;
|
|
184376
|
+
wait?: boolean;
|
|
184377
|
+
idempotencyKey?: string;
|
|
184378
|
+
}): Promise<unknown>;
|
|
184331
184379
|
workflow_retryRun(args: { id: string }): Promise<unknown>;
|
|
184332
184380
|
workflow_cancelRun(args: { id: string }): Promise<unknown>;
|
|
184333
184381
|
|
|
@@ -184337,7 +184385,7 @@ export interface SwarmSdk {
|
|
|
184337
184385
|
prompt_preview(args: Record<string, unknown>): Promise<unknown>;
|
|
184338
184386
|
|
|
184339
184387
|
// --- write: scripts ---
|
|
184340
|
-
script_upsert(args: { name: string; source: string; description?: string; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode }): Promise<unknown>;
|
|
184388
|
+
script_upsert(args: { name: string; source: string; description?: string; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null }): Promise<unknown>;
|
|
184341
184389
|
script_delete(args: { name: string; scope?: ScriptScope }): Promise<unknown>;
|
|
184342
184390
|
script_queryTypes(args: { name: string; scope?: ScriptScope }): Promise<unknown>;
|
|
184343
184391
|
script_launchRun(args: { source: string; args?: unknown; idempotencyKey?: string; scriptName?: string; requestedByUserId?: string }): Promise<unknown>;
|
|
@@ -185178,4 +185226,4 @@ function parseSkillContent(content) {
|
|
|
185178
185226
|
};
|
|
185179
185227
|
}
|
|
185180
185228
|
|
|
185181
|
-
export { require_dist2, isInvalidClientError, publicEndpointSsrfOptions, mcpOAuthSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, resolveSqlDsn, runReadOnlyQuery, listVendoredOpenapiEntries, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, require_typescript2, checkImportAllowlist, validateScriptImports, runScriptWithRunCredential, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, checkQuickJSCompat, quickJSCompatWarnings, resolveSyncRunAs, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, parseSkillContent };
|
|
185229
|
+
export { require_dist2, isInvalidClientError, publicEndpointSsrfOptions, mcpOAuthSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, resolveSqlDsn, runReadOnlyQuery, listVendoredOpenapiEntries, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, isExecutorAllowedByDeployment, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, HOST_VALIDATED_ARGS, require_typescript2, checkImportAllowlist, validateScriptImports, runScriptWithRunCredential, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, checkQuickJSCompat, quickJSCompatWarnings, resolveSyncRunAs, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, parseSkillContent };
|
|
@@ -8,19 +8,21 @@ import {
|
|
|
8
8
|
} from "./cli-qeaq3j6t.js";
|
|
9
9
|
import {
|
|
10
10
|
init_templates3
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-nzdf09js.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveTemplateAsync,
|
|
14
14
|
init_resolver,
|
|
15
15
|
init_session_templates
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-b41p764a.js";
|
|
17
17
|
import {
|
|
18
18
|
MAX_PROFILE_FILE_LENGTH,
|
|
19
19
|
getAppUrl,
|
|
20
|
+
resolveAgentFsLinkBase,
|
|
21
|
+
agentFsFileRoute,
|
|
20
22
|
buildAgentFsLiveUrl,
|
|
21
23
|
buildCombFileUrl,
|
|
22
24
|
init_constants2
|
|
23
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-3cywb44q.js";
|
|
24
26
|
import {
|
|
25
27
|
scrubSecrets,
|
|
26
28
|
init_secret_scrubber
|
|
@@ -256,6 +258,18 @@ var init_defaults = () => {};
|
|
|
256
258
|
function claudeMdSourcePath(provider) {
|
|
257
259
|
return provider === "claude" ? "~/.claude/CLAUDE.md" : "/workspace/CLAUDE.md";
|
|
258
260
|
}
|
|
261
|
+
function toolDiscoveryEvent(provider, hasToolSearch) {
|
|
262
|
+
switch (provider) {
|
|
263
|
+
case "amp":
|
|
264
|
+
return "system.agent.tool_discovery.amp";
|
|
265
|
+
case "codex":
|
|
266
|
+
return "system.agent.tool_discovery.codex";
|
|
267
|
+
case "opencode":
|
|
268
|
+
return "system.agent.tool_discovery.opencode";
|
|
269
|
+
default:
|
|
270
|
+
return hasToolSearch ? "system.agent.tool_discovery.search" : "system.agent.tool_discovery.direct";
|
|
271
|
+
}
|
|
272
|
+
}
|
|
259
273
|
function areSlackPromptToolsEnabled(env = process.env, serverCapabilities) {
|
|
260
274
|
const config = getSlackConfiguration(env);
|
|
261
275
|
if (config.disabled || !config.mode)
|
|
@@ -283,6 +297,9 @@ function promptFlags(args) {
|
|
|
283
297
|
scriptsOnlyMode: hasMcp && scriptsOnly
|
|
284
298
|
};
|
|
285
299
|
}
|
|
300
|
+
function hasSwarmDocsSkill(skills) {
|
|
301
|
+
return skills === undefined || skills.some((skill) => skill.name === "swarm-docs");
|
|
302
|
+
}
|
|
286
303
|
function renderToolsAndSkillsVars(input) {
|
|
287
304
|
let section = "";
|
|
288
305
|
const skills = input.skillsSummary ?? [];
|
|
@@ -306,7 +323,7 @@ ${discovery}
|
|
|
306
323
|
}
|
|
307
324
|
}
|
|
308
325
|
const servers = (input.mcpServers ?? []).filter((name) => name.trim().length > 0);
|
|
309
|
-
const mcpLine = servers.length > 0 ? `Connected MCP servers: ${servers.join(", ")}. Their tools are in your tool list.
|
|
326
|
+
const mcpLine = servers.length > 0 ? `Connected MCP servers: ${servers.join(", ")}. ${input.mcpToolsDeferred ? "Load their tools with your harness tool search." : "Their tools are in your tool list."}
|
|
310
327
|
` : "";
|
|
311
328
|
return {
|
|
312
329
|
skills: section,
|
|
@@ -495,7 +512,7 @@ ${scriptsOnlyResult.text}`;
|
|
|
495
512
|
const serverHasCapability = (cap, whenUnknown) => args.serverCapabilities ? args.serverCapabilities.includes(cap) : whenUnknown;
|
|
496
513
|
if (hasMcp && serverHasCapability("pages", true)) {
|
|
497
514
|
const agentFsConfigured = hasLocalEnv && Boolean(process.env.AGENT_FS_API_URL);
|
|
498
|
-
const outputsResult = await resolveTemplateAsync(agentFsConfigured ? "system.agent.outputs" : "system.agent.outputs.no_agent_fs", {});
|
|
515
|
+
const outputsResult = await resolveTemplateAsync(agentFsConfigured ? "system.agent.outputs" : "system.agent.outputs.no_agent_fs", { fileLinkBase: resolveAgentFsLinkBase("prompt") ?? `\${AGENT_FS_LIVE_URL}` });
|
|
499
516
|
prompt += outputsResult.text;
|
|
500
517
|
}
|
|
501
518
|
const slackPromptToolsEnabled = areSlackPromptToolsEnabled(process.env, args.serverCapabilities);
|
|
@@ -508,16 +525,21 @@ ${scriptsOnlyResult.text}`;
|
|
|
508
525
|
prompt += steeringResult.text;
|
|
509
526
|
}
|
|
510
527
|
if (hasMcp) {
|
|
511
|
-
const discoveryEvent = provider
|
|
528
|
+
const discoveryEvent = toolDiscoveryEvent(provider, hasToolSearch);
|
|
512
529
|
const discoveryResult = await resolveTemplateAsync(discoveryEvent, {});
|
|
513
530
|
const toolsResult = await resolveTemplateAsync("system.agent.tools_skills", renderToolsAndSkillsVars({
|
|
514
531
|
skillsSummary: args.skillsSummary,
|
|
515
532
|
mcpServers: args.mcpServers,
|
|
533
|
+
mcpToolsDeferred: provider === "pi" && hasToolSearch,
|
|
516
534
|
nativeSkillDiscovery,
|
|
517
535
|
toolDiscovery: discoveryResult.text,
|
|
518
536
|
hasLocalEnv
|
|
519
537
|
}));
|
|
520
538
|
prompt += toolsResult.text;
|
|
539
|
+
if (role === "lead" && hasSwarmDocsSkill(args.skillsSummary)) {
|
|
540
|
+
const docsResult = await resolveTemplateAsync("system.agent.lead.docs", {});
|
|
541
|
+
prompt += docsResult.text;
|
|
542
|
+
}
|
|
521
543
|
}
|
|
522
544
|
if (hasLocalEnv && args.claudeMd && CLAUDE_MD_INJECT_PROVIDERS.has(provider) && !matchesDefaultClaudeMd(args.claudeMd, defaultsInput)) {
|
|
523
545
|
const budget = Math.min(BOOTSTRAP_MAX_CHARS, Math.max(0, BOOTSTRAP_TOTAL_MAX_CHARS - prompt.length));
|
|
@@ -546,6 +568,7 @@ ${scriptsOnlyResult.text}`;
|
|
|
546
568
|
};
|
|
547
569
|
var init_base_prompt = __esm(() => {
|
|
548
570
|
init_config();
|
|
571
|
+
init_constants2();
|
|
549
572
|
init_steering_enabled();
|
|
550
573
|
init_defaults();
|
|
551
574
|
init_resolver();
|
|
@@ -671,6 +694,11 @@ function taskAttachmentDisplayUrl(attachment, opts = {}) {
|
|
|
671
694
|
}
|
|
672
695
|
if (attachment.providerId === "agent-fs" || attachment.kind === "agent-fs") {
|
|
673
696
|
const file = { path: attachment.path, orgId: attachment.orgId, driveId: attachment.driveId };
|
|
697
|
+
const linkBase = opts.comb === false ? null : resolveAgentFsLinkBase("attachment");
|
|
698
|
+
if (linkBase !== null) {
|
|
699
|
+
const route = agentFsFileRoute(file);
|
|
700
|
+
return route ? `${linkBase}/file/~/${route}` : `agent-fs:${attachment.path ?? ""}`;
|
|
701
|
+
}
|
|
674
702
|
const combUrl = opts.comb === false ? null : buildCombFileUrl(file);
|
|
675
703
|
return combUrl ?? buildAgentFsLiveUrl(file) ?? `agent-fs:${attachment.path ?? ""}`;
|
|
676
704
|
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
DEFAULT_MODEL_TIER_MAP,
|
|
24
24
|
init_types
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-s504c3w7.js";
|
|
26
26
|
import {
|
|
27
27
|
getOpenRouterBaseUrl,
|
|
28
28
|
getOpenRouterAttributionHeaders,
|
|
@@ -68,7 +68,7 @@ function addDshStepUsage(acc, step) {
|
|
|
68
68
|
// src/providers/dsh-adapter.ts
|
|
69
69
|
init_openrouter_base_url();
|
|
70
70
|
init_secret_scrubber();
|
|
71
|
-
var DSH_PACKAGE = "@deepseek-ai/dsh@0.2.1-rc.
|
|
71
|
+
var DSH_PACKAGE = "@deepseek-ai/dsh@0.2.1-rc.4";
|
|
72
72
|
function checkDshCredentials2(env) {
|
|
73
73
|
return env.DEEPSEEK_API_KEY?.trim() || env.OPENROUTER_API_KEY?.trim() ? { ready: true, missing: [], satisfiedBy: "env" } : {
|
|
74
74
|
ready: false,
|
|
@@ -17,7 +17,7 @@ async function createRuntimeProvider(kind, target = {}) {
|
|
|
17
17
|
return new DockerRuntimeProvider;
|
|
18
18
|
}
|
|
19
19
|
case "e2b": {
|
|
20
|
-
const { E2BRuntimeProvider } = await import("./e2b-
|
|
20
|
+
const { E2BRuntimeProvider } = await import("./e2b-74vg9b7e.js");
|
|
21
21
|
return new E2BRuntimeProvider(target);
|
|
22
22
|
}
|
|
23
23
|
case "k8s":
|
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_MODEL_TIER_MAP,
|
|
17
17
|
init_types
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-s504c3w7.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveTemplateFromCode,
|
|
21
21
|
resolveTemplateAsync,
|
|
22
22
|
init_resolver,
|
|
23
23
|
init_session_templates
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-b41p764a.js";
|
|
25
25
|
import {
|
|
26
26
|
parseEnvFlag,
|
|
27
27
|
init_env_flag
|
|
@@ -54,7 +54,7 @@ function checkCursorCredentials2(env) {
|
|
|
54
54
|
return env.CURSOR_API_KEY?.trim() ? { ready: true, missing: [], satisfiedBy: "env" } : { ready: false, missing: ["CURSOR_API_KEY"], hint: "Set CURSOR_API_KEY for cursor." };
|
|
55
55
|
}
|
|
56
56
|
async function liveTestCursorKey2(apiKey) {
|
|
57
|
-
const { Cursor } = await import("./index-
|
|
57
|
+
const { Cursor } = await import("./index-farm1zsn.js");
|
|
58
58
|
try {
|
|
59
59
|
await Cursor.me({ apiKey });
|
|
60
60
|
return { ok: true };
|
|
@@ -74,7 +74,7 @@ async function listCursorModels(apiKey) {
|
|
|
74
74
|
if (modelListCache?.key === apiKey && Date.now() - modelListCache.at < MODEL_LIST_TTL_MS) {
|
|
75
75
|
return modelListCache.models;
|
|
76
76
|
}
|
|
77
|
-
const { Cursor } = await import("./index-
|
|
77
|
+
const { Cursor } = await import("./index-farm1zsn.js");
|
|
78
78
|
const models = await Cursor.models.list({ apiKey });
|
|
79
79
|
modelListCache = { key: apiKey, at: Date.now(), models };
|
|
80
80
|
return models;
|
|
@@ -448,7 +448,7 @@ class CursorAdapter2 {
|
|
|
448
448
|
if (!apiKey)
|
|
449
449
|
throw new Error("cursor requires CURSOR_API_KEY");
|
|
450
450
|
registerVolatileSecret(apiKey, "CURSOR_API_KEY");
|
|
451
|
-
const { Agent, JsonlLocalAgentStore } = await import("./index-
|
|
451
|
+
const { Agent, JsonlLocalAgentStore } = await import("./index-farm1zsn.js");
|
|
452
452
|
const modelId = config.model || DEFAULT_MODEL_TIER_MAP.cursor.regular;
|
|
453
453
|
const effort = applyReasoningEffort("cursor", modelId, config.reasoningEffort);
|
|
454
454
|
const requested = effort.kind === "cursor-effort" ? effort.reasoningEffort : undefined;
|
|
@@ -45,12 +45,12 @@ import {
|
|
|
45
45
|
checkMemorySyncInterval,
|
|
46
46
|
promiseWithResolvers
|
|
47
47
|
} from "./cli-6rg2jn2y.js";
|
|
48
|
-
import {
|
|
49
|
-
require_src
|
|
50
|
-
} from "./cli-dv97kdzv.js";
|
|
51
48
|
import {
|
|
52
49
|
require_dist3
|
|
53
50
|
} from "./cli-k28wkapa.js";
|
|
51
|
+
import {
|
|
52
|
+
require_src2
|
|
53
|
+
} from "./cli-wdxgsdz5.js";
|
|
54
54
|
import {
|
|
55
55
|
__toESM
|
|
56
56
|
} from "./cli-242037k3.js";
|
|
@@ -319,7 +319,7 @@ var FallbackEncoder = ({ headers, body }) => {
|
|
|
319
319
|
};
|
|
320
320
|
|
|
321
321
|
// node_modules/@anthropic-ai/sdk/internal/tracing.mjs
|
|
322
|
-
var import_api = __toESM(
|
|
322
|
+
var import_api = __toESM(require_src2(), 1);
|
|
323
323
|
|
|
324
324
|
// node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs
|
|
325
325
|
var _LineDecoder_buffer;
|
|
@@ -1293,7 +1293,7 @@ function stringifyQuery(query) {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
|
|
1295
1295
|
// node_modules/@anthropic-ai/sdk/client.mjs
|
|
1296
|
-
var import_api9 = __toESM(
|
|
1296
|
+
var import_api9 = __toESM(require_src2(), 1);
|
|
1297
1297
|
|
|
1298
1298
|
// node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs
|
|
1299
1299
|
var GRANT_TYPE_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer";
|
|
@@ -1990,7 +1990,7 @@ function recordSessionsCreateResponse(client, call, session) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
1992
|
// node_modules/@anthropic-ai/sdk/internal/trace-headers.mjs
|
|
1993
|
-
var import_api2 = __toESM(
|
|
1993
|
+
var import_api2 = __toESM(require_src2(), 1);
|
|
1994
1994
|
function traceHeaderNames() {
|
|
1995
1995
|
const names = new Set(["traceparent", "tracestate", "baggage"]);
|
|
1996
1996
|
try {
|
|
@@ -2025,7 +2025,7 @@ function withoutTraceHeaders(middleware) {
|
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
2027
|
// node_modules/@anthropic-ai/sdk/lib/internal/tracing/streaming.mjs
|
|
2028
|
-
var import_api3 = __toESM(
|
|
2028
|
+
var import_api3 = __toESM(require_src2(), 1);
|
|
2029
2029
|
function recordStreamedMessageContent(client, call, body, message) {
|
|
2030
2030
|
if (!call.span.isRecording() || client.openTelemetry.traces.contentMode !== "content") {
|
|
2031
2031
|
return;
|
|
@@ -2140,7 +2140,7 @@ function endMessagesCreateSpanWhenStreamEnds(client, span, stream, props) {
|
|
|
2140
2140
|
});
|
|
2141
2141
|
}
|
|
2142
2142
|
// node_modules/@anthropic-ai/sdk/lib/internal/tracing/environments.mjs
|
|
2143
|
-
var import_api4 = __toESM(
|
|
2143
|
+
var import_api4 = __toESM(require_src2(), 1);
|
|
2144
2144
|
function startEnvironmentWorkSpan(client, work, parentContext) {
|
|
2145
2145
|
return client._tracer?.startSpan("anthropic.environment.work", {
|
|
2146
2146
|
kind: import_api4.SpanKind.INTERNAL,
|
|
@@ -2183,7 +2183,7 @@ async function withEnvironmentWorkSpan(client, span, signal, handle) {
|
|
|
2183
2183
|
guardTracing(client, () => endEnvironmentWorkSpan(span, signal));
|
|
2184
2184
|
}
|
|
2185
2185
|
// node_modules/@anthropic-ai/sdk/lib/internal/tracing/tools.mjs
|
|
2186
|
-
var import_api5 = __toESM(
|
|
2186
|
+
var import_api5 = __toESM(require_src2(), 1);
|
|
2187
2187
|
|
|
2188
2188
|
// node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs
|
|
2189
2189
|
var STAINLESS_HELPER_HEADER = "x-stainless-helper";
|
|
@@ -5183,7 +5183,7 @@ var Agents = /* @__PURE__ */ (() => {
|
|
|
5183
5183
|
})();
|
|
5184
5184
|
|
|
5185
5185
|
// node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs
|
|
5186
|
-
var import_api6 = __toESM(
|
|
5186
|
+
var import_api6 = __toESM(require_src2(), 1);
|
|
5187
5187
|
|
|
5188
5188
|
// node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs
|
|
5189
5189
|
function linkAbort(external, controller) {
|
|
@@ -5398,7 +5398,7 @@ function defaultWorkerId() {
|
|
|
5398
5398
|
}
|
|
5399
5399
|
|
|
5400
5400
|
// node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs
|
|
5401
|
-
var import_api7 = __toESM(
|
|
5401
|
+
var import_api7 = __toESM(require_src2(), 1);
|
|
5402
5402
|
|
|
5403
5403
|
// node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs
|
|
5404
5404
|
var _AsyncQueue_items;
|
|
@@ -7895,7 +7895,7 @@ var BetaMessageStream = /* @__PURE__ */ (() => {
|
|
|
7895
7895
|
})();
|
|
7896
7896
|
|
|
7897
7897
|
// node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs
|
|
7898
|
-
var import_api8 = __toESM(
|
|
7898
|
+
var import_api8 = __toESM(require_src2(), 1);
|
|
7899
7899
|
|
|
7900
7900
|
// node_modules/@anthropic-ai/sdk/lib/internal/toolsets/family.mjs
|
|
7901
7901
|
var TOOLSET_TYPE_TO_FAMILY = {
|