@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,220 @@
1
+ /**
2
+ * WriteFile Tool Executor
3
+ *
4
+ * Writes content to a specified file in the local filesystem.
5
+ * Can create new files or overwrite existing ones.
6
+ *
7
+ * Adapted from Gemini CLI patterns
8
+ */
9
+ import fs from 'fs';
10
+ import path from 'path';
11
+ import { BaseTool } from '../../base/index.js';
12
+ import { SchemaValidator } from '../../utils/SchemaValidator.js';
13
+ import { makeRelative, shortenPath, fileExists, resolveFilePath, } from '../../utils/FileUtils.js';
14
+ /**
15
+ * Document file extensions that get collapsible preview (no full content in metadata)
16
+ */
17
+ const DOCUMENT_EXTENSIONS = ['.md', '.mdx', '.txt', '.rst', '.adoc', '.markdown'];
18
+ /**
19
+ * Detect if a file is a document (markdown, text, etc.) vs code/other
20
+ */
21
+ function isDocumentFile(filePath) {
22
+ const ext = path.extname(filePath).toLowerCase();
23
+ return DOCUMENT_EXTENSIONS.includes(ext);
24
+ }
25
+ /**
26
+ * Detect programming language from file extension for syntax highlighting hints
27
+ */
28
+ function detectLanguage(filePath) {
29
+ const ext = path.extname(filePath).toLowerCase();
30
+ const languageMap = {
31
+ '.ts': 'typescript',
32
+ '.tsx': 'typescript',
33
+ '.js': 'javascript',
34
+ '.jsx': 'javascript',
35
+ '.py': 'python',
36
+ '.rb': 'ruby',
37
+ '.go': 'go',
38
+ '.rs': 'rust',
39
+ '.java': 'java',
40
+ '.c': 'c',
41
+ '.cpp': 'cpp',
42
+ '.h': 'c',
43
+ '.hpp': 'cpp',
44
+ '.cs': 'csharp',
45
+ '.php': 'php',
46
+ '.swift': 'swift',
47
+ '.kt': 'kotlin',
48
+ '.scala': 'scala',
49
+ '.r': 'r',
50
+ '.sql': 'sql',
51
+ '.sh': 'bash',
52
+ '.bash': 'bash',
53
+ '.zsh': 'bash',
54
+ '.json': 'json',
55
+ '.yaml': 'yaml',
56
+ '.yml': 'yaml',
57
+ '.toml': 'toml',
58
+ '.xml': 'xml',
59
+ '.html': 'html',
60
+ '.htm': 'html',
61
+ '.css': 'css',
62
+ '.scss': 'scss',
63
+ '.sass': 'sass',
64
+ '.less': 'less',
65
+ '.vue': 'vue',
66
+ '.svelte': 'svelte',
67
+ };
68
+ return languageMap[ext];
69
+ }
70
+ /**
71
+ * WriteFile Tool Executor
72
+ *
73
+ * Features:
74
+ * - Creates new files
75
+ * - Overwrites existing files
76
+ * - Creates parent directories if needed
77
+ * - Path normalization and validation
78
+ * - Security: prevents path traversal
79
+ */
80
+ export class WriteFileTool extends BaseTool {
81
+ config;
82
+ constructor(config) {
83
+ super('Write', 'Write', 'Writes content to a specified file in the local filesystem. Can create new files or overwrite existing ones. Parent directories will be created if they do not exist.', {
84
+ type: 'object',
85
+ properties: {
86
+ file_path: {
87
+ type: 'string',
88
+ description: "The path to the file to write to (e.g., 'src/file.txt' or '/home/user/project/file.txt'). Can be absolute or relative to the current working directory.",
89
+ },
90
+ content: {
91
+ type: 'string',
92
+ description: 'The content to write to the file.',
93
+ },
94
+ },
95
+ required: ['file_path', 'content'],
96
+ });
97
+ this.config = config;
98
+ }
99
+ validateToolParams(params) {
100
+ // Schema validation
101
+ const schemaError = SchemaValidator.validate(this.parameterSchema, params);
102
+ if (schemaError) {
103
+ return schemaError;
104
+ }
105
+ // Normalize and resolve path (with smart fallback for doubled directory names)
106
+ let filePath = resolveFilePath(params.file_path, this.config.workingDirectory);
107
+ // Path validation: allow any absolute path (matching standard absolute-path behavior).
108
+ if (!path.isAbsolute(filePath)) {
109
+ return `File path must resolve to an absolute path: ${filePath}`;
110
+ }
111
+ // Update params with resolved path
112
+ params.file_path = filePath;
113
+ // Check if path is a directory
114
+ if (fileExists(filePath)) {
115
+ try {
116
+ const stats = fs.lstatSync(filePath);
117
+ if (stats.isDirectory()) {
118
+ return `Path is a directory, not a file: ${filePath}`;
119
+ }
120
+ }
121
+ catch (error) {
122
+ return `Error accessing path: ${error.message}`;
123
+ }
124
+ }
125
+ return null;
126
+ }
127
+ getDescription(params) {
128
+ if (!params || !params.file_path) {
129
+ return 'Write file';
130
+ }
131
+ const relativePath = makeRelative(params.file_path, this.config.workingDirectory);
132
+ const shortened = shortenPath(relativePath);
133
+ const contentSize = params.content ? params.content.length : 0;
134
+ return `Write ${shortened} (${contentSize} bytes)`;
135
+ }
136
+ async execute(params, signal, updateOutput) {
137
+ const startTime = Date.now();
138
+ // Validate parameters
139
+ const validationError = this.validateToolParams(params);
140
+ if (validationError) {
141
+ return this.createErrorResult(validationError);
142
+ }
143
+ try {
144
+ // Ensure parent directory exists
145
+ const dirPath = path.dirname(params.file_path);
146
+ if (!fs.existsSync(dirPath)) {
147
+ fs.mkdirSync(dirPath, { recursive: true });
148
+ }
149
+ // Check if file exists (for reporting)
150
+ const existed = fileExists(params.file_path);
151
+ const action = existed ? 'Updated' : 'Created';
152
+ // Write file
153
+ await fs.promises.writeFile(params.file_path, params.content, 'utf-8');
154
+ // Get file stats
155
+ const stats = await fs.promises.stat(params.file_path);
156
+ const fileSize = stats.size;
157
+ const lineCount = params.content.split('\n').length;
158
+ // Format for display
159
+ const relativePath = makeRelative(params.file_path, this.config.workingDirectory);
160
+ const displayContent = `${action} ${relativePath} (${lineCount} lines, ${fileSize} bytes)`;
161
+ // Stream output if callback provided
162
+ if (updateOutput) {
163
+ updateOutput(displayContent);
164
+ }
165
+ // Build metadata with preview information
166
+ const metadata = {
167
+ executionTime: Date.now() - startTime,
168
+ resourcesUsed: {
169
+ files: [params.file_path],
170
+ },
171
+ fileStats: {
172
+ path: relativePath,
173
+ size: fileSize,
174
+ lines: lineCount,
175
+ action,
176
+ existed,
177
+ operation: 'create',
178
+ },
179
+ };
180
+ // Add preview metadata based on file type
181
+ const isDocument = isDocumentFile(params.file_path);
182
+ if (isDocument) {
183
+ // Document files: store minimal metadata (content lazy-loaded on expand)
184
+ const wordCount = params.content.split(/\s+/).filter(Boolean).length;
185
+ const isMarkdown = params.file_path.endsWith('.md') || params.file_path.endsWith('.mdx');
186
+ metadata.documentPreview = {
187
+ filePath: relativePath,
188
+ lineCount,
189
+ wordCount,
190
+ isMarkdown,
191
+ };
192
+ }
193
+ else {
194
+ // Code/other files: store full content for preview persistence
195
+ metadata.writePreview = {
196
+ filePath: relativePath,
197
+ content: params.content,
198
+ lineCount,
199
+ byteSize: fileSize,
200
+ language: detectLanguage(params.file_path),
201
+ };
202
+ }
203
+ return this.createSuccessResult(displayContent, metadata);
204
+ }
205
+ catch (error) {
206
+ // Handle write errors
207
+ if (error.code === 'EACCES') {
208
+ return this.createErrorResult(`Permission denied: ${params.file_path}`);
209
+ }
210
+ if (error.code === 'ENOSPC') {
211
+ return this.createErrorResult('No space left on device');
212
+ }
213
+ if (error.code === 'EROFS') {
214
+ return this.createErrorResult('Read-only file system');
215
+ }
216
+ return this.createErrorResult(`Failed to write file: ${error.message}`);
217
+ }
218
+ }
219
+ }
220
+ //# sourceMappingURL=WriteFileTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WriteFileTool.js","sourceRoot":"","sources":["../../../src/implementations/file/WriteFileTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAGlC;;GAEG;AACH,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAElF;;GAEG;AAC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AC,yBAAyB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * File Operation Tool Executors
3
+ */
4
+ export { ReadFileTool, type ReadFileToolParams } from './ReadFileTool.js';
5
+ export { WriteFileTool, type WriteFileToolParams } from './WriteFileTool.js';
6
+ export { WriteBinaryTool, type WriteBinaryToolParams } from './WriteBinaryTool.js';
7
+ export { EditTool, type EditToolParams, FileReadTracker } from './EditTool.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/implementations/file/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * File Operation Tool Executors
3
+ */
4
+ export { ReadFileTool } from './ReadFileTool.js';
5
+ export { WriteFileTool } from './WriteFileTool.js';
6
+ export { WriteBinaryTool } from './WriteBinaryTool.js';
7
+ export { EditTool, FileReadTracker } from './EditTool.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/implementations/file/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAA8B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAuB,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * GetConversationSegment Tool Executor
3
+ *
4
+ * Retrieves specific segments of conversation history at different detail levels.
5
+ * Can retrieve by turn range or checkpoint ID.
6
+ */
7
+ import { BaseTool, type ToolResult } from '../../base/index.js';
8
+ import type { ExecutorConfig } from '../../base/ToolRegistry.js';
9
+ /**
10
+ * Parameters for the GetConversationSegment tool
11
+ */
12
+ export interface GetConversationSegmentToolParams {
13
+ /** Turn range to retrieve */
14
+ turnRange?: {
15
+ start: number;
16
+ end: number;
17
+ };
18
+ /** Checkpoint ID to retrieve from */
19
+ checkpointId?: string;
20
+ /** Format of the returned segment */
21
+ format?: 'full' | 'summary' | 'compressed';
22
+ }
23
+ /**
24
+ * GetConversationSegment Tool Executor
25
+ *
26
+ * Features:
27
+ * - Retrieve by turn range or checkpoint
28
+ * - Multiple format options (full, summary, compressed)
29
+ * - Handles compacted sections
30
+ */
31
+ export declare class GetConversationSegmentToolExecutor extends BaseTool<GetConversationSegmentToolParams, ToolResult> {
32
+ private config;
33
+ private historyStore;
34
+ private workspaceRoot;
35
+ constructor(config: ExecutorConfig);
36
+ validateToolParams(params: GetConversationSegmentToolParams): string | null;
37
+ getDescription(params: GetConversationSegmentToolParams): string;
38
+ execute(params: GetConversationSegmentToolParams, signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
39
+ /**
40
+ * Format conversation segment for display
41
+ */
42
+ private formatSegment;
43
+ }
44
+ //# sourceMappingURL=GetConversationSegmentTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetConversationSegmentTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/historical/GetConversationSegmentTool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAOjE;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,6BAA6B;IAC7B,SAAS,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IAEF,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC;CAC5C;AAED;;;;;;;GAOG;AACH,qBAAa,kCAAmC,SAAQ,QAAQ,CAC9D,gCAAgC,EAChC,UAAU,CACX;IAIa,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,aAAa,CAAS;gBAEV,MAAM,EAAE,cAAc;IA0C1C,kBAAkB,CAAC,MAAM,EAAE,gCAAgC,GAAG,MAAM,GAAG,IAAI;IA8B3E,cAAc,CAAC,MAAM,EAAE,gCAAgC,GAAG,MAAM;IAQ1D,OAAO,CACX,MAAM,EAAE,gCAAgC,EACxC,MAAM,EAAE,WAAW,EACnB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,UAAU,CAAC;IA+GtB;;OAEG;IACH,OAAO,CAAC,aAAa;CAiCtB"}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * GetConversationSegment Tool Executor
3
+ *
4
+ * Retrieves specific segments of conversation history at different detail levels.
5
+ * Can retrieve by turn range or checkpoint ID.
6
+ */
7
+ import { BaseTool } from '../../base/index.js';
8
+ import { SchemaValidator } from '../../utils/SchemaValidator.js';
9
+ import { GetConversationSegmentTool as CoreGetSegmentTool, JSONLHistoryStore, } from '@nexus-cortex/core';
10
+ /**
11
+ * GetConversationSegment Tool Executor
12
+ *
13
+ * Features:
14
+ * - Retrieve by turn range or checkpoint
15
+ * - Multiple format options (full, summary, compressed)
16
+ * - Handles compacted sections
17
+ */
18
+ export class GetConversationSegmentToolExecutor extends BaseTool {
19
+ config;
20
+ historyStore;
21
+ workspaceRoot;
22
+ constructor(config) {
23
+ super('GetConversationSegment', 'GetConversationSegment', `Retrieve a specific segment of conversation history at different detail levels.
24
+
25
+ Can retrieve by turn range or checkpoint ID in full, summary, or compressed format.`, {
26
+ type: 'object',
27
+ properties: {
28
+ turnRange: {
29
+ type: 'object',
30
+ properties: {
31
+ start: {
32
+ type: 'number',
33
+ description: 'Starting turn number (1-based)',
34
+ },
35
+ end: {
36
+ type: 'number',
37
+ description: 'Ending turn number (inclusive)',
38
+ },
39
+ },
40
+ description: 'Turn range to retrieve',
41
+ },
42
+ checkpointId: {
43
+ type: 'string',
44
+ description: 'Checkpoint ID to retrieve from',
45
+ },
46
+ format: {
47
+ type: 'string',
48
+ enum: ['full', 'summary', 'compressed'],
49
+ description: 'Format of the returned segment',
50
+ default: 'summary',
51
+ },
52
+ },
53
+ });
54
+ this.config = config;
55
+ this.workspaceRoot = config.workspaceRoot || config.workingDirectory;
56
+ this.historyStore = new JSONLHistoryStore({ baseDir: this.workspaceRoot });
57
+ }
58
+ validateToolParams(params) {
59
+ // Schema validation
60
+ const schemaError = SchemaValidator.validate(this.parameterSchema, params);
61
+ if (schemaError) {
62
+ return schemaError;
63
+ }
64
+ // Must provide either turnRange or checkpointId
65
+ if (!params.turnRange && !params.checkpointId) {
66
+ return 'Must provide either turnRange or checkpointId.';
67
+ }
68
+ // Validate turnRange if provided
69
+ if (params.turnRange) {
70
+ if (params.turnRange.start < 1) {
71
+ return 'Turn range start must be at least 1.';
72
+ }
73
+ if (params.turnRange.end < params.turnRange.start) {
74
+ return 'Turn range end must be >= start.';
75
+ }
76
+ }
77
+ // Validate format
78
+ if (params.format && !['full', 'summary', 'compressed'].includes(params.format)) {
79
+ return `Invalid format: ${params.format}. Must be 'full', 'summary', or 'compressed'.`;
80
+ }
81
+ return null;
82
+ }
83
+ getDescription(params) {
84
+ const format = params.format || 'summary';
85
+ if (params.turnRange) {
86
+ return `Getting conversation segment turns ${params.turnRange.start}-${params.turnRange.end} (${format})`;
87
+ }
88
+ return `Getting conversation segment from checkpoint ${params.checkpointId} (${format})`;
89
+ }
90
+ async execute(params, signal, updateOutput) {
91
+ const startTime = Date.now();
92
+ try {
93
+ // Check for abort
94
+ if (signal.aborted) {
95
+ return {
96
+ ...this.createErrorResult('Segment retrieval was cancelled'),
97
+ metadata: {
98
+ executionTime: Date.now() - startTime,
99
+ },
100
+ };
101
+ }
102
+ // Validate parameters
103
+ const validationError = this.validateToolParams(params);
104
+ if (validationError) {
105
+ return {
106
+ ...this.createErrorResult(validationError),
107
+ metadata: {
108
+ executionTime: Date.now() - startTime,
109
+ },
110
+ };
111
+ }
112
+ // Get session ID from config
113
+ const sessionId = this.config.sessionId;
114
+ if (!sessionId) {
115
+ return {
116
+ ...this.createErrorResult('Session ID not provided in executor config. Historical tools require active session context.'),
117
+ metadata: {
118
+ executionTime: Date.now() - startTime,
119
+ },
120
+ };
121
+ }
122
+ // Load messages from session storage
123
+ const messages = await this.historyStore.loadSession(sessionId, this.workspaceRoot);
124
+ if (messages.length === 0) {
125
+ return {
126
+ ...this.createSuccessResult('No messages found in session history.'),
127
+ metadata: {
128
+ executionTime: Date.now() - startTime,
129
+ sessionId,
130
+ messageCount: 0,
131
+ },
132
+ };
133
+ }
134
+ // Create core tool and execute
135
+ const coreTool = new CoreGetSegmentTool(this.workspaceRoot);
136
+ const input = {
137
+ turnRange: params.turnRange,
138
+ checkpointId: params.checkpointId,
139
+ format: params.format,
140
+ };
141
+ const segment = await coreTool.execute(input, sessionId, messages);
142
+ // Check for abort
143
+ if (signal.aborted) {
144
+ return {
145
+ ...this.createErrorResult('Segment retrieval was cancelled'),
146
+ metadata: {
147
+ executionTime: Date.now() - startTime,
148
+ },
149
+ };
150
+ }
151
+ // Format output
152
+ const formattedOutput = this.formatSegment(segment, params.format || 'summary');
153
+ return {
154
+ ...this.createSuccessResult(formattedOutput),
155
+ metadata: {
156
+ executionTime: Date.now() - startTime,
157
+ sessionId,
158
+ totalTokens: segment.metadata.totalTokens,
159
+ turnRange: segment.metadata.turnRange,
160
+ hasCompactions: segment.metadata.hasCompactions,
161
+ messageCount: segment.metadata.messageCount,
162
+ },
163
+ };
164
+ }
165
+ catch (error) {
166
+ // Check for abort
167
+ if (signal.aborted) {
168
+ return {
169
+ ...this.createErrorResult('Segment retrieval was cancelled'),
170
+ metadata: {
171
+ executionTime: Date.now() - startTime,
172
+ },
173
+ };
174
+ }
175
+ const errorMessage = error.message || String(error);
176
+ return {
177
+ ...this.createErrorResult(`Error retrieving conversation segment: ${errorMessage}`),
178
+ metadata: {
179
+ executionTime: Date.now() - startTime,
180
+ error: errorMessage,
181
+ },
182
+ };
183
+ }
184
+ }
185
+ /**
186
+ * Format conversation segment for display
187
+ */
188
+ formatSegment(segment, format) {
189
+ const lines = [];
190
+ lines.push('=== Conversation Segment ===\n\n');
191
+ lines.push(`Turns: ${segment.metadata.turnRange.start} - ${segment.metadata.turnRange.end}\n`);
192
+ lines.push(`Messages: ${segment.metadata.messageCount}\n`);
193
+ lines.push(`Estimated tokens: ${segment.metadata.totalTokens}\n`);
194
+ lines.push(`Has compactions: ${segment.metadata.hasCompactions ? 'Yes' : 'No'}\n\n`);
195
+ if (format === 'full' && segment.messages) {
196
+ lines.push('## Full Messages\n\n');
197
+ segment.messages.forEach((msg, index) => {
198
+ const msgAny = msg;
199
+ lines.push(`Message ${index + 1}:\n`);
200
+ if (msgAny.role) {
201
+ lines.push(` Role: ${msgAny.role}\n`);
202
+ }
203
+ if (msgAny.content) {
204
+ const content = typeof msgAny.content === 'string'
205
+ ? msgAny.content
206
+ : JSON.stringify(msgAny.content);
207
+ lines.push(` Content: ${content.substring(0, 200)}${content.length > 200 ? '...' : ''}\n`);
208
+ }
209
+ lines.push('\n');
210
+ });
211
+ }
212
+ else if (segment.summary) {
213
+ lines.push('## Summary\n\n');
214
+ lines.push(segment.summary);
215
+ lines.push('\n');
216
+ }
217
+ return lines.join('');
218
+ }
219
+ }
220
+ //# sourceMappingURL=GetConversationSegmentTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetConversationSegmentTool.js","sourceRoot":"","sources":["../../../src/implementations/historical/GetConversationSegmentTool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,EACL,0BAA0B,IAAI,kBAAkB,EAChD,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAmB5B;;;;;;;GAOG;AACH,MAAM,OAAO,kCAAmC,SAAQ,QAGvD;IAIqB;IAHZ,YAAY,CAAoB;IAChC,aAAa,CAAS;IAE9B,YAAoB,MAAsB;QACxC,KAAK,CACH,wBAAwB,EACxB,wBAAwB,EACxB;;oFAE8E,EAC9E;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,gCAAgC;yBAC9C;wBACD,GAAG,EAAE;4BACH,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,gCAAgC;yBAC9C;qBACF;oBACD,WAAW,EAAE,wBAAwB;iBACtC;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,gCAAgC;iBAC9C;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC;oBACvC,WAAW,EAAE,gCAAgC;oBAC7C,OAAO,EAAE,SAAS;iBACnB;aACF;SACF,CACF,CAAC;QApCgB,WAAM,GAAN,MAAM,CAAgB;QAsCxC,IAAI,CAAC,aAAa,GAAI,MAAc,CAAC,aAAa,IAAI,MAAM,CAAC,gBAAgB,CAA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3
+ *
4
+ * Lists all compaction boundaries (conversation summaries) with metadata.
5
+ * Provides an overview of the compaction history for the session.
6
+ */
7
+ import { BaseTool, type ToolResult } from '../../base/index.js';
8
+ import type { ExecutorConfig } from '../../base/ToolRegistry.js';
9
+ /**
10
+ * Parameters for the ListCompactionBoundaries tool
11
+ */
12
+ export interface ListCompactionBoundariesToolParams {
13
+ /** Include detailed metadata in response */
14
+ includeMetadata?: boolean;
15
+ }
16
+ /**
17
+ * ListCompactionBoundaries Tool Executor
18
+ *
19
+ * Features:
20
+ * - Lists all compaction boundaries chronologically
21
+ * - Shows token savings and compression ratios
22
+ * - Optional detailed metadata (topics, decisions, tools used)
23
+ */
24
+ export declare class ListCompactionBoundariesToolExecutor extends BaseTool<ListCompactionBoundariesToolParams, ToolResult> {
25
+ private config;
26
+ private workspaceRoot;
27
+ constructor(config: ExecutorConfig);
28
+ validateToolParams(params: ListCompactionBoundariesToolParams): string | null;
29
+ getDescription(params: ListCompactionBoundariesToolParams): string;
30
+ execute(params: ListCompactionBoundariesToolParams, signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
31
+ /**
32
+ * Format compaction boundaries for display
33
+ */
34
+ private formatBoundaries;
35
+ }
36
+ //# sourceMappingURL=ListCompactionBoundariesTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListCompactionBoundariesTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/historical/ListCompactionBoundariesTool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAMjE;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,qBAAa,oCAAqC,SAAQ,QAAQ,CAChE,kCAAkC,EAClC,UAAU,CACX;IAGa,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,aAAa,CAAS;gBAEV,MAAM,EAAE,cAAc;IAuB1C,kBAAkB,CAAC,MAAM,EAAE,kCAAkC,GAAG,MAAM,GAAG,IAAI;IAU7E,cAAc,CAAC,MAAM,EAAE,kCAAkC,GAAG,MAAM;IAI5D,OAAO,CACX,MAAM,EAAE,kCAAkC,EAC1C,MAAM,EAAE,WAAW,EACnB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,UAAU,CAAC;IAyFtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAsDzB"}