@nexus-cortex/executors 4.26.0

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 (365) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +2 -0
  3. package/README.md +13 -0
  4. package/dist/ExecutorRegistry.d.ts +89 -0
  5. package/dist/ExecutorRegistry.d.ts.map +1 -0
  6. package/dist/ExecutorRegistry.js +219 -0
  7. package/dist/ExecutorRegistry.js.map +1 -0
  8. package/dist/base/BaseTool.d.ts +108 -0
  9. package/dist/base/BaseTool.d.ts.map +1 -0
  10. package/dist/base/BaseTool.js +111 -0
  11. package/dist/base/BaseTool.js.map +1 -0
  12. package/dist/base/ToolRegistry.d.ts +141 -0
  13. package/dist/base/ToolRegistry.d.ts.map +1 -0
  14. package/dist/base/ToolRegistry.js +241 -0
  15. package/dist/base/ToolRegistry.js.map +1 -0
  16. package/dist/base/ToolResult.d.ts +63 -0
  17. package/dist/base/ToolResult.d.ts.map +1 -0
  18. package/dist/base/ToolResult.js +8 -0
  19. package/dist/base/ToolResult.js.map +1 -0
  20. package/dist/base/index.d.ts +10 -0
  21. package/dist/base/index.d.ts.map +1 -0
  22. package/dist/base/index.js +8 -0
  23. package/dist/base/index.js.map +1 -0
  24. package/dist/implementations/addon/CreateArtifactTool.d.ts +221 -0
  25. package/dist/implementations/addon/CreateArtifactTool.d.ts.map +1 -0
  26. package/dist/implementations/addon/CreateArtifactTool.js +1042 -0
  27. package/dist/implementations/addon/CreateArtifactTool.js.map +1 -0
  28. package/dist/implementations/addon/FrameDiffCache.d.ts +166 -0
  29. package/dist/implementations/addon/FrameDiffCache.d.ts.map +1 -0
  30. package/dist/implementations/addon/FrameDiffCache.js +395 -0
  31. package/dist/implementations/addon/FrameDiffCache.js.map +1 -0
  32. package/dist/implementations/addon/H264StreamEncoder.d.ts +84 -0
  33. package/dist/implementations/addon/H264StreamEncoder.d.ts.map +1 -0
  34. package/dist/implementations/addon/H264StreamEncoder.js +203 -0
  35. package/dist/implementations/addon/H264StreamEncoder.js.map +1 -0
  36. package/dist/implementations/addon/HybridScreenshotManager.d.ts +197 -0
  37. package/dist/implementations/addon/HybridScreenshotManager.d.ts.map +1 -0
  38. package/dist/implementations/addon/HybridScreenshotManager.js +415 -0
  39. package/dist/implementations/addon/HybridScreenshotManager.js.map +1 -0
  40. package/dist/implementations/addon/InspectSandboxTool.d.ts +54 -0
  41. package/dist/implementations/addon/InspectSandboxTool.d.ts.map +1 -0
  42. package/dist/implementations/addon/InspectSandboxTool.js +226 -0
  43. package/dist/implementations/addon/InspectSandboxTool.js.map +1 -0
  44. package/dist/implementations/addon/InteractWithSandboxTool.d.ts +90 -0
  45. package/dist/implementations/addon/InteractWithSandboxTool.d.ts.map +1 -0
  46. package/dist/implementations/addon/InteractWithSandboxTool.js +367 -0
  47. package/dist/implementations/addon/InteractWithSandboxTool.js.map +1 -0
  48. package/dist/implementations/addon/KeyframeDetector.d.ts +140 -0
  49. package/dist/implementations/addon/KeyframeDetector.d.ts.map +1 -0
  50. package/dist/implementations/addon/KeyframeDetector.js +390 -0
  51. package/dist/implementations/addon/KeyframeDetector.js.map +1 -0
  52. package/dist/implementations/addon/ModifySandboxTool.d.ts +62 -0
  53. package/dist/implementations/addon/ModifySandboxTool.d.ts.map +1 -0
  54. package/dist/implementations/addon/ModifySandboxTool.js +266 -0
  55. package/dist/implementations/addon/ModifySandboxTool.js.map +1 -0
  56. package/dist/implementations/addon/ReactArtifactBuilder.d.ts +27 -0
  57. package/dist/implementations/addon/ReactArtifactBuilder.d.ts.map +1 -0
  58. package/dist/implementations/addon/ReactArtifactBuilder.js +198 -0
  59. package/dist/implementations/addon/ReactArtifactBuilder.js.map +1 -0
  60. package/dist/implementations/addon/SandboxEventBroadcaster.d.ts +143 -0
  61. package/dist/implementations/addon/SandboxEventBroadcaster.d.ts.map +1 -0
  62. package/dist/implementations/addon/SandboxEventBroadcaster.js +258 -0
  63. package/dist/implementations/addon/SandboxEventBroadcaster.js.map +1 -0
  64. package/dist/implementations/addon/SandboxIntrospectionTools.d.ts +77 -0
  65. package/dist/implementations/addon/SandboxIntrospectionTools.d.ts.map +1 -0
  66. package/dist/implementations/addon/SandboxIntrospectionTools.js +292 -0
  67. package/dist/implementations/addon/SandboxIntrospectionTools.js.map +1 -0
  68. package/dist/implementations/addon/SandboxViewServer.d.ts +127 -0
  69. package/dist/implementations/addon/SandboxViewServer.d.ts.map +1 -0
  70. package/dist/implementations/addon/SandboxViewServer.js +775 -0
  71. package/dist/implementations/addon/SandboxViewServer.js.map +1 -0
  72. package/dist/implementations/addon/ScreenStream.d.ts +149 -0
  73. package/dist/implementations/addon/ScreenStream.d.ts.map +1 -0
  74. package/dist/implementations/addon/ScreenStream.js +306 -0
  75. package/dist/implementations/addon/ScreenStream.js.map +1 -0
  76. package/dist/implementations/addon/StopSandboxTool.d.ts +61 -0
  77. package/dist/implementations/addon/StopSandboxTool.d.ts.map +1 -0
  78. package/dist/implementations/addon/StopSandboxTool.js +252 -0
  79. package/dist/implementations/addon/StopSandboxTool.js.map +1 -0
  80. package/dist/implementations/addon/TerminalSandbox.d.ts +111 -0
  81. package/dist/implementations/addon/TerminalSandbox.d.ts.map +1 -0
  82. package/dist/implementations/addon/TerminalSandbox.js +345 -0
  83. package/dist/implementations/addon/TerminalSandbox.js.map +1 -0
  84. package/dist/implementations/addon/VisualFeedbackBridge.d.ts +367 -0
  85. package/dist/implementations/addon/VisualFeedbackBridge.d.ts.map +1 -0
  86. package/dist/implementations/addon/VisualFeedbackBridge.js +888 -0
  87. package/dist/implementations/addon/VisualFeedbackBridge.js.map +1 -0
  88. package/dist/implementations/addon/WindowManager.d.ts +138 -0
  89. package/dist/implementations/addon/WindowManager.d.ts.map +1 -0
  90. package/dist/implementations/addon/WindowManager.js +276 -0
  91. package/dist/implementations/addon/WindowManager.js.map +1 -0
  92. package/dist/implementations/addon/index.d.ts +29 -0
  93. package/dist/implementations/addon/index.d.ts.map +1 -0
  94. package/dist/implementations/addon/index.js +29 -0
  95. package/dist/implementations/addon/index.js.map +1 -0
  96. package/dist/implementations/addon/injectables/reactIntrospection.d.ts +57 -0
  97. package/dist/implementations/addon/injectables/reactIntrospection.d.ts.map +1 -0
  98. package/dist/implementations/addon/injectables/reactIntrospection.js +480 -0
  99. package/dist/implementations/addon/injectables/reactIntrospection.js.map +1 -0
  100. package/dist/implementations/addon/terminal-client.html +253 -0
  101. package/dist/implementations/agent/PRAgentTool.d.ts +37 -0
  102. package/dist/implementations/agent/PRAgentTool.d.ts.map +1 -0
  103. package/dist/implementations/agent/PRAgentTool.js +257 -0
  104. package/dist/implementations/agent/PRAgentTool.js.map +1 -0
  105. package/dist/implementations/agent/TaskTool.d.ts +76 -0
  106. package/dist/implementations/agent/TaskTool.d.ts.map +1 -0
  107. package/dist/implementations/agent/TaskTool.js +424 -0
  108. package/dist/implementations/agent/TaskTool.js.map +1 -0
  109. package/dist/implementations/agent/index.d.ts +5 -0
  110. package/dist/implementations/agent/index.d.ts.map +1 -0
  111. package/dist/implementations/agent/index.js +3 -0
  112. package/dist/implementations/agent/index.js.map +1 -0
  113. package/dist/implementations/execution/BackgroundProcessRegistry.d.ts +68 -0
  114. package/dist/implementations/execution/BackgroundProcessRegistry.d.ts.map +1 -0
  115. package/dist/implementations/execution/BackgroundProcessRegistry.js +146 -0
  116. package/dist/implementations/execution/BackgroundProcessRegistry.js.map +1 -0
  117. package/dist/implementations/execution/BashOutputTool.d.ts +42 -0
  118. package/dist/implementations/execution/BashOutputTool.d.ts.map +1 -0
  119. package/dist/implementations/execution/BashOutputTool.js +168 -0
  120. package/dist/implementations/execution/BashOutputTool.js.map +1 -0
  121. package/dist/implementations/execution/CodeExecuteTool.d.ts +31 -0
  122. package/dist/implementations/execution/CodeExecuteTool.d.ts.map +1 -0
  123. package/dist/implementations/execution/CodeExecuteTool.js +127 -0
  124. package/dist/implementations/execution/CodeExecuteTool.js.map +1 -0
  125. package/dist/implementations/execution/KillShellTool.d.ts +37 -0
  126. package/dist/implementations/execution/KillShellTool.d.ts.map +1 -0
  127. package/dist/implementations/execution/KillShellTool.js +144 -0
  128. package/dist/implementations/execution/KillShellTool.js.map +1 -0
  129. package/dist/implementations/execution/SearchToolsTool.d.ts +32 -0
  130. package/dist/implementations/execution/SearchToolsTool.d.ts.map +1 -0
  131. package/dist/implementations/execution/SearchToolsTool.js +109 -0
  132. package/dist/implementations/execution/SearchToolsTool.js.map +1 -0
  133. package/dist/implementations/execution/ShellTool.d.ts +108 -0
  134. package/dist/implementations/execution/ShellTool.d.ts.map +1 -0
  135. package/dist/implementations/execution/ShellTool.js +546 -0
  136. package/dist/implementations/execution/ShellTool.js.map +1 -0
  137. package/dist/implementations/execution/WorkspaceManagerTool.d.ts +40 -0
  138. package/dist/implementations/execution/WorkspaceManagerTool.d.ts.map +1 -0
  139. package/dist/implementations/execution/WorkspaceManagerTool.js +370 -0
  140. package/dist/implementations/execution/WorkspaceManagerTool.js.map +1 -0
  141. package/dist/implementations/execution/index.d.ts +13 -0
  142. package/dist/implementations/execution/index.d.ts.map +1 -0
  143. package/dist/implementations/execution/index.js +13 -0
  144. package/dist/implementations/execution/index.js.map +1 -0
  145. package/dist/implementations/extensions/EndTurnTool.d.ts +62 -0
  146. package/dist/implementations/extensions/EndTurnTool.d.ts.map +1 -0
  147. package/dist/implementations/extensions/EndTurnTool.js +172 -0
  148. package/dist/implementations/extensions/EndTurnTool.js.map +1 -0
  149. package/dist/implementations/extensions/ResearchBacklogTool.d.ts +37 -0
  150. package/dist/implementations/extensions/ResearchBacklogTool.d.ts.map +1 -0
  151. package/dist/implementations/extensions/ResearchBacklogTool.js +102 -0
  152. package/dist/implementations/extensions/ResearchBacklogTool.js.map +1 -0
  153. package/dist/implementations/extensions/SkillTool.d.ts +108 -0
  154. package/dist/implementations/extensions/SkillTool.d.ts.map +1 -0
  155. package/dist/implementations/extensions/SkillTool.js +351 -0
  156. package/dist/implementations/extensions/SkillTool.js.map +1 -0
  157. package/dist/implementations/extensions/SlashCommandTool.d.ts +112 -0
  158. package/dist/implementations/extensions/SlashCommandTool.d.ts.map +1 -0
  159. package/dist/implementations/extensions/SlashCommandTool.js +315 -0
  160. package/dist/implementations/extensions/SlashCommandTool.js.map +1 -0
  161. package/dist/implementations/extensions/index.d.ts +14 -0
  162. package/dist/implementations/extensions/index.d.ts.map +1 -0
  163. package/dist/implementations/extensions/index.js +10 -0
  164. package/dist/implementations/extensions/index.js.map +1 -0
  165. package/dist/implementations/file/EditTool.d.ts +232 -0
  166. package/dist/implementations/file/EditTool.d.ts.map +1 -0
  167. package/dist/implementations/file/EditTool.js +707 -0
  168. package/dist/implementations/file/EditTool.js.map +1 -0
  169. package/dist/implementations/file/ReadFileTool.d.ts +49 -0
  170. package/dist/implementations/file/ReadFileTool.d.ts.map +1 -0
  171. package/dist/implementations/file/ReadFileTool.js +225 -0
  172. package/dist/implementations/file/ReadFileTool.js.map +1 -0
  173. package/dist/implementations/file/WriteBinaryTool.d.ts +21 -0
  174. package/dist/implementations/file/WriteBinaryTool.d.ts.map +1 -0
  175. package/dist/implementations/file/WriteBinaryTool.js +153 -0
  176. package/dist/implementations/file/WriteBinaryTool.js.map +1 -0
  177. package/dist/implementations/file/WriteFileTool.d.ts +41 -0
  178. package/dist/implementations/file/WriteFileTool.d.ts.map +1 -0
  179. package/dist/implementations/file/WriteFileTool.js +220 -0
  180. package/dist/implementations/file/WriteFileTool.js.map +1 -0
  181. package/dist/implementations/file/index.d.ts +8 -0
  182. package/dist/implementations/file/index.d.ts.map +1 -0
  183. package/dist/implementations/file/index.js +8 -0
  184. package/dist/implementations/file/index.js.map +1 -0
  185. package/dist/implementations/historical/GetConversationSegmentTool.d.ts +44 -0
  186. package/dist/implementations/historical/GetConversationSegmentTool.d.ts.map +1 -0
  187. package/dist/implementations/historical/GetConversationSegmentTool.js +220 -0
  188. package/dist/implementations/historical/GetConversationSegmentTool.js.map +1 -0
  189. package/dist/implementations/historical/ListCompactionBoundariesTool.d.ts +36 -0
  190. package/dist/implementations/historical/ListCompactionBoundariesTool.d.ts.map +1 -0
  191. package/dist/implementations/historical/ListCompactionBoundariesTool.js +174 -0
  192. package/dist/implementations/historical/ListCompactionBoundariesTool.js.map +1 -0
  193. package/dist/implementations/historical/ListSessionsTool.d.ts +38 -0
  194. package/dist/implementations/historical/ListSessionsTool.d.ts.map +1 -0
  195. package/dist/implementations/historical/ListSessionsTool.js +140 -0
  196. package/dist/implementations/historical/ListSessionsTool.js.map +1 -0
  197. package/dist/implementations/historical/LoadSessionTool.d.ts +39 -0
  198. package/dist/implementations/historical/LoadSessionTool.d.ts.map +1 -0
  199. package/dist/implementations/historical/LoadSessionTool.js +171 -0
  200. package/dist/implementations/historical/LoadSessionTool.js.map +1 -0
  201. package/dist/implementations/historical/RequestHistoricalContextTool.d.ts +46 -0
  202. package/dist/implementations/historical/RequestHistoricalContextTool.d.ts.map +1 -0
  203. package/dist/implementations/historical/RequestHistoricalContextTool.js +224 -0
  204. package/dist/implementations/historical/RequestHistoricalContextTool.js.map +1 -0
  205. package/dist/implementations/historical/SearchConversationHistoryTool.d.ts +51 -0
  206. package/dist/implementations/historical/SearchConversationHistoryTool.d.ts.map +1 -0
  207. package/dist/implementations/historical/SearchConversationHistoryTool.js +306 -0
  208. package/dist/implementations/historical/SearchConversationHistoryTool.js.map +1 -0
  209. package/dist/implementations/historical/index.d.ts +12 -0
  210. package/dist/implementations/historical/index.d.ts.map +1 -0
  211. package/dist/implementations/historical/index.js +12 -0
  212. package/dist/implementations/historical/index.js.map +1 -0
  213. package/dist/implementations/index.d.ts +16 -0
  214. package/dist/implementations/index.d.ts.map +1 -0
  215. package/dist/implementations/index.js +28 -0
  216. package/dist/implementations/index.js.map +1 -0
  217. package/dist/implementations/mcp/DiscoveredMcpTool.d.ts +58 -0
  218. package/dist/implementations/mcp/DiscoveredMcpTool.d.ts.map +1 -0
  219. package/dist/implementations/mcp/DiscoveredMcpTool.js +269 -0
  220. package/dist/implementations/mcp/DiscoveredMcpTool.js.map +1 -0
  221. package/dist/implementations/mcp/index.d.ts +9 -0
  222. package/dist/implementations/mcp/index.d.ts.map +1 -0
  223. package/dist/implementations/mcp/index.js +8 -0
  224. package/dist/implementations/mcp/index.js.map +1 -0
  225. package/dist/implementations/notebook/NotebookEditTool.d.ts +96 -0
  226. package/dist/implementations/notebook/NotebookEditTool.d.ts.map +1 -0
  227. package/dist/implementations/notebook/NotebookEditTool.js +390 -0
  228. package/dist/implementations/notebook/NotebookEditTool.js.map +1 -0
  229. package/dist/implementations/notebook/index.d.ts +7 -0
  230. package/dist/implementations/notebook/index.d.ts.map +1 -0
  231. package/dist/implementations/notebook/index.js +7 -0
  232. package/dist/implementations/notebook/index.js.map +1 -0
  233. package/dist/implementations/search/GlobTool.d.ts +73 -0
  234. package/dist/implementations/search/GlobTool.d.ts.map +1 -0
  235. package/dist/implementations/search/GlobTool.js +213 -0
  236. package/dist/implementations/search/GlobTool.js.map +1 -0
  237. package/dist/implementations/search/GrepTool.d.ts +102 -0
  238. package/dist/implementations/search/GrepTool.d.ts.map +1 -0
  239. package/dist/implementations/search/GrepTool.js +754 -0
  240. package/dist/implementations/search/GrepTool.js.map +1 -0
  241. package/dist/implementations/search/index.d.ts +6 -0
  242. package/dist/implementations/search/index.d.ts.map +1 -0
  243. package/dist/implementations/search/index.js +6 -0
  244. package/dist/implementations/search/index.js.map +1 -0
  245. package/dist/implementations/tmux/TmuxSessionTool.d.ts +82 -0
  246. package/dist/implementations/tmux/TmuxSessionTool.d.ts.map +1 -0
  247. package/dist/implementations/tmux/TmuxSessionTool.js +371 -0
  248. package/dist/implementations/tmux/TmuxSessionTool.js.map +1 -0
  249. package/dist/implementations/tmux/TmuxViewServer.d.ts +86 -0
  250. package/dist/implementations/tmux/TmuxViewServer.d.ts.map +1 -0
  251. package/dist/implementations/tmux/TmuxViewServer.js +480 -0
  252. package/dist/implementations/tmux/TmuxViewServer.js.map +1 -0
  253. package/dist/implementations/tmux/index.d.ts +6 -0
  254. package/dist/implementations/tmux/index.d.ts.map +1 -0
  255. package/dist/implementations/tmux/index.js +6 -0
  256. package/dist/implementations/tmux/index.js.map +1 -0
  257. package/dist/implementations/ui/AskUserQuestionTool.d.ts +77 -0
  258. package/dist/implementations/ui/AskUserQuestionTool.d.ts.map +1 -0
  259. package/dist/implementations/ui/AskUserQuestionTool.js +241 -0
  260. package/dist/implementations/ui/AskUserQuestionTool.js.map +1 -0
  261. package/dist/implementations/ui/ExitPlanModeTool.d.ts +44 -0
  262. package/dist/implementations/ui/ExitPlanModeTool.d.ts.map +1 -0
  263. package/dist/implementations/ui/ExitPlanModeTool.js +150 -0
  264. package/dist/implementations/ui/ExitPlanModeTool.js.map +1 -0
  265. package/dist/implementations/ui/TodoWriteTool.d.ts +59 -0
  266. package/dist/implementations/ui/TodoWriteTool.d.ts.map +1 -0
  267. package/dist/implementations/ui/TodoWriteTool.js +315 -0
  268. package/dist/implementations/ui/TodoWriteTool.js.map +1 -0
  269. package/dist/implementations/ui/index.d.ts +9 -0
  270. package/dist/implementations/ui/index.d.ts.map +1 -0
  271. package/dist/implementations/ui/index.js +9 -0
  272. package/dist/implementations/ui/index.js.map +1 -0
  273. package/dist/implementations/web/BrowseTool.d.ts +43 -0
  274. package/dist/implementations/web/BrowseTool.d.ts.map +1 -0
  275. package/dist/implementations/web/BrowseTool.js +181 -0
  276. package/dist/implementations/web/BrowseTool.js.map +1 -0
  277. package/dist/implementations/web/SandboxTransferTool.d.ts +30 -0
  278. package/dist/implementations/web/SandboxTransferTool.d.ts.map +1 -0
  279. package/dist/implementations/web/SandboxTransferTool.js +261 -0
  280. package/dist/implementations/web/SandboxTransferTool.js.map +1 -0
  281. package/dist/implementations/web/WebFetchTool.d.ts +93 -0
  282. package/dist/implementations/web/WebFetchTool.d.ts.map +1 -0
  283. package/dist/implementations/web/WebFetchTool.js +484 -0
  284. package/dist/implementations/web/WebFetchTool.js.map +1 -0
  285. package/dist/implementations/web/WebSearchTool.d.ts +53 -0
  286. package/dist/implementations/web/WebSearchTool.d.ts.map +1 -0
  287. package/dist/implementations/web/WebSearchTool.js +227 -0
  288. package/dist/implementations/web/WebSearchTool.js.map +1 -0
  289. package/dist/implementations/web/escalateDirective.d.ts +11 -0
  290. package/dist/implementations/web/escalateDirective.d.ts.map +1 -0
  291. package/dist/implementations/web/escalateDirective.js +20 -0
  292. package/dist/implementations/web/escalateDirective.js.map +1 -0
  293. package/dist/implementations/web/index.d.ts +10 -0
  294. package/dist/implementations/web/index.d.ts.map +1 -0
  295. package/dist/implementations/web/index.js +10 -0
  296. package/dist/implementations/web/index.js.map +1 -0
  297. package/dist/implementations/web/webBackends.d.ts +65 -0
  298. package/dist/implementations/web/webBackends.d.ts.map +1 -0
  299. package/dist/implementations/web/webBackends.js +430 -0
  300. package/dist/implementations/web/webBackends.js.map +1 -0
  301. package/dist/implementations/web/webFetchRequestInit.d.ts +9 -0
  302. package/dist/implementations/web/webFetchRequestInit.d.ts.map +1 -0
  303. package/dist/implementations/web/webFetchRequestInit.js +21 -0
  304. package/dist/implementations/web/webFetchRequestInit.js.map +1 -0
  305. package/dist/index.d.ts +14 -0
  306. package/dist/index.d.ts.map +1 -0
  307. package/dist/index.js +18 -0
  308. package/dist/index.js.map +1 -0
  309. package/dist/utils/ArtifactRegistry.d.ts +138 -0
  310. package/dist/utils/ArtifactRegistry.d.ts.map +1 -0
  311. package/dist/utils/ArtifactRegistry.js +259 -0
  312. package/dist/utils/ArtifactRegistry.js.map +1 -0
  313. package/dist/utils/ChromiumBrowserManager.d.ts +56 -0
  314. package/dist/utils/ChromiumBrowserManager.d.ts.map +1 -0
  315. package/dist/utils/ChromiumBrowserManager.js +243 -0
  316. package/dist/utils/ChromiumBrowserManager.js.map +1 -0
  317. package/dist/utils/FileUtils.d.ts +81 -0
  318. package/dist/utils/FileUtils.d.ts.map +1 -0
  319. package/dist/utils/FileUtils.js +148 -0
  320. package/dist/utils/FileUtils.js.map +1 -0
  321. package/dist/utils/GitPolicy.d.ts +70 -0
  322. package/dist/utils/GitPolicy.d.ts.map +1 -0
  323. package/dist/utils/GitPolicy.js +166 -0
  324. package/dist/utils/GitPolicy.js.map +1 -0
  325. package/dist/utils/GitUtils.d.ts +18 -0
  326. package/dist/utils/GitUtils.d.ts.map +1 -0
  327. package/dist/utils/GitUtils.js +62 -0
  328. package/dist/utils/GitUtils.js.map +1 -0
  329. package/dist/utils/SandboxRegistry.d.ts +110 -0
  330. package/dist/utils/SandboxRegistry.d.ts.map +1 -0
  331. package/dist/utils/SandboxRegistry.js +220 -0
  332. package/dist/utils/SandboxRegistry.js.map +1 -0
  333. package/dist/utils/SchemaValidator.d.ts +21 -0
  334. package/dist/utils/SchemaValidator.d.ts.map +1 -0
  335. package/dist/utils/SchemaValidator.js +67 -0
  336. package/dist/utils/SchemaValidator.js.map +1 -0
  337. package/dist/utils/SessionLock.d.ts +96 -0
  338. package/dist/utils/SessionLock.d.ts.map +1 -0
  339. package/dist/utils/SessionLock.js +276 -0
  340. package/dist/utils/SessionLock.js.map +1 -0
  341. package/dist/utils/SessionPersistence.d.ts +89 -0
  342. package/dist/utils/SessionPersistence.d.ts.map +1 -0
  343. package/dist/utils/SessionPersistence.js +244 -0
  344. package/dist/utils/SessionPersistence.js.map +1 -0
  345. package/dist/utils/TextUtils.d.ts +77 -0
  346. package/dist/utils/TextUtils.d.ts.map +1 -0
  347. package/dist/utils/TextUtils.js +112 -0
  348. package/dist/utils/TextUtils.js.map +1 -0
  349. package/dist/utils/TmuxCapture.d.ts +94 -0
  350. package/dist/utils/TmuxCapture.d.ts.map +1 -0
  351. package/dist/utils/TmuxCapture.js +131 -0
  352. package/dist/utils/TmuxCapture.js.map +1 -0
  353. package/dist/utils/TmuxManager.d.ts +65 -0
  354. package/dist/utils/TmuxManager.d.ts.map +1 -0
  355. package/dist/utils/TmuxManager.js +304 -0
  356. package/dist/utils/TmuxManager.js.map +1 -0
  357. package/dist/utils/autoResearchPlanGate.d.ts +10 -0
  358. package/dist/utils/autoResearchPlanGate.d.ts.map +1 -0
  359. package/dist/utils/autoResearchPlanGate.js +57 -0
  360. package/dist/utils/autoResearchPlanGate.js.map +1 -0
  361. package/dist/utils/index.d.ts +19 -0
  362. package/dist/utils/index.d.ts.map +1 -0
  363. package/dist/utils/index.js +13 -0
  364. package/dist/utils/index.js.map +1 -0
  365. package/package.json +83 -0
@@ -0,0 +1,480 @@
1
+ /**
2
+ * TmuxViewServer - Live web-based tmux session viewer
3
+ *
4
+ * Extends SandboxViewServer to provide real-time tmux session viewing.
5
+ * No headless browser needed - renders in user's browser!
6
+ *
7
+ * Features:
8
+ * - Live terminal rendering with xterm.js
9
+ * - Real-time output streaming via WebSocket
10
+ * - Session list dashboard
11
+ * - Direct attach to tmux sessions
12
+ * - Works in any environment (no Chromium needed!)
13
+ *
14
+ * Architecture:
15
+ * - Piggybacks on SandboxViewServer (port 4001)
16
+ * - Adds /tmux routes alongside /sandbox routes
17
+ * - Uses TerminalSandbox for xterm.js rendering
18
+ * - Connects xterm.js to tmux session via PTY
19
+ *
20
+ * User Flow:
21
+ * 1. User creates tmux session
22
+ * 2. Server returns view URL: http://localhost:4001/tmux/{sessionId}
23
+ * 3. User opens URL in their browser
24
+ * 4. See live terminal with full colors, formatting, updates
25
+ * 5. Can interact if desired (type, scroll, etc.)
26
+ *
27
+ * Example:
28
+ * ```
29
+ * const viewServer = TmuxViewServer.getInstance();
30
+ * await viewServer.start(); // Auto-starts if not running
31
+ *
32
+ * const url = viewServer.getTmuxViewUrl("my-session");
33
+ * // Returns: http://localhost:4001/tmux/my-session
34
+ * ```
35
+ */
36
+ import { SandboxViewServer } from '../addon/SandboxViewServer.js';
37
+ import { TmuxManager } from '../../utils/TmuxManager.js';
38
+ import { SessionPersistence } from '../../utils/SessionPersistence.js';
39
+ export class TmuxViewServer {
40
+ static instance;
41
+ sandboxViewServer;
42
+ tmuxManager;
43
+ persistence;
44
+ isInitialized = false;
45
+ recoveredSessions = new Map();
46
+ constructor() {
47
+ this.sandboxViewServer = SandboxViewServer.getInstance();
48
+ this.tmuxManager = TmuxManager.getInstance();
49
+ // Use PROJECT_ROOT if set (server sets this to monorepo root), otherwise fallback to cwd
50
+ const projectRoot = process.env.PROJECT_ROOT || process.cwd();
51
+ this.persistence = new SessionPersistence(projectRoot);
52
+ }
53
+ /**
54
+ * Get singleton instance
55
+ */
56
+ static getInstance() {
57
+ if (!TmuxViewServer.instance) {
58
+ TmuxViewServer.instance = new TmuxViewServer();
59
+ }
60
+ return TmuxViewServer.instance;
61
+ }
62
+ /**
63
+ * Initialize tmux viewing routes
64
+ */
65
+ async initialize() {
66
+ if (this.isInitialized) {
67
+ return;
68
+ }
69
+ // Start SandboxViewServer with dynamic port resolution (starting from 4001)
70
+ // It will automatically find the next available port if 4001 is occupied
71
+ await this.sandboxViewServer.start(4001);
72
+ // Add tmux-specific routes
73
+ this.addTmuxRoutes();
74
+ this.isInitialized = true;
75
+ const actualPort = this.sandboxViewServer.getPort();
76
+ console.log(` Tmux view routes initialized at http://localhost:${actualPort}/tmux`);
77
+ }
78
+ /**
79
+ * Get view URL for a tmux session (uses dynamically assigned port)
80
+ */
81
+ getTmuxViewUrl(sessionId) {
82
+ const port = this.sandboxViewServer.getPort();
83
+ return `http://localhost:${port}/tmux/${sessionId}`;
84
+ }
85
+ /**
86
+ * Get tmux dashboard URL (uses dynamically assigned port)
87
+ */
88
+ getTmuxDashboardUrl() {
89
+ const port = this.sandboxViewServer.getPort();
90
+ return `http://localhost:${port}/tmux`;
91
+ }
92
+ /**
93
+ * Get tmux API URL (uses dynamically assigned port)
94
+ */
95
+ getTmuxApiUrl() {
96
+ const port = this.sandboxViewServer.getPort();
97
+ return `http://localhost:${port}/api/tmux/sessions`;
98
+ }
99
+ markRecovered(sessionIds) {
100
+ const now = new Date();
101
+ for (const id of sessionIds) {
102
+ this.recoveredSessions.set(id, now);
103
+ }
104
+ }
105
+ /**
106
+ * Add tmux-specific routes to the express app
107
+ */
108
+ addTmuxRoutes() {
109
+ const app = this.sandboxViewServer.getApp();
110
+ const io = this.sandboxViewServer.getIO();
111
+ // Tmux dashboard - list all sessions
112
+ app.get('/tmux', async (req, res) => {
113
+ res.send(this.generateTmuxDashboardHTML());
114
+ });
115
+ // Live terminal view for specific session
116
+ app.get('/tmux/:sessionId', async (req, res) => {
117
+ const sessionId = req.params.sessionId;
118
+ // Check if session exists
119
+ if (!(await this.tmuxManager.sessionExists(sessionId))) {
120
+ res.status(404).send(this.generateTmux404HTML(sessionId));
121
+ return;
122
+ }
123
+ res.send(this.generateTmuxSessionHTML(sessionId));
124
+ });
125
+ // API: Get session list with metadata (only active sessions)
126
+ app.get('/api/tmux/sessions', async (req, res) => {
127
+ try {
128
+ // Get list of actually running tmux sessions
129
+ const activeSessions = await this.tmuxManager.listSessions();
130
+ // Get metadata for all sessions
131
+ const allMetadata = await this.persistence.listSessions();
132
+ const metadataMap = new Map(allMetadata.map(m => [m.sessionId, m]));
133
+ // Build session list - include ALL active tmux sessions
134
+ const sessions = await Promise.all(activeSessions.map(async (sessionId) => {
135
+ // Use existing metadata if available, otherwise create minimal metadata
136
+ const recovered = this.recoveredSessions.has(sessionId);
137
+ const recoveredAt = this.recoveredSessions.get(sessionId) || null;
138
+ if (metadataMap.has(sessionId)) {
139
+ const meta = metadataMap.get(sessionId);
140
+ return {
141
+ sessionId: meta.sessionId,
142
+ workingDirectory: meta.cwd || process.cwd(),
143
+ created: meta.created,
144
+ lastUsed: meta.lastUsed,
145
+ commandCount: 0,
146
+ recovered,
147
+ recoveredAt
148
+ };
149
+ }
150
+ else {
151
+ return {
152
+ sessionId,
153
+ workingDirectory: process.cwd(),
154
+ created: new Date(),
155
+ lastUsed: new Date(),
156
+ commandCount: 0,
157
+ recovered,
158
+ recoveredAt
159
+ };
160
+ }
161
+ }));
162
+ res.json({ sessions, dashboardUrl: this.getTmuxDashboardUrl() });
163
+ }
164
+ catch (error) {
165
+ res.status(500).json({ error: error.message });
166
+ }
167
+ });
168
+ // Setup WebSocket handlers for tmux
169
+ this.setupTmuxWebSocket(io);
170
+ console.log('[OK] Tmux routes registered:');
171
+ console.log(' GET /tmux - Tmux dashboard');
172
+ console.log(' GET /tmux/:sessionId - Live terminal view');
173
+ console.log(' GET /api/tmux/sessions - Session list API');
174
+ }
175
+ /**
176
+ * Setup WebSocket handlers for tmux interaction
177
+ */
178
+ setupTmuxWebSocket(io) {
179
+ io.on('connection', (socket) => {
180
+ // Subscribe to tmux session
181
+ socket.on('subscribe-tmux', async (sessionId) => {
182
+ console.log(`[WS] Client ${socket.id} subscribed to tmux: ${sessionId}`);
183
+ socket.join(`tmux-${sessionId}`);
184
+ // Send initial capture
185
+ try {
186
+ const output = await this.tmuxManager.capturePane(sessionId);
187
+ socket.emit('tmux-output', { output });
188
+ }
189
+ catch (error) {
190
+ socket.emit('tmux-error', { error: error.message });
191
+ }
192
+ });
193
+ // Handle terminal input from client
194
+ socket.on('tmux-input', async ({ sessionId, input }) => {
195
+ try {
196
+ await this.tmuxManager.sendKeys(sessionId, input);
197
+ }
198
+ catch (error) {
199
+ socket.emit('tmux-error', { error: error.message });
200
+ }
201
+ });
202
+ // Manual capture request
203
+ socket.on('tmux-capture', async (sessionId) => {
204
+ try {
205
+ const output = await this.tmuxManager.capturePane(sessionId);
206
+ socket.emit('tmux-output', { output });
207
+ }
208
+ catch (error) {
209
+ socket.emit('tmux-error', { error: error.message });
210
+ }
211
+ });
212
+ // Unsubscribe from tmux session
213
+ socket.on('unsubscribe-tmux', (sessionId) => {
214
+ console.log(`[WS] Client ${socket.id} unsubscribed from tmux: ${sessionId}`);
215
+ socket.leave(`tmux-${sessionId}`);
216
+ });
217
+ });
218
+ }
219
+ /**
220
+ * Generate 404 page for missing tmux session
221
+ */
222
+ generateTmux404HTML(sessionId) {
223
+ return `
224
+ <!DOCTYPE html>
225
+ <html lang="en">
226
+ <head>
227
+ <meta charset="UTF-8">
228
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
229
+ <title>Cortex Intelligence // Session Not Found</title>
230
+ <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Oxygen+Mono&display=swap" rel="stylesheet">
231
+ <style>
232
+ * { margin: 0; padding: 0; box-sizing: border-box; }
233
+ body { font-family: 'Oxygen Mono', monospace; font-size: 12px; background: #0f172a; color: #e2e8f0; display: flex; align-items: center; justify-content: center; height: 100vh; text-align: center; }
234
+ .error-container { max-width: 440px; padding: 40px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; }
235
+ h1 { font-size: 14px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; color: #f8fafc; }
236
+ p { color: #94a3b8; font-size: 11px; margin-bottom: 8px; }
237
+ .session-id { background: #253347; padding: 8px 12px; border-radius: 6px; margin: 16px 0; color: #f87171; font-size: 11px; border: 1px solid #283548; }
238
+ a { color: #4a90d9; text-decoration: none; font-size: 11px; letter-spacing: 0.04em; }
239
+ a:hover { color: #f8fafc; }
240
+ </style>
241
+ </head>
242
+ <body>
243
+ <div class="error-container">
244
+ <h1>Tmux Session Not Found</h1>
245
+ <p>The tmux session you're looking for doesn't exist or has been terminated.</p>
246
+ <div class="session-id">${sessionId}</div>
247
+ <p><a href="/tmux">&larr; Back to Tmux Dashboard</a></p>
248
+ </div>
249
+ </body>
250
+ </html>
251
+ `;
252
+ }
253
+ /**
254
+ * Generate tmux dashboard HTML
255
+ */
256
+ generateTmuxDashboardHTML() {
257
+ return `
258
+ <!DOCTYPE html>
259
+ <html lang="en">
260
+ <head>
261
+ <meta charset="UTF-8">
262
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
263
+ <title>Cortex Intelligence // Tmux Sessions</title>
264
+ <link rel="preconnect" href="https://fonts.googleapis.com">
265
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
266
+ <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Oxygen+Mono&display=swap" rel="stylesheet">
267
+ <style>
268
+ :root {
269
+ --cx-primary: #4a90d9; --cx-primary-rgb: 74, 144, 217;
270
+ --cx-positive: #4ade80; --cx-positive-rgb: 74, 222, 128;
271
+ --cx-bg: #0f172a; --cx-bg2: #1e293b; --cx-bg3: #253347;
272
+ --cx-text: #e2e8f0; --cx-text2: #b0b8c4; --cx-muted: #94a3b8; --cx-heading: #f8fafc;
273
+ --cx-border: #334155; --cx-border2: #283548;
274
+ --cx-radius: 6px;
275
+ --cx-font: 'Oxygen Mono', monospace;
276
+ }
277
+ * { margin: 0; padding: 0; box-sizing: border-box; }
278
+ body { font-family: var(--cx-font); font-size: 12px; line-height: 1.5; color: var(--cx-text); background: var(--cx-bg); padding: 24px 20px; min-height: 100vh; }
279
+ body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at 20% 50%, rgba(var(--cx-primary-rgb), 0.04) 0%, transparent 60%), linear-gradient(180deg, var(--cx-bg) 0%, #080818 100%); pointer-events: none; z-index: 0; }
280
+ .shell { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
281
+ .header-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--cx-bg2); border: 1px solid var(--cx-border); border-radius: var(--cx-radius); margin-bottom: 20px; }
282
+ .header-bar h1 { font-family: 'Orbitron', var(--cx-font); font-size: 14px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cx-heading); }
283
+ .header-bar .badge { font-size: 10px; color: var(--cx-muted); padding: 2px 8px; border: 1px solid var(--cx-border2); border-radius: var(--cx-radius); }
284
+ .nav-link { font-size: 10px; color: var(--cx-primary); text-decoration: none; letter-spacing: 0.04em; transition: color 200ms; }
285
+ .nav-link:hover { color: var(--cx-heading); }
286
+ .sessions { display: grid; gap: 10px; }
287
+ .session-card { background: var(--cx-bg2); border: 1px solid var(--cx-border); border-radius: var(--cx-radius); padding: 14px 16px; transition: all 200ms ease; cursor: pointer; }
288
+ .session-card:hover { border-color: rgba(var(--cx-primary-rgb), 0.5); box-shadow: 0 0 16px rgba(var(--cx-primary-rgb), 0.1); }
289
+ .session-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
290
+ .session-id { font-size: 12px; color: var(--cx-primary); letter-spacing: 0.04em; }
291
+ .session-status { padding: 2px 8px; border-radius: var(--cx-radius); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cx-positive); border: 1px solid rgba(var(--cx-positive-rgb), 0.3); }
292
+ .session-recovered { padding: 2px 8px; border-radius: var(--cx-radius); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
293
+ .session-info { color: var(--cx-muted); font-size: 10px; line-height: 1.8; }
294
+ .session-info strong { color: var(--cx-text2); }
295
+ .no-sessions { text-align: center; padding: 60px 20px; color: var(--cx-muted); font-size: 11px; }
296
+ .refresh-btn { position: fixed; bottom: 20px; right: 20px; font-family: var(--cx-font); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-primary); background: var(--cx-bg2); border: 1px solid rgba(var(--cx-primary-rgb), 0.3); border-radius: var(--cx-radius); padding: 8px 16px; cursor: pointer; transition: all 200ms ease; z-index: 10; }
297
+ .refresh-btn:hover { background: rgba(var(--cx-primary-rgb), 0.08); border-color: rgba(var(--cx-primary-rgb), 0.5); box-shadow: 0 0 12px rgba(var(--cx-primary-rgb), 0.15); }
298
+ @keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
299
+ .anim-in { animation: fade-up 400ms ease both; }
300
+ </style>
301
+ </head>
302
+ <body>
303
+ <div class="shell">
304
+ <div class="header-bar anim-in">
305
+ <div style="display: flex; align-items: center; gap: 12px;">
306
+ <h1>Cortex Intelligence // Tmux</h1>
307
+ <span class="badge">TERMINAL</span>
308
+ </div>
309
+ <div style="display: flex; align-items: center; gap: 16px;">
310
+ <a href="/" class="nav-link">Sandbox Dashboard</a>
311
+ <span style="font-size: 11px; color: var(--cx-muted);">Live terminal sessions</span>
312
+ </div>
313
+ </div>
314
+
315
+ <div class="sessions" id="sessions">
316
+ <div class="no-sessions">Loading sessions...</div>
317
+ </div>
318
+ </div>
319
+
320
+ <button class="refresh-btn" onclick="loadSessions()">Refresh</button>
321
+
322
+ <script>
323
+ async function loadSessions() {
324
+ try {
325
+ const response = await fetch('/api/tmux/sessions');
326
+ const data = await response.json();
327
+ const container = document.getElementById('sessions');
328
+
329
+ if (data.sessions.length === 0) {
330
+ container.innerHTML = '<div class="no-sessions">No active tmux sessions</div>';
331
+ return;
332
+ }
333
+
334
+ container.innerHTML = data.sessions.map((session, i) => \`
335
+ <div class="session-card anim-in" style="animation-delay: \${i * 60}ms" onclick="window.location='/tmux/\${session.sessionId}'">
336
+ <div class="session-header">
337
+ <div class="session-id">\${session.sessionId}</div>
338
+ <div style="display: flex; gap: 6px; align-items: center;">
339
+ \${session.recovered ? '<div class="session-recovered">[RECOVERED]</div>' : ''}
340
+ <div class="session-status">Active</div>
341
+ </div>
342
+ </div>
343
+ <div class="session-info">
344
+ <div><strong>Directory:</strong> \${session.workingDirectory}</div>
345
+ <div><strong>Created:</strong> \${new Date(session.created).toLocaleString()}</div>
346
+ <div><strong>Last Used:</strong> \${new Date(session.lastUsed).toLocaleString()}</div>
347
+ \${session.recovered ? '<div><strong>Recovered:</strong> ' + new Date(session.recoveredAt).toLocaleString() + '</div>' : ''}
348
+ </div>
349
+ </div>
350
+ \`).join('');
351
+ } catch (error) {
352
+ console.error('Failed to load sessions:', error);
353
+ document.getElementById('sessions').innerHTML = '<div class="no-sessions">Failed to load sessions</div>';
354
+ }
355
+ }
356
+
357
+ loadSessions();
358
+ setInterval(loadSessions, 5000);
359
+ </script>
360
+ </body>
361
+ </html>
362
+ `;
363
+ }
364
+ /**
365
+ * Generate live terminal view HTML for a specific session
366
+ */
367
+ generateTmuxSessionHTML(sessionId) {
368
+ return `
369
+ <!DOCTYPE html>
370
+ <html lang="en">
371
+ <head>
372
+ <meta charset="UTF-8">
373
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
374
+ <title>Cortex Intelligence // ${sessionId}</title>
375
+ <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Oxygen+Mono&display=swap" rel="stylesheet">
376
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.css" />
377
+ <script src="https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.js"></script>
378
+ <script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.js"></script>
379
+ <script src="https://cdn.jsdelivr.net/npm/socket.io-client@4.6.0/dist/socket.io.min.js"></script>
380
+ <style>
381
+ :root {
382
+ --cx-primary: #4a90d9; --cx-primary-rgb: 74, 144, 217;
383
+ --cx-positive: #4ade80; --cx-positive-rgb: 74, 222, 128;
384
+ --cx-negative: #f87171;
385
+ --cx-bg: #0f172a; --cx-bg2: #1e293b;
386
+ --cx-text: #e2e8f0; --cx-muted: #94a3b8; --cx-heading: #f8fafc;
387
+ --cx-border: #334155;
388
+ --cx-radius: 6px;
389
+ --cx-font: 'Oxygen Mono', monospace;
390
+ }
391
+ * { margin: 0; padding: 0; box-sizing: border-box; }
392
+ body { font-family: var(--cx-font); font-size: 12px; background: var(--cx-bg); color: var(--cx-text); overflow: hidden; }
393
+ #header { background: var(--cx-bg2); padding: 0 16px; height: 44px; border-bottom: 1px solid var(--cx-border); display: flex; justify-content: space-between; align-items: center; }
394
+ #header h1 { font-family: 'Orbitron', var(--cx-font); font-size: 12px; font-weight: 500; color: var(--cx-heading); letter-spacing: 0.1em; text-transform: uppercase; }
395
+ .nav-link { font-size: 10px; color: var(--cx-primary); text-decoration: none; letter-spacing: 0.04em; }
396
+ .nav-link:hover { color: var(--cx-heading); }
397
+ #status { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
398
+ .connected { color: var(--cx-positive); }
399
+ .disconnected { color: var(--cx-negative); }
400
+ #terminal-container { position: absolute; top: 44px; left: 0; right: 0; bottom: 0; padding: 8px; background: #0a0f1a; }
401
+ </style>
402
+ </head>
403
+ <body>
404
+ <div id="header">
405
+ <div style="display: flex; align-items: center; gap: 16px;">
406
+ <a href="/tmux" class="nav-link">&larr; Sessions</a>
407
+ <h1>${sessionId}</h1>
408
+ </div>
409
+ <div id="status" class="disconnected">Connecting...</div>
410
+ </div>
411
+ <div id="terminal-container"></div>
412
+
413
+ <script>
414
+ const term = new Terminal({
415
+ cursorBlink: true,
416
+ fontSize: 13,
417
+ fontFamily: "'Oxygen Mono', 'Menlo', 'Monaco', monospace",
418
+ theme: {
419
+ background: '#0a0f1a',
420
+ foreground: '#e2e8f0',
421
+ cursor: '#4a90d9',
422
+ selectionBackground: 'rgba(74, 144, 217, 0.3)',
423
+ black: '#0f172a',
424
+ brightBlack: '#334155',
425
+ red: '#f87171',
426
+ brightRed: '#fca5a5',
427
+ green: '#4ade80',
428
+ brightGreen: '#86efac',
429
+ yellow: '#fbbf24',
430
+ brightYellow: '#fde68a',
431
+ blue: '#4a90d9',
432
+ brightBlue: '#93c5fd',
433
+ magenta: '#c084fc',
434
+ brightMagenta: '#d8b4fe',
435
+ cyan: '#22d3ee',
436
+ brightCyan: '#67e8f9',
437
+ white: '#e2e8f0',
438
+ brightWhite: '#f8fafc'
439
+ }
440
+ });
441
+
442
+ const fitAddon = new FitAddon.FitAddon();
443
+ term.loadAddon(fitAddon);
444
+ term.open(document.getElementById('terminal-container'));
445
+ fitAddon.fit();
446
+ window.addEventListener('resize', () => fitAddon.fit());
447
+
448
+ const statusEl = document.getElementById('status');
449
+ const socket = io({
450
+ reconnection: true,
451
+ reconnectionDelay: 1000,
452
+ reconnectionDelayMax: 5000,
453
+ reconnectionAttempts: Infinity
454
+ });
455
+
456
+ socket.on('connect', () => {
457
+ statusEl.textContent = 'Connected';
458
+ statusEl.className = 'connected';
459
+ socket.emit('subscribe-tmux', '${sessionId}');
460
+ });
461
+ socket.on('disconnect', () => {
462
+ statusEl.textContent = 'Disconnected';
463
+ statusEl.className = 'disconnected';
464
+ });
465
+ socket.io.on('reconnect_attempt', (attempt) => {
466
+ statusEl.textContent = 'Reconnecting... (' + attempt + ')';
467
+ statusEl.className = 'disconnected';
468
+ });
469
+ socket.on('tmux-output', (data) => term.write(data.output));
470
+ socket.on('tmux-error', (data) => {
471
+ term.write('\\r\\n[ERROR] ' + data.error + '\\r\\n');
472
+ });
473
+ term.onData((data) => socket.emit('tmux-input', { sessionId: '${sessionId}', input: data }));
474
+ </script>
475
+ </body>
476
+ </html>
477
+ `;
478
+ }
479
+ }
480
+ //# sourceMappingURL=TmuxViewServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TmuxViewServer.js","sourceRoot":"","sources":["../../../src/implementations/tmux/TmuxViewServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,QAAQ,CAAiB;IAChC,iBAAiB,CAAoB;IACrC,WAAW,CAAc;IACzB,WAAW,CAAqB;IAChC,aAAa,GAAY,KAAK,CAAC;IAC/B,iBAAiB,GAAsB,IAAI,GAAG,EAAE,CAAC;IAEzD;QACE,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;QAC7C,yFAAyF;QACzF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC9D,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyGN,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,uBAAuB,CAAC,SAAiB;QAC/C,OAAO;;;;;;kCAMuB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiC/B,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAoDkB,SAAS;;;;;;;;;;;;;;oEAcoB,SAAS;;;;KAIxE,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Tmux Tool Implementations
3
+ */
4
+ export { TmuxSessionTool } from './TmuxSessionTool.js';
5
+ export { TmuxViewServer } from './TmuxViewServer.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/implementations/tmux/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Tmux Tool Implementations
3
+ */
4
+ export { TmuxSessionTool } from './TmuxSessionTool.js';
5
+ export { TmuxViewServer } from './TmuxViewServer.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/implementations/tmux/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * AskUserQuestion Tool Executor
3
+ *
4
+ * Present multiple-choice questions to users during execution.
5
+ * Allows agent to gather user preferences, clarify ambiguous instructions,
6
+ * and get decisions on implementation choices.
7
+ */
8
+ import { BaseTool, type ToolResult } from '../../base/index.js';
9
+ import type { ExecutorConfig } from '../../base/ToolRegistry.js';
10
+ /**
11
+ * Answer option for a question
12
+ */
13
+ export interface QuestionOption {
14
+ /**
15
+ * Display text for this option (1-5 words)
16
+ */
17
+ label: string;
18
+ /**
19
+ * Explanation of what this option means
20
+ */
21
+ description: string;
22
+ }
23
+ /**
24
+ * Single question with multiple choice options
25
+ */
26
+ export interface Question {
27
+ /**
28
+ * The complete question to ask
29
+ */
30
+ question: string;
31
+ /**
32
+ * Short label displayed as chip/tag (max 12 chars)
33
+ */
34
+ header: string;
35
+ /**
36
+ * Available choices (2-4 options)
37
+ */
38
+ options: QuestionOption[];
39
+ /**
40
+ * Allow multiple selections
41
+ */
42
+ multiSelect: boolean;
43
+ }
44
+ /**
45
+ * Parameters for the AskUserQuestion tool
46
+ */
47
+ export interface AskUserQuestionToolParams {
48
+ /**
49
+ * Questions to ask (1-4 questions)
50
+ */
51
+ questions: Question[];
52
+ /**
53
+ * User's answers (filled by client)
54
+ */
55
+ answers?: Record<string, string>;
56
+ }
57
+ /**
58
+ * AskUserQuestion Tool Executor
59
+ *
60
+ * Features:
61
+ * - Present 1-4 multiple choice questions
62
+ * - Each question has 2-4 options
63
+ * - Support for single or multi-select
64
+ * - Clear formatting for user interaction
65
+ */
66
+ export declare class AskUserQuestionTool extends BaseTool<AskUserQuestionToolParams, ToolResult> {
67
+ private config;
68
+ constructor(config: ExecutorConfig);
69
+ validateToolParams(params: AskUserQuestionToolParams): string | null;
70
+ getDescription(params: AskUserQuestionToolParams): string;
71
+ execute(params: AskUserQuestionToolParams, signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
72
+ /**
73
+ * Format questions for user display
74
+ */
75
+ private formatQuestions;
76
+ }
77
+ //# sourceMappingURL=AskUserQuestionTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AskUserQuestionTool.d.ts","s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