@desplega.ai/agent-swarm 1.135.0 → 1.135.2

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 (118) hide show
  1. package/README.md +1 -1
  2. package/dist/{actions-3fpj602h.js → actions-3az2vwwn.js} +6 -6
  3. package/dist/{anthropic-messages-706yad38.js → anthropic-messages-pm7pp23c.js} +36 -23
  4. package/dist/{app-12mwdsvg.js → app-vygnfvrh.js} +3 -3
  5. package/dist/{assistant-p87pt2b5.js → assistant-2jr2frrm.js} +8 -8
  6. package/dist/{azure-openai-responses-40z2astx.js → azure-openai-responses-cwesc845.js} +13 -4
  7. package/dist/{boot-reembed-jf6gx8yr.js → boot-reembed-ncbg16rb.js} +4 -4
  8. package/dist/{boot-reembed-vjkptm2x.js → boot-reembed-y7r9cxt0.js} +3 -3
  9. package/dist/{boot-scrub-logs-ah6bpjte.js → boot-scrub-logs-t82rwa0y.js} +2 -2
  10. package/dist/{claude-adapter-9ry59y9k.js → claude-adapter-vvx2aw3v.js} +5 -5
  11. package/dist/{claude-managed-adapter-m2v2e90a.js → claude-managed-adapter-5zr3n86v.js} +2 -2
  12. package/dist/{cli-77vf7z36.js → cli-0crn5kaz.js} +7 -16
  13. package/dist/{cli-h9gpdrzg.js → cli-0jhyxtdj.js} +2 -2
  14. package/dist/cli-0v7jxbvz.js +6724 -0
  15. package/dist/{cli-w3xch1b8.js → cli-1857msnd.js} +1 -1
  16. package/dist/{cli-y98ry8cz.js → cli-1dfatkzm.js} +1 -1
  17. package/dist/{cli-a2brkr6h.js → cli-1z01xdqh.js} +5 -5
  18. package/dist/{cli-d08xq4nz.js → cli-3f0tnh34.js} +102 -45
  19. package/dist/{cli-w4ezqgkj.js → cli-4dakdn30.js} +6 -6
  20. package/dist/{cli-10694wk0.js → cli-4rdjdddh.js} +1 -1
  21. package/dist/{cli-j2p3bfs3.js → cli-5a5nrq3g.js} +5 -5
  22. package/dist/{cli-dphm5tyw.js → cli-6290n4yz.js} +1 -1
  23. package/dist/{cli-f2tgry1v.js → cli-6bz2hzvw.js} +2 -2
  24. package/dist/{cli-bynsg176.js → cli-6mmwmy45.js} +20 -9
  25. package/dist/{cli-crkvptsz.js → cli-7ccy0h4r.js} +2 -2
  26. package/dist/{cli-wzmeara2.js → cli-83razmqg.js} +38 -12
  27. package/dist/{cli-8ca5b9j9.js → cli-8f4h27gm.js} +1 -1
  28. package/dist/{cli-vtz6yj3v.js → cli-9phjbffs.js} +1 -1
  29. package/dist/{cli-y37pxs1m.js → cli-a1zrc2g6.js} +146 -96
  30. package/dist/{cli-vd2twm2p.js → cli-cf6vq6qa.js} +1 -1
  31. package/dist/{cli-9kekm9yz.js → cli-cm4z7w7w.js} +2 -2
  32. package/dist/{cli-269pdgm4.js → cli-cv2vjg2y.js} +1 -1
  33. package/dist/{cli-3m4mkyqy.js → cli-ey09krp2.js} +1 -1
  34. package/dist/{cli-2gwpvmew.js → cli-fhsz3twr.js} +1 -171
  35. package/dist/{cli-yd6vqt1x.js → cli-fmha74ga.js} +9 -7
  36. package/dist/{cli-1gvam274.js → cli-j3xnd5b4.js} +22 -6
  37. package/dist/{cli-xmyqv00z.js → cli-j8dggbcr.js} +17 -11
  38. package/dist/{cli-p0sqfhw1.js → cli-jfrh963q.js} +14 -14
  39. package/dist/{cli-z6gdnbjy.js → cli-mfa2eaef.js} +5 -5
  40. package/dist/cli-n1q8q14d.js +177 -0
  41. package/dist/{cli-md759nb0.js → cli-nhvym0d2.js} +3 -3
  42. package/dist/{cli-prfghf4h.js → cli-qxn3g3yx.js} +72 -45
  43. package/dist/{cli-2ecesrtw.js → cli-r5vwg1ma.js} +4 -4
  44. package/dist/{cli-tv9f1kyb.js → cli-s73zwwqn.js} +97 -7
  45. package/dist/{cli-3zmdzfjf.js → cli-s9gpxh9q.js} +17 -2
  46. package/dist/{cli-1gzz6pmf.js → cli-w0ygcv43.js} +1 -1
  47. package/dist/{cli-v21nahej.js → cli-yw2z5kj9.js} +1 -1
  48. package/dist/cli.js +19 -19
  49. package/dist/{codex-adapter-6r08aepx.js → codex-adapter-6p290yq3.js} +4 -4
  50. package/dist/{codex-session-runner-9dk036pn.js → codex-session-runner-7b3dhpmx.js} +4 -4
  51. package/dist/{commands-kg7cm1jz.js → commands-wxg1g4nq.js} +2 -2
  52. package/dist/{db-g666qxpv.js → db-8fqeheve.js} +2 -2
  53. package/dist/{google-generative-ai-b0wzss55.js → google-generative-ai-6xxdj4t3.js} +20 -13
  54. package/dist/{google-vertex-e8q4dpya.js → google-vertex-zma18wb0.js} +19 -12
  55. package/dist/{handlers-58k0e9mc.js → handlers-gwtqp17c.js} +13 -10
  56. package/dist/{hook-gezxk50h.js → hook-gd9fwfp0.js} +5 -5
  57. package/dist/{hook-51ez1v2s.js → hook-mrqygs7p.js} +3 -3
  58. package/dist/{http-d4qhhnyy.js → http-x4mc1mqg.js} +50 -47
  59. package/dist/{index-c06j5e9e.js → index-2mdqrd0n.js} +10 -10
  60. package/dist/{index-kvgmhb7w.js → index-4djjkp9z.js} +9 -9
  61. package/dist/index-g9tttwkm.js +26012 -0
  62. package/dist/{index-ys39hr8t.js → index-pzgasj16.js} +11 -11
  63. package/dist/{index-h96j88n6.js → index-yd654kac.js} +9 -9
  64. package/dist/{keepalive-b6n7th6x.js → keepalive-3tycspcy.js} +4 -4
  65. package/dist/{lead-3wgc402v.js → lead-js1h3z7d.js} +30 -29
  66. package/dist/{maintenance-wr20z889.js → maintenance-y91ry8q4.js} +4 -4
  67. package/dist/{mistral-conversations-2njwdwhj.js → mistral-conversations-hdmnkf6h.js} +9 -2
  68. package/dist/{oauth-refresh-sweep-brxmpz1j.js → oauth-refresh-sweep-s33gtxrw.js} +3 -3
  69. package/dist/{onboard-88hgdp28.js → onboard-vndj64mb.js} +2 -2
  70. package/dist/{openai-codex-responses-kt84eq86.js → openai-codex-responses-xxca1qr1.js} +9 -6
  71. package/dist/{openai-completions-kasahkpq.js → openai-completions-cwy2kkzg.js} +105 -70
  72. package/dist/{openai-responses-175qgngv.js → openai-responses-e4dcwm9g.js} +10 -4
  73. package/dist/{opencode-adapter-rar9676j.js → opencode-adapter-sx38y7f7.js} +3 -3
  74. package/dist/{otel-impl-an7gh3eh.js → otel-impl-d2p84k6e.js} +4 -4
  75. package/dist/{pi-messages-txp9f97r.js → pi-messages-2d3e7egd.js} +1 -1
  76. package/dist/{pi-mono-adapter-6vmrr3g8.js → pi-mono-adapter-1phspz2y.js} +96035 -130798
  77. package/dist/{pricing-refresh-ettrct0b.js → pricing-refresh-c2bwsyk5.js} +4 -4
  78. package/dist/{rbac-roles-grtmky49.js → rbac-roles-2pedz5e9.js} +2 -2
  79. package/dist/{rbac-roles-wdwpg5fc.js → rbac-roles-reef5y2d.js} +3 -3
  80. package/dist/{registry-2g6d2p3n.js → registry-6nvn6bj0.js} +2 -1
  81. package/dist/{render-v2-k7h2sbmp.js → render-v2-zd5r5wgf.js} +3 -3
  82. package/dist/{seed-pricing-gtqxtqzc.js → seed-pricing-2kyk1vhg.js} +3 -3
  83. package/dist/{setup-3tcfqyz9.js → setup-5ys9pwyr.js} +2 -2
  84. package/dist/{worker-9tejebcv.js → worker-nb1f7k04.js} +30 -29
  85. package/openapi.json +16 -5
  86. package/package.json +6 -6
  87. package/src/be/db.ts +52 -26
  88. package/src/be/migrations/runner.ts +78 -17
  89. package/src/be/seed/agent-fs-provision.ts +37 -8
  90. package/src/http/db-query.ts +20 -5
  91. package/src/http/scripts.ts +2 -1
  92. package/src/http/task-templates.ts +1 -1
  93. package/src/http/workflow-events.ts +2 -2
  94. package/src/providers/claude-managed-models.ts +2 -12
  95. package/src/providers/pricing-sources.md +5 -5
  96. package/src/scripts-runtime/eval-harness.ts +1 -3
  97. package/src/scripts-runtime/import-allowlist.ts +7 -1
  98. package/src/slack/app.ts +9 -0
  99. package/src/slack/handlers.ts +22 -4
  100. package/src/slack/socket-mode-guard.test.ts +25 -0
  101. package/src/slack/socket-mode-guard.ts +10 -0
  102. package/src/tests/agent-fs-provision-seeder.test.ts +82 -1
  103. package/src/tests/claude-managed-adapter.test.ts +8 -16
  104. package/src/tests/db-query.test.ts +95 -0
  105. package/src/tests/docs-index-footprint.test.js +147 -0
  106. package/src/tests/fixtures/compiled-migrations-boot.ts +47 -0
  107. package/src/tests/migration-bunfs-compat.test.ts +167 -0
  108. package/src/tests/script-connections.test.ts +17 -7
  109. package/src/tests/scripts-import-allowlist.test.ts +23 -1
  110. package/src/tests/scripts-mcp-e2e.test.ts +32 -0
  111. package/src/tests/scripts-runtime-secret-egress.test.ts +33 -0
  112. package/src/tests/session-costs.test.ts +414 -0
  113. package/src/tests/slack-thread-buffer.test.ts +248 -2
  114. package/src/tests/store-progress-attachments-handler.test.ts +156 -23
  115. package/src/tests/workflow-ctx.test.ts +22 -7
  116. package/src/tools/db-query.ts +5 -4
  117. package/src/tools/store-progress.ts +83 -22
  118. package/dist/{cli-snz3p4yf.js → cli-06ghj6pe.js} +6 -6
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-prfghf4h.js";
4
+ } from "./cli-qxn3g3yx.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -3,7 +3,7 @@ import {
3
3
  getAgentWorkingOnThread,
4
4
  getAllAgents,
5
5
  init_db
6
- } from "./cli-prfghf4h.js";
6
+ } from "./cli-qxn3g3yx.js";
7
7
  import {
8
8
  init_env_flag,
9
9
  isEnvFlagEnabled
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  summarizeSession
3
- } from "./cli-y37pxs1m.js";
3
+ } from "./cli-a1zrc2g6.js";
4
4
  import {
5
5
  checkToolLoop,
6
6
  clearToolHistory
@@ -27,14 +27,14 @@ import {
27
27
  getMcpBaseUrl,
28
28
  init_constants
29
29
  } from "./cli-a1rrkrb4.js";
30
- import {
31
- init_package,
32
- package_default
33
- } from "./cli-w4ezqgkj.js";
34
30
  import {
35
31
  init_secret_scrubber,
36
32
  scrubSecrets
37
33
  } from "./cli-mkq1rk7b.js";
34
+ import {
35
+ init_package,
36
+ package_default
37
+ } from "./cli-4dakdn30.js";
38
38
 
39
39
  // src/hooks/hook.ts
40
40
  init_package();
@@ -28,7 +28,7 @@ import {
28
28
  updateTrackerSync,
29
29
  updateTrackerSyncSwarmId,
30
30
  upsertSwarmConfigWithPolicyMirror
31
- } from "./cli-dphm5tyw.js";
31
+ } from "./cli-6290n4yz.js";
32
32
  import {
33
33
  isMultiRuntimeEnabled
34
34
  } from "./cli-qh4sqfws.js";
@@ -37,17 +37,17 @@ import {
37
37
  ensure,
38
38
  require_dist,
39
39
  runScheduleNow
40
- } from "./cli-2ecesrtw.js";
40
+ } from "./cli-r5vwg1ma.js";
41
41
  import {
42
42
  startPricingRefreshLoop
43
- } from "./cli-9kekm9yz.js";
43
+ } from "./cli-cm4z7w7w.js";
44
44
  import {
45
45
  seedPricingFromModelsDev
46
- } from "./cli-w3xch1b8.js";
46
+ } from "./cli-1857msnd.js";
47
47
  import {
48
48
  ensureRbacSeedsSynced,
49
49
  getUserGrant
50
- } from "./cli-269pdgm4.js";
50
+ } from "./cli-cv2vjg2y.js";
51
51
  import {
52
52
  can,
53
53
  decideAdmission,
@@ -74,7 +74,7 @@ import {
74
74
  runSavedScriptAsAgent,
75
75
  updateApp,
76
76
  upgradeAppDefinition
77
- } from "./cli-f2tgry1v.js";
77
+ } from "./cli-6bz2hzvw.js";
78
78
  import {
79
79
  TriggerSchemaError,
80
80
  applyDefinitionPatch,
@@ -88,7 +88,7 @@ import {
88
88
  startWorkflowExecution,
89
89
  validateDefinition,
90
90
  validateJsonSchema
91
- } from "./cli-j2p3bfs3.js";
91
+ } from "./cli-5a5nrq3g.js";
92
92
  import {
93
93
  ConnectionAuthInputSchema,
94
94
  SCRIPT_LONG_TIMEOUT_HINT_MS,
@@ -107,7 +107,7 @@ import {
107
107
  setScriptConnectionEnabled,
108
108
  upsertCredentialBinding,
109
109
  upsertScriptConnection
110
- } from "./cli-yd6vqt1x.js";
110
+ } from "./cli-fmha74ga.js";
111
111
  import {
112
112
  getApiKey
113
113
  } from "./cli-f14fvzag.js";
@@ -122,7 +122,7 @@ import {
122
122
  isGraphExpansionEnabled,
123
123
  rerank,
124
124
  rowToCandidate
125
- } from "./cli-10694wk0.js";
125
+ } from "./cli-4rdjdddh.js";
126
126
  import {
127
127
  buildAuthorizationUrl,
128
128
  createOAuthApp,
@@ -137,16 +137,19 @@ import {
137
137
  listAuthorizationsForApp,
138
138
  onAuthorizationRefreshed,
139
139
  upsertOAuthApp
140
- } from "./cli-3m4mkyqy.js";
140
+ } from "./cli-ey09krp2.js";
141
141
  import {
142
142
  ZodFirstPartyTypeKind,
143
143
  objectType
144
144
  } from "./cli-fad8m16k.js";
145
+ import {
146
+ AgentFsProvider
147
+ } from "./cli-fhsz3twr.js";
145
148
  import {
146
149
  createAdditiveBuffer,
147
150
  extractSlackMessageText,
148
151
  parseSlackTs
149
- } from "./cli-y98ry8cz.js";
152
+ } from "./cli-1dfatkzm.js";
150
153
  import {
151
154
  findOrCreateUserByEmail,
152
155
  findUserByExternalId,
@@ -162,10 +165,10 @@ import {
162
165
  resolveIdentityByEmail,
163
166
  resolveUserByToken,
164
167
  unlinkIdentity
165
- } from "./cli-v21nahej.js";
168
+ } from "./cli-yw2z5kj9.js";
166
169
  import {
167
170
  createTaskWithSiblingAwareness
168
- } from "./cli-1gzz6pmf.js";
171
+ } from "./cli-w0ygcv43.js";
169
172
  import {
170
173
  getAgentDisplayName,
171
174
  getAgentEmoji,
@@ -174,7 +177,7 @@ import {
174
177
  markdownToSlack,
175
178
  startSlackApp,
176
179
  stopSlackApp
177
- } from "./cli-1gvam274.js";
180
+ } from "./cli-j3xnd5b4.js";
178
181
  import {
179
182
  $OpenAPIRegistry,
180
183
  $OpenApiGeneratorV31,
@@ -419,7 +422,7 @@ import {
419
422
  upsertPromptTemplate,
420
423
  upsertService,
421
424
  validateConfigValue
422
- } from "./cli-prfghf4h.js";
425
+ } from "./cli-qxn3g3yx.js";
423
426
  import {
424
427
  generateDefaultClaudeMd,
425
428
  generateDefaultIdentityMd,
@@ -451,10 +454,6 @@ import {
451
454
  exports_zod,
452
455
  init_zod
453
456
  } from "./cli-s35981d0.js";
454
- import {
455
- init_package,
456
- package_default
457
- } from "./cli-w4ezqgkj.js";
458
457
  import {
459
458
  init_secret_scrubber,
460
459
  refreshSecretScrubberCache,
@@ -462,6 +461,10 @@ import {
462
461
  scrubObject,
463
462
  scrubSecrets
464
463
  } from "./cli-mkq1rk7b.js";
464
+ import {
465
+ init_package,
466
+ package_default
467
+ } from "./cli-4dakdn30.js";
465
468
  import {
466
469
  $ZodObject,
467
470
  $ZodType,
@@ -22953,7 +22956,7 @@ async function notifySlack(text) {
22953
22956
  return;
22954
22957
  }
22955
22958
  try {
22956
- const { getSlackApp: getSlackApp2 } = await import("./app-12mwdsvg.js");
22959
+ const { getSlackApp: getSlackApp2 } = await import("./app-vygnfvrh.js");
22957
22960
  const app = getSlackApp2();
22958
22961
  if (!app) {
22959
22962
  console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
@@ -23024,7 +23027,7 @@ async function deleteJiraWebhook(webhookId) {
23024
23027
  console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
23025
23028
  }
23026
23029
  async function overwriteWebhookIds(next) {
23027
- const { getDbClient: getDbClient2 } = await import("./db-g666qxpv.js");
23030
+ const { getDbClient: getDbClient2 } = await import("./db-8fqeheve.js");
23028
23031
  await getDbClient2().transaction(async (tx) => {
23029
23032
  const row = await tx.get("SELECT metadata FROM oauth_apps WHERE provider = 'jira'");
23030
23033
  if (!row) {
@@ -96280,7 +96283,7 @@ async function reloadGlobalConfigsAndIntegrations() {
96280
96283
  }
96281
96284
  async function reloadGlobalConfigsAndIntegrationsInner() {
96282
96285
  const updated = await loadGlobalConfigsIntoEnv(true);
96283
- const { resetFileStorageProvider } = await import("./registry-2g6d2p3n.js");
96286
+ const { resetFileStorageProvider } = await import("./registry-6nvn6bj0.js");
96284
96287
  resetFileStorageProvider();
96285
96288
  const integrations = [];
96286
96289
  resetAgentMail();
@@ -96651,7 +96654,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
96651
96654
  return;
96652
96655
  initialized6 = true;
96653
96656
  try {
96654
- const impl = await import("./otel-impl-an7gh3eh.js");
96657
+ const impl = await import("./otel-impl-d2p84k6e.js");
96655
96658
  await impl.boot(serviceRole);
96656
96659
  realWithSpan = impl.withSpan;
96657
96660
  realStartSpan = impl.startSpan;
@@ -102081,11 +102084,18 @@ function assertSelectOnlyQuery(sql) {
102081
102084
  }
102082
102085
  }
102083
102086
  async function executeReadOnlyQueryGated(sql, params = [], budgetMs, maxRows) {
102087
+ let result;
102084
102088
  if (isDbQueryBoundedEnabled()) {
102085
- return executeReadOnlyQueryBounded(sql, params, budgetMs, maxRows);
102089
+ result = await executeReadOnlyQueryBounded(sql, params, budgetMs, maxRows);
102090
+ } else {
102091
+ warnDbQueryBoundedDisabledOnce();
102092
+ result = executeReadOnlyQuery(sql, params, maxRows);
102086
102093
  }
102087
- warnDbQueryBoundedDisabledOnce();
102088
- return executeReadOnlyQuery(sql, params, maxRows);
102094
+ return {
102095
+ ...result,
102096
+ truncated: maxRows !== undefined && result.total > maxRows,
102097
+ rowLimit: maxRows ?? null
102098
+ };
102089
102099
  }
102090
102100
  var dbQueryRoute = route({
102091
102101
  method: "post",
@@ -102101,7 +102111,9 @@ var dbQueryRoute = route({
102101
102111
  columns: exports_external.array(exports_external.string()),
102102
102112
  rows: exports_external.array(exports_external.array(exports_external.any())),
102103
102113
  elapsed: exports_external.number(),
102104
- total: exports_external.number()
102114
+ total: exports_external.number(),
102115
+ truncated: exports_external.boolean(),
102116
+ rowLimit: exports_external.number().nullable()
102105
102117
  })
102106
102118
  },
102107
102119
  400: { description: "Invalid or disallowed SQL" },
@@ -102119,7 +102131,7 @@ async function handleDbQuery(req, res, pathSegments, queryParams) {
102119
102131
  return true;
102120
102132
  try {
102121
102133
  const result = await executeReadOnlyQueryGated(resolveDbQuerySql(parsed.body), parsed.body.params, getDbQueryHttpBudgetMs(), getDbQueryHttpMaxRows());
102122
- json(res, result);
102134
+ dbQueryRoute.respond(res, 200, result);
102123
102135
  } catch (err) {
102124
102136
  if (err instanceof DbQueryConcurrencyCapError) {
102125
102137
  res.setHeader("Retry-After", "1");
@@ -102983,7 +102995,8 @@ var registerDbQueryTool = (server) => {
102983
102995
  rows: array(array(any())).optional(),
102984
102996
  elapsed: number().optional(),
102985
102997
  total: number().optional(),
102986
- truncated: boolean().optional()
102998
+ truncated: boolean().optional(),
102999
+ rowLimit: number().optional()
102987
103000
  })
102988
103001
  }, async (input, _requestInfo, _meta) => {
102989
103002
  try {
@@ -102991,20 +103004,19 @@ var registerDbQueryTool = (server) => {
102991
103004
  const params = input.params ?? [];
102992
103005
  const maxRows = getDbQueryMcpMaxRows();
102993
103006
  const result = await executeReadOnlyQueryGated(sql, params, getDbQueryMcpBudgetMs(), maxRows);
102994
- const truncated = result.total > maxRows;
102995
103007
  const header = result.columns.join(" | ");
102996
103008
  const separator = result.columns.map(() => "---").join(" | ");
102997
103009
  const dataRows = result.rows.map((row) => row.map((v) => String(v ?? "NULL")).join(" | "));
102998
103010
  const table = [header, separator, ...dataRows].join(`
102999
103011
  `);
103000
- const suffix = truncated ? `
103001
- (Showing ${maxRows} of ${result.total} rows)` : "";
103012
+ const suffix = result.truncated ? `
103013
+ (Showing ${result.rowLimit} of ${result.total} rows)` : "";
103002
103014
  const details = `${table}${suffix}
103003
103015
 
103004
103016
  ${result.total} rows in ${result.elapsed}ms`;
103005
103017
  return toolOk(`${result.total} row(s) in ${result.elapsed}ms`, {
103006
103018
  details,
103007
- data: { ...result, truncated }
103019
+ data: { ...result }
103008
103020
  });
103009
103021
  } catch (err) {
103010
103022
  const message = err instanceof Error ? err.message : String(err);
@@ -112427,7 +112439,7 @@ var registerStoreProgressTool = (server) => {
112427
112439
  status: _enum(["completed", "failed"]).optional().describe("Set to 'completed' or 'failed' to finish the task."),
112428
112440
  output: string().optional().describe("The task result (used when completing). For Slack-originated tasks, this is published verbatim in the thread's outcome card: provide a concrete summary scaled to what was asked, including only the outcome and any links or IDs the human needs—not process narration, a transcript, or a restatement of the brief."),
112429
112441
  failureReason: string().optional().describe("The reason for failure (used when failing)."),
112430
- attachments: array(AttachmentInputSchema).max(20).optional().describe("Pointer-based artifacts produced by this step — agent-fs path, URL, shared-fs path, or swarm Page. No inline file data; upload to agent-fs first and attach by path. May be sent on any call (progress or completion) and accumulates across calls; duplicates are de-duped by sha256 (when present) or by (kind, pointer, name)."),
112442
+ attachments: array(AttachmentInputSchema).max(20).optional().describe("Pointer-based artifacts produced by this step — agent-fs path, URL, shared-fs path, or swarm Page. No inline file data; upload to agent-fs first and attach by path. Agent-fs pointers are verified before task state changes, using the explicit org/drive pair or the registering agent's configured defaults. May be sent on any call (progress or completion) and accumulates across calls; duplicates are de-duped by sha256 (when present) or by (kind, pointer, name)."),
112431
112443
  persistMemory: boolean().optional().describe("Opt in to task_completion memory persistence for automatic/recurring tasks. Manual tasks are persisted by default; scheduled, system, heartbeat/boot-triage, monitor, and digest tasks are skipped unless this is true."),
112432
112444
  force: boolean().optional().describe("On an already-terminal task, overwrite explicitly provided output and/or failureReason text while preserving status and finishedAt and without replaying events, memory writes, follow-up creation, business-use ensure, or capacity updates. Differing terminal text is otherwise discarded and reported as a failure.")
112433
112445
  }),
@@ -112436,15 +112448,59 @@ var registerStoreProgressTool = (server) => {
112436
112448
  if (!requestInfo.agentId) {
112437
112449
  return toolErr('Agent ID not found. The MCP client should define the "X-Agent-ID" header.');
112438
112450
  }
112439
- let agentFsDefaults;
112440
- if (attachments?.some((a) => a.kind === "agent-fs" && !a.orgId && !a.driveId)) {
112451
+ const agentFsScopes = new Map;
112452
+ const agentFsAttachments = attachments?.filter((a) => a.kind === "agent-fs") ?? [];
112453
+ if (agentFsAttachments.length > 0) {
112454
+ if (!await getAgentById(requestInfo.agentId)) {
112455
+ return toolErr(`Agent with ID "${requestInfo.agentId}" not found in the swarm, register before storing task progress.`);
112456
+ }
112457
+ if (!await getTaskById(taskId)) {
112458
+ return toolErr(`Task with ID "${taskId}" not found.`);
112459
+ }
112441
112460
  const configs = await getResolvedConfig(requestInfo.agentId ?? undefined);
112442
- const orgId = configs.find((c) => c.key === "AGENT_FS_DEFAULT_ORG_ID")?.value;
112443
- const driveId = configs.find((c) => c.key === "AGENT_FS_DEFAULT_DRIVE_ID")?.value;
112444
- agentFsDefaults = {
112445
- orgId: orgId && orgId.length > 0 ? orgId : undefined,
112446
- driveId: driveId && driveId.length > 0 ? driveId : undefined
112447
- };
112461
+ const configValue = (key) => configs.find((c) => c.key === key)?.value?.trim();
112462
+ const defaultOrgId = configValue("AGENT_FS_DEFAULT_ORG_ID");
112463
+ const defaultDriveId = configValue("AGENT_FS_DEFAULT_DRIVE_ID");
112464
+ const apiUrl = configValue("AGENT_FS_API_URL") || process.env.AGENT_FS_API_URL?.trim();
112465
+ const apiKey = configValue("AGENT_FS_API_KEY") || configValue("API_AGENT_FS_API_KEY") || process.env.AGENT_FS_API_KEY?.trim() || process.env.API_AGENT_FS_API_KEY?.trim();
112466
+ for (const attachment of agentFsAttachments) {
112467
+ const hasExplicitScope = Boolean(attachment.orgId || attachment.driveId);
112468
+ const orgId = (hasExplicitScope ? attachment.orgId : defaultOrgId)?.trim();
112469
+ const driveId = (hasExplicitScope ? attachment.driveId : defaultDriveId)?.trim();
112470
+ if (!orgId || !driveId) {
112471
+ return toolErr(`Agent-fs attachment "${attachment.name}" cannot be verified: both orgId and driveId must resolve from the attachment or the registering agent's config. No attachment was registered and task state was unchanged.`);
112472
+ }
112473
+ agentFsScopes.set(attachment, { orgId, driveId });
112474
+ }
112475
+ if (!apiUrl || !apiKey) {
112476
+ return toolErr("Agent-fs attachments cannot be verified because the registering agent's agent-fs API URL or credential is unavailable. No attachment was registered and task state was unchanged.");
112477
+ }
112478
+ const firstScope = agentFsScopes.get(agentFsAttachments[0]);
112479
+ if (!firstScope) {
112480
+ return toolErr("Agent-fs attachment scope resolution failed.");
112481
+ }
112482
+ const provider = new AgentFsProvider({ apiUrl, apiKey, ...firstScope });
112483
+ const verificationErrors = await Promise.all(agentFsAttachments.map(async (attachment) => {
112484
+ const scope = agentFsScopes.get(attachment);
112485
+ if (!scope)
112486
+ return "Agent-fs attachment scope resolution failed.";
112487
+ try {
112488
+ await provider.head({
112489
+ taskId,
112490
+ name: attachment.name,
112491
+ key: attachment.path,
112492
+ ...scope
112493
+ });
112494
+ return;
112495
+ } catch (error) {
112496
+ const detail = scrubSecrets(error instanceof Error ? error.message : String(error));
112497
+ return `Agent-fs attachment "${attachment.name}" does not resolve at orgId=${scope.orgId}, driveId=${scope.driveId}, path=${attachment.path}: ${detail}.`;
112498
+ }
112499
+ }));
112500
+ const verificationError = verificationErrors.find((error) => error !== undefined);
112501
+ if (verificationError) {
112502
+ return toolErr(`${verificationError} No attachment was registered and task state was unchanged.`);
112503
+ }
112448
112504
  }
112449
112505
  const result = await getDbClient().transaction(async () => {
112450
112506
  const agent = await getAgentById(requestInfo.agentId ?? "");
@@ -112467,9 +112523,10 @@ var registerStoreProgressTool = (server) => {
112467
112523
  for (const a of attachments) {
112468
112524
  let orgId = a.kind === "agent-fs" ? a.orgId : undefined;
112469
112525
  let driveId = a.kind === "agent-fs" ? a.driveId : undefined;
112470
- if (a.kind === "agent-fs" && !orgId && !driveId) {
112471
- orgId = orgId || agentFsDefaults?.orgId;
112472
- driveId = driveId || agentFsDefaults?.driveId;
112526
+ if (a.kind === "agent-fs") {
112527
+ const verifiedScope = agentFsScopes.get(a);
112528
+ orgId = verifiedScope?.orgId;
112529
+ driveId = verifiedScope?.driveId;
112473
112530
  }
112474
112531
  await insertTaskAttachment({
112475
112532
  taskId,
@@ -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.135.0",
10
+ version: "1.135.2",
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",
@@ -178,14 +178,14 @@ var init_package = __esm(() => {
178
178
  "@aws-sdk/client-bedrock": "3.1048.0",
179
179
  "@desplega.ai/business-use": "^0.4.2",
180
180
  "@desplega.ai/localtunnel": "^2.2.0",
181
- "@earendil-works/pi-agent-core": "^0.84.2",
182
- "@earendil-works/pi-ai": "^0.84.2",
183
- "@earendil-works/pi-coding-agent": "^0.84.2",
181
+ "@earendil-works/pi-agent-core": "^0.84.3",
182
+ "@earendil-works/pi-ai": "^0.84.3",
183
+ "@earendil-works/pi-coding-agent": "^0.84.3",
184
184
  "@inkjs/ui": "^2.0.0",
185
185
  "@linear/sdk": "^77.0.0",
186
186
  "@modelcontextprotocol/sdk": "^1.25.1",
187
- "@openai/codex-sdk": "^0.148.0",
188
- "@opencode-ai/sdk": "^1.18.18",
187
+ "@openai/codex-sdk": "^0.149.1",
188
+ "@opencode-ai/sdk": "^1.18.23",
189
189
  "@openfort/openfort-node": "^0.9.1",
190
190
  "@opentelemetry/api": "^1.9.1",
191
191
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -11,7 +11,7 @@ import {
11
11
  getDbClient,
12
12
  init_db,
13
13
  isSqliteVecAvailable
14
- } from "./cli-prfghf4h.js";
14
+ } from "./cli-qxn3g3yx.js";
15
15
  import {
16
16
  __esm,
17
17
  __export,
@@ -18,10 +18,10 @@ import {
18
18
  sandboxSpawnEnv,
19
19
  snapshotCapped,
20
20
  touchScratchScriptLastUsed
21
- } from "./cli-yd6vqt1x.js";
21
+ } from "./cli-fmha74ga.js";
22
22
  import {
23
23
  withSiblingAwareness
24
- } from "./cli-1gzz6pmf.js";
24
+ } from "./cli-w0ygcv43.js";
25
25
  import {
26
26
  FollowUpConfigSchema,
27
27
  ModelTierSchema,
@@ -67,7 +67,7 @@ import {
67
67
  updateWorkflowRun,
68
68
  updateWorkflowRunStep,
69
69
  workflowContextKey
70
- } from "./cli-prfghf4h.js";
70
+ } from "./cli-qxn3g3yx.js";
71
71
  import {
72
72
  deepInterpolate,
73
73
  findInterpolationTokens,
@@ -3194,7 +3194,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
3194
3194
  }
3195
3195
  if (notification.channel === "slack") {
3196
3196
  try {
3197
- const { getSlackApp } = await import("./app-12mwdsvg.js");
3197
+ const { getSlackApp } = await import("./app-vygnfvrh.js");
3198
3198
  const slackApp = getSlackApp();
3199
3199
  if (!slackApp) {
3200
3200
  console.warn("[HITL] Slack not initialized — cannot send notification");
@@ -3310,7 +3310,7 @@ class NotifyExecutor extends BaseExecutor {
3310
3310
  }
3311
3311
  }
3312
3312
  case "slack": {
3313
- const { getSlackApp } = await import("./app-12mwdsvg.js");
3313
+ const { getSlackApp } = await import("./app-vygnfvrh.js");
3314
3314
  const app = getSlackApp();
3315
3315
  if (!app) {
3316
3316
  return {
@@ -23,7 +23,7 @@ import {
23
23
  updateAgentMaxTasks,
24
24
  updateAgentStatus,
25
25
  upsertSwarmConfig
26
- } from "./cli-prfghf4h.js";
26
+ } from "./cli-qxn3g3yx.js";
27
27
  import {
28
28
  init_resolver,
29
29
  resolveTemplate
@@ -7,14 +7,14 @@ import {
7
7
  restoreScratchScriptLastUsedIfUnchanged,
8
8
  runScript,
9
9
  touchScratchScriptLastUsed
10
- } from "./cli-yd6vqt1x.js";
10
+ } from "./cli-fmha74ga.js";
11
11
  import {
12
12
  defaultAssetKey,
13
13
  getDbClient,
14
14
  getLeadAgent,
15
15
  init_db,
16
16
  init_key
17
- } from "./cli-prfghf4h.js";
17
+ } from "./cli-qxn3g3yx.js";
18
18
  import {
19
19
  init_zod
20
20
  } from "./cli-s35981d0.js";
@@ -4,10 +4,16 @@ import {
4
4
  import {
5
5
  resolveCodexPrompt
6
6
  } from "./cli-r94z9p1z.js";
7
+ import {
8
+ readPkgVersion
9
+ } from "./cli-f64gdfxc.js";
7
10
  import {
8
11
  SessionErrorTracker,
9
12
  buildOtelTraceparentEnv
10
13
  } from "./cli-a3pkfpqs.js";
14
+ import {
15
+ summarizeSession
16
+ } from "./cli-a1zrc2g6.js";
11
17
  import {
12
18
  CTX_MODE_NUDGE_EVERY
13
19
  } from "./cli-zm7njwzd.js";
@@ -16,12 +22,6 @@ import {
16
22
  clampContextPercent,
17
23
  computeContextUsedUnified
18
24
  } from "./cli-cw70hymf.js";
19
- import {
20
- readPkgVersion
21
- } from "./cli-f64gdfxc.js";
22
- import {
23
- summarizeSession
24
- } from "./cli-y37pxs1m.js";
25
25
  import {
26
26
  buildRatingsFromLlm,
27
27
  fetchRetrievalsForTask,
@@ -116,6 +116,7 @@ var Thread = class {
116
116
  threadId: this._id,
117
117
  images,
118
118
  model: options?.model,
119
+ threadSource: options?.threadSource,
119
120
  sandboxMode: options?.sandboxMode,
120
121
  workingDirectory: options?.workingDirectory,
121
122
  skipGitRepoCheck: options?.skipGitRepoCheck,
@@ -206,7 +207,8 @@ var CodexExec = class {
206
207
  pathDirs;
207
208
  envOverride;
208
209
  configOverrides;
209
- constructor(executablePath = null, env, configOverrides) {
210
+ rawConfigOverrides;
211
+ constructor(executablePath = null, env, configOverrides, rawConfigOverrides) {
210
212
  if (executablePath) {
211
213
  this.executablePath = executablePath;
212
214
  this.pathDirs = [];
@@ -217,6 +219,7 @@ var CodexExec = class {
217
219
  }
218
220
  this.envOverride = env;
219
221
  this.configOverrides = configOverrides;
222
+ this.rawConfigOverrides = rawConfigOverrides;
220
223
  }
221
224
  async* run(args) {
222
225
  const commandArgs = ["exec", "--experimental-json"];
@@ -225,12 +228,20 @@ var CodexExec = class {
225
228
  commandArgs.push("--config", override);
226
229
  }
227
230
  }
231
+ if (this.rawConfigOverrides) {
232
+ for (const override of this.rawConfigOverrides) {
233
+ commandArgs.push("--config", override);
234
+ }
235
+ }
228
236
  if (args.baseUrl) {
229
237
  commandArgs.push("--config", `openai_base_url=${toTomlValue(args.baseUrl, "openai_base_url")}`);
230
238
  }
231
239
  if (args.model) {
232
240
  commandArgs.push("--model", args.model);
233
241
  }
242
+ if (args.threadSource !== undefined && !args.threadId) {
243
+ commandArgs.push("--thread-source", args.threadSource);
244
+ }
234
245
  if (args.sandboxMode) {
235
246
  commandArgs.push("--sandbox", args.sandboxMode);
236
247
  }
@@ -545,8 +556,8 @@ var Codex = class {
545
556
  exec;
546
557
  options;
547
558
  constructor(options = {}) {
548
- const { codexPathOverride, env, config } = options;
549
- this.exec = new CodexExec(codexPathOverride, env, config);
559
+ const { codexPathOverride, env, config, configOverrides } = options;
560
+ this.exec = new CodexExec(codexPathOverride, env, config, configOverrides);
550
561
  this.options = options;
551
562
  }
552
563
  startThread(options = {}) {
@@ -4,12 +4,12 @@ import {
4
4
  linkIdentity,
5
5
  recordUnmappedIdentity,
6
6
  resolveIdentity
7
- } from "./cli-v21nahej.js";
7
+ } from "./cli-yw2z5kj9.js";
8
8
  import {
9
9
  getKv,
10
10
  init_db,
11
11
  upsertKv
12
- } from "./cli-prfghf4h.js";
12
+ } from "./cli-qxn3g3yx.js";
13
13
 
14
14
  // src/slack/enrich.ts
15
15
  init_db();