@desplega.ai/agent-swarm 1.109.0 → 1.110.0

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 (54) hide show
  1. package/dist/{actions-c67n3jxb.js → actions-837ktebk.js} +6 -6
  2. package/dist/{app-16zmk3px.js → app-85h97pg2.js} +3 -3
  3. package/dist/{assistant-5wzbdcqf.js → assistant-yhrta0c5.js} +9 -9
  4. package/dist/{boot-reembed-jd82hb59.js → boot-reembed-5sd1t9r4.js} +4 -4
  5. package/dist/{boot-reembed-3af9vms0.js → boot-reembed-8xmfv2pq.js} +3 -3
  6. package/dist/{boot-scrub-logs-858c7xqe.js → boot-scrub-logs-fdw8wbtq.js} +2 -2
  7. package/dist/{cli-68aqqrmf.js → cli-0pzg1f8z.js} +4 -4
  8. package/dist/{cli-4hapc9v6.js → cli-2h86bsfe.js} +2 -2
  9. package/dist/{cli-72vm595k.js → cli-3baz70yp.js} +1 -1
  10. package/dist/{cli-06p7cfcg.js → cli-3t97r3y1.js} +5 -5
  11. package/dist/{cli-rtqc5r54.js → cli-4trfcacj.js} +5 -5
  12. package/dist/{cli-0wbkrrky.js → cli-5kav4x1a.js} +1 -1
  13. package/dist/{cli-pqgd2rd1.js → cli-6ttdv68b.js} +1 -1
  14. package/dist/{cli-wjsj96hh.js → cli-8ps5wsk9.js} +1 -1
  15. package/dist/{cli-q95b16kk.js → cli-8s0swp2t.js} +3 -3
  16. package/dist/{cli-ef1wbkhh.js → cli-cwety9qq.js} +2 -2
  17. package/dist/{cli-ng2k7kwa.js → cli-d8vmtyyr.js} +2 -2
  18. package/dist/{cli-efaejv9v.js → cli-dhph6q98.js} +1 -1
  19. package/dist/{cli-7d38eycj.js → cli-dy01kwxk.js} +2 -2
  20. package/dist/{cli-wgbsdhjc.js → cli-g44ffxk5.js} +1 -1
  21. package/dist/{cli-dn44vqyb.js → cli-gb7dqnna.js} +1 -1
  22. package/dist/{cli-3s560caw.js → cli-gtt1f14h.js} +3 -3
  23. package/dist/{cli-wdp73c7w.js → cli-k6ssh5dk.js} +15 -5
  24. package/dist/{cli-eqq99cyd.js → cli-kg9v8h1w.js} +2 -2
  25. package/dist/{cli-aenr2vrd.js → cli-kna0r84e.js} +17 -17
  26. package/dist/{cli-phe0nm59.js → cli-r19ttke3.js} +4 -4
  27. package/dist/{cli-rk3snywa.js → cli-sjm0e1pa.js} +2 -2
  28. package/dist/{cli-4cgfsn4h.js → cli-vfyhrk9k.js} +1 -1
  29. package/dist/{cli-987a9zvn.js → cli-zw3cmjh6.js} +4 -4
  30. package/dist/cli.js +9 -9
  31. package/dist/{commands-0racez18.js → commands-3fh75nzv.js} +2 -2
  32. package/dist/{db-dt0zx0jq.js → db-kwfxkhpw.js} +2 -2
  33. package/dist/{handlers-aca9z23r.js → handlers-jj8rzetb.js} +9 -9
  34. package/dist/{hook-twh1eb6a.js → hook-1b45zzz1.js} +1 -1
  35. package/dist/{http-p2vvn9m1.js → http-71964f7a.js} +31 -31
  36. package/dist/{index-jw00ycgg.js → index-464v93y6.js} +9 -9
  37. package/dist/{index-kax7pt3w.js → index-c35g752k.js} +6 -6
  38. package/dist/{index-nbh8s0gd.js → index-e01wmtj0.js} +7 -7
  39. package/dist/{index-md9ke5yd.js → index-zm0x6vmf.js} +8 -8
  40. package/dist/{keepalive-54awap1s.js → keepalive-2gxqjgrx.js} +4 -4
  41. package/dist/{lead-xqf6mzb8.js → lead-twm4zp8y.js} +17 -17
  42. package/dist/{maintenance-1eqnnqwz.js → maintenance-1htsnyz6.js} +4 -4
  43. package/dist/{onboard-jwhd9g2q.js → onboard-1y1pdzt5.js} +2 -2
  44. package/dist/{otel-impl-zx1b8yr9.js → otel-impl-pw9tnc80.js} +1 -1
  45. package/dist/{pricing-refresh-q3yep8w5.js → pricing-refresh-tqvvrk7a.js} +4 -4
  46. package/dist/{seed-pricing-1af3yh3p.js → seed-pricing-f23sehzq.js} +3 -3
  47. package/dist/{setup-10f473wc.js → setup-jtw9rz9t.js} +2 -2
  48. package/dist/{worker-exyz0652.js → worker-jxrmzwb9.js} +17 -17
  49. package/openapi.json +1 -1
  50. package/package.json +2 -2
  51. package/src/be/db.ts +11 -11
  52. package/src/tasks/worker-follow-up.ts +47 -23
  53. package/src/tests/heartbeat-reroute-decision.test.ts +49 -0
  54. package/src/tests/task-supersede-resume.test.ts +83 -6
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-q95b16kk.js";
4
- import"./cli-efaejv9v.js";
5
- import"./cli-dn44vqyb.js";
3
+ } from "./cli-8s0swp2t.js";
4
+ import"./cli-dhph6q98.js";
5
+ import"./cli-gb7dqnna.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-wjsj96hh.js";
14
+ } from "./cli-8ps5wsk9.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-ng2k7kwa.js";
22
+ } from "./cli-d8vmtyyr.js";
23
23
  import"./cli-z2zcxes1.js";
24
24
  import"./cli-q21d49ac.js";
25
25
  import"./cli-anrj584m.js";
26
- import"./cli-eqq99cyd.js";
26
+ import"./cli-kg9v8h1w.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-rtqc5r54.js";
6
+ } from "./cli-4trfcacj.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-ng2k7kwa.js";
12
+ import"./cli-d8vmtyyr.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-q21d49ac.js";
15
15
  import"./cli-anrj584m.js";
16
- import"./cli-eqq99cyd.js";
16
+ import"./cli-kg9v8h1w.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-phe0nm59.js";
4
+ } from "./cli-r19ttke3.js";
5
5
  import {
6
6
  hasOtherUserMention
7
- } from "./cli-wgbsdhjc.js";
7
+ } from "./cli-g44ffxk5.js";
8
8
  import {
9
9
  require_dist
10
- } from "./cli-rtqc5r54.js";
10
+ } from "./cli-4trfcacj.js";
11
11
  import"./cli-rkndnn90.js";
12
12
  import"./cli-b0p7rfnd.js";
13
13
  import {
14
14
  resolveSlackUserId
15
- } from "./cli-q95b16kk.js";
16
- import"./cli-efaejv9v.js";
17
- import"./cli-dn44vqyb.js";
15
+ } from "./cli-8s0swp2t.js";
16
+ import"./cli-dhph6q98.js";
17
+ import"./cli-gb7dqnna.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-wjsj96hh.js";
23
+ } from "./cli-8ps5wsk9.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-ng2k7kwa.js";
32
+ } from "./cli-d8vmtyyr.js";
33
33
  import"./cli-z2zcxes1.js";
34
34
  import"./cli-q21d49ac.js";
35
35
  import"./cli-anrj584m.js";
36
- import"./cli-eqq99cyd.js";
36
+ import"./cli-kg9v8h1w.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-7d38eycj.js";
5
- import"./cli-0wbkrrky.js";
4
+ } from "./cli-dy01kwxk.js";
5
+ import"./cli-5kav4x1a.js";
6
6
  import"./cli-q25ejbyn.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-ng2k7kwa.js";
10
+ } from "./cli-d8vmtyyr.js";
11
11
  import"./cli-z2zcxes1.js";
12
12
  import"./cli-q21d49ac.js";
13
13
  import"./cli-anrj584m.js";
14
- import"./cli-eqq99cyd.js";
14
+ import"./cli-kg9v8h1w.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-0wbkrrky.js";
6
+ } from "./cli-5kav4x1a.js";
7
7
  import"./cli-q25ejbyn.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-ng2k7kwa.js";
11
+ } from "./cli-d8vmtyyr.js";
12
12
  import"./cli-z2zcxes1.js";
13
13
  import"./cli-q21d49ac.js";
14
14
  import"./cli-anrj584m.js";
15
- import"./cli-eqq99cyd.js";
15
+ import"./cli-kg9v8h1w.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-ng2k7kwa.js";
4
+ } from "./cli-d8vmtyyr.js";
5
5
  import"./cli-z2zcxes1.js";
6
6
  import"./cli-q21d49ac.js";
7
7
  import"./cli-anrj584m.js";
8
- import"./cli-eqq99cyd.js";
8
+ import"./cli-kg9v8h1w.js";
9
9
  import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
@@ -23,7 +23,7 @@ import {
23
23
  withSpan,
24
24
  withSpanContext,
25
25
  writeSkillsToFilesystem
26
- } from "./cli-aenr2vrd.js";
26
+ } from "./cli-kna0r84e.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-987a9zvn.js";
43
+ } from "./cli-zw3cmjh6.js";
44
44
  import {
45
45
  validateJsonSchema
46
- } from "./cli-06p7cfcg.js";
46
+ } from "./cli-3t97r3y1.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-ng2k7kwa.js";
82
+ } from "./cli-d8vmtyyr.js";
83
83
  import {
84
84
  init_credentials,
85
85
  resolveCredentialPools
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  embedScript
3
- } from "./cli-7d38eycj.js";
3
+ } from "./cli-dy01kwxk.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-ng2k7kwa.js";
13
+ } from "./cli-d8vmtyyr.js";
14
14
  import {
15
15
  init_zod
16
16
  } from "./cli-q21d49ac.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-ng2k7kwa.js";
4
+ } from "./cli-d8vmtyyr.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-4hapc9v6.js";
12
+ } from "./cli-2h86bsfe.js";
13
13
  import {
14
14
  withSiblingAwareness,
15
15
  workflowContextKey
16
- } from "./cli-wjsj96hh.js";
16
+ } from "./cli-8ps5wsk9.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-ng2k7kwa.js";
65
+ } from "./cli-d8vmtyyr.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-16zmk3px.js");
2518
+ const { getSlackApp } = await import("./app-85h97pg2.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-16zmk3px.js");
2632
+ const { getSlackApp } = await import("./app-85h97pg2.js");
2633
2633
  const app = getSlackApp();
2634
2634
  if (!app) {
2635
2635
  return {
@@ -25,7 +25,7 @@ import {
25
25
  getTaskById,
26
26
  init_db,
27
27
  setSlackMessageTracking
28
- } from "./cli-ng2k7kwa.js";
28
+ } from "./cli-d8vmtyyr.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-aca9z23r.js");
54992
- const { registerCommandHandler } = await import("./commands-0racez18.js");
54993
- const { registerActionHandlers } = await import("./actions-c67n3jxb.js");
54991
+ const { registerMessageHandler } = await import("./handlers-jj8rzetb.js");
54992
+ const { registerCommandHandler } = await import("./commands-3fh75nzv.js");
54993
+ const { registerActionHandlers } = await import("./actions-837ktebk.js");
54994
54994
  registerMessageHandler(app);
54995
54995
  registerCommandHandler(app);
54996
54996
  registerActionHandlers(app);
54997
- const { createAssistant } = await import("./assistant-5wzbdcqf.js");
54997
+ const { createAssistant } = await import("./assistant-yhrta0c5.js");
54998
54998
  app.assistant(createAssistant());
54999
54999
  return app;
55000
55000
  }
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-ng2k7kwa.js";
9
+ } from "./cli-d8vmtyyr.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -3,7 +3,7 @@ import {
3
3
  init_date_utils,
4
4
  init_db,
5
5
  normalizeDateRequired
6
- } from "./cli-ng2k7kwa.js";
6
+ } from "./cli-d8vmtyyr.js";
7
7
 
8
8
  // src/be/db-queries/oauth.ts
9
9
  init_date_utils();
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-ng2k7kwa.js";
6
+ } from "./cli-d8vmtyyr.js";
7
7
 
8
8
  // src/tasks/context-key.ts
9
9
  var SEPARATOR = ":";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  recordUnmappedIdentity
3
- } from "./cli-efaejv9v.js";
3
+ } from "./cli-dhph6q98.js";
4
4
  import {
5
5
  findOrCreateUserByEmail,
6
6
  findUserByExternalId,
7
7
  linkIdentity
8
- } from "./cli-dn44vqyb.js";
8
+ } from "./cli-gb7dqnna.js";
9
9
  import {
10
10
  getKv,
11
11
  init_db,
12
12
  upsertKv
13
- } from "./cli-ng2k7kwa.js";
13
+ } from "./cli-d8vmtyyr.js";
14
14
 
15
15
  // src/slack/enrich.ts
16
16
  init_db();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getScriptApiTypes,
3
3
  require_typescript
4
- } from "./cli-4hapc9v6.js";
4
+ } from "./cli-2h86bsfe.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-ng2k7kwa.js";
13
+ } from "./cli-d8vmtyyr.js";
14
14
  import {
15
15
  init_secret_scrubber,
16
16
  scrubSecrets
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  init_package,
27
27
  package_default
28
- } from "./cli-eqq99cyd.js";
28
+ } from "./cli-kg9v8h1w.js";
29
29
  import {
30
30
  init_secret_scrubber,
31
31
  scrubSecrets
@@ -7140,7 +7140,7 @@ function getStalePinnedResumes(graceMin) {
7140
7140
  const cutoff = new Date(Date.now() - graceMin * 60 * 1000).toISOString();
7141
7141
  return getDb().prepare(`SELECT * FROM agent_tasks
7142
7142
  WHERE taskType = 'resume' AND status = 'pending'
7143
- AND tags LIKE '%"crash-recovery-pin"%'
7143
+ AND (tags LIKE '%"crash-recovery-pin"%' OR tags LIKE '%"graceful-shutdown-pin"%')
7144
7144
  AND createdAt < ?
7145
7145
  ORDER BY createdAt ASC`).all(cutoff).map(rowToAgentTask);
7146
7146
  }
@@ -3,7 +3,7 @@ import {
3
3
  incrKv,
4
4
  init_db,
5
5
  upsertKv
6
- } from "./cli-ng2k7kwa.js";
6
+ } from "./cli-d8vmtyyr.js";
7
7
 
8
8
  // src/be/unmapped-identities.ts
9
9
  init_db();
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-0wbkrrky.js";
7
+ } from "./cli-5kav4x1a.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-ng2k7kwa.js";
11
+ } from "./cli-d8vmtyyr.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -3,7 +3,7 @@ import {
3
3
  getAgentWorkingOnThread,
4
4
  getAllAgents,
5
5
  init_db
6
- } from "./cli-ng2k7kwa.js";
6
+ } from "./cli-d8vmtyyr.js";
7
7
 
8
8
  // src/slack/router.ts
9
9
  init_db();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-ng2k7kwa.js";
4
+ } from "./cli-d8vmtyyr.js";
5
5
 
6
6
  // src/be/users.ts
7
7
  init_db();
@@ -4,11 +4,11 @@ import {
4
4
  getNextResumeGeneration,
5
5
  getResumeGeneration,
6
6
  repointTrackerSyncBySwarmId
7
- } from "./cli-wdp73c7w.js";
7
+ } from "./cli-k6ssh5dk.js";
8
8
  import {
9
9
  getExecutorRegistry,
10
10
  recoverIncompleteRuns
11
- } from "./cli-06p7cfcg.js";
11
+ } from "./cli-3t97r3y1.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-ng2k7kwa.js";
47
+ } from "./cli-d8vmtyyr.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-ng2k7kwa.js";
20
+ } from "./cli-d8vmtyyr.js";
21
21
 
22
22
  // src/be/db-queries/tracker.ts
23
23
  init_date_utils();
@@ -141,8 +141,12 @@ init_resolver();
141
141
  init_templates();
142
142
  var WORKER_LIVENESS_WINDOW_SECONDS = Number(process.env.WORKER_LIVENESS_WINDOW_SECONDS || "30");
143
143
  var HEARTBEAT_PIN_CRASH_RESUME = process.env.HEARTBEAT_PIN_CRASH_RESUME !== "0";
144
+ function isGracefulResumePinEnabled() {
145
+ return process.env.HEARTBEAT_PIN_GRACEFUL_RESUME !== "0";
146
+ }
144
147
  var RESUME_GENERATION_TAG_PREFIX = "resume-generation:";
145
148
  var CRASH_RECOVERY_PIN_TAG = "crash-recovery-pin";
149
+ var GRACEFUL_SHUTDOWN_PIN_TAG = "graceful-shutdown-pin";
146
150
  function getResumeGeneration(task) {
147
151
  const tag = task.tags.find((value) => value.startsWith(RESUME_GENERATION_TAG_PREFIX));
148
152
  if (!tag)
@@ -242,7 +246,7 @@ function createResumeFollowUp(args) {
242
246
  return { kind: "workflow-skip", stepId: parent.workflowRunStepId };
243
247
  }
244
248
  let preferredAgentId;
245
- if (parent.agentId && args.reason !== "graceful_shutdown") {
249
+ if (parent.agentId) {
246
250
  const candidate = getAgentById(parent.agentId);
247
251
  if (candidate && candidate.status !== "offline") {
248
252
  const lastActivity = candidate.lastActivityAt ? Date.parse(candidate.lastActivityAt) : 0;
@@ -250,10 +254,13 @@ function createResumeFollowUp(args) {
250
254
  const activeCount = getActiveTaskCount(candidate.id);
251
255
  const hasCap = activeCount < (candidate.maxTasks ?? 1);
252
256
  const isCrashRecovery = args.reason === "crash_recovery" && HEARTBEAT_PIN_CRASH_RESUME;
253
- if (hasCap && (isCrashRecovery || fresh)) {
257
+ const isGracefulShutdown = args.reason === "graceful_shutdown";
258
+ const isGracefulPin = isGracefulShutdown && isGracefulResumePinEnabled();
259
+ const isFreshPinnedReason = !isGracefulShutdown && fresh;
260
+ if (hasCap && (isCrashRecovery || isGracefulPin || isFreshPinnedReason)) {
254
261
  preferredAgentId = candidate.id;
255
- } else if (isCrashRecovery && !hasCap) {
256
- console.warn(`[Heartbeat] crash_recovery resume for task ${parent.id.slice(0, 8)} NOT pinned: agent ${candidate.id.slice(0, 8)} at capacity (${activeCount}/${candidate.maxTasks ?? 1}); falling back to unassigned pool`);
262
+ } else if ((isCrashRecovery || isGracefulPin) && !hasCap) {
263
+ console.warn(`[Heartbeat] ${args.reason} resume for task ${parent.id.slice(0, 8)} NOT pinned: agent ${candidate.id.slice(0, 8)} at capacity (${activeCount}/${candidate.maxTasks ?? 1}); falling back to unassigned pool`);
257
264
  }
258
265
  }
259
266
  }
@@ -279,6 +286,9 @@ function createResumeFollowUp(args) {
279
286
  if (args.reason === "crash_recovery" && preferredAgentId !== undefined) {
280
287
  tags.push(CRASH_RECOVERY_PIN_TAG);
281
288
  }
289
+ if (args.reason === "graceful_shutdown" && preferredAgentId !== undefined) {
290
+ tags.push(GRACEFUL_SHUTDOWN_PIN_TAG);
291
+ }
282
292
  const created = createTaskExtended(followUpDescription, {
283
293
  agentId: preferredAgentId,
284
294
  creatorAgentId: parent.creatorAgentId,
@@ -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.109.0",
10
+ version: "1.110.0",
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>",
@@ -153,7 +153,7 @@ var init_package = __esm(() => {
153
153
  "@linear/sdk": "^77.0.0",
154
154
  "@modelcontextprotocol/sdk": "^1.25.1",
155
155
  "@openai/codex-sdk": "^0.142.5",
156
- "@opencode-ai/sdk": "^1.17.12",
156
+ "@opencode-ai/sdk": "^1.17.13",
157
157
  "@openfort/openfort-node": "^0.9.1",
158
158
  "@opentelemetry/api": "^1.9.1",
159
159
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -14,13 +14,13 @@ import {
14
14
  getOAuthApp,
15
15
  getOAuthTokens,
16
16
  upsertOAuthApp
17
- } from "./cli-pqgd2rd1.js";
17
+ } from "./cli-6ttdv68b.js";
18
18
  import {
19
19
  startPricingRefreshLoop
20
- } from "./cli-rk3snywa.js";
20
+ } from "./cli-sjm0e1pa.js";
21
21
  import {
22
22
  seedPricingFromModelsDev
23
- } from "./cli-72vm595k.js";
23
+ } from "./cli-3baz70yp.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-wdp73c7w.js";
38
+ } from "./cli-k6ssh5dk.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-987a9zvn.js";
48
+ } from "./cli-zw3cmjh6.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-06p7cfcg.js";
60
+ } from "./cli-3t97r3y1.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-4hapc9v6.js";
76
+ } from "./cli-2h86bsfe.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-0wbkrrky.js";
84
+ } from "./cli-5kav4x1a.js";
85
85
  import {
86
86
  createAdditiveBuffer,
87
87
  extractSlackMessageText
88
- } from "./cli-wgbsdhjc.js";
88
+ } from "./cli-g44ffxk5.js";
89
89
  import {
90
90
  getSlackApp,
91
91
  startSlackApp,
92
92
  stopSlackApp
93
- } from "./cli-rtqc5r54.js";
93
+ } from "./cli-4trfcacj.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-dn44vqyb.js";
105
+ } from "./cli-gb7dqnna.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-wjsj96hh.js";
116
+ } from "./cli-8ps5wsk9.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-ng2k7kwa.js";
345
+ } from "./cli-d8vmtyyr.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-eqq99cyd.js";
389
+ } from "./cli-kg9v8h1w.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-zx1b8yr9.js");
19671
+ const impl = await import("./otel-impl-pw9tnc80.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-16zmk3px.js");
32887
+ const { getSlackApp: getSlackApp2 } = await import("./app-85h97pg2.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-dt0zx0jq.js");
32956
+ const { getDb: getDb2 } = await import("./db-kwfxkhpw.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();