@vybestack/llxprt-code-tools 0.10.0-nightly.260613.1adad3b34

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 (364) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +294 -0
  3. package/dist/.last_build +0 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +2 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/__tests__/fixtures/filesystem-tool-fixtures.d.ts +29 -0
  8. package/dist/src/__tests__/fixtures/filesystem-tool-fixtures.js +30 -0
  9. package/dist/src/__tests__/fixtures/filesystem-tool-fixtures.js.map +1 -0
  10. package/dist/src/__tests__/fixtures/key-storage-fixtures.d.ts +39 -0
  11. package/dist/src/__tests__/fixtures/key-storage-fixtures.js +53 -0
  12. package/dist/src/__tests__/fixtures/key-storage-fixtures.js.map +1 -0
  13. package/dist/src/__tests__/fixtures/provider-formatting-fixtures.d.ts +140 -0
  14. package/dist/src/__tests__/fixtures/provider-formatting-fixtures.js +157 -0
  15. package/dist/src/__tests__/fixtures/provider-formatting-fixtures.js.map +1 -0
  16. package/dist/src/__tests__/red-test-helpers.d.ts +14 -0
  17. package/dist/src/__tests__/red-test-helpers.js +18 -0
  18. package/dist/src/__tests__/red-test-helpers.js.map +1 -0
  19. package/dist/src/formatters/IToolFormatter.d.ts +84 -0
  20. package/dist/src/formatters/IToolFormatter.js +6 -0
  21. package/dist/src/formatters/IToolFormatter.js.map +1 -0
  22. package/dist/src/formatters/ToolFormatter.d.ts +94 -0
  23. package/dist/src/formatters/ToolFormatter.js +379 -0
  24. package/dist/src/formatters/ToolFormatter.js.map +1 -0
  25. package/dist/src/formatters/ToolIdStrategy.d.ts +79 -0
  26. package/dist/src/formatters/ToolIdStrategy.js +173 -0
  27. package/dist/src/formatters/ToolIdStrategy.js.map +1 -0
  28. package/dist/src/formatters/doubleEscapeUtils.d.ts +46 -0
  29. package/dist/src/formatters/doubleEscapeUtils.js +223 -0
  30. package/dist/src/formatters/doubleEscapeUtils.js.map +1 -0
  31. package/dist/src/formatters/index.d.ts +21 -0
  32. package/dist/src/formatters/index.js +12 -0
  33. package/dist/src/formatters/index.js.map +1 -0
  34. package/dist/src/formatters/toolIdNormalization.d.ts +28 -0
  35. package/dist/src/formatters/toolIdNormalization.js +97 -0
  36. package/dist/src/formatters/toolIdNormalization.js.map +1 -0
  37. package/dist/src/formatters/toolNameUtils.d.ts +43 -0
  38. package/dist/src/formatters/toolNameUtils.js +143 -0
  39. package/dist/src/formatters/toolNameUtils.js.map +1 -0
  40. package/dist/src/index.d.ts +88 -0
  41. package/dist/src/index.js +68 -0
  42. package/dist/src/index.js.map +1 -0
  43. package/dist/src/interfaces/IAsyncTaskService.d.ts +57 -0
  44. package/dist/src/interfaces/IAsyncTaskService.js +6 -0
  45. package/dist/src/interfaces/IAsyncTaskService.js.map +1 -0
  46. package/dist/src/interfaces/IIdeService.d.ts +62 -0
  47. package/dist/src/interfaces/IIdeService.js +6 -0
  48. package/dist/src/interfaces/IIdeService.js.map +1 -0
  49. package/dist/src/interfaces/ILspService.d.ts +54 -0
  50. package/dist/src/interfaces/ILspService.js +6 -0
  51. package/dist/src/interfaces/ILspService.js.map +1 -0
  52. package/dist/src/interfaces/IMcpToolService.d.ts +47 -0
  53. package/dist/src/interfaces/IMcpToolService.js +6 -0
  54. package/dist/src/interfaces/IMcpToolService.js.map +1 -0
  55. package/dist/src/interfaces/IPromptRegistryService.d.ts +51 -0
  56. package/dist/src/interfaces/IPromptRegistryService.js +6 -0
  57. package/dist/src/interfaces/IPromptRegistryService.js.map +1 -0
  58. package/dist/src/interfaces/ISettingsService.d.ts +50 -0
  59. package/dist/src/interfaces/ISettingsService.js +6 -0
  60. package/dist/src/interfaces/ISettingsService.js.map +1 -0
  61. package/dist/src/interfaces/IShellExecutionService.d.ts +55 -0
  62. package/dist/src/interfaces/IShellExecutionService.js +6 -0
  63. package/dist/src/interfaces/IShellExecutionService.js.map +1 -0
  64. package/dist/src/interfaces/IShellToolHost.d.ts +176 -0
  65. package/dist/src/interfaces/IShellToolHost.js +6 -0
  66. package/dist/src/interfaces/IShellToolHost.js.map +1 -0
  67. package/dist/src/interfaces/ISkillService.d.ts +69 -0
  68. package/dist/src/interfaces/ISkillService.js +6 -0
  69. package/dist/src/interfaces/ISkillService.js.map +1 -0
  70. package/dist/src/interfaces/IStorageService.d.ts +42 -0
  71. package/dist/src/interfaces/IStorageService.js +6 -0
  72. package/dist/src/interfaces/IStorageService.js.map +1 -0
  73. package/dist/src/interfaces/ISubagentService.d.ts +112 -0
  74. package/dist/src/interfaces/ISubagentService.js +6 -0
  75. package/dist/src/interfaces/ISubagentService.js.map +1 -0
  76. package/dist/src/interfaces/ITaskToolHost.d.ts +185 -0
  77. package/dist/src/interfaces/ITaskToolHost.js +6 -0
  78. package/dist/src/interfaces/ITaskToolHost.js.map +1 -0
  79. package/dist/src/interfaces/ITodoService.d.ts +79 -0
  80. package/dist/src/interfaces/ITodoService.js +6 -0
  81. package/dist/src/interfaces/ITodoService.js.map +1 -0
  82. package/dist/src/interfaces/IToolHost.d.ts +91 -0
  83. package/dist/src/interfaces/IToolHost.js +6 -0
  84. package/dist/src/interfaces/IToolHost.js.map +1 -0
  85. package/dist/src/interfaces/IToolKeyStorage.d.ts +62 -0
  86. package/dist/src/interfaces/IToolKeyStorage.js +6 -0
  87. package/dist/src/interfaces/IToolKeyStorage.js.map +1 -0
  88. package/dist/src/interfaces/IToolMessageBus.d.ts +63 -0
  89. package/dist/src/interfaces/IToolMessageBus.js +6 -0
  90. package/dist/src/interfaces/IToolMessageBus.js.map +1 -0
  91. package/dist/src/interfaces/IToolRegistryHost.d.ts +43 -0
  92. package/dist/src/interfaces/IToolRegistryHost.js +6 -0
  93. package/dist/src/interfaces/IToolRegistryHost.js.map +1 -0
  94. package/dist/src/interfaces/IWebSearchService.d.ts +16 -0
  95. package/dist/src/interfaces/IWebSearchService.js +7 -0
  96. package/dist/src/interfaces/IWebSearchService.js.map +1 -0
  97. package/dist/src/interfaces/index.d.ts +33 -0
  98. package/dist/src/interfaces/index.js +6 -0
  99. package/dist/src/interfaces/index.js.map +1 -0
  100. package/dist/src/tools/activate-skill.d.ts +26 -0
  101. package/dist/src/tools/activate-skill.js +121 -0
  102. package/dist/src/tools/activate-skill.js.map +1 -0
  103. package/dist/src/tools/apply-patch.d.ts +65 -0
  104. package/dist/src/tools/apply-patch.js +528 -0
  105. package/dist/src/tools/apply-patch.js.map +1 -0
  106. package/dist/src/tools/ast-edit/ast-config.d.ts +67 -0
  107. package/dist/src/tools/ast-edit/ast-config.js +72 -0
  108. package/dist/src/tools/ast-edit/ast-config.js.map +1 -0
  109. package/dist/src/tools/ast-edit/ast-edit-invocation.d.ts +40 -0
  110. package/dist/src/tools/ast-edit/ast-edit-invocation.js +410 -0
  111. package/dist/src/tools/ast-edit/ast-edit-invocation.js.map +1 -0
  112. package/dist/src/tools/ast-edit/ast-query-extractor.d.ts +21 -0
  113. package/dist/src/tools/ast-edit/ast-query-extractor.js +178 -0
  114. package/dist/src/tools/ast-edit/ast-query-extractor.js.map +1 -0
  115. package/dist/src/tools/ast-edit/ast-read-file-invocation.d.ts +26 -0
  116. package/dist/src/tools/ast-edit/ast-read-file-invocation.js +149 -0
  117. package/dist/src/tools/ast-edit/ast-read-file-invocation.js.map +1 -0
  118. package/dist/src/tools/ast-edit/constants.d.ts +30 -0
  119. package/dist/src/tools/ast-edit/constants.js +36 -0
  120. package/dist/src/tools/ast-edit/constants.js.map +1 -0
  121. package/dist/src/tools/ast-edit/context-collector.d.ts +25 -0
  122. package/dist/src/tools/ast-edit/context-collector.js +115 -0
  123. package/dist/src/tools/ast-edit/context-collector.js.map +1 -0
  124. package/dist/src/tools/ast-edit/context-optimizer.d.ts +29 -0
  125. package/dist/src/tools/ast-edit/context-optimizer.js +86 -0
  126. package/dist/src/tools/ast-edit/context-optimizer.js.map +1 -0
  127. package/dist/src/tools/ast-edit/cross-file-analyzer.d.ts +41 -0
  128. package/dist/src/tools/ast-edit/cross-file-analyzer.js +294 -0
  129. package/dist/src/tools/ast-edit/cross-file-analyzer.js.map +1 -0
  130. package/dist/src/tools/ast-edit/edit-calculator.d.ts +71 -0
  131. package/dist/src/tools/ast-edit/edit-calculator.js +249 -0
  132. package/dist/src/tools/ast-edit/edit-calculator.js.map +1 -0
  133. package/dist/src/tools/ast-edit/edit-helpers.d.ts +22 -0
  134. package/dist/src/tools/ast-edit/edit-helpers.js +36 -0
  135. package/dist/src/tools/ast-edit/edit-helpers.js.map +1 -0
  136. package/dist/src/tools/ast-edit/language-analysis.d.ts +19 -0
  137. package/dist/src/tools/ast-edit/language-analysis.js +123 -0
  138. package/dist/src/tools/ast-edit/language-analysis.js.map +1 -0
  139. package/dist/src/tools/ast-edit/local-context-analyzer.d.ts +84 -0
  140. package/dist/src/tools/ast-edit/local-context-analyzer.js +267 -0
  141. package/dist/src/tools/ast-edit/local-context-analyzer.js.map +1 -0
  142. package/dist/src/tools/ast-edit/repository-context-provider.d.ts +22 -0
  143. package/dist/src/tools/ast-edit/repository-context-provider.js +139 -0
  144. package/dist/src/tools/ast-edit/repository-context-provider.js.map +1 -0
  145. package/dist/src/tools/ast-edit/types.d.ts +155 -0
  146. package/dist/src/tools/ast-edit/types.js +7 -0
  147. package/dist/src/tools/ast-edit/types.js.map +1 -0
  148. package/dist/src/tools/ast-edit/workspace-context-provider.d.ts +22 -0
  149. package/dist/src/tools/ast-edit/workspace-context-provider.js +39 -0
  150. package/dist/src/tools/ast-edit/workspace-context-provider.js.map +1 -0
  151. package/dist/src/tools/ast-edit.d.ts +43 -0
  152. package/dist/src/tools/ast-edit.js +183 -0
  153. package/dist/src/tools/ast-edit.js.map +1 -0
  154. package/dist/src/tools/ast-grep.d.ts +22 -0
  155. package/dist/src/tools/ast-grep.js +291 -0
  156. package/dist/src/tools/ast-grep.js.map +1 -0
  157. package/dist/src/tools/check-async-tasks.d.ts +46 -0
  158. package/dist/src/tools/check-async-tasks.js +241 -0
  159. package/dist/src/tools/check-async-tasks.js.map +1 -0
  160. package/dist/src/tools/codesearch.d.ts +25 -0
  161. package/dist/src/tools/codesearch.js +153 -0
  162. package/dist/src/tools/codesearch.js.map +1 -0
  163. package/dist/src/tools/delete_line_range.d.ts +41 -0
  164. package/dist/src/tools/delete_line_range.js +238 -0
  165. package/dist/src/tools/delete_line_range.js.map +1 -0
  166. package/dist/src/tools/direct-web-fetch.d.ts +22 -0
  167. package/dist/src/tools/direct-web-fetch.js +215 -0
  168. package/dist/src/tools/direct-web-fetch.js.map +1 -0
  169. package/dist/src/tools/edit-utils.d.ts +53 -0
  170. package/dist/src/tools/edit-utils.js +250 -0
  171. package/dist/src/tools/edit-utils.js.map +1 -0
  172. package/dist/src/tools/edit.d.ts +70 -0
  173. package/dist/src/tools/edit.js +816 -0
  174. package/dist/src/tools/edit.js.map +1 -0
  175. package/dist/src/tools/exa-web-search.d.ts +27 -0
  176. package/dist/src/tools/exa-web-search.js +153 -0
  177. package/dist/src/tools/exa-web-search.js.map +1 -0
  178. package/dist/src/tools/glob.d.ts +55 -0
  179. package/dist/src/tools/glob.js +284 -0
  180. package/dist/src/tools/glob.js.map +1 -0
  181. package/dist/src/tools/google-web-fetch.d.ts +34 -0
  182. package/dist/src/tools/google-web-fetch.js +417 -0
  183. package/dist/src/tools/google-web-fetch.js.map +1 -0
  184. package/dist/src/tools/google-web-search-invocation.d.ts +53 -0
  185. package/dist/src/tools/google-web-search-invocation.js +180 -0
  186. package/dist/src/tools/google-web-search-invocation.js.map +1 -0
  187. package/dist/src/tools/google-web-search.d.ts +16 -0
  188. package/dist/src/tools/google-web-search.js +34 -0
  189. package/dist/src/tools/google-web-search.js.map +1 -0
  190. package/dist/src/tools/grep.d.ts +56 -0
  191. package/dist/src/tools/grep.js +883 -0
  192. package/dist/src/tools/grep.js.map +1 -0
  193. package/dist/src/tools/insert_at_line.d.ts +41 -0
  194. package/dist/src/tools/insert_at_line.js +287 -0
  195. package/dist/src/tools/insert_at_line.js.map +1 -0
  196. package/dist/src/tools/list-subagents.d.ts +31 -0
  197. package/dist/src/tools/list-subagents.js +122 -0
  198. package/dist/src/tools/list-subagents.js.map +1 -0
  199. package/dist/src/tools/ls.d.ts +71 -0
  200. package/dist/src/tools/ls.js +238 -0
  201. package/dist/src/tools/ls.js.map +1 -0
  202. package/dist/src/tools/memoryTool.d.ts +66 -0
  203. package/dist/src/tools/memoryTool.js +435 -0
  204. package/dist/src/tools/memoryTool.js.map +1 -0
  205. package/dist/src/tools/modifiable-tool.d.ts +37 -0
  206. package/dist/src/tools/modifiable-tool.js +120 -0
  207. package/dist/src/tools/modifiable-tool.js.map +1 -0
  208. package/dist/src/tools/read-file.d.ts +49 -0
  209. package/dist/src/tools/read-file.js +279 -0
  210. package/dist/src/tools/read-file.js.map +1 -0
  211. package/dist/src/tools/read-many-files.d.ts +60 -0
  212. package/dist/src/tools/read-many-files.js +529 -0
  213. package/dist/src/tools/read-many-files.js.map +1 -0
  214. package/dist/src/tools/read_line_range.d.ts +47 -0
  215. package/dist/src/tools/read_line_range.js +248 -0
  216. package/dist/src/tools/read_line_range.js.map +1 -0
  217. package/dist/src/tools/ripGrep.d.ts +41 -0
  218. package/dist/src/tools/ripGrep.js +395 -0
  219. package/dist/src/tools/ripGrep.js.map +1 -0
  220. package/dist/src/tools/shell.d.ts +60 -0
  221. package/dist/src/tools/shell.js +735 -0
  222. package/dist/src/tools/shell.js.map +1 -0
  223. package/dist/src/tools/structural-analysis.d.ts +27 -0
  224. package/dist/src/tools/structural-analysis.js +1089 -0
  225. package/dist/src/tools/structural-analysis.js.map +1 -0
  226. package/dist/src/tools/stubs.d.ts +10 -0
  227. package/dist/src/tools/stubs.js +6 -0
  228. package/dist/src/tools/stubs.js.map +1 -0
  229. package/dist/src/tools/task.d.ts +41 -0
  230. package/dist/src/tools/task.js +195 -0
  231. package/dist/src/tools/task.js.map +1 -0
  232. package/dist/src/tools/todo-events.d.ts +22 -0
  233. package/dist/src/tools/todo-events.js +24 -0
  234. package/dist/src/tools/todo-events.js.map +1 -0
  235. package/dist/src/tools/todo-pause.d.ts +29 -0
  236. package/dist/src/tools/todo-pause.js +172 -0
  237. package/dist/src/tools/todo-pause.js.map +1 -0
  238. package/dist/src/tools/todo-read.d.ts +18 -0
  239. package/dist/src/tools/todo-read.js +98 -0
  240. package/dist/src/tools/todo-read.js.map +1 -0
  241. package/dist/src/tools/todo-store.d.ts +35 -0
  242. package/dist/src/tools/todo-store.js +124 -0
  243. package/dist/src/tools/todo-store.js.map +1 -0
  244. package/dist/src/tools/todo-write.d.ts +29 -0
  245. package/dist/src/tools/todo-write.js +366 -0
  246. package/dist/src/tools/todo-write.js.map +1 -0
  247. package/dist/src/tools/tool-registry.d.ts +156 -0
  248. package/dist/src/tools/tool-registry.js +623 -0
  249. package/dist/src/tools/tool-registry.js.map +1 -0
  250. package/dist/src/tools/tools.d.ts +403 -0
  251. package/dist/src/tools/tools.js +519 -0
  252. package/dist/src/tools/tools.js.map +1 -0
  253. package/dist/src/tools/write-file.d.ts +45 -0
  254. package/dist/src/tools/write-file.js +320 -0
  255. package/dist/src/tools/write-file.js.map +1 -0
  256. package/dist/src/types/index.d.ts +17 -0
  257. package/dist/src/types/index.js +9 -0
  258. package/dist/src/types/index.js.map +1 -0
  259. package/dist/src/types/provider-content-types.d.ts +56 -0
  260. package/dist/src/types/provider-content-types.js +6 -0
  261. package/dist/src/types/provider-content-types.js.map +1 -0
  262. package/dist/src/types/todo-schemas.d.ts +263 -0
  263. package/dist/src/types/todo-schemas.js +32 -0
  264. package/dist/src/types/todo-schemas.js.map +1 -0
  265. package/dist/src/types/tool-confirmation-types.d.ts +34 -0
  266. package/dist/src/types/tool-confirmation-types.js +29 -0
  267. package/dist/src/types/tool-confirmation-types.js.map +1 -0
  268. package/dist/src/types/tool-context.d.ts +31 -0
  269. package/dist/src/types/tool-context.js +6 -0
  270. package/dist/src/types/tool-context.js.map +1 -0
  271. package/dist/src/types/tool-error.d.ts +69 -0
  272. package/dist/src/types/tool-error.js +94 -0
  273. package/dist/src/types/tool-error.js.map +1 -0
  274. package/dist/src/types/tool-names.d.ts +57 -0
  275. package/dist/src/types/tool-names.js +64 -0
  276. package/dist/src/types/tool-names.js.map +1 -0
  277. package/dist/src/utils/EmojiFilter.d.ts +134 -0
  278. package/dist/src/utils/EmojiFilter.js +370 -0
  279. package/dist/src/utils/EmojiFilter.js.map +1 -0
  280. package/dist/src/utils/ast-grep-utils.d.ts +42 -0
  281. package/dist/src/utils/ast-grep-utils.js +140 -0
  282. package/dist/src/utils/ast-grep-utils.js.map +1 -0
  283. package/dist/src/utils/debugLogger.d.ts +11 -0
  284. package/dist/src/utils/debugLogger.js +16 -0
  285. package/dist/src/utils/debugLogger.js.map +1 -0
  286. package/dist/src/utils/diffOptions.d.ts +14 -0
  287. package/dist/src/utils/diffOptions.js +46 -0
  288. package/dist/src/utils/diffOptions.js.map +1 -0
  289. package/dist/src/utils/editor.d.ts +39 -0
  290. package/dist/src/utils/editor.js +212 -0
  291. package/dist/src/utils/editor.js.map +1 -0
  292. package/dist/src/utils/ensure-dirs.d.ts +10 -0
  293. package/dist/src/utils/ensure-dirs.js +16 -0
  294. package/dist/src/utils/ensure-dirs.js.map +1 -0
  295. package/dist/src/utils/errors.d.ts +59 -0
  296. package/dist/src/utils/errors.js +178 -0
  297. package/dist/src/utils/errors.js.map +1 -0
  298. package/dist/src/utils/fetch.d.ts +11 -0
  299. package/dist/src/utils/fetch.js +74 -0
  300. package/dist/src/utils/fetch.js.map +1 -0
  301. package/dist/src/utils/fileUtils.d.ts +32 -0
  302. package/dist/src/utils/fileUtils.js +363 -0
  303. package/dist/src/utils/fileUtils.js.map +1 -0
  304. package/dist/src/utils/fuzzy-replacer.d.ts +61 -0
  305. package/dist/src/utils/fuzzy-replacer.js +492 -0
  306. package/dist/src/utils/fuzzy-replacer.js.map +1 -0
  307. package/dist/src/utils/gitLineChanges.d.ts +12 -0
  308. package/dist/src/utils/gitLineChanges.js +171 -0
  309. package/dist/src/utils/gitLineChanges.js.map +1 -0
  310. package/dist/src/utils/gitUtils.d.ts +6 -0
  311. package/dist/src/utils/gitUtils.js +31 -0
  312. package/dist/src/utils/gitUtils.js.map +1 -0
  313. package/dist/src/utils/lsp-diagnostics-helper.d.ts +27 -0
  314. package/dist/src/utils/lsp-diagnostics-helper.js +62 -0
  315. package/dist/src/utils/lsp-diagnostics-helper.js.map +1 -0
  316. package/dist/src/utils/mediaUtils.d.ts +38 -0
  317. package/dist/src/utils/mediaUtils.js +22 -0
  318. package/dist/src/utils/mediaUtils.js.map +1 -0
  319. package/dist/src/utils/pathValidation.d.ts +7 -0
  320. package/dist/src/utils/pathValidation.js +39 -0
  321. package/dist/src/utils/pathValidation.js.map +1 -0
  322. package/dist/src/utils/paths.d.ts +7 -0
  323. package/dist/src/utils/paths.js +158 -0
  324. package/dist/src/utils/paths.js.map +1 -0
  325. package/dist/src/utils/resolveTextSearchTarget.d.ts +17 -0
  326. package/dist/src/utils/resolveTextSearchTarget.js +45 -0
  327. package/dist/src/utils/resolveTextSearchTarget.js.map +1 -0
  328. package/dist/src/utils/retry.d.ts +17 -0
  329. package/dist/src/utils/retry.js +185 -0
  330. package/dist/src/utils/retry.js.map +1 -0
  331. package/dist/src/utils/ripgrepPathResolver.d.ts +23 -0
  332. package/dist/src/utils/ripgrepPathResolver.js +179 -0
  333. package/dist/src/utils/ripgrepPathResolver.js.map +1 -0
  334. package/dist/src/utils/safeJsonStringify.d.ts +9 -0
  335. package/dist/src/utils/safeJsonStringify.js +21 -0
  336. package/dist/src/utils/safeJsonStringify.js.map +1 -0
  337. package/dist/src/utils/schemaValidator.d.ts +13 -0
  338. package/dist/src/utils/schemaValidator.js +275 -0
  339. package/dist/src/utils/schemaValidator.js.map +1 -0
  340. package/dist/src/utils/terminalSerializer.d.ts +33 -0
  341. package/dist/src/utils/terminalSerializer.js +6 -0
  342. package/dist/src/utils/terminalSerializer.js.map +1 -0
  343. package/dist/src/utils/todoContextTracker.d.ts +12 -0
  344. package/dist/src/utils/todoContextTracker.js +28 -0
  345. package/dist/src/utils/todoContextTracker.js.map +1 -0
  346. package/dist/src/utils/todoFormatter.d.ts +24 -0
  347. package/dist/src/utils/todoFormatter.js +157 -0
  348. package/dist/src/utils/todoFormatter.js.map +1 -0
  349. package/dist/src/utils/todoReminderService.d.ts +22 -0
  350. package/dist/src/utils/todoReminderService.js +43 -0
  351. package/dist/src/utils/todoReminderService.js.map +1 -0
  352. package/dist/src/utils/tool-key-storage-facade.d.ts +32 -0
  353. package/dist/src/utils/tool-key-storage-facade.js +56 -0
  354. package/dist/src/utils/tool-key-storage-facade.js.map +1 -0
  355. package/dist/src/utils/tool-key-storage-types.d.ts +56 -0
  356. package/dist/src/utils/tool-key-storage-types.js +56 -0
  357. package/dist/src/utils/tool-key-storage-types.js.map +1 -0
  358. package/dist/src/utils/toolOutputLimiter.d.ts +29 -0
  359. package/dist/src/utils/toolOutputLimiter.js +107 -0
  360. package/dist/src/utils/toolOutputLimiter.js.map +1 -0
  361. package/dist/src/utils/unicodeUtils.d.ts +55 -0
  362. package/dist/src/utils/unicodeUtils.js +129 -0
  363. package/dist/src/utils/unicodeUtils.js.map +1 -0
  364. package/package.json +75 -0
@@ -0,0 +1,395 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /* eslint-disable complexity, sonarjs/cognitive-complexity -- Phase 5: legacy core boundary retained while larger decomposition continues. */
7
+ import fsPromises from 'fs/promises';
8
+ import path from 'path';
9
+ import { EOL } from 'os';
10
+ import { spawn } from 'child_process';
11
+ // import { rgPath } from '@lvce-editor/ripgrep'; // Now using getRipgrepPath() instead
12
+ import { BaseDeclarativeTool, BaseToolInvocation, Kind, } from './tools.js';
13
+ import { SchemaValidator } from '../utils/schemaValidator.js';
14
+ import { makeRelative, shortenPath } from '../utils/paths.js';
15
+ import { getErrorMessage } from '../utils/errors.js';
16
+ import { getRipgrepPath } from '../utils/ripgrepPathResolver.js';
17
+ import { resolveTextSearchTarget, } from '../utils/resolveTextSearchTarget.js';
18
+ import { debugLogger } from '../utils/debugLogger.js';
19
+ export const ripGrepDebugLogger = debugLogger;
20
+ const DEFAULT_TOTAL_MAX_MATCHES = 20000;
21
+ class GrepToolInvocation extends BaseToolInvocation {
22
+ host;
23
+ constructor(host, params, messageBus) {
24
+ super(params, messageBus);
25
+ this.host = host;
26
+ }
27
+ resolveTarget(relativePath) {
28
+ return resolveTextSearchTarget(this.host.getTargetDir(), this.host.getWorkspaceRoots(), relativePath);
29
+ }
30
+ async handleFileSearch(resolved, searchDirDisplay, signal) {
31
+ const fileResult = await this.performSingleFileSearch(this.params.pattern, resolved.filePath, signal);
32
+ let includeNote = '';
33
+ if (this.params.include) {
34
+ includeNote =
35
+ '\nNote: include filter ignored because a specific file path was provided.';
36
+ }
37
+ if (fileResult.length === 0) {
38
+ const noMatchMsg = `No matches found for pattern "${this.params.pattern}" in file "${searchDirDisplay}".${includeNote}`;
39
+ return { llmContent: noMatchMsg, returnDisplay: 'No matches found' };
40
+ }
41
+ const matchTerm = fileResult.length === 1 ? 'match' : 'matches';
42
+ let llmContent = `Found ${fileResult.length} ${matchTerm} for pattern "${this.params.pattern}" in file "${searchDirDisplay}":${includeNote}
43
+ ---
44
+ File: ${resolved.basename}
45
+ `;
46
+ for (const match of fileResult) {
47
+ llmContent += `L${match.lineNumber}: ${match.line.trim()}
48
+ `;
49
+ }
50
+ llmContent += '---';
51
+ return {
52
+ llmContent: llmContent.trim(),
53
+ returnDisplay: `Found ${fileResult.length} ${matchTerm}`,
54
+ };
55
+ }
56
+ resolveSearchDirectories(searchDirAbs, workspaceContext) {
57
+ if (searchDirAbs === null) {
58
+ return workspaceContext.getDirectories();
59
+ }
60
+ return [searchDirAbs];
61
+ }
62
+ collectDirectoryMatches(searchDirectories, signal) {
63
+ return this.collectDirectoryMatchesImpl(searchDirectories, signal, DEFAULT_TOTAL_MAX_MATCHES);
64
+ }
65
+ async collectDirectoryMatchesImpl(searchDirectories, signal, totalMaxMatches) {
66
+ let allMatches = [];
67
+ if (this.host.getDebugMode()) {
68
+ debugLogger.debug(`[GrepTool] Total result limit: ${totalMaxMatches}`);
69
+ }
70
+ for (const searchDir of searchDirectories) {
71
+ const searchResult = await this.performRipgrepSearch({
72
+ pattern: this.params.pattern,
73
+ path: searchDir,
74
+ include: this.params.include,
75
+ signal,
76
+ });
77
+ if (searchDirectories.length > 1) {
78
+ const dirName = path.basename(searchDir);
79
+ searchResult.forEach((match) => {
80
+ match.filePath = path.join(dirName, match.filePath);
81
+ });
82
+ }
83
+ allMatches = allMatches.concat(searchResult);
84
+ if (allMatches.length >= totalMaxMatches) {
85
+ allMatches = allMatches.slice(0, totalMaxMatches);
86
+ break;
87
+ }
88
+ }
89
+ return allMatches;
90
+ }
91
+ buildSearchLocationDescription(searchDirAbs, searchDirDisplay, workspaceContext) {
92
+ if (searchDirAbs === null) {
93
+ const numDirs = workspaceContext.getDirectories().length;
94
+ return numDirs > 1
95
+ ? `across ${numDirs} workspace directories`
96
+ : `in the workspace directory`;
97
+ }
98
+ return `in path "${searchDirDisplay}"`;
99
+ }
100
+ formatDirectoryResults(allMatches, searchLocationDescription) {
101
+ const totalMaxMatches = DEFAULT_TOTAL_MAX_MATCHES;
102
+ if (allMatches.length === 0) {
103
+ const noMatchMsg = `No matches found for pattern "${this.params.pattern}" ${searchLocationDescription}${this.params.include ? ` (filter: "${this.params.include}")` : ''}.`;
104
+ return { llmContent: noMatchMsg, returnDisplay: `No matches found` };
105
+ }
106
+ const wasTruncated = allMatches.length >= totalMaxMatches;
107
+ const matchesByFile = allMatches.reduce((acc, match) => {
108
+ const fileKey = match.filePath;
109
+ acc[fileKey] ??= [];
110
+ const fileMatches = acc[fileKey];
111
+ fileMatches.push(match);
112
+ fileMatches.sort((a, b) => a.lineNumber - b.lineNumber);
113
+ return acc;
114
+ }, {});
115
+ const matchCount = allMatches.length;
116
+ const matchTerm = matchCount === 1 ? 'match' : 'matches';
117
+ let llmContent = `Found ${matchCount} ${matchTerm} for pattern "${this.params.pattern}" ${searchLocationDescription}${this.params.include ? ` (filter: "${this.params.include}")` : ''}`;
118
+ if (wasTruncated) {
119
+ llmContent += ` (results limited to ${totalMaxMatches} matches for performance)`;
120
+ }
121
+ llmContent += `:\n---\n`;
122
+ for (const filePath in matchesByFile) {
123
+ llmContent += `File: ${filePath}\n`;
124
+ matchesByFile[filePath].forEach((match) => {
125
+ const trimmedLine = match.line.trim();
126
+ llmContent += `L${match.lineNumber}: ${trimmedLine}\n`;
127
+ });
128
+ llmContent += '---\n';
129
+ }
130
+ let displayMessage = `Found ${matchCount} ${matchTerm}`;
131
+ if (wasTruncated) {
132
+ displayMessage += ` (limited)`;
133
+ }
134
+ return {
135
+ llmContent: llmContent.trim(),
136
+ returnDisplay: displayMessage,
137
+ };
138
+ }
139
+ async execute(signal) {
140
+ try {
141
+ const workspaceContext = {
142
+ getDirectories: () => this.host.getWorkspaceRoots(),
143
+ };
144
+ const resolved = this.resolveTarget(this.params.path);
145
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: path param may be empty string, display '.' instead
146
+ const searchDirDisplay = this.params.path || '.';
147
+ if (resolved.kind === 'file') {
148
+ return await this.handleFileSearch(resolved, searchDirDisplay, signal);
149
+ }
150
+ const searchDirAbs = resolved.kind === 'directory' ? resolved.searchDir : null;
151
+ const searchDirectories = this.resolveSearchDirectories(searchDirAbs, workspaceContext);
152
+ const allMatches = await this.collectDirectoryMatches(searchDirectories, signal);
153
+ const searchLocationDescription = this.buildSearchLocationDescription(searchDirAbs, searchDirDisplay, workspaceContext);
154
+ return this.formatDirectoryResults(allMatches, searchLocationDescription);
155
+ }
156
+ catch (error) {
157
+ debugLogger.warn(`Error during GrepLogic execution: ${error}`);
158
+ const errorMessage = getErrorMessage(error);
159
+ return {
160
+ llmContent: `Error during grep search operation: ${errorMessage}`,
161
+ returnDisplay: `Error: ${errorMessage}`,
162
+ };
163
+ }
164
+ }
165
+ parseRipgrepOutput(output, basePath) {
166
+ const results = [];
167
+ if (!output)
168
+ return results;
169
+ const lines = output.split(EOL);
170
+ // eslint-disable-next-line sonarjs/too-many-break-or-continue-in-loop -- Existing structure is intentionally preserved; refactoring this boundary is outside the lint slice.
171
+ for (const line of lines) {
172
+ if (!line.trim())
173
+ continue;
174
+ const firstColonIndex = line.indexOf(':');
175
+ if (firstColonIndex === -1)
176
+ continue;
177
+ const secondColonIndex = line.indexOf(':', firstColonIndex + 1);
178
+ if (secondColonIndex === -1)
179
+ continue;
180
+ const filePathRaw = line.substring(0, firstColonIndex);
181
+ const lineNumberStr = line.substring(firstColonIndex + 1, secondColonIndex);
182
+ const lineContent = line.substring(secondColonIndex + 1);
183
+ const lineNumber = parseInt(lineNumberStr, 10);
184
+ if (!isNaN(lineNumber)) {
185
+ const absoluteFilePath = path.resolve(basePath, filePathRaw);
186
+ const relativeFilePath = path.relative(basePath, absoluteFilePath);
187
+ results.push({
188
+ filePath: relativeFilePath || path.basename(absoluteFilePath),
189
+ lineNumber,
190
+ line: lineContent,
191
+ });
192
+ }
193
+ }
194
+ return results;
195
+ }
196
+ /**
197
+ * Returns the path to .llxprtignore file if it exists and has patterns.
198
+ * Only returns path if patterns are non-empty (excluding comments/blank lines).
199
+ */
200
+ getLlxprtIgnorePath() {
201
+ return this.host.getLlxprtIgnoreFilePath();
202
+ }
203
+ async runRipgrepProcess(rgArgs, signal) {
204
+ const resolvedRgPath = await getRipgrepPath();
205
+ return new Promise((resolve, reject) => {
206
+ const child = spawn(resolvedRgPath, rgArgs, {
207
+ windowsHide: true,
208
+ });
209
+ const stdoutChunks = [];
210
+ const stderrChunks = [];
211
+ const cleanup = () => {
212
+ if (signal.aborted) {
213
+ child.kill();
214
+ }
215
+ };
216
+ signal.addEventListener('abort', cleanup, { once: true });
217
+ child.stdout.on('data', (chunk) => stdoutChunks.push(chunk));
218
+ child.stderr.on('data', (chunk) => stderrChunks.push(chunk));
219
+ child.on('error', (err) => {
220
+ signal.removeEventListener('abort', cleanup);
221
+ reject(new Error(`Failed to start ripgrep: ${err.message}. Please ensure @lvce-editor/ripgrep is properly installed.`));
222
+ });
223
+ child.on('close', (code) => {
224
+ signal.removeEventListener('abort', cleanup);
225
+ const stdoutData = Buffer.concat(stdoutChunks).toString('utf8');
226
+ const stderrData = Buffer.concat(stderrChunks).toString('utf8');
227
+ if (code === 0) {
228
+ resolve(stdoutData);
229
+ }
230
+ else if (code === 1) {
231
+ resolve(''); // No matches found
232
+ }
233
+ else {
234
+ reject(new Error(`ripgrep exited with code ${code}: ${stderrData}`));
235
+ }
236
+ });
237
+ });
238
+ }
239
+ buildRipgrepArgs(pattern, absolutePath, include) {
240
+ const rgArgs = [
241
+ '--line-number',
242
+ '--no-heading',
243
+ '--with-filename',
244
+ '--ignore-case',
245
+ '--regexp',
246
+ pattern,
247
+ ];
248
+ if (include) {
249
+ rgArgs.push('--glob', include);
250
+ }
251
+ const excludes = [
252
+ '.git',
253
+ 'node_modules',
254
+ 'bower_components',
255
+ '*.log',
256
+ '*.tmp',
257
+ 'build',
258
+ 'dist',
259
+ 'coverage',
260
+ ];
261
+ excludes.forEach((exclude) => {
262
+ rgArgs.push('--glob', `!${exclude}`);
263
+ });
264
+ if (this.host.getFileFilteringRespectLlxprtIgnore()) {
265
+ const llxprtIgnorePath = this.getLlxprtIgnorePath();
266
+ if (llxprtIgnorePath) {
267
+ rgArgs.push('--ignore-file', llxprtIgnorePath);
268
+ }
269
+ }
270
+ rgArgs.push('--threads', '4');
271
+ rgArgs.push(absolutePath);
272
+ return rgArgs;
273
+ }
274
+ async performRipgrepSearch(options) {
275
+ const { pattern, path: absolutePath, include, signal } = options;
276
+ const rgArgs = this.buildRipgrepArgs(pattern, absolutePath, include);
277
+ try {
278
+ const output = await this.runRipgrepProcess(rgArgs, signal);
279
+ return this.parseRipgrepOutput(output, absolutePath);
280
+ }
281
+ catch (error) {
282
+ debugLogger.debug(`GrepLogic: ripgrep failed: ${getErrorMessage(error)}`);
283
+ throw error;
284
+ }
285
+ }
286
+ /**
287
+ * Gets a description of the grep operation
288
+ * @param params Parameters for the grep operation
289
+ * @returns A string describing the grep
290
+ */
291
+ getDescription() {
292
+ let description = `'${this.params.pattern}'`;
293
+ if (this.params.include) {
294
+ description += ` in ${this.params.include}`;
295
+ }
296
+ if (this.params.path) {
297
+ try {
298
+ const resolved = this.resolveTarget(this.params.path);
299
+ if (resolved.kind === 'file') {
300
+ const relativePath = makeRelative(resolved.filePath, this.host.getTargetDir());
301
+ description += ` in file ${shortenPath(relativePath)}`;
302
+ return description;
303
+ }
304
+ }
305
+ catch {
306
+ // Fall through to default path display on validation errors
307
+ }
308
+ const resolvedPath = path.resolve(this.host.getTargetDir(), this.params.path);
309
+ if (resolvedPath === this.host.getTargetDir() ||
310
+ this.params.path === '.') {
311
+ description += ` within ./`;
312
+ }
313
+ else {
314
+ const relativePath = makeRelative(resolvedPath, this.host.getTargetDir());
315
+ description += ` within ${shortenPath(relativePath)}`;
316
+ }
317
+ }
318
+ else {
319
+ const directories = this.host.getWorkspaceRoots();
320
+ if (directories.length > 1) {
321
+ description += ` across all workspace directories`;
322
+ }
323
+ }
324
+ return description;
325
+ }
326
+ async performSingleFileSearch(pattern, filePath, signal) {
327
+ if (signal.aborted) {
328
+ return [];
329
+ }
330
+ const regex = new RegExp(pattern, 'i');
331
+ const content = await fsPromises.readFile(filePath, 'utf8');
332
+ const lines = content.split(/\r?\n/);
333
+ const matches = [];
334
+ for (let i = 0; i < lines.length; i++) {
335
+ if (regex.test(lines[i])) {
336
+ matches.push({
337
+ filePath: path.basename(filePath),
338
+ lineNumber: i + 1,
339
+ line: lines[i],
340
+ });
341
+ }
342
+ }
343
+ return matches;
344
+ }
345
+ }
346
+ /**
347
+ * Implementation of the Grep tool logic (moved from CLI)
348
+ */
349
+ export class RipGrepTool extends BaseDeclarativeTool {
350
+ host;
351
+ static Name = 'search_file_content';
352
+ constructor(host) {
353
+ super(RipGrepTool.Name, 'SearchText', 'Searches for a regular expression pattern within the content of files in a specified directory (or current working directory). Can filter files by a glob pattern. Returns the lines containing matches, along with their file paths and line numbers. Total results limited to 20,000 matches like VSCode.', Kind.Search, {
354
+ properties: {
355
+ pattern: {
356
+ description: "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').",
357
+ type: 'string',
358
+ },
359
+ path: {
360
+ description: 'Optional: The absolute path to the directory to search within. If omitted, searches the current working directory. Can also be a path to a specific file (will search only that file).',
361
+ type: 'string',
362
+ },
363
+ include: {
364
+ description: "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).",
365
+ type: 'string',
366
+ },
367
+ },
368
+ required: ['pattern'],
369
+ type: 'object',
370
+ });
371
+ this.host = host;
372
+ }
373
+ validateToolParams(params) {
374
+ const errors = SchemaValidator.validate(this.schema.parametersJsonSchema, params);
375
+ if (errors) {
376
+ return errors;
377
+ }
378
+ if (params.path) {
379
+ try {
380
+ resolveTextSearchTarget(this.host.getTargetDir(), this.host.getWorkspaceRoots(), params.path);
381
+ }
382
+ catch (error) {
383
+ return getErrorMessage(error);
384
+ }
385
+ }
386
+ return null;
387
+ }
388
+ createInvocation(params, messageBus) {
389
+ return new GrepToolInvocation(this.host, params, messageBus);
390
+ }
391
+ async execute(params, signal = new AbortController().signal) {
392
+ return this.build(params).execute(signal);
393
+ }
394
+ }
395
+ //# sourceMappingURL=ripGrep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ripGrep.js","sourceRoot":"","sources":["../../../src/tools/ripGrep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6IAA6I;AAE7I,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CA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AC,QAAQ,CACrC,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAChC,MAAM,CACP,CAAC;QACF,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,uBAAuB,CACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EACxB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAC7B,MAAM,CAAC,IAAI,CACZ,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,gBAAgB,CACjC,MAAyB,EACzB,UAA2B;QAE3B,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAyB,EACzB,SAAsB,IAAI,eAAe,EAAE,CAAC,MAAM;QAElD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @plan:PLAN-20260608-ISSUE1585.P11
3
+ * @requirement:REQ-INTERFACE-OWNERSHIP, REQ-API-001
4
+ */
5
+ import { BaseDeclarativeTool, BaseToolInvocation, type ToolResult, type ToolInvocation, ToolConfirmationOutcome, type ToolCallConfirmationDetails, type PolicyUpdateOptions } from './tools.js';
6
+ import type { IToolMessageBus } from '../interfaces/IToolMessageBus.js';
7
+ import type { IShellExecutionService } from '../interfaces/IShellExecutionService.js';
8
+ import type { IShellToolHost } from '../interfaces/IShellToolHost.js';
9
+ /** Throttle interval for shell output updates. */
10
+ export declare const OUTPUT_UPDATE_INTERVAL_MS = 100;
11
+ export interface ShellToolParams {
12
+ /** The shell command to execute. */
13
+ command: string;
14
+ /** Optional description of what this command does. */
15
+ description?: string;
16
+ /** Optional directory to execute the command in. */
17
+ dir_path?: string;
18
+ /** @deprecated Use dir_path instead. */
19
+ directory?: string;
20
+ /** Optional number of lines to show from the beginning of output. */
21
+ head_lines?: number;
22
+ /** Optional number of lines to show from the end of output. */
23
+ tail_lines?: number;
24
+ /** Optional grep pattern to filter output lines. */
25
+ grep_pattern?: string;
26
+ /** Optional grep flags (e.g., -i for case-insensitive, -v for inverted). */
27
+ grep_flags?: string[];
28
+ /** Optional timeout in seconds (-1 for unlimited). */
29
+ timeout_seconds?: number;
30
+ }
31
+ export declare class ShellToolInvocation extends BaseToolInvocation<ShellToolParams, ToolResult> {
32
+ private readonly host;
33
+ private allowlist;
34
+ constructor(host: IShellToolHost, params: ShellToolParams, allowlist: Set<string>, messageBus: IToolMessageBus);
35
+ getToolName(): string;
36
+ private getDirPath;
37
+ getDescription(): string;
38
+ protected getPolicyUpdateOptions(outcome: ToolConfirmationOutcome): PolicyUpdateOptions | undefined;
39
+ shouldConfirmExecute(_abortSignal: AbortSignal): Promise<ToolCallConfirmationDetails | false>;
40
+ execute(signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
41
+ private executeShell;
42
+ private validateFilterParams;
43
+ private resolveCwd;
44
+ private resolveDirPath;
45
+ private formatOutputContent;
46
+ private applyFilterDescription;
47
+ private buildExecutionError;
48
+ private createPreCancelledResult;
49
+ private resolveTimeoutSeconds;
50
+ private isInvocationAllowlisted;
51
+ }
52
+ export declare class ShellTool extends BaseDeclarativeTool<ShellToolParams, ToolResult> {
53
+ static readonly Name: string;
54
+ private allowlist;
55
+ private readonly host;
56
+ constructor(host: IShellToolHost | IShellExecutionService, messageBus?: IToolMessageBus);
57
+ protected validateToolParamValues(params: ShellToolParams): string | null;
58
+ execute(params: ShellToolParams, signal?: AbortSignal): Promise<ToolResult>;
59
+ protected createInvocation(params: ShellToolParams, messageBus: IToolMessageBus): ToolInvocation<ShellToolParams, ToolResult>;
60
+ }