@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,108 @@
1
+ 'use client';
2
+
3
+ import { useState, useEffect } from 'react';
4
+
5
+ interface LocalProject {
6
+ name: string;
7
+ path: string;
8
+ hasGit: boolean;
9
+ hasClaudeMd: boolean;
10
+ language: string | null;
11
+ lastModified: string;
12
+ }
13
+
14
+ interface ClaudeProcess {
15
+ id: string;
16
+ projectName: string;
17
+ status: string;
18
+ }
19
+
20
+ const langIcons: Record<string, string> = {
21
+ java: 'JV',
22
+ kotlin: 'KT',
23
+ typescript: 'TS',
24
+ python: 'PY',
25
+ go: 'GO',
26
+ rust: 'RS',
27
+ };
28
+
29
+ export default function ProjectList({
30
+ onLaunch,
31
+ claudeProcesses,
32
+ }: {
33
+ onLaunch: (projectName: string) => void;
34
+ claudeProcesses: ClaudeProcess[];
35
+ }) {
36
+ const [projects, setProjects] = useState<LocalProject[]>([]);
37
+ const [filter, setFilter] = useState('');
38
+
39
+ useEffect(() => {
40
+ fetch('/api/projects').then(r => r.json()).then(setProjects);
41
+ }, []);
42
+
43
+ const filtered = projects.filter(p =>
44
+ p.name.toLowerCase().includes(filter.toLowerCase())
45
+ );
46
+
47
+ const getProcessForProject = (name: string) =>
48
+ claudeProcesses.find(p => p.projectName === name && p.status === 'running');
49
+
50
+ return (
51
+ <div className="flex flex-col h-full">
52
+ <div className="p-3 border-b border-[var(--border)]">
53
+ <input
54
+ value={filter}
55
+ onChange={e => setFilter(e.target.value)}
56
+ placeholder="Filter projects..."
57
+ className="w-full px-2 py-1 bg-[var(--bg-tertiary)] border border-[var(--border)] rounded text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)]"
58
+ />
59
+ </div>
60
+ <div className="flex-1 overflow-y-auto">
61
+ {filtered.map(p => {
62
+ const proc = getProcessForProject(p.name);
63
+ return (
64
+ <div
65
+ key={p.name}
66
+ className="flex items-center justify-between px-3 py-2 border-b border-[var(--border)] hover:bg-[var(--bg-tertiary)] group"
67
+ >
68
+ <div className="min-w-0">
69
+ <div className="flex items-center gap-2">
70
+ {p.language && (
71
+ <span className="text-[9px] px-1 py-0.5 bg-[var(--bg-tertiary)] rounded text-[var(--text-secondary)] font-mono">
72
+ {langIcons[p.language] || p.language.slice(0, 2).toUpperCase()}
73
+ </span>
74
+ )}
75
+ <span className="text-xs font-medium truncate">{p.name}</span>
76
+ {p.hasClaudeMd && (
77
+ <span className="text-[9px] text-[var(--accent)]" title="Has CLAUDE.md">C</span>
78
+ )}
79
+ </div>
80
+ </div>
81
+ <div className="flex items-center gap-1 shrink-0">
82
+ {proc ? (
83
+ <span className="text-[9px] text-[var(--green)]">● running</span>
84
+ ) : (
85
+ <button
86
+ onClick={() => onLaunch(p.name)}
87
+ className="text-[10px] px-2 py-0.5 bg-[var(--accent)] text-white rounded opacity-0 group-hover:opacity-100 transition-opacity"
88
+ >
89
+ Launch Claude
90
+ </button>
91
+ )}
92
+ </div>
93
+ </div>
94
+ );
95
+ })}
96
+ </div>
97
+ {filtered.length === 0 && projects.length === 0 && (
98
+ <div className="p-4 text-center text-xs text-[var(--text-secondary)] space-y-2">
99
+ <p>No projects found</p>
100
+ <p className="text-[10px]">Go to Settings to add project directories</p>
101
+ </div>
102
+ )}
103
+ <div className="p-2 border-t border-[var(--border)] text-[10px] text-[var(--text-secondary)]">
104
+ {projects.length} projects
105
+ </div>
106
+ </div>
107
+ );
108
+ }
@@ -0,0 +1,401 @@
1
+ 'use client';
2
+
3
+ import React, { useState, useEffect, useCallback, useRef } from 'react';
4
+ import TabBar from './TabBar';
5
+ import ProjectDetail from './ProjectDetail';
6
+ import { useSidebarResize } from '@/hooks/useSidebarResize';
7
+
8
+ interface Project {
9
+ name: string;
10
+ path: string;
11
+ root: string;
12
+ hasGit: boolean;
13
+ language: string | null;
14
+ }
15
+
16
+ interface ProjectTab {
17
+ id: number;
18
+ projectPath: string;
19
+ projectName: string;
20
+ hasGit: boolean;
21
+ mountedAt: number; // timestamp for LRU eviction
22
+ }
23
+
24
+ const MAX_MOUNTED_TABS = 5;
25
+ function genTabId(): number { return Date.now() + Math.floor(Math.random() * 10000); }
26
+
27
+ export default function ProjectManager() {
28
+ const { sidebarWidth, onSidebarDragStart } = useSidebarResize({ defaultWidth: 240, minWidth: 140, maxWidth: 400 });
29
+ const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
30
+ const [projects, setProjects] = useState<Project[]>([]);
31
+ const [showClone, setShowClone] = useState(false);
32
+ const [cloneUrl, setCloneUrl] = useState('');
33
+ const [cloneLoading, setCloneLoading] = useState(false);
34
+ const [gitResult, setGitResult] = useState<{ ok?: boolean; error?: string } | null>(null);
35
+ const [favorites, setFavorites] = useState<string[]>([]); // array of project paths
36
+
37
+ // Tab state
38
+ const [tabs, setTabs] = useState<ProjectTab[]>([]);
39
+ const [activeTabId, setActiveTabId] = useState(0);
40
+ const [tabsLoaded, setTabsLoaded] = useState(false);
41
+ const saveTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
42
+
43
+ // Fetch projects
44
+ useEffect(() => {
45
+ fetch('/api/projects').then(r => r.json())
46
+ .then((p: Project[]) => { if (Array.isArray(p)) setProjects(p); })
47
+ .catch(() => {});
48
+ }, []);
49
+
50
+ // Load favorites from DB
51
+ useEffect(() => {
52
+ fetch('/api/favorites').then(r => r.json())
53
+ .then(favs => { if (Array.isArray(favs)) setFavorites(favs); })
54
+ .catch(() => {});
55
+ }, []);
56
+
57
+ // Load tabs from API
58
+ useEffect(() => {
59
+ fetch('/api/tabs?type=projects').then(r => r.json())
60
+ .then(data => {
61
+ if (Array.isArray(data.tabs) && data.tabs.length > 0) {
62
+ const maxId = Math.max(...data.tabs.map((t: any) => t.id || 0));
63
+ setTabs(data.tabs.map((t: any) => ({ ...t, mountedAt: Date.now() })));
64
+ setActiveTabId(data.activeTabId || data.tabs[0].id);
65
+ }
66
+ setTabsLoaded(true);
67
+ })
68
+ .catch(() => setTabsLoaded(true));
69
+ }, []);
70
+
71
+ // Persist tabs (debounced)
72
+ const persistTabs = useCallback((newTabs: ProjectTab[], newActiveId: number) => {
73
+ if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
74
+ saveTimerRef.current = setTimeout(() => {
75
+ fetch('/api/tabs?type=projects', {
76
+ method: 'POST',
77
+ headers: { 'Content-Type': 'application/json' },
78
+ body: JSON.stringify({
79
+ tabs: newTabs.map(t => ({ id: t.id, projectPath: t.projectPath, projectName: t.projectName, hasGit: t.hasGit })),
80
+ activeTabId: newActiveId,
81
+ }),
82
+ }).catch(() => {});
83
+ }, 500);
84
+ }, []);
85
+
86
+ // Save favorites to settings
87
+ const saveFavorite = useCallback((projectPath: string, add: boolean) => {
88
+ fetch('/api/favorites', {
89
+ method: 'POST',
90
+ headers: { 'Content-Type': 'application/json' },
91
+ body: JSON.stringify({ action: add ? 'add' : 'remove', projectPath }),
92
+ }).then(r => r.json())
93
+ .then(favs => { if (Array.isArray(favs)) setFavorites(favs); })
94
+ .catch(() => {});
95
+ }, []);
96
+
97
+ const toggleFavorite = useCallback((projectPath: string) => {
98
+ const isFav = favorites.includes(projectPath);
99
+ // Optimistic update
100
+ setFavorites(prev => isFav ? prev.filter(p => p !== projectPath) : [...prev, projectPath]);
101
+ saveFavorite(projectPath, !isFav);
102
+ }, [favorites, saveFavorite]);
103
+
104
+ // Open a project in a tab
105
+ const openProjectTab = useCallback((p: Project) => {
106
+ setTabs(prev => {
107
+ const existing = prev.find(t => t.projectPath === p.path);
108
+ if (existing) {
109
+ // Activate existing tab
110
+ const updated = prev.map(t => t.id === existing.id ? { ...t, mountedAt: Date.now() } : t);
111
+ setActiveTabId(existing.id);
112
+ persistTabs(updated, existing.id);
113
+ return updated;
114
+ }
115
+ // Create new tab
116
+ const newTab: ProjectTab = {
117
+ id: genTabId(),
118
+ projectPath: p.path,
119
+ projectName: p.name,
120
+ hasGit: p.hasGit,
121
+ mountedAt: Date.now(),
122
+ };
123
+ const updated = [...prev, newTab];
124
+ setActiveTabId(newTab.id);
125
+ persistTabs(updated, newTab.id);
126
+ return updated;
127
+ });
128
+ }, [persistTabs]);
129
+
130
+ const activateTab = useCallback((id: number) => {
131
+ setActiveTabId(id);
132
+ setTabs(prev => {
133
+ const updated = prev.map(t => t.id === id ? { ...t, mountedAt: Date.now() } : t);
134
+ persistTabs(updated, id);
135
+ return updated;
136
+ });
137
+ }, [persistTabs]);
138
+
139
+ const closeTab = useCallback((id: number) => {
140
+ setTabs(prev => {
141
+ const idx = prev.findIndex(t => t.id === id);
142
+ const updated = prev.filter(t => t.id !== id);
143
+ if (id === activeTabId && updated.length > 0) {
144
+ // Activate nearest tab
145
+ const newIdx = Math.min(idx, updated.length - 1);
146
+ const newActiveId = updated[newIdx].id;
147
+ setActiveTabId(newActiveId);
148
+ persistTabs(updated, newActiveId);
149
+ } else if (updated.length === 0) {
150
+ setActiveTabId(0);
151
+ persistTabs(updated, 0);
152
+ } else {
153
+ persistTabs(updated, activeTabId);
154
+ }
155
+ return updated;
156
+ });
157
+ }, [activeTabId, persistTabs]);
158
+
159
+ // Determine which tabs to mount (max 5, LRU eviction)
160
+ const mountedTabIds = new Set<number>();
161
+ // Always mount active tab
162
+ if (activeTabId) mountedTabIds.add(activeTabId);
163
+ // Add rest sorted by mountedAt desc
164
+ const sortedByRecency = [...tabs].sort((a, b) => b.mountedAt - a.mountedAt);
165
+ for (const t of sortedByRecency) {
166
+ if (mountedTabIds.size >= MAX_MOUNTED_TABS) break;
167
+ mountedTabIds.add(t.id);
168
+ }
169
+
170
+ const handleClone = async () => {
171
+ if (!cloneUrl.trim()) return;
172
+ setCloneLoading(true);
173
+ setGitResult(null);
174
+ try {
175
+ const res = await fetch('/api/git', {
176
+ method: 'POST',
177
+ headers: { 'Content-Type': 'application/json' },
178
+ body: JSON.stringify({ action: 'clone', repoUrl: cloneUrl.trim() }),
179
+ });
180
+ const data = await res.json();
181
+ if (data.ok) {
182
+ setCloneUrl('');
183
+ setShowClone(false);
184
+ const pRes = await fetch('/api/projects');
185
+ const pData = await pRes.json();
186
+ if (Array.isArray(pData)) setProjects(pData);
187
+ setGitResult({ ok: true });
188
+ } else {
189
+ setGitResult(data);
190
+ }
191
+ } catch (e: any) {
192
+ setGitResult({ error: e.message });
193
+ }
194
+ setCloneLoading(false);
195
+ };
196
+
197
+ // Group projects by root
198
+ const [collapsedRoots, setCollapsedRoots] = useState<Set<string>>(new Set());
199
+ const roots = [...new Set(projects.map(p => p.root))].sort();
200
+ const favoriteProjects = projects
201
+ .filter(p => favorites.includes(p.path))
202
+ .sort((a, b) => a.name.localeCompare(b.name));
203
+
204
+ const toggleRoot = (root: string) => {
205
+ setCollapsedRoots(prev => {
206
+ const next = new Set(prev);
207
+ if (next.has(root)) next.delete(root); else next.add(root);
208
+ return next;
209
+ });
210
+ };
211
+
212
+ const activeTab = tabs.find(t => t.id === activeTabId);
213
+
214
+ return (
215
+ <div className="flex-1 flex min-h-0">
216
+ {/* Collapsed sidebar — narrow strip with project initials */}
217
+ {sidebarCollapsed && (
218
+ <div className="w-10 border-r border-[var(--border)] flex flex-col shrink-0 overflow-hidden">
219
+ <button onClick={() => setSidebarCollapsed(false)}
220
+ className="w-full text-sm text-[var(--text-secondary)] hover:text-[var(--accent)] py-3 hover:bg-[var(--bg-secondary)] transition-colors"
221
+ title="Expand sidebar">
222
+
223
+ </button>
224
+ <div className="flex-1 overflow-y-auto">
225
+ {[...projects].sort((a, b) => a.name.localeCompare(b.name)).map(p => {
226
+ const isActive = activeTab?.projectPath === p.path;
227
+ const initial = p.name.slice(0, 2).toUpperCase();
228
+ return (
229
+ <button key={p.path}
230
+ onClick={() => openProjectTab(p)}
231
+ title={p.name}
232
+ className={`w-full py-1.5 text-[9px] font-bold text-center ${
233
+ isActive ? 'text-[var(--accent)] bg-[var(--accent)]/10' : 'text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-secondary)]'
234
+ }`}>
235
+ {initial}
236
+ </button>
237
+ );
238
+ })}
239
+ </div>
240
+ </div>
241
+ )}
242
+
243
+ {/* Full sidebar — project list */}
244
+ {!sidebarCollapsed && <>
245
+ <aside style={{ width: sidebarWidth }} className="border-r border-[var(--border)] flex flex-col shrink-0">
246
+ <div className="px-3 py-2 border-b border-[var(--border)] flex items-center justify-between">
247
+ <span className="text-[11px] font-semibold text-[var(--text-primary)]">Projects</span>
248
+ <button
249
+ onClick={() => setShowClone(v => !v)}
250
+ className={`text-[10px] px-2 py-0.5 rounded ${showClone ? 'text-white bg-[var(--accent)]' : 'text-[var(--accent)] hover:bg-[var(--accent)]/10'}`}
251
+ >
252
+ + Clone
253
+ </button>
254
+ </div>
255
+
256
+ {/* Clone form */}
257
+ {showClone && (
258
+ <div className="p-2 border-b border-[var(--border)] space-y-2">
259
+ <input
260
+ value={cloneUrl}
261
+ onChange={e => setCloneUrl(e.target.value)}
262
+ onKeyDown={e => e.key === 'Enter' && handleClone()}
263
+ placeholder="https://github.com/user/repo.git"
264
+ className="w-full text-xs bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1.5 text-[var(--text-primary)] font-mono focus:outline-none focus:border-[var(--accent)]"
265
+ />
266
+ <button
267
+ onClick={handleClone}
268
+ disabled={cloneLoading || !cloneUrl.trim()}
269
+ className="w-full text-[10px] px-2 py-1 bg-[var(--accent)] text-white rounded hover:opacity-90 disabled:opacity-50"
270
+ >
271
+ {cloneLoading ? 'Cloning...' : 'Clone Repository'}
272
+ </button>
273
+ </div>
274
+ )}
275
+
276
+ {/* Project list */}
277
+ <div className="flex-1 overflow-y-auto">
278
+ {/* Favorites section */}
279
+ {favoriteProjects.length > 0 && (
280
+ <div>
281
+ <button
282
+ onClick={() => toggleRoot('__favorites__')}
283
+ className="w-full px-3 py-1 text-[9px] text-[var(--yellow)] uppercase bg-[var(--bg-tertiary)] flex items-center gap-1 hover:bg-[var(--border)]/30"
284
+ >
285
+ <span className="text-[8px]">{collapsedRoots.has('__favorites__') ? '▸' : '▾'}</span>
286
+ <span>★</span> Favorites ({favoriteProjects.length})
287
+ </button>
288
+ {!collapsedRoots.has('__favorites__') && favoriteProjects.map(p => (
289
+ <button
290
+ key={`fav-${p.path}`}
291
+ onClick={() => openProjectTab(p)}
292
+ className={`w-full text-left px-3 py-1.5 text-xs border-b border-[var(--border)]/30 flex items-center gap-2 ${
293
+ tabs.find(t => t.id === activeTabId)?.projectPath === p.path ? 'bg-[var(--accent)]/10 text-[var(--accent)]' : 'hover:bg-[var(--bg-tertiary)] text-[var(--text-primary)]'
294
+ }`}
295
+ >
296
+ <span
297
+ onClick={(e) => { e.stopPropagation(); toggleFavorite(p.path); }}
298
+ className="text-[13px] text-[var(--yellow)] shrink-0 cursor-pointer leading-none"
299
+ title="Remove from favorites"
300
+ >★</span>
301
+ <span className="truncate">{p.name}</span>
302
+ {p.language && <span className="text-[8px] text-[var(--text-secondary)] ml-auto shrink-0">{p.language}</span>}
303
+ {p.hasGit && <span className="text-[8px] text-[var(--accent)] shrink-0">git</span>}
304
+ </button>
305
+ ))}
306
+ </div>
307
+ )}
308
+
309
+ {/* All projects by root */}
310
+ {roots.map(root => {
311
+ const rootName = root.split('/').pop() || root;
312
+ const rootProjects = projects.filter(p => p.root === root).sort((a, b) => a.name.localeCompare(b.name));
313
+ const isCollapsed = collapsedRoots.has(root);
314
+ return (
315
+ <div key={root}>
316
+ <button
317
+ onClick={() => toggleRoot(root)}
318
+ className="w-full px-3 py-1 text-[9px] text-[var(--text-secondary)] uppercase bg-[var(--bg-tertiary)] flex items-center gap-1 hover:bg-[var(--border)]/30"
319
+ >
320
+ <span className="text-[8px]">{isCollapsed ? '▸' : '▾'}</span>
321
+ {rootName} ({rootProjects.length})
322
+ </button>
323
+ {!isCollapsed && rootProjects.map(p => (
324
+ <button
325
+ key={p.path}
326
+ onClick={() => openProjectTab(p)}
327
+ className={`w-full text-left px-3 py-1.5 text-xs border-b border-[var(--border)]/30 flex items-center gap-2 ${
328
+ tabs.find(t => t.id === activeTabId)?.projectPath === p.path ? 'bg-[var(--accent)]/10 text-[var(--accent)]' : 'hover:bg-[var(--bg-tertiary)] text-[var(--text-primary)]'
329
+ }`}
330
+ >
331
+ <span
332
+ onClick={(e) => { e.stopPropagation(); toggleFavorite(p.path); }}
333
+ className={`text-[13px] shrink-0 cursor-pointer leading-none ${favorites.includes(p.path) ? 'text-[var(--yellow)]' : 'text-[var(--text-secondary)]/30 hover:text-[var(--yellow)]'}`}
334
+ title={favorites.includes(p.path) ? 'Remove from favorites' : 'Add to favorites'}
335
+ >{favorites.includes(p.path) ? '★' : '☆'}</span>
336
+ <span className="truncate">{p.name}</span>
337
+ {p.language && <span className="text-[8px] text-[var(--text-secondary)] ml-auto shrink-0">{p.language}</span>}
338
+ {p.hasGit && <span className="text-[8px] text-[var(--accent)] shrink-0">git</span>}
339
+ </button>
340
+ ))}
341
+ </div>
342
+ );
343
+ })}
344
+ </div>
345
+ </aside>
346
+ {/* Resize handle + collapse button */}
347
+ <div className="flex flex-col shrink-0">
348
+ <button onClick={() => setSidebarCollapsed(true)}
349
+ className="text-sm text-[var(--text-secondary)] hover:text-[var(--accent)] py-2 px-1 hover:bg-[var(--bg-secondary)] transition-colors"
350
+ title="Collapse sidebar">
351
+
352
+ </button>
353
+ <div onMouseDown={onSidebarDragStart} className="flex-1 w-1 cursor-col-resize hover:bg-[var(--accent)]/30 bg-[var(--border)]" />
354
+ </div>
355
+ </>}
356
+
357
+ {/* Main area */}
358
+ <div className="flex-1 flex flex-col min-w-0">
359
+ {/* Tab bar */}
360
+ {tabs.length > 0 && (
361
+ <TabBar
362
+ tabs={tabs.map(t => ({ id: t.id, label: t.projectName }))}
363
+ activeId={activeTabId}
364
+ onActivate={activateTab}
365
+ onClose={closeTab}
366
+ />
367
+ )}
368
+
369
+ {/* Tab content */}
370
+ {tabs.length > 0 ? (
371
+ <div className="flex-1 flex flex-col min-h-0 relative">
372
+ {tabs.map(tab => {
373
+ if (!mountedTabIds.has(tab.id)) return null;
374
+ const isActive = tab.id === activeTabId;
375
+ return (
376
+ <div
377
+ key={tab.id}
378
+ className="flex-1 flex flex-col min-h-0"
379
+ style={{ display: isActive ? 'flex' : 'none' }}
380
+ >
381
+ <ProjectDetail
382
+ projectPath={tab.projectPath}
383
+ projectName={tab.projectName}
384
+ hasGit={tab.hasGit}
385
+ />
386
+ </div>
387
+ );
388
+ })}
389
+ </div>
390
+ ) : (
391
+ <div className="flex-1 flex items-center justify-center text-[var(--text-secondary)]">
392
+ <div className="text-center space-y-2">
393
+ <p className="text-sm">Select a project</p>
394
+ <p className="text-xs">{projects.length} projects across {roots.length} directories</p>
395
+ </div>
396
+ </div>
397
+ )}
398
+ </div>
399
+ </div>
400
+ );
401
+ }
@@ -0,0 +1,74 @@
1
+ 'use client';
2
+
3
+ import type { Session } from '@/src/types';
4
+
5
+ const statusConfig = {
6
+ running: { icon: '●', color: 'text-[var(--green)]' },
7
+ idle: { icon: '●', color: 'text-[var(--accent)]' },
8
+ paused: { icon: '○', color: 'text-[var(--yellow)]' },
9
+ archived: { icon: '○', color: 'text-[var(--text-secondary)]' },
10
+ error: { icon: '●', color: 'text-[var(--red)]' },
11
+ };
12
+
13
+ const providerLabels: Record<string, string> = {
14
+ anthropic: 'Claude',
15
+ google: 'Gemini',
16
+ openai: 'OpenAI',
17
+ grok: 'Grok',
18
+ };
19
+
20
+ export default function SessionList({
21
+ sessions,
22
+ activeId,
23
+ onSelect,
24
+ }: {
25
+ sessions: Session[];
26
+ activeId: string | null;
27
+ onSelect: (id: string) => void;
28
+ }) {
29
+ return (
30
+ <div className="flex-1 overflow-y-auto">
31
+ {sessions.map(s => {
32
+ const cfg = statusConfig[s.status] || statusConfig.idle;
33
+ const isActive = s.id === activeId;
34
+
35
+ return (
36
+ <button
37
+ key={s.id}
38
+ onClick={() => onSelect(s.id)}
39
+ className={`w-full text-left px-3 py-2.5 border-b border-[var(--border)] hover:bg-[var(--bg-tertiary)] transition-colors ${
40
+ isActive ? 'bg-[var(--bg-tertiary)] border-l-2 border-l-[var(--accent)]' : ''
41
+ }`}
42
+ >
43
+ <div className="flex items-center gap-2">
44
+ <span className={`text-xs ${cfg.color}`}>{cfg.icon}</span>
45
+ <span className="text-sm font-medium truncate">{s.name}</span>
46
+ </div>
47
+ <div className="flex items-center gap-2 mt-0.5 ml-4">
48
+ <span className="text-[10px] text-[var(--text-secondary)]">
49
+ {providerLabels[s.provider] || s.provider}
50
+ </span>
51
+ <span className="text-[10px] text-[var(--text-secondary)]">
52
+ {s.memory.strategy}
53
+ </span>
54
+ <span className="text-[10px] text-[var(--text-secondary)]">
55
+ {s.messageCount}msg
56
+ </span>
57
+ </div>
58
+ {s.lastMessage && (
59
+ <p className="text-[10px] text-[var(--text-secondary)] mt-0.5 ml-4 truncate">
60
+ {s.lastMessage.slice(0, 60)}
61
+ </p>
62
+ )}
63
+ </button>
64
+ );
65
+ })}
66
+
67
+ {sessions.length === 0 && (
68
+ <div className="p-4 text-center text-xs text-[var(--text-secondary)]">
69
+ No sessions yet
70
+ </div>
71
+ )}
72
+ </div>
73
+ );
74
+ }