@desplega.ai/agent-swarm 1.169.0 → 1.171.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 +11 -2
- package/dist/{acp-adapter-m47zfx4a.js → acp-adapter-wnhq4ydy.js} +6 -6
- package/dist/{actions-ws7k3tvq.js → actions-45eyf0ns.js} +31 -29
- package/dist/{amp-adapter-nvv8k8j5.js → amp-adapter-f5dr6dm0.js} +6 -6
- package/dist/{anthropic-messages-13yn502s.js → anthropic-messages-etkbxhhy.js} +11 -11
- package/dist/{app-80w6qspx.js → app-qv86qhzz.js} +9 -9
- package/dist/{artifact-fey7dvj9.js → artifact-eczsknc3.js} +6 -3
- package/dist/{assistant-jtq439kw.js → assistant-10yaeebp.js} +34 -32
- package/dist/{azure-openai-responses-9st34pfz.js → azure-openai-responses-xap57x4b.js} +7 -7
- package/dist/{boot-reembed-feda8wn8.js → boot-reembed-p2wbqxm4.js} +8 -8
- package/dist/{boot-reembed-3nc0aaed.js → boot-reembed-wyb785et.js} +8 -8
- package/dist/{boot-scrub-sweep-grsa2er0.js → boot-scrub-sweep-daaqcs9t.js} +9 -9
- package/dist/{boot-seeds-gcfgq44f.js → boot-seeds-1pvzyx4h.js} +12 -12
- package/dist/{claude-adapter-pjv2q7t8.js → claude-adapter-v2py1c6g.js} +15 -15
- package/dist/{claude-managed-adapter-0wa8se82.js → claude-managed-adapter-kqqqhp2q.js} +2 -2
- package/dist/{claude-managed-setup-zxa9p9tx.js → claude-managed-setup-bnmjarjc.js} +11 -8
- package/dist/{claude-sdk-session-c9j6k9kx.js → claude-sdk-session-mk938tpt.js} +15 -15
- package/dist/cli-0p3enk35.js +188 -0
- package/dist/cli-1srmzpr3.js +16 -0
- package/dist/{cli-zzev32jw.js → cli-231av4y6.js} +6 -6
- package/dist/{cli-eqfbsxsn.js → cli-2aap68ns.js} +14 -11
- package/dist/{cli-mv2520nm.js → cli-2bw3w47j.js} +1 -1
- package/dist/{cli-km8559dm.js → cli-2k8gyaey.js} +18 -10
- package/dist/{cli-efnd2kce.js → cli-2rbt7at8.js} +6 -1
- package/dist/{cli-xvc3q9br.js → cli-451ks6aw.js} +1 -1
- package/dist/{cli-7vz49g7h.js → cli-48ve9gsj.js} +101 -4
- package/dist/{cli-zp38xvtm.js → cli-5rqrj7q0.js} +1 -1
- package/dist/{cli-km4x66j0.js → cli-5y67yrt6.js} +13 -13
- package/dist/{cli-3ry5gx4f.js → cli-6pxmb99j.js} +2 -2
- package/dist/cli-6zx22mv6.js +0 -0
- package/dist/{cli-zp67qg5x.js → cli-7a0sde2x.js} +72 -1
- package/dist/{cli-v1w7pbd8.js → cli-7jykv7ef.js} +1 -1
- package/dist/{cli-rfphkzh5.js → cli-7pz3b7x5.js} +24 -4
- package/dist/{cli-mb75wpxf.js → cli-81r1wjyv.js} +1 -1
- package/dist/cli-8ntwbxmm.js +1351 -0
- package/dist/{cli-f14fvzag.js → cli-a1b9b32n.js} +6 -1
- package/dist/{cli-rg1c8ccw.js → cli-amvnn9wz.js} +497 -73
- package/dist/{cli-fyeft04q.js → cli-apnwqe6h.js} +2 -2
- package/dist/{cli-m23r88re.js → cli-bkdbswyn.js} +3 -3
- package/dist/{cli-qg2zhjfc.js → cli-c9cnsnms.js} +8 -8
- package/dist/cli-cd0hv9nh.js +32 -0
- package/dist/{cli-wt7ccy4r.js → cli-d161g69q.js} +9 -1
- package/dist/{cli-rbr91whd.js → cli-d78fccnb.js} +9 -5
- package/dist/cli-db3m6zdt.js +362 -0
- package/dist/{cli-hf5s9pgf.js → cli-e3pmyt39.js} +1 -1
- package/dist/{cli-91r17hb1.js → cli-ehf1dfay.js} +3 -3
- package/dist/{cli-61tbnjpf.js → cli-f3vy7ncj.js} +767 -541
- package/dist/{cli-sajr098b.js → cli-f651ypy4.js} +3 -3
- package/dist/{cli-9k7mqz00.js → cli-ge593j7e.js} +30 -3
- package/dist/cli-h8w3fg83.js +17 -0
- package/dist/{cli-dv76vq5d.js → cli-hadkza7w.js} +685 -209
- package/dist/{cli-jkfxpg1b.js → cli-hrbedqp0.js} +2 -2
- package/dist/{cli-xvdgasgy.js → cli-hsem16hb.js} +114 -9
- package/dist/{cli-kp3vfknv.js → cli-j8xzym9k.js} +2 -2
- package/dist/{cli-swrz3mj8.js → cli-jn9wk8z8.js} +1 -1
- package/dist/{cli-a8vps458.js → cli-jr749y58.js} +17274 -17242
- package/dist/{cli-b7y8113e.js → cli-k2v5x13t.js} +1 -1
- package/dist/{cli-bqrs5ycj.js → cli-m4csbs67.js} +2 -2
- package/dist/{cli-yvxfaem2.js → cli-ndvfgmk8.js} +9 -5
- package/dist/{cli-r7eeddkq.js → cli-ph3145b7.js} +3 -3
- package/dist/cli-ppy4nnnh.js +168 -0
- package/dist/{cli-e5qk3m2a.js → cli-pw9x22wp.js} +19 -19
- package/dist/{cli-s0k2j7q9.js → cli-pwnxv8pw.js} +10 -10
- package/dist/{cli-jv36y8wz.js → cli-rrbctenq.js} +1 -1
- package/dist/{cli-vejds37t.js → cli-tb8p51kg.js} +3 -3
- package/dist/cli-tqzk05ty.js +832 -0
- package/dist/{cli-rh44xx46.js → cli-vtqrsgnm.js} +15 -15
- package/dist/{cli-7mhy3ths.js → cli-x61srfpp.js} +5 -5
- package/dist/{cli-n4z21pt8.js → cli-xy6sgy6p.js} +1 -1
- package/dist/{cli-w6xa5nf5.js → cli-y1j1ggbf.js} +8 -8
- package/dist/{cli-jvmtxqtc.js → cli-ywh2a87k.js} +7 -2
- package/dist/{cli-3qhyh31j.js → cli-ywm1azg9.js} +6 -0
- package/dist/{cli-8xjst8q2.js → cli-z9cvwx5m.js} +11 -11
- package/dist/{cli-ysnkvdx6.js → cli-zh93km01.js} +313 -91
- package/dist/{cli-z48ggfyq.js → cli-zxm9p3x4.js} +2 -2
- package/dist/cli.js +42 -24
- package/dist/{codex-adapter-0kpg09ca.js → codex-adapter-cg8vntj1.js} +13 -13
- package/dist/{codex-hook-295jpbfa.js → codex-hook-7ba15hjd.js} +5 -3
- package/dist/{codex-login-g1cyt5zm.js → codex-login-841kv5fk.js} +7 -5
- package/dist/{codex-session-runner-8n672hxh.js → codex-session-runner-jxs6n1qx.js} +13 -13
- package/dist/{commands-mhmg5n0x.js → commands-8zhezbzr.js} +10 -10
- package/dist/controller-hq5ggpcp.js +193 -0
- package/dist/controllers-connect-q0brsq11.js +265 -0
- package/dist/{cursor-adapter-wn8n5zzk.js → cursor-adapter-t4pr1m3c.js} +5 -5
- package/dist/db-d80sy99v.js +71 -0
- package/dist/{db-wa6s1mwv.js → db-ggc4b127.js} +8 -8
- package/dist/{devin-adapter-bffjj5n4.js → devin-adapter-xgtj680j.js} +2 -2
- package/dist/{dispatcher-nhs2pkr8.js → dispatcher-eascgc1z.js} +30 -28
- package/dist/docker-f503k9p0.js +201 -0
- package/dist/{dsh-adapter-5423p70m.js → dsh-adapter-2h8m4cab.js} +5 -5
- package/dist/e2b-66xra4az.js +202 -0
- package/dist/{e2b-nd50eccg.js → e2b-xwhyj8cw.js} +43 -527
- package/dist/{event-bus-vnfthafg.js → event-bus-vjtv82gm.js} +2 -2
- package/dist/{grok-adapter-28pkdt80.js → grok-adapter-8ram8zse.js} +7 -7
- package/dist/{handlers-5rtf9nng.js → handlers-hypxbg7e.js} +33 -31
- package/dist/heartbeat-ge72pt7q.js +124 -0
- package/dist/{hook-krjfkpzy.js → hook-grgtyrad.js} +20 -17
- package/dist/{hook-qkm73zk6.js → hook-xzwg1zwp.js} +13 -13
- package/dist/{http-a397xcn4.js → http-2nf2axqq.js} +1958 -205
- package/dist/{index-vvsq7v45.js → index-0h5dd9xg.js} +30 -28
- package/dist/{index-ac0v8v9d.js → index-27aez391.js} +8 -8
- package/dist/{index-rtxg15ah.js → index-57svck0z.js} +39 -29
- package/dist/{index-ytdhtdry.js → index-6zehd2p5.js} +31 -22
- package/dist/{index-kqre45fr.js → index-9egx96ey.js} +30 -28
- package/dist/{keepalive-psfh8ysx.js → keepalive-5pjbsz8f.js} +10 -10
- package/dist/{lead-m6rppjn7.js → lead-g19prqhd.js} +48 -46
- package/dist/{maintenance-41f837ke.js → maintenance-1brc7q4c.js} +8 -8
- package/dist/{node-8zkdq42h.js → node-c9we95xf.js} +9 -9
- package/dist/{oauth-refresh-sweep-6hr55hm8.js → oauth-refresh-sweep-rhe857nd.js} +9 -9
- package/dist/{onboard-ktrtd7cz.js → onboard-6bcg69eg.js} +25 -15
- package/dist/{openai-codex-responses-jzxkta9b.js → openai-codex-responses-pgvtddvv.js} +3 -3
- package/dist/{openai-responses-m3g43rrt.js → openai-responses-9dyzwzkr.js} +9 -9
- package/dist/{opencode-adapter-yjyqynzf.js → opencode-adapter-f1zby94p.js} +3 -3
- package/dist/{otel-impl-dq4f2k3m.js → otel-impl-y237rck3.js} +5 -5
- package/dist/{pi-mono-adapter-e5v9w0hv.js → pi-mono-adapter-fx6k5wwh.js} +38 -27
- package/dist/{pricing-refresh-kmk7j1ra.js → pricing-refresh-se1qg8wn.js} +10 -10
- package/dist/{rbac-roles-9w1dkkxd.js → rbac-roles-b6ca1n23.js} +11 -11
- package/dist/{rbac-roles-9ykx9tc5.js → rbac-roles-c58kydph.js} +10 -10
- package/dist/{render-v2-ycqm53np.js → render-v2-gqz7z5xt.js} +9 -9
- package/dist/{resume-cq2pkp8q.js → resume-yb3y3vda.js} +16 -16
- package/dist/{setup-0dcmdvbn.js → setup-1rbr9x3c.js} +7 -5
- package/dist/static-t1gr2cr7.js +30 -0
- package/dist/{virtual-modules-1x9k4jcs.js → virtual-modules-rdjmcg7q.js} +3 -3
- package/dist/{work-objects-x01x2fh8.js → work-objects-nzcp8srm.js} +35 -33
- package/dist/{worker-py1ssb1h.js → worker-wnz1h3g0.js} +48 -46
- package/dist/{x-ma4gnfgy.js → x-qfmygqqv.js} +2 -2
- package/openapi.json +3382 -167
- package/package.json +3 -3
- package/src/be/db/agents.ts +6 -0
- package/src/be/db/instance-signals.ts +30 -0
- package/src/be/db/tasks/read.ts +2 -0
- package/src/be/db/tasks/write.ts +39 -5
- package/src/be/db/workflow-runs.ts +22 -0
- package/src/be/db.ts +96 -40
- package/src/be/fleet-benchmark-stats.ts +39 -0
- package/src/be/migrations/205_favorites_per_dashboard_user.sql +29 -0
- package/src/be/migrations/206_runtime_pools.sql +62 -0
- package/src/be/migrations/207_runtime_session_tokens.sql +31 -0
- package/src/be/migrations/208_task_runtime_dispatch.sql +4 -0
- package/src/be/model-tier-resolution.ts +9 -2
- package/src/be/multi-runtime.ts +102 -13
- package/src/be/org-profile.ts +35 -0
- package/src/be/rbac-audit.ts +4 -0
- package/src/be/runtime-pools/controllers.ts +150 -0
- package/src/be/runtime-pools/db.ts +526 -0
- package/src/be/runtime-pools/demand.ts +65 -0
- package/src/be/runtime-pools/e2b-images.ts +109 -0
- package/src/be/runtime-pools/errors.ts +8 -0
- package/src/be/runtime-pools/lifecycle.ts +44 -0
- package/src/be/runtime-pools/reachability.ts +30 -0
- package/src/be/runtime-pools/recovery.ts +248 -0
- package/src/be/runtime-pools/remote-controller.ts +144 -0
- package/src/be/runtime-pools/routing.ts +304 -0
- package/src/be/runtime-pools/seed.ts +110 -0
- package/src/be/runtime-pools/supervisor.ts +981 -0
- package/src/be/runtime-pools/tokens.ts +57 -0
- package/src/be/scripts/typecheck.ts +48 -3
- package/src/be/secret-registry.ts +17 -1
- package/src/be/skill-usage.ts +467 -0
- package/src/be/swarm-config-guard.ts +59 -2
- package/src/be/telemetry-enable.ts +66 -0
- package/src/be/telemetry-ingest-anchor.ts +77 -0
- package/src/be/users.ts +173 -23
- package/src/be/worker-nudge-listener.ts +28 -0
- package/src/be/worker-nudges.ts +22 -0
- package/src/cli.tsx +22 -3
- package/src/commands/controller.ts +180 -0
- package/src/commands/onboard/non-interactive.ts +36 -12
- package/src/commands/onboard/types.ts +1 -1
- package/src/commands/onboard.tsx +3 -0
- package/src/commands/push-delivery.ts +230 -0
- package/src/commands/runner.ts +560 -276
- package/src/e2b/dispatch.ts +15 -1
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/fleet-benchmark.ts +157 -0
- package/src/heartbeat/heartbeat.ts +53 -135
- package/src/hooks/hook.ts +3 -2
- package/src/http/agents.ts +21 -0
- package/src/http/all-routes.ts +6 -0
- package/src/http/apps.ts +4 -2
- package/src/http/auth.ts +4 -7
- package/src/http/config.ts +58 -21
- package/src/http/controllers-connect.ts +206 -0
- package/src/http/core.ts +108 -14
- package/src/http/favorite-owner.ts +31 -1
- package/src/http/fleet-benchmark.ts +206 -0
- package/src/http/index.ts +38 -6
- package/src/http/mcp.ts +3 -8
- package/src/http/poll.ts +31 -2
- package/src/http/realtime.ts +1 -1
- package/src/http/request-principal.ts +2 -0
- package/src/http/runtime-pools.ts +527 -0
- package/src/http/session-data.ts +2 -0
- package/src/http/sessions.ts +100 -23
- package/src/http/skills.ts +173 -0
- package/src/http/status.ts +25 -1
- package/src/http/tasks.ts +14 -1
- package/src/http/telemetry-ui.ts +102 -0
- package/src/http/used-by.ts +140 -0
- package/src/http/utils.ts +7 -1
- package/src/http/workflows.ts +10 -2
- package/src/jira/app.ts +1 -2
- package/src/kv-reserved-namespaces.ts +1 -0
- package/src/linear/app.ts +1 -2
- package/src/providers/acp-target-catalog.ts +75 -1
- package/src/providers/acp-targets.ts +114 -0
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +5 -1
- package/src/providers/opencode-adapter.ts +2 -1
- package/src/providers/pi-mono-adapter.ts +41 -26
- package/src/providers/pricing-sources.md +2 -0
- package/src/providers/skill-invoke.ts +39 -3
- package/src/rbac/legacy-policy.ts +8 -0
- package/src/rbac/permissions.ts +16 -0
- package/src/rbac/types.ts +2 -0
- package/src/realtime/auth.ts +13 -0
- package/src/realtime/channels.ts +24 -0
- package/src/realtime/transport.ts +94 -15
- package/src/realtime/worker-client.ts +176 -0
- package/src/runtime-providers/controller-protocol.ts +97 -0
- package/src/runtime-providers/controller.ts +86 -0
- package/src/runtime-providers/docker.ts +235 -0
- package/src/runtime-providers/e2b.ts +217 -0
- package/src/runtime-providers/index.ts +37 -0
- package/src/runtime-providers/static.ts +26 -0
- package/src/runtime-providers/types.ts +92 -0
- package/src/runtime-providers/worker-api-url.ts +11 -0
- package/src/scripts-runtime/sdk-allowlist.ts +6 -0
- package/src/scripts-runtime/types/stdlib.d.ts +15 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +15 -0
- package/src/server.ts +12 -0
- package/src/slack/router.ts +7 -5
- package/src/tasks/worker-follow-up.ts +80 -52
- package/src/telemetry-context.ts +6 -0
- package/src/telemetry-contract/EVENTS.md +14 -1
- package/src/telemetry-contract/SOURCE.json +4 -4
- package/src/telemetry-contract/catalog.json +155 -0
- package/src/telemetry-contract/types.gen.ts +248 -4
- package/src/telemetry-ui-events.ts +130 -0
- package/src/telemetry.ts +43 -3
- package/src/tests/acp-adapter.test.ts +129 -0
- package/src/tests/claude-adapter.test.ts +6 -2
- package/src/tests/codex-adapter.test.ts +6 -2
- package/src/tests/config-internal-keys.test.ts +27 -0
- package/src/tests/config-session-auth.test.ts +19 -3
- package/src/tests/db-retention.test.ts +50 -10
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/e2b-dispatch.test.ts +28 -1
- package/src/tests/e2e-runtime-pools.test.ts +51 -0
- package/src/tests/entrypoint-acp-target-binary.test.ts +38 -1
- package/src/tests/favorites.test.ts +188 -0
- package/src/tests/fetch-resolved-env.test.ts +59 -1
- package/src/tests/fleet-benchmark.test.ts +453 -0
- package/src/tests/harness-model-support.test.ts +70 -2
- package/src/tests/heartbeat-orphan-resume.test.ts +24 -0
- package/src/tests/heartbeat-reboot-live.test.ts +31 -0
- package/src/tests/heartbeat-supersede-resume.test.ts +21 -0
- package/src/tests/hook-runtime-close.test.ts +64 -0
- package/src/tests/http-task-write-ownership.test.ts +8 -1
- package/src/tests/integration-disable-flags.test.ts +45 -0
- package/src/tests/migration-206-runtime-pools.test.ts +134 -0
- package/src/tests/migration-207-runtime-session-tokens.test.ts +45 -0
- package/src/tests/migration-208-task-runtime-dispatch.test.ts +30 -0
- package/src/tests/multi-runtime-registration.test.ts +219 -4
- package/src/tests/onboard-non-interactive.test.ts +104 -6
- package/src/tests/opencode-adapter.test.ts +6 -2
- package/src/tests/org-website.test.ts +115 -0
- package/src/tests/pi-mono-adapter.test.ts +74 -10
- package/src/tests/rbac-admission-e2e.test.ts +4 -4
- package/src/tests/rbac-engine.test.ts +8 -1
- package/src/tests/realtime-room-auth.test.ts +49 -0
- package/src/tests/repo-allow-merge-gate.test.ts +8 -1
- package/src/tests/runner-exit-after-tasks.test.ts +163 -0
- package/src/tests/runner-finish-retry.test.ts +466 -0
- package/src/tests/runner-harness-telemetry-env.test.ts +105 -0
- package/src/tests/runner-push-delivery.test.ts +670 -0
- package/src/tests/runner-slot-reconcile.test.ts +89 -1
- package/src/tests/runtime-child-token-cleanup.test.ts +172 -0
- package/src/tests/runtime-controller-token.test.ts +254 -0
- package/src/tests/runtime-demand.test.ts +119 -0
- package/src/tests/runtime-e2b-pools.test.ts +847 -0
- package/src/tests/runtime-pool-reachability.test.ts +328 -0
- package/src/tests/runtime-pool-routing.test.ts +817 -0
- package/src/tests/runtime-pools-db.test.ts +275 -0
- package/src/tests/runtime-pools-http.test.ts +506 -0
- package/src/tests/runtime-pools-ownership-guards.test.ts +235 -0
- package/src/tests/runtime-pools-seed.test.ts +203 -0
- package/src/tests/runtime-pools-test-utils.ts +128 -0
- package/src/tests/runtime-provider-registration.test.ts +133 -0
- package/src/tests/runtime-providers-docker.test.ts +400 -0
- package/src/tests/runtime-providers-e2b-transport.test.ts +50 -0
- package/src/tests/runtime-providers-e2b.test.ts +335 -0
- package/src/tests/runtime-recovery.test.ts +745 -0
- package/src/tests/runtime-remote-controller.test.ts +846 -0
- package/src/tests/runtime-supervisor-failures.test.ts +387 -0
- package/src/tests/runtime-supervisor.test.ts +1039 -0
- package/src/tests/runtime-token-auth.test.ts +897 -0
- package/src/tests/script-connections.test.ts +7 -0
- package/src/tests/secret-scrubber.test.ts +17 -2
- package/src/tests/session-costs-codex-recompute.test.ts +49 -0
- package/src/tests/session-tokens.test.ts +13 -3
- package/src/tests/skill-invoke.test.ts +142 -0
- package/src/tests/skill-usage-cohorts.test.ts +232 -0
- package/src/tests/skill-usage.test.ts +348 -0
- package/src/tests/slack-attachments-block.test.ts +23 -0
- package/src/tests/slack-render-v2.test.ts +6 -0
- package/src/tests/status-instance.test.ts +71 -0
- package/src/tests/task-supersede-resume.test.ts +87 -4
- package/src/tests/telemetry-enable.test.ts +113 -0
- package/src/tests/telemetry-ui-route.test.ts +195 -0
- package/src/tests/tool-annotations.test.ts +1 -1
- package/src/tests/used-by-route.test.ts +237 -0
- package/src/tests/worker-nudges.test.ts +653 -0
- package/src/tests/worker-realtime-client.test.ts +188 -0
- package/src/tests/workflow-sub-workflow.test.ts +22 -0
- package/src/tools/app-upsert.ts +1 -1
- package/src/tools/runtime-controller-list.ts +28 -0
- package/src/tools/runtime-pool-bind-agent.ts +29 -0
- package/src/tools/runtime-pool-common.ts +37 -0
- package/src/tools/runtime-pool-create-agent.ts +29 -0
- package/src/tools/runtime-pool-delete.ts +27 -0
- package/src/tools/runtime-pool-list.ts +27 -0
- package/src/tools/runtime-pool-upsert.ts +31 -0
- package/src/tools/script-common.ts +1 -1
- package/src/tools/send-task.ts +3 -2
- package/src/tools/tool-config.ts +6 -0
- package/src/types.ts +137 -2
- package/src/utils/config-secrets.ts +1 -0
- package/src/utils/lead-monitor-channels.ts +3 -0
- package/src/utils/org-website.ts +104 -0
- package/src/utils/request-auth-context.ts +10 -2
- package/src/utils/runtime-pools-flag.ts +11 -0
- package/src/utils/secret-scrubber.ts +9 -0
- package/src/utils/session-token-connections.ts +20 -0
- package/templates/skills/apps/content.md +1 -1
- package/templates/skills/code-quality/content.md +9 -1
- package/templates/skills/db-query-guidance/content.md +9 -0
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/templates/skills/work-on-task/SKILL.md +1 -1
- package/templates/skills/work-on-task/content.md +1 -1
- package/dist/{cli-qd97v6z2.js → cli-1qtgd1h1.js} +3 -3
- package/dist/{cli-cmxkbzzs.js → cli-j0w59p15.js} +6 -6
- package/dist/{google-generative-ai-b8zxrpax.js → google-generative-ai-pvhm0dq1.js} +1 -1
- package/dist/{google-vertex-nrdd697t.js → google-vertex-tek9sqe2.js} +4 -4
- package/dist/{mistral-conversations-059y51zt.js → mistral-conversations-rjxa9s1j.js} +3 -3
- package/dist/{openai-completions-663yncfq.js → openai-completions-44gb0zsk.js} +12 -12
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
markAuthorizationRefreshFailed,
|
|
10
10
|
releaseOAuthRefreshLock,
|
|
11
11
|
updateAuthorizationTokens
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-amvnn9wz.js";
|
|
13
13
|
import {
|
|
14
14
|
init_secret_scrubber,
|
|
15
15
|
registerVolatileSecret,
|
|
16
16
|
scrubSecrets
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-d161g69q.js";
|
|
18
18
|
|
|
19
19
|
// src/oauth/ensure-token.ts
|
|
20
20
|
init_oauth();
|
|
@@ -7,7 +7,7 @@ var package_default;
|
|
|
7
7
|
var init_package = __esm(() => {
|
|
8
8
|
package_default = {
|
|
9
9
|
name: "@desplega.ai/agent-swarm",
|
|
10
|
-
version: "1.
|
|
10
|
+
version: "1.171.1",
|
|
11
11
|
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.",
|
|
12
12
|
keywords: [
|
|
13
13
|
"agent-swarm.dev",
|
|
@@ -192,7 +192,7 @@ var init_package = __esm(() => {
|
|
|
192
192
|
"@desplega/model-catalog": "workspace:*",
|
|
193
193
|
"@desplega/model-routing": "workspace:*",
|
|
194
194
|
"@faker-js/faker": "^10.4.0",
|
|
195
|
-
"@opencode-ai/plugin": "1.
|
|
195
|
+
"@opencode-ai/plugin": "1.19.0",
|
|
196
196
|
"@oxlint/plugins": "1.78.0",
|
|
197
197
|
"@types/bun": "latest",
|
|
198
198
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
@@ -227,7 +227,7 @@ var init_package = __esm(() => {
|
|
|
227
227
|
"@linear/sdk": "^77.0.0",
|
|
228
228
|
"@modelcontextprotocol/sdk": "1.31.0",
|
|
229
229
|
"@openai/codex": "0.162.1",
|
|
230
|
-
"@opencode-ai/sdk": "^1.
|
|
230
|
+
"@opencode-ai/sdk": "^1.19.0",
|
|
231
231
|
"@openfort/openfort-node": "^0.9.1",
|
|
232
232
|
"@opentelemetry/api": "^1.9.1",
|
|
233
233
|
"@opentelemetry/api-logs": "^0.218.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runStopHookSessionSummarySubprocess
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-2aap68ns.js";
|
|
4
4
|
import {
|
|
5
5
|
buildOtelTraceparentEnv,
|
|
6
6
|
isHarnessOtelEnabled
|
|
@@ -33,6 +33,9 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
applyReasoningEffort
|
|
35
35
|
} from "./cli-tmhsxhb8.js";
|
|
36
|
+
import {
|
|
37
|
+
require_src
|
|
38
|
+
} from "./cli-knd276ed.js";
|
|
36
39
|
import {
|
|
37
40
|
swarmRuntimeInstanceId
|
|
38
41
|
} from "./cli-re8z5p8p.js";
|
|
@@ -44,7 +47,7 @@ import {
|
|
|
44
47
|
import {
|
|
45
48
|
init_file_lock,
|
|
46
49
|
withFileLock
|
|
47
|
-
} from "./cli-
|
|
50
|
+
} from "./cli-rrbctenq.js";
|
|
48
51
|
import {
|
|
49
52
|
CLAUDE_CREDENTIALS_HINT,
|
|
50
53
|
init_credentials,
|
|
@@ -67,10 +70,7 @@ import {
|
|
|
67
70
|
import {
|
|
68
71
|
init_secret_scrubber,
|
|
69
72
|
scrubSecrets
|
|
70
|
-
} from "./cli-
|
|
71
|
-
import {
|
|
72
|
-
require_src
|
|
73
|
-
} from "./cli-knd276ed.js";
|
|
73
|
+
} from "./cli-d161g69q.js";
|
|
74
74
|
import {
|
|
75
75
|
__require,
|
|
76
76
|
__toESM
|
|
@@ -654,7 +654,7 @@ async function createSessionMcpConfig(cwd, taskId, installedServers, contextKey)
|
|
|
654
654
|
}
|
|
655
655
|
if (Object.keys(mergedServers).length === 0 && !installedServers)
|
|
656
656
|
return null;
|
|
657
|
-
if (
|
|
657
|
+
if (!isEnvFlagEnabled("CONTEXT_MODE_DISABLED", false)) {
|
|
658
658
|
mergedServers["plugin_context-mode_context-mode"] = { command: "context-mode" };
|
|
659
659
|
}
|
|
660
660
|
try {
|
|
@@ -1116,7 +1116,7 @@ class ClaudeAdapter {
|
|
|
1116
1116
|
if (transport === "sdk" && isClaudeBridgeEffective(sourceEnv)) {
|
|
1117
1117
|
throw new Error("CLAUDE_TRANSPORT=sdk cannot run with an effective Claude Bridge configuration. Select CLI transport or disable the bridge.");
|
|
1118
1118
|
}
|
|
1119
|
-
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-
|
|
1119
|
+
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-mk938tpt.js") : undefined;
|
|
1120
1120
|
claudeSdk?.validateClaudeSdkAdditionalArgs([
|
|
1121
1121
|
...claudeBinaryArgv.slice(1),
|
|
1122
1122
|
...config.additionalArgs ?? []
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm,
|
|
3
|
+
__require
|
|
4
|
+
} from "./cli-bc05qbss.js";
|
|
5
|
+
|
|
6
|
+
// src/runtime-providers/index.ts
|
|
7
|
+
function canProvisionKind(kind) {
|
|
8
|
+
return kind === "docker" || kind === "e2b";
|
|
9
|
+
}
|
|
10
|
+
async function createRuntimeProvider(kind, target = {}) {
|
|
11
|
+
switch (kind) {
|
|
12
|
+
case "static": {
|
|
13
|
+
const { StaticRuntimeProvider } = await import("./static-t1gr2cr7.js");
|
|
14
|
+
return new StaticRuntimeProvider;
|
|
15
|
+
}
|
|
16
|
+
case "docker": {
|
|
17
|
+
const { DockerRuntimeProvider } = await import("./docker-f503k9p0.js");
|
|
18
|
+
return new DockerRuntimeProvider;
|
|
19
|
+
}
|
|
20
|
+
case "e2b": {
|
|
21
|
+
const { E2BRuntimeProvider } = await import("./e2b-66xra4az.js");
|
|
22
|
+
return new E2BRuntimeProvider(target);
|
|
23
|
+
}
|
|
24
|
+
case "k8s":
|
|
25
|
+
throw new Error('Unknown runtime provider: "k8s" (not implemented). Supported: static, docker, e2b');
|
|
26
|
+
default:
|
|
27
|
+
throw new Error(`Unknown runtime provider: "${kind}". Supported: static, docker, e2b`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
var init_runtime_providers = () => {};
|
|
31
|
+
|
|
32
|
+
export { canProvisionKind, createRuntimeProvider, init_runtime_providers };
|
|
@@ -2468,6 +2468,14 @@ function registerVolatileSecret(value, name) {
|
|
|
2468
2468
|
volatileGeneration++;
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
+
function unregisterVolatileSecret(name) {
|
|
2472
|
+
for (const [value, registeredName] of volatileSecrets) {
|
|
2473
|
+
if (registeredName !== name)
|
|
2474
|
+
continue;
|
|
2475
|
+
volatileSecrets.delete(value);
|
|
2476
|
+
volatileGeneration++;
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2471
2479
|
function registerSensitiveKeyName(key) {
|
|
2472
2480
|
if (registeredSensitiveKeys.has(key))
|
|
2473
2481
|
return;
|
|
@@ -2651,4 +2659,4 @@ var init_secret_scrubber = __esm(() => {
|
|
|
2651
2659
|
sensitiveKeyVerdicts = new Map;
|
|
2652
2660
|
});
|
|
2653
2661
|
|
|
2654
|
-
export { SCRUBBER_RULES_VERSION, isSensitiveKey, scrubSecrets, findSecretsIn, scrubObject, refreshSecretScrubberCache, registerVolatileSecret, registerSensitiveKeyName, init_secret_scrubber };
|
|
2662
|
+
export { SCRUBBER_RULES_VERSION, isSensitiveKey, scrubSecrets, findSecretsIn, scrubObject, refreshSecretScrubberCache, registerVolatileSecret, unregisterVolatileSecret, registerSensitiveKeyName, init_secret_scrubber };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId,
|
|
3
3
|
rewriteSlackMentions
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ndvfgmk8.js";
|
|
5
5
|
import {
|
|
6
6
|
bufferedFileFailures,
|
|
7
7
|
buildEffectiveText,
|
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
createSlackTaskWithFiles,
|
|
10
10
|
extractSlackMessageText,
|
|
11
11
|
fetchSlackFiles,
|
|
12
|
-
findUserByExternalId,
|
|
13
12
|
notifySlackFileFailures
|
|
14
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-f3vy7ncj.js";
|
|
15
14
|
import {
|
|
16
15
|
buildBufferFlushBlocks,
|
|
17
16
|
ensureSlackThreadTree,
|
|
@@ -20,7 +19,11 @@ import {
|
|
|
20
19
|
getSlackApp,
|
|
21
20
|
isSlackRenderV2Enabled,
|
|
22
21
|
registerTreeMessage
|
|
23
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-pw9x22wp.js";
|
|
23
|
+
import {
|
|
24
|
+
findUserByExternalId,
|
|
25
|
+
init_users
|
|
26
|
+
} from "./cli-tqzk05ty.js";
|
|
24
27
|
import {
|
|
25
28
|
createLogEntry,
|
|
26
29
|
getAgentById,
|
|
@@ -33,7 +36,7 @@ import {
|
|
|
33
36
|
init_steering,
|
|
34
37
|
requestSteering,
|
|
35
38
|
slackContextKey
|
|
36
|
-
} from "./cli-
|
|
39
|
+
} from "./cli-amvnn9wz.js";
|
|
37
40
|
import {
|
|
38
41
|
init_steering_enabled,
|
|
39
42
|
isSteeringEnabled
|
|
@@ -138,6 +141,7 @@ function formatSlackSteeringAck(result) {
|
|
|
138
141
|
|
|
139
142
|
// src/slack/thread-buffer.ts
|
|
140
143
|
init_db();
|
|
144
|
+
init_users();
|
|
141
145
|
init_context_key();
|
|
142
146
|
var BUFFER_TIMEOUT_MS = Number(process.env.ADDITIVE_SLACK_BUFFER_MS) || 1e4;
|
|
143
147
|
function makeKey(channelId, threadTs) {
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_E2B_API_BASE,
|
|
3
|
+
init_env,
|
|
4
|
+
redactWithEnv
|
|
5
|
+
} from "./cli-0p3enk35.js";
|
|
6
|
+
import {
|
|
7
|
+
__esm,
|
|
8
|
+
__require,
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./cli-bc05qbss.js";
|
|
11
|
+
|
|
12
|
+
// src/e2b/dispatch.ts
|
|
13
|
+
function e2bHeaders(apiKey) {
|
|
14
|
+
return {
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
"X-API-Key": apiKey
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function buildTrackedShell(command, logPath) {
|
|
20
|
+
return `set -o pipefail; ${command} 2>&1 | tee ${logPath}`;
|
|
21
|
+
}
|
|
22
|
+
function e2bSdkConnectionOptions(apiKey, env, apiBase) {
|
|
23
|
+
const options = { apiKey };
|
|
24
|
+
const resolvedApiUrl = apiBase || env.E2B_API_URL;
|
|
25
|
+
if (resolvedApiUrl)
|
|
26
|
+
options.apiUrl = resolvedApiUrl;
|
|
27
|
+
if (env.E2B_DOMAIN)
|
|
28
|
+
options.domain = env.E2B_DOMAIN;
|
|
29
|
+
if (env.E2B_SANDBOX_URL)
|
|
30
|
+
options.sandboxUrl = env.E2B_SANDBOX_URL;
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
function sandboxDomainFromUrl(rawUrl) {
|
|
34
|
+
try {
|
|
35
|
+
const url = new URL(rawUrl);
|
|
36
|
+
const host = url.host;
|
|
37
|
+
return host.startsWith("sandbox.") ? host.slice("sandbox.".length) : host;
|
|
38
|
+
} catch {
|
|
39
|
+
const host = rawUrl.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
40
|
+
if (!host)
|
|
41
|
+
return;
|
|
42
|
+
return host.startsWith("sandbox.") ? host.slice("sandbox.".length) : host;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function configuredSandboxDomain(env) {
|
|
46
|
+
if (env.E2B_DOMAIN)
|
|
47
|
+
return env.E2B_DOMAIN;
|
|
48
|
+
if (env.E2B_SANDBOX_URL)
|
|
49
|
+
return sandboxDomainFromUrl(env.E2B_SANDBOX_URL);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
function sandboxPortHost(sandbox, port, env = {}) {
|
|
53
|
+
const domain = sandbox.domain || configuredSandboxDomain(env) || "e2b.app";
|
|
54
|
+
if (domain.includes(sandbox.sandboxID)) {
|
|
55
|
+
return `${port}-${domain}`;
|
|
56
|
+
}
|
|
57
|
+
return `${port}-${sandbox.sandboxID}.${domain}`;
|
|
58
|
+
}
|
|
59
|
+
function sandboxPortUrl(sandbox, port, env = {}) {
|
|
60
|
+
return `https://${sandboxPortHost(sandbox, port, env)}`;
|
|
61
|
+
}
|
|
62
|
+
async function readResponseBody(response) {
|
|
63
|
+
const text = await response.text();
|
|
64
|
+
return text.trim();
|
|
65
|
+
}
|
|
66
|
+
async function e2bFetchJson(path, apiKey, init = {}, apiBase = DEFAULT_E2B_API_BASE) {
|
|
67
|
+
const response = await fetch(`${apiBase}${path}`, {
|
|
68
|
+
...init,
|
|
69
|
+
headers: {
|
|
70
|
+
...e2bHeaders(apiKey),
|
|
71
|
+
...init.headers ?? {}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
const body = await readResponseBody(response);
|
|
76
|
+
throw new E2BApiError(response.status, `E2B API ${response.status} ${response.statusText}: ${body}`);
|
|
77
|
+
}
|
|
78
|
+
if (response.status === 204) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
return await response.json();
|
|
82
|
+
}
|
|
83
|
+
async function createSandbox(opts) {
|
|
84
|
+
const createdAt = Date.now();
|
|
85
|
+
const sandbox = await e2bFetchJson("/sandboxes", opts.apiKey, {
|
|
86
|
+
method: "POST",
|
|
87
|
+
body: JSON.stringify({
|
|
88
|
+
templateID: opts.template,
|
|
89
|
+
timeout: opts.timeoutSec,
|
|
90
|
+
secure: true,
|
|
91
|
+
allow_internet_access: opts.allowInternetAccess ?? true,
|
|
92
|
+
metadata: opts.metadata,
|
|
93
|
+
envVars: opts.envVars
|
|
94
|
+
})
|
|
95
|
+
}, opts.apiBase);
|
|
96
|
+
if (!sandbox.endAt && !sandbox.expiresAt) {
|
|
97
|
+
sandbox.expiresAt = new Date(createdAt + opts.timeoutSec * 1000).toISOString();
|
|
98
|
+
}
|
|
99
|
+
return sandbox;
|
|
100
|
+
}
|
|
101
|
+
function ttlRemaining(sandbox) {
|
|
102
|
+
const expiresAt = sandbox.endAt ?? sandbox.expiresAt;
|
|
103
|
+
if (!expiresAt)
|
|
104
|
+
return {};
|
|
105
|
+
const expiryMs = Date.parse(expiresAt);
|
|
106
|
+
if (Number.isNaN(expiryMs))
|
|
107
|
+
return {};
|
|
108
|
+
const secondsLeft = Math.max(0, Math.round((expiryMs - Date.now()) / 1000));
|
|
109
|
+
return { expiresAt, secondsLeft };
|
|
110
|
+
}
|
|
111
|
+
async function setSandboxTimeout(opts) {
|
|
112
|
+
const { Sandbox } = await import("./index-etdrp7yp.js").then((m)=>__toESM(m.default,1));
|
|
113
|
+
let sandbox;
|
|
114
|
+
try {
|
|
115
|
+
sandbox = await Sandbox.connect(opts.sandboxId, e2bSdkConnectionOptions(opts.apiKey, opts.e2bEnv ?? {}, opts.apiBase));
|
|
116
|
+
} catch {
|
|
117
|
+
throw new Error(`sandbox ${opts.sandboxId} not found / already expired`);
|
|
118
|
+
}
|
|
119
|
+
await sandbox.setTimeout(opts.timeoutMs);
|
|
120
|
+
const info = await sandbox.getInfo();
|
|
121
|
+
const expiresAt = info.endAt instanceof Date ? info.endAt.toISOString() : String(info.endAt);
|
|
122
|
+
return ttlRemaining({
|
|
123
|
+
sandboxID: opts.sandboxId,
|
|
124
|
+
templateID: info.templateId,
|
|
125
|
+
endAt: expiresAt
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async function killSandbox(sandboxId, apiKey, apiBase = DEFAULT_E2B_API_BASE) {
|
|
129
|
+
await e2bFetchJson(`/sandboxes/${encodeURIComponent(sandboxId)}`, apiKey, { method: "DELETE" }, apiBase);
|
|
130
|
+
}
|
|
131
|
+
async function listSandboxes(apiKey, apiBase = DEFAULT_E2B_API_BASE) {
|
|
132
|
+
return e2bFetchJson("/sandboxes", apiKey, {}, apiBase);
|
|
133
|
+
}
|
|
134
|
+
function sandboxLogPath(role) {
|
|
135
|
+
return `/tmp/agent-swarm-e2b-${role}.log`;
|
|
136
|
+
}
|
|
137
|
+
async function startDetachedProcess(opts) {
|
|
138
|
+
const logPath = sandboxLogPath(opts.role);
|
|
139
|
+
const shell = buildTrackedShell(opts.command, logPath);
|
|
140
|
+
const { Sandbox } = await import("./index-etdrp7yp.js").then((m)=>__toESM(m.default,1));
|
|
141
|
+
const sandbox = await Sandbox.connect(opts.sandbox.sandboxID, e2bSdkConnectionOptions(opts.apiKey, opts.e2bEnv ?? {}, opts.apiBase));
|
|
142
|
+
const handle = await sandbox.commands.run(`bash -lc ${shellQuote(shell)}`, {
|
|
143
|
+
user: opts.user ?? "root",
|
|
144
|
+
cwd: opts.cwd ?? "/",
|
|
145
|
+
envs: opts.env,
|
|
146
|
+
background: true,
|
|
147
|
+
timeoutMs: 0
|
|
148
|
+
});
|
|
149
|
+
await Bun.sleep(2000);
|
|
150
|
+
if (typeof handle.exitCode === "number" && handle.exitCode !== 0) {
|
|
151
|
+
const detail = redactWithEnv(`${handle.stdout}
|
|
152
|
+
${handle.stderr}`.trim(), opts.env);
|
|
153
|
+
throw new Error(`E2B start command exited ${handle.exitCode} at launch: ${detail}`);
|
|
154
|
+
}
|
|
155
|
+
return String(handle.pid);
|
|
156
|
+
}
|
|
157
|
+
function shellQuote(value) {
|
|
158
|
+
return `'${value.split("'").join(`'\\''`)}'`;
|
|
159
|
+
}
|
|
160
|
+
async function streamSandboxLog(opts) {
|
|
161
|
+
const logPath = sandboxLogPath(opts.role);
|
|
162
|
+
const tailLines = opts.tailLines ?? 200;
|
|
163
|
+
const { Sandbox } = await import("./index-etdrp7yp.js").then((m)=>__toESM(m.default,1));
|
|
164
|
+
const sandbox = await Sandbox.connect(opts.sandboxId, e2bSdkConnectionOptions(opts.apiKey, opts.e2bEnv ?? {}, opts.apiBase));
|
|
165
|
+
if (!opts.follow) {
|
|
166
|
+
const result = await sandbox.commands.run(`bash -lc ${shellQuote(`tail -n ${tailLines} ${logPath} 2>&1 || true`)}`, { user: "root", timeoutMs: 30000 });
|
|
167
|
+
if (result.stdout)
|
|
168
|
+
opts.onChunk(result.stdout);
|
|
169
|
+
if (result.stderr)
|
|
170
|
+
opts.onChunk(result.stderr);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const handle = await sandbox.commands.run(`bash -lc ${shellQuote(`tail -n ${tailLines} -F ${logPath}`)}`, {
|
|
174
|
+
user: "root",
|
|
175
|
+
background: true,
|
|
176
|
+
onStdout: (data) => opts.onChunk(data),
|
|
177
|
+
onStderr: (data) => opts.onChunk(data)
|
|
178
|
+
});
|
|
179
|
+
const stop = async () => {
|
|
180
|
+
try {
|
|
181
|
+
await handle.kill();
|
|
182
|
+
} catch {}
|
|
183
|
+
};
|
|
184
|
+
if (opts.signal) {
|
|
185
|
+
if (opts.signal.aborted) {
|
|
186
|
+
await stop();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
opts.signal.addEventListener("abort", stop, { once: true });
|
|
190
|
+
}
|
|
191
|
+
try {
|
|
192
|
+
await handle.wait();
|
|
193
|
+
} catch {}
|
|
194
|
+
}
|
|
195
|
+
async function waitForAgentRegistration(apiUrl, agentId, apiKey, timeoutMs) {
|
|
196
|
+
const baseUrl = apiUrl.replace(/\/+$/, "");
|
|
197
|
+
const url = `${baseUrl}/api/agents/${encodeURIComponent(agentId)}`;
|
|
198
|
+
const started = Date.now();
|
|
199
|
+
let lastError = "";
|
|
200
|
+
while (Date.now() - started < timeoutMs) {
|
|
201
|
+
try {
|
|
202
|
+
const response = await fetch(url, {
|
|
203
|
+
headers: {
|
|
204
|
+
Authorization: `Bearer ${apiKey}`
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
if (response.ok)
|
|
208
|
+
return;
|
|
209
|
+
lastError = `${response.status} ${response.statusText}`;
|
|
210
|
+
} catch (err) {
|
|
211
|
+
lastError = err instanceof Error ? err.message : String(err);
|
|
212
|
+
}
|
|
213
|
+
await Bun.sleep(1000);
|
|
214
|
+
}
|
|
215
|
+
throw new Error(`Timed out waiting for worker ${agentId} to register at ${url}${lastError ? ` (${lastError})` : ""}`);
|
|
216
|
+
}
|
|
217
|
+
async function waitForHttpOk(url, timeoutMs) {
|
|
218
|
+
const started = Date.now();
|
|
219
|
+
let lastError = "";
|
|
220
|
+
while (Date.now() - started < timeoutMs) {
|
|
221
|
+
try {
|
|
222
|
+
const response = await fetch(url);
|
|
223
|
+
if (response.ok)
|
|
224
|
+
return;
|
|
225
|
+
lastError = `${response.status} ${response.statusText}`;
|
|
226
|
+
} catch (err) {
|
|
227
|
+
lastError = err instanceof Error ? err.message : String(err);
|
|
228
|
+
}
|
|
229
|
+
await Bun.sleep(1000);
|
|
230
|
+
}
|
|
231
|
+
throw new Error(`Timed out waiting for ${url}${lastError ? ` (${lastError})` : ""}`);
|
|
232
|
+
}
|
|
233
|
+
function buildTemplateArgs(opts) {
|
|
234
|
+
const args = [
|
|
235
|
+
"template",
|
|
236
|
+
"create",
|
|
237
|
+
"-p",
|
|
238
|
+
opts.cwd,
|
|
239
|
+
"-d",
|
|
240
|
+
opts.dockerfile,
|
|
241
|
+
"-c",
|
|
242
|
+
"sleep infinity",
|
|
243
|
+
"--ready-cmd",
|
|
244
|
+
"sleep 0",
|
|
245
|
+
"--cpu-count",
|
|
246
|
+
String(opts.cpuCount),
|
|
247
|
+
"--memory-mb",
|
|
248
|
+
String(opts.memoryMb)
|
|
249
|
+
];
|
|
250
|
+
if (opts.noCache) {
|
|
251
|
+
args.push("--no-cache");
|
|
252
|
+
}
|
|
253
|
+
args.push(opts.name);
|
|
254
|
+
return args;
|
|
255
|
+
}
|
|
256
|
+
async function runE2BCommand(args, env) {
|
|
257
|
+
const child = Bun.spawn(["e2b", ...args], {
|
|
258
|
+
env: { ...process.env, ...env },
|
|
259
|
+
stdout: "pipe",
|
|
260
|
+
stderr: "pipe"
|
|
261
|
+
});
|
|
262
|
+
const [stdout, stderr, exitCode] = await Promise.all([
|
|
263
|
+
new Response(child.stdout).text(),
|
|
264
|
+
new Response(child.stderr).text(),
|
|
265
|
+
child.exited
|
|
266
|
+
]);
|
|
267
|
+
return { stdout: redactWithEnv(stdout, env), stderr: redactWithEnv(stderr, env), exitCode };
|
|
268
|
+
}
|
|
269
|
+
async function buildTemplate(opts) {
|
|
270
|
+
const args = buildTemplateArgs(opts);
|
|
271
|
+
if (opts.dryRun) {
|
|
272
|
+
return { exitCode: 0, stdout: `e2b ${args.join(" ")}
|
|
273
|
+
`, stderr: "" };
|
|
274
|
+
}
|
|
275
|
+
return runE2BCommand(args, opts.e2bEnv);
|
|
276
|
+
}
|
|
277
|
+
async function buildImageTemplate(opts) {
|
|
278
|
+
if (opts.dryRun) {
|
|
279
|
+
return {
|
|
280
|
+
exitCode: 0,
|
|
281
|
+
stdout: [
|
|
282
|
+
`e2b-sdk template build --from-image ${opts.image}`,
|
|
283
|
+
` --name ${opts.name}`,
|
|
284
|
+
` --start-cmd "sleep infinity"`,
|
|
285
|
+
` --ready-cmd "sleep 0"`,
|
|
286
|
+
` --cpu-count ${opts.cpuCount}`,
|
|
287
|
+
` --memory-mb ${opts.memoryMb}`,
|
|
288
|
+
opts.noCache ? ` --no-cache` : ""
|
|
289
|
+
].filter(Boolean).join(`
|
|
290
|
+
`).concat(`
|
|
291
|
+
`),
|
|
292
|
+
stderr: ""
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const apiKey = opts.e2bEnv.E2B_API_KEY;
|
|
296
|
+
if (!apiKey) {
|
|
297
|
+
throw new Error("Missing E2B_API_KEY");
|
|
298
|
+
}
|
|
299
|
+
const { Template } = await import("./index-etdrp7yp.js").then((m)=>__toESM(m.default,1));
|
|
300
|
+
const template = Template().fromImage(opts.image).setStartCmd("sleep infinity", "sleep 0");
|
|
301
|
+
const buildInfo = await Template.build(template, opts.name, {
|
|
302
|
+
...e2bSdkConnectionOptions(apiKey, opts.e2bEnv),
|
|
303
|
+
cpuCount: opts.cpuCount,
|
|
304
|
+
memoryMB: opts.memoryMb,
|
|
305
|
+
skipCache: opts.noCache,
|
|
306
|
+
signal: opts.signal
|
|
307
|
+
});
|
|
308
|
+
return {
|
|
309
|
+
exitCode: 0,
|
|
310
|
+
stdout: `Built E2B ${opts.role} template ${buildInfo.name} (${buildInfo.templateId}, build ${buildInfo.buildId})
|
|
311
|
+
`,
|
|
312
|
+
stderr: ""
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
async function deleteTemplate(opts) {
|
|
316
|
+
const args = ["template", "delete", opts.name, "-y"];
|
|
317
|
+
if (opts.dryRun) {
|
|
318
|
+
return { exitCode: 0, stdout: `e2b ${args.join(" ")}
|
|
319
|
+
`, stderr: "" };
|
|
320
|
+
}
|
|
321
|
+
return runE2BCommand(args, opts.e2bEnv);
|
|
322
|
+
}
|
|
323
|
+
async function setTemplateVisibility(opts) {
|
|
324
|
+
const path = `/v2/templates/${encodeURIComponent(opts.name)}`;
|
|
325
|
+
if (opts.dryRun) {
|
|
326
|
+
return {
|
|
327
|
+
exitCode: 0,
|
|
328
|
+
stdout: `PATCH ${path} {"public":${opts.public}}
|
|
329
|
+
`,
|
|
330
|
+
stderr: ""
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const apiKey = opts.e2bEnv.E2B_API_KEY;
|
|
334
|
+
if (!apiKey) {
|
|
335
|
+
throw new Error("Missing E2B_API_KEY");
|
|
336
|
+
}
|
|
337
|
+
const result = await e2bFetchJson(path, apiKey, {
|
|
338
|
+
method: "PATCH",
|
|
339
|
+
body: JSON.stringify({ public: opts.public })
|
|
340
|
+
}, opts.e2bEnv.E2B_API_URL || DEFAULT_E2B_API_BASE);
|
|
341
|
+
const names = result.names.length > 0 ? ` (${result.names.join(", ")})` : "";
|
|
342
|
+
const visibility = opts.public ? "public" : "private";
|
|
343
|
+
return {
|
|
344
|
+
exitCode: 0,
|
|
345
|
+
stdout: `Set E2B template ${opts.name} visibility to ${visibility}${names}
|
|
346
|
+
`,
|
|
347
|
+
stderr: ""
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
var E2BApiError;
|
|
351
|
+
var init_dispatch = __esm(() => {
|
|
352
|
+
init_env();
|
|
353
|
+
E2BApiError = class E2BApiError extends Error {
|
|
354
|
+
statusCode;
|
|
355
|
+
constructor(statusCode, message) {
|
|
356
|
+
super(message);
|
|
357
|
+
this.statusCode = statusCode;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
export { e2bSdkConnectionOptions, sandboxPortUrl, E2BApiError, createSandbox, ttlRemaining, setSandboxTimeout, killSandbox, listSandboxes, startDetachedProcess, streamSandboxLog, waitForAgentRegistration, waitForHttpOk, buildTemplate, buildImageTemplate, deleteTemplate, setTemplateVisibility, init_dispatch };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
seedPricingFromModelsDev
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-xy6sgy6p.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureRbacSeedsSynced,
|
|
6
6
|
init_rbac_roles
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-hrbedqp0.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db1 as init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-amvnn9wz.js";
|
|
12
12
|
|
|
13
13
|
// src/be/boot-seeds.ts
|
|
14
14
|
init_db();
|