@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,49 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { BaseDeclarativeTool, type ToolInvocation, type ToolResult } from './tools.js';
7
+ import type { IToolHost, IToolMessageBus } from '../interfaces/index.js';
8
+ /**
9
+ * Parameters for the ReadFile tool
10
+ */
11
+ export interface ReadFileToolParams {
12
+ /**
13
+ * The absolute path to the file to read
14
+ */
15
+ absolute_path?: string;
16
+ /**
17
+ * Alternative parameter name for absolute_path (for compatibility)
18
+ * Not shown in schema - internal use only
19
+ */
20
+ file_path?: string;
21
+ /**
22
+ * The line number to start reading from (optional)
23
+ */
24
+ offset?: number;
25
+ /**
26
+ * The number of lines to read (optional)
27
+ */
28
+ limit?: number;
29
+ /**
30
+ * When true, prefixes each text line with a virtual line number.
31
+ */
32
+ showLineNumbers?: boolean;
33
+ /**
34
+ * When true, prefixes each text line with a git-change marker column.
35
+ */
36
+ showGitChanges?: boolean;
37
+ }
38
+ /**
39
+ * Implementation of the ReadFile tool logic
40
+ */
41
+ export declare class ReadFileTool extends BaseDeclarativeTool<ReadFileToolParams, ToolResult> {
42
+ private host;
43
+ static readonly Name: string;
44
+ constructor(host: IToolHost);
45
+ protected validateToolParamValues(params: ReadFileToolParams): string | null;
46
+ protected createInvocation(params: ReadFileToolParams, messageBus: IToolMessageBus): ToolInvocation<ReadFileToolParams, ToolResult>;
47
+ execute(params: ReadFileToolParams, signal?: AbortSignal): Promise<ToolResult>;
48
+ private normalizeLegacyExecutableResult;
49
+ }
@@ -0,0 +1,279 @@
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 path from 'node:path';
8
+ import process from 'node:process';
9
+ import { BaseDeclarativeTool, BaseToolInvocation, Kind, } from './tools.js';
10
+ import { makeRelative, shortenPath } from '../utils/paths.js';
11
+ import { processSingleFileContent, getSpecificMimeType, DEFAULT_MAX_LINES_TEXT_FILE, } from '../utils/fileUtils.js';
12
+ import { getGitLineChanges } from '../utils/gitLineChanges.js';
13
+ import { validatePathWithinWorkspace } from '../utils/pathValidation.js';
14
+ function formatWithLineNumbers(content, startLine) {
15
+ const lines = content.split('\n');
16
+ const maxLine = startLine + lines.length - 1;
17
+ const width = Math.max(4, String(maxLine).length);
18
+ return lines
19
+ .map((line, index) => {
20
+ const lineNo = startLine + index;
21
+ const padded = String(lineNo).padStart(width, ' ');
22
+ return `${padded}| ${line}`;
23
+ })
24
+ .join('\n');
25
+ }
26
+ function formatWithGitChanges(content, startLine, markers, deletionAfterLines, showLineNumbers) {
27
+ const lines = content.split('\n');
28
+ const maxLine = startLine + lines.length - 1;
29
+ const width = showLineNumbers ? Math.max(4, String(maxLine).length) : 0;
30
+ const formattedLines = [];
31
+ const hasDeletionBeforeRange = deletionAfterLines.has(startLine - 1) ||
32
+ deletionAfterLines.has(startLine) ||
33
+ (startLine === 1 && deletionAfterLines.has(0));
34
+ if (hasDeletionBeforeRange) {
35
+ if (showLineNumbers) {
36
+ const padded = ''.padStart(width, ' ');
37
+ formattedLines.push(`D${padded}|`);
38
+ }
39
+ else {
40
+ formattedLines.push('D');
41
+ }
42
+ }
43
+ formattedLines.push(...lines.map((line, index) => {
44
+ const lineNo = startLine + index;
45
+ const baseMarker = markers.get(lineNo) ?? '░';
46
+ const marker = deletionAfterLines.has(lineNo) ? 'D' : baseMarker;
47
+ if (showLineNumbers) {
48
+ const padded = String(lineNo).padStart(width, ' ');
49
+ return `${marker}${padded}| ${line}`;
50
+ }
51
+ return `${marker}${line}`;
52
+ }));
53
+ return formattedLines.join('\n');
54
+ }
55
+ class ReadFileToolInvocation extends BaseToolInvocation {
56
+ host;
57
+ constructor(host, params, messageBus) {
58
+ super(params, messageBus);
59
+ this.host = host;
60
+ }
61
+ getFilePath() {
62
+ // Use absolute_path if provided, otherwise fall back to file_path
63
+ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: multi-line || chain with terminator, absolute_path/file_path are optional strings with fallthrough intent */
64
+ return this.params.absolute_path || this.params.file_path || '';
65
+ /* eslint-enable @typescript-eslint/prefer-nullish-coalescing */
66
+ }
67
+ getDescription() {
68
+ const relativePath = makeRelative(this.getFilePath(), this.host.getTargetDir());
69
+ return shortenPath(relativePath);
70
+ }
71
+ toolLocations() {
72
+ return [{ path: this.getFilePath(), line: this.params.offset }];
73
+ }
74
+ async fetchGitAnnotations(filePath) {
75
+ const gitResult = await getGitLineChanges(filePath);
76
+ return {
77
+ gitWarning: gitResult.warning,
78
+ markersByLine: gitResult.markersByLine,
79
+ deletionAfterLines: gitResult.deletionAfterLines,
80
+ };
81
+ }
82
+ applyTextFormatting(content, startLine, markersByLine, deletionAfterLines) {
83
+ if (this.params.showGitChanges === true &&
84
+ markersByLine != null &&
85
+ deletionAfterLines != null) {
86
+ return formatWithGitChanges(content, startLine, markersByLine, deletionAfterLines, this.params.showLineNumbers === true);
87
+ }
88
+ if (this.params.showLineNumbers === true) {
89
+ return formatWithLineNumbers(content, startLine);
90
+ }
91
+ return content;
92
+ }
93
+ prependGitHeader(llmContent, gitWarning) {
94
+ if (this.params.showGitChanges !== true) {
95
+ return llmContent;
96
+ }
97
+ const headerParts = [];
98
+ if (gitWarning != null) {
99
+ headerParts.push(`NOTE: Failed to read git change status: ${gitWarning}`);
100
+ }
101
+ headerParts.push('Git changes legend: ░ unchanged, N new, M modified, D deletion after line.');
102
+ return `${headerParts.join('\n')}\n\n${llmContent}`;
103
+ }
104
+ buildTruncatedLlmContent(result, gitWarning, markersByLine, deletionAfterLines) {
105
+ const [start, end] = result.linesShown;
106
+ const total = result.originalLineCount;
107
+ const nextOffset = this.params.offset != null ? this.params.offset + end - start + 1 : end;
108
+ const startLine = this.params.offset != null ? this.params.offset + 1 : start;
109
+ const formattedContent = this.applyTextFormatting(result.llmContent, startLine, markersByLine, deletionAfterLines);
110
+ const gitLegend = this.params.showGitChanges === true
111
+ ? `\nGit changes legend: ░ unchanged, N new, M modified, D deletion after line.\n`
112
+ : '';
113
+ const gitWarningText = this.params.showGitChanges === true && gitWarning != null
114
+ ? `\nNOTE: Failed to read git change status: ${gitWarning}\n`
115
+ : '';
116
+ return `
117
+ IMPORTANT: The file content has been truncated.${gitWarningText}${gitLegend}
118
+ Status: Showing lines ${start}-${end} of ${total} total lines.
119
+ Action: To read more of the file, you can use the 'offset' and 'limit' parameters in a subsequent 'read_file' call. For example, to read the next section of the file, use offset: ${nextOffset}.
120
+
121
+ --- FILE CONTENT (truncated) ---
122
+ ${formattedContent}`;
123
+ }
124
+ buildFullLlmContent(result, gitWarning, markersByLine, deletionAfterLines) {
125
+ const startLine = this.params.offset != null ? this.params.offset + 1 : 1;
126
+ const formatted = this.applyTextFormatting(result.llmContent, startLine, markersByLine, deletionAfterLines);
127
+ return this.prependGitHeader(formatted, gitWarning);
128
+ }
129
+ recordReadMetric(llmContent, filePath) {
130
+ const lines = typeof llmContent === 'string'
131
+ ? llmContent.split('\n').length
132
+ : undefined;
133
+ const mimetype = getSpecificMimeType(filePath);
134
+ void lines;
135
+ void mimetype;
136
+ void filePath;
137
+ }
138
+ async execute() {
139
+ const ephemeralSettings = this.host.getEphemeralSettings();
140
+ const effectiveLimit = this.params.limit ??
141
+ ephemeralSettings['file-read-max-lines'] ??
142
+ DEFAULT_MAX_LINES_TEXT_FILE;
143
+ const result = await processSingleFileContent(this.getFilePath(), this.host.getTargetDir(), this.params.offset, effectiveLimit);
144
+ if (result.error) {
145
+ return {
146
+ llmContent: result.llmContent,
147
+ returnDisplay: result.returnDisplay || 'Error reading file',
148
+ error: { message: result.error, type: result.errorType },
149
+ };
150
+ }
151
+ let gitWarning;
152
+ let markersByLine;
153
+ let deletionAfterLines;
154
+ const shouldAnnotateGit = this.params.showGitChanges === true &&
155
+ typeof result.llmContent === 'string';
156
+ if (shouldAnnotateGit) {
157
+ ({ gitWarning, markersByLine, deletionAfterLines } =
158
+ await this.fetchGitAnnotations(this.getFilePath()));
159
+ }
160
+ let llmContent;
161
+ if (typeof result.llmContent !== 'string') {
162
+ llmContent = result.llmContent;
163
+ }
164
+ else if (result.isTruncated === true) {
165
+ llmContent = this.buildTruncatedLlmContent(result, gitWarning, markersByLine, deletionAfterLines);
166
+ }
167
+ else {
168
+ llmContent = this.buildFullLlmContent(result, gitWarning, markersByLine, deletionAfterLines);
169
+ }
170
+ this.recordReadMetric(result.llmContent, this.getFilePath());
171
+ return {
172
+ llmContent,
173
+ returnDisplay: result.returnDisplay || '',
174
+ };
175
+ }
176
+ }
177
+ /**
178
+ * Implementation of the ReadFile tool logic
179
+ */
180
+ export class ReadFileTool extends BaseDeclarativeTool {
181
+ host;
182
+ static Name = 'read_file';
183
+ constructor(host) {
184
+ super(ReadFileTool.Name, 'ReadFile', `Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.
185
+
186
+ Optional: when 'showGitChanges' is true, prefixes each returned text line with a single-character git-change marker column and includes a legend.
187
+ Legend: '░' unchanged, 'N' new, 'M' modified, 'D' deletion after line.
188
+ Column order: git marker first, then (optional) virtual line number column, then line content.
189
+ The git marker column is virtual and not part of the underlying file content.
190
+ If git status cannot be read, the tool will still return file content and include a brief warning.`, Kind.Read, {
191
+ properties: {
192
+ absolute_path: {
193
+ description: process.platform === 'win32'
194
+ ? "The absolute path to the file to read (e.g., 'C:\\Users\\project\\file.txt'). Relative paths are not supported. You must provide an absolute path."
195
+ : "The absolute path to the file to read (e.g., '/home/user/project/file.txt'). Relative paths are not supported. You must provide an absolute path.",
196
+ type: 'string',
197
+ },
198
+ file_path: {
199
+ description: 'Alternative parameter name for absolute_path (for backward compatibility). The absolute path to the file to read.',
200
+ type: 'string',
201
+ },
202
+ offset: {
203
+ description: "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.",
204
+ type: 'number',
205
+ },
206
+ limit: {
207
+ description: "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).",
208
+ type: 'number',
209
+ },
210
+ showLineNumbers: {
211
+ description: 'Optional: When true, prefixes each line of the returned text with a left-padded virtual line number and a separator bar (for example, " 294| const x = 1;"). This numbering is not part of the underlying file; it is only a visual aid. Recommended when you need to precisely understand line numbers in large files for subsequent editing operations.',
212
+ type: 'boolean',
213
+ },
214
+ showGitChanges: {
215
+ description: "Optional: When true (text files only), prefixes each returned line with a single-character git-change marker column computed relative to HEAD (includes staged and unstaged changes). This marker column is virtual and not part of the file content. Legend: '░' unchanged, 'N' new, 'M' modified, 'D' deletion after line. Column order: git marker first, then (optional) the virtual line number column, then line content. If git status cannot be read, content is still returned and a brief warning is included.",
216
+ type: 'boolean',
217
+ },
218
+ },
219
+ // Don't require either in schema - validation handles this
220
+ type: 'object',
221
+ });
222
+ this.host = host;
223
+ }
224
+ validateToolParamValues(params) {
225
+ // Accept either absolute_path or file_path
226
+ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: multi-line || chain with terminator, absolute_path/file_path are optional strings with fallthrough intent */
227
+ const filePath = params.absolute_path || params.file_path || '';
228
+ /* eslint-enable @typescript-eslint/prefer-nullish-coalescing */
229
+ if (filePath.trim() === '') {
230
+ return "Either 'absolute_path' or 'file_path' parameter must be provided and non-empty.";
231
+ }
232
+ if (!path.isAbsolute(filePath)) {
233
+ return `File path must be absolute, but was relative: ${filePath}. You must provide an absolute path.`;
234
+ }
235
+ const pathError = validatePathWithinWorkspace(this.host.getWorkspaceRoots(), filePath);
236
+ if (pathError) {
237
+ return pathError;
238
+ }
239
+ if (params.offset !== undefined && params.offset < 0) {
240
+ return 'Offset must be a non-negative number';
241
+ }
242
+ if (params.limit !== undefined && params.limit <= 0) {
243
+ return 'Limit must be a positive number';
244
+ }
245
+ const fileService = this.host.getFileService();
246
+ if (fileService.shouldLlxprtIgnoreFile(filePath)) {
247
+ return `File path '${filePath}' is ignored by .llxprtignore pattern(s).`;
248
+ }
249
+ return null;
250
+ }
251
+ createInvocation(params, messageBus) {
252
+ // Normalize parameters: if file_path is provided but not absolute_path, copy it over
253
+ const normalizedParams = { ...params };
254
+ if (!normalizedParams.absolute_path && normalizedParams.file_path) {
255
+ normalizedParams.absolute_path = normalizedParams.file_path;
256
+ }
257
+ return new ReadFileToolInvocation(this.host, normalizedParams, messageBus);
258
+ }
259
+ async execute(params, signal = new AbortController().signal) {
260
+ const result = await this.build(params).execute(signal);
261
+ return this.normalizeLegacyExecutableResult(result);
262
+ }
263
+ normalizeLegacyExecutableResult(result) {
264
+ const normalized = { ...result };
265
+ if (normalized.returnDisplay === '' &&
266
+ typeof normalized.llmContent === 'string') {
267
+ normalized.returnDisplay = normalized.llmContent;
268
+ }
269
+ if (normalized.error != null) {
270
+ return {
271
+ ...normalized,
272
+ llmContent: normalized.error.message,
273
+ error: normalized.error.message,
274
+ };
275
+ }
276
+ return normalized;
277
+ }
278
+ }
279
+ //# sourceMappingURL=read-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file.js","sourceRoot":"","sources":["../../../src/tools/read-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6IAA6I;AAE7I,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,IAAI,GAIL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,GAE5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAsCzE,SAAS,qBAAqB,CAAC,OAAe,EAAE,SAAiB;IAC/D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,SAAS,GAA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,CAAC;YACD,UAAU,CAAC,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC;QACnD,CAAC;QACD,IAAI,UAAU,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAC7B,OAAO;gBACL,GAAG,UAAU;gBACb,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO;gBACpC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,OAAyC;aAClE,CAAC;QACJ,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { BaseDeclarativeTool, type ToolInvocation, type ToolResult } from './tools.js';
7
+ import type { IToolHost, IToolMessageBus } from '../interfaces/index.js';
8
+ /**
9
+ * Parameters for the ReadManyFilesTool.
10
+ */
11
+ export interface ReadManyFilesParams {
12
+ /**
13
+ * An array of file paths or directory paths to search within.
14
+ * Paths are relative to the tool's configured target directory.
15
+ * Glob patterns can be used directly in these paths.
16
+ */
17
+ paths: string[];
18
+ /**
19
+ * Optional. Glob patterns for files to include.
20
+ * These are effectively combined with the `paths`.
21
+ * Example: ["*.ts", "src/** /*.md"]
22
+ */
23
+ include?: string[];
24
+ /**
25
+ * Optional. Glob patterns for files/directories to exclude.
26
+ * Applied as ignore patterns.
27
+ * Example: ["*.log", "dist/**"]
28
+ */
29
+ exclude?: string[];
30
+ /**
31
+ * Optional. Search directories recursively.
32
+ * This is generally controlled by glob patterns (e.g., `**`).
33
+ * The glob implementation is recursive by default for `**`.
34
+ * For simplicity, we'll rely on `**` for recursion.
35
+ */
36
+ recursive?: boolean;
37
+ /**
38
+ * Optional. Apply default exclusion patterns. Defaults to true.
39
+ */
40
+ useDefaultExcludes?: boolean;
41
+ /**
42
+ * Whether to respect .gitignore and .llxprtignore patterns (optional, defaults to true)
43
+ */
44
+ file_filtering_options?: {
45
+ respect_git_ignore?: boolean;
46
+ respect_llxprt_ignore?: boolean;
47
+ };
48
+ }
49
+ /**
50
+ * Tool implementation for finding and reading multiple text files from the local filesystem
51
+ * within a specified target directory. The content is concatenated.
52
+ * It is intended to run in an environment with access to the local file system (e.g., a Node.js backend).
53
+ */
54
+ export declare class ReadManyFilesTool extends BaseDeclarativeTool<ReadManyFilesParams, ToolResult> {
55
+ private host;
56
+ static readonly Name: string;
57
+ constructor(host: IToolHost);
58
+ protected createInvocation(params: ReadManyFilesParams, messageBus: IToolMessageBus): ToolInvocation<ReadManyFilesParams, ToolResult>;
59
+ execute(params: ReadManyFilesParams, signal?: AbortSignal): Promise<ToolResult>;
60
+ }