@desplega.ai/agent-swarm 2.7.9 → 2.8.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 (355) hide show
  1. package/dist/acp-adapter-t949vbbp.js +15 -0
  2. package/dist/{actions-g563mbn2.js → actions-7e9czc7s.js} +19 -19
  3. package/dist/{amp-adapter-q61w05eb.js → amp-adapter-gv6cbb7d.js} +2 -3
  4. package/dist/app-b9fbkp9v.js +20 -0
  5. package/dist/{assistant-p477rjwj.js → assistant-wjb7v4c7.js} +22 -22
  6. package/dist/{boot-args-schema-h4qj462e.js → boot-args-schema-2t37e0fe.js} +1 -1
  7. package/dist/{boot-reembed-n1ehfbsw.js → boot-reembed-a35nkyr1.js} +1 -1
  8. package/dist/{boot-reembed-qw4mc0pt.js → boot-reembed-gka3zas7.js} +1 -1
  9. package/dist/{boot-scrub-sweep-9w9jp4sm.js → boot-scrub-sweep-65sdnp6c.js} +3 -3
  10. package/dist/{boot-seeds-qdaf3sdy.js → boot-seeds-x42tzytw.js} +4 -5
  11. package/dist/{claude-adapter-348p5hx9.js → claude-adapter-v221b2fd.js} +7 -8
  12. package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-29eq09wd.js} +2 -2
  13. package/dist/{claude-managed-setup-7787fxtp.js → claude-managed-setup-9m6450zk.js} +2 -2
  14. package/dist/{claude-sdk-session-hbszbt8a.js → claude-sdk-session-0q0ptaba.js} +9066 -8818
  15. package/dist/{cli-n5yexkdg.js → cli-0b4zam62.js} +1 -0
  16. package/dist/{cli-21159vea.js → cli-0jzra9ad.js} +2 -2
  17. package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
  18. package/dist/{cli-k70e3x9e.js → cli-2wnq8jkz.js} +9 -9
  19. package/dist/{cli-cvs2r2vq.js → cli-2zp0et3v.js} +59 -6
  20. package/dist/{cli-650zv9q9.js → cli-334z18y3.js} +4 -4
  21. package/dist/{cli-12xyjhws.js → cli-3rkdne1h.js} +2 -2
  22. package/dist/{cli-2a8py3sx.js → cli-4txa0ter.js} +5 -7
  23. package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
  24. package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
  25. package/dist/{cli-v3cf1ts9.js → cli-6t09sdhy.js} +3 -3
  26. package/dist/{cli-qzt90yze.js → cli-6wxjceza.js} +8 -8
  27. package/dist/{cli-9aezs55w.js → cli-7b8sbmag.js} +8 -8
  28. package/dist/{cli-3xj33nrx.js → cli-7cp6aa1q.js} +10 -3
  29. package/dist/{cli-jfx48xrj.js → cli-7p1kvkck.js} +6 -6
  30. package/dist/{cli-b932gexn.js → cli-8aes17e4.js} +2 -2
  31. package/dist/{cli-3tqcamp6.js → cli-8fknbnhw.js} +14 -13
  32. package/dist/{cli-587857ys.js → cli-8kzasymh.js} +3 -3
  33. package/dist/{cli-sgs5k6yd.js → cli-a7wvp2km.js} +1 -1
  34. package/dist/{cli-varqt4d1.js → cli-abejgen1.js} +69 -22
  35. package/dist/{cli-rwymrnaz.js → cli-bsywb58a.js} +8 -8
  36. package/dist/{cli-btc9cb4c.js → cli-c55z5chy.js} +4 -6
  37. package/dist/{cli-ms5m5r1y.js → cli-deefvewm.js} +1 -1
  38. package/dist/{cli-p17970qv.js → cli-ee0b971j.js} +3 -3
  39. package/dist/cli-f3vq58d2.js +242 -0
  40. package/dist/{cli-3xcwp3z8.js → cli-ffhtssbp.js} +2 -2
  41. package/dist/{cli-hwprv9e4.js → cli-g70vxtjh.js} +2 -2
  42. package/dist/{cli-4t0fmf3z.js → cli-gxkx0zzp.js} +1 -1
  43. package/dist/{cli-neyag5p6.js → cli-h38x262p.js} +3365 -429
  44. package/dist/{cli-2ccpqyyf.js → cli-j790gp2w.js} +105 -22
  45. package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
  46. package/dist/{cli-vxh6acp7.js → cli-m23zjcy2.js} +10 -10
  47. package/dist/{cli-y8nbefpb.js → cli-m28atx8q.js} +12 -10
  48. package/dist/{cli-serm8zrx.js → cli-m4dqmnbp.js} +1 -1
  49. package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
  50. package/dist/{cli-y5rbvxhc.js → cli-n515ex5z.js} +14 -14
  51. package/dist/{cli-ypff1qwp.js → cli-n9ftpys4.js} +7 -7
  52. package/dist/{cli-605nn699.js → cli-p1bq50aa.js} +894 -226
  53. package/dist/{cli-qkdmz8c8.js → cli-p1w18yhx.js} +1 -1
  54. package/dist/{cli-xk879m3k.js → cli-p2gfst4m.js} +52 -43
  55. package/dist/{cli-sya22y84.js → cli-pasjcnmj.js} +12 -12
  56. package/dist/{cli-0whpms1z.js → cli-qa4wdgsy.js} +5 -5
  57. package/dist/{cli-ejkvvqbe.js → cli-qfedvmcr.js} +50 -24
  58. package/dist/{cli-tqq0hspb.js → cli-qmqk2yc2.js} +1 -1
  59. package/dist/{cli-qmd3mse0.js → cli-qsnnd04k.js} +1 -1
  60. package/dist/{cli-agyaeef4.js → cli-qwca7s44.js} +3 -3
  61. package/dist/{cli-fayav105.js → cli-rfywm85n.js} +724 -792
  62. package/dist/{cli-zgv8gxgs.js → cli-rmmpt0wm.js} +6 -6
  63. package/dist/{cli-hae9j8sv.js → cli-rzsy6nc6.js} +12 -8
  64. package/dist/{cli-btf6fw39.js → cli-s7t6p9my.js} +1 -1
  65. package/dist/{cli-cseh6f8w.js → cli-sdtt3men.js} +1 -1
  66. package/dist/{cli-9r5gtwjr.js → cli-tk7cjj8h.js} +197 -2
  67. package/dist/{cli-q26b9wre.js → cli-tph5wt3y.js} +4 -4
  68. package/dist/{cli-gce09r66.js → cli-tqegb8eq.js} +3 -3
  69. package/dist/{cli-kf3pxxdg.js → cli-v1dv1r37.js} +1 -1
  70. package/dist/{cli-09kmfkmq.js → cli-wcg8x116.js} +1 -1
  71. package/dist/{cli-mnrkgg60.js → cli-wk18cm92.js} +5 -5
  72. package/dist/{cli-p0m0p34z.js → cli-x1wa213s.js} +3 -3
  73. package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
  74. package/dist/{cli-715t1gx6.js → cli-y97qxcfx.js} +9 -9
  75. package/dist/{cli-bc779n4v.js → cli-yq3zak69.js} +1 -1
  76. package/dist/cli.js +17 -17
  77. package/dist/{codex-adapter-ysq6bzha.js → codex-adapter-30j9bpzd.js} +5 -6
  78. package/dist/{codex-hook-fac6175r.js → codex-hook-h3vk6xzr.js} +1 -1
  79. package/dist/{codex-session-runner-qakzfx93.js → codex-session-runner-8vp57v8w.js} +5 -6
  80. package/dist/{commands-rs7hkv9r.js → commands-bngnz9g7.js} +3 -3
  81. package/dist/{controller-r5x9bg6e.js → controller-hxx8wwy1.js} +2 -2
  82. package/dist/{controllers-connect-498hrxvk.js → controllers-connect-e2b4gyxc.js} +20 -20
  83. package/dist/{cursor-adapter-d46qszer.js → cursor-adapter-n5nc3mfe.js} +1 -2
  84. package/dist/{db-s13dqhr6.js → db-bgm7vkc0.js} +3 -3
  85. package/dist/{db-pm96nhdb.js → db-c6np41ca.js} +12 -2
  86. package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
  87. package/dist/{dispatcher-j3h81t7m.js → dispatcher-jnybck15.js} +18 -18
  88. package/dist/{dsh-adapter-rw0d5rc4.js → dsh-adapter-nrhbrjz8.js} +1 -2
  89. package/dist/{easter-egg-3d-qtgfxgze.js → easter-egg-3d-533knw22.js} +1 -1
  90. package/dist/{embedding-space-xh8p4q4x.js → embedding-space-crsm2zp0.js} +6 -6
  91. package/dist/{embeddings-wp745m91.js → embeddings-e7z3f27f.js} +1 -1
  92. package/dist/{execute-2fzb9z74.js → execute-b3mrb1mv.js} +1 -1
  93. package/dist/{external-channel-ys21h3sy.js → external-channel-m77wf5z3.js} +2 -2
  94. package/dist/{fx-adapter-vz0b9z3g.js → fx-adapter-b6w0kf56.js} +7 -8
  95. package/dist/{google-generative-ai-ytpgncx9.js → google-generative-ai-h7s3e9kk.js} +1 -1
  96. package/dist/{google-vertex-tqhze5j7.js → google-vertex-fhxaafzw.js} +1 -1
  97. package/dist/{grok-adapter-spea7zkj.js → grok-adapter-4sqtebdk.js} +7 -8
  98. package/dist/handlers-kdjcyzdj.js +32 -0
  99. package/dist/heartbeat-xgb036sx.js +43 -0
  100. package/dist/{hook-amcj4s10.js → hook-5h02c9ga.js} +6 -6
  101. package/dist/{hook-bc6n49qn.js → hook-xsk1jbha.js} +5 -5
  102. package/dist/{http-7374brv5.js → http-txe7qhvn.js} +448 -165
  103. package/dist/{index-pxn30mse.js → index-0eny15vj.js} +8 -8
  104. package/dist/{index-5a9jtqde.js → index-0rvk3vd4.js} +46 -46
  105. package/dist/{index-fvzke5kx.js → index-1qw6f2dc.js} +10 -10
  106. package/dist/{index-q5cmtbz5.js → index-4a0670yh.js} +15939 -14244
  107. package/dist/index-835xdgnm.js +33 -0
  108. package/dist/index-d469300x.js +37 -0
  109. package/dist/{index-h7f61sy9.js → index-e5pfbsys.js} +3 -3
  110. package/dist/{index-hsad2t3r.js → index-m5gx1xd6.js} +38 -38
  111. package/dist/{index-5fx3b3kw.js → index-rvccek1w.js} +9 -9
  112. package/dist/index-rzqwp11g.js +32 -0
  113. package/dist/{index-w4m9z29z.js → index-tvfafeyy.js} +1 -1
  114. package/dist/{index-c9y31ytf.js → index-vk63emp7.js} +979 -35
  115. package/dist/{index-514d9pf6.js → index-w7em4ktq.js} +8 -8
  116. package/dist/{index-p4hjwbvw.js → index-ysvbhg5m.js} +1 -1
  117. package/dist/{keepalive-wy29kbrg.js → keepalive-4zsrce78.js} +3 -3
  118. package/dist/lead-yqt47dkr.js +70 -0
  119. package/dist/{maintenance-h2ds9w6c.js → maintenance-86jvartk.js} +1 -1
  120. package/dist/{oauth-refresh-sweep-q7mtbyp3.js → oauth-refresh-sweep-j52kg9pr.js} +2 -2
  121. package/dist/{onboard-vw8r2fdw.js → onboard-c2aj5p8q.js} +3 -3
  122. package/dist/{opencode-adapter-mtb0953j.js → opencode-adapter-dsagkhtw.js} +5 -6
  123. package/dist/{otel-impl-j42czw3r.js → otel-impl-yyy203z8.js} +1 -1
  124. package/dist/{pi-mono-adapter-zk8pg9jr.js → pi-mono-adapter-546cd1cc.js} +9 -9
  125. package/dist/{pricing-refresh-x7nhv23d.js → pricing-refresh-1rgzqyzz.js} +2 -3
  126. package/dist/{rbac-roles-9044425x.js → rbac-roles-e70xfeyj.js} +4 -6
  127. package/dist/{rbac-roles-bzvee6cf.js → rbac-roles-q89qe8er.js} +3 -3
  128. package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
  129. package/dist/{render-v2-t7bn4skz.js → render-v2-k6tt107q.js} +9 -4
  130. package/dist/{resume-x94gemep.js → resume-cnnrjfxa.js} +6 -6
  131. package/dist/{runtime-breq6fmv.js → runtime-1hv06jsn.js} +1 -1
  132. package/dist/{session-access-q7dmqjvt.js → session-access-xkxkjw3n.js} +4 -4
  133. package/dist/{session-source-backfill-440ysamr.js → session-source-backfill-1d5pdwww.js} +2 -2
  134. package/dist/{setup-07n4727s.js → setup-se8q7gkc.js} +1 -1
  135. package/dist/{virtual-modules-z5h6mcyf.js → virtual-modules-gazyapte.js} +3 -3
  136. package/dist/{work-objects-pnq5y534.js → work-objects-1kxnbzy5.js} +22 -22
  137. package/dist/{worker-follow-up-7z1gfkr8.js → worker-follow-up-zqm8apt4.js} +18 -18
  138. package/dist/worker-j6xxtq7p.js +70 -0
  139. package/openapi.json +334 -7
  140. package/package.json +4 -4
  141. package/src/apps/catalog.generated.json +55 -0
  142. package/src/apps/definition.ts +11 -0
  143. package/src/apps/page-validator.ts +19 -0
  144. package/src/apps/store.ts +28 -8
  145. package/src/assets/key.ts +77 -4
  146. package/src/be/db/model-profiles.ts +147 -38
  147. package/src/be/db/session-labels.ts +57 -0
  148. package/src/be/db/session-tree.ts +51 -7
  149. package/src/be/db/slack-trees.ts +146 -0
  150. package/src/be/db/tasks/read.ts +107 -8
  151. package/src/be/db/workflow-run-definitions.ts +117 -0
  152. package/src/be/db-client.ts +8 -2
  153. package/src/be/db.ts +119 -87
  154. package/src/be/event-loop-lag.ts +146 -0
  155. package/src/be/mcp-overflow-sweep.ts +2 -1
  156. package/src/be/memory/constants.ts +14 -1
  157. package/src/be/memory/key-paths.ts +8 -0
  158. package/src/be/memory/providers/sqlite-store.ts +199 -18
  159. package/src/be/memory/task-learning.ts +79 -14
  160. package/src/be/memory/types.ts +24 -1
  161. package/src/be/migrations/278_slack_render_v2_reconcile.sql +108 -0
  162. package/src/be/migrations/279_backfill_learning_expiry.sql +15 -0
  163. package/src/be/migrations/281_model_profiles_pr2.sql +28 -0
  164. package/src/be/migrations/283_workflow_run_definitions.sql +14 -0
  165. package/src/be/model-profile-check.ts +284 -0
  166. package/src/be/model-tier-resolution.ts +112 -12
  167. package/src/be/multi-runtime.ts +27 -0
  168. package/src/be/runtime-pools/routing.ts +52 -4
  169. package/src/be/scripts/typecheck.ts +1 -0
  170. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +552 -0
  171. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +389 -14
  172. package/src/be/seed-scripts/catalog/dreaming-memtax.ts +6 -3
  173. package/src/be/seed-scripts/index.ts +9 -0
  174. package/src/be/steering.ts +8 -2
  175. package/src/be/swarm-config-guard.ts +2 -0
  176. package/src/commands/context-preamble.ts +258 -0
  177. package/src/commands/onboard/agent-fs-version.ts +1 -1
  178. package/src/commands/runner.ts +32 -1
  179. package/src/extensions/catalog.generated.json +3 -3
  180. package/src/fs/provider.ts +17 -3
  181. package/src/heartbeat/heartbeat.ts +17 -5
  182. package/src/heartbeat/index.ts +1 -0
  183. package/src/http/agents.ts +56 -4
  184. package/src/http/apps.ts +3 -1
  185. package/src/http/config.ts +2 -6
  186. package/src/http/core.ts +9 -3
  187. package/src/http/index.ts +12 -9
  188. package/src/http/memory.ts +9 -4
  189. package/src/http/model-profiles.ts +58 -10
  190. package/src/http/poll.ts +36 -3
  191. package/src/http/schedules.ts +42 -3
  192. package/src/http/sessions.ts +16 -3
  193. package/src/http/tasks.ts +37 -12
  194. package/src/http/utils.ts +18 -0
  195. package/src/http/webhooks.ts +48 -0
  196. package/src/http/workflows.ts +15 -2
  197. package/src/integrations/chat-sdk/commands.ts +167 -31
  198. package/src/integrations/chat-sdk/inbound.ts +10 -8
  199. package/src/integrations/chat-sdk/message-text.ts +117 -0
  200. package/src/prompts/session-templates.ts +1 -1
  201. package/src/providers/acp-targets.ts +11 -6
  202. package/src/providers/amp-adapter.ts +1 -1
  203. package/src/providers/claude-sdk-session.ts +132 -23
  204. package/src/providers/codex-skill-resolver.ts +10 -4
  205. package/src/providers/cursor-adapter.ts +1 -1
  206. package/src/providers/devin-skill-resolver.ts +5 -5
  207. package/src/providers/dsh-adapter.ts +1 -1
  208. package/src/scheduler/schedule-task.ts +1 -0
  209. package/src/scheduler/scheduler.ts +4 -1
  210. package/src/scripts-runtime/executors/quickjs-runner.ts +2 -0
  211. package/src/scripts-runtime/executors/quickjs-structured-clone.ts +180 -0
  212. package/src/scripts-runtime/quickjs-compat.ts +0 -1
  213. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  214. package/src/scripts-runtime/swarm-sdk.ts +18 -1
  215. package/src/scripts-runtime/types/stdlib.d.ts +1 -0
  216. package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
  217. package/src/server.ts +2 -0
  218. package/src/slack/app.ts +425 -10
  219. package/src/slack/handlers.ts +9 -2
  220. package/src/slack/inbound-dispatch.ts +18 -1
  221. package/src/slack/index.ts +7 -1
  222. package/src/slack/lifecycle-lock.ts +29 -0
  223. package/src/slack/render-v2.ts +424 -212
  224. package/src/slack/socket-fence.ts +64 -0
  225. package/src/slack/watcher.ts +42 -8
  226. package/src/slack/workspace-guard.ts +345 -0
  227. package/src/tasks/task-terminal-effects.ts +4 -0
  228. package/src/tasks/worker-follow-up.ts +102 -2
  229. package/src/tests/acp-adapter.test.ts +82 -0
  230. package/src/tests/apps-icon.test.ts +120 -0
  231. package/src/tests/apps-schema-form.test.ts +151 -0
  232. package/src/tests/chained-task-follow-up.test.ts +248 -0
  233. package/src/tests/chat-sdk-commands.test.ts +359 -2
  234. package/src/tests/chat-sdk-inbound.test.ts +20 -0
  235. package/src/tests/chat-sdk-slack.test.ts +189 -1
  236. package/src/tests/check-pr-body.test.ts +40 -0
  237. package/src/tests/claude-sdk-lifecycle.test.ts +216 -1
  238. package/src/tests/claude-sdk-process.fixture.ts +57 -0
  239. package/src/tests/codex-skill-resolver.test.ts +31 -0
  240. package/src/tests/credentials-allowlist.test.ts +470 -0
  241. package/src/tests/db-client-busy-retry.test.ts +69 -18
  242. package/src/tests/db-client.test.ts +26 -1
  243. package/src/tests/db-task-read-contract.test.ts +7 -0
  244. package/src/tests/db-task-write-contract.test.ts +6 -0
  245. package/src/tests/deferred-wake-follow-up.test.ts +47 -0
  246. package/src/tests/docs-index-footprint.test.js +3 -3
  247. package/src/tests/dreaming-learnings.test.ts +1395 -0
  248. package/src/tests/dsh-adapter.test.ts +1 -1
  249. package/src/tests/event-loop-lag.test.ts +184 -0
  250. package/src/tests/explicit-model-validation.test.ts +2 -0
  251. package/src/tests/extensions-example-comms-adherence-gate.test.ts +115 -0
  252. package/src/tests/fs-provider.test.ts +42 -0
  253. package/src/tests/github-webhook-early-ack.test.ts +144 -0
  254. package/src/tests/heartbeat.test.ts +28 -1
  255. package/src/tests/http-api-integration.test.ts +2 -0
  256. package/src/tests/http-log-scrubbing.test.ts +68 -2
  257. package/src/tests/human-free-reclassify.test.ts +5 -1
  258. package/src/tests/kv-storage.test.ts +92 -1
  259. package/src/tests/list-endpoint-slimming.test.ts +17 -0
  260. package/src/tests/memory-key-paths.test.ts +57 -0
  261. package/src/tests/memory-retrieval-purge.test.ts +19 -0
  262. package/src/tests/migration-283-workflow-run-definitions.test.ts +69 -0
  263. package/src/tests/model-profile-check.test.ts +387 -0
  264. package/src/tests/model-profiles-api.test.ts +528 -1
  265. package/src/tests/profile-claim.test.ts +415 -3
  266. package/src/tests/profile-tier-alias.test.ts +382 -0
  267. package/src/tests/quickjs-compat.test.ts +1 -1
  268. package/src/tests/runner-context-preamble.test.ts +552 -0
  269. package/src/tests/schedule-profile.test.ts +359 -0
  270. package/src/tests/script-connections.test.ts +9 -0
  271. package/src/tests/script-executor-conformance.test.ts +188 -0
  272. package/src/tests/script-per-script-executor.test.ts +1 -0
  273. package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +141 -0
  274. package/src/tests/seed-scripts.test.ts +2 -2
  275. package/src/tests/sessions-tree.test.ts +133 -2
  276. package/src/tests/slack-app-icon.test.ts +4 -0
  277. package/src/tests/slack-dm-implicit-mention.test.ts +236 -0
  278. package/src/tests/slack-file-tools-attachments.test.ts +1 -0
  279. package/src/tests/slack-inbound-receipts.test.ts +22 -2
  280. package/src/tests/slack-read-boundaries.test.ts +4 -3
  281. package/src/tests/slack-render-v2-query-plans.test.ts +262 -3
  282. package/src/tests/slack-render-v2-reconcile.test.ts +201 -0
  283. package/src/tests/slack-socket-ack.test.ts +16 -1
  284. package/src/tests/slack-socket-watchdog.test.ts +748 -0
  285. package/src/tests/slack-workspace-guard.test.ts +905 -0
  286. package/src/tests/steering-core.test.ts +40 -0
  287. package/src/tests/store-progress-learning.test.ts +605 -20
  288. package/src/tests/tool-annotations.test.ts +1 -1
  289. package/src/tests/vcs-identity-inheritance.test.ts +85 -0
  290. package/src/tests/workflow-convergence.test.ts +46 -40
  291. package/src/tests/workflow-definition-pinning-recovery.test.ts +552 -0
  292. package/src/tests/workflow-definition-pinning.test.ts +645 -0
  293. package/src/tests/workflow-executors.test.ts +16 -7
  294. package/src/tests/workflow-foreach.test.ts +43 -20
  295. package/src/tests/workflow-notify-slack-ready.test.ts +161 -0
  296. package/src/tests/workflow-profile.test.ts +328 -0
  297. package/src/tools/app-upsert.ts +1 -1
  298. package/src/tools/memory-edit.ts +2 -1
  299. package/src/tools/model-profiles/check-model-profile.ts +63 -0
  300. package/src/tools/schedules/create-schedule.ts +45 -4
  301. package/src/tools/schedules/patch-schedule.ts +50 -4
  302. package/src/tools/schedules/update-schedule.ts +50 -4
  303. package/src/tools/send-task.ts +17 -2
  304. package/src/tools/store-progress.ts +15 -3
  305. package/src/tools/task-action.ts +9 -1
  306. package/src/tools/templates.ts +13 -0
  307. package/src/tools/tool-config.ts +2 -1
  308. package/src/tools/utils.ts +77 -11
  309. package/src/tools/workflows/create-workflow.ts +1 -1
  310. package/src/tools/workflows/retry-workflow-run.ts +1 -1
  311. package/src/tools/workflows/update-workflow.ts +10 -1
  312. package/src/types.ts +56 -1
  313. package/src/utils/credentials.ts +89 -12
  314. package/src/workflows/engine.ts +10 -1
  315. package/src/workflows/executors/agent-task.ts +21 -2
  316. package/src/workflows/executors/foreach.ts +4 -1
  317. package/src/workflows/executors/notify.ts +62 -6
  318. package/src/workflows/executors/sub-workflow.ts +1 -1
  319. package/src/workflows/executors/swarm-script.ts +4 -1
  320. package/src/workflows/foreach-driver.ts +8 -5
  321. package/src/workflows/limits.ts +2 -1
  322. package/src/workflows/model-validation.ts +27 -2
  323. package/src/workflows/patch-definition.ts +3 -1
  324. package/src/workflows/recovery.ts +6 -6
  325. package/src/workflows/resume.ts +9 -9
  326. package/src/workflows/retry-poller.ts +2 -2
  327. package/templates/extensions/comms-adherence-gate/README.md +25 -0
  328. package/templates/extensions/comms-adherence-gate/hooks.ts +100 -11
  329. package/templates/extensions/comms-adherence-gate/manifest.json +1 -1
  330. package/templates/skills/apps/SKILL.md +9 -0
  331. package/templates/skills/apps/content.md +9 -0
  332. package/templates/skills/code-quality/content.md +12 -0
  333. package/templates/skills/memory/content.md +8 -0
  334. package/templates/skills/scheduling/config.json +1 -1
  335. package/templates/skills/scheduling/content.md +2 -2
  336. package/templates/skills/swarm-docs/content.md +4 -0
  337. package/templates/skills/swarm-extensions/content.md +1 -1
  338. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  339. package/templates/skills/swarm-scripts/content.md +1 -1
  340. package/templates/skills/work-on-task/SKILL.md +2 -0
  341. package/templates/skills/work-on-task/content.md +2 -0
  342. package/templates/workflows/dreaming/content.md +174 -7
  343. package/dist/acp-adapter-dn4gdsgr.js +0 -16
  344. package/dist/app-a66ssc4k.js +0 -17
  345. package/dist/cli-530hkwdy.js +0 -779
  346. package/dist/cli-a0657jmf.js +0 -339
  347. package/dist/cli-cyn9v8zr.js +0 -748
  348. package/dist/handlers-crckt5dq.js +0 -32
  349. package/dist/heartbeat-8phn1kdq.js +0 -41
  350. package/dist/index-4x08sjtk.js +0 -30
  351. package/dist/index-8ybffts4.js +0 -37
  352. package/dist/index-nfy4kkg5.js +0 -33
  353. package/dist/lead-zdqxsvjn.js +0 -71
  354. package/dist/worker-y62rvvq3.js +0 -71
  355. package/dist/{cli-gxy8y1dt.js → cli-8bpgbr8k.js} +3 -3
@@ -1,748 +0,0 @@
1
- import {
2
- init_zod
3
- } from "./cli-zcfpsfzf.js";
4
- import {
5
- _enum2
6
- } from "./cli-hg42n3hx.js";
7
- import {
8
- isEnvFlagEnabled,
9
- init_env_flag
10
- } from "./cli-cebvbc9t.js";
11
- import {
12
- __esm
13
- } from "./cli-242037k3.js";
14
-
15
- // src/rbac/admission.ts
16
- function grantedVerb(rbac, grant) {
17
- return [rbac.permission, ...rbac.alsoAdmits ?? []].find((verb) => grant.verbs.has(verb));
18
- }
19
- function isRbacEnabled() {
20
- return isEnvFlagEnabled("RBAC_ENABLED", true);
21
- }
22
- function decideAdmission(input) {
23
- if (input.grant.grantsAll) {
24
- return { allow: true };
25
- }
26
- if (input.rbac && "permission" in input.rbac) {
27
- const granted = grantedVerb(input.rbac, input.grant);
28
- if (granted) {
29
- return { allow: true, verb: granted };
30
- }
31
- const verb = input.rbac.permission;
32
- return { allow: false, reason: `admission: missing permission '${verb}'`, verb };
33
- }
34
- const method = input.method.toUpperCase();
35
- if (method === "GET" || method === "HEAD") {
36
- return { allow: true };
37
- }
38
- return { allow: false, reason: "admission: route has no permission verb (operator-only)" };
39
- }
40
- function decideToolAdmission(input) {
41
- if (input.grant.grantsAll) {
42
- return { allow: true };
43
- }
44
- if (input.rbac && "permission" in input.rbac) {
45
- const granted = grantedVerb(input.rbac, input.grant);
46
- if (granted) {
47
- return { allow: true, verb: granted };
48
- }
49
- const verb = input.rbac.permission;
50
- return { allow: false, reason: `admission: missing permission '${verb}'`, verb };
51
- }
52
- if (input.readOnly) {
53
- return { allow: true };
54
- }
55
- return { allow: false, reason: "admission: tool has no permission verb (operator-only)" };
56
- }
57
- var init_admission = __esm(() => {
58
- init_env_flag();
59
- });
60
-
61
- // src/rbac/elevated-agents.ts
62
- function grantLeadEquivalence(agentId) {
63
- leadEquivalentAgentIds.add(agentId);
64
- }
65
- function revokeLeadEquivalence(agentId) {
66
- leadEquivalentAgentIds.delete(agentId);
67
- }
68
- function hasLeadEquivalence(agentId) {
69
- return !!agentId && leadEquivalentAgentIds.has(agentId);
70
- }
71
- var leadEquivalentAgentIds;
72
- var init_elevated_agents = __esm(() => {
73
- leadEquivalentAgentIds = new Set;
74
- });
75
-
76
- // src/rbac/legacy-policy.ts
77
- function actsAsLead(principal) {
78
- return principal.kind === "agent" && (principal.isLead || hasLeadEquivalence(principal.agentId));
79
- }
80
- var leadOnly, operatorOrUser, operatorOnly, leadOrOperatorOrUser, leadOrOperator, agentOrOperator, extensionWrite, extensionActivation, leadOrTaskCreator, leadOrResourceOwner, humanOrLeadOrResourceOwner, leadOrOwnNamespace, anyAuthenticated, requesterOwnsTask, memoryDelete, taskFsMutate, taskProgressWrite, LEGACY_RULES, LEGACY_POLICY;
81
- var init_legacy_policy = __esm(() => {
82
- init_env_flag();
83
- init_elevated_agents();
84
- leadOnly = {
85
- name: "lead-only",
86
- denyReason: "requires lead agent",
87
- evaluate: (principal) => actsAsLead(principal)
88
- };
89
- operatorOrUser = {
90
- name: "operator-or-user",
91
- denyReason: "requires operator or user authentication",
92
- evaluate: (principal) => principal.kind === "operator" || principal.kind === "user"
93
- };
94
- operatorOnly = {
95
- name: "operator-only",
96
- denyReason: "requires operator authentication",
97
- evaluate: (principal) => principal.kind === "operator"
98
- };
99
- leadOrOperatorOrUser = {
100
- name: "lead-or-operator-or-user",
101
- denyReason: "requires lead agent, operator, or user authentication",
102
- evaluate: (principal) => principal.kind === "operator" || principal.kind === "user" || actsAsLead(principal)
103
- };
104
- leadOrOperator = {
105
- name: "lead-or-operator",
106
- denyReason: "requires lead agent or operator authentication",
107
- evaluate: (principal) => principal.kind === "operator" || actsAsLead(principal)
108
- };
109
- agentOrOperator = {
110
- name: "agent-or-operator",
111
- denyReason: "requires a registered agent or operator authentication",
112
- evaluate: (principal) => principal.kind === "operator" || principal.kind === "agent" && principal.agentId !== ""
113
- };
114
- extensionWrite = {
115
- name: "extension-owner-or-elevated",
116
- denyReason: "requires extension owner, lead agent, operator, or user authentication",
117
- evaluate: (principal, resource) => {
118
- if (leadOrOperatorOrUser.evaluate(principal, resource))
119
- return true;
120
- return principal.kind === "agent" && principal.agentId !== "" && resource?.kind === "extension" && (resource.extensionId === undefined || resource.createdByAgentId === principal.agentId);
121
- }
122
- };
123
- extensionActivation = {
124
- name: "extension-activation",
125
- denyReason: "requires operator/user authentication, or a lead with EXTENSION_ALLOW_LEAD_ACTIVATION enabled",
126
- evaluate: (principal) => principal.kind === "operator" || principal.kind === "user" || actsAsLead(principal) && isEnvFlagEnabled("EXTENSION_ALLOW_LEAD_ACTIVATION", true)
127
- };
128
- leadOrTaskCreator = {
129
- name: "lead-or-task-creator",
130
- denyReason: "requires lead agent or task creator",
131
- evaluate: (principal, resource) => {
132
- if (principal.kind !== "agent")
133
- return false;
134
- if (actsAsLead(principal))
135
- return true;
136
- return resource?.kind === "task" && resource.creatorAgentId != null && resource.creatorAgentId === principal.agentId;
137
- }
138
- };
139
- leadOrResourceOwner = {
140
- name: "lead-or-resource-owner",
141
- denyReason: "requires lead agent or resource owner",
142
- evaluate: (principal, resource) => {
143
- if (principal.kind !== "agent")
144
- return false;
145
- if (actsAsLead(principal))
146
- return true;
147
- return resource?.kind === "owned" && resource.ownerAgentId != null && resource.ownerAgentId === principal.agentId;
148
- }
149
- };
150
- humanOrLeadOrResourceOwner = {
151
- name: "human-or-lead-or-resource-owner",
152
- denyReason: "requires a human, the operator, a lead agent, or the resource owner",
153
- evaluate: (principal, resource) => {
154
- if (principal.kind === "operator" || principal.kind === "user")
155
- return true;
156
- if (actsAsLead(principal))
157
- return true;
158
- return resource?.kind === "owned" && resource.ownerAgentId != null && resource.ownerAgentId === principal.agentId;
159
- }
160
- };
161
- leadOrOwnNamespace = {
162
- name: "lead-or-own-namespace",
163
- denyReason: "requires lead agent or your own task:agent: namespace",
164
- evaluate: (principal, resource) => {
165
- if (principal.kind !== "agent")
166
- return false;
167
- if (actsAsLead(principal))
168
- return true;
169
- return principal.agentId !== "" && resource?.kind === "kv-namespace" && resource.namespace === `task:agent:${principal.agentId}`;
170
- }
171
- };
172
- anyAuthenticated = {
173
- name: "any-authenticated",
174
- denyReason: "requires an authenticated principal",
175
- evaluate: () => true
176
- };
177
- requesterOwnsTask = {
178
- name: "requester-owns-task",
179
- denyReason: "not the task requester",
180
- evaluate: (principal, resource) => {
181
- if (principal.kind !== "user")
182
- return true;
183
- return resource?.kind === "task" && resource.requestedByUserId === principal.userId;
184
- }
185
- };
186
- memoryDelete = {
187
- name: "memory-delete",
188
- denyReason: "requires operator or user, the lead for swarm-scoped memories, or the owner for agent-scoped memories",
189
- evaluate: (principal, resource) => {
190
- if (principal.kind === "operator" || principal.kind === "user")
191
- return true;
192
- if (resource?.kind !== "owned")
193
- return false;
194
- const isOwner = principal.agentId !== "" && resource.ownerAgentId != null && resource.ownerAgentId === principal.agentId;
195
- if (actsAsLead(principal))
196
- return isOwner || resource.scope === "swarm";
197
- return isOwner && resource.scope === "agent";
198
- }
199
- };
200
- taskFsMutate = {
201
- name: "operator-or-user-or-lead-or-task-owner",
202
- denyReason: "requires operator, user, lead agent, task assignee, or task creator",
203
- evaluate: (principal, resource) => {
204
- if (principal.kind === "operator" || principal.kind === "user")
205
- return true;
206
- if (actsAsLead(principal))
207
- return true;
208
- if (resource?.kind !== "task")
209
- return false;
210
- return resource.agentId != null && resource.agentId === principal.agentId || resource.creatorAgentId != null && resource.creatorAgentId === principal.agentId;
211
- }
212
- };
213
- taskProgressWrite = {
214
- name: "operator-or-user-or-lead-or-task-assignee",
215
- denyReason: "requires operator, user, lead agent, or task assignee",
216
- evaluate: (principal, resource) => {
217
- if (principal.kind === "operator" || principal.kind === "user")
218
- return true;
219
- if (actsAsLead(principal))
220
- return true;
221
- if (resource?.kind !== "task")
222
- return false;
223
- return resource.agentId == null || resource.agentId === principal.agentId;
224
- }
225
- };
226
- LEGACY_RULES = {
227
- "operator-or-user": operatorOrUser,
228
- "lead-or-operator-or-user": leadOrOperatorOrUser,
229
- "lead-or-operator": leadOrOperator,
230
- "agent-or-operator": agentOrOperator,
231
- "lead-only": leadOnly,
232
- "lead-or-task-creator": leadOrTaskCreator,
233
- "lead-or-resource-owner": leadOrResourceOwner,
234
- "human-or-lead-or-resource-owner": humanOrLeadOrResourceOwner,
235
- "lead-or-own-namespace": leadOrOwnNamespace,
236
- "any-authenticated": anyAuthenticated,
237
- "requester-owns-task": requesterOwnsTask
238
- };
239
- LEGACY_POLICY = {
240
- "user.manage": leadOnly,
241
- "agent.profile.update.any": leadOnly,
242
- "agent.act.any": leadOnly,
243
- "agent.context.read.any": leadOnly,
244
- "task.cancel.any": leadOrTaskCreator,
245
- "approval.cancel.any": humanOrLeadOrResourceOwner,
246
- "approval.respond": operatorOrUser,
247
- "improvement.submit": anyAuthenticated,
248
- "improvement.approve": operatorOrUser,
249
- "task.steer.any": leadOrTaskCreator,
250
- "task.create.own": anyAuthenticated,
251
- "task.requester.assign": leadOrOperatorOrUser,
252
- "task.read.own": requesterOwnsTask,
253
- "task.cancel.own": requesterOwnsTask,
254
- "task.steer.own": requesterOwnsTask,
255
- "task.action.own": requesterOwnsTask,
256
- "task.fs.mutate": taskFsMutate,
257
- "task.parent.attach": taskFsMutate,
258
- "session.share": operatorOrUser,
259
- "session.presence": operatorOrUser,
260
- "session.read.all": operatorOrUser,
261
- "task.progress.write": taskProgressWrite,
262
- "favorite.write.own": anyAuthenticated,
263
- "memory.learning.inject": leadOnly,
264
- "memory.edit.any": leadOrResourceOwner,
265
- "memory.write.consolidated": leadOnly,
266
- "memory.read.any": leadOrOperatorOrUser,
267
- "memory.delete.any": memoryDelete,
268
- "channel.delete": leadOnly,
269
- "repo.merge-policy.write": leadOrOperatorOrUser,
270
- "integration.kapso.manage": leadOnly,
271
- "integration.chat.manage": leadOnly,
272
- "integration.chat.post": leadOnly,
273
- "integration.chat.read": leadOnly,
274
- "integration.chat.dm": leadOnly,
275
- "integration.slack.post": leadOnly,
276
- "integration.slack.read": leadOnly,
277
- "integration.slack.thread.start": leadOnly,
278
- "integration.slack.channel.create": leadOnly,
279
- "integration.slack.channel.invite": leadOnly,
280
- "integration.slack.channel.archive": leadOnly,
281
- "integration.slack.upload": leadOnly,
282
- "integration.slack.delete": leadOnly,
283
- "integration.slack.update": leadOnly,
284
- "credential-binding.manage": leadOnly,
285
- "script-connection.manage": leadOnly,
286
- "script-connection.invoke": anyAuthenticated,
287
- "oauth-app.manage": leadOnly,
288
- "oauth-authorization.manage": leadOnly,
289
- "config.write.any": leadOnly,
290
- "config.delete.any": leadOnly,
291
- "config.read.secrets": leadOnly,
292
- "models.catalog.write": leadOrOperator,
293
- "models.harness-support.write": agentOrOperator,
294
- "models.profiles.write": operatorOnly,
295
- "skill.create.swarm": leadOnly,
296
- "skill.install.any": leadOnly,
297
- "skill.install.global": leadOnly,
298
- "skill.uninstall.any": leadOnly,
299
- "skill.update.any": leadOrResourceOwner,
300
- "skill.promote.swarm": leadOnly,
301
- "skill.delete.any": leadOrResourceOwner,
302
- "mcp-server.create.swarm": leadOnly,
303
- "mcp-server.install.any": leadOnly,
304
- "mcp-server.uninstall.any": leadOnly,
305
- "mcp-server.delete.any": leadOrResourceOwner,
306
- "mcp-server.update.any": leadOrResourceOwner,
307
- "mcp-server.stdio.write": leadOrOperatorOrUser,
308
- "mcp-server.read.secrets": leadOnly,
309
- "mcp-oauth.authorize.any": anyAuthenticated,
310
- "kv.write.any": leadOrOwnNamespace,
311
- "comb.presence": operatorOrUser,
312
- "fs.join.own": anyAuthenticated,
313
- "page.delete.any": leadOrResourceOwner,
314
- "app.manage": anyAuthenticated,
315
- "app.use": anyAuthenticated,
316
- "script.global.write": leadOnly,
317
- "script.global.delete": leadOnly,
318
- "script.search": anyAuthenticated,
319
- "script.api.read.secrets": leadOnly,
320
- "script.api.create": leadOnly,
321
- "script.api.update": leadOnly,
322
- "script.api.rotate": leadOnly,
323
- "script.api.delete": leadOnly,
324
- "schedule.deferral.update.any": leadOrResourceOwner,
325
- "runtime_pool.write": operatorOrUser,
326
- "runtime_pool.bind": leadOrOperatorOrUser,
327
- "runtime_controller.write": operatorOrUser,
328
- "agent.token.manage": operatorOrUser,
329
- "user.role.manage": operatorOrUser,
330
- "extension.write": extensionWrite,
331
- "extension.activate": extensionActivation,
332
- "extension.install.inline": leadOrOperatorOrUser
333
- };
334
- });
335
-
336
- // src/rbac/can.ts
337
- function setAuditSink(fn) {
338
- auditSink = fn;
339
- }
340
- function clearAuditSink() {
341
- auditSink = null;
342
- }
343
- function can(check) {
344
- const rule = LEGACY_POLICY[check.verb];
345
- const decision = check.principal.kind !== "guest" && rule.evaluate(check.principal, check.resource) ? { allow: true } : { allow: false, reason: rule.denyReason, missing: check.verb };
346
- if (auditSink) {
347
- try {
348
- auditSink(check, decision);
349
- } catch {}
350
- }
351
- return decision;
352
- }
353
- var auditSink = null;
354
- var init_can = __esm(() => {
355
- init_legacy_policy();
356
- });
357
-
358
- // src/rbac/permissions.ts
359
- var PERMISSIONS, PERMISSION_VERBS, PermissionVerbSchema;
360
- var init_permissions = __esm(() => {
361
- init_zod();
362
- PERMISSIONS = {
363
- "user.manage": {
364
- description: "Create, update, or deactivate user profiles.",
365
- namespace: "user"
366
- },
367
- "agent.profile.update.any": {
368
- description: "Update another agent's profile.",
369
- namespace: "agent"
370
- },
371
- "agent.act.any": {
372
- description: "Act on another agent's scope over HTTP.",
373
- namespace: "agent"
374
- },
375
- "agent.context.read.any": {
376
- description: "View or diff another agent's context history.",
377
- namespace: "agent"
378
- },
379
- "agent.token.manage": {
380
- description: "Mint, rotate, or revoke an agent-bound worker token.",
381
- namespace: "agent"
382
- },
383
- "user.role.manage": {
384
- description: "Assign or remove a person's RBAC roles.",
385
- namespace: "user"
386
- },
387
- "task.cancel.any": {
388
- description: "Cancel any task (beyond tasks the caller created).",
389
- namespace: "task"
390
- },
391
- "approval.cancel.any": {
392
- description: "Cancel a pending approval request.",
393
- namespace: "approval"
394
- },
395
- "approval.respond": {
396
- description: "Approve or reject a pending approval request as a person. Agents never hold it; the request's approvers list still applies.",
397
- namespace: "approval"
398
- },
399
- "improvement.submit": {
400
- description: "Draft a product improvement for desplega. An agent's draft stays pending until a person approves it.",
401
- namespace: "improvement"
402
- },
403
- "improvement.approve": {
404
- description: "Approve and send a drafted product improvement to desplega as a person. Agents never hold it.",
405
- namespace: "improvement"
406
- },
407
- "task.steer.any": {
408
- description: "Steer any task (beyond tasks the caller created).",
409
- namespace: "task"
410
- },
411
- "task.create.own": {
412
- description: "Create a task the caller owns.",
413
- namespace: "task"
414
- },
415
- "task.requester.assign": {
416
- description: "Attribute a new task to a user other than the requester of the caller's own current task.",
417
- namespace: "task"
418
- },
419
- "task.read.own": {
420
- description: "Read details of a task the principal requested.",
421
- namespace: "task"
422
- },
423
- "task.cancel.own": {
424
- description: "Cancel a task the principal requested.",
425
- namespace: "task"
426
- },
427
- "task.steer.own": {
428
- description: "Steer a task the principal requested.",
429
- namespace: "task"
430
- },
431
- "task.action.own": {
432
- description: "Run actions (follow-up, retry, ...) on a task the principal requested.",
433
- namespace: "task"
434
- },
435
- "task.fs.mutate": {
436
- description: "Mutate a task's filesystem artifacts and attachments.",
437
- namespace: "task"
438
- },
439
- "task.parent.attach": {
440
- description: "Create a task under an existing parent task. The child inherits the parent's thread context (contextKey, Slack thread, requester).",
441
- namespace: "task"
442
- },
443
- "task.progress.write": {
444
- description: "Write a task's progress, status, or output (its assignee, a lead, a human, or anyone while unassigned).",
445
- namespace: "task"
446
- },
447
- "session.share": {
448
- description: "Change who can view or edit a session the principal owns (the owner check runs in the handler).",
449
- namespace: "task"
450
- },
451
- "session.presence": {
452
- description: "Join the presence room of a session the principal can view.",
453
- namespace: "task"
454
- },
455
- "session.read.all": {
456
- description: "Opt in to read every user's tasks and sessions (the dashboard's All users scope). Read-only: writes and steering still need the principal's own access.",
457
- namespace: "task"
458
- },
459
- "favorite.write.own": {
460
- description: "Set a favorite the caller owns.",
461
- namespace: "favorite"
462
- },
463
- "memory.learning.inject": {
464
- description: "Inject a learning into another agent's memory.",
465
- namespace: "memory"
466
- },
467
- "memory.edit.any": {
468
- description: "Edit a memory entry (own entries, or any scope as lead).",
469
- namespace: "memory"
470
- },
471
- "memory.write.consolidated": {
472
- description: "Write or move a memory key under a lead-maintained /longterm root (company-story, entities, timeline).",
473
- namespace: "memory"
474
- },
475
- "memory.read.any": {
476
- description: "List every agent's memories, beyond the caller's own and swarm-scoped entries (lead, operator, or user).",
477
- namespace: "memory"
478
- },
479
- "memory.delete.any": {
480
- description: "Delete a memory entry: own agent-scoped entries; swarm-scoped entries as lead, operator, or user; any entry as operator or user.",
481
- namespace: "memory"
482
- },
483
- "channel.delete": {
484
- description: "Delete a Slack channel.",
485
- namespace: "channel"
486
- },
487
- "repo.merge-policy.write": {
488
- description: "Change a repo's allowMerge guideline, which tells agents whether they may merge a PR themselves.",
489
- namespace: "repo"
490
- },
491
- "integration.kapso.manage": {
492
- description: "Register or unregister a Kapso inbound number.",
493
- namespace: "integration"
494
- },
495
- "integration.chat.manage": {
496
- description: "Register or unregister a Chat SDK channel route.",
497
- namespace: "integration"
498
- },
499
- "integration.chat.post": {
500
- description: "Post to a Chat SDK thread or channel other than the thread of the current task.",
501
- namespace: "integration"
502
- },
503
- "integration.chat.read": {
504
- description: "Read a Chat SDK thread other than the thread of the current task.",
505
- namespace: "integration"
506
- },
507
- "integration.chat.dm": {
508
- description: "Open a direct-message thread with a user on a Chat SDK adapter.",
509
- namespace: "integration"
510
- },
511
- "integration.slack.post": {
512
- description: "Post to a direct Slack channel.",
513
- namespace: "integration"
514
- },
515
- "integration.slack.read": {
516
- description: "Read a direct Slack channel.",
517
- namespace: "integration"
518
- },
519
- "integration.slack.thread.start": {
520
- description: "Start a thread in a direct Slack channel.",
521
- namespace: "integration"
522
- },
523
- "integration.slack.channel.create": {
524
- description: "Create a Slack channel.",
525
- namespace: "integration"
526
- },
527
- "integration.slack.channel.invite": {
528
- description: "Invite users to a Slack channel.",
529
- namespace: "integration"
530
- },
531
- "integration.slack.channel.archive": {
532
- description: "Archive a Slack channel.",
533
- namespace: "integration"
534
- },
535
- "integration.slack.upload": {
536
- description: "Upload a file to a direct Slack channel.",
537
- namespace: "integration"
538
- },
539
- "integration.slack.delete": {
540
- description: "Delete a Slack message.",
541
- namespace: "integration"
542
- },
543
- "integration.slack.update": {
544
- description: "Update (edit) a Slack message.",
545
- namespace: "integration"
546
- },
547
- "credential-binding.manage": {
548
- description: "Manage script credential bindings.",
549
- namespace: "credential-binding"
550
- },
551
- "script-connection.manage": {
552
- description: "Manage script connections.",
553
- namespace: "script-connection"
554
- },
555
- "script-connection.invoke": {
556
- description: "Invoke a script MCP connection through the server-side proxy.",
557
- namespace: "script-connection"
558
- },
559
- "oauth-app.manage": {
560
- description: "Register, update, delete, disconnect, or discover OAuth apps.",
561
- namespace: "oauth-app"
562
- },
563
- "oauth-authorization.manage": {
564
- description: "Start, refresh, or revoke labeled OAuth authorizations on an OAuth app.",
565
- namespace: "oauth-authorization"
566
- },
567
- "config.write.any": {
568
- description: "Write any swarm-config key.",
569
- namespace: "config"
570
- },
571
- "config.delete.any": {
572
- description: "Delete any swarm-config entry.",
573
- namespace: "config"
574
- },
575
- "models.catalog.write": {
576
- description: "Force a model-catalog refresh from models.dev or write/delete model-catalog overlay rows.",
577
- namespace: "models"
578
- },
579
- "models.harness-support.write": {
580
- description: "Record whether a pinned harness CLI version accepts a model (a worker reports its own probe results; the operator may correct any row).",
581
- namespace: "models"
582
- },
583
- "models.profiles.write": {
584
- description: "Create, update, or delete model profiles (named harness + model + effort). Operator (shared API key) only.",
585
- namespace: "models"
586
- },
587
- "config.read.secrets": {
588
- description: "Read unmasked secret config values.",
589
- namespace: "config"
590
- },
591
- "skill.create.swarm": {
592
- description: "Create a swarm-scoped skill.",
593
- namespace: "skill"
594
- },
595
- "skill.install.any": {
596
- description: "Install a skill for another agent.",
597
- namespace: "skill"
598
- },
599
- "skill.install.global": {
600
- description: "Install a remote/global skill.",
601
- namespace: "skill"
602
- },
603
- "skill.uninstall.any": {
604
- description: "Uninstall a skill for another agent.",
605
- namespace: "skill"
606
- },
607
- "skill.update.any": {
608
- description: "Update a skill the caller does not own.",
609
- namespace: "skill"
610
- },
611
- "skill.promote.swarm": {
612
- description: "Promote a skill to swarm scope (skill-approval path).",
613
- namespace: "skill"
614
- },
615
- "skill.delete.any": {
616
- description: "Delete a skill the caller does not own.",
617
- namespace: "skill"
618
- },
619
- "mcp-server.create.swarm": {
620
- description: "Create a swarm- or global-scoped MCP server.",
621
- namespace: "mcp-server"
622
- },
623
- "mcp-server.install.any": {
624
- description: "Install an MCP server for another agent.",
625
- namespace: "mcp-server"
626
- },
627
- "mcp-server.uninstall.any": {
628
- description: "Uninstall an MCP server for another agent.",
629
- namespace: "mcp-server"
630
- },
631
- "mcp-server.delete.any": {
632
- description: "Delete an MCP server the caller does not own.",
633
- namespace: "mcp-server"
634
- },
635
- "mcp-server.update.any": {
636
- description: "Update an MCP server the caller does not own.",
637
- namespace: "mcp-server"
638
- },
639
- "mcp-server.stdio.write": {
640
- description: "Create an agent-scope stdio MCP server, or change or enable what a stdio server runs. A stdio server runs a command on the worker.",
641
- namespace: "mcp-server"
642
- },
643
- "mcp-server.read.secrets": {
644
- description: "Read resolved MCP server secret env/header values.",
645
- namespace: "mcp-server"
646
- },
647
- "mcp-oauth.authorize.any": {
648
- description: "Start an MCP-server OAuth authorize flow for a caller-supplied user scope.",
649
- namespace: "mcp-oauth"
650
- },
651
- "kv.write.any": {
652
- description: "Write another agent's task:agent: KV namespace.",
653
- namespace: "kv"
654
- },
655
- "comb.presence": {
656
- description: "Use dashboard presence rooms for Comb drives.",
657
- namespace: "comb"
658
- },
659
- "fs.join.own": {
660
- description: "Join the swarm's shared agent-fs drive with your own account email.",
661
- namespace: "fs"
662
- },
663
- "page.delete.any": {
664
- description: "Delete a page the caller does not own.",
665
- namespace: "page"
666
- },
667
- "app.manage": {
668
- description: "Create, update, delete, or roll back apps, and inspect app version history.",
669
- namespace: "app"
670
- },
671
- "app.use": {
672
- description: "View an app and act through it: queries, rows, and actions.",
673
- namespace: "app"
674
- },
675
- "script.global.write": {
676
- description: "Create or update a global-scope script.",
677
- namespace: "script"
678
- },
679
- "script.global.delete": {
680
- description: "Delete a global-scope script.",
681
- namespace: "script"
682
- },
683
- "script.search": {
684
- description: "Search reusable scripts visible to the caller.",
685
- namespace: "script"
686
- },
687
- "script.api.read.secrets": {
688
- description: "Reveal an external script API endpoint bearer token.",
689
- namespace: "script"
690
- },
691
- "script.api.create": {
692
- description: "Expose a script as an external HTTP API endpoint.",
693
- namespace: "script"
694
- },
695
- "script.api.update": {
696
- description: "Update an external script API endpoint.",
697
- namespace: "script"
698
- },
699
- "script.api.rotate": {
700
- description: "Rotate an external script API endpoint bearer token.",
701
- namespace: "script"
702
- },
703
- "script.api.delete": {
704
- description: "Delete an external script API endpoint.",
705
- namespace: "script"
706
- },
707
- "schedule.deferral.update.any": {
708
- description: "Change a defer-task schedule the caller did not create.",
709
- namespace: "schedule"
710
- },
711
- "runtime_pool.write": {
712
- description: "Create, update, or delete runtime pools (image, provider kind, placement).",
713
- namespace: "runtime_pool"
714
- },
715
- "runtime_pool.bind": {
716
- description: "Bind an agent to an existing runtime pool, or create an agent in one.",
717
- namespace: "runtime_pool"
718
- },
719
- "runtime_controller.write": {
720
- description: "Create, update, or delete runtime controllers.",
721
- namespace: "runtime_controller"
722
- },
723
- "extension.write": {
724
- description: "Install, update, or uninstall a swarm extension.",
725
- namespace: "extension"
726
- },
727
- "extension.activate": {
728
- description: "Enable, disable, or activate a version of a swarm extension.",
729
- namespace: "extension"
730
- },
731
- "extension.install.inline": {
732
- description: "Install a swarm extension from an inline manifest and files instead of the catalog.",
733
- namespace: "extension"
734
- }
735
- };
736
- PERMISSION_VERBS = Object.keys(PERMISSIONS);
737
- PermissionVerbSchema = _enum2(PERMISSION_VERBS);
738
- });
739
-
740
- // src/rbac/index.ts
741
- var init_rbac = __esm(() => {
742
- init_admission();
743
- init_can();
744
- init_legacy_policy();
745
- init_permissions();
746
- });
747
-
748
- export { isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, PermissionVerbSchema, init_rbac };