@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,10 +1,10 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-78xwvkhj.js";
4
- import"./cli-psh3c4va.js";
3
+ } from "./cli-7dm2zqy2.js";
4
+ import"./cli-aca5pz9f.js";
5
5
  import {
6
6
  createTaskWithSiblingAwareness
7
- } from "./cli-cdeg08wx.js";
7
+ } from "./cli-2f07m0xr.js";
8
8
  import {
9
9
  buildCancelledBlocks,
10
10
  ensureSlackThreadTree,
@@ -12,7 +12,7 @@ import {
12
12
  getAgentEmoji,
13
13
  getTaskLink,
14
14
  isSlackRenderV2Enabled
15
- } from "./cli-cvgjwnh1.js";
15
+ } from "./cli-rgrfzg8z.js";
16
16
  import"./cli-k9qkf1hw.js";
17
17
  import"./cli-b0p7rfnd.js";
18
18
  import"./cli-t930g0xh.js";
@@ -24,13 +24,13 @@ import {
24
24
  init_context_key,
25
25
  init_db,
26
26
  slackContextKey
27
- } from "./cli-a4jzdpa3.js";
27
+ } from "./cli-50vbt00w.js";
28
28
  import"./cli-xpxde7rm.js";
29
29
  import"./cli-x23me2mg.js";
30
30
  import"./cli-z2zcxes1.js";
31
31
  import"./cli-zsspvvm2.js";
32
32
  import"./cli-4j2mrzag.js";
33
- import"./cli-72q8m8gk.js";
33
+ import"./cli-ccf9vy7q.js";
34
34
  import"./cli-5dsbcjjw.js";
35
35
  import"./cli-e15jhafb.js";
36
36
  import"./cli-3fj60etf.js";
@@ -3,17 +3,17 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-cvgjwnh1.js";
6
+ } from "./cli-rgrfzg8z.js";
7
7
  import"./cli-k9qkf1hw.js";
8
8
  import"./cli-b0p7rfnd.js";
9
9
  import"./cli-t930g0xh.js";
10
- import"./cli-a4jzdpa3.js";
10
+ import"./cli-50vbt00w.js";
11
11
  import"./cli-xpxde7rm.js";
12
12
  import"./cli-x23me2mg.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-zsspvvm2.js";
15
15
  import"./cli-4j2mrzag.js";
16
- import"./cli-72q8m8gk.js";
16
+ import"./cli-ccf9vy7q.js";
17
17
  import"./cli-5dsbcjjw.js";
18
18
  import"./cli-e15jhafb.js";
19
19
  import"./cli-3fj60etf.js";
@@ -2,24 +2,24 @@ import {
2
2
  bufferThreadMessage,
3
3
  getBufferMessageCount,
4
4
  wasEventSeen
5
- } from "./cli-a40rnf71.js";
5
+ } from "./cli-ygrbmjja.js";
6
6
  import {
7
7
  hasOtherUserMention
8
- } from "./cli-d3x3x1c9.js";
8
+ } from "./cli-6dpytdr2.js";
9
9
  import {
10
10
  resolveSlackUserId,
11
11
  rewriteSlackMentions
12
- } from "./cli-78xwvkhj.js";
13
- import"./cli-psh3c4va.js";
12
+ } from "./cli-7dm2zqy2.js";
13
+ import"./cli-aca5pz9f.js";
14
14
  import {
15
15
  createTaskWithSiblingAwareness
16
- } from "./cli-cdeg08wx.js";
16
+ } from "./cli-2f07m0xr.js";
17
17
  import {
18
18
  ackSlackMessage,
19
19
  ensureSlackThreadTree,
20
20
  isSlackRenderV2Enabled,
21
21
  require_dist
22
- } from "./cli-cvgjwnh1.js";
22
+ } from "./cli-rgrfzg8z.js";
23
23
  import"./cli-k9qkf1hw.js";
24
24
  import"./cli-b0p7rfnd.js";
25
25
  import"./cli-t930g0xh.js";
@@ -30,7 +30,7 @@ import {
30
30
  init_context_key,
31
31
  init_db,
32
32
  slackContextKey
33
- } from "./cli-a4jzdpa3.js";
33
+ } from "./cli-50vbt00w.js";
34
34
  import {
35
35
  init_env_flag,
36
36
  init_resolver,
@@ -41,7 +41,7 @@ import"./cli-x23me2mg.js";
41
41
  import"./cli-z2zcxes1.js";
42
42
  import"./cli-zsspvvm2.js";
43
43
  import"./cli-4j2mrzag.js";
44
- import"./cli-72q8m8gk.js";
44
+ import"./cli-ccf9vy7q.js";
45
45
  import"./cli-5dsbcjjw.js";
46
46
  import"./cli-e15jhafb.js";
47
47
  import"./cli-3fj60etf.js";
@@ -3,18 +3,18 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-rzbpmxdr.js";
6
+ } from "./cli-se2p6rkb.js";
7
7
  import"./cli-0258203w.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-a4jzdpa3.js";
11
+ } from "./cli-50vbt00w.js";
12
12
  import"./cli-xpxde7rm.js";
13
13
  import"./cli-x23me2mg.js";
14
14
  import"./cli-z2zcxes1.js";
15
15
  import"./cli-zsspvvm2.js";
16
16
  import"./cli-4j2mrzag.js";
17
- import"./cli-72q8m8gk.js";
17
+ import"./cli-ccf9vy7q.js";
18
18
  import"./cli-5dsbcjjw.js";
19
19
  import"./cli-p9swy5t3.js";
20
20
 
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-qv61hp37.js";
5
- import"./cli-rzbpmxdr.js";
4
+ } from "./cli-g1re8r05.js";
5
+ import"./cli-se2p6rkb.js";
6
6
  import"./cli-0258203w.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-a4jzdpa3.js";
10
+ } from "./cli-50vbt00w.js";
11
11
  import"./cli-xpxde7rm.js";
12
12
  import"./cli-x23me2mg.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-zsspvvm2.js";
15
15
  import"./cli-4j2mrzag.js";
16
- import"./cli-72q8m8gk.js";
16
+ import"./cli-ccf9vy7q.js";
17
17
  import"./cli-5dsbcjjw.js";
18
18
  import"./cli-p9swy5t3.js";
19
19
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-a4jzdpa3.js";
4
+ } from "./cli-50vbt00w.js";
5
5
  import"./cli-xpxde7rm.js";
6
6
  import"./cli-x23me2mg.js";
7
7
  import"./cli-z2zcxes1.js";
@@ -10,7 +10,7 @@ import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
12
12
  } from "./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
 
@@ -12,10 +12,10 @@ import {
12
12
  resolveClaudeBinary,
13
13
  resolveClaudeBinaryArgv,
14
14
  resolveClaudeBridgeEnabled
15
- } from "./cli-3kf51j15.js";
16
- import"./cli-70xqj0z3.js";
15
+ } from "./cli-kd1ck4rx.js";
16
+ import"./cli-2rk0cx7s.js";
17
17
  import"./cli-psrqtw2m.js";
18
- import"./cli-0rcyq6d9.js";
18
+ import"./cli-w2wxd56v.js";
19
19
  import"./cli-yv9dttkh.js";
20
20
  import"./cli-tng3131n.js";
21
21
  import"./cli-zm7njwzd.js";
@@ -32,7 +32,7 @@ import"./cli-x23me2mg.js";
32
32
  import"./cli-z2zcxes1.js";
33
33
  import"./cli-zsspvvm2.js";
34
34
  import"./cli-4j2mrzag.js";
35
- import"./cli-72q8m8gk.js";
35
+ import"./cli-ccf9vy7q.js";
36
36
  import"./cli-5dsbcjjw.js";
37
37
  import"./cli-darcwax3.js";
38
38
  import"./cli-4wgngmwv.js";
@@ -3,7 +3,7 @@ import {
3
3
  checkClaudeManagedCredentials,
4
4
  composeManagedUserMessage,
5
5
  normalizeRepoUrl
6
- } from "./cli-qmdnhpej.js";
6
+ } from "./cli-wz9115x0.js";
7
7
  import"./cli-07er7wrs.js";
8
8
  import"./cli-d6n0thxw.js";
9
9
  import"./cli-yv9dttkh.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-a4jzdpa3.js";
4
+ } from "./cli-50vbt00w.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-a4jzdpa3.js";
6
+ } from "./cli-50vbt00w.js";
7
7
 
8
8
  // src/tasks/sibling-awareness.ts
9
9
  init_db();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  summarizeSession
3
- } from "./cli-0rcyq6d9.js";
3
+ } from "./cli-w2wxd56v.js";
4
4
  import {
5
5
  checkToolLoop,
6
6
  clearToolHistory
@@ -33,7 +33,7 @@ import {
33
33
  import {
34
34
  init_package,
35
35
  package_default
36
- } from "./cli-72q8m8gk.js";
36
+ } from "./cli-ccf9vy7q.js";
37
37
 
38
38
  // src/hooks/hook.ts
39
39
  init_package();
@@ -16,7 +16,7 @@ import {
16
16
  init_db,
17
17
  init_templates1 as init_templates,
18
18
  normalizeDateRequired
19
- } from "./cli-a4jzdpa3.js";
19
+ } from "./cli-50vbt00w.js";
20
20
  import {
21
21
  init_env_flag,
22
22
  init_resolver,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  SYSTEM_COLUMN_KINDS,
3
3
  listAppRecords
4
- } from "./cli-2q72qz2s.js";
4
+ } from "./cli-gecy3z2s.js";
5
5
  import {
6
6
  getScriptApiTypes,
7
7
  getScriptMcpTypes,
8
8
  require_typescript
9
- } from "./cli-pm6xbh84.js";
9
+ } from "./cli-6dp3ydxa.js";
10
10
  import {
11
11
  deleteSwarmConfigByKey,
12
12
  getAgentById,
@@ -15,7 +15,7 @@ import {
15
15
  getSwarmConfigs,
16
16
  init_db,
17
17
  upsertSwarmConfig
18
- } from "./cli-a4jzdpa3.js";
18
+ } from "./cli-50vbt00w.js";
19
19
  import {
20
20
  init_secret_scrubber,
21
21
  scrubSecrets
@@ -29,7 +29,7 @@ import {
29
29
  import {
30
30
  init_package,
31
31
  package_default
32
- } from "./cli-72q8m8gk.js";
32
+ } from "./cli-ccf9vy7q.js";
33
33
  import {
34
34
  _enum,
35
35
  array,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./cli-f14fvzag.js";
7
7
  import {
8
8
  embedScript
9
- } from "./cli-qv61hp37.js";
9
+ } from "./cli-g1re8r05.js";
10
10
  import {
11
11
  calculatePKCECodeChallenge,
12
12
  ensureAuthorizationTokenOrThrow,
@@ -18,7 +18,7 @@ import {
18
18
  oauthAppRowToProviderConfig,
19
19
  updateAuthorizationTokens,
20
20
  upsertAuthorization
21
- } from "./cli-g6b8x1h8.js";
21
+ } from "./cli-nrkkknat.js";
22
22
  import {
23
23
  CredentialBroker,
24
24
  DEFAULT_CREDENTIAL_BINDINGS,
@@ -38,7 +38,7 @@ import {
38
38
  normalizeDateRequired,
39
39
  placeholderForConfigKey,
40
40
  upsertSwarmConfig
41
- } from "./cli-a4jzdpa3.js";
41
+ } from "./cli-50vbt00w.js";
42
42
  import {
43
43
  init_env_flag,
44
44
  isEnvFlagEnabled
@@ -171126,7 +171126,8 @@ async function upsertScriptByName(args) {
171126
171126
  const argsJsonSchema2 = args.argsJsonSchema !== undefined ? args.argsJsonSchema : existing.argsJsonSchema;
171127
171127
  const trackedMetadataChanged = args.description !== existing.description || args.intent !== existing.intent || args.signatureJson !== existing.signatureJson || argsJsonSchema2 !== existing.argsJsonSchema;
171128
171128
  const promotedFromScratch = existing.isScratch && !isScratch2;
171129
- if (fsMode2 !== existing.fsMode || isScratch2 !== existing.isScratch || typeChecked2 !== existing.typeChecked || trackedMetadataChanged) {
171129
+ const refreshScratchLastUsed = existing.scope === "agent" && existing.name.startsWith("scratch-") && existing.isScratch && isScratch2;
171130
+ if (fsMode2 !== existing.fsMode || isScratch2 !== existing.isScratch || typeChecked2 !== existing.typeChecked || trackedMetadataChanged || refreshScratchLastUsed) {
171130
171131
  const row = getDb().prepare(`UPDATE scripts
171131
171132
  SET description = ?, intent = ?, signatureJson = ?, argsJsonSchema = ?,
171132
171133
  isScratch = ?, typeChecked = ?, fsMode = ?, updatedAt = ?, updated_by = ?
@@ -171235,6 +171236,15 @@ function deleteScript(args) {
171235
171236
  const result = getDb().run("DELETE FROM scripts WHERE id = ?", [existing.id]);
171236
171237
  return result.changes > 0;
171237
171238
  }
171239
+ function touchScratchScriptLastUsed(id, at = new Date().toISOString()) {
171240
+ const result = getDb().prepare(`UPDATE scripts SET updatedAt = ?
171241
+ WHERE id = ? AND scope = 'agent' AND isScratch = 1 AND name GLOB 'scratch-*'`).run(at, id);
171242
+ return result.changes > 0 ? at : null;
171243
+ }
171244
+ function restoreScratchScriptLastUsedIfUnchanged(id, priorUpdatedAt, expectedUpdatedAt) {
171245
+ return getDb().prepare(`UPDATE scripts SET updatedAt = ?
171246
+ WHERE id = ? AND scope = 'agent' AND isScratch = 1 AND name GLOB 'scratch-*' AND updatedAt = ?`).run(priorUpdatedAt, id, expectedUpdatedAt).changes > 0;
171247
+ }
171238
171248
  var SCRIPT_API_ID_LEN = 12;
171239
171249
  function rowToScriptApi(row) {
171240
171250
  return {
@@ -171359,23 +171369,39 @@ var DEFAULT_SANDBOX_LIMITS = {
171359
171369
  maxFdCount: 64
171360
171370
  };
171361
171371
  var BUN_SANDBOX_VIRTUAL_MEMORY_MB = 4096;
171372
+ var JAVASCRIPT_RUNTIME_SANDBOX_MAX_PROCS = 512;
171373
+ var JAVASCRIPT_RUNTIMES = new Set(["bun", "bunx", "node", "nodejs", "npx"]);
171374
+ var SHELL_RUNTIMES = new Set(["bash", "dash", "sh"]);
171375
+ function commandBasename(command) {
171376
+ return command.slice(command.lastIndexOf("/") + 1);
171377
+ }
171378
+ function usesInterpreterSandboxProfile(innerCommand) {
171379
+ const runtime = commandBasename(innerCommand[0] ?? "");
171380
+ return JAVASCRIPT_RUNTIMES.has(runtime) || SHELL_RUNTIMES.has(runtime);
171381
+ }
171362
171382
  function shellQuote(value) {
171363
171383
  return `'${value.replaceAll("'", "'\\''")}'`;
171364
171384
  }
171365
171385
  function buildSandboxedCommand(innerCommand, env, limits = DEFAULT_SANDBOX_LIMITS) {
171366
171386
  if (process.platform === "win32")
171367
171387
  return [...innerCommand];
171368
- const virtualMemoryMb = innerCommand[0] === "bun" ? Math.max(limits.virtualMemoryMb, BUN_SANDBOX_VIRTUAL_MEMORY_MB) : limits.virtualMemoryMb;
171388
+ const usesInterpreterProfile = usesInterpreterSandboxProfile(innerCommand);
171389
+ const virtualMemoryMb = usesInterpreterProfile ? Math.max(limits.virtualMemoryMb, BUN_SANDBOX_VIRTUAL_MEMORY_MB) : limits.virtualMemoryMb;
171390
+ const maxProcs = usesInterpreterProfile ? Math.max(limits.maxProcs, JAVASCRIPT_RUNTIME_SANDBOX_MAX_PROCS) : limits.maxProcs;
171369
171391
  const ulimits = [
171370
171392
  `ulimit -v ${Math.floor(virtualMemoryMb * 1024)} 2>/dev/null || true`,
171371
171393
  `ulimit -t ${limits.cpuTimeSec} 2>/dev/null || true`,
171372
- `ulimit -u ${limits.maxProcs} 2>/dev/null || true`,
171394
+ `ulimit -u ${maxProcs} 2>/dev/null || true`,
171373
171395
  `ulimit -f ${limits.maxFileKb} 2>/dev/null || true`,
171374
171396
  `ulimit -n ${limits.maxFdCount} 2>/dev/null || true`
171375
171397
  ].join("; ");
171376
171398
  const envAssignments = Object.entries(env).map(([key, value]) => `${key}=${shellQuote(value)}`).join(" ");
171377
171399
  const quotedInner = innerCommand.map(shellQuote).join(" ");
171378
- return ["sh", "-c", `${ulimits}; exec env -i ${envAssignments} ${quotedInner}`];
171400
+ return [
171401
+ usesInterpreterProfile ? "bash" : "sh",
171402
+ "-c",
171403
+ `${ulimits}; exec env -i ${envAssignments} ${quotedInner}`
171404
+ ];
171379
171405
  }
171380
171406
  function sandboxSpawnEnv(env) {
171381
171407
  return process.platform === "win32" ? { ...env } : { PATH: env.PATH ?? "" };
@@ -171822,4 +171848,4 @@ async function buildScriptCredentialBindings(input) {
171822
171848
  return (await buildScriptCredentialBindingsWithFailures(input)).egressSecrets;
171823
171849
  }
171824
171850
 
171825
- export { MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, isInvalidClientError, assertUrlSafe, publicEndpointSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, listVendoredOpenapiEntries, ConnectionAuthInputSchema, connectionAuthSummary, listRelationalCredentialBindings, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, getScriptConnectionById, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, upsertScriptByName, getScript, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, require_typescript, validateScriptImports, runScript, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings };
171851
+ export { MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, isInvalidClientError, assertUrlSafe, publicEndpointSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, listVendoredOpenapiEntries, ConnectionAuthInputSchema, connectionAuthSummary, listRelationalCredentialBindings, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, getScriptConnectionById, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, upsertScriptByName, getScript, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, require_typescript, validateScriptImports, runScript, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings };
@@ -3,7 +3,7 @@ import {
3
3
  getAgentWorkingOnThread,
4
4
  getAllAgents,
5
5
  init_db
6
- } from "./cli-a4jzdpa3.js";
6
+ } from "./cli-50vbt00w.js";
7
7
  import {
8
8
  init_env_flag,
9
9
  isEnvFlagEnabled
@@ -3,10 +3,10 @@ import {
3
3
  } from "./cli-f1am9szv.js";
4
4
  import {
5
5
  checkCodexCredentials
6
- } from "./cli-5kx36evn.js";
6
+ } from "./cli-793jvbsh.js";
7
7
  import {
8
8
  checkClaudeManagedCredentials
9
- } from "./cli-qmdnhpej.js";
9
+ } from "./cli-wz9115x0.js";
10
10
  import {
11
11
  checkDevinCredentials
12
12
  } from "./cli-9b13ggd1.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./cli-n6h8qt8n.js";
16
16
  import {
17
17
  checkClaudeCredentials
18
- } from "./cli-3kf51j15.js";
18
+ } from "./cli-kd1ck4rx.js";
19
19
  import {
20
20
  MAX_RATE_LIMIT_RESET_MS,
21
21
  isCodexCreditsExhaustedMessage,
@@ -35,7 +35,7 @@ import {
35
35
  withSpan,
36
36
  withSpanContext,
37
37
  writeSkillsToFilesystem
38
- } from "./cli-t76vw5db.js";
38
+ } from "./cli-jevgrb4w.js";
39
39
  import {
40
40
  authJsonToCredentialSelection,
41
41
  credentialsToAuthJson,
@@ -44,10 +44,10 @@ import {
44
44
  import {
45
45
  ensure,
46
46
  initialize
47
- } from "./cli-5ze9rv97.js";
47
+ } from "./cli-ycrnynpw.js";
48
48
  import {
49
49
  validateJsonSchema
50
- } from "./cli-yw8vghx2.js";
50
+ } from "./cli-jbcva0xj.js";
51
51
  import {
52
52
  getOpenRouterBaseUrl
53
53
  } from "./cli-3dpj7atn.js";
@@ -78,7 +78,7 @@ import {
78
78
  init_types,
79
79
  resolveTaskModelSelection,
80
80
  telemetry
81
- } from "./cli-a4jzdpa3.js";
81
+ } from "./cli-50vbt00w.js";
82
82
  import {
83
83
  configureHttpResolver,
84
84
  init_resolver,
@@ -495,19 +495,19 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
495
495
  async function createProviderAdapter(provider) {
496
496
  switch (provider) {
497
497
  case "claude": {
498
- const { ClaudeAdapter } = await import("./claude-adapter-2y47mrkd.js");
498
+ const { ClaudeAdapter } = await import("./claude-adapter-q6x7yspx.js");
499
499
  return new ClaudeAdapter;
500
500
  }
501
501
  case "pi": {
502
- const { PiMonoAdapter } = await import("./pi-mono-adapter-t091s27g.js");
502
+ const { PiMonoAdapter } = await import("./pi-mono-adapter-4g5kby31.js");
503
503
  return new PiMonoAdapter;
504
504
  }
505
505
  case "codex": {
506
- const { CodexAdapter } = await import("./codex-adapter-d24q75wk.js");
506
+ const { CodexAdapter } = await import("./codex-adapter-htjkn22b.js");
507
507
  return new CodexAdapter;
508
508
  }
509
509
  case "claude-managed": {
510
- const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-gv19tdew.js");
510
+ const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-wsg37bt8.js");
511
511
  return new ClaudeManagedAdapter;
512
512
  }
513
513
  case "devin": {
@@ -1201,7 +1201,7 @@ async function checkProviderCredentials(provider, env, opts) {
1201
1201
  case "opencode":
1202
1202
  return checkOpencodeCredentials(env, opts);
1203
1203
  case "pi": {
1204
- const { checkPiMonoCredentials } = await import("./pi-mono-adapter-t091s27g.js");
1204
+ const { checkPiMonoCredentials } = await import("./pi-mono-adapter-4g5kby31.js");
1205
1205
  return checkPiMonoCredentials(env, opts);
1206
1206
  }
1207
1207
  default:
@@ -13,7 +13,7 @@ import {
13
13
  } from "./cli-psrqtw2m.js";
14
14
  import {
15
15
  summarizeSession
16
- } from "./cli-0rcyq6d9.js";
16
+ } from "./cli-w2wxd56v.js";
17
17
  import {
18
18
  CTX_MODE_NUDGE_EVERY
19
19
  } from "./cli-zm7njwzd.js";
@@ -4,12 +4,12 @@ import {
4
4
  linkIdentity,
5
5
  recordUnmappedIdentity,
6
6
  resolveIdentity
7
- } from "./cli-psh3c4va.js";
7
+ } from "./cli-aca5pz9f.js";
8
8
  import {
9
9
  getKv,
10
10
  init_db,
11
11
  upsertKv
12
- } from "./cli-a4jzdpa3.js";
12
+ } from "./cli-50vbt00w.js";
13
13
 
14
14
  // src/slack/enrich.ts
15
15
  init_db();
@@ -4,7 +4,7 @@ import {
4
4
  incrKv,
5
5
  init_db,
6
6
  upsertKv
7
- } from "./cli-a4jzdpa3.js";
7
+ } from "./cli-50vbt00w.js";
8
8
 
9
9
  // src/be/users.ts
10
10
  init_db();
@@ -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.131.0",
10
+ version: "1.131.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",
@@ -183,7 +183,7 @@ var init_package = __esm(() => {
183
183
  "@linear/sdk": "^77.0.0",
184
184
  "@modelcontextprotocol/sdk": "^1.25.1",
185
185
  "@openai/codex-sdk": "^0.147.0",
186
- "@opencode-ai/sdk": "^1.18.15",
186
+ "@opencode-ai/sdk": "^1.18.16",
187
187
  "@openfort/openfort-node": "^0.9.1",
188
188
  "@opentelemetry/api": "^1.9.1",
189
189
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-rzbpmxdr.js";
7
+ } from "./cli-se2p6rkb.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-a4jzdpa3.js";
11
+ } from "./cli-50vbt00w.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -7,11 +7,11 @@ import {
7
7
  getPinCandidateAgent,
8
8
  getResumeGeneration,
9
9
  repointTrackerSyncBySwarmId
10
- } from "./cli-nm5gtp1x.js";
10
+ } from "./cli-3ty0t082.js";
11
11
  import {
12
12
  getExecutorRegistry,
13
13
  recoverIncompleteRuns
14
- } from "./cli-yw8vghx2.js";
14
+ } from "./cli-jbcva0xj.js";
15
15
  import {
16
16
  MAX_EMPTY_POLLS,
17
17
  assignUnassignedTaskPending,
@@ -51,7 +51,7 @@ import {
51
51
  releaseStaleReviewingTasks,
52
52
  supersedeTask,
53
53
  updateAgentStatus
54
- } from "./cli-a4jzdpa3.js";
54
+ } from "./cli-50vbt00w.js";
55
55
  import {
56
56
  init_registry,
57
57
  init_resolver,
@@ -4,15 +4,17 @@ import {
4
4
  getScriptById,
5
5
  getScriptMcpConnectionDescriptors,
6
6
  listScriptConnections,
7
- runScript
8
- } from "./cli-pm6xbh84.js";
7
+ restoreScratchScriptLastUsedIfUnchanged,
8
+ runScript,
9
+ touchScratchScriptLastUsed
10
+ } from "./cli-6dp3ydxa.js";
9
11
  import {
10
12
  defaultAssetKey,
11
13
  getDb,
12
14
  getLeadAgent,
13
15
  init_db,
14
16
  init_key
15
- } from "./cli-a4jzdpa3.js";
17
+ } from "./cli-50vbt00w.js";
16
18
  import {
17
19
  init_zod
18
20
  } from "./cli-zsspvvm2.js";
@@ -36,10 +38,11 @@ function getSavedScriptOwnerAgentId(script) {
36
38
  return script.scopeId ?? script.createdByAgentId;
37
39
  }
38
40
  async function runSavedScriptAsAgent(args) {
41
+ const runStartTouch = args.script.isScratch ? touchScratchScriptLastUsed(args.script.id) : null;
39
42
  const credentials = await buildScriptCredentialBindingsWithFailures({
40
43
  agentId: args.agentId
41
44
  });
42
- return runScript({
45
+ const output = await runScript({
43
46
  source: args.script.source,
44
47
  args: args.input,
45
48
  fsMode: args.script.fsMode,
@@ -49,6 +52,12 @@ async function runSavedScriptAsAgent(args) {
49
52
  apiConnections: getScriptApiConnectionDescriptors({ agentId: args.agentId }),
50
53
  mcpConnections: getScriptMcpConnectionDescriptors({ agentId: args.agentId })
51
54
  });
55
+ if (output.exitCode === 0 && !output.error && !output.runtimeError) {
56
+ touchScratchScriptLastUsed(args.script.id);
57
+ } else if (runStartTouch) {
58
+ restoreScratchScriptLastUsedIfUnchanged(args.script.id, args.script.updatedAt, runStartTouch);
59
+ }
60
+ return output;
52
61
  }
53
62
 
54
63
  // src/apps/definition.ts