@desplega.ai/agent-swarm 1.108.0 → 1.108.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 (64) hide show
  1. package/dist/{actions-sdr91cfp.js → actions-0rszpr51.js} +6 -6
  2. package/dist/{app-0mcf7mwz.js → app-0rchrsgj.js} +3 -3
  3. package/dist/{assistant-7f3cmabp.js → assistant-81233cgs.js} +9 -9
  4. package/dist/{boot-reembed-a9btk2eh.js → boot-reembed-m4fdfvde.js} +4 -4
  5. package/dist/{boot-reembed-47cfre4w.js → boot-reembed-rcfexjee.js} +3 -3
  6. package/dist/{boot-scrub-logs-hy8pqhej.js → boot-scrub-logs-4r9w8ep9.js} +2 -2
  7. package/dist/{cli-j9eqkarv.js → cli-4nc1v1ez.js} +3 -3
  8. package/dist/{cli-vemx13wc.js → cli-5cv1m3gd.js} +3 -3
  9. package/dist/{cli-vhpa5j27.js → cli-9aqwqmyw.js} +1 -1
  10. package/dist/{cli-gx7gnvha.js → cli-a9ycng51.js} +17 -17
  11. package/dist/{cli-entbgsd5.js → cli-awex6rqa.js} +1 -1
  12. package/dist/{cli-psz2xq0n.js → cli-cb4yzbvr.js} +5 -5
  13. package/dist/{cli-apdrt1ch.js → cli-czc8mmc6.js} +1 -1
  14. package/dist/{cli-mmaz2btq.js → cli-dr8bpgf0.js} +1 -1
  15. package/dist/{cli-m0k99m2s.js → cli-dvn23403.js} +1 -1
  16. package/dist/{cli-mkn2ryba.js → cli-frbw04sq.js} +1 -1
  17. package/dist/{cli-a0w6tqyc.js → cli-h53vbe8k.js} +1 -1
  18. package/dist/{cli-nmt32dxp.js → cli-hz7jggwp.js} +1 -1
  19. package/dist/{cli-xy83cmfc.js → cli-m0j9g47t.js} +33 -6
  20. package/dist/{cli-cya9knf9.js → cli-mq1zkwmr.js} +2 -2
  21. package/dist/{cli-7r40bgvr.js → cli-q0ea86r9.js} +4 -4
  22. package/dist/{cli-tehpf2fm.js → cli-qcw09hr8.js} +1 -1
  23. package/dist/{cli-a8gkr14c.js → cli-r48tdxbv.js} +30 -4
  24. package/dist/{cli-kppbkzj4.js → cli-thc24d4s.js} +5 -5
  25. package/dist/{cli-h2qhdwhr.js → cli-vzdjbf7f.js} +1 -1
  26. package/dist/{cli-75b0wmer.js → cli-xcty7st9.js} +2 -2
  27. package/dist/{cli-3cfvx630.js → cli-xx2e6rpj.js} +2 -2
  28. package/dist/{cli-9wv4e7qs.js → cli-y8py1s7d.js} +7 -3
  29. package/dist/{cli-1zs2dm5w.js → cli-zh0zc88x.js} +4 -4
  30. package/dist/cli.js +8 -8
  31. package/dist/{commands-4p93q1rf.js → commands-rhnr6ekp.js} +2 -2
  32. package/dist/{db-hb0chrmg.js → db-9b4nhwt8.js} +2 -2
  33. package/dist/{handlers-pz3zc83m.js → handlers-exza1nv9.js} +9 -9
  34. package/dist/{hook-mye8ket2.js → hook-erz5hmx3.js} +1 -1
  35. package/dist/{http-3nrx1tp1.js → http-hpjpkat2.js} +73 -37
  36. package/dist/{index-17n7z8k8.js → index-n2t8g26e.js} +9 -9
  37. package/dist/{index-6sgpkhby.js → index-takxjn9f.js} +6 -6
  38. package/dist/{index-rys8ctm6.js → index-ve59rfv2.js} +7 -7
  39. package/dist/{index-x9n06ze1.js → index-zbbfkz52.js} +8 -8
  40. package/dist/{keepalive-b6eax0y0.js → keepalive-sy9ge11x.js} +4 -4
  41. package/dist/{lead-v1g4j7he.js → lead-kanxwtfj.js} +17 -17
  42. package/dist/{maintenance-xwf1vf0v.js → maintenance-5b5f4yr3.js} +4 -4
  43. package/dist/{onboard-vy0z8b11.js → onboard-00fgv018.js} +2 -2
  44. package/dist/{otel-impl-94sm94jm.js → otel-impl-s0pfpd9q.js} +1 -1
  45. package/dist/{pricing-refresh-an9bxjcd.js → pricing-refresh-0fw4v1j0.js} +4 -4
  46. package/dist/{seed-pricing-3t22x5ax.js → seed-pricing-z88nemdf.js} +3 -3
  47. package/dist/{setup-8hd3jk8s.js → setup-e09wnnsm.js} +2 -2
  48. package/dist/{worker-s0xm8naj.js → worker-w01ptydp.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-4nc1v1ez.js";
4
+ import"./cli-dvn23403.js";
5
+ import"./cli-dr8bpgf0.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-h53vbe8k.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-y8py1s7d.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-czc8mmc6.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-thc24d4s.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-y8py1s7d.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-czc8mmc6.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-q0ea86r9.js";
5
5
  import {
6
6
  hasOtherUserMention
7
- } from "./cli-nmt32dxp.js";
7
+ } from "./cli-hz7jggwp.js";
8
8
  import {
9
9
  require_dist
10
- } from "./cli-kppbkzj4.js";
10
+ } from "./cli-thc24d4s.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-4nc1v1ez.js";
16
+ import"./cli-dvn23403.js";
17
+ import"./cli-dr8bpgf0.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-h53vbe8k.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-y8py1s7d.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-czc8mmc6.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-mq1zkwmr.js";
5
+ import"./cli-9aqwqmyw.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-y8py1s7d.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-czc8mmc6.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-9aqwqmyw.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-y8py1s7d.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-czc8mmc6.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-y8py1s7d.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-czc8mmc6.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-dvn23403.js";
4
4
  import {
5
5
  findOrCreateUserByEmail,
6
6
  findUserByExternalId,
7
7
  linkIdentity
8
- } from "./cli-mmaz2btq.js";
8
+ } from "./cli-dr8bpgf0.js";
9
9
  import {
10
10
  getKv,
11
11
  init_db,
12
12
  upsertKv
13
- } from "./cli-9wv4e7qs.js";
13
+ } from "./cli-y8py1s7d.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-vzdjbf7f.js";
8
8
  import {
9
9
  getExecutorRegistry,
10
10
  recoverIncompleteRuns
11
- } from "./cli-psz2xq0n.js";
11
+ } from "./cli-cb4yzbvr.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-y8py1s7d.js";
48
48
 
49
49
  // src/heartbeat/heartbeat.ts
50
50
  init_db();
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-9wv4e7qs.js";
9
+ } from "./cli-y8py1s7d.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -14,13 +14,13 @@ import {
14
14
  getOAuthApp,
15
15
  getOAuthTokens,
16
16
  upsertOAuthApp
17
- } from "./cli-tehpf2fm.js";
17
+ } from "./cli-qcw09hr8.js";
18
18
  import {
19
19
  startPricingRefreshLoop
20
- } from "./cli-75b0wmer.js";
20
+ } from "./cli-xcty7st9.js";
21
21
  import {
22
22
  seedPricingFromModelsDev
23
- } from "./cli-entbgsd5.js";
23
+ } from "./cli-awex6rqa.js";
24
24
  import {
25
25
  createTrackerAgentMapping,
26
26
  createTrackerSync,
@@ -35,7 +35,7 @@ import {
35
35
  repointTrackerSyncBySwarmId,
36
36
  updateTrackerSync,
37
37
  updateTrackerSyncSwarmId
38
- } from "./cli-h2qhdwhr.js";
38
+ } from "./cli-vzdjbf7f.js";
39
39
  import {
40
40
  ZodFirstPartyTypeKind,
41
41
  objectType
@@ -45,7 +45,7 @@ import {
45
45
  ensure,
46
46
  require_dist,
47
47
  runScheduleNow
48
- } from "./cli-1zs2dm5w.js";
48
+ } from "./cli-zh0zc88x.js";
49
49
  import {
50
50
  TriggerSchemaError,
51
51
  applyDefinitionPatch,
@@ -57,7 +57,7 @@ import {
57
57
  startWorkflowExecution,
58
58
  validateDefinition,
59
59
  validateJsonSchema
60
- } from "./cli-psz2xq0n.js";
60
+ } from "./cli-cb4yzbvr.js";
61
61
  import {
62
62
  getApiKey
63
63
  } from "./cli-f14fvzag.js";
@@ -73,7 +73,7 @@ import {
73
73
  setScriptConnectionEnabled,
74
74
  upsertCredentialBinding,
75
75
  upsertScriptConnection
76
- } from "./cli-3cfvx630.js";
76
+ } from "./cli-xx2e6rpj.js";
77
77
  import {
78
78
  CANDIDATE_SET_MULTIPLIER,
79
79
  getEmbeddingProvider,
@@ -81,16 +81,16 @@ import {
81
81
  init_constants,
82
82
  init_reranker,
83
83
  rerank
84
- } from "./cli-vhpa5j27.js";
84
+ } from "./cli-9aqwqmyw.js";
85
85
  import {
86
86
  createAdditiveBuffer,
87
87
  extractSlackMessageText
88
- } from "./cli-nmt32dxp.js";
88
+ } from "./cli-hz7jggwp.js";
89
89
  import {
90
90
  getSlackApp,
91
91
  startSlackApp,
92
92
  stopSlackApp
93
- } from "./cli-kppbkzj4.js";
93
+ } from "./cli-thc24d4s.js";
94
94
  import {
95
95
  findOrCreateUserByEmail,
96
96
  findUserByEmail,
@@ -102,7 +102,7 @@ import {
102
102
  recordIdentityEvent,
103
103
  resolveUserByToken,
104
104
  unlinkIdentity
105
- } from "./cli-mmaz2btq.js";
105
+ } from "./cli-dr8bpgf0.js";
106
106
  import {
107
107
  markdownToSlack
108
108
  } from "./cli-6xd0bvf8.js";
@@ -113,7 +113,7 @@ import {
113
113
  createTaskWithSiblingAwareness,
114
114
  githubContextKey,
115
115
  linearContextKey
116
- } from "./cli-a0w6tqyc.js";
116
+ } from "./cli-h53vbe8k.js";
117
117
  import {
118
118
  getAppUrl,
119
119
  getMcpBaseUrl,
@@ -342,7 +342,7 @@ import {
342
342
  upsertService,
343
343
  upsertSwarmConfig,
344
344
  validateConfigValue
345
- } from "./cli-9wv4e7qs.js";
345
+ } from "./cli-y8py1s7d.js";
346
346
  import {
347
347
  init_zod
348
348
  } from "./cli-q21d49ac.js";
@@ -386,7 +386,7 @@ import {
386
386
  import {
387
387
  init_package,
388
388
  package_default
389
- } from "./cli-apdrt1ch.js";
389
+ } from "./cli-czc8mmc6.js";
390
390
  import {
391
391
  init_secret_scrubber,
392
392
  refreshSecretScrubberCache,
@@ -19668,7 +19668,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
19668
19668
  return;
19669
19669
  initialized2 = true;
19670
19670
  try {
19671
- const impl = await import("./otel-impl-94sm94jm.js");
19671
+ const impl = await import("./otel-impl-s0pfpd9q.js");
19672
19672
  await impl.boot(serviceRole);
19673
19673
  realWithSpan = impl.withSpan;
19674
19674
  realStartSpan = impl.startSpan;
@@ -32884,7 +32884,7 @@ async function notifySlack(text) {
32884
32884
  return;
32885
32885
  }
32886
32886
  try {
32887
- const { getSlackApp: getSlackApp2 } = await import("./app-0mcf7mwz.js");
32887
+ const { getSlackApp: getSlackApp2 } = await import("./app-0rchrsgj.js");
32888
32888
  const app = getSlackApp2();
32889
32889
  if (!app) {
32890
32890
  console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
@@ -32953,7 +32953,7 @@ async function deleteJiraWebhook(webhookId) {
32953
32953
  console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
32954
32954
  }
32955
32955
  async function overwriteWebhookIds(next) {
32956
- const { getDb: getDb2 } = await import("./db-hb0chrmg.js");
32956
+ const { getDb: getDb2 } = await import("./db-9b4nhwt8.js");
32957
32957
  const db = getDb2();
32958
32958
  const txn = db.transaction(() => {
32959
32959
  const row = db.query("SELECT metadata FROM oauth_apps WHERE provider = 'jira'").get();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-9wv4e7qs.js";
4
+ } from "./cli-y8py1s7d.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -9,11 +9,11 @@ import {
9
9
  getScriptVersion,
10
10
  listRelationalCredentialBindings,
11
11
  validateScriptImports
12
- } from "./cli-3cfvx630.js";
12
+ } from "./cli-xx2e6rpj.js";
13
13
  import {
14
14
  withSiblingAwareness,
15
15
  workflowContextKey
16
- } from "./cli-a0w6tqyc.js";
16
+ } from "./cli-h53vbe8k.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-y8py1s7d.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-0rchrsgj.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-0rchrsgj.js");
2633
2633
  const app = getSlackApp();
2634
2634
  if (!app) {
2635
2635
  return {
@@ -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.108.0",
10
+ version: "1.108.1",
11
11
  description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
12
12
  license: "MIT",
13
13
  author: "desplega.sh <contact@desplega.sh>",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-9wv4e7qs.js";
4
+ } from "./cli-y8py1s7d.js";
5
5
 
6
6
  // src/be/users.ts
7
7
  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-y8py1s7d.js";
7
7
 
8
8
  // src/be/unmapped-identities.ts
9
9
  init_db();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_package,
3
3
  package_default
4
- } from "./cli-apdrt1ch.js";
4
+ } from "./cli-czc8mmc6.js";
5
5
 
6
6
  // src/commands/shared/client-config.ts
7
7
  init_package();
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-9wv4e7qs.js";
6
+ } from "./cli-y8py1s7d.js";
7
7
 
8
8
  // src/tasks/context-key.ts
9
9
  var SEPARATOR = ":";
@@ -3,7 +3,7 @@ import {
3
3
  getAgentWorkingOnThread,
4
4
  getAllAgents,
5
5
  init_db
6
- } from "./cli-9wv4e7qs.js";
6
+ } from "./cli-y8py1s7d.js";
7
7
 
8
8
  // src/slack/router.ts
9
9
  init_db();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getScriptApiTypes,
3
3
  require_typescript
4
- } from "./cli-3cfvx630.js";
4
+ } from "./cli-xx2e6rpj.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-y8py1s7d.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({
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-vhpa5j27.js";
7
+ } from "./cli-9aqwqmyw.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-9wv4e7qs.js";
11
+ } from "./cli-y8py1s7d.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  createAdditiveBuffer,
3
3
  extractSlackMessageText
4
- } from "./cli-nmt32dxp.js";
4
+ } from "./cli-hz7jggwp.js";
5
5
  import {
6
6
  getSlackApp,
7
7
  registerTreeMessage
8
- } from "./cli-kppbkzj4.js";
8
+ } from "./cli-thc24d4s.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-h53vbe8k.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-y8py1s7d.js";
24
24
 
25
25
  // src/slack/event-dedup.ts
26
26
  var DEFAULT_TTL_MS = 300000;
@@ -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-y8py1s7d.js";
7
7
 
8
8
  // src/be/db-queries/oauth.ts
9
9
  init_date_utils();