@desplega.ai/agent-swarm 1.20.0 → 1.49.0

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