@desplega.ai/agent-swarm 1.161.0 → 1.162.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 (224) hide show
  1. package/README.md +3 -2
  2. package/dist/{acp-adapter-xx489vvb.js → acp-adapter-74m73ae9.js} +1 -1
  3. package/dist/{actions-ykjkn0m9.js → actions-4sr14gnt.js} +34 -31
  4. package/dist/{anthropic-messages-5qx80j9k.js → anthropic-messages-8xxrzky9.js} +22 -26
  5. package/dist/{app-0hdqa4k1.js → app-pt68fbwp.js} +13 -11
  6. package/dist/{artifact-3v5t9jtg.js → artifact-fey7dvj9.js} +3 -2
  7. package/dist/{assistant-am2g5g8a.js → assistant-cv3jytks.js} +37 -34
  8. package/dist/{azure-openai-responses-fszbkp0e.js → azure-openai-responses-f5cqsyj8.js} +15 -10
  9. package/dist/{boot-reembed-xy9t7avg.js → boot-reembed-4ht4gqth.js} +13 -11
  10. package/dist/{boot-reembed-gt5gjkt4.js → boot-reembed-nxpcvpj9.js} +12 -10
  11. package/dist/{boot-scrub-logs-9x0985y5.js → boot-scrub-logs-k93kyw8k.js} +9 -7
  12. package/dist/{boot-seeds-trv0d4vg.js → boot-seeds-1skcrs0e.js} +13 -10
  13. package/dist/{claude-adapter-jb6e1e54.js → claude-adapter-r5g0tzge.js} +23 -20
  14. package/dist/{claude-managed-setup-d1q9hv2b.js → claude-managed-setup-pkyrgshb.js} +3 -2
  15. package/dist/{claude-sdk-session-zga700s2.js → claude-sdk-session-jxyxnrwd.js} +5565 -5512
  16. package/dist/{cli-we0q7t0e.js → cli-2zy95vhm.js} +137 -64
  17. package/dist/{cli-35pj2yva.js → cli-4cwxn7gp.js} +38 -11
  18. package/dist/{cli-ad4qxm6j.js → cli-4dcpaefp.js} +2 -2
  19. package/dist/{cli-82c1pacn.js → cli-4x0csdjq.js} +71 -37
  20. package/dist/{cli-sqm3r5ps.js → cli-5bcd7sfy.js} +14 -18
  21. package/dist/{cli-d56tgd45.js → cli-5k6k8ta3.js} +2 -2
  22. package/dist/{cli-1er0rhz8.js → cli-5xhpb3kv.js} +15 -15
  23. package/dist/{cli-yrg7c73k.js → cli-7af8yhav.js} +10 -183
  24. package/dist/{cli-r6fsxc76.js → cli-7tre70zp.js} +513 -961
  25. package/dist/{cli-bh7jed3k.js → cli-8ev9xqnx.js} +34 -18
  26. package/dist/cli-bsky8g7w.js +449 -0
  27. package/dist/{cli-hn04t9db.js → cli-cebmgwsc.js} +14 -10
  28. package/dist/{cli-cfkrztza.js → cli-cvatsam7.js} +2 -2
  29. package/dist/{cli-2658f6at.js → cli-cvk6yzw5.js} +6 -8
  30. package/dist/{cli-ptr8h7kp.js → cli-eg0b3p0k.js} +5 -218
  31. package/dist/{cli-zb6xbk61.js → cli-g739zqzt.js} +4 -4
  32. package/dist/{cli-dv6cdjs2.js → cli-gd4favx9.js} +28 -7
  33. package/dist/{cli-5p3x4zna.js → cli-gpqpmns7.js} +2 -2
  34. package/dist/{cli-5nbmpy8w.js → cli-hb5c2x5y.js} +1 -1
  35. package/dist/{cli-jpf7e1zq.js → cli-hmsw1gpy.js} +3 -3
  36. package/dist/{cli-1cz0c18q.js → cli-jf7wmv1r.js} +2521 -733
  37. package/dist/{cli-qwsnmjdd.js → cli-jxs2ygaw.js} +168 -61
  38. package/dist/cli-kdkwd3yr.js +615 -0
  39. package/dist/{cli-hgmnf38m.js → cli-kh04eqwe.js} +1 -1
  40. package/dist/{cli-0383bp7f.js → cli-kp42yek0.js} +425 -90
  41. package/dist/{cli-ybgv4kw2.js → cli-mbssg1xv.js} +9 -2
  42. package/dist/{cli-jsp14b6c.js → cli-mzfth0bp.js} +38 -1
  43. package/dist/{cli-8g6mc14k.js → cli-nq7yqw7b.js} +16 -5
  44. package/dist/{cli-ee8bc46j.js → cli-nt8hecg9.js} +33 -32
  45. package/dist/{cli-9s68w752.js → cli-p0r8sxj5.js} +1 -1
  46. package/dist/{cli-58e8yr0d.js → cli-pkd6s2wy.js} +4 -2
  47. package/dist/{cli-17xpf7cm.js → cli-q24re23n.js} +6 -4
  48. package/dist/cli-qjjvzwzd.js +222 -0
  49. package/dist/cli-qrgt5bqf.js +189 -0
  50. package/dist/{cli-et8m9xsv.js → cli-rfjw9jw2.js} +22 -10
  51. package/dist/{cli-798vkbks.js → cli-rj0gqwwp.js} +2 -2
  52. package/dist/{cli-121ph74b.js → cli-rnyzn44p.js} +1 -1
  53. package/dist/{cli-vnnz5ncg.js → cli-s3hwpt9v.js} +95 -16
  54. package/dist/{cli-7119ja3w.js → cli-sptrj5f5.js} +2 -2
  55. package/dist/{cli-a8c82p2t.js → cli-sqvfa090.js} +13 -6
  56. package/dist/{cli-phfg8vy8.js → cli-swfmp1fx.js} +26 -26
  57. package/dist/{cli-nsdxtcbg.js → cli-tcen9p5w.js} +8 -5
  58. package/dist/{cli-9m03pzga.js → cli-vc9bp061.js} +5 -5
  59. package/dist/{cli-rtx9dygp.js → cli-vxe6qa4h.js} +1 -1
  60. package/dist/{cli-ecfxwnyb.js → cli-vy3ed88x.js} +1 -1
  61. package/dist/{cli-0c7ata9h.js → cli-vyqs9ya8.js} +6 -6
  62. package/dist/cli-wbvnn6tk.js +861 -0
  63. package/dist/{cli-kgd3p0bm.js → cli-wjgs5wxe.js} +6 -6
  64. package/dist/cli-wxkkd0e0.js +33 -0
  65. package/dist/{cli-akfj32vj.js → cli-xqpk3rp7.js} +5 -4
  66. package/dist/cli-zp38xvtm.js +9487 -0
  67. package/dist/{cli-3zc55ctx.js → cli-zvhd3f64.js} +2 -2
  68. package/dist/{cli-ze1d3wzv.js → cli-zxqx25nz.js} +5 -5
  69. package/dist/cli.js +32 -25
  70. package/dist/{cloudflare-workers-ai-system-one-k6fbxw9d.js → cloudflare-workers-ai-system-one-k8ddqjkq.js} +8 -6
  71. package/dist/{codex-adapter-04v97vep.js → codex-adapter-esvmnhn7.js} +13 -13
  72. package/dist/{codex-hook-20me6byw.js → codex-hook-m73jmqgx.js} +19 -3
  73. package/dist/{codex-session-runner-ax69mqq3.js → codex-session-runner-ban9excr.js} +13 -13
  74. package/dist/{commands-18gy08n1.js → commands-75413p2n.js} +9 -7
  75. package/dist/{db-d2pvjpyt.js → db-7f5pecwg.js} +11 -7
  76. package/dist/{dispatcher-8wbwyzjg.js → dispatcher-fh9at8nz.js} +33 -30
  77. package/dist/{dsh-adapter-ysqk9snv.js → dsh-adapter-wpze65d4.js} +3 -3
  78. package/dist/{e2b-esmt1r16.js → e2b-gjgdjp91.js} +10 -9
  79. package/dist/{pi-logo-animation-e9a0t68z.js → easter-egg-3d-3w5c2n4c.js} +122 -68
  80. package/dist/{execute-cmagrbrz.js → execute-f50wg9nh.js} +29 -6
  81. package/dist/{google-generative-ai-k6n5nbpp.js → google-generative-ai-jxxpnegy.js} +2 -2
  82. package/dist/{google-vertex-44xxtcvp.js → google-vertex-x7q1angm.js} +5 -5
  83. package/dist/{handlers-6b69m5kp.js → handlers-w13787bb.js} +36 -33
  84. package/dist/{hook-srnkt0hb.js → hook-46g1jrvx.js} +28 -15
  85. package/dist/{hook-k3mydf2n.js → hook-4tpts2ry.js} +20 -17
  86. package/dist/{http-hrf80ca1.js → http-19pzbfrt.js} +964 -176
  87. package/dist/{index-9rxdvj6w.js → index-8fd4dm4h.js} +34 -31
  88. package/dist/{index-1asbaj62.js → index-dqmp15bq.js} +35 -32
  89. package/dist/{index-45evq4ee.js → index-qb4q1y3e.js} +33 -30
  90. package/dist/{index-k4nj18qs.js → index-s75wc4wd.js} +12 -10
  91. package/dist/{index-xmevk2b9.js → index-scptvdxg.js} +27 -25
  92. package/dist/{keepalive-sfdz6ksp.js → keepalive-xa5ts9cd.js} +11 -9
  93. package/dist/{lead-ej91e9hw.js → lead-qp4xkvjq.js} +45 -41
  94. package/dist/{maintenance-80dnd7ke.js → maintenance-rm5885hm.js} +13 -11
  95. package/dist/{mistral-conversations-pc3ntnxt.js → mistral-conversations-rw7fbt22.js} +4 -4
  96. package/dist/{node-a5e00qhp.js → node-8zkdq42h.js} +834 -833
  97. package/dist/{oauth-refresh-sweep-m1etk2mx.js → oauth-refresh-sweep-1csdfebf.js} +10 -8
  98. package/dist/{onboard-0q8sdfqc.js → onboard-r6b78cs4.js} +10 -10
  99. package/dist/{openai-codex-responses-n7n683p2.js → openai-codex-responses-efvrgrq3.js} +4 -4
  100. package/dist/{openai-completions-jpaj5g2b.js → openai-completions-bbbrrz4z.js} +12 -8
  101. package/dist/{openai-responses-9a3nme9j.js → openai-responses-9jjyrcm1.js} +15 -10
  102. package/dist/{opencode-adapter-4wcgmvgf.js → opencode-adapter-kb3g6pkf.js} +2 -2
  103. package/dist/{otel-impl-hnqm9mxq.js → otel-impl-0y9knpky.js} +5 -5
  104. package/dist/{pi-mono-adapter-d6sqm9wr.js → pi-mono-adapter-z6s1bme2.js} +100 -19
  105. package/dist/{pricing-refresh-y60z64pm.js → pricing-refresh-mth26tgp.js} +11 -9
  106. package/dist/{rbac-roles-8pa0754b.js → rbac-roles-kwntb23q.js} +13 -9
  107. package/dist/rbac-roles-vpk4ebm8.js +45 -0
  108. package/dist/{registry-v5wytg0s.js → registry-km6t1jd2.js} +1 -1
  109. package/dist/{render-v2-418s1vj7.js → render-v2-hcm7h00y.js} +13 -11
  110. package/dist/{runtime-3pknc168.js → runtime-vfjsfsc5.js} +4 -4
  111. package/dist/{setup-yghdkj4x.js → setup-hbyzd65h.js} +2 -2
  112. package/dist/{virtual-modules-jcceevt5.js → virtual-modules-9bv7ry91.js} +9 -8
  113. package/dist/{work-objects-j1sz20v9.js → work-objects-m09sxnhe.js} +36 -33
  114. package/dist/{worker-d4gcvkjt.js → worker-0h35rvk4.js} +45 -41
  115. package/openapi.json +491 -12
  116. package/package.json +13 -6
  117. package/src/be/api-drain.ts +184 -0
  118. package/src/be/db/tasks/read.ts +31 -6
  119. package/src/be/db/tasks/write.ts +5 -4
  120. package/src/be/db.ts +42 -18
  121. package/src/be/memory/link-resolver.ts +29 -3
  122. package/src/be/migrations/192_favorites_agent_fs_path.sql +36 -0
  123. package/src/be/onboarding.ts +7 -1
  124. package/src/be/seed-prompt-templates.ts +1 -0
  125. package/src/be/swarm-config-guard.ts +35 -16
  126. package/src/be/task-citations.ts +11 -5
  127. package/src/be/users.ts +3 -0
  128. package/src/cli.tsx +3 -2
  129. package/src/comb/agent-fs.ts +39 -0
  130. package/src/comb/config.ts +37 -0
  131. package/src/comb/markers.ts +37 -0
  132. package/src/comb/review-batch.ts +486 -0
  133. package/src/comb/templates.ts +88 -0
  134. package/src/commands/context-preamble.ts +4 -1
  135. package/src/commands/hook.ts +2 -1
  136. package/src/commands/runner.ts +262 -68
  137. package/src/commands/templates.ts +10 -0
  138. package/src/extensions/contract-types.generated.ts +1 -1
  139. package/src/fs/agent-fs-provider.ts +106 -2
  140. package/src/heartbeat/heartbeat.ts +4 -0
  141. package/src/hooks/codex-hook.ts +25 -1
  142. package/src/hooks/hook.ts +13 -0
  143. package/src/hooks/pr-body-guard.ts +983 -0
  144. package/src/http/all-routes.ts +1 -0
  145. package/src/http/assets.ts +5 -17
  146. package/src/http/comb.ts +131 -0
  147. package/src/http/core.ts +2 -1
  148. package/src/http/fs.ts +9 -17
  149. package/src/http/index.ts +23 -9
  150. package/src/http/onboarding.ts +21 -2
  151. package/src/http/poll.ts +30 -3
  152. package/src/http/realtime.ts +62 -0
  153. package/src/http/request-principal.ts +22 -0
  154. package/src/http/status.ts +34 -2
  155. package/src/kv-reserved-namespaces.ts +10 -5
  156. package/src/providers/dsh-adapter.ts +1 -1
  157. package/src/providers/pi-mono-adapter.ts +123 -0
  158. package/src/rbac/legacy-policy.ts +1 -0
  159. package/src/rbac/permissions.ts +4 -0
  160. package/src/realtime/auth.ts +63 -1
  161. package/src/realtime/tickets.ts +52 -0
  162. package/src/realtime/transport.ts +51 -22
  163. package/src/scripts-runtime/types/swarm-extension.d.ts +3 -1
  164. package/src/telemetry-context.ts +175 -0
  165. package/src/telemetry-contract/EVENTS.md +81 -0
  166. package/src/telemetry-contract/SOURCE.json +9 -0
  167. package/src/telemetry-contract/catalog.json +1335 -0
  168. package/src/telemetry-contract/index.ts +60 -0
  169. package/src/telemetry-contract/types.gen.ts +1971 -0
  170. package/src/telemetry-identity.ts +129 -0
  171. package/src/telemetry-snapshot.ts +211 -0
  172. package/src/telemetry-trigger.ts +125 -0
  173. package/src/telemetry-types.typetest.ts +40 -0
  174. package/src/telemetry.ts +271 -67
  175. package/src/tests/api-drain-e2e.test.ts +249 -0
  176. package/src/tests/api-drain-worker-e2e.test.ts +216 -0
  177. package/src/tests/api-drain.test.ts +351 -0
  178. package/src/tests/comb-config-guard.test.ts +38 -0
  179. package/src/tests/comb-links.test.ts +162 -0
  180. package/src/tests/comb-markers.test.ts +68 -0
  181. package/src/tests/comb-review-batch.test.ts +770 -0
  182. package/src/tests/comb-status.test.ts +152 -0
  183. package/src/tests/db-task-read-contract.test.ts +2 -0
  184. package/src/tests/db-task-write-contract.test.ts +1 -0
  185. package/src/tests/docs-index-footprint.test.js +3 -3
  186. package/src/tests/dsh-adapter.test.ts +1 -1
  187. package/src/tests/favorites-agent-fs-path.test.ts +226 -0
  188. package/src/tests/memory-link-resolver.test.ts +34 -0
  189. package/src/tests/onboarding.test.ts +108 -0
  190. package/src/tests/pi-mono-adapter.test.ts +265 -2
  191. package/src/tests/pr-body-leaks.test.ts +789 -0
  192. package/src/tests/preload.ts +8 -0
  193. package/src/tests/rbac-engine.test.ts +19 -0
  194. package/src/tests/realtime-room-auth.test.ts +104 -1
  195. package/src/tests/realtime-tickets.test.ts +74 -0
  196. package/src/tests/realtime-transport.test.ts +131 -4
  197. package/src/tests/runner-api-drain.test.ts +301 -0
  198. package/src/tests/runner-fallback-output.test.ts +61 -0
  199. package/src/tests/runner-fenced-json-output.test.ts +178 -0
  200. package/src/tests/script-connections.test.ts +2 -0
  201. package/src/tests/send-task-requested-by.test.ts +133 -15
  202. package/src/tests/task-lifecycle-telemetry.test.ts +8 -3
  203. package/src/tests/telemetry-context.test.ts +314 -0
  204. package/src/tests/telemetry-init.test.ts +51 -19
  205. package/src/tests/telemetry-snapshot.test.ts +229 -0
  206. package/src/tests/telemetry-trigger.test.ts +200 -0
  207. package/src/tests/template-registry-helpers.ts +1 -0
  208. package/src/tests/workflow-agent-task-retry.test.ts +363 -0
  209. package/src/tests/workflow-definition-telemetry.test.ts +4 -4
  210. package/src/tools/poll-task.ts +20 -1
  211. package/src/tools/send-task.ts +9 -1
  212. package/src/tools/task-action.ts +11 -0
  213. package/src/types.ts +2 -1
  214. package/src/utils/api-drain.ts +24 -0
  215. package/src/utils/constants.ts +57 -16
  216. package/src/utils/pr-body-leaks.ts +172 -0
  217. package/src/utils/task-attachment-links.ts +14 -8
  218. package/src/workflows/recovery.ts +26 -1
  219. package/src/workflows/resume.ts +31 -4
  220. package/src/workflows/task-step-routing.ts +75 -2
  221. package/tsconfig.json +3 -0
  222. package/dist/cli-tjf4cn8z.js +0 -9119
  223. package/dist/cli-tsk3nz8a.js +0 -582
  224. package/dist/{cli-t6v2ah3r.js → cli-twrh04ap.js} +3 -3
@@ -11,20 +11,20 @@ import {
11
11
  builtinModels,
12
12
  normalizeRadiusGatewayUrl,
13
13
  registerBundledOAuthFlowLoaders
14
- } from "./cli-ee8bc46j.js";
14
+ } from "./cli-nt8hecg9.js";
15
15
  import {
16
16
  getEnvApiKey
17
17
  } from "./cli-trc24wk2.js";
18
18
  import {
19
- init_src,
20
- isFirstPartyAnthropicUrl
21
- } from "./cli-f9w1semm.js";
19
+ InMemoryCredentialStore
20
+ } from "./cli-ykk5jaax.js";
22
21
  import {
23
22
  getProviderEnvValue
24
23
  } from "./cli-btbzvq95.js";
25
24
  import {
26
- InMemoryCredentialStore
27
- } from "./cli-ykk5jaax.js";
25
+ init_src,
26
+ isFirstPartyAnthropicUrl
27
+ } from "./cli-f9w1semm.js";
28
28
  import {
29
29
  __require
30
30
  } from "./cli-bc05qbss.js";
@@ -1423,15 +1423,11 @@ async function loginOpenAIChatGPT(interaction, options) {
1423
1423
  const { verifier, challenge } = await generatePKCE();
1424
1424
  const state = randomValue();
1425
1425
  const nonce = randomValue();
1426
- let callback;
1427
- try {
1428
- callback = await startCallbackServer(state);
1429
- } catch (error) {
1430
- interaction.notify({
1431
- type: "info",
1432
- message: `Could not listen on ${REDIRECT_URI2}; paste the final redirect URL to continue. ${error instanceof Error ? error.message : String(error)}`
1433
- });
1434
- }
1426
+ const callback = await startCallbackServer(state).catch((error) => {
1427
+ if (!(error instanceof Error && ("code" in error) && error.code === "EADDRINUSE"))
1428
+ throw error;
1429
+ throw new Error(`Port ${CALLBACK_PORT2} is in use, probably by an unfinished login in another pi session or by the Codex CLI. Cancel that login and try again.`);
1430
+ });
1435
1431
  const authorizationUrl = new URL(AUTHORIZE_URL2);
1436
1432
  authorizationUrl.search = new URLSearchParams({
1437
1433
  client_id: DYNAMIC_CLIENT_ID,
@@ -1459,7 +1455,7 @@ async function loginOpenAIChatGPT(interaction, options) {
1459
1455
  signal: AbortSignal.any([manualAbort.signal, interaction.signal])
1460
1456
  }).then((input) => authorizationResultFromManualInput(input, state));
1461
1457
  try {
1462
- const result = await (callback ? Promise.race([callback.result, manualCode]) : manualCode);
1458
+ const result = await Promise.race([callback.result, manualCode]);
1463
1459
  interaction.notify({ type: "progress", message: "Exchanging authorization code for tokens..." });
1464
1460
  return await exchangeAuthorizationCode2(result.code, verifier, result.clientId, interaction.signal);
1465
1461
  } catch (error) {
@@ -1468,8 +1464,8 @@ async function loginOpenAIChatGPT(interaction, options) {
1468
1464
  throw error;
1469
1465
  } finally {
1470
1466
  manualAbort.abort();
1471
- callback?.server.close();
1472
- callback?.server.closeAllConnections();
1467
+ callback.server.close();
1468
+ callback.server.closeAllConnections();
1473
1469
  }
1474
1470
  }
1475
1471
  var openaiChatGPTOAuth = {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  contentSha256,
3
3
  init_profile_sync
4
- } from "./cli-hn04t9db.js";
4
+ } from "./cli-cebmgwsc.js";
5
5
  import {
6
6
  getDb,
7
7
  getDbClient,
8
8
  init_db,
9
9
  isSqliteVecAvailable
10
- } from "./cli-1cz0c18q.js";
10
+ } from "./cli-jf7wmv1r.js";
11
11
  import {
12
12
  __esm,
13
13
  __export,
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  McpHttpClient
3
3
  } from "./cli-epan13p1.js";
4
+ import {
5
+ getApiKey
6
+ } from "./cli-f14fvzag.js";
4
7
  import {
5
8
  detachedProcessGroup,
6
9
  registerProcessGroup,
7
10
  terminateProcessGroup
8
11
  } from "./cli-y89t4nca.js";
9
- import {
10
- getApiKey
11
- } from "./cli-f14fvzag.js";
12
12
  import {
13
13
  DEFAULT_MODEL,
14
14
  resolveCredential
15
- } from "./cli-sqm3r5ps.js";
15
+ } from "./cli-5bcd7sfy.js";
16
16
  import {
17
17
  DEFAULT_OPENROUTER_BASE_URL,
18
18
  getOpenRouterBaseUrl
19
19
  } from "./cli-3dpj7atn.js";
20
20
  import {
21
21
  embedScript
22
- } from "./cli-7119ja3w.js";
22
+ } from "./cli-sptrj5f5.js";
23
23
  import {
24
24
  calculatePKCECodeChallenge,
25
25
  ensureAuthorizationTokenOrThrow,
@@ -31,10 +31,10 @@ import {
31
31
  oauthAppRowToProviderConfig,
32
32
  updateAuthorizationTokens,
33
33
  upsertAuthorization
34
- } from "./cli-hgmnf38m.js";
34
+ } from "./cli-kh04eqwe.js";
35
35
  import {
36
36
  getSlackApp
37
- } from "./cli-phfg8vy8.js";
37
+ } from "./cli-swfmp1fx.js";
38
38
  import {
39
39
  CredentialBroker,
40
40
  DEFAULT_CREDENTIAL_BINDINGS,
@@ -59,21 +59,21 @@ import {
59
59
  placeholderForConfigKey,
60
60
  releaseApprovalCancellationNotificationClaim,
61
61
  upsertSwarmConfig
62
- } from "./cli-1cz0c18q.js";
62
+ } from "./cli-jf7wmv1r.js";
63
63
  import {
64
64
  TERMINAL_TASK_STATUSES,
65
65
  defaultAssetKey,
66
66
  init_key,
67
67
  init_types
68
- } from "./cli-akfj32vj.js";
69
- import {
70
- init_resolver,
71
- resolveTemplate
72
- } from "./cli-ptr8h7kp.js";
68
+ } from "./cli-xqpk3rp7.js";
73
69
  import {
74
70
  getAppUrl,
75
71
  init_constants
76
- } from "./cli-dv6cdjs2.js";
72
+ } from "./cli-gd4favx9.js";
73
+ import {
74
+ init_resolver,
75
+ resolveTemplate
76
+ } from "./cli-qjjvzwzd.js";
77
77
  import {
78
78
  init_env_flag,
79
79
  isEnvFlagEnabled
@@ -175590,7 +175590,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
175590
175590
  }
175591
175591
  if (notification.channel === "slack") {
175592
175592
  try {
175593
- const { getSlackApp: getSlackApp2 } = await import("./app-0hdqa4k1.js");
175593
+ const { getSlackApp: getSlackApp2 } = await import("./app-pt68fbwp.js");
175594
175594
  const slackApp = getSlackApp2();
175595
175595
  if (!slackApp) {
175596
175596
  console.warn("[HITL] Slack not initialized — cannot send notification");
@@ -1,16 +1,16 @@
1
- import {
2
- init_registry,
3
- init_resolver,
4
- init_session_templates,
5
- init_steering_enabled,
6
- isSteeringEnabled,
7
- registerTemplate,
8
- resolveTemplateAsync
9
- } from "./cli-ptr8h7kp.js";
10
1
  import {
11
2
  getSlackConfiguration,
12
3
  init_config
13
4
  } from "./cli-n7h1kqpf.js";
5
+ import {
6
+ init_session_templates,
7
+ init_steering_enabled,
8
+ isSteeringEnabled
9
+ } from "./cli-eg0b3p0k.js";
10
+ import {
11
+ init_resolver,
12
+ resolveTemplateAsync
13
+ } from "./cli-qjjvzwzd.js";
14
14
  import {
15
15
  __esm
16
16
  } from "./cli-bc05qbss.js";
@@ -566,177 +566,4 @@ var init_identity_field_budget = __esm(() => {
566
566
  };
567
567
  });
568
568
 
569
- // src/commands/templates.ts
570
- var init_templates = __esm(() => {
571
- init_registry();
572
- registerTemplate({
573
- eventType: "task.trigger.assigned",
574
- header: "",
575
- defaultBody: `{{work_on_task_cmd}} {{task_id}}{{task_desc_section}}{{attachments_section}}{{output_instructions}}`,
576
- variables: [
577
- { name: "work_on_task_cmd", description: "Formatted /work-on-task command" },
578
- { name: "task_id", description: "Task ID" },
579
- { name: "task_desc_section", description: "Task description section or empty string" },
580
- {
581
- name: "attachments_section",
582
- 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"
583
- },
584
- {
585
- name: "output_instructions",
586
- description: "Output format instructions (with outputSchema if present, or generic store-progress)"
587
- }
588
- ],
589
- category: "task_lifecycle"
590
- });
591
- registerTemplate({
592
- eventType: "task.trigger.offered",
593
- header: "",
594
- defaultBody: `{{review_offered_task_cmd}} {{task_id}}{{task_desc_section}}
595
-
596
- Accept if you have capacity and skills. Reject with a reason if you cannot handle it.`,
597
- variables: [
598
- { name: "review_offered_task_cmd", description: "Formatted /review-offered-task command" },
599
- { name: "task_id", description: "Task ID" },
600
- { name: "task_desc_section", description: "Task description section or empty string" }
601
- ],
602
- category: "task_lifecycle"
603
- });
604
- registerTemplate({
605
- eventType: "task.profile_sync_rejection",
606
- header: "",
607
- defaultBody: `=== PERSISTED PROFILE SYNC REJECTION ===
608
- A {{timestamp}} sync of {{field_label}} did not reach the database. Disk size: {{disk_size}}; DB size: {{db_size}}; budget: {{budget}}; delta: {{delta}}.
609
- Audit event: {{event_id}}. {{recovery_guidance}}
610
- === END PROFILE SYNC REJECTION ===
611
-
612
- `,
613
- variables: [
614
- { name: "timestamp", description: "UTC timestamp of the rejected sync" },
615
- { name: "field_label", description: "Profile field and its harness-specific file path" },
616
- { name: "disk_size", description: "Rejected local file size" },
617
- { name: "db_size", description: "Stored database field size" },
618
- { name: "budget", description: "Configured field budget" },
619
- { name: "delta", description: "Signed size delta" },
620
- { name: "event_id", description: "Persisted audit event ID" },
621
- { name: "recovery_guidance", description: "Accurate field-specific recovery instructions" }
622
- ],
623
- category: "task_lifecycle"
624
- });
625
- registerTemplate({
626
- eventType: "task.trigger.unread_mentions",
627
- header: "",
628
- defaultBody: `You have {{mention_count}} mention(s) in chat channels.
629
-
630
- 1. Use \`read-messages\` with unreadOnly: true to see them
631
- 2. Respond to questions or requests directed at you
632
- 3. If a message requires work, create a task using \`send-task\``,
633
- variables: [{ name: "mention_count", description: "Number of unread mentions or 'unread'" }],
634
- category: "task_lifecycle"
635
- });
636
- registerTemplate({
637
- eventType: "task.trigger.pool_available",
638
- header: "",
639
- defaultBody: `{{task_count}} task(s) available in the pool.
640
-
641
- 1. Run \`get-tasks\` with unassigned: true to browse
642
- 2. Pick one matching your skills
643
- 3. Run \`task-action\` with action: "claim" and taskId: "<id>"
644
-
645
- Note: Claims are first-come-first-serve. If claim fails, pick another.`,
646
- variables: [{ name: "task_count", description: "Number of available pool tasks" }],
647
- category: "task_lifecycle"
648
- });
649
- registerTemplate({
650
- eventType: "task.trigger.channel_activity",
651
- header: "",
652
- defaultBody: `## Slack Channel Activity
653
-
654
- {{message_count}} new message(s) in monitored Slack channels:
655
-
656
- {{messages_detail}}
657
- ## Your Task
658
-
659
- Review these messages and decide if any require action:
660
- 1. If a message is a question or request, respond using \`slack-reply\` or create a task with \`send-task\`
661
- 2. If a message is informational, no action needed
662
- 3. Use \`slack-read\` with the channelId to get more context if needed`,
663
- variables: [
664
- { name: "message_count", description: "Number of new messages" },
665
- {
666
- name: "messages_detail",
667
- description: "Formatted list of messages with channel and user info"
668
- }
669
- ],
670
- category: "task_lifecycle"
671
- });
672
- registerTemplate({
673
- eventType: "task.resumption.with_progress",
674
- header: "",
675
- defaultBody: `{{work_on_task_cmd}} {{task_id}}
676
-
677
- **RESUMED TASK** - This task was interrupted during a deployment and is being resumed.
678
-
679
- Task: "{{task_description}}"{{attachments_section}}
680
-
681
- Previous Progress:
682
- {{progress}}
683
-
684
- Continue from where you left off. Review the progress above and complete the remaining work.{{completion_instructions}}`,
685
- variables: [
686
- { name: "work_on_task_cmd", description: "Formatted /work-on-task command" },
687
- { name: "task_id", description: "Task ID" },
688
- { name: "task_description", description: "Original task description" },
689
- { name: "attachments_section", description: "Task attachment fetch recipes" },
690
- { name: "progress", description: "Previous progress text" },
691
- {
692
- name: "completion_instructions",
693
- description: "Completion instructions (empty for providers without MCP)"
694
- }
695
- ],
696
- category: "task_lifecycle"
697
- });
698
- registerTemplate({
699
- eventType: "task.resumption.no_progress",
700
- header: "",
701
- defaultBody: `{{work_on_task_cmd}} {{task_id}}
702
-
703
- **RESUMED TASK** - This task was interrupted during a deployment and is being resumed.
704
-
705
- Task: "{{task_description}}"{{attachments_section}}
706
-
707
- No progress was saved before the interruption. Start the task fresh but be aware files may have been partially modified.{{completion_instructions}}`,
708
- variables: [
709
- { name: "work_on_task_cmd", description: "Formatted /work-on-task command" },
710
- { name: "task_id", description: "Task ID" },
711
- { name: "task_description", description: "Original task description" },
712
- { name: "attachments_section", description: "Task attachment fetch recipes" },
713
- {
714
- name: "completion_instructions",
715
- description: "Completion instructions (empty for providers without MCP)"
716
- }
717
- ],
718
- category: "task_lifecycle"
719
- });
720
- registerTemplate({
721
- eventType: "task.output.schema",
722
- header: "",
723
- defaultBody: `
724
-
725
- **Required Output Format**: When completing this task, you MUST call store-progress with output that is valid JSON conforming to this schema:
726
- \`\`\`json
727
- {{schema}}
728
- \`\`\`
729
- Call store-progress with status "completed" and your JSON output. If your output doesn't match the schema, the tool call will fail and you should fix and retry.`,
730
- variables: [{ name: "schema", description: "Required output JSON schema" }],
731
- category: "task_lifecycle"
732
- });
733
- registerTemplate({
734
- eventType: "task.output.generic",
735
- header: "",
736
- defaultBody: '\n\nWhen done, use `store-progress` with status: "completed" and include your output.',
737
- variables: [],
738
- category: "task_lifecycle"
739
- });
740
- });
741
-
742
- export { generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, matchesDefaultIdentityMd, matchesDefaultClaudeMd, init_defaults, getBasePrompt, init_base_prompt, IDENTITY_FIELD_BUDGETS, checkIdentityFieldBudget, IdentityFieldBudgetError, init_identity_field_budget, init_templates };
569
+ export { generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, matchesDefaultIdentityMd, matchesDefaultClaudeMd, init_defaults, getBasePrompt, init_base_prompt, IDENTITY_FIELD_BUDGETS, checkIdentityFieldBudget, IdentityFieldBudgetError, init_identity_field_budget };