@desplega.ai/agent-swarm 1.157.0 → 1.158.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 (256) hide show
  1. package/dist/{acp-adapter-qhqrk4q0.js → acp-adapter-xaq4n6pc.js} +1 -1
  2. package/dist/{actions-9rrg0zxm.js → actions-p9hz5yat.js} +15 -15
  3. package/dist/{app-enysy1zd.js → app-g26wdcz6.js} +4 -4
  4. package/dist/{artifact-td4q4dch.js → artifact-3v5t9jtg.js} +1 -1
  5. package/dist/{assistant-zegamy48.js → assistant-wydfqkb3.js} +16 -16
  6. package/dist/{boot-reembed-r6shx5qx.js → boot-reembed-g5ckg9yb.js} +6 -6
  7. package/dist/{boot-reembed-zfxb937k.js → boot-reembed-se8zmdcp.js} +5 -5
  8. package/dist/{boot-scrub-logs-k5y0se6r.js → boot-scrub-logs-wfxqan61.js} +3 -3
  9. package/dist/{seed-pricing-vqxa06qf.js → boot-seeds-s3q01xj3.js} +10 -10
  10. package/dist/{claude-adapter-5yc7hxwv.js → claude-adapter-tv2x4f36.js} +7 -7
  11. package/dist/{claude-managed-adapter-ea2aga6w.js → claude-managed-adapter-41b2s7fd.js} +2 -2
  12. package/dist/{claude-sdk-session-j4ywn3xf.js → claude-sdk-session-t442qz6f.js} +8 -8
  13. package/dist/{cli-e781c6f9.js → cli-0xjkj1j7.js} +1 -0
  14. package/dist/{cli-58rgvkt4.js → cli-1hkrch3k.js} +2 -2
  15. package/dist/{cli-yscm6cv8.js → cli-20cj37vt.js} +1866 -9
  16. package/dist/{cli-h0wdadsx.js → cli-4198qc9v.js} +7 -3
  17. package/dist/{cli-awwphhcs.js → cli-47m6dkd3.js} +362 -126
  18. package/dist/{cli-wb2zvbfg.js → cli-53sz8gkz.js} +1 -1
  19. package/dist/{cli-005pze6s.js → cli-5d10vd2m.js} +1 -1
  20. package/dist/{cli-v53rbqp3.js → cli-65hjmev5.js} +57 -17
  21. package/dist/{cli-scwq51gn.js → cli-68w09sjw.js} +7 -1
  22. package/dist/{cli-s98skd5r.js → cli-7gtvvpbh.js} +4 -4
  23. package/dist/{cli-y3nxwx0t.js → cli-7s3syk22.js} +18 -11
  24. package/dist/{cli-74h6f2bp.js → cli-8qmme6vd.js} +2 -2
  25. package/dist/{cli-wsed24mk.js → cli-987hg0aa.js} +2 -2
  26. package/dist/{cli-9n76jszt.js → cli-9httdpyq.js} +1 -1
  27. package/dist/{cli-f3va018d.js → cli-aky8tctm.js} +26 -93
  28. package/dist/{cli-sgyqyyxe.js → cli-c07r9a2m.js} +2 -1
  29. package/dist/{cli-c41wjx0r.js → cli-fgqxwrpv.js} +291 -12
  30. package/dist/{cli-01vfmq8c.js → cli-ftfvggzx.js} +607 -164
  31. package/dist/{cli-ytxs7mn1.js → cli-g8djp6qe.js} +17 -0
  32. package/dist/{cli-avkd6mqv.js → cli-h967nb6r.js} +551 -0
  33. package/dist/{cli-r9ee9c4w.js → cli-j55n64b6.js} +23 -22
  34. package/dist/{cli-9p33cz9h.js → cli-j57qkrpq.js} +86 -28
  35. package/dist/{cli-tjmghmm5.js → cli-q67y4wzm.js} +6 -3
  36. package/dist/{cli-n6zq3kbd.js → cli-rj19hc34.js} +1 -1
  37. package/dist/{cli-jytrw2na.js → cli-rjehvrts.js} +4 -4
  38. package/dist/{cli-tpv97m71.js → cli-rqz8qbw7.js} +245 -75
  39. package/dist/{cli-p37sg0a9.js → cli-s8eet254.js} +1 -1
  40. package/dist/cli-t1ze64h3.js +811 -0
  41. package/dist/{cli-6jjzxv3b.js → cli-ws6rqycm.js} +3 -2
  42. package/dist/{cli-xf5b7y1f.js → cli-wscdvcqz.js} +13 -5
  43. package/dist/{cli-5j7bm4tb.js → cli-x24pshtq.js} +5 -5
  44. package/dist/{cli-nbp6m6gp.js → cli-xberxa1r.js} +51 -26
  45. package/dist/{cli-vx9p3qdt.js → cli-xhaeg2nc.js} +1 -1
  46. package/dist/cli.js +29 -15
  47. package/dist/{codex-adapter-gns3s6c3.js → codex-adapter-cnm8wk11.js} +5 -5
  48. package/dist/{codex-session-runner-gqnxys5w.js → codex-session-runner-gfg547zj.js} +5 -5
  49. package/dist/{commands-hxy2y2sp.js → commands-e3bn0p75.js} +3 -3
  50. package/dist/{db-w8ghhsgf.js → db-03v9kzr2.js} +17 -3
  51. package/dist/{dispatcher-cp1rknjz.js → dispatcher-nrmg8yht.js} +14 -14
  52. package/dist/{dsh-adapter-1dwg97zv.js → dsh-adapter-k03nfqa6.js} +2 -2
  53. package/dist/{handlers-egfhr351.js → handlers-aqcedbyb.js} +17 -17
  54. package/dist/{hook-x4kftwzt.js → hook-7vkskkre.js} +19 -11
  55. package/dist/{hook-fbxjqfjz.js → hook-ybvmrmhq.js} +4 -4
  56. package/dist/{http-c7jfx990.js → http-2eqa8t24.js} +432 -195
  57. package/dist/{index-4k9hct21.js → index-1yks3qcr.js} +14 -14
  58. package/dist/{index-jtvpgb8f.js → index-a3vn96n8.js} +30 -27
  59. package/dist/{index-dc2ek6bw.js → index-c6zsv1bd.js} +5 -5
  60. package/dist/{index-yy07ef2s.js → index-chgdkq36.js} +14 -14
  61. package/dist/{index-r6bty6tb.js → index-x71bvq0p.js} +15 -15
  62. package/dist/{keepalive-f7ekefyc.js → keepalive-vtkf5n99.js} +5 -5
  63. package/dist/{lead-h053syts.js → lead-h3sp357x.js} +26 -26
  64. package/dist/{maintenance-a3w6zs54.js → maintenance-jzeqtk3q.js} +6 -6
  65. package/dist/{oauth-refresh-sweep-vra1dhkd.js → oauth-refresh-sweep-qp3dzmdp.js} +4 -4
  66. package/dist/{onboard-mfgzeqxs.js → onboard-tmsp0qbz.js} +278 -81
  67. package/dist/{opencode-adapter-z64xjzec.js → opencode-adapter-x6x2da1z.js} +3 -3
  68. package/dist/{otel-impl-2ez6xk57.js → otel-impl-9mz73q65.js} +416 -301
  69. package/dist/{pi-mono-adapter-2b7mw16r.js → pi-mono-adapter-m6dvv0dz.js} +2 -2
  70. package/dist/{pricing-refresh-6sw65tck.js → pricing-refresh-v1cbr9te.js} +5 -5
  71. package/dist/{rbac-roles-nm6924sy.js → rbac-roles-c9wqz83x.js} +4 -4
  72. package/dist/{render-v2-f026j6c4.js → render-v2-gryrh9h8.js} +4 -4
  73. package/dist/{setup-w606fr1q.js → setup-q9720bt6.js} +2 -2
  74. package/dist/{virtual-modules-8qheft18.js → virtual-modules-3htpgn8x.js} +1 -1
  75. package/dist/{work-objects-ezmggdne.js → work-objects-b76x7deb.js} +17 -17
  76. package/dist/{worker-1mbyv29k.js → worker-6vrxbv41.js} +26 -26
  77. package/openapi.json +1626 -629
  78. package/package.json +2 -1
  79. package/src/apps/catalog.generated.json +229 -0
  80. package/src/apps/page-validator.ts +71 -16
  81. package/src/apps/row-store.ts +66 -11
  82. package/src/apps/sync.ts +59 -17
  83. package/src/artifact-sdk/browser-sdk.ts +436 -2
  84. package/src/be/approval-sweeps.ts +109 -0
  85. package/src/be/boot-seeds.ts +40 -0
  86. package/src/be/chunking.ts +1 -1
  87. package/src/be/db/agents.ts +20 -0
  88. package/src/be/db/approvals.ts +78 -0
  89. package/src/be/db/tasks/read.ts +197 -39
  90. package/src/be/db/tasks/write.ts +41 -9
  91. package/src/be/db-client.ts +107 -48
  92. package/src/be/db.ts +219 -76
  93. package/src/be/events.ts +33 -1
  94. package/src/be/memory/graph-expansion.ts +10 -3
  95. package/src/be/memory/providers/sqlite-store.ts +55 -13
  96. package/src/be/memory/raters/retrieval.ts +5 -2
  97. package/src/be/memory/reranker.ts +26 -2
  98. package/src/be/memory/types.ts +2 -0
  99. package/src/be/migrations/166_approval_request_auto_cancellation.sql +9 -0
  100. package/src/be/migrations/171_memory_retrieval_relevance.sql +8 -0
  101. package/src/be/migrations/175_workflow_runs_list_index.sql +11 -0
  102. package/src/be/migrations/177_events_event_agent_created_index.sql +11 -0
  103. package/src/be/models-catalog.ts +2 -0
  104. package/src/be/modelsdev-cache.json +1857 -0
  105. package/src/be/modelsdev-cache.ts +14 -1
  106. package/src/be/pricing-normalize.ts +2 -0
  107. package/src/be/scripts/typecheck.ts +1 -0
  108. package/src/be/seed-pricing.ts +3 -1
  109. package/src/be/seed-skills/bundled-files.generated.json +1 -1
  110. package/src/be/steering.ts +53 -3
  111. package/src/be/swarm-config-guard.ts +3 -0
  112. package/src/be/task-citations.ts +29 -0
  113. package/src/cli.tsx +14 -1
  114. package/src/commands/onboard/compose-generator.ts +8 -3
  115. package/src/commands/onboard/container-engine.ts +220 -0
  116. package/src/commands/onboard/manifest.ts +1 -0
  117. package/src/commands/onboard/steps/health-check.tsx +4 -1
  118. package/src/commands/onboard/steps/prereq-check.tsx +50 -54
  119. package/src/commands/onboard/steps/start.tsx +31 -16
  120. package/src/commands/onboard/types.ts +7 -2
  121. package/src/commands/onboard.tsx +39 -4
  122. package/src/commands/profile-sync.ts +79 -26
  123. package/src/commands/runner.ts +8 -1
  124. package/src/extensions/catalog.generated.json +17 -0
  125. package/src/extensions/contract-types.generated.ts +1 -1
  126. package/src/heartbeat/heartbeat.ts +263 -103
  127. package/src/hooks/hook.ts +21 -12
  128. package/src/http/agents.ts +35 -0
  129. package/src/http/approval-requests.ts +136 -64
  130. package/src/http/apps.ts +14 -3
  131. package/src/http/config.ts +15 -1
  132. package/src/http/events.ts +62 -2
  133. package/src/http/index.ts +6 -4
  134. package/src/http/memory.ts +21 -7
  135. package/src/http/schedules.ts +1 -1
  136. package/src/http/session-data.ts +9 -4
  137. package/src/http/sessions.ts +25 -18
  138. package/src/http/stats.ts +19 -7
  139. package/src/http/status.ts +11 -1
  140. package/src/http/tasks.ts +40 -8
  141. package/src/http/webhooks.ts +67 -46
  142. package/src/http/workflows.ts +15 -20
  143. package/src/linear/outbound.ts +37 -15
  144. package/src/otel-impl.ts +151 -1
  145. package/src/otel.ts +14 -3
  146. package/src/prompts/memories.ts +19 -2
  147. package/src/providers/claude-managed-models.ts +8 -0
  148. package/src/providers/modelsdev-reasoning.json +551 -0
  149. package/src/rbac/legacy-policy.ts +16 -0
  150. package/src/rbac/permissions.ts +4 -0
  151. package/src/scheduler/schedule-task.ts +3 -0
  152. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  153. package/src/scripts-runtime/swarm-sdk.ts +9 -0
  154. package/src/scripts-runtime/types/stdlib.d.ts +1 -0
  155. package/src/scripts-runtime/types/swarm-extension.d.ts +1 -0
  156. package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
  157. package/src/server.ts +12 -7
  158. package/src/slack/app.ts +35 -4
  159. package/src/slack/connection-state.ts +17 -0
  160. package/src/tasks/context-key.ts +1 -0
  161. package/src/tasks/worker-follow-up.ts +6 -2
  162. package/src/tests/agent-task-activity.test.ts +74 -0
  163. package/src/tests/agents-list-model-display.test.ts +6 -1
  164. package/src/tests/approval-auto-cancellation-migration.test.ts +104 -0
  165. package/src/tests/approval-requests.test.ts +395 -0
  166. package/src/tests/approval-sweeps-config.test.ts +47 -0
  167. package/src/tests/approval-sweeps.test.ts +508 -0
  168. package/src/tests/apps-kibo-blocks.test.ts +77 -0
  169. package/src/tests/apps-spike.test.ts +56 -1
  170. package/src/tests/apps-sync-engine.test.ts +20 -9
  171. package/src/tests/boot-seeds.test.ts +170 -0
  172. package/src/tests/cancel-approval-request-tool.test.ts +115 -0
  173. package/src/tests/claude-managed-adapter.test.ts +6 -0
  174. package/src/tests/config-key-filter.test.ts +80 -0
  175. package/src/tests/context-window.test.ts +1 -0
  176. package/src/tests/db-client-busy-retry.test.ts +96 -0
  177. package/src/tests/db-client.test.ts +60 -1
  178. package/src/tests/db-task-read-contract.test.ts +10 -0
  179. package/src/tests/db-task-write-contract.test.ts +9 -0
  180. package/src/tests/docs-index-footprint.test.js +3 -3
  181. package/src/tests/events-http.test.ts +103 -0
  182. package/src/tests/extensions-catalog.test.ts +22 -17
  183. package/src/tests/extensions-pre-task.test.ts +107 -0
  184. package/src/tests/fixtures/kibo-blocks-definition.json.txt +105 -0
  185. package/src/tests/follow-up-config-inheritance.test.ts +260 -0
  186. package/src/tests/heartbeat-orphan-resume.test.ts +84 -0
  187. package/src/tests/heartbeat-reboot-live.test.ts +95 -0
  188. package/src/tests/heartbeat-stall-cas.test.ts +80 -0
  189. package/src/tests/heartbeat.test.ts +99 -3
  190. package/src/tests/hook-mcp-config.test.ts +29 -0
  191. package/src/tests/http-api-integration.test.ts +16 -2
  192. package/src/tests/kv-storage.test.ts +62 -0
  193. package/src/tests/linear-outbound-sync.test.ts +120 -5
  194. package/src/tests/list-endpoint-slimming.test.ts +91 -0
  195. package/src/tests/memory-graph-organic-route.test.ts +155 -0
  196. package/src/tests/memory-http-recall-gating.test.ts +14 -4
  197. package/src/tests/memory-hybrid.test.ts +161 -1
  198. package/src/tests/memory-prompt-recall-crowdout.test.ts +297 -0
  199. package/src/tests/memory.test.ts +22 -0
  200. package/src/tests/onboard-container-engine.test.ts +240 -0
  201. package/src/tests/otel-event-loop-and-logs.test.ts +99 -0
  202. package/src/tests/pricing-routes.test.ts +14 -0
  203. package/src/tests/profile-sync-warning.test.ts +8 -4
  204. package/src/tests/promote-draft-task-route.test.ts +19 -0
  205. package/src/tests/provider-registration.test.ts +296 -42
  206. package/src/tests/rbac-engine.test.ts +30 -0
  207. package/src/tests/reasoning-effort.test.ts +8 -0
  208. package/src/tests/script-connections.test.ts +7 -0
  209. package/src/tests/sdk-allowlist.test.ts +39 -0
  210. package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
  211. package/src/tests/sessions-detail-batch.test.ts +250 -0
  212. package/src/tests/sessions.test.ts +118 -0
  213. package/src/tests/slack-config.test.ts +22 -0
  214. package/src/tests/sonnet-5-5-registry.test.ts +44 -0
  215. package/src/tests/status.test.ts +36 -1
  216. package/src/tests/swarm-diff.test.ts +316 -10
  217. package/src/tests/task-completion-idempotency.test.ts +2 -1
  218. package/src/tests/tasks-requested-by-filter.test.ts +3 -1
  219. package/src/tests/tool-annotations.test.ts +1 -1
  220. package/src/tests/ui-list-slim-projections.test.ts +158 -0
  221. package/src/tests/webhooks-task-blocked.test.ts +127 -0
  222. package/src/tests/workflow-approval-recovery.test.ts +203 -0
  223. package/src/tests/workflow-hitl-routing.test.ts +22 -1
  224. package/src/tests/workflow-hitl-slack-card.test.ts +52 -0
  225. package/src/tests/workflow-http-v2.test.ts +99 -8
  226. package/src/tests/workflow-retry-validation.test.ts +56 -0
  227. package/src/tests/workflow-tla-races.test.ts +389 -0
  228. package/src/tests/workflow-validation-port-routing.test.ts +113 -1
  229. package/src/tools/cancel-approval-request.ts +57 -0
  230. package/src/tools/memory-search.ts +1 -0
  231. package/src/tools/request-human-input.ts +4 -2
  232. package/src/tools/send-task.ts +4 -0
  233. package/src/tools/templates.ts +19 -0
  234. package/src/tools/tool-config.ts +2 -1
  235. package/src/tools/workflows/list-workflow-runs.ts +1 -0
  236. package/src/types.ts +38 -0
  237. package/src/utils/context-window.ts +1 -0
  238. package/src/workflows/approval-cancel.ts +152 -0
  239. package/src/workflows/approval-notifications.ts +84 -0
  240. package/src/workflows/checkpoint.ts +10 -5
  241. package/src/workflows/definition.ts +21 -0
  242. package/src/workflows/engine.ts +152 -21
  243. package/src/workflows/executors/human-in-the-loop.ts +1 -1
  244. package/src/workflows/recovery.ts +100 -45
  245. package/src/workflows/resume.ts +49 -18
  246. package/src/workflows/retry-poller.ts +71 -21
  247. package/templates/extensions/README.md +1 -0
  248. package/templates/extensions/github-sender-allowlist/README.md +18 -0
  249. package/templates/extensions/github-sender-allowlist/hooks.ts +55 -0
  250. package/templates/extensions/github-sender-allowlist/manifest.json +8 -0
  251. package/templates/skills/apps/content.md +20 -1
  252. package/templates/skills/code-quality/content.md +26 -1
  253. package/templates/skills/pages/content.md +16 -4
  254. package/templates/skills/pages/files/examples/multiplayer-board.html +3 -12
  255. package/dist/cli-2daksqps.js +0 -378
  256. package/dist/rbac-roles-3gxmnb20.js +0 -37
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": "1.157.0",
5
+ "version": "1.158.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": [
@@ -3128,7 +3128,8 @@
3128
3128
  "opencode",
3129
3129
  "devin",
3130
3130
  "gemini",
3131
- "acp"
3131
+ "acp",
3132
+ "dsh"
3132
3133
  ]
3133
3134
  },
3134
3135
  "model": {
@@ -4149,6 +4150,7 @@
4149
4150
  "task_dispatch_rejected_affinity",
4150
4151
  "task_authorization_rejected",
4151
4152
  "task_recovery_authorization",
4153
+ "task_dependency_repointed",
4152
4154
  "task_released",
4153
4155
  "task_deferred_wait_woke",
4154
4156
  "task_follow_up_suppressed",
@@ -5120,6 +5122,53 @@
5120
5122
  }
5121
5123
  }
5122
5124
  },
5125
+ "WorkflowRunSummary": {
5126
+ "type": "object",
5127
+ "properties": {
5128
+ "id": {
5129
+ "type": "string",
5130
+ "format": "uuid"
5131
+ },
5132
+ "workflowId": {
5133
+ "type": "string",
5134
+ "format": "uuid"
5135
+ },
5136
+ "status": {
5137
+ "type": "string",
5138
+ "enum": [
5139
+ "running",
5140
+ "waiting",
5141
+ "completed",
5142
+ "failed",
5143
+ "skipped",
5144
+ "cancelled"
5145
+ ]
5146
+ },
5147
+ "triggerData": {},
5148
+ "error": {
5149
+ "type": "string"
5150
+ },
5151
+ "createdBy": {
5152
+ "type": "string"
5153
+ },
5154
+ "startedAt": {
5155
+ "type": "string"
5156
+ },
5157
+ "lastUpdatedAt": {
5158
+ "type": "string"
5159
+ },
5160
+ "finishedAt": {
5161
+ "type": "string"
5162
+ }
5163
+ },
5164
+ "required": [
5165
+ "id",
5166
+ "workflowId",
5167
+ "status",
5168
+ "startedAt",
5169
+ "lastUpdatedAt"
5170
+ ]
5171
+ },
5123
5172
  "WorkflowRun": {
5124
5173
  "type": "object",
5125
5174
  "properties": {
@@ -10525,6 +10574,85 @@
10525
10574
  }
10526
10575
  }
10527
10576
  },
10577
+ "/api/agents/{id}/task-activity": {
10578
+ "get": {
10579
+ "summary": "Daily task counts for an agent",
10580
+ "description": "Number of tasks created for the agent per UTC day over the last `days` days (default 365, max 730), oldest first. Days with no tasks are omitted. Backs the activity heatmap on the agent page.",
10581
+ "tags": [
10582
+ "Agents"
10583
+ ],
10584
+ "security": [
10585
+ {
10586
+ "bearerAuth": []
10587
+ }
10588
+ ],
10589
+ "parameters": [
10590
+ {
10591
+ "schema": {
10592
+ "type": "string"
10593
+ },
10594
+ "required": true,
10595
+ "name": "id",
10596
+ "in": "path"
10597
+ },
10598
+ {
10599
+ "schema": {
10600
+ "type": "integer",
10601
+ "minimum": 1,
10602
+ "maximum": 730
10603
+ },
10604
+ "required": false,
10605
+ "name": "days",
10606
+ "in": "query"
10607
+ }
10608
+ ],
10609
+ "responses": {
10610
+ "200": {
10611
+ "description": "Daily task counts",
10612
+ "content": {
10613
+ "application/json": {
10614
+ "schema": {
10615
+ "type": "object",
10616
+ "properties": {
10617
+ "days": {
10618
+ "type": "array",
10619
+ "items": {
10620
+ "type": "object",
10621
+ "properties": {
10622
+ "date": {
10623
+ "type": "string"
10624
+ },
10625
+ "count": {
10626
+ "type": "integer"
10627
+ }
10628
+ },
10629
+ "required": [
10630
+ "date",
10631
+ "count"
10632
+ ]
10633
+ }
10634
+ }
10635
+ },
10636
+ "required": [
10637
+ "days"
10638
+ ]
10639
+ }
10640
+ }
10641
+ }
10642
+ },
10643
+ "404": {
10644
+ "description": "Agent not found",
10645
+ "content": {
10646
+ "application/json": {
10647
+ "schema": {
10648
+ "$ref": "#/components/schemas/ErrorResponse"
10649
+ }
10650
+ }
10651
+ }
10652
+ }
10653
+ }
10654
+ }
10655
+ },
10528
10656
  "/api/agents/{id}/profile": {
10529
10657
  "put": {
10530
10658
  "summary": "Update agent profile (role, description, capabilities, etc.)",
@@ -11445,7 +11573,8 @@
11445
11573
  },
11446
11574
  "timeoutSeconds": {
11447
11575
  "type": "integer",
11448
- "minimum": 1
11576
+ "minimum": 1,
11577
+ "description": "Seconds until the request expires. After that the request becomes 'timeout' and you get a hitl-follow-up task. A request with no timeout is cancelled after APPROVAL_REQUEST_AUTO_CANCELLATION_DAYS days (default 7)."
11449
11578
  },
11450
11579
  "notifications": {
11451
11580
  "type": "array",
@@ -11762,6 +11891,7 @@
11762
11891
  },
11763
11892
  "get": {
11764
11893
  "summary": "List approval requests with optional filters",
11894
+ "description": "Returns full approval requests by default. Pass `fields=slim` for the list-view shape: `questions`, `approvers`, `responses`, `resolutionReason` and `notificationChannels` are dropped and `questionCount` is added. Fetch one request in full via `GET /api/approval-requests/{id}`.",
11765
11895
  "tags": [
11766
11896
  "ApprovalRequests"
11767
11897
  ],
@@ -11797,323 +11927,31 @@
11797
11927
  "required": false,
11798
11928
  "name": "limit",
11799
11929
  "in": "query"
11800
- }
11801
- ],
11802
- "responses": {
11803
- "200": {
11804
- "description": "List of approval requests",
11805
- "content": {
11806
- "application/json": {
11807
- "schema": {
11808
- "type": "object",
11809
- "properties": {
11810
- "approvalRequests": {
11811
- "type": "array",
11812
- "items": {
11813
- "type": "object",
11814
- "properties": {
11815
- "id": {
11816
- "type": "string"
11817
- },
11818
- "title": {
11819
- "type": "string"
11820
- },
11821
- "questions": {
11822
- "type": "array",
11823
- "items": {
11824
- "type": "object",
11825
- "properties": {
11826
- "id": {
11827
- "type": "string"
11828
- },
11829
- "type": {
11830
- "type": "string",
11831
- "enum": [
11832
- "approval",
11833
- "text",
11834
- "single-select",
11835
- "multi-select",
11836
- "boolean"
11837
- ]
11838
- },
11839
- "label": {
11840
- "type": "string"
11841
- },
11842
- "required": {
11843
- "type": "boolean"
11844
- },
11845
- "description": {
11846
- "type": "string"
11847
- },
11848
- "placeholder": {
11849
- "type": "string"
11850
- },
11851
- "multiline": {
11852
- "type": "boolean"
11853
- },
11854
- "options": {
11855
- "type": "array",
11856
- "items": {
11857
- "type": "object",
11858
- "properties": {
11859
- "value": {
11860
- "type": "string"
11861
- },
11862
- "label": {
11863
- "type": "string"
11864
- },
11865
- "description": {
11866
- "type": "string"
11867
- }
11868
- },
11869
- "required": [
11870
- "value",
11871
- "label"
11872
- ]
11873
- }
11874
- },
11875
- "minSelections": {
11876
- "type": "integer",
11877
- "minimum": 0
11878
- },
11879
- "maxSelections": {
11880
- "type": "integer",
11881
- "minimum": 1
11882
- },
11883
- "defaultValue": {
11884
- "type": "boolean"
11885
- }
11886
- },
11887
- "required": [
11888
- "id",
11889
- "type",
11890
- "label"
11891
- ]
11892
- }
11893
- },
11894
- "workflowRunId": {
11895
- "type": [
11896
- "string",
11897
- "null"
11898
- ]
11899
- },
11900
- "workflowRunStepId": {
11901
- "type": [
11902
- "string",
11903
- "null"
11904
- ]
11905
- },
11906
- "sourceTaskId": {
11907
- "type": [
11908
- "string",
11909
- "null"
11910
- ]
11911
- },
11912
- "approvers": {
11913
- "type": "object",
11914
- "properties": {
11915
- "users": {
11916
- "type": "array",
11917
- "items": {
11918
- "type": "string"
11919
- }
11920
- },
11921
- "roles": {
11922
- "type": "array",
11923
- "items": {
11924
- "type": "string"
11925
- }
11926
- },
11927
- "policy": {
11928
- "anyOf": [
11929
- {
11930
- "type": "string",
11931
- "enum": [
11932
- "any"
11933
- ]
11934
- },
11935
- {
11936
- "type": "string",
11937
- "enum": [
11938
- "all"
11939
- ]
11940
- },
11941
- {
11942
- "type": "object",
11943
- "properties": {
11944
- "min": {
11945
- "type": "integer",
11946
- "minimum": 1
11947
- }
11948
- },
11949
- "required": [
11950
- "min"
11951
- ]
11952
- }
11953
- ]
11954
- }
11955
- },
11956
- "required": [
11957
- "policy"
11958
- ]
11959
- },
11960
- "status": {
11961
- "type": "string",
11962
- "enum": [
11963
- "pending",
11964
- "approved",
11965
- "rejected",
11966
- "timeout",
11967
- "cancelled"
11968
- ]
11969
- },
11970
- "responses": {
11971
- "type": [
11972
- "object",
11973
- "null"
11974
- ],
11975
- "additionalProperties": {}
11976
- },
11977
- "resolvedBy": {
11978
- "type": [
11979
- "string",
11980
- "null"
11981
- ]
11982
- },
11983
- "resolvedAt": {
11984
- "type": [
11985
- "string",
11986
- "null"
11987
- ]
11988
- },
11989
- "resolutionReason": {
11990
- "type": [
11991
- "string",
11992
- "null"
11993
- ]
11994
- },
11995
- "timeoutSeconds": {
11996
- "type": [
11997
- "number",
11998
- "null"
11999
- ]
12000
- },
12001
- "expiresAt": {
12002
- "type": [
12003
- "string",
12004
- "null"
12005
- ]
12006
- },
12007
- "notificationChannels": {
12008
- "type": [
12009
- "array",
12010
- "null"
12011
- ],
12012
- "items": {
12013
- "type": "object",
12014
- "properties": {
12015
- "channel": {
12016
- "type": "string",
12017
- "enum": [
12018
- "slack",
12019
- "email"
12020
- ]
12021
- },
12022
- "target": {
12023
- "type": "string"
12024
- },
12025
- "messageTs": {
12026
- "type": "string"
12027
- }
12028
- },
12029
- "required": [
12030
- "channel",
12031
- "target"
12032
- ]
12033
- }
12034
- },
12035
- "createdBy": {
12036
- "type": "string"
12037
- },
12038
- "createdAt": {
12039
- "type": "string"
12040
- },
12041
- "updatedAt": {
12042
- "type": "string"
12043
- }
12044
- },
12045
- "required": [
12046
- "id",
12047
- "title",
12048
- "questions",
12049
- "workflowRunId",
12050
- "workflowRunStepId",
12051
- "sourceTaskId",
12052
- "approvers",
12053
- "status",
12054
- "responses",
12055
- "resolvedBy",
12056
- "resolvedAt",
12057
- "resolutionReason",
12058
- "timeoutSeconds",
12059
- "expiresAt",
12060
- "notificationChannels",
12061
- "createdAt",
12062
- "updatedAt"
12063
- ]
12064
- }
12065
- }
12066
- },
12067
- "required": [
12068
- "approvalRequests"
12069
- ]
12070
- }
12071
- }
12072
- }
12073
- }
12074
- }
12075
- }
12076
- },
12077
- "/api/approval-requests/{id}": {
12078
- "get": {
12079
- "summary": "Get approval request details",
12080
- "tags": [
12081
- "ApprovalRequests"
12082
- ],
12083
- "security": [
12084
- {
12085
- "bearerAuth": []
12086
- }
12087
- ],
12088
- "parameters": [
11930
+ },
12089
11931
  {
12090
11932
  "schema": {
12091
11933
  "type": "string",
12092
- "format": "uuid"
11934
+ "enum": [
11935
+ "full",
11936
+ "slim"
11937
+ ]
12093
11938
  },
12094
- "required": true,
12095
- "name": "id",
12096
- "in": "path"
11939
+ "required": false,
11940
+ "name": "fields",
11941
+ "in": "query"
12097
11942
  }
12098
11943
  ],
12099
11944
  "responses": {
12100
11945
  "200": {
12101
- "description": "Approval request details",
11946
+ "description": "List of approval requests",
12102
11947
  "content": {
12103
11948
  "application/json": {
12104
11949
  "schema": {
12105
11950
  "type": "object",
12106
11951
  "properties": {
12107
- "approvalRequest": {
12108
- "type": "object",
12109
- "properties": {
12110
- "id": {
12111
- "type": "string"
12112
- },
12113
- "title": {
12114
- "type": "string"
12115
- },
12116
- "questions": {
11952
+ "approvalRequests": {
11953
+ "anyOf": [
11954
+ {
12117
11955
  "type": "array",
12118
11956
  "items": {
12119
11957
  "type": "object",
@@ -12121,118 +11959,519 @@
12121
11959
  "id": {
12122
11960
  "type": "string"
12123
11961
  },
12124
- "type": {
12125
- "type": "string",
12126
- "enum": [
12127
- "approval",
12128
- "text",
12129
- "single-select",
12130
- "multi-select",
12131
- "boolean"
12132
- ]
12133
- },
12134
- "label": {
12135
- "type": "string"
12136
- },
12137
- "required": {
12138
- "type": "boolean"
12139
- },
12140
- "description": {
12141
- "type": "string"
12142
- },
12143
- "placeholder": {
11962
+ "title": {
12144
11963
  "type": "string"
12145
11964
  },
12146
- "multiline": {
12147
- "type": "boolean"
12148
- },
12149
- "options": {
11965
+ "questions": {
12150
11966
  "type": "array",
12151
11967
  "items": {
12152
11968
  "type": "object",
12153
11969
  "properties": {
12154
- "value": {
11970
+ "id": {
12155
11971
  "type": "string"
12156
11972
  },
11973
+ "type": {
11974
+ "type": "string",
11975
+ "enum": [
11976
+ "approval",
11977
+ "text",
11978
+ "single-select",
11979
+ "multi-select",
11980
+ "boolean"
11981
+ ]
11982
+ },
12157
11983
  "label": {
12158
11984
  "type": "string"
12159
11985
  },
11986
+ "required": {
11987
+ "type": "boolean"
11988
+ },
12160
11989
  "description": {
12161
11990
  "type": "string"
11991
+ },
11992
+ "placeholder": {
11993
+ "type": "string"
11994
+ },
11995
+ "multiline": {
11996
+ "type": "boolean"
11997
+ },
11998
+ "options": {
11999
+ "type": "array",
12000
+ "items": {
12001
+ "type": "object",
12002
+ "properties": {
12003
+ "value": {
12004
+ "type": "string"
12005
+ },
12006
+ "label": {
12007
+ "type": "string"
12008
+ },
12009
+ "description": {
12010
+ "type": "string"
12011
+ }
12012
+ },
12013
+ "required": [
12014
+ "value",
12015
+ "label"
12016
+ ]
12017
+ }
12018
+ },
12019
+ "minSelections": {
12020
+ "type": "integer",
12021
+ "minimum": 0
12022
+ },
12023
+ "maxSelections": {
12024
+ "type": "integer",
12025
+ "minimum": 1
12026
+ },
12027
+ "defaultValue": {
12028
+ "type": "boolean"
12162
12029
  }
12163
12030
  },
12164
12031
  "required": [
12165
- "value",
12032
+ "id",
12033
+ "type",
12166
12034
  "label"
12167
12035
  ]
12168
12036
  }
12169
12037
  },
12170
- "minSelections": {
12171
- "type": "integer",
12172
- "minimum": 0
12038
+ "workflowRunId": {
12039
+ "type": [
12040
+ "string",
12041
+ "null"
12042
+ ]
12173
12043
  },
12174
- "maxSelections": {
12175
- "type": "integer",
12176
- "minimum": 1
12044
+ "workflowRunStepId": {
12045
+ "type": [
12046
+ "string",
12047
+ "null"
12048
+ ]
12177
12049
  },
12178
- "defaultValue": {
12179
- "type": "boolean"
12180
- }
12181
- },
12182
- "required": [
12183
- "id",
12184
- "type",
12185
- "label"
12186
- ]
12187
- }
12188
- },
12189
- "workflowRunId": {
12190
- "type": [
12191
- "string",
12192
- "null"
12193
- ]
12194
- },
12195
- "workflowRunStepId": {
12196
- "type": [
12197
- "string",
12198
- "null"
12199
- ]
12200
- },
12201
- "sourceTaskId": {
12202
- "type": [
12203
- "string",
12204
- "null"
12205
- ]
12206
- },
12207
- "approvers": {
12208
- "type": "object",
12209
- "properties": {
12210
- "users": {
12211
- "type": "array",
12212
- "items": {
12213
- "type": "string"
12214
- }
12215
- },
12216
- "roles": {
12217
- "type": "array",
12218
- "items": {
12219
- "type": "string"
12220
- }
12221
- },
12222
- "policy": {
12223
- "anyOf": [
12224
- {
12225
- "type": "string",
12226
- "enum": [
12227
- "any"
12228
- ]
12229
- },
12230
- {
12231
- "type": "string",
12232
- "enum": [
12233
- "all"
12234
- ]
12235
- },
12050
+ "sourceTaskId": {
12051
+ "type": [
12052
+ "string",
12053
+ "null"
12054
+ ]
12055
+ },
12056
+ "approvers": {
12057
+ "type": "object",
12058
+ "properties": {
12059
+ "users": {
12060
+ "type": "array",
12061
+ "items": {
12062
+ "type": "string"
12063
+ }
12064
+ },
12065
+ "roles": {
12066
+ "type": "array",
12067
+ "items": {
12068
+ "type": "string"
12069
+ }
12070
+ },
12071
+ "policy": {
12072
+ "anyOf": [
12073
+ {
12074
+ "type": "string",
12075
+ "enum": [
12076
+ "any"
12077
+ ]
12078
+ },
12079
+ {
12080
+ "type": "string",
12081
+ "enum": [
12082
+ "all"
12083
+ ]
12084
+ },
12085
+ {
12086
+ "type": "object",
12087
+ "properties": {
12088
+ "min": {
12089
+ "type": "integer",
12090
+ "minimum": 1
12091
+ }
12092
+ },
12093
+ "required": [
12094
+ "min"
12095
+ ]
12096
+ }
12097
+ ]
12098
+ }
12099
+ },
12100
+ "required": [
12101
+ "policy"
12102
+ ]
12103
+ },
12104
+ "status": {
12105
+ "type": "string",
12106
+ "enum": [
12107
+ "pending",
12108
+ "approved",
12109
+ "rejected",
12110
+ "timeout",
12111
+ "cancelled"
12112
+ ]
12113
+ },
12114
+ "responses": {
12115
+ "type": [
12116
+ "object",
12117
+ "null"
12118
+ ],
12119
+ "additionalProperties": {}
12120
+ },
12121
+ "resolvedBy": {
12122
+ "type": [
12123
+ "string",
12124
+ "null"
12125
+ ]
12126
+ },
12127
+ "resolvedAt": {
12128
+ "type": [
12129
+ "string",
12130
+ "null"
12131
+ ]
12132
+ },
12133
+ "resolutionReason": {
12134
+ "type": [
12135
+ "string",
12136
+ "null"
12137
+ ]
12138
+ },
12139
+ "timeoutSeconds": {
12140
+ "type": [
12141
+ "number",
12142
+ "null"
12143
+ ]
12144
+ },
12145
+ "expiresAt": {
12146
+ "type": [
12147
+ "string",
12148
+ "null"
12149
+ ]
12150
+ },
12151
+ "notificationChannels": {
12152
+ "type": [
12153
+ "array",
12154
+ "null"
12155
+ ],
12156
+ "items": {
12157
+ "type": "object",
12158
+ "properties": {
12159
+ "channel": {
12160
+ "type": "string",
12161
+ "enum": [
12162
+ "slack",
12163
+ "email"
12164
+ ]
12165
+ },
12166
+ "target": {
12167
+ "type": "string"
12168
+ },
12169
+ "messageTs": {
12170
+ "type": "string"
12171
+ }
12172
+ },
12173
+ "required": [
12174
+ "channel",
12175
+ "target"
12176
+ ]
12177
+ }
12178
+ },
12179
+ "createdBy": {
12180
+ "type": "string"
12181
+ },
12182
+ "createdAt": {
12183
+ "type": "string"
12184
+ },
12185
+ "updatedAt": {
12186
+ "type": "string"
12187
+ }
12188
+ },
12189
+ "required": [
12190
+ "id",
12191
+ "title",
12192
+ "questions",
12193
+ "workflowRunId",
12194
+ "workflowRunStepId",
12195
+ "sourceTaskId",
12196
+ "approvers",
12197
+ "status",
12198
+ "responses",
12199
+ "resolvedBy",
12200
+ "resolvedAt",
12201
+ "resolutionReason",
12202
+ "timeoutSeconds",
12203
+ "expiresAt",
12204
+ "notificationChannels",
12205
+ "createdAt",
12206
+ "updatedAt"
12207
+ ]
12208
+ }
12209
+ },
12210
+ {
12211
+ "type": "array",
12212
+ "items": {
12213
+ "type": "object",
12214
+ "properties": {
12215
+ "id": {
12216
+ "type": "string"
12217
+ },
12218
+ "title": {
12219
+ "type": "string"
12220
+ },
12221
+ "workflowRunId": {
12222
+ "type": [
12223
+ "string",
12224
+ "null"
12225
+ ]
12226
+ },
12227
+ "workflowRunStepId": {
12228
+ "type": [
12229
+ "string",
12230
+ "null"
12231
+ ]
12232
+ },
12233
+ "sourceTaskId": {
12234
+ "type": [
12235
+ "string",
12236
+ "null"
12237
+ ]
12238
+ },
12239
+ "status": {
12240
+ "type": "string",
12241
+ "enum": [
12242
+ "pending",
12243
+ "approved",
12244
+ "rejected",
12245
+ "timeout",
12246
+ "cancelled"
12247
+ ]
12248
+ },
12249
+ "resolvedBy": {
12250
+ "type": [
12251
+ "string",
12252
+ "null"
12253
+ ]
12254
+ },
12255
+ "resolvedAt": {
12256
+ "type": [
12257
+ "string",
12258
+ "null"
12259
+ ]
12260
+ },
12261
+ "timeoutSeconds": {
12262
+ "type": [
12263
+ "number",
12264
+ "null"
12265
+ ]
12266
+ },
12267
+ "expiresAt": {
12268
+ "type": [
12269
+ "string",
12270
+ "null"
12271
+ ]
12272
+ },
12273
+ "createdBy": {
12274
+ "type": "string"
12275
+ },
12276
+ "createdAt": {
12277
+ "type": "string"
12278
+ },
12279
+ "updatedAt": {
12280
+ "type": "string"
12281
+ },
12282
+ "questionCount": {
12283
+ "type": "integer"
12284
+ }
12285
+ },
12286
+ "required": [
12287
+ "id",
12288
+ "title",
12289
+ "workflowRunId",
12290
+ "workflowRunStepId",
12291
+ "sourceTaskId",
12292
+ "status",
12293
+ "resolvedBy",
12294
+ "resolvedAt",
12295
+ "timeoutSeconds",
12296
+ "expiresAt",
12297
+ "createdAt",
12298
+ "updatedAt",
12299
+ "questionCount"
12300
+ ]
12301
+ }
12302
+ }
12303
+ ]
12304
+ }
12305
+ },
12306
+ "required": [
12307
+ "approvalRequests"
12308
+ ]
12309
+ }
12310
+ }
12311
+ }
12312
+ }
12313
+ }
12314
+ }
12315
+ },
12316
+ "/api/approval-requests/{id}": {
12317
+ "get": {
12318
+ "summary": "Get approval request details",
12319
+ "tags": [
12320
+ "ApprovalRequests"
12321
+ ],
12322
+ "security": [
12323
+ {
12324
+ "bearerAuth": []
12325
+ }
12326
+ ],
12327
+ "parameters": [
12328
+ {
12329
+ "schema": {
12330
+ "type": "string",
12331
+ "format": "uuid"
12332
+ },
12333
+ "required": true,
12334
+ "name": "id",
12335
+ "in": "path"
12336
+ }
12337
+ ],
12338
+ "responses": {
12339
+ "200": {
12340
+ "description": "Approval request details",
12341
+ "content": {
12342
+ "application/json": {
12343
+ "schema": {
12344
+ "type": "object",
12345
+ "properties": {
12346
+ "approvalRequest": {
12347
+ "type": "object",
12348
+ "properties": {
12349
+ "id": {
12350
+ "type": "string"
12351
+ },
12352
+ "title": {
12353
+ "type": "string"
12354
+ },
12355
+ "questions": {
12356
+ "type": "array",
12357
+ "items": {
12358
+ "type": "object",
12359
+ "properties": {
12360
+ "id": {
12361
+ "type": "string"
12362
+ },
12363
+ "type": {
12364
+ "type": "string",
12365
+ "enum": [
12366
+ "approval",
12367
+ "text",
12368
+ "single-select",
12369
+ "multi-select",
12370
+ "boolean"
12371
+ ]
12372
+ },
12373
+ "label": {
12374
+ "type": "string"
12375
+ },
12376
+ "required": {
12377
+ "type": "boolean"
12378
+ },
12379
+ "description": {
12380
+ "type": "string"
12381
+ },
12382
+ "placeholder": {
12383
+ "type": "string"
12384
+ },
12385
+ "multiline": {
12386
+ "type": "boolean"
12387
+ },
12388
+ "options": {
12389
+ "type": "array",
12390
+ "items": {
12391
+ "type": "object",
12392
+ "properties": {
12393
+ "value": {
12394
+ "type": "string"
12395
+ },
12396
+ "label": {
12397
+ "type": "string"
12398
+ },
12399
+ "description": {
12400
+ "type": "string"
12401
+ }
12402
+ },
12403
+ "required": [
12404
+ "value",
12405
+ "label"
12406
+ ]
12407
+ }
12408
+ },
12409
+ "minSelections": {
12410
+ "type": "integer",
12411
+ "minimum": 0
12412
+ },
12413
+ "maxSelections": {
12414
+ "type": "integer",
12415
+ "minimum": 1
12416
+ },
12417
+ "defaultValue": {
12418
+ "type": "boolean"
12419
+ }
12420
+ },
12421
+ "required": [
12422
+ "id",
12423
+ "type",
12424
+ "label"
12425
+ ]
12426
+ }
12427
+ },
12428
+ "workflowRunId": {
12429
+ "type": [
12430
+ "string",
12431
+ "null"
12432
+ ]
12433
+ },
12434
+ "workflowRunStepId": {
12435
+ "type": [
12436
+ "string",
12437
+ "null"
12438
+ ]
12439
+ },
12440
+ "sourceTaskId": {
12441
+ "type": [
12442
+ "string",
12443
+ "null"
12444
+ ]
12445
+ },
12446
+ "approvers": {
12447
+ "type": "object",
12448
+ "properties": {
12449
+ "users": {
12450
+ "type": "array",
12451
+ "items": {
12452
+ "type": "string"
12453
+ }
12454
+ },
12455
+ "roles": {
12456
+ "type": "array",
12457
+ "items": {
12458
+ "type": "string"
12459
+ }
12460
+ },
12461
+ "policy": {
12462
+ "anyOf": [
12463
+ {
12464
+ "type": "string",
12465
+ "enum": [
12466
+ "any"
12467
+ ]
12468
+ },
12469
+ {
12470
+ "type": "string",
12471
+ "enum": [
12472
+ "all"
12473
+ ]
12474
+ },
12236
12475
  {
12237
12476
  "type": "object",
12238
12477
  "properties": {
@@ -12684,14 +12923,361 @@
12684
12923
  }
12685
12924
  },
12686
12925
  "required": [
12687
- "approvalRequest"
12926
+ "approvalRequest"
12927
+ ]
12928
+ }
12929
+ }
12930
+ }
12931
+ },
12932
+ "400": {
12933
+ "description": "Validation error",
12934
+ "content": {
12935
+ "application/json": {
12936
+ "schema": {
12937
+ "$ref": "#/components/schemas/ErrorResponse"
12938
+ }
12939
+ }
12940
+ }
12941
+ },
12942
+ "404": {
12943
+ "description": "Not found",
12944
+ "content": {
12945
+ "application/json": {
12946
+ "schema": {
12947
+ "$ref": "#/components/schemas/ErrorResponse"
12948
+ }
12949
+ }
12950
+ }
12951
+ },
12952
+ "409": {
12953
+ "description": "Already resolved",
12954
+ "content": {
12955
+ "application/json": {
12956
+ "schema": {
12957
+ "$ref": "#/components/schemas/ErrorResponse"
12958
+ }
12959
+ }
12960
+ }
12961
+ }
12962
+ }
12963
+ }
12964
+ },
12965
+ "/api/approval-requests/{id}/cancel": {
12966
+ "post": {
12967
+ "summary": "Cancel a pending approval request",
12968
+ "tags": [
12969
+ "ApprovalRequests"
12970
+ ],
12971
+ "security": [
12972
+ {
12973
+ "bearerAuth": []
12974
+ }
12975
+ ],
12976
+ "parameters": [
12977
+ {
12978
+ "schema": {
12979
+ "type": "string",
12980
+ "format": "uuid"
12981
+ },
12982
+ "required": true,
12983
+ "name": "id",
12984
+ "in": "path"
12985
+ }
12986
+ ],
12987
+ "requestBody": {
12988
+ "content": {
12989
+ "application/json": {
12990
+ "schema": {
12991
+ "type": "object",
12992
+ "properties": {
12993
+ "reason": {
12994
+ "type": "string",
12995
+ "maxLength": 500
12996
+ }
12997
+ }
12998
+ }
12999
+ }
13000
+ }
13001
+ },
13002
+ "responses": {
13003
+ "200": {
13004
+ "description": "Request cancelled, or already cancelled. A request that gates a running or waiting workflow run cancels that run too.",
13005
+ "content": {
13006
+ "application/json": {
13007
+ "schema": {
13008
+ "type": "object",
13009
+ "properties": {
13010
+ "approvalRequest": {
13011
+ "type": "object",
13012
+ "properties": {
13013
+ "id": {
13014
+ "type": "string"
13015
+ },
13016
+ "title": {
13017
+ "type": "string"
13018
+ },
13019
+ "questions": {
13020
+ "type": "array",
13021
+ "items": {
13022
+ "type": "object",
13023
+ "properties": {
13024
+ "id": {
13025
+ "type": "string"
13026
+ },
13027
+ "type": {
13028
+ "type": "string",
13029
+ "enum": [
13030
+ "approval",
13031
+ "text",
13032
+ "single-select",
13033
+ "multi-select",
13034
+ "boolean"
13035
+ ]
13036
+ },
13037
+ "label": {
13038
+ "type": "string"
13039
+ },
13040
+ "required": {
13041
+ "type": "boolean"
13042
+ },
13043
+ "description": {
13044
+ "type": "string"
13045
+ },
13046
+ "placeholder": {
13047
+ "type": "string"
13048
+ },
13049
+ "multiline": {
13050
+ "type": "boolean"
13051
+ },
13052
+ "options": {
13053
+ "type": "array",
13054
+ "items": {
13055
+ "type": "object",
13056
+ "properties": {
13057
+ "value": {
13058
+ "type": "string"
13059
+ },
13060
+ "label": {
13061
+ "type": "string"
13062
+ },
13063
+ "description": {
13064
+ "type": "string"
13065
+ }
13066
+ },
13067
+ "required": [
13068
+ "value",
13069
+ "label"
13070
+ ]
13071
+ }
13072
+ },
13073
+ "minSelections": {
13074
+ "type": "integer",
13075
+ "minimum": 0
13076
+ },
13077
+ "maxSelections": {
13078
+ "type": "integer",
13079
+ "minimum": 1
13080
+ },
13081
+ "defaultValue": {
13082
+ "type": "boolean"
13083
+ }
13084
+ },
13085
+ "required": [
13086
+ "id",
13087
+ "type",
13088
+ "label"
13089
+ ]
13090
+ }
13091
+ },
13092
+ "workflowRunId": {
13093
+ "type": [
13094
+ "string",
13095
+ "null"
13096
+ ]
13097
+ },
13098
+ "workflowRunStepId": {
13099
+ "type": [
13100
+ "string",
13101
+ "null"
13102
+ ]
13103
+ },
13104
+ "sourceTaskId": {
13105
+ "type": [
13106
+ "string",
13107
+ "null"
13108
+ ]
13109
+ },
13110
+ "approvers": {
13111
+ "type": "object",
13112
+ "properties": {
13113
+ "users": {
13114
+ "type": "array",
13115
+ "items": {
13116
+ "type": "string"
13117
+ }
13118
+ },
13119
+ "roles": {
13120
+ "type": "array",
13121
+ "items": {
13122
+ "type": "string"
13123
+ }
13124
+ },
13125
+ "policy": {
13126
+ "anyOf": [
13127
+ {
13128
+ "type": "string",
13129
+ "enum": [
13130
+ "any"
13131
+ ]
13132
+ },
13133
+ {
13134
+ "type": "string",
13135
+ "enum": [
13136
+ "all"
13137
+ ]
13138
+ },
13139
+ {
13140
+ "type": "object",
13141
+ "properties": {
13142
+ "min": {
13143
+ "type": "integer",
13144
+ "minimum": 1
13145
+ }
13146
+ },
13147
+ "required": [
13148
+ "min"
13149
+ ]
13150
+ }
13151
+ ]
13152
+ }
13153
+ },
13154
+ "required": [
13155
+ "policy"
13156
+ ]
13157
+ },
13158
+ "status": {
13159
+ "type": "string",
13160
+ "enum": [
13161
+ "pending",
13162
+ "approved",
13163
+ "rejected",
13164
+ "timeout",
13165
+ "cancelled"
13166
+ ]
13167
+ },
13168
+ "responses": {
13169
+ "type": [
13170
+ "object",
13171
+ "null"
13172
+ ],
13173
+ "additionalProperties": {}
13174
+ },
13175
+ "resolvedBy": {
13176
+ "type": [
13177
+ "string",
13178
+ "null"
13179
+ ]
13180
+ },
13181
+ "resolvedAt": {
13182
+ "type": [
13183
+ "string",
13184
+ "null"
13185
+ ]
13186
+ },
13187
+ "resolutionReason": {
13188
+ "type": [
13189
+ "string",
13190
+ "null"
13191
+ ]
13192
+ },
13193
+ "timeoutSeconds": {
13194
+ "type": [
13195
+ "number",
13196
+ "null"
13197
+ ]
13198
+ },
13199
+ "expiresAt": {
13200
+ "type": [
13201
+ "string",
13202
+ "null"
13203
+ ]
13204
+ },
13205
+ "notificationChannels": {
13206
+ "type": [
13207
+ "array",
13208
+ "null"
13209
+ ],
13210
+ "items": {
13211
+ "type": "object",
13212
+ "properties": {
13213
+ "channel": {
13214
+ "type": "string",
13215
+ "enum": [
13216
+ "slack",
13217
+ "email"
13218
+ ]
13219
+ },
13220
+ "target": {
13221
+ "type": "string"
13222
+ },
13223
+ "messageTs": {
13224
+ "type": "string"
13225
+ }
13226
+ },
13227
+ "required": [
13228
+ "channel",
13229
+ "target"
13230
+ ]
13231
+ }
13232
+ },
13233
+ "createdBy": {
13234
+ "type": "string"
13235
+ },
13236
+ "createdAt": {
13237
+ "type": "string"
13238
+ },
13239
+ "updatedAt": {
13240
+ "type": "string"
13241
+ }
13242
+ },
13243
+ "required": [
13244
+ "id",
13245
+ "title",
13246
+ "questions",
13247
+ "workflowRunId",
13248
+ "workflowRunStepId",
13249
+ "sourceTaskId",
13250
+ "approvers",
13251
+ "status",
13252
+ "responses",
13253
+ "resolvedBy",
13254
+ "resolvedAt",
13255
+ "resolutionReason",
13256
+ "timeoutSeconds",
13257
+ "expiresAt",
13258
+ "notificationChannels",
13259
+ "createdAt",
13260
+ "updatedAt"
13261
+ ]
13262
+ },
13263
+ "alreadyCancelled": {
13264
+ "type": "boolean"
13265
+ },
13266
+ "runCancelled": {
13267
+ "type": "boolean"
13268
+ }
13269
+ },
13270
+ "required": [
13271
+ "approvalRequest",
13272
+ "alreadyCancelled",
13273
+ "runCancelled"
12688
13274
  ]
12689
13275
  }
12690
13276
  }
12691
13277
  }
12692
13278
  },
12693
- "400": {
12694
- "description": "Validation error",
13279
+ "403": {
13280
+ "description": "Caller may not cancel this request",
12695
13281
  "content": {
12696
13282
  "application/json": {
12697
13283
  "schema": {
@@ -12711,7 +13297,7 @@
12711
13297
  }
12712
13298
  },
12713
13299
  "409": {
12714
- "description": "Already resolved",
13300
+ "description": "Already resolved with approved, rejected, or timeout, or its expiresAt passed",
12715
13301
  "content": {
12716
13302
  "application/json": {
12717
13303
  "schema": {
@@ -13695,6 +14281,17 @@
13695
14281
  "name": "repoId",
13696
14282
  "in": "query"
13697
14283
  },
14284
+ {
14285
+ "schema": {
14286
+ "type": "string",
14287
+ "minLength": 1,
14288
+ "description": "Return only the entry with this exact key. Omit to return every resolved entry."
14289
+ },
14290
+ "required": false,
14291
+ "description": "Return only the entry with this exact key. Omit to return every resolved entry.",
14292
+ "name": "key",
14293
+ "in": "query"
14294
+ },
13698
14295
  {
13699
14296
  "schema": {
13700
14297
  "type": "string",
@@ -14018,6 +14615,17 @@
14018
14615
  "name": "scopeId",
14019
14616
  "in": "query"
14020
14617
  },
14618
+ {
14619
+ "schema": {
14620
+ "type": "string",
14621
+ "minLength": 1,
14622
+ "description": "Return only entries with this exact key. Omit to return every entry."
14623
+ },
14624
+ "required": false,
14625
+ "description": "Return only entries with this exact key. Omit to return every entry.",
14626
+ "name": "key",
14627
+ "in": "query"
14628
+ },
14021
14629
  {
14022
14630
  "schema": {
14023
14631
  "type": "string",
@@ -16253,6 +16861,40 @@
16253
16861
  "required": false,
16254
16862
  "name": "limit",
16255
16863
  "in": "query"
16864
+ },
16865
+ {
16866
+ "schema": {
16867
+ "type": "string",
16868
+ "description": "Comma-separated event names; matches any of them (ANDed with `event`)"
16869
+ },
16870
+ "required": false,
16871
+ "description": "Comma-separated event names; matches any of them (ANDed with `event`)",
16872
+ "name": "events",
16873
+ "in": "query"
16874
+ },
16875
+ {
16876
+ "schema": {
16877
+ "type": "string",
16878
+ "description": "Comma-separated `data.field` values, used with latestPerDataField"
16879
+ },
16880
+ "required": false,
16881
+ "description": "Comma-separated `data.field` values, used with latestPerDataField",
16882
+ "name": "dataFields",
16883
+ "in": "query"
16884
+ },
16885
+ {
16886
+ "schema": {
16887
+ "type": "string",
16888
+ "enum": [
16889
+ "true",
16890
+ "false"
16891
+ ],
16892
+ "description": "When true, return only the newest event per (event, data.field) pair for every name in `event`/`events` and every value in `dataFields`"
16893
+ },
16894
+ "required": false,
16895
+ "description": "When true, return only the newest event per (event, data.field) pair for every name in `event`/`events` and every value in `dataFields`",
16896
+ "name": "latestPerDataField",
16897
+ "in": "query"
16256
16898
  }
16257
16899
  ],
16258
16900
  "responses": {
@@ -16268,6 +16910,13 @@
16268
16910
  "items": {
16269
16911
  "$ref": "#/components/schemas/SwarmEvent"
16270
16912
  }
16913
+ },
16914
+ "latestPerDataField": {
16915
+ "type": "boolean",
16916
+ "enum": [
16917
+ true
16918
+ ],
16919
+ "description": "Present only when the request asked for latestPerDataField=true"
16271
16920
  }
16272
16921
  },
16273
16922
  "required": [
@@ -16276,6 +16925,16 @@
16276
16925
  }
16277
16926
  }
16278
16927
  }
16928
+ },
16929
+ "400": {
16930
+ "description": "Validation error",
16931
+ "content": {
16932
+ "application/json": {
16933
+ "schema": {
16934
+ "$ref": "#/components/schemas/ErrorResponse"
16935
+ }
16936
+ }
16937
+ }
16279
16938
  }
16280
16939
  }
16281
16940
  }
@@ -28038,7 +28697,8 @@
28038
28697
  "opencode",
28039
28698
  "devin",
28040
28699
  "gemini",
28041
- "acp"
28700
+ "acp",
28701
+ "dsh"
28042
28702
  ]
28043
28703
  },
28044
28704
  "required": true,
@@ -28119,7 +28779,8 @@
28119
28779
  "opencode",
28120
28780
  "devin",
28121
28781
  "gemini",
28122
- "acp"
28782
+ "acp",
28783
+ "dsh"
28123
28784
  ]
28124
28785
  },
28125
28786
  "required": true,
@@ -28233,7 +28894,8 @@
28233
28894
  "opencode",
28234
28895
  "devin",
28235
28896
  "gemini",
28236
- "acp"
28897
+ "acp",
28898
+ "dsh"
28237
28899
  ]
28238
28900
  },
28239
28901
  "required": true,
@@ -28315,7 +28977,8 @@
28315
28977
  "opencode",
28316
28978
  "devin",
28317
28979
  "gemini",
28318
- "acp"
28980
+ "acp",
28981
+ "dsh"
28319
28982
  ]
28320
28983
  },
28321
28984
  "required": true,
@@ -38119,7 +38782,8 @@
38119
38782
  "opencode",
38120
38783
  "devin",
38121
38784
  "gemini",
38122
- "acp"
38785
+ "acp",
38786
+ "dsh"
38123
38787
  ]
38124
38788
  },
38125
38789
  "createdAt": {
@@ -38896,6 +39560,15 @@
38896
39560
  "name": "requestedByUserId",
38897
39561
  "in": "query"
38898
39562
  },
39563
+ {
39564
+ "schema": {
39565
+ "type": "string",
39566
+ "minLength": 1
39567
+ },
39568
+ "required": false,
39569
+ "name": "contextKeyPrefix",
39570
+ "in": "query"
39571
+ },
38899
39572
  {
38900
39573
  "schema": {
38901
39574
  "type": "string",
@@ -43337,6 +44010,7 @@
43337
44010
  "/api/scheduled-tasks": {
43338
44011
  "get": {
43339
44012
  "summary": "List scheduled tasks",
44013
+ "description": "Returns full schedules by default. Pass `fields=slim` for the list-view shape, which swaps the full `taskTemplate` for a bounded `taskTemplatePreview`. Fetch one schedule in full via `GET /api/schedules/{id}`.",
43340
44014
  "tags": [
43341
44015
  "Stats"
43342
44016
  ],
@@ -43419,6 +44093,18 @@
43419
44093
  "required": false,
43420
44094
  "name": "scriptName",
43421
44095
  "in": "query"
44096
+ },
44097
+ {
44098
+ "schema": {
44099
+ "type": "string",
44100
+ "enum": [
44101
+ "full",
44102
+ "slim"
44103
+ ]
44104
+ },
44105
+ "required": false,
44106
+ "name": "fields",
44107
+ "in": "query"
43422
44108
  }
43423
44109
  ],
43424
44110
  "responses": {
@@ -43430,191 +44116,384 @@
43430
44116
  "type": "object",
43431
44117
  "properties": {
43432
44118
  "scheduledTasks": {
43433
- "type": "array",
43434
- "items": {
43435
- "type": "object",
43436
- "properties": {
43437
- "id": {
43438
- "type": "string",
43439
- "format": "uuid"
43440
- },
43441
- "key": {
43442
- "type": "string",
43443
- "minLength": 1,
43444
- "maxLength": 255,
43445
- "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
43446
- },
43447
- "name": {
43448
- "type": "string",
43449
- "minLength": 1,
43450
- "maxLength": 100
43451
- },
43452
- "description": {
43453
- "type": "string"
43454
- },
43455
- "cronExpression": {
43456
- "type": "string"
43457
- },
43458
- "intervalMs": {
43459
- "type": "integer",
43460
- "exclusiveMinimum": 0
43461
- },
43462
- "taskTemplate": {
43463
- "type": "string"
43464
- },
43465
- "taskType": {
43466
- "type": "string",
43467
- "maxLength": 50
43468
- },
43469
- "tags": {
43470
- "type": "array",
43471
- "items": {
43472
- "type": "string"
44119
+ "anyOf": [
44120
+ {
44121
+ "type": "array",
44122
+ "items": {
44123
+ "type": "object",
44124
+ "properties": {
44125
+ "id": {
44126
+ "type": "string",
44127
+ "format": "uuid"
44128
+ },
44129
+ "key": {
44130
+ "type": "string",
44131
+ "minLength": 1,
44132
+ "maxLength": 255,
44133
+ "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
44134
+ },
44135
+ "name": {
44136
+ "type": "string",
44137
+ "minLength": 1,
44138
+ "maxLength": 100
44139
+ },
44140
+ "description": {
44141
+ "type": "string"
44142
+ },
44143
+ "cronExpression": {
44144
+ "type": "string"
44145
+ },
44146
+ "intervalMs": {
44147
+ "type": "integer",
44148
+ "exclusiveMinimum": 0
44149
+ },
44150
+ "taskTemplate": {
44151
+ "type": "string"
44152
+ },
44153
+ "taskType": {
44154
+ "type": "string",
44155
+ "maxLength": 50
44156
+ },
44157
+ "tags": {
44158
+ "type": "array",
44159
+ "items": {
44160
+ "type": "string"
44161
+ },
44162
+ "default": []
44163
+ },
44164
+ "priority": {
44165
+ "type": "integer",
44166
+ "minimum": 0,
44167
+ "maximum": 100,
44168
+ "default": 50
44169
+ },
44170
+ "targetAgentId": {
44171
+ "type": "string"
44172
+ },
44173
+ "enabled": {
44174
+ "type": "boolean",
44175
+ "default": true
44176
+ },
44177
+ "lastRunAt": {
44178
+ "type": "string",
44179
+ "format": "date-time"
44180
+ },
44181
+ "nextRunAt": {
44182
+ "type": "string",
44183
+ "format": "date-time"
44184
+ },
44185
+ "createdByAgentId": {
44186
+ "type": "string"
44187
+ },
44188
+ "parentTaskId": {
44189
+ "type": "string"
44190
+ },
44191
+ "requestedDelayMs": {
44192
+ "type": "integer",
44193
+ "exclusiveMinimum": 0
44194
+ },
44195
+ "requestedRunAt": {
44196
+ "type": "string",
44197
+ "format": "date-time"
44198
+ },
44199
+ "timezone": {
44200
+ "type": "string",
44201
+ "default": "UTC"
44202
+ },
44203
+ "consecutiveErrors": {
44204
+ "type": "integer",
44205
+ "minimum": 0,
44206
+ "default": 0
44207
+ },
44208
+ "lastErrorAt": {
44209
+ "type": "string",
44210
+ "format": "date-time"
44211
+ },
44212
+ "lastErrorMessage": {
44213
+ "type": "string"
44214
+ },
44215
+ "model": {
44216
+ "type": "string"
44217
+ },
44218
+ "modelTier": {
44219
+ "type": "string",
44220
+ "enum": [
44221
+ "smol",
44222
+ "regular",
44223
+ "smart",
44224
+ "ultra"
44225
+ ]
44226
+ },
44227
+ "scheduleType": {
44228
+ "type": "string",
44229
+ "enum": [
44230
+ "recurring",
44231
+ "one_time"
44232
+ ],
44233
+ "default": "recurring"
44234
+ },
44235
+ "targetType": {
44236
+ "type": "string",
44237
+ "enum": [
44238
+ "agent-task",
44239
+ "workflow",
44240
+ "script"
44241
+ ],
44242
+ "default": "agent-task"
44243
+ },
44244
+ "workflowId": {
44245
+ "type": "string",
44246
+ "format": "uuid"
44247
+ },
44248
+ "scriptName": {
44249
+ "type": "string"
44250
+ },
44251
+ "scriptArgs": {
44252
+ "type": "object",
44253
+ "additionalProperties": {}
44254
+ },
44255
+ "params": {
44256
+ "type": "object",
44257
+ "additionalProperties": {}
44258
+ },
44259
+ "requiredParams": {
44260
+ "type": "array",
44261
+ "items": {
44262
+ "type": "string"
44263
+ }
44264
+ },
44265
+ "requires": {
44266
+ "type": "array",
44267
+ "items": {
44268
+ "type": "string",
44269
+ "enum": [
44270
+ "slack",
44271
+ "github",
44272
+ "linear",
44273
+ "jira",
44274
+ "gsc",
44275
+ "agentmail",
44276
+ "agentfs"
44277
+ ]
44278
+ }
44279
+ },
44280
+ "createdAt": {
44281
+ "type": "string",
44282
+ "format": "date-time"
44283
+ },
44284
+ "lastUpdatedAt": {
44285
+ "type": "string",
44286
+ "format": "date-time"
44287
+ },
44288
+ "createdBy": {
44289
+ "type": "string"
44290
+ },
44291
+ "updatedBy": {
44292
+ "type": "string"
44293
+ },
44294
+ "favorite": {
44295
+ "type": "boolean"
44296
+ }
43473
44297
  },
43474
- "default": []
43475
- },
43476
- "priority": {
43477
- "type": "integer",
43478
- "minimum": 0,
43479
- "maximum": 100,
43480
- "default": 50
43481
- },
43482
- "targetAgentId": {
43483
- "type": "string"
43484
- },
43485
- "enabled": {
43486
- "type": "boolean",
43487
- "default": true
43488
- },
43489
- "lastRunAt": {
43490
- "type": "string",
43491
- "format": "date-time"
43492
- },
43493
- "nextRunAt": {
43494
- "type": "string",
43495
- "format": "date-time"
43496
- },
43497
- "createdByAgentId": {
43498
- "type": "string"
43499
- },
43500
- "parentTaskId": {
43501
- "type": "string"
43502
- },
43503
- "requestedDelayMs": {
43504
- "type": "integer",
43505
- "exclusiveMinimum": 0
43506
- },
43507
- "requestedRunAt": {
43508
- "type": "string",
43509
- "format": "date-time"
43510
- },
43511
- "timezone": {
43512
- "type": "string",
43513
- "default": "UTC"
43514
- },
43515
- "consecutiveErrors": {
43516
- "type": "integer",
43517
- "minimum": 0,
43518
- "default": 0
43519
- },
43520
- "lastErrorAt": {
43521
- "type": "string",
43522
- "format": "date-time"
43523
- },
43524
- "lastErrorMessage": {
43525
- "type": "string"
43526
- },
43527
- "model": {
43528
- "type": "string"
43529
- },
43530
- "modelTier": {
43531
- "type": "string",
43532
- "enum": [
43533
- "smol",
43534
- "regular",
43535
- "smart",
43536
- "ultra"
44298
+ "required": [
44299
+ "id",
44300
+ "key",
44301
+ "name",
44302
+ "createdAt",
44303
+ "lastUpdatedAt"
43537
44304
  ]
43538
- },
43539
- "scheduleType": {
43540
- "type": "string",
43541
- "enum": [
43542
- "recurring",
43543
- "one_time"
43544
- ],
43545
- "default": "recurring"
43546
- },
43547
- "targetType": {
43548
- "type": "string",
43549
- "enum": [
43550
- "agent-task",
43551
- "workflow",
43552
- "script"
43553
- ],
43554
- "default": "agent-task"
43555
- },
43556
- "workflowId": {
43557
- "type": "string",
43558
- "format": "uuid"
43559
- },
43560
- "scriptName": {
43561
- "type": "string"
43562
- },
43563
- "scriptArgs": {
43564
- "type": "object",
43565
- "additionalProperties": {}
43566
- },
43567
- "params": {
43568
- "type": "object",
43569
- "additionalProperties": {}
43570
- },
43571
- "requiredParams": {
43572
- "type": "array",
43573
- "items": {
43574
- "type": "string"
43575
- }
43576
- },
43577
- "requires": {
43578
- "type": "array",
43579
- "items": {
43580
- "type": "string",
43581
- "enum": [
43582
- "slack",
43583
- "github",
43584
- "linear",
43585
- "jira",
43586
- "gsc",
43587
- "agentmail",
43588
- "agentfs"
43589
- ]
43590
- }
43591
- },
43592
- "createdAt": {
43593
- "type": "string",
43594
- "format": "date-time"
43595
- },
43596
- "lastUpdatedAt": {
43597
- "type": "string",
43598
- "format": "date-time"
43599
- },
43600
- "createdBy": {
43601
- "type": "string"
43602
- },
43603
- "updatedBy": {
43604
- "type": "string"
43605
- },
43606
- "favorite": {
43607
- "type": "boolean"
43608
44305
  }
43609
44306
  },
43610
- "required": [
43611
- "id",
43612
- "key",
43613
- "name",
43614
- "createdAt",
43615
- "lastUpdatedAt"
43616
- ]
43617
- }
44307
+ {
44308
+ "type": "array",
44309
+ "items": {
44310
+ "type": "object",
44311
+ "properties": {
44312
+ "id": {
44313
+ "type": "string",
44314
+ "format": "uuid"
44315
+ },
44316
+ "key": {
44317
+ "type": "string",
44318
+ "minLength": 1,
44319
+ "maxLength": 255,
44320
+ "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
44321
+ },
44322
+ "name": {
44323
+ "type": "string",
44324
+ "minLength": 1,
44325
+ "maxLength": 100
44326
+ },
44327
+ "description": {
44328
+ "type": "string"
44329
+ },
44330
+ "cronExpression": {
44331
+ "type": "string"
44332
+ },
44333
+ "intervalMs": {
44334
+ "type": "integer",
44335
+ "exclusiveMinimum": 0
44336
+ },
44337
+ "taskType": {
44338
+ "type": "string",
44339
+ "maxLength": 50
44340
+ },
44341
+ "tags": {
44342
+ "type": "array",
44343
+ "items": {
44344
+ "type": "string"
44345
+ },
44346
+ "default": []
44347
+ },
44348
+ "priority": {
44349
+ "type": "integer",
44350
+ "minimum": 0,
44351
+ "maximum": 100,
44352
+ "default": 50
44353
+ },
44354
+ "targetAgentId": {
44355
+ "type": "string"
44356
+ },
44357
+ "enabled": {
44358
+ "type": "boolean",
44359
+ "default": true
44360
+ },
44361
+ "lastRunAt": {
44362
+ "type": "string",
44363
+ "format": "date-time"
44364
+ },
44365
+ "nextRunAt": {
44366
+ "type": "string",
44367
+ "format": "date-time"
44368
+ },
44369
+ "createdByAgentId": {
44370
+ "type": "string"
44371
+ },
44372
+ "parentTaskId": {
44373
+ "type": "string"
44374
+ },
44375
+ "requestedDelayMs": {
44376
+ "type": "integer",
44377
+ "exclusiveMinimum": 0
44378
+ },
44379
+ "requestedRunAt": {
44380
+ "type": "string",
44381
+ "format": "date-time"
44382
+ },
44383
+ "timezone": {
44384
+ "type": "string",
44385
+ "default": "UTC"
44386
+ },
44387
+ "consecutiveErrors": {
44388
+ "type": "integer",
44389
+ "minimum": 0,
44390
+ "default": 0
44391
+ },
44392
+ "lastErrorAt": {
44393
+ "type": "string",
44394
+ "format": "date-time"
44395
+ },
44396
+ "lastErrorMessage": {
44397
+ "type": "string"
44398
+ },
44399
+ "model": {
44400
+ "type": "string"
44401
+ },
44402
+ "modelTier": {
44403
+ "type": "string",
44404
+ "enum": [
44405
+ "smol",
44406
+ "regular",
44407
+ "smart",
44408
+ "ultra"
44409
+ ]
44410
+ },
44411
+ "scheduleType": {
44412
+ "type": "string",
44413
+ "enum": [
44414
+ "recurring",
44415
+ "one_time"
44416
+ ],
44417
+ "default": "recurring"
44418
+ },
44419
+ "targetType": {
44420
+ "type": "string",
44421
+ "enum": [
44422
+ "agent-task",
44423
+ "workflow",
44424
+ "script"
44425
+ ],
44426
+ "default": "agent-task"
44427
+ },
44428
+ "workflowId": {
44429
+ "type": "string",
44430
+ "format": "uuid"
44431
+ },
44432
+ "scriptName": {
44433
+ "type": "string"
44434
+ },
44435
+ "scriptArgs": {
44436
+ "type": "object",
44437
+ "additionalProperties": {}
44438
+ },
44439
+ "params": {
44440
+ "type": "object",
44441
+ "additionalProperties": {}
44442
+ },
44443
+ "requiredParams": {
44444
+ "type": "array",
44445
+ "items": {
44446
+ "type": "string"
44447
+ }
44448
+ },
44449
+ "requires": {
44450
+ "type": "array",
44451
+ "items": {
44452
+ "type": "string",
44453
+ "enum": [
44454
+ "slack",
44455
+ "github",
44456
+ "linear",
44457
+ "jira",
44458
+ "gsc",
44459
+ "agentmail",
44460
+ "agentfs"
44461
+ ]
44462
+ }
44463
+ },
44464
+ "createdAt": {
44465
+ "type": "string",
44466
+ "format": "date-time"
44467
+ },
44468
+ "lastUpdatedAt": {
44469
+ "type": "string",
44470
+ "format": "date-time"
44471
+ },
44472
+ "createdBy": {
44473
+ "type": "string"
44474
+ },
44475
+ "updatedBy": {
44476
+ "type": "string"
44477
+ },
44478
+ "favorite": {
44479
+ "type": "boolean"
44480
+ },
44481
+ "taskTemplatePreview": {
44482
+ "type": "string"
44483
+ }
44484
+ },
44485
+ "required": [
44486
+ "id",
44487
+ "key",
44488
+ "name",
44489
+ "createdAt",
44490
+ "lastUpdatedAt",
44491
+ "favorite",
44492
+ "taskTemplatePreview"
44493
+ ]
44494
+ }
44495
+ }
44496
+ ]
43618
44497
  }
43619
44498
  },
43620
44499
  "required": [
@@ -43796,7 +44675,7 @@
43796
44675
  "/api/tasks": {
43797
44676
  "get": {
43798
44677
  "summary": "List tasks with filters",
43799
- "description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`. Fetch a single task in full via `GET /api/tasks/{id}`.",
44678
+ "description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`, or `fields=timeline` for the narrow shape the dashboard timeline draws. Fetch a single task in full via `GET /api/tasks/{id}`. `total` (the filtered row count, ignoring limit/offset) is computed only with `includeTotal=true`.",
43800
44679
  "tags": [
43801
44680
  "Tasks"
43802
44681
  ],
@@ -43948,12 +44827,25 @@
43948
44827
  "type": "string",
43949
44828
  "enum": [
43950
44829
  "full",
43951
- "slim"
44830
+ "slim",
44831
+ "timeline"
43952
44832
  ]
43953
44833
  },
43954
44834
  "required": false,
43955
44835
  "name": "fields",
43956
44836
  "in": "query"
44837
+ },
44838
+ {
44839
+ "schema": {
44840
+ "type": "string",
44841
+ "enum": [
44842
+ "true",
44843
+ "false"
44844
+ ]
44845
+ },
44846
+ "required": false,
44847
+ "name": "includeTotal",
44848
+ "in": "query"
43957
44849
  }
43958
44850
  ],
43959
44851
  "responses": {
@@ -44149,6 +45041,79 @@
44149
45041
  "lastUpdatedAt"
44150
45042
  ]
44151
45043
  }
45044
+ },
45045
+ {
45046
+ "type": "array",
45047
+ "items": {
45048
+ "type": "object",
45049
+ "properties": {
45050
+ "id": {
45051
+ "type": "string",
45052
+ "format": "uuid"
45053
+ },
45054
+ "agentId": {
45055
+ "type": [
45056
+ "string",
45057
+ "null"
45058
+ ]
45059
+ },
45060
+ "parentTaskId": {
45061
+ "type": "string"
45062
+ },
45063
+ "task": {
45064
+ "type": "string",
45065
+ "minLength": 1
45066
+ },
45067
+ "title": {
45068
+ "type": "string"
45069
+ },
45070
+ "status": {
45071
+ "type": "string",
45072
+ "enum": [
45073
+ "draft",
45074
+ "backlog",
45075
+ "unassigned",
45076
+ "offered",
45077
+ "reviewing",
45078
+ "pending",
45079
+ "in_progress",
45080
+ "paused",
45081
+ "completed",
45082
+ "failed",
45083
+ "cancelled",
45084
+ "superseded"
45085
+ ]
45086
+ },
45087
+ "createdAt": {
45088
+ "type": "string",
45089
+ "format": "date-time"
45090
+ },
45091
+ "lastUpdatedAt": {
45092
+ "type": "string",
45093
+ "format": "date-time"
45094
+ },
45095
+ "finishedAt": {
45096
+ "type": "string",
45097
+ "format": "date-time"
45098
+ },
45099
+ "peakContextTokens": {
45100
+ "type": "integer",
45101
+ "minimum": 0
45102
+ },
45103
+ "totalCostUsd": {
45104
+ "type": "number",
45105
+ "minimum": 0
45106
+ }
45107
+ },
45108
+ "required": [
45109
+ "id",
45110
+ "agentId",
45111
+ "task",
45112
+ "status",
45113
+ "createdAt",
45114
+ "lastUpdatedAt"
45115
+ ]
45116
+ }
44152
45117
  }
44153
45118
  ]
44154
45119
  },
@@ -44157,8 +45122,7 @@
44157
45122
  }
44158
45123
  },
44159
45124
  "required": [
44160
- "tasks",
44161
- "total"
45125
+ "tasks"
44162
45126
  ]
44163
45127
  }
44164
45128
  }
@@ -49464,6 +50428,27 @@
49464
50428
  },
49465
50429
  "taskId": {
49466
50430
  "type": "string"
50431
+ },
50432
+ "skipped": {
50433
+ "type": "boolean"
50434
+ },
50435
+ "reason": {
50436
+ "type": "string"
50437
+ },
50438
+ "extension": {
50439
+ "type": "object",
50440
+ "properties": {
50441
+ "id": {
50442
+ "type": "string"
50443
+ },
50444
+ "name": {
50445
+ "type": "string"
50446
+ }
50447
+ },
50448
+ "required": [
50449
+ "id",
50450
+ "name"
50451
+ ]
49467
50452
  }
49468
50453
  },
49469
50454
  "required": [
@@ -49517,6 +50502,27 @@
49517
50502
  },
49518
50503
  "taskId": {
49519
50504
  "type": "string"
50505
+ },
50506
+ "skipped": {
50507
+ "type": "boolean"
50508
+ },
50509
+ "reason": {
50510
+ "type": "string"
50511
+ },
50512
+ "extension": {
50513
+ "type": "object",
50514
+ "properties": {
50515
+ "id": {
50516
+ "type": "string"
50517
+ },
50518
+ "name": {
50519
+ "type": "string"
50520
+ }
50521
+ },
50522
+ "required": [
50523
+ "id",
50524
+ "name"
50525
+ ]
49520
50526
  }
49521
50527
  },
49522
50528
  "required": [
@@ -51104,7 +52110,8 @@
51104
52110
  },
51105
52111
  "/api/workflows/{id}/runs": {
51106
52112
  "get": {
51107
- "summary": "List runs for a workflow",
52113
+ "summary": "List runs for a workflow, newest first",
52114
+ "description": "Returns one page of runs without `context` (fetch it with GET /api/workflow-runs/{id}). `limit` defaults to 50 and is capped at 100; follow `page.nextOffset` while `page.hasMore` is true.",
51108
52115
  "tags": [
51109
52116
  "Workflows"
51110
52117
  ],
@@ -51163,58 +52170,48 @@
51163
52170
  ],
51164
52171
  "responses": {
51165
52172
  "200": {
51166
- "description": "Workflow run list",
52173
+ "description": "One page of workflow runs",
51167
52174
  "content": {
51168
52175
  "application/json": {
51169
52176
  "schema": {
51170
- "anyOf": [
51171
- {
52177
+ "type": "object",
52178
+ "properties": {
52179
+ "runs": {
51172
52180
  "type": "array",
51173
52181
  "items": {
51174
- "$ref": "#/components/schemas/WorkflowRun"
52182
+ "$ref": "#/components/schemas/WorkflowRunSummary"
51175
52183
  }
51176
52184
  },
51177
- {
52185
+ "page": {
51178
52186
  "type": "object",
51179
52187
  "properties": {
51180
- "runs": {
51181
- "type": "array",
51182
- "items": {
51183
- "$ref": "#/components/schemas/WorkflowRun"
51184
- }
52188
+ "limit": {
52189
+ "type": "integer"
51185
52190
  },
51186
- "page": {
51187
- "type": "object",
51188
- "properties": {
51189
- "limit": {
51190
- "type": "integer"
51191
- },
51192
- "offset": {
51193
- "type": "integer"
51194
- },
51195
- "total": {
51196
- "type": "integer"
51197
- },
51198
- "hasMore": {
51199
- "type": "boolean"
51200
- },
51201
- "nextOffset": {
51202
- "type": "integer"
51203
- }
51204
- },
51205
- "required": [
51206
- "limit",
51207
- "offset",
51208
- "total",
51209
- "hasMore"
51210
- ]
52191
+ "offset": {
52192
+ "type": "integer"
52193
+ },
52194
+ "total": {
52195
+ "type": "integer"
52196
+ },
52197
+ "hasMore": {
52198
+ "type": "boolean"
52199
+ },
52200
+ "nextOffset": {
52201
+ "type": "integer"
51211
52202
  }
51212
52203
  },
51213
52204
  "required": [
51214
- "runs",
51215
- "page"
52205
+ "limit",
52206
+ "offset",
52207
+ "total",
52208
+ "hasMore"
51216
52209
  ]
51217
52210
  }
52211
+ },
52212
+ "required": [
52213
+ "runs",
52214
+ "page"
51218
52215
  ]
51219
52216
  }
51220
52217
  }