@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,144 @@
1
+ /**
2
+ * KillShell Tool Executor
3
+ *
4
+ * Terminates background shell processes started by ShellTool.
5
+ * Uses BackgroundProcessRegistry to track and kill processes.
6
+ *
7
+ * Ported from Gemini CLI kill-shell functionality
8
+ */
9
+ import { BaseTool } from '../../base/index.js';
10
+ import { SchemaValidator } from '../../utils/SchemaValidator.js';
11
+ import { BackgroundProcessRegistry } from './BackgroundProcessRegistry.js';
12
+ /**
13
+ * KillShell Tool Executor
14
+ *
15
+ * Features:
16
+ * - Terminates background shell processes by shell ID
17
+ * - Sends SIGTERM signal to process
18
+ * - Returns success/failure status
19
+ * - Removes terminated process from registry
20
+ */
21
+ export class KillShellTool extends BaseTool {
22
+ config;
23
+ registry;
24
+ constructor(config) {
25
+ super('KillShell', 'KillShell', `Kills a running background bash shell by its ID. Sends SIGTERM signal to the process. Returns a success or failure status.`, {
26
+ type: 'object',
27
+ properties: {
28
+ shell_id: {
29
+ type: 'string',
30
+ description: 'The ID of the background shell to kill',
31
+ },
32
+ },
33
+ required: ['shell_id'],
34
+ });
35
+ this.config = config;
36
+ this.registry = BackgroundProcessRegistry.getInstance();
37
+ }
38
+ validateToolParams(params) {
39
+ // Schema validation
40
+ const schemaError = SchemaValidator.validate(this.parameterSchema, params);
41
+ if (schemaError) {
42
+ return schemaError;
43
+ }
44
+ // Validate shell_id is not empty
45
+ if (!params.shell_id || !params.shell_id.trim()) {
46
+ return "The 'shell_id' parameter cannot be empty.";
47
+ }
48
+ return null;
49
+ }
50
+ getDescription(params) {
51
+ return `Killing background shell: ${params.shell_id}`;
52
+ }
53
+ async execute(params, signal, updateOutput) {
54
+ const startTime = Date.now();
55
+ try {
56
+ // Validate parameters
57
+ const validationError = this.validateToolParams(params);
58
+ if (validationError) {
59
+ return {
60
+ ...this.createErrorResult(validationError),
61
+ metadata: {
62
+ executionTime: Date.now() - startTime,
63
+ },
64
+ };
65
+ }
66
+ // Check if process exists
67
+ const process = this.registry.getProcess(params.shell_id);
68
+ if (!process) {
69
+ return {
70
+ ...this.createErrorResult(`Background shell '${params.shell_id}' not found. It may have already exited or been removed from the registry.`),
71
+ metadata: {
72
+ executionTime: Date.now() - startTime,
73
+ shell_id: params.shell_id,
74
+ found: false,
75
+ },
76
+ };
77
+ }
78
+ // Check if already not running
79
+ if (!process.isRunning) {
80
+ return {
81
+ ...this.createSuccessResult(`Shell '${params.shell_id}' (PID: ${process.pid}) was already not running (exit code: ${process.exitCode}). Removed from registry.`),
82
+ metadata: {
83
+ executionTime: Date.now() - startTime,
84
+ shell_id: params.shell_id,
85
+ pid: process.pid,
86
+ wasRunning: false,
87
+ exitCode: process.exitCode,
88
+ },
89
+ };
90
+ }
91
+ // Attempt to kill the process
92
+ const killed = this.registry.killProcess(params.shell_id);
93
+ if (killed) {
94
+ // Wait a moment to see if process exits
95
+ await new Promise((resolve) => setTimeout(resolve, 100));
96
+ // Remove from registry
97
+ this.registry.removeProcess(params.shell_id);
98
+ return {
99
+ ...this.createSuccessResult(`Successfully killed shell '${params.shell_id}' (PID: ${process.pid}) and removed from registry.`),
100
+ metadata: {
101
+ executionTime: Date.now() - startTime,
102
+ shell_id: params.shell_id,
103
+ pid: process.pid,
104
+ killed: true,
105
+ },
106
+ };
107
+ }
108
+ else {
109
+ return {
110
+ ...this.createErrorResult(`Failed to kill shell '${params.shell_id}' (PID: ${process.pid}). Process may have already exited or permission denied.`),
111
+ metadata: {
112
+ executionTime: Date.now() - startTime,
113
+ shell_id: params.shell_id,
114
+ pid: process.pid,
115
+ killed: false,
116
+ },
117
+ };
118
+ }
119
+ }
120
+ catch (error) {
121
+ // Check for abort
122
+ if (signal.aborted) {
123
+ return {
124
+ ...this.createErrorResult('Kill operation was cancelled'),
125
+ metadata: {
126
+ executionTime: Date.now() - startTime,
127
+ shell_id: params.shell_id,
128
+ },
129
+ };
130
+ }
131
+ // Handle errors
132
+ const errorMessage = error.message || String(error);
133
+ return {
134
+ ...this.createErrorResult(`Error killing shell: ${errorMessage}`),
135
+ metadata: {
136
+ executionTime: Date.now() - startTime,
137
+ shell_id: params.shell_id,
138
+ error: errorMessage,
139
+ },
140
+ };
141
+ }
142
+ }
143
+ }
144
+ //# sourceMappingURL=KillShellTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KillShellTool.js","sourceRoot":"","sources":["../../../src/implementations/execution/KillShellTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAY3E;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,QAAyC;IAGtD;IAFZ,QAAQ,CAA4B;IAE5C,YAAoB,MAAsB;QACxC,KAAK,CACH,WAAW,EACX,WAAW,EACX,4HAA4H,EAC5H;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wCAAwC;iBACtD;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB,CACF,CAAC;QAfgB,WAAM,GAAN,MAAM,CAAgB;QAiBxC,IAAI,CAAC,QAAQ,GAAG,yBAAyB,CAAC,WAAW,EAAE,CAAC;IAC1D,CAAC;IAED,kBAAkB,CAAC,MAA2B;QAC5C,oBAAoB;QACpB,MAAM,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC3E,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WA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AAQ,EAAE,MAAM,CAAC,QAAQ;wBACzB,GAAG,EAAE,OAAO,CAAC,GAAG;wBAChB,MAAM,EAAE,KAAK;qBACd;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,kBAAkB;YAClB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO;oBACL,GAAG,IAAI,CAAC,iBAAiB,CAAC,8BAA8B,CAAC;oBACzD,QAAQ,EAAE;wBACR,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;wBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;iBACF,CAAC;YACJ,CAAC;YAED,gBAAgB;YAChB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;YACpD,OAAO;gBACL,GAAG,IAAI,CAAC,iBAAiB,CAAC,wBAAwB,YAAY,EAAE,CAAC;gBACjE,QAAQ,EAAE;oBACR,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;oBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,KAAK,EAAE,YAAY;iBACpB;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Search Tools Tool
3
+ *
4
+ * Client-side tool discovery for non-PTC providers with deferred tool loading.
5
+ * Searches the tool registry by name, description, or category and returns
6
+ * matching tool schemas. Discovered tools are recorded in the progressive
7
+ * loading filter so they're included in subsequent requests.
8
+ */
9
+ import { BaseTool, type ToolResult } from '../../base/index.js';
10
+ export interface SearchToolsParams {
11
+ /** Search query to match tool names and descriptions */
12
+ query?: string;
13
+ /** Filter by tool category (e.g., "execution", "search", "file") */
14
+ category?: string;
15
+ }
16
+ interface ToolEntry {
17
+ name: string;
18
+ description: string;
19
+ category?: string;
20
+ schema: unknown;
21
+ }
22
+ export declare class SearchToolsTool extends BaseTool<SearchToolsParams> {
23
+ private toolProvider?;
24
+ constructor();
25
+ setToolProvider(provider: () => ToolEntry[]): void;
26
+ validateToolParams(params: SearchToolsParams): string | null;
27
+ execute(params: SearchToolsParams, _signal: AbortSignal): Promise<ToolResult>;
28
+ private scoreMatch;
29
+ private toResults;
30
+ }
31
+ export {};
32
+ //# sourceMappingURL=SearchToolsTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchToolsTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/execution/SearchToolsTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGhE,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AASD,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,iBAAiB,CAAC;IAC9D,OAAO,CAAC,YAAY,CAAC,CAAoB;;IAuBzC,eAAe,CAAC,QAAQ,EAAE,MAAM,SAAS,EAAE,GAAG,IAAI;IAIlD,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IAStD,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAwCnF,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,SAAS;CAQlB"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Search Tools Tool
3
+ *
4
+ * Client-side tool discovery for non-PTC providers with deferred tool loading.
5
+ * Searches the tool registry by name, description, or category and returns
6
+ * matching tool schemas. Discovered tools are recorded in the progressive
7
+ * loading filter so they're included in subsequent requests.
8
+ */
9
+ import { BaseTool } from '../../base/index.js';
10
+ import { SchemaValidator } from '../../utils/SchemaValidator.js';
11
+ export class SearchToolsTool extends BaseTool {
12
+ toolProvider;
13
+ constructor() {
14
+ super('SearchTools', 'Search Tools', 'Search the tool registry to discover available tools by name, description, or category.', {
15
+ type: 'object',
16
+ properties: {
17
+ query: {
18
+ type: 'string',
19
+ description: 'Search query — keywords matched against tool names and descriptions. Use "select:Name1,Name2" to fetch exact tools by name.',
20
+ },
21
+ category: {
22
+ type: 'string',
23
+ description: 'Filter by tool category',
24
+ },
25
+ },
26
+ });
27
+ }
28
+ setToolProvider(provider) {
29
+ this.toolProvider = provider;
30
+ }
31
+ validateToolParams(params) {
32
+ const error = SchemaValidator.validate(this.parameterSchema, params);
33
+ if (error)
34
+ return error;
35
+ if (!params.query && !params.category) {
36
+ return 'At least one of "query" or "category" is required';
37
+ }
38
+ return null;
39
+ }
40
+ async execute(params, _signal) {
41
+ if (!this.toolProvider) {
42
+ return {
43
+ llmContent: JSON.stringify({ matches: 0, tools: [], error: 'Tool provider not configured' }),
44
+ success: false,
45
+ error: 'Tool provider not configured',
46
+ };
47
+ }
48
+ const allTools = this.toolProvider();
49
+ // "select:Name1,Name2" — exact name lookup (like CC's ToolSearch)
50
+ if (params.query?.startsWith('select:')) {
51
+ const names = params.query.slice(7).split(',').map((n) => n.trim());
52
+ const nameSet = new Set(names.map((n) => n.toLowerCase()));
53
+ const exact = allTools.filter((t) => nameSet.has(t.name.toLowerCase()));
54
+ return {
55
+ llmContent: JSON.stringify({ matches: exact.length, tools: this.toResults(exact) }),
56
+ success: true,
57
+ };
58
+ }
59
+ // Score-based keyword search
60
+ const scored = allTools.map((t) => ({
61
+ tool: t,
62
+ score: this.scoreMatch(t, params.query, params.category),
63
+ }));
64
+ const matches = scored
65
+ .filter((s) => s.score > 0)
66
+ .sort((a, b) => b.score - a.score)
67
+ .slice(0, 10)
68
+ .map((s) => s.tool);
69
+ return {
70
+ llmContent: JSON.stringify({ matches: matches.length, tools: this.toResults(matches) }),
71
+ success: true,
72
+ };
73
+ }
74
+ scoreMatch(tool, query, category) {
75
+ let score = 0;
76
+ const nameLower = tool.name.toLowerCase();
77
+ const descLower = tool.description.toLowerCase();
78
+ if (category) {
79
+ const catLower = category.toLowerCase();
80
+ if (tool.category?.toLowerCase() === catLower) {
81
+ score += 5;
82
+ }
83
+ else if (nameLower.includes(catLower) || descLower.includes(catLower)) {
84
+ score += 2;
85
+ }
86
+ }
87
+ if (query) {
88
+ const words = query.toLowerCase().split(/\s+/).filter((w) => w.length > 1);
89
+ for (const word of words) {
90
+ if (nameLower === word)
91
+ score += 10;
92
+ else if (nameLower.includes(word))
93
+ score += 5;
94
+ if (descLower.includes(word))
95
+ score += 1;
96
+ }
97
+ }
98
+ return score;
99
+ }
100
+ toResults(tools) {
101
+ return tools.map((t) => ({
102
+ name: t.name,
103
+ category: t.category,
104
+ description: t.description,
105
+ schema: t.schema,
106
+ }));
107
+ }
108
+ }
109
+ //# sourceMappingURL=SearchToolsTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchToolsTool.js","sourceRoot":"","sources":["../../../src/implementations/execution/SearchToolsTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAuBjE,MAAM,OAAO,eAAgB,SAAQ,QAA2B;IACtD,YAAY,CAAqB;IAEzC;QACE,KAAK,CACH,aAAa,EACb,cAAc,EACd,yFAAyF,EACzF;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6HAA6H;iBAC3I;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACvC;a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AC1B,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Shell Tool Executor
3
+ *
4
+ * Executes shell commands via bash/cmd and captures output.
5
+ * Supports background processes, timeouts, and abort handling.
6
+ *
7
+ * Adapted and simplified from Gemini CLI patterns
8
+ * - Removed: Complex allow/block lists, summarization
9
+ * - Kept: Core execution, background process detection, timeout enforcement
10
+ * - Simplified: Security model (path-based only)
11
+ */
12
+ import { BaseTool, type ToolResult } from '../../base/index.js';
13
+ import type { ExecutorConfig } from '../../base/ToolRegistry.js';
14
+ /**
15
+ * Parameters for the Shell tool
16
+ */
17
+ export interface ShellToolParams {
18
+ /**
19
+ * The bash command to execute
20
+ */
21
+ command: string;
22
+ /**
23
+ * Optional directory to run the command in (relative to working directory)
24
+ */
25
+ directory?: string;
26
+ /**
27
+ * Optional timeout in milliseconds (default: 120000ms = 2 minutes)
28
+ */
29
+ timeout?: number;
30
+ /**
31
+ * Run command in background and return immediately with a bash_id.
32
+ * Use BashOutput to poll output, KillShell to stop.
33
+ */
34
+ run_in_background?: boolean;
35
+ /**
36
+ * Run command in persistent tmux session (requires tmux)
37
+ */
38
+ persistentSession?: boolean;
39
+ /**
40
+ * ID of persistent session (auto-generated if not provided)
41
+ */
42
+ sessionId?: string;
43
+ /**
44
+ * Capture entire scrollback history (for persistent sessions)
45
+ */
46
+ captureHistory?: boolean;
47
+ }
48
+ /**
49
+ * Shell Tool Executor
50
+ *
51
+ * Features:
52
+ * - Executes commands via bash -c (or cmd.exe on Windows)
53
+ * - Captures stdout, stderr, exit code
54
+ * - Background process detection (Unix only)
55
+ * - Timeout enforcement
56
+ * - Abort signal support
57
+ * - Streaming output updates
58
+ *
59
+ * Security:
60
+ * - Commands run in specified working directory
61
+ * - Path traversal prevention for directory parameter
62
+ * - Blocks command substitution with $()
63
+ */
64
+ export declare class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
65
+ private config;
66
+ private static readonly DEFAULT_TIMEOUT_MS;
67
+ private static readonly OUTPUT_UPDATE_INTERVAL_MS;
68
+ private static readonly MAX_OUTPUT_LENGTH;
69
+ private tmux;
70
+ private persistence;
71
+ constructor(config: ExecutorConfig);
72
+ validateToolParams(params: ShellToolParams): string | null;
73
+ getDescription(params: ShellToolParams): string;
74
+ execute(params: ShellToolParams, signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
75
+ /**
76
+ * Executes the shell command and captures output
77
+ * @private
78
+ */
79
+ private executeCommand;
80
+ /**
81
+ * Kills a process and its children
82
+ * @private
83
+ */
84
+ private killProcess;
85
+ /**
86
+ * Execute command in persistent tmux session
87
+ * @private
88
+ */
89
+ private executeInPersistentSession;
90
+ /**
91
+ * Checks if a command should be routed to a dedicated tool instead of Bash.
92
+ * Returns an error message with guidance if redirected, or null if allowed.
93
+ * @private
94
+ */
95
+ private checkToolRedirect;
96
+ /**
97
+ * Execute command in background — returns immediately with bash_id.
98
+ * The process is registered in BackgroundProcessRegistry for polling via BashOutput.
99
+ * @private
100
+ */
101
+ private executeInBackground;
102
+ /**
103
+ * Removes ANSI escape codes from string
104
+ * @private
105
+ */
106
+ private stripAnsi;
107
+ }
108
+ //# sourceMappingURL=ShellTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShellTool.d.ts","sourceRoot":"","sources":["../../../src/implementations/execution/ShellTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEj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