@desplega.ai/agent-swarm 1.131.0 → 1.131.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.
Files changed (84) hide show
  1. package/dist/{actions-w53mbns9.js → actions-jgcy477k.js} +6 -6
  2. package/dist/{app-m9gwqsqv.js → app-5da78bd4.js} +3 -3
  3. package/dist/{assistant-bp65m6f3.js → assistant-f2vkk1hj.js} +8 -8
  4. package/dist/{boot-reembed-62p0at2k.js → boot-reembed-q7mp8hcr.js} +3 -3
  5. package/dist/{boot-reembed-xmfp6wdh.js → boot-reembed-xmw8wcx6.js} +4 -4
  6. package/dist/{boot-scrub-logs-rr8q2dms.js → boot-scrub-logs-dsqrv79n.js} +2 -2
  7. package/dist/{claude-adapter-2y47mrkd.js → claude-adapter-q6x7yspx.js} +4 -4
  8. package/dist/{claude-managed-adapter-gv19tdew.js → claude-managed-adapter-wsg37bt8.js} +1 -1
  9. package/dist/{cli-t1xze5qh.js → cli-114fvtmj.js} +1 -1
  10. package/dist/{cli-cdeg08wx.js → cli-2f07m0xr.js} +1 -1
  11. package/dist/{cli-70xqj0z3.js → cli-2rk0cx7s.js} +2 -2
  12. package/dist/{cli-nm5gtp1x.js → cli-3ty0t082.js} +1 -1
  13. package/dist/{cli-efxfnq6q.js → cli-4rkfg1wx.js} +3 -3
  14. package/dist/{cli-a4jzdpa3.js → cli-50vbt00w.js} +1 -1
  15. package/dist/{cli-pm6xbh84.js → cli-6dp3ydxa.js} +34 -8
  16. package/dist/{cli-d3x3x1c9.js → cli-6dpytdr2.js} +1 -1
  17. package/dist/{cli-e7ckcg4v.js → cli-6pcz9h15.js} +12 -12
  18. package/dist/{cli-5kx36evn.js → cli-793jvbsh.js} +1 -1
  19. package/dist/{cli-78xwvkhj.js → cli-7dm2zqy2.js} +2 -2
  20. package/dist/{cli-psh3c4va.js → cli-aca5pz9f.js} +1 -1
  21. package/dist/{cli-72q8m8gk.js → cli-ccf9vy7q.js} +2 -2
  22. package/dist/{cli-qv61hp37.js → cli-g1re8r05.js} +2 -2
  23. package/dist/{cli-d2tfkcga.js → cli-g74vpjp2.js} +3 -3
  24. package/dist/{cli-2q72qz2s.js → cli-gecy3z2s.js} +13 -4
  25. package/dist/{cli-yw8vghx2.js → cli-jbcva0xj.js} +14 -6
  26. package/dist/{cli-t76vw5db.js → cli-jevgrb4w.js} +19 -19
  27. package/dist/{cli-3kf51j15.js → cli-kd1ck4rx.js} +1 -1
  28. package/dist/{cli-g6b8x1h8.js → cli-nrkkknat.js} +1 -1
  29. package/dist/{cli-fywms69x.js → cli-pxfxkx5m.js} +1 -1
  30. package/dist/{cli-cvgjwnh1.js → cli-rgrfzg8z.js} +6 -6
  31. package/dist/{cli-rzbpmxdr.js → cli-se2p6rkb.js} +1 -1
  32. package/dist/{cli-5v4rw6yd.js → cli-sy7jk3tx.js} +1 -1
  33. package/dist/{cli-t55yw3a1.js → cli-t8d349cy.js} +2 -2
  34. package/dist/{cli-0rcyq6d9.js → cli-w2wxd56v.js} +2 -2
  35. package/dist/{cli-qmdnhpej.js → cli-wz9115x0.js} +17 -7
  36. package/dist/{cli-5ze9rv97.js → cli-ycrnynpw.js} +4 -4
  37. package/dist/{cli-a40rnf71.js → cli-ygrbmjja.js} +5 -5
  38. package/dist/cli.js +12 -12
  39. package/dist/{codex-adapter-d24q75wk.js → codex-adapter-htjkn22b.js} +2 -2
  40. package/dist/{codex-session-runner-g50vcsex.js → codex-session-runner-wjfc7smz.js} +2 -2
  41. package/dist/{commands-c3nrc5hg.js → commands-xhrfwqsk.js} +2 -2
  42. package/dist/{db-nt7fg3tw.js → db-anvwb22f.js} +2 -2
  43. package/dist/{handlers-fkr6swat.js → handlers-b9kbc621.js} +8 -8
  44. package/dist/{hook-g019yehy.js → hook-cgk4wxmx.js} +3 -3
  45. package/dist/{hook-77wpvnjc.js → hook-xkvn6c5h.js} +2 -2
  46. package/dist/{http-jewj0syk.js → http-9xh6ta4r.js} +156 -37
  47. package/dist/{index-hfvggd0z.js → index-25wjsdv2.js} +9 -9
  48. package/dist/{index-7n2xpbd4.js → index-eaxyqcmj.js} +8 -8
  49. package/dist/{index-hp1kdbjj.js → index-vg4snay4.js} +10 -10
  50. package/dist/{index-6gm5he8h.js → index-ywds4812.js} +8 -8
  51. package/dist/{keepalive-j0fjvqfd.js → keepalive-vc7s2aa6.js} +4 -4
  52. package/dist/{lead-1n8x30xe.js → lead-r2yqfmx7.js} +24 -24
  53. package/dist/{maintenance-gvev11sa.js → maintenance-mw70k468.js} +4 -4
  54. package/dist/{oauth-refresh-sweep-s9ecsvh0.js → oauth-refresh-sweep-yecgjpk4.js} +3 -3
  55. package/dist/{onboard-pvm5b38w.js → onboard-xj0f73f9.js} +2 -2
  56. package/dist/{otel-impl-p6jvgd9c.js → otel-impl-nxg0n0b3.js} +1 -1
  57. package/dist/{pi-mono-adapter-t091s27g.js → pi-mono-adapter-4g5kby31.js} +1 -1
  58. package/dist/{pricing-refresh-k49rcyed.js → pricing-refresh-2cn6effr.js} +4 -4
  59. package/dist/{rbac-roles-cr80g96t.js → rbac-roles-1hcxdtg7.js} +2 -2
  60. package/dist/{rbac-roles-30pspvy7.js → rbac-roles-vynday5g.js} +3 -3
  61. package/dist/{render-v2-xm457ng1.js → render-v2-tc0bh8kk.js} +3 -3
  62. package/dist/{seed-pricing-yhpv35fr.js → seed-pricing-8kceb43f.js} +3 -3
  63. package/dist/{setup-nytnmwwr.js → setup-46xtgq3c.js} +2 -2
  64. package/dist/{worker-msytr2cw.js → worker-qrbz6hmv.js} +24 -24
  65. package/openapi.json +1 -1
  66. package/package.json +2 -2
  67. package/src/be/migrations/130_scratch_script_retention_grace.sql +6 -0
  68. package/src/be/scripts/db.ts +43 -1
  69. package/src/be/scripts/retention.ts +164 -0
  70. package/src/be/scripts/run-saved.ts +16 -1
  71. package/src/http/index.ts +5 -0
  72. package/src/http/scripts.ts +21 -3
  73. package/src/http/x.ts +14 -0
  74. package/src/providers/claude-managed-models.ts +34 -10
  75. package/src/tests/claude-managed-adapter.test.ts +38 -7
  76. package/src/tests/sandboxed-process.test.ts +45 -0
  77. package/src/tests/script-connections.test.ts +3 -2
  78. package/src/tests/scripts-external-api.test.ts +8 -3
  79. package/src/tests/scripts-http.test.ts +12 -0
  80. package/src/tests/scripts-retention.test.ts +384 -0
  81. package/src/tests/workflow-swarm-script.test.ts +14 -5
  82. package/src/utils/sandboxed-process.ts +40 -14
  83. package/src/workflows/executors/swarm-script.ts +24 -1
  84. package/templates/schedules/daily-compounding-reflection/content.md +12 -3
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  runAgent
3
- } from "./cli-e7ckcg4v.js";
3
+ } from "./cli-6pcz9h15.js";
4
4
  import"./cli-f1am9szv.js";
5
- import"./cli-5kx36evn.js";
6
- import"./cli-qmdnhpej.js";
5
+ import"./cli-793jvbsh.js";
6
+ import"./cli-wz9115x0.js";
7
7
  import"./cli-07er7wrs.js";
8
8
  import"./cli-9b13ggd1.js";
9
9
  import"./cli-n6h8qt8n.js";
10
10
  import"./cli-yazx6hap.js";
11
11
  import"./cli-r94z9p1z.js";
12
12
  import"./cli-d6n0thxw.js";
13
- import"./cli-3kf51j15.js";
14
- import"./cli-70xqj0z3.js";
13
+ import"./cli-kd1ck4rx.js";
14
+ import"./cli-2rk0cx7s.js";
15
15
  import"./cli-psrqtw2m.js";
16
- import"./cli-0rcyq6d9.js";
16
+ import"./cli-w2wxd56v.js";
17
17
  import"./cli-yv9dttkh.js";
18
18
  import"./cli-tng3131n.js";
19
19
  import"./cli-zm7njwzd.js";
@@ -21,44 +21,44 @@ import"./cli-cw70hymf.js";
21
21
  import"./cli-v1mwc5v2.js";
22
22
  import {
23
23
  getEnabledCapabilities
24
- } from "./cli-t76vw5db.js";
24
+ } from "./cli-jevgrb4w.js";
25
25
  import"./cli-1z7048dy.js";
26
26
  import"./cli-gz9sbyk3.js";
27
27
  import"./cli-2wadx7p2.js";
28
28
  import"./cli-e7d20cty.js";
29
29
  import"./cli-8whqavk2.js";
30
- import"./cli-nm5gtp1x.js";
31
- import"./cli-5ze9rv97.js";
32
- import"./cli-t55yw3a1.js";
33
- import"./cli-t1xze5qh.js";
34
- import"./cli-5v4rw6yd.js";
30
+ import"./cli-3ty0t082.js";
31
+ import"./cli-ycrnynpw.js";
32
+ import"./cli-t8d349cy.js";
33
+ import"./cli-114fvtmj.js";
34
+ import"./cli-sy7jk3tx.js";
35
35
  import"./cli-bqw0mt1n.js";
36
- import"./cli-2q72qz2s.js";
37
- import"./cli-yw8vghx2.js";
36
+ import"./cli-gecy3z2s.js";
37
+ import"./cli-jbcva0xj.js";
38
38
  import"./cli-3dpj7atn.js";
39
- import"./cli-pm6xbh84.js";
39
+ import"./cli-6dp3ydxa.js";
40
40
  import"./cli-epan13p1.js";
41
41
  import"./cli-f14fvzag.js";
42
- import"./cli-qv61hp37.js";
43
- import"./cli-rzbpmxdr.js";
42
+ import"./cli-g1re8r05.js";
43
+ import"./cli-se2p6rkb.js";
44
44
  import"./cli-0258203w.js";
45
- import"./cli-g6b8x1h8.js";
45
+ import"./cli-nrkkknat.js";
46
46
  import"./cli-fad8m16k.js";
47
47
  import"./cli-7zd05xb4.js";
48
- import"./cli-d3x3x1c9.js";
49
- import"./cli-psh3c4va.js";
50
- import"./cli-cdeg08wx.js";
51
- import"./cli-cvgjwnh1.js";
48
+ import"./cli-6dpytdr2.js";
49
+ import"./cli-aca5pz9f.js";
50
+ import"./cli-2f07m0xr.js";
51
+ import"./cli-rgrfzg8z.js";
52
52
  import"./cli-k9qkf1hw.js";
53
53
  import"./cli-b0p7rfnd.js";
54
54
  import"./cli-t930g0xh.js";
55
- import"./cli-a4jzdpa3.js";
55
+ import"./cli-50vbt00w.js";
56
56
  import"./cli-xpxde7rm.js";
57
57
  import"./cli-x23me2mg.js";
58
58
  import"./cli-z2zcxes1.js";
59
59
  import"./cli-zsspvvm2.js";
60
60
  import"./cli-4j2mrzag.js";
61
- import"./cli-72q8m8gk.js";
61
+ import"./cli-ccf9vy7q.js";
62
62
  import"./cli-5dsbcjjw.js";
63
63
  import"./cli-e15jhafb.js";
64
64
  import"./cli-9aryf9tv.js";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  reembedAllScripts
3
- } from "./cli-qv61hp37.js";
4
- import"./cli-rzbpmxdr.js";
3
+ } from "./cli-g1re8r05.js";
4
+ import"./cli-se2p6rkb.js";
5
5
  import"./cli-0258203w.js";
6
- import"./cli-a4jzdpa3.js";
6
+ import"./cli-50vbt00w.js";
7
7
  import"./cli-xpxde7rm.js";
8
8
  import"./cli-x23me2mg.js";
9
9
  import"./cli-z2zcxes1.js";
10
10
  import"./cli-zsspvvm2.js";
11
11
  import"./cli-4j2mrzag.js";
12
- import"./cli-72q8m8gk.js";
12
+ import"./cli-ccf9vy7q.js";
13
13
  import"./cli-5dsbcjjw.js";
14
14
  import"./cli-p9swy5t3.js";
15
15
 
@@ -2,8 +2,8 @@ import {
2
2
  forceRefreshAuthorizationOrThrow,
3
3
  getAuthorizationById,
4
4
  listAuthorizationSweepRows
5
- } from "./cli-g6b8x1h8.js";
6
- import"./cli-a4jzdpa3.js";
5
+ } from "./cli-nrkkknat.js";
6
+ import"./cli-50vbt00w.js";
7
7
  import"./cli-xpxde7rm.js";
8
8
  import"./cli-x23me2mg.js";
9
9
  import"./cli-z2zcxes1.js";
@@ -12,7 +12,7 @@ import {
12
12
  init_secret_scrubber,
13
13
  scrubSecrets
14
14
  } from "./cli-4j2mrzag.js";
15
- import"./cli-72q8m8gk.js";
15
+ import"./cli-ccf9vy7q.js";
16
16
  import"./cli-5dsbcjjw.js";
17
17
  import"./cli-p9swy5t3.js";
18
18
 
@@ -3,7 +3,7 @@ import {
3
3
  createDefaultMcpJson,
4
4
  createDefaultSettingsLocal,
5
5
  createHooksConfig
6
- } from "./cli-fywms69x.js";
6
+ } from "./cli-pxfxkx5m.js";
7
7
  import {
8
8
  require_jsx_dev_runtime
9
9
  } from "./cli-wx82tw1k.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  init_package,
15
15
  package_default
16
- } from "./cli-72q8m8gk.js";
16
+ } from "./cli-ccf9vy7q.js";
17
17
  import {
18
18
  Box_default,
19
19
  Select,
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  init_package,
15
15
  package_default
16
- } from "./cli-72q8m8gk.js";
16
+ } from "./cli-ccf9vy7q.js";
17
17
  import {
18
18
  exports_supports_color,
19
19
  init_supports_color
@@ -29,7 +29,7 @@ import {
29
29
  streamSimple,
30
30
  summarizeSession,
31
31
  validateToolArguments
32
- } from "./cli-0rcyq6d9.js";
32
+ } from "./cli-w2wxd56v.js";
33
33
  import {
34
34
  checkToolLoop,
35
35
  clearToolHistory
@@ -2,15 +2,15 @@ import {
2
2
  PRICING_REFRESH_INTERVAL_MS,
3
3
  refreshPricingFromModelsDev,
4
4
  startPricingRefreshLoop
5
- } from "./cli-t55yw3a1.js";
6
- import"./cli-t1xze5qh.js";
7
- import"./cli-a4jzdpa3.js";
5
+ } from "./cli-t8d349cy.js";
6
+ import"./cli-114fvtmj.js";
7
+ import"./cli-50vbt00w.js";
8
8
  import"./cli-xpxde7rm.js";
9
9
  import"./cli-x23me2mg.js";
10
10
  import"./cli-z2zcxes1.js";
11
11
  import"./cli-zsspvvm2.js";
12
12
  import"./cli-4j2mrzag.js";
13
- import"./cli-72q8m8gk.js";
13
+ import"./cli-ccf9vy7q.js";
14
14
  import"./cli-5dsbcjjw.js";
15
15
  import"./cli-p9swy5t3.js";
16
16
  export {
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  getDb,
6
6
  init_db
7
- } from "./cli-a4jzdpa3.js";
7
+ } from "./cli-50vbt00w.js";
8
8
  import"./cli-xpxde7rm.js";
9
9
  import"./cli-x23me2mg.js";
10
10
  import"./cli-z2zcxes1.js";
11
11
  import"./cli-zsspvvm2.js";
12
12
  import"./cli-4j2mrzag.js";
13
- import"./cli-72q8m8gk.js";
13
+ import"./cli-ccf9vy7q.js";
14
14
  import"./cli-5dsbcjjw.js";
15
15
  import"./cli-p9swy5t3.js";
16
16
 
@@ -7,15 +7,15 @@ import {
7
7
  getUserGrant,
8
8
  listUserRoles,
9
9
  runRbacCliCommand
10
- } from "./cli-5v4rw6yd.js";
10
+ } from "./cli-sy7jk3tx.js";
11
11
  import"./cli-bqw0mt1n.js";
12
- import"./cli-a4jzdpa3.js";
12
+ import"./cli-50vbt00w.js";
13
13
  import"./cli-xpxde7rm.js";
14
14
  import"./cli-x23me2mg.js";
15
15
  import"./cli-z2zcxes1.js";
16
16
  import"./cli-zsspvvm2.js";
17
17
  import"./cli-4j2mrzag.js";
18
- import"./cli-72q8m8gk.js";
18
+ import"./cli-ccf9vy7q.js";
19
19
  import"./cli-5dsbcjjw.js";
20
20
  import"./cli-p9swy5t3.js";
21
21
  export {
@@ -7,17 +7,17 @@ import {
7
7
  processSlackRenderV2,
8
8
  renderThreadTree,
9
9
  streamOutcomeCard
10
- } from "./cli-cvgjwnh1.js";
10
+ } from "./cli-rgrfzg8z.js";
11
11
  import"./cli-k9qkf1hw.js";
12
12
  import"./cli-b0p7rfnd.js";
13
13
  import"./cli-t930g0xh.js";
14
- import"./cli-a4jzdpa3.js";
14
+ import"./cli-50vbt00w.js";
15
15
  import"./cli-xpxde7rm.js";
16
16
  import"./cli-x23me2mg.js";
17
17
  import"./cli-z2zcxes1.js";
18
18
  import"./cli-zsspvvm2.js";
19
19
  import"./cli-4j2mrzag.js";
20
- import"./cli-72q8m8gk.js";
20
+ import"./cli-ccf9vy7q.js";
21
21
  import"./cli-5dsbcjjw.js";
22
22
  import"./cli-e15jhafb.js";
23
23
  import"./cli-3fj60etf.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  buildModelsDevSeedRows,
3
3
  seedPricingFromModelsDev
4
- } from "./cli-t1xze5qh.js";
5
- import"./cli-a4jzdpa3.js";
4
+ } from "./cli-114fvtmj.js";
5
+ import"./cli-50vbt00w.js";
6
6
  import"./cli-xpxde7rm.js";
7
7
  import"./cli-x23me2mg.js";
8
8
  import"./cli-z2zcxes1.js";
9
9
  import"./cli-zsspvvm2.js";
10
10
  import"./cli-4j2mrzag.js";
11
- import"./cli-72q8m8gk.js";
11
+ import"./cli-ccf9vy7q.js";
12
12
  import"./cli-5dsbcjjw.js";
13
13
  import"./cli-p9swy5t3.js";
14
14
  export {
@@ -4,14 +4,14 @@ import {
4
4
  createDefaultMcpJson,
5
5
  createDefaultSettingsLocal,
6
6
  createHooksConfig
7
- } from "./cli-fywms69x.js";
7
+ } from "./cli-pxfxkx5m.js";
8
8
  import {
9
9
  require_jsx_dev_runtime
10
10
  } from "./cli-wx82tw1k.js";
11
11
  import {
12
12
  getApiKey
13
13
  } from "./cli-f14fvzag.js";
14
- import"./cli-72q8m8gk.js";
14
+ import"./cli-ccf9vy7q.js";
15
15
  import {
16
16
  Box_default,
17
17
  Spinner,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  runAgent
3
- } from "./cli-e7ckcg4v.js";
3
+ } from "./cli-6pcz9h15.js";
4
4
  import"./cli-f1am9szv.js";
5
- import"./cli-5kx36evn.js";
6
- import"./cli-qmdnhpej.js";
5
+ import"./cli-793jvbsh.js";
6
+ import"./cli-wz9115x0.js";
7
7
  import"./cli-07er7wrs.js";
8
8
  import"./cli-9b13ggd1.js";
9
9
  import"./cli-n6h8qt8n.js";
10
10
  import"./cli-yazx6hap.js";
11
11
  import"./cli-r94z9p1z.js";
12
12
  import"./cli-d6n0thxw.js";
13
- import"./cli-3kf51j15.js";
14
- import"./cli-70xqj0z3.js";
13
+ import"./cli-kd1ck4rx.js";
14
+ import"./cli-2rk0cx7s.js";
15
15
  import"./cli-psrqtw2m.js";
16
- import"./cli-0rcyq6d9.js";
16
+ import"./cli-w2wxd56v.js";
17
17
  import"./cli-yv9dttkh.js";
18
18
  import"./cli-tng3131n.js";
19
19
  import"./cli-zm7njwzd.js";
@@ -21,44 +21,44 @@ import"./cli-cw70hymf.js";
21
21
  import"./cli-v1mwc5v2.js";
22
22
  import {
23
23
  getEnabledCapabilities
24
- } from "./cli-t76vw5db.js";
24
+ } from "./cli-jevgrb4w.js";
25
25
  import"./cli-1z7048dy.js";
26
26
  import"./cli-gz9sbyk3.js";
27
27
  import"./cli-2wadx7p2.js";
28
28
  import"./cli-e7d20cty.js";
29
29
  import"./cli-8whqavk2.js";
30
- import"./cli-nm5gtp1x.js";
31
- import"./cli-5ze9rv97.js";
32
- import"./cli-t55yw3a1.js";
33
- import"./cli-t1xze5qh.js";
34
- import"./cli-5v4rw6yd.js";
30
+ import"./cli-3ty0t082.js";
31
+ import"./cli-ycrnynpw.js";
32
+ import"./cli-t8d349cy.js";
33
+ import"./cli-114fvtmj.js";
34
+ import"./cli-sy7jk3tx.js";
35
35
  import"./cli-bqw0mt1n.js";
36
- import"./cli-2q72qz2s.js";
37
- import"./cli-yw8vghx2.js";
36
+ import"./cli-gecy3z2s.js";
37
+ import"./cli-jbcva0xj.js";
38
38
  import"./cli-3dpj7atn.js";
39
- import"./cli-pm6xbh84.js";
39
+ import"./cli-6dp3ydxa.js";
40
40
  import"./cli-epan13p1.js";
41
41
  import"./cli-f14fvzag.js";
42
- import"./cli-qv61hp37.js";
43
- import"./cli-rzbpmxdr.js";
42
+ import"./cli-g1re8r05.js";
43
+ import"./cli-se2p6rkb.js";
44
44
  import"./cli-0258203w.js";
45
- import"./cli-g6b8x1h8.js";
45
+ import"./cli-nrkkknat.js";
46
46
  import"./cli-fad8m16k.js";
47
47
  import"./cli-7zd05xb4.js";
48
- import"./cli-d3x3x1c9.js";
49
- import"./cli-psh3c4va.js";
50
- import"./cli-cdeg08wx.js";
51
- import"./cli-cvgjwnh1.js";
48
+ import"./cli-6dpytdr2.js";
49
+ import"./cli-aca5pz9f.js";
50
+ import"./cli-2f07m0xr.js";
51
+ import"./cli-rgrfzg8z.js";
52
52
  import"./cli-k9qkf1hw.js";
53
53
  import"./cli-b0p7rfnd.js";
54
54
  import"./cli-t930g0xh.js";
55
- import"./cli-a4jzdpa3.js";
55
+ import"./cli-50vbt00w.js";
56
56
  import"./cli-xpxde7rm.js";
57
57
  import"./cli-x23me2mg.js";
58
58
  import"./cli-z2zcxes1.js";
59
59
  import"./cli-zsspvvm2.js";
60
60
  import"./cli-4j2mrzag.js";
61
- import"./cli-72q8m8gk.js";
61
+ import"./cli-ccf9vy7q.js";
62
62
  import"./cli-5dsbcjjw.js";
63
63
  import"./cli-e15jhafb.js";
64
64
  import"./cli-9aryf9tv.js";
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "1.131.0",
5
+ "version": "1.131.1",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "1.131.0",
3
+ "version": "1.131.1",
4
4
  "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.",
5
5
  "keywords": [
6
6
  "agent-swarm.dev",
@@ -176,7 +176,7 @@
176
176
  "@linear/sdk": "^77.0.0",
177
177
  "@modelcontextprotocol/sdk": "^1.25.1",
178
178
  "@openai/codex-sdk": "^0.147.0",
179
- "@opencode-ai/sdk": "^1.18.15",
179
+ "@opencode-ai/sdk": "^1.18.16",
180
180
  "@openfort/openfort-node": "^0.9.1",
181
181
  "@opentelemetry/api": "^1.9.1",
182
182
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -0,0 +1,6 @@
1
+ -- Historical inline script runs did not retain the generated scratch slug, so
2
+ -- refresh existing scratch rows once to give them a full retention window
3
+ -- under the new last-used tracking policy.
4
+ UPDATE scripts
5
+ SET updatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
6
+ WHERE scope = 'agent' AND isScratch = 1 AND name GLOB 'scratch-*';
@@ -226,11 +226,17 @@ export async function upsertScriptByName(args: ScriptWriteArgs): Promise<UpsertS
226
226
  args.signatureJson !== existing.signatureJson ||
227
227
  argsJsonSchema !== existing.argsJsonSchema;
228
228
  const promotedFromScratch = existing.isScratch && !isScratch;
229
+ const refreshScratchLastUsed =
230
+ existing.scope === "agent" &&
231
+ existing.name.startsWith("scratch-") &&
232
+ existing.isScratch &&
233
+ isScratch;
229
234
  if (
230
235
  fsMode !== existing.fsMode ||
231
236
  isScratch !== existing.isScratch ||
232
237
  typeChecked !== existing.typeChecked ||
233
- trackedMetadataChanged
238
+ trackedMetadataChanged ||
239
+ refreshScratchLastUsed
234
240
  ) {
235
241
  const row = getDb()
236
242
  .prepare<
@@ -466,6 +472,42 @@ export function deleteScript(args: ScriptIdentity): boolean {
466
472
  return result.changes > 0;
467
473
  }
468
474
 
475
+ /** Bumps updatedAt and returns the timestamp actually written, or null if the row didn't match. */
476
+ export function touchScratchScriptLastUsed(
477
+ id: string,
478
+ at: string = new Date().toISOString(),
479
+ ): string | null {
480
+ const result = getDb()
481
+ .prepare(
482
+ `UPDATE scripts SET updatedAt = ?
483
+ WHERE id = ? AND scope = 'agent' AND isScratch = 1 AND name GLOB 'scratch-*'`,
484
+ )
485
+ .run(at, id);
486
+ return result.changes > 0 ? at : null;
487
+ }
488
+
489
+ /**
490
+ * Rolls back an in-flight run-start touch after the run turns out to have
491
+ * failed, so a failed invocation doesn't extend the retention window the way
492
+ * a successful one does. Only applies if nothing has touched the row since
493
+ * (CAS on updatedAt) — a concurrent run's touch, in-flight or successful,
494
+ * always wins over this rollback.
495
+ */
496
+ export function restoreScratchScriptLastUsedIfUnchanged(
497
+ id: string,
498
+ priorUpdatedAt: string,
499
+ expectedUpdatedAt: string,
500
+ ): boolean {
501
+ return (
502
+ getDb()
503
+ .prepare(
504
+ `UPDATE scripts SET updatedAt = ?
505
+ WHERE id = ? AND scope = 'agent' AND isScratch = 1 AND name GLOB 'scratch-*' AND updatedAt = ?`,
506
+ )
507
+ .run(priorUpdatedAt, id, expectedUpdatedAt).changes > 0
508
+ );
509
+ }
510
+
469
511
  // ─── External script APIs (script_apis) ──────────────────────────────────────
470
512
 
471
513
  type ScriptApiRow = {
@@ -0,0 +1,164 @@
1
+ import { collectScriptReferences } from "../../apps/definition";
2
+ import { listAppRecords } from "../../apps/store";
3
+ import { getDb, listWorkflows } from "../db";
4
+
5
+ const SCRATCH_RETENTION_DAYS = 14;
6
+ const SCRATCH_GC_INTERVAL_MS = 24 * 60 * 60 * 1000;
7
+
8
+ let scratchGcTimer: ReturnType<typeof setInterval> | null = null;
9
+
10
+ /**
11
+ * Every script id wired into an app definition, as an action or model source.
12
+ *
13
+ * `candidateIds` are the GC-candidate scratch scripts this call cares about.
14
+ * A broken app (invalid stored JSON) decodes with `definition` set to the raw
15
+ * string itself, not a merge-patch object, so `collectScriptReferences` below
16
+ * finds nothing for it. Same substring-probe fallback the interactive delete
17
+ * guard applies via `appScriptReferenceIssues` in src/http/scripts.ts — a
18
+ * broken app is not consent to break it further.
19
+ */
20
+ function appReferencedScriptIds(candidateIds: readonly string[]): Set<string> {
21
+ const ids = new Set<string>();
22
+ for (const app of listAppRecords()) {
23
+ for (const scriptId of collectScriptReferences(app.definition).keys()) {
24
+ ids.add(scriptId);
25
+ }
26
+ if (app.definitionError === undefined) continue;
27
+ const serialized = JSON.stringify(app.definition ?? null);
28
+ for (const id of candidateIds) {
29
+ if (!ids.has(id) && serialized.includes(id)) ids.add(id);
30
+ }
31
+ }
32
+ return ids;
33
+ }
34
+
35
+ /**
36
+ * Every script id bound to a durable public API endpoint. `script_apis.scriptId`
37
+ * cascade-deletes with the script (`ON DELETE CASCADE`, src/be/migrations/102_script_apis.sql),
38
+ * so an unreferenced-looking scratch script backing a live `/api/x/script` endpoint
39
+ * would otherwise be silently deleted out from under it.
40
+ */
41
+ function scriptApiReferencedScriptIds(): Set<string> {
42
+ const rows = getDb()
43
+ .prepare<{ scriptId: string }, []>("SELECT DISTINCT scriptId FROM script_apis")
44
+ .all();
45
+ return new Set(rows.map((row) => row.scriptId));
46
+ }
47
+
48
+ /**
49
+ * `(name, agentId)` keys an enabled workflow's `swarm-script` node could resolve at
50
+ * agent scope. A node's `config.scriptName` resolves by NAME, not id
51
+ * (src/workflows/executors/swarm-script.ts `resolveScriptSource`), against the
52
+ * workflow's `createdByAgentId` for `scope: "agent"` or omitted scope — so a
53
+ * name/scope match against a workflow's owner is the only static signal available;
54
+ * `scope: "global"` nodes can never resolve an agent-scoped scratch candidate and
55
+ * are skipped.
56
+ */
57
+ function workflowReferencedAgentScriptKeys(): Set<string> {
58
+ const keys = new Set<string>();
59
+ for (const workflow of listWorkflows()) {
60
+ if (!workflow.createdByAgentId) continue;
61
+ for (const node of workflow.definition.nodes) {
62
+ if (node.type !== "swarm-script") continue;
63
+ const scriptName = (node.config as { scriptName?: unknown }).scriptName;
64
+ const scope = (node.config as { scope?: unknown }).scope;
65
+ if (typeof scriptName !== "string" || scope === "global") continue;
66
+ keys.add(`${scriptName}::${workflow.createdByAgentId}`);
67
+ }
68
+ }
69
+ return keys;
70
+ }
71
+
72
+ /**
73
+ * Script names an enabled `swarm-script` node could resolve at agent scope for a
74
+ * workflow with no static owner (`createdByAgentId` null — no `X-Agent-ID` at
75
+ * creation time, or a pre-migration legacy row). `SwarmScriptExecutor` falls back to
76
+ * `trigger.agentId` at run time for these (src/workflows/executors/swarm-script.ts
77
+ * `agentIdFromContext`), so the resolving agent isn't knowable statically — this
78
+ * excludes by NAME alone across every agent scope, which is over-broad (it also
79
+ * protects a same-named scratch script some *other*, unrelated agent owns) but is
80
+ * the only sound static signal available; `scope: "global"` nodes are skipped for
81
+ * the same reason as the owner-keyed variant above.
82
+ */
83
+ function workflowReferencedScratchNamesForOwnerlessWorkflows(): Set<string> {
84
+ const names = new Set<string>();
85
+ for (const workflow of listWorkflows()) {
86
+ if (workflow.createdByAgentId) continue;
87
+ for (const node of workflow.definition.nodes) {
88
+ if (node.type !== "swarm-script") continue;
89
+ const scriptName = (node.config as { scriptName?: unknown }).scriptName;
90
+ const scope = (node.config as { scope?: unknown }).scope;
91
+ if (typeof scriptName !== "string" || scope === "global") continue;
92
+ names.add(scriptName);
93
+ }
94
+ }
95
+ return names;
96
+ }
97
+
98
+ /** Delete auto-saved scratch scripts that have not run within the retention window. */
99
+ export function purgeExpiredScratchScripts(now = new Date()): number {
100
+ const cutoff = new Date(
101
+ now.getTime() - SCRATCH_RETENTION_DAYS * 24 * 60 * 60 * 1000,
102
+ ).toISOString();
103
+ const candidates = getDb()
104
+ .prepare<{ id: string; name: string; scopeId: string | null }, [string]>(
105
+ `SELECT id, name, scopeId FROM scripts
106
+ WHERE scope = 'agent'
107
+ AND isScratch = 1
108
+ AND name GLOB 'scratch-*'
109
+ AND updatedAt < ?`,
110
+ )
111
+ .all(cutoff);
112
+ if (candidates.length === 0) return 0;
113
+
114
+ // A scratch script still wired into a durable reference — an app action/model
115
+ // source, a public API endpoint, or a workflow's swarm-script node — is no
116
+ // longer "scratch" in effect; deleting it leaves that reference dangling. Same
117
+ // guard the interactive scripts-API delete route enforces for app references via
118
+ // appScriptReferenceIssues, applied here to the whole sweep at once, plus the two
119
+ // durable reference kinds that guard doesn't cover either.
120
+ const referenced = appReferencedScriptIds(candidates.map((row) => row.id));
121
+ const apiReferenced = scriptApiReferencedScriptIds();
122
+ const workflowReferenced = workflowReferencedAgentScriptKeys();
123
+ const ownerlessWorkflowReferencedNames = workflowReferencedScratchNamesForOwnerlessWorkflows();
124
+ const idsToDelete = candidates
125
+ .filter((row) => !referenced.has(row.id))
126
+ .filter((row) => !apiReferenced.has(row.id))
127
+ .filter((row) => !(row.scopeId && workflowReferenced.has(`${row.name}::${row.scopeId}`)))
128
+ .filter((row) => !ownerlessWorkflowReferencedNames.has(row.name))
129
+ .map((row) => row.id);
130
+ if (idsToDelete.length === 0) return 0;
131
+
132
+ const placeholders = idsToDelete.map(() => "?").join(",");
133
+ return (
134
+ getDb()
135
+ .prepare<{ id: string }, string[]>(
136
+ `DELETE FROM scripts WHERE id IN (${placeholders}) RETURNING id`,
137
+ )
138
+ // RETURNING counts scripts only; SQLite's change count includes cascaded rows.
139
+ .all(...idsToDelete).length
140
+ );
141
+ }
142
+
143
+ function runScratchScriptGc(label: "Initial" | "Periodic"): void {
144
+ try {
145
+ const purged = purgeExpiredScratchScripts();
146
+ console.log(`[scratch-script-gc] ${label} purge removed ${purged} scratch script row(s)`);
147
+ } catch (err) {
148
+ console.error(`[scratch-script-gc] ${label} purge failed:`, (err as Error).message);
149
+ }
150
+ }
151
+
152
+ /** Start the scratch-script retention GC (daily tick, immediate first run). */
153
+ export function startScratchScriptGc(intervalMs = SCRATCH_GC_INTERVAL_MS): void {
154
+ if (scratchGcTimer) return;
155
+ runScratchScriptGc("Initial");
156
+ scratchGcTimer = setInterval(() => runScratchScriptGc("Periodic"), intervalMs);
157
+ if (typeof scratchGcTimer.unref === "function") scratchGcTimer.unref();
158
+ }
159
+
160
+ export function stopScratchScriptGc(): void {
161
+ if (!scratchGcTimer) return;
162
+ clearInterval(scratchGcTimer);
163
+ scratchGcTimer = null;
164
+ }