@desplega.ai/agent-swarm 1.20.0 → 1.51.2

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 (561) hide show
  1. package/README.md +271 -169
  2. package/openapi.json +5015 -0
  3. package/package.json +40 -7
  4. package/plugin/commands/close-issue.md +7 -3
  5. package/plugin/commands/create-pr.md +18 -12
  6. package/plugin/commands/implement-issue.md +7 -3
  7. package/plugin/commands/respond-github.md +8 -4
  8. package/plugin/commands/review-pr.md +44 -10
  9. package/plugin/commands/start-leader.md +1 -3
  10. package/plugin/commands/start-worker.md +1 -3
  11. package/plugin/commands/work-on-task.md +22 -3
  12. package/plugin/pi-skills/close-issue/SKILL.md +90 -0
  13. package/plugin/pi-skills/create-pr/SKILL.md +99 -0
  14. package/plugin/pi-skills/implement-issue/SKILL.md +135 -0
  15. package/plugin/pi-skills/investigate-sentry-issue/SKILL.md +138 -0
  16. package/plugin/pi-skills/respond-github/SKILL.md +98 -0
  17. package/plugin/pi-skills/review-offered-task/SKILL.md +45 -0
  18. package/plugin/pi-skills/review-pr/SKILL.md +261 -0
  19. package/plugin/pi-skills/start-leader/SKILL.md +121 -0
  20. package/plugin/pi-skills/start-worker/SKILL.md +60 -0
  21. package/plugin/pi-skills/swarm-chat/SKILL.md +82 -0
  22. package/plugin/pi-skills/todos/SKILL.md +66 -0
  23. package/plugin/pi-skills/work-on-task/SKILL.md +65 -0
  24. package/plugin/skills/artifacts/examples/approval-flow.ts +34 -0
  25. package/plugin/skills/artifacts/examples/hono-dashboard.ts +31 -0
  26. package/plugin/skills/artifacts/examples/multi-artifact.ts +20 -0
  27. package/plugin/skills/artifacts/examples/static-report.sh +17 -0
  28. package/plugin/skills/artifacts/skill.md +71 -0
  29. package/src/agentmail/app.ts +65 -0
  30. package/src/agentmail/handlers.ts +262 -0
  31. package/src/agentmail/index.ts +9 -0
  32. package/src/agentmail/templates.ts +111 -0
  33. package/src/agentmail/types.ts +51 -0
  34. package/src/artifact-sdk/browser-sdk.ts +30 -0
  35. package/src/artifact-sdk/index.ts +2 -0
  36. package/src/artifact-sdk/localtunnel.d.ts +20 -0
  37. package/src/artifact-sdk/port.ts +12 -0
  38. package/src/artifact-sdk/server.ts +156 -0
  39. package/src/artifact-sdk/tunnel.ts +19 -0
  40. package/src/be/chunking.ts +193 -0
  41. package/src/be/db-queries/oauth.ts +90 -0
  42. package/src/be/db-queries/tracker.ts +182 -0
  43. package/src/be/db.ts +3327 -784
  44. package/src/be/embedding.ts +80 -0
  45. package/src/be/migrations/001_initial.sql +409 -0
  46. package/src/be/migrations/002_one_time_schedules.sql +59 -0
  47. package/src/be/migrations/003_workflows.sql +51 -0
  48. package/src/be/migrations/004_workflow_source.sql +81 -0
  49. package/src/be/migrations/005_epic_next_steps.sql +2 -0
  50. package/src/be/migrations/006_vcs_provider.sql +94 -0
  51. package/src/be/migrations/007_task_dir.sql +2 -0
  52. package/src/be/migrations/008_workflow_redesign.sql +85 -0
  53. package/src/be/migrations/009_tracker_integration.sql +144 -0
  54. package/src/be/migrations/010_step_diagnostics.sql +1 -0
  55. package/src/be/migrations/011_step_next_port.sql +1 -0
  56. package/src/be/migrations/012_trigger_schema.sql +1 -0
  57. package/src/be/migrations/013_task_output_schema.sql +2 -0
  58. package/src/be/migrations/014_prompt_templates.sql +33 -0
  59. package/src/be/migrations/015_workflow_workspace.sql +3 -0
  60. package/src/be/migrations/016_active_session_runner_session.sql +4 -0
  61. package/src/be/migrations/017_channel_activity_cursors.sql +6 -0
  62. package/src/be/migrations/018_fix_seed_double_version.sql +30 -0
  63. package/src/be/migrations/runner.ts +188 -0
  64. package/src/be/seed.ts +62 -0
  65. package/src/cli.tsx +231 -299
  66. package/src/commands/artifact.ts +241 -0
  67. package/src/commands/onboard/compose-generator.ts +169 -0
  68. package/src/commands/onboard/env-generator.ts +79 -0
  69. package/src/commands/onboard/manifest.ts +37 -0
  70. package/src/commands/onboard/presets.ts +85 -0
  71. package/src/commands/onboard/service-names.ts +47 -0
  72. package/src/commands/onboard/steps/core-credentials.tsx +111 -0
  73. package/src/commands/onboard/steps/custom-templates.tsx +168 -0
  74. package/src/commands/onboard/steps/generate.tsx +154 -0
  75. package/src/commands/onboard/steps/harness-credentials.tsx +195 -0
  76. package/src/commands/onboard/steps/harness.tsx +21 -0
  77. package/src/commands/onboard/steps/health-check.tsx +171 -0
  78. package/src/commands/onboard/steps/integration-github.tsx +105 -0
  79. package/src/commands/onboard/steps/integration-gitlab.tsx +79 -0
  80. package/src/commands/onboard/steps/integration-menu.tsx +58 -0
  81. package/src/commands/onboard/steps/integration-sentry.tsx +79 -0
  82. package/src/commands/onboard/steps/integration-slack.tsx +165 -0
  83. package/src/commands/onboard/steps/post-connect.tsx +145 -0
  84. package/src/commands/onboard/steps/post-dashboard.tsx +34 -0
  85. package/src/commands/onboard/steps/post-task.tsx +103 -0
  86. package/src/commands/onboard/steps/prereq-check.tsx +178 -0
  87. package/src/commands/onboard/steps/review.tsx +82 -0
  88. package/src/commands/onboard/steps/start.tsx +97 -0
  89. package/src/commands/onboard/templates.ts +34 -0
  90. package/src/commands/onboard/types.ts +259 -0
  91. package/src/commands/onboard.tsx +425 -0
  92. package/src/commands/runner.ts +1540 -630
  93. package/src/commands/setup.tsx +23 -38
  94. package/src/commands/shared/client-config.ts +41 -0
  95. package/src/commands/templates.ts +172 -0
  96. package/src/github/app.ts +8 -0
  97. package/src/github/handlers.ts +384 -151
  98. package/src/github/index.ts +1 -0
  99. package/src/github/mentions-aliases.test.ts +73 -0
  100. package/src/github/mentions.test.ts +3 -3
  101. package/src/github/mentions.ts +32 -6
  102. package/src/github/templates.ts +398 -0
  103. package/src/github/types.ts +1 -0
  104. package/src/gitlab/auth.ts +63 -0
  105. package/src/gitlab/handlers.ts +368 -0
  106. package/src/gitlab/index.ts +19 -0
  107. package/src/gitlab/reactions.ts +104 -0
  108. package/src/gitlab/templates.ts +140 -0
  109. package/src/gitlab/types.ts +130 -0
  110. package/src/heartbeat/heartbeat.ts +434 -0
  111. package/src/heartbeat/index.ts +1 -0
  112. package/src/heartbeat/templates.ts +30 -0
  113. package/src/hooks/hook.ts +555 -4
  114. package/src/hooks/tool-loop-detection.test.ts +158 -0
  115. package/src/hooks/tool-loop-detection.ts +167 -0
  116. package/src/http/active-sessions.ts +199 -0
  117. package/src/http/agents.ts +328 -0
  118. package/src/http/config.ts +191 -0
  119. package/src/http/core.ts +309 -0
  120. package/src/http/db-query.ts +91 -0
  121. package/src/http/ecosystem.ts +63 -0
  122. package/src/http/epics.ts +460 -0
  123. package/src/http/index.ts +216 -0
  124. package/src/http/mcp.ts +77 -0
  125. package/src/http/memory.ts +168 -0
  126. package/src/http/openapi.ts +109 -0
  127. package/src/http/poll.ts +299 -0
  128. package/src/http/prompt-templates.ts +412 -0
  129. package/src/http/repos.ts +195 -0
  130. package/src/http/route-def.ts +123 -0
  131. package/src/http/schedules.ts +426 -0
  132. package/src/http/session-data.ts +241 -0
  133. package/src/http/stats.ts +174 -0
  134. package/src/http/tasks.ts +468 -0
  135. package/src/http/trackers/index.ts +10 -0
  136. package/src/http/trackers/linear.ts +187 -0
  137. package/src/http/types.ts +12 -0
  138. package/src/http/utils.ts +87 -0
  139. package/src/http/webhooks.ts +432 -0
  140. package/src/http/workflows.ts +530 -0
  141. package/src/http.ts +1 -1890
  142. package/src/linear/README.md +65 -0
  143. package/src/linear/app.ts +48 -0
  144. package/src/linear/client.ts +18 -0
  145. package/src/linear/index.ts +1 -0
  146. package/src/linear/oauth.ts +35 -0
  147. package/src/linear/outbound.ts +212 -0
  148. package/src/linear/sync.ts +567 -0
  149. package/src/linear/templates.ts +47 -0
  150. package/src/linear/types.ts +7 -0
  151. package/src/linear/webhook.ts +104 -0
  152. package/src/oauth/README.md +66 -0
  153. package/src/oauth/index.ts +6 -0
  154. package/src/oauth/wrapper.ts +204 -0
  155. package/src/prompts/base-prompt.ts +150 -265
  156. package/src/prompts/defaults.ts +196 -0
  157. package/src/prompts/registry.ts +57 -0
  158. package/src/prompts/resolver.ts +296 -0
  159. package/src/prompts/session-templates.ts +604 -0
  160. package/src/providers/claude-adapter.ts +442 -0
  161. package/src/providers/index.ts +24 -0
  162. package/src/providers/pi-mono-adapter.ts +442 -0
  163. package/src/providers/pi-mono-extension.ts +624 -0
  164. package/src/providers/pi-mono-mcp-client.ts +124 -0
  165. package/src/providers/types.ts +75 -0
  166. package/src/scheduler/scheduler.test.ts +2 -0
  167. package/src/scheduler/scheduler.ts +231 -40
  168. package/src/server.ts +97 -6
  169. package/src/slack/HEURISTICS.md +105 -0
  170. package/src/slack/actions.ts +133 -0
  171. package/src/slack/app.ts +7 -0
  172. package/src/slack/assistant.ts +118 -0
  173. package/src/slack/blocks.ts +233 -0
  174. package/src/slack/channel-activity.ts +177 -0
  175. package/src/slack/commands.ts +31 -17
  176. package/src/slack/files.ts +1 -1
  177. package/src/slack/handlers.test.ts +114 -1
  178. package/src/slack/handlers.ts +230 -55
  179. package/src/slack/responses.ts +120 -67
  180. package/src/slack/router.ts +17 -99
  181. package/src/slack/templates.ts +55 -0
  182. package/src/slack/thread-buffer.ts +213 -0
  183. package/src/slack/watcher.ts +119 -4
  184. package/src/tests/agent-activity.test.ts +247 -0
  185. package/src/tests/agentmail-filters.test.ts +97 -0
  186. package/src/tests/artifact-sdk.test.ts +800 -0
  187. package/src/tests/base-prompt.test.ts +264 -0
  188. package/src/tests/build-pi-skills.test.ts +127 -0
  189. package/src/tests/channel-activity.test.ts +363 -0
  190. package/src/tests/claude-adapter.test.ts +126 -0
  191. package/src/tests/context-versioning.test.ts +425 -0
  192. package/src/tests/db-queries-oauth.test.ts +197 -0
  193. package/src/tests/db-queries-tracker.test.ts +230 -0
  194. package/src/tests/epics.test.ts +3 -3
  195. package/src/tests/error-tracker.test.ts +368 -0
  196. package/src/tests/fetch-resolved-env.test.ts +167 -0
  197. package/src/tests/generate-default-claude-md.test.ts +9 -1
  198. package/src/tests/generate-identity-templates.test.ts +124 -0
  199. package/src/tests/gitlab-auth.test.ts +109 -0
  200. package/src/tests/gitlab-handlers.test.ts +691 -0
  201. package/src/tests/gitlab-vcs-db.test.ts +177 -0
  202. package/src/tests/heartbeat.test.ts +364 -0
  203. package/src/tests/http-api-integration.test.ts +1698 -0
  204. package/src/tests/linear-outbound-sync.test.ts +200 -0
  205. package/src/tests/linear-webhook.test.ts +406 -0
  206. package/src/tests/match-route.test.ts +187 -0
  207. package/src/tests/memory.test.ts +737 -0
  208. package/src/tests/migration-runner-regressions.test.ts +86 -0
  209. package/src/tests/model-control.test.ts +338 -0
  210. package/src/tests/oauth-wrapper.test.ts +147 -0
  211. package/src/tests/onboard-compose.test.ts +138 -0
  212. package/src/tests/onboard-env.test.ts +174 -0
  213. package/src/tests/onboard-manifest.test.ts +137 -0
  214. package/src/tests/pi-mono-adapter.test.ts +234 -0
  215. package/src/tests/pool-session-logs.test.ts +199 -0
  216. package/src/tests/progress-dedup.test.ts +98 -0
  217. package/src/tests/prompt-template-github.test.ts +682 -0
  218. package/src/tests/prompt-template-remaining.test.ts +504 -0
  219. package/src/tests/prompt-template-resolver.test.ts +621 -0
  220. package/src/tests/prompt-template-session.test.ts +363 -0
  221. package/src/tests/prompt-templates-db.test.ts +616 -0
  222. package/src/tests/provider-adapter.test.ts +122 -0
  223. package/src/tests/provider-command-format.test.ts +98 -0
  224. package/src/tests/reload-config.test.ts +170 -0
  225. package/src/tests/runner-polling-api.test.ts +25 -20
  226. package/src/tests/scheduled-tasks.test.ts +104 -0
  227. package/src/tests/scheduler-backoff.test.ts +166 -0
  228. package/src/tests/self-improvement.test.ts +541 -0
  229. package/src/tests/session-attach.test.ts +536 -0
  230. package/src/tests/session-costs.test.ts +267 -1
  231. package/src/tests/slack-actions.test.ts +133 -0
  232. package/src/tests/slack-assistant.test.ts +136 -0
  233. package/src/tests/slack-blocks.test.ts +246 -0
  234. package/src/tests/slack-metadata-inheritance.test.ts +243 -0
  235. package/src/tests/slack-queue-offline.test.ts +174 -0
  236. package/src/tests/slack-router.test.ts +181 -0
  237. package/src/tests/slack-thread-buffer.test.ts +305 -0
  238. package/src/tests/slack-thread-followups.test.ts +298 -0
  239. package/src/tests/slack-watcher.test.ts +101 -0
  240. package/src/tests/structured-output.test.ts +307 -0
  241. package/src/tests/swarm-repos.test.ts +198 -0
  242. package/src/tests/task-cancellation.test.ts +6 -4
  243. package/src/tests/task-working-dir.test.ts +176 -0
  244. package/src/tests/template-fetch.test.ts +490 -0
  245. package/src/tests/tool-annotations.test.ts +371 -0
  246. package/src/tests/tracker-tools.test.ts +184 -0
  247. package/src/tests/update-profile-agentid.test.ts +248 -0
  248. package/src/tests/update-profile-api.test.ts +143 -3
  249. package/src/tests/update-profile-auth.test.ts +195 -0
  250. package/src/tests/validation-adapters.test.ts +86 -0
  251. package/src/tests/vcs-provider.test.ts +27 -0
  252. package/src/tests/workflow-agent-task.test.ts +196 -0
  253. package/src/tests/workflow-async-v2.test.ts +508 -0
  254. package/src/tests/workflow-convergence.test.ts +541 -0
  255. package/src/tests/workflow-definition-validation.test.ts +366 -0
  256. package/src/tests/workflow-engine-v2.test.ts +691 -0
  257. package/src/tests/workflow-executors.test.ts +736 -0
  258. package/src/tests/workflow-http-v2.test.ts +599 -0
  259. package/src/tests/workflow-integration-io.test.ts +902 -0
  260. package/src/tests/workflow-io-schemas.test.ts +624 -0
  261. package/src/tests/workflow-registry.test.ts +592 -0
  262. package/src/tests/workflow-retry-v2.test.ts +401 -0
  263. package/src/tests/workflow-retry-validation.test.ts +282 -0
  264. package/src/tests/workflow-schedule-trigger.test.ts +104 -0
  265. package/src/tests/workflow-template.test.ts +288 -0
  266. package/src/tests/workflow-trigger-schema.test.ts +359 -0
  267. package/src/tests/workflow-triggers-v2.test.ts +264 -0
  268. package/src/tests/workflow-versions.test.ts +208 -0
  269. package/src/tests/workflow-workspace.test.ts +272 -0
  270. package/src/tests/x402-client.test.ts +117 -0
  271. package/src/tests/x402-config.test.ts +182 -0
  272. package/src/tests/x402-spending-tracker.test.ts +185 -0
  273. package/src/tools/cancel-task.ts +2 -0
  274. package/src/tools/context-diff.ts +171 -0
  275. package/src/tools/context-history.ts +138 -0
  276. package/src/tools/create-channel.ts +1 -0
  277. package/src/tools/db-query.ts +78 -0
  278. package/src/tools/delete-channel.ts +132 -0
  279. package/src/tools/epics/assign-task-to-epic.ts +1 -0
  280. package/src/tools/epics/create-epic.ts +3 -2
  281. package/src/tools/epics/delete-epic.ts +2 -0
  282. package/src/tools/epics/get-epic-details.ts +2 -0
  283. package/src/tools/epics/list-epics.ts +2 -0
  284. package/src/tools/epics/unassign-task-from-epic.ts +1 -0
  285. package/src/tools/epics/update-epic.ts +7 -4
  286. package/src/tools/get-swarm.ts +2 -0
  287. package/src/tools/get-task-details.ts +2 -0
  288. package/src/tools/get-tasks.ts +27 -1
  289. package/src/tools/inject-learning.ts +106 -0
  290. package/src/tools/join-swarm.ts +17 -7
  291. package/src/tools/list-channels.ts +2 -0
  292. package/src/tools/list-services.ts +2 -0
  293. package/src/tools/memory-get.ts +56 -0
  294. package/src/tools/memory-search.ts +131 -0
  295. package/src/tools/my-agent-info.ts +2 -0
  296. package/src/tools/poll-task.ts +2 -20
  297. package/src/tools/post-message.ts +1 -0
  298. package/src/tools/prompt-templates/delete.ts +86 -0
  299. package/src/tools/prompt-templates/get.ts +89 -0
  300. package/src/tools/prompt-templates/index.ts +5 -0
  301. package/src/tools/prompt-templates/list.ts +95 -0
  302. package/src/tools/prompt-templates/preview.ts +84 -0
  303. package/src/tools/prompt-templates/set.ts +117 -0
  304. package/src/tools/read-messages.ts +2 -0
  305. package/src/tools/register-agentmail-inbox.ts +166 -0
  306. package/src/tools/register-service.ts +2 -0
  307. package/src/tools/schedules/create-schedule.ts +134 -24
  308. package/src/tools/schedules/delete-schedule.ts +2 -0
  309. package/src/tools/schedules/list-schedules.ts +20 -4
  310. package/src/tools/schedules/run-schedule-now.ts +1 -0
  311. package/src/tools/schedules/update-schedule.ts +49 -17
  312. package/src/tools/send-task.ts +132 -10
  313. package/src/tools/slack-download-file.ts +4 -2
  314. package/src/tools/slack-list-channels.ts +2 -0
  315. package/src/tools/slack-post.ts +2 -0
  316. package/src/tools/slack-read.ts +2 -0
  317. package/src/tools/slack-reply.ts +2 -0
  318. package/src/tools/slack-upload-file.ts +2 -0
  319. package/src/tools/store-progress.ts +205 -4
  320. package/src/tools/swarm-config/delete-config.ts +87 -0
  321. package/src/tools/swarm-config/get-config.ts +108 -0
  322. package/src/tools/swarm-config/index.ts +4 -0
  323. package/src/tools/swarm-config/list-config.ts +99 -0
  324. package/src/tools/swarm-config/set-config.ts +118 -0
  325. package/src/tools/task-action.ts +50 -5
  326. package/src/tools/task-dedup.ts +97 -0
  327. package/src/tools/templates.ts +53 -0
  328. package/src/tools/tool-config.ts +124 -0
  329. package/src/tools/tracker/index.ts +6 -0
  330. package/src/tools/tracker/tracker-link-epic.ts +64 -0
  331. package/src/tools/tracker/tracker-link-task.ts +64 -0
  332. package/src/tools/tracker/tracker-map-agent.ts +57 -0
  333. package/src/tools/tracker/tracker-status.ts +56 -0
  334. package/src/tools/tracker/tracker-sync-status.ts +42 -0
  335. package/src/tools/tracker/tracker-unlink.ts +41 -0
  336. package/src/tools/unregister-service.ts +2 -0
  337. package/src/tools/update-profile.ts +172 -17
  338. package/src/tools/update-service-status.ts +2 -0
  339. package/src/tools/utils.ts +10 -1
  340. package/src/tools/workflows/create-workflow.ts +129 -0
  341. package/src/tools/workflows/delete-workflow.ts +42 -0
  342. package/src/tools/workflows/get-workflow-run.ts +59 -0
  343. package/src/tools/workflows/get-workflow.ts +53 -0
  344. package/src/tools/workflows/index.ts +9 -0
  345. package/src/tools/workflows/list-workflow-runs.ts +48 -0
  346. package/src/tools/workflows/list-workflows.ts +42 -0
  347. package/src/tools/workflows/retry-workflow-run.ts +40 -0
  348. package/src/tools/workflows/trigger-workflow.ts +96 -0
  349. package/src/tools/workflows/update-workflow.ts +133 -0
  350. package/src/tracker/types.ts +51 -0
  351. package/src/types.ts +530 -14
  352. package/src/utils/credentials.test.ts +156 -0
  353. package/src/utils/credentials.ts +50 -0
  354. package/src/utils/error-tracker.ts +190 -0
  355. package/src/vcs/index.ts +15 -0
  356. package/src/vcs/types.ts +5 -0
  357. package/src/workflows/checkpoint.ts +121 -0
  358. package/src/workflows/cooldown.ts +28 -0
  359. package/src/workflows/definition.ts +235 -0
  360. package/src/workflows/engine.ts +580 -0
  361. package/src/workflows/event-bus.ts +29 -0
  362. package/src/workflows/executors/agent-task.ts +103 -0
  363. package/src/workflows/executors/base.ts +86 -0
  364. package/src/workflows/executors/code-match.ts +88 -0
  365. package/src/workflows/executors/index.ts +16 -0
  366. package/src/workflows/executors/notify.ts +93 -0
  367. package/src/workflows/executors/property-match.ts +104 -0
  368. package/src/workflows/executors/raw-llm.ts +83 -0
  369. package/src/workflows/executors/registry.ts +76 -0
  370. package/src/workflows/executors/script.ts +103 -0
  371. package/src/workflows/executors/validate.ts +215 -0
  372. package/src/workflows/executors/vcs.ts +58 -0
  373. package/src/workflows/index.ts +61 -0
  374. package/src/workflows/input.ts +46 -0
  375. package/src/workflows/json-schema-validator.ts +118 -0
  376. package/src/workflows/recovery.ts +139 -0
  377. package/src/workflows/resume.ts +229 -0
  378. package/src/workflows/retry-poller.ts +216 -0
  379. package/src/workflows/template.ts +74 -0
  380. package/src/workflows/templates.ts +86 -0
  381. package/src/workflows/triggers.ts +124 -0
  382. package/src/workflows/validation.ts +104 -0
  383. package/src/workflows/version.ts +44 -0
  384. package/src/x402/cli.ts +140 -0
  385. package/src/x402/client.ts +192 -0
  386. package/src/x402/config.ts +131 -0
  387. package/src/x402/index.ts +37 -0
  388. package/src/x402/openfort-signer.ts +83 -0
  389. package/src/x402/spending-tracker.ts +109 -0
  390. package/templates/official/coder/CLAUDE.md +49 -0
  391. package/templates/official/coder/IDENTITY.md +28 -0
  392. package/templates/official/coder/SOUL.md +43 -0
  393. package/templates/official/coder/TOOLS.md +40 -0
  394. package/templates/official/coder/config.json +23 -0
  395. package/templates/official/coder/start-up.sh +23 -0
  396. package/templates/official/content-reviewer/CLAUDE.md +68 -0
  397. package/templates/official/content-reviewer/IDENTITY.md +28 -0
  398. package/templates/official/content-reviewer/SOUL.md +44 -0
  399. package/templates/official/content-reviewer/TOOLS.md +37 -0
  400. package/templates/official/content-reviewer/config.json +23 -0
  401. package/templates/official/content-reviewer/start-up.sh +23 -0
  402. package/templates/official/content-strategist/CLAUDE.md +63 -0
  403. package/templates/official/content-strategist/IDENTITY.md +33 -0
  404. package/templates/official/content-strategist/SOUL.md +48 -0
  405. package/templates/official/content-strategist/TOOLS.md +47 -0
  406. package/templates/official/content-strategist/config.json +23 -0
  407. package/templates/official/content-strategist/start-up.sh +23 -0
  408. package/templates/official/content-writer/CLAUDE.md +72 -0
  409. package/templates/official/content-writer/IDENTITY.md +30 -0
  410. package/templates/official/content-writer/SOUL.md +46 -0
  411. package/templates/official/content-writer/TOOLS.md +44 -0
  412. package/templates/official/content-writer/config.json +23 -0
  413. package/templates/official/content-writer/start-up.sh +23 -0
  414. package/templates/official/forward-deployed-engineer/CLAUDE.md +54 -0
  415. package/templates/official/forward-deployed-engineer/IDENTITY.md +37 -0
  416. package/templates/official/forward-deployed-engineer/SOUL.md +55 -0
  417. package/templates/official/forward-deployed-engineer/config.json +21 -0
  418. package/templates/official/lead/CLAUDE.md +33 -0
  419. package/templates/official/lead/IDENTITY.md +36 -0
  420. package/templates/official/lead/SOUL.md +51 -0
  421. package/templates/official/lead/config.json +22 -0
  422. package/templates/official/researcher/CLAUDE.md +46 -0
  423. package/templates/official/researcher/IDENTITY.md +28 -0
  424. package/templates/official/researcher/SOUL.md +43 -0
  425. package/templates/official/researcher/config.json +21 -0
  426. package/templates/official/reviewer/CLAUDE.md +63 -0
  427. package/templates/official/reviewer/IDENTITY.md +28 -0
  428. package/templates/official/reviewer/SOUL.md +45 -0
  429. package/templates/official/reviewer/config.json +21 -0
  430. package/templates/official/tester/CLAUDE.md +53 -0
  431. package/templates/official/tester/IDENTITY.md +28 -0
  432. package/templates/official/tester/SOUL.md +55 -0
  433. package/templates/official/tester/config.json +21 -0
  434. package/templates/schema.ts +35 -0
  435. package/.claude/settings.local.json +0 -115
  436. package/.dockerignore +0 -61
  437. package/.editorconfig +0 -15
  438. package/.env.docker.example +0 -39
  439. package/.env.example +0 -40
  440. package/.github/workflows/ci.yml +0 -76
  441. package/.github/workflows/docker-and-deploy.yml +0 -117
  442. package/.wts-config.json +0 -4
  443. package/.wts-setup.ts +0 -102
  444. package/CLAUDE.md +0 -104
  445. package/CONTRIBUTING.md +0 -270
  446. package/DEPLOYMENT.md +0 -605
  447. package/Dockerfile +0 -57
  448. package/Dockerfile.worker +0 -157
  449. package/FAQ.md +0 -19
  450. package/MCP.md +0 -406
  451. package/UI.md +0 -40
  452. package/assets/agent-swarm-logo-orange.png +0 -0
  453. package/assets/agent-swarm-logo.png +0 -0
  454. package/assets/agent-swarm.mp4 +0 -0
  455. package/assets/agent-swarm.png +0 -0
  456. package/biome.json +0 -39
  457. package/deploy/DEPLOY.md +0 -60
  458. package/deploy/agent-swarm.service +0 -17
  459. package/deploy/docker-push.ts +0 -30
  460. package/deploy/install.ts +0 -85
  461. package/deploy/prod-db.ts +0 -42
  462. package/deploy/uninstall.ts +0 -12
  463. package/deploy/update.ts +0 -21
  464. package/docker-compose.example.yml +0 -159
  465. package/docker-entrypoint.sh +0 -352
  466. package/ecosystem.config.cjs +0 -66
  467. package/plugin/README.md +0 -1
  468. package/plugin/hooks/hooks.json +0 -71
  469. package/pyproject.toml +0 -9
  470. package/scripts/generate-mcp-docs.ts +0 -415
  471. package/slack-manifest.json +0 -71
  472. package/src/tests/get-inbox-message.test.ts +0 -145
  473. package/src/tools/get-inbox-message.ts +0 -89
  474. package/src/tools/inbox-delegate.ts +0 -113
  475. package/thoughts/shared/plans/2025-12-18-slack-integration.md +0 -1195
  476. package/thoughts/shared/plans/2025-12-19-agent-log-streaming.md +0 -732
  477. package/thoughts/shared/plans/2025-12-19-role-based-swarm-plugin.md +0 -361
  478. package/thoughts/shared/plans/2025-12-20-mobile-responsive-ui.md +0 -501
  479. package/thoughts/shared/plans/2025-12-20-startup-team-swarm.md +0 -560
  480. package/thoughts/shared/plans/2025-12-23-runner-level-polling.md +0 -934
  481. package/thoughts/shared/plans/2025-12-23-runner-session-logs.md +0 -1000
  482. package/thoughts/shared/plans/2025-12-23-worker-lead-spawn-triggers.md +0 -568
  483. package/thoughts/shared/plans/2026-01-09-inverse-teleport.md +0 -1516
  484. package/thoughts/shared/plans/2026-01-12-agent-rename-pm2-control.md +0 -1133
  485. package/thoughts/shared/plans/2026-01-12-github-app-integration.md +0 -380
  486. package/thoughts/shared/plans/2026-01-12-lead-inbox-model.md +0 -876
  487. package/thoughts/shared/plans/2026-01-12-ralph-wiggum-integration.md +0 -463
  488. package/thoughts/shared/plans/2026-01-13-agent-concurrency.md +0 -691
  489. package/thoughts/shared/plans/2026-01-13-github-assignment-handling.md +0 -690
  490. package/thoughts/shared/plans/2026-01-13-prevent-duplicate-trigger-processing.md +0 -1071
  491. package/thoughts/shared/plans/2026-01-14-fix-slack-thread-context.md +0 -507
  492. package/thoughts/shared/plans/2026-01-15-scheduled-tasks-implementation.md +0 -565
  493. package/thoughts/shared/plans/2026-01-15-usage-cost-tracking-ui.md +0 -1479
  494. package/thoughts/shared/plans/2026-01-16-epics-feature-implementation.md +0 -1230
  495. package/thoughts/shared/research/.gitkeep +0 -0
  496. package/thoughts/shared/research/2025-01-09-inverse-teleport-plan-review.md +0 -420
  497. package/thoughts/shared/research/2025-12-18-slack-integration.md +0 -442
  498. package/thoughts/shared/research/2025-12-19-agent-log-streaming.md +0 -339
  499. package/thoughts/shared/research/2025-12-19-agent-secrets-cli-research.md +0 -390
  500. package/thoughts/shared/research/2025-12-21-gemini-cli-integration.md +0 -376
  501. package/thoughts/shared/research/2025-12-22-runner-loop-architecture.md +0 -582
  502. package/thoughts/shared/research/2025-12-22-setup-experience-improvements.md +0 -264
  503. package/thoughts/shared/research/2026-01-13-lead-duplicate-trigger-processing.md +0 -223
  504. package/thoughts/shared/research/2026-01-14-lead-slack-thread-context.md +0 -277
  505. package/thoughts/shared/research/2026-01-15-ai-tracker-agent-swarm-integration.md +0 -376
  506. package/thoughts/shared/research/2026-01-15-auto-starting-processes-in-worker-containers.md +0 -787
  507. package/thoughts/shared/research/2026-01-15-scheduled-tasks.md +0 -390
  508. package/thoughts/shared/research/2026-01-16-epics-feature-research.md +0 -437
  509. package/thoughts/taras/plans/2026-01-22-agent-swarm-schemas.md +0 -98
  510. package/thoughts/taras/plans/2026-01-28-per-worker-claude-md.md +0 -617
  511. package/thoughts/taras/plans/2026-01-28-sentry-cli-integration.md +0 -214
  512. package/thoughts/taras/research/2026-01-22-vercel-cli-integration.md +0 -287
  513. package/thoughts/taras/research/2026-01-27-excessive-polling-issue.md +0 -311
  514. package/thoughts/taras/research/2026-01-28-per-worker-claude-md.md +0 -383
  515. package/thoughts/taras/research/2026-01-28-sentry-cli-integration.md +0 -240
  516. package/tsconfig.json +0 -37
  517. package/ui/CLAUDE.md +0 -49
  518. package/ui/bun.lock +0 -771
  519. package/ui/index.html +0 -22
  520. package/ui/package-lock.json +0 -5290
  521. package/ui/package.json +0 -33
  522. package/ui/pnpm-lock.yaml +0 -3341
  523. package/ui/postcss.config.js +0 -6
  524. package/ui/public/logo.png +0 -0
  525. package/ui/src/App.tsx +0 -63
  526. package/ui/src/components/ActivityFeed.tsx +0 -440
  527. package/ui/src/components/AgentDetailPanel.tsx +0 -733
  528. package/ui/src/components/AgentsPanel.tsx +0 -815
  529. package/ui/src/components/ChatPanel.tsx +0 -1920
  530. package/ui/src/components/ConfigModal.tsx +0 -253
  531. package/ui/src/components/Dashboard.tsx +0 -832
  532. package/ui/src/components/EditAgentProfileModal.tsx +0 -433
  533. package/ui/src/components/EpicDetailPage.tsx +0 -741
  534. package/ui/src/components/EpicsPanel.tsx +0 -566
  535. package/ui/src/components/Header.tsx +0 -160
  536. package/ui/src/components/JsonViewer.tsx +0 -171
  537. package/ui/src/components/ScheduledTaskDetailPanel.tsx +0 -517
  538. package/ui/src/components/ScheduledTasksPanel.tsx +0 -639
  539. package/ui/src/components/ServicesPanel.tsx +0 -622
  540. package/ui/src/components/SessionLogPanel.tsx +0 -1219
  541. package/ui/src/components/StatsBar.tsx +0 -321
  542. package/ui/src/components/StatusBadge.tsx +0 -168
  543. package/ui/src/components/TaskDetailPanel.tsx +0 -903
  544. package/ui/src/components/TasksPanel.tsx +0 -614
  545. package/ui/src/components/UsageCharts.tsx +0 -216
  546. package/ui/src/components/UsageTab.tsx +0 -394
  547. package/ui/src/hooks/queries.ts +0 -353
  548. package/ui/src/hooks/useAutoScroll.ts +0 -83
  549. package/ui/src/index.css +0 -257
  550. package/ui/src/lib/api.ts +0 -268
  551. package/ui/src/lib/config.ts +0 -35
  552. package/ui/src/lib/contentPreview.ts +0 -208
  553. package/ui/src/lib/theme.ts +0 -214
  554. package/ui/src/lib/utils.ts +0 -88
  555. package/ui/src/main.tsx +0 -28
  556. package/ui/src/types/api.ts +0 -323
  557. package/ui/src/vite-env.d.ts +0 -1
  558. package/ui/tailwind.config.js +0 -37
  559. package/ui/tsconfig.json +0 -31
  560. package/ui/vite.config.ts +0 -35
  561. /package/{thoughts/shared/plans → templates/community}/.gitkeep +0 -0
package/openapi.json ADDED
@@ -0,0 +1,5015 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Agent Swarm API",
5
+ "version": "1.51.0",
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
+ },
8
+ "servers": [
9
+ {
10
+ "url": "http://localhost:3013",
11
+ "description": "Local development"
12
+ }
13
+ ],
14
+ "components": {
15
+ "securitySchemes": {
16
+ "bearerAuth": {
17
+ "type": "http",
18
+ "scheme": "bearer",
19
+ "description": "API key via Authorization: Bearer <API_KEY>"
20
+ },
21
+ "agentId": {
22
+ "type": "apiKey",
23
+ "in": "header",
24
+ "name": "X-Agent-ID",
25
+ "description": "Agent UUID for agent-scoped operations"
26
+ }
27
+ },
28
+ "schemas": {},
29
+ "parameters": {}
30
+ },
31
+ "paths": {
32
+ "/api/active-sessions": {
33
+ "get": {
34
+ "summary": "List active sessions",
35
+ "tags": [
36
+ "Active Sessions"
37
+ ],
38
+ "security": [
39
+ {
40
+ "bearerAuth": []
41
+ }
42
+ ],
43
+ "parameters": [
44
+ {
45
+ "schema": {
46
+ "type": "string",
47
+ "format": "uuid"
48
+ },
49
+ "required": false,
50
+ "name": "agentId",
51
+ "in": "query"
52
+ }
53
+ ],
54
+ "responses": {
55
+ "200": {
56
+ "description": "Active session list"
57
+ }
58
+ }
59
+ },
60
+ "post": {
61
+ "summary": "Create a new active session",
62
+ "tags": [
63
+ "Active Sessions"
64
+ ],
65
+ "security": [
66
+ {
67
+ "bearerAuth": []
68
+ }
69
+ ],
70
+ "requestBody": {
71
+ "content": {
72
+ "application/json": {
73
+ "schema": {
74
+ "type": "object",
75
+ "properties": {
76
+ "agentId": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ },
80
+ "taskId": {
81
+ "type": "string"
82
+ },
83
+ "triggerType": {
84
+ "type": "string",
85
+ "minLength": 1
86
+ },
87
+ "inboxMessageId": {
88
+ "type": "string"
89
+ },
90
+ "taskDescription": {
91
+ "type": "string"
92
+ },
93
+ "runnerSessionId": {
94
+ "type": "string"
95
+ }
96
+ },
97
+ "required": [
98
+ "agentId",
99
+ "triggerType"
100
+ ]
101
+ }
102
+ }
103
+ }
104
+ },
105
+ "responses": {
106
+ "201": {
107
+ "description": "Session created"
108
+ },
109
+ "400": {
110
+ "description": "Validation error"
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "/api/active-sessions/by-task/{taskId}": {
116
+ "delete": {
117
+ "summary": "Delete active session by task ID",
118
+ "tags": [
119
+ "Active Sessions"
120
+ ],
121
+ "security": [
122
+ {
123
+ "bearerAuth": []
124
+ }
125
+ ],
126
+ "parameters": [
127
+ {
128
+ "schema": {
129
+ "type": "string"
130
+ },
131
+ "required": true,
132
+ "name": "taskId",
133
+ "in": "path"
134
+ }
135
+ ],
136
+ "responses": {
137
+ "200": {
138
+ "description": "Session deleted"
139
+ }
140
+ }
141
+ }
142
+ },
143
+ "/api/active-sessions/{id}": {
144
+ "delete": {
145
+ "summary": "Delete active session by ID",
146
+ "tags": [
147
+ "Active Sessions"
148
+ ],
149
+ "security": [
150
+ {
151
+ "bearerAuth": []
152
+ }
153
+ ],
154
+ "parameters": [
155
+ {
156
+ "schema": {
157
+ "type": "string"
158
+ },
159
+ "required": true,
160
+ "name": "id",
161
+ "in": "path"
162
+ }
163
+ ],
164
+ "responses": {
165
+ "200": {
166
+ "description": "Session deleted"
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "/api/active-sessions/heartbeat/{taskId}": {
172
+ "put": {
173
+ "summary": "Update heartbeat for an active session",
174
+ "tags": [
175
+ "Active Sessions"
176
+ ],
177
+ "security": [
178
+ {
179
+ "bearerAuth": []
180
+ }
181
+ ],
182
+ "parameters": [
183
+ {
184
+ "schema": {
185
+ "type": "string"
186
+ },
187
+ "required": true,
188
+ "name": "taskId",
189
+ "in": "path"
190
+ }
191
+ ],
192
+ "responses": {
193
+ "200": {
194
+ "description": "Heartbeat updated"
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "/api/active-sessions/provider-session/{taskId}": {
200
+ "put": {
201
+ "summary": "Update provider session ID on an active session",
202
+ "tags": [
203
+ "Active Sessions"
204
+ ],
205
+ "security": [
206
+ {
207
+ "bearerAuth": []
208
+ }
209
+ ],
210
+ "parameters": [
211
+ {
212
+ "schema": {
213
+ "type": "string"
214
+ },
215
+ "required": true,
216
+ "name": "taskId",
217
+ "in": "path"
218
+ }
219
+ ],
220
+ "requestBody": {
221
+ "content": {
222
+ "application/json": {
223
+ "schema": {
224
+ "type": "object",
225
+ "properties": {
226
+ "providerSessionId": {
227
+ "type": "string",
228
+ "minLength": 1
229
+ }
230
+ },
231
+ "required": [
232
+ "providerSessionId"
233
+ ]
234
+ }
235
+ }
236
+ }
237
+ },
238
+ "responses": {
239
+ "200": {
240
+ "description": "Provider session ID updated"
241
+ }
242
+ }
243
+ }
244
+ },
245
+ "/api/active-sessions/cleanup": {
246
+ "post": {
247
+ "summary": "Clean up stale sessions",
248
+ "tags": [
249
+ "Active Sessions"
250
+ ],
251
+ "security": [
252
+ {
253
+ "bearerAuth": []
254
+ }
255
+ ],
256
+ "requestBody": {
257
+ "content": {
258
+ "application/json": {
259
+ "schema": {
260
+ "type": "object",
261
+ "properties": {
262
+ "agentId": {
263
+ "type": "string"
264
+ },
265
+ "maxAgeMinutes": {
266
+ "type": "integer"
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "responses": {
274
+ "200": {
275
+ "description": "Cleanup result"
276
+ }
277
+ }
278
+ }
279
+ },
280
+ "/api/agents": {
281
+ "post": {
282
+ "summary": "Register or re-register an agent",
283
+ "tags": [
284
+ "Agents"
285
+ ],
286
+ "security": [
287
+ {
288
+ "bearerAuth": []
289
+ }
290
+ ],
291
+ "requestBody": {
292
+ "content": {
293
+ "application/json": {
294
+ "schema": {
295
+ "type": "object",
296
+ "properties": {
297
+ "name": {
298
+ "type": "string",
299
+ "minLength": 1
300
+ },
301
+ "isLead": {
302
+ "type": "boolean"
303
+ },
304
+ "description": {
305
+ "type": "string"
306
+ },
307
+ "role": {
308
+ "type": "string"
309
+ },
310
+ "capabilities": {
311
+ "type": "array",
312
+ "items": {
313
+ "type": "string"
314
+ }
315
+ },
316
+ "maxTasks": {
317
+ "type": "integer"
318
+ }
319
+ },
320
+ "required": [
321
+ "name"
322
+ ]
323
+ }
324
+ }
325
+ }
326
+ },
327
+ "responses": {
328
+ "200": {
329
+ "description": "Agent re-registered (already existed)"
330
+ },
331
+ "201": {
332
+ "description": "Agent created"
333
+ },
334
+ "400": {
335
+ "description": "Validation error"
336
+ }
337
+ }
338
+ },
339
+ "get": {
340
+ "summary": "List all agents",
341
+ "tags": [
342
+ "Agents"
343
+ ],
344
+ "security": [
345
+ {
346
+ "bearerAuth": []
347
+ }
348
+ ],
349
+ "parameters": [
350
+ {
351
+ "schema": {
352
+ "type": "string",
353
+ "enum": [
354
+ "tasks"
355
+ ]
356
+ },
357
+ "required": false,
358
+ "name": "include",
359
+ "in": "query"
360
+ }
361
+ ],
362
+ "responses": {
363
+ "200": {
364
+ "description": "Agent list with capacity info"
365
+ }
366
+ }
367
+ }
368
+ },
369
+ "/api/agents/{id}/name": {
370
+ "put": {
371
+ "summary": "Update agent name",
372
+ "tags": [
373
+ "Agents"
374
+ ],
375
+ "security": [
376
+ {
377
+ "bearerAuth": []
378
+ }
379
+ ],
380
+ "parameters": [
381
+ {
382
+ "schema": {
383
+ "type": "string"
384
+ },
385
+ "required": true,
386
+ "name": "id",
387
+ "in": "path"
388
+ }
389
+ ],
390
+ "requestBody": {
391
+ "content": {
392
+ "application/json": {
393
+ "schema": {
394
+ "type": "object",
395
+ "properties": {
396
+ "name": {
397
+ "type": "string",
398
+ "minLength": 1
399
+ }
400
+ },
401
+ "required": [
402
+ "name"
403
+ ]
404
+ }
405
+ }
406
+ }
407
+ },
408
+ "responses": {
409
+ "200": {
410
+ "description": "Agent updated"
411
+ },
412
+ "404": {
413
+ "description": "Agent not found"
414
+ },
415
+ "409": {
416
+ "description": "Name conflict"
417
+ }
418
+ }
419
+ }
420
+ },
421
+ "/api/agents/{id}/setup-script": {
422
+ "get": {
423
+ "summary": "Fetch agent + global setup scripts for Docker entrypoint",
424
+ "tags": [
425
+ "Agents"
426
+ ],
427
+ "security": [
428
+ {
429
+ "bearerAuth": []
430
+ }
431
+ ],
432
+ "parameters": [
433
+ {
434
+ "schema": {
435
+ "type": "string"
436
+ },
437
+ "required": true,
438
+ "name": "id",
439
+ "in": "path"
440
+ }
441
+ ],
442
+ "responses": {
443
+ "200": {
444
+ "description": "Setup scripts"
445
+ },
446
+ "404": {
447
+ "description": "Agent not found"
448
+ }
449
+ }
450
+ }
451
+ },
452
+ "/api/agents/{id}/profile": {
453
+ "put": {
454
+ "summary": "Update agent profile (role, description, capabilities, etc.)",
455
+ "tags": [
456
+ "Agents"
457
+ ],
458
+ "security": [
459
+ {
460
+ "bearerAuth": []
461
+ }
462
+ ],
463
+ "parameters": [
464
+ {
465
+ "schema": {
466
+ "type": "string"
467
+ },
468
+ "required": true,
469
+ "name": "id",
470
+ "in": "path"
471
+ }
472
+ ],
473
+ "requestBody": {
474
+ "content": {
475
+ "application/json": {
476
+ "schema": {
477
+ "type": "object",
478
+ "properties": {
479
+ "role": {
480
+ "type": "string",
481
+ "maxLength": 100
482
+ },
483
+ "description": {
484
+ "type": "string"
485
+ },
486
+ "capabilities": {
487
+ "type": "array",
488
+ "items": {
489
+ "type": "string"
490
+ }
491
+ },
492
+ "claudeMd": {
493
+ "type": "string",
494
+ "maxLength": 65536
495
+ },
496
+ "soulMd": {
497
+ "type": "string",
498
+ "maxLength": 65536
499
+ },
500
+ "identityMd": {
501
+ "type": "string",
502
+ "maxLength": 65536
503
+ },
504
+ "setupScript": {
505
+ "type": "string",
506
+ "maxLength": 65536
507
+ },
508
+ "toolsMd": {
509
+ "type": "string",
510
+ "maxLength": 65536
511
+ },
512
+ "changeSource": {
513
+ "type": "string"
514
+ },
515
+ "changedByAgentId": {
516
+ "type": "string"
517
+ },
518
+ "changeReason": {
519
+ "type": "string"
520
+ }
521
+ }
522
+ }
523
+ }
524
+ }
525
+ },
526
+ "responses": {
527
+ "200": {
528
+ "description": "Profile updated"
529
+ },
530
+ "400": {
531
+ "description": "Validation error"
532
+ },
533
+ "404": {
534
+ "description": "Agent not found"
535
+ }
536
+ }
537
+ }
538
+ },
539
+ "/api/agents/{id}/activity": {
540
+ "put": {
541
+ "summary": "Update agent last activity timestamp",
542
+ "tags": [
543
+ "Agents"
544
+ ],
545
+ "security": [
546
+ {
547
+ "bearerAuth": []
548
+ }
549
+ ],
550
+ "parameters": [
551
+ {
552
+ "schema": {
553
+ "type": "string"
554
+ },
555
+ "required": true,
556
+ "name": "id",
557
+ "in": "path"
558
+ }
559
+ ],
560
+ "responses": {
561
+ "204": {
562
+ "description": "Activity updated"
563
+ }
564
+ }
565
+ }
566
+ },
567
+ "/api/agents/{id}": {
568
+ "get": {
569
+ "summary": "Get a single agent",
570
+ "tags": [
571
+ "Agents"
572
+ ],
573
+ "security": [
574
+ {
575
+ "bearerAuth": []
576
+ }
577
+ ],
578
+ "parameters": [
579
+ {
580
+ "schema": {
581
+ "type": "string"
582
+ },
583
+ "required": true,
584
+ "name": "id",
585
+ "in": "path"
586
+ },
587
+ {
588
+ "schema": {
589
+ "type": "string",
590
+ "enum": [
591
+ "tasks"
592
+ ]
593
+ },
594
+ "required": false,
595
+ "name": "include",
596
+ "in": "query"
597
+ }
598
+ ],
599
+ "responses": {
600
+ "200": {
601
+ "description": "Agent with capacity info"
602
+ },
603
+ "404": {
604
+ "description": "Agent not found"
605
+ }
606
+ }
607
+ }
608
+ },
609
+ "/api/config/resolved": {
610
+ "get": {
611
+ "summary": "Get resolved config (merged global + agent + repo scopes)",
612
+ "tags": [
613
+ "Config"
614
+ ],
615
+ "security": [
616
+ {
617
+ "bearerAuth": []
618
+ }
619
+ ],
620
+ "parameters": [
621
+ {
622
+ "schema": {
623
+ "type": "string"
624
+ },
625
+ "required": false,
626
+ "name": "agentId",
627
+ "in": "query"
628
+ },
629
+ {
630
+ "schema": {
631
+ "type": "string"
632
+ },
633
+ "required": false,
634
+ "name": "repoId",
635
+ "in": "query"
636
+ },
637
+ {
638
+ "schema": {
639
+ "type": "string",
640
+ "enum": [
641
+ "true",
642
+ "false"
643
+ ]
644
+ },
645
+ "required": false,
646
+ "name": "includeSecrets",
647
+ "in": "query"
648
+ }
649
+ ],
650
+ "responses": {
651
+ "200": {
652
+ "description": "Resolved config entries"
653
+ }
654
+ }
655
+ }
656
+ },
657
+ "/api/config/{id}": {
658
+ "get": {
659
+ "summary": "Get a single config entry by ID",
660
+ "tags": [
661
+ "Config"
662
+ ],
663
+ "security": [
664
+ {
665
+ "bearerAuth": []
666
+ }
667
+ ],
668
+ "parameters": [
669
+ {
670
+ "schema": {
671
+ "type": "string"
672
+ },
673
+ "required": true,
674
+ "name": "id",
675
+ "in": "path"
676
+ },
677
+ {
678
+ "schema": {
679
+ "type": "string",
680
+ "enum": [
681
+ "true",
682
+ "false"
683
+ ]
684
+ },
685
+ "required": false,
686
+ "name": "includeSecrets",
687
+ "in": "query"
688
+ }
689
+ ],
690
+ "responses": {
691
+ "200": {
692
+ "description": "Config entry"
693
+ },
694
+ "404": {
695
+ "description": "Config not found"
696
+ }
697
+ }
698
+ },
699
+ "delete": {
700
+ "summary": "Delete a config entry",
701
+ "tags": [
702
+ "Config"
703
+ ],
704
+ "security": [
705
+ {
706
+ "bearerAuth": []
707
+ }
708
+ ],
709
+ "parameters": [
710
+ {
711
+ "schema": {
712
+ "type": "string"
713
+ },
714
+ "required": true,
715
+ "name": "id",
716
+ "in": "path"
717
+ }
718
+ ],
719
+ "responses": {
720
+ "200": {
721
+ "description": "Config deleted"
722
+ },
723
+ "404": {
724
+ "description": "Config not found"
725
+ }
726
+ }
727
+ }
728
+ },
729
+ "/api/config": {
730
+ "get": {
731
+ "summary": "List config entries with optional filters",
732
+ "tags": [
733
+ "Config"
734
+ ],
735
+ "security": [
736
+ {
737
+ "bearerAuth": []
738
+ }
739
+ ],
740
+ "parameters": [
741
+ {
742
+ "schema": {
743
+ "type": "string"
744
+ },
745
+ "required": false,
746
+ "name": "scope",
747
+ "in": "query"
748
+ },
749
+ {
750
+ "schema": {
751
+ "type": "string"
752
+ },
753
+ "required": false,
754
+ "name": "scopeId",
755
+ "in": "query"
756
+ },
757
+ {
758
+ "schema": {
759
+ "type": "string",
760
+ "enum": [
761
+ "true",
762
+ "false"
763
+ ]
764
+ },
765
+ "required": false,
766
+ "name": "includeSecrets",
767
+ "in": "query"
768
+ }
769
+ ],
770
+ "responses": {
771
+ "200": {
772
+ "description": "List of config entries"
773
+ }
774
+ }
775
+ },
776
+ "put": {
777
+ "summary": "Create or update a config entry",
778
+ "tags": [
779
+ "Config"
780
+ ],
781
+ "security": [
782
+ {
783
+ "bearerAuth": []
784
+ }
785
+ ],
786
+ "requestBody": {
787
+ "content": {
788
+ "application/json": {
789
+ "schema": {
790
+ "type": "object",
791
+ "properties": {
792
+ "scope": {
793
+ "type": "string",
794
+ "enum": [
795
+ "global",
796
+ "agent",
797
+ "repo"
798
+ ]
799
+ },
800
+ "scopeId": {
801
+ "type": "string"
802
+ },
803
+ "key": {
804
+ "type": "string",
805
+ "minLength": 1
806
+ },
807
+ "value": {},
808
+ "isSecret": {
809
+ "type": "boolean"
810
+ },
811
+ "envPath": {
812
+ "type": "string"
813
+ },
814
+ "description": {
815
+ "type": "string"
816
+ }
817
+ },
818
+ "required": [
819
+ "scope",
820
+ "key"
821
+ ]
822
+ }
823
+ }
824
+ }
825
+ },
826
+ "responses": {
827
+ "200": {
828
+ "description": "Config entry upserted"
829
+ },
830
+ "400": {
831
+ "description": "Validation error"
832
+ }
833
+ }
834
+ }
835
+ },
836
+ "/api/db-query": {
837
+ "post": {
838
+ "summary": "Execute a read-only SQL query",
839
+ "tags": [
840
+ "Debug"
841
+ ],
842
+ "security": [
843
+ {
844
+ "bearerAuth": []
845
+ }
846
+ ],
847
+ "requestBody": {
848
+ "content": {
849
+ "application/json": {
850
+ "schema": {
851
+ "type": "object",
852
+ "properties": {
853
+ "sql": {
854
+ "type": "string",
855
+ "minLength": 1,
856
+ "maxLength": 10000
857
+ },
858
+ "params": {
859
+ "type": "array",
860
+ "items": {},
861
+ "default": []
862
+ }
863
+ },
864
+ "required": [
865
+ "sql"
866
+ ]
867
+ }
868
+ }
869
+ }
870
+ },
871
+ "responses": {
872
+ "200": {
873
+ "description": "Query results",
874
+ "content": {
875
+ "application/json": {
876
+ "schema": {
877
+ "type": "object",
878
+ "properties": {
879
+ "columns": {
880
+ "type": "array",
881
+ "items": {
882
+ "type": "string"
883
+ }
884
+ },
885
+ "rows": {
886
+ "type": "array",
887
+ "items": {
888
+ "type": "array",
889
+ "items": {}
890
+ }
891
+ },
892
+ "elapsed": {
893
+ "type": "number"
894
+ },
895
+ "total": {
896
+ "type": "number"
897
+ }
898
+ },
899
+ "required": [
900
+ "columns",
901
+ "rows",
902
+ "elapsed",
903
+ "total"
904
+ ]
905
+ }
906
+ }
907
+ }
908
+ },
909
+ "400": {
910
+ "description": "Invalid or disallowed SQL"
911
+ }
912
+ }
913
+ }
914
+ },
915
+ "/ecosystem": {
916
+ "get": {
917
+ "summary": "Get PM2 ecosystem config for agent services",
918
+ "tags": [
919
+ "Ecosystem"
920
+ ],
921
+ "security": [
922
+ {
923
+ "bearerAuth": []
924
+ }
925
+ ],
926
+ "responses": {
927
+ "200": {
928
+ "description": "PM2 ecosystem config"
929
+ },
930
+ "400": {
931
+ "description": "Missing X-Agent-ID"
932
+ }
933
+ }
934
+ }
935
+ },
936
+ "/api/epics": {
937
+ "get": {
938
+ "summary": "List epics with optional filters",
939
+ "tags": [
940
+ "Epics"
941
+ ],
942
+ "security": [
943
+ {
944
+ "bearerAuth": []
945
+ }
946
+ ],
947
+ "parameters": [
948
+ {
949
+ "schema": {
950
+ "type": "string"
951
+ },
952
+ "required": false,
953
+ "name": "status",
954
+ "in": "query"
955
+ },
956
+ {
957
+ "schema": {
958
+ "type": "string"
959
+ },
960
+ "required": false,
961
+ "name": "search",
962
+ "in": "query"
963
+ },
964
+ {
965
+ "schema": {
966
+ "type": "string"
967
+ },
968
+ "required": false,
969
+ "name": "leadAgentId",
970
+ "in": "query"
971
+ }
972
+ ],
973
+ "responses": {
974
+ "200": {
975
+ "description": "Epic list with progress"
976
+ }
977
+ }
978
+ },
979
+ "post": {
980
+ "summary": "Create a new epic",
981
+ "tags": [
982
+ "Epics"
983
+ ],
984
+ "security": [
985
+ {
986
+ "bearerAuth": []
987
+ }
988
+ ],
989
+ "requestBody": {
990
+ "content": {
991
+ "application/json": {
992
+ "schema": {
993
+ "type": "object",
994
+ "properties": {
995
+ "name": {
996
+ "type": "string",
997
+ "minLength": 1
998
+ },
999
+ "goal": {
1000
+ "type": "string",
1001
+ "minLength": 1
1002
+ },
1003
+ "description": {
1004
+ "type": "string"
1005
+ },
1006
+ "leadAgentId": {
1007
+ "type": "string"
1008
+ },
1009
+ "repoId": {
1010
+ "type": "string"
1011
+ },
1012
+ "branch": {
1013
+ "type": "string"
1014
+ },
1015
+ "tags": {
1016
+ "type": "array",
1017
+ "items": {
1018
+ "type": "string"
1019
+ }
1020
+ }
1021
+ },
1022
+ "required": [
1023
+ "name",
1024
+ "goal"
1025
+ ]
1026
+ }
1027
+ }
1028
+ }
1029
+ },
1030
+ "responses": {
1031
+ "201": {
1032
+ "description": "Epic created"
1033
+ },
1034
+ "400": {
1035
+ "description": "Validation error"
1036
+ }
1037
+ }
1038
+ }
1039
+ },
1040
+ "/api/epics/{id}": {
1041
+ "get": {
1042
+ "summary": "Get epic with progress and tasks",
1043
+ "tags": [
1044
+ "Epics"
1045
+ ],
1046
+ "security": [
1047
+ {
1048
+ "bearerAuth": []
1049
+ }
1050
+ ],
1051
+ "parameters": [
1052
+ {
1053
+ "schema": {
1054
+ "type": "string"
1055
+ },
1056
+ "required": true,
1057
+ "name": "id",
1058
+ "in": "path"
1059
+ }
1060
+ ],
1061
+ "responses": {
1062
+ "200": {
1063
+ "description": "Epic with tasks"
1064
+ },
1065
+ "404": {
1066
+ "description": "Epic not found"
1067
+ }
1068
+ }
1069
+ },
1070
+ "put": {
1071
+ "summary": "Update an epic",
1072
+ "tags": [
1073
+ "Epics"
1074
+ ],
1075
+ "security": [
1076
+ {
1077
+ "bearerAuth": []
1078
+ }
1079
+ ],
1080
+ "parameters": [
1081
+ {
1082
+ "schema": {
1083
+ "type": "string"
1084
+ },
1085
+ "required": true,
1086
+ "name": "id",
1087
+ "in": "path"
1088
+ }
1089
+ ],
1090
+ "requestBody": {
1091
+ "content": {
1092
+ "application/json": {
1093
+ "schema": {
1094
+ "type": "object",
1095
+ "additionalProperties": {}
1096
+ }
1097
+ }
1098
+ }
1099
+ },
1100
+ "responses": {
1101
+ "200": {
1102
+ "description": "Epic updated"
1103
+ },
1104
+ "404": {
1105
+ "description": "Epic not found"
1106
+ }
1107
+ }
1108
+ },
1109
+ "delete": {
1110
+ "summary": "Delete an epic",
1111
+ "tags": [
1112
+ "Epics"
1113
+ ],
1114
+ "security": [
1115
+ {
1116
+ "bearerAuth": []
1117
+ }
1118
+ ],
1119
+ "parameters": [
1120
+ {
1121
+ "schema": {
1122
+ "type": "string"
1123
+ },
1124
+ "required": true,
1125
+ "name": "id",
1126
+ "in": "path"
1127
+ }
1128
+ ],
1129
+ "responses": {
1130
+ "200": {
1131
+ "description": "Epic deleted"
1132
+ },
1133
+ "404": {
1134
+ "description": "Epic not found"
1135
+ }
1136
+ }
1137
+ }
1138
+ },
1139
+ "/api/epics/{id}/tasks": {
1140
+ "post": {
1141
+ "summary": "Add task to epic (create new or assign existing)",
1142
+ "tags": [
1143
+ "Epics"
1144
+ ],
1145
+ "security": [
1146
+ {
1147
+ "bearerAuth": []
1148
+ }
1149
+ ],
1150
+ "parameters": [
1151
+ {
1152
+ "schema": {
1153
+ "type": "string"
1154
+ },
1155
+ "required": true,
1156
+ "name": "id",
1157
+ "in": "path"
1158
+ }
1159
+ ],
1160
+ "requestBody": {
1161
+ "content": {
1162
+ "application/json": {
1163
+ "schema": {
1164
+ "type": "object",
1165
+ "properties": {
1166
+ "taskId": {
1167
+ "type": "string"
1168
+ },
1169
+ "task": {
1170
+ "type": "string"
1171
+ },
1172
+ "agentId": {
1173
+ "type": "string"
1174
+ },
1175
+ "taskType": {
1176
+ "type": "string"
1177
+ },
1178
+ "tags": {
1179
+ "type": "array",
1180
+ "items": {
1181
+ "type": "string"
1182
+ }
1183
+ },
1184
+ "priority": {
1185
+ "type": "integer"
1186
+ },
1187
+ "offeredTo": {
1188
+ "type": "string"
1189
+ }
1190
+ }
1191
+ }
1192
+ }
1193
+ }
1194
+ },
1195
+ "responses": {
1196
+ "200": {
1197
+ "description": "Existing task assigned"
1198
+ },
1199
+ "201": {
1200
+ "description": "New task created in epic"
1201
+ },
1202
+ "400": {
1203
+ "description": "Missing task or taskId"
1204
+ },
1205
+ "404": {
1206
+ "description": "Epic or task not found"
1207
+ }
1208
+ }
1209
+ }
1210
+ },
1211
+ "/api/channels": {
1212
+ "get": {
1213
+ "summary": "List all channels",
1214
+ "tags": [
1215
+ "Channels"
1216
+ ],
1217
+ "security": [
1218
+ {
1219
+ "bearerAuth": []
1220
+ }
1221
+ ],
1222
+ "responses": {
1223
+ "200": {
1224
+ "description": "Channel list"
1225
+ }
1226
+ }
1227
+ },
1228
+ "post": {
1229
+ "summary": "Create a new channel",
1230
+ "tags": [
1231
+ "Channels"
1232
+ ],
1233
+ "security": [
1234
+ {
1235
+ "bearerAuth": []
1236
+ }
1237
+ ],
1238
+ "requestBody": {
1239
+ "content": {
1240
+ "application/json": {
1241
+ "schema": {
1242
+ "type": "object",
1243
+ "properties": {
1244
+ "name": {
1245
+ "type": "string",
1246
+ "minLength": 1
1247
+ },
1248
+ "description": {
1249
+ "type": "string"
1250
+ },
1251
+ "type": {
1252
+ "type": "string",
1253
+ "enum": [
1254
+ "public",
1255
+ "dm"
1256
+ ]
1257
+ }
1258
+ },
1259
+ "required": [
1260
+ "name"
1261
+ ]
1262
+ }
1263
+ }
1264
+ }
1265
+ },
1266
+ "responses": {
1267
+ "201": {
1268
+ "description": "Channel created"
1269
+ },
1270
+ "400": {
1271
+ "description": "Validation error"
1272
+ },
1273
+ "409": {
1274
+ "description": "Duplicate name"
1275
+ }
1276
+ }
1277
+ }
1278
+ },
1279
+ "/api/channels/{id}": {
1280
+ "delete": {
1281
+ "summary": "Delete a channel",
1282
+ "tags": [
1283
+ "Channels"
1284
+ ],
1285
+ "security": [
1286
+ {
1287
+ "bearerAuth": []
1288
+ }
1289
+ ],
1290
+ "parameters": [
1291
+ {
1292
+ "schema": {
1293
+ "type": "string"
1294
+ },
1295
+ "required": true,
1296
+ "name": "id",
1297
+ "in": "path"
1298
+ }
1299
+ ],
1300
+ "responses": {
1301
+ "200": {
1302
+ "description": "Channel deleted"
1303
+ },
1304
+ "400": {
1305
+ "description": "Cannot delete general channel"
1306
+ },
1307
+ "404": {
1308
+ "description": "Channel not found"
1309
+ }
1310
+ }
1311
+ }
1312
+ },
1313
+ "/api/channels/{id}/messages": {
1314
+ "get": {
1315
+ "summary": "Get messages in a channel",
1316
+ "tags": [
1317
+ "Channels"
1318
+ ],
1319
+ "security": [
1320
+ {
1321
+ "bearerAuth": []
1322
+ }
1323
+ ],
1324
+ "parameters": [
1325
+ {
1326
+ "schema": {
1327
+ "type": "string"
1328
+ },
1329
+ "required": true,
1330
+ "name": "id",
1331
+ "in": "path"
1332
+ },
1333
+ {
1334
+ "schema": {
1335
+ "type": "integer",
1336
+ "minimum": 1
1337
+ },
1338
+ "required": false,
1339
+ "name": "limit",
1340
+ "in": "query"
1341
+ },
1342
+ {
1343
+ "schema": {
1344
+ "type": "string"
1345
+ },
1346
+ "required": false,
1347
+ "name": "since",
1348
+ "in": "query"
1349
+ },
1350
+ {
1351
+ "schema": {
1352
+ "type": "string"
1353
+ },
1354
+ "required": false,
1355
+ "name": "before",
1356
+ "in": "query"
1357
+ }
1358
+ ],
1359
+ "responses": {
1360
+ "200": {
1361
+ "description": "Channel messages"
1362
+ },
1363
+ "404": {
1364
+ "description": "Channel not found"
1365
+ }
1366
+ }
1367
+ },
1368
+ "post": {
1369
+ "summary": "Post a message to a channel",
1370
+ "tags": [
1371
+ "Channels"
1372
+ ],
1373
+ "security": [
1374
+ {
1375
+ "bearerAuth": []
1376
+ }
1377
+ ],
1378
+ "parameters": [
1379
+ {
1380
+ "schema": {
1381
+ "type": "string"
1382
+ },
1383
+ "required": true,
1384
+ "name": "id",
1385
+ "in": "path"
1386
+ }
1387
+ ],
1388
+ "requestBody": {
1389
+ "content": {
1390
+ "application/json": {
1391
+ "schema": {
1392
+ "type": "object",
1393
+ "properties": {
1394
+ "content": {
1395
+ "type": "string",
1396
+ "minLength": 1
1397
+ },
1398
+ "agentId": {
1399
+ "type": "string"
1400
+ },
1401
+ "replyToId": {
1402
+ "type": "string"
1403
+ },
1404
+ "mentions": {
1405
+ "type": "array",
1406
+ "items": {
1407
+ "type": "string"
1408
+ }
1409
+ }
1410
+ },
1411
+ "required": [
1412
+ "content"
1413
+ ]
1414
+ }
1415
+ }
1416
+ }
1417
+ },
1418
+ "responses": {
1419
+ "201": {
1420
+ "description": "Message posted"
1421
+ },
1422
+ "400": {
1423
+ "description": "Invalid content or agentId"
1424
+ },
1425
+ "404": {
1426
+ "description": "Channel not found"
1427
+ }
1428
+ }
1429
+ }
1430
+ },
1431
+ "/api/channels/{channelId}/messages/{messageId}/thread": {
1432
+ "get": {
1433
+ "summary": "Get thread messages for a message",
1434
+ "tags": [
1435
+ "Channels"
1436
+ ],
1437
+ "security": [
1438
+ {
1439
+ "bearerAuth": []
1440
+ }
1441
+ ],
1442
+ "parameters": [
1443
+ {
1444
+ "schema": {
1445
+ "type": "string"
1446
+ },
1447
+ "required": true,
1448
+ "name": "channelId",
1449
+ "in": "path"
1450
+ },
1451
+ {
1452
+ "schema": {
1453
+ "type": "string"
1454
+ },
1455
+ "required": true,
1456
+ "name": "messageId",
1457
+ "in": "path"
1458
+ }
1459
+ ],
1460
+ "responses": {
1461
+ "200": {
1462
+ "description": "Thread messages"
1463
+ },
1464
+ "404": {
1465
+ "description": "Channel not found"
1466
+ }
1467
+ }
1468
+ }
1469
+ },
1470
+ "/api/memory/index": {
1471
+ "post": {
1472
+ "summary": "Ingest content into memory system (async embedding)",
1473
+ "tags": [
1474
+ "Memory"
1475
+ ],
1476
+ "security": [
1477
+ {
1478
+ "bearerAuth": []
1479
+ }
1480
+ ],
1481
+ "requestBody": {
1482
+ "content": {
1483
+ "application/json": {
1484
+ "schema": {
1485
+ "type": "object",
1486
+ "properties": {
1487
+ "agentId": {
1488
+ "type": "string",
1489
+ "format": "uuid"
1490
+ },
1491
+ "content": {
1492
+ "type": "string",
1493
+ "minLength": 1
1494
+ },
1495
+ "name": {
1496
+ "type": "string",
1497
+ "minLength": 1
1498
+ },
1499
+ "scope": {
1500
+ "type": "string",
1501
+ "enum": [
1502
+ "agent",
1503
+ "swarm"
1504
+ ]
1505
+ },
1506
+ "source": {
1507
+ "type": "string",
1508
+ "enum": [
1509
+ "manual",
1510
+ "file_index",
1511
+ "session_summary",
1512
+ "task_completion"
1513
+ ]
1514
+ },
1515
+ "sourceTaskId": {
1516
+ "type": "string",
1517
+ "format": "uuid"
1518
+ },
1519
+ "sourcePath": {
1520
+ "type": "string"
1521
+ },
1522
+ "tags": {
1523
+ "type": "array",
1524
+ "items": {
1525
+ "type": "string"
1526
+ }
1527
+ }
1528
+ },
1529
+ "required": [
1530
+ "content",
1531
+ "name",
1532
+ "scope",
1533
+ "source"
1534
+ ]
1535
+ }
1536
+ }
1537
+ }
1538
+ },
1539
+ "responses": {
1540
+ "202": {
1541
+ "description": "Content queued for embedding"
1542
+ },
1543
+ "400": {
1544
+ "description": "Validation error"
1545
+ }
1546
+ }
1547
+ }
1548
+ },
1549
+ "/api/memory/search": {
1550
+ "post": {
1551
+ "summary": "Search memories by natural language query",
1552
+ "tags": [
1553
+ "Memory"
1554
+ ],
1555
+ "security": [
1556
+ {
1557
+ "bearerAuth": []
1558
+ }
1559
+ ],
1560
+ "requestBody": {
1561
+ "content": {
1562
+ "application/json": {
1563
+ "schema": {
1564
+ "type": "object",
1565
+ "properties": {
1566
+ "query": {
1567
+ "type": "string",
1568
+ "minLength": 1
1569
+ },
1570
+ "limit": {
1571
+ "type": "integer",
1572
+ "minimum": 1,
1573
+ "maximum": 20,
1574
+ "default": 5
1575
+ }
1576
+ },
1577
+ "required": [
1578
+ "query"
1579
+ ]
1580
+ }
1581
+ }
1582
+ }
1583
+ },
1584
+ "responses": {
1585
+ "200": {
1586
+ "description": "Search results"
1587
+ },
1588
+ "400": {
1589
+ "description": "Missing query or agent ID"
1590
+ }
1591
+ }
1592
+ }
1593
+ },
1594
+ "/api/prompt-templates/resolved": {
1595
+ "get": {
1596
+ "summary": "Resolve a prompt template for a given event type and scope chain",
1597
+ "tags": [
1598
+ "PromptTemplates"
1599
+ ],
1600
+ "security": [
1601
+ {
1602
+ "bearerAuth": []
1603
+ }
1604
+ ],
1605
+ "parameters": [
1606
+ {
1607
+ "schema": {
1608
+ "type": "string"
1609
+ },
1610
+ "required": true,
1611
+ "name": "eventType",
1612
+ "in": "query"
1613
+ },
1614
+ {
1615
+ "schema": {
1616
+ "type": "string"
1617
+ },
1618
+ "required": false,
1619
+ "name": "agentId",
1620
+ "in": "query"
1621
+ },
1622
+ {
1623
+ "schema": {
1624
+ "type": "string"
1625
+ },
1626
+ "required": false,
1627
+ "name": "repoId",
1628
+ "in": "query"
1629
+ }
1630
+ ],
1631
+ "responses": {
1632
+ "200": {
1633
+ "description": "Resolved template info"
1634
+ },
1635
+ "400": {
1636
+ "description": "Missing eventType"
1637
+ }
1638
+ }
1639
+ }
1640
+ },
1641
+ "/api/prompt-templates/events": {
1642
+ "get": {
1643
+ "summary": "List all registered event types with their available variables",
1644
+ "tags": [
1645
+ "PromptTemplates"
1646
+ ],
1647
+ "security": [
1648
+ {
1649
+ "bearerAuth": []
1650
+ }
1651
+ ],
1652
+ "responses": {
1653
+ "200": {
1654
+ "description": "List of event template definitions"
1655
+ }
1656
+ }
1657
+ }
1658
+ },
1659
+ "/api/prompt-templates/preview": {
1660
+ "post": {
1661
+ "summary": "Dry-run render a template with provided variables",
1662
+ "tags": [
1663
+ "PromptTemplates"
1664
+ ],
1665
+ "security": [
1666
+ {
1667
+ "bearerAuth": []
1668
+ }
1669
+ ],
1670
+ "requestBody": {
1671
+ "content": {
1672
+ "application/json": {
1673
+ "schema": {
1674
+ "type": "object",
1675
+ "properties": {
1676
+ "eventType": {
1677
+ "type": "string"
1678
+ },
1679
+ "body": {
1680
+ "type": "string"
1681
+ },
1682
+ "variables": {
1683
+ "type": "object",
1684
+ "additionalProperties": {}
1685
+ }
1686
+ },
1687
+ "required": [
1688
+ "eventType"
1689
+ ]
1690
+ }
1691
+ }
1692
+ }
1693
+ },
1694
+ "responses": {
1695
+ "200": {
1696
+ "description": "Rendered template preview"
1697
+ },
1698
+ "400": {
1699
+ "description": "Validation error"
1700
+ }
1701
+ }
1702
+ }
1703
+ },
1704
+ "/api/prompt-templates/render": {
1705
+ "post": {
1706
+ "summary": "Full scope-aware template resolution with interpolation (used by workers via HTTP)",
1707
+ "tags": [
1708
+ "PromptTemplates"
1709
+ ],
1710
+ "security": [
1711
+ {
1712
+ "bearerAuth": []
1713
+ }
1714
+ ],
1715
+ "requestBody": {
1716
+ "content": {
1717
+ "application/json": {
1718
+ "schema": {
1719
+ "type": "object",
1720
+ "properties": {
1721
+ "eventType": {
1722
+ "type": "string"
1723
+ },
1724
+ "variables": {
1725
+ "type": "object",
1726
+ "additionalProperties": {}
1727
+ },
1728
+ "agentId": {
1729
+ "type": "string"
1730
+ },
1731
+ "repoId": {
1732
+ "type": "string"
1733
+ }
1734
+ },
1735
+ "required": [
1736
+ "eventType"
1737
+ ]
1738
+ }
1739
+ }
1740
+ }
1741
+ },
1742
+ "responses": {
1743
+ "200": {
1744
+ "description": "Fully resolved and interpolated template"
1745
+ },
1746
+ "400": {
1747
+ "description": "Validation error"
1748
+ }
1749
+ }
1750
+ }
1751
+ },
1752
+ "/api/prompt-templates/{id}/checkout": {
1753
+ "post": {
1754
+ "summary": "Checkout a specific version of a prompt template from history",
1755
+ "tags": [
1756
+ "PromptTemplates"
1757
+ ],
1758
+ "security": [
1759
+ {
1760
+ "bearerAuth": []
1761
+ }
1762
+ ],
1763
+ "parameters": [
1764
+ {
1765
+ "schema": {
1766
+ "type": "string"
1767
+ },
1768
+ "required": true,
1769
+ "name": "id",
1770
+ "in": "path"
1771
+ }
1772
+ ],
1773
+ "requestBody": {
1774
+ "content": {
1775
+ "application/json": {
1776
+ "schema": {
1777
+ "type": "object",
1778
+ "properties": {
1779
+ "version": {
1780
+ "type": "number"
1781
+ }
1782
+ },
1783
+ "required": [
1784
+ "version"
1785
+ ]
1786
+ }
1787
+ }
1788
+ }
1789
+ },
1790
+ "responses": {
1791
+ "200": {
1792
+ "description": "Checked-out template"
1793
+ },
1794
+ "400": {
1795
+ "description": "Validation error"
1796
+ },
1797
+ "404": {
1798
+ "description": "Template or version not found"
1799
+ }
1800
+ }
1801
+ }
1802
+ },
1803
+ "/api/prompt-templates/{id}/reset": {
1804
+ "post": {
1805
+ "summary": "Reset a prompt template to its code-defined default",
1806
+ "tags": [
1807
+ "PromptTemplates"
1808
+ ],
1809
+ "security": [
1810
+ {
1811
+ "bearerAuth": []
1812
+ }
1813
+ ],
1814
+ "parameters": [
1815
+ {
1816
+ "schema": {
1817
+ "type": "string"
1818
+ },
1819
+ "required": true,
1820
+ "name": "id",
1821
+ "in": "path"
1822
+ }
1823
+ ],
1824
+ "responses": {
1825
+ "200": {
1826
+ "description": "Reset template"
1827
+ },
1828
+ "404": {
1829
+ "description": "Template not found or no code default available"
1830
+ }
1831
+ }
1832
+ }
1833
+ },
1834
+ "/api/prompt-templates/{id}": {
1835
+ "get": {
1836
+ "summary": "Get a single prompt template with its version history",
1837
+ "tags": [
1838
+ "PromptTemplates"
1839
+ ],
1840
+ "security": [
1841
+ {
1842
+ "bearerAuth": []
1843
+ }
1844
+ ],
1845
+ "parameters": [
1846
+ {
1847
+ "schema": {
1848
+ "type": "string"
1849
+ },
1850
+ "required": true,
1851
+ "name": "id",
1852
+ "in": "path"
1853
+ }
1854
+ ],
1855
+ "responses": {
1856
+ "200": {
1857
+ "description": "Template with history"
1858
+ },
1859
+ "404": {
1860
+ "description": "Template not found"
1861
+ }
1862
+ }
1863
+ },
1864
+ "delete": {
1865
+ "summary": "Delete a prompt template override",
1866
+ "tags": [
1867
+ "PromptTemplates"
1868
+ ],
1869
+ "security": [
1870
+ {
1871
+ "bearerAuth": []
1872
+ }
1873
+ ],
1874
+ "parameters": [
1875
+ {
1876
+ "schema": {
1877
+ "type": "string"
1878
+ },
1879
+ "required": true,
1880
+ "name": "id",
1881
+ "in": "path"
1882
+ }
1883
+ ],
1884
+ "responses": {
1885
+ "200": {
1886
+ "description": "Template deleted"
1887
+ },
1888
+ "400": {
1889
+ "description": "Cannot delete default template"
1890
+ },
1891
+ "404": {
1892
+ "description": "Template not found"
1893
+ }
1894
+ }
1895
+ }
1896
+ },
1897
+ "/api/prompt-templates": {
1898
+ "get": {
1899
+ "summary": "List prompt templates with optional filters",
1900
+ "tags": [
1901
+ "PromptTemplates"
1902
+ ],
1903
+ "security": [
1904
+ {
1905
+ "bearerAuth": []
1906
+ }
1907
+ ],
1908
+ "parameters": [
1909
+ {
1910
+ "schema": {
1911
+ "type": "string"
1912
+ },
1913
+ "required": false,
1914
+ "name": "eventType",
1915
+ "in": "query"
1916
+ },
1917
+ {
1918
+ "schema": {
1919
+ "type": "string"
1920
+ },
1921
+ "required": false,
1922
+ "name": "scope",
1923
+ "in": "query"
1924
+ },
1925
+ {
1926
+ "schema": {
1927
+ "type": "string"
1928
+ },
1929
+ "required": false,
1930
+ "name": "scopeId",
1931
+ "in": "query"
1932
+ },
1933
+ {
1934
+ "schema": {
1935
+ "type": "string",
1936
+ "enum": [
1937
+ "true",
1938
+ "false"
1939
+ ]
1940
+ },
1941
+ "required": false,
1942
+ "name": "isDefault",
1943
+ "in": "query"
1944
+ }
1945
+ ],
1946
+ "responses": {
1947
+ "200": {
1948
+ "description": "List of prompt templates"
1949
+ }
1950
+ }
1951
+ },
1952
+ "put": {
1953
+ "summary": "Create or update a prompt template override",
1954
+ "tags": [
1955
+ "PromptTemplates"
1956
+ ],
1957
+ "security": [
1958
+ {
1959
+ "bearerAuth": []
1960
+ }
1961
+ ],
1962
+ "requestBody": {
1963
+ "content": {
1964
+ "application/json": {
1965
+ "schema": {
1966
+ "type": "object",
1967
+ "properties": {
1968
+ "eventType": {
1969
+ "type": "string",
1970
+ "minLength": 1
1971
+ },
1972
+ "scope": {
1973
+ "type": "string",
1974
+ "enum": [
1975
+ "global",
1976
+ "agent",
1977
+ "repo"
1978
+ ]
1979
+ },
1980
+ "scopeId": {
1981
+ "type": "string"
1982
+ },
1983
+ "state": {
1984
+ "type": "string",
1985
+ "enum": [
1986
+ "enabled",
1987
+ "default_prompt_fallback",
1988
+ "skip_event"
1989
+ ]
1990
+ },
1991
+ "body": {
1992
+ "type": "string"
1993
+ },
1994
+ "changedBy": {
1995
+ "type": "string"
1996
+ },
1997
+ "changeReason": {
1998
+ "type": "string"
1999
+ }
2000
+ },
2001
+ "required": [
2002
+ "eventType",
2003
+ "body"
2004
+ ]
2005
+ }
2006
+ }
2007
+ }
2008
+ },
2009
+ "responses": {
2010
+ "200": {
2011
+ "description": "Upserted template"
2012
+ },
2013
+ "400": {
2014
+ "description": "Validation error"
2015
+ }
2016
+ }
2017
+ }
2018
+ },
2019
+ "/api/poll": {
2020
+ "get": {
2021
+ "summary": "Poll for triggers (tasks, mentions, epic updates)",
2022
+ "tags": [
2023
+ "Poll"
2024
+ ],
2025
+ "security": [
2026
+ {
2027
+ "bearerAuth": []
2028
+ }
2029
+ ],
2030
+ "responses": {
2031
+ "200": {
2032
+ "description": "Trigger data or null"
2033
+ },
2034
+ "400": {
2035
+ "description": "Missing X-Agent-ID"
2036
+ },
2037
+ "404": {
2038
+ "description": "Agent not found"
2039
+ }
2040
+ }
2041
+ }
2042
+ },
2043
+ "/api/channel-activity/commit-cursors": {
2044
+ "post": {
2045
+ "summary": "Commit channel activity cursors after successful processing",
2046
+ "tags": [
2047
+ "Poll"
2048
+ ],
2049
+ "security": [
2050
+ {
2051
+ "bearerAuth": []
2052
+ }
2053
+ ],
2054
+ "requestBody": {
2055
+ "content": {
2056
+ "application/json": {
2057
+ "schema": {
2058
+ "type": "object",
2059
+ "properties": {
2060
+ "cursorUpdates": {
2061
+ "type": "array",
2062
+ "items": {
2063
+ "type": "object",
2064
+ "properties": {
2065
+ "channelId": {
2066
+ "type": "string"
2067
+ },
2068
+ "ts": {
2069
+ "type": "string"
2070
+ }
2071
+ },
2072
+ "required": [
2073
+ "channelId",
2074
+ "ts"
2075
+ ]
2076
+ }
2077
+ }
2078
+ },
2079
+ "required": [
2080
+ "cursorUpdates"
2081
+ ]
2082
+ }
2083
+ }
2084
+ }
2085
+ },
2086
+ "responses": {
2087
+ "200": {
2088
+ "description": "Cursors committed"
2089
+ },
2090
+ "400": {
2091
+ "description": "Invalid request"
2092
+ }
2093
+ }
2094
+ }
2095
+ },
2096
+ "/api/repos/{id}": {
2097
+ "get": {
2098
+ "summary": "Get a repo by ID",
2099
+ "tags": [
2100
+ "Repos"
2101
+ ],
2102
+ "security": [
2103
+ {
2104
+ "bearerAuth": []
2105
+ }
2106
+ ],
2107
+ "parameters": [
2108
+ {
2109
+ "schema": {
2110
+ "type": "string",
2111
+ "format": "uuid"
2112
+ },
2113
+ "required": true,
2114
+ "name": "id",
2115
+ "in": "path"
2116
+ }
2117
+ ],
2118
+ "responses": {
2119
+ "200": {
2120
+ "description": "Repo details",
2121
+ "content": {
2122
+ "application/json": {
2123
+ "schema": {
2124
+ "type": "object",
2125
+ "properties": {
2126
+ "id": {
2127
+ "type": "string",
2128
+ "format": "uuid"
2129
+ },
2130
+ "url": {
2131
+ "type": "string",
2132
+ "minLength": 1
2133
+ },
2134
+ "name": {
2135
+ "type": "string",
2136
+ "minLength": 1,
2137
+ "maxLength": 100
2138
+ },
2139
+ "clonePath": {
2140
+ "type": "string",
2141
+ "minLength": 1
2142
+ },
2143
+ "defaultBranch": {
2144
+ "type": "string",
2145
+ "default": "main"
2146
+ },
2147
+ "autoClone": {
2148
+ "type": "boolean",
2149
+ "default": true
2150
+ },
2151
+ "createdAt": {
2152
+ "type": "string"
2153
+ },
2154
+ "lastUpdatedAt": {
2155
+ "type": "string"
2156
+ }
2157
+ },
2158
+ "required": [
2159
+ "id",
2160
+ "url",
2161
+ "name",
2162
+ "clonePath",
2163
+ "createdAt",
2164
+ "lastUpdatedAt"
2165
+ ]
2166
+ }
2167
+ }
2168
+ }
2169
+ },
2170
+ "404": {
2171
+ "description": "Repo not found",
2172
+ "content": {
2173
+ "application/json": {
2174
+ "schema": {
2175
+ "type": "object",
2176
+ "properties": {
2177
+ "error": {
2178
+ "type": "string"
2179
+ }
2180
+ },
2181
+ "required": [
2182
+ "error"
2183
+ ]
2184
+ }
2185
+ }
2186
+ }
2187
+ }
2188
+ }
2189
+ },
2190
+ "put": {
2191
+ "summary": "Update a repo",
2192
+ "tags": [
2193
+ "Repos"
2194
+ ],
2195
+ "security": [
2196
+ {
2197
+ "bearerAuth": []
2198
+ }
2199
+ ],
2200
+ "parameters": [
2201
+ {
2202
+ "schema": {
2203
+ "type": "string",
2204
+ "format": "uuid"
2205
+ },
2206
+ "required": true,
2207
+ "name": "id",
2208
+ "in": "path"
2209
+ }
2210
+ ],
2211
+ "requestBody": {
2212
+ "content": {
2213
+ "application/json": {
2214
+ "schema": {
2215
+ "type": "object",
2216
+ "properties": {
2217
+ "url": {
2218
+ "type": "string"
2219
+ },
2220
+ "name": {
2221
+ "type": "string"
2222
+ },
2223
+ "clonePath": {
2224
+ "type": "string"
2225
+ },
2226
+ "defaultBranch": {
2227
+ "type": "string"
2228
+ },
2229
+ "autoClone": {
2230
+ "type": "boolean"
2231
+ }
2232
+ }
2233
+ }
2234
+ }
2235
+ }
2236
+ },
2237
+ "responses": {
2238
+ "200": {
2239
+ "description": "Repo updated",
2240
+ "content": {
2241
+ "application/json": {
2242
+ "schema": {
2243
+ "type": "object",
2244
+ "properties": {
2245
+ "id": {
2246
+ "type": "string",
2247
+ "format": "uuid"
2248
+ },
2249
+ "url": {
2250
+ "type": "string",
2251
+ "minLength": 1
2252
+ },
2253
+ "name": {
2254
+ "type": "string",
2255
+ "minLength": 1,
2256
+ "maxLength": 100
2257
+ },
2258
+ "clonePath": {
2259
+ "type": "string",
2260
+ "minLength": 1
2261
+ },
2262
+ "defaultBranch": {
2263
+ "type": "string",
2264
+ "default": "main"
2265
+ },
2266
+ "autoClone": {
2267
+ "type": "boolean",
2268
+ "default": true
2269
+ },
2270
+ "createdAt": {
2271
+ "type": "string"
2272
+ },
2273
+ "lastUpdatedAt": {
2274
+ "type": "string"
2275
+ }
2276
+ },
2277
+ "required": [
2278
+ "id",
2279
+ "url",
2280
+ "name",
2281
+ "clonePath",
2282
+ "createdAt",
2283
+ "lastUpdatedAt"
2284
+ ]
2285
+ }
2286
+ }
2287
+ }
2288
+ },
2289
+ "404": {
2290
+ "description": "Repo not found",
2291
+ "content": {
2292
+ "application/json": {
2293
+ "schema": {
2294
+ "type": "object",
2295
+ "properties": {
2296
+ "error": {
2297
+ "type": "string"
2298
+ }
2299
+ },
2300
+ "required": [
2301
+ "error"
2302
+ ]
2303
+ }
2304
+ }
2305
+ }
2306
+ },
2307
+ "409": {
2308
+ "description": "Duplicate repo",
2309
+ "content": {
2310
+ "application/json": {
2311
+ "schema": {
2312
+ "type": "object",
2313
+ "properties": {
2314
+ "error": {
2315
+ "type": "string"
2316
+ }
2317
+ },
2318
+ "required": [
2319
+ "error"
2320
+ ]
2321
+ }
2322
+ }
2323
+ }
2324
+ }
2325
+ }
2326
+ },
2327
+ "delete": {
2328
+ "summary": "Delete a repo",
2329
+ "tags": [
2330
+ "Repos"
2331
+ ],
2332
+ "security": [
2333
+ {
2334
+ "bearerAuth": []
2335
+ }
2336
+ ],
2337
+ "parameters": [
2338
+ {
2339
+ "schema": {
2340
+ "type": "string",
2341
+ "format": "uuid"
2342
+ },
2343
+ "required": true,
2344
+ "name": "id",
2345
+ "in": "path"
2346
+ }
2347
+ ],
2348
+ "responses": {
2349
+ "200": {
2350
+ "description": "Repo deleted",
2351
+ "content": {
2352
+ "application/json": {
2353
+ "schema": {
2354
+ "type": "object",
2355
+ "properties": {
2356
+ "success": {
2357
+ "type": "boolean"
2358
+ }
2359
+ },
2360
+ "required": [
2361
+ "success"
2362
+ ]
2363
+ }
2364
+ }
2365
+ }
2366
+ },
2367
+ "404": {
2368
+ "description": "Repo not found",
2369
+ "content": {
2370
+ "application/json": {
2371
+ "schema": {
2372
+ "type": "object",
2373
+ "properties": {
2374
+ "error": {
2375
+ "type": "string"
2376
+ }
2377
+ },
2378
+ "required": [
2379
+ "error"
2380
+ ]
2381
+ }
2382
+ }
2383
+ }
2384
+ }
2385
+ }
2386
+ }
2387
+ },
2388
+ "/api/repos": {
2389
+ "get": {
2390
+ "summary": "List repos with optional filters",
2391
+ "tags": [
2392
+ "Repos"
2393
+ ],
2394
+ "security": [
2395
+ {
2396
+ "bearerAuth": []
2397
+ }
2398
+ ],
2399
+ "parameters": [
2400
+ {
2401
+ "schema": {
2402
+ "type": "string",
2403
+ "enum": [
2404
+ "true",
2405
+ "false"
2406
+ ]
2407
+ },
2408
+ "required": false,
2409
+ "name": "autoClone",
2410
+ "in": "query"
2411
+ },
2412
+ {
2413
+ "schema": {
2414
+ "type": "string"
2415
+ },
2416
+ "required": false,
2417
+ "name": "name",
2418
+ "in": "query"
2419
+ }
2420
+ ],
2421
+ "responses": {
2422
+ "200": {
2423
+ "description": "List of repos",
2424
+ "content": {
2425
+ "application/json": {
2426
+ "schema": {
2427
+ "type": "object",
2428
+ "properties": {
2429
+ "repos": {
2430
+ "type": "array",
2431
+ "items": {
2432
+ "type": "object",
2433
+ "properties": {
2434
+ "id": {
2435
+ "type": "string",
2436
+ "format": "uuid"
2437
+ },
2438
+ "url": {
2439
+ "type": "string",
2440
+ "minLength": 1
2441
+ },
2442
+ "name": {
2443
+ "type": "string",
2444
+ "minLength": 1,
2445
+ "maxLength": 100
2446
+ },
2447
+ "clonePath": {
2448
+ "type": "string",
2449
+ "minLength": 1
2450
+ },
2451
+ "defaultBranch": {
2452
+ "type": "string",
2453
+ "default": "main"
2454
+ },
2455
+ "autoClone": {
2456
+ "type": "boolean",
2457
+ "default": true
2458
+ },
2459
+ "createdAt": {
2460
+ "type": "string"
2461
+ },
2462
+ "lastUpdatedAt": {
2463
+ "type": "string"
2464
+ }
2465
+ },
2466
+ "required": [
2467
+ "id",
2468
+ "url",
2469
+ "name",
2470
+ "clonePath",
2471
+ "createdAt",
2472
+ "lastUpdatedAt"
2473
+ ]
2474
+ }
2475
+ }
2476
+ },
2477
+ "required": [
2478
+ "repos"
2479
+ ]
2480
+ }
2481
+ }
2482
+ }
2483
+ }
2484
+ }
2485
+ },
2486
+ "post": {
2487
+ "summary": "Create a new repo",
2488
+ "tags": [
2489
+ "Repos"
2490
+ ],
2491
+ "security": [
2492
+ {
2493
+ "bearerAuth": []
2494
+ }
2495
+ ],
2496
+ "requestBody": {
2497
+ "content": {
2498
+ "application/json": {
2499
+ "schema": {
2500
+ "type": "object",
2501
+ "properties": {
2502
+ "url": {
2503
+ "type": "string",
2504
+ "minLength": 1
2505
+ },
2506
+ "name": {
2507
+ "type": "string",
2508
+ "minLength": 1
2509
+ },
2510
+ "clonePath": {
2511
+ "type": "string"
2512
+ },
2513
+ "defaultBranch": {
2514
+ "type": "string"
2515
+ },
2516
+ "autoClone": {
2517
+ "type": "boolean"
2518
+ }
2519
+ },
2520
+ "required": [
2521
+ "url",
2522
+ "name"
2523
+ ]
2524
+ }
2525
+ }
2526
+ }
2527
+ },
2528
+ "responses": {
2529
+ "201": {
2530
+ "description": "Repo created",
2531
+ "content": {
2532
+ "application/json": {
2533
+ "schema": {
2534
+ "type": "object",
2535
+ "properties": {
2536
+ "id": {
2537
+ "type": "string",
2538
+ "format": "uuid"
2539
+ },
2540
+ "url": {
2541
+ "type": "string",
2542
+ "minLength": 1
2543
+ },
2544
+ "name": {
2545
+ "type": "string",
2546
+ "minLength": 1,
2547
+ "maxLength": 100
2548
+ },
2549
+ "clonePath": {
2550
+ "type": "string",
2551
+ "minLength": 1
2552
+ },
2553
+ "defaultBranch": {
2554
+ "type": "string",
2555
+ "default": "main"
2556
+ },
2557
+ "autoClone": {
2558
+ "type": "boolean",
2559
+ "default": true
2560
+ },
2561
+ "createdAt": {
2562
+ "type": "string"
2563
+ },
2564
+ "lastUpdatedAt": {
2565
+ "type": "string"
2566
+ }
2567
+ },
2568
+ "required": [
2569
+ "id",
2570
+ "url",
2571
+ "name",
2572
+ "clonePath",
2573
+ "createdAt",
2574
+ "lastUpdatedAt"
2575
+ ]
2576
+ }
2577
+ }
2578
+ }
2579
+ },
2580
+ "400": {
2581
+ "description": "Validation error",
2582
+ "content": {
2583
+ "application/json": {
2584
+ "schema": {
2585
+ "type": "object",
2586
+ "properties": {
2587
+ "error": {
2588
+ "type": "string"
2589
+ }
2590
+ },
2591
+ "required": [
2592
+ "error"
2593
+ ]
2594
+ }
2595
+ }
2596
+ }
2597
+ },
2598
+ "409": {
2599
+ "description": "Duplicate repo",
2600
+ "content": {
2601
+ "application/json": {
2602
+ "schema": {
2603
+ "type": "object",
2604
+ "properties": {
2605
+ "error": {
2606
+ "type": "string"
2607
+ }
2608
+ },
2609
+ "required": [
2610
+ "error"
2611
+ ]
2612
+ }
2613
+ }
2614
+ }
2615
+ }
2616
+ }
2617
+ }
2618
+ },
2619
+ "/api/schedules": {
2620
+ "post": {
2621
+ "summary": "Create a new schedule",
2622
+ "tags": [
2623
+ "Schedules"
2624
+ ],
2625
+ "security": [
2626
+ {
2627
+ "bearerAuth": []
2628
+ }
2629
+ ],
2630
+ "requestBody": {
2631
+ "content": {
2632
+ "application/json": {
2633
+ "schema": {
2634
+ "type": "object",
2635
+ "properties": {
2636
+ "name": {
2637
+ "type": "string",
2638
+ "minLength": 1
2639
+ },
2640
+ "description": {
2641
+ "type": "string"
2642
+ },
2643
+ "cronExpression": {
2644
+ "type": "string"
2645
+ },
2646
+ "intervalMs": {
2647
+ "type": "integer"
2648
+ },
2649
+ "taskTemplate": {
2650
+ "type": "string",
2651
+ "minLength": 1
2652
+ },
2653
+ "taskType": {
2654
+ "type": "string"
2655
+ },
2656
+ "tags": {
2657
+ "type": "array",
2658
+ "items": {
2659
+ "type": "string"
2660
+ }
2661
+ },
2662
+ "priority": {
2663
+ "type": "integer"
2664
+ },
2665
+ "targetAgentId": {
2666
+ "type": "string",
2667
+ "format": "uuid"
2668
+ },
2669
+ "enabled": {
2670
+ "type": "boolean"
2671
+ },
2672
+ "timezone": {
2673
+ "type": "string"
2674
+ },
2675
+ "model": {
2676
+ "type": "string"
2677
+ },
2678
+ "scheduleType": {
2679
+ "type": "string",
2680
+ "enum": [
2681
+ "recurring",
2682
+ "one_time"
2683
+ ]
2684
+ },
2685
+ "delayMs": {
2686
+ "type": "integer"
2687
+ },
2688
+ "runAt": {
2689
+ "type": "string"
2690
+ }
2691
+ },
2692
+ "required": [
2693
+ "name",
2694
+ "taskTemplate"
2695
+ ]
2696
+ }
2697
+ }
2698
+ }
2699
+ },
2700
+ "responses": {
2701
+ "201": {
2702
+ "description": "Schedule created"
2703
+ },
2704
+ "400": {
2705
+ "description": "Validation error"
2706
+ },
2707
+ "409": {
2708
+ "description": "Duplicate name"
2709
+ }
2710
+ }
2711
+ }
2712
+ },
2713
+ "/api/schedules/{id}/run": {
2714
+ "post": {
2715
+ "summary": "Run a schedule immediately",
2716
+ "tags": [
2717
+ "Schedules"
2718
+ ],
2719
+ "security": [
2720
+ {
2721
+ "bearerAuth": []
2722
+ }
2723
+ ],
2724
+ "parameters": [
2725
+ {
2726
+ "schema": {
2727
+ "type": "string"
2728
+ },
2729
+ "required": true,
2730
+ "name": "id",
2731
+ "in": "path"
2732
+ }
2733
+ ],
2734
+ "responses": {
2735
+ "200": {
2736
+ "description": "Schedule run triggered"
2737
+ },
2738
+ "400": {
2739
+ "description": "Schedule is disabled"
2740
+ },
2741
+ "404": {
2742
+ "description": "Schedule not found"
2743
+ }
2744
+ }
2745
+ }
2746
+ },
2747
+ "/api/schedules/{id}": {
2748
+ "get": {
2749
+ "summary": "Get a schedule by ID",
2750
+ "tags": [
2751
+ "Schedules"
2752
+ ],
2753
+ "security": [
2754
+ {
2755
+ "bearerAuth": []
2756
+ }
2757
+ ],
2758
+ "parameters": [
2759
+ {
2760
+ "schema": {
2761
+ "type": "string"
2762
+ },
2763
+ "required": true,
2764
+ "name": "id",
2765
+ "in": "path"
2766
+ }
2767
+ ],
2768
+ "responses": {
2769
+ "200": {
2770
+ "description": "Schedule details"
2771
+ },
2772
+ "404": {
2773
+ "description": "Schedule not found"
2774
+ }
2775
+ }
2776
+ },
2777
+ "put": {
2778
+ "summary": "Update a schedule",
2779
+ "tags": [
2780
+ "Schedules"
2781
+ ],
2782
+ "security": [
2783
+ {
2784
+ "bearerAuth": []
2785
+ }
2786
+ ],
2787
+ "parameters": [
2788
+ {
2789
+ "schema": {
2790
+ "type": "string"
2791
+ },
2792
+ "required": true,
2793
+ "name": "id",
2794
+ "in": "path"
2795
+ }
2796
+ ],
2797
+ "requestBody": {
2798
+ "content": {
2799
+ "application/json": {
2800
+ "schema": {
2801
+ "type": "object",
2802
+ "properties": {
2803
+ "name": {
2804
+ "type": "string"
2805
+ },
2806
+ "description": {
2807
+ "type": "string"
2808
+ },
2809
+ "cronExpression": {
2810
+ "type": "string"
2811
+ },
2812
+ "intervalMs": {
2813
+ "type": "integer"
2814
+ },
2815
+ "taskTemplate": {
2816
+ "type": "string"
2817
+ },
2818
+ "taskType": {
2819
+ "type": "string"
2820
+ },
2821
+ "tags": {
2822
+ "type": "array",
2823
+ "items": {
2824
+ "type": "string"
2825
+ }
2826
+ },
2827
+ "priority": {
2828
+ "type": "integer"
2829
+ },
2830
+ "targetAgentId": {
2831
+ "type": "string",
2832
+ "format": "uuid"
2833
+ },
2834
+ "enabled": {
2835
+ "type": "boolean"
2836
+ },
2837
+ "timezone": {
2838
+ "type": "string"
2839
+ },
2840
+ "model": {
2841
+ "type": "string"
2842
+ },
2843
+ "nextRunAt": {
2844
+ "type": [
2845
+ "string",
2846
+ "null"
2847
+ ]
2848
+ }
2849
+ }
2850
+ }
2851
+ }
2852
+ }
2853
+ },
2854
+ "responses": {
2855
+ "200": {
2856
+ "description": "Schedule updated"
2857
+ },
2858
+ "400": {
2859
+ "description": "Validation error"
2860
+ },
2861
+ "404": {
2862
+ "description": "Schedule not found"
2863
+ },
2864
+ "409": {
2865
+ "description": "Duplicate name"
2866
+ }
2867
+ }
2868
+ },
2869
+ "delete": {
2870
+ "summary": "Delete a schedule",
2871
+ "tags": [
2872
+ "Schedules"
2873
+ ],
2874
+ "security": [
2875
+ {
2876
+ "bearerAuth": []
2877
+ }
2878
+ ],
2879
+ "parameters": [
2880
+ {
2881
+ "schema": {
2882
+ "type": "string"
2883
+ },
2884
+ "required": true,
2885
+ "name": "id",
2886
+ "in": "path"
2887
+ }
2888
+ ],
2889
+ "responses": {
2890
+ "200": {
2891
+ "description": "Schedule deleted"
2892
+ },
2893
+ "404": {
2894
+ "description": "Schedule not found"
2895
+ }
2896
+ }
2897
+ }
2898
+ },
2899
+ "/api/session-logs": {
2900
+ "post": {
2901
+ "summary": "Store session logs",
2902
+ "tags": [
2903
+ "Session Data"
2904
+ ],
2905
+ "security": [
2906
+ {
2907
+ "bearerAuth": []
2908
+ }
2909
+ ],
2910
+ "requestBody": {
2911
+ "content": {
2912
+ "application/json": {
2913
+ "schema": {
2914
+ "type": "object",
2915
+ "properties": {
2916
+ "sessionId": {
2917
+ "type": "string",
2918
+ "minLength": 1
2919
+ },
2920
+ "iteration": {
2921
+ "type": "integer",
2922
+ "minimum": 1
2923
+ },
2924
+ "lines": {
2925
+ "type": "array",
2926
+ "items": {
2927
+ "type": "string"
2928
+ },
2929
+ "minItems": 1
2930
+ },
2931
+ "taskId": {
2932
+ "type": "string"
2933
+ },
2934
+ "cli": {
2935
+ "type": "string"
2936
+ }
2937
+ },
2938
+ "required": [
2939
+ "sessionId",
2940
+ "iteration",
2941
+ "lines"
2942
+ ]
2943
+ }
2944
+ }
2945
+ }
2946
+ },
2947
+ "responses": {
2948
+ "201": {
2949
+ "description": "Logs stored"
2950
+ },
2951
+ "400": {
2952
+ "description": "Validation error"
2953
+ }
2954
+ }
2955
+ }
2956
+ },
2957
+ "/api/tasks/{taskId}/session-logs": {
2958
+ "get": {
2959
+ "summary": "Get session logs for a task",
2960
+ "tags": [
2961
+ "Session Data"
2962
+ ],
2963
+ "security": [
2964
+ {
2965
+ "bearerAuth": []
2966
+ }
2967
+ ],
2968
+ "parameters": [
2969
+ {
2970
+ "schema": {
2971
+ "type": "string"
2972
+ },
2973
+ "required": true,
2974
+ "name": "taskId",
2975
+ "in": "path"
2976
+ }
2977
+ ],
2978
+ "responses": {
2979
+ "200": {
2980
+ "description": "Session logs"
2981
+ },
2982
+ "404": {
2983
+ "description": "Task not found"
2984
+ }
2985
+ }
2986
+ }
2987
+ },
2988
+ "/api/session-costs": {
2989
+ "post": {
2990
+ "summary": "Store session cost record",
2991
+ "tags": [
2992
+ "Session Data"
2993
+ ],
2994
+ "security": [
2995
+ {
2996
+ "bearerAuth": []
2997
+ }
2998
+ ],
2999
+ "requestBody": {
3000
+ "content": {
3001
+ "application/json": {
3002
+ "schema": {
3003
+ "type": "object",
3004
+ "properties": {
3005
+ "sessionId": {
3006
+ "type": "string",
3007
+ "minLength": 1
3008
+ },
3009
+ "agentId": {
3010
+ "type": "string",
3011
+ "minLength": 1
3012
+ },
3013
+ "totalCostUsd": {
3014
+ "type": "number"
3015
+ },
3016
+ "taskId": {
3017
+ "type": "string"
3018
+ },
3019
+ "inputTokens": {
3020
+ "type": "integer"
3021
+ },
3022
+ "outputTokens": {
3023
+ "type": "integer"
3024
+ },
3025
+ "cacheReadTokens": {
3026
+ "type": "integer"
3027
+ },
3028
+ "cacheWriteTokens": {
3029
+ "type": "integer"
3030
+ },
3031
+ "durationMs": {
3032
+ "type": "integer"
3033
+ },
3034
+ "numTurns": {
3035
+ "type": "integer"
3036
+ },
3037
+ "model": {
3038
+ "type": "string"
3039
+ },
3040
+ "isError": {
3041
+ "type": "boolean"
3042
+ }
3043
+ },
3044
+ "required": [
3045
+ "sessionId",
3046
+ "agentId",
3047
+ "totalCostUsd"
3048
+ ]
3049
+ }
3050
+ }
3051
+ }
3052
+ },
3053
+ "responses": {
3054
+ "201": {
3055
+ "description": "Cost record stored"
3056
+ },
3057
+ "400": {
3058
+ "description": "Validation error"
3059
+ }
3060
+ }
3061
+ },
3062
+ "get": {
3063
+ "summary": "Query session costs with filters",
3064
+ "tags": [
3065
+ "Session Data"
3066
+ ],
3067
+ "security": [
3068
+ {
3069
+ "bearerAuth": []
3070
+ }
3071
+ ],
3072
+ "parameters": [
3073
+ {
3074
+ "schema": {
3075
+ "type": "string"
3076
+ },
3077
+ "required": false,
3078
+ "name": "agentId",
3079
+ "in": "query"
3080
+ },
3081
+ {
3082
+ "schema": {
3083
+ "type": "string"
3084
+ },
3085
+ "required": false,
3086
+ "name": "taskId",
3087
+ "in": "query"
3088
+ },
3089
+ {
3090
+ "schema": {
3091
+ "type": "string"
3092
+ },
3093
+ "required": false,
3094
+ "name": "startDate",
3095
+ "in": "query"
3096
+ },
3097
+ {
3098
+ "schema": {
3099
+ "type": "string"
3100
+ },
3101
+ "required": false,
3102
+ "name": "endDate",
3103
+ "in": "query"
3104
+ },
3105
+ {
3106
+ "schema": {
3107
+ "type": "integer",
3108
+ "minimum": 1
3109
+ },
3110
+ "required": false,
3111
+ "name": "limit",
3112
+ "in": "query"
3113
+ }
3114
+ ],
3115
+ "responses": {
3116
+ "200": {
3117
+ "description": "Session costs"
3118
+ }
3119
+ }
3120
+ }
3121
+ },
3122
+ "/api/session-costs/summary": {
3123
+ "get": {
3124
+ "summary": "Aggregated session cost summary",
3125
+ "tags": [
3126
+ "Session Data"
3127
+ ],
3128
+ "security": [
3129
+ {
3130
+ "bearerAuth": []
3131
+ }
3132
+ ],
3133
+ "parameters": [
3134
+ {
3135
+ "schema": {
3136
+ "type": "string",
3137
+ "enum": [
3138
+ "day",
3139
+ "agent",
3140
+ "both"
3141
+ ]
3142
+ },
3143
+ "required": false,
3144
+ "name": "groupBy",
3145
+ "in": "query"
3146
+ },
3147
+ {
3148
+ "schema": {
3149
+ "type": "string"
3150
+ },
3151
+ "required": false,
3152
+ "name": "startDate",
3153
+ "in": "query"
3154
+ },
3155
+ {
3156
+ "schema": {
3157
+ "type": "string"
3158
+ },
3159
+ "required": false,
3160
+ "name": "endDate",
3161
+ "in": "query"
3162
+ },
3163
+ {
3164
+ "schema": {
3165
+ "type": "string"
3166
+ },
3167
+ "required": false,
3168
+ "name": "agentId",
3169
+ "in": "query"
3170
+ }
3171
+ ],
3172
+ "responses": {
3173
+ "200": {
3174
+ "description": "Cost summary"
3175
+ },
3176
+ "400": {
3177
+ "description": "Invalid groupBy"
3178
+ }
3179
+ }
3180
+ }
3181
+ },
3182
+ "/api/session-costs/dashboard": {
3183
+ "get": {
3184
+ "summary": "Cost today and month-to-date for dashboard",
3185
+ "tags": [
3186
+ "Session Data"
3187
+ ],
3188
+ "security": [
3189
+ {
3190
+ "bearerAuth": []
3191
+ }
3192
+ ],
3193
+ "responses": {
3194
+ "200": {
3195
+ "description": "Dashboard cost data"
3196
+ }
3197
+ }
3198
+ }
3199
+ },
3200
+ "/api/logs": {
3201
+ "get": {
3202
+ "summary": "List agent logs",
3203
+ "tags": [
3204
+ "Stats"
3205
+ ],
3206
+ "security": [
3207
+ {
3208
+ "bearerAuth": []
3209
+ }
3210
+ ],
3211
+ "parameters": [
3212
+ {
3213
+ "schema": {
3214
+ "type": "integer",
3215
+ "minimum": 1
3216
+ },
3217
+ "required": false,
3218
+ "name": "limit",
3219
+ "in": "query"
3220
+ },
3221
+ {
3222
+ "schema": {
3223
+ "type": "string",
3224
+ "format": "uuid"
3225
+ },
3226
+ "required": false,
3227
+ "name": "agentId",
3228
+ "in": "query"
3229
+ }
3230
+ ],
3231
+ "responses": {
3232
+ "200": {
3233
+ "description": "Agent logs"
3234
+ }
3235
+ }
3236
+ }
3237
+ },
3238
+ "/api/stats": {
3239
+ "get": {
3240
+ "summary": "Dashboard summary stats",
3241
+ "tags": [
3242
+ "Stats"
3243
+ ],
3244
+ "security": [
3245
+ {
3246
+ "bearerAuth": []
3247
+ }
3248
+ ],
3249
+ "responses": {
3250
+ "200": {
3251
+ "description": "Agent and task statistics"
3252
+ }
3253
+ }
3254
+ }
3255
+ },
3256
+ "/api/services": {
3257
+ "get": {
3258
+ "summary": "List all registered services",
3259
+ "tags": [
3260
+ "Stats"
3261
+ ],
3262
+ "security": [
3263
+ {
3264
+ "bearerAuth": []
3265
+ }
3266
+ ],
3267
+ "parameters": [
3268
+ {
3269
+ "schema": {
3270
+ "type": "string"
3271
+ },
3272
+ "required": false,
3273
+ "name": "status",
3274
+ "in": "query"
3275
+ },
3276
+ {
3277
+ "schema": {
3278
+ "type": "string"
3279
+ },
3280
+ "required": false,
3281
+ "name": "agentId",
3282
+ "in": "query"
3283
+ },
3284
+ {
3285
+ "schema": {
3286
+ "type": "string"
3287
+ },
3288
+ "required": false,
3289
+ "name": "name",
3290
+ "in": "query"
3291
+ }
3292
+ ],
3293
+ "responses": {
3294
+ "200": {
3295
+ "description": "Service list"
3296
+ }
3297
+ }
3298
+ }
3299
+ },
3300
+ "/api/scheduled-tasks": {
3301
+ "get": {
3302
+ "summary": "List scheduled tasks",
3303
+ "tags": [
3304
+ "Stats"
3305
+ ],
3306
+ "security": [
3307
+ {
3308
+ "bearerAuth": []
3309
+ }
3310
+ ],
3311
+ "parameters": [
3312
+ {
3313
+ "schema": {
3314
+ "type": "string",
3315
+ "enum": [
3316
+ "true",
3317
+ "false"
3318
+ ]
3319
+ },
3320
+ "required": false,
3321
+ "name": "enabled",
3322
+ "in": "query"
3323
+ },
3324
+ {
3325
+ "schema": {
3326
+ "type": "string"
3327
+ },
3328
+ "required": false,
3329
+ "name": "name",
3330
+ "in": "query"
3331
+ },
3332
+ {
3333
+ "schema": {
3334
+ "type": "string",
3335
+ "enum": [
3336
+ "recurring",
3337
+ "one_time"
3338
+ ]
3339
+ },
3340
+ "required": false,
3341
+ "name": "scheduleType",
3342
+ "in": "query"
3343
+ },
3344
+ {
3345
+ "schema": {
3346
+ "type": "string",
3347
+ "enum": [
3348
+ "true",
3349
+ "false"
3350
+ ]
3351
+ },
3352
+ "required": false,
3353
+ "name": "hideCompleted",
3354
+ "in": "query"
3355
+ }
3356
+ ],
3357
+ "responses": {
3358
+ "200": {
3359
+ "description": "Scheduled tasks list"
3360
+ }
3361
+ }
3362
+ }
3363
+ },
3364
+ "/api/concurrent-context": {
3365
+ "get": {
3366
+ "summary": "Get concurrent session context for lead awareness",
3367
+ "tags": [
3368
+ "Stats"
3369
+ ],
3370
+ "security": [
3371
+ {
3372
+ "bearerAuth": []
3373
+ }
3374
+ ],
3375
+ "responses": {
3376
+ "200": {
3377
+ "description": "Concurrent context data"
3378
+ }
3379
+ }
3380
+ }
3381
+ },
3382
+ "/api/tasks": {
3383
+ "get": {
3384
+ "summary": "List tasks with filters",
3385
+ "tags": [
3386
+ "Tasks"
3387
+ ],
3388
+ "security": [
3389
+ {
3390
+ "bearerAuth": []
3391
+ }
3392
+ ],
3393
+ "parameters": [
3394
+ {
3395
+ "schema": {
3396
+ "type": "string"
3397
+ },
3398
+ "required": false,
3399
+ "name": "status",
3400
+ "in": "query"
3401
+ },
3402
+ {
3403
+ "schema": {
3404
+ "type": "string"
3405
+ },
3406
+ "required": false,
3407
+ "name": "agentId",
3408
+ "in": "query"
3409
+ },
3410
+ {
3411
+ "schema": {
3412
+ "type": "string"
3413
+ },
3414
+ "required": false,
3415
+ "name": "epicId",
3416
+ "in": "query"
3417
+ },
3418
+ {
3419
+ "schema": {
3420
+ "type": "string"
3421
+ },
3422
+ "required": false,
3423
+ "name": "scheduleId",
3424
+ "in": "query"
3425
+ },
3426
+ {
3427
+ "schema": {
3428
+ "type": "string"
3429
+ },
3430
+ "required": false,
3431
+ "name": "search",
3432
+ "in": "query"
3433
+ },
3434
+ {
3435
+ "schema": {
3436
+ "type": "string",
3437
+ "enum": [
3438
+ "true",
3439
+ "false"
3440
+ ]
3441
+ },
3442
+ "required": false,
3443
+ "name": "includeHeartbeat",
3444
+ "in": "query"
3445
+ },
3446
+ {
3447
+ "schema": {
3448
+ "type": [
3449
+ "integer",
3450
+ "null"
3451
+ ]
3452
+ },
3453
+ "required": false,
3454
+ "name": "limit",
3455
+ "in": "query"
3456
+ },
3457
+ {
3458
+ "schema": {
3459
+ "type": [
3460
+ "integer",
3461
+ "null"
3462
+ ]
3463
+ },
3464
+ "required": false,
3465
+ "name": "offset",
3466
+ "in": "query"
3467
+ }
3468
+ ],
3469
+ "responses": {
3470
+ "200": {
3471
+ "description": "Paginated task list"
3472
+ }
3473
+ }
3474
+ },
3475
+ "post": {
3476
+ "summary": "Create a new task",
3477
+ "tags": [
3478
+ "Tasks"
3479
+ ],
3480
+ "security": [
3481
+ {
3482
+ "bearerAuth": []
3483
+ }
3484
+ ],
3485
+ "requestBody": {
3486
+ "content": {
3487
+ "application/json": {
3488
+ "schema": {
3489
+ "type": "object",
3490
+ "properties": {
3491
+ "task": {
3492
+ "type": "string",
3493
+ "minLength": 1
3494
+ },
3495
+ "agentId": {
3496
+ "type": "string"
3497
+ },
3498
+ "taskType": {
3499
+ "type": "string"
3500
+ },
3501
+ "tags": {
3502
+ "type": "array",
3503
+ "items": {
3504
+ "type": "string"
3505
+ }
3506
+ },
3507
+ "priority": {
3508
+ "type": "integer"
3509
+ },
3510
+ "dependsOn": {
3511
+ "type": "array",
3512
+ "items": {
3513
+ "type": "string"
3514
+ }
3515
+ },
3516
+ "offeredTo": {
3517
+ "type": "string"
3518
+ },
3519
+ "dir": {
3520
+ "type": "string"
3521
+ },
3522
+ "parentTaskId": {
3523
+ "type": "string"
3524
+ },
3525
+ "source": {
3526
+ "type": "string"
3527
+ },
3528
+ "outputSchema": {
3529
+ "type": "object",
3530
+ "additionalProperties": {}
3531
+ }
3532
+ },
3533
+ "required": [
3534
+ "task"
3535
+ ]
3536
+ }
3537
+ }
3538
+ }
3539
+ },
3540
+ "responses": {
3541
+ "201": {
3542
+ "description": "Task created"
3543
+ },
3544
+ "400": {
3545
+ "description": "Validation error"
3546
+ }
3547
+ }
3548
+ }
3549
+ },
3550
+ "/api/tasks/{id}/claude-session": {
3551
+ "put": {
3552
+ "summary": "Update Claude session ID for a task",
3553
+ "tags": [
3554
+ "Tasks"
3555
+ ],
3556
+ "security": [
3557
+ {
3558
+ "bearerAuth": []
3559
+ }
3560
+ ],
3561
+ "parameters": [
3562
+ {
3563
+ "schema": {
3564
+ "type": "string"
3565
+ },
3566
+ "required": true,
3567
+ "name": "id",
3568
+ "in": "path"
3569
+ }
3570
+ ],
3571
+ "requestBody": {
3572
+ "content": {
3573
+ "application/json": {
3574
+ "schema": {
3575
+ "type": "object",
3576
+ "properties": {
3577
+ "claudeSessionId": {
3578
+ "type": "string",
3579
+ "minLength": 1
3580
+ }
3581
+ },
3582
+ "required": [
3583
+ "claudeSessionId"
3584
+ ]
3585
+ }
3586
+ }
3587
+ }
3588
+ },
3589
+ "responses": {
3590
+ "200": {
3591
+ "description": "Session ID updated"
3592
+ },
3593
+ "404": {
3594
+ "description": "Task not found"
3595
+ }
3596
+ }
3597
+ }
3598
+ },
3599
+ "/api/tasks/{id}/cancel": {
3600
+ "post": {
3601
+ "summary": "Cancel a pending or in-progress task",
3602
+ "tags": [
3603
+ "Tasks"
3604
+ ],
3605
+ "security": [
3606
+ {
3607
+ "bearerAuth": []
3608
+ }
3609
+ ],
3610
+ "parameters": [
3611
+ {
3612
+ "schema": {
3613
+ "type": "string"
3614
+ },
3615
+ "required": true,
3616
+ "name": "id",
3617
+ "in": "path"
3618
+ }
3619
+ ],
3620
+ "responses": {
3621
+ "200": {
3622
+ "description": "Task cancelled"
3623
+ },
3624
+ "400": {
3625
+ "description": "Cannot cancel terminal task"
3626
+ },
3627
+ "404": {
3628
+ "description": "Task not found"
3629
+ }
3630
+ }
3631
+ }
3632
+ },
3633
+ "/api/tasks/{id}": {
3634
+ "get": {
3635
+ "summary": "Get task details with logs",
3636
+ "tags": [
3637
+ "Tasks"
3638
+ ],
3639
+ "security": [
3640
+ {
3641
+ "bearerAuth": []
3642
+ }
3643
+ ],
3644
+ "parameters": [
3645
+ {
3646
+ "schema": {
3647
+ "type": "string"
3648
+ },
3649
+ "required": true,
3650
+ "name": "id",
3651
+ "in": "path"
3652
+ }
3653
+ ],
3654
+ "responses": {
3655
+ "200": {
3656
+ "description": "Task with logs"
3657
+ },
3658
+ "404": {
3659
+ "description": "Task not found"
3660
+ }
3661
+ }
3662
+ }
3663
+ },
3664
+ "/api/tasks/{id}/progress": {
3665
+ "post": {
3666
+ "summary": "Update task progress text",
3667
+ "tags": [
3668
+ "Tasks"
3669
+ ],
3670
+ "security": [
3671
+ {
3672
+ "bearerAuth": []
3673
+ }
3674
+ ],
3675
+ "parameters": [
3676
+ {
3677
+ "schema": {
3678
+ "type": "string"
3679
+ },
3680
+ "required": true,
3681
+ "name": "id",
3682
+ "in": "path"
3683
+ }
3684
+ ],
3685
+ "requestBody": {
3686
+ "content": {
3687
+ "application/json": {
3688
+ "schema": {
3689
+ "type": "object",
3690
+ "properties": {
3691
+ "progress": {
3692
+ "type": "string",
3693
+ "minLength": 1
3694
+ }
3695
+ },
3696
+ "required": [
3697
+ "progress"
3698
+ ]
3699
+ }
3700
+ }
3701
+ }
3702
+ },
3703
+ "responses": {
3704
+ "200": {
3705
+ "description": "Progress updated"
3706
+ },
3707
+ "404": {
3708
+ "description": "Task not found"
3709
+ }
3710
+ }
3711
+ }
3712
+ },
3713
+ "/api/tasks/{id}/finish": {
3714
+ "post": {
3715
+ "summary": "Mark task as completed or failed (runner endpoint)",
3716
+ "tags": [
3717
+ "Tasks"
3718
+ ],
3719
+ "security": [
3720
+ {
3721
+ "bearerAuth": []
3722
+ }
3723
+ ],
3724
+ "parameters": [
3725
+ {
3726
+ "schema": {
3727
+ "type": "string"
3728
+ },
3729
+ "required": true,
3730
+ "name": "id",
3731
+ "in": "path"
3732
+ }
3733
+ ],
3734
+ "requestBody": {
3735
+ "content": {
3736
+ "application/json": {
3737
+ "schema": {
3738
+ "type": "object",
3739
+ "properties": {
3740
+ "status": {
3741
+ "type": "string",
3742
+ "enum": [
3743
+ "completed",
3744
+ "failed"
3745
+ ]
3746
+ },
3747
+ "output": {
3748
+ "type": "string"
3749
+ },
3750
+ "failureReason": {
3751
+ "type": "string"
3752
+ }
3753
+ },
3754
+ "required": [
3755
+ "status"
3756
+ ]
3757
+ }
3758
+ }
3759
+ }
3760
+ },
3761
+ "responses": {
3762
+ "200": {
3763
+ "description": "Task finished"
3764
+ },
3765
+ "400": {
3766
+ "description": "Invalid status"
3767
+ },
3768
+ "403": {
3769
+ "description": "Not assigned to this agent"
3770
+ },
3771
+ "404": {
3772
+ "description": "Task not found"
3773
+ }
3774
+ }
3775
+ }
3776
+ },
3777
+ "/api/paused-tasks": {
3778
+ "get": {
3779
+ "summary": "Get paused tasks for this agent",
3780
+ "tags": [
3781
+ "Tasks"
3782
+ ],
3783
+ "security": [
3784
+ {
3785
+ "bearerAuth": []
3786
+ }
3787
+ ],
3788
+ "responses": {
3789
+ "200": {
3790
+ "description": "Paused task list"
3791
+ }
3792
+ }
3793
+ }
3794
+ },
3795
+ "/api/tasks/{id}/pause": {
3796
+ "post": {
3797
+ "summary": "Pause an in-progress task",
3798
+ "tags": [
3799
+ "Tasks"
3800
+ ],
3801
+ "security": [
3802
+ {
3803
+ "bearerAuth": []
3804
+ }
3805
+ ],
3806
+ "parameters": [
3807
+ {
3808
+ "schema": {
3809
+ "type": "string"
3810
+ },
3811
+ "required": true,
3812
+ "name": "id",
3813
+ "in": "path"
3814
+ }
3815
+ ],
3816
+ "responses": {
3817
+ "200": {
3818
+ "description": "Task paused"
3819
+ },
3820
+ "400": {
3821
+ "description": "Task not in_progress"
3822
+ },
3823
+ "403": {
3824
+ "description": "Task belongs to another agent"
3825
+ },
3826
+ "404": {
3827
+ "description": "Task not found"
3828
+ }
3829
+ }
3830
+ }
3831
+ },
3832
+ "/api/tasks/{id}/resume": {
3833
+ "post": {
3834
+ "summary": "Resume a paused task",
3835
+ "tags": [
3836
+ "Tasks"
3837
+ ],
3838
+ "security": [
3839
+ {
3840
+ "bearerAuth": []
3841
+ }
3842
+ ],
3843
+ "parameters": [
3844
+ {
3845
+ "schema": {
3846
+ "type": "string"
3847
+ },
3848
+ "required": true,
3849
+ "name": "id",
3850
+ "in": "path"
3851
+ }
3852
+ ],
3853
+ "responses": {
3854
+ "200": {
3855
+ "description": "Task resumed"
3856
+ },
3857
+ "400": {
3858
+ "description": "Task not paused"
3859
+ },
3860
+ "403": {
3861
+ "description": "Task belongs to another agent"
3862
+ },
3863
+ "404": {
3864
+ "description": "Task not found"
3865
+ }
3866
+ }
3867
+ }
3868
+ },
3869
+ "/api/trackers/linear/authorize": {
3870
+ "get": {
3871
+ "summary": "Redirect to Linear OAuth consent screen",
3872
+ "tags": [
3873
+ "Trackers"
3874
+ ],
3875
+ "responses": {
3876
+ "302": {
3877
+ "description": "Redirect to Linear OAuth"
3878
+ },
3879
+ "500": {
3880
+ "description": "Failed to generate authorization URL"
3881
+ },
3882
+ "503": {
3883
+ "description": "Linear integration not configured"
3884
+ }
3885
+ }
3886
+ }
3887
+ },
3888
+ "/api/trackers/linear/callback": {
3889
+ "get": {
3890
+ "summary": "Handle Linear OAuth callback",
3891
+ "tags": [
3892
+ "Trackers"
3893
+ ],
3894
+ "parameters": [
3895
+ {
3896
+ "schema": {
3897
+ "type": "string"
3898
+ },
3899
+ "required": true,
3900
+ "name": "code",
3901
+ "in": "query"
3902
+ },
3903
+ {
3904
+ "schema": {
3905
+ "type": "string"
3906
+ },
3907
+ "required": true,
3908
+ "name": "state",
3909
+ "in": "query"
3910
+ }
3911
+ ],
3912
+ "responses": {
3913
+ "200": {
3914
+ "description": "OAuth complete"
3915
+ },
3916
+ "400": {
3917
+ "description": "Invalid state or code"
3918
+ },
3919
+ "500": {
3920
+ "description": "Token exchange failed"
3921
+ }
3922
+ }
3923
+ }
3924
+ },
3925
+ "/api/trackers/linear/status": {
3926
+ "get": {
3927
+ "summary": "Linear connection status, token expiry, workspace info, expected webhook URL",
3928
+ "tags": [
3929
+ "Trackers"
3930
+ ],
3931
+ "security": [
3932
+ {
3933
+ "bearerAuth": []
3934
+ }
3935
+ ],
3936
+ "responses": {
3937
+ "200": {
3938
+ "description": "Connection status"
3939
+ },
3940
+ "503": {
3941
+ "description": "Linear integration not configured"
3942
+ }
3943
+ }
3944
+ }
3945
+ },
3946
+ "/api/trackers/linear/webhook": {
3947
+ "post": {
3948
+ "summary": "Handle Linear webhook events (signature-verified)",
3949
+ "tags": [
3950
+ "Trackers"
3951
+ ],
3952
+ "responses": {
3953
+ "200": {
3954
+ "description": "Event accepted"
3955
+ },
3956
+ "401": {
3957
+ "description": "Invalid signature"
3958
+ },
3959
+ "503": {
3960
+ "description": "Linear integration not configured"
3961
+ }
3962
+ }
3963
+ }
3964
+ },
3965
+ "/api/github/webhook": {
3966
+ "post": {
3967
+ "summary": "Handle GitHub webhook events",
3968
+ "tags": [
3969
+ "Webhooks"
3970
+ ],
3971
+ "responses": {
3972
+ "200": {
3973
+ "description": "Event processed"
3974
+ },
3975
+ "401": {
3976
+ "description": "Invalid signature"
3977
+ },
3978
+ "503": {
3979
+ "description": "GitHub integration not configured"
3980
+ }
3981
+ }
3982
+ }
3983
+ },
3984
+ "/api/gitlab/webhook": {
3985
+ "post": {
3986
+ "summary": "Handle GitLab webhook events",
3987
+ "tags": [
3988
+ "Webhooks"
3989
+ ],
3990
+ "responses": {
3991
+ "200": {
3992
+ "description": "Event processed"
3993
+ },
3994
+ "401": {
3995
+ "description": "Invalid token"
3996
+ },
3997
+ "503": {
3998
+ "description": "GitLab integration not configured"
3999
+ }
4000
+ }
4001
+ }
4002
+ },
4003
+ "/api/agentmail/webhook": {
4004
+ "post": {
4005
+ "summary": "Handle AgentMail webhook events",
4006
+ "tags": [
4007
+ "Webhooks"
4008
+ ],
4009
+ "responses": {
4010
+ "200": {
4011
+ "description": "Event received"
4012
+ },
4013
+ "401": {
4014
+ "description": "Invalid signature"
4015
+ },
4016
+ "503": {
4017
+ "description": "AgentMail integration not configured"
4018
+ }
4019
+ }
4020
+ }
4021
+ },
4022
+ "/api/workflows": {
4023
+ "get": {
4024
+ "summary": "List all workflows",
4025
+ "tags": [
4026
+ "Workflows"
4027
+ ],
4028
+ "security": [
4029
+ {
4030
+ "bearerAuth": []
4031
+ }
4032
+ ],
4033
+ "responses": {
4034
+ "200": {
4035
+ "description": "Workflow list"
4036
+ }
4037
+ }
4038
+ },
4039
+ "post": {
4040
+ "summary": "Create a new workflow",
4041
+ "tags": [
4042
+ "Workflows"
4043
+ ],
4044
+ "security": [
4045
+ {
4046
+ "bearerAuth": []
4047
+ }
4048
+ ],
4049
+ "requestBody": {
4050
+ "content": {
4051
+ "application/json": {
4052
+ "schema": {
4053
+ "type": "object",
4054
+ "properties": {
4055
+ "name": {
4056
+ "type": "string",
4057
+ "minLength": 1
4058
+ },
4059
+ "description": {
4060
+ "type": "string"
4061
+ },
4062
+ "definition": {
4063
+ "type": "object",
4064
+ "properties": {
4065
+ "nodes": {
4066
+ "type": "array",
4067
+ "items": {
4068
+ "type": "object",
4069
+ "properties": {
4070
+ "id": {
4071
+ "type": "string",
4072
+ "description": "Unique node identifier, used in 'next' and 'inputs' mappings"
4073
+ },
4074
+ "type": {
4075
+ "type": "string",
4076
+ "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
4077
+ },
4078
+ "label": {
4079
+ "type": "string",
4080
+ "description": "Human-readable label for UI display"
4081
+ },
4082
+ "config": {
4083
+ "type": "object",
4084
+ "additionalProperties": {},
4085
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
4086
+ },
4087
+ "next": {
4088
+ "anyOf": [
4089
+ {
4090
+ "type": "string"
4091
+ },
4092
+ {
4093
+ "type": "array",
4094
+ "items": {
4095
+ "type": "string"
4096
+ }
4097
+ },
4098
+ {
4099
+ "type": "object",
4100
+ "additionalProperties": {
4101
+ "type": "string"
4102
+ }
4103
+ }
4104
+ ],
4105
+ "description": "Next node(s): string for simple chaining, string[] for fan-out to parallel nodes, or record for port-based routing ({pass: 'a', fail: 'b'})"
4106
+ },
4107
+ "validation": {
4108
+ "type": "object",
4109
+ "properties": {
4110
+ "executor": {
4111
+ "type": "string",
4112
+ "default": "validate"
4113
+ },
4114
+ "config": {
4115
+ "type": "object",
4116
+ "additionalProperties": {}
4117
+ },
4118
+ "mustPass": {
4119
+ "type": "boolean",
4120
+ "default": false
4121
+ },
4122
+ "retry": {
4123
+ "type": "object",
4124
+ "properties": {
4125
+ "maxRetries": {
4126
+ "type": "integer",
4127
+ "minimum": 0,
4128
+ "default": 3
4129
+ },
4130
+ "strategy": {
4131
+ "type": "string",
4132
+ "enum": [
4133
+ "exponential",
4134
+ "static",
4135
+ "linear"
4136
+ ],
4137
+ "default": "exponential"
4138
+ },
4139
+ "baseDelayMs": {
4140
+ "type": "integer",
4141
+ "minimum": 0,
4142
+ "default": 1000
4143
+ },
4144
+ "maxDelayMs": {
4145
+ "type": "integer",
4146
+ "minimum": 0,
4147
+ "default": 60000
4148
+ }
4149
+ }
4150
+ }
4151
+ },
4152
+ "required": [
4153
+ "config"
4154
+ ]
4155
+ },
4156
+ "retry": {
4157
+ "type": "object",
4158
+ "properties": {
4159
+ "maxRetries": {
4160
+ "type": "integer",
4161
+ "minimum": 0,
4162
+ "default": 3
4163
+ },
4164
+ "strategy": {
4165
+ "type": "string",
4166
+ "enum": [
4167
+ "exponential",
4168
+ "static",
4169
+ "linear"
4170
+ ],
4171
+ "default": "exponential"
4172
+ },
4173
+ "baseDelayMs": {
4174
+ "type": "integer",
4175
+ "minimum": 0,
4176
+ "default": 1000
4177
+ },
4178
+ "maxDelayMs": {
4179
+ "type": "integer",
4180
+ "minimum": 0,
4181
+ "default": 60000
4182
+ }
4183
+ }
4184
+ },
4185
+ "inputs": {
4186
+ "type": "object",
4187
+ "additionalProperties": {
4188
+ "type": "string"
4189
+ },
4190
+ "description": "REQUIRED for cross-node data access. Maps local names to context paths. Without this, upstream step outputs are NOT available for interpolation — only 'trigger' and 'input' are. Example: { \"cityData\": \"generate-city\" } → use {{cityData.taskOutput.field}} in config templates. For trigger data: { \"pr\": \"trigger.pullRequest\" }."
4191
+ },
4192
+ "inputSchema": {
4193
+ "type": "object",
4194
+ "additionalProperties": {},
4195
+ "description": "JSON Schema to validate resolved inputs before execution"
4196
+ },
4197
+ "outputSchema": {
4198
+ "type": "object",
4199
+ "additionalProperties": {},
4200
+ "description": "JSON Schema to validate the executor's output (e.g. {taskId, taskOutput} for agent-task). Different from config.outputSchema which validates the agent's raw output."
4201
+ }
4202
+ },
4203
+ "required": [
4204
+ "id",
4205
+ "type",
4206
+ "config"
4207
+ ]
4208
+ },
4209
+ "minItems": 1
4210
+ },
4211
+ "onNodeFailure": {
4212
+ "type": "string",
4213
+ "enum": [
4214
+ "fail",
4215
+ "continue"
4216
+ ],
4217
+ "default": "fail",
4218
+ "description": "Behavior when a node's task fails or is cancelled. 'fail' (default): mark the entire run as failed. 'continue': treat the failed node as completed with error output and proceed — downstream convergence nodes receive '[FAILED: reason]' and can handle partial results."
4219
+ }
4220
+ },
4221
+ "required": [
4222
+ "nodes"
4223
+ ]
4224
+ },
4225
+ "triggers": {
4226
+ "type": "array",
4227
+ "items": {
4228
+ "oneOf": [
4229
+ {
4230
+ "type": "object",
4231
+ "properties": {
4232
+ "type": {
4233
+ "type": "string",
4234
+ "enum": [
4235
+ "webhook"
4236
+ ]
4237
+ },
4238
+ "hmacSecret": {
4239
+ "type": "string"
4240
+ },
4241
+ "hmacHeader": {
4242
+ "type": "string",
4243
+ "default": "X-Hub-Signature-256"
4244
+ }
4245
+ },
4246
+ "required": [
4247
+ "type"
4248
+ ]
4249
+ },
4250
+ {
4251
+ "type": "object",
4252
+ "properties": {
4253
+ "type": {
4254
+ "type": "string",
4255
+ "enum": [
4256
+ "schedule"
4257
+ ]
4258
+ },
4259
+ "scheduleId": {
4260
+ "type": "string",
4261
+ "format": "uuid"
4262
+ }
4263
+ },
4264
+ "required": [
4265
+ "type",
4266
+ "scheduleId"
4267
+ ]
4268
+ }
4269
+ ]
4270
+ }
4271
+ },
4272
+ "cooldown": {
4273
+ "type": "object",
4274
+ "properties": {
4275
+ "hours": {
4276
+ "type": "number",
4277
+ "minimum": 0
4278
+ },
4279
+ "minutes": {
4280
+ "type": "number",
4281
+ "minimum": 0
4282
+ },
4283
+ "seconds": {
4284
+ "type": "number",
4285
+ "minimum": 0
4286
+ }
4287
+ }
4288
+ },
4289
+ "input": {
4290
+ "type": "object",
4291
+ "additionalProperties": {
4292
+ "anyOf": [
4293
+ {
4294
+ "type": "string",
4295
+ "pattern": "^\\$\\{.+\\}$"
4296
+ },
4297
+ {
4298
+ "type": "string",
4299
+ "pattern": "^secret\\..+$"
4300
+ },
4301
+ {
4302
+ "type": "string"
4303
+ }
4304
+ ]
4305
+ }
4306
+ },
4307
+ "triggerSchema": {
4308
+ "type": "object",
4309
+ "additionalProperties": {}
4310
+ },
4311
+ "dir": {
4312
+ "type": "string",
4313
+ "minLength": 1
4314
+ },
4315
+ "vcsRepo": {
4316
+ "type": "string",
4317
+ "minLength": 1
4318
+ }
4319
+ },
4320
+ "required": [
4321
+ "name",
4322
+ "definition"
4323
+ ]
4324
+ }
4325
+ }
4326
+ }
4327
+ },
4328
+ "responses": {
4329
+ "201": {
4330
+ "description": "Workflow created"
4331
+ },
4332
+ "400": {
4333
+ "description": "Invalid definition"
4334
+ }
4335
+ }
4336
+ }
4337
+ },
4338
+ "/api/workflows/{id}": {
4339
+ "get": {
4340
+ "summary": "Get a workflow by ID",
4341
+ "tags": [
4342
+ "Workflows"
4343
+ ],
4344
+ "security": [
4345
+ {
4346
+ "bearerAuth": []
4347
+ }
4348
+ ],
4349
+ "parameters": [
4350
+ {
4351
+ "schema": {
4352
+ "type": "string"
4353
+ },
4354
+ "required": true,
4355
+ "name": "id",
4356
+ "in": "path"
4357
+ }
4358
+ ],
4359
+ "responses": {
4360
+ "200": {
4361
+ "description": "Workflow details with auto-generated edges"
4362
+ },
4363
+ "404": {
4364
+ "description": "Workflow not found"
4365
+ }
4366
+ }
4367
+ },
4368
+ "put": {
4369
+ "summary": "Update a workflow",
4370
+ "tags": [
4371
+ "Workflows"
4372
+ ],
4373
+ "security": [
4374
+ {
4375
+ "bearerAuth": []
4376
+ }
4377
+ ],
4378
+ "parameters": [
4379
+ {
4380
+ "schema": {
4381
+ "type": "string"
4382
+ },
4383
+ "required": true,
4384
+ "name": "id",
4385
+ "in": "path"
4386
+ }
4387
+ ],
4388
+ "requestBody": {
4389
+ "content": {
4390
+ "application/json": {
4391
+ "schema": {
4392
+ "type": "object",
4393
+ "properties": {
4394
+ "name": {
4395
+ "type": "string"
4396
+ },
4397
+ "description": {
4398
+ "type": "string"
4399
+ },
4400
+ "definition": {
4401
+ "type": "object",
4402
+ "properties": {
4403
+ "nodes": {
4404
+ "type": "array",
4405
+ "items": {
4406
+ "type": "object",
4407
+ "properties": {
4408
+ "id": {
4409
+ "type": "string",
4410
+ "description": "Unique node identifier, used in 'next' and 'inputs' mappings"
4411
+ },
4412
+ "type": {
4413
+ "type": "string",
4414
+ "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
4415
+ },
4416
+ "label": {
4417
+ "type": "string",
4418
+ "description": "Human-readable label for UI display"
4419
+ },
4420
+ "config": {
4421
+ "type": "object",
4422
+ "additionalProperties": {},
4423
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
4424
+ },
4425
+ "next": {
4426
+ "anyOf": [
4427
+ {
4428
+ "type": "string"
4429
+ },
4430
+ {
4431
+ "type": "array",
4432
+ "items": {
4433
+ "type": "string"
4434
+ }
4435
+ },
4436
+ {
4437
+ "type": "object",
4438
+ "additionalProperties": {
4439
+ "type": "string"
4440
+ }
4441
+ }
4442
+ ],
4443
+ "description": "Next node(s): string for simple chaining, string[] for fan-out to parallel nodes, or record for port-based routing ({pass: 'a', fail: 'b'})"
4444
+ },
4445
+ "validation": {
4446
+ "type": "object",
4447
+ "properties": {
4448
+ "executor": {
4449
+ "type": "string",
4450
+ "default": "validate"
4451
+ },
4452
+ "config": {
4453
+ "type": "object",
4454
+ "additionalProperties": {}
4455
+ },
4456
+ "mustPass": {
4457
+ "type": "boolean",
4458
+ "default": false
4459
+ },
4460
+ "retry": {
4461
+ "type": "object",
4462
+ "properties": {
4463
+ "maxRetries": {
4464
+ "type": "integer",
4465
+ "minimum": 0,
4466
+ "default": 3
4467
+ },
4468
+ "strategy": {
4469
+ "type": "string",
4470
+ "enum": [
4471
+ "exponential",
4472
+ "static",
4473
+ "linear"
4474
+ ],
4475
+ "default": "exponential"
4476
+ },
4477
+ "baseDelayMs": {
4478
+ "type": "integer",
4479
+ "minimum": 0,
4480
+ "default": 1000
4481
+ },
4482
+ "maxDelayMs": {
4483
+ "type": "integer",
4484
+ "minimum": 0,
4485
+ "default": 60000
4486
+ }
4487
+ }
4488
+ }
4489
+ },
4490
+ "required": [
4491
+ "config"
4492
+ ]
4493
+ },
4494
+ "retry": {
4495
+ "type": "object",
4496
+ "properties": {
4497
+ "maxRetries": {
4498
+ "type": "integer",
4499
+ "minimum": 0,
4500
+ "default": 3
4501
+ },
4502
+ "strategy": {
4503
+ "type": "string",
4504
+ "enum": [
4505
+ "exponential",
4506
+ "static",
4507
+ "linear"
4508
+ ],
4509
+ "default": "exponential"
4510
+ },
4511
+ "baseDelayMs": {
4512
+ "type": "integer",
4513
+ "minimum": 0,
4514
+ "default": 1000
4515
+ },
4516
+ "maxDelayMs": {
4517
+ "type": "integer",
4518
+ "minimum": 0,
4519
+ "default": 60000
4520
+ }
4521
+ }
4522
+ },
4523
+ "inputs": {
4524
+ "type": "object",
4525
+ "additionalProperties": {
4526
+ "type": "string"
4527
+ },
4528
+ "description": "REQUIRED for cross-node data access. Maps local names to context paths. Without this, upstream step outputs are NOT available for interpolation — only 'trigger' and 'input' are. Example: { \"cityData\": \"generate-city\" } → use {{cityData.taskOutput.field}} in config templates. For trigger data: { \"pr\": \"trigger.pullRequest\" }."
4529
+ },
4530
+ "inputSchema": {
4531
+ "type": "object",
4532
+ "additionalProperties": {},
4533
+ "description": "JSON Schema to validate resolved inputs before execution"
4534
+ },
4535
+ "outputSchema": {
4536
+ "type": "object",
4537
+ "additionalProperties": {},
4538
+ "description": "JSON Schema to validate the executor's output (e.g. {taskId, taskOutput} for agent-task). Different from config.outputSchema which validates the agent's raw output."
4539
+ }
4540
+ },
4541
+ "required": [
4542
+ "id",
4543
+ "type",
4544
+ "config"
4545
+ ]
4546
+ },
4547
+ "minItems": 1
4548
+ },
4549
+ "onNodeFailure": {
4550
+ "type": "string",
4551
+ "enum": [
4552
+ "fail",
4553
+ "continue"
4554
+ ],
4555
+ "default": "fail",
4556
+ "description": "Behavior when a node's task fails or is cancelled. 'fail' (default): mark the entire run as failed. 'continue': treat the failed node as completed with error output and proceed — downstream convergence nodes receive '[FAILED: reason]' and can handle partial results."
4557
+ }
4558
+ },
4559
+ "required": [
4560
+ "nodes"
4561
+ ]
4562
+ },
4563
+ "triggers": {
4564
+ "type": "array",
4565
+ "items": {
4566
+ "oneOf": [
4567
+ {
4568
+ "type": "object",
4569
+ "properties": {
4570
+ "type": {
4571
+ "type": "string",
4572
+ "enum": [
4573
+ "webhook"
4574
+ ]
4575
+ },
4576
+ "hmacSecret": {
4577
+ "type": "string"
4578
+ },
4579
+ "hmacHeader": {
4580
+ "type": "string",
4581
+ "default": "X-Hub-Signature-256"
4582
+ }
4583
+ },
4584
+ "required": [
4585
+ "type"
4586
+ ]
4587
+ },
4588
+ {
4589
+ "type": "object",
4590
+ "properties": {
4591
+ "type": {
4592
+ "type": "string",
4593
+ "enum": [
4594
+ "schedule"
4595
+ ]
4596
+ },
4597
+ "scheduleId": {
4598
+ "type": "string",
4599
+ "format": "uuid"
4600
+ }
4601
+ },
4602
+ "required": [
4603
+ "type",
4604
+ "scheduleId"
4605
+ ]
4606
+ }
4607
+ ]
4608
+ }
4609
+ },
4610
+ "cooldown": {
4611
+ "type": [
4612
+ "object",
4613
+ "null"
4614
+ ],
4615
+ "properties": {
4616
+ "hours": {
4617
+ "type": "number",
4618
+ "minimum": 0
4619
+ },
4620
+ "minutes": {
4621
+ "type": "number",
4622
+ "minimum": 0
4623
+ },
4624
+ "seconds": {
4625
+ "type": "number",
4626
+ "minimum": 0
4627
+ }
4628
+ }
4629
+ },
4630
+ "input": {
4631
+ "type": [
4632
+ "object",
4633
+ "null"
4634
+ ],
4635
+ "additionalProperties": {
4636
+ "anyOf": [
4637
+ {
4638
+ "type": "string",
4639
+ "pattern": "^\\$\\{.+\\}$"
4640
+ },
4641
+ {
4642
+ "type": "string",
4643
+ "pattern": "^secret\\..+$"
4644
+ },
4645
+ {
4646
+ "type": "string"
4647
+ }
4648
+ ]
4649
+ }
4650
+ },
4651
+ "triggerSchema": {
4652
+ "type": [
4653
+ "object",
4654
+ "null"
4655
+ ],
4656
+ "additionalProperties": {}
4657
+ },
4658
+ "dir": {
4659
+ "type": [
4660
+ "string",
4661
+ "null"
4662
+ ],
4663
+ "minLength": 1
4664
+ },
4665
+ "vcsRepo": {
4666
+ "type": [
4667
+ "string",
4668
+ "null"
4669
+ ],
4670
+ "minLength": 1
4671
+ },
4672
+ "enabled": {
4673
+ "type": "boolean"
4674
+ }
4675
+ }
4676
+ }
4677
+ }
4678
+ }
4679
+ },
4680
+ "responses": {
4681
+ "200": {
4682
+ "description": "Workflow updated (version snapshot created)"
4683
+ },
4684
+ "400": {
4685
+ "description": "Invalid definition"
4686
+ },
4687
+ "404": {
4688
+ "description": "Workflow not found"
4689
+ }
4690
+ }
4691
+ },
4692
+ "delete": {
4693
+ "summary": "Delete a workflow",
4694
+ "tags": [
4695
+ "Workflows"
4696
+ ],
4697
+ "security": [
4698
+ {
4699
+ "bearerAuth": []
4700
+ }
4701
+ ],
4702
+ "parameters": [
4703
+ {
4704
+ "schema": {
4705
+ "type": "string"
4706
+ },
4707
+ "required": true,
4708
+ "name": "id",
4709
+ "in": "path"
4710
+ }
4711
+ ],
4712
+ "responses": {
4713
+ "204": {
4714
+ "description": "Workflow deleted"
4715
+ },
4716
+ "404": {
4717
+ "description": "Workflow not found"
4718
+ }
4719
+ }
4720
+ }
4721
+ },
4722
+ "/api/workflows/{id}/trigger": {
4723
+ "post": {
4724
+ "summary": "Trigger a workflow execution",
4725
+ "tags": [
4726
+ "Workflows"
4727
+ ],
4728
+ "security": [
4729
+ {
4730
+ "bearerAuth": []
4731
+ }
4732
+ ],
4733
+ "parameters": [
4734
+ {
4735
+ "schema": {
4736
+ "type": "string"
4737
+ },
4738
+ "required": true,
4739
+ "name": "id",
4740
+ "in": "path"
4741
+ }
4742
+ ],
4743
+ "responses": {
4744
+ "201": {
4745
+ "description": "Workflow run started (or skipped if cooldown active)"
4746
+ },
4747
+ "400": {
4748
+ "description": "Workflow is disabled"
4749
+ },
4750
+ "401": {
4751
+ "description": "Unauthorized"
4752
+ },
4753
+ "404": {
4754
+ "description": "Workflow not found"
4755
+ }
4756
+ }
4757
+ }
4758
+ },
4759
+ "/api/workflows/{id}/runs": {
4760
+ "get": {
4761
+ "summary": "List runs for a workflow",
4762
+ "tags": [
4763
+ "Workflows"
4764
+ ],
4765
+ "security": [
4766
+ {
4767
+ "bearerAuth": []
4768
+ }
4769
+ ],
4770
+ "parameters": [
4771
+ {
4772
+ "schema": {
4773
+ "type": "string"
4774
+ },
4775
+ "required": true,
4776
+ "name": "id",
4777
+ "in": "path"
4778
+ },
4779
+ {
4780
+ "schema": {
4781
+ "type": "string",
4782
+ "enum": [
4783
+ "running",
4784
+ "waiting",
4785
+ "completed",
4786
+ "failed",
4787
+ "skipped"
4788
+ ]
4789
+ },
4790
+ "required": false,
4791
+ "name": "status",
4792
+ "in": "query"
4793
+ }
4794
+ ],
4795
+ "responses": {
4796
+ "200": {
4797
+ "description": "Workflow run list"
4798
+ }
4799
+ }
4800
+ }
4801
+ },
4802
+ "/api/workflow-runs/{id}": {
4803
+ "get": {
4804
+ "summary": "Get a workflow run with steps (includes retry columns)",
4805
+ "tags": [
4806
+ "Workflows"
4807
+ ],
4808
+ "security": [
4809
+ {
4810
+ "bearerAuth": []
4811
+ }
4812
+ ],
4813
+ "parameters": [
4814
+ {
4815
+ "schema": {
4816
+ "type": "string"
4817
+ },
4818
+ "required": true,
4819
+ "name": "id",
4820
+ "in": "path"
4821
+ }
4822
+ ],
4823
+ "responses": {
4824
+ "200": {
4825
+ "description": "Workflow run details with steps including retry info"
4826
+ },
4827
+ "404": {
4828
+ "description": "Run not found"
4829
+ }
4830
+ }
4831
+ }
4832
+ },
4833
+ "/api/workflow-runs/{id}/retry": {
4834
+ "post": {
4835
+ "summary": "Retry a failed workflow run",
4836
+ "tags": [
4837
+ "Workflows"
4838
+ ],
4839
+ "security": [
4840
+ {
4841
+ "bearerAuth": []
4842
+ }
4843
+ ],
4844
+ "parameters": [
4845
+ {
4846
+ "schema": {
4847
+ "type": "string"
4848
+ },
4849
+ "required": true,
4850
+ "name": "id",
4851
+ "in": "path"
4852
+ }
4853
+ ],
4854
+ "responses": {
4855
+ "200": {
4856
+ "description": "Retry started"
4857
+ },
4858
+ "400": {
4859
+ "description": "Cannot retry"
4860
+ }
4861
+ }
4862
+ }
4863
+ },
4864
+ "/api/executor-types": {
4865
+ "get": {
4866
+ "summary": "List all executor types with their config and output schemas",
4867
+ "tags": [
4868
+ "Workflows"
4869
+ ],
4870
+ "security": [
4871
+ {
4872
+ "bearerAuth": []
4873
+ }
4874
+ ],
4875
+ "responses": {
4876
+ "200": {
4877
+ "description": "List of executor types with schemas"
4878
+ }
4879
+ }
4880
+ }
4881
+ },
4882
+ "/api/executor-types/{type}": {
4883
+ "get": {
4884
+ "summary": "Get a specific executor type with its schemas",
4885
+ "tags": [
4886
+ "Workflows"
4887
+ ],
4888
+ "security": [
4889
+ {
4890
+ "bearerAuth": []
4891
+ }
4892
+ ],
4893
+ "parameters": [
4894
+ {
4895
+ "schema": {
4896
+ "type": "string"
4897
+ },
4898
+ "required": true,
4899
+ "name": "type",
4900
+ "in": "path"
4901
+ }
4902
+ ],
4903
+ "responses": {
4904
+ "200": {
4905
+ "description": "Executor type details"
4906
+ },
4907
+ "404": {
4908
+ "description": "Executor type not found"
4909
+ }
4910
+ }
4911
+ }
4912
+ },
4913
+ "/api/webhooks/{workflowId}": {
4914
+ "post": {
4915
+ "summary": "Trigger workflow via webhook",
4916
+ "tags": [
4917
+ "Webhooks"
4918
+ ],
4919
+ "parameters": [
4920
+ {
4921
+ "schema": {
4922
+ "type": "string"
4923
+ },
4924
+ "required": true,
4925
+ "name": "workflowId",
4926
+ "in": "path"
4927
+ }
4928
+ ],
4929
+ "responses": {
4930
+ "201": {
4931
+ "description": "Webhook processed"
4932
+ },
4933
+ "401": {
4934
+ "description": "Invalid signature"
4935
+ },
4936
+ "404": {
4937
+ "description": "Workflow not found"
4938
+ }
4939
+ }
4940
+ }
4941
+ },
4942
+ "/api/workflows/{id}/versions": {
4943
+ "get": {
4944
+ "summary": "List version history for a workflow",
4945
+ "tags": [
4946
+ "Workflows"
4947
+ ],
4948
+ "security": [
4949
+ {
4950
+ "bearerAuth": []
4951
+ }
4952
+ ],
4953
+ "parameters": [
4954
+ {
4955
+ "schema": {
4956
+ "type": "string"
4957
+ },
4958
+ "required": true,
4959
+ "name": "id",
4960
+ "in": "path"
4961
+ }
4962
+ ],
4963
+ "responses": {
4964
+ "200": {
4965
+ "description": "Version list (newest first)"
4966
+ },
4967
+ "404": {
4968
+ "description": "Workflow not found"
4969
+ }
4970
+ }
4971
+ }
4972
+ },
4973
+ "/api/workflows/{id}/versions/{version}": {
4974
+ "get": {
4975
+ "summary": "Get a specific version snapshot of a workflow",
4976
+ "tags": [
4977
+ "Workflows"
4978
+ ],
4979
+ "security": [
4980
+ {
4981
+ "bearerAuth": []
4982
+ }
4983
+ ],
4984
+ "parameters": [
4985
+ {
4986
+ "schema": {
4987
+ "type": "string"
4988
+ },
4989
+ "required": true,
4990
+ "name": "id",
4991
+ "in": "path"
4992
+ },
4993
+ {
4994
+ "schema": {
4995
+ "type": "integer",
4996
+ "minimum": 1
4997
+ },
4998
+ "required": true,
4999
+ "name": "version",
5000
+ "in": "path"
5001
+ }
5002
+ ],
5003
+ "responses": {
5004
+ "200": {
5005
+ "description": "Version snapshot"
5006
+ },
5007
+ "404": {
5008
+ "description": "Version not found"
5009
+ }
5010
+ }
5011
+ }
5012
+ }
5013
+ },
5014
+ "webhooks": {}
5015
+ }