@desplega.ai/agent-swarm 2.0.0 → 2.1.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 (238) hide show
  1. package/dist/{acp-adapter-sj2g0m84.js → acp-adapter-kr4abrsk.js} +10 -10
  2. package/dist/{actions-fegk44gr.js → actions-eh4g6w2r.js} +27 -27
  3. package/dist/{amp-adapter-ad8ft89x.js → amp-adapter-7h7wdt8q.js} +5 -5
  4. package/dist/{app-kfvgbvzy.js → app-7k8s9w5p.js} +9 -9
  5. package/dist/{assistant-z7zdy9ja.js → assistant-wswt2y7p.js} +28 -28
  6. package/dist/{boot-reembed-j8xa181e.js → boot-reembed-9apm9qw6.js} +7 -7
  7. package/dist/{boot-reembed-5c2z0mbe.js → boot-reembed-whzbdthj.js} +7 -7
  8. package/dist/{boot-scrub-sweep-hnkn3rgt.js → boot-scrub-sweep-ndzmvmgt.js} +8 -8
  9. package/dist/{boot-seeds-kwjq4d2z.js → boot-seeds-e9sta0yt.js} +13 -11
  10. package/dist/{claude-adapter-9vmvpvgd.js → claude-adapter-4mqd3r6r.js} +11 -11
  11. package/dist/{claude-managed-adapter-k9qae05j.js → claude-managed-adapter-9wswb52m.js} +3 -3
  12. package/dist/{claude-managed-setup-q54zx5q2.js → claude-managed-setup-tpe1effx.js} +4 -4
  13. package/dist/{claude-sdk-session-9jye6cxr.js → claude-sdk-session-q49ghmh9.js} +10340 -10197
  14. package/dist/{cli-ke896fcf.js → cli-01xvj1rq.js} +10 -10
  15. package/dist/{cli-tr4sxp68.js → cli-035vekcw.js} +2 -2
  16. package/dist/{cli-z5jjpaxw.js → cli-0pd8hzhc.js} +3 -3
  17. package/dist/{cli-n5vwg842.js → cli-0veb92a3.js} +6 -1
  18. package/dist/{cli-wayw93nt.js → cli-10jesr25.js} +3 -3
  19. package/dist/{cli-se8w6wny.js → cli-1y7yywmj.js} +1 -1
  20. package/dist/{cli-v1yb0rqb.js → cli-20krdhz5.js} +47 -19
  21. package/dist/{cli-d5f9ed5c.js → cli-29rja109.js} +39 -20
  22. package/dist/{cli-apx87jne.js → cli-2pwa0q4d.js} +15 -4
  23. package/dist/{cli-ee9gtz70.js → cli-4mengw46.js} +348 -25
  24. package/dist/{cli-03gedhng.js → cli-5twdke5x.js} +6 -6
  25. package/dist/{cli-6razj6t4.js → cli-711vwbxn.js} +2 -2
  26. package/dist/{cli-s2sp957d.js → cli-78vv7446.js} +1 -1
  27. package/dist/{cli-3fbmmawm.js → cli-7n6s5man.js} +4 -4
  28. package/dist/{cli-hnhtk6cj.js → cli-8wwxw8a3.js} +1 -1
  29. package/dist/{cli-hnmhtzvh.js → cli-9jzdj90z.js} +2 -0
  30. package/dist/{cli-skxvvpap.js → cli-cvv9k0hh.js} +28 -25
  31. package/dist/{cli-74ahz61x.js → cli-d9286m9h.js} +2 -2
  32. package/dist/{cli-4jxm2qtz.js → cli-gxzkg1de.js} +28 -16
  33. package/dist/{cli-zkpks3r3.js → cli-h1arqn31.js} +1 -1
  34. package/dist/{cli-r62a35ea.js → cli-hqr88ew6.js} +1 -1
  35. package/dist/{cli-ra0xzggj.js → cli-j67mh2vg.js} +2 -2
  36. package/dist/{cli-29jc5q7w.js → cli-ksphgh48.js} +2 -2
  37. package/dist/{cli-eejsgvm4.js → cli-mgz4nbgg.js} +4 -4
  38. package/dist/{cli-vatyhshy.js → cli-mz5as5ha.js} +4 -4
  39. package/dist/{cli-f7kr7svz.js → cli-n8ndw8j7.js} +2 -2
  40. package/dist/{cli-1e4b6bzh.js → cli-naqzr17j.js} +7 -7
  41. package/dist/{cli-q0ke1yww.js → cli-nm1p8jfr.js} +6 -6
  42. package/dist/{cli-m50t4309.js → cli-p3zbc1rw.js} +5 -5
  43. package/dist/{cli-cgtksawx.js → cli-pe05f8yk.js} +23 -3
  44. package/dist/{cli-vdach5a9.js → cli-qmzsbkvy.js} +4 -4
  45. package/dist/{cli-n3hzg89b.js → cli-qnm4e9e4.js} +57 -579
  46. package/dist/{cli-s4setq91.js → cli-qqy4q48b.js} +3 -3
  47. package/dist/{cli-k382tshb.js → cli-r35rw5de.js} +8 -7
  48. package/dist/{cli-k3dp5tpf.js → cli-r610p9bs.js} +2 -2
  49. package/dist/{cli-e6mpjhed.js → cli-rc6pf5kv.js} +1 -1
  50. package/dist/{cli-3dj8k4vy.js → cli-rdxm77k3.js} +1 -1
  51. package/dist/{cli-tqaazemc.js → cli-s69nfyeh.js} +1 -1
  52. package/dist/{cli-6jyj59nb.js → cli-sawv63e8.js} +2 -2
  53. package/dist/{cli-q50942rs.js → cli-sg19gbf0.js} +1 -1
  54. package/dist/{cli-p1x85d2t.js → cli-shk7r5cs.js} +12 -9
  55. package/dist/{cli-przpmdgr.js → cli-sksetb2q.js} +11 -1
  56. package/dist/{cli-d2qr7aj4.js → cli-t02z59f2.js} +1 -1
  57. package/dist/{cli-j0pfptdp.js → cli-v7g551te.js} +39 -43
  58. package/dist/{cli-bzszjf2p.js → cli-vgqzp4em.js} +519 -126
  59. package/dist/cli-wfnemr1t.js +86 -0
  60. package/dist/{cli-ne236afy.js → cli-wms6x9db.js} +8 -8
  61. package/dist/{cli-5hkm7whv.js → cli-x1r545x8.js} +1 -1
  62. package/dist/{cli-kt6zqg0e.js → cli-xczsgshn.js} +2 -2
  63. package/dist/{cli-ef1hg1wv.js → cli-y3167wt1.js} +430 -238
  64. package/dist/{cli-tsde1hdr.js → cli-yjmqpxt3.js} +12 -11
  65. package/dist/{cli-9nfx44eh.js → cli-z780ec7c.js} +1 -1
  66. package/dist/{cli-r2pnvj8g.js → cli-zm9t2vde.js} +2 -2
  67. package/dist/cli.js +24 -23
  68. package/dist/{codex-adapter-y81sssk0.js → codex-adapter-4z16v9n0.js} +8 -8
  69. package/dist/{codex-login-f2rcfpp9.js → codex-login-pkepy2j1.js} +2 -2
  70. package/dist/{codex-session-runner-8vx4j6a9.js → codex-session-runner-rvms9y2x.js} +8 -8
  71. package/dist/{commands-kcpvpcrr.js → commands-2a9rtyat.js} +8 -8
  72. package/dist/{controller-ywrmt6yd.js → controller-3k3madbn.js} +4 -4
  73. package/dist/{controllers-connect-kwpvj3rf.js → controllers-connect-v9yn8zb9.js} +30 -30
  74. package/dist/{cursor-adapter-cehv1qns.js → cursor-adapter-98gbhyzn.js} +4 -4
  75. package/dist/{db-ww5d7jq3.js → db-eywwsnjw.js} +9 -7
  76. package/dist/{db-k8ankj20.js → db-ncypk9np.js} +9 -9
  77. package/dist/{devin-adapter-x1022qb1.js → devin-adapter-zeq8b9gz.js} +2 -2
  78. package/dist/{dispatcher-e8gq5m68.js → dispatcher-w94kc575.js} +26 -26
  79. package/dist/{docker-ff6y1190.js → docker-b1e4cqab.js} +2 -2
  80. package/dist/{dsh-adapter-3epjm3af.js → dsh-adapter-47ztej36.js} +4 -4
  81. package/dist/{e2b-8ygwhg0f.js → e2b-bbt8ey45.js} +3 -3
  82. package/dist/{e2b-swhnpw3n.js → e2b-dp804sen.js} +3 -3
  83. package/dist/{event-bus-6axnngdj.js → event-bus-j2jdg3qb.js} +2 -2
  84. package/dist/{external-channel-h3359cwn.js → external-channel-zrkg8ar9.js} +8 -8
  85. package/dist/{grok-adapter-0d4x7gkx.js → grok-adapter-s9ncp9vy.js} +11 -11
  86. package/dist/{handlers-an1gzv21.js → handlers-kqftvjgw.js} +29 -29
  87. package/dist/{heartbeat-6dakeb61.js → heartbeat-9q96p8v9.js} +31 -31
  88. package/dist/{hook-6v6cv6d5.js → hook-56qe10dp.js} +7 -7
  89. package/dist/{hook-sa5xye4y.js → hook-yy6rw42k.js} +8 -8
  90. package/dist/{http-r7f3eky0.js → http-r2dnb8f8.js} +963 -75
  91. package/dist/{index-7ep4gzdk.js → index-3gtmkhc6.js} +26 -26
  92. package/dist/{index-v1v6n7hg.js → index-3k5hkz7r.js} +31 -31
  93. package/dist/{index-rmpw9a8q.js → index-5e101240.js} +26 -26
  94. package/dist/{index-s2wxgzr0.js → index-5wyfjc2c.js} +392 -15
  95. package/dist/{index-zk96aq1k.js → index-vxvhxxbn.js} +7 -7
  96. package/dist/{keepalive-be9vwy5h.js → keepalive-psj6j54c.js} +9 -9
  97. package/dist/{lead-0861cwrf.js → lead-hajz4688.js} +43 -43
  98. package/dist/{maintenance-mzzgc8bn.js → maintenance-ps02sb5m.js} +7 -7
  99. package/dist/{node-mn1zs7an.js → node-mwb5r697.js} +1 -1
  100. package/dist/{oauth-refresh-sweep-cpdnfwdj.js → oauth-refresh-sweep-0284h93b.js} +8 -8
  101. package/dist/{onboard-fh8qs4r3.js → onboard-rbf6bg01.js} +2 -2
  102. package/dist/{opencode-adapter-nm42wwj8.js → opencode-adapter-13dcatgq.js} +8 -8
  103. package/dist/{otel-impl-x6c1c9g4.js → otel-impl-zvqcbhp7.js} +2 -2
  104. package/dist/{pi-mono-adapter-9n2ya240.js → pi-mono-adapter-xxy47q4v.js} +7 -7
  105. package/dist/{pricing-refresh-qb0rv0ap.js → pricing-refresh-kefx9v3t.js} +9 -9
  106. package/dist/{rbac-roles-1gzdwbh1.js → rbac-roles-3m36rxm2.js} +8 -8
  107. package/dist/{rbac-roles-3mraey52.js → rbac-roles-z76xv0hq.js} +9 -9
  108. package/dist/{render-v2-agpa45zz.js → render-v2-wz73bs25.js} +9 -9
  109. package/dist/{resume-x0ydy9s9.js → resume-k4wzge8w.js} +14 -14
  110. package/dist/{setup-as9ga0d6.js → setup-2fp2pypp.js} +2 -2
  111. package/dist/{work-objects-y5g1y7ev.js → work-objects-6k0ywz3m.js} +29 -29
  112. package/dist/{worker-860c3e38.js → worker-5v3rxsdh.js} +43 -43
  113. package/dist/{x-m477fr0h.js → x-4mtdeym1.js} +2 -2
  114. package/openapi.json +777 -6
  115. package/package.json +8 -7
  116. package/src/agentmail/handlers.ts +21 -11
  117. package/src/apps/definition.ts +16 -0
  118. package/src/azure-devops/api.ts +52 -2
  119. package/src/azure-devops/boards-sync.ts +50 -20
  120. package/src/azure-devops/index.ts +1 -0
  121. package/src/azure-devops/outbound.ts +95 -0
  122. package/src/be/boot-seeds.ts +11 -0
  123. package/src/be/db/model-profiles.ts +315 -0
  124. package/src/be/db/tasks/read.ts +7 -0
  125. package/src/be/db.ts +53 -47
  126. package/src/be/migrations/219_relabel_pi_context_compactions.sql +22 -0
  127. package/src/be/migrations/220_model_profiles.sql +137 -0
  128. package/src/be/model-tier-resolution.ts +145 -11
  129. package/src/be/model-validation.ts +8 -1
  130. package/src/be/scripts/typecheck.ts +12 -0
  131. package/src/be/secret-registry.ts +6 -2
  132. package/src/be/seed-model-profiles.ts +41 -0
  133. package/src/be/seed-scripts/catalog/heartbeat-jev-gate.ts +368 -0
  134. package/src/be/seed-scripts/index.ts +9 -0
  135. package/src/be/swarm-config-guard.ts +1 -0
  136. package/src/commands/runner.ts +3 -17
  137. package/src/extensions/catalog.generated.json +17 -0
  138. package/src/extensions/contract-types.generated.ts +1 -1
  139. package/src/extensions/loader.ts +10 -5
  140. package/src/heartbeat/heartbeat.ts +2 -1
  141. package/src/http/agents.ts +49 -2
  142. package/src/http/all-routes.ts +1 -0
  143. package/src/http/apps.ts +30 -3
  144. package/src/http/config.ts +26 -2
  145. package/src/http/core.ts +4 -0
  146. package/src/http/index.ts +11 -1
  147. package/src/http/model-profiles.ts +303 -0
  148. package/src/http/pages-public.ts +11 -5
  149. package/src/http/poll.ts +16 -5
  150. package/src/http/script-runs.ts +1 -1
  151. package/src/http/scripts.ts +25 -2
  152. package/src/http/tasks.ts +18 -0
  153. package/src/http/webhooks.ts +1 -2
  154. package/src/pages/feedback-overlay.ts +65 -6
  155. package/src/providers/acp-targets.ts +1 -1
  156. package/src/providers/amp-adapter.ts +1 -1
  157. package/src/providers/dsh-adapter.ts +1 -1
  158. package/src/providers/pi-mono-extension.ts +17 -3
  159. package/src/providers/reasoning-effort.ts +10 -0
  160. package/src/rbac/legacy-policy.ts +8 -0
  161. package/src/rbac/permissions.ts +5 -0
  162. package/src/scheduler/deferred-task-waits.ts +18 -5
  163. package/src/scheduler/scheduler.ts +7 -1
  164. package/src/scripts-runtime/executors/quickjs-prelude.ts +75 -6
  165. package/src/scripts-runtime/executors/quickjs-runner.ts +85 -8
  166. package/src/scripts-runtime/executors/quickjs-web-shims.ts +1041 -0
  167. package/src/scripts-runtime/extract-args-schema.ts +9 -8
  168. package/src/scripts-runtime/quickjs-compat.ts +464 -0
  169. package/src/scripts-runtime/sdk-allowlist.ts +4 -0
  170. package/src/scripts-runtime/types/stdlib.d.ts +12 -0
  171. package/src/scripts-runtime/types/swarm-extension.d.ts +3 -0
  172. package/src/scripts-runtime/types/swarm-sdk.d.ts +12 -0
  173. package/src/server.ts +10 -1
  174. package/src/slack/blocks.ts +4 -2
  175. package/src/slack/reaction-shortcode.ts +14 -0
  176. package/src/slack/render-v2.ts +12 -7
  177. package/src/slack/responses.ts +5 -4
  178. package/src/slack/thread-buffer.ts +41 -22
  179. package/src/tasks/worker-follow-up.ts +11 -2
  180. package/src/tests/agentmail-filters.test.ts +47 -0
  181. package/src/tests/apps-spike2.test.ts +35 -0
  182. package/src/tests/azure-devops-outbound.test.ts +420 -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/deferred-task-wake.test.ts +78 -1
  186. package/src/tests/docs-index-footprint.test.js +2 -2
  187. package/src/tests/dsh-adapter.test.ts +1 -1
  188. package/src/tests/env-flag.test.ts +1 -0
  189. package/src/tests/extensions-catalog.test.ts +1 -0
  190. package/src/tests/extensions-example-comms-adherence-gate.test.ts +413 -0
  191. package/src/tests/extensions-loader.test.ts +15 -0
  192. package/src/tests/heartbeat-jev-gate-credentials.test.ts +168 -0
  193. package/src/tests/heartbeat-jev-gate.test.ts +385 -0
  194. package/src/tests/model-profile-backcompat.test.ts +327 -0
  195. package/src/tests/model-profile-providers.test.ts +302 -0
  196. package/src/tests/model-profile-runtime-secrets.test.ts +223 -0
  197. package/src/tests/model-profiles-api.test.ts +614 -0
  198. package/src/tests/pages-feedback-keys.test.ts +121 -0
  199. package/src/tests/pages-feedback.test.ts +3 -0
  200. package/src/tests/pi-context-compaction.test.ts +193 -0
  201. package/src/tests/profile-claim.test.ts +269 -0
  202. package/src/tests/quickjs-compat.test.ts +213 -0
  203. package/src/tests/rbac-engine.test.ts +21 -0
  204. package/src/tests/script-connections.test.ts +4 -0
  205. package/src/tests/script-executor-conformance.test.ts +252 -1
  206. package/src/tests/script-executor-quickjs.test.ts +96 -0
  207. package/src/tests/script-runs-http.test.ts +89 -0
  208. package/src/tests/scripts-http.test.ts +16 -0
  209. package/src/tests/secret-scrubber.test.ts +10 -0
  210. package/src/tests/seed-model-profiles.test.ts +174 -0
  211. package/src/tests/seed-scripts.test.ts +2 -2
  212. package/src/tests/skill-invocations.test.ts +4 -2
  213. package/src/tests/slack-blocks.test.ts +36 -0
  214. package/src/tests/slack-inline-output.test.ts +14 -0
  215. package/src/tests/slack-reaction-config.test.ts +20 -0
  216. package/src/tests/slack-render-v2.test.ts +37 -0
  217. package/src/tests/slack-thread-buffer.test.ts +98 -1
  218. package/src/tests/workflow-llm.test.ts +61 -0
  219. package/src/tools/model-profiles/list-model-profiles.ts +54 -0
  220. package/src/tools/request-human-input.ts +11 -3
  221. package/src/tools/script-apis.ts +5 -1
  222. package/src/tools/script-upsert.ts +4 -1
  223. package/src/tools/send-task.ts +24 -1
  224. package/src/tools/system-one-decide.ts +104 -0
  225. package/src/tools/task-action.ts +22 -1
  226. package/src/tools/tool-config.ts +6 -0
  227. package/src/types.ts +36 -1
  228. package/src/utils/secret-scrubber.ts +19 -12
  229. package/src/utils/vcs-repo-match.ts +29 -0
  230. package/src/workflows/executors/raw-llm.ts +8 -3
  231. package/src/workflows/executors/system-one-decision.ts +21 -11
  232. package/src/workflows/executors/workflow-llm.ts +22 -0
  233. package/src/workflows/index.ts +21 -12
  234. package/templates/extensions/README.md +1 -0
  235. package/templates/extensions/comms-adherence-gate/README.md +88 -0
  236. package/templates/extensions/comms-adherence-gate/hooks.ts +489 -0
  237. package/templates/extensions/comms-adherence-gate/manifest.json +8 -0
  238. package/dist/cli-5t4f29ez.js +0 -33
@@ -4,7 +4,7 @@ import {
4
4
  ControllerOfflineError,
5
5
  ControllerStatusResultSchema,
6
6
  RuntimeHandleSchema
7
- } from "./cli-f7kr7svz.js";
7
+ } from "./cli-n8ndw8j7.js";
8
8
  import {
9
9
  canClaim,
10
10
  createWorkerTaskFollowUp,
@@ -14,7 +14,7 @@ import {
14
14
  listRuntimeInstancesForPool,
15
15
  markRuntimeTerminated,
16
16
  runtimeStaleThresholdMinutes
17
- } from "./cli-bzszjf2p.js";
17
+ } from "./cli-vgqzp4em.js";
18
18
  import {
19
19
  isMultiRuntimeEnabled
20
20
  } from "./cli-re8z5p8p.js";
@@ -30,12 +30,12 @@ import {
30
30
  listRuntimePools,
31
31
  mintRuntimeToken,
32
32
  resolvePoolDelivery
33
- } from "./cli-eejsgvm4.js";
33
+ } from "./cli-mgz4nbgg.js";
34
34
  import {
35
35
  canProvisionKind,
36
36
  createRuntimeProvider,
37
37
  init_runtime_providers
38
- } from "./cli-ra0xzggj.js";
38
+ } from "./cli-j67mh2vg.js";
39
39
  import {
40
40
  import_websocket
41
41
  } from "./cli-76yrvwsa.js";
@@ -55,12 +55,12 @@ import {
55
55
  upsertSwarmConfig,
56
56
  validateConfigValue,
57
57
  validateControllerGraceSec
58
- } from "./cli-ef1hg1wv.js";
58
+ } from "./cli-y3167wt1.js";
59
59
  import {
60
60
  TERMINAL_TASK_STATUSES,
61
61
  init_types,
62
62
  isTerminalTaskStatus
63
- } from "./cli-cgtksawx.js";
63
+ } from "./cli-pe05f8yk.js";
64
64
  import {
65
65
  init_zod
66
66
  } from "./cli-sd0mxa3c.js";
@@ -70,7 +70,7 @@ import {
70
70
  import {
71
71
  init_event_bus,
72
72
  workflowEventBus
73
- } from "./cli-9nfx44eh.js";
73
+ } from "./cli-z780ec7c.js";
74
74
  import {
75
75
  init_bus,
76
76
  realtimeBus
@@ -82,7 +82,7 @@ import {
82
82
  import {
83
83
  buildImageTemplate,
84
84
  init_dispatch
85
- } from "./cli-d2qr7aj4.js";
85
+ } from "./cli-t02z59f2.js";
86
86
  import {
87
87
  RUNTIME_LABELS,
88
88
  init_types as init_types2
@@ -91,7 +91,7 @@ import {
91
91
  init_secret_scrubber,
92
92
  registerVolatileSecret,
93
93
  scrubSecrets
94
- } from "./cli-p1x85d2t.js";
94
+ } from "./cli-shk7r5cs.js";
95
95
  import {
96
96
  __require
97
97
  } from "./cli-bc05qbss.js";
@@ -1204,7 +1204,7 @@ async function recoverSessions(runtimeId, reason) {
1204
1204
  }
1205
1205
  if (!sessions2.length)
1206
1206
  return;
1207
- const { remediateTaskForDeadRuntime } = await import("./heartbeat-6dakeb61.js");
1207
+ const { remediateTaskForDeadRuntime } = await import("./heartbeat-9q96p8v9.js");
1208
1208
  for (const session of sessions2) {
1209
1209
  try {
1210
1210
  const task = await getTaskById(session.taskId);
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  parseModelStr,
8
8
  resolveCredential
9
- } from "./cli-se8w6wny.js";
9
+ } from "./cli-1y7yywmj.js";
10
10
  import {
11
11
  complete,
12
12
  getBuiltinModel
@@ -29,7 +29,7 @@ import {
29
29
  import {
30
30
  init_secret_scrubber,
31
31
  scrubSecrets
32
- } from "./cli-p1x85d2t.js";
32
+ } from "./cli-shk7r5cs.js";
33
33
 
34
34
  // src/utils/internal-ai/complete-structured.ts
35
35
  init_zod();
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  buildModelsDevSeedRows,
3
3
  loadModelsDevCache
4
- } from "./cli-r62a35ea.js";
4
+ } from "./cli-hqr88ew6.js";
5
5
  import {
6
6
  createLogEntry,
7
7
  getActivePricingRow,
8
8
  getDbClient,
9
9
  init_db1 as init_db,
10
10
  insertPricingRow
11
- } from "./cli-ef1hg1wv.js";
11
+ } from "./cli-y3167wt1.js";
12
12
  import {
13
13
  init_runtime_model_catalog,
14
14
  setRuntimeModelCatalog
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  init_secret_scrubber,
18
18
  scrubSecrets
19
- } from "./cli-p1x85d2t.js";
19
+ } from "./cli-shk7r5cs.js";
20
20
  import {
21
21
  init_src,
22
22
  openAICompatibleProviderIds,
@@ -140,10 +140,15 @@ var REASONING_HARNESSES = new Set([
140
140
  "amp",
141
141
  "grok"
142
142
  ]);
143
+ function supportedReasoningLevels(harness, model) {
144
+ if (!REASONING_HARNESSES.has(harness))
145
+ return [];
146
+ return reasoningCapability(harness, model).levels;
147
+ }
143
148
  function effectiveReasoningEffort(harness, model, level) {
144
149
  if (!level || !REASONING_HARNESSES.has(harness))
145
150
  return null;
146
151
  return applyReasoningEffort(harness, model, level).kind === "noop" ? null : level;
147
152
  }
148
153
 
149
- export { reasoningCapability, applyReasoningEffort, effectiveReasoningEffort };
154
+ export { reasoningCapability, applyReasoningEffort, supportedReasoningLevels, effectiveReasoningEffort };
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  recordUnmappedIdentity,
3
3
  resolveIdentity
4
- } from "./cli-bzszjf2p.js";
4
+ } from "./cli-vgqzp4em.js";
5
5
  import {
6
6
  findOrCreateUserByEmail,
7
7
  findUserByExternalId,
8
8
  init_users,
9
9
  linkIdentity
10
- } from "./cli-eejsgvm4.js";
10
+ } from "./cli-mgz4nbgg.js";
11
11
  import {
12
12
  getKv,
13
13
  init_db1 as init_db,
14
14
  upsertKv
15
- } from "./cli-ef1hg1wv.js";
15
+ } from "./cli-y3167wt1.js";
16
16
 
17
17
  // src/slack/enrich.ts
18
18
  init_db();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getValidCodexOAuth,
3
3
  persistCodexOAuth
4
- } from "./cli-e6mpjhed.js";
4
+ } from "./cli-rc6pf5kv.js";
5
5
  import {
6
6
  oauthErrorHtml,
7
7
  oauthSuccessHtml
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_MODEL,
3
3
  resolveCredential
4
- } from "./cli-se8w6wny.js";
4
+ } from "./cli-1y7yywmj.js";
5
5
  import {
6
6
  getSlackApp
7
- } from "./cli-skxvvpap.js";
7
+ } from "./cli-cvv9k0hh.js";
8
8
  import {
9
9
  claimApprovalCancellationNotification,
10
10
  completeApprovalCancellationNotificationClaim,
@@ -12,11 +12,15 @@ import {
12
12
  getTaskById,
13
13
  init_db1 as init_db,
14
14
  releaseApprovalCancellationNotificationClaim
15
- } from "./cli-ef1hg1wv.js";
15
+ } from "./cli-y3167wt1.js";
16
16
  import {
17
17
  TERMINAL_TASK_STATUSES,
18
18
  init_types
19
- } from "./cli-cgtksawx.js";
19
+ } from "./cli-pe05f8yk.js";
20
+ import {
21
+ init_credentials,
22
+ selectCredential
23
+ } from "./cli-x1r545x8.js";
20
24
  import {
21
25
  init_resolver,
22
26
  resolveTemplate
@@ -40,7 +44,13 @@ import {
40
44
  import {
41
45
  init_secret_scrubber,
42
46
  scrubSecrets
43
- } from "./cli-p1x85d2t.js";
47
+ } from "./cli-shk7r5cs.js";
48
+ import {
49
+ init_src,
50
+ providerBaseUrl,
51
+ providerForModel,
52
+ providerKeyVars
53
+ } from "./cli-e3g5mbkz.js";
44
54
  import {
45
55
  __require
46
56
  } from "./cli-bc05qbss.js";
@@ -433,7 +443,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
433
443
  }
434
444
  if (notification.channel === "slack") {
435
445
  try {
436
- const { getSlackApp: getSlackApp2 } = await import("./app-kfvgbvzy.js");
446
+ const { getSlackApp: getSlackApp2 } = await import("./app-7k8s9w5p.js");
437
447
  const slackApp = getSlackApp2();
438
448
  if (!slackApp) {
439
449
  console.warn("[HITL] Slack not initialized — cannot send notification");
@@ -698,8 +708,23 @@ var OPENAI_DECISIONS_WIRE = {
698
708
  };
699
709
 
700
710
  // src/workflows/executors/workflow-llm.ts
711
+ init_src();
712
+ init_credentials();
701
713
  init_openrouter_base_url();
702
714
  async function resolveWorkflowLlmConfig(requestedModel, env = process.env, options = {}) {
715
+ const registryProvider = options.requireKind ? undefined : providerForModel(requestedModel);
716
+ if (registryProvider && requestedModel) {
717
+ const keyVar = providerKeyVars(registryProvider).find((name) => env[name]?.trim());
718
+ if (!keyVar) {
719
+ throw new Error(`No ${registryProvider.displayName} credential found for ${requestedModel}. Set ${registryProvider.envVar}.`);
720
+ }
721
+ return {
722
+ apiKey: selectCredential(env[keyVar], undefined, keyVar).selected,
723
+ baseURL: providerBaseUrl(registryProvider, env),
724
+ headers: {},
725
+ model: requestedModel.slice(registryProvider.id.length + 1)
726
+ };
727
+ }
703
728
  const credential = await resolveCredential({ env });
704
729
  if (!credential) {
705
730
  throw new Error("No workflow LLM credential found. Set OPENROUTER_API_KEY or OPENAI_API_KEY.");
@@ -1516,27 +1541,35 @@ class SystemOneDecisionExecutor extends BaseExecutor {
1516
1541
  return this.handOffToReviewer(config, await this.readParked(meta.stepId), context, meta);
1517
1542
  }
1518
1543
  }
1544
+ const decided = await this.decide(config);
1545
+ if (!decided.ok)
1546
+ return { status: "failed", error: decided.error };
1547
+ if (!config.humanReview)
1548
+ return { status: "success", output: decided.output };
1549
+ return this.reviewDecision(config, config.humanReview, decided.output, context, meta);
1550
+ }
1551
+ async decide(config) {
1519
1552
  const providerId = config.provider;
1520
1553
  const provider = SYSTEM_ONE_PROVIDERS[providerId];
1521
1554
  const model = config.model ?? provider.defaultModel;
1522
1555
  const modelProblem = systemOneModelProblem(providerId, model);
1523
1556
  if (modelProblem)
1524
- return { status: "failed", error: modelProblem };
1557
+ return { ok: false, error: modelProblem };
1525
1558
  const target = await this.resolveTarget(providerId, model);
1526
1559
  if (!target.ok)
1527
- return { status: "failed", error: target.error };
1560
+ return { ok: false, error: target.error };
1528
1561
  const { apiKey, endpoint } = target;
1529
1562
  const wire = provider.wire ?? SYSTEM_ONE_WIRE;
1530
1563
  const body = JSON.stringify(wire.buildRequest(config, model));
1531
1564
  const scrub = (message) => message.split(apiKey).join("[REDACTED]");
1532
1565
  const sent = await this.send(providerId, endpoint, apiKey, body, config.timeoutMs, config.maxRetries);
1533
1566
  if (!sent.ok)
1534
- return { status: "failed", error: scrub(sent.error) };
1567
+ return { ok: false, error: scrub(sent.error) };
1535
1568
  let parsed;
1536
1569
  try {
1537
1570
  parsed = JSON.parse(sent.text);
1538
1571
  } catch {
1539
- return { status: "failed", error: "SystemOne response was not valid JSON" };
1572
+ return { ok: false, error: "SystemOne response was not valid JSON" };
1540
1573
  }
1541
1574
  let decision;
1542
1575
  try {
@@ -1544,19 +1577,14 @@ class SystemOneDecisionExecutor extends BaseExecutor {
1544
1577
  } catch (err) {
1545
1578
  if (err instanceof SystemOneWireError) {
1546
1579
  const withId = sent.requestId ? `${err.message} [request ${sent.requestId}]` : err.message;
1547
- return { status: "failed", error: scrub(withId) };
1580
+ return { ok: false, error: scrub(withId) };
1548
1581
  }
1549
1582
  if (err instanceof SystemOneContractError) {
1550
- return {
1551
- status: "failed",
1552
- error: scrub(`SystemOne response failed validation: ${err.message}`)
1553
- };
1583
+ return { ok: false, error: scrub(`SystemOne response failed validation: ${err.message}`) };
1554
1584
  }
1555
1585
  throw err;
1556
1586
  }
1557
- if (!config.humanReview)
1558
- return { status: "success", output: decision };
1559
- return this.reviewDecision(config, config.humanReview, decision, context, meta);
1587
+ return { ok: true, output: decision };
1560
1588
  }
1561
1589
  async reviewDecision(config, review, decision, context, meta) {
1562
1590
  const questions = {};
@@ -2081,4 +2109,4 @@ function applyDefinitionPatch(def, patch) {
2081
2109
  return { definition: patchedDef, errors };
2082
2110
  }
2083
2111
 
2084
- export { BaseExecutor, postApprovalCancellationUpdates, createApprovalFollowUpTask, HumanInTheLoopExecutor, resolveWorkflowLlmConfig, SYSTEM_ONE_DECISION_NODE_TYPE, systemOneRetryViolations, systemOneUnresolvedError, SystemOneDecisionExecutor, getNextTargets, generateEdges, findEntryNodes, resolveValidationPort, getSuccessors, definitionNodeIds, validateDefinition, applyDefinitionPatch };
2112
+ export { BaseExecutor, postApprovalCancellationUpdates, createApprovalFollowUpTask, HumanInTheLoopExecutor, resolveWorkflowLlmConfig, SYSTEM_ONE_PROVIDER_IDS, SYSTEM_ONE_DECISION_NODE_TYPE, SystemOneDecisionConfigSchema, systemOneRetryViolations, systemOneUnresolvedError, SystemOneDecisionExecutor, getNextTargets, generateEdges, findEntryNodes, resolveValidationPort, getSuccessors, definitionNodeIds, validateDefinition, applyDefinitionPatch };
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  resolveSlackUserId,
3
3
  rewriteSlackMentions
4
- } from "./cli-wayw93nt.js";
4
+ } from "./cli-10jesr25.js";
5
5
  import {
6
+ TaskCreationBlockedError,
6
7
  bufferedFileFailures,
7
8
  buildEffectiveText,
8
9
  createAdditiveBuffer,
@@ -10,8 +11,9 @@ import {
10
11
  extractSlackMessageText,
11
12
  fetchSlackFiles,
12
13
  notifySlackFileFailures
13
- } from "./cli-bzszjf2p.js";
14
+ } from "./cli-vgqzp4em.js";
14
15
  import {
16
+ ackSlackMessage,
15
17
  buildBufferFlushBlocks,
16
18
  ensureSlackThreadTree,
17
19
  getAgentDisplayName,
@@ -19,11 +21,11 @@ import {
19
21
  getSlackApp,
20
22
  isSlackRenderV2Enabled,
21
23
  registerTreeMessage
22
- } from "./cli-skxvvpap.js";
24
+ } from "./cli-cvv9k0hh.js";
23
25
  import {
24
26
  findUserByExternalId,
25
27
  init_users
26
- } from "./cli-eejsgvm4.js";
28
+ } from "./cli-mgz4nbgg.js";
27
29
  import {
28
30
  createLogEntry,
29
31
  getAgentById,
@@ -36,11 +38,15 @@ import {
36
38
  init_steering,
37
39
  requestSteering,
38
40
  slackContextKey
39
- } from "./cli-ef1hg1wv.js";
41
+ } from "./cli-y3167wt1.js";
40
42
  import {
41
43
  init_steering_enabled,
42
44
  isSteeringEnabled
43
45
  } from "./cli-7mm2r1kp.js";
46
+ import {
47
+ init_secret_scrubber,
48
+ scrubSecrets
49
+ } from "./cli-shk7r5cs.js";
44
50
  import {
45
51
  __callDispose,
46
52
  __using
@@ -143,6 +149,7 @@ function formatSlackSteeringAck(result) {
143
149
  init_db();
144
150
  init_users();
145
151
  init_context_key();
152
+ init_secret_scrubber();
146
153
  var BUFFER_TIMEOUT_MS = Number(process.env.ADDITIVE_SLACK_BUFFER_MS) || 1e4;
147
154
  function makeKey(channelId, threadTs) {
148
155
  return `${channelId}:${threadTs}`;
@@ -288,21 +295,33 @@ ${threadContext}
288
295
  ${description}` : description;
289
296
  const dependsOn = !immediate && latestActiveTask ? [latestActiveTask.id] : undefined;
290
297
  const mostRecentTask = await getMostRecentTaskInThread(channelId, threadTs);
291
- const { task, unattached } = await createSlackTaskWithFiles(fullDescription, {
292
- agentId: lead?.id,
293
- routingReason: lead && mostRecentTask?.agentId === lead.id ? "continuity" : lead ? "skill" : undefined,
294
- routingSource: lead ? "engine_default" : undefined,
295
- source: "slack",
296
- slackChannelId: channelId,
297
- slackThreadTs: threadTs,
298
- slackTriggerMessageTs: items.at(-1).ts,
299
- slackUserId: originalRequesterId,
300
- requestedByUserId,
301
- dependsOn,
302
- parentTaskId: mostRecentTask?.id,
303
- inheritParentOutputSchema: false,
304
- contextKey: slackContextKey({ channelId, threadTs })
305
- }, inbound);
298
+ let created;
299
+ try {
300
+ created = await createSlackTaskWithFiles(fullDescription, {
301
+ agentId: lead?.id,
302
+ routingReason: lead && mostRecentTask?.agentId === lead.id ? "continuity" : lead ? "skill" : undefined,
303
+ routingSource: lead ? "engine_default" : undefined,
304
+ source: "slack",
305
+ slackChannelId: channelId,
306
+ slackThreadTs: threadTs,
307
+ slackTriggerMessageTs: items.at(-1).ts,
308
+ slackUserId: originalRequesterId,
309
+ requestedByUserId,
310
+ dependsOn,
311
+ parentTaskId: mostRecentTask?.id,
312
+ inheritParentOutputSchema: false,
313
+ contextKey: slackContextKey({ channelId, threadTs })
314
+ }, inbound);
315
+ } catch (error) {
316
+ if (!(error instanceof TaskCreationBlockedError))
317
+ throw error;
318
+ console.info("[Slack] pre.task.create blocked:", error.extension.name, scrubSecrets(error.reason));
319
+ if (app) {
320
+ await ackSlackMessage(app.client, channelId, items.at(-1).ts, "no_entry");
321
+ }
322
+ return;
323
+ }
324
+ const { task, unattached } = created;
306
325
  if (app)
307
326
  await notifySlackFileFailures(app.client, channelId, threadTs, unattached);
308
327
  console.log(`[Slack] Buffer flushed → task ${task.id} (dependsOn: ${dependsOn ? dependsOn.join(", ") : "none"})`);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  summarizeSession
3
- } from "./cli-tr4sxp68.js";
3
+ } from "./cli-035vekcw.js";
4
4
  import {
5
5
  checkToolLoop,
6
6
  clearToolHistory
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  init_secret_scrubber,
26
26
  scrubSecrets
27
- } from "./cli-p1x85d2t.js";
27
+ } from "./cli-shk7r5cs.js";
28
28
 
29
29
  // src/prompts/goal-reminder.ts
30
30
  init_session_templates();
@@ -440,9 +440,20 @@ function createSwarmHooksExtension(config) {
440
440
  }
441
441
  return;
442
442
  });
443
- pi.on("session_compact", async () => {
443
+ pi.on("session_compact", async (event, ctx) => {
444
444
  if (!config.taskId)
445
445
  return;
446
+ fireAndForget(`${config.apiUrl}/api/tasks/${config.taskId}/context`, {
447
+ method: "POST",
448
+ headers: apiHeaders(config),
449
+ body: JSON.stringify({
450
+ eventType: "compaction",
451
+ sessionId: `pi-${config.taskId}`,
452
+ compactTrigger: event.reason === "manual" ? "manual" : "auto",
453
+ preCompactTokens: event.compactionEntry?.tokensBefore,
454
+ contextTotalTokens: ctx.getContextUsage?.()?.contextWindow
455
+ })
456
+ });
446
457
  const taskDetails = await fetchTaskDetails(config);
447
458
  if (taskDetails) {
448
459
  const reminder = await renderGoalReminder(taskDetails);
@@ -459,7 +470,7 @@ function createSwarmHooksExtension(config) {
459
470
  method: "POST",
460
471
  headers: apiHeaders(config),
461
472
  body: JSON.stringify({
462
- eventType: "compaction",
473
+ eventType: "progress",
463
474
  sessionId: `pi-${config.taskId}`,
464
475
  contextUsedTokens: usage.tokens ?? undefined,
465
476
  contextTotalTokens: usage.contextWindow,