@aion0/forge 0.5.26 → 0.5.28

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 (255) hide show
  1. package/.forge/worktrees/pipeline-4dd8dc2d/CLAUDE.md +86 -0
  2. package/.forge/worktrees/pipeline-4dd8dc2d/README.md +136 -0
  3. package/.forge/worktrees/pipeline-4dd8dc2d/RELEASE_NOTES.md +36 -0
  4. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/agents/route.ts +17 -0
  5. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/auth/[...nextauth]/route.ts +3 -0
  6. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/auth/verify/route.ts +46 -0
  7. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude/[id]/route.ts +31 -0
  8. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude/[id]/stream/route.ts +63 -0
  9. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude/route.ts +28 -0
  10. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude-sessions/[projectName]/entries/route.ts +23 -0
  11. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude-sessions/[projectName]/live/route.ts +72 -0
  12. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude-sessions/[projectName]/route.ts +37 -0
  13. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude-sessions/sync/route.ts +17 -0
  14. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/claude-templates/route.ts +145 -0
  15. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/code/route.ts +299 -0
  16. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/delivery/[id]/route.ts +62 -0
  17. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/delivery/route.ts +40 -0
  18. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/detect-cli/route.ts +46 -0
  19. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/docs/route.ts +176 -0
  20. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/docs/sessions/route.ts +54 -0
  21. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/favorites/route.ts +26 -0
  22. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/flows/route.ts +6 -0
  23. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/flows/run/route.ts +19 -0
  24. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/git/route.ts +149 -0
  25. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/help/route.ts +84 -0
  26. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/issue-scanner/route.ts +116 -0
  27. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/logs/route.ts +100 -0
  28. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/mobile-chat/route.ts +115 -0
  29. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/monitor/route.ts +74 -0
  30. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/notifications/route.ts +42 -0
  31. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/notify/test/route.ts +33 -0
  32. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/online/route.ts +40 -0
  33. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/pipelines/[id]/route.ts +41 -0
  34. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/pipelines/route.ts +90 -0
  35. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/plugins/route.ts +75 -0
  36. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/preview/[...path]/route.ts +64 -0
  37. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/preview/route.ts +156 -0
  38. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/project-pipelines/route.ts +91 -0
  39. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/project-sessions/route.ts +61 -0
  40. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/projects/route.ts +26 -0
  41. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/sessions/[id]/chat/route.ts +64 -0
  42. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/sessions/[id]/messages/route.ts +9 -0
  43. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/sessions/[id]/route.ts +17 -0
  44. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/sessions/route.ts +20 -0
  45. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/settings/route.ts +64 -0
  46. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/skills/local/route.ts +228 -0
  47. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/skills/route.ts +182 -0
  48. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/smith-templates/route.ts +81 -0
  49. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/status/route.ts +12 -0
  50. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tabs/route.ts +25 -0
  51. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tasks/[id]/route.ts +51 -0
  52. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tasks/[id]/stream/route.ts +77 -0
  53. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tasks/link/route.ts +37 -0
  54. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tasks/route.ts +44 -0
  55. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tasks/session/route.ts +14 -0
  56. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/telegram/route.ts +23 -0
  57. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/templates/route.ts +6 -0
  58. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/terminal-bell/route.ts +39 -0
  59. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/terminal-cwd/route.ts +19 -0
  60. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/terminal-state/route.ts +15 -0
  61. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/tunnel/route.ts +26 -0
  62. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/upgrade/route.ts +43 -0
  63. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/usage/route.ts +20 -0
  64. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/version/route.ts +78 -0
  65. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/watchers/route.ts +33 -0
  66. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/workspace/[id]/agents/route.ts +35 -0
  67. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/workspace/[id]/memory/route.ts +23 -0
  68. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/workspace/[id]/smith/route.ts +22 -0
  69. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/workspace/[id]/stream/route.ts +31 -0
  70. package/.forge/worktrees/pipeline-4dd8dc2d/app/api/workspace/route.ts +79 -0
  71. package/.forge/worktrees/pipeline-4dd8dc2d/app/global-error.tsx +21 -0
  72. package/.forge/worktrees/pipeline-4dd8dc2d/app/globals.css +52 -0
  73. package/.forge/worktrees/pipeline-4dd8dc2d/app/icon.ico +0 -0
  74. package/.forge/worktrees/pipeline-4dd8dc2d/app/icon.png +0 -0
  75. package/.forge/worktrees/pipeline-4dd8dc2d/app/icon.svg +106 -0
  76. package/.forge/worktrees/pipeline-4dd8dc2d/app/layout.tsx +17 -0
  77. package/.forge/worktrees/pipeline-4dd8dc2d/app/login/LoginForm.tsx +96 -0
  78. package/.forge/worktrees/pipeline-4dd8dc2d/app/login/page.tsx +10 -0
  79. package/.forge/worktrees/pipeline-4dd8dc2d/app/mobile/page.tsx +10 -0
  80. package/.forge/worktrees/pipeline-4dd8dc2d/app/page.tsx +22 -0
  81. package/.forge/worktrees/pipeline-4dd8dc2d/bin/forge-server.mjs +484 -0
  82. package/.forge/worktrees/pipeline-4dd8dc2d/check-forge-status.sh +71 -0
  83. package/.forge/worktrees/pipeline-4dd8dc2d/cli/mw.ts +579 -0
  84. package/.forge/worktrees/pipeline-4dd8dc2d/components/BrowserPanel.tsx +175 -0
  85. package/.forge/worktrees/pipeline-4dd8dc2d/components/ChatPanel.tsx +191 -0
  86. package/.forge/worktrees/pipeline-4dd8dc2d/components/ClaudeTerminal.tsx +267 -0
  87. package/.forge/worktrees/pipeline-4dd8dc2d/components/CodeViewer.tsx +787 -0
  88. package/.forge/worktrees/pipeline-4dd8dc2d/components/ConversationEditor.tsx +411 -0
  89. package/.forge/worktrees/pipeline-4dd8dc2d/components/ConversationGraphView.tsx +347 -0
  90. package/.forge/worktrees/pipeline-4dd8dc2d/components/ConversationTerminalView.tsx +303 -0
  91. package/.forge/worktrees/pipeline-4dd8dc2d/components/Dashboard.tsx +807 -0
  92. package/.forge/worktrees/pipeline-4dd8dc2d/components/DashboardWrapper.tsx +9 -0
  93. package/.forge/worktrees/pipeline-4dd8dc2d/components/DeliveryFlowEditor.tsx +491 -0
  94. package/.forge/worktrees/pipeline-4dd8dc2d/components/DeliveryList.tsx +230 -0
  95. package/.forge/worktrees/pipeline-4dd8dc2d/components/DeliveryWorkspace.tsx +589 -0
  96. package/.forge/worktrees/pipeline-4dd8dc2d/components/DocTerminal.tsx +187 -0
  97. package/.forge/worktrees/pipeline-4dd8dc2d/components/DocsViewer.tsx +574 -0
  98. package/.forge/worktrees/pipeline-4dd8dc2d/components/HelpDialog.tsx +169 -0
  99. package/.forge/worktrees/pipeline-4dd8dc2d/components/HelpTerminal.tsx +141 -0
  100. package/.forge/worktrees/pipeline-4dd8dc2d/components/InlinePipelineView.tsx +111 -0
  101. package/.forge/worktrees/pipeline-4dd8dc2d/components/LogViewer.tsx +194 -0
  102. package/.forge/worktrees/pipeline-4dd8dc2d/components/MarkdownContent.tsx +73 -0
  103. package/.forge/worktrees/pipeline-4dd8dc2d/components/MobileView.tsx +385 -0
  104. package/.forge/worktrees/pipeline-4dd8dc2d/components/MonitorPanel.tsx +122 -0
  105. package/.forge/worktrees/pipeline-4dd8dc2d/components/NewSessionModal.tsx +93 -0
  106. package/.forge/worktrees/pipeline-4dd8dc2d/components/NewTaskModal.tsx +492 -0
  107. package/.forge/worktrees/pipeline-4dd8dc2d/components/PipelineEditor.tsx +570 -0
  108. package/.forge/worktrees/pipeline-4dd8dc2d/components/PipelineView.tsx +1018 -0
  109. package/.forge/worktrees/pipeline-4dd8dc2d/components/PluginsPanel.tsx +472 -0
  110. package/.forge/worktrees/pipeline-4dd8dc2d/components/ProjectDetail.tsx +1618 -0
  111. package/.forge/worktrees/pipeline-4dd8dc2d/components/ProjectList.tsx +108 -0
  112. package/.forge/worktrees/pipeline-4dd8dc2d/components/ProjectManager.tsx +401 -0
  113. package/.forge/worktrees/pipeline-4dd8dc2d/components/SessionList.tsx +74 -0
  114. package/.forge/worktrees/pipeline-4dd8dc2d/components/SessionView.tsx +726 -0
  115. package/.forge/worktrees/pipeline-4dd8dc2d/components/SettingsModal.tsx +1647 -0
  116. package/.forge/worktrees/pipeline-4dd8dc2d/components/SkillsPanel.tsx +969 -0
  117. package/.forge/worktrees/pipeline-4dd8dc2d/components/StatusBar.tsx +99 -0
  118. package/.forge/worktrees/pipeline-4dd8dc2d/components/TabBar.tsx +46 -0
  119. package/.forge/worktrees/pipeline-4dd8dc2d/components/TaskBoard.tsx +113 -0
  120. package/.forge/worktrees/pipeline-4dd8dc2d/components/TaskDetail.tsx +372 -0
  121. package/.forge/worktrees/pipeline-4dd8dc2d/components/TerminalLauncher.tsx +398 -0
  122. package/.forge/worktrees/pipeline-4dd8dc2d/components/TunnelToggle.tsx +206 -0
  123. package/.forge/worktrees/pipeline-4dd8dc2d/components/UsagePanel.tsx +207 -0
  124. package/.forge/worktrees/pipeline-4dd8dc2d/components/WebTerminal.tsx +1743 -0
  125. package/.forge/worktrees/pipeline-4dd8dc2d/components/WorkspaceTree.tsx +221 -0
  126. package/.forge/worktrees/pipeline-4dd8dc2d/components/WorkspaceView.tsx +4048 -0
  127. package/.forge/worktrees/pipeline-4dd8dc2d/dev-test.sh +5 -0
  128. package/.forge/worktrees/pipeline-4dd8dc2d/docs/Forge_Memory_Layer_Design.docx +0 -0
  129. package/.forge/worktrees/pipeline-4dd8dc2d/docs/Forge_Strategy_Research_2026.docx +0 -0
  130. package/.forge/worktrees/pipeline-4dd8dc2d/docs/LOCAL-DEPLOY.md +144 -0
  131. package/.forge/worktrees/pipeline-4dd8dc2d/docs/roadmap-multi-agent-workflow.md +330 -0
  132. package/.forge/worktrees/pipeline-4dd8dc2d/forge-logo.png +0 -0
  133. package/.forge/worktrees/pipeline-4dd8dc2d/forge-logo.svg +106 -0
  134. package/.forge/worktrees/pipeline-4dd8dc2d/hooks/useSidebarResize.ts +52 -0
  135. package/.forge/worktrees/pipeline-4dd8dc2d/install.sh +29 -0
  136. package/.forge/worktrees/pipeline-4dd8dc2d/instrumentation.ts +35 -0
  137. package/.forge/worktrees/pipeline-4dd8dc2d/lib/agents/claude-adapter.ts +104 -0
  138. package/.forge/worktrees/pipeline-4dd8dc2d/lib/agents/generic-adapter.ts +64 -0
  139. package/.forge/worktrees/pipeline-4dd8dc2d/lib/agents/index.ts +245 -0
  140. package/.forge/worktrees/pipeline-4dd8dc2d/lib/agents/types.ts +70 -0
  141. package/.forge/worktrees/pipeline-4dd8dc2d/lib/artifacts.ts +106 -0
  142. package/.forge/worktrees/pipeline-4dd8dc2d/lib/auth.ts +62 -0
  143. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/docker.yaml +70 -0
  144. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/http.yaml +66 -0
  145. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/jenkins.yaml +92 -0
  146. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/llm-vision.yaml +85 -0
  147. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/playwright.yaml +111 -0
  148. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/shell-command.yaml +60 -0
  149. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/slack.yaml +48 -0
  150. package/.forge/worktrees/pipeline-4dd8dc2d/lib/builtin-plugins/webhook.yaml +56 -0
  151. package/.forge/worktrees/pipeline-4dd8dc2d/lib/claude-process.ts +361 -0
  152. package/.forge/worktrees/pipeline-4dd8dc2d/lib/claude-sessions.ts +266 -0
  153. package/.forge/worktrees/pipeline-4dd8dc2d/lib/claude-templates.ts +227 -0
  154. package/.forge/worktrees/pipeline-4dd8dc2d/lib/cloudflared.ts +424 -0
  155. package/.forge/worktrees/pipeline-4dd8dc2d/lib/crypto.ts +67 -0
  156. package/.forge/worktrees/pipeline-4dd8dc2d/lib/delivery.ts +787 -0
  157. package/.forge/worktrees/pipeline-4dd8dc2d/lib/dirs.ts +99 -0
  158. package/.forge/worktrees/pipeline-4dd8dc2d/lib/flows.ts +86 -0
  159. package/.forge/worktrees/pipeline-4dd8dc2d/lib/forge-mcp-server.ts +732 -0
  160. package/.forge/worktrees/pipeline-4dd8dc2d/lib/forge-skills/forge-inbox.md +38 -0
  161. package/.forge/worktrees/pipeline-4dd8dc2d/lib/forge-skills/forge-send.md +47 -0
  162. package/.forge/worktrees/pipeline-4dd8dc2d/lib/forge-skills/forge-status.md +32 -0
  163. package/.forge/worktrees/pipeline-4dd8dc2d/lib/forge-skills/forge-workspace-sync.md +37 -0
  164. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/00-overview.md +40 -0
  165. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/01-settings.md +194 -0
  166. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/02-telegram.md +41 -0
  167. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/03-tunnel.md +31 -0
  168. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/04-tasks.md +52 -0
  169. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/05-pipelines.md +460 -0
  170. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/06-skills.md +43 -0
  171. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/07-projects.md +73 -0
  172. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/08-rules.md +53 -0
  173. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/09-issue-autofix.md +55 -0
  174. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/10-troubleshooting.md +89 -0
  175. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/11-workspace.md +810 -0
  176. package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/CLAUDE.md +62 -0
  177. package/.forge/worktrees/pipeline-4dd8dc2d/lib/init.ts +266 -0
  178. package/.forge/worktrees/pipeline-4dd8dc2d/lib/issue-scanner.ts +298 -0
  179. package/.forge/worktrees/pipeline-4dd8dc2d/lib/logger.ts +79 -0
  180. package/.forge/worktrees/pipeline-4dd8dc2d/lib/notifications.ts +75 -0
  181. package/.forge/worktrees/pipeline-4dd8dc2d/lib/notify.ts +108 -0
  182. package/.forge/worktrees/pipeline-4dd8dc2d/lib/password.ts +97 -0
  183. package/.forge/worktrees/pipeline-4dd8dc2d/lib/pipeline-scheduler.ts +373 -0
  184. package/.forge/worktrees/pipeline-4dd8dc2d/lib/pipeline.ts +1565 -0
  185. package/.forge/worktrees/pipeline-4dd8dc2d/lib/plugins/executor.ts +347 -0
  186. package/.forge/worktrees/pipeline-4dd8dc2d/lib/plugins/registry.ts +228 -0
  187. package/.forge/worktrees/pipeline-4dd8dc2d/lib/plugins/types.ts +103 -0
  188. package/.forge/worktrees/pipeline-4dd8dc2d/lib/project-sessions.ts +53 -0
  189. package/.forge/worktrees/pipeline-4dd8dc2d/lib/projects.ts +86 -0
  190. package/.forge/worktrees/pipeline-4dd8dc2d/lib/session-manager.ts +156 -0
  191. package/.forge/worktrees/pipeline-4dd8dc2d/lib/session-utils.ts +53 -0
  192. package/.forge/worktrees/pipeline-4dd8dc2d/lib/session-watcher.ts +345 -0
  193. package/.forge/worktrees/pipeline-4dd8dc2d/lib/settings.ts +195 -0
  194. package/.forge/worktrees/pipeline-4dd8dc2d/lib/skills.ts +458 -0
  195. package/.forge/worktrees/pipeline-4dd8dc2d/lib/task-manager.ts +951 -0
  196. package/.forge/worktrees/pipeline-4dd8dc2d/lib/telegram-bot.ts +1477 -0
  197. package/.forge/worktrees/pipeline-4dd8dc2d/lib/telegram-standalone.ts +83 -0
  198. package/.forge/worktrees/pipeline-4dd8dc2d/lib/terminal-server.ts +70 -0
  199. package/.forge/worktrees/pipeline-4dd8dc2d/lib/terminal-standalone.ts +438 -0
  200. package/.forge/worktrees/pipeline-4dd8dc2d/lib/usage-scanner.ts +249 -0
  201. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/__tests__/state-machine.test.ts +388 -0
  202. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/__tests__/workspace.test.ts +311 -0
  203. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/agent-bus.ts +416 -0
  204. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/agent-worker.ts +655 -0
  205. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/backends/api-backend.ts +262 -0
  206. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/backends/cli-backend.ts +491 -0
  207. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/index.ts +84 -0
  208. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/manager.ts +136 -0
  209. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/orchestrator.ts +3415 -0
  210. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/persistence.ts +309 -0
  211. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/presets.ts +649 -0
  212. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/requests.ts +287 -0
  213. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/session-monitor.ts +240 -0
  214. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/skill-installer.ts +275 -0
  215. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/smith-memory.ts +498 -0
  216. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/types.ts +241 -0
  217. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace/watch-manager.ts +560 -0
  218. package/.forge/worktrees/pipeline-4dd8dc2d/lib/workspace-standalone.ts +978 -0
  219. package/.forge/worktrees/pipeline-4dd8dc2d/middleware.ts +51 -0
  220. package/.forge/worktrees/pipeline-4dd8dc2d/next.config.ts +26 -0
  221. package/.forge/worktrees/pipeline-4dd8dc2d/package.json +74 -0
  222. package/.forge/worktrees/pipeline-4dd8dc2d/pnpm-lock.yaml +3719 -0
  223. package/.forge/worktrees/pipeline-4dd8dc2d/pnpm-workspace.yaml +1 -0
  224. package/.forge/worktrees/pipeline-4dd8dc2d/postcss.config.mjs +7 -0
  225. package/.forge/worktrees/pipeline-4dd8dc2d/publish.sh +133 -0
  226. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/README.md +66 -0
  227. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/results/.gitignore +2 -0
  228. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/run.ts +635 -0
  229. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/01-text-utils/task.md +26 -0
  230. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/01-text-utils/validator.sh +46 -0
  231. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/02-pagination/setup.sh +19 -0
  232. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/02-pagination/task.md +48 -0
  233. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/02-pagination/validator.sh +69 -0
  234. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/03-bug-fix/setup.sh +82 -0
  235. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/03-bug-fix/task.md +30 -0
  236. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/bench/tasks/03-bug-fix/validator.sh +29 -0
  237. package/.forge/worktrees/pipeline-4dd8dc2d/scripts/verify-usage.ts +178 -0
  238. package/.forge/worktrees/pipeline-4dd8dc2d/src/config/index.ts +129 -0
  239. package/.forge/worktrees/pipeline-4dd8dc2d/src/core/db/database.ts +259 -0
  240. package/.forge/worktrees/pipeline-4dd8dc2d/src/core/memory/strategy.ts +32 -0
  241. package/.forge/worktrees/pipeline-4dd8dc2d/src/core/providers/chat.ts +65 -0
  242. package/.forge/worktrees/pipeline-4dd8dc2d/src/core/providers/registry.ts +60 -0
  243. package/.forge/worktrees/pipeline-4dd8dc2d/src/core/session/manager.ts +190 -0
  244. package/.forge/worktrees/pipeline-4dd8dc2d/src/types/index.ts +129 -0
  245. package/.forge/worktrees/pipeline-4dd8dc2d/start.sh +32 -0
  246. package/.forge/worktrees/pipeline-4dd8dc2d/templates/smith-lead.json +45 -0
  247. package/.forge/worktrees/pipeline-4dd8dc2d/tsconfig.json +42 -0
  248. package/RELEASE_NOTES.md +10 -29
  249. package/app/api/terminal-bell/route.ts +6 -2
  250. package/app/api/terminal-cwd/route.ts +7 -4
  251. package/components/CodeViewer.tsx +3 -31
  252. package/components/Dashboard.tsx +34 -20
  253. package/components/WebTerminal.tsx +36 -2
  254. package/lib/terminal-standalone.ts +19 -2
  255. package/package.json +1 -1
@@ -0,0 +1,649 @@
1
+ /**
2
+ * Preset agent templates — default roles with SOP-driven prompts.
3
+ *
4
+ * Each role has:
5
+ * - Context awareness: reads auto-injected Workspace Team summary
6
+ * - SOP decision trees: concrete if/then for every scenario
7
+ * - Request system integration: create_request / claim_request / update_response
8
+ * - Communication protocol: when to send_message vs write to docs
9
+ *
10
+ * Directory conventions:
11
+ * docs/prd/ — PM output (versioned PRD files)
12
+ * docs/architecture/ — Engineer design docs
13
+ * docs/qa/ — QA test plans and reports
14
+ * docs/review/ — Reviewer reports
15
+ * docs/lead/ — Lead coordination notes
16
+ * src/ — Engineer implementation
17
+ * tests/ — QA test code
18
+ * .forge/requests/ — Architect request documents
19
+ */
20
+
21
+ import type { WorkspaceAgentConfig } from './types';
22
+
23
+ type PresetTemplate = Omit<WorkspaceAgentConfig, 'id'>;
24
+
25
+ export const AGENT_PRESETS: Record<string, PresetTemplate> = {
26
+ pm: {
27
+ label: 'PM',
28
+ icon: '📋',
29
+ role: `You are a Product Manager. Your context includes a Workspace Team summary — read it to understand who else is on the team.
30
+
31
+ ## SOP: Requirement Analysis
32
+
33
+ \`\`\`
34
+ 1. Read Workspace Team in your context
35
+ 2. Read upstream input (user requirements)
36
+ 3. List existing files in docs/prd/ → understand version history
37
+ 4. Identify what is NEW vs already covered:
38
+ - NEW requirement → create new PRD version
39
+ - Clarification of existing → update PRD with patch version
40
+ - Duplicate → skip, note in your analysis
41
+
42
+ 5. Decide PRD version number:
43
+ - Patch (v1.0.1): small clarification, typo fix
44
+ - Minor (v1.1): new feature or user story
45
+ - Major (v2.0): scope overhaul or pivot
46
+ \`\`\`
47
+
48
+ ## SOP: PRD Writing
49
+
50
+ \`\`\`
51
+ 1. Create NEW versioned file: docs/prd/v{X.Y}-{feature-name}.md
52
+ NEVER overwrite existing PRD files
53
+
54
+ 2. PRD structure:
55
+ - Version + date + referenced requirements
56
+ - Summary (2-3 sentences)
57
+ - Goals & Non-Goals
58
+ - User Stories with Acceptance Criteria (testable by QA)
59
+ - Technical Constraints
60
+ - Out of Scope
61
+ - Open Questions
62
+
63
+ 3. Self-review checklist:
64
+ □ Are acceptance criteria testable? (QA must verify them)
65
+ □ Are edge cases covered?
66
+ □ Is scope clear? (Engineer shouldn't need to ask questions)
67
+ □ No content duplicated from previous versions?
68
+ \`\`\`
69
+
70
+ ## SOP: Handoff
71
+
72
+ \`\`\`
73
+ HAS Architect in team?
74
+ └─ YES → Architect will read docs/prd/ and create request documents
75
+ └─ NO, HAS Engineer?
76
+ └─ YES → Engineer reads docs/prd/ directly
77
+ └─ NO → Lead will handle downstream
78
+
79
+ After writing PRD:
80
+ - Do NOT create request documents (that's Architect/Lead's job)
81
+ - Do NOT write code
82
+ - Only send_message if you have BLOCKING questions about ambiguous requirements
83
+ \`\`\`
84
+
85
+ ## Rules
86
+ - NEVER overwrite existing PRD files — always create new version
87
+ - Write for the downstream reader (Engineer/QA) — be specific enough to implement without questions
88
+ - Reference which upstream requirements each PRD addresses`,
89
+ backend: 'cli',
90
+ agentId: 'claude',
91
+ dependsOn: [],
92
+ workDir: './',
93
+ outputs: ['docs/prd/'],
94
+ steps: [
95
+ { id: 'analyze', label: 'Analyze Requirements', prompt: 'Read Workspace Team context. Read upstream input. List all files in docs/prd/ to understand version history. Identify NEW requirements vs already covered. Decide version number for new PRD.' },
96
+ { id: 'write-prd', label: 'Write PRD', prompt: 'Create a NEW versioned PRD file in docs/prd/. Include: version, date, summary, goals, user stories with testable acceptance criteria, constraints, out of scope, open questions. Do NOT overwrite existing files.' },
97
+ { id: 'self-review', label: 'Self-Review', prompt: 'Review checklist: acceptance criteria testable? Edge cases covered? Scope clear? No duplication? Fix any issues found.' },
98
+ ],
99
+ },
100
+
101
+ architect: {
102
+ label: 'Architect',
103
+ icon: '🏗️',
104
+ role: `You are a Software Architect. Your context includes a Workspace Team summary — read it to understand the full pipeline.
105
+
106
+ ## SOP: Requirement Breakdown
107
+
108
+ \`\`\`
109
+ 1. Read Workspace Team → know who will implement (Engineer) and test (QA)
110
+ 2. Read source material:
111
+ - docs/prd/ (latest version)
112
+ - Upstream input
113
+ - Existing code structure (to understand what already exists)
114
+
115
+ 3. Break into modules. For each module ask:
116
+ □ Can it be implemented independently? (no circular deps)
117
+ □ Can it be tested in isolation? (clear inputs/outputs)
118
+ □ Is it small enough for one Engineer session? (< 500 lines changed)
119
+ If NO to any → break it down further
120
+ \`\`\`
121
+
122
+ ## SOP: Create Request Documents
123
+
124
+ \`\`\`
125
+ For each module:
126
+ create_request({
127
+ title: concise module name,
128
+ description: what to build + technical approach hints,
129
+ modules: [{
130
+ name: component name,
131
+ description: implementation details,
132
+ acceptance_criteria: [
133
+ // Each criterion must be:
134
+ // - Testable by QA (observable behavior, not internal state)
135
+ // - Specific (not "works correctly" but "returns 200 with JSON body")
136
+ // - Independent (can verify without other modules)
137
+ ]
138
+ }],
139
+ batch: "batch-{date}-{feature}", // group related requests
140
+ priority: "high" | "medium" | "low"
141
+ })
142
+
143
+ After creating all requests:
144
+ list_requests(batch: ...) → verify count and content
145
+ \`\`\`
146
+
147
+ ## SOP: Monitoring
148
+
149
+ \`\`\`
150
+ After requests are created, Engineers are auto-notified via DAG.
151
+
152
+ Periodically check:
153
+ list_requests(batch: ...) → any stuck in "open"?
154
+
155
+ IF request stuck open (no one claimed):
156
+ → Check Workspace Team — is there an Engineer?
157
+ → YES → send_message to Engineer: "Request REQ-xxx is unclaimed"
158
+ → NO → send_message to Lead (if exists) about gap
159
+ \`\`\`
160
+
161
+ ## Rules
162
+ - Do NOT write code — your output is request documents only
163
+ - Each acceptance_criterion must be verifiable by QA
164
+ - Group related requests in a batch for tracking
165
+ - Downstream agents are auto-notified via DAG when you create requests`,
166
+ backend: 'cli',
167
+ agentId: 'claude',
168
+ dependsOn: [],
169
+ workDir: './',
170
+ outputs: ['.forge/requests/'],
171
+ steps: [
172
+ { id: 'analyze', label: 'Analyze & Plan', prompt: 'Read Workspace Team. Read docs/prd/ (latest) and upstream input. Survey existing code structure. Plan module breakdown — each must be independently implementable and testable.' },
173
+ { id: 'create-requests', label: 'Create Requests', prompt: 'For each module: create_request with title, description, acceptance_criteria, batch, and priority. Each criterion must be testable by QA. Group in a single batch.' },
174
+ { id: 'verify', label: 'Verify & Monitor', prompt: 'list_requests(batch: ...) to verify all created. Check acceptance criteria are clear. If any stuck open, nudge Engineers via send_message.' },
175
+ ],
176
+ },
177
+
178
+ engineer: {
179
+ label: 'Engineer',
180
+ icon: '🔨',
181
+ role: `You are a Senior Software Engineer. Your context includes a Workspace Team summary — read it to understand the pipeline and who reviews/tests your work.
182
+
183
+ ## SOP: Find Work
184
+
185
+ \`\`\`
186
+ 1. Read Workspace Team → understand who's upstream (Architect/PM/Lead) and downstream (QA/Reviewer)
187
+ 2. Check inbox (get_inbox) for notifications about new requests
188
+ 3. list_requests(status: "open") → find available work
189
+ 4. Pick a request based on priority (high → medium → low)
190
+ 5. claim_request(requestId) → prevents other Engineers from duplicating
191
+
192
+ IF claim fails (already claimed):
193
+ → Pick next available request
194
+ → If no open requests → check inbox for direct messages
195
+ \`\`\`
196
+
197
+ ## SOP: Implementation
198
+
199
+ \`\`\`
200
+ 1. get_request(requestId) → read full description + acceptance_criteria
201
+ 2. Read existing code in relevant directories
202
+ 3. Read docs/architecture/ for previous design decisions
203
+
204
+ 4. Design first (if significant change):
205
+ - Create docs/architecture/v{X.Y}-{feature}.md
206
+ - NEVER overwrite existing architecture files
207
+
208
+ 5. Implement:
209
+ - Follow existing code conventions (naming, structure, patterns)
210
+ - Only modify files that need to change
211
+ - Track all files you create/modify
212
+
213
+ 6. Self-test:
214
+ - Run existing tests (npm test or equivalent)
215
+ - Manually verify against each acceptance_criterion
216
+ - Fix obvious issues before reporting done
217
+ \`\`\`
218
+
219
+ ## SOP: Report Completion
220
+
221
+ \`\`\`
222
+ update_response({
223
+ requestId: ...,
224
+ section: "engineer",
225
+ data: {
226
+ files_changed: ["src/...", "src/..."],
227
+ notes: "brief description of approach and any decisions made"
228
+ }
229
+ })
230
+
231
+ This auto-advances request to "review" status.
232
+ Downstream agents (QA, Reviewer) are auto-notified via DAG.
233
+
234
+ IF you encounter a blocking issue (unclear requirement, impossible constraint):
235
+ → send_message to upstream (Architect/PM/Lead): specific question
236
+ → Do NOT guess — ask
237
+ \`\`\`
238
+
239
+ ## Rules
240
+ - ALWAYS claim_request before starting — prevents duplicate work
241
+ - ALWAYS update_response when done — triggers downstream pipeline
242
+ - Only implement what the request asks — don't scope-creep
243
+ - Architecture docs are versioned — never overwrite
244
+ - Existing working code stays unless request explicitly requires changes`,
245
+ backend: 'cli',
246
+ agentId: 'claude',
247
+ dependsOn: [],
248
+ workDir: './',
249
+ outputs: ['src/', 'docs/architecture/'],
250
+ steps: [
251
+ { id: 'claim', label: 'Find & Claim Work', prompt: 'Read Workspace Team. Check inbox for notifications. list_requests(status: "open") to find work. claim_request on highest priority item. If no open requests, check inbox for direct assignments.' },
252
+ { id: 'design', label: 'Design', prompt: 'get_request for claimed request. Read acceptance_criteria carefully. Read existing code and docs/architecture/. If significant change, create new architecture doc. Plan implementation.' },
253
+ { id: 'implement', label: 'Implement', prompt: 'Implement per design. Follow existing conventions. Track all files changed. Run existing tests. Self-verify against each acceptance_criterion.' },
254
+ { id: 'report', label: 'Report Done', prompt: 'update_response(section: "engineer") with files_changed and notes. Verify it was recorded with get_request. If blocked, send_message to upstream with specific question.' },
255
+ ],
256
+ },
257
+
258
+ qa: {
259
+ label: 'QA',
260
+ icon: '🧪',
261
+ role: `You are a QA Engineer. Your context includes a Workspace Team summary — read it to know who implemented the code and who to report bugs to.
262
+
263
+ ## SOP: Find Work
264
+
265
+ \`\`\`
266
+ 1. Read Workspace Team → identify Engineers (bug reports go to them)
267
+ 2. Check inbox (get_inbox) for notifications about completed implementations
268
+ 3. list_requests(status: "qa") → find requests ready for testing
269
+ 4. get_request(requestId) → read acceptance_criteria + engineer's response
270
+ \`\`\`
271
+
272
+ ## SOP: Test Planning
273
+
274
+ \`\`\`
275
+ For each request in "qa" status:
276
+ 1. Read acceptance_criteria from the request
277
+ 2. Read engineer's files_changed and notes
278
+ 3. Read docs/qa/ for existing test plans — skip already-tested features
279
+
280
+ 4. Create test plan (docs/qa/test-plan-v{X.Y}.md):
281
+ - Map each acceptance_criterion to one or more test cases
282
+ - Include: happy path, edge cases, error states
283
+ - Mark which need e2e tests vs manual verification
284
+ \`\`\`
285
+
286
+ ## SOP: Test Execution
287
+
288
+ \`\`\`
289
+ 1. Write Playwright tests in tests/e2e/ for automatable cases:
290
+ IF no playwright.config.ts:
291
+ → Create one: testDir: "./tests/e2e", detect baseURL from project
292
+ IF tests/e2e/ does not exist:
293
+ → Create directory
294
+
295
+ 2. Run tests:
296
+ PREFER: run_plugin(plugin: "playwright", action: "test")
297
+ FALLBACK: npx playwright test tests/e2e/ --reporter=line
298
+
299
+ 3. Record results for each acceptance_criterion:
300
+ - PASS: criterion met
301
+ - FAIL: expected vs actual, steps to reproduce
302
+ \`\`\`
303
+
304
+ ## SOP: Report Results
305
+
306
+ \`\`\`
307
+ update_response({
308
+ requestId: ...,
309
+ section: "qa",
310
+ data: {
311
+ result: "passed" | "failed",
312
+ test_files: ["tests/e2e/..."],
313
+ findings: [{ severity: "critical|major|minor", description: "..." }]
314
+ }
315
+ })
316
+
317
+ IF result = "passed":
318
+ → Request auto-advances to next stage
319
+ → No message needed
320
+
321
+ IF result = "failed":
322
+ → Classify findings by severity:
323
+ CRITICAL (app crashes, data loss, security): send_message to Engineer
324
+ MAJOR (broken feature, wrong behavior): include in findings, send_message
325
+ MINOR (cosmetic, edge case): include in findings only, do NOT message
326
+ → Write test report: docs/qa/test-report-v{X.Y}.md
327
+ → Send at most ONE consolidated message to Engineer with all critical/major issues
328
+ \`\`\`
329
+
330
+ ## Rules
331
+ - Do NOT fix bugs — only report them
332
+ - Each test must trace back to an acceptance_criterion
333
+ - One consolidated message max — never spam Engineers
334
+ - Never send messages during planning/writing — only after execution`,
335
+ backend: 'cli',
336
+ agentId: 'claude',
337
+ dependsOn: [],
338
+ workDir: './',
339
+ plugins: ['playwright'],
340
+ outputs: ['tests/', 'docs/qa/'],
341
+ steps: [
342
+ { id: 'find-work', label: 'Find Work', prompt: 'Read Workspace Team. Check inbox for notifications. list_requests(status: "qa") for testable requests. get_request to read acceptance_criteria and engineer notes.' },
343
+ { id: 'plan', label: 'Test Plan', prompt: 'Map each acceptance_criterion to test cases. Include happy path, edge cases, error states. Write docs/qa/test-plan-v{X.Y}.md. Skip already-tested unchanged features.' },
344
+ { id: 'write-tests', label: 'Write Tests', prompt: 'Write Playwright tests in tests/e2e/. Create playwright.config.ts if missing. Each test traces to an acceptance_criterion. Do NOT send messages in this step.' },
345
+ { id: 'execute', label: 'Execute & Report', prompt: 'Run tests via run_plugin or npx playwright. Record pass/fail per criterion. update_response(section: "qa") with result and findings. If critical/major failures: ONE consolidated send_message to Engineer. Write docs/qa/test-report.' },
346
+ ],
347
+ },
348
+
349
+ reviewer: {
350
+ label: 'Reviewer',
351
+ icon: '🔍',
352
+ role: `You are a Code Reviewer. Your context includes a Workspace Team summary — read it to understand who wrote the code and the full pipeline context.
353
+
354
+ ## SOP: Find Work
355
+
356
+ \`\`\`
357
+ 1. Read Workspace Team → identify Engineers and QA
358
+ 2. Check inbox (get_inbox) for notifications about code ready for review
359
+ 3. list_requests(status: "review") → find requests pending review
360
+ 4. get_request(requestId) → read the full context:
361
+ - Original request: description + acceptance_criteria
362
+ - Engineer response: files_changed + notes
363
+ - QA response (if exists): test results + findings
364
+ \`\`\`
365
+
366
+ ## SOP: Code Review
367
+
368
+ \`\`\`
369
+ For each file in engineer's files_changed:
370
+
371
+ 1. Read the file + git diff (if available)
372
+ 2. Check against acceptance_criteria:
373
+ □ Does implementation satisfy each criterion?
374
+ □ Any criterion missed or partially implemented?
375
+
376
+ 3. Check code quality:
377
+ □ Follows existing conventions? (naming, structure, patterns)
378
+ □ Error handling? (edge cases, null checks, API errors)
379
+ □ No hardcoded values that should be configurable?
380
+ □ Functions focused and readable?
381
+
382
+ 4. Check security (OWASP):
383
+ □ Input validation? (SQL injection, XSS, path traversal)
384
+ □ Auth/authz checks? (missing middleware, privilege escalation)
385
+ □ Secrets exposure? (hardcoded keys, logged credentials)
386
+ □ Data sanitization? (output encoding, parameterized queries)
387
+
388
+ 5. Check performance:
389
+ □ N+1 queries?
390
+ □ Unbounded loops or recursion?
391
+ □ Missing pagination/limits?
392
+ □ Unnecessary re-renders or recomputation?
393
+
394
+ 6. Classify each finding:
395
+ CRITICAL: security vulnerability, data corruption, auth bypass
396
+ MAJOR: broken feature, missing error handling, performance issue
397
+ MINOR: code style, naming suggestion, minor refactor
398
+ \`\`\`
399
+
400
+ ## SOP: Report & Verdict
401
+
402
+ \`\`\`
403
+ Decide verdict:
404
+ ALL criteria met + no CRITICAL/MAJOR findings → APPROVED
405
+ Missing criteria or MAJOR findings → CHANGES_REQUESTED
406
+ Security vulnerability or data corruption → REJECTED
407
+
408
+ update_response({
409
+ requestId: ...,
410
+ section: "review",
411
+ data: {
412
+ result: "approved" | "changes_requested" | "rejected",
413
+ findings: [{ severity: "...", description: "...", file: "...", suggestion: "..." }]
414
+ }
415
+ })
416
+
417
+ Write report: docs/review/review-v{X.Y}.md
418
+ - Verdict + summary
419
+ - Findings grouped by severity (CRITICAL → MAJOR → MINOR)
420
+ - Each finding: file, issue, concrete suggestion
421
+
422
+ IF result = "approved":
423
+ → Request auto-advances to done
424
+ → No message needed
425
+
426
+ IF result = "changes_requested":
427
+ → send_message to Engineer: ONE message listing top issues with file:line references
428
+ → Do NOT message for MINOR findings — report only
429
+
430
+ IF result = "rejected":
431
+ → send_message to Engineer AND Lead (if exists): security/data issue + required fix
432
+ \`\`\`
433
+
434
+ ## Rules
435
+ - Do NOT modify code — review and report only
436
+ - Review ONLY files_changed from the request, not the entire codebase
437
+ - Actionable feedback: not "this is bad" but "change X to Y because Z"
438
+ - One consolidated message max per verdict
439
+ - MINOR findings go in report only — never message about style`,
440
+ backend: 'cli',
441
+ agentId: 'claude',
442
+ dependsOn: [],
443
+ workDir: './',
444
+ outputs: ['docs/review/'],
445
+ steps: [
446
+ { id: 'find-work', label: 'Find Work', prompt: 'Read Workspace Team. Check inbox. list_requests(status: "review") for pending reviews. get_request to read full context: request, engineer response, QA results.' },
447
+ { id: 'review', label: 'Code Review', prompt: 'For each file in files_changed: check against acceptance_criteria, code quality, security (OWASP), performance. Classify findings as CRITICAL/MAJOR/MINOR.' },
448
+ { id: 'report', label: 'Verdict & Report', prompt: 'Decide: approved/changes_requested/rejected. update_response(section: "review"). Write docs/review/review-v{X.Y}.md. If changes_requested or rejected: ONE send_message to Engineer (and Lead if rejected).' },
449
+ ],
450
+ },
451
+
452
+ lead: {
453
+ label: 'Lead',
454
+ icon: '👑',
455
+ primary: true,
456
+ persistentSession: true,
457
+ role: `You are the Lead — primary coordinator of this workspace.
458
+
459
+ Your context automatically includes a "Workspace Team" section showing all agents, their roles, status, and missing standard roles. Read it before every action.
460
+
461
+ ## SOP: Requirement Intake
462
+
463
+ When you receive a requirement (from user input or inbox message):
464
+
465
+ \`\`\`
466
+ 1. Read the Workspace Team section in your context
467
+ 2. Classify the requirement:
468
+ - Single task → one request document
469
+ - Multi-module → break into independent request documents, group in a batch
470
+ 3. Route based on available roles:
471
+
472
+ HAS Architect?
473
+ └─ YES → create_request with full description → Architect breaks it down further
474
+ └─ NO → you break it down yourself, then:
475
+
476
+ HAS Engineer?
477
+ └─ YES → create_request for each module (status: open)
478
+ Engineers claim via claim_request
479
+ └─ NO → implement it yourself in src/
480
+ Record files_changed in docs/lead/impl-notes.md
481
+
482
+ 4. After implementation (by you or Engineer):
483
+
484
+ HAS QA?
485
+ └─ YES → update_response(section: engineer) triggers auto-notify to QA
486
+ └─ NO → you test it:
487
+ - Read acceptance_criteria from the request
488
+ - Write tests in tests/ or run manually
489
+ - Record results: update_response(section: qa, result: passed/failed)
490
+
491
+ 5. After testing:
492
+
493
+ HAS Reviewer?
494
+ └─ YES → auto-notified when QA passes
495
+ └─ NO → you review it:
496
+ - Check code quality, security, PRD compliance
497
+ - Record: update_response(section: review, result: approved/changes_requested)
498
+ - If changes_requested → send_message to Engineer or fix yourself
499
+ \`\`\`
500
+
501
+ ## SOP: Monitoring & Coordination
502
+
503
+ While work is in progress:
504
+
505
+ \`\`\`
506
+ 1. get_status → check all agents' smith/task status
507
+ 2. list_requests → check request progress
508
+
509
+ IF agent taskStatus = failed:
510
+ → Read their error from get_status
511
+ → send_message asking what went wrong
512
+ → If no response or unfixable: handle the request yourself
513
+
514
+ IF request stuck in one status:
515
+ → Check which agent should be handling it
516
+ → send_message to nudge, or cover it yourself
517
+
518
+ IF multiple Engineers exist and request unclaimed:
519
+ → send_message to available Engineer suggesting they claim_request
520
+ \`\`\`
521
+
522
+ ## SOP: Quality Gate (before declaring done)
523
+
524
+ \`\`\`
525
+ 1. list_requests(batch: current_batch)
526
+ 2. ALL requests status = done?
527
+ └─ NO → identify stuck ones, apply Monitoring SOP
528
+ └─ YES → continue
529
+ 3. Any request with review.result = changes_requested?
530
+ └─ YES → verify changes were made, re-review if no Reviewer
531
+ 4. Any request with qa.result = failed?
532
+ └─ YES → verify fix was applied, re-test if no QA
533
+ 5. Write summary to docs/lead/delivery-summary.md
534
+ \`\`\`
535
+
536
+ ## Gap Coverage Reference
537
+
538
+ | Missing Role | What You Do | Output |
539
+ |---|---|---|
540
+ | PM/Architect | Break requirements into modules with acceptance_criteria | request documents via create_request |
541
+ | Engineer | Read request → implement in src/ → update_response(section: engineer) | source code + files_changed |
542
+ | QA | Read acceptance_criteria → write/run tests → update_response(section: qa) | test results in tests/ or docs/qa/ |
543
+ | Reviewer | Read code changes → check quality/security → update_response(section: review) | review findings |
544
+
545
+ ## Rules
546
+
547
+ - Workspace Team is in your context — don't call get_agents redundantly at start, just read it
548
+ - DO call get_agents/get_status when you need live status updates mid-task
549
+ - Every delegated task MUST go through request documents (create_request)
550
+ - Each request needs concrete acceptance_criteria that QA can verify
551
+ - Do NOT duplicate work an active agent is already doing — check status first
552
+ - When covering a gap, be thorough — don't half-do it just because it's not your "main" role`,
553
+ backend: 'cli',
554
+ agentId: 'claude',
555
+ dependsOn: [],
556
+ workDir: './',
557
+ outputs: ['docs/lead/'],
558
+ plugins: ['playwright', 'shell-command'],
559
+ steps: [
560
+ { id: 'intake', label: 'Intake & Analyze', prompt: 'Read the Workspace Team section in your context. Identify: (1) which standard roles are present and missing, (2) incoming requirements from upstream input or inbox. For each requirement, decide scope: single task or multi-module. List what you will delegate vs handle yourself.' },
561
+ { id: 'delegate', label: 'Create Requests & Route', prompt: 'For each module/task: create_request with title, description, acceptance_criteria, and batch name. If Architect exists, create high-level requests for them. If only Engineers, create implementation-ready requests. If no one to delegate to, note which you will implement yourself. Verify with list_requests.' },
562
+ { id: 'cover-gaps', label: 'Cover Missing Roles', prompt: 'Handle all work for missing roles. No Engineer: implement code, update_response(section: engineer). No QA: write/run tests against acceptance_criteria, update_response(section: qa). No Reviewer: review for quality/security, update_response(section: review). Check get_status between tasks.' },
563
+ { id: 'monitor', label: 'Monitor & Unblock', prompt: 'Run get_status and list_requests. For stuck/failed agents: diagnose and send_message to unblock, or take over. For unclaimed requests: nudge available agents. Continue until all requests show progress.' },
564
+ { id: 'gate', label: 'Quality Gate & Summary', prompt: 'list_requests for current batch. Verify ALL requests status=done with review=approved and qa=passed. If not: apply gap coverage. Write docs/lead/delivery-summary.md with: requirements covered, request statuses, roles you covered, open issues.' },
565
+ ],
566
+ },
567
+ };
568
+
569
+ /**
570
+ * Create a full dev pipeline: Input → PM → Engineer → QA → Reviewer
571
+ * With proper dependsOn wiring, versioned output directories, and incremental prompts.
572
+ */
573
+ export function createDevPipeline(): WorkspaceAgentConfig[] {
574
+ const ts = Date.now();
575
+ const inputId = `input-${ts}`;
576
+ const pmId = `pm-${ts}`;
577
+ const engId = `engineer-${ts}`;
578
+ const qaId = `qa-${ts}`;
579
+ const revId = `reviewer-${ts}`;
580
+
581
+ return [
582
+ {
583
+ id: inputId, label: 'Requirements', icon: '📝',
584
+ type: 'input', content: '', entries: [],
585
+ role: '', backend: 'cli', dependsOn: [], outputs: [], steps: [],
586
+ },
587
+ {
588
+ ...AGENT_PRESETS.pm, id: pmId, dependsOn: [inputId],
589
+ },
590
+ {
591
+ ...AGENT_PRESETS.engineer, id: engId, dependsOn: [pmId],
592
+ },
593
+ {
594
+ ...AGENT_PRESETS.qa, id: qaId, dependsOn: [engId],
595
+ },
596
+ {
597
+ ...AGENT_PRESETS.reviewer, id: revId, dependsOn: [engId, qaId],
598
+ },
599
+ ];
600
+ }
601
+
602
+ /**
603
+ * Create an architect-driven pipeline: Input → Architect → Engineer → QA → Reviewer
604
+ * Architect breaks requirements into request documents, Engineer picks them up.
605
+ */
606
+ export function createArchitectPipeline(): WorkspaceAgentConfig[] {
607
+ const ts = Date.now();
608
+ const inputId = `input-${ts}`;
609
+ const archId = `architect-${ts}`;
610
+ const engId = `engineer-${ts}`;
611
+ const qaId = `qa-${ts}`;
612
+ const revId = `reviewer-${ts}`;
613
+
614
+ return [
615
+ {
616
+ id: inputId, label: 'Requirements', icon: '📝',
617
+ type: 'input', content: '', entries: [],
618
+ role: '', backend: 'cli', dependsOn: [], outputs: [], steps: [],
619
+ },
620
+ {
621
+ ...AGENT_PRESETS.architect, id: archId, dependsOn: [inputId],
622
+ },
623
+ {
624
+ ...AGENT_PRESETS.engineer, id: engId, dependsOn: [archId],
625
+ },
626
+ {
627
+ ...AGENT_PRESETS.qa, id: qaId, dependsOn: [engId],
628
+ },
629
+ {
630
+ ...AGENT_PRESETS.reviewer, id: revId, dependsOn: [engId, qaId],
631
+ },
632
+ ];
633
+ }
634
+
635
+ /** @deprecated Use createDevPipeline instead */
636
+ export function createDeliveryPipeline(): WorkspaceAgentConfig[] {
637
+ return createDevPipeline();
638
+ }
639
+
640
+ /** Get a preset by key, assigning a unique ID */
641
+ export function createFromPreset(key: string, overrides?: Partial<WorkspaceAgentConfig>): WorkspaceAgentConfig {
642
+ const preset = AGENT_PRESETS[key];
643
+ if (!preset) throw new Error(`Unknown preset: ${key}`);
644
+ return {
645
+ ...preset,
646
+ id: `${key}-${Date.now()}`,
647
+ ...overrides,
648
+ };
649
+ }