@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,472 @@
1
+ 'use client';
2
+
3
+ import { useState, useEffect, useCallback } from 'react';
4
+
5
+ interface PluginSource {
6
+ id: string;
7
+ name: string;
8
+ icon: string;
9
+ version: string;
10
+ author: string;
11
+ description: string;
12
+ source: 'builtin' | 'local' | 'registry';
13
+ installed: boolean;
14
+ }
15
+
16
+ interface PluginInstance {
17
+ id: string;
18
+ name: string;
19
+ source: string; // plugin definition ID
20
+ icon: string;
21
+ config: Record<string, any>;
22
+ enabled: boolean;
23
+ }
24
+
25
+ interface PluginDetail {
26
+ id: string;
27
+ name: string;
28
+ icon: string;
29
+ version: string;
30
+ author?: string;
31
+ description?: string;
32
+ config: Record<string, { type: string; label?: string; description?: string; required?: boolean; default?: any; options?: string[] }>;
33
+ params: Record<string, { type: string; label?: string; description?: string; required?: boolean; default?: any }>;
34
+ actions: Record<string, { run: string; method?: string; url?: string; command?: string }>;
35
+ defaultAction?: string;
36
+ }
37
+
38
+ export default function PluginsPanel() {
39
+ const [plugins, setPlugins] = useState<PluginSource[]>([]);
40
+ const [instances, setInstances] = useState<PluginInstance[]>([]);
41
+ const [selectedId, setSelectedId] = useState<string | null>(null);
42
+ const [selectedInstance, setSelectedInstance] = useState<string | null>(null);
43
+ const [detail, setDetail] = useState<PluginDetail | null>(null);
44
+ const [installedConfig, setInstalledConfig] = useState<Record<string, any> | null>(null);
45
+ const [configValues, setConfigValues] = useState<Record<string, any>>({});
46
+ const [configSaved, setConfigSaved] = useState(false);
47
+ const [filter, setFilter] = useState<'all' | 'installed'>('all');
48
+ const [loading, setLoading] = useState(true);
49
+ const [testResult, setTestResult] = useState<{ ok: boolean; output: any; error?: string; duration?: number } | null>(null);
50
+ const [testAction, setTestAction] = useState('');
51
+ const [testParams, setTestParams] = useState('{}');
52
+ const [testing, setTesting] = useState(false);
53
+ // New instance form
54
+ const [showNewInstance, setShowNewInstance] = useState(false);
55
+ const [newInstanceName, setNewInstanceName] = useState('');
56
+
57
+ const fetchPlugins = useCallback(async () => {
58
+ setLoading(true);
59
+ try {
60
+ const [allRes, instRes] = await Promise.all([
61
+ fetch('/api/plugins'),
62
+ fetch('/api/plugins?installed=true'),
63
+ ]);
64
+ const allData = await allRes.json();
65
+ const instData = await instRes.json();
66
+ setPlugins(allData.plugins || []);
67
+ // Build instances list from installed plugins
68
+ const inst: PluginInstance[] = (instData.plugins || []).map((p: any) => ({
69
+ id: p.id,
70
+ name: p.instanceName || p.definition?.name || p.id,
71
+ source: p.source || p.id,
72
+ icon: p.definition?.icon || '🔌',
73
+ config: p.config || {},
74
+ enabled: p.enabled !== false,
75
+ }));
76
+ setInstances(inst);
77
+ } catch {} finally { setLoading(false); }
78
+ }, []);
79
+
80
+ useEffect(() => { fetchPlugins(); }, [fetchPlugins]);
81
+
82
+ const selectPlugin = useCallback(async (id: string, instanceId?: string) => {
83
+ setSelectedId(id);
84
+ setSelectedInstance(instanceId || null);
85
+ setTestResult(null);
86
+ setShowNewInstance(false);
87
+ try {
88
+ const lookupId = instanceId || id;
89
+ const res = await fetch(`/api/plugins?id=${lookupId}`);
90
+ const data = await res.json();
91
+ setDetail(data.plugin || null);
92
+ setInstalledConfig(data.config ?? null);
93
+ setConfigValues(data.config || {});
94
+ if (data.plugin?.defaultAction) setTestAction(data.plugin.defaultAction);
95
+ else if (data.plugin?.actions) setTestAction(Object.keys(data.plugin.actions)[0] || '');
96
+ } catch {}
97
+ }, []);
98
+
99
+ const handleInstall = async () => {
100
+ if (!selectedId) return;
101
+ await fetch('/api/plugins', {
102
+ method: 'POST',
103
+ headers: { 'Content-Type': 'application/json' },
104
+ body: JSON.stringify({ action: 'install', id: selectedId, config: {} }),
105
+ });
106
+ await fetchPlugins();
107
+ await selectPlugin(selectedId);
108
+ // Auto-open new instance form after install
109
+ setShowNewInstance(true);
110
+ setNewInstanceName('');
111
+ setConfigValues({});
112
+ };
113
+
114
+ const handleUninstall = async () => {
115
+ const id = selectedInstance || selectedId;
116
+ if (!id) return;
117
+ await fetch('/api/plugins', {
118
+ method: 'POST',
119
+ headers: { 'Content-Type': 'application/json' },
120
+ body: JSON.stringify({ action: 'uninstall', id }),
121
+ });
122
+ setInstalledConfig(null);
123
+ setSelectedInstance(null);
124
+ await fetchPlugins();
125
+ };
126
+
127
+ const handleSaveConfig = async () => {
128
+ const id = selectedInstance || selectedId;
129
+ if (!id || !detail) return;
130
+ // Merge schema defaults with user-entered values
131
+ const finalConfig: Record<string, any> = {};
132
+ for (const [key, schema] of Object.entries(detail.config)) {
133
+ finalConfig[key] = configValues[key] ?? (schema as any).default ?? '';
134
+ }
135
+ await fetch('/api/plugins', {
136
+ method: 'POST',
137
+ headers: { 'Content-Type': 'application/json' },
138
+ body: JSON.stringify({ action: 'update_config', id, config: finalConfig }),
139
+ });
140
+ setConfigSaved(true);
141
+ setTimeout(() => setConfigSaved(false), 2000);
142
+ await selectPlugin(selectedId!, selectedInstance || undefined);
143
+ };
144
+
145
+ const handleCreateInstance = async () => {
146
+ if (!selectedId || !newInstanceName.trim() || !detail) return;
147
+ // Merge schema defaults with user-entered values
148
+ const finalConfig: Record<string, any> = {};
149
+ for (const [key, schema] of Object.entries(detail.config)) {
150
+ finalConfig[key] = configValues[key] ?? (schema as any).default ?? '';
151
+ }
152
+ const res = await fetch('/api/plugins', {
153
+ method: 'POST',
154
+ headers: { 'Content-Type': 'application/json' },
155
+ body: JSON.stringify({ action: 'create_instance', source: selectedId, name: newInstanceName.trim(), config: finalConfig }),
156
+ });
157
+ const data = await res.json();
158
+ if (!res.ok) {
159
+ alert(data.error || 'Failed to create instance');
160
+ return;
161
+ }
162
+ setShowNewInstance(false);
163
+ setNewInstanceName('');
164
+ await fetchPlugins();
165
+ // Auto-select the new instance
166
+ if (data.instanceId) {
167
+ await selectPlugin(selectedId, data.instanceId);
168
+ }
169
+ };
170
+
171
+ const handleTest = async () => {
172
+ const id = selectedInstance || selectedId;
173
+ if (!id || !testAction) return;
174
+ setTesting(true);
175
+ setTestResult(null);
176
+ try {
177
+ let params = {};
178
+ try { params = JSON.parse(testParams); } catch {}
179
+ const res = await fetch('/api/plugins', {
180
+ method: 'POST',
181
+ headers: { 'Content-Type': 'application/json' },
182
+ body: JSON.stringify({ action: 'test', id, actionName: testAction, params }),
183
+ });
184
+ setTestResult(await res.json());
185
+ } catch (err: any) {
186
+ setTestResult({ ok: false, output: {}, error: err.message });
187
+ } finally { setTesting(false); }
188
+ };
189
+
190
+ const filtered = filter === 'installed' ? plugins.filter(p => p.installed || instances.some(i => i.source === p.id)) : plugins;
191
+ const pluginInstances = (id: string) => instances.filter(i => i.source === id && i.id !== id);
192
+
193
+ if (loading) return <div className="p-4 text-xs text-[var(--text-secondary)]">Loading plugins...</div>;
194
+
195
+ return (
196
+ <div className="flex-1 flex flex-col min-h-0">
197
+ {/* Header */}
198
+ <div className="flex items-center justify-between px-4 py-2 border-b border-[var(--border)] shrink-0">
199
+ <div className="flex items-center gap-2">
200
+ <span className="text-xs font-semibold text-[var(--text-primary)]">Plugins</span>
201
+ <span className="text-[10px] text-[var(--text-secondary)]">{instances.length} instances from {plugins.filter(p => p.installed).length} plugins</span>
202
+ </div>
203
+ <div className="flex items-center bg-[var(--bg-tertiary)] rounded p-0.5">
204
+ {(['all', 'installed'] as const).map(f => (
205
+ <button key={f} onClick={() => setFilter(f)}
206
+ className={`text-[10px] px-2 py-0.5 rounded transition-colors ${filter === f ? 'bg-[var(--bg-secondary)] text-[var(--text-primary)] shadow-sm' : 'text-[var(--text-secondary)]'}`}
207
+ >{f === 'all' ? 'All' : 'Installed'}</button>
208
+ ))}
209
+ </div>
210
+ </div>
211
+
212
+ <div className="flex-1 flex min-h-0">
213
+ {/* Plugin list with instances */}
214
+ <div className="w-56 overflow-y-auto shrink-0 border-r border-[var(--border)]">
215
+ {filtered.length === 0 && (
216
+ <div className="p-4 text-xs text-[var(--text-secondary)] text-center">No plugins found</div>
217
+ )}
218
+ {filtered.map(p => {
219
+ const pInstances = pluginInstances(p.id);
220
+ const isSelected = selectedId === p.id && !selectedInstance;
221
+ return (
222
+ <div key={p.id}>
223
+ <div
224
+ onClick={() => selectPlugin(p.id)}
225
+ className={`px-3 py-2 cursor-pointer border-b border-[var(--border)]/50 transition-colors ${
226
+ isSelected ? 'bg-[var(--bg-secondary)]' : 'hover:bg-[var(--bg-tertiary)]'
227
+ }`}
228
+ >
229
+ <div className="flex items-center gap-2">
230
+ <span className="text-sm">{p.icon}</span>
231
+ <span className="text-[11px] font-semibold text-[var(--text-primary)] truncate flex-1">{p.name}</span>
232
+ {p.installed && <span className="w-1.5 h-1.5 rounded-full bg-green-400 shrink-0" />}
233
+ </div>
234
+ <div className="text-[10px] text-[var(--text-secondary)] mt-0.5 line-clamp-1">{p.description}</div>
235
+ <div className="flex items-center gap-2 mt-1">
236
+ <span className="text-[9px] text-[var(--text-secondary)]">v{p.version}</span>
237
+ {pInstances.length > 0 && <span className="text-[9px] text-[var(--accent)]">{pInstances.length} instance{pInstances.length > 1 ? 's' : ''}</span>}
238
+ </div>
239
+ </div>
240
+ {/* Instances */}
241
+ {pInstances.map(inst => (
242
+ <div key={inst.id}
243
+ onClick={() => selectPlugin(p.id, inst.id)}
244
+ className={`pl-8 pr-3 py-1.5 cursor-pointer border-b border-[var(--border)]/30 transition-colors ${
245
+ selectedInstance === inst.id ? 'bg-[var(--bg-secondary)]' : 'hover:bg-[var(--bg-tertiary)]'
246
+ }`}
247
+ >
248
+ <div className="flex items-center gap-1.5">
249
+ <span className="text-[9px]">{p.icon}</span>
250
+ <span className="text-[10px] text-[var(--text-primary)] truncate">{inst.name}</span>
251
+ <span className={`w-1.5 h-1.5 rounded-full shrink-0 ${inst.enabled ? 'bg-green-400' : 'bg-gray-500'}`} />
252
+ </div>
253
+ </div>
254
+ ))}
255
+ </div>
256
+ );
257
+ })}
258
+ </div>
259
+
260
+ {/* Detail panel */}
261
+ <div className="flex-1 overflow-y-auto p-4">
262
+ {!selectedId || !detail ? (
263
+ <div className="flex-1 flex items-center justify-center text-xs text-[var(--text-secondary)] h-full">
264
+ Select a plugin to view details
265
+ </div>
266
+ ) : (
267
+ <div className="space-y-4 max-w-xl">
268
+ {/* Header */}
269
+ <div className="flex items-center gap-3">
270
+ <span className="text-2xl">{detail.icon}</span>
271
+ <div>
272
+ <h2 className="text-sm font-semibold text-[var(--text-primary)]">
273
+ {selectedInstance ? instances.find(i => i.id === selectedInstance)?.name || selectedInstance : detail.name}
274
+ </h2>
275
+ <p className="text-[10px] text-[var(--text-secondary)]">
276
+ {selectedInstance ? `Instance of ${detail.name}` : `v${detail.version} by ${detail.author || 'unknown'}`}
277
+ </p>
278
+ </div>
279
+ <div className="flex-1" />
280
+ <div className="flex items-center gap-1.5">
281
+ {/* Create instance button (only for installed base plugins) */}
282
+ {installedConfig !== null && !selectedInstance && (
283
+ <button onClick={() => { setShowNewInstance(true); setNewInstanceName(''); setConfigValues({}); }}
284
+ className="text-[10px] px-3 py-1 rounded bg-[var(--accent)]/20 text-[var(--accent)] hover:bg-[var(--accent)]/30 transition-colors"
285
+ >+ Instance</button>
286
+ )}
287
+ {installedConfig !== null || selectedInstance ? (
288
+ <button onClick={handleUninstall}
289
+ className="text-[10px] px-3 py-1 rounded bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors"
290
+ >{selectedInstance ? 'Delete' : 'Uninstall'}</button>
291
+ ) : (
292
+ <button onClick={handleInstall}
293
+ className="text-[10px] px-3 py-1 rounded bg-[var(--accent)]/20 text-[var(--accent)] hover:bg-[var(--accent)]/30 transition-colors"
294
+ >Install</button>
295
+ )}
296
+ </div>
297
+ </div>
298
+
299
+ {/* New instance form */}
300
+ {showNewInstance && (
301
+ <div className="rounded border border-[var(--accent)]/30 bg-[var(--accent)]/5 p-3 space-y-2">
302
+ <h3 className="text-[11px] font-semibold text-[var(--accent)]">New Instance</h3>
303
+ <div>
304
+ <label className="text-[10px] text-[var(--text-secondary)] block mb-0.5">Instance Name</label>
305
+ <input value={newInstanceName} onChange={e => setNewInstanceName(e.target.value)}
306
+ placeholder={`e.g., ${detail.name} Production`}
307
+ className="w-full bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1 text-[11px] text-[var(--text-primary)]"
308
+ />
309
+ </div>
310
+ {/* Config fields for new instance */}
311
+ {Object.entries(detail.config).map(([key, schema]) => (
312
+ <div key={key}>
313
+ <label className="text-[10px] text-[var(--text-secondary)] block mb-0.5">
314
+ {schema.label || key} {schema.required && <span className="text-red-400">*</span>}
315
+ {schema.description && <span className="text-[8px] text-[var(--text-secondary)]/60 ml-1">{schema.description}</span>}
316
+ </label>
317
+ {schema.type === 'select' ? (
318
+ <select
319
+ value={configValues[key] || schema.default || ''}
320
+ onChange={e => setConfigValues({ ...configValues, [key]: e.target.value })}
321
+ className="w-full bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1 text-[11px] text-[var(--text-primary)]"
322
+ >
323
+ <option value="">Select...</option>
324
+ {(schema.options || []).map((o: string) => <option key={o} value={o}>{o}</option>)}
325
+ </select>
326
+ ) : schema.type === 'boolean' ? (
327
+ <input type="checkbox"
328
+ checked={configValues[key] === true || configValues[key] === 'true'}
329
+ onChange={e => setConfigValues({ ...configValues, [key]: e.target.checked })}
330
+ className="accent-[var(--accent)]"
331
+ />
332
+ ) : (
333
+ <input
334
+ type={schema.type === 'secret' ? 'password' : schema.type === 'number' ? 'number' : 'text'}
335
+ value={configValues[key] ?? schema.default ?? ''}
336
+ onChange={e => setConfigValues({ ...configValues, [key]: e.target.value })}
337
+ placeholder={schema.description || ''}
338
+ className="w-full bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1 text-[11px] text-[var(--text-primary)]"
339
+ />
340
+ )}
341
+ </div>
342
+ ))}
343
+ <div className="flex gap-2">
344
+ <button onClick={handleCreateInstance} disabled={!newInstanceName.trim()}
345
+ className="text-[10px] px-3 py-1 rounded bg-[var(--accent)] text-white hover:opacity-90 disabled:opacity-40"
346
+ >Create</button>
347
+ <button onClick={() => setShowNewInstance(false)}
348
+ className="text-[10px] px-3 py-1 rounded text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
349
+ >Cancel</button>
350
+ </div>
351
+ </div>
352
+ )}
353
+
354
+ {detail.description && !showNewInstance && (
355
+ <p className="text-[11px] text-[var(--text-secondary)]">{detail.description}</p>
356
+ )}
357
+
358
+ {/* Actions */}
359
+ {!showNewInstance && (
360
+ <div>
361
+ <h3 className="text-[11px] font-semibold text-[var(--text-primary)] mb-1.5">Actions</h3>
362
+ <div className="grid gap-1.5">
363
+ {Object.entries(detail.actions).map(([name, action]) => (
364
+ <div key={name} className="flex items-center gap-2 px-2.5 py-1.5 rounded bg-[var(--bg-tertiary)]">
365
+ <span className="text-[10px] font-mono font-semibold text-[var(--accent)]">{name}</span>
366
+ <span className="text-[9px] px-1.5 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)]">{action.run}</span>
367
+ {action.url && <span className="text-[9px] text-[var(--text-secondary)] truncate">{action.method || 'GET'} {action.url}</span>}
368
+ {action.command && <span className="text-[9px] text-[var(--text-secondary)] truncate font-mono">{action.command.slice(0, 60)}</span>}
369
+ {detail.defaultAction === name && <span className="text-[8px] px-1 py-0.5 rounded bg-[var(--accent)]/10 text-[var(--accent)]">default</span>}
370
+ </div>
371
+ ))}
372
+ </div>
373
+ </div>
374
+ )}
375
+
376
+ {/* Hint: create instance if base plugin has no instances */}
377
+ {!showNewInstance && !selectedInstance && installedConfig !== null && pluginInstances(selectedId!).length === 0 && Object.keys(detail.config).length > 0 && (
378
+ <div className="rounded border border-dashed border-[var(--accent)]/30 bg-[var(--accent)]/5 p-3 text-center">
379
+ <p className="text-[11px] text-[var(--text-secondary)] mb-2">Create an instance to configure and use this plugin</p>
380
+ <button onClick={() => { setShowNewInstance(true); setNewInstanceName(''); setConfigValues({}); }}
381
+ className="text-[10px] px-3 py-1 rounded bg-[var(--accent)] text-white hover:opacity-90"
382
+ >+ Create First Instance</button>
383
+ </div>
384
+ )}
385
+
386
+ {/* Config (for installed plugins and instances) */}
387
+ {!showNewInstance && Object.keys(detail.config).length > 0 && installedConfig !== null && (
388
+ <div>
389
+ <h3 className="text-[11px] font-semibold text-[var(--text-primary)] mb-1.5">Configuration</h3>
390
+ <div className="space-y-2">
391
+ {Object.entries(detail.config).map(([key, schema]) => (
392
+ <div key={key}>
393
+ <label className="text-[10px] text-[var(--text-secondary)] block mb-0.5">
394
+ {schema.label || key} {schema.required && <span className="text-red-400">*</span>}
395
+ </label>
396
+ {schema.type === 'select' ? (
397
+ <select
398
+ value={configValues[key] || schema.default || ''}
399
+ onChange={e => setConfigValues({ ...configValues, [key]: e.target.value })}
400
+ className="w-full bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1 text-[11px] text-[var(--text-primary)]"
401
+ >
402
+ <option value="">Select...</option>
403
+ {(schema.options || []).map(o => <option key={o} value={o}>{o}</option>)}
404
+ </select>
405
+ ) : schema.type === 'boolean' ? (
406
+ <input type="checkbox"
407
+ checked={configValues[key] === true || configValues[key] === 'true'}
408
+ onChange={e => setConfigValues({ ...configValues, [key]: e.target.checked })}
409
+ className="accent-[var(--accent)]"
410
+ />
411
+ ) : (
412
+ <input
413
+ type={schema.type === 'secret' ? 'password' : schema.type === 'number' ? 'number' : 'text'}
414
+ value={configValues[key] ?? schema.default ?? ''}
415
+ onChange={e => setConfigValues({ ...configValues, [key]: e.target.value })}
416
+ placeholder={schema.description || ''}
417
+ className="w-full bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1 text-[11px] text-[var(--text-primary)]"
418
+ />
419
+ )}
420
+ </div>
421
+ ))}
422
+ <button onClick={handleSaveConfig}
423
+ className="text-[10px] px-3 py-1 rounded bg-[var(--accent)]/20 text-[var(--accent)] hover:bg-[var(--accent)]/30 transition-colors"
424
+ >{configSaved ? 'Saved!' : 'Save Config'}</button>
425
+ </div>
426
+ </div>
427
+ )}
428
+
429
+ {/* Run Action (only for instances) */}
430
+ {!showNewInstance && selectedInstance && (
431
+ <div>
432
+ <h3 className="text-[11px] font-semibold text-[var(--text-primary)] mb-1.5">Run Action</h3>
433
+ <div className="space-y-2">
434
+ <div className="flex items-center gap-2">
435
+ <select value={testAction} onChange={e => setTestAction(e.target.value)}
436
+ className="bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1 text-[11px] text-[var(--text-primary)]"
437
+ >
438
+ {Object.keys(detail.actions).map(a => <option key={a} value={a}>{a}</option>)}
439
+ </select>
440
+ <button onClick={handleTest} disabled={testing}
441
+ className="text-[10px] px-3 py-1 rounded bg-[var(--accent)] text-white hover:opacity-90 transition-opacity disabled:opacity-50"
442
+ >{testing ? 'Running...' : 'Run'}</button>
443
+ </div>
444
+ <textarea
445
+ value={testParams}
446
+ onChange={e => setTestParams(e.target.value)}
447
+ placeholder='{"key": "value"}'
448
+ rows={3}
449
+ className="w-full bg-[var(--bg-tertiary)] border border-[var(--border)] rounded px-2 py-1.5 text-[10px] font-mono text-[var(--text-primary)] resize-y"
450
+ />
451
+ {testResult && (
452
+ <div className={`rounded p-2.5 text-[10px] font-mono ${testResult.ok ? 'bg-green-500/10 border border-green-500/20' : 'bg-red-500/10 border border-red-500/20'}`}>
453
+ <div className="flex items-center gap-2 mb-1">
454
+ <span className={testResult.ok ? 'text-green-400' : 'text-red-400'}>{testResult.ok ? 'OK' : 'FAILED'}</span>
455
+ {testResult.duration && <span className="text-[var(--text-secondary)]">{testResult.duration}ms</span>}
456
+ </div>
457
+ {testResult.error && <div className="text-red-400 mb-1">{testResult.error}</div>}
458
+ <pre className="text-[var(--text-secondary)] whitespace-pre-wrap break-all max-h-40 overflow-y-auto">
459
+ {JSON.stringify(testResult.output, null, 2)}
460
+ </pre>
461
+ </div>
462
+ )}
463
+ </div>
464
+ </div>
465
+ )}
466
+ </div>
467
+ )}
468
+ </div>
469
+ </div>
470
+ </div>
471
+ );
472
+ }