@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,79 @@
1
+ /**
2
+ * Logger — adds timestamps + writes to forge.log file.
3
+ * Call `initLogger()` once at startup.
4
+ * Works in both dev mode (terminal + file) and production (file via redirect).
5
+ */
6
+
7
+ import { appendFileSync, mkdirSync, existsSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+
10
+ // Use globalThis to prevent double-init across forge-server.mjs and init.ts
11
+ const loggerKey = Symbol.for('forge-logger-init');
12
+
13
+ export function initLogger() {
14
+ if ((globalThis as any)[loggerKey]) return;
15
+ (globalThis as any)[loggerKey] = true;
16
+
17
+ // Determine log file path
18
+ // In production mode (FORGE_EXTERNAL_SERVICES=1), stdout is already redirected to forge.log
19
+ // by forge-server.mjs, so we only need to write to file in dev mode
20
+ const isProduction = process.env.FORGE_EXTERNAL_SERVICES === '1';
21
+ let logFile: string | null = null;
22
+ if (!isProduction) {
23
+ try {
24
+ const { getDataDir } = require('./dirs');
25
+ const dataDir = getDataDir();
26
+ if (!existsSync(dataDir)) mkdirSync(dataDir, { recursive: true });
27
+ logFile = join(dataDir, 'forge.log');
28
+ } catch {}
29
+ }
30
+
31
+ const origLog = console.log;
32
+ const origError = console.error;
33
+ const origWarn = console.warn;
34
+
35
+ const ts = () => new Date().toISOString().replace('T', ' ').slice(0, 19);
36
+
37
+ const writeToFile = (line: string) => {
38
+ if (!logFile) return;
39
+ try { appendFileSync(logFile, line + '\n'); } catch {}
40
+ };
41
+
42
+ const SENSITIVE_PATTERNS = [
43
+ /(\d{8,})/g, // session codes (8+ digits)
44
+ /(bot\d+:[A-Za-z0-9_-]{30,})/gi, // telegram bot tokens
45
+ /(enc:[A-Za-z0-9+/=.]+)/g, // encrypted values
46
+ /(sk-ant-[A-Za-z0-9_-]+)/g, // anthropic API keys
47
+ /(sk-[A-Za-z0-9]{20,})/g, // openai API keys
48
+ ];
49
+
50
+ const sanitize = (str: string): string => {
51
+ let result = str;
52
+ for (const pattern of SENSITIVE_PATTERNS) {
53
+ result = result.replace(pattern, (match) => match.slice(0, 4) + '****');
54
+ }
55
+ return result;
56
+ };
57
+
58
+ const format = (...args: any[]): string => {
59
+ return args.map(a => typeof a === 'string' ? a : JSON.stringify(a)).join(' ');
60
+ };
61
+
62
+ console.log = (...args: any[]) => {
63
+ const line = `[${ts()}] ${format(...args)}`;
64
+ origLog(line);
65
+ writeToFile(sanitize(line));
66
+ };
67
+
68
+ console.error = (...args: any[]) => {
69
+ const line = `[${ts()}] [ERROR] ${format(...args)}`;
70
+ origError(line);
71
+ writeToFile(sanitize(line));
72
+ };
73
+
74
+ console.warn = (...args: any[]) => {
75
+ const line = `[${ts()}] [WARN] ${format(...args)}`;
76
+ origWarn(line);
77
+ writeToFile(sanitize(line));
78
+ };
79
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * In-app notification system.
3
+ * Stores notifications in SQLite, auto-cleans based on retention setting.
4
+ */
5
+
6
+ import { getDb } from '@/src/core/db/database';
7
+ import { getDbPath } from '@/src/config';
8
+ import { loadSettings } from './settings';
9
+
10
+ export interface Notification {
11
+ id: number;
12
+ type: string; // 'task_done' | 'task_failed' | 'pipeline_done' | 'pipeline_failed' | 'tunnel' | 'system'
13
+ title: string;
14
+ body: string | null;
15
+ read: boolean;
16
+ taskId: string | null;
17
+ createdAt: string;
18
+ }
19
+
20
+ function db() {
21
+ return getDb(getDbPath());
22
+ }
23
+
24
+ /** Add a notification */
25
+ export function addNotification(type: string, title: string, body?: string, taskId?: string) {
26
+ db().prepare(
27
+ 'INSERT INTO notifications (type, title, body, task_id) VALUES (?, ?, ?, ?)'
28
+ ).run(type, title, body || null, taskId || null);
29
+ }
30
+
31
+ /** Get recent notifications (newest first) */
32
+ export function getNotifications(limit = 50, offset = 0): Notification[] {
33
+ const rows = db().prepare(
34
+ 'SELECT * FROM notifications ORDER BY created_at DESC LIMIT ? OFFSET ?'
35
+ ).all(limit, offset) as any[];
36
+ return rows.map(r => ({
37
+ id: r.id,
38
+ type: r.type,
39
+ title: r.title,
40
+ body: r.body,
41
+ read: !!r.read,
42
+ taskId: r.task_id,
43
+ createdAt: r.created_at ? (r.created_at.endsWith('Z') ? r.created_at : r.created_at.replace(' ', 'T') + 'Z') : r.created_at,
44
+ }));
45
+ }
46
+
47
+ /** Count unread notifications */
48
+ export function getUnreadCount(): number {
49
+ const row = db().prepare('SELECT COUNT(*) as count FROM notifications WHERE read = 0').get() as any;
50
+ return row?.count || 0;
51
+ }
52
+
53
+ /** Mark one as read */
54
+ export function markRead(id: number) {
55
+ db().prepare('UPDATE notifications SET read = 1 WHERE id = ?').run(id);
56
+ }
57
+
58
+ /** Mark all as read */
59
+ export function markAllRead() {
60
+ db().prepare('UPDATE notifications SET read = 1 WHERE read = 0').run();
61
+ }
62
+
63
+ /** Delete one notification */
64
+ export function deleteNotification(id: number) {
65
+ db().prepare('DELETE FROM notifications WHERE id = ?').run(id);
66
+ }
67
+
68
+ /** Clean up old notifications based on retention setting */
69
+ export function cleanupNotifications() {
70
+ const settings = loadSettings();
71
+ const days = settings.notificationRetentionDays || 30;
72
+ db().prepare(
73
+ `DELETE FROM notifications WHERE created_at < datetime('now', '-' || ? || ' days')`
74
+ ).run(days);
75
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Notification module — sends task updates via Telegram.
3
+ */
4
+
5
+ import { loadSettings } from './settings';
6
+ import { addNotification } from './notifications';
7
+ import type { Task } from '@/src/types';
8
+
9
+ export async function notifyTaskComplete(task: Task) {
10
+ // Skip pipeline tasks
11
+ let isPipeline = false;
12
+ try { const { pipelineTaskIds } = require('./pipeline'); isPipeline = pipelineTaskIds.has(task.id); } catch {}
13
+ if (isPipeline) return;
14
+
15
+ const cost = task.costUSD != null ? `$${task.costUSD.toFixed(4)}` : 'unknown';
16
+ const duration = task.startedAt && task.completedAt
17
+ ? formatDuration(new Date(task.completedAt).getTime() - new Date(task.startedAt).getTime())
18
+ : 'unknown';
19
+ const model = task.log?.find(e => e.subtype === 'init' && e.content.startsWith('Model:'))?.content.replace('Model: ', '') || 'unknown';
20
+
21
+ // In-app notification (always)
22
+ try {
23
+ addNotification(
24
+ 'task_done',
25
+ `Task done: ${task.projectName}`,
26
+ `${task.prompt.slice(0, 100)} — ${duration}, ${cost}`,
27
+ task.id
28
+ );
29
+ } catch {}
30
+
31
+ const settings = loadSettings();
32
+ if (!settings.notifyOnComplete) return;
33
+
34
+ await sendTelegram(
35
+ `✅ *Task Done*\n\n` +
36
+ `*Project:* ${esc(task.projectName)}\n` +
37
+ `*Task:* ${esc(task.prompt.slice(0, 200))}\n` +
38
+ `*Model:* ${esc(model)}\n` +
39
+ `*Duration:* ${duration}\n` +
40
+ `*Cost:* ${cost}\n\n` +
41
+ `${task.resultSummary ? `*Result:*\n${esc(task.resultSummary.slice(0, 500))}` : '_No summary_'}`
42
+ );
43
+ }
44
+
45
+ export async function notifyTaskFailed(task: Task) {
46
+ // Skip pipeline tasks
47
+ let isPipeline = false;
48
+ try { const { pipelineTaskIds } = require('./pipeline'); isPipeline = pipelineTaskIds.has(task.id); } catch {}
49
+ if (isPipeline) return;
50
+
51
+ // In-app notification (always)
52
+ try {
53
+ addNotification(
54
+ 'task_failed',
55
+ `Task failed: ${task.projectName}`,
56
+ task.error || task.prompt.slice(0, 100),
57
+ task.id
58
+ );
59
+ } catch {}
60
+
61
+ const settings = loadSettings();
62
+ if (!settings.notifyOnFailure) return;
63
+
64
+ await sendTelegram(
65
+ `❌ *Task Failed*\n\n` +
66
+ `*Project:* ${esc(task.projectName)}\n` +
67
+ `*Task:* ${esc(task.prompt.slice(0, 200))}\n` +
68
+ `*Error:* ${esc(task.error || 'Unknown error')}`
69
+ );
70
+ }
71
+
72
+ async function sendTelegram(text: string) {
73
+ const settings = loadSettings();
74
+ const { telegramBotToken, telegramChatId } = settings;
75
+
76
+ if (!telegramBotToken || !telegramChatId) return;
77
+
78
+ try {
79
+ const url = `https://api.telegram.org/bot${telegramBotToken}/sendMessage`;
80
+ const res = await fetch(url, {
81
+ method: 'POST',
82
+ headers: { 'Content-Type': 'application/json' },
83
+ body: JSON.stringify({
84
+ chat_id: telegramChatId,
85
+ text,
86
+ parse_mode: 'Markdown',
87
+ disable_web_page_preview: true,
88
+ }),
89
+ });
90
+
91
+ if (!res.ok) {
92
+ console.error('[notify] Telegram error:', res.status, await res.text());
93
+ }
94
+ } catch (err) {
95
+ console.error('[notify] Telegram send failed:', err);
96
+ }
97
+ }
98
+
99
+ // Escape Markdown special characters
100
+ function esc(s: string): string {
101
+ return s.replace(/[_*[\]()~`>#+=|{}.!-]/g, '\\$&');
102
+ }
103
+
104
+ function formatDuration(ms: number): string {
105
+ if (ms < 60000) return `${Math.round(ms / 1000)}s`;
106
+ if (ms < 3600000) return `${Math.floor(ms / 60000)}m ${Math.round((ms % 60000) / 1000)}s`;
107
+ return `${Math.floor(ms / 3600000)}h ${Math.floor((ms % 3600000) / 60000)}m`;
108
+ }
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Password management.
3
+ *
4
+ * - Admin password: set in Settings, encrypted in settings.yaml
5
+ * Used for: local login, tunnel start, secret changes, Telegram commands
6
+ * - Session code: random 8-digit numeric, generated each time tunnel starts
7
+ * Used for: remote login 2FA (admin password + session code)
8
+ *
9
+ * Local login: admin password only
10
+ * Remote login (tunnel): admin password + session code
11
+ */
12
+
13
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
14
+ import { join, dirname } from 'node:path';
15
+ import { randomInt } from 'node:crypto';
16
+ import { getDataDir } from './dirs';
17
+
18
+ const DATA_DIR = getDataDir();
19
+ const SESSION_CODE_FILE = join(DATA_DIR, 'session-code.json');
20
+
21
+ /** Generate a random 8-digit numeric code */
22
+ function generateSessionCode(): string {
23
+ return String(randomInt(10000000, 99999999));
24
+ }
25
+
26
+ function readSessionCode(): string {
27
+ try {
28
+ if (!existsSync(SESSION_CODE_FILE)) return '';
29
+ const data = JSON.parse(readFileSync(SESSION_CODE_FILE, 'utf-8'));
30
+ return data?.code || '';
31
+ } catch {
32
+ return '';
33
+ }
34
+ }
35
+
36
+ function saveSessionCode(code: string) {
37
+ const dir = dirname(SESSION_CODE_FILE);
38
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
39
+ writeFileSync(SESSION_CODE_FILE, JSON.stringify({ code }), { mode: 0o600 });
40
+ }
41
+
42
+ /** Get the admin password from settings */
43
+ export function getAdminPassword(): string {
44
+ try {
45
+ const { loadSettings } = require('./settings');
46
+ const settings = loadSettings();
47
+ return settings.telegramTunnelPassword || '';
48
+ } catch {
49
+ return '';
50
+ }
51
+ }
52
+
53
+ /** Get current session code (empty if none) */
54
+ export function getSessionCode(): string {
55
+ return readSessionCode();
56
+ }
57
+
58
+ /** Generate new session code. Called on tunnel start. */
59
+ export function rotateSessionCode(): string {
60
+ const code = generateSessionCode();
61
+ saveSessionCode(code);
62
+ console.log(`[password] New session code: ****${code.slice(-2)}`);
63
+ return code;
64
+ }
65
+
66
+ /**
67
+ * Verify login credentials.
68
+ * @param password - admin password
69
+ * @param sessionCode - session code (required for remote, empty for local)
70
+ * @param isRemote - true if accessing via tunnel
71
+ */
72
+ export function verifyLogin(password: string, sessionCode?: string, isRemote?: boolean): boolean {
73
+ if (!password) return false;
74
+
75
+ const admin = getAdminPassword();
76
+ if (!admin) return false;
77
+ if (password !== admin) return false;
78
+
79
+ // Remote access requires session code as 2FA
80
+ if (isRemote) {
81
+ const currentCode = readSessionCode();
82
+ if (!currentCode || sessionCode !== currentCode) return false;
83
+ }
84
+
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Verify admin password for privileged operations
90
+ * (tunnel start, secret changes, Telegram commands).
91
+ */
92
+ export function verifyAdmin(input: string): boolean {
93
+ if (!input) return false;
94
+ const admin = getAdminPassword();
95
+ return admin ? input === admin : false;
96
+ }
97
+