@aion0/forge 0.5.26 → 0.5.27

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 (253) 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 +11 -28
  249. package/app/api/terminal-bell/route.ts +6 -2
  250. package/components/WebTerminal.tsx +36 -2
  251. package/lib/terminal-standalone.ts +19 -2
  252. package/next-env.d.ts +1 -1
  253. package/package.json +1 -1
@@ -0,0 +1,492 @@
1
+ 'use client';
2
+
3
+ import { useState, useEffect } from 'react';
4
+ import type { TaskMode, WatchConfig } from '@/src/types';
5
+
6
+ interface Project {
7
+ name: string;
8
+ path: string;
9
+ language: string | null;
10
+ }
11
+
12
+ interface SessionInfo {
13
+ sessionId: string;
14
+ summary?: string;
15
+ firstPrompt?: string;
16
+ modified?: string;
17
+ gitBranch?: string;
18
+ }
19
+
20
+ interface TaskData {
21
+ projectName: string;
22
+ prompt: string;
23
+ priority?: number;
24
+ conversationId?: string;
25
+ newSession?: boolean;
26
+ scheduledAt?: string;
27
+ mode?: TaskMode;
28
+ watchConfig?: WatchConfig;
29
+ agent?: string;
30
+ }
31
+
32
+ export default function NewTaskModal({
33
+ onClose,
34
+ onCreate,
35
+ editTask,
36
+ }: {
37
+ onClose: () => void;
38
+ onCreate: (data: TaskData) => void;
39
+ editTask?: { id: string; projectName: string; prompt: string; priority: number; mode: TaskMode; scheduledAt?: string };
40
+ }) {
41
+ const [projects, setProjects] = useState<Project[]>([]);
42
+ const [selectedProject, setSelectedProject] = useState(editTask?.projectName || '');
43
+ const [prompt, setPrompt] = useState(editTask?.prompt || '');
44
+ const [priority, setPriority] = useState(editTask?.priority || 0);
45
+
46
+ // Task mode
47
+ const [taskMode, setTaskMode] = useState<TaskMode>(editTask?.mode || 'prompt');
48
+
49
+ // Monitor config
50
+ const [watchCondition, setWatchCondition] = useState<WatchConfig['condition']>('change');
51
+ const [watchKeyword, setWatchKeyword] = useState('');
52
+ const [watchIdleMinutes, setWatchIdleMinutes] = useState(10);
53
+ const [watchAction, setWatchAction] = useState<WatchConfig['action']>('notify');
54
+ const [watchActionPrompt, setWatchActionPrompt] = useState('');
55
+ const [watchRepeat, setWatchRepeat] = useState(false);
56
+
57
+ // Session selection
58
+ const [sessionMode, setSessionMode] = useState<'auto' | 'select' | 'new'>('auto');
59
+ const [sessions, setSessions] = useState<SessionInfo[]>([]);
60
+ const [selectedSessionId, setSelectedSessionId] = useState<string | null>(null);
61
+ const [autoSessionId, setAutoSessionId] = useState<string | null>(null);
62
+
63
+ // Scheduling
64
+ const [scheduleMode, setScheduleMode] = useState<'now' | 'delay' | 'time'>(editTask?.scheduledAt ? 'time' : 'now');
65
+ const [delayMinutes, setDelayMinutes] = useState(30);
66
+ const [scheduledTime, setScheduledTime] = useState(editTask?.scheduledAt ? new Date(editTask.scheduledAt).toISOString().slice(0, 16) : '');
67
+
68
+ // Agent selection
69
+ const [availableAgents, setAvailableAgents] = useState<{ id: string; name: string; detected?: boolean }[]>([]);
70
+ const [selectedAgent, setSelectedAgent] = useState('');
71
+
72
+ useEffect(() => {
73
+ fetch('/api/agents').then(r => r.json())
74
+ .then(data => {
75
+ const agents = (data.agents || []).filter((a: any) => a.enabled && a.detected !== false);
76
+ setAvailableAgents(agents);
77
+ setSelectedAgent(data.defaultAgent || 'claude');
78
+ }).catch(() => {});
79
+ }, []);
80
+
81
+ useEffect(() => {
82
+ fetch('/api/projects').then(r => r.json()).then((p: Project[]) => {
83
+ setProjects(p);
84
+ if (!selectedProject && p.length > 0) setSelectedProject(p[0].name);
85
+ });
86
+ }, []);
87
+
88
+ // Fetch sessions when project changes
89
+ useEffect(() => {
90
+ if (!selectedProject) return;
91
+
92
+ // Get auto-inherited session
93
+ fetch(`/api/tasks/session?project=${encodeURIComponent(selectedProject)}`)
94
+ .then(r => r.json())
95
+ .then(data => setAutoSessionId(data.conversationId || null))
96
+ .catch(() => setAutoSessionId(null));
97
+
98
+ // Get all sessions for picker
99
+ fetch(`/api/claude-sessions/${encodeURIComponent(selectedProject)}`)
100
+ .then(r => r.json())
101
+ .then((s: SessionInfo[]) => setSessions(s))
102
+ .catch(() => setSessions([]));
103
+ }, [selectedProject]);
104
+
105
+ const getScheduledAt = (): string | null | undefined => {
106
+ if (scheduleMode === 'now') return editTask ? null : undefined; // null clears existing schedule
107
+ if (scheduleMode === 'delay') {
108
+ return new Date(Date.now() + delayMinutes * 60_000).toISOString();
109
+ }
110
+ if (scheduleMode === 'time' && scheduledTime) {
111
+ return new Date(scheduledTime).toISOString();
112
+ }
113
+ return editTask ? null : undefined;
114
+ };
115
+
116
+ const handleSubmit = (e: React.FormEvent) => {
117
+ e.preventDefault();
118
+ if (!selectedProject) return;
119
+ // Monitor mode requires session selection; prompt mode requires prompt text
120
+ if (taskMode === 'prompt' && !prompt.trim()) return;
121
+ if (taskMode === 'monitor' && sessionMode !== 'select') return;
122
+
123
+ const data: Parameters<typeof onCreate>[0] = {
124
+ projectName: selectedProject,
125
+ prompt: taskMode === 'monitor' ? `Monitor session ${selectedSessionId}` : prompt.trim(),
126
+ priority,
127
+ scheduledAt: getScheduledAt() ?? undefined,
128
+ mode: taskMode,
129
+ };
130
+
131
+ if (sessionMode === 'new') {
132
+ data.newSession = true;
133
+ } else if (sessionMode === 'select' && selectedSessionId) {
134
+ data.conversationId = selectedSessionId;
135
+ }
136
+
137
+ if (taskMode === 'monitor') {
138
+ const wc: WatchConfig = {
139
+ condition: watchCondition,
140
+ action: watchAction,
141
+ repeat: watchRepeat,
142
+ };
143
+ if (watchCondition === 'keyword') wc.keyword = watchKeyword;
144
+ if (watchCondition === 'idle') wc.idleMinutes = watchIdleMinutes;
145
+ if (watchAction !== 'notify') wc.actionPrompt = watchActionPrompt;
146
+ data.watchConfig = wc;
147
+ }
148
+
149
+ if (selectedAgent) data.agent = selectedAgent;
150
+
151
+ onCreate(data);
152
+ };
153
+
154
+ return (
155
+ <div className="fixed inset-0 bg-black/60 flex items-center justify-center z-50" onClick={onClose}>
156
+ <div className="bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg w-[560px] max-h-[80vh] overflow-auto" onClick={e => e.stopPropagation()}>
157
+ <div className="p-4 border-b border-[var(--border)]">
158
+ <h2 className="text-sm font-semibold">{editTask ? 'Edit Task' : 'New Task'}</h2>
159
+ <p className="text-[11px] text-[var(--text-secondary)] mt-0.5">
160
+ Submit a task for Claude Code to work on autonomously
161
+ </p>
162
+ </div>
163
+
164
+ <form onSubmit={handleSubmit} className="p-4 space-y-4">
165
+ {/* Project */}
166
+ <div>
167
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Project</label>
168
+ <select
169
+ value={selectedProject}
170
+ onChange={e => { setSelectedProject(e.target.value); setSelectedSessionId(null); }}
171
+ className="w-full px-3 py-2 bg-[var(--bg-tertiary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)]"
172
+ >
173
+ {projects.map(p => (
174
+ <option key={`${p.name}-${p.path}`} value={p.name}>
175
+ {p.name} {p.language ? `(${p.language})` : ''}
176
+ </option>
177
+ ))}
178
+ </select>
179
+ </div>
180
+
181
+ {/* Agent */}
182
+ {availableAgents.length > 1 && (
183
+ <div>
184
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Agent</label>
185
+ <select
186
+ value={selectedAgent}
187
+ onChange={e => setSelectedAgent(e.target.value)}
188
+ className="w-full px-3 py-2 bg-[var(--bg-tertiary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)]"
189
+ >
190
+ {availableAgents.map(a => (
191
+ <option key={a.id} value={a.id}>{a.name}</option>
192
+ ))}
193
+ </select>
194
+ </div>
195
+ )}
196
+
197
+ {/* Task Mode */}
198
+ <div>
199
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Mode</label>
200
+ <div className="flex gap-2">
201
+ {([
202
+ { value: 'prompt' as const, label: 'Prompt', desc: 'Send a message to Claude' },
203
+ { value: 'monitor' as const, label: 'Monitor', desc: 'Watch a session, trigger actions' },
204
+ ]).map(m => (
205
+ <button
206
+ key={m.value}
207
+ type="button"
208
+ onClick={() => {
209
+ setTaskMode(m.value);
210
+ if (m.value === 'monitor') setSessionMode('select');
211
+ }}
212
+ className={`text-[11px] px-3 py-1 rounded border transition-colors ${
213
+ taskMode === m.value
214
+ ? 'border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10'
215
+ : 'border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--text-secondary)]'
216
+ }`}
217
+ >
218
+ {m.label}
219
+ </button>
220
+ ))}
221
+ </div>
222
+ <p className="text-[10px] text-[var(--text-secondary)] mt-1">
223
+ {taskMode === 'prompt' ? 'Send a message to Claude to work on autonomously' : 'Watch a session and trigger actions on conditions'}
224
+ </p>
225
+ </div>
226
+
227
+ {/* Session */}
228
+ <div>
229
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Session</label>
230
+ {taskMode === 'prompt' && (
231
+ <div className="flex gap-2">
232
+ {(['auto', 'select', 'new'] as const).map(mode => (
233
+ <button
234
+ key={mode}
235
+ type="button"
236
+ onClick={() => setSessionMode(mode)}
237
+ className={`text-[11px] px-3 py-1 rounded border transition-colors ${
238
+ sessionMode === mode
239
+ ? 'border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10'
240
+ : 'border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--text-secondary)]'
241
+ }`}
242
+ >
243
+ {mode === 'auto' ? 'Auto Continue' : mode === 'select' ? 'Choose Session' : 'New Session'}
244
+ </button>
245
+ ))}
246
+ </div>
247
+ )}
248
+ {taskMode === 'monitor' && (
249
+ <p className="text-[10px] text-[var(--text-secondary)]">Select a session to monitor</p>
250
+ )}
251
+
252
+ {sessionMode === 'auto' && taskMode === 'prompt' && (
253
+ <p className="text-[10px] text-[var(--text-secondary)] mt-1">
254
+ {autoSessionId
255
+ ? <>Will continue <span className="font-mono text-[var(--accent)]">{autoSessionId.slice(0, 12)}</span></>
256
+ : 'No existing session — will start new'}
257
+ </p>
258
+ )}
259
+
260
+ {sessionMode === 'select' && (
261
+ <div className="mt-2 max-h-32 overflow-y-auto border border-[var(--border)] rounded">
262
+ {sessions.length === 0 ? (
263
+ <p className="text-[10px] text-[var(--text-secondary)] p-2">No sessions found</p>
264
+ ) : sessions.map(s => (
265
+ <button
266
+ key={s.sessionId}
267
+ type="button"
268
+ onClick={() => setSelectedSessionId(s.sessionId)}
269
+ className={`w-full text-left px-2 py-1.5 text-[10px] hover:bg-[var(--bg-tertiary)] transition-colors ${
270
+ selectedSessionId === s.sessionId ? 'bg-[var(--accent)]/10 border-l-2 border-l-[var(--accent)]' : ''
271
+ }`}
272
+ >
273
+ <div className="text-[var(--text-primary)] truncate">
274
+ {s.summary || s.firstPrompt?.slice(0, 50) || s.sessionId.slice(0, 8)}
275
+ </div>
276
+ <div className="flex gap-2 mt-0.5">
277
+ <span className="font-mono text-[var(--text-secondary)]">{s.sessionId.slice(0, 8)}</span>
278
+ {s.gitBranch && <span className="text-[var(--accent)]">{s.gitBranch}</span>}
279
+ {s.modified && <span className="text-[var(--text-secondary)]">{new Date(s.modified).toLocaleDateString()}</span>}
280
+ </div>
281
+ </button>
282
+ ))}
283
+ </div>
284
+ )}
285
+
286
+ {sessionMode === 'new' && (
287
+ <p className="text-[10px] text-[var(--text-secondary)] mt-1">
288
+ Will start a fresh session with no prior context
289
+ </p>
290
+ )}
291
+ </div>
292
+
293
+ {/* Monitor Config — only in monitor mode */}
294
+ {taskMode === 'monitor' && (
295
+ <div className="space-y-3 p-3 bg-[var(--bg-tertiary)] rounded border border-[var(--border)]">
296
+ <div>
297
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Trigger when</label>
298
+ <div className="flex gap-1 flex-wrap">
299
+ {([
300
+ { value: 'change' as const, label: 'Content changes' },
301
+ { value: 'idle' as const, label: 'Session idle' },
302
+ { value: 'complete' as const, label: 'Session completes' },
303
+ { value: 'error' as const, label: 'Error occurs' },
304
+ { value: 'keyword' as const, label: 'Keyword found' },
305
+ ]).map(c => (
306
+ <button
307
+ key={c.value}
308
+ type="button"
309
+ onClick={() => setWatchCondition(c.value)}
310
+ className={`text-[10px] px-2 py-0.5 rounded border transition-colors ${
311
+ watchCondition === c.value
312
+ ? 'border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10'
313
+ : 'border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--text-secondary)]'
314
+ }`}
315
+ >
316
+ {c.label}
317
+ </button>
318
+ ))}
319
+ </div>
320
+ {watchCondition === 'keyword' && (
321
+ <input
322
+ type="text"
323
+ value={watchKeyword}
324
+ onChange={e => setWatchKeyword(e.target.value)}
325
+ placeholder="Enter keyword to watch for..."
326
+ className="mt-2 w-full px-2 py-1 bg-[var(--bg-secondary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none"
327
+ />
328
+ )}
329
+ {watchCondition === 'idle' && (
330
+ <div className="flex items-center gap-2 mt-2">
331
+ <span className="text-[10px] text-[var(--text-secondary)]">Idle for</span>
332
+ <input
333
+ type="number"
334
+ value={watchIdleMinutes}
335
+ onChange={e => setWatchIdleMinutes(Number(e.target.value))}
336
+ min={1}
337
+ className="w-16 px-2 py-1 bg-[var(--bg-secondary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none"
338
+ />
339
+ <span className="text-[10px] text-[var(--text-secondary)]">minutes</span>
340
+ </div>
341
+ )}
342
+ </div>
343
+
344
+ <div>
345
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Then</label>
346
+ <div className="flex gap-1 flex-wrap">
347
+ {([
348
+ { value: 'notify' as const, label: 'Send Telegram notification' },
349
+ { value: 'message' as const, label: 'Send message to session' },
350
+ { value: 'task' as const, label: 'Create new task' },
351
+ ]).map(a => (
352
+ <button
353
+ key={a.value}
354
+ type="button"
355
+ onClick={() => setWatchAction(a.value)}
356
+ className={`text-[10px] px-2 py-0.5 rounded border transition-colors ${
357
+ watchAction === a.value
358
+ ? 'border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10'
359
+ : 'border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--text-secondary)]'
360
+ }`}
361
+ >
362
+ {a.label}
363
+ </button>
364
+ ))}
365
+ </div>
366
+ {watchAction !== 'notify' && (
367
+ <textarea
368
+ value={watchActionPrompt}
369
+ onChange={e => setWatchActionPrompt(e.target.value)}
370
+ placeholder={watchAction === 'message' ? 'Message to send to the session...' : 'Prompt for the new task...'}
371
+ rows={2}
372
+ className="mt-2 w-full px-2 py-1 bg-[var(--bg-secondary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] resize-none focus:outline-none"
373
+ />
374
+ )}
375
+ </div>
376
+
377
+ <label className="flex items-center gap-2 cursor-pointer">
378
+ <input
379
+ type="checkbox"
380
+ checked={watchRepeat}
381
+ onChange={e => setWatchRepeat(e.target.checked)}
382
+ className="rounded"
383
+ />
384
+ <span className="text-[10px] text-[var(--text-secondary)]">Keep watching after trigger (repeat)</span>
385
+ </label>
386
+ </div>
387
+ )}
388
+
389
+ {/* Task prompt — only in prompt mode */}
390
+ {taskMode === 'prompt' && (
391
+ <div>
392
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">What should Claude do?</label>
393
+ <textarea
394
+ value={prompt}
395
+ onChange={e => setPrompt(e.target.value)}
396
+ placeholder="e.g. Refactor the authentication module to use JWT tokens..."
397
+ rows={5}
398
+ className="w-full px-3 py-2 bg-[var(--bg-tertiary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] resize-none focus:outline-none focus:border-[var(--accent)]"
399
+ autoFocus
400
+ />
401
+ </div>
402
+ )}
403
+
404
+ {/* Schedule */}
405
+ <div>
406
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">When</label>
407
+ <div className="flex gap-2">
408
+ {(['now', 'delay', 'time'] as const).map(mode => (
409
+ <button
410
+ key={mode}
411
+ type="button"
412
+ onClick={() => setScheduleMode(mode)}
413
+ className={`text-[11px] px-3 py-1 rounded border transition-colors ${
414
+ scheduleMode === mode
415
+ ? 'border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10'
416
+ : 'border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--text-secondary)]'
417
+ }`}
418
+ >
419
+ {mode === 'now' ? 'Now' : mode === 'delay' ? 'Delay' : 'Schedule'}
420
+ </button>
421
+ ))}
422
+ </div>
423
+
424
+ {scheduleMode === 'delay' && (
425
+ <div className="flex items-center gap-2 mt-2">
426
+ <span className="text-[10px] text-[var(--text-secondary)]">Run in</span>
427
+ <input
428
+ type="number"
429
+ value={delayMinutes}
430
+ onChange={e => setDelayMinutes(Number(e.target.value))}
431
+ min={1}
432
+ className="w-20 px-2 py-1 bg-[var(--bg-tertiary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none"
433
+ />
434
+ <span className="text-[10px] text-[var(--text-secondary)]">minutes</span>
435
+ </div>
436
+ )}
437
+
438
+ {scheduleMode === 'time' && (
439
+ <div className="mt-2">
440
+ <input
441
+ type="datetime-local"
442
+ value={scheduledTime}
443
+ onChange={e => setScheduledTime(e.target.value)}
444
+ className="px-2 py-1 bg-[var(--bg-tertiary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none"
445
+ />
446
+ </div>
447
+ )}
448
+ </div>
449
+
450
+ {/* Priority */}
451
+ <div>
452
+ <label className="text-[11px] text-[var(--text-secondary)] block mb-1">Priority</label>
453
+ <div className="flex gap-2">
454
+ {[
455
+ { value: 0, label: 'Normal' },
456
+ { value: 1, label: 'High' },
457
+ { value: 2, label: 'Urgent' },
458
+ ].map(p => (
459
+ <button
460
+ key={p.value}
461
+ type="button"
462
+ onClick={() => setPriority(p.value)}
463
+ className={`text-[11px] px-3 py-1 rounded border transition-colors ${
464
+ priority === p.value
465
+ ? 'border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10'
466
+ : 'border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--text-secondary)]'
467
+ }`}
468
+ >
469
+ {p.label}
470
+ </button>
471
+ ))}
472
+ </div>
473
+ </div>
474
+
475
+ {/* Actions */}
476
+ <div className="flex justify-end gap-2 pt-2">
477
+ <button type="button" onClick={onClose} className="text-xs px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)]">
478
+ Cancel
479
+ </button>
480
+ <button
481
+ type="submit"
482
+ disabled={!selectedProject || (taskMode === 'prompt' && !prompt.trim()) || (taskMode === 'monitor' && !selectedSessionId)}
483
+ className="text-xs px-4 py-1.5 bg-[var(--accent)] text-white rounded hover:opacity-90 disabled:opacity-50"
484
+ >
485
+ {editTask ? 'Save & Restart' : taskMode === 'monitor' ? 'Start Monitor' : scheduleMode === 'now' ? 'Submit Task' : 'Schedule Task'}
486
+ </button>
487
+ </div>
488
+ </form>
489
+ </div>
490
+ </div>
491
+ );
492
+ }