@desplega.ai/agent-swarm 2.7.4 → 2.7.6
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 +1 -1
- package/dist/acp-adapter-bp91d37f.js +15 -0
- package/dist/{actions-gfrr9vb7.js → actions-yj0eeaqh.js} +19 -18
- package/dist/{amp-adapter-0s58gm46.js → amp-adapter-4pg9h34q.js} +3 -3
- package/dist/{app-stvq692g.js → app-909e97cr.js} +3 -3
- package/dist/{assistant-5s37fr9n.js → assistant-qdyb5fyy.js} +32 -23
- package/dist/{boot-reembed-yzy1841n.js → boot-reembed-fk0s9z18.js} +1 -1
- package/dist/{boot-reembed-cv82gz7y.js → boot-reembed-gs1rzrnh.js} +1 -1
- package/dist/{boot-scrub-sweep-8k4q95ap.js → boot-scrub-sweep-4qfd4kfx.js} +4 -4
- package/dist/{boot-seeds-ftt9htah.js → boot-seeds-yr00k13d.js} +4 -4
- package/dist/{boxd-515v1t8z.js → boxd-vdmfssd9.js} +5 -5
- package/dist/{claude-adapter-t00wrzeh.js → claude-adapter-qta1f1xn.js} +7 -7
- package/dist/{claude-managed-adapter-g6vmjccb.js → claude-managed-adapter-dvs2xw5n.js} +2 -2
- package/dist/{claude-managed-setup-afpa82f7.js → claude-managed-setup-sc6j4dm0.js} +3 -3
- package/dist/{claude-sdk-session-vj0c2azx.js → claude-sdk-session-zgrz6yvc.js} +9175 -9076
- package/dist/{cli-gjr2y2xk.js → cli-0agcv1v5.js} +4 -1
- package/dist/{cli-edmm9d9y.js → cli-0at8w34w.js} +7 -7
- package/dist/{cli-a81qevyg.js → cli-0qatpy8q.js} +20 -36
- package/dist/{cli-bcz074zx.js → cli-0yv5z2pg.js} +1 -1
- package/dist/{cli-a4btqqft.js → cli-1b7btd38.js} +1 -1
- package/dist/{cli-a2jw6ee5.js → cli-1p89xny0.js} +1 -1
- package/dist/{cli-v726afdm.js → cli-2pnswgh8.js} +1 -1
- package/dist/{cli-jkt52mgt.js → cli-386tyxxg.js} +2 -2
- package/dist/{cli-az0bpf8p.js → cli-3ypk9vk1.js} +3 -3
- package/dist/{cli-wk9md5px.js → cli-436532ck.js} +4 -4
- package/dist/{cli-7n5sbw0z.js → cli-4necwtsv.js} +5 -5
- package/dist/cli-54t00gt8.js +151 -0
- package/dist/{cli-655xm9ms.js → cli-583frbyr.js} +1 -1
- package/dist/{cli-4r12t6w6.js → cli-5c4hjzne.js} +101 -4
- package/dist/{cli-hf6zt5m6.js → cli-69szn7w7.js} +17 -1
- package/dist/{cli-rtk9g7av.js → cli-73jzwksr.js} +6 -2
- package/dist/{cli-jg0nfda6.js → cli-75gkpjvw.js} +52 -21
- package/dist/{cli-wcmnan2g.js → cli-89knwags.js} +5 -5
- package/dist/{cli-pwyevs29.js → cli-8bc1w0tw.js} +22 -21
- package/dist/{cli-t282jgab.js → cli-8snvgs5r.js} +41 -16
- package/dist/{cli-vqgnyh76.js → cli-98rw5dt5.js} +15 -3
- package/dist/{cli-9cctx1tn.js → cli-a22h291q.js} +1 -1
- package/dist/{cli-ycm6180s.js → cli-a7v854rf.js} +5 -3
- package/dist/{cli-98pke4vk.js → cli-ae7mrdf9.js} +2 -2
- package/dist/{cli-je8yeyc5.js → cli-bjb3z51z.js} +5 -5
- package/dist/{cli-mc97xy2s.js → cli-c60vetmm.js} +16 -4
- package/dist/{cli-j4kw3rsx.js → cli-cm5yqn35.js} +18 -0
- package/dist/{cli-wndv9p7g.js → cli-decfb6v8.js} +6 -6
- package/dist/{cli-h55y2bjc.js → cli-dhar9qay.js} +2 -2
- package/dist/{cli-8yy525ad.js → cli-drr5v6av.js} +2 -2
- package/dist/{cli-5gr1g711.js → cli-dxae2yg7.js} +2 -2
- package/dist/{cli-pe09p6dv.js → cli-e3r2neck.js} +8 -7
- package/dist/{cli-13jvmew3.js → cli-ekwks2vs.js} +7 -7
- package/dist/{cli-jg4p5t36.js → cli-es6va8jk.js} +121 -51
- package/dist/{cli-j4kt1mpb.js → cli-faxe6thg.js} +3 -3
- package/dist/{cli-tzrpv5sc.js → cli-ftyxyspd.js} +1 -1
- package/dist/cli-fw2w0kva.js +47 -0
- package/dist/{cli-2dfbv8qr.js → cli-fy6x31ps.js} +1 -0
- package/dist/{cli-aq58fk5m.js → cli-g83s9ewh.js} +7 -1
- package/dist/cli-gdhpcbhf.js +55 -0
- package/dist/{cli-82jg7fp9.js → cli-he5nxaa8.js} +1 -1
- package/dist/{cli-8veytvbh.js → cli-he9wchme.js} +1 -1
- package/dist/{cli-k76tgq03.js → cli-hgaazk69.js} +2 -2
- package/dist/{cli-d2pzqej1.js → cli-hr2e2fft.js} +741 -7
- package/dist/{cli-dae4sbgy.js → cli-jm2vfpfd.js} +2 -2
- package/dist/{cli-1s1dqn1j.js → cli-k2gzwsj2.js} +297 -140
- package/dist/{cli-b1afgtj3.js → cli-kqdg1bsb.js} +3 -3
- package/dist/cli-m2z8jagn.js +12078 -0
- package/dist/{cli-mvckssyq.js → cli-m48g6p95.js} +5 -5
- package/dist/{cli-bwty35gx.js → cli-mthwvjre.js} +1 -1
- package/dist/{cli-41z8xwj0.js → cli-nhrvpaj7.js} +34 -8
- package/dist/{cli-ahd90bwt.js → cli-nwj0ee2w.js} +6 -6
- package/dist/{cli-kvtc7aez.js → cli-p5gp8pcx.js} +44 -14
- package/dist/{cli-avgcz4ra.js → cli-pd7vagab.js} +436 -171
- package/dist/{cli-zn15c46z.js → cli-q0k1w5zd.js} +1 -1
- package/dist/{cli-bq2pcphn.js → cli-rmmmrjkd.js} +1 -1
- package/dist/{cli-2qpvmmkw.js → cli-s0qnd4wv.js} +1 -1
- package/dist/{cli-kg8hchyg.js → cli-sa02jsqt.js} +1 -1
- package/dist/{cli-1yekbyqm.js → cli-shpbx5ee.js} +283 -82
- package/dist/{cli-9y354g3j.js → cli-srye3vdt.js} +1 -1
- package/dist/{cli-byqfbnjw.js → cli-svj5090z.js} +9 -9
- package/dist/{cli-gcbdjt47.js → cli-vfym7wmz.js} +6 -6
- package/dist/{cli-v1yw3wha.js → cli-vvpx3gsx.js} +4 -4
- package/dist/{cli-a1fhj4n9.js → cli-w6dt9ged.js} +2 -2
- package/dist/{cli-1gm8jcyr.js → cli-waqbxg08.js} +5232 -68
- package/dist/{cli-5hjced2v.js → cli-wp9sp1qb.js} +6 -6
- package/dist/{cli-eny54typ.js → cli-wx3rhnm0.js} +1 -1
- package/dist/{cli-s0exq74r.js → cli-xbbndvjy.js} +3 -3
- package/dist/{cli-f255yaqn.js → cli-xds5f77d.js} +3 -3
- package/dist/{cli-0sbkss7h.js → cli-xnqgpshy.js} +2 -2
- package/dist/{cli-0fgr1w9b.js → cli-xnrwazav.js} +20 -3
- package/dist/{cli-gf5hbmdr.js → cli-yjdgea32.js} +3 -3
- package/dist/{cli-cq1pf336.js → cli-yn4kxs06.js} +124 -11
- package/dist/{cli-224epwwf.js → cli-yx4kfngt.js} +3 -3
- package/dist/{cli-eqx6k993.js → cli-yy3rhsdw.js} +47 -13
- package/dist/{cli-36g23z21.js → cli-zbbwez0r.js} +4 -4
- package/dist/{cli-ktmvb20s.js → cli-zm72anhg.js} +12 -12
- package/dist/cli.js +26 -25
- package/dist/{codex-adapter-g0gctw29.js → codex-adapter-ayd1fb6h.js} +5 -5
- package/dist/{codex-hook-vrzz2xhr.js → codex-hook-9efm2x1m.js} +1 -1
- package/dist/{codex-login-0gg46ygn.js → codex-login-y0pmff1c.js} +1 -1
- package/dist/{codex-session-runner-dr2cxe1c.js → codex-session-runner-jesa32xc.js} +6 -6
- package/dist/{commands-1p07cvff.js → commands-hanewgf2.js} +9 -3
- package/dist/{controller-z0s7sv6r.js → controller-dt1n3c1q.js} +9 -4
- package/dist/{controllers-connect-x9kvvhyk.js → controllers-connect-xx8x64n5.js} +22 -21
- package/dist/{cursor-adapter-m5b98pvk.js → cursor-adapter-9s4dwwdw.js} +2 -2
- package/dist/{db-capk2raj.js → db-3vttcbv4.js} +3 -3
- package/dist/{db-rsh04kh3.js → db-9dv0g1ab.js} +12 -4
- package/dist/{devin-adapter-yxm87fe9.js → devin-adapter-r9phbnc9.js} +1 -1
- package/dist/{devtools-82fzqra8.js → devtools-qxfgbsqz.js} +1 -1
- package/dist/{dispatcher-304q6fwa.js → dispatcher-tx9hd1sv.js} +18 -17
- package/dist/{docker-7rxt0rry.js → docker-c1a3gqmf.js} +91 -24
- package/dist/{dsh-adapter-btewem0y.js → dsh-adapter-007y4ejs.js} +2 -2
- package/dist/{e2b-renc0k8q.js → e2b-a19d28rz.js} +4 -4
- package/dist/{e2b-7fc9b9bd.js → e2b-we6hs6q5.js} +6 -6
- package/dist/{easter-egg-3d-fm1p3n4d.js → easter-egg-3d-rgbrqb8s.js} +1 -1
- package/dist/{embedding-space-s68v49ct.js → embedding-space-ny1e2940.js} +6 -6
- package/dist/{embeddings-4ms3604w.js → embeddings-2t386t13.js} +1 -1
- package/dist/{event-bus-dfjx2qdh.js → event-bus-g0ka3pbw.js} +1 -1
- package/dist/{execute-mcdgccjs.js → execute-pksh0ceh.js} +1 -1
- package/dist/{external-channel-9dxwfztn.js → external-channel-phgmhmd7.js} +2 -2
- package/dist/fx-adapter-fy8rr921.js +18 -0
- package/dist/{google-generative-ai-yvmdxyxa.js → google-generative-ai-8y3m3k4b.js} +1 -1
- package/dist/{google-vertex-jrtdh9gs.js → google-vertex-w3v98n7b.js} +1 -1
- package/dist/{grok-adapter-05ecv4h0.js → grok-adapter-q0abvpaj.js} +8 -8
- package/dist/handlers-by3sfxyx.js +32 -0
- package/dist/{heartbeat-3n94heh3.js → heartbeat-kadyek8p.js} +21 -20
- package/dist/{hook-aadrn69x.js → hook-5zs3msf6.js} +6 -6
- package/dist/{hook-zxwje86c.js → hook-9k551xnj.js} +4 -4
- package/dist/{http-xzxk9mst.js → http-mhz9vw1f.js} +272 -103
- package/dist/index-4f2pvxae.js +37 -0
- package/dist/index-98gz7tmp.js +30 -0
- package/dist/{index-5rk6rfzr.js → index-fvzke5kx.js} +1 -1
- package/dist/index-k08z2cak.js +33 -0
- package/dist/{index-yqhz88yy.js → index-pxn30mse.js} +8 -8
- package/dist/{index-d34f6r87.js → index-q361cg2f.js} +1 -1
- package/dist/{index-9j4zwcht.js → index-rvr00sg7.js} +168 -675
- package/dist/{index-qeb82z37.js → index-vdygbq10.js} +1 -1
- package/dist/{keepalive-w4aakbyk.js → keepalive-w56f32cg.js} +4 -4
- package/dist/lead-enq35nqp.js +70 -0
- package/dist/{maintenance-hbptpk6p.js → maintenance-7mdgxcea.js} +1 -1
- package/dist/{oauth-refresh-sweep-217semrv.js → oauth-refresh-sweep-29txy9vk.js} +3 -3
- package/dist/{onboard-vz2s5df3.js → onboard-kpsrkarj.js} +5 -5
- package/dist/{opencode-adapter-gtfd7d7v.js → opencode-adapter-j25vm3rr.js} +5 -5
- package/dist/{otel-impl-aefave37.js → otel-impl-6kkct7a8.js} +2 -2
- package/dist/{pi-mono-adapter-f8h5yseh.js → pi-mono-adapter-exhkzhn2.js} +117 -23
- package/dist/{pricing-refresh-m1yhh9ya.js → pricing-refresh-n2x7jh6k.js} +3 -3
- package/dist/{rbac-roles-rrw8twdz.js → rbac-roles-81ypx6es.js} +1 -1
- package/dist/{rbac-roles-svj72cdf.js → rbac-roles-b5htkjby.js} +2 -2
- package/dist/{render-v2-amwbnfxh.js → render-v2-qn6jmpk4.js} +3 -3
- package/dist/{resume-9cd6wf6z.js → resume-wd30wx23.js} +7 -7
- package/dist/{runtime-fp4vrx7m.js → runtime-4hsg7h60.js} +1 -1
- package/dist/{session-access-21t6yjyg.js → session-access-5qvfevhk.js} +4 -4
- package/dist/{session-source-backfill-pxbzcsc6.js → session-source-backfill-n1czavbr.js} +3 -3
- package/dist/{setup-4592tqz4.js → setup-dnb56qy5.js} +3 -3
- package/dist/{virtual-modules-gzfnpmnz.js → virtual-modules-76xxv9fs.js} +2 -2
- package/dist/{work-objects-t9tcf174.js → work-objects-4n21tfkm.js} +21 -20
- package/dist/{worker-follow-up-q32jh4yk.js → worker-follow-up-77hvzxww.js} +18 -17
- package/dist/worker-gg1576j3.js +70 -0
- package/dist/{x-b6wxntdt.js → x-vmmye1kb.js} +2 -2
- package/openapi.json +189 -32
- package/package.json +8 -7
- package/src/be/db/script-runs.ts +23 -0
- package/src/be/db/session-summaries.ts +8 -2
- package/src/be/db/session-tree.ts +174 -61
- package/src/be/db/session-visibility.ts +5 -4
- package/src/be/db/tasks/read.ts +122 -3
- package/src/be/db-client.ts +8 -5
- package/src/be/db.ts +23 -8
- package/src/be/memory/providers/sqlite-store.ts +49 -12
- package/src/be/migrations/259_session_summaries_open_tasks.sql +111 -0
- package/src/be/migrations/260_runtime_pool_cache.sql +20 -0
- package/src/be/migrations/262_session_visibility_indexes.sql +18 -0
- package/src/be/migrations/263_task_list_filter_index.sql +11 -0
- package/src/be/migrations/264_slack_thread_cover_index.sql +9 -0
- package/src/be/migrations/266_script_runs_source_task.sql +11 -0
- package/src/be/model-validation.ts +5 -1
- package/src/be/pricing-normalize.ts +7 -2
- package/src/be/runtime-pools/cache-cleanup.ts +109 -0
- package/src/be/runtime-pools/db.ts +65 -6
- package/src/be/runtime-pools/remote-controller.ts +5 -0
- package/src/be/runtime-pools/supervisor.ts +33 -2
- package/src/be/scripts/typecheck.ts +23 -0
- package/src/be/seed/schedules-seeder.ts +135 -9
- package/src/be/seed/workflows-seeder.ts +65 -1
- package/src/be/seed-pricing.ts +23 -0
- package/src/be/seed-scripts/catalog/task-failure-audit.ts +5 -1
- package/src/be/steering.ts +50 -3
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/controller.ts +4 -0
- package/src/commands/entrypoint-api-readiness.ts +74 -0
- package/src/commands/provider-credentials.ts +29 -2
- package/src/commands/runner.ts +86 -5
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/contract.ts +27 -1
- package/src/extensions/dispatcher.ts +4 -0
- package/src/http/agents.ts +1 -0
- package/src/http/index.ts +1 -1
- package/src/http/list-total-cache.ts +14 -7
- package/src/http/mcp-bridge.ts +4 -0
- package/src/http/memory.ts +38 -9
- package/src/http/script-runs.ts +174 -5
- package/src/http/status.ts +10 -2
- package/src/http/tasks.ts +4 -2
- package/src/integrations/chat-sdk/inbound.ts +15 -5
- package/src/integrations/chat-sdk/steering.ts +3 -1
- package/src/kv-reserved-namespaces.ts +2 -0
- package/src/prompts/base-prompt.ts +4 -1
- package/src/prompts/session-templates.ts +26 -0
- package/src/providers/acp-adapter.ts +190 -26
- package/src/providers/acp-targets.ts +306 -6
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +9 -44
- package/src/providers/codex-oauth/flow.ts +24 -3
- package/src/providers/codex-oauth/storage.ts +56 -17
- package/src/providers/codex-oauth/subscription.ts +67 -0
- package/src/providers/fx-adapter.ts +211 -0
- package/src/providers/index.ts +5 -1
- package/src/providers/mcp-loopback-proxy.ts +94 -0
- package/src/providers/pi-mono-adapter.ts +98 -13
- package/src/providers/pricing-sources.md +8 -0
- package/src/providers/reasoning-effort.ts +17 -1
- package/src/providers/types.ts +2 -1
- package/src/runtime-providers/controller-protocol.ts +14 -1
- package/src/runtime-providers/controller.ts +5 -0
- package/src/runtime-providers/docker.ts +108 -23
- package/src/runtime-providers/types.ts +16 -0
- package/src/scheduler/scheduler.ts +36 -3
- package/src/script-workflows/workflow-ctx.ts +8 -0
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/types/stdlib.d.ts +27 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +33 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +27 -0
- package/src/server-user.ts +1 -0
- package/src/server.ts +7 -0
- package/src/slack/assistant.ts +17 -1
- package/src/slack/commands.ts +5 -1
- package/src/slack/handlers.ts +53 -5
- package/src/slack/left-threads.ts +88 -0
- package/src/slack/steering.ts +3 -0
- package/src/slack/thread-buffer.ts +40 -16
- package/src/tasks/follow-up-redelegation-guard.ts +155 -0
- package/src/tests/acp-adapter.test.ts +79 -0
- package/src/tests/base-prompt.test.ts +12 -0
- package/src/tests/chat-sdk-inbound.test.ts +30 -0
- package/src/tests/chatgpt-subscription-model-groups.test.ts +62 -0
- package/src/tests/chatgpt-subscription-pi.test.ts +170 -0
- package/src/tests/chatgpt-subscription-session-bench.test.ts +198 -0
- package/src/tests/claude-artifacts-read-script.test.ts +209 -0
- package/src/tests/codex-oauth-credential-info.test.ts +40 -0
- package/src/tests/codex-oauth-refresh-egress.test.ts +194 -0
- package/src/tests/context-window.test.ts +7 -0
- package/src/tests/db-client.test.ts +21 -0
- package/src/tests/db-task-read-contract.test.ts +8 -2
- package/src/tests/db-task-write-contract.test.ts +5 -1
- package/src/tests/entrypoint-api-readiness.test.ts +416 -210
- package/src/tests/explicit-model-validation.test.ts +113 -8
- package/src/tests/extensions-run-context.test.ts +11 -0
- package/src/tests/extensions-steering.test.ts +353 -0
- package/src/tests/extensions-validate.test.ts +5 -0
- package/src/tests/fixtures/extensions/steering-policy/hooks.ts +39 -0
- package/src/tests/fixtures/extensions/steering-policy/manifest.json +7 -0
- package/src/tests/fixtures/fake-fx.ts +167 -0
- package/src/tests/fixtures/fx/acp-responses-recorded.json +157 -0
- package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +15 -0
- package/src/tests/follow-up-redelivery-guard.test.ts +432 -202
- package/src/tests/fx-adapter.test.ts +771 -0
- package/src/tests/grok-adapter.test.ts +36 -0
- package/src/tests/list-total-cache.test.ts +27 -2
- package/src/tests/mcp-loopback-proxy.test.ts +193 -0
- package/src/tests/memory-fts-populate.test.ts +11 -9
- package/src/tests/memory-retrieval-purge.test.ts +80 -0
- package/src/tests/migration-260-runtime-pool-cache.test.ts +118 -0
- package/src/tests/model-tier-resolution.test.ts +3 -3
- package/src/tests/pricing-refresh.test.ts +5 -5
- package/src/tests/prompt-template-session.test.ts +5 -3
- package/src/tests/provider-registration.test.ts +2 -1
- package/src/tests/query-audit-plans.test.ts +30 -2
- package/src/tests/runtime-cache-cleanup.test.ts +367 -0
- package/src/tests/runtime-e2b-pools.test.ts +41 -0
- package/src/tests/runtime-pools-db.test.ts +98 -0
- package/src/tests/runtime-pools-http.test.ts +29 -0
- package/src/tests/runtime-providers-docker.test.ts +253 -0
- package/src/tests/runtime-remote-controller.test.ts +66 -2
- package/src/tests/runtime-supervisor.test.ts +66 -2
- package/src/tests/script-connections.test.ts +13 -0
- package/src/tests/script-runs-http.test.ts +684 -2
- package/src/tests/seed-model-profiles.test.ts +2 -2
- package/src/tests/seed-schedules.test.ts +138 -0
- package/src/tests/seed-scripts.test.ts +26 -0
- package/src/tests/session-cost-recompute-unit.test.ts +39 -0
- package/src/tests/session-costs-golden.test.ts +26 -0
- package/src/tests/session-summaries-plans.test.ts +120 -0
- package/src/tests/session-summaries.test.ts +72 -12
- package/src/tests/sessions-tree.test.ts +11 -3
- package/src/tests/slack-leave-thread.test.ts +571 -0
- package/src/tests/slack-render-v2-query-plans.test.ts +24 -2
- package/src/tests/status.test.ts +11 -0
- package/src/tests/tasks-readable-row.test.ts +155 -0
- package/src/tests/tool-annotations.test.ts +2 -1
- package/src/tests/workflow-engine-v2.test.ts +42 -0
- package/src/tests/workflow-script-principal.test.ts +207 -7
- package/src/tools/send-task.ts +35 -47
- package/src/tools/slack-leave-thread.ts +104 -0
- package/src/tools/steer-task.ts +3 -2
- package/src/tools/task-dedup.ts +45 -21
- package/src/tools/tool-config.ts +2 -1
- package/src/types.ts +57 -0
- package/src/utils/codex-auth-failure.ts +30 -0
- package/src/utils/context-window.ts +4 -1
- package/src/utils/credentials.ts +7 -0
- package/src/utils/fx-models.ts +43 -0
- package/src/workflows/cooldown.ts +3 -2
- package/src/workflows/engine.ts +24 -9
- package/templates/schedules/dreaming-daily/config.json +1 -1
- package/templates/schedules/dreaming-daily/content.md +6 -14
- package/templates/skills/composio-google-docs/content.md +10 -0
- package/templates/skills/script-workflows/content.md +19 -1
- package/templates/skills/swarm-docs/content.md +2 -0
- package/templates/skills/swarm-scripts/SKILL.md +2 -0
- package/templates/skills/swarm-scripts/content.md +2 -0
- package/templates/workflows/dreaming/content.md +5 -1
- package/dist/acp-adapter-96dc64m2.js +0 -15
- package/dist/cli-dznrgaep.js +0 -30
- package/dist/cli-w3hcrxht.js +0 -6985
- package/dist/handlers-jg7v74ty.js +0 -31
- package/dist/index-8c1zbz59.js +0 -29
- package/dist/index-8k8tmfxd.js +0 -32
- package/dist/index-hq617xdj.js +0 -36
- package/dist/lead-567kw7x3.js +0 -68
- package/dist/worker-fjdqra6q.js +0 -68
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./cli-jc1g9ndz.js";
|
|
4
4
|
import {
|
|
5
5
|
applyReasoningEffort
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-98rw5dt5.js";
|
|
7
7
|
import {
|
|
8
8
|
getContextWindowSize,
|
|
9
9
|
clampContextPercent,
|
|
10
10
|
init_context_window
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-73jzwksr.js";
|
|
12
12
|
import {
|
|
13
13
|
swarmRuntimeInstanceId,
|
|
14
14
|
init_multi_runtime2
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
DEFAULT_MODEL_TIER_MAP,
|
|
18
18
|
init_types4
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-nhrvpaj7.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveTemplateFromCode,
|
|
22
22
|
resolveTemplateAsync,
|
|
23
23
|
init_resolver,
|
|
24
24
|
init_session_templates
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-cm5yqn35.js";
|
|
26
26
|
import {
|
|
27
27
|
parseEnvFlag,
|
|
28
28
|
init_env_flag
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
scrubSecrets,
|
|
32
32
|
registerVolatileSecret,
|
|
33
33
|
init_secret_scrubber
|
|
34
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-1b7btd38.js";
|
|
35
35
|
import {
|
|
36
36
|
cursorCatalogRef,
|
|
37
37
|
init_src2
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-5c4hjzne.js";
|
|
39
39
|
|
|
40
40
|
// src/providers/cursor-adapter.ts
|
|
41
41
|
init_src2();
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
getKv2,
|
|
3
3
|
upsertKv2,
|
|
4
4
|
init_db4
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-k2gzwsj2.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveIdentity,
|
|
8
8
|
init_identity,
|
|
9
9
|
recordUnmappedIdentity,
|
|
10
10
|
init_unmapped_identities
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-shpbx5ee.js";
|
|
12
12
|
import {
|
|
13
13
|
findUserByExternalId,
|
|
14
14
|
findOrCreateUserByEmail,
|
|
15
15
|
linkIdentity,
|
|
16
16
|
init_users
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-drr5v6av.js";
|
|
18
18
|
import {
|
|
19
19
|
__esm
|
|
20
20
|
} from "./cli-242037k3.js";
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
getResolvedConfig2,
|
|
7
7
|
getAllUsers2,
|
|
8
8
|
init_db4
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-k2gzwsj2.js";
|
|
10
10
|
import {
|
|
11
11
|
getUserGrant2,
|
|
12
12
|
init_rbac_roles
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-rmmmrjkd.js";
|
|
14
14
|
import {
|
|
15
15
|
scrubSecrets,
|
|
16
16
|
init_secret_scrubber
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-1b7btd38.js";
|
|
18
18
|
|
|
19
19
|
// src/be/seed/agent-fs-provision.ts
|
|
20
20
|
init_secret_scrubber();
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
acquireOAuthRefreshLock,
|
|
10
10
|
releaseOAuthRefreshLock,
|
|
11
11
|
init_oauth
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-k2gzwsj2.js";
|
|
13
13
|
import {
|
|
14
14
|
generateRandomCodeVerifier,
|
|
15
15
|
generateRandomState,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
scrubSecrets,
|
|
21
21
|
registerVolatileSecret,
|
|
22
22
|
init_secret_scrubber
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-1b7btd38.js";
|
|
24
24
|
import {
|
|
25
25
|
__esm
|
|
26
26
|
} from "./cli-242037k3.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RuntimeProviderKindSchema,
|
|
3
|
+
RuntimePoolCacheSchema,
|
|
3
4
|
init_types4
|
|
4
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-nhrvpaj7.js";
|
|
5
6
|
import {
|
|
6
7
|
init_zod
|
|
7
8
|
} from "./cli-k5671be5.js";
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
import {
|
|
22
23
|
scrubSecrets,
|
|
23
24
|
init_secret_scrubber
|
|
24
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-1b7btd38.js";
|
|
25
26
|
|
|
26
27
|
// src/runtime-providers/controller.ts
|
|
27
28
|
init_secret_scrubber();
|
|
@@ -44,6 +45,7 @@ class BuiltinController {
|
|
|
44
45
|
renew;
|
|
45
46
|
pause;
|
|
46
47
|
resume;
|
|
48
|
+
releaseCache;
|
|
47
49
|
constructor(id, provider, target, workerApiUrl) {
|
|
48
50
|
this.id = id;
|
|
49
51
|
this.provider = provider;
|
|
@@ -52,6 +54,8 @@ class BuiltinController {
|
|
|
52
54
|
this.workerApiUrl = workerApiUrl;
|
|
53
55
|
if (provider.renew)
|
|
54
56
|
this.renew = (handle, ttlSec) => this.call(() => provider.renew(target, handle, ttlSec));
|
|
57
|
+
if (provider.releaseCache)
|
|
58
|
+
this.releaseCache = (cache) => this.call(() => provider.releaseCache(target, cache));
|
|
55
59
|
if (provider.pause)
|
|
56
60
|
this.pause = (handle) => this.call(() => provider.pause(target, handle));
|
|
57
61
|
if (provider.resume)
|
|
@@ -101,6 +105,7 @@ var traitsSchema = object2({
|
|
|
101
105
|
canProvision: boolean(),
|
|
102
106
|
ephemeralDisk: boolean(),
|
|
103
107
|
supportsPause: boolean(),
|
|
108
|
+
persistentCache: boolean().optional(),
|
|
104
109
|
maxTtlSec: number2().positive().optional(),
|
|
105
110
|
maxContinuousSec: number2().positive().optional()
|
|
106
111
|
});
|
|
@@ -113,10 +118,22 @@ var provisionSchema = object2({
|
|
|
113
118
|
env: record2(string2(), string2()),
|
|
114
119
|
labels: record2(string2(), string2()),
|
|
115
120
|
resources: object2({ cpu: number2().positive().optional(), memoryMb: number2().positive().optional() }).optional(),
|
|
116
|
-
ttlSec: number2().positive().optional()
|
|
121
|
+
ttlSec: number2().positive().optional(),
|
|
122
|
+
cache: RuntimePoolCacheSchema.extend({
|
|
123
|
+
key: string2().regex(/^[a-zA-Z0-9][a-zA-Z0-9_.-]+$/)
|
|
124
|
+
}).optional()
|
|
117
125
|
});
|
|
118
126
|
var command = { type: literal2("cmd"), id: string2().min(1) };
|
|
119
127
|
var ControllerCommandSchema = discriminatedUnion("op", [
|
|
128
|
+
object2({
|
|
129
|
+
...command,
|
|
130
|
+
op: literal2("release-cache"),
|
|
131
|
+
payload: object2({
|
|
132
|
+
key: string2().regex(/^[a-zA-Z0-9][a-zA-Z0-9_.-]+$/),
|
|
133
|
+
poolId: string2().min(1),
|
|
134
|
+
ownerId: string2().min(1)
|
|
135
|
+
})
|
|
136
|
+
}),
|
|
120
137
|
object2({ ...command, op: literal2("provision"), payload: provisionSchema }),
|
|
121
138
|
object2({
|
|
122
139
|
...command,
|
|
@@ -1037,7 +1037,7 @@ var require_jsonwebtoken = __commonJS(function(exports, module) {
|
|
|
1037
1037
|
});
|
|
1038
1038
|
|
|
1039
1039
|
// node_modules/path-to-regexp/dist/index.js
|
|
1040
|
-
var
|
|
1040
|
+
var require_dist6 = __commonJS(function(exports) {
|
|
1041
1041
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1042
1042
|
exports.PathError = exports.TokenData = undefined;
|
|
1043
1043
|
exports.parse = parse;
|
|
@@ -19820,7 +19820,7 @@ var require_layer = __commonJS(function(exports, module) {
|
|
|
19820
19820
|
* MIT Licensed
|
|
19821
19821
|
*/
|
|
19822
19822
|
var isPromise = require_is_promise();
|
|
19823
|
-
var pathRegexp =
|
|
19823
|
+
var pathRegexp = require_dist6();
|
|
19824
19824
|
var debug = require_src4()("router:layer");
|
|
19825
19825
|
var deprecate = require_depd()("router");
|
|
19826
19826
|
var TRAILING_SLASH_REGEXP = /\/+$/;
|
|
@@ -23251,4 +23251,4 @@ var require_express = __commonJS(function(exports, module) {
|
|
|
23251
23251
|
exports.urlencoded = bodyParser.urlencoded;
|
|
23252
23252
|
});
|
|
23253
23253
|
|
|
23254
|
-
export { require_jsonwebtoken,
|
|
23254
|
+
export { require_jsonwebtoken, require_dist6, require_raw_body, require_content_type, require_lib, require_vary, require_express };
|
|
@@ -13,19 +13,20 @@ import {
|
|
|
13
13
|
init_swarm_config_guard,
|
|
14
14
|
registerStoredSecret,
|
|
15
15
|
init_secret_registry,
|
|
16
|
+
getSwarmConfigs2,
|
|
16
17
|
upsertSwarmConfig2,
|
|
17
18
|
init_db4
|
|
18
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-k2gzwsj2.js";
|
|
19
20
|
import {
|
|
20
21
|
createRuntimeProvider,
|
|
21
22
|
init_runtime_providers
|
|
22
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-kqdg1bsb.js";
|
|
23
24
|
import {
|
|
24
25
|
closeSessionTokenConnections,
|
|
25
26
|
init_session_token_connections,
|
|
26
27
|
insertSessionToken,
|
|
27
28
|
init_users
|
|
28
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-drr5v6av.js";
|
|
29
30
|
import {
|
|
30
31
|
RuntimeControllerCreateSchema,
|
|
31
32
|
RuntimeControllerUpdateSchema,
|
|
@@ -33,17 +34,94 @@ import {
|
|
|
33
34
|
RuntimePoolUpdateSchema,
|
|
34
35
|
RuntimePoolCreateAgentSchema,
|
|
35
36
|
init_types4
|
|
36
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-nhrvpaj7.js";
|
|
38
|
+
import {
|
|
39
|
+
poolCacheKey,
|
|
40
|
+
init_types5
|
|
41
|
+
} from "./cli-0agcv1v5.js";
|
|
37
42
|
import {
|
|
38
43
|
scrubSecrets,
|
|
39
44
|
registerVolatileSecret,
|
|
40
45
|
unregisterVolatileSecret,
|
|
41
46
|
init_secret_scrubber
|
|
42
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-1b7btd38.js";
|
|
43
48
|
import {
|
|
44
49
|
__esm
|
|
45
50
|
} from "./cli-242037k3.js";
|
|
46
51
|
|
|
52
|
+
// src/be/runtime-pools/cache-cleanup.ts
|
|
53
|
+
async function getPoolCache(poolId) {
|
|
54
|
+
const row = await getDbClient2().get("SELECT cache, json_extract(placements, '$[0]') AS controllerId FROM runtime_pools WHERE id = ?", [poolId]);
|
|
55
|
+
if (!row?.cache)
|
|
56
|
+
return null;
|
|
57
|
+
const cache = JSON.parse(row.cache);
|
|
58
|
+
return {
|
|
59
|
+
key: cache.key ?? poolCacheKey(poolId),
|
|
60
|
+
mountPath: cache.mountPath,
|
|
61
|
+
controllerId: row.controllerId
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function queuePoolCacheRelease(pool, actor) {
|
|
65
|
+
if (!pool.cache)
|
|
66
|
+
return;
|
|
67
|
+
const owner = (await getSwarmConfigs2({ scope: "global", key: "runtime_owner_id" }))[0];
|
|
68
|
+
if (!owner)
|
|
69
|
+
return;
|
|
70
|
+
const cache = await getPoolCache(pool.id);
|
|
71
|
+
const runtimes = await getDbClient2().query(`SELECT id FROM runtime_instances WHERE pool_id = ?
|
|
72
|
+
AND (controller_id = ? OR controller_id IS NULL) AND status != 'offline'`, [pool.id, pool.placements[0]]);
|
|
73
|
+
await getDbClient2().run(`INSERT INTO runtime_cache_releases
|
|
74
|
+
(id, pool_id, controller_id, owner_id, cache_key, runtime_ids, created_by, updated_by)
|
|
75
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(controller_id, owner_id, cache_key) DO NOTHING`, [
|
|
76
|
+
crypto.randomUUID(),
|
|
77
|
+
pool.id,
|
|
78
|
+
pool.placements[0],
|
|
79
|
+
owner.value,
|
|
80
|
+
cache.key,
|
|
81
|
+
JSON.stringify(runtimes.map((r) => r.id)),
|
|
82
|
+
actor,
|
|
83
|
+
actor
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
async function reconcileCacheReleases(commands, signal, now) {
|
|
87
|
+
const jobs = await getDbClient2().query(`SELECT id, pool_id AS poolId, controller_id AS controllerId, owner_id AS ownerId,
|
|
88
|
+
cache_key AS key FROM runtime_cache_releases ORDER BY created_at`);
|
|
89
|
+
for (const job of jobs) {
|
|
90
|
+
if (signal.aborted)
|
|
91
|
+
return;
|
|
92
|
+
const claimed = now ?? new Date;
|
|
93
|
+
const claimedAt = claimed.toISOString();
|
|
94
|
+
const reserved = await getDbClient2().run(`UPDATE runtime_cache_releases SET state = 'deleting', updated_at = ?
|
|
95
|
+
WHERE id = ? AND (state = 'pending' OR updated_at < ?) AND NOT EXISTS (
|
|
96
|
+
SELECT 1 FROM runtime_instances WHERE status != 'offline'
|
|
97
|
+
AND id IN (SELECT value FROM json_each(runtime_cache_releases.runtime_ids))
|
|
98
|
+
)`, [claimedAt, job.id, new Date(claimed.getTime() - RELEASE_LEASE_MS).toISOString()]);
|
|
99
|
+
if (!reserved.changes)
|
|
100
|
+
continue;
|
|
101
|
+
try {
|
|
102
|
+
signal.throwIfAborted();
|
|
103
|
+
const controller = await commands(job.controllerId);
|
|
104
|
+
if (!controller.releaseCache)
|
|
105
|
+
throw new Error("Controller cannot release caches; upgrade it before cleanup");
|
|
106
|
+
await controller.releaseCache({ key: job.key, poolId: job.poolId, ownerId: job.ownerId });
|
|
107
|
+
await getDbClient2().run("DELETE FROM runtime_cache_releases WHERE id = ? AND state = 'deleting' AND updated_at = ?", [job.id, claimedAt]);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
const message = scrubSecrets(String(error));
|
|
110
|
+
await getDbClient2().run(`UPDATE runtime_cache_releases SET state = 'pending', last_error = ?, updated_at = ?
|
|
111
|
+
WHERE id = ? AND state = 'deleting' AND updated_at = ?`, [message, new Date().toISOString(), job.id, claimedAt]);
|
|
112
|
+
if (!signal.aborted)
|
|
113
|
+
console.error("[runtime-pools] Cache cleanup deferred:", message);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
var RELEASE_LEASE_MS;
|
|
118
|
+
var init_cache_cleanup = __esm(() => {
|
|
119
|
+
init_types5();
|
|
120
|
+
init_secret_scrubber();
|
|
121
|
+
init_db4();
|
|
122
|
+
RELEASE_LEASE_MS = 5 * 60000;
|
|
123
|
+
});
|
|
124
|
+
|
|
47
125
|
// src/be/runtime-pools/errors.ts
|
|
48
126
|
var RuntimePoolError2;
|
|
49
127
|
var init_errors = __esm(() => {
|
|
@@ -114,11 +192,13 @@ function rowToController(row) {
|
|
|
114
192
|
};
|
|
115
193
|
}
|
|
116
194
|
function rowToPool(row) {
|
|
195
|
+
const cache = row.cache ? JSON.parse(row.cache) : null;
|
|
117
196
|
return {
|
|
118
197
|
...row,
|
|
119
198
|
placements: JSON.parse(row.placements),
|
|
120
199
|
env: JSON.parse(row.env),
|
|
121
200
|
resources: row.resources ? JSON.parse(row.resources) : null,
|
|
201
|
+
cache: cache ? { mountPath: cache.mountPath } : null,
|
|
122
202
|
enabled: row.enabled === 1
|
|
123
203
|
};
|
|
124
204
|
}
|
|
@@ -157,6 +237,15 @@ async function getRuntimeControllerTarget2(controller, env = process.env) {
|
|
|
157
237
|
E2B_MAX_CONTINUOUS_SEC: env.E2B_MAX_CONTINUOUS_SEC,
|
|
158
238
|
RUNTIME_WORKER_API_URL: env.RUNTIME_WORKER_API_URL,
|
|
159
239
|
PUBLIC_MCP_BASE_URL: env.PUBLIC_MCP_BASE_URL,
|
|
240
|
+
...controller.kind === "boxd" && controller.placement === "builtin" ? {
|
|
241
|
+
BOXD_ORG: env.BOXD_ORG,
|
|
242
|
+
BOXD_BASE_URL: env.BOXD_BASE_URL,
|
|
243
|
+
BOXD_SNAPSHOT: env.BOXD_SNAPSHOT,
|
|
244
|
+
BOXD_DELETE_AFTER_SEC: env.BOXD_DELETE_AFTER_SEC,
|
|
245
|
+
BOXD_START_TIMEOUT_SEC: env.BOXD_START_TIMEOUT_SEC,
|
|
246
|
+
BOXD_STATUS_TIMEOUT_SEC: env.BOXD_STATUS_TIMEOUT_SEC,
|
|
247
|
+
BOXD_TEARDOWN_TIMEOUT_SEC: env.BOXD_TEARDOWN_TIMEOUT_SEC
|
|
248
|
+
} : {},
|
|
160
249
|
...controller.config,
|
|
161
250
|
...secrets
|
|
162
251
|
};
|
|
@@ -232,11 +321,18 @@ async function updateRuntimeController2(id, input, actor = null) {
|
|
|
232
321
|
if (await tx.get("SELECT id FROM runtime_controllers WHERE name = ? AND id != ?", [data.name, id]))
|
|
233
322
|
throw new RuntimePoolError2("Controller name already exists", 409);
|
|
234
323
|
const pools = await listRuntimePools2();
|
|
324
|
+
const oldConfig = JSON.parse(row.config);
|
|
325
|
+
const configChanged = Object.keys(data.config).length !== Object.keys(oldConfig).length || Object.entries(data.config).some(([key, value]) => oldConfig[key] !== value);
|
|
326
|
+
const secrets = patch.secretConfig !== undefined ? controllerSecrets(row) : {};
|
|
327
|
+
const secretsChanged = Object.entries(patch.secretConfig ?? {}).some(([key, value]) => value === null ? key in secrets : secrets[key] !== value);
|
|
328
|
+
if ((data.kind !== row.kind || data.placement !== row.placement || configChanged || secretsChanged) && (pools.some((pool) => pool.cache && pool.placements.includes(id)) || await tx.get("SELECT id FROM runtime_cache_releases WHERE controller_id = ? LIMIT 1", [
|
|
329
|
+
id
|
|
330
|
+
])))
|
|
331
|
+
throw new RuntimePoolError2("Disable pool caches and wait for cleanup before changing controller configuration or placement", 409);
|
|
235
332
|
if (pools.some((pool) => pool.placements.includes(id) && pool.kind !== data.kind))
|
|
236
333
|
throw new RuntimePoolError2("Pool kind must equal controller kind");
|
|
237
334
|
let encrypted = row.secretConfig;
|
|
238
335
|
if (patch.secretConfig !== undefined) {
|
|
239
|
-
const secrets = controllerSecrets(row);
|
|
240
336
|
for (const [key, value] of Object.entries(patch.secretConfig)) {
|
|
241
337
|
if (value === null)
|
|
242
338
|
delete secrets[key];
|
|
@@ -268,6 +364,8 @@ async function deleteRuntimeController2(id) {
|
|
|
268
364
|
throw new RuntimePoolError2("Controller not found", 404);
|
|
269
365
|
if ((await listRuntimePools2()).some((pool) => pool.placements.includes(id)))
|
|
270
366
|
throw new RuntimePoolError2("Controller has runtime pools", 409);
|
|
367
|
+
if (await tx.get("SELECT id FROM runtime_cache_releases WHERE controller_id = ? LIMIT 1", [id]))
|
|
368
|
+
throw new RuntimePoolError2("Controller has pending cache cleanup", 409);
|
|
271
369
|
await revokeControllerTokens(id);
|
|
272
370
|
await tx.run("DELETE FROM runtime_controllers WHERE id = ?", [id]);
|
|
273
371
|
});
|
|
@@ -281,6 +379,9 @@ async function getRuntimePool2(id) {
|
|
|
281
379
|
}
|
|
282
380
|
async function validatePool(data) {
|
|
283
381
|
supportedKind(data.kind);
|
|
382
|
+
if (data.cache && !(await createRuntimeProvider(data.kind)).traits.persistentCache) {
|
|
383
|
+
throw new RuntimePoolError2(`${data.kind} does not support persistent pool caches`);
|
|
384
|
+
}
|
|
284
385
|
const controller = await getRuntimeController2(data.placements[0]);
|
|
285
386
|
if (!controller)
|
|
286
387
|
throw new RuntimePoolError2("Controller not found");
|
|
@@ -301,7 +402,7 @@ async function createRuntimePool2(input, actor = null, id = crypto.randomUUID())
|
|
|
301
402
|
await validatePool(data);
|
|
302
403
|
if (await tx.get("SELECT id FROM runtime_pools WHERE name = ? OR id = ?", [data.name, id]))
|
|
303
404
|
throw new RuntimePoolError2("Pool already exists", 409);
|
|
304
|
-
await tx.run(`INSERT INTO runtime_pools (id, name, kind, placements, image, lifecycle, idle_minutes, slots_per_runtime, max_runtimes, min_runtimes, delivery, env, resources, ttl_sec, enabled, created_by, updated_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
405
|
+
await tx.run(`INSERT INTO runtime_pools (id, name, kind, placements, image, lifecycle, idle_minutes, slots_per_runtime, max_runtimes, min_runtimes, delivery, env, resources, cache, ttl_sec, enabled, created_by, updated_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
305
406
|
id,
|
|
306
407
|
data.name,
|
|
307
408
|
data.kind,
|
|
@@ -315,6 +416,7 @@ async function createRuntimePool2(input, actor = null, id = crypto.randomUUID())
|
|
|
315
416
|
data.delivery,
|
|
316
417
|
JSON.stringify(data.env),
|
|
317
418
|
data.resources ? JSON.stringify(data.resources) : null,
|
|
419
|
+
data.cache ? JSON.stringify({ ...data.cache, key: poolCacheKey(id, crypto.randomUUID()) }) : null,
|
|
318
420
|
data.ttlSec,
|
|
319
421
|
Number(data.enabled),
|
|
320
422
|
actor,
|
|
@@ -335,7 +437,13 @@ async function updateRuntimePool2(id, input, actor = null) {
|
|
|
335
437
|
await validatePool(data);
|
|
336
438
|
if (await tx.get("SELECT id FROM runtime_pools WHERE name = ? AND id != ?", [data.name, id]))
|
|
337
439
|
throw new RuntimePoolError2("Pool name already exists", 409);
|
|
338
|
-
|
|
440
|
+
const cache = data.cache ? {
|
|
441
|
+
...data.cache,
|
|
442
|
+
key: existing.cache && data.placements[0] === existing.placements[0] ? (await getPoolCache(id)).key : poolCacheKey(id, crypto.randomUUID())
|
|
443
|
+
} : null;
|
|
444
|
+
if (existing.cache && (!data.cache || data.placements[0] !== existing.placements[0]))
|
|
445
|
+
await queuePoolCacheRelease(existing, actor);
|
|
446
|
+
await tx.run(`UPDATE runtime_pools SET name = ?, kind = ?, placements = ?, image = ?, resolved_image = ?, lifecycle = ?, idle_minutes = ?, slots_per_runtime = ?, max_runtimes = ?, min_runtimes = ?, delivery = ?, env = ?, resources = ?, cache = ?, ttl_sec = ?, enabled = ?, updated_by = COALESCE(?, updated_by), updated_at = ? WHERE id = ?`, [
|
|
339
447
|
data.name,
|
|
340
448
|
data.kind,
|
|
341
449
|
JSON.stringify(data.placements),
|
|
@@ -349,6 +457,7 @@ async function updateRuntimePool2(id, input, actor = null) {
|
|
|
349
457
|
data.delivery,
|
|
350
458
|
JSON.stringify(data.env),
|
|
351
459
|
data.resources ? JSON.stringify(data.resources) : null,
|
|
460
|
+
cache ? JSON.stringify(cache) : null,
|
|
352
461
|
data.ttlSec,
|
|
353
462
|
Number(data.enabled),
|
|
354
463
|
actor,
|
|
@@ -360,7 +469,8 @@ async function updateRuntimePool2(id, input, actor = null) {
|
|
|
360
469
|
}
|
|
361
470
|
async function deleteRuntimePool2(id, force = false, actor = null) {
|
|
362
471
|
await getDbClient2().transaction(async (tx) => {
|
|
363
|
-
|
|
472
|
+
const pool = await getRuntimePool2(id);
|
|
473
|
+
if (!pool)
|
|
364
474
|
throw new RuntimePoolError2("Pool not found", 404);
|
|
365
475
|
if (await tx.get("SELECT id FROM runtime_instances WHERE pool_id = ? AND status != 'offline' LIMIT 1", [id]))
|
|
366
476
|
throw new RuntimePoolError2("Pool has non-offline runtimes. Scale to zero or disable the pool and wait for teardown before deletion.", 409);
|
|
@@ -369,6 +479,7 @@ async function deleteRuntimePool2(id, force = false, actor = null) {
|
|
|
369
479
|
if (force) {
|
|
370
480
|
await tx.run("UPDATE agents SET runtime_pool_id = NULL, lastUpdatedAt = ?, updated_by = COALESCE(?, updated_by) WHERE runtime_pool_id = ?", [new Date().toISOString(), actor, id]);
|
|
371
481
|
}
|
|
482
|
+
await queuePoolCacheRelease(pool, actor);
|
|
372
483
|
await tx.run("DELETE FROM runtime_pools WHERE id = ?", [id]);
|
|
373
484
|
});
|
|
374
485
|
}
|
|
@@ -450,21 +561,23 @@ var controllerColumns = `id, name, kind, placement, config, secret_config AS sec
|
|
|
450
561
|
status, last_seen_at AS lastSeenAt, last_error AS lastError, last_error_at AS lastErrorAt,
|
|
451
562
|
created_by AS createdBy, updated_by AS updatedBy, created_at AS createdAt, updated_at AS updatedAt`, poolColumns = `id, name, kind, placements, image, lifecycle, idle_minutes AS idleMinutes,
|
|
452
563
|
slots_per_runtime AS slotsPerRuntime, max_runtimes AS maxRuntimes, min_runtimes AS minRuntimes,
|
|
453
|
-
delivery, env, resources, ttl_sec AS ttlSec, resolved_image AS resolvedImage, enabled,
|
|
564
|
+
delivery, env, resources, cache, ttl_sec AS ttlSec, resolved_image AS resolvedImage, enabled,
|
|
454
565
|
consecutive_failures AS consecutiveFailures, circuit_open_until AS circuitOpenUntil,
|
|
455
566
|
last_error AS lastError, last_error_at AS lastErrorAt, created_by AS createdBy,
|
|
456
567
|
updated_by AS updatedBy, created_at AS createdAt, updated_at AS updatedAt`;
|
|
457
568
|
var init_db2 = __esm(() => {
|
|
458
569
|
init_runtime_providers();
|
|
570
|
+
init_types5();
|
|
459
571
|
init_types4();
|
|
460
572
|
init_secret_scrubber();
|
|
461
573
|
init_crypto();
|
|
462
574
|
init_db4();
|
|
463
575
|
init_agents();
|
|
464
576
|
init_secret_registry();
|
|
577
|
+
init_cache_cleanup();
|
|
465
578
|
init_errors();
|
|
466
579
|
init_tokens();
|
|
467
580
|
init_errors();
|
|
468
581
|
});
|
|
469
582
|
|
|
470
|
-
export { RuntimePoolError2, mintControllerToken, init_tokens, listRuntimeControllers2, getRuntimeController2, getRuntimeControllerTarget2, checkE2bControllerConfig2, createRuntimeController2, updateRuntimeController2, deleteRuntimeController2, listRuntimePools2, getRuntimePool2, createRuntimePool2, updateRuntimePool2, deleteRuntimePool2, bindAgentToPool2, listAgentsForPool2, getPoolForAgent2, resolvePoolDelivery2, createPoolAgent2, loadRuntimeControllerSecrets2, init_db2 };
|
|
583
|
+
export { getPoolCache, reconcileCacheReleases, init_cache_cleanup, RuntimePoolError2, mintControllerToken, init_tokens, listRuntimeControllers2, getRuntimeController2, getRuntimeControllerTarget2, checkE2bControllerConfig2, createRuntimeController2, updateRuntimeController2, deleteRuntimeController2, listRuntimePools2, getRuntimePool2, createRuntimePool2, updateRuntimePool2, deleteRuntimePool2, bindAgentToPool2, listAgentsForPool2, getPoolForAgent2, resolvePoolDelivery2, createPoolAgent2, loadRuntimeControllerSecrets2, init_db2 };
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./cli-0726awxw.js";
|
|
5
5
|
import {
|
|
6
6
|
summarizeSession
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-faxe6thg.js";
|
|
8
8
|
import {
|
|
9
9
|
getMemoryRaterNames,
|
|
10
10
|
init_memory_raters,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveTemplateAsync,
|
|
23
23
|
init_resolver,
|
|
24
24
|
init_session_templates
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-cm5yqn35.js";
|
|
26
26
|
import {
|
|
27
27
|
isSessionSummarySkipped,
|
|
28
28
|
init_env_flag
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
scrubSecrets,
|
|
32
32
|
init_secret_scrubber
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-1b7btd38.js";
|
|
34
34
|
|
|
35
35
|
// src/prompts/goal-reminder.ts
|
|
36
36
|
init_session_templates();
|
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
getAgentWorkingOnThread2,
|
|
10
10
|
getMostRecentTaskInThread2,
|
|
11
11
|
reactionName,
|
|
12
|
+
SteeringBlockedError,
|
|
13
|
+
init_steering2,
|
|
12
14
|
init_db4
|
|
13
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-k2gzwsj2.js";
|
|
14
16
|
import {
|
|
15
17
|
isBlockExternalEnabled2,
|
|
16
18
|
invalidateChannelExternality2,
|
|
@@ -18,7 +20,7 @@ import {
|
|
|
18
20
|
shouldBlockChannel2,
|
|
19
21
|
leaveExternalChannel2,
|
|
20
22
|
init_external_channel
|
|
21
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-w6dt9ged.js";
|
|
22
24
|
import {
|
|
23
25
|
noteSlackInboundSideEffect,
|
|
24
26
|
ignoreSlackInbound,
|
|
@@ -34,11 +36,11 @@ import {
|
|
|
34
36
|
init_render_v2,
|
|
35
37
|
registerTreeMessage,
|
|
36
38
|
init_watcher
|
|
37
|
-
} from "./cli-
|
|
39
|
+
} from "./cli-waqbxg08.js";
|
|
38
40
|
import {
|
|
39
41
|
workflowEventBus2,
|
|
40
42
|
init_event_bus
|
|
41
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-wx3rhnm0.js";
|
|
42
44
|
import {
|
|
43
45
|
TaskCreationBlockedError,
|
|
44
46
|
init_errors2,
|
|
@@ -59,7 +61,7 @@ import {
|
|
|
59
61
|
init_message_text,
|
|
60
62
|
dispatchPre2,
|
|
61
63
|
init_dispatcher
|
|
62
|
-
} from "./cli-
|
|
64
|
+
} from "./cli-shpbx5ee.js";
|
|
63
65
|
import {
|
|
64
66
|
wasEventSeen,
|
|
65
67
|
init_event_dedup,
|
|
@@ -70,17 +72,25 @@ import {
|
|
|
70
72
|
getBufferMessageCount,
|
|
71
73
|
instantFlush,
|
|
72
74
|
init_thread_buffer
|
|
73
|
-
} from "./cli-
|
|
75
|
+
} from "./cli-p5gp8pcx.js";
|
|
74
76
|
import {
|
|
75
77
|
enrichSlackUserEmail,
|
|
76
78
|
resolveSlackUserId,
|
|
77
79
|
rewriteSlackMentions,
|
|
78
80
|
init_enrich
|
|
79
|
-
} from "./cli-
|
|
81
|
+
} from "./cli-xbbndvjy.js";
|
|
82
|
+
import {
|
|
83
|
+
isSlackLeaveThreadDisabled,
|
|
84
|
+
SLACK_LEFT_THREAD_CONFIRMATION,
|
|
85
|
+
isSlackLeaveThreadCommand,
|
|
86
|
+
leaveSlackThread,
|
|
87
|
+
shouldSkipLeftSlackThread,
|
|
88
|
+
init_left_threads
|
|
89
|
+
} from "./cli-gdhpcbhf.js";
|
|
80
90
|
import {
|
|
81
91
|
resolveTemplate,
|
|
82
92
|
init_resolver
|
|
83
|
-
} from "./cli-
|
|
93
|
+
} from "./cli-cm5yqn35.js";
|
|
84
94
|
import {
|
|
85
95
|
init_zod
|
|
86
96
|
} from "./cli-k5671be5.js";
|
|
@@ -97,7 +107,7 @@ import {
|
|
|
97
107
|
import {
|
|
98
108
|
scrubSecrets,
|
|
99
109
|
init_secret_scrubber
|
|
100
|
-
} from "./cli-
|
|
110
|
+
} from "./cli-1b7btd38.js";
|
|
101
111
|
import {
|
|
102
112
|
__esm,
|
|
103
113
|
__using,
|
|
@@ -294,6 +304,27 @@ function registerMessageHandler2(app) {
|
|
|
294
304
|
console.log(`[Slack] Ignoring message from unauthorized user ${msg.user}`);
|
|
295
305
|
return ignoreSlackInbound("unauthorized_user");
|
|
296
306
|
}
|
|
307
|
+
const botMentioned = !!cachedBotUserId && !!msg.text?.includes(`<@${cachedBotUserId}>`);
|
|
308
|
+
if (msg.thread_ts && !isSlackLeaveThreadDisabled() && isSlackLeaveThreadCommand(msg.text, cachedBotUserId) && (await getMostRecentTaskInThread2(msg.channel, msg.thread_ts) !== null || await wasThreadStartedBySwarm(client, msg.channel, msg.thread_ts))) {
|
|
309
|
+
noteSlackInboundSideEffect("thread_leave");
|
|
310
|
+
await leaveSlackThread(msg.channel, msg.thread_ts, { slackUserId: msg.user });
|
|
311
|
+
console.log(`[Slack] Left thread ${msg.channel}/${msg.thread_ts}: !leave from ${msg.user}`);
|
|
312
|
+
try {
|
|
313
|
+
await client.chat.postEphemeral({
|
|
314
|
+
channel: msg.channel,
|
|
315
|
+
user: msg.user,
|
|
316
|
+
thread_ts: msg.thread_ts,
|
|
317
|
+
text: SLACK_LEFT_THREAD_CONFIRMATION
|
|
318
|
+
});
|
|
319
|
+
} catch (error) {
|
|
320
|
+
console.error("[Slack] Failed to confirm !leave:", error);
|
|
321
|
+
}
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (await shouldSkipLeftSlackThread(msg.channel, msg.thread_ts, botMentioned)) {
|
|
325
|
+
console.log(`[Slack] Skipping message in left thread ${msg.channel}/${msg.thread_ts}`);
|
|
326
|
+
return ignoreSlackInbound("thread_left");
|
|
327
|
+
}
|
|
297
328
|
const requestedByUserId = await resolveSlackUserId(client, msg.user, {
|
|
298
329
|
sampleEventType: "message",
|
|
299
330
|
sampleContext: msg.text ?? ""
|
|
@@ -314,7 +345,6 @@ function registerMessageHandler2(app) {
|
|
|
314
345
|
return reportSlackInboundFailure("bot_user_unavailable");
|
|
315
346
|
}
|
|
316
347
|
const botUserId = cachedBotUserId;
|
|
317
|
-
const botMentioned = !!msg.text?.includes(`<@${botUserId}>`);
|
|
318
348
|
const isAssistantThread = !!msg.assistant_thread;
|
|
319
349
|
const isImplicitMention = isAssistantThread && !botMentioned && !isAddressedToOtherUser(effectiveText, botUserId);
|
|
320
350
|
const additiveSlack = isEnvFlagEnabled("ADDITIVE_SLACK", false);
|
|
@@ -520,7 +550,8 @@ ${taskDescription}`;
|
|
|
520
550
|
threadTs,
|
|
521
551
|
message: taskDescription,
|
|
522
552
|
messageTimestamps: [msg.ts],
|
|
523
|
-
requestedByUserId
|
|
553
|
+
requestedByUserId,
|
|
554
|
+
slackUserId: msg.user
|
|
524
555
|
}) : null;
|
|
525
556
|
if (steering) {
|
|
526
557
|
await ackSlackMessage(client, msg.channel, msg.ts, reactionName("steered"), "steered");
|
|
@@ -573,12 +604,13 @@ ${taskDescription}`;
|
|
|
573
604
|
results.assigned.push({ agentName: agent.name, taskId: task.id });
|
|
574
605
|
}
|
|
575
606
|
} catch (error) {
|
|
576
|
-
|
|
607
|
+
const blocked = error instanceof TaskCreationBlockedError || error instanceof SteeringBlockedError;
|
|
608
|
+
if (!blocked) {
|
|
577
609
|
reportSlackInboundFailure("task_creation_error");
|
|
578
610
|
}
|
|
579
611
|
results.failed.push({
|
|
580
612
|
agentName: agent.name,
|
|
581
|
-
reason:
|
|
613
|
+
reason: blocked ? error.reason : "error"
|
|
582
614
|
});
|
|
583
615
|
}
|
|
584
616
|
}
|
|
@@ -711,6 +743,7 @@ var SlackRouteModifySchema, allowedEmailDomains, allowedUserIds, envUserFilterCo
|
|
|
711
743
|
var init_handlers = __esm(() => {
|
|
712
744
|
init_zod();
|
|
713
745
|
init_db4();
|
|
746
|
+
init_steering2();
|
|
714
747
|
init_dispatcher();
|
|
715
748
|
init_resolver();
|
|
716
749
|
init_context_key();
|
|
@@ -727,6 +760,7 @@ var init_handlers = __esm(() => {
|
|
|
727
760
|
init_templates();
|
|
728
761
|
init_env_flag();
|
|
729
762
|
init_external_channel();
|
|
763
|
+
init_left_threads();
|
|
730
764
|
init_message_text();
|
|
731
765
|
init_render_v2();
|
|
732
766
|
init_steering();
|