@desplega.ai/agent-swarm 1.128.0 → 1.129.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 (402) hide show
  1. package/README.md +3 -2
  2. package/dist/{actions-3tjz0jkn.js → actions-kfv2dawe.js} +15 -12
  3. package/dist/{app-08mcfqa5.js → app-q8vjk6e8.js} +8 -8
  4. package/dist/{artifact-x7e6f41t.js → artifact-hg4t1nx7.js} +7 -2
  5. package/dist/{assistant-j90fr0jm.js → assistant-g037r345.js} +14 -14
  6. package/dist/{azure-openai-responses-ggmzdxgy.js → azure-openai-responses-xa4sh9f6.js} +10 -10
  7. package/dist/{boot-reembed-fsj45809.js → boot-reembed-18pzsrxa.js} +8 -7
  8. package/dist/{boot-reembed-e3290yjs.js → boot-reembed-wpks2cj8.js} +9 -8
  9. package/dist/{boot-scrub-logs-15m9vfhy.js → boot-scrub-logs-n7szd57r.js} +6 -5
  10. package/dist/{claude-adapter-6acnfptg.js → claude-adapter-qz4r0ajt.js} +20 -2
  11. package/dist/{claude-managed-adapter-g92bcm1a.js → claude-managed-adapter-gv19tdew.js} +3 -3
  12. package/dist/{claude-managed-setup-cm05wtek.js → claude-managed-setup-52z4mq9w.js} +1 -1
  13. package/dist/{cli-q25ejbyn.js → cli-0258203w.js} +49 -14
  14. package/dist/{cli-t83gdcf7.js → cli-0sf92efp.js} +1 -1
  15. package/dist/{cli-a36npnxa.js → cli-17zxdgsq.js} +28 -31
  16. package/dist/{cli-sq7f72d6.js → cli-1qkk5er0.js} +1 -1
  17. package/dist/{cli-24adhcy3.js → cli-1y1cm570.js} +3 -3
  18. package/dist/{cli-vajhsd2e.js → cli-2k0ztbfp.js} +1 -1
  19. package/dist/{cli-xz9aq0rf.js → cli-2mbe7vk0.js} +1 -1
  20. package/dist/{cli-xc0x7wey.js → cli-33jj76y8.js} +353 -2
  21. package/dist/{cli-shzqkrbd.js → cli-39vgrsep.js} +2 -2
  22. package/dist/{cli-jjp0c4rj.js → cli-4n2gcjpd.js} +273 -9
  23. package/dist/{cli-hzad20bp.js → cli-4n4mdv21.js} +28 -0
  24. package/dist/{cli-thsqy2j0.js → cli-7bz8dzqa.js} +3519 -476
  25. package/dist/{cli-90q5q9pt.js → cli-7ecgm5v0.js} +83 -3
  26. package/dist/{cli-rwctnq1j.js → cli-7padk69a.js} +6 -4
  27. package/dist/{cli-e61fs2hp.js → cli-8whqavk2.js} +2797 -1890
  28. package/dist/{cli-w5r4wfm5.js → cli-9b13ggd1.js} +6 -1
  29. package/dist/{cli-br49cbqp.js → cli-9fxg3v5m.js} +4 -4
  30. package/dist/{cli-agwvxxvh.js → cli-a8ynhkyj.js} +101 -14
  31. package/dist/{cli-bz42mzy3.js → cli-akxnpx17.js} +1662 -1234
  32. package/dist/{cli-95kferzh.js → cli-bnx54kxv.js} +13 -9
  33. package/dist/{cli-bw80ck94.js → cli-d91pvmq1.js} +1 -1
  34. package/dist/{cli-tk9vyqzh.js → cli-e7d20cty.js} +11 -0
  35. package/dist/{cli-jkhwmmgg.js → cli-epan13p1.js} +1 -0
  36. package/dist/{cli-k6nzt9hv.js → cli-etr62zy6.js} +162462 -94993
  37. package/dist/{cli-86jbqh6f.js → cli-fpaa5k2q.js} +624 -547
  38. package/dist/{cli-xn11dp5x.js → cli-g252a9ky.js} +8 -3
  39. package/dist/{cli-peycqz69.js → cli-ga12dc1d.js} +13 -3
  40. package/dist/{cli-852zctpg.js → cli-gb25p1h2.js} +3 -3
  41. package/dist/{cli-ftyf58xj.js → cli-gztgc3hz.js} +2 -2
  42. package/dist/{hook-qpgs6nt4.js → cli-h0457a67.js} +118 -47
  43. package/dist/{cli-qd4xzgk9.js → cli-hx02s9zq.js} +2 -2
  44. package/dist/{cli-k9m7hetx.js → cli-kk4f9r17.js} +6 -2
  45. package/dist/{cli-9f6yb8vh.js → cli-mhjnbgb6.js} +3899 -3871
  46. package/dist/{cli-61y9bkab.js → cli-mmrk00vp.js} +31 -4
  47. package/dist/{cli-b5p0jk5f.js → cli-n6h8qt8n.js} +34 -19
  48. package/dist/{cli-xvkz3rm5.js → cli-nhcd7x43.js} +2 -2
  49. package/dist/{cli-wgvn0gs7.js → cli-t53vnnxz.js} +144 -47
  50. package/dist/{cli-wspgs9bt.js → cli-t930g0xh.js} +4 -2
  51. package/dist/cli-ttkmehy0.js +2792 -0
  52. package/dist/{cli-t2msesap.js → cli-v37yr6mf.js} +7 -7
  53. package/dist/{cli-dh55d5fg.js → cli-x23me2mg.js} +14 -5
  54. package/dist/{cli-tfev56s0.js → cli-xg2eezyv.js} +1 -1
  55. package/dist/{cli-gg85k3zt.js → cli-xy4cwsm9.js} +1 -1
  56. package/dist/{cli-hwtd7cvy.js → cli-yjbgmysx.js} +102 -50
  57. package/dist/{cli-8fjwym53.js → cli-z9xqqhfk.js} +1 -1
  58. package/dist/{cli-1yjrbg1f.js → cli-zejvt395.js} +1 -1
  59. package/dist/cli.js +37 -22
  60. package/dist/{codex-adapter-tp9k7xqg.js → codex-adapter-7v6t7ff6.js} +9 -9
  61. package/dist/{codex-hook-tyqm0gpy.js → codex-hook-amndawyb.js} +7 -5
  62. package/dist/{codex-login-0h18cy3e.js → codex-login-z6yhbkmk.js} +1 -1
  63. package/dist/{codex-session-runner-6c2zds78.js → codex-session-runner-e7j4khe2.js} +9 -9
  64. package/dist/{commands-pfy10d4q.js → commands-ex0k5tbf.js} +6 -5
  65. package/dist/{db-0f7f1cvj.js → db-df7jatfc.js} +16 -5
  66. package/dist/{devin-adapter-8nmsgff3.js → devin-adapter-v1sarqtw.js} +1 -1
  67. package/dist/{e2b-q345y8s4.js → e2b-jdkwemv2.js} +6 -2
  68. package/dist/{handlers-d25x44k0.js → handlers-1j2cfqt2.js} +17 -16
  69. package/dist/hook-nx9a0mj3.js +877 -0
  70. package/dist/hook-w6yaf6sy.js +31 -0
  71. package/dist/{http-2f52nkya.js → http-4tz5h8wg.js} +510 -183
  72. package/dist/{index-2dgfj9av.js → index-0bpkzb09.js} +3 -3
  73. package/dist/{index-4b6wmbmk.js → index-0s67qv7h.js} +16 -15
  74. package/dist/index-35gtv6gj.js +13162 -0
  75. package/dist/index-7c0jqna0.js +36 -0
  76. package/dist/index-kcf3tm9h.js +34 -0
  77. package/dist/{index-t2snazez.js → index-ker3gccb.js} +4 -4
  78. package/dist/{keepalive-aw9aqjd5.js → keepalive-3j4a9168.js} +9 -10
  79. package/dist/{lead-sjxyhtxa.js → lead-6kpevymb.js} +43 -42
  80. package/dist/{maintenance-5h18tcq7.js → maintenance-m1k82ean.js} +9 -8
  81. package/dist/{mistral-conversations-3yjpaa7k.js → mistral-conversations-bjkdfb6z.js} +10 -10
  82. package/dist/{oauth-refresh-sweep-qgpbc9am.js → oauth-refresh-sweep-881k8e4q.js} +8 -9
  83. package/dist/{onboard-76xj7266.js → onboard-c0ykffjn.js} +2 -2
  84. package/dist/{openai-codex-responses-yd2x7kp4.js → openai-codex-responses-xetseqvt.js} +10 -10
  85. package/dist/{openai-responses-xke4h8fx.js → openai-responses-ce67hd23.js} +17 -17
  86. package/dist/{opencode-adapter-7pxawpsp.js → opencode-adapter-1gm38aba.js} +2 -2
  87. package/dist/{otel-63jr5v38.js → otel-3mp81ppd.js} +2 -2
  88. package/dist/{otel-impl-2pfbdnr8.js → otel-impl-sqagjerv.js} +20 -5
  89. package/dist/{pi-mono-adapter-6r7nb9yr.js → pi-mono-adapter-k584k16g.js} +32 -18
  90. package/dist/{pricing-refresh-ba3ag6hh.js → pricing-refresh-y82whbf9.js} +8 -7
  91. package/dist/{rbac-roles-jm18zgpz.js → rbac-roles-4ht8gegc.js} +7 -6
  92. package/dist/{rbac-roles-ktzfw0b0.js → rbac-roles-nvkqmzyd.js} +8 -7
  93. package/dist/{registry-wejfsj31.js → registry-02cy9z5z.js} +1 -1
  94. package/dist/{render-v2-bhez9szv.js → render-v2-wvqdgvvp.js} +8 -8
  95. package/dist/{seed-pricing-ybkssg65.js → seed-pricing-fy3rxhde.js} +7 -6
  96. package/dist/{setup-eegn7eyv.js → setup-ak5cnc6f.js} +2 -2
  97. package/dist/{worker-vvwg97h9.js → worker-d8769q8a.js} +43 -42
  98. package/openapi.json +1675 -13
  99. package/package.json +6 -2
  100. package/src/apps/catalog.generated.json +1064 -0
  101. package/src/apps/definition.ts +694 -0
  102. package/src/apps/format-upgrades.ts +74 -0
  103. package/src/apps/page-validator.ts +1572 -0
  104. package/src/apps/row-store.ts +446 -0
  105. package/src/apps/schema-migrate.ts +980 -0
  106. package/src/apps/script-types.ts +288 -0
  107. package/src/apps/store.ts +179 -0
  108. package/src/apps/user-config.ts +135 -0
  109. package/src/apps/version.ts +193 -0
  110. package/src/be/db.ts +204 -31
  111. package/src/be/mcp-proxy.ts +7 -0
  112. package/src/be/migrations/126_apps.sql +33 -0
  113. package/src/be/migrations/127_backfill_user_attribution.sql +94 -0
  114. package/src/be/migrations/128_session_costs_accuracy.sql +6 -0
  115. package/src/be/models-catalog.ts +8 -0
  116. package/src/be/modelsdev-cache.json +162625 -95180
  117. package/src/be/rbac-audit.ts +2 -0
  118. package/src/be/scripts/run-saved.ts +32 -0
  119. package/src/be/scripts/type-contributors.ts +24 -0
  120. package/src/be/scripts/typecheck.ts +48 -8
  121. package/src/be/seed-pricing.ts +41 -5
  122. package/src/be/seed-skills/bundled-files.generated.json +94 -0
  123. package/src/be/seed-skills/index.ts +206 -16
  124. package/src/be/seed-skills/render.ts +48 -0
  125. package/src/be/skill-parser.ts +11 -1
  126. package/src/cli.tsx +11 -0
  127. package/src/commands/profile-sync.ts +63 -12
  128. package/src/commands/runner.ts +118 -17
  129. package/src/fs/agent-fs-provider.ts +22 -16
  130. package/src/hooks/hook.ts +158 -26
  131. package/src/http/agents.ts +7 -6
  132. package/src/http/all-routes.ts +1 -0
  133. package/src/http/approval-requests.ts +54 -1
  134. package/src/http/apps.ts +1426 -0
  135. package/src/http/favorite-owner.ts +5 -3
  136. package/src/http/fs.ts +2 -1
  137. package/src/http/index.ts +2 -0
  138. package/src/http/kv.ts +6 -0
  139. package/src/http/mcp-servers.ts +85 -3
  140. package/src/http/page-proxy.ts +42 -2
  141. package/src/http/pages.ts +30 -0
  142. package/src/http/script-runs.ts +10 -0
  143. package/src/http/scripts.ts +8 -3
  144. package/src/http/session-cost-recompute.ts +196 -0
  145. package/src/http/session-data.ts +72 -77
  146. package/src/http/webhooks.ts +6 -0
  147. package/src/http/workflows.ts +16 -5
  148. package/src/kv-reserved-namespaces.ts +14 -0
  149. package/src/mcp-client/http-client.ts +3 -0
  150. package/src/otel-impl.ts +25 -0
  151. package/src/prompts/base-prompt.ts +44 -5
  152. package/src/prompts/session-templates.ts +30 -0
  153. package/src/providers/claude-adapter.ts +127 -0
  154. package/src/providers/codex-adapter.ts +62 -15
  155. package/src/providers/codex-models.ts +15 -7
  156. package/src/providers/codex-oauth/storage.ts +25 -0
  157. package/src/providers/devin-adapter.ts +9 -1
  158. package/src/providers/modelsdev-reasoning.json +2797 -1890
  159. package/src/providers/opencode-adapter.ts +54 -20
  160. package/src/providers/pi-mono-adapter.ts +2 -0
  161. package/src/providers/pi-mono-extension.ts +30 -5
  162. package/src/providers/pricing-sources.md +44 -7
  163. package/src/providers/types.ts +25 -0
  164. package/src/rbac/legacy-policy.ts +2 -0
  165. package/src/rbac/permissions.ts +8 -0
  166. package/src/rbac/types.ts +1 -0
  167. package/src/script-workflows/executor.ts +63 -28
  168. package/src/script-workflows/harness.ts +22 -1
  169. package/src/scripts-runtime/executors/native.ts +40 -67
  170. package/src/scripts-runtime/loader.ts +1 -0
  171. package/src/scripts-runtime/sdk-allowlist.ts +8 -0
  172. package/src/scripts-runtime/types/stdlib.d.ts +31 -0
  173. package/src/scripts-runtime/types/swarm-sdk.d.ts +31 -0
  174. package/src/server.ts +16 -0
  175. package/src/slack/HEURISTICS.md +1 -1
  176. package/src/slack/ack.ts +73 -0
  177. package/src/slack/actions.ts +2 -0
  178. package/src/slack/blocks.ts +4 -4
  179. package/src/slack/enrich.ts +6 -2
  180. package/src/slack/handlers.test.ts +34 -1
  181. package/src/slack/handlers.ts +3 -2
  182. package/src/slack/render-v2.ts +10 -0
  183. package/src/slack/responses.ts +6 -7
  184. package/src/slack/steering.ts +14 -5
  185. package/src/slack/thread-buffer.ts +13 -1
  186. package/src/slack/watcher.ts +10 -1
  187. package/src/tests/approval-requests.test.ts +44 -1
  188. package/src/tests/apps-element-assembly.test.ts +808 -0
  189. package/src/tests/apps-elements.test.ts +1169 -0
  190. package/src/tests/apps-rbac.test.ts +342 -0
  191. package/src/tests/apps-script-types.test.ts +307 -0
  192. package/src/tests/apps-spike.test.ts +590 -0
  193. package/src/tests/apps-spike2.test.ts +1231 -0
  194. package/src/tests/apps-spike4.test.ts +743 -0
  195. package/src/tests/apps-spike5.test.ts +1858 -0
  196. package/src/tests/apps-user-config.test.ts +551 -0
  197. package/src/tests/base-prompt.test.ts +82 -0
  198. package/src/tests/claude-adapter.test.ts +274 -7
  199. package/src/tests/claude-stop-hook.test.ts +99 -2
  200. package/src/tests/codex-adapter.test.ts +51 -3
  201. package/src/tests/codex-oauth-credential-info.test.ts +146 -0
  202. package/src/tests/codex-oauth-storage.test.ts +43 -1
  203. package/src/tests/entrypoint-codex-oauth-seed.test.ts +50 -2
  204. package/src/tests/fetch-resolved-env.test.ts +171 -61
  205. package/src/tests/fixtures/bookmarks-definition.json.txt +203 -0
  206. package/src/tests/fs-provider.test.ts +131 -24
  207. package/src/tests/fs-routes.test.ts +57 -0
  208. package/src/tests/github-handlers.test.ts +1 -1
  209. package/src/tests/http-api-integration.test.ts +21 -2
  210. package/src/tests/internal-ai/complete-structured.test.ts +165 -4
  211. package/src/tests/mcp-server-ssrf.test.ts +186 -0
  212. package/src/tests/memory-edges.test.ts +3 -1
  213. package/src/tests/migration-046-budgets.test.ts +31 -27
  214. package/src/tests/opencode-adapter.test.ts +139 -1
  215. package/src/tests/otel-session-cost-metrics.test.ts +88 -0
  216. package/src/tests/page-proxy.test.ts +107 -0
  217. package/src/tests/page-session.test.ts +92 -25
  218. package/src/tests/pages-http.test.ts +106 -0
  219. package/src/tests/pricing-refresh.test.ts +36 -0
  220. package/src/tests/profile-sync.test.ts +23 -7
  221. package/src/tests/prompt-template-remaining.test.ts +12 -0
  222. package/src/tests/prompt-template-session.test.ts +3 -2
  223. package/src/tests/rbac-engine.test.ts +2 -0
  224. package/src/tests/refresh-modelsdev-carryforward.test.ts +58 -0
  225. package/src/tests/run-bun-tests.test.ts +4 -0
  226. package/src/tests/runner-profile-backup.test.ts +52 -0
  227. package/src/tests/sandboxed-process.test.ts +92 -0
  228. package/src/tests/script-connections.test.ts +3 -0
  229. package/src/tests/script-workflows-runtime-e2e.test.ts +61 -0
  230. package/src/tests/scripts-http.test.ts +50 -0
  231. package/src/tests/scripts-typecheck.test.ts +144 -1
  232. package/src/tests/seed-scripts.test.ts +1 -1
  233. package/src/tests/seed-skills-bundled-files.test.ts +23 -0
  234. package/src/tests/session-cost-recompute-unit.test.ts +148 -0
  235. package/src/tests/session-costs-golden.test.ts +565 -0
  236. package/src/tests/session-costs-recompute-all-providers.test.ts +132 -1
  237. package/src/tests/session-costs.test.ts +83 -0
  238. package/src/tests/skill-parser.test.ts +76 -0
  239. package/src/tests/slack-attachments-block.test.ts +24 -0
  240. package/src/tests/slack-identity-resolution.test.ts +33 -1
  241. package/src/tests/slack-inline-output.test.ts +16 -1
  242. package/src/tests/slack-render-v2.test.ts +45 -1
  243. package/src/tests/slack-steering.test.ts +25 -1
  244. package/src/tests/slack-watcher.test.ts +48 -3
  245. package/src/tests/store-progress-attachments-handler.test.ts +2 -2
  246. package/src/tests/sync-ai-toolbox-skills.test.ts +300 -0
  247. package/src/tests/tracker-fold.test.ts +8 -1
  248. package/src/tests/user-attribution-migration.test.ts +160 -0
  249. package/src/tests/workflow-engine-v2.test.ts +147 -1
  250. package/src/tests/workflow-executors.test.ts +219 -2
  251. package/src/tests/workflow-foreach.test.ts +1122 -0
  252. package/src/tests/workflow-http-v2.test.ts +20 -0
  253. package/src/tests/workflow-triggers-v2.test.ts +70 -1
  254. package/src/tools/app-diff.ts +80 -0
  255. package/src/tools/app-get.ts +124 -0
  256. package/src/tools/app-history.ts +87 -0
  257. package/src/tools/app-list.ts +47 -0
  258. package/src/tools/app-patch.ts +158 -0
  259. package/src/tools/app-query.ts +1 -0
  260. package/src/tools/app-rollback.ts +111 -0
  261. package/src/tools/app-upsert.ts +176 -0
  262. package/src/tools/context-diff.ts +9 -5
  263. package/src/tools/kv/kv-write-auth.ts +4 -0
  264. package/src/tools/slack-post.ts +3 -3
  265. package/src/tools/slack-reply.ts +3 -3
  266. package/src/tools/slack-start-thread.ts +3 -3
  267. package/src/tools/store-progress.ts +5 -4
  268. package/src/tools/tool-config.ts +9 -1
  269. package/src/tools/update-profile.ts +7 -6
  270. package/src/tools/workflows/create-workflow.ts +5 -0
  271. package/src/tools/workflows/patch-workflow-node.ts +8 -2
  272. package/src/tools/workflows/patch-workflow.ts +8 -2
  273. package/src/tools/workflows/update-workflow.ts +4 -2
  274. package/src/types.ts +32 -7
  275. package/src/utils/constants.ts +12 -5
  276. package/src/utils/content-disposition.ts +15 -0
  277. package/src/utils/internal-ai/complete-structured.ts +41 -6
  278. package/src/utils/page-session.ts +77 -15
  279. package/src/utils/sandboxed-process.ts +174 -0
  280. package/src/workflows/constants.ts +1 -0
  281. package/src/workflows/definition.ts +155 -21
  282. package/src/workflows/engine.ts +148 -45
  283. package/src/workflows/executors/foreach.ts +213 -0
  284. package/src/workflows/executors/registry.ts +2 -0
  285. package/src/workflows/executors/script.ts +159 -24
  286. package/src/workflows/foreach-join.ts +117 -0
  287. package/src/workflows/index.ts +10 -1
  288. package/src/workflows/limits.ts +8 -0
  289. package/src/workflows/recovery.ts +57 -22
  290. package/src/workflows/resume.ts +45 -17
  291. package/src/workflows/retry-poller.ts +24 -5
  292. package/src/workflows/task-step-routing.ts +59 -0
  293. package/src/workflows/triggers.ts +72 -15
  294. package/templates/ai-toolbox.manifest.json +220 -0
  295. package/templates/skills/agentmail-sending/config.json +2 -1
  296. package/templates/skills/agentmail-sending/content.md +147 -30
  297. package/templates/skills/apps/config.json +14 -0
  298. package/templates/skills/apps/content.md +598 -0
  299. package/templates/skills/artifacts/content.md +27 -17
  300. package/templates/skills/ask-user/config.json +18 -0
  301. package/templates/skills/ask-user/content.md +73 -0
  302. package/templates/skills/attio-interaction/SKILL.md +5 -2
  303. package/templates/skills/attio-interaction/config.json +1 -0
  304. package/templates/skills/attio-interaction/content.md +4 -0
  305. package/templates/skills/brainstorming/config.json +18 -0
  306. package/templates/skills/brainstorming/content.md +140 -0
  307. package/templates/skills/brainstorming/files/template.md +38 -0
  308. package/templates/skills/code-reviewing/config.json +18 -0
  309. package/templates/skills/code-reviewing/content.md +66 -0
  310. package/templates/skills/composio/SKILL.md +244 -0
  311. package/templates/skills/composio/config.json +14 -0
  312. package/{plugin/skills/composio/SKILL.md → templates/skills/composio/content.md} +86 -20
  313. package/templates/skills/composio-gmail/config.json +14 -0
  314. package/{plugin/skills/composio-gmail/SKILL.md → templates/skills/composio-gmail/content.md} +4 -6
  315. package/templates/skills/composio-google-calendar/config.json +14 -0
  316. package/{plugin/skills/composio-google-calendar/SKILL.md → templates/skills/composio-google-calendar/content.md} +5 -7
  317. package/templates/skills/composio-google-docs/config.json +14 -0
  318. package/{plugin/skills/composio-google-docs/SKILL.md → templates/skills/composio-google-docs/content.md} +24 -6
  319. package/templates/skills/delegate-work/config.json +18 -0
  320. package/templates/skills/delegate-work/content.md +108 -0
  321. package/templates/skills/delegate-work/files/scripts/codex-exec.sh +82 -0
  322. package/templates/skills/design-docs/config.json +18 -0
  323. package/templates/skills/design-docs/content.md +37 -0
  324. package/templates/skills/design-docs/files/template.md +42 -0
  325. package/templates/skills/download-task-attachment/config.json +14 -0
  326. package/{plugin/skills/download-task-attachment/SKILL.md → templates/skills/download-task-attachment/content.md} +0 -5
  327. package/templates/skills/engineering-standards/config.json +18 -0
  328. package/templates/skills/engineering-standards/content.md +68 -0
  329. package/templates/skills/implementing/config.json +18 -0
  330. package/templates/skills/implementing/content.md +190 -0
  331. package/templates/skills/improve-agents-md/config.json +18 -0
  332. package/templates/skills/improve-agents-md/content.md +417 -0
  333. package/templates/skills/kapso-whatsapp/SKILL.md +15 -15
  334. package/templates/skills/kapso-whatsapp/config.json +10 -4
  335. package/templates/skills/kapso-whatsapp/content.md +64 -54
  336. package/templates/skills/kv-storage/content.md +4 -1
  337. package/templates/skills/learning/config.json +18 -0
  338. package/templates/skills/learning/content.md +265 -0
  339. package/templates/skills/learning/files/template.md +23 -0
  340. package/templates/skills/one-shot/config.json +18 -0
  341. package/templates/skills/one-shot/content.md +66 -0
  342. package/templates/skills/pages/content.md +3 -4
  343. package/templates/skills/phase-running/config.json +18 -0
  344. package/templates/skills/phase-running/content.md +129 -0
  345. package/templates/skills/planning/config.json +18 -0
  346. package/templates/skills/planning/content.md +72 -0
  347. package/templates/skills/planning/files/template.md +111 -0
  348. package/templates/skills/qa/config.json +18 -0
  349. package/templates/skills/qa/content.md +182 -0
  350. package/templates/skills/qa/files/template.md +75 -0
  351. package/templates/skills/questioning/config.json +18 -0
  352. package/templates/skills/questioning/content.md +108 -0
  353. package/templates/skills/questioning/files/template.md +19 -0
  354. package/templates/skills/researching/config.json +18 -0
  355. package/templates/skills/researching/content.md +166 -0
  356. package/templates/skills/researching/files/template.md +56 -0
  357. package/templates/skills/reviewing/config.json +18 -0
  358. package/templates/skills/reviewing/content.md +249 -0
  359. package/templates/skills/script-builder/config.json +18 -0
  360. package/templates/skills/script-builder/content.md +231 -0
  361. package/templates/skills/script-builder/files/templates/README.md +34 -0
  362. package/templates/skills/script-builder/files/templates/bash.sh.tmpl +70 -0
  363. package/templates/skills/script-builder/files/templates/python.py.tmpl +86 -0
  364. package/templates/skills/script-builder/files/templates/typescript.ts.tmpl +73 -0
  365. package/templates/skills/step-running/config.json +18 -0
  366. package/templates/skills/step-running/content.md +117 -0
  367. package/templates/skills/swarm-scripts/SKILL.md +87 -8
  368. package/templates/skills/swarm-scripts/content.md +1 -1
  369. package/templates/skills/tackle-gh-comments/config.json +18 -0
  370. package/templates/skills/tackle-gh-comments/content.md +116 -0
  371. package/templates/skills/tackle-gh-comments/files/scripts/gh-pr-comments.ts +292 -0
  372. package/templates/skills/tdd-planning/config.json +18 -0
  373. package/templates/skills/tdd-planning/content.md +259 -0
  374. package/templates/skills/tdd-planning/files/template.md +248 -0
  375. package/templates/skills/v-implementing/config.json +18 -0
  376. package/templates/skills/v-implementing/content.md +167 -0
  377. package/templates/skills/v-planning/config.json +18 -0
  378. package/templates/skills/v-planning/content.md +88 -0
  379. package/templates/skills/v-planning/files/templates/root.md +93 -0
  380. package/templates/skills/v-planning/files/templates/step.md +50 -0
  381. package/templates/skills/verifying/config.json +18 -0
  382. package/templates/skills/verifying/content.md +145 -0
  383. package/templates/skills/workflow-iterate/content.md +88 -1
  384. package/templates/skills/workflow-structured-output/config.json +1 -1
  385. package/templates/skills/workflow-structured-output/content.md +44 -23
  386. package/templates/skills/wts-expert/config.json +18 -0
  387. package/templates/skills/wts-expert/content.md +146 -0
  388. package/templates/skills/wts-expert/files/COMMANDS.md +201 -0
  389. package/dist/cli-0fxf2ess.js +0 -367
  390. package/dist/index-hc8ar2w3.js +0 -37
  391. package/dist/index-mm5rc1qa.js +0 -35
  392. package/dist/index-yg4y519c.js +0 -7443
  393. package/plugin/skills/.gitkeep +0 -0
  394. package/dist/{anthropic-messages-1hwa97nn.js → anthropic-messages-3xgme8my.js} +6 -6
  395. package/dist/{cli-h0yddy4n.js → cli-dxtxacy7.js} +12 -12
  396. package/dist/{cli-5j8hafqh.js → cli-epsvdckx.js} +3 -3
  397. package/dist/{cli-jj1arm18.js → cli-qmdnhpej.js} +5 -5
  398. package/dist/{google-generative-ai-307e5dq6.js → google-generative-ai-y42hnw9p.js} +6 -6
  399. package/dist/{google-vertex-btp9zq4e.js → google-vertex-4sg66gb6.js} +9 -9
  400. package/dist/{openai-completions-f4edtpd8.js → openai-completions-5r2g5axa.js} +16 -16
  401. package/dist/{openrouter-images-qv4vbkrr.js → openrouter-images-pzfp22jb.js} +3 -3
  402. package/dist/{pi-messages-68qm6bwq.js → pi-messages-tqj8q6b9.js} +4 -4
package/README.md CHANGED
@@ -126,7 +126,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
126
126
  - **Hybrid + graph-linked memory recall** — memory retrieval can blend vector and full-text ranking, expand through linked memories, surface usefulness readouts, and let agents correct an existing memory without losing its ID or history. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools#memory-tools)
127
127
  - **Multi-channel inputs** — Slack, GitHub, GitLab, email, WhatsApp, Linear, Jira, and the HTTP API all create tasks. [Integrations](#integrations)
128
128
  - **Persistent Slack thread trees** — opt in to one editable task tree per conversation, complete streamed outcome cards, and explicit agent-authored Block Kit messages without routine relay spam. [Slack guide →](https://docs.agent-swarm.dev/docs/guides/slack-integration)
129
- - **Workflow engine with Human-in-the-Loop** — DAG-based automation with approval gates, retries, and structured I/O. [Workflows →](https://docs.agent-swarm.dev/docs/concepts/workflows)
129
+ - **Workflow engine with Human-in-the-Loop** — DAG-based automation with approval gates, retries, structured I/O, and `foreach` fan-out that rejoins child agent tasks deterministically. [Workflows →](https://docs.agent-swarm.dev/docs/concepts/workflows)
130
130
  - **Scheduled & recurring tasks** — cron-based automation for standing work, with schedules that can target agent tasks, workflows, or catalog scripts. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
131
131
  - **Mid-run task steering** — add context at the next turn boundary, request an immediate interrupt where the harness supports it, or degrade safely to a follow-up task. [Task steering →](https://docs.agent-swarm.dev/docs/guides/task-steering)
132
132
  - **Operator configuration UI** — tune non-secret feature flags, limits, integration toggles, and runtime defaults from Settings → Configuration, with source and restart-required indicators. [Configuration →](https://docs.agent-swarm.dev/docs/ui/configuration)
@@ -136,6 +136,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
136
136
  - **Scripts-only MCP mode (code-mode)** — reduce the external MCP surface to eight script tools while retaining the full swarm SDK through `script-run`, cutting tool-schema context for capable coordinator models. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-only-mode)
137
137
  - **Scripts as external APIs** — expose a saved script as a public `POST /api/x/script/<id>` endpoint with optional bearer auth, typed input validation, and per-endpoint usage tracking. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-external-apis)
138
138
  - **Typed script API connections** — lead-managed OpenAPI, GraphQL, and MCP connections generate `ctx.api.*` / `ctx.mcp.*` clients for scripts, with credential bindings and OAuth-backed auth kept server-side. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-connections)
139
+ - **Swarm Apps** — agents build versioned, schema-backed dashboard apps with reusable UI elements, named queries and actions, per-user settings, RBAC, history, and safe rollback. App definitions also generate typed script APIs. [Apps API →](https://docs.agent-swarm.dev/docs/api-reference/apps)
139
140
  - **E2B-backed eval harness** — run a scenario × harness-config matrix against real swarm stacks, capture transcripts/artifacts, and grade outcomes with deterministic checks plus LLM or agentic judges. [Guide →](https://docs.agent-swarm.dev/docs/guides/evals-harness)
140
141
  - **Harness & LLM agnostic** — run with Claude Code, Claude Bridge, OpenAI Codex, pi-mono (Anthropic, OpenRouter, or Amazon Bedrock), Devin, Claude Managed Agents, raw LLMs, or opencode. The dashboard model picker follows a live models.dev catalog (with a bundled snapshot fallback), so newly released provider models appear without a redeploy. Route every OpenRouter-backed harness, workflow, and summarizer through an OpenAI-compatible gateway with `OPENROUTER_BASE_URL`. Tasks, schedules, and workflow agent-task nodes can use portable `modelTier` intent (`smol`, `regular`, `smart`, `ultra`), and operators can set per-agent reasoning effort (`off` → `max`, where supported) without changing task payloads. [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
141
142
  - **Published release artifacts** — every release publishes multi-architecture API, full-worker, and slim-worker images alongside versioned E2B templates, the npm CLI package, and the Helm chart. [Artifact inventory →](https://docs.agent-swarm.dev/docs/guides/published-artifacts)
@@ -146,7 +147,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
146
147
  - **Config-driven metrics dashboards** — define read-only SQL widgets, version them, and render them in the dashboard without shipping custom frontend code. [Metrics API →](https://docs.agent-swarm.dev/docs/api-reference/stats)
147
148
  - **DB-backed pages** — agents publish HTML or JSON pages (reports, dashboards, action specs) via `create_page`, remove stale pages with `delete-page`, and share them with public / authed / password modes, version history, view counters, diff helpers, and PDF export. [MCP tools → Pages](https://docs.agent-swarm.dev/docs/reference/mcp-tools#pages-tools)
148
149
  - **KV store** — Redis-like namespaced key/value store with auto-scoped context (Slack thread / PR / Linear issue / page). [MCP tools → KV](https://docs.agent-swarm.dev/docs/reference/mcp-tools#kv-tools)
149
- - **Real-time dashboard + task attachments** — monitor agents, tasks, and inter-agent chat; filter tasks by requester (including yourself or unattributed work); rename sessions inline; search a broad Lucide catalog to customize each agent's icon and color; filter Pages, Approval Requests, and workflow definitions with URL-backed search/facets; create tasks with uploaded files from the sessions composer; and preview task attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
150
+ - **Real-time, themeable dashboard + task attachments** — monitor agents, tasks, per-user usage costs, and inter-agent chat; choose from built-in light/dark themes; filter tasks by requester; create tasks with uploaded files; and preview attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
150
151
 
151
152
  ## Quick Start
152
153
 
@@ -1,20 +1,21 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-rwctnq1j.js";
4
- import"./cli-vajhsd2e.js";
3
+ } from "./cli-7padk69a.js";
4
+ import"./cli-2k0ztbfp.js";
5
5
  import {
6
6
  createTaskWithSiblingAwareness
7
- } from "./cli-t83gdcf7.js";
7
+ } from "./cli-0sf92efp.js";
8
8
  import {
9
9
  buildCancelledBlocks,
10
10
  ensureSlackThreadTree,
11
+ getAgentDisplayName,
12
+ getAgentEmoji,
11
13
  getTaskLink,
12
14
  isSlackRenderV2Enabled
13
- } from "./cli-agwvxxvh.js";
15
+ } from "./cli-a8ynhkyj.js";
14
16
  import"./cli-rkndnn90.js";
15
17
  import"./cli-b0p7rfnd.js";
16
- import"./cli-wspgs9bt.js";
17
- import"./cli-dh55d5fg.js";
18
+ import"./cli-t930g0xh.js";
18
19
  import {
19
20
  cancelTask,
20
21
  getAgentById,
@@ -23,13 +24,14 @@ import {
23
24
  init_context_key,
24
25
  init_db,
25
26
  slackContextKey
26
- } from "./cli-wgvn0gs7.js";
27
- import"./cli-hzad20bp.js";
27
+ } from "./cli-t53vnnxz.js";
28
+ import"./cli-4n4mdv21.js";
29
+ import"./cli-x23me2mg.js";
28
30
  import"./cli-z2zcxes1.js";
29
- import"./cli-bw80ck94.js";
30
- import"./cli-k9m7hetx.js";
31
+ import"./cli-d91pvmq1.js";
31
32
  import"./cli-4j2mrzag.js";
32
- import"./cli-xz9aq0rf.js";
33
+ import"./cli-kk4f9r17.js";
34
+ import"./cli-2mbe7vk0.js";
33
35
  import"./cli-e15jhafb.js";
34
36
  import"./cli-7wmybrt5.js";
35
37
  import"./cli-p9swy5t3.js";
@@ -122,7 +124,8 @@ function registerActionHandlers(app) {
122
124
  thread_ts: originalTask.slackThreadTs,
123
125
  text: `\uD83D\uDCAC Follow-up sent to *${agentName}* (${taskLink})`,
124
126
  unfurl_links: false,
125
- unfurl_media: false
127
+ unfurl_media: false,
128
+ ...lead ? { username: getAgentDisplayName(lead), icon_emoji: getAgentEmoji(lead) } : {}
126
129
  });
127
130
  } catch (error) {
128
131
  console.error("[Slack] Failed to post follow-up confirmation:", error);
@@ -3,18 +3,18 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-agwvxxvh.js";
6
+ } from "./cli-a8ynhkyj.js";
7
7
  import"./cli-rkndnn90.js";
8
8
  import"./cli-b0p7rfnd.js";
9
- import"./cli-wspgs9bt.js";
10
- import"./cli-dh55d5fg.js";
11
- import"./cli-wgvn0gs7.js";
12
- import"./cli-hzad20bp.js";
9
+ import"./cli-t930g0xh.js";
10
+ import"./cli-t53vnnxz.js";
11
+ import"./cli-4n4mdv21.js";
12
+ import"./cli-x23me2mg.js";
13
13
  import"./cli-z2zcxes1.js";
14
- import"./cli-bw80ck94.js";
15
- import"./cli-k9m7hetx.js";
14
+ import"./cli-d91pvmq1.js";
16
15
  import"./cli-4j2mrzag.js";
17
- import"./cli-xz9aq0rf.js";
16
+ import"./cli-kk4f9r17.js";
17
+ import"./cli-2mbe7vk0.js";
18
18
  import"./cli-e15jhafb.js";
19
19
  import"./cli-7wmybrt5.js";
20
20
  import"./cli-p9swy5t3.js";
@@ -9,8 +9,9 @@ import {
9
9
  require_src
10
10
  } from "./cli-rkndnn90.js";
11
11
  import {
12
- getMcpBaseUrl
13
- } from "./cli-dh55d5fg.js";
12
+ getMcpBaseUrl,
13
+ init_constants
14
+ } from "./cli-x23me2mg.js";
14
15
  import"./cli-7wmybrt5.js";
15
16
  import {
16
17
  __commonJS,
@@ -3591,6 +3592,9 @@ var upgradeWebSocket = defineWebSocketHelper((c, events) => {
3591
3592
  return;
3592
3593
  });
3593
3594
 
3595
+ // src/artifact-sdk/server.ts
3596
+ init_constants();
3597
+
3594
3598
  // src/artifact-sdk/port.ts
3595
3599
  import { createServer } from "node:net";
3596
3600
  async function getAvailablePort() {
@@ -3743,6 +3747,7 @@ function createArtifactServer(opts) {
3743
3747
  return artifact;
3744
3748
  }
3745
3749
  // src/commands/artifact.ts
3750
+ init_constants();
3746
3751
  async function runArtifact(subcommand, args) {
3747
3752
  switch (subcommand) {
3748
3753
  case "serve":
@@ -1,29 +1,28 @@
1
1
  import {
2
- ackSlackMessage,
3
2
  bufferThreadMessage,
4
3
  getBufferMessageCount,
5
4
  wasEventSeen
6
- } from "./cli-a36npnxa.js";
5
+ } from "./cli-17zxdgsq.js";
7
6
  import {
8
7
  hasOtherUserMention
9
- } from "./cli-xvkz3rm5.js";
8
+ } from "./cli-nhcd7x43.js";
10
9
  import {
11
10
  resolveSlackUserId,
12
11
  rewriteSlackMentions
13
- } from "./cli-rwctnq1j.js";
14
- import"./cli-vajhsd2e.js";
12
+ } from "./cli-7padk69a.js";
13
+ import"./cli-2k0ztbfp.js";
15
14
  import {
16
15
  createTaskWithSiblingAwareness
17
- } from "./cli-t83gdcf7.js";
16
+ } from "./cli-0sf92efp.js";
18
17
  import {
18
+ ackSlackMessage,
19
19
  ensureSlackThreadTree,
20
20
  isSlackRenderV2Enabled,
21
21
  require_dist
22
- } from "./cli-agwvxxvh.js";
22
+ } from "./cli-a8ynhkyj.js";
23
23
  import"./cli-rkndnn90.js";
24
24
  import"./cli-b0p7rfnd.js";
25
- import"./cli-wspgs9bt.js";
26
- import"./cli-dh55d5fg.js";
25
+ import"./cli-t930g0xh.js";
27
26
  import {
28
27
  getAgentWorkingOnThread,
29
28
  getLeadAgent,
@@ -31,18 +30,19 @@ import {
31
30
  init_context_key,
32
31
  init_db,
33
32
  slackContextKey
34
- } from "./cli-wgvn0gs7.js";
33
+ } from "./cli-t53vnnxz.js";
35
34
  import {
36
35
  init_env_flag,
37
36
  init_resolver,
38
37
  isEnvFlagEnabled,
39
38
  resolveTemplate
40
- } from "./cli-hzad20bp.js";
39
+ } from "./cli-4n4mdv21.js";
40
+ import"./cli-x23me2mg.js";
41
41
  import"./cli-z2zcxes1.js";
42
- import"./cli-bw80ck94.js";
43
- import"./cli-k9m7hetx.js";
42
+ import"./cli-d91pvmq1.js";
44
43
  import"./cli-4j2mrzag.js";
45
- import"./cli-xz9aq0rf.js";
44
+ import"./cli-kk4f9r17.js";
45
+ import"./cli-2mbe7vk0.js";
46
46
  import"./cli-e15jhafb.js";
47
47
  import"./cli-7wmybrt5.js";
48
48
  import {
@@ -2,39 +2,39 @@ import {
2
2
  convertResponsesMessages,
3
3
  convertResponsesTools,
4
4
  processResponsesStream
5
- } from "./cli-5j8hafqh.js";
5
+ } from "./cli-epsvdckx.js";
6
6
  import {
7
7
  clampOpenAIPromptCacheKey
8
8
  } from "./cli-mrptpp86.js";
9
- import"./cli-5m9j2spm.js";
10
9
  import {
11
10
  AzureOpenAI
12
11
  } from "./cli-sajgpkqg.js";
12
+ import"./cli-5m9j2spm.js";
13
13
  import {
14
14
  retryProviderRequest
15
15
  } from "./cli-s8s499xy.js";
16
- import {
17
- getProviderEnvValue
18
- } from "./cli-4wgngmwv.js";
19
- import"./cli-zyxs93y9.js";
20
16
  import {
21
17
  formatProviderError,
22
18
  normalizeProviderError
23
19
  } from "./cli-ch7t5v7n.js";
20
+ import {
21
+ getProviderEnvValue
22
+ } from "./cli-4wgngmwv.js";
23
+ import {
24
+ headersToRecord
25
+ } from "./cli-vapyk8sw.js";
26
+ import"./cli-zyxs93y9.js";
24
27
  import {
25
28
  buildBaseOptions,
26
29
  createGrammarToolInputProperties
27
30
  } from "./cli-vgexpfsr.js";
31
+ import"./cli-y2apkfe2.js";
28
32
  import {
29
33
  clampThinkingLevel
30
34
  } from "./cli-w10fkrf1.js";
31
- import"./cli-y2apkfe2.js";
32
35
  import {
33
36
  AssistantMessageEventStream
34
37
  } from "./cli-8wrympd7.js";
35
- import {
36
- headersToRecord
37
- } from "./cli-vapyk8sw.js";
38
38
  import"./cli-p9swy5t3.js";
39
39
 
40
40
  // node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js
@@ -3,18 +3,19 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-24adhcy3.js";
7
- import"./cli-q25ejbyn.js";
6
+ } from "./cli-1y1cm570.js";
7
+ import"./cli-0258203w.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-wgvn0gs7.js";
12
- import"./cli-hzad20bp.js";
11
+ } from "./cli-t53vnnxz.js";
12
+ import"./cli-4n4mdv21.js";
13
+ import"./cli-x23me2mg.js";
13
14
  import"./cli-z2zcxes1.js";
14
- import"./cli-bw80ck94.js";
15
- import"./cli-k9m7hetx.js";
15
+ import"./cli-d91pvmq1.js";
16
16
  import"./cli-4j2mrzag.js";
17
- import"./cli-xz9aq0rf.js";
17
+ import"./cli-kk4f9r17.js";
18
+ import"./cli-2mbe7vk0.js";
18
19
  import"./cli-p9swy5t3.js";
19
20
 
20
21
  // src/be/memory/boot-reembed.ts
@@ -1,19 +1,20 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-shzqkrbd.js";
5
- import"./cli-24adhcy3.js";
6
- import"./cli-q25ejbyn.js";
4
+ } from "./cli-39vgrsep.js";
5
+ import"./cli-1y1cm570.js";
6
+ import"./cli-0258203w.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-wgvn0gs7.js";
11
- import"./cli-hzad20bp.js";
10
+ } from "./cli-t53vnnxz.js";
11
+ import"./cli-4n4mdv21.js";
12
+ import"./cli-x23me2mg.js";
12
13
  import"./cli-z2zcxes1.js";
13
- import"./cli-bw80ck94.js";
14
- import"./cli-k9m7hetx.js";
14
+ import"./cli-d91pvmq1.js";
15
15
  import"./cli-4j2mrzag.js";
16
- import"./cli-xz9aq0rf.js";
16
+ import"./cli-kk4f9r17.js";
17
+ import"./cli-2mbe7vk0.js";
17
18
  import"./cli-p9swy5t3.js";
18
19
 
19
20
  // src/be/scripts/boot-reembed.ts
@@ -1,16 +1,17 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-wgvn0gs7.js";
5
- import"./cli-hzad20bp.js";
4
+ } from "./cli-t53vnnxz.js";
5
+ import"./cli-4n4mdv21.js";
6
+ import"./cli-x23me2mg.js";
6
7
  import"./cli-z2zcxes1.js";
7
- import"./cli-bw80ck94.js";
8
- import"./cli-k9m7hetx.js";
8
+ import"./cli-d91pvmq1.js";
9
9
  import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
12
12
  } from "./cli-4j2mrzag.js";
13
- import"./cli-xz9aq0rf.js";
13
+ import"./cli-kk4f9r17.js";
14
+ import"./cli-2mbe7vk0.js";
14
15
  import"./cli-p9swy5t3.js";
15
16
 
16
17
  // src/be/boot-scrub-logs.ts
@@ -12,15 +12,33 @@ import {
12
12
  resolveClaudeBinary,
13
13
  resolveClaudeBinaryArgv,
14
14
  resolveClaudeBridgeEnabled
15
- } from "./cli-90q5q9pt.js";
15
+ } from "./cli-7ecgm5v0.js";
16
+ import"./cli-h0457a67.js";
16
17
  import"./cli-psrqtw2m.js";
18
+ import"./cli-mhjnbgb6.js";
19
+ import"./cli-yv9dttkh.js";
17
20
  import"./cli-tng3131n.js";
18
21
  import"./cli-zm7njwzd.js";
19
22
  import"./cli-cw70hymf.js";
20
- import"./cli-e61fs2hp.js";
23
+ import"./cli-v1mwc5v2.js";
24
+ import"./cli-gztgc3hz.js";
25
+ import"./cli-e7d20cty.js";
26
+ import"./cli-8whqavk2.js";
27
+ import"./cli-3dpj7atn.js";
28
+ import"./cli-f14fvzag.js";
29
+ import"./cli-0258203w.js";
21
30
  import"./cli-7zd05xb4.js";
31
+ import"./cli-x23me2mg.js";
22
32
  import"./cli-z2zcxes1.js";
33
+ import"./cli-d91pvmq1.js";
23
34
  import"./cli-4j2mrzag.js";
35
+ import"./cli-kk4f9r17.js";
36
+ import"./cli-2mbe7vk0.js";
37
+ import"./cli-6nh2qxvh.js";
38
+ import"./cli-4wgngmwv.js";
39
+ import"./cli-zyxs93y9.js";
40
+ import"./cli-w10fkrf1.js";
41
+ import"./cli-8wrympd7.js";
24
42
  import"./cli-p9swy5t3.js";
25
43
  export {
26
44
  resolveClaudeBridgeEnabled,
@@ -3,12 +3,12 @@ import {
3
3
  checkClaudeManagedCredentials,
4
4
  composeManagedUserMessage,
5
5
  normalizeRepoUrl
6
- } from "./cli-jj1arm18.js";
6
+ } from "./cli-qmdnhpej.js";
7
7
  import"./cli-07er7wrs.js";
8
- import"./cli-yv9dttkh.js";
9
8
  import"./cli-d6n0thxw.js";
10
- import"./cli-gz9sbyk3.js";
9
+ import"./cli-yv9dttkh.js";
11
10
  import"./cli-cw70hymf.js";
11
+ import"./cli-gz9sbyk3.js";
12
12
  import"./cli-4j2mrzag.js";
13
13
  import"./cli-p9swy5t3.js";
14
14
  export {
@@ -1,10 +1,10 @@
1
- import"./cli-tk9vyqzh.js";
2
1
  import {
3
2
  Anthropic,
4
3
  BadRequestError,
5
4
  ConflictError,
6
5
  toFile
7
6
  } from "./cli-gz9sbyk3.js";
7
+ import"./cli-e7d20cty.js";
8
8
  import {
9
9
  getApiKey
10
10
  } from "./cli-f14fvzag.js";
@@ -1,3 +1,7 @@
1
+ import {
2
+ MAX_PROFILE_FILE_LENGTH,
3
+ init_constants
4
+ } from "./cli-x23me2mg.js";
1
5
  import {
2
6
  init_secret_scrubber,
3
7
  scrubSecrets
@@ -23,11 +27,27 @@ async function readIdentityBaselines(readFile = readFileIfExists) {
23
27
  return null;
24
28
  }
25
29
  }
30
+ function warnProfileFileTooLarge(agentId, field, actualLength, source = "profile-sync") {
31
+ console.warn(`[${source}] Skipping profile sync for agent ${agentId}, field ${field}: ${actualLength} characters exceeds the ${MAX_PROFILE_FILE_LENGTH}-character cap.`);
32
+ }
33
+ async function writeProfileFileFromDb(filePath, dbContent, now = () => new Date) {
34
+ const file = Bun.file(filePath);
35
+ let backupPath = null;
36
+ if (await file.exists()) {
37
+ const localContent = await file.text();
38
+ if (localContent !== dbContent) {
39
+ backupPath = `${filePath}.pre-boot-${now().toISOString()}.bak`;
40
+ await Bun.write(backupPath, localContent);
41
+ }
42
+ }
43
+ await Bun.write(filePath, dbContent);
44
+ return backupPath;
45
+ }
26
46
  function resolveClaudeMdPath(completedProviders) {
27
47
  const anyNonClaude = completedProviders.some((p) => p !== "claude");
28
48
  return anyNonClaude ? WORKSPACE_CLAUDE_MD_PATH : CLAUDE_MD_PATH;
29
49
  }
30
- function extractSetupScriptContent(raw) {
50
+ function extractSetupScriptContent(raw, agentId = "unknown") {
31
51
  if (!raw.trim())
32
52
  return null;
33
53
  const startIdx = raw.indexOf(SETUP_MARKER_START);
@@ -38,15 +58,21 @@ function extractSetupScriptContent(raw) {
38
58
  } else {
39
59
  content = raw.replace(/^#!\/bin\/bash\n/, "").trim();
40
60
  }
41
- if (!content || content.length > MAX_FILE_LENGTH)
61
+ if (!content)
62
+ return null;
63
+ if (content.length > MAX_PROFILE_FILE_LENGTH) {
64
+ warnProfileFileTooLarge(agentId, "setupScript", content.length);
42
65
  return null;
66
+ }
43
67
  return content;
44
68
  }
45
- function buildIdentityPayload(files, baselines) {
69
+ function buildIdentityPayload(files, baselines, agentId = "unknown") {
46
70
  const updates = {};
47
71
  if (files.soulMd !== undefined) {
48
72
  const content = files.soulMd;
49
- if (baselines?.soulMd && contentSha256(content) === baselines.soulMd) {} else if (content.trim() && content.length <= MAX_FILE_LENGTH) {
73
+ if (baselines?.soulMd && contentSha256(content) === baselines.soulMd) {} else if (content.length > MAX_PROFILE_FILE_LENGTH) {
74
+ warnProfileFileTooLarge(agentId, "soulMd", content.length);
75
+ } else if (content.trim()) {
50
76
  if (content.length < IDENTITY_FILE_MIN_LENGTH) {
51
77
  console.error(`[profile-sync] Skipping SOUL.md sync: content too short (${content.length} chars, minimum ${IDENTITY_FILE_MIN_LENGTH}). This prevents accidental profile corruption.`);
52
78
  } else {
@@ -56,7 +82,9 @@ function buildIdentityPayload(files, baselines) {
56
82
  }
57
83
  if (files.identityMd !== undefined) {
58
84
  const content = files.identityMd;
59
- if (baselines?.identityMd && contentSha256(content) === baselines.identityMd) {} else if (content.trim() && content.length <= MAX_FILE_LENGTH) {
85
+ if (baselines?.identityMd && contentSha256(content) === baselines.identityMd) {} else if (content.length > MAX_PROFILE_FILE_LENGTH) {
86
+ warnProfileFileTooLarge(agentId, "identityMd", content.length);
87
+ } else if (content.trim()) {
60
88
  if (content.length < IDENTITY_FILE_MIN_LENGTH) {
61
89
  console.error(`[profile-sync] Skipping IDENTITY.md sync: content too short (${content.length} chars, minimum ${IDENTITY_FILE_MIN_LENGTH}). This prevents accidental profile corruption.`);
62
90
  } else {
@@ -66,13 +94,17 @@ function buildIdentityPayload(files, baselines) {
66
94
  }
67
95
  if (files.toolsMd !== undefined) {
68
96
  const content = files.toolsMd;
69
- if (baselines?.toolsMd && contentSha256(content) === baselines.toolsMd) {} else if (content.trim() && content.length <= MAX_FILE_LENGTH) {
97
+ if (baselines?.toolsMd && contentSha256(content) === baselines.toolsMd) {} else if (content.length > MAX_PROFILE_FILE_LENGTH) {
98
+ warnProfileFileTooLarge(agentId, "toolsMd", content.length);
99
+ } else if (content.trim()) {
70
100
  updates.toolsMd = content;
71
101
  }
72
102
  }
73
103
  if (files.heartbeatMd !== undefined) {
74
104
  const content = files.heartbeatMd;
75
- if (baselines?.heartbeatMd && contentSha256(content) === baselines.heartbeatMd) {} else if (content.length <= MAX_FILE_LENGTH) {
105
+ if (baselines?.heartbeatMd && contentSha256(content) === baselines.heartbeatMd) {} else if (content.length > MAX_PROFILE_FILE_LENGTH) {
106
+ warnProfileFileTooLarge(agentId, "heartbeatMd", content.length);
107
+ } else {
76
108
  updates.heartbeatMd = content;
77
109
  }
78
110
  }
@@ -88,7 +120,7 @@ async function readFileIfExists(path) {
88
120
  return;
89
121
  }
90
122
  }
91
- async function collectProfilePayloads(fields, changeSource, readFile = readFileIfExists, claudeMdPath = CLAUDE_MD_PATH) {
123
+ async function collectProfilePayloads(fields, changeSource, readFile = readFileIfExists, claudeMdPath = CLAUDE_MD_PATH, agentId = "unknown") {
92
124
  const payloads = [];
93
125
  const baselines = changeSource === "session_sync" ? await readIdentityBaselines(readFile) : null;
94
126
  if (fields.includes("identity")) {
@@ -97,14 +129,16 @@ async function collectProfilePayloads(fields, changeSource, readFile = readFileI
97
129
  identityMd: await readFile(IDENTITY_MD_PATH),
98
130
  toolsMd: await readFile(TOOLS_MD_PATH),
99
131
  heartbeatMd: await readFile(HEARTBEAT_MD_PATH)
100
- }, baselines);
132
+ }, baselines, agentId);
101
133
  if (Object.keys(updates).length > 0) {
102
134
  payloads.push({ label: "identity", body: { ...updates, changeSource } });
103
135
  }
104
136
  }
105
137
  if (fields.includes("claude")) {
106
138
  const raw = await readFile(claudeMdPath);
107
- if (raw?.trim() && raw.length <= MAX_FILE_LENGTH) {
139
+ if (raw && raw.length > MAX_PROFILE_FILE_LENGTH) {
140
+ warnProfileFileTooLarge(agentId, "claudeMd", raw.length);
141
+ } else if (raw?.trim()) {
108
142
  if (baselines?.claudeMd && contentSha256(raw) === baselines.claudeMd) {} else {
109
143
  payloads.push({ label: "claude", body: { claudeMd: raw, changeSource } });
110
144
  }
@@ -113,7 +147,7 @@ async function collectProfilePayloads(fields, changeSource, readFile = readFileI
113
147
  if (fields.includes("setup")) {
114
148
  const raw = await readFile(SETUP_SCRIPT_PATH);
115
149
  if (raw !== undefined) {
116
- const content = extractSetupScriptContent(raw);
150
+ const content = extractSetupScriptContent(raw, agentId);
117
151
  if (content !== null) {
118
152
  payloads.push({ label: "setup", body: { setupScript: content, changeSource } });
119
153
  }
@@ -148,15 +182,16 @@ async function postProfileUpdate(opts, payload) {
148
182
  async function syncProfileFilesToServer(opts) {
149
183
  const changeSource = opts.changeSource ?? "session_sync";
150
184
  const fields = opts.fields ?? ["identity", "claude", "setup"];
151
- const payloads = await collectProfilePayloads(fields, changeSource, readFileIfExists, opts.claudeMdPath ?? CLAUDE_MD_PATH);
185
+ const payloads = await collectProfilePayloads(fields, changeSource, readFileIfExists, opts.claudeMdPath ?? CLAUDE_MD_PATH, opts.agentId);
152
186
  for (const payload of payloads) {
153
187
  await postProfileUpdate(opts, payload);
154
188
  }
155
189
  }
156
- var SOUL_MD_PATH = "/workspace/SOUL.md", IDENTITY_MD_PATH = "/workspace/IDENTITY.md", TOOLS_MD_PATH = "/workspace/TOOLS.md", HEARTBEAT_MD_PATH = "/workspace/HEARTBEAT.md", SETUP_SCRIPT_PATH = "/workspace/start-up.sh", IDENTITY_BASELINES_PATH = "/tmp/identity-baselines.json", CLAUDE_MD_PATH, WORKSPACE_CLAUDE_MD_PATH = "/workspace/CLAUDE.md", IDENTITY_FILE_MIN_LENGTH = 500, MAX_FILE_LENGTH = 65536, SETUP_MARKER_START = "# === Agent-managed setup (from DB) ===", SETUP_MARKER_END = "# === End agent-managed setup ===";
190
+ var SOUL_MD_PATH = "/workspace/SOUL.md", IDENTITY_MD_PATH = "/workspace/IDENTITY.md", TOOLS_MD_PATH = "/workspace/TOOLS.md", HEARTBEAT_MD_PATH = "/workspace/HEARTBEAT.md", SETUP_SCRIPT_PATH = "/workspace/start-up.sh", IDENTITY_BASELINES_PATH = "/tmp/identity-baselines.json", CLAUDE_MD_PATH, WORKSPACE_CLAUDE_MD_PATH = "/workspace/CLAUDE.md", IDENTITY_FILE_MIN_LENGTH = 500, SETUP_MARKER_START = "# === Agent-managed setup (from DB) ===", SETUP_MARKER_END = "# === End agent-managed setup ===";
157
191
  var init_profile_sync = __esm(() => {
192
+ init_constants();
158
193
  init_secret_scrubber();
159
194
  CLAUDE_MD_PATH = `${process.env.HOME}/.claude/CLAUDE.md`;
160
195
  });
161
196
 
162
- export { contentSha256, writeIdentityBaselines, readIdentityBaselines, resolveClaudeMdPath, syncProfileFilesToServer, init_profile_sync };
197
+ export { contentSha256, writeIdentityBaselines, readIdentityBaselines, warnProfileFileTooLarge, writeProfileFileFromDb, resolveClaudeMdPath, syncProfileFilesToServer, init_profile_sync };
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-wgvn0gs7.js";
6
+ } from "./cli-t53vnnxz.js";
7
7
 
8
8
  // src/tasks/sibling-awareness.ts
9
9
  init_db();