@desplega.ai/agent-swarm 1.108.0 → 1.108.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 (64) hide show
  1. package/dist/{actions-sdr91cfp.js → actions-1hxdkcp6.js} +6 -6
  2. package/dist/{app-0mcf7mwz.js → app-vn2sy15m.js} +3 -3
  3. package/dist/{assistant-7f3cmabp.js → assistant-sj71nx88.js} +9 -9
  4. package/dist/{boot-reembed-a9btk2eh.js → boot-reembed-nc1dpmdj.js} +4 -4
  5. package/dist/{boot-reembed-47cfre4w.js → boot-reembed-nw9vp9ez.js} +3 -3
  6. package/dist/{boot-scrub-logs-hy8pqhej.js → boot-scrub-logs-g2mpp0cg.js} +2 -2
  7. package/dist/{cli-j9eqkarv.js → cli-1brke24m.js} +3 -3
  8. package/dist/{cli-vemx13wc.js → cli-1wzrmxaj.js} +3 -3
  9. package/dist/{cli-h2qhdwhr.js → cli-27pxayz8.js} +1 -1
  10. package/dist/{cli-a0w6tqyc.js → cli-3p0e74xv.js} +1 -1
  11. package/dist/{cli-xy83cmfc.js → cli-4wrdrmr3.js} +33 -6
  12. package/dist/{cli-vhpa5j27.js → cli-5m4da9px.js} +1 -1
  13. package/dist/{cli-9wv4e7qs.js → cli-6jf8xfnt.js} +7 -3
  14. package/dist/{cli-1zs2dm5w.js → cli-6z0y1339.js} +4 -4
  15. package/dist/{cli-mkn2ryba.js → cli-8gtrpqcw.js} +1 -1
  16. package/dist/{cli-7r40bgvr.js → cli-8kssf4wv.js} +4 -4
  17. package/dist/{cli-nmt32dxp.js → cli-9zz27c9g.js} +1 -1
  18. package/dist/{cli-m0k99m2s.js → cli-ae9hy8yh.js} +1 -1
  19. package/dist/{cli-entbgsd5.js → cli-b4hwyzev.js} +1 -1
  20. package/dist/{cli-3cfvx630.js → cli-b7ytq2z8.js} +2 -2
  21. package/dist/{cli-a8gkr14c.js → cli-bz6qha8p.js} +30 -4
  22. package/dist/{cli-tehpf2fm.js → cli-cr2wze6h.js} +1 -1
  23. package/dist/{cli-psz2xq0n.js → cli-er5kffrx.js} +5 -5
  24. package/dist/{cli-mmaz2btq.js → cli-fxk0as0h.js} +1 -1
  25. package/dist/{cli-kppbkzj4.js → cli-gg6zxrx1.js} +5 -5
  26. package/dist/{cli-cya9knf9.js → cli-hc7hxy2m.js} +2 -2
  27. package/dist/{cli-75b0wmer.js → cli-nt60dmfm.js} +2 -2
  28. package/dist/{cli-apdrt1ch.js → cli-tc19ec02.js} +1 -1
  29. package/dist/{cli-gx7gnvha.js → cli-xekgq1r8.js} +17 -17
  30. package/dist/cli.js +8 -8
  31. package/dist/{commands-4p93q1rf.js → commands-11d7nc0g.js} +2 -2
  32. package/dist/{db-hb0chrmg.js → db-0r0wz8a4.js} +2 -2
  33. package/dist/{handlers-pz3zc83m.js → handlers-v8th05yh.js} +9 -9
  34. package/dist/{hook-mye8ket2.js → hook-9n0np62b.js} +1 -1
  35. package/dist/{http-3nrx1tp1.js → http-pmaqk60c.js} +73 -37
  36. package/dist/{index-x9n06ze1.js → index-35x6ptdt.js} +8 -8
  37. package/dist/{index-17n7z8k8.js → index-9vma4xmv.js} +9 -9
  38. package/dist/{index-6sgpkhby.js → index-c9tx34ke.js} +6 -6
  39. package/dist/{index-rys8ctm6.js → index-vgvvr6yk.js} +7 -7
  40. package/dist/{keepalive-b6eax0y0.js → keepalive-pjd1kjv7.js} +4 -4
  41. package/dist/{lead-v1g4j7he.js → lead-czd1xgxr.js} +17 -17
  42. package/dist/{maintenance-xwf1vf0v.js → maintenance-xjqt3ne7.js} +4 -4
  43. package/dist/{onboard-vy0z8b11.js → onboard-whf6w0mr.js} +2 -2
  44. package/dist/{otel-impl-94sm94jm.js → otel-impl-9n4p19tt.js} +1 -1
  45. package/dist/{pricing-refresh-an9bxjcd.js → pricing-refresh-wg80me14.js} +4 -4
  46. package/dist/{seed-pricing-3t22x5ax.js → seed-pricing-garwba27.js} +3 -3
  47. package/dist/{setup-8hd3jk8s.js → setup-dktff2q2.js} +2 -2
  48. package/dist/{worker-s0xm8naj.js → worker-t26gwn0n.js} +17 -17
  49. package/openapi.json +1 -1
  50. package/package.json +1 -1
  51. package/plugin/skills/download-task-attachment/SKILL.md +59 -0
  52. package/src/be/seed/agent-fs-provision.ts +51 -4
  53. package/src/commands/runner.ts +40 -0
  54. package/src/commands/templates.ts +6 -1
  55. package/src/fs/local-fs-provider.ts +36 -4
  56. package/src/http/poll.ts +24 -2
  57. package/src/telemetry.ts +12 -2
  58. package/src/tests/agent-fs-provision-seeder.test.ts +204 -3
  59. package/src/tests/claude-adapter.test.ts +17 -3
  60. package/src/tests/fs-provider.test.ts +34 -0
  61. package/src/tests/http-api-integration.test.ts +51 -0
  62. package/src/tests/prompt-template-remaining.test.ts +25 -0
  63. package/src/tests/runner-attachments-section.test.ts +55 -0
  64. package/src/tests/telemetry-init.test.ts +23 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-j9eqkarv.js";
4
- import"./cli-m0k99m2s.js";
5
- import"./cli-mmaz2btq.js";
3
+ } from "./cli-1brke24m.js";
4
+ import"./cli-ae9hy8yh.js";
5
+ import"./cli-fxk0as0h.js";
6
6
  import {
7
7
  buildCancelledBlocks,
8
8
  getTaskLink
@@ -11,7 +11,7 @@ import"./cli-wspgs9bt.js";
11
11
  import {
12
12
  createTaskWithSiblingAwareness,
13
13
  slackContextKey
14
- } from "./cli-a0w6tqyc.js";
14
+ } from "./cli-3p0e74xv.js";
15
15
  import"./cli-dh55d5fg.js";
16
16
  import {
17
17
  cancelTask,
@@ -19,11 +19,11 @@ import {
19
19
  getLeadAgent,
20
20
  getTaskById,
21
21
  init_db
22
- } from "./cli-9wv4e7qs.js";
22
+ } from "./cli-6jf8xfnt.js";
23
23
  import"./cli-z2zcxes1.js";
24
24
  import"./cli-q21d49ac.js";
25
25
  import"./cli-anrj584m.js";
26
- import"./cli-apdrt1ch.js";
26
+ import"./cli-tc19ec02.js";
27
27
  import"./cli-4j2mrzag.js";
28
28
  import"./cli-p9swy5t3.js";
29
29
 
@@ -3,17 +3,17 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-kppbkzj4.js";
6
+ } from "./cli-gg6zxrx1.js";
7
7
  import"./cli-rkndnn90.js";
8
8
  import"./cli-b0p7rfnd.js";
9
9
  import"./cli-6xd0bvf8.js";
10
10
  import"./cli-wspgs9bt.js";
11
11
  import"./cli-dh55d5fg.js";
12
- import"./cli-9wv4e7qs.js";
12
+ import"./cli-6jf8xfnt.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-q21d49ac.js";
15
15
  import"./cli-anrj584m.js";
16
- import"./cli-apdrt1ch.js";
16
+ import"./cli-tc19ec02.js";
17
17
  import"./cli-4j2mrzag.js";
18
18
  import"./cli-e15jhafb.js";
19
19
  import"./cli-7wmybrt5.js";
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  bufferThreadMessage,
3
3
  wasEventSeen
4
- } from "./cli-7r40bgvr.js";
4
+ } from "./cli-8kssf4wv.js";
5
5
  import {
6
6
  hasOtherUserMention
7
- } from "./cli-nmt32dxp.js";
7
+ } from "./cli-9zz27c9g.js";
8
8
  import {
9
9
  require_dist
10
- } from "./cli-kppbkzj4.js";
10
+ } from "./cli-gg6zxrx1.js";
11
11
  import"./cli-rkndnn90.js";
12
12
  import"./cli-b0p7rfnd.js";
13
13
  import {
14
14
  resolveSlackUserId
15
- } from "./cli-j9eqkarv.js";
16
- import"./cli-m0k99m2s.js";
17
- import"./cli-mmaz2btq.js";
15
+ } from "./cli-1brke24m.js";
16
+ import"./cli-ae9hy8yh.js";
17
+ import"./cli-fxk0as0h.js";
18
18
  import"./cli-6xd0bvf8.js";
19
19
  import"./cli-wspgs9bt.js";
20
20
  import {
21
21
  createTaskWithSiblingAwareness,
22
22
  slackContextKey
23
- } from "./cli-a0w6tqyc.js";
23
+ } from "./cli-3p0e74xv.js";
24
24
  import"./cli-dh55d5fg.js";
25
25
  import {
26
26
  getAgentWorkingOnThread,
@@ -29,11 +29,11 @@ import {
29
29
  init_db,
30
30
  init_resolver,
31
31
  resolveTemplate
32
- } from "./cli-9wv4e7qs.js";
32
+ } from "./cli-6jf8xfnt.js";
33
33
  import"./cli-z2zcxes1.js";
34
34
  import"./cli-q21d49ac.js";
35
35
  import"./cli-anrj584m.js";
36
- import"./cli-apdrt1ch.js";
36
+ import"./cli-tc19ec02.js";
37
37
  import"./cli-4j2mrzag.js";
38
38
  import"./cli-e15jhafb.js";
39
39
  import"./cli-7wmybrt5.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-cya9knf9.js";
5
- import"./cli-vhpa5j27.js";
4
+ } from "./cli-hc7hxy2m.js";
5
+ import"./cli-5m4da9px.js";
6
6
  import"./cli-q25ejbyn.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-9wv4e7qs.js";
10
+ } from "./cli-6jf8xfnt.js";
11
11
  import"./cli-z2zcxes1.js";
12
12
  import"./cli-q21d49ac.js";
13
13
  import"./cli-anrj584m.js";
14
- import"./cli-apdrt1ch.js";
14
+ import"./cli-tc19ec02.js";
15
15
  import"./cli-4j2mrzag.js";
16
16
  import"./cli-p9swy5t3.js";
17
17
 
@@ -3,16 +3,16 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-vhpa5j27.js";
6
+ } from "./cli-5m4da9px.js";
7
7
  import"./cli-q25ejbyn.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-9wv4e7qs.js";
11
+ } from "./cli-6jf8xfnt.js";
12
12
  import"./cli-z2zcxes1.js";
13
13
  import"./cli-q21d49ac.js";
14
14
  import"./cli-anrj584m.js";
15
- import"./cli-apdrt1ch.js";
15
+ import"./cli-tc19ec02.js";
16
16
  import"./cli-4j2mrzag.js";
17
17
  import"./cli-p9swy5t3.js";
18
18
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-9wv4e7qs.js";
4
+ } from "./cli-6jf8xfnt.js";
5
5
  import"./cli-z2zcxes1.js";
6
6
  import"./cli-q21d49ac.js";
7
7
  import"./cli-anrj584m.js";
8
- import"./cli-apdrt1ch.js";
8
+ import"./cli-tc19ec02.js";
9
9
  import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  recordUnmappedIdentity
3
- } from "./cli-m0k99m2s.js";
3
+ } from "./cli-ae9hy8yh.js";
4
4
  import {
5
5
  findOrCreateUserByEmail,
6
6
  findUserByExternalId,
7
7
  linkIdentity
8
- } from "./cli-mmaz2btq.js";
8
+ } from "./cli-fxk0as0h.js";
9
9
  import {
10
10
  getKv,
11
11
  init_db,
12
12
  upsertKv
13
- } from "./cli-9wv4e7qs.js";
13
+ } from "./cli-6jf8xfnt.js";
14
14
 
15
15
  // src/slack/enrich.ts
16
16
  init_db();
@@ -4,11 +4,11 @@ import {
4
4
  getNextResumeGeneration,
5
5
  getResumeGeneration,
6
6
  repointTrackerSyncBySwarmId
7
- } from "./cli-h2qhdwhr.js";
7
+ } from "./cli-27pxayz8.js";
8
8
  import {
9
9
  getExecutorRegistry,
10
10
  recoverIncompleteRuns
11
- } from "./cli-psz2xq0n.js";
11
+ } from "./cli-er5kffrx.js";
12
12
  import {
13
13
  MAX_EMPTY_POLLS,
14
14
  assignUnassignedTaskPending,
@@ -44,7 +44,7 @@ import {
44
44
  resolveTemplate,
45
45
  supersedeTask,
46
46
  updateAgentStatus
47
- } from "./cli-9wv4e7qs.js";
47
+ } from "./cli-6jf8xfnt.js";
48
48
 
49
49
  // src/heartbeat/heartbeat.ts
50
50
  init_db();
@@ -17,7 +17,7 @@ import {
17
17
  init_templates1 as init_templates,
18
18
  normalizeDateRequired,
19
19
  resolveTemplate
20
- } from "./cli-9wv4e7qs.js";
20
+ } from "./cli-6jf8xfnt.js";
21
21
 
22
22
  // src/be/db-queries/tracker.ts
23
23
  init_date_utils();
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-9wv4e7qs.js";
6
+ } from "./cli-6jf8xfnt.js";
7
7
 
8
8
  // src/tasks/context-key.ts
9
9
  var SEPARATOR = ":";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getScriptApiTypes,
3
3
  require_typescript
4
- } from "./cli-3cfvx630.js";
4
+ } from "./cli-b7ytq2z8.js";
5
5
  import {
6
6
  deleteSwarmConfigByKey,
7
7
  getAgentById,
@@ -10,7 +10,7 @@ import {
10
10
  getSwarmConfigs,
11
11
  init_db,
12
12
  upsertSwarmConfig
13
- } from "./cli-9wv4e7qs.js";
13
+ } from "./cli-6jf8xfnt.js";
14
14
  import {
15
15
  init_secret_scrubber,
16
16
  scrubSecrets
@@ -67,7 +67,11 @@ async function provisionAgentFs(item) {
67
67
  apiUrl: item.apiUrl,
68
68
  registerEmail: item.registerEmail
69
69
  });
70
+ const currentRoles = await getCurrentOrgMemberRoles(item.apiUrl, shared.authHeaders, shared.orgId);
70
71
  for (const invite of item.invites) {
72
+ const currentRole = currentRoles.get(invite.email.toLowerCase());
73
+ if (currentRole && roleRank(currentRole) >= roleRank(invite.role))
74
+ continue;
71
75
  await inviteToSharedOrg(item.apiUrl, shared.authHeaders, shared.orgId, invite);
72
76
  }
73
77
  upsertSwarmConfig({
@@ -150,7 +154,11 @@ async function ensureAgentFsCredentialsForAgent(agentId) {
150
154
  const apiKey = registered.apiKey ?? "";
151
155
  if (!apiKey)
152
156
  throw new Error(`agent-fs registration did not return an apiKey for ${agentId}`);
153
- await inviteToSharedOrg(apiUrl, shared.authHeaders, shared.orgId, { email, role: "editor" });
157
+ const currentRoles = await getCurrentOrgMemberRoles(apiUrl, shared.authHeaders, shared.orgId);
158
+ const currentRole = currentRoles.get(email.toLowerCase());
159
+ if (!currentRole || roleRank(currentRole) < roleRank("editor")) {
160
+ await inviteToSharedOrg(apiUrl, shared.authHeaders, shared.orgId, { email, role: "editor" });
161
+ }
154
162
  upsertSwarmConfig({
155
163
  scope: "agent",
156
164
  scopeId: agentId,
@@ -216,6 +224,25 @@ async function inviteToSharedOrg(apiUrl, headers, orgId, invite) {
216
224
  console.warn(scrubSecrets(`[seed:${KIND}] invite skipped for ${invite.email}: ${error instanceof Error ? error.message : String(error)}`));
217
225
  }
218
226
  }
227
+ async function getCurrentOrgMemberRoles(apiUrl, headers, orgId) {
228
+ const response = await agentFsRequest(apiUrl, `/orgs/${encodeURIComponent(orgId)}/members`, { headers });
229
+ const roles = new Map;
230
+ for (const member of response.members ?? []) {
231
+ const email = (member.email ?? member.user?.email ?? "").trim().toLowerCase();
232
+ const role = normalizeRole(member.role);
233
+ if (email && role)
234
+ roles.set(email, role);
235
+ }
236
+ return roles;
237
+ }
238
+ function normalizeRole(role) {
239
+ if (role === "viewer" || role === "editor" || role === "admin")
240
+ return role;
241
+ return null;
242
+ }
243
+ function roleRank(role) {
244
+ return { viewer: 0, editor: 1, admin: 2 }[role];
245
+ }
219
246
  async function agentFsRequest(apiUrl, path, options = {}) {
220
247
  const headers = new Headers(options.headers);
221
248
  if (options.body !== undefined)
@@ -249,13 +276,13 @@ function resolveInviteTargets() {
249
276
  for (const user of getAllUsers()) {
250
277
  if (!user.email)
251
278
  continue;
252
- const role = isOperatorRole(user.role) ? "editor" : "viewer";
279
+ const role = isExplicitViewerRole(user.role) ? "viewer" : "editor";
253
280
  targets.set(user.email.toLowerCase(), { email: user.email, role });
254
281
  }
255
282
  return [...targets.values()].sort((a, b) => a.email.localeCompare(b.email));
256
283
  }
257
- function isOperatorRole(role) {
258
- return /\b(admin|operator|owner|lead)\b/i.test(role ?? "");
284
+ function isExplicitViewerRole(role) {
285
+ return /\b(viewer|read[-\s]?only|guest)\b/i.test(role ?? "");
259
286
  }
260
287
  function provisionHashFromCurrentState() {
261
288
  return provisionHash({
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-9wv4e7qs.js";
9
+ } from "./cli-6jf8xfnt.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  init_package,
27
27
  package_default
28
- } from "./cli-apdrt1ch.js";
28
+ } from "./cli-tc19ec02.js";
29
29
  import {
30
30
  init_secret_scrubber,
31
31
  scrubSecrets
@@ -345,7 +345,7 @@ function track(options) {
345
345
  actor_anonymous_id: installationId,
346
346
  properties: {
347
347
  ...options.properties ?? {},
348
- is_cloud: cachedIsCloud,
348
+ is_cloud: cachedIsCloud || isCloudDeployment(),
349
349
  is_e2b: cachedIsE2b,
350
350
  swarmVersion: package_default.version
351
351
  },
@@ -2834,11 +2834,15 @@ var init_templates = __esm(() => {
2834
2834
  registerTemplate({
2835
2835
  eventType: "task.trigger.assigned",
2836
2836
  header: "",
2837
- defaultBody: `{{work_on_task_cmd}} {{task_id}}{{task_desc_section}}{{output_instructions}}`,
2837
+ defaultBody: `{{work_on_task_cmd}} {{task_id}}{{task_desc_section}}{{attachments_section}}{{output_instructions}}`,
2838
2838
  variables: [
2839
2839
  { name: "work_on_task_cmd", description: "Formatted /work-on-task command" },
2840
2840
  { name: "task_id", description: "Task ID" },
2841
2841
  { name: "task_desc_section", description: "Task description section or empty string" },
2842
+ {
2843
+ name: "attachments_section",
2844
+ description: "Ready-to-run fetch recipe per task attachment (or empty string if none) — lets the agent download an attachment in one call instead of discovering the path/provider itself"
2845
+ },
2842
2846
  {
2843
2847
  name: "output_instructions",
2844
2848
  description: "Output format instructions (with outputSchema if present, or generic store-progress)"
@@ -4,14 +4,14 @@ import {
4
4
  handleScheduleTrigger,
5
5
  runScript,
6
6
  startWorkflowExecution
7
- } from "./cli-psz2xq0n.js";
7
+ } from "./cli-er5kffrx.js";
8
8
  import {
9
9
  getScript
10
- } from "./cli-3cfvx630.js";
10
+ } from "./cli-b7ytq2z8.js";
11
11
  import {
12
12
  createTaskWithSiblingAwareness,
13
13
  scheduleContextKey
14
- } from "./cli-a0w6tqyc.js";
14
+ } from "./cli-3p0e74xv.js";
15
15
  import {
16
16
  getDb,
17
17
  getDueScheduledTasks,
@@ -21,7 +21,7 @@ import {
21
21
  init_telemetry,
22
22
  telemetry,
23
23
  updateScheduledTask
24
- } from "./cli-9wv4e7qs.js";
24
+ } from "./cli-6jf8xfnt.js";
25
25
  import {
26
26
  __commonJS,
27
27
  __require,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_package,
3
3
  package_default
4
- } from "./cli-apdrt1ch.js";
4
+ } from "./cli-tc19ec02.js";
5
5
 
6
6
  // src/commands/shared/client-config.ts
7
7
  init_package();
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  createAdditiveBuffer,
3
3
  extractSlackMessageText
4
- } from "./cli-nmt32dxp.js";
4
+ } from "./cli-9zz27c9g.js";
5
5
  import {
6
6
  getSlackApp,
7
7
  registerTreeMessage
8
- } from "./cli-kppbkzj4.js";
8
+ } from "./cli-gg6zxrx1.js";
9
9
  import {
10
10
  buildBufferFlushBlocks
11
11
  } from "./cli-6xd0bvf8.js";
12
12
  import {
13
13
  createTaskWithSiblingAwareness,
14
14
  slackContextKey
15
- } from "./cli-a0w6tqyc.js";
15
+ } from "./cli-3p0e74xv.js";
16
16
  import {
17
17
  getLatestActiveTaskInThread,
18
18
  getLeadAgent,
@@ -20,7 +20,7 @@ import {
20
20
  init_db,
21
21
  init_registry,
22
22
  registerTemplate
23
- } from "./cli-9wv4e7qs.js";
23
+ } from "./cli-6jf8xfnt.js";
24
24
 
25
25
  // src/slack/event-dedup.ts
26
26
  var DEFAULT_TTL_MS = 300000;
@@ -3,7 +3,7 @@ import {
3
3
  getAgentWorkingOnThread,
4
4
  getAllAgents,
5
5
  init_db
6
- } from "./cli-9wv4e7qs.js";
6
+ } from "./cli-6jf8xfnt.js";
7
7
 
8
8
  // src/slack/router.ts
9
9
  init_db();
@@ -3,7 +3,7 @@ import {
3
3
  incrKv,
4
4
  init_db,
5
5
  upsertKv
6
- } from "./cli-9wv4e7qs.js";
6
+ } from "./cli-6jf8xfnt.js";
7
7
 
8
8
  // src/be/unmapped-identities.ts
9
9
  init_db();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-9wv4e7qs.js";
4
+ } from "./cli-6jf8xfnt.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  embedScript
3
- } from "./cli-cya9knf9.js";
3
+ } from "./cli-hc7hxy2m.js";
4
4
  import {
5
5
  computeContentHash,
6
6
  decryptSecret,
@@ -10,7 +10,7 @@ import {
10
10
  getSwarmConfigs,
11
11
  init_crypto,
12
12
  init_db
13
- } from "./cli-9wv4e7qs.js";
13
+ } from "./cli-6jf8xfnt.js";
14
14
  import {
15
15
  init_zod
16
16
  } from "./cli-q21d49ac.js";
@@ -23,7 +23,7 @@ import {
23
23
  withSpan,
24
24
  withSpanContext,
25
25
  writeSkillsToFilesystem
26
- } from "./cli-gx7gnvha.js";
26
+ } from "./cli-xekgq1r8.js";
27
27
  import {
28
28
  checkClaudeCredentials
29
29
  } from "./cli-2fc97xm5.js";
@@ -40,10 +40,10 @@ import {
40
40
  import {
41
41
  ensure,
42
42
  initialize
43
- } from "./cli-1zs2dm5w.js";
43
+ } from "./cli-6z0y1339.js";
44
44
  import {
45
45
  validateJsonSchema
46
- } from "./cli-psz2xq0n.js";
46
+ } from "./cli-er5kffrx.js";
47
47
  import {
48
48
  getApiKey
49
49
  } from "./cli-f14fvzag.js";
@@ -79,7 +79,7 @@ import {
79
79
  resolveTaskModelSelection,
80
80
  resolveTemplateAsync,
81
81
  telemetry
82
- } from "./cli-9wv4e7qs.js";
82
+ } from "./cli-6jf8xfnt.js";
83
83
  import {
84
84
  init_credentials,
85
85
  resolveCredentialPools
@@ -2809,6 +2809,30 @@ async function pollForTriggerOnce(opts) {
2809
2809
  }
2810
2810
  return null;
2811
2811
  }
2812
+ function buildAttachmentsSection(taskId, attachmentsRaw) {
2813
+ if (!taskId || !Array.isArray(attachmentsRaw) || attachmentsRaw.length === 0)
2814
+ return "";
2815
+ const lines = attachmentsRaw.filter((a) => !!a && typeof a === "object").map((a) => {
2816
+ const id = typeof a.id === "string" ? a.id : undefined;
2817
+ const name = typeof a.name === "string" ? a.name : id;
2818
+ if (!id || !name)
2819
+ return null;
2820
+ const details = [
2821
+ typeof a.mimeType === "string" ? a.mimeType : null,
2822
+ typeof a.sizeBytes === "number" ? `${a.sizeBytes} bytes` : null
2823
+ ].filter(Boolean).join(", ");
2824
+ const url = `$MCP_BASE_URL/api/fs/tasks/${taskId}/files/${id}/raw`;
2825
+ const cmd = `curl -s -H "Authorization: Bearer \${AGENT_SWARM_API_KEY:-$API_KEY}" -H "X-Agent-ID: $AGENT_ID" "${url}" -o /tmp/${name}`;
2826
+ return `- ${name}${details ? ` (${details})` : ""}: \`${cmd}\``;
2827
+ }).filter((line) => line !== null);
2828
+ if (lines.length === 0)
2829
+ return "";
2830
+ return `
2831
+
2832
+ \uD83D\uDCCE Attachment(s) — fetch directly, no need to discover the storage path yourself:
2833
+ ${lines.join(`
2834
+ `)}`;
2835
+ }
2812
2836
  async function buildPromptForTrigger(trigger, defaultPrompt, fmt = (cmd) => `/${cmd}`, options) {
2813
2837
  const hasMcp = options?.hasMcp !== false;
2814
2838
  switch (trigger.type) {
@@ -2836,10 +2860,12 @@ Call store-progress with status "completed" and your JSON output. If your output
2836
2860
  const requestedBySection = requestedBy ? `
2837
2861
 
2838
2862
  Requested by: ${requestedBy.name}${requestedBy.email ? ` (${requestedBy.email})` : ""}` : "";
2863
+ const attachmentsSection = buildAttachmentsSection(trigger.taskId, taskObj?.attachments);
2839
2864
  const result = await resolveTemplateAsync("task.trigger.assigned", {
2840
2865
  work_on_task_cmd: hasMcp ? fmt("work-on-task") : "",
2841
2866
  task_id: hasMcp ? trigger.taskId : "",
2842
2867
  task_desc_section: taskDescSection + requestedBySection,
2868
+ attachments_section: attachmentsSection,
2843
2869
  output_instructions: outputInstructions
2844
2870
  });
2845
2871
  return result.text;
@@ -3,7 +3,7 @@ import {
3
3
  init_date_utils,
4
4
  init_db,
5
5
  normalizeDateRequired
6
- } from "./cli-9wv4e7qs.js";
6
+ } from "./cli-6jf8xfnt.js";
7
7
 
8
8
  // src/be/db-queries/oauth.ts
9
9
  init_date_utils();
@@ -9,11 +9,11 @@ import {
9
9
  getScriptVersion,
10
10
  listRelationalCredentialBindings,
11
11
  validateScriptImports
12
- } from "./cli-3cfvx630.js";
12
+ } from "./cli-b7ytq2z8.js";
13
13
  import {
14
14
  withSiblingAwareness,
15
15
  workflowContextKey
16
- } from "./cli-a0w6tqyc.js";
16
+ } from "./cli-3p0e74xv.js";
17
17
  import {
18
18
  getAppUrl
19
19
  } from "./cli-dh55d5fg.js";
@@ -62,7 +62,7 @@ import {
62
62
  telemetry,
63
63
  updateWorkflowRun,
64
64
  updateWorkflowRunStep
65
- } from "./cli-9wv4e7qs.js";
65
+ } from "./cli-6jf8xfnt.js";
66
66
  import {
67
67
  init_zod
68
68
  } from "./cli-q21d49ac.js";
@@ -2515,7 +2515,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
2515
2515
  }
2516
2516
  if (notification.channel === "slack") {
2517
2517
  try {
2518
- const { getSlackApp } = await import("./app-0mcf7mwz.js");
2518
+ const { getSlackApp } = await import("./app-vn2sy15m.js");
2519
2519
  const slackApp = getSlackApp();
2520
2520
  if (!slackApp) {
2521
2521
  console.warn("[HITL] Slack not initialized — cannot send notification");
@@ -2629,7 +2629,7 @@ class NotifyExecutor extends BaseExecutor {
2629
2629
  }
2630
2630
  }
2631
2631
  case "slack": {
2632
- const { getSlackApp } = await import("./app-0mcf7mwz.js");
2632
+ const { getSlackApp } = await import("./app-vn2sy15m.js");
2633
2633
  const app = getSlackApp();
2634
2634
  if (!app) {
2635
2635
  return {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-9wv4e7qs.js";
4
+ } from "./cli-6jf8xfnt.js";
5
5
 
6
6
  // src/be/users.ts
7
7
  init_db();
@@ -25,7 +25,7 @@ import {
25
25
  getTaskById,
26
26
  init_db,
27
27
  setSlackMessageTracking
28
- } from "./cli-9wv4e7qs.js";
28
+ } from "./cli-6jf8xfnt.js";
29
29
  import {
30
30
  require_receiver,
31
31
  require_sender,
@@ -54988,13 +54988,13 @@ async function initSlackApp() {
54988
54988
  socketMode: true,
54989
54989
  logLevel: import_bolt.LogLevel.DEBUG
54990
54990
  });
54991
- const { registerMessageHandler } = await import("./handlers-pz3zc83m.js");
54992
- const { registerCommandHandler } = await import("./commands-4p93q1rf.js");
54993
- const { registerActionHandlers } = await import("./actions-sdr91cfp.js");
54991
+ const { registerMessageHandler } = await import("./handlers-v8th05yh.js");
54992
+ const { registerCommandHandler } = await import("./commands-11d7nc0g.js");
54993
+ const { registerActionHandlers } = await import("./actions-1hxdkcp6.js");
54994
54994
  registerMessageHandler(app);
54995
54995
  registerCommandHandler(app);
54996
54996
  registerActionHandlers(app);
54997
- const { createAssistant } = await import("./assistant-7f3cmabp.js");
54997
+ const { createAssistant } = await import("./assistant-sj71nx88.js");
54998
54998
  app.assistant(createAssistant());
54999
54999
  return app;
55000
55000
  }
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-vhpa5j27.js";
7
+ } from "./cli-5m4da9px.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-9wv4e7qs.js";
11
+ } from "./cli-6jf8xfnt.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  buildModelsDevSeedRows
3
- } from "./cli-entbgsd5.js";
3
+ } from "./cli-b4hwyzev.js";
4
4
  import {
5
5
  createLogEntry,
6
6
  getActivePricingRow,
7
7
  getDb,
8
8
  init_db,
9
9
  insertPricingRow
10
- } from "./cli-9wv4e7qs.js";
10
+ } from "./cli-6jf8xfnt.js";
11
11
  import {
12
12
  init_secret_scrubber,
13
13
  scrubSecrets