@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,390 @@
1
+ /**
2
+ * Keyframe Detector
3
+ *
4
+ * Intelligently detects when screenshots should be sent to vision API
5
+ * Uses DOM analysis, perceptual hashing, and event monitoring
6
+ * to minimize unnecessary API calls while maintaining accuracy.
7
+ *
8
+ * Features:
9
+ * - Navigation change detection
10
+ * - DOM mutation monitoring
11
+ * - Modal/alert detection
12
+ * - Visual error detection
13
+ * - Perceptual hash-based change detection
14
+ * - Event-driven keyframe triggers
15
+ */
16
+ import { EventEmitter } from 'events';
17
+ import crypto from 'crypto';
18
+ /**
19
+ * KeyframeDetector - Smart detection of when to send screenshots to vision API
20
+ *
21
+ * Monitors page state and triggers keyframe captures only when significant
22
+ * changes occur, dramatically reducing API costs while maintaining accuracy.
23
+ *
24
+ * @example
25
+ * const detector = new KeyframeDetector(page, {
26
+ * domMutationThreshold: 50,
27
+ * visualHashThreshold: 0.15
28
+ * });
29
+ *
30
+ * detector.on('keyframe', (trigger: KeyframeTrigger) => {
31
+ * console.log(`Keyframe needed: ${trigger.reason}`);
32
+ * // Send screenshot to vision API
33
+ * });
34
+ *
35
+ * await detector.start();
36
+ */
37
+ export class KeyframeDetector extends EventEmitter {
38
+ page;
39
+ config;
40
+ isRunning = false;
41
+ lastSnapshot = null;
42
+ mutationCount = 0;
43
+ modalCheckInterval = null;
44
+ constructor(page, config = {}) {
45
+ super();
46
+ this.page = page;
47
+ this.config = {
48
+ domMutationThreshold: config.domMutationThreshold ?? 50,
49
+ visualHashThreshold: config.visualHashThreshold ?? 0.15,
50
+ modalCheckInterval: config.modalCheckInterval ?? 500,
51
+ detectNavigation: config.detectNavigation ?? true,
52
+ detectDOMMutations: config.detectDOMMutations ?? true,
53
+ detectModals: config.detectModals ?? true,
54
+ detectErrors: config.detectErrors ?? true
55
+ };
56
+ }
57
+ /**
58
+ * Start monitoring for keyframe triggers
59
+ */
60
+ async start() {
61
+ if (this.isRunning) {
62
+ console.warn('KeyframeDetector already running');
63
+ return;
64
+ }
65
+ this.isRunning = true;
66
+ // Take initial snapshot
67
+ this.lastSnapshot = await this.captureSnapshot();
68
+ // Set up detectors
69
+ if (this.config.detectNavigation) {
70
+ await this.setupNavigationDetector();
71
+ }
72
+ if (this.config.detectDOMMutations) {
73
+ await this.setupDOMMutationDetector();
74
+ }
75
+ if (this.config.detectModals) {
76
+ this.setupModalDetector();
77
+ }
78
+ if (this.config.detectErrors) {
79
+ await this.setupErrorDetector();
80
+ }
81
+ this.emit('start', { config: this.config });
82
+ }
83
+ /**
84
+ * Stop monitoring
85
+ */
86
+ stop() {
87
+ if (!this.isRunning) {
88
+ return;
89
+ }
90
+ this.isRunning = false;
91
+ if (this.modalCheckInterval) {
92
+ clearInterval(this.modalCheckInterval);
93
+ this.modalCheckInterval = null;
94
+ }
95
+ this.emit('stop');
96
+ }
97
+ /**
98
+ * Manually trigger keyframe (for user requests)
99
+ */
100
+ triggerKeyframe(reason, metadata) {
101
+ const trigger = {
102
+ type: 'user_request',
103
+ reason,
104
+ confidence: 1.0,
105
+ metadata,
106
+ timestamp: Date.now()
107
+ };
108
+ this.emit('keyframe', trigger);
109
+ }
110
+ /**
111
+ * Capture current page snapshot
112
+ */
113
+ async captureSnapshot() {
114
+ const url = this.page.url();
115
+ const title = await this.page.title();
116
+ // Compute DOM hash
117
+ const domContent = await this.page.evaluate(() => {
118
+ return document.body.innerHTML;
119
+ });
120
+ const domHash = this.computeHash(domContent);
121
+ // Get element count
122
+ const elementCount = await this.page.evaluate(() => {
123
+ return document.querySelectorAll('*').length;
124
+ });
125
+ // Check for modals
126
+ const hasModal = await this.detectModal();
127
+ // Check for errors
128
+ const hasError = await this.detectError();
129
+ // Compute visual hash (placeholder - would need actual perceptual hashing)
130
+ const visualHash = this.computeHash(url + title + elementCount);
131
+ return {
132
+ url,
133
+ title,
134
+ domHash,
135
+ visualHash,
136
+ elementCount,
137
+ hasModal,
138
+ hasError
139
+ };
140
+ }
141
+ /**
142
+ * Set up navigation change detector
143
+ */
144
+ async setupNavigationDetector() {
145
+ this.page.on('framenavigated', async (frame) => {
146
+ if (frame === this.page.mainFrame()) {
147
+ const newSnapshot = await this.captureSnapshot();
148
+ if (this.lastSnapshot && newSnapshot.url !== this.lastSnapshot.url) {
149
+ const trigger = {
150
+ type: 'navigation',
151
+ reason: `Navigation from ${this.lastSnapshot.url} to ${newSnapshot.url}`,
152
+ confidence: 1.0,
153
+ metadata: {
154
+ fromUrl: this.lastSnapshot.url,
155
+ toUrl: newSnapshot.url
156
+ },
157
+ timestamp: Date.now()
158
+ };
159
+ this.emit('keyframe', trigger);
160
+ }
161
+ this.lastSnapshot = newSnapshot;
162
+ }
163
+ });
164
+ }
165
+ /**
166
+ * Set up DOM mutation detector
167
+ */
168
+ async setupDOMMutationDetector() {
169
+ await this.page.evaluate((threshold) => {
170
+ let mutationCount = 0;
171
+ const observer = new MutationObserver((mutations) => {
172
+ mutationCount += mutations.length;
173
+ if (mutationCount >= threshold) {
174
+ // Emit custom event that we'll listen for
175
+ window.dispatchEvent(new CustomEvent('significant-mutation', {
176
+ detail: { count: mutationCount }
177
+ }));
178
+ mutationCount = 0;
179
+ }
180
+ });
181
+ observer.observe(document.body, {
182
+ childList: true,
183
+ subtree: true,
184
+ attributes: true,
185
+ characterData: true
186
+ });
187
+ // Store observer so we can disconnect later
188
+ window.__keyframeDetectorObserver = observer;
189
+ }, this.config.domMutationThreshold);
190
+ // Listen for custom event
191
+ await this.page.exposeFunction('__triggerDOMMutation', (count) => {
192
+ const trigger = {
193
+ type: 'dom_mutation',
194
+ reason: `Significant DOM changes detected (${count} mutations)`,
195
+ confidence: 0.8,
196
+ metadata: { mutationCount: count },
197
+ timestamp: Date.now()
198
+ };
199
+ this.emit('keyframe', trigger);
200
+ });
201
+ await this.page.evaluate(() => {
202
+ window.addEventListener('significant-mutation', (e) => {
203
+ window.__triggerDOMMutation(e.detail.count);
204
+ });
205
+ });
206
+ }
207
+ /**
208
+ * Set up modal detector (periodic check)
209
+ */
210
+ setupModalDetector() {
211
+ this.modalCheckInterval = setInterval(async () => {
212
+ if (!this.isRunning)
213
+ return;
214
+ try {
215
+ const hasModal = await this.detectModal();
216
+ if (hasModal && (!this.lastSnapshot || !this.lastSnapshot.hasModal)) {
217
+ const trigger = {
218
+ type: 'modal',
219
+ reason: 'Modal or dialog detected on page',
220
+ confidence: 0.9,
221
+ timestamp: Date.now()
222
+ };
223
+ this.emit('keyframe', trigger);
224
+ if (this.lastSnapshot) {
225
+ this.lastSnapshot.hasModal = true;
226
+ }
227
+ }
228
+ }
229
+ catch (error) {
230
+ // Ignore navigation errors - page context was destroyed during navigation
231
+ if (!error.message?.includes('Execution context was destroyed')) {
232
+ // Re-throw other errors
233
+ throw error;
234
+ }
235
+ }
236
+ }, this.config.modalCheckInterval);
237
+ }
238
+ /**
239
+ * Set up error detector
240
+ */
241
+ async setupErrorDetector() {
242
+ // Listen for console errors
243
+ this.page.on('console', (msg) => {
244
+ if (msg.type() === 'error') {
245
+ const trigger = {
246
+ type: 'error',
247
+ reason: `Console error: ${msg.text()}`,
248
+ confidence: 0.7,
249
+ metadata: { errorText: msg.text() },
250
+ timestamp: Date.now()
251
+ };
252
+ this.emit('keyframe', trigger);
253
+ }
254
+ });
255
+ // Listen for page errors
256
+ this.page.on('pageerror', (error) => {
257
+ const trigger = {
258
+ type: 'error',
259
+ reason: `Page error: ${error.message}`,
260
+ confidence: 0.9,
261
+ metadata: { error: error.message },
262
+ timestamp: Date.now()
263
+ };
264
+ this.emit('keyframe', trigger);
265
+ });
266
+ }
267
+ /**
268
+ * Detect if modal/dialog is present
269
+ */
270
+ async detectModal() {
271
+ return await this.page.evaluate(() => {
272
+ // Common modal selectors
273
+ const modalSelectors = [
274
+ '[role="dialog"]',
275
+ '[role="alertdialog"]',
276
+ '.modal',
277
+ '.dialog',
278
+ '[aria-modal="true"]'
279
+ ];
280
+ for (const selector of modalSelectors) {
281
+ const element = document.querySelector(selector);
282
+ if (element && element.offsetParent !== null) {
283
+ return true;
284
+ }
285
+ }
286
+ return false;
287
+ });
288
+ }
289
+ /**
290
+ * Detect if error is visible on page
291
+ */
292
+ async detectError() {
293
+ return await this.page.evaluate(() => {
294
+ const errorSelectors = [
295
+ '.error',
296
+ '.error-message',
297
+ '[role="alert"]',
298
+ '.alert-danger',
299
+ '.notification-error'
300
+ ];
301
+ for (const selector of errorSelectors) {
302
+ const element = document.querySelector(selector);
303
+ if (element && element.offsetParent !== null) {
304
+ const text = element.textContent?.toLowerCase() || '';
305
+ if (text.includes('error') || text.includes('failed') || text.includes('wrong')) {
306
+ return true;
307
+ }
308
+ }
309
+ }
310
+ return false;
311
+ });
312
+ }
313
+ /**
314
+ * Compute simple hash of content
315
+ */
316
+ computeHash(content) {
317
+ return crypto.createHash('md5').update(content).digest('hex');
318
+ }
319
+ /**
320
+ * Compute perceptual hash difference between two snapshots
321
+ * Returns 0-1, where 0 is identical and 1 is completely different
322
+ */
323
+ async computeVisualDifference() {
324
+ if (!this.lastSnapshot) {
325
+ return 1.0; // No baseline, assume different
326
+ }
327
+ const newSnapshot = await this.captureSnapshot();
328
+ // Simple comparison based on DOM hash and element count
329
+ if (newSnapshot.domHash === this.lastSnapshot.domHash) {
330
+ return 0.0; // Identical
331
+ }
332
+ // Calculate difference based on element count change
333
+ const elementDiff = Math.abs(newSnapshot.elementCount - this.lastSnapshot.elementCount) / Math.max(newSnapshot.elementCount, this.lastSnapshot.elementCount);
334
+ return Math.min(elementDiff, 1.0);
335
+ }
336
+ /**
337
+ * Check if visual change threshold is exceeded
338
+ */
339
+ async shouldSendToAPI() {
340
+ const visualDiff = await this.computeVisualDifference();
341
+ if (visualDiff >= this.config.visualHashThreshold) {
342
+ return {
343
+ should: true,
344
+ reason: `Visual difference ${(visualDiff * 100).toFixed(1)}% exceeds threshold`,
345
+ confidence: Math.min(visualDiff * 2, 1.0)
346
+ };
347
+ }
348
+ const newSnapshot = await this.captureSnapshot();
349
+ // Check for modals
350
+ if (newSnapshot.hasModal && (!this.lastSnapshot || !this.lastSnapshot.hasModal)) {
351
+ return {
352
+ should: true,
353
+ reason: 'Modal detected',
354
+ confidence: 0.9
355
+ };
356
+ }
357
+ // Check for errors
358
+ if (newSnapshot.hasError && (!this.lastSnapshot || !this.lastSnapshot.hasError)) {
359
+ return {
360
+ should: true,
361
+ reason: 'Error detected',
362
+ confidence: 0.9
363
+ };
364
+ }
365
+ return {
366
+ should: false,
367
+ reason: 'No significant changes detected',
368
+ confidence: 0.0
369
+ };
370
+ }
371
+ /**
372
+ * Get current detector state
373
+ */
374
+ getState() {
375
+ return {
376
+ isRunning: this.isRunning,
377
+ lastSnapshot: this.lastSnapshot,
378
+ config: this.config
379
+ };
380
+ }
381
+ /**
382
+ * Cleanup resources
383
+ */
384
+ destroy() {
385
+ this.stop();
386
+ this.removeAllListeners();
387
+ this.lastSnapshot = null;
388
+ }
389
+ }
390
+ //# sourceMappingURL=KeyframeDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyframeDetector.js","sourceRoot":"","sources":["../../../src/implementations/addon/KeyframeDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAiC5B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IACxC,IAAI,CAAO;IACX,MAAM,CAA2B;IACjC,SAAS,GAAY,KAAK,CAAC;IAE3B,YAAY,GAAwB,IAAI,CAAC;IACzC,aAAa,GAAW,CAAC,CAAC;IAC1B,kBAAkB,GAA0C,IAAI,CAAC;IAEzE,YAAY,IAAU,EAAE,SAAyB,EAAE;QACjD,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AY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChF,OAAO;gBACL,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,gBAAgB;gBACxB,UAAU,EAAE,GAAG;aAChB,CAAC;QACJ,CAAC;QAED,mBAAmB;QACnB,IAAI,WAAW,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChF,OAAO;gBACL,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,gBAAgB;gBACxB,UAAU,EAAE,GAAG;aAChB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,iCAAiC;YACzC,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QAKN,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,62 @@
1
+ import { BaseTool } from '../../base/BaseTool.js';
2
+ import type { ToolResult } from '../../base/ToolResult.js';
3
+ /**
4
+ * Parameters for ModifySandbox tool
5
+ */
6
+ export interface ModifySandboxParams {
7
+ sandboxId: string;
8
+ file: string;
9
+ content: string;
10
+ waitForReload?: boolean;
11
+ captureAfterReload?: boolean;
12
+ verifyChanges?: boolean;
13
+ }
14
+ /**
15
+ * ModifySandboxTool - Edit sandbox code with automatic hot reload and verification
16
+ *
17
+ * This tool provides a higher-level interface than raw Write tool:
18
+ * - Edits files within the sandbox directory
19
+ * - Waits for hot reload to complete
20
+ * - Captures visual snapshot after changes
21
+ * - Verifies changes took effect
22
+ *
23
+ * Advantages over Write tool:
24
+ * 1. Sandbox-aware - knows sandbox directory structure
25
+ * 2. Hot reload integration - waits for restart
26
+ * 3. Automatic verification - captures post-edit snapshot
27
+ * 4. Error detection - checks if reload succeeded
28
+ *
29
+ * Use Cases:
30
+ * 1. Iterative development - Edit → See → Edit again
31
+ * 2. Bug fixing - Modify code, verify fix visually
32
+ * 3. Feature addition - Add code, test immediately
33
+ * 4. Styling - Change CSS, see results instantly
34
+ *
35
+ * Example:
36
+ * ```
37
+ * await modifySandbox({
38
+ * sandboxId: "abc-123",
39
+ * file: "index.js",
40
+ * content: "// fixed code",
41
+ * waitForReload: true,
42
+ * captureAfterReload: true
43
+ * });
44
+ * ```
45
+ */
46
+ export declare class ModifySandboxExecutor extends BaseTool<ModifySandboxParams, ToolResult> {
47
+ private sandboxDir;
48
+ constructor(config: {
49
+ workingDirectory: string;
50
+ });
51
+ validateToolParams(params: ModifySandboxParams): string | null;
52
+ execute(params: ModifySandboxParams, signal: AbortSignal): Promise<ToolResult>;
53
+ /**
54
+ * Wait helper
55
+ */
56
+ private wait;
57
+ /**
58
+ * Format modification output for model consumption
59
+ */
60
+ private formatModificationOutput;
61
+ }
62
+ //# sourceMappingURL=ModifySandboxTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModifySandboxTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/addon/ModifySandboxTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQ3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC;IAClF,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE;IA0ChD,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI;IAqBxD,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAiIpF;;OAEG;IACH,OAAO,CAAC,IAAI;IAIZ;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAyEjC"}