@desplega.ai/agent-swarm 2.9.0 → 2.10.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 (453) hide show
  1. package/dist/acp-adapter-bht22g3k.js +16 -0
  2. package/dist/{acp-targets-swxq55dr.js → acp-targets-arrwv4f0.js} +7 -7
  3. package/dist/{actions-pb678g3e.js → actions-y0d2n1c2.js} +102 -21
  4. package/dist/{agent-fs-provision-dmhnc38q.js → agent-fs-provision-tpj7sktd.js} +4 -4
  5. package/dist/{amp-adapter-3pa66q27.js → amp-adapter-vmmnmw8d.js} +2 -2
  6. package/dist/{anthropic-messages-x2cp5fvf.js → anthropic-messages-zdca3gv1.js} +22 -22
  7. package/dist/{app-17d12ev4.js → app-wb7w45dq.js} +6 -3
  8. package/dist/{approval-notifications-h7vd9pmg.js → approval-notifications-7mqr6vbd.js} +8 -5
  9. package/dist/{assistant-t7k39ree.js → assistant-gf60454p.js} +23 -21
  10. package/dist/{boot-args-schema-0gqmkfbe.js → boot-args-schema-qxmd59sr.js} +1 -1
  11. package/dist/{boot-reembed-f064w382.js → boot-reembed-5tmeskj2.js} +1 -1
  12. package/dist/{boot-reembed-n6anc01d.js → boot-reembed-wb44vc3s.js} +1 -1
  13. package/dist/boot-scrub-sweep-25bxhnw4.js +9 -0
  14. package/dist/{boot-seeds-f99fjs5q.js → boot-seeds-nj9za0vk.js} +4 -4
  15. package/dist/{claude-adapter-gvznwxgc.js → claude-adapter-d3krpdyb.js} +7 -7
  16. package/dist/{claude-managed-adapter-pbrbvc64.js → claude-managed-adapter-t8nfgcgz.js} +2 -2
  17. package/dist/{claude-managed-setup-kdxttvc3.js → claude-managed-setup-7y4pwd81.js} +3 -3
  18. package/dist/{claude-sdk-session-0t2teq6n.js → claude-sdk-session-d138zy0e.js} +7 -7
  19. package/dist/{cli-6dp0jkfj.js → cli-01k6wpr9.js} +4 -4
  20. package/dist/{cli-c07v0qfa.js → cli-124ntmf0.js} +83 -74
  21. package/dist/{cli-1tvdx9t5.js → cli-2rnd5j3t.js} +1 -1
  22. package/dist/{cli-4ghh072d.js → cli-2spnz7ye.js} +36 -36
  23. package/dist/{cli-dd37e0cm.js → cli-2v2zdm0a.js} +1 -1
  24. package/dist/{cli-aa8s22gn.js → cli-3aaeb78m.js} +195 -186
  25. package/dist/{cli-8x8y70av.js → cli-3caf7pmg.js} +2 -2
  26. package/dist/{cli-jd3kxppb.js → cli-3et6fmfe.js} +1 -1
  27. package/dist/{cli-kaa4bd7x.js → cli-3f8zbtqa.js} +9 -8
  28. package/dist/{cli-57pvhnyt.js → cli-43evxwj4.js} +1 -1
  29. package/dist/cli-43ms35q9.js +270 -0
  30. package/dist/cli-47hz21se.js +25584 -0
  31. package/dist/{cli-n515ex5z.js → cli-4ymxrwg5.js} +16 -16
  32. package/dist/{cli-2tnbc3gw.js → cli-539h29es.js} +2379 -66
  33. package/dist/{cli-rts1qvb4.js → cli-5qhfv9rw.js} +2 -2
  34. package/dist/{cli-faf46gdq.js → cli-6037prsx.js} +10 -10
  35. package/dist/{cli-bk9v1xrv.js → cli-6cwr32fe.js} +25 -25
  36. package/dist/{cli-812paz57.js → cli-6ehs4mta.js} +18 -2
  37. package/dist/{cli-95930z69.js → cli-6ym4jhzp.js} +2 -2
  38. package/dist/{cli-zg3z63x3.js → cli-7mv4h3sn.js} +1 -1
  39. package/dist/{cli-9a2rtd77.js → cli-7r162fxe.js} +24 -15
  40. package/dist/{cli-eg437b5p.js → cli-7sf9sb0w.js} +2 -1
  41. package/dist/{cli-vw5x18yj.js → cli-8st34zhr.js} +20 -10
  42. package/dist/{cli-fgphc007.js → cli-91pkxres.js} +1 -1
  43. package/dist/{cli-2kg31ted.js → cli-9fjr27ez.js} +11 -11
  44. package/dist/{cli-wr1h0k28.js → cli-9w8712tq.js} +617 -278
  45. package/dist/cli-aw83sr40.js +98 -0
  46. package/dist/{cli-ssvdrk4y.js → cli-b6px1k1q.js} +1 -1
  47. package/dist/{cli-w7dxb2fj.js → cli-cc93xzes.js} +6 -6
  48. package/dist/{cli-js8zrfyg.js → cli-fcfbct2j.js} +5 -5
  49. package/dist/{cli-3zxdz9r7.js → cli-fq2rr3jb.js} +6 -6
  50. package/dist/{boot-scrub-sweep-ejd5dnrz.js → cli-had1p04a.js} +8 -9
  51. package/dist/{cli-7cgf614g.js → cli-j6te8keb.js} +5 -5
  52. package/dist/{cli-25nstr34.js → cli-jrbq4djp.js} +1 -1
  53. package/dist/{cli-pz1c00aa.js → cli-k3q2va86.js} +2 -2
  54. package/dist/{cli-nhq5js1b.js → cli-k5yewqgd.js} +3 -3
  55. package/dist/cli-kbtzfrxj.js +404 -0
  56. package/dist/{cli-dx439zpg.js → cli-kpgcm7xy.js} +13 -1
  57. package/dist/{cli-mc1fx4xd.js → cli-m9cvf7vs.js} +10 -10
  58. package/dist/{cli-kmvcm34h.js → cli-md50mj0r.js} +2 -2
  59. package/dist/{cli-q8cfh1t9.js → cli-mk7c5ac4.js} +1 -1
  60. package/dist/cli-mys27d03.js +321 -0
  61. package/dist/{cli-spzkdgtg.js → cli-n3qe7tyr.js} +172 -168
  62. package/dist/{cli-7akn6ze9.js → cli-nh7x3133.js} +7 -28
  63. package/dist/{cli-fnh4b12r.js → cli-nstkanmx.js} +6 -6
  64. package/dist/{cli-g3zzby8t.js → cli-nv4xsvmk.js} +5 -5
  65. package/dist/{cli-sn4pc4qx.js → cli-p0c3vtch.js} +2 -2
  66. package/dist/{cli-5ntc4we6.js → cli-p0n7b5rz.js} +859 -2058
  67. package/dist/{cli-pn1v1pb0.js → cli-psffsanb.js} +3 -2
  68. package/dist/{cli-svc803vq.js → cli-q5srsxq2.js} +15 -15
  69. package/dist/{cli-nmcpzbty.js → cli-qrta34nb.js} +4 -4
  70. package/dist/{cli-k09cxm6m.js → cli-qx4f057j.js} +2 -2
  71. package/dist/{cli-eepnpee7.js → cli-s1khw52h.js} +12 -12
  72. package/dist/{cli-h474mvp5.js → cli-s1zqk1aj.js} +21 -11
  73. package/dist/{cli-8axx8vnw.js → cli-sb4426be.js} +10 -10
  74. package/dist/{cli-kqh27v2y.js → cli-th1dkc2v.js} +1 -1
  75. package/dist/{cli-cw7mc1je.js → cli-tr27kwyg.js} +3 -3
  76. package/dist/{cli-5kcmxwxv.js → cli-tvgqesec.js} +7 -5
  77. package/dist/{cli-a9hfzg2r.js → cli-ty3gha1p.js} +6 -6
  78. package/dist/{cli-fjggej24.js → cli-v46zsvqk.js} +1 -1
  79. package/dist/{cli-5gygrr67.js → cli-v8z0yga9.js} +4 -4
  80. package/dist/{cli-k7pt28ad.js → cli-vfqvrd82.js} +5 -5
  81. package/dist/{cli-vvgaz8t6.js → cli-vq2eg24x.js} +2 -2
  82. package/dist/{cli-pwsax0vp.js → cli-vsw91x06.js} +23 -22
  83. package/dist/{cli-7fx9jyfs.js → cli-w1q68d8x.js} +67 -11
  84. package/dist/{cli-c5cspahx.js → cli-wafmk3fn.js} +45 -20
  85. package/dist/{cli-ymct0ycy.js → cli-wwp1bd3n.js} +5495 -5095
  86. package/dist/{cli-me4maa4j.js → cli-y4ccxtz5.js} +45 -9
  87. package/dist/{cli-m1fbz2wj.js → cli-y8p78ekx.js} +178 -19
  88. package/dist/{cli-nr46j5pw.js → cli-z0m452jr.js} +1 -1
  89. package/dist/{cli-gddgcnav.js → cli-zeh2mhkg.js} +1 -1
  90. package/dist/{cli-e9973bf0.js → cli-zk7v5s89.js} +2 -2
  91. package/dist/cli.js +24 -23
  92. package/dist/{cloudflare-workers-ai-system-one-9y1zx3pt.js → cloudflare-workers-ai-system-one-4aysy6rh.js} +2 -2
  93. package/dist/{codex-adapter-44yq2fkn.js → codex-adapter-exfdbj73.js} +6 -6
  94. package/dist/{codex-hook-h1zb7cfk.js → codex-hook-59atdwd8.js} +1 -1
  95. package/dist/{codex-login-cdyrr5y1.js → codex-login-a239g1ah.js} +1 -1
  96. package/dist/{codex-session-runner-zbh26gbw.js → codex-session-runner-xhznc4g3.js} +6 -6
  97. package/dist/{commands-54f02v5b.js → commands-d8g349v4.js} +3 -3
  98. package/dist/{controller-9gpwcdek.js → controller-mwgdmb8y.js} +6 -3
  99. package/dist/{controllers-connect-61re6k1n.js → controllers-connect-5v7qx04j.js} +22 -20
  100. package/dist/core-sxy4epp2.js +38 -0
  101. package/dist/{cursor-adapter-7e4g81vd.js → cursor-adapter-p2q5h35d.js} +1 -1
  102. package/dist/{db-wnh0qjy1.js → db-qpganbeb.js} +3 -3
  103. package/dist/{db-dg2gc7fd.js → db-wcw0b2j8.js} +8 -2
  104. package/dist/{dispatcher-jrm24r43.js → dispatcher-8d8s49yz.js} +20 -18
  105. package/dist/{docker-9aq30pp2.js → docker-09tkkg0n.js} +42 -3
  106. package/dist/{dsh-adapter-1yqk267c.js → dsh-adapter-me0twn13.js} +1 -1
  107. package/dist/{easter-egg-3d-r4h9cs9m.js → easter-egg-3d-wv7w5ty6.js} +1 -1
  108. package/dist/{embedding-space-bafjr5f7.js → embedding-space-e48xchqa.js} +6 -6
  109. package/dist/{embeddings-7xmgqe0e.js → embeddings-tgq2afbq.js} +1 -1
  110. package/dist/{execute-d6jg5ns0.js → execute-8rhwrk7f.js} +1 -1
  111. package/dist/{external-channel-frq1xvq2.js → external-channel-8bt3j2pm.js} +2 -2
  112. package/dist/fx-adapter-adtdb3jb.js +19 -0
  113. package/dist/{google-generative-ai-hh7strj3.js → google-generative-ai-bh0djqjp.js} +5 -5
  114. package/dist/{google-vertex-fy5bw2pm.js → google-vertex-prjbw8dj.js} +9 -9
  115. package/dist/grok-adapter-accnn9km.js +19 -0
  116. package/dist/handlers-1x77561e.js +35 -0
  117. package/dist/{heartbeat-6bpa611t.js → heartbeat-x0056ra5.js} +23 -21
  118. package/dist/{hook-hvm5nf46.js → hook-a7vmn2st.js} +5 -5
  119. package/dist/{hook-w12k146y.js → hook-mrd2ayxv.js} +6 -6
  120. package/dist/{http-43tthdvs.js → http-ym9c5svp.js} +1335 -363
  121. package/dist/{index-fn054vsf.js → index-01ns1pkw.js} +1 -1
  122. package/dist/{index-1f0vypbg.js → index-0h6qd4p1.js} +34 -24
  123. package/dist/index-48qzcqzj.js +35 -0
  124. package/dist/{index-4b1q8kan.js → index-4k7m5dgj.js} +629 -354
  125. package/dist/index-620y7jzq.js +15 -0
  126. package/dist/{index-cret47a5.js → index-8p0j4h4j.js} +506 -43
  127. package/dist/{index-m5gx1xd6.js → index-9myfj74s.js} +40 -40
  128. package/dist/{index-bs7gw5fd.js → index-b5wgnm78.js} +44 -44
  129. package/dist/{index-ftywhyr0.js → index-ny60jcat.js} +394 -66
  130. package/dist/{index-tx9mc2ap.js → index-p46tvwtx.js} +24 -22
  131. package/dist/{index-585gyczt.js → index-pe3d8jfy.js} +3 -3
  132. package/dist/index-rkvaambe.js +36 -0
  133. package/dist/{index-mhq4sh5w.js → index-x6azjwm8.js} +1 -1
  134. package/dist/index-xj1mq27m.js +40 -0
  135. package/dist/k8s-m56sw868.js +217 -0
  136. package/dist/{keepalive-rk0j0jvh.js → keepalive-7yxg8z4c.js} +3 -3
  137. package/dist/lead-enzn86bz.js +74 -0
  138. package/dist/{maintenance-g6z6kaxw.js → maintenance-6tefxmk1.js} +1 -1
  139. package/dist/{node-jftbyawr.js → node-2wfcey7d.js} +1 -1
  140. package/dist/{oauth-refresh-sweep-2k3g2q4w.js → oauth-refresh-sweep-70cavc3a.js} +2 -2
  141. package/dist/{onboard-6fdbvh3v.js → onboard-fja65z08.js} +5 -5
  142. package/dist/{openai-decisions-q3hh60wr.js → openai-decisions-ytp6w6xh.js} +1 -1
  143. package/dist/{opencode-adapter-fdbsvts7.js → opencode-adapter-hakkm7yh.js} +6 -6
  144. package/dist/{otel-impl-rvwtc09q.js → otel-impl-7zhnt6gj.js} +1 -1
  145. package/dist/{pending-sqkrb836.js → pending-h01yzpx4.js} +21 -19
  146. package/dist/{pi-mono-adapter-asqayqcg.js → pi-mono-adapter-f52hz743.js} +40 -13
  147. package/dist/{pricing-refresh-f5tkgmw2.js → pricing-refresh-fzxvk2zf.js} +2 -2
  148. package/dist/{rbac-roles-06s555fa.js → rbac-roles-9v6vhgbs.js} +3 -3
  149. package/dist/{rbac-roles-szxsg8t1.js → rbac-roles-hfgh8sba.js} +2 -2
  150. package/dist/{render-v2-103p266q.js → render-v2-1rgspxzf.js} +6 -3
  151. package/dist/{resume-v7kjewt9.js → resume-tqy61x24.js} +10 -7
  152. package/dist/{runtime-f1gmk0b7.js → runtime-exkxyx5f.js} +1 -1
  153. package/dist/{session-access-6shev8ts.js → session-access-3act7vt4.js} +4 -4
  154. package/dist/{session-source-backfill-bd7spzjd.js → session-source-backfill-82qe7fqq.js} +3 -3
  155. package/dist/{setup-kmxmztdb.js → setup-ry1vfdef.js} +1 -1
  156. package/dist/thread-buffer-3x93yexa.js +38 -0
  157. package/dist/{typesafe-system-one-f2en2knd.js → typesafe-system-one-vcfj2ak8.js} +2 -2
  158. package/dist/user-merge-jobs-bx6bf7db.js +22 -0
  159. package/dist/{virtual-modules-57eje5wy.js → virtual-modules-s0rjzcqq.js} +3 -3
  160. package/dist/{work-objects-zr47ygmf.js → work-objects-z2e5tv03.js} +29 -23
  161. package/dist/{worker-follow-up-grrr3fda.js → worker-follow-up-y3xeg89w.js} +20 -18
  162. package/dist/worker-zfcv2wbf.js +74 -0
  163. package/openapi.json +2763 -147
  164. package/package.json +9 -8
  165. package/src/apps/catalog.generated.json +43 -3
  166. package/src/apps/page-validator.ts +27 -0
  167. package/src/be/boot-seeds.ts +7 -1
  168. package/src/be/db/model-groups.ts +238 -0
  169. package/src/be/db/model-profiles.ts +28 -7
  170. package/src/be/db/session-costs.ts +225 -0
  171. package/src/be/db/session-log-reasoning.ts +36 -0
  172. package/src/be/db/tasks/read.ts +8 -3
  173. package/src/be/db/tasks/write.ts +34 -1
  174. package/src/be/db/user-references.ts +75 -0
  175. package/src/be/db/users/references.ts +185 -0
  176. package/src/be/db-client.ts +70 -19
  177. package/src/be/db.ts +232 -361
  178. package/src/be/key-window-usage.ts +386 -0
  179. package/src/be/memory/demotion-evidence.ts +34 -0
  180. package/src/be/memory/reranker.ts +34 -12
  181. package/src/be/memory/review-recall-filter.ts +83 -0
  182. package/src/be/memory/search-candidates.ts +19 -6
  183. package/src/be/memory/types.ts +11 -0
  184. package/src/be/migrations/303_task_ui_specs.sql +28 -0
  185. package/src/be/migrations/306_provider_account_telemetry.sql +1 -0
  186. package/src/be/migrations/307_session_cost_credential_attribution.sql +23 -0
  187. package/src/be/migrations/310_session_logs_reasoning.sql +12 -0
  188. package/src/be/migrations/312_task_ui_action_runs_repeatable.sql +6 -0
  189. package/src/be/migrations/314_model_groups.sql +85 -0
  190. package/src/be/migrations/318_superseded_workflow_cut_backfill.sql +22 -0
  191. package/src/be/migrations/319_user_fk_indexes.sql +153 -0
  192. package/src/be/migrations/320_session_costs_kind.sql +4 -0
  193. package/src/be/migrations/321_user_merge_jobs.sql +52 -0
  194. package/src/be/pricing-normalize.ts +2 -0
  195. package/src/be/rbac-roles.ts +6 -4
  196. package/src/be/runtime-pools/db.ts +23 -5
  197. package/src/be/runtime-pools/supervisor.ts +15 -1
  198. package/src/be/scripts/db.ts +11 -0
  199. package/src/be/scripts/typecheck.ts +2 -0
  200. package/src/be/seed-model-groups.ts +86 -0
  201. package/src/be/seed-model-profiles.ts +20 -13
  202. package/src/be/seed-scripts/catalog/boot-triage.inline.ts +1 -0
  203. package/src/be/seed-scripts/catalog/boot-triage.ts +1 -0
  204. package/src/be/seed-scripts/catalog/dreaming-gather.ts +165 -1
  205. package/src/be/seed-scripts/catalog/wait-for-task.ts +5 -1
  206. package/src/be/seed-skills/index.ts +3 -0
  207. package/src/be/swarm-config-guard.ts +58 -1
  208. package/src/be/task-ui-spec.ts +259 -0
  209. package/src/be/user-merge-jobs.ts +564 -0
  210. package/src/be/users.ts +41 -23
  211. package/src/commands/controller.ts +3 -0
  212. package/src/commands/credential-outcome-report.ts +13 -3
  213. package/src/commands/onboard/agent-fs-version.ts +1 -1
  214. package/src/commands/onboard/compose-generator.ts +1 -1
  215. package/src/commands/onboard/env-generator.ts +1 -1
  216. package/src/commands/provider-credentials.ts +1 -1
  217. package/src/commands/rate-limit-outcome.ts +6 -0
  218. package/src/commands/runner.ts +34 -53
  219. package/src/extensions/catalog.generated.json +3 -3
  220. package/src/extensions/contract-types.generated.ts +1 -1
  221. package/src/extensions/contract.ts +15 -0
  222. package/src/extensions/dispatcher.ts +14 -4
  223. package/src/github/handlers.ts +57 -0
  224. package/src/github/types.ts +4 -0
  225. package/src/http/all-routes.ts +2 -0
  226. package/src/http/api-keys.ts +258 -30
  227. package/src/http/approval-requests.ts +5 -1
  228. package/src/http/auth.ts +3 -1
  229. package/src/http/config.ts +34 -1
  230. package/src/http/index.ts +13 -0
  231. package/src/http/memory.ts +19 -6
  232. package/src/http/model-groups.ts +277 -0
  233. package/src/http/model-profiles.ts +30 -13
  234. package/src/http/session-data.ts +74 -23
  235. package/src/http/sessions.ts +6 -2
  236. package/src/http/tasks.ts +140 -5
  237. package/src/http/tool-hooks.ts +140 -0
  238. package/src/http/users.ts +142 -19
  239. package/src/http/workflows.ts +19 -1
  240. package/src/integrations/chat-sdk/inbound.ts +8 -2
  241. package/src/integrations/chat-sdk/limits.ts +8 -3
  242. package/src/integrations/chat-sdk/relay.ts +87 -0
  243. package/src/jira/outbound.ts +5 -3
  244. package/src/linear/outbound.ts +5 -1
  245. package/src/prompts/base-prompt.ts +8 -0
  246. package/src/prompts/session-templates.ts +19 -2
  247. package/src/providers/acp-targets.ts +2 -2
  248. package/src/providers/amp-adapter.ts +1 -1
  249. package/src/providers/claude-adapter.ts +27 -4
  250. package/src/providers/claude-flag-settings.ts +39 -1
  251. package/src/providers/codex-adapter.ts +85 -3
  252. package/src/providers/codex-app-server.ts +9 -5
  253. package/src/providers/codex-oauth/auth-json.ts +1 -0
  254. package/src/providers/pi-mono-adapter.ts +35 -2
  255. package/src/providers/pricing-sources.md +41 -0
  256. package/src/providers/types.ts +11 -0
  257. package/src/rbac/legacy-policy.ts +1 -0
  258. package/src/rbac/permissions.ts +5 -0
  259. package/src/runtime-providers/docker.ts +65 -1
  260. package/src/runtime-providers/index.ts +7 -5
  261. package/src/runtime-providers/k8s.ts +250 -0
  262. package/src/scheduler/deferred-task-waits.ts +18 -5
  263. package/src/scripts-runtime/types/stdlib.d.ts +2 -0
  264. package/src/scripts-runtime/types/swarm-extension.d.ts +24 -9
  265. package/src/scripts-runtime/types/swarm-sdk.d.ts +2 -0
  266. package/src/slack/actions.ts +79 -0
  267. package/src/slack/app.ts +22 -15
  268. package/src/slack/blocks.ts +23 -2
  269. package/src/slack/inbound-files.ts +2 -0
  270. package/src/slack/render-v2.ts +154 -23
  271. package/src/slack/responses.ts +3 -2
  272. package/src/slack/work-objects.ts +4 -1
  273. package/src/tasks/errors.ts +5 -0
  274. package/src/tests/acp-adapter.test.ts +30 -6
  275. package/src/tests/api-key-tracking.test.ts +0 -72
  276. package/src/tests/api-keys-status-model-limits.test.ts +93 -1
  277. package/src/tests/api-keys-validation.test.ts +42 -0
  278. package/src/tests/approval-card-resolution.test.ts +7 -1
  279. package/src/tests/approval-requests-notifications.test.ts +11 -1
  280. package/src/tests/apps-catalog-page-frame.test.ts +49 -0
  281. package/src/tests/apps-session-thread.test.ts +79 -0
  282. package/src/tests/base-prompt.test.ts +111 -5
  283. package/src/tests/chat-sdk-relay.test.ts +170 -2
  284. package/src/tests/check-pr-body.test.ts +43 -0
  285. package/src/tests/claude-adapter-binary.test.ts +67 -6
  286. package/src/tests/claude-flag-settings.test.ts +29 -0
  287. package/src/tests/claude-sdk-lifecycle.test.ts +5 -0
  288. package/src/tests/codex-adapter.test.ts +340 -2
  289. package/src/tests/codex-app-server.test.ts +16 -0
  290. package/src/tests/codex-oauth.test.ts +3 -1
  291. package/src/tests/codex-rate-limits.test.ts +384 -0
  292. package/src/tests/credential-check.test.ts +14 -6
  293. package/src/tests/credential-outcome-report.test.ts +20 -0
  294. package/src/tests/db-client.test.ts +146 -0
  295. package/src/tests/db-task-read-contract.test.ts +3 -0
  296. package/src/tests/db-task-write-contract.test.ts +4 -0
  297. package/src/tests/deferred-task-wake.test.ts +63 -1
  298. package/src/tests/deploy-guard.test.ts +7 -7
  299. package/src/tests/deploy-select.test.ts +83 -0
  300. package/src/tests/docker-isolation-config-guard.test.ts +29 -0
  301. package/src/tests/docs-index-footprint.test.js +11 -3
  302. package/src/tests/dreaming-gather-corrections.test.ts +467 -0
  303. package/src/tests/e2e-visuals-comment.test.ts +82 -0
  304. package/src/tests/e2e-visuals-verify-pr.test.ts +138 -0
  305. package/src/tests/event-loop-lag.test.ts +9 -7
  306. package/src/tests/extensions-example-sql-admin-only.test.ts +7 -4
  307. package/src/tests/fixtures/extensions/native-tool-recorder/hooks.ts +26 -0
  308. package/src/tests/fixtures/extensions/native-tool-recorder/manifest.json +10 -0
  309. package/src/tests/fixtures/onboard/content.compose.yml.txt +1 -1
  310. package/src/tests/fixtures/onboard/content.env.txt +1 -1
  311. package/src/tests/fixtures/onboard/dev.compose.yml.txt +1 -1
  312. package/src/tests/fixtures/onboard/dev.env.txt +1 -1
  313. package/src/tests/fixtures/onboard/full-all.compose.yml.txt +1 -1
  314. package/src/tests/fixtures/onboard/full-all.env.txt +1 -1
  315. package/src/tests/fixtures/onboard/full.compose.yml.txt +1 -1
  316. package/src/tests/fixtures/onboard/full.env.txt +1 -1
  317. package/src/tests/fixtures/onboard/research.compose.yml.txt +1 -1
  318. package/src/tests/fixtures/onboard/research.env.txt +1 -1
  319. package/src/tests/fixtures/onboard/solo.compose.yml.txt +1 -1
  320. package/src/tests/fixtures/onboard/solo.env.txt +1 -1
  321. package/src/tests/fixtures/ui-spec-slack/deploys.json +121 -0
  322. package/src/tests/fixtures/ui-spec-slack/incident.json +183 -0
  323. package/src/tests/fixtures/ui-spec-slack/three-charts-stale.json +196 -0
  324. package/src/tests/fixtures/ui-spec-slack/video-rejected-by-slack.json +183 -0
  325. package/src/tests/fixtures/ui-spec-slack/video.json +446 -0
  326. package/src/tests/github-event-filter.test.ts +8 -0
  327. package/src/tests/github-handlers-inline-comments.test.ts +2 -0
  328. package/src/tests/github-handlers-reactions.test.ts +4 -0
  329. package/src/tests/github-handlers.test.ts +3 -0
  330. package/src/tests/github-sender-trust.test.ts +223 -0
  331. package/src/tests/gitleaks-download-retry.test.ts +85 -0
  332. package/src/tests/http-users.test.ts +142 -41
  333. package/src/tests/human-thread-routing.test.ts +187 -0
  334. package/src/tests/jira-outbound-sync.test.ts +33 -1
  335. package/src/tests/k8s-pool-smoke.test.ts +190 -0
  336. package/src/tests/key-window-usage.test.ts +846 -0
  337. package/src/tests/linear-outbound-sync.test.ts +30 -1
  338. package/src/tests/memory-rater-store.test.ts +35 -1
  339. package/src/tests/memory-reranker.test.ts +39 -4
  340. package/src/tests/memory-review-recall-filter.test.ts +205 -0
  341. package/src/tests/migration-318-superseded-workflow-cut-backfill.test.ts +74 -0
  342. package/src/tests/model-groups-api.test.ts +415 -0
  343. package/src/tests/model-profiles-api.test.ts +1 -0
  344. package/src/tests/operator-granted-credentials.test.ts +7 -2
  345. package/src/tests/operator-granted-role-wire.test.ts +2 -1
  346. package/src/tests/pi-mono-adapter.test.ts +79 -0
  347. package/src/tests/preload-env.test.ts +2 -0
  348. package/src/tests/preload.ts +3 -1
  349. package/src/tests/prompt-template-session.test.ts +4 -3
  350. package/src/tests/provider-quota-persistence.test.ts +362 -0
  351. package/src/tests/rate-limit-event.test.ts +22 -0
  352. package/src/tests/rbac-engine.test.ts +1 -0
  353. package/src/tests/reasoning-events.test.ts +164 -0
  354. package/src/tests/routing-affinity-inventory.test.ts +22 -0
  355. package/src/tests/runtime-k8s-pools.test.ts +142 -0
  356. package/src/tests/runtime-pools-db.test.ts +42 -2
  357. package/src/tests/runtime-pools-http.test.ts +47 -2
  358. package/src/tests/runtime-provider-registration.test.ts +5 -14
  359. package/src/tests/runtime-providers-docker.test.ts +91 -0
  360. package/src/tests/runtime-providers-k8s.test.ts +303 -0
  361. package/src/tests/script-connections.test.ts +18 -1
  362. package/src/tests/secret-canary-sweep.test.ts +41 -5
  363. package/src/tests/seed-scripts.test.ts +23 -0
  364. package/src/tests/session-cost-attribution.test.ts +748 -0
  365. package/src/tests/session-costs.test.ts +14 -15
  366. package/src/tests/session-logs.test.ts +83 -0
  367. package/src/tests/sessions-detail-batch.test.ts +7 -0
  368. package/src/tests/short-id.test.ts +23 -0
  369. package/src/tests/slack-blocks.test.ts +69 -0
  370. package/src/tests/slack-render-v2.test.ts +411 -0
  371. package/src/tests/slack-start-reload-race.test.ts +67 -0
  372. package/src/tests/spec-base-url.test.ts +13 -1
  373. package/src/tests/subscription-plans.test.ts +20 -1
  374. package/src/tests/system-one-decide-session-cost.test.ts +196 -0
  375. package/src/tests/task-ui-action-route.test.ts +249 -0
  376. package/src/tests/task-ui-actions.test.ts +195 -0
  377. package/src/tests/task-ui-script-actions.test.ts +517 -0
  378. package/src/tests/task-ui-spec-fallback.test.ts +65 -0
  379. package/src/tests/task-ui-spec.test.ts +368 -0
  380. package/src/tests/tool-hooks-http.test.ts +187 -0
  381. package/src/tests/ui-spec-script-actions-config.test.ts +196 -0
  382. package/src/tests/user-delete-perf.test.ts +321 -0
  383. package/src/tests/user-merge-jobs.test.ts +680 -0
  384. package/src/tests/vcs-provider.test.ts +25 -5
  385. package/src/tests/vendored-openapi.test.ts +13 -1
  386. package/src/tests/workflow-agent-task-retry.test.ts +96 -1
  387. package/src/tests/workflow-foreach-supersede-retry.test.ts +10 -0
  388. package/src/tests/workflow-http-v2.test.ts +27 -0
  389. package/src/tests/workflow-replay.test.ts +10 -1
  390. package/src/tests/workflow-triggers-v2.test.ts +128 -0
  391. package/src/tests/workflow-wait-event.test.ts +109 -1
  392. package/src/tools/defer-task.ts +1 -1
  393. package/src/tools/memory-search.ts +14 -3
  394. package/src/tools/store-progress.ts +69 -3
  395. package/src/tools/swarm-config/delete-config.ts +12 -1
  396. package/src/tools/swarm-config/set-config.ts +8 -0
  397. package/src/tools/system-one-decide.ts +113 -3
  398. package/src/tools/utils.ts +4 -1
  399. package/src/tools/workflows/create-workflow.ts +2 -0
  400. package/src/tools/workflows/update-workflow.ts +3 -1
  401. package/src/types.ts +93 -4
  402. package/src/ui-spec/actions.ts +112 -0
  403. package/src/ui-spec/fallback.ts +19 -0
  404. package/src/ui-spec/schema.ts +38 -0
  405. package/src/ui-spec/script-actions.ts +340 -0
  406. package/src/ui-spec/script-allowlist.ts +48 -0
  407. package/src/ui-spec/slack.ts +17 -0
  408. package/src/ui-spec/validate.ts +169 -0
  409. package/src/utils/codex-rate-limits.ts +159 -0
  410. package/src/utils/credentials.ts +2 -0
  411. package/src/utils/error-tracker.ts +19 -0
  412. package/src/utils/provider-account-telemetry.ts +331 -0
  413. package/src/utils/reasoning-events.ts +107 -0
  414. package/src/utils/short-id.ts +20 -14
  415. package/src/utils/subscription-plans.ts +11 -59
  416. package/src/utils/task-ui-spec.ts +79 -0
  417. package/src/vcs/index.ts +12 -2
  418. package/src/workflows/executors/system-one-decision.ts +2 -2
  419. package/src/workflows/resume.ts +3 -2
  420. package/src/workflows/task-step-routing.ts +38 -13
  421. package/src/workflows/triggers.ts +35 -3
  422. package/templates/extensions/manifest.schema.json +13 -0
  423. package/templates/extensions/sql-admin-only/README.md +2 -1
  424. package/templates/extensions/sql-admin-only/hooks.ts +7 -3
  425. package/templates/extensions/sql-admin-only/manifest.json +1 -1
  426. package/templates/skills/apps/SKILL.md +32 -5
  427. package/templates/skills/apps/content.md +32 -5
  428. package/templates/skills/swarm-docs/content.md +2 -0
  429. package/templates/skills/ui-spec/config.json +14 -0
  430. package/templates/skills/ui-spec/content.md +133 -0
  431. package/templates/workflows/dreaming/content.md +1 -1
  432. package/dist/acp-adapter-jqn86aam.js +0 -16
  433. package/dist/cli-7831nhaw.js +0 -93
  434. package/dist/cli-srtkr1h2.js +0 -12078
  435. package/dist/fx-adapter-0zrkfbkd.js +0 -19
  436. package/dist/grok-adapter-3db1c538.js +0 -19
  437. package/dist/handlers-k22n8mnn.js +0 -33
  438. package/dist/index-8xcyd3mc.js +0 -33
  439. package/dist/index-9sy2bh6n.js +0 -38
  440. package/dist/index-b24j7t2m.js +0 -12797
  441. package/dist/index-wjd56k1v.js +0 -34
  442. package/dist/lead-atxf3q6e.js +0 -72
  443. package/dist/thread-buffer-4yz236d0.js +0 -36
  444. package/dist/worker-p4hbtcy3.js +0 -72
  445. package/dist/{azure-openai-responses-590s1eea.js → azure-openai-responses-b3y7fz36.js} +8 -8
  446. package/dist/{cli-j49yqpvh.js → cli-7evph51z.js} +3 -3
  447. package/dist/{cli-g0vv9dg4.js → cli-8y43jx2r.js} +8 -8
  448. package/dist/{cli-m0cy2vyf.js → cli-k6nejceb.js} +4 -4
  449. package/dist/{mistral-conversations-0c30em7t.js → mistral-conversations-tm2vd4gc.js} +8 -8
  450. package/dist/{openai-codex-responses-bkcd8pjj.js → openai-codex-responses-sxjv60xx.js} +4 -4
  451. package/dist/{openai-completions-f3n69rep.js → openai-completions-0c7qnhsx.js} +20 -20
  452. package/dist/{openai-responses-gbh0wfqe.js → openai-responses-a7h29chp.js} +15 -15
  453. package/dist/{pi-messages-zebyt7gb.js → pi-messages-2j0fpqwq.js} +5 -5
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "2.9.0",
5
+ "version": "2.10.0",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -2252,6 +2252,18 @@
2252
2252
  "author": {
2253
2253
  "type": "string",
2254
2254
  "minLength": 1
2255
+ },
2256
+ "toolSources": {
2257
+ "type": "array",
2258
+ "items": {
2259
+ "type": "string",
2260
+ "enum": [
2261
+ "mcp",
2262
+ "native"
2263
+ ]
2264
+ },
2265
+ "minItems": 1,
2266
+ "description": "Which tool calls reach this extension's `pre.tool.call` and `post.tool.call` handlers: `\"mcp\"` for swarm MCP tools, `\"native\"` for harness built-ins (bash, read, write, edit) reported through `POST /api/tool-hooks`. Default `[\"mcp\"]`."
2255
2267
  }
2256
2268
  },
2257
2269
  "required": [
@@ -3530,6 +3542,8 @@
3530
3542
  "task_follow_up_suppressed",
3531
3543
  "task_follow_up_gate_shadow",
3532
3544
  "task_citation_check_refused",
3545
+ "task_ui_spec_check_refused",
3546
+ "task_ui_script_action_failed",
3533
3547
  "channel_message",
3534
3548
  "service_registered",
3535
3549
  "service_unregistered",
@@ -3986,7 +4000,8 @@
3986
4000
  "amp",
3987
4001
  "cursor",
3988
4002
  "grok",
3989
- "fx"
4003
+ "fx",
4004
+ "system-one"
3990
4005
  ]
3991
4006
  },
3992
4007
  "model": {
@@ -4346,6 +4361,39 @@
4346
4361
  "agentId": {
4347
4362
  "type": "string"
4348
4363
  },
4364
+ "credentialKeyType": {
4365
+ "type": [
4366
+ "string",
4367
+ "null"
4368
+ ]
4369
+ },
4370
+ "credentialKeySuffix": {
4371
+ "type": [
4372
+ "string",
4373
+ "null"
4374
+ ]
4375
+ },
4376
+ "harness": {
4377
+ "type": [
4378
+ "string",
4379
+ "null"
4380
+ ],
4381
+ "enum": [
4382
+ "claude",
4383
+ "codex",
4384
+ "pi",
4385
+ "devin",
4386
+ "claude-managed",
4387
+ "opencode",
4388
+ "acp",
4389
+ "dsh",
4390
+ "amp",
4391
+ "cursor",
4392
+ "grok",
4393
+ "fx",
4394
+ null
4395
+ ]
4396
+ },
4349
4397
  "totalCostUsd": {
4350
4398
  "type": "number",
4351
4399
  "minimum": 0
@@ -4361,14 +4409,20 @@
4361
4409
  "default": 0
4362
4410
  },
4363
4411
  "cacheReadTokens": {
4364
- "type": "integer",
4412
+ "type": [
4413
+ "integer",
4414
+ "null"
4415
+ ],
4365
4416
  "minimum": 0,
4366
- "default": 0
4417
+ "default": null
4367
4418
  },
4368
4419
  "cacheWriteTokens": {
4369
- "type": "integer",
4420
+ "type": [
4421
+ "integer",
4422
+ "null"
4423
+ ],
4370
4424
  "minimum": 0,
4371
- "default": 0
4425
+ "default": null
4372
4426
  },
4373
4427
  "reasoningOutputTokens": {
4374
4428
  "type": "integer",
@@ -4408,6 +4462,14 @@
4408
4462
  ],
4409
4463
  "default": "harness"
4410
4464
  },
4465
+ "kind": {
4466
+ "type": "string",
4467
+ "enum": [
4468
+ "harness",
4469
+ "system-one"
4470
+ ],
4471
+ "default": "harness"
4472
+ },
4411
4473
  "harnessCostUsd": {
4412
4474
  "type": [
4413
4475
  "number",
@@ -5221,6 +5283,12 @@
5221
5283
  ],
5222
5284
  "default": "active"
5223
5285
  },
5286
+ "mergedIntoUserId": {
5287
+ "type": [
5288
+ "string",
5289
+ "null"
5290
+ ]
5291
+ },
5224
5292
  "createdAt": {
5225
5293
  "type": "string",
5226
5294
  "format": "date-time"
@@ -5237,6 +5305,85 @@
5237
5305
  "lastUpdatedAt"
5238
5306
  ]
5239
5307
  },
5308
+ "UserMergeJob": {
5309
+ "type": "object",
5310
+ "properties": {
5311
+ "id": {
5312
+ "type": "string"
5313
+ },
5314
+ "sourceUserId": {
5315
+ "type": "string"
5316
+ },
5317
+ "targetUserId": {
5318
+ "type": "string"
5319
+ },
5320
+ "status": {
5321
+ "type": "string",
5322
+ "enum": [
5323
+ "pending",
5324
+ "running",
5325
+ "done",
5326
+ "failed"
5327
+ ]
5328
+ },
5329
+ "phase": {
5330
+ "type": [
5331
+ "string",
5332
+ "null"
5333
+ ]
5334
+ },
5335
+ "progress": {
5336
+ "type": "object",
5337
+ "additionalProperties": {
5338
+ "type": "number"
5339
+ }
5340
+ },
5341
+ "error": {
5342
+ "type": [
5343
+ "string",
5344
+ "null"
5345
+ ]
5346
+ },
5347
+ "attempts": {
5348
+ "type": "number"
5349
+ },
5350
+ "nextAttemptAt": {
5351
+ "type": [
5352
+ "string",
5353
+ "null"
5354
+ ]
5355
+ },
5356
+ "createdAt": {
5357
+ "type": "string"
5358
+ },
5359
+ "startedAt": {
5360
+ "type": [
5361
+ "string",
5362
+ "null"
5363
+ ]
5364
+ },
5365
+ "finishedAt": {
5366
+ "type": [
5367
+ "string",
5368
+ "null"
5369
+ ]
5370
+ }
5371
+ },
5372
+ "required": [
5373
+ "id",
5374
+ "sourceUserId",
5375
+ "targetUserId",
5376
+ "status",
5377
+ "phase",
5378
+ "progress",
5379
+ "error",
5380
+ "attempts",
5381
+ "nextAttemptAt",
5382
+ "createdAt",
5383
+ "startedAt",
5384
+ "finishedAt"
5385
+ ]
5386
+ },
5240
5387
  "WorkflowDefinition": {
5241
5388
  "type": "object",
5242
5389
  "properties": {
@@ -5528,6 +5675,19 @@
5528
5675
  }
5529
5676
  ],
5530
5677
  "description": "Optional webhook verification format. Omit to keep legacy HMAC-SHA256 behavior with fallback header scanning."
5678
+ },
5679
+ "events": {
5680
+ "type": "array",
5681
+ "items": {
5682
+ "type": "string",
5683
+ "minLength": 1
5684
+ },
5685
+ "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
5686
+ },
5687
+ "eventHeader": {
5688
+ "type": "string",
5689
+ "minLength": 1,
5690
+ "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
5531
5691
  }
5532
5692
  },
5533
5693
  "required": [
@@ -6293,6 +6453,19 @@
6293
6453
  }
6294
6454
  ],
6295
6455
  "description": "Optional webhook verification format. Omit to keep legacy HMAC-SHA256 behavior with fallback header scanning."
6456
+ },
6457
+ "events": {
6458
+ "type": "array",
6459
+ "items": {
6460
+ "type": "string",
6461
+ "minLength": 1
6462
+ },
6463
+ "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
6464
+ },
6465
+ "eventHeader": {
6466
+ "type": "string",
6467
+ "minLength": 1,
6468
+ "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
6296
6469
  }
6297
6470
  },
6298
6471
  "required": [
@@ -19731,6 +19904,11 @@
19731
19904
  "plan": {
19732
19905
  "type": "string",
19733
19906
  "maxLength": 40
19907
+ },
19908
+ "planRaw": {
19909
+ "type": "string",
19910
+ "minLength": 1,
19911
+ "maxLength": 80
19734
19912
  }
19735
19913
  },
19736
19914
  "required": [
@@ -20116,6 +20294,7 @@
20116
20294
  "/api/keys/report-rate-limit-windows": {
20117
20295
  "post": {
20118
20296
  "summary": "Record provider-emitted rate-limit window telemetry for an API key",
20297
+ "description": "Reports accept up to 64 windows and 64 account limits within 256 KiB. Stored records have the same count limits.",
20119
20298
  "tags": [
20120
20299
  "API Keys"
20121
20300
  ],
@@ -20148,7 +20327,8 @@
20148
20327
  "type": "object",
20149
20328
  "properties": {
20150
20329
  "status": {
20151
- "type": "string"
20330
+ "type": "string",
20331
+ "maxLength": 256
20152
20332
  },
20153
20333
  "utilization": {
20154
20334
  "type": "number"
@@ -20156,6 +20336,60 @@
20156
20336
  "resetsAt": {
20157
20337
  "type": "number"
20158
20338
  },
20339
+ "fieldObservedAt": {
20340
+ "type": "object",
20341
+ "properties": {
20342
+ "durationMins": {
20343
+ "type": "string",
20344
+ "format": "date-time"
20345
+ },
20346
+ "resetsAt": {
20347
+ "type": "string",
20348
+ "format": "date-time"
20349
+ },
20350
+ "label": {
20351
+ "type": "string",
20352
+ "format": "date-time"
20353
+ },
20354
+ "normalModelSlug": {
20355
+ "type": "string",
20356
+ "format": "date-time"
20357
+ }
20358
+ }
20359
+ },
20360
+ "durationMins": {
20361
+ "type": "integer",
20362
+ "exclusiveMinimum": 0,
20363
+ "maximum": 576000
20364
+ },
20365
+ "source": {
20366
+ "type": "string",
20367
+ "enum": [
20368
+ "claude",
20369
+ "codex"
20370
+ ]
20371
+ },
20372
+ "limitId": {
20373
+ "type": "string",
20374
+ "minLength": 1,
20375
+ "maxLength": 128
20376
+ },
20377
+ "label": {
20378
+ "type": "string",
20379
+ "maxLength": 256
20380
+ },
20381
+ "normalModelSlug": {
20382
+ "type": "string",
20383
+ "maxLength": 256
20384
+ },
20385
+ "overageStatus": {
20386
+ "type": "string",
20387
+ "maxLength": 256
20388
+ },
20389
+ "overageDisabledReason": {
20390
+ "type": "string",
20391
+ "maxLength": 256
20392
+ },
20159
20393
  "isUsingOverage": {
20160
20394
  "type": "boolean"
20161
20395
  },
@@ -20173,6 +20407,252 @@
20173
20407
  ]
20174
20408
  }
20175
20409
  },
20410
+ "account": {
20411
+ "type": "object",
20412
+ "properties": {
20413
+ "source": {
20414
+ "type": "string",
20415
+ "enum": [
20416
+ "codex",
20417
+ "claude"
20418
+ ]
20419
+ },
20420
+ "observedAt": {
20421
+ "type": "string",
20422
+ "format": "date-time"
20423
+ },
20424
+ "fieldObservedAt": {
20425
+ "type": "object",
20426
+ "properties": {
20427
+ "ordinaryUsageAllowed": {
20428
+ "type": "string",
20429
+ "format": "date-time"
20430
+ },
20431
+ "resetCreditsAvailable": {
20432
+ "type": "string",
20433
+ "format": "date-time"
20434
+ }
20435
+ }
20436
+ },
20437
+ "ordinaryUsageAllowed": {
20438
+ "type": [
20439
+ "boolean",
20440
+ "null"
20441
+ ]
20442
+ },
20443
+ "resetCreditsAvailable": {
20444
+ "type": [
20445
+ "integer",
20446
+ "null"
20447
+ ],
20448
+ "minimum": 0
20449
+ },
20450
+ "limits": {
20451
+ "type": "object",
20452
+ "additionalProperties": {
20453
+ "type": "object",
20454
+ "properties": {
20455
+ "observedAt": {
20456
+ "type": "string",
20457
+ "format": "date-time"
20458
+ },
20459
+ "fieldObservedAt": {
20460
+ "type": "object",
20461
+ "properties": {
20462
+ "planRaw": {
20463
+ "type": "string",
20464
+ "format": "date-time"
20465
+ },
20466
+ "label": {
20467
+ "type": "string",
20468
+ "format": "date-time"
20469
+ },
20470
+ "normalModelSlug": {
20471
+ "type": "string",
20472
+ "format": "date-time"
20473
+ },
20474
+ "credits": {
20475
+ "type": "string",
20476
+ "format": "date-time"
20477
+ },
20478
+ "spend": {
20479
+ "type": "string",
20480
+ "format": "date-time"
20481
+ },
20482
+ "spendControlReached": {
20483
+ "type": "string",
20484
+ "format": "date-time"
20485
+ },
20486
+ "reachedType": {
20487
+ "type": "string",
20488
+ "format": "date-time"
20489
+ }
20490
+ }
20491
+ },
20492
+ "windowRemovedAt": {
20493
+ "type": "object",
20494
+ "properties": {
20495
+ "primary": {
20496
+ "type": "string",
20497
+ "format": "date-time"
20498
+ },
20499
+ "secondary": {
20500
+ "type": "string",
20501
+ "format": "date-time"
20502
+ }
20503
+ },
20504
+ "additionalProperties": false
20505
+ },
20506
+ "planRaw": {
20507
+ "type": [
20508
+ "string",
20509
+ "null"
20510
+ ],
20511
+ "maxLength": 256
20512
+ },
20513
+ "label": {
20514
+ "type": [
20515
+ "string",
20516
+ "null"
20517
+ ],
20518
+ "maxLength": 256
20519
+ },
20520
+ "normalModelSlug": {
20521
+ "type": [
20522
+ "string",
20523
+ "null"
20524
+ ],
20525
+ "maxLength": 256
20526
+ },
20527
+ "credits": {
20528
+ "type": [
20529
+ "object",
20530
+ "null"
20531
+ ],
20532
+ "properties": {
20533
+ "hasCredits": {
20534
+ "type": "boolean"
20535
+ },
20536
+ "unlimited": {
20537
+ "type": "boolean"
20538
+ },
20539
+ "balance": {
20540
+ "type": [
20541
+ "string",
20542
+ "null"
20543
+ ],
20544
+ "maxLength": 256
20545
+ }
20546
+ },
20547
+ "required": [
20548
+ "hasCredits",
20549
+ "unlimited"
20550
+ ],
20551
+ "additionalProperties": false
20552
+ },
20553
+ "spend": {
20554
+ "type": [
20555
+ "object",
20556
+ "null"
20557
+ ],
20558
+ "properties": {
20559
+ "limit": {
20560
+ "type": "string",
20561
+ "maxLength": 256
20562
+ },
20563
+ "used": {
20564
+ "type": "string",
20565
+ "maxLength": 256
20566
+ },
20567
+ "remainingPercent": {
20568
+ "type": "integer",
20569
+ "minimum": -2147483648,
20570
+ "maximum": 2147483647
20571
+ },
20572
+ "resetsAt": {
20573
+ "type": "integer",
20574
+ "minimum": 0,
20575
+ "maximum": 8640000000000
20576
+ }
20577
+ },
20578
+ "required": [
20579
+ "limit",
20580
+ "used",
20581
+ "remainingPercent",
20582
+ "resetsAt"
20583
+ ],
20584
+ "additionalProperties": false
20585
+ },
20586
+ "spendControlReached": {
20587
+ "type": [
20588
+ "boolean",
20589
+ "null"
20590
+ ]
20591
+ },
20592
+ "reachedType": {
20593
+ "type": [
20594
+ "string",
20595
+ "null"
20596
+ ],
20597
+ "maxLength": 256
20598
+ }
20599
+ },
20600
+ "required": [
20601
+ "observedAt"
20602
+ ],
20603
+ "additionalProperties": false
20604
+ }
20605
+ }
20606
+ },
20607
+ "required": [
20608
+ "source",
20609
+ "observedAt"
20610
+ ],
20611
+ "additionalProperties": false
20612
+ },
20613
+ "replace": {
20614
+ "type": "array",
20615
+ "items": {
20616
+ "type": "object",
20617
+ "properties": {
20618
+ "source": {
20619
+ "type": "string",
20620
+ "enum": [
20621
+ "codex"
20622
+ ]
20623
+ },
20624
+ "limitId": {
20625
+ "type": "string",
20626
+ "minLength": 1,
20627
+ "maxLength": 128
20628
+ },
20629
+ "observedAt": {
20630
+ "type": "string",
20631
+ "format": "date-time"
20632
+ },
20633
+ "slots": {
20634
+ "type": "array",
20635
+ "items": {
20636
+ "type": "string",
20637
+ "enum": [
20638
+ "primary",
20639
+ "secondary"
20640
+ ]
20641
+ },
20642
+ "minItems": 1,
20643
+ "maxItems": 2
20644
+ }
20645
+ },
20646
+ "required": [
20647
+ "source",
20648
+ "limitId",
20649
+ "observedAt",
20650
+ "slots"
20651
+ ],
20652
+ "additionalProperties": false
20653
+ },
20654
+ "maxItems": 128
20655
+ },
20176
20656
  "scope": {
20177
20657
  "type": "string"
20178
20658
  },
@@ -20235,6 +20715,16 @@
20235
20715
  }
20236
20716
  }
20237
20717
  }
20718
+ },
20719
+ "413": {
20720
+ "description": "Telemetry report exceeds 256 KiB",
20721
+ "content": {
20722
+ "application/json": {
20723
+ "schema": {
20724
+ "$ref": "#/components/schemas/ErrorResponse"
20725
+ }
20726
+ }
20727
+ }
20238
20728
  }
20239
20729
  }
20240
20730
  }
@@ -20614,7 +21104,8 @@
20614
21104
  "type": "object",
20615
21105
  "properties": {
20616
21106
  "status": {
20617
- "type": "string"
21107
+ "type": "string",
21108
+ "maxLength": 256
20618
21109
  },
20619
21110
  "utilization": {
20620
21111
  "type": "number"
@@ -20622,6 +21113,60 @@
20622
21113
  "resetsAt": {
20623
21114
  "type": "number"
20624
21115
  },
21116
+ "fieldObservedAt": {
21117
+ "type": "object",
21118
+ "properties": {
21119
+ "durationMins": {
21120
+ "type": "string",
21121
+ "format": "date-time"
21122
+ },
21123
+ "resetsAt": {
21124
+ "type": "string",
21125
+ "format": "date-time"
21126
+ },
21127
+ "label": {
21128
+ "type": "string",
21129
+ "format": "date-time"
21130
+ },
21131
+ "normalModelSlug": {
21132
+ "type": "string",
21133
+ "format": "date-time"
21134
+ }
21135
+ }
21136
+ },
21137
+ "durationMins": {
21138
+ "type": "integer",
21139
+ "exclusiveMinimum": 0,
21140
+ "maximum": 576000
21141
+ },
21142
+ "source": {
21143
+ "type": "string",
21144
+ "enum": [
21145
+ "claude",
21146
+ "codex"
21147
+ ]
21148
+ },
21149
+ "limitId": {
21150
+ "type": "string",
21151
+ "minLength": 1,
21152
+ "maxLength": 128
21153
+ },
21154
+ "label": {
21155
+ "type": "string",
21156
+ "maxLength": 256
21157
+ },
21158
+ "normalModelSlug": {
21159
+ "type": "string",
21160
+ "maxLength": 256
21161
+ },
21162
+ "overageStatus": {
21163
+ "type": "string",
21164
+ "maxLength": 256
21165
+ },
21166
+ "overageDisabledReason": {
21167
+ "type": "string",
21168
+ "maxLength": 256
21169
+ },
20625
21170
  "isUsingOverage": {
20626
21171
  "type": "boolean"
20627
21172
  },
@@ -20639,6 +21184,212 @@
20639
21184
  ]
20640
21185
  }
20641
21186
  },
21187
+ "providerAccount": {
21188
+ "type": [
21189
+ "object",
21190
+ "null"
21191
+ ],
21192
+ "properties": {
21193
+ "source": {
21194
+ "type": "string",
21195
+ "enum": [
21196
+ "codex",
21197
+ "claude"
21198
+ ]
21199
+ },
21200
+ "observedAt": {
21201
+ "type": "string",
21202
+ "format": "date-time"
21203
+ },
21204
+ "fieldObservedAt": {
21205
+ "type": "object",
21206
+ "properties": {
21207
+ "ordinaryUsageAllowed": {
21208
+ "type": "string",
21209
+ "format": "date-time"
21210
+ },
21211
+ "resetCreditsAvailable": {
21212
+ "type": "string",
21213
+ "format": "date-time"
21214
+ }
21215
+ }
21216
+ },
21217
+ "ordinaryUsageAllowed": {
21218
+ "type": [
21219
+ "boolean",
21220
+ "null"
21221
+ ]
21222
+ },
21223
+ "resetCreditsAvailable": {
21224
+ "type": [
21225
+ "integer",
21226
+ "null"
21227
+ ],
21228
+ "minimum": 0
21229
+ },
21230
+ "limits": {
21231
+ "type": "object",
21232
+ "additionalProperties": {
21233
+ "type": "object",
21234
+ "properties": {
21235
+ "observedAt": {
21236
+ "type": "string",
21237
+ "format": "date-time"
21238
+ },
21239
+ "fieldObservedAt": {
21240
+ "type": "object",
21241
+ "properties": {
21242
+ "planRaw": {
21243
+ "type": "string",
21244
+ "format": "date-time"
21245
+ },
21246
+ "label": {
21247
+ "type": "string",
21248
+ "format": "date-time"
21249
+ },
21250
+ "normalModelSlug": {
21251
+ "type": "string",
21252
+ "format": "date-time"
21253
+ },
21254
+ "credits": {
21255
+ "type": "string",
21256
+ "format": "date-time"
21257
+ },
21258
+ "spend": {
21259
+ "type": "string",
21260
+ "format": "date-time"
21261
+ },
21262
+ "spendControlReached": {
21263
+ "type": "string",
21264
+ "format": "date-time"
21265
+ },
21266
+ "reachedType": {
21267
+ "type": "string",
21268
+ "format": "date-time"
21269
+ }
21270
+ }
21271
+ },
21272
+ "windowRemovedAt": {
21273
+ "type": "object",
21274
+ "properties": {
21275
+ "primary": {
21276
+ "type": "string",
21277
+ "format": "date-time"
21278
+ },
21279
+ "secondary": {
21280
+ "type": "string",
21281
+ "format": "date-time"
21282
+ }
21283
+ },
21284
+ "additionalProperties": false
21285
+ },
21286
+ "planRaw": {
21287
+ "type": [
21288
+ "string",
21289
+ "null"
21290
+ ],
21291
+ "maxLength": 256
21292
+ },
21293
+ "label": {
21294
+ "type": [
21295
+ "string",
21296
+ "null"
21297
+ ],
21298
+ "maxLength": 256
21299
+ },
21300
+ "normalModelSlug": {
21301
+ "type": [
21302
+ "string",
21303
+ "null"
21304
+ ],
21305
+ "maxLength": 256
21306
+ },
21307
+ "credits": {
21308
+ "type": [
21309
+ "object",
21310
+ "null"
21311
+ ],
21312
+ "properties": {
21313
+ "hasCredits": {
21314
+ "type": "boolean"
21315
+ },
21316
+ "unlimited": {
21317
+ "type": "boolean"
21318
+ },
21319
+ "balance": {
21320
+ "type": [
21321
+ "string",
21322
+ "null"
21323
+ ],
21324
+ "maxLength": 256
21325
+ }
21326
+ },
21327
+ "required": [
21328
+ "hasCredits",
21329
+ "unlimited"
21330
+ ],
21331
+ "additionalProperties": false
21332
+ },
21333
+ "spend": {
21334
+ "type": [
21335
+ "object",
21336
+ "null"
21337
+ ],
21338
+ "properties": {
21339
+ "limit": {
21340
+ "type": "string",
21341
+ "maxLength": 256
21342
+ },
21343
+ "used": {
21344
+ "type": "string",
21345
+ "maxLength": 256
21346
+ },
21347
+ "remainingPercent": {
21348
+ "type": "integer",
21349
+ "minimum": -2147483648,
21350
+ "maximum": 2147483647
21351
+ },
21352
+ "resetsAt": {
21353
+ "type": "integer",
21354
+ "minimum": 0,
21355
+ "maximum": 8640000000000
21356
+ }
21357
+ },
21358
+ "required": [
21359
+ "limit",
21360
+ "used",
21361
+ "remainingPercent",
21362
+ "resetsAt"
21363
+ ],
21364
+ "additionalProperties": false
21365
+ },
21366
+ "spendControlReached": {
21367
+ "type": [
21368
+ "boolean",
21369
+ "null"
21370
+ ]
21371
+ },
21372
+ "reachedType": {
21373
+ "type": [
21374
+ "string",
21375
+ "null"
21376
+ ],
21377
+ "maxLength": 256
21378
+ }
21379
+ },
21380
+ "required": [
21381
+ "observedAt"
21382
+ ],
21383
+ "additionalProperties": false
21384
+ }
21385
+ }
21386
+ },
21387
+ "required": [
21388
+ "source",
21389
+ "observedAt"
21390
+ ],
21391
+ "additionalProperties": false
21392
+ },
20642
21393
  "plan": {
20643
21394
  "type": [
20644
21395
  "string",
@@ -20657,6 +21408,12 @@
20657
21408
  null
20658
21409
  ]
20659
21410
  },
21411
+ "detectedPlanRaw": {
21412
+ "type": [
21413
+ "string",
21414
+ "null"
21415
+ ]
21416
+ },
20660
21417
  "lastSeatMismatchAt": {
20661
21418
  "type": [
20662
21419
  "string",
@@ -20743,8 +21500,10 @@
20743
21500
  "name",
20744
21501
  "provider",
20745
21502
  "rateLimitWindows",
21503
+ "providerAccount",
20746
21504
  "plan",
20747
21505
  "planSource",
21506
+ "detectedPlanRaw",
20748
21507
  "lastSeatMismatchAt",
20749
21508
  "lastSeatMismatchModel",
20750
21509
  "consecutiveAuthFailures",
@@ -20779,6 +21538,419 @@
20779
21538
  }
20780
21539
  }
20781
21540
  },
21541
+ "/api/keys/window-usage": {
21542
+ "get": {
21543
+ "summary": "Get Swarm-observed usage within current provider windows",
21544
+ "description": "Usage calculations support 256 windows, 16 distinct windows per credential, 90 days, and 100,000 session rows. Oversized requests fail without partial totals.",
21545
+ "tags": [
21546
+ "API Keys"
21547
+ ],
21548
+ "security": [
21549
+ {
21550
+ "bearerAuth": []
21551
+ }
21552
+ ],
21553
+ "parameters": [
21554
+ {
21555
+ "schema": {
21556
+ "type": "string",
21557
+ "maxLength": 128
21558
+ },
21559
+ "required": false,
21560
+ "name": "keyType",
21561
+ "in": "query"
21562
+ },
21563
+ {
21564
+ "schema": {
21565
+ "type": "string",
21566
+ "minLength": 1,
21567
+ "maxLength": 10
21568
+ },
21569
+ "required": false,
21570
+ "name": "keySuffix",
21571
+ "in": "query"
21572
+ },
21573
+ {
21574
+ "schema": {
21575
+ "type": "string",
21576
+ "maxLength": 64
21577
+ },
21578
+ "required": false,
21579
+ "name": "scope",
21580
+ "in": "query"
21581
+ },
21582
+ {
21583
+ "schema": {
21584
+ "type": "string",
21585
+ "maxLength": 128
21586
+ },
21587
+ "required": false,
21588
+ "name": "scopeId",
21589
+ "in": "query"
21590
+ }
21591
+ ],
21592
+ "responses": {
21593
+ "200": {
21594
+ "description": "Independent windows with receipt-time tokens and explicit measurement coverage",
21595
+ "content": {
21596
+ "application/json": {
21597
+ "schema": {
21598
+ "type": "object",
21599
+ "properties": {
21600
+ "success": {
21601
+ "type": "boolean",
21602
+ "enum": [
21603
+ true
21604
+ ]
21605
+ },
21606
+ "asOf": {
21607
+ "type": "string"
21608
+ },
21609
+ "accounting": {
21610
+ "type": "string",
21611
+ "enum": [
21612
+ "session_cost_receipt_time"
21613
+ ]
21614
+ },
21615
+ "windows": {
21616
+ "type": "array",
21617
+ "items": {
21618
+ "type": "object",
21619
+ "properties": {
21620
+ "statusId": {
21621
+ "type": "string"
21622
+ },
21623
+ "keyType": {
21624
+ "type": "string"
21625
+ },
21626
+ "keySuffix": {
21627
+ "type": "string"
21628
+ },
21629
+ "scope": {
21630
+ "type": "string"
21631
+ },
21632
+ "scopeId": {
21633
+ "type": [
21634
+ "string",
21635
+ "null"
21636
+ ]
21637
+ },
21638
+ "windowKey": {
21639
+ "type": "string"
21640
+ },
21641
+ "durationMins": {
21642
+ "type": [
21643
+ "number",
21644
+ "null"
21645
+ ]
21646
+ },
21647
+ "startsAt": {
21648
+ "type": [
21649
+ "string",
21650
+ "null"
21651
+ ]
21652
+ },
21653
+ "endsAt": {
21654
+ "type": [
21655
+ "string",
21656
+ "null"
21657
+ ]
21658
+ },
21659
+ "dataThrough": {
21660
+ "type": "string"
21661
+ },
21662
+ "observedAt": {
21663
+ "type": "string"
21664
+ },
21665
+ "observationAgeMs": {
21666
+ "type": "number"
21667
+ },
21668
+ "modelScope": {
21669
+ "type": "object",
21670
+ "properties": {
21671
+ "kind": {
21672
+ "type": "string",
21673
+ "enum": [
21674
+ "account",
21675
+ "family",
21676
+ "unknown"
21677
+ ]
21678
+ },
21679
+ "model": {
21680
+ "type": [
21681
+ "string",
21682
+ "null"
21683
+ ]
21684
+ }
21685
+ },
21686
+ "required": [
21687
+ "kind",
21688
+ "model"
21689
+ ]
21690
+ },
21691
+ "unavailableReason": {
21692
+ "type": [
21693
+ "string",
21694
+ "null"
21695
+ ],
21696
+ "enum": [
21697
+ "missing_reset",
21698
+ "unknown_duration",
21699
+ "unknown_model_scope",
21700
+ "window_not_started",
21701
+ null
21702
+ ]
21703
+ },
21704
+ "usage": {
21705
+ "type": [
21706
+ "object",
21707
+ "null"
21708
+ ],
21709
+ "properties": {
21710
+ "sessions": {
21711
+ "type": "integer"
21712
+ },
21713
+ "errorSessions": {
21714
+ "type": "integer"
21715
+ },
21716
+ "completedTasks": {
21717
+ "type": "integer"
21718
+ },
21719
+ "tokens": {
21720
+ "type": "object",
21721
+ "properties": {
21722
+ "uncachedInput": {
21723
+ "type": "object",
21724
+ "properties": {
21725
+ "value": {
21726
+ "type": [
21727
+ "number",
21728
+ "null"
21729
+ ]
21730
+ },
21731
+ "measuredSessions": {
21732
+ "type": "integer"
21733
+ },
21734
+ "missingSessions": {
21735
+ "type": "integer"
21736
+ }
21737
+ },
21738
+ "required": [
21739
+ "value",
21740
+ "measuredSessions",
21741
+ "missingSessions"
21742
+ ]
21743
+ },
21744
+ "output": {
21745
+ "type": "object",
21746
+ "properties": {
21747
+ "value": {
21748
+ "type": [
21749
+ "number",
21750
+ "null"
21751
+ ]
21752
+ },
21753
+ "measuredSessions": {
21754
+ "type": "integer"
21755
+ },
21756
+ "missingSessions": {
21757
+ "type": "integer"
21758
+ }
21759
+ },
21760
+ "required": [
21761
+ "value",
21762
+ "measuredSessions",
21763
+ "missingSessions"
21764
+ ]
21765
+ },
21766
+ "cacheRead": {
21767
+ "type": "object",
21768
+ "properties": {
21769
+ "value": {
21770
+ "type": [
21771
+ "number",
21772
+ "null"
21773
+ ]
21774
+ },
21775
+ "measuredSessions": {
21776
+ "type": "integer"
21777
+ },
21778
+ "missingSessions": {
21779
+ "type": "integer"
21780
+ }
21781
+ },
21782
+ "required": [
21783
+ "value",
21784
+ "measuredSessions",
21785
+ "missingSessions"
21786
+ ]
21787
+ },
21788
+ "cacheWrite": {
21789
+ "type": "object",
21790
+ "properties": {
21791
+ "value": {
21792
+ "type": [
21793
+ "number",
21794
+ "null"
21795
+ ]
21796
+ },
21797
+ "measuredSessions": {
21798
+ "type": "integer"
21799
+ },
21800
+ "missingSessions": {
21801
+ "type": "integer"
21802
+ }
21803
+ },
21804
+ "required": [
21805
+ "value",
21806
+ "measuredSessions",
21807
+ "missingSessions"
21808
+ ]
21809
+ },
21810
+ "reasoning": {
21811
+ "type": "object",
21812
+ "properties": {
21813
+ "value": {
21814
+ "type": [
21815
+ "number",
21816
+ "null"
21817
+ ]
21818
+ },
21819
+ "measuredSessions": {
21820
+ "type": "integer"
21821
+ },
21822
+ "missingSessions": {
21823
+ "type": "integer"
21824
+ }
21825
+ },
21826
+ "required": [
21827
+ "value",
21828
+ "measuredSessions",
21829
+ "missingSessions"
21830
+ ]
21831
+ },
21832
+ "thinking": {
21833
+ "type": "object",
21834
+ "properties": {
21835
+ "value": {
21836
+ "type": [
21837
+ "number",
21838
+ "null"
21839
+ ]
21840
+ },
21841
+ "measuredSessions": {
21842
+ "type": "integer"
21843
+ },
21844
+ "missingSessions": {
21845
+ "type": "integer"
21846
+ }
21847
+ },
21848
+ "required": [
21849
+ "value",
21850
+ "measuredSessions",
21851
+ "missingSessions"
21852
+ ]
21853
+ }
21854
+ },
21855
+ "required": [
21856
+ "uncachedInput",
21857
+ "output",
21858
+ "cacheRead",
21859
+ "cacheWrite",
21860
+ "reasoning",
21861
+ "thinking"
21862
+ ]
21863
+ },
21864
+ "modelUnattributedSessions": {
21865
+ "type": "integer"
21866
+ },
21867
+ "swarmUnattributedSessions": {
21868
+ "type": "integer"
21869
+ }
21870
+ },
21871
+ "required": [
21872
+ "sessions",
21873
+ "errorSessions",
21874
+ "completedTasks",
21875
+ "tokens",
21876
+ "modelUnattributedSessions",
21877
+ "swarmUnattributedSessions"
21878
+ ]
21879
+ }
21880
+ },
21881
+ "required": [
21882
+ "statusId",
21883
+ "keyType",
21884
+ "keySuffix",
21885
+ "scope",
21886
+ "scopeId",
21887
+ "windowKey",
21888
+ "durationMins",
21889
+ "startsAt",
21890
+ "endsAt",
21891
+ "dataThrough",
21892
+ "observedAt",
21893
+ "observationAgeMs",
21894
+ "modelScope",
21895
+ "unavailableReason",
21896
+ "usage"
21897
+ ]
21898
+ }
21899
+ }
21900
+ },
21901
+ "required": [
21902
+ "success",
21903
+ "asOf",
21904
+ "accounting",
21905
+ "windows"
21906
+ ]
21907
+ }
21908
+ }
21909
+ }
21910
+ },
21911
+ "400": {
21912
+ "description": "Invalid filters",
21913
+ "content": {
21914
+ "application/json": {
21915
+ "schema": {
21916
+ "$ref": "#/components/schemas/ErrorResponse"
21917
+ }
21918
+ }
21919
+ }
21920
+ },
21921
+ "401": {
21922
+ "description": "Unauthorized",
21923
+ "content": {
21924
+ "application/json": {
21925
+ "schema": {
21926
+ "$ref": "#/components/schemas/ErrorResponse"
21927
+ }
21928
+ }
21929
+ }
21930
+ },
21931
+ "422": {
21932
+ "description": "Requested usage exceeds the aggregation bounds",
21933
+ "content": {
21934
+ "application/json": {
21935
+ "schema": {
21936
+ "$ref": "#/components/schemas/ErrorResponse"
21937
+ }
21938
+ }
21939
+ }
21940
+ },
21941
+ "429": {
21942
+ "description": "Usage query budget exhausted. Retry after one second",
21943
+ "content": {
21944
+ "application/json": {
21945
+ "schema": {
21946
+ "$ref": "#/components/schemas/ErrorResponse"
21947
+ }
21948
+ }
21949
+ }
21950
+ }
21951
+ }
21952
+ }
21953
+ },
20782
21954
  "/api/keys/costs": {
20783
21955
  "get": {
20784
21956
  "summary": "Get aggregated cost data per API key",
@@ -29349,6 +30521,633 @@
29349
30521
  }
29350
30522
  }
29351
30523
  },
30524
+ "/api/model-groups": {
30525
+ "get": {
30526
+ "summary": "List model groups",
30527
+ "description": "Every model group with its member profiles in order, by name.",
30528
+ "tags": [
30529
+ "Models"
30530
+ ],
30531
+ "security": [
30532
+ {
30533
+ "bearerAuth": []
30534
+ }
30535
+ ],
30536
+ "responses": {
30537
+ "200": {
30538
+ "description": "Model groups",
30539
+ "content": {
30540
+ "application/json": {
30541
+ "schema": {
30542
+ "type": "object",
30543
+ "properties": {
30544
+ "groups": {
30545
+ "type": "array",
30546
+ "items": {
30547
+ "type": "object",
30548
+ "properties": {
30549
+ "id": {
30550
+ "type": "string"
30551
+ },
30552
+ "name": {
30553
+ "type": "string"
30554
+ },
30555
+ "description": {
30556
+ "type": [
30557
+ "string",
30558
+ "null"
30559
+ ]
30560
+ },
30561
+ "seededFrom": {
30562
+ "type": [
30563
+ "string",
30564
+ "null"
30565
+ ]
30566
+ },
30567
+ "members": {
30568
+ "type": "array",
30569
+ "items": {
30570
+ "type": "string"
30571
+ }
30572
+ },
30573
+ "createdAt": {
30574
+ "type": "string"
30575
+ },
30576
+ "lastUpdatedAt": {
30577
+ "type": "string"
30578
+ }
30579
+ },
30580
+ "required": [
30581
+ "id",
30582
+ "name",
30583
+ "description",
30584
+ "seededFrom",
30585
+ "members",
30586
+ "createdAt",
30587
+ "lastUpdatedAt"
30588
+ ]
30589
+ }
30590
+ }
30591
+ },
30592
+ "required": [
30593
+ "groups"
30594
+ ]
30595
+ }
30596
+ }
30597
+ }
30598
+ }
30599
+ }
30600
+ },
30601
+ "post": {
30602
+ "summary": "Create a model group",
30603
+ "description": "A group is an ordered list of model profiles that may span harnesses. Every member must be an existing profile, listed once. The name may not be a model profile's (groups and profiles share one name space; 409). Lead, operator or dashboard user.",
30604
+ "tags": [
30605
+ "Models"
30606
+ ],
30607
+ "security": [
30608
+ {
30609
+ "bearerAuth": []
30610
+ }
30611
+ ],
30612
+ "requestBody": {
30613
+ "content": {
30614
+ "application/json": {
30615
+ "schema": {
30616
+ "type": "object",
30617
+ "properties": {
30618
+ "name": {
30619
+ "type": "string",
30620
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,99}$"
30621
+ },
30622
+ "description": {
30623
+ "type": [
30624
+ "string",
30625
+ "null"
30626
+ ],
30627
+ "maxLength": 500
30628
+ },
30629
+ "members": {
30630
+ "type": "array",
30631
+ "items": {
30632
+ "type": "string",
30633
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,99}$"
30634
+ },
30635
+ "minItems": 1,
30636
+ "maxItems": 20,
30637
+ "description": "Profile names in preference order, first preferred. Any harness; no repeats."
30638
+ }
30639
+ },
30640
+ "required": [
30641
+ "name",
30642
+ "members"
30643
+ ]
30644
+ }
30645
+ }
30646
+ }
30647
+ },
30648
+ "responses": {
30649
+ "201": {
30650
+ "description": "Group created",
30651
+ "content": {
30652
+ "application/json": {
30653
+ "schema": {
30654
+ "type": "object",
30655
+ "properties": {
30656
+ "id": {
30657
+ "type": "string"
30658
+ },
30659
+ "name": {
30660
+ "type": "string"
30661
+ },
30662
+ "description": {
30663
+ "type": [
30664
+ "string",
30665
+ "null"
30666
+ ]
30667
+ },
30668
+ "seededFrom": {
30669
+ "type": [
30670
+ "string",
30671
+ "null"
30672
+ ]
30673
+ },
30674
+ "members": {
30675
+ "type": "array",
30676
+ "items": {
30677
+ "type": "string"
30678
+ }
30679
+ },
30680
+ "createdAt": {
30681
+ "type": "string"
30682
+ },
30683
+ "lastUpdatedAt": {
30684
+ "type": "string"
30685
+ }
30686
+ },
30687
+ "required": [
30688
+ "id",
30689
+ "name",
30690
+ "description",
30691
+ "seededFrom",
30692
+ "members",
30693
+ "createdAt",
30694
+ "lastUpdatedAt"
30695
+ ]
30696
+ }
30697
+ }
30698
+ }
30699
+ },
30700
+ "400": {
30701
+ "description": "Validation error",
30702
+ "content": {
30703
+ "application/json": {
30704
+ "schema": {
30705
+ "$ref": "#/components/schemas/ErrorResponse"
30706
+ }
30707
+ }
30708
+ }
30709
+ },
30710
+ "403": {
30711
+ "description": "Forbidden",
30712
+ "content": {
30713
+ "application/json": {
30714
+ "schema": {
30715
+ "$ref": "#/components/schemas/ErrorResponse"
30716
+ }
30717
+ }
30718
+ }
30719
+ },
30720
+ "409": {
30721
+ "description": "A group or profile with that name exists",
30722
+ "content": {
30723
+ "application/json": {
30724
+ "schema": {
30725
+ "$ref": "#/components/schemas/ErrorResponse"
30726
+ }
30727
+ }
30728
+ }
30729
+ }
30730
+ }
30731
+ }
30732
+ },
30733
+ "/api/model-groups/{name}": {
30734
+ "get": {
30735
+ "summary": "Get one model group",
30736
+ "tags": [
30737
+ "Models"
30738
+ ],
30739
+ "security": [
30740
+ {
30741
+ "bearerAuth": []
30742
+ }
30743
+ ],
30744
+ "parameters": [
30745
+ {
30746
+ "schema": {
30747
+ "type": "string"
30748
+ },
30749
+ "required": true,
30750
+ "name": "name",
30751
+ "in": "path"
30752
+ }
30753
+ ],
30754
+ "responses": {
30755
+ "200": {
30756
+ "description": "The model group",
30757
+ "content": {
30758
+ "application/json": {
30759
+ "schema": {
30760
+ "type": "object",
30761
+ "properties": {
30762
+ "id": {
30763
+ "type": "string"
30764
+ },
30765
+ "name": {
30766
+ "type": "string"
30767
+ },
30768
+ "description": {
30769
+ "type": [
30770
+ "string",
30771
+ "null"
30772
+ ]
30773
+ },
30774
+ "seededFrom": {
30775
+ "type": [
30776
+ "string",
30777
+ "null"
30778
+ ]
30779
+ },
30780
+ "members": {
30781
+ "type": "array",
30782
+ "items": {
30783
+ "type": "string"
30784
+ }
30785
+ },
30786
+ "createdAt": {
30787
+ "type": "string"
30788
+ },
30789
+ "lastUpdatedAt": {
30790
+ "type": "string"
30791
+ }
30792
+ },
30793
+ "required": [
30794
+ "id",
30795
+ "name",
30796
+ "description",
30797
+ "seededFrom",
30798
+ "members",
30799
+ "createdAt",
30800
+ "lastUpdatedAt"
30801
+ ]
30802
+ }
30803
+ }
30804
+ }
30805
+ },
30806
+ "404": {
30807
+ "description": "No group with that name",
30808
+ "content": {
30809
+ "application/json": {
30810
+ "schema": {
30811
+ "$ref": "#/components/schemas/ErrorResponse"
30812
+ }
30813
+ }
30814
+ }
30815
+ }
30816
+ }
30817
+ },
30818
+ "patch": {
30819
+ "summary": "Update a model group",
30820
+ "description": "Changes the description (`null` clears it). The name is fixed; reorder or replace members with `PUT /api/model-groups/{name}/members`. Lead, operator or dashboard user.",
30821
+ "tags": [
30822
+ "Models"
30823
+ ],
30824
+ "security": [
30825
+ {
30826
+ "bearerAuth": []
30827
+ }
30828
+ ],
30829
+ "parameters": [
30830
+ {
30831
+ "schema": {
30832
+ "type": "string"
30833
+ },
30834
+ "required": true,
30835
+ "name": "name",
30836
+ "in": "path"
30837
+ }
30838
+ ],
30839
+ "requestBody": {
30840
+ "content": {
30841
+ "application/json": {
30842
+ "schema": {
30843
+ "type": "object",
30844
+ "properties": {
30845
+ "description": {
30846
+ "type": [
30847
+ "string",
30848
+ "null"
30849
+ ],
30850
+ "maxLength": 500
30851
+ }
30852
+ },
30853
+ "required": [
30854
+ "description"
30855
+ ]
30856
+ }
30857
+ }
30858
+ }
30859
+ },
30860
+ "responses": {
30861
+ "200": {
30862
+ "description": "Group updated",
30863
+ "content": {
30864
+ "application/json": {
30865
+ "schema": {
30866
+ "type": "object",
30867
+ "properties": {
30868
+ "id": {
30869
+ "type": "string"
30870
+ },
30871
+ "name": {
30872
+ "type": "string"
30873
+ },
30874
+ "description": {
30875
+ "type": [
30876
+ "string",
30877
+ "null"
30878
+ ]
30879
+ },
30880
+ "seededFrom": {
30881
+ "type": [
30882
+ "string",
30883
+ "null"
30884
+ ]
30885
+ },
30886
+ "members": {
30887
+ "type": "array",
30888
+ "items": {
30889
+ "type": "string"
30890
+ }
30891
+ },
30892
+ "createdAt": {
30893
+ "type": "string"
30894
+ },
30895
+ "lastUpdatedAt": {
30896
+ "type": "string"
30897
+ }
30898
+ },
30899
+ "required": [
30900
+ "id",
30901
+ "name",
30902
+ "description",
30903
+ "seededFrom",
30904
+ "members",
30905
+ "createdAt",
30906
+ "lastUpdatedAt"
30907
+ ]
30908
+ }
30909
+ }
30910
+ }
30911
+ },
30912
+ "400": {
30913
+ "description": "Validation error",
30914
+ "content": {
30915
+ "application/json": {
30916
+ "schema": {
30917
+ "$ref": "#/components/schemas/ErrorResponse"
30918
+ }
30919
+ }
30920
+ }
30921
+ },
30922
+ "403": {
30923
+ "description": "Forbidden",
30924
+ "content": {
30925
+ "application/json": {
30926
+ "schema": {
30927
+ "$ref": "#/components/schemas/ErrorResponse"
30928
+ }
30929
+ }
30930
+ }
30931
+ },
30932
+ "404": {
30933
+ "description": "No group with that name",
30934
+ "content": {
30935
+ "application/json": {
30936
+ "schema": {
30937
+ "$ref": "#/components/schemas/ErrorResponse"
30938
+ }
30939
+ }
30940
+ }
30941
+ }
30942
+ }
30943
+ },
30944
+ "delete": {
30945
+ "summary": "Delete a model group",
30946
+ "description": "Refused (409) for a shipped tier group (`smol`, `regular`, `smart`, `ultra`; edit it instead, it would come back at the next boot), and while a schedule names the group or a task holds it (unfinished, or superseded and still owed its resume). Lead, operator or dashboard user.",
30947
+ "tags": [
30948
+ "Models"
30949
+ ],
30950
+ "security": [
30951
+ {
30952
+ "bearerAuth": []
30953
+ }
30954
+ ],
30955
+ "parameters": [
30956
+ {
30957
+ "schema": {
30958
+ "type": "string"
30959
+ },
30960
+ "required": true,
30961
+ "name": "name",
30962
+ "in": "path"
30963
+ }
30964
+ ],
30965
+ "responses": {
30966
+ "200": {
30967
+ "description": "Group deleted",
30968
+ "content": {
30969
+ "application/json": {
30970
+ "schema": {
30971
+ "type": "object",
30972
+ "properties": {
30973
+ "deleted": {
30974
+ "type": "boolean",
30975
+ "enum": [
30976
+ true
30977
+ ]
30978
+ }
30979
+ },
30980
+ "required": [
30981
+ "deleted"
30982
+ ]
30983
+ }
30984
+ }
30985
+ }
30986
+ },
30987
+ "403": {
30988
+ "description": "Forbidden",
30989
+ "content": {
30990
+ "application/json": {
30991
+ "schema": {
30992
+ "$ref": "#/components/schemas/ErrorResponse"
30993
+ }
30994
+ }
30995
+ }
30996
+ },
30997
+ "404": {
30998
+ "description": "No group with that name",
30999
+ "content": {
31000
+ "application/json": {
31001
+ "schema": {
31002
+ "$ref": "#/components/schemas/ErrorResponse"
31003
+ }
31004
+ }
31005
+ }
31006
+ },
31007
+ "409": {
31008
+ "description": "The group is a seed or still in use",
31009
+ "content": {
31010
+ "application/json": {
31011
+ "schema": {
31012
+ "$ref": "#/components/schemas/ErrorResponse"
31013
+ }
31014
+ }
31015
+ }
31016
+ }
31017
+ }
31018
+ }
31019
+ },
31020
+ "/api/model-groups/{name}/members": {
31021
+ "put": {
31022
+ "summary": "Replace a model group's members",
31023
+ "description": "Replaces the whole ordered member list in one transaction; send the full list to reorder. Every member must be an existing profile, listed once. Lead, operator or dashboard user.",
31024
+ "tags": [
31025
+ "Models"
31026
+ ],
31027
+ "security": [
31028
+ {
31029
+ "bearerAuth": []
31030
+ }
31031
+ ],
31032
+ "parameters": [
31033
+ {
31034
+ "schema": {
31035
+ "type": "string"
31036
+ },
31037
+ "required": true,
31038
+ "name": "name",
31039
+ "in": "path"
31040
+ }
31041
+ ],
31042
+ "requestBody": {
31043
+ "content": {
31044
+ "application/json": {
31045
+ "schema": {
31046
+ "type": "object",
31047
+ "properties": {
31048
+ "members": {
31049
+ "type": "array",
31050
+ "items": {
31051
+ "type": "string",
31052
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,99}$"
31053
+ },
31054
+ "minItems": 1,
31055
+ "maxItems": 20,
31056
+ "description": "Profile names in preference order, first preferred. Any harness; no repeats."
31057
+ }
31058
+ },
31059
+ "required": [
31060
+ "members"
31061
+ ]
31062
+ }
31063
+ }
31064
+ }
31065
+ },
31066
+ "responses": {
31067
+ "200": {
31068
+ "description": "Members replaced",
31069
+ "content": {
31070
+ "application/json": {
31071
+ "schema": {
31072
+ "type": "object",
31073
+ "properties": {
31074
+ "id": {
31075
+ "type": "string"
31076
+ },
31077
+ "name": {
31078
+ "type": "string"
31079
+ },
31080
+ "description": {
31081
+ "type": [
31082
+ "string",
31083
+ "null"
31084
+ ]
31085
+ },
31086
+ "seededFrom": {
31087
+ "type": [
31088
+ "string",
31089
+ "null"
31090
+ ]
31091
+ },
31092
+ "members": {
31093
+ "type": "array",
31094
+ "items": {
31095
+ "type": "string"
31096
+ }
31097
+ },
31098
+ "createdAt": {
31099
+ "type": "string"
31100
+ },
31101
+ "lastUpdatedAt": {
31102
+ "type": "string"
31103
+ }
31104
+ },
31105
+ "required": [
31106
+ "id",
31107
+ "name",
31108
+ "description",
31109
+ "seededFrom",
31110
+ "members",
31111
+ "createdAt",
31112
+ "lastUpdatedAt"
31113
+ ]
31114
+ }
31115
+ }
31116
+ }
31117
+ },
31118
+ "400": {
31119
+ "description": "Validation error",
31120
+ "content": {
31121
+ "application/json": {
31122
+ "schema": {
31123
+ "$ref": "#/components/schemas/ErrorResponse"
31124
+ }
31125
+ }
31126
+ }
31127
+ },
31128
+ "403": {
31129
+ "description": "Forbidden",
31130
+ "content": {
31131
+ "application/json": {
31132
+ "schema": {
31133
+ "$ref": "#/components/schemas/ErrorResponse"
31134
+ }
31135
+ }
31136
+ }
31137
+ },
31138
+ "404": {
31139
+ "description": "No group with that name",
31140
+ "content": {
31141
+ "application/json": {
31142
+ "schema": {
31143
+ "$ref": "#/components/schemas/ErrorResponse"
31144
+ }
31145
+ }
31146
+ }
31147
+ }
31148
+ }
31149
+ }
31150
+ },
29352
31151
  "/api/model-profiles": {
29353
31152
  "get": {
29354
31153
  "summary": "List model profiles",
@@ -29510,7 +31309,7 @@
29510
31309
  },
29511
31310
  "post": {
29512
31311
  "summary": "Create a model profile",
29513
- "description": "A profile runs on one harness. `model` must run on that harness and be in the model catalog unless `allowCustomModel` is true (a gateway id, a fresh launch); a `latest:` alias is accepted and resolves at claim. `effort` must be a level the harness and model support. `credentials` pins which pooled keys the profile uses: per credential var of the harness, the last 5 characters of each allowed key (`CODEX_OAUTH` is not supported). `fallbacks` lists profiles on the same harness, in order, that a task on this profile hops to when a provider error (rate limit, seat, overload, auth, empty key pool) ends it; no repeats, no self, no cycle. Operator only (the shared API key).",
31312
+ "description": "A profile runs on one harness. `model` must run on that harness and be in the model catalog unless `allowCustomModel` is true (a gateway id, a fresh launch); a `latest:` alias is accepted and resolves at claim. `effort` must be a level the harness and model support. `credentials` pins which pooled keys the profile uses: per credential var of the harness, the last 5 characters of each allowed key (`CODEX_OAUTH` is not supported). `fallbacks` lists profiles on the same harness, in order, that a task on this profile hops to when a provider error (rate limit, seat, overload, auth, empty key pool) ends it; no repeats, no self, no cycle. The name may not be a model group's (one name space; 409). Operator only (the shared API key).",
29514
31313
  "tags": [
29515
31314
  "Models"
29516
31315
  ],
@@ -29740,7 +31539,7 @@
29740
31539
  }
29741
31540
  },
29742
31541
  "409": {
29743
- "description": "A profile with that name exists",
31542
+ "description": "A profile or model group with that name exists",
29744
31543
  "content": {
29745
31544
  "application/json": {
29746
31545
  "schema": {
@@ -30123,7 +31922,7 @@
30123
31922
  },
30124
31923
  "delete": {
30125
31924
  "summary": "Delete a model profile",
30126
- "description": "Refused (409) for a shipped `<harness>-<tier>` seed (edit it instead; it would come back at the next boot), and while an agent has the profile as its default, a schedule names it, another profile lists it as a fallback, or a task holds it (unfinished, or superseded and still owed its resume). Operator only (the shared API key).",
31925
+ "description": "Refused (409) for a shipped `<harness>-<tier>` seed (edit it instead; it would come back at the next boot), and while an agent has the profile as its default, a schedule names it, another profile lists it as a fallback, a model group lists it as a member, or a task holds it (unfinished, or superseded and still owed its resume). Operator only (the shared API key).",
30127
31926
  "tags": [
30128
31927
  "Models"
30129
31928
  ],
@@ -36090,7 +37889,7 @@
36090
37889
  }
36091
37890
  },
36092
37891
  "403": {
36093
- "description": "An agent caller names a parentTaskId it neither owns nor created, or a non-lead agent binds the task to a chat thread",
37892
+ "description": "Parent/session access denied, unauthorized chat-thread binding, or routing requirements reject the assignment",
36094
37893
  "content": {
36095
37894
  "application/json": {
36096
37895
  "schema": {
@@ -37100,6 +38899,88 @@
37100
38899
  "verified"
37101
38900
  ]
37102
38901
  }
38902
+ },
38903
+ "uiSpec": {
38904
+ "type": [
38905
+ "object",
38906
+ "null"
38907
+ ],
38908
+ "properties": {
38909
+ "spec": {
38910
+ "type": "object",
38911
+ "properties": {
38912
+ "root": {
38913
+ "type": "string"
38914
+ },
38915
+ "elements": {
38916
+ "type": "object",
38917
+ "additionalProperties": {}
38918
+ },
38919
+ "state": {
38920
+ "type": "object",
38921
+ "additionalProperties": {}
38922
+ }
38923
+ },
38924
+ "required": [
38925
+ "root",
38926
+ "elements"
38927
+ ]
38928
+ },
38929
+ "actions": {
38930
+ "type": "object",
38931
+ "additionalProperties": {
38932
+ "oneOf": [
38933
+ {
38934
+ "type": "object",
38935
+ "properties": {
38936
+ "kind": {
38937
+ "type": "string",
38938
+ "enum": [
38939
+ "follow_up"
38940
+ ]
38941
+ },
38942
+ "prompt": {
38943
+ "type": "string"
38944
+ }
38945
+ },
38946
+ "required": [
38947
+ "kind",
38948
+ "prompt"
38949
+ ]
38950
+ },
38951
+ {
38952
+ "type": "object",
38953
+ "properties": {
38954
+ "kind": {
38955
+ "type": "string",
38956
+ "enum": [
38957
+ "script"
38958
+ ]
38959
+ },
38960
+ "script": {
38961
+ "type": "string"
38962
+ },
38963
+ "args": {
38964
+ "type": "object",
38965
+ "additionalProperties": {}
38966
+ }
38967
+ },
38968
+ "required": [
38969
+ "kind",
38970
+ "script"
38971
+ ]
38972
+ }
38973
+ ]
38974
+ }
38975
+ },
38976
+ "fallbackText": {
38977
+ "type": "string"
38978
+ }
38979
+ },
38980
+ "required": [
38981
+ "spec",
38982
+ "fallbackText"
38983
+ ]
37103
38984
  }
37104
38985
  },
37105
38986
  "required": [
@@ -37107,7 +38988,8 @@
37107
38988
  "supportedSteerModes",
37108
38989
  "logs",
37109
38990
  "attachments",
37110
- "citations"
38991
+ "citations",
38992
+ "uiSpec"
37111
38993
  ]
37112
38994
  }
37113
38995
  ]
@@ -38049,10 +39931,199 @@
38049
39931
  }
38050
39932
  }
38051
39933
  },
39934
+ "/api/tasks/{id}/ui-actions/{actionId}": {
39935
+ "post": {
39936
+ "summary": "Run the action a task card Button declares",
39937
+ "description": "Runs a task card action. Only the task requester may run it: a user token, or the operator key with the requester in `X-Swarm-User-Id`. Agent callers, and operator calls with no picked user, get 403. Needs UI_SPEC_ACTIONS_ENABLED=true. A `follow_up` action runs once per task and action. A `script` action re-runs its allowlisted script (UI_SPEC_SCRIPT_ACTIONS) and returns the new card; it can run again after a 30 s cooldown.",
39938
+ "tags": [
39939
+ "Tasks"
39940
+ ],
39941
+ "security": [
39942
+ {
39943
+ "bearerAuth": []
39944
+ }
39945
+ ],
39946
+ "parameters": [
39947
+ {
39948
+ "schema": {
39949
+ "type": "string"
39950
+ },
39951
+ "required": true,
39952
+ "name": "id",
39953
+ "in": "path"
39954
+ },
39955
+ {
39956
+ "schema": {
39957
+ "type": "string"
39958
+ },
39959
+ "required": true,
39960
+ "name": "actionId",
39961
+ "in": "path"
39962
+ }
39963
+ ],
39964
+ "responses": {
39965
+ "200": {
39966
+ "description": "The follow-up started or already ran, or the script action replaced the card (`refreshed`, with the new `uiSpec`)",
39967
+ "content": {
39968
+ "application/json": {
39969
+ "schema": {
39970
+ "type": "object",
39971
+ "properties": {
39972
+ "status": {
39973
+ "type": "string",
39974
+ "enum": [
39975
+ "started",
39976
+ "already_done",
39977
+ "refreshed"
39978
+ ]
39979
+ },
39980
+ "taskId": {
39981
+ "type": "string"
39982
+ },
39983
+ "uiSpec": {
39984
+ "type": "object",
39985
+ "properties": {
39986
+ "spec": {
39987
+ "type": "object",
39988
+ "properties": {
39989
+ "root": {
39990
+ "type": "string"
39991
+ },
39992
+ "elements": {
39993
+ "type": "object",
39994
+ "additionalProperties": {}
39995
+ },
39996
+ "state": {
39997
+ "type": "object",
39998
+ "additionalProperties": {}
39999
+ }
40000
+ },
40001
+ "required": [
40002
+ "root",
40003
+ "elements"
40004
+ ]
40005
+ },
40006
+ "actions": {
40007
+ "type": "object",
40008
+ "additionalProperties": {
40009
+ "oneOf": [
40010
+ {
40011
+ "type": "object",
40012
+ "properties": {
40013
+ "kind": {
40014
+ "type": "string",
40015
+ "enum": [
40016
+ "follow_up"
40017
+ ]
40018
+ },
40019
+ "prompt": {
40020
+ "type": "string"
40021
+ }
40022
+ },
40023
+ "required": [
40024
+ "kind",
40025
+ "prompt"
40026
+ ]
40027
+ },
40028
+ {
40029
+ "type": "object",
40030
+ "properties": {
40031
+ "kind": {
40032
+ "type": "string",
40033
+ "enum": [
40034
+ "script"
40035
+ ]
40036
+ },
40037
+ "script": {
40038
+ "type": "string"
40039
+ },
40040
+ "args": {
40041
+ "type": "object",
40042
+ "additionalProperties": {}
40043
+ }
40044
+ },
40045
+ "required": [
40046
+ "kind",
40047
+ "script"
40048
+ ]
40049
+ }
40050
+ ]
40051
+ }
40052
+ },
40053
+ "fallbackText": {
40054
+ "type": "string"
40055
+ }
40056
+ },
40057
+ "required": [
40058
+ "spec",
40059
+ "fallbackText"
40060
+ ]
40061
+ }
40062
+ },
40063
+ "required": [
40064
+ "status"
40065
+ ]
40066
+ }
40067
+ }
40068
+ }
40069
+ },
40070
+ "403": {
40071
+ "description": "Only the task requester may run the action, or the action's script is not allowlisted or changed since it was allowlisted",
40072
+ "content": {
40073
+ "application/json": {
40074
+ "schema": {
40075
+ "$ref": "#/components/schemas/ErrorResponse"
40076
+ }
40077
+ }
40078
+ }
40079
+ },
40080
+ "404": {
40081
+ "description": "Task or action not found",
40082
+ "content": {
40083
+ "application/json": {
40084
+ "schema": {
40085
+ "$ref": "#/components/schemas/ErrorResponse"
40086
+ }
40087
+ }
40088
+ }
40089
+ },
40090
+ "409": {
40091
+ "description": "Card actions are turned off (UI_SPEC_ACTIONS_ENABLED), or the script action is already running (with `Retry-After`)",
40092
+ "content": {
40093
+ "application/json": {
40094
+ "schema": {
40095
+ "$ref": "#/components/schemas/ErrorResponse"
40096
+ }
40097
+ }
40098
+ }
40099
+ },
40100
+ "422": {
40101
+ "description": "The script failed or returned an invalid card; the old card stays",
40102
+ "content": {
40103
+ "application/json": {
40104
+ "schema": {
40105
+ "$ref": "#/components/schemas/ErrorResponse"
40106
+ }
40107
+ }
40108
+ }
40109
+ },
40110
+ "429": {
40111
+ "description": "The script action ran recently; `Retry-After` says when it can run again",
40112
+ "content": {
40113
+ "application/json": {
40114
+ "schema": {
40115
+ "$ref": "#/components/schemas/ErrorResponse"
40116
+ }
40117
+ }
40118
+ }
40119
+ }
40120
+ }
40121
+ }
40122
+ },
38052
40123
  "/api/tasks/{id}/supersede": {
38053
40124
  "post": {
38054
40125
  "summary": "Supersede an in-progress task (terminate + spawn resume follow-up)",
38055
- "description": "Marks the original task `superseded` (terminal) and creates a fresh `taskType=\"resume\"` follow-up so a worker can pick up the work in a new provider session. Workflow-step tasks (those with `workflowRunStepId`) are carved out: the original is marked `failed` with reason `superseded_workflow_task` and no follow-up is created — the workflow engine's retry/failure policy applies. With `reason: provider_fallback` (and its `errorClass`), the resume runs on the same agent with the next fallback profile that passes the profile check; when none is left, or the task is a workflow step, nothing changes and `kind: noFallback` tells the worker to fail the task itself, led by `failureReason` when set.",
40126
+ "description": "Marks the original task `superseded` (terminal) and creates a fresh `taskType=\"resume\"` follow-up so a worker can pick up the work in a new provider session. Workflow-step tasks (those with `workflowRunStepId`) are carved out: the original is marked `failed` with reason `superseded_workflow_task` and no follow-up is created — the workflow engine's retry/failure policy applies, and the task moves to `superseded` once the engine queues the step's retry or the step ends without failing. With `reason: provider_fallback` (and its `errorClass`), the resume runs on the same agent with the next fallback profile that passes the profile check; when none is left, or the task is a workflow step, nothing changes and `kind: noFallback` tells the worker to fail the task itself, led by `failureReason` when set.",
38056
40127
  "tags": [
38057
40128
  "Tasks"
38058
40129
  ],
@@ -41315,7 +43386,8 @@
41315
43386
  "amp",
41316
43387
  "cursor",
41317
43388
  "grok",
41318
- "fx"
43389
+ "fx",
43390
+ "system-one"
41319
43391
  ]
41320
43392
  },
41321
43393
  "required": true,
@@ -41401,7 +43473,8 @@
41401
43473
  "amp",
41402
43474
  "cursor",
41403
43475
  "grok",
41404
- "fx"
43476
+ "fx",
43477
+ "system-one"
41405
43478
  ]
41406
43479
  },
41407
43480
  "required": true,
@@ -41520,7 +43593,8 @@
41520
43593
  "amp",
41521
43594
  "cursor",
41522
43595
  "grok",
41523
- "fx"
43596
+ "fx",
43597
+ "system-one"
41524
43598
  ]
41525
43599
  },
41526
43600
  "required": true,
@@ -41607,7 +43681,8 @@
41607
43681
  "amp",
41608
43682
  "cursor",
41609
43683
  "grok",
41610
- "fx"
43684
+ "fx",
43685
+ "system-one"
41611
43686
  ]
41612
43687
  },
41613
43688
  "required": true,
@@ -51977,6 +54052,42 @@
51977
54052
  "type": "string",
51978
54053
  "minLength": 1
51979
54054
  },
54055
+ "credentialKeyType": {
54056
+ "type": [
54057
+ "string",
54058
+ "null"
54059
+ ],
54060
+ "pattern": "^[A-Z][A-Z0-9_]{0,79}$"
54061
+ },
54062
+ "credentialKeySuffix": {
54063
+ "type": [
54064
+ "string",
54065
+ "null"
54066
+ ],
54067
+ "minLength": 1,
54068
+ "maxLength": 10
54069
+ },
54070
+ "harness": {
54071
+ "type": [
54072
+ "string",
54073
+ "null"
54074
+ ],
54075
+ "enum": [
54076
+ "claude",
54077
+ "codex",
54078
+ "pi",
54079
+ "devin",
54080
+ "claude-managed",
54081
+ "opencode",
54082
+ "acp",
54083
+ "dsh",
54084
+ "amp",
54085
+ "cursor",
54086
+ "grok",
54087
+ "fx",
54088
+ null
54089
+ ]
54090
+ },
51980
54091
  "totalCostUsd": {
51981
54092
  "type": "number"
51982
54093
  },
@@ -51995,7 +54106,10 @@
51995
54106
  "minimum": 0
51996
54107
  },
51997
54108
  "cacheReadTokens": {
51998
- "type": "integer",
54109
+ "type": [
54110
+ "integer",
54111
+ "null"
54112
+ ],
51999
54113
  "minimum": 0
52000
54114
  },
52001
54115
  "cacheWriteTokens": {
@@ -52104,7 +54218,8 @@
52104
54218
  "amp",
52105
54219
  "cursor",
52106
54220
  "grok",
52107
- "fx"
54221
+ "fx",
54222
+ "system-one"
52108
54223
  ]
52109
54224
  },
52110
54225
  "createdAt": {
@@ -52156,6 +54271,26 @@
52156
54271
  }
52157
54272
  }
52158
54273
  }
54274
+ },
54275
+ "403": {
54276
+ "description": "Untrusted session attribution",
54277
+ "content": {
54278
+ "application/json": {
54279
+ "schema": {
54280
+ "$ref": "#/components/schemas/ErrorResponse"
54281
+ }
54282
+ }
54283
+ }
54284
+ },
54285
+ "409": {
54286
+ "description": "Session identity conflict",
54287
+ "content": {
54288
+ "application/json": {
54289
+ "schema": {
54290
+ "$ref": "#/components/schemas/ErrorResponse"
54291
+ }
54292
+ }
54293
+ }
52159
54294
  }
52160
54295
  }
52161
54296
  },
@@ -52345,6 +54480,12 @@
52345
54480
  },
52346
54481
  "subscriptionCostUsd": {
52347
54482
  "type": "number"
54483
+ },
54484
+ "credentialUnattributedCostUsd": {
54485
+ "type": "number"
54486
+ },
54487
+ "credentialUnattributedSessions": {
54488
+ "type": "integer"
52348
54489
  }
52349
54490
  },
52350
54491
  "required": [
@@ -52360,7 +54501,9 @@
52360
54501
  "attributableCostUsd",
52361
54502
  "excludedCostUsd",
52362
54503
  "excludedTaskCount",
52363
- "subscriptionCostUsd"
54504
+ "subscriptionCostUsd",
54505
+ "credentialUnattributedCostUsd",
54506
+ "credentialUnattributedSessions"
52364
54507
  ]
52365
54508
  },
52366
54509
  "daily": {
@@ -52385,6 +54528,12 @@
52385
54528
  },
52386
54529
  "subscriptionCostUsd": {
52387
54530
  "type": "number"
54531
+ },
54532
+ "credentialUnattributedCostUsd": {
54533
+ "type": "number"
54534
+ },
54535
+ "credentialUnattributedSessions": {
54536
+ "type": "integer"
52388
54537
  }
52389
54538
  },
52390
54539
  "required": [
@@ -52393,7 +54542,9 @@
52393
54542
  "inputTokens",
52394
54543
  "outputTokens",
52395
54544
  "sessions",
52396
- "subscriptionCostUsd"
54545
+ "subscriptionCostUsd",
54546
+ "credentialUnattributedCostUsd",
54547
+ "credentialUnattributedSessions"
52397
54548
  ]
52398
54549
  }
52399
54550
  },
@@ -56262,6 +58413,88 @@
56262
58413
  ]
56263
58414
  }
56264
58415
  },
58416
+ "uiSpec": {
58417
+ "type": [
58418
+ "object",
58419
+ "null"
58420
+ ],
58421
+ "properties": {
58422
+ "spec": {
58423
+ "type": "object",
58424
+ "properties": {
58425
+ "root": {
58426
+ "type": "string"
58427
+ },
58428
+ "elements": {
58429
+ "type": "object",
58430
+ "additionalProperties": {}
58431
+ },
58432
+ "state": {
58433
+ "type": "object",
58434
+ "additionalProperties": {}
58435
+ }
58436
+ },
58437
+ "required": [
58438
+ "root",
58439
+ "elements"
58440
+ ]
58441
+ },
58442
+ "actions": {
58443
+ "type": "object",
58444
+ "additionalProperties": {
58445
+ "oneOf": [
58446
+ {
58447
+ "type": "object",
58448
+ "properties": {
58449
+ "kind": {
58450
+ "type": "string",
58451
+ "enum": [
58452
+ "follow_up"
58453
+ ]
58454
+ },
58455
+ "prompt": {
58456
+ "type": "string"
58457
+ }
58458
+ },
58459
+ "required": [
58460
+ "kind",
58461
+ "prompt"
58462
+ ]
58463
+ },
58464
+ {
58465
+ "type": "object",
58466
+ "properties": {
58467
+ "kind": {
58468
+ "type": "string",
58469
+ "enum": [
58470
+ "script"
58471
+ ]
58472
+ },
58473
+ "script": {
58474
+ "type": "string"
58475
+ },
58476
+ "args": {
58477
+ "type": "object",
58478
+ "additionalProperties": {}
58479
+ }
58480
+ },
58481
+ "required": [
58482
+ "kind",
58483
+ "script"
58484
+ ]
58485
+ }
58486
+ ]
58487
+ }
58488
+ },
58489
+ "fallbackText": {
58490
+ "type": "string"
58491
+ }
58492
+ },
58493
+ "required": [
58494
+ "spec",
58495
+ "fallbackText"
58496
+ ]
58497
+ },
56265
58498
  "isLeadTask": {
56266
58499
  "type": "boolean"
56267
58500
  },
@@ -56278,6 +58511,7 @@
56278
58511
  },
56279
58512
  "required": [
56280
58513
  "citations",
58514
+ "uiSpec",
56281
58515
  "isLeadTask",
56282
58516
  "supportedSteerModes"
56283
58517
  ]
@@ -56359,6 +58593,88 @@
56359
58593
  ]
56360
58594
  }
56361
58595
  },
58596
+ "uiSpec": {
58597
+ "type": [
58598
+ "object",
58599
+ "null"
58600
+ ],
58601
+ "properties": {
58602
+ "spec": {
58603
+ "type": "object",
58604
+ "properties": {
58605
+ "root": {
58606
+ "type": "string"
58607
+ },
58608
+ "elements": {
58609
+ "type": "object",
58610
+ "additionalProperties": {}
58611
+ },
58612
+ "state": {
58613
+ "type": "object",
58614
+ "additionalProperties": {}
58615
+ }
58616
+ },
58617
+ "required": [
58618
+ "root",
58619
+ "elements"
58620
+ ]
58621
+ },
58622
+ "actions": {
58623
+ "type": "object",
58624
+ "additionalProperties": {
58625
+ "oneOf": [
58626
+ {
58627
+ "type": "object",
58628
+ "properties": {
58629
+ "kind": {
58630
+ "type": "string",
58631
+ "enum": [
58632
+ "follow_up"
58633
+ ]
58634
+ },
58635
+ "prompt": {
58636
+ "type": "string"
58637
+ }
58638
+ },
58639
+ "required": [
58640
+ "kind",
58641
+ "prompt"
58642
+ ]
58643
+ },
58644
+ {
58645
+ "type": "object",
58646
+ "properties": {
58647
+ "kind": {
58648
+ "type": "string",
58649
+ "enum": [
58650
+ "script"
58651
+ ]
58652
+ },
58653
+ "script": {
58654
+ "type": "string"
58655
+ },
58656
+ "args": {
58657
+ "type": "object",
58658
+ "additionalProperties": {}
58659
+ }
58660
+ },
58661
+ "required": [
58662
+ "kind",
58663
+ "script"
58664
+ ]
58665
+ }
58666
+ ]
58667
+ }
58668
+ },
58669
+ "fallbackText": {
58670
+ "type": "string"
58671
+ }
58672
+ },
58673
+ "required": [
58674
+ "spec",
58675
+ "fallbackText"
58676
+ ]
58677
+ },
56362
58678
  "isLeadTask": {
56363
58679
  "type": "boolean"
56364
58680
  },
@@ -56375,6 +58691,7 @@
56375
58691
  },
56376
58692
  "required": [
56377
58693
  "citations",
58694
+ "uiSpec",
56378
58695
  "isLeadTask",
56379
58696
  "supportedSteerModes"
56380
58697
  ]
@@ -62783,6 +65100,226 @@
62783
65100
  }
62784
65101
  }
62785
65102
  },
65103
+ "/api/tool-hooks": {
65104
+ "post": {
65105
+ "summary": "Run extension tool hooks for a harness-native tool call",
65106
+ "description": "A worker shim reports a harness built-in tool call (bash, read, write, edit). `phase: pre` runs `pre.tool.call` with `callOrigin: native` and returns the decision. `phase: post` runs `post.tool.call` observe-only and returns 202 at once. Only extensions whose manifest `toolSources` includes `\"native\"` receive these calls. The server runs the secret scrubber over the body before any handler sees it, so handlers read `[REDACTED:<name>]` in place of a secret. A `modify` whose args still carry that marker is rejected and the call continues unchanged. Shims must also scrub worker-side before sending.",
65107
+ "tags": [
65108
+ "Extensions"
65109
+ ],
65110
+ "security": [
65111
+ {
65112
+ "bearerAuth": []
65113
+ }
65114
+ ],
65115
+ "requestBody": {
65116
+ "content": {
65117
+ "application/json": {
65118
+ "schema": {
65119
+ "oneOf": [
65120
+ {
65121
+ "type": "object",
65122
+ "properties": {
65123
+ "phase": {
65124
+ "type": "string",
65125
+ "enum": [
65126
+ "pre"
65127
+ ]
65128
+ },
65129
+ "harness": {
65130
+ "type": "string",
65131
+ "minLength": 1,
65132
+ "maxLength": 64,
65133
+ "description": "Worker harness, such as `claude` or `pi`."
65134
+ },
65135
+ "tool": {
65136
+ "type": "string",
65137
+ "minLength": 1,
65138
+ "maxLength": 256,
65139
+ "description": "Canonical tool name, such as `bash` or `edit`."
65140
+ },
65141
+ "nativeTool": {
65142
+ "type": "string",
65143
+ "minLength": 1,
65144
+ "maxLength": 256,
65145
+ "description": "The harness's own tool name."
65146
+ },
65147
+ "args": {
65148
+ "description": "Canonical tool arguments."
65149
+ },
65150
+ "rawArgs": {
65151
+ "description": "The harness's own argument shape."
65152
+ },
65153
+ "toolCallId": {
65154
+ "type": "string",
65155
+ "maxLength": 256
65156
+ },
65157
+ "parentToolCallId": {
65158
+ "type": "string",
65159
+ "maxLength": 256
65160
+ }
65161
+ },
65162
+ "required": [
65163
+ "phase",
65164
+ "harness",
65165
+ "tool"
65166
+ ]
65167
+ },
65168
+ {
65169
+ "type": "object",
65170
+ "properties": {
65171
+ "phase": {
65172
+ "type": "string",
65173
+ "enum": [
65174
+ "post"
65175
+ ]
65176
+ },
65177
+ "harness": {
65178
+ "type": "string",
65179
+ "minLength": 1,
65180
+ "maxLength": 64,
65181
+ "description": "Worker harness, such as `claude` or `pi`."
65182
+ },
65183
+ "tool": {
65184
+ "type": "string",
65185
+ "minLength": 1,
65186
+ "maxLength": 256,
65187
+ "description": "Canonical tool name, such as `bash` or `edit`."
65188
+ },
65189
+ "nativeTool": {
65190
+ "type": "string",
65191
+ "minLength": 1,
65192
+ "maxLength": 256,
65193
+ "description": "The harness's own tool name."
65194
+ },
65195
+ "args": {
65196
+ "description": "Canonical tool arguments."
65197
+ },
65198
+ "rawArgs": {
65199
+ "description": "The harness's own argument shape."
65200
+ },
65201
+ "toolCallId": {
65202
+ "type": "string",
65203
+ "maxLength": 256
65204
+ },
65205
+ "parentToolCallId": {
65206
+ "type": "string",
65207
+ "maxLength": 256
65208
+ },
65209
+ "result": {},
65210
+ "isError": {
65211
+ "type": "boolean"
65212
+ },
65213
+ "durationMs": {
65214
+ "type": "number",
65215
+ "minimum": 0
65216
+ }
65217
+ },
65218
+ "required": [
65219
+ "phase",
65220
+ "harness",
65221
+ "tool",
65222
+ "durationMs"
65223
+ ]
65224
+ }
65225
+ ]
65226
+ }
65227
+ }
65228
+ }
65229
+ },
65230
+ "responses": {
65231
+ "200": {
65232
+ "description": "Pre-call decision",
65233
+ "content": {
65234
+ "application/json": {
65235
+ "schema": {
65236
+ "oneOf": [
65237
+ {
65238
+ "type": "object",
65239
+ "properties": {
65240
+ "action": {
65241
+ "type": "string",
65242
+ "enum": [
65243
+ "continue"
65244
+ ]
65245
+ }
65246
+ },
65247
+ "required": [
65248
+ "action"
65249
+ ]
65250
+ },
65251
+ {
65252
+ "type": "object",
65253
+ "properties": {
65254
+ "action": {
65255
+ "type": "string",
65256
+ "enum": [
65257
+ "modify"
65258
+ ]
65259
+ },
65260
+ "args": {}
65261
+ },
65262
+ "required": [
65263
+ "action"
65264
+ ]
65265
+ },
65266
+ {
65267
+ "type": "object",
65268
+ "properties": {
65269
+ "action": {
65270
+ "type": "string",
65271
+ "enum": [
65272
+ "block"
65273
+ ]
65274
+ },
65275
+ "reason": {
65276
+ "type": "string"
65277
+ }
65278
+ },
65279
+ "required": [
65280
+ "action",
65281
+ "reason"
65282
+ ]
65283
+ }
65284
+ ]
65285
+ }
65286
+ }
65287
+ }
65288
+ },
65289
+ "202": {
65290
+ "description": "Post-call event accepted",
65291
+ "content": {
65292
+ "application/json": {
65293
+ "schema": {
65294
+ "type": "object",
65295
+ "properties": {
65296
+ "accepted": {
65297
+ "type": "boolean",
65298
+ "enum": [
65299
+ true
65300
+ ]
65301
+ }
65302
+ },
65303
+ "required": [
65304
+ "accepted"
65305
+ ]
65306
+ }
65307
+ }
65308
+ }
65309
+ },
65310
+ "400": {
65311
+ "description": "Invalid body or missing X-Agent-ID header",
65312
+ "content": {
65313
+ "application/json": {
65314
+ "schema": {
65315
+ "$ref": "#/components/schemas/ErrorResponse"
65316
+ }
65317
+ }
65318
+ }
65319
+ }
65320
+ }
65321
+ }
65322
+ },
62786
65323
  "/api/trackers/jira/authorize": {
62787
65324
  "get": {
62788
65325
  "summary": "Start the Jira OAuth flow (admin): redirect to the consent screen, or return its URL",
@@ -67536,7 +70073,8 @@
67536
70073
  },
67537
70074
  "/api/users/{id}/merge": {
67538
70075
  "post": {
67539
- "summary": "Merge another user into this one — moves identities + email aliases, deletes source",
70076
+ "summary": "Merge another user into this one: moves identities + email aliases, queues the rest",
70077
+ "description": "Moves the source's identities and email aliases to the target, revokes the source's credentials and records a manual_merge event, all in one short transaction. The attribution rewrite across every table and the deletion of the source run as a background job; poll GET /api/users/merge-jobs/{jobId} until its status is done or failed. While the job runs, the source cannot authenticate and identity lookups resolve to the target.",
67540
70078
  "tags": [
67541
70079
  "Users"
67542
70080
  ],
@@ -67574,137 +70112,19 @@
67574
70112
  }
67575
70113
  },
67576
70114
  "responses": {
67577
- "200": {
67578
- "description": "Merged user",
70115
+ "202": {
70116
+ "description": "The queued merge job",
67579
70117
  "content": {
67580
70118
  "application/json": {
67581
70119
  "schema": {
67582
70120
  "type": "object",
67583
70121
  "properties": {
67584
- "user": {
67585
- "anyOf": [
67586
- {
67587
- "allOf": [
67588
- {
67589
- "$ref": "#/components/schemas/User"
67590
- },
67591
- {
67592
- "type": "object",
67593
- "properties": {
67594
- "identities": {
67595
- "type": "array",
67596
- "items": {
67597
- "type": "object",
67598
- "properties": {
67599
- "kind": {
67600
- "type": "string"
67601
- },
67602
- "externalId": {
67603
- "type": "string"
67604
- }
67605
- },
67606
- "required": [
67607
- "kind",
67608
- "externalId"
67609
- ]
67610
- }
67611
- },
67612
- "tokens": {
67613
- "type": "array",
67614
- "items": {
67615
- "type": "object",
67616
- "properties": {
67617
- "id": {
67618
- "type": "string"
67619
- },
67620
- "userId": {
67621
- "type": "string"
67622
- },
67623
- "label": {
67624
- "type": [
67625
- "string",
67626
- "null"
67627
- ]
67628
- },
67629
- "tokenPreview": {
67630
- "type": "string"
67631
- },
67632
- "createdAt": {
67633
- "type": "string"
67634
- },
67635
- "lastUsedAt": {
67636
- "type": [
67637
- "string",
67638
- "null"
67639
- ]
67640
- },
67641
- "revokedAt": {
67642
- "type": [
67643
- "string",
67644
- "null"
67645
- ]
67646
- }
67647
- },
67648
- "required": [
67649
- "id",
67650
- "userId",
67651
- "label",
67652
- "tokenPreview",
67653
- "createdAt",
67654
- "lastUsedAt",
67655
- "revokedAt"
67656
- ]
67657
- }
67658
- },
67659
- "recentEvents": {
67660
- "type": "array",
67661
- "items": {
67662
- "type": "object",
67663
- "properties": {
67664
- "id": {
67665
- "type": "string"
67666
- },
67667
- "userId": {
67668
- "type": "string"
67669
- },
67670
- "eventType": {
67671
- "type": "string"
67672
- },
67673
- "actor": {
67674
- "type": "string"
67675
- },
67676
- "before": {},
67677
- "after": {},
67678
- "createdAt": {
67679
- "type": "string"
67680
- }
67681
- },
67682
- "required": [
67683
- "id",
67684
- "userId",
67685
- "eventType",
67686
- "actor",
67687
- "createdAt"
67688
- ]
67689
- }
67690
- }
67691
- },
67692
- "required": [
67693
- "identities",
67694
- "tokens",
67695
- "recentEvents"
67696
- ]
67697
- }
67698
- ]
67699
- },
67700
- {
67701
- "type": "null"
67702
- }
67703
- ]
70122
+ "job": {
70123
+ "$ref": "#/components/schemas/UserMergeJob"
67704
70124
  }
67705
70125
  },
67706
70126
  "required": [
67707
- "user"
70127
+ "job"
67708
70128
  ]
67709
70129
  }
67710
70130
  }
@@ -67751,7 +70171,142 @@
67751
70171
  }
67752
70172
  },
67753
70173
  "409": {
67754
- "description": "Source is the last active admin (last_admin)",
70174
+ "description": "Source is the last active admin (last_admin), or a merge job for the source or target is still running (merge_in_progress)",
70175
+ "content": {
70176
+ "application/json": {
70177
+ "schema": {
70178
+ "$ref": "#/components/schemas/ErrorResponse"
70179
+ }
70180
+ }
70181
+ }
70182
+ }
70183
+ }
70184
+ }
70185
+ },
70186
+ "/api/users/merge-jobs": {
70187
+ "get": {
70188
+ "summary": "List background user merge jobs, newest first",
70189
+ "tags": [
70190
+ "Users"
70191
+ ],
70192
+ "security": [
70193
+ {
70194
+ "bearerAuth": []
70195
+ }
70196
+ ],
70197
+ "parameters": [
70198
+ {
70199
+ "schema": {
70200
+ "type": "string",
70201
+ "enum": [
70202
+ "pending",
70203
+ "running",
70204
+ "done",
70205
+ "failed"
70206
+ ]
70207
+ },
70208
+ "required": false,
70209
+ "name": "status",
70210
+ "in": "query"
70211
+ },
70212
+ {
70213
+ "schema": {
70214
+ "type": "integer",
70215
+ "minimum": 1,
70216
+ "maximum": 200
70217
+ },
70218
+ "required": false,
70219
+ "name": "limit",
70220
+ "in": "query"
70221
+ }
70222
+ ],
70223
+ "responses": {
70224
+ "200": {
70225
+ "description": "Merge jobs",
70226
+ "content": {
70227
+ "application/json": {
70228
+ "schema": {
70229
+ "type": "object",
70230
+ "properties": {
70231
+ "jobs": {
70232
+ "type": "array",
70233
+ "items": {
70234
+ "$ref": "#/components/schemas/UserMergeJob"
70235
+ }
70236
+ }
70237
+ },
70238
+ "required": [
70239
+ "jobs"
70240
+ ]
70241
+ }
70242
+ }
70243
+ }
70244
+ },
70245
+ "401": {
70246
+ "description": "Unauthorized",
70247
+ "content": {
70248
+ "application/json": {
70249
+ "schema": {
70250
+ "$ref": "#/components/schemas/ErrorResponse"
70251
+ }
70252
+ }
70253
+ }
70254
+ }
70255
+ }
70256
+ }
70257
+ },
70258
+ "/api/users/merge-jobs/{jobId}": {
70259
+ "get": {
70260
+ "summary": "A background user merge job (poll until status is done or failed)",
70261
+ "tags": [
70262
+ "Users"
70263
+ ],
70264
+ "security": [
70265
+ {
70266
+ "bearerAuth": []
70267
+ }
70268
+ ],
70269
+ "parameters": [
70270
+ {
70271
+ "schema": {
70272
+ "type": "string"
70273
+ },
70274
+ "required": true,
70275
+ "name": "jobId",
70276
+ "in": "path"
70277
+ }
70278
+ ],
70279
+ "responses": {
70280
+ "200": {
70281
+ "description": "The merge job",
70282
+ "content": {
70283
+ "application/json": {
70284
+ "schema": {
70285
+ "type": "object",
70286
+ "properties": {
70287
+ "job": {
70288
+ "$ref": "#/components/schemas/UserMergeJob"
70289
+ }
70290
+ },
70291
+ "required": [
70292
+ "job"
70293
+ ]
70294
+ }
70295
+ }
70296
+ }
70297
+ },
70298
+ "401": {
70299
+ "description": "Unauthorized",
70300
+ "content": {
70301
+ "application/json": {
70302
+ "schema": {
70303
+ "$ref": "#/components/schemas/ErrorResponse"
70304
+ }
70305
+ }
70306
+ }
70307
+ },
70308
+ "404": {
70309
+ "description": "Job not found",
67755
70310
  "content": {
67756
70311
  "application/json": {
67757
70312
  "schema": {
@@ -69171,6 +71726,19 @@
69171
71726
  }
69172
71727
  ],
69173
71728
  "description": "Optional webhook verification format. Omit to keep legacy HMAC-SHA256 behavior with fallback header scanning."
71729
+ },
71730
+ "events": {
71731
+ "type": "array",
71732
+ "items": {
71733
+ "type": "string",
71734
+ "minLength": 1
71735
+ },
71736
+ "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
71737
+ },
71738
+ "eventHeader": {
71739
+ "type": "string",
71740
+ "minLength": 1,
71741
+ "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
69174
71742
  }
69175
71743
  },
69176
71744
  "required": [
@@ -69592,6 +72160,19 @@
69592
72160
  }
69593
72161
  ],
69594
72162
  "description": "Optional webhook verification format. Omit to keep legacy HMAC-SHA256 behavior with fallback header scanning."
72163
+ },
72164
+ "events": {
72165
+ "type": "array",
72166
+ "items": {
72167
+ "type": "string",
72168
+ "minLength": 1
72169
+ },
72170
+ "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
72171
+ },
72172
+ "eventHeader": {
72173
+ "type": "string",
72174
+ "minLength": 1,
72175
+ "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
69595
72176
  }
69596
72177
  },
69597
72178
  "required": [
@@ -70834,6 +73415,41 @@
70834
73415
  }
70835
73416
  ],
70836
73417
  "responses": {
73418
+ "200": {
73419
+ "description": "Delivery skipped: its event is not in the trigger's `events` allowlist. No run was created.",
73420
+ "content": {
73421
+ "application/json": {
73422
+ "schema": {
73423
+ "type": "object",
73424
+ "properties": {
73425
+ "skipped": {
73426
+ "type": "boolean",
73427
+ "enum": [
73428
+ true
73429
+ ]
73430
+ },
73431
+ "reason": {
73432
+ "type": "string",
73433
+ "enum": [
73434
+ "event-not-allowed"
73435
+ ]
73436
+ },
73437
+ "event": {
73438
+ "type": [
73439
+ "string",
73440
+ "null"
73441
+ ]
73442
+ }
73443
+ },
73444
+ "required": [
73445
+ "skipped",
73446
+ "reason",
73447
+ "event"
73448
+ ]
73449
+ }
73450
+ }
73451
+ }
73452
+ },
70837
73453
  "201": {
70838
73454
  "description": "Webhook processed",
70839
73455
  "content": {