@desplega.ai/agent-swarm 2.8.2 → 2.8.3

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 (258) hide show
  1. package/dist/acp-adapter-xq6s2z6t.js +14 -0
  2. package/dist/{actions-kxek041g.js → actions-ewz7bp4g.js} +20 -19
  3. package/dist/{amp-adapter-ce7jjke4.js → amp-adapter-f25tqhnf.js} +3 -3
  4. package/dist/{app-v6zz8yh0.js → app-mkptw0k7.js} +4 -4
  5. package/dist/{assistant-m0sw9xx2.js → assistant-c47rfe77.js} +23 -22
  6. package/dist/{boot-args-schema-66bk37wv.js → boot-args-schema-4vb0xsat.js} +1 -1
  7. package/dist/{boot-reembed-edjpwsc1.js → boot-reembed-1ghy2sab.js} +1 -1
  8. package/dist/{boot-reembed-y27n09tz.js → boot-reembed-htr73hbs.js} +1 -1
  9. package/dist/{boot-scrub-sweep-1xc35965.js → boot-scrub-sweep-yrytg42z.js} +4 -4
  10. package/dist/{boot-seeds-7hjj91qj.js → boot-seeds-n2b3dx4e.js} +4 -4
  11. package/dist/{boxd-ent8ch04.js → boxd-jmfqgkqa.js} +1 -1
  12. package/dist/{claude-adapter-stw7jdcf.js → claude-adapter-r33pqnzx.js} +8 -9
  13. package/dist/{claude-managed-adapter-jh6c523j.js → claude-managed-adapter-hddmxjyj.js} +4 -4
  14. package/dist/{claude-managed-setup-y6z2perp.js → claude-managed-setup-hfvry1bd.js} +5 -5
  15. package/dist/{claude-sdk-session-vvya8wqk.js → claude-sdk-session-0hamqzc7.js} +10 -11
  16. package/dist/{cli-v1dv1r37.js → cli-0bcgyj5b.js} +74 -3
  17. package/dist/{cli-t2tma8gb.js → cli-0vksaxvr.js} +2 -2
  18. package/dist/{cli-mrt48bx7.js → cli-15204js0.js} +1 -1
  19. package/dist/{cli-8aes17e4.js → cli-1m96dc36.js} +3 -3
  20. package/dist/{cli-2r0jcc3k.js → cli-2d0cghfn.js} +1 -1
  21. package/dist/{cli-0cq8y6m7.js → cli-4ax9mvvg.js} +4 -4
  22. package/dist/{cli-tekytdq9.js → cli-4dpkjc2e.js} +6 -6
  23. package/dist/{cli-x1wa213s.js → cli-4e1hfbpq.js} +5 -5
  24. package/dist/{cli-7349va39.js → cli-500c09j9.js} +921 -431
  25. package/dist/{cli-9mb2q6pb.js → cli-54qr8mcd.js} +2 -2
  26. package/dist/{cli-m88rpzkh.js → cli-5a7szzfh.js} +2 -2
  27. package/dist/{cli-bst1vp7e.js → cli-5y2fvw4z.js} +13 -5
  28. package/dist/{cli-vj75tyaw.js → cli-6yygkr0w.js} +7 -7
  29. package/dist/{cli-kjtwrhea.js → cli-7c5tgqhf.js} +5 -5
  30. package/dist/{cli-2gxeg5gr.js → cli-8476gtwf.js} +1 -1
  31. package/dist/{cli-zh9rsbqf.js → cli-922z7gwm.js} +3 -3
  32. package/dist/{cli-jrzkw01m.js → cli-93t5s4zq.js} +2 -2
  33. package/dist/{cli-gyt3zydq.js → cli-9zmb7ptc.js} +9 -9
  34. package/dist/{cli-dzpc6en0.js → cli-am1ptset.js} +2 -2
  35. package/dist/{cli-w401b9tq.js → cli-awwptga4.js} +1 -1
  36. package/dist/{cli-26ctbcdp.js → cli-bhsfbmk8.js} +3 -3
  37. package/dist/{cli-mxn1qvbn.js → cli-bj6qhgte.js} +14 -32
  38. package/dist/{cli-g70vxtjh.js → cli-c0xjnr8z.js} +2 -2
  39. package/dist/{cli-jdknh18m.js → cli-c3ng0mb4.js} +13 -13
  40. package/dist/{cli-f4e8r23x.js → cli-c71n3bxq.js} +11 -6
  41. package/dist/{cli-6rc5frdm.js → cli-crpf163n.js} +25 -18
  42. package/dist/{cli-1qkz151v.js → cli-dpsfwh7n.js} +13 -21
  43. package/dist/{cli-xzm9vcfg.js → cli-dtdht77h.js} +2 -2
  44. package/dist/{cli-a0z912j7.js → cli-e2w34h6z.js} +137 -62
  45. package/dist/{cli-eddnyg3t.js → cli-emekyyhr.js} +1 -1
  46. package/dist/{cli-d84byzn8.js → cli-f1kwb5fc.js} +109 -33
  47. package/dist/{cli-0jzra9ad.js → cli-gn9y6fn7.js} +2 -2
  48. package/dist/{cli-vdektqgf.js → cli-gpz1d0t2.js} +4 -4
  49. package/dist/{cli-rcecc3yq.js → cli-h9yy18gy.js} +84 -36
  50. package/dist/{cli-m5akxq8q.js → cli-j8cjdzan.js} +1 -1
  51. package/dist/{cli-m9s2qff2.js → cli-jg5txpm6.js} +187 -93
  52. package/dist/{cli-b98a65ed.js → cli-k2rw11py.js} +3 -3
  53. package/dist/{cli-3e875j5p.js → cli-k96cecs7.js} +276 -47
  54. package/dist/{cli-3vjhs18n.js → cli-kd56bmk4.js} +1 -1
  55. package/dist/{cli-3sy2xags.js → cli-kmemts3w.js} +12 -12
  56. package/dist/{cli-f6bahpn5.js → cli-knva3nmx.js} +2 -2
  57. package/dist/{cli-959kp5h2.js → cli-kw44j53p.js} +13 -13
  58. package/dist/{cli-bsywb58a.js → cli-mdpbjnzq.js} +10 -10
  59. package/dist/{cli-2kvhc7x8.js → cli-me0r8gzr.js} +35 -76
  60. package/dist/{cli-4vzgeta4.js → cli-mwwmka77.js} +14 -14
  61. package/dist/{cli-q24n86d2.js → cli-n5t077me.js} +2 -2
  62. package/dist/{cli-rvhdmjvt.js → cli-nx2n3z6p.js} +1 -1
  63. package/dist/{cli-28fq781p.js → cli-pe4d96rb.js} +1 -1
  64. package/dist/{cli-3rkdne1h.js → cli-pxwtcgcp.js} +2 -2
  65. package/dist/{cli-n6vtrcht.js → cli-qmqt520k.js} +2 -2
  66. package/dist/{cli-pchypa1s.js → cli-qps8je6j.js} +17 -2
  67. package/dist/{cli-97ae65rz.js → cli-rjvsf9qa.js} +5 -5
  68. package/dist/{cli-e1p3n5gq.js → cli-rqfvkx5t.js} +6 -6
  69. package/dist/{cli-3vmb0n58.js → cli-s7zz734a.js} +1 -1
  70. package/dist/{cli-rmzsadkf.js → cli-s8p8hhty.js} +2 -2
  71. package/dist/{cli-j24zbska.js → cli-sdvcrq5x.js} +5 -5
  72. package/dist/{cli-5y340nzn.js → cli-sg27rk2t.js} +5 -5
  73. package/dist/{cli-d6521kb5.js → cli-skmhsnqh.js} +1 -1
  74. package/dist/{cli-5mrq3ake.js → cli-t4dv07kr.js} +1 -1
  75. package/dist/{cli-z1w943va.js → cli-t5ys4ebm.js} +3 -3
  76. package/dist/{cli-f4r3g076.js → cli-tas6ckky.js} +2 -2
  77. package/dist/{cli-1pz0330a.js → cli-tf79ryyy.js} +1 -1
  78. package/dist/{cli-kc7v1nfv.js → cli-tnzebztn.js} +1 -1
  79. package/dist/{cli-pfs8adn4.js → cli-vx421edw.js} +3 -3
  80. package/dist/{cli-kchjb7qy.js → cli-x3ex5bqf.js} +1 -1
  81. package/dist/cli-yss07azk.js +142 -0
  82. package/dist/{cli-fwy8kfd6.js → cli-z8cvws4c.js} +98 -16
  83. package/dist/{cli-g5mtmf6t.js → cli-zdaypkq9.js} +146 -52
  84. package/dist/{cli-fpjmegdb.js → cli-zeaehgyd.js} +2 -2
  85. package/dist/{cli-837vfs2x.js → cli-ztq5z4e1.js} +4 -4
  86. package/dist/cli.js +20 -20
  87. package/dist/{codex-adapter-zerf5qsp.js → codex-adapter-2brxx5ta.js} +7 -8
  88. package/dist/{codex-hook-30gyhzxe.js → codex-hook-c930c3ea.js} +1 -1
  89. package/dist/{codex-login-bcda78ge.js → codex-login-cbrs1h5w.js} +1 -1
  90. package/dist/{codex-session-runner-89s304py.js → codex-session-runner-y9anfj0r.js} +8 -9
  91. package/dist/{commands-jeh1b51j.js → commands-wn9q06qr.js} +3 -3
  92. package/dist/{controller-mctfbrse.js → controller-fw608czd.js} +4 -4
  93. package/dist/{controllers-connect-nxa1ddwn.js → controllers-connect-63j5rdcm.js} +20 -20
  94. package/dist/{cursor-adapter-qj8vehv6.js → cursor-adapter-6mb9jme8.js} +2 -2
  95. package/dist/{db-2dvay0es.js → db-0m6v5tq4.js} +3 -3
  96. package/dist/{db-b36qn6k3.js → db-y4wfrzbm.js} +4 -2
  97. package/dist/{devin-adapter-xedz98zv.js → devin-adapter-r0yx3gv8.js} +1 -1
  98. package/dist/{dispatcher-gndbta01.js → dispatcher-9tq2zzdj.js} +17 -17
  99. package/dist/{docker-866qpzt9.js → docker-j75atvpt.js} +2 -2
  100. package/dist/{dsh-adapter-f75sz821.js → dsh-adapter-t09sv4tq.js} +2 -2
  101. package/dist/{e2b-jbm7mj93.js → e2b-7s9dscap.js} +2 -2
  102. package/dist/{e2b-3gpc2n3w.js → e2b-a7vzs2vj.js} +2 -2
  103. package/dist/{easter-egg-3d-533knw22.js → easter-egg-3d-fbwvmwhe.js} +1 -1
  104. package/dist/{embedding-space-4p05vb2x.js → embedding-space-wh8de1t9.js} +6 -6
  105. package/dist/{embeddings-m6768mgh.js → embeddings-3hpbdtjr.js} +1 -1
  106. package/dist/{event-bus-e66gh7cc.js → event-bus-tr6h3gv8.js} +1 -1
  107. package/dist/{execute-b3mrb1mv.js → execute-4bdf8sdy.js} +1 -1
  108. package/dist/{external-channel-gjv3jne3.js → external-channel-ts2fwqh0.js} +2 -2
  109. package/dist/fx-adapter-1rnxnf56.js +17 -0
  110. package/dist/grok-adapter-efhmf1r8.js +17 -0
  111. package/dist/handlers-anrr3py9.js +32 -0
  112. package/dist/{heartbeat-a1tv60gt.js → heartbeat-2ze5fzpc.js} +20 -20
  113. package/dist/{hook-8h5dzcgq.js → hook-ca54yd4s.js} +5 -5
  114. package/dist/{hook-cyaps9ba.js → hook-gaehe2w5.js} +7 -7
  115. package/dist/{http-t15mhbd9.js → http-jfg8t2yk.js} +3861 -1798
  116. package/dist/{index-tvfafeyy.js → index-3gv6sc4z.js} +1 -1
  117. package/dist/{index-qav6455f.js → index-3yvzbhxd.js} +97 -22
  118. package/dist/index-8w2aznds.js +33 -0
  119. package/dist/{index-w1zqf680.js → index-csgrxedz.js} +1 -1
  120. package/dist/index-qnjvr362.js +37 -0
  121. package/dist/index-yzxd3sn9.js +32 -0
  122. package/dist/{keepalive-91s7hzrb.js → keepalive-k2a3qe73.js} +4 -4
  123. package/dist/lead-zhxqbfdv.js +69 -0
  124. package/dist/{maintenance-7pjmy5xy.js → maintenance-gb5sd5nc.js} +1 -1
  125. package/dist/{node-4c5jqxr3.js → node-7qsx5kvm.js} +1 -1
  126. package/dist/{oauth-refresh-sweep-rzqfm94j.js → oauth-refresh-sweep-y7rm6bkb.js} +3 -3
  127. package/dist/{onboard-74st7pag.js → onboard-jmc5qerv.js} +3 -3
  128. package/dist/{opencode-adapter-arn7gm8q.js → opencode-adapter-7eade9ev.js} +6 -7
  129. package/dist/{otel-impl-rnzey8cb.js → otel-impl-8j1xhxqd.js} +2 -2
  130. package/dist/{pi-mono-adapter-6mkwq64n.js → pi-mono-adapter-yqmaf32x.js} +13 -13
  131. package/dist/{pricing-refresh-ha21jhk7.js → pricing-refresh-1nj722h6.js} +2 -2
  132. package/dist/{rbac-roles-wqhma4dr.js → rbac-roles-b1mtr6dr.js} +3 -3
  133. package/dist/{rbac-roles-59dxachk.js → rbac-roles-n1f3frk1.js} +2 -2
  134. package/dist/{render-v2-14kpzx12.js → render-v2-1gfpd8rj.js} +4 -4
  135. package/dist/{resume-gsa5fb5f.js → resume-w1s1eh5v.js} +7 -7
  136. package/dist/{runtime-1hv06jsn.js → runtime-84g5egsc.js} +1 -1
  137. package/dist/{session-access-skm7bnp6.js → session-access-y6z1txk4.js} +4 -4
  138. package/dist/{session-source-backfill-pbqzbncv.js → session-source-backfill-gxxwfh12.js} +3 -3
  139. package/dist/{setup-5yermsem.js → setup-r91gstyk.js} +1 -1
  140. package/dist/{virtual-modules-gazyapte.js → virtual-modules-cgnj6kme.js} +3 -3
  141. package/dist/{work-objects-xj0ck0w4.js → work-objects-qcxzg61c.js} +20 -20
  142. package/dist/worker-7j2907g6.js +69 -0
  143. package/dist/{worker-follow-up-911xc0b8.js → worker-follow-up-y2d2h7km.js} +17 -17
  144. package/dist/{x-2fyrt5pp.js → x-qhxq2ama.js} +2 -2
  145. package/openapi.json +1214 -108
  146. package/package.json +3 -3
  147. package/src/be/db/tasks/read.ts +33 -0
  148. package/src/be/db.ts +32 -7
  149. package/src/be/migrations/289_automation_savings_daily.sql +47 -0
  150. package/src/be/migrations/291_task_slack_participants.sql +4 -0
  151. package/src/be/migrations/293_savings_component_links.sql +58 -0
  152. package/src/be/migrations/296_automation_savings_daily_read_index.sql +6 -0
  153. package/src/be/model-profile-check.ts +10 -2
  154. package/src/be/savings/compute.ts +511 -16
  155. package/src/be/savings/model.ts +282 -14
  156. package/src/be/savings/read.ts +1500 -0
  157. package/src/be/savings/rollup.ts +571 -0
  158. package/src/be/scripts/run-credential.ts +15 -3
  159. package/src/be/scripts/typecheck.ts +86 -4
  160. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +10 -2
  161. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +70 -4
  162. package/src/be/swarm-config-guard.ts +8 -0
  163. package/src/be/users.ts +29 -2
  164. package/src/commands/runner.ts +159 -41
  165. package/src/extensions/contract-types.generated.ts +1 -1
  166. package/src/http/index.ts +8 -1
  167. package/src/http/poll.ts +14 -1
  168. package/src/http/requested-by.ts +97 -1
  169. package/src/http/savings.ts +676 -190
  170. package/src/http/scripts.ts +26 -15
  171. package/src/http/tasks.ts +43 -5
  172. package/src/prompts/session-templates.ts +80 -3
  173. package/src/providers/acp-targets.ts +1 -1
  174. package/src/providers/amp-adapter.ts +1 -1
  175. package/src/providers/claude-adapter.ts +0 -20
  176. package/src/providers/claude-flag-settings.ts +12 -10
  177. package/src/providers/codex-adapter.ts +9 -34
  178. package/src/providers/opencode-adapter.ts +34 -12
  179. package/src/scheduler/scheduler.ts +20 -14
  180. package/src/scripts-runtime/ctx.ts +1 -1
  181. package/src/scripts-runtime/executors/quickjs-bundle.ts +1 -0
  182. package/src/scripts-runtime/executors/quickjs-prelude.ts +162 -2
  183. package/src/scripts-runtime/executors/quickjs-runner.ts +4 -1
  184. package/src/scripts-runtime/stdlib/fetch.ts +113 -15
  185. package/src/scripts-runtime/stdlib/index.ts +3 -1
  186. package/src/scripts-runtime/stdlib/retry.ts +174 -0
  187. package/src/scripts-runtime/swarm-sdk.ts +186 -17
  188. package/src/scripts-runtime/types/stdlib.d.ts +86 -4
  189. package/src/scripts-runtime/types/swarm-extension.d.ts +26 -0
  190. package/src/scripts-runtime/types/swarm-sdk.d.ts +60 -2
  191. package/src/slack/actions.ts +1 -0
  192. package/src/slack/assistant.ts +2 -0
  193. package/src/slack/enrich.ts +144 -50
  194. package/src/slack/handlers.ts +37 -95
  195. package/src/slack/templates.ts +9 -0
  196. package/src/slack/thread-buffer.ts +45 -71
  197. package/src/slack/thread-participants.ts +187 -0
  198. package/src/tests/base-prompt.test.ts +5 -4
  199. package/src/tests/claude-adapter-binary.test.ts +7 -1
  200. package/src/tests/claude-adapter.test.ts +10 -64
  201. package/src/tests/claude-flag-settings.test.ts +15 -11
  202. package/src/tests/claude-hook-credentials.test.ts +0 -1
  203. package/src/tests/claude-sdk-lifecycle.test.ts +5 -1
  204. package/src/tests/codex-adapter.test.ts +17 -78
  205. package/src/tests/create-task-vcs-repo.test.ts +136 -0
  206. package/src/tests/db-task-read-contract.test.ts +2 -0
  207. package/src/tests/db-task-write-contract.test.ts +1 -0
  208. package/src/tests/docs-index-footprint.test.js +3 -3
  209. package/src/tests/dreaming-learnings.test.ts +104 -0
  210. package/src/tests/extensions-pre-task.test.ts +4 -2
  211. package/src/tests/fetch-resolved-env.test.ts +47 -1
  212. package/src/tests/opencode-adapter.test.ts +53 -6
  213. package/src/tests/prompt-template-session.test.ts +17 -1
  214. package/src/tests/runner-requester-profile.test.ts +139 -1
  215. package/src/tests/savings-compound.test.ts +774 -0
  216. package/src/tests/savings-compute.test.ts +7 -198
  217. package/src/tests/savings-fleet-latency.test.ts +143 -0
  218. package/src/tests/savings-fleet-read.test.ts +195 -0
  219. package/src/tests/savings-fleet-scale.test.ts +222 -0
  220. package/src/tests/savings-model.test.ts +212 -0
  221. package/src/tests/savings-read.test.ts +367 -0
  222. package/src/tests/savings-rollup.test.ts +766 -0
  223. package/src/tests/savings-scripts.test.ts +611 -0
  224. package/src/tests/script-connections.test.ts +2 -0
  225. package/src/tests/script-executor-conformance.test.ts +444 -0
  226. package/src/tests/scripts-http.test.ts +55 -0
  227. package/src/tests/scripts-runtime-fetch.test.ts +2 -2
  228. package/src/tests/secret-rules.test.ts +124 -1
  229. package/src/tests/secret-scrubber.test.ts +1 -1
  230. package/src/tests/slack-dm-implicit-mention.test.ts +20 -1
  231. package/src/tests/slack-identity-resolution.test.ts +23 -0
  232. package/src/tests/slack-inbound-files.test.ts +2 -1
  233. package/src/tests/slack-thread-participants.test.ts +429 -0
  234. package/src/tests/tool-annotations.test.ts +30 -0
  235. package/src/types.ts +31 -0
  236. package/src/utils/mcp-server-fetcher.test.ts +89 -0
  237. package/src/utils/mcp-server-fetcher.ts +13 -5
  238. package/src/utils/request-auth-context.ts +24 -0
  239. package/src/utils/secret-rules.generated.ts +1 -1
  240. package/src/utils/secret-scrubber.ts +154 -29
  241. package/src/workflows/executors/swarm-script.ts +23 -19
  242. package/templates/skills/swarm-scripts/SKILL.md +5 -4
  243. package/templates/skills/swarm-scripts/content.md +5 -4
  244. package/templates/skills/work-on-task/SKILL.md +1 -1
  245. package/templates/skills/work-on-task/content.md +1 -1
  246. package/templates/workflows/dreaming/content.md +1 -1
  247. package/dist/acp-adapter-fqzkxyra.js +0 -15
  248. package/dist/cli-4bd1rck6.js +0 -4
  249. package/dist/cli-xf3qw745.js +0 -104
  250. package/dist/fx-adapter-rpsgb1tw.js +0 -18
  251. package/dist/grok-adapter-n2m3zjg1.js +0 -18
  252. package/dist/handlers-nv8edn19.js +0 -32
  253. package/dist/index-ksmyd6kc.js +0 -37
  254. package/dist/index-rjnrje98.js +0 -32
  255. package/dist/index-tv3413wy.js +0 -33
  256. package/dist/lead-3hmddvrm.js +0 -70
  257. package/dist/worker-qgg0m2gw.js +0 -70
  258. package/src/providers/ctx-mode-env.ts +0 -10
@@ -21,7 +21,7 @@ import {
21
21
  require_scala,
22
22
  require_swift,
23
23
  require_typescript
24
- } from "./cli-bsywb58a.js";
24
+ } from "./cli-mdpbjnzq.js";
25
25
  import {
26
26
  __commonJS
27
27
  } from "./cli-242037k3.js";
@@ -17,14 +17,14 @@ import {
17
17
  deleteSkill2,
18
18
  getSkillByName2,
19
19
  init_db4
20
- } from "./cli-rcecc3yq.js";
21
- import"./cli-q24n86d2.js";
20
+ } from "./cli-h9yy18gy.js";
21
+ import"./cli-n5t077me.js";
22
22
  import {
23
23
  agentFsProvisionSeeder
24
- } from "./cli-26ctbcdp.js";
25
- import"./cli-fpjmegdb.js";
26
- import"./cli-eddnyg3t.js";
27
- import"./cli-4vzgeta4.js";
24
+ } from "./cli-bhsfbmk8.js";
25
+ import"./cli-zeaehgyd.js";
26
+ import"./cli-emekyyhr.js";
27
+ import"./cli-mwwmka77.js";
28
28
  import {
29
29
  buildSkillContent
30
30
  } from "./cli-691vz9mk.js";
@@ -49,11 +49,11 @@ import {
49
49
  init_typecheck,
50
50
  parseSkillContent,
51
51
  init_skill_parser
52
- } from "./cli-fwy8kfd6.js";
53
- import"./cli-rmzsadkf.js";
54
- import"./cli-jdknh18m.js";
55
- import"./cli-n6vtrcht.js";
56
- import"./cli-f4e8r23x.js";
52
+ } from "./cli-z8cvws4c.js";
53
+ import"./cli-s8p8hhty.js";
54
+ import"./cli-c3ng0mb4.js";
55
+ import"./cli-qmqt520k.js";
56
+ import"./cli-c71n3bxq.js";
57
57
  import {
58
58
  __toESM
59
59
  } from "./cli-242037k3.js";
@@ -5365,6 +5365,13 @@ export function reuseWatermark(o: { from: Cursor; at: string; reuseRan: boolean;
5365
5365
 
5366
5366
  const esc = (s: string, n: number) => String(s ?? "").replace(/\\s+/g, " ").replace(/\\|/g, "\\\\|").slice(0, n);
5367
5367
 
5368
+ /** Measured triage cost: "this run" only when every triage task has a session_costs row; rows land late, so a short count is "partial". */
5369
+ export function measuredCost(row: { tasks?: unknown; usd?: unknown } | undefined, taskCount: number): { usd: number; basis: string } | null {
5370
+ const tasks = Number(row?.tasks ?? 0);
5371
+ if (!row || row.usd === null || row.usd === undefined || tasks === 0) return null;
5372
+ return { usd: Number(row.usd), basis: tasks >= taskCount ? "this run" : \`partial: \${tasks} of \${taskCount} tasks\` };
5373
+ }
5374
+
5368
5375
  export function renderSection(r: { skipReason?: string | null; read: number; planned: number; newRead: number; reuseRead: number; batches: number; okBatches: number; failedBatches: Array<{ batchId: string; status: string }>; promoted: number; kept: number; keptHowto: number; dropped: number; dropWhy: Record<string, number>; guards: Record<string, number>; invalid: Record<string, number>; missing: number; left: number | null; cursor: { from: string; to: string } | null; cost: { usd: number | null; basis: string }; samples: TriageRow[]; names: Record<string, string> }): string {
5369
5376
  const L: string[] = [HEADING];
5370
5377
  if (r.skipReason) {
@@ -5593,8 +5600,9 @@ export default async function (args: unknown, ctx: ScriptContext) {
5593
5600
  const taskIds = parsed.map((x) => x.taskId).filter(Boolean) as string[];
5594
5601
  let cost: { usd: number | null; basis: string } = { usd: null, basis: "no tasks" };
5595
5602
  if (taskIds.length) {
5596
- const c = (await q("cost", \`SELECT SUM(totalCostUsd) usd FROM session_costs WHERE taskId IN (\${taskIds.map(() => "?").join(",")})\`, taskIds))[0];
5597
- if (c && c.usd !== null && c.usd !== undefined) cost = { usd: Number(c.usd), basis: "this run" };
5603
+ const c = (await q("cost", \`SELECT COUNT(DISTINCT taskId) tasks, SUM(totalCostUsd) usd FROM session_costs WHERE taskId IN (\${taskIds.map(() => "?").join(",")})\`, taskIds))[0];
5604
+ const measured = measuredCost(c, new Set(taskIds).size);
5605
+ if (measured) cost = measured;
5598
5606
  else {
5599
5607
  const prior = (await q("cost-prior", \`SELECT COUNT(*) tasks, AVG(s.usd) usd FROM (SELECT sc.taskId, SUM(sc.totalCostUsd) usd FROM session_costs sc JOIN agent_tasks t ON t.id = sc.taskId WHERE t.tags LIKE '%dreaming-v2-learnings%' AND t.status = 'completed' AND sc.createdAt >= datetime('now','-7 days') GROUP BY sc.taskId) s\`))[0];
5600
5608
  cost = prior && Number(prior.tasks) > 0 && prior.usd !== null ? { usd: Number(prior.usd) * taskIds.length, basis: \`estimate: mean of \${prior.tasks} triage tasks in 7 days\` } : { usd: null, basis: "session_costs lands after the triage tasks finish" };
@@ -6943,6 +6951,45 @@ export function handoffRow(path: string, r: Route, texts: string[], scripts: Ski
6943
6951
  memberIds,
6944
6952
  };
6945
6953
  }
6954
+ // Synthesize turns only a few routes into actions a night (shared skill caps), so :latest carries every route it did
6955
+ // not act on. A route is consumed when an approved synthesize action cites the handoff KV and one of its members.
6956
+ export const ROUTES_KV_REF = "memtax-create:skill-routes";
6957
+ export function consumedMembers(synth: unknown): Set<string> {
6958
+ const s: any = parse(synth);
6959
+ const out = new Set<string>();
6960
+ for (const x of Array.isArray(s?.actions) ? s.actions : []) {
6961
+ const ev: string[] = Array.isArray(x?.evidence) ? x.evidence.map(String) : [];
6962
+ if (!ev.some((e) => e.includes(ROUTES_KV_REF))) continue;
6963
+ for (const e of ev) if (e.startsWith("memory:")) out.add(e.slice("memory:".length));
6964
+ }
6965
+ return out;
6966
+ }
6967
+ /** Stored routes minus consumed ones, merged by slug with tonight's (union memberIds, tonight's fields win), members
6968
+ * whose rows are gone dropped (\`live\` null = unknown, keep all), largest first. */
6969
+ export function carryRoutes(tonight: any[], stored: any[], consumed: Set<string>, live: Set<string> | null) {
6970
+ const slugOf = (r: any) => String(r?.slug || String(r?.path ?? "").split("/").pop() || "");
6971
+ const namesOf = (r: any) => Object.fromEntries((r?.memberIds ?? []).map((id: string, i: number) => [id, String(r?.memberNames?.[i] ?? "")]));
6972
+ const kept = stored.filter((r) => slugOf(r) && !(r.memberIds ?? []).some((id: string) => consumed.has(id)));
6973
+ const tonightSlugs = new Set(tonight.map(slugOf));
6974
+ const bySlug = new Map<string, any>();
6975
+ const names: Record<string, string> = {};
6976
+ for (const r of [...kept, ...tonight]) {
6977
+ const slug = slugOf(r);
6978
+ if (!slug) continue;
6979
+ Object.assign(names, Object.fromEntries(Object.entries(namesOf(r)).filter(([, n]) => n)));
6980
+ const prev = bySlug.get(slug);
6981
+ bySlug.set(slug, { ...prev, ...r, slug, memberIds: [...new Set([...(prev?.memberIds ?? []), ...(r.memberIds ?? []).map(String)])] });
6982
+ }
6983
+ const routes: any[] = [];
6984
+ let gone = 0;
6985
+ for (const r of bySlug.values()) {
6986
+ const memberIds = live ? r.memberIds.filter((id: string) => live.has(id)) : r.memberIds;
6987
+ if (!memberIds.length) gone++;
6988
+ else routes.push({ ...r, memberIds, memberNames: memberIds.map((id: string) => names[id] ?? "") });
6989
+ }
6990
+ routes.sort((x, y) => y.memberIds.length - x.memberIds.length);
6991
+ return { routes, carried: routes.filter((r) => !tonightSlugs.has(r.slug)).length, consumed: stored.length - kept.length, gone };
6992
+ }
6946
6993
  export const scriptHint = (texts: string[]) => texts.some((t) => /\\b(GET|POST|PUT|PATCH|DELETE) \\/|\\bcurl\\b|\\bendpoint\\b|https?:\\/\\/[^\\s]*\\/(v\\d|api)\\b|x-api-key|Bearer\\b/i.test(String(t ?? "")));
6947
6994
 
6948
6995
  const KIND_OF_ROOT = (root: string) =>
@@ -7681,10 +7728,33 @@ async function runScript(args: unknown, ctx: ScriptContext) {
7681
7728
  let handoff = runDry ? "dry run, not written" : "none";
7682
7729
  if (!runDry) {
7683
7730
  try {
7684
- const value = { runId, at: new Date().toISOString(), routes: skillRoutes.map((r) => ({ ...r, memberNames: (r.memberIds ?? []).map((id: string) => memberNames[id] ?? "") })) };
7685
- await ctx.swarm.kv_set({ namespace: NS, key: \`memtax-create:skill-routes:\${runId}\`, value: value as any });
7686
- await ctx.swarm.kv_set({ namespace: NS, key: "memtax-create:skill-routes:latest", value: value as any });
7687
- handoff = \`KV memtax-create:skill-routes:latest (\${skillRoutes.length} routes)\`;
7731
+ const tonight = skillRoutes.map((r) => ({ ...r, memberNames: (r.memberIds ?? []).map((id: string) => memberNames[id] ?? "") }));
7732
+ await ctx.swarm.kv_set({ namespace: NS, key: \`memtax-create:skill-routes:\${runId}\`, value: { runId, at: new Date().toISOString(), routes: tonight } as any });
7733
+ // Tonight's synthesize already read the stored set: drop what it acted on, carry the rest forward.
7734
+ const stored: any = (await ctx.swarm.kv_getOrNull({ namespace: NS, key: "memtax-create:skill-routes:latest" }))?.value;
7735
+ const prior: any[] = Array.isArray(stored?.routes) ? stored.routes : [];
7736
+ let consumed = new Set<string>();
7737
+ try {
7738
+ for (const r of await qStrict(\`SELECT json_extract(output, '$.taskOutput') v FROM workflow_run_steps WHERE runId = ? AND nodeId = 'synthesize'\`, [runId])) for (const id of consumedMembers(r.v)) consumed.add(id);
7739
+ } catch (e: any) {
7740
+ consumed = new Set();
7741
+ errors.push(\`handoff: synthesize step unreadable, nothing marked consumed: \${String(e?.message ?? e).slice(0, 200)}\`);
7742
+ }
7743
+ const ids = [...new Set([...prior, ...tonight].flatMap((r: any) => (r?.memberIds ?? []).map(String)))];
7744
+ let live: Set<string> | null = null;
7745
+ try {
7746
+ live = new Set<string>();
7747
+ for (let i = 0; i < ids.length; i += 500) {
7748
+ const part = ids.slice(i, i + 500);
7749
+ for (const r of await qStrict(\`SELECT DISTINCT id FROM agent_memory WHERE id IN (\${part.map(() => "?").join(",")}) AND (expiresAt IS NULL OR expiresAt > ?)\`, [...part, new Date().toISOString()])) live.add(String(r.id));
7750
+ }
7751
+ } catch (e: any) {
7752
+ live = null;
7753
+ errors.push(\`handoff: member check failed, kept every member: \${String(e?.message ?? e).slice(0, 200)}\`);
7754
+ }
7755
+ const carry = carryRoutes(tonight, prior, consumed, live);
7756
+ await ctx.swarm.kv_set({ namespace: NS, key: "memtax-create:skill-routes:latest", value: { runId, at: new Date().toISOString(), routes: carry.routes } as any });
7757
+ handoff = \`KV memtax-create:skill-routes:latest (\${carry.routes.length} routes: \${tonight.length} tonight, \${carry.carried} carried, \${carry.consumed} consumed, \${carry.gone} with no live members)\`;
7688
7758
  } catch (e: any) {
7689
7759
  errors.push(\`handoff: \${String(e?.message ?? e).slice(0, 200)}\`);
7690
7760
  handoff = "failed";
@@ -8035,6 +8105,10 @@ async function runScript(args: unknown, ctx: ScriptContext) {
8035
8105
  t("handoff: covered how-to -> skill-refactor skill-update, no script", h2.lane === "skill-refactor" && h2.op === "skill-update" && h2.skill === "agentmail-sending" && h2.scriptLane === null, h2);
8036
8106
  const h3 = handoffRow("/howto/bluesky", routeCluster("/howto/bluesky", sk), ["POST /xrpc/com.atproto.repo.createRecord with Bearer token"], scr, ["d4", "d5"]);
8037
8107
  t("handoff: API how-to with no script -> script candidate", h3.scriptExisting === null && h3.script === true && h3.scriptLane === "scriptify", h3);
8108
+ const cm = consumedMembers(JSON.stringify({ actions: [{ evidence: ["memory:m1", "kv:dreaming-v2/memtax-create:skill-routes:latest"] }, { evidence: ["memory:m9"] }] }));
8109
+ t("carry: only an action citing the handoff KV consumes its members", cm.has("m1") && !cm.has("m9"), [...cm]);
8110
+ const cr = carryRoutes([{ slug: "b", memberIds: ["m4"], memberNames: ["n4"], route: "skill-new" }], [{ slug: "a", memberIds: ["m1"] }, { slug: "b", memberIds: ["m2", "m3"], memberNames: ["n2", "n3"], route: "skill-update" }, { slug: "c", memberIds: ["m5"] }], cm, new Set(["m1", "m2", "m4"]));
8111
+ t("carry: consumed dropped, merged by slug (union), dead members and empty routes dropped, largest first", cr.routes.length === 1 && cr.routes[0].slug === "b" && cr.routes[0].route === "skill-new" && cr.routes[0].memberIds.join() === "m2,m4" && cr.routes[0].memberNames.join() === "n2,n4" && cr.consumed === 1 && cr.gone === 1, cr);
8038
8112
  // Near-duplicate guard. Vectors with a known cosine: [1, 0] vs [c, sqrt(1 - c^2)].
8039
8113
  const at = (c: number) => [c, Math.sqrt(1 - c * c)];
8040
8114
  const o = { nearDupCos: 0.8, twinCos: 0.95 };
@@ -20682,8 +20756,8 @@ A swarm script is TypeScript that runs out of process with a typed Swarm SDK. On
20682
20756
  |---|---|
20683
20757
  | 1 to 9 SDK calls, result fits in context | Direct tool calls. |
20684
20758
  | 10 or more similar calls, bulk or fan-out | Script. Inline \`script-run\` for a one-off, a named script for reuse. |
20685
- | Fetch, parse, and transform heavy data | Script, or \`ctx_*\` (context-mode) when your harness has it. |
20686
- | One large web fetch | \`ctx_fetch_and_index\` (context-mode). |
20759
+ | Fetch, parse, and transform heavy data | Script. |
20760
+ | One large web fetch | Script with \`ctx.stdlib.fetch\`. Return only the part you need. |
20687
20761
  | A schedule, workflow, or API script that reads or writes drive files | Script with \`ctx.fs\` and \`ctx.sh\`. |
20688
20762
  | Multi-agent fan-out, parallel work, deterministic pipeline | Workflow. See \`workflow-iterate\`. |
20689
20763
  | Work that repeats on a clock | Schedule. See \`scheduling\`. |
@@ -20737,7 +20811,7 @@ export default async function (args: z.infer<typeof argsSchema>, ctx: ScriptCont
20737
20811
  - \`args\` can be \`undefined\` when a caller passes none. Guard with \`argsSchema.safeParse(args ?? {})\` or optional chaining.
20738
20812
  - Export a Zod \`argsSchema\` from every named script. \`script-upsert\` converts it to JSON Schema, so callers, schedules, and workflows see the input contract.
20739
20813
  - Both \`zod\` and \`zod/mini\` imports work. Use \`import * as z from "zod/mini"\` for smaller QuickJS bundles. Mini uses functional forms: \`z.optional(z.string())\`, \`z._default(z.number(), 10)\`, and \`z.string().check(z.minLength(1))\`; its schemas still have \`.parse()\` and \`.safeParse()\`.
20740
- - Inline source through \`script-run\` runs without a typecheck. \`script-upsert\` typechecks before it saves. Import \`ScriptContext\` from \`"swarm-sdk"\` in inline code too, so promotion to a named script works.
20814
+ - Inline source through \`script-run\` runs without a typecheck. \`script-upsert\` typechecks before it saves. Import \`ScriptContext\` from \`"swarm-sdk"\` in inline code too, so promotion to a named script works. A worker's \`script-upsert\` saves at agent scope; a global-scope upsert is rejected unless you are the lead. To share a script, send the lead its name and \`contentHash\` to promote.
20741
20815
  - SDK methods return \`Promise<unknown>\`. Responses are usually wrapped: read \`res?.data ?? res\`. Exception: \`app_query\` with a literal \`appId\` and \`query\` returns rows typed from the app's columns.
20742
20816
  - \`agentId\` is propagated through the \`X-Agent-ID\` header, so SDK calls run as you. \`taskId\` is not ambient: pass it in \`args\` when the script calls \`task_storeProgress\`.
20743
20817
  - A script invoked from a workflow node may run under a workflow identity. The node may also supply arguments the script needs: when you run that script directly, pass the same arguments the node maps. A script without a strict \`argsSchema\` then fails deeper in, often as a not-found or resource error instead of a validation error.
@@ -20751,7 +20825,8 @@ export default async function (args: z.infer<typeof argsSchema>, ctx: ScriptCont
20751
20825
  - \`ctx.swarm.config\`: \`apiKey\`, \`agentId\`, \`mcpBaseUrl\`, and \`ctx.swarm.config.get("KEY")\` for swarm config values, resolved for the agent running the script (agent scope over global, the same rows \`get-config\` returns for that agent). A key that is not set returns \`undefined\`, so \`config.get("KEY") ?? fallback\` works. All are \`Redacted\` wrappers that stringify to \`<redacted>\`. Never unwrap one into a return value, a log line, or a request body you build by hand.
20752
20826
  - \`ctx.api.<slug>\` and \`ctx.mcp.<slug>\`: typed clients for registered connections. They exist only for registered connections. Introspect with \`Object.keys(ctx.api ?? {})\` and \`Object.keys(ctx.mcp ?? {})\`.
20753
20827
  - \`ctx.fs\` and \`ctx.sh\`: files and bash. See "Files and shell" below.
20754
- - \`ctx.stdlib\`: \`fetch\`, \`fetchJson\` (retries, 30 s timeout), \`grep\`, \`glob\`, \`table\`, \`Redacted\`.
20828
+ - \`ctx.stdlib\`: \`fetch\`, \`fetchJson\` (retries, 30 s timeout), \`grep\`, \`glob\`, \`table\`, \`retry\`, \`Redacted\`.
20829
+ - Retries: \`ctx.swarm\` calls retry a 429 on any call, and a 502/503/504 or network error on reads and on writes that send an idempotency key (such as \`workflow_trigger\` with \`idempotencyKey\`), within about 5 s. \`ctx.stdlib.fetch\` retries a 429 on any method and a 502/503/504 or network error on GET, HEAD, OPTIONS, PUT and DELETE. A POST or PATCH retries those only with an \`Idempotency-Key\` header: pass \`retry: { idempotencyKey: true }\` to send one UUID on every attempt. The key prevents a duplicate only when the server dedupes by it. \`retry: false\` makes one attempt. Wrap anything else, sync or async, in \`ctx.stdlib.retry(fn, { retries, minDelayMs, maxDelayMs, budgetMs, retryOn })\`; it rethrows the last error or returns the last result when attempts run out.
20755
20830
  - \`ctx.logger\`: \`log\`, \`warn\`, \`error\`. Keep logs short.
20756
20831
 
20757
20832
  ### Files and shell
@@ -21722,7 +21797,7 @@ var config_default53 = `{
21722
21797
  `;
21723
21798
 
21724
21799
  // templates/skills/work-on-task/content.md
21725
- var content_default53 = '# Working on a task\n\nThe taskId follows the command. Without one, call `get-tasks` with `mineOnly: true` and take your `pending` or `in_progress` task. If there is none, say so and stop.\n\nThis message carries the task text, its attachments, its output format, and memories from past sessions. If it does not (you invoked this command yourself, or the context was compacted), run the `task-context-gathering` script with the taskId.\n\nWhen the task names a skill (`researching`, `planning`, `implementing`), use it. Otherwise work directly.\n\nFinish the task with one of the four endings in your operating contract: `completed`, `defer-task`, `request-human-input`, or `failed`. Then stop.\n\nA lesson that would change how the next agent works goes in `learning` on that last `store-progress` call: line 1 a title, line 2 the rule ("When X, do Y"), then evidence. Leave it out for a status line, a restatement of the output, or text already in a skill.\n\nResuming (a resume task, or work cut by a graceful shutdown): read the parent\'s last progress line, then re-read live state once (PR state and head SHA, branch, `git status`) before new work. Re-run controls only if the head moved. Never redo a pushed commit or open a second PR for the same branch. Store a progress line with branch, PR number and head SHA each time you push. A document task has no branch: its live state is the brief\'s agent-fs output path and the task attachments. Read the parent task\'s output and any agent-fs draft path it names before rewriting. Run `agent-fs ls` on that path, download any partial and extend it; a superseded parent with empty output and no draft means a rebuild, not an extension. Then list the task\'s local work directory: a shutdown can leave the newest draft only there, or leave cache files half-written. Parse every cache file, delete the ones that fail, and re-run only the stages whose output is missing. Never re-run collection steps that already produced artifacts. A render task (video, image, generated page) has no branch either: its live state is the local project directory plus the brief\'s agent-fs output. List both; timestamps are hints only. Before reusing an output, verify that it exists, is complete and valid, and corresponds to the current sources and render settings (for example, using recorded input/settings hashes). Download remote output and verify its bytes and provenance; agent-fs listing dates alone do not establish freshness. Re-render missing, invalid, incomplete or stale output. Hand over the live app link `${AGENT_FS_LIVE_URL}/file/~/<org>/<drive>/<path>` by default. Use a share link only when the requester asked for one or the reader has no agent-fs login: then reuse a usable one, and create a missing one or replace an expired, revoked or view-exhausted one without re-rendering a valid unchanged output. A task that covers several PRs re-reads every PR in scope (state, mergedAt, head SHA), not only the first: a PR that merged during the shutdown takes no more pushes. If your task\'s `model` differs from the parent\'s, say so in the output, because the result\'s provenance changed.\n\nWrite times in replies, outputs and defer notes in the requester\'s timezone when the Requester Profile names one, never raw UTC.\n\nIf the user interrupts, follow their instructions. To resume, call `/work-on-task <taskId>` again.\n';
21800
+ var content_default53 = '# Working on a task\n\nThe taskId follows the command. Without one, call `get-tasks` with `mineOnly: true` and take your `pending` or `in_progress` task. If there is none, say so and stop.\n\nThis message carries the task text, its attachments, its output format, and memories from past sessions. If it does not (you invoked this command yourself, or the context was compacted), run the `task-context-gathering` script with the taskId.\n\nWhen the task names a skill (`researching`, `planning`, `implementing`), use it. Otherwise work directly.\n\nFinish the task with one of the four endings in your operating contract: `completed`, `defer-task`, `request-human-input`, or `failed`. Then stop.\n\nA lesson that would change how the next agent works goes in `learning` on that last `store-progress` call: line 1 a title, line 2 the rule ("When X, do Y"), then evidence. Leave it out for a status line, a restatement of the output, or text already in a skill.\n\nResuming (a resume task, or work cut by a graceful shutdown): read the parent\'s last progress line, then re-read live state once (PR state and head SHA, branch, `git status`) before new work. Re-run controls only if the head moved. Never redo a pushed commit or open a second PR for the same branch. Store a progress line with branch, PR number and head SHA each time you push. A document task has no branch: its live state is the brief\'s agent-fs output path and the task attachments. Read the parent task\'s output and any agent-fs draft path it names before rewriting. Run `agent-fs ls` on that path, download any partial and extend it; a superseded parent with empty output and no draft means a rebuild, not an extension. Then list the task\'s local work directory: a shutdown can leave the newest draft only there, or leave cache files half-written. Parse every cache file, delete the ones that fail, and re-run only the stages whose output is missing. Before re-running a collection, call `list-script-runs` with your `agentId` and reuse the output (`get-script-run`) of each completed run that started after the parent task started. Never re-run collection steps that already produced artifacts. A render task (video, image, generated page) has no branch either: its live state is the local project directory plus the brief\'s agent-fs output. List both; timestamps are hints only. Before reusing an output, verify that it exists, is complete and valid, and corresponds to the current sources and render settings (for example, using recorded input/settings hashes). Download remote output and verify its bytes and provenance; agent-fs listing dates alone do not establish freshness. Re-render missing, invalid, incomplete or stale output. Hand over the live app link `${AGENT_FS_LIVE_URL}/file/~/<org>/<drive>/<path>` by default. Use a share link only when the requester asked for one or the reader has no agent-fs login: then reuse a usable one, and create a missing one or replace an expired, revoked or view-exhausted one without re-rendering a valid unchanged output. A task that covers several PRs re-reads every PR in scope (state, mergedAt, head SHA), not only the first: a PR that merged during the shutdown takes no more pushes. If your task\'s `model` differs from the parent\'s, say so in the output, because the result\'s provenance changed.\n\nWrite times in replies, outputs and defer notes in the requester\'s timezone when the Requester Profile names one, never raw UTC.\n\nIf the user interrupts, follow their instructions. To resume, call `/work-on-task <taskId>` again.\n';
21726
21801
 
21727
21802
  // templates/skills/workflow-iterate/config.json
21728
21803
  var config_default54 = `{
@@ -0,0 +1,33 @@
1
+ import {
2
+ calculateNextRun2,
3
+ startScheduler2,
4
+ stopScheduler2,
5
+ runScheduleNow2,
6
+ init_scheduler2
7
+ } from "./cli-k96cecs7.js";
8
+ import"./cli-k2rw11py.js";
9
+ import"./cli-0vksaxvr.js";
10
+ import"./cli-z8cvws4c.js";
11
+ import"./cli-s8p8hhty.js";
12
+ import"./cli-7cp6aa1q.js";
13
+ import"./cli-sg27rk2t.js";
14
+ import"./cli-x6t50dmw.js";
15
+ import"./cli-sdvcrq5x.js";
16
+ import"./cli-c3ng0mb4.js";
17
+ import"./cli-mwwmka77.js";
18
+ import"./cli-s7zz734a.js";
19
+ import"./cli-zeaehgyd.js";
20
+ import"./cli-qmqt520k.js";
21
+ import"./cli-rjvsf9qa.js";
22
+ import"./cli-n5t077me.js";
23
+ import"./cli-c71n3bxq.js";
24
+ import"./cli-h9yy18gy.js";
25
+ import"./cli-emekyyhr.js";
26
+ init_scheduler2();
27
+
28
+ export {
29
+ calculateNextRun2 as calculateNextRun,
30
+ runScheduleNow2 as runScheduleNow,
31
+ startScheduler2 as startScheduler,
32
+ stopScheduler2 as stopScheduler
33
+ };
@@ -3,7 +3,7 @@ import {
3
3
  resetEmbeddingProvider2,
4
4
  getMemoryStore2,
5
5
  init_memory
6
- } from "./cli-rcecc3yq.js";
6
+ } from "./cli-h9yy18gy.js";
7
7
  init_memory();
8
8
 
9
9
  export {
@@ -0,0 +1,37 @@
1
+ import {
2
+ getExecutorRegistry2,
3
+ initWorkflows2,
4
+ init_workflows
5
+ } from "./cli-k96cecs7.js";
6
+ import"./cli-k2rw11py.js";
7
+ import"./cli-0vksaxvr.js";
8
+ import"./cli-z8cvws4c.js";
9
+ import"./cli-s8p8hhty.js";
10
+ import"./cli-7cp6aa1q.js";
11
+ import"./cli-sg27rk2t.js";
12
+ import"./cli-x6t50dmw.js";
13
+ import {
14
+ retryFailedRun2,
15
+ cancelWorkflowRun2
16
+ } from "./cli-sdvcrq5x.js";
17
+ import {
18
+ startWorkflowExecution2
19
+ } from "./cli-c3ng0mb4.js";
20
+ import"./cli-mwwmka77.js";
21
+ import"./cli-s7zz734a.js";
22
+ import"./cli-zeaehgyd.js";
23
+ import"./cli-qmqt520k.js";
24
+ import"./cli-rjvsf9qa.js";
25
+ import"./cli-n5t077me.js";
26
+ import"./cli-c71n3bxq.js";
27
+ import"./cli-h9yy18gy.js";
28
+ import"./cli-emekyyhr.js";
29
+ init_workflows();
30
+
31
+ export {
32
+ cancelWorkflowRun2 as cancelWorkflowRun,
33
+ getExecutorRegistry2 as getExecutorRegistry,
34
+ initWorkflows2 as initWorkflows,
35
+ retryFailedRun2 as retryFailedRun,
36
+ startWorkflowExecution2 as startWorkflowExecution
37
+ };
@@ -0,0 +1,32 @@
1
+ import"./cli-ns59dc6r.js";
2
+ import {
3
+ parseHeartbeatIntervalMs2,
4
+ startHeartbeat2,
5
+ stopHeartbeat2
6
+ } from "./cli-kw44j53p.js";
7
+ import"./cli-kmemts3w.js";
8
+ import"./cli-54qr8mcd.js";
9
+ import"./cli-k96cecs7.js";
10
+ import"./cli-k2rw11py.js";
11
+ import"./cli-0vksaxvr.js";
12
+ import"./cli-z8cvws4c.js";
13
+ import"./cli-s8p8hhty.js";
14
+ import"./cli-7cp6aa1q.js";
15
+ import"./cli-sg27rk2t.js";
16
+ import"./cli-x6t50dmw.js";
17
+ import"./cli-sdvcrq5x.js";
18
+ import"./cli-c3ng0mb4.js";
19
+ import"./cli-mwwmka77.js";
20
+ import"./cli-s7zz734a.js";
21
+ import"./cli-zeaehgyd.js";
22
+ import"./cli-qmqt520k.js";
23
+ import"./cli-rjvsf9qa.js";
24
+ import"./cli-n5t077me.js";
25
+ import"./cli-c71n3bxq.js";
26
+ import"./cli-h9yy18gy.js";
27
+ import"./cli-emekyyhr.js";
28
+ export {
29
+ parseHeartbeatIntervalMs2 as parseHeartbeatIntervalMs,
30
+ startHeartbeat2 as startHeartbeat,
31
+ stopHeartbeat2 as stopHeartbeat
32
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  listKeepAliveAuthorizations,
3
3
  init_oauth
4
- } from "./cli-rcecc3yq.js";
4
+ } from "./cli-h9yy18gy.js";
5
5
  import {
6
6
  ensureAuthorizationTokenOrThrow,
7
7
  init_ensure_token
8
- } from "./cli-rmzsadkf.js";
8
+ } from "./cli-s8p8hhty.js";
9
9
  import {
10
10
  scrubSecrets,
11
11
  init_secret_scrubber
12
- } from "./cli-d84byzn8.js";
12
+ } from "./cli-f1kwb5fc.js";
13
13
 
14
14
  // src/oauth/keepalive.ts
15
15
  init_oauth();
@@ -59,7 +59,7 @@ async function notifySlack(text) {
59
59
  return;
60
60
  }
61
61
  try {
62
- const { getSlackApp } = await import("./app-v6zz8yh0.js");
62
+ const { getSlackApp } = await import("./app-mkptw0k7.js");
63
63
  const app = getSlackApp();
64
64
  if (!app) {
65
65
  console.warn("[OAuth Keepalive] Slack not available, cannot send notification");
@@ -0,0 +1,69 @@
1
+ import"./cli-h9yy18gy.js";
2
+ import"./cli-n5t077me.js";
3
+ import"./cli-k2rw11py.js";
4
+ import"./cli-0vksaxvr.js";
5
+ import"./cli-emekyyhr.js";
6
+ import"./cli-zeaehgyd.js";
7
+ import"./cli-mwwmka77.js";
8
+ import"./cli-sdvcrq5x.js";
9
+ import {
10
+ getEnabledCapabilities,
11
+ init_server
12
+ } from "./cli-k96cecs7.js";
13
+ import"./cli-7cp6aa1q.js";
14
+ import"./cli-x6t50dmw.js";
15
+ import"./cli-rjvsf9qa.js";
16
+ import"./cli-sg27rk2t.js";
17
+ import"./cli-ztq5z4e1.js";
18
+ import"./cli-8476gtwf.js";
19
+ import {
20
+ runAgent
21
+ } from "./cli-e2w34h6z.js";
22
+ import"./cli-93t5s4zq.js";
23
+ import"./cli-77cd6gy8.js";
24
+ import"./cli-tnzebztn.js";
25
+ import"./cli-skmhsnqh.js";
26
+ import"./cli-dtdht77h.js";
27
+ import"./cli-4dpkjc2e.js";
28
+ import"./cli-tas6ckky.js";
29
+ import"./cli-1m96dc36.js";
30
+ import"./cli-c0xjnr8z.js";
31
+ import"./cli-d82btycs.js";
32
+ import"./cli-0726awxw.js";
33
+ import"./cli-rqfvkx5t.js";
34
+ import"./cli-dpsfwh7n.js";
35
+ import"./cli-98rwmcyc.js";
36
+ import"./cli-500c09j9.js";
37
+ import"./cli-6yygkr0w.js";
38
+ import"./cli-j8cjdzan.js";
39
+ import"./cli-kr5tjjtz.js";
40
+ import"./cli-bj6qhgte.js";
41
+ import"./cli-7c5tgqhf.js";
42
+ import"./cli-15204js0.js";
43
+ import"./cli-4ax9mvvg.js";
44
+ import"./cli-9zmb7ptc.js";
45
+ import"./cli-gpz1d0t2.js";
46
+ import"./cli-crpf163n.js";
47
+ import"./cli-vx421edw.js";
48
+ import"./cli-knva3nmx.js";
49
+ import"./cli-z8cvws4c.js";
50
+ import"./cli-s8p8hhty.js";
51
+ import"./cli-c3ng0mb4.js";
52
+ import"./cli-s7zz734a.js";
53
+ import"./cli-qmqt520k.js";
54
+ import"./cli-c71n3bxq.js";
55
+
56
+ // src/commands/lead.ts
57
+ init_server();
58
+ var leadConfig = {
59
+ role: "lead",
60
+ defaultPrompt: "/start-leader",
61
+ metadataType: "lead_metadata",
62
+ capabilities: getEnabledCapabilities()
63
+ };
64
+ async function runLead(opts) {
65
+ return runAgent(leadConfig, opts);
66
+ }
67
+ export {
68
+ runLead
69
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  reembedAllScripts2,
3
3
  init_embeddings
4
- } from "./cli-rcecc3yq.js";
4
+ } from "./cli-h9yy18gy.js";
5
5
 
6
6
  // src/be/scripts/maintenance.ts
7
7
  init_embeddings();
@@ -18,7 +18,7 @@ import {
18
18
  DEFAULT_MEMORY_SYNC_INTERVAL_MS,
19
19
  checkMemorySyncInterval,
20
20
  promiseWithResolvers
21
- } from "./cli-m9s2qff2.js";
21
+ } from "./cli-jg5txpm6.js";
22
22
 
23
23
  // node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs
24
24
  import * as fs4 from "node:fs/promises";
@@ -2,11 +2,11 @@ import {
2
2
  getAuthorizationById,
3
3
  listAuthorizationSweepRows,
4
4
  init_oauth
5
- } from "./cli-rcecc3yq.js";
5
+ } from "./cli-h9yy18gy.js";
6
6
  import {
7
7
  forceRefreshAuthorizationOrThrow,
8
8
  init_ensure_token
9
- } from "./cli-rmzsadkf.js";
9
+ } from "./cli-s8p8hhty.js";
10
10
  import {
11
11
  isEnvFlagEnabled,
12
12
  init_env_flag
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  scrubSecrets,
16
16
  init_secret_scrubber
17
- } from "./cli-d84byzn8.js";
17
+ } from "./cli-f1kwb5fc.js";
18
18
 
19
19
  // src/be/oauth-refresh-sweep.ts
20
20
  init_ensure_token();
@@ -16,7 +16,7 @@ import {
16
16
  createDefaultSettingsLocal,
17
17
  createDefaultMcpJson,
18
18
  createHooksConfig
19
- } from "./cli-w401b9tq.js";
19
+ } from "./cli-awwptga4.js";
20
20
  import {
21
21
  getSlackConfiguration,
22
22
  isSlackConfigured,
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  init_package,
27
27
  package_default
28
- } from "./cli-zh9rsbqf.js";
28
+ } from "./cli-922z7gwm.js";
29
29
  import {
30
30
  getApiKey,
31
31
  init_api_key
@@ -36,7 +36,7 @@ import {
36
36
  init_src2,
37
37
  scrubSecrets,
38
38
  init_secret_scrubber
39
- } from "./cli-d84byzn8.js";
39
+ } from "./cli-f1kwb5fc.js";
40
40
  import {
41
41
  __toESM
42
42
  } from "./cli-242037k3.js";
@@ -3,14 +3,13 @@ import {
3
3
  applyOpenRouterBaseUrlOverride2,
4
4
  buildOpenAICompatibleProviderBlock2,
5
5
  OpencodeAdapter2
6
- } from "./cli-6rc5frdm.js";
7
- import"./cli-vdektqgf.js";
8
- import"./cli-4bd1rck6.js";
9
- import"./cli-g70vxtjh.js";
6
+ } from "./cli-crpf163n.js";
7
+ import"./cli-gpz1d0t2.js";
8
+ import"./cli-c0xjnr8z.js";
10
9
  import"./cli-0726awxw.js";
11
- import"./cli-xzm9vcfg.js";
12
- import"./cli-8aes17e4.js";
13
- import"./cli-jrzkw01m.js";
10
+ import"./cli-dtdht77h.js";
11
+ import"./cli-1m96dc36.js";
12
+ import"./cli-93t5s4zq.js";
14
13
  export {
15
14
  OpencodeAdapter2 as OpencodeAdapter,
16
15
  applyOpenRouterBaseUrlOverride2 as applyOpenRouterBaseUrlOverride,
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  init_package,
15
15
  package_default
16
- } from "./cli-zh9rsbqf.js";
16
+ } from "./cli-922z7gwm.js";
17
17
  import {
18
18
  getNodeEnv,
19
19
  init_node_env
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  scrubSecrets,
23
23
  init_secret_scrubber
24
- } from "./cli-d84byzn8.js";
24
+ } from "./cli-f1kwb5fc.js";
25
25
  import {
26
26
  __toESM,
27
27
  __commonJS,
@@ -11,25 +11,25 @@ import {
11
11
  createCodemodeExtension,
12
12
  createMcpExtension,
13
13
  createToolSearchExtension
14
- } from "./cli-bsywb58a.js";
14
+ } from "./cli-mdpbjnzq.js";
15
15
  import {
16
16
  Unsafe
17
- } from "./cli-8aes17e4.js";
17
+ } from "./cli-1m96dc36.js";
18
18
  import {
19
19
  contextBoundNoteThreshold,
20
20
  createContextBoundNote
21
- } from "./cli-xzm9vcfg.js";
21
+ } from "./cli-dtdht77h.js";
22
22
  import {
23
23
  readPkgVersion
24
24
  } from "./cli-kr5tjjtz.js";
25
25
  import"./cli-0726awxw.js";
26
26
  import {
27
27
  createSwarmHooksExtension
28
- } from "./cli-vdektqgf.js";
29
- import"./cli-g70vxtjh.js";
28
+ } from "./cli-gpz1d0t2.js";
29
+ import"./cli-c0xjnr8z.js";
30
30
  import {
31
31
  applyReasoningEffort
32
- } from "./cli-jrzkw01m.js";
32
+ } from "./cli-93t5s4zq.js";
33
33
  import {
34
34
  piPromptSkillName
35
35
  } from "./cli-77cd6gy8.js";
@@ -38,7 +38,7 @@ import {
38
38
  } from "./cli-j4bwnpkm.js";
39
39
  import {
40
40
  fetchInstalledMcpServers
41
- } from "./cli-bst1vp7e.js";
41
+ } from "./cli-5y2fvw4z.js";
42
42
  import {
43
43
  McpHttpClient,
44
44
  init_http_client
@@ -48,12 +48,12 @@ import {
48
48
  getBuiltinModel,
49
49
  getBuiltinModels,
50
50
  init_all
51
- } from "./cli-x1wa213s.js";
51
+ } from "./cli-4e1hfbpq.js";
52
52
  import {
53
53
  buildPoolRevalidationFailureReason,
54
54
  getValidCodexOAuth,
55
55
  init_storage
56
- } from "./cli-rvhdmjvt.js";
56
+ } from "./cli-nx2n3z6p.js";
57
57
  import {
58
58
  swarmRuntimeInstanceId,
59
59
  init_multi_runtime2
@@ -71,7 +71,7 @@ import {
71
71
  } from "./cli-fw2w0kva.js";
72
72
  import {
73
73
  init_templates4
74
- } from "./cli-dzpc6en0.js";
74
+ } from "./cli-am1ptset.js";
75
75
  import {
76
76
  DEFAULT_OPENROUTER_BASE_URL,
77
77
  getOpenRouterBaseUrl,
@@ -80,11 +80,11 @@ import {
80
80
  import {
81
81
  resolveTemplateAsync,
82
82
  init_resolver
83
- } from "./cli-v1dv1r37.js";
83
+ } from "./cli-0bcgyj5b.js";
84
84
  import {
85
85
  snapshotCatalogRows,
86
86
  init_runtime_model_catalog
87
- } from "./cli-2r0jcc3k.js";
87
+ } from "./cli-2d0cghfn.js";
88
88
  import {
89
89
  parseEnvFlag,
90
90
  init_env_flag
@@ -107,7 +107,7 @@ import {
107
107
  registerVolatileSecret,
108
108
  registerEnvSecrets,
109
109
  init_secret_scrubber
110
- } from "./cli-d84byzn8.js";
110
+ } from "./cli-f1kwb5fc.js";
111
111
  import {
112
112
  __toESM
113
113
  } from "./cli-242037k3.js";
@@ -2,8 +2,8 @@ import {
2
2
  requestModelCatalogRefresh2,
3
3
  startPricingRefreshLoop2,
4
4
  init_pricing_refresh
5
- } from "./cli-t2tma8gb.js";
6
- import"./cli-rcecc3yq.js";
5
+ } from "./cli-0vksaxvr.js";
6
+ import"./cli-h9yy18gy.js";
7
7
  init_pricing_refresh();
8
8
 
9
9
  export {