@vybestack/llxprt-code-core 0.1.12

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 (448) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +8 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/src/__mocks__/fs/promises.d.ts +11 -0
  6. package/dist/src/__mocks__/fs/promises.js +17 -0
  7. package/dist/src/__mocks__/fs/promises.js.map +1 -0
  8. package/dist/src/code_assist/codeAssist.d.ts +9 -0
  9. package/dist/src/code_assist/codeAssist.js +19 -0
  10. package/dist/src/code_assist/codeAssist.js.map +1 -0
  11. package/dist/src/code_assist/converter.d.ts +68 -0
  12. package/dist/src/code_assist/converter.js +125 -0
  13. package/dist/src/code_assist/converter.js.map +1 -0
  14. package/dist/src/code_assist/converter.test.d.ts +6 -0
  15. package/dist/src/code_assist/converter.test.js +229 -0
  16. package/dist/src/code_assist/converter.test.js.map +1 -0
  17. package/dist/src/code_assist/oauth2.d.ts +20 -0
  18. package/dist/src/code_assist/oauth2.js +339 -0
  19. package/dist/src/code_assist/oauth2.js.map +1 -0
  20. package/dist/src/code_assist/oauth2.test.d.ts +6 -0
  21. package/dist/src/code_assist/oauth2.test.js +249 -0
  22. package/dist/src/code_assist/oauth2.test.js.map +1 -0
  23. package/dist/src/code_assist/server.d.ts +39 -0
  24. package/dist/src/code_assist/server.js +191 -0
  25. package/dist/src/code_assist/server.js.map +1 -0
  26. package/dist/src/code_assist/server.test.d.ts +6 -0
  27. package/dist/src/code_assist/server.test.js +123 -0
  28. package/dist/src/code_assist/server.test.js.map +1 -0
  29. package/dist/src/code_assist/setup.d.ts +15 -0
  30. package/dist/src/code_assist/setup.js +67 -0
  31. package/dist/src/code_assist/setup.js.map +1 -0
  32. package/dist/src/code_assist/setup.test.d.ts +6 -0
  33. package/dist/src/code_assist/setup.test.js +62 -0
  34. package/dist/src/code_assist/setup.test.js.map +1 -0
  35. package/dist/src/code_assist/types.d.ts +148 -0
  36. package/dist/src/code_assist/types.js +46 -0
  37. package/dist/src/code_assist/types.js.map +1 -0
  38. package/dist/src/config/config.d.ts +212 -0
  39. package/dist/src/config/config.js +454 -0
  40. package/dist/src/config/config.js.map +1 -0
  41. package/dist/src/config/config.test.d.ts +6 -0
  42. package/dist/src/config/config.test.js +291 -0
  43. package/dist/src/config/config.test.js.map +1 -0
  44. package/dist/src/config/flashFallback.test.d.ts +6 -0
  45. package/dist/src/config/flashFallback.test.js +115 -0
  46. package/dist/src/config/flashFallback.test.js.map +1 -0
  47. package/dist/src/config/models.d.ts +8 -0
  48. package/dist/src/config/models.js +9 -0
  49. package/dist/src/config/models.js.map +1 -0
  50. package/dist/src/core/client.d.ts +59 -0
  51. package/dist/src/core/client.js +503 -0
  52. package/dist/src/core/client.js.map +1 -0
  53. package/dist/src/core/client.test.d.ts +6 -0
  54. package/dist/src/core/client.test.js +1006 -0
  55. package/dist/src/core/client.test.js.map +1 -0
  56. package/dist/src/core/contentGenerator.d.ts +36 -0
  57. package/dist/src/core/contentGenerator.js +79 -0
  58. package/dist/src/core/contentGenerator.js.map +1 -0
  59. package/dist/src/core/contentGenerator.test.d.ts +6 -0
  60. package/dist/src/core/contentGenerator.test.js +92 -0
  61. package/dist/src/core/contentGenerator.test.js.map +1 -0
  62. package/dist/src/core/coreToolScheduler.d.ts +104 -0
  63. package/dist/src/core/coreToolScheduler.js +413 -0
  64. package/dist/src/core/coreToolScheduler.js.map +1 -0
  65. package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
  66. package/dist/src/core/coreToolScheduler.test.js +347 -0
  67. package/dist/src/core/coreToolScheduler.test.js.map +1 -0
  68. package/dist/src/core/geminiChat.d.ts +116 -0
  69. package/dist/src/core/geminiChat.js +513 -0
  70. package/dist/src/core/geminiChat.js.map +1 -0
  71. package/dist/src/core/geminiChat.test.d.ts +6 -0
  72. package/dist/src/core/geminiChat.test.js +424 -0
  73. package/dist/src/core/geminiChat.test.js.map +1 -0
  74. package/dist/src/core/geminiRequest.d.ts +13 -0
  75. package/dist/src/core/geminiRequest.js +45 -0
  76. package/dist/src/core/geminiRequest.js.map +1 -0
  77. package/dist/src/core/geminiRequest.test.d.ts +6 -0
  78. package/dist/src/core/geminiRequest.test.js +72 -0
  79. package/dist/src/core/geminiRequest.test.js.map +1 -0
  80. package/dist/src/core/logger.d.ts +38 -0
  81. package/dist/src/core/logger.js +237 -0
  82. package/dist/src/core/logger.js.map +1 -0
  83. package/dist/src/core/logger.test.d.ts +6 -0
  84. package/dist/src/core/logger.test.js +387 -0
  85. package/dist/src/core/logger.test.js.map +1 -0
  86. package/dist/src/core/modelCheck.d.ts +14 -0
  87. package/dist/src/core/modelCheck.js +55 -0
  88. package/dist/src/core/modelCheck.js.map +1 -0
  89. package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
  90. package/dist/src/core/nonInteractiveToolExecutor.js +93 -0
  91. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
  92. package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
  93. package/dist/src/core/nonInteractiveToolExecutor.test.js +180 -0
  94. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
  95. package/dist/src/core/prompts.d.ts +12 -0
  96. package/dist/src/core/prompts.js +418 -0
  97. package/dist/src/core/prompts.js.map +1 -0
  98. package/dist/src/core/prompts.test.d.ts +6 -0
  99. package/dist/src/core/prompts.test.js +97 -0
  100. package/dist/src/core/prompts.test.js.map +1 -0
  101. package/dist/src/core/tokenLimits.d.ts +10 -0
  102. package/dist/src/core/tokenLimits.js +75 -0
  103. package/dist/src/core/tokenLimits.js.map +1 -0
  104. package/dist/src/core/tokenLimits.test.d.ts +6 -0
  105. package/dist/src/core/tokenLimits.test.js +66 -0
  106. package/dist/src/core/tokenLimits.test.js.map +1 -0
  107. package/dist/src/core/turn.d.ts +116 -0
  108. package/dist/src/core/turn.js +131 -0
  109. package/dist/src/core/turn.js.map +1 -0
  110. package/dist/src/core/turn.test.d.ts +6 -0
  111. package/dist/src/core/turn.test.js +237 -0
  112. package/dist/src/core/turn.test.js.map +1 -0
  113. package/dist/src/index.d.ts +57 -0
  114. package/dist/src/index.js +64 -0
  115. package/dist/src/index.js.map +1 -0
  116. package/dist/src/index.test.d.ts +6 -0
  117. package/dist/src/index.test.js +12 -0
  118. package/dist/src/index.test.js.map +1 -0
  119. package/dist/src/providers/ProviderContentGenerator.d.ts +21 -0
  120. package/dist/src/providers/ProviderContentGenerator.js +52 -0
  121. package/dist/src/providers/ProviderContentGenerator.js.map +1 -0
  122. package/dist/src/providers/adapters/GeminiCompatibleWrapper.d.ts +68 -0
  123. package/dist/src/providers/adapters/GeminiCompatibleWrapper.js +549 -0
  124. package/dist/src/providers/adapters/GeminiCompatibleWrapper.js.map +1 -0
  125. package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.d.ts +6 -0
  126. package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.js +253 -0
  127. package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.js.map +1 -0
  128. package/dist/src/providers/types.d.ts +82 -0
  129. package/dist/src/providers/types.js +7 -0
  130. package/dist/src/providers/types.js.map +1 -0
  131. package/dist/src/services/fileDiscoveryService.d.ts +35 -0
  132. package/dist/src/services/fileDiscoveryService.js +91 -0
  133. package/dist/src/services/fileDiscoveryService.js.map +1 -0
  134. package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
  135. package/dist/src/services/fileDiscoveryService.test.js +102 -0
  136. package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
  137. package/dist/src/services/gitService.d.ts +21 -0
  138. package/dist/src/services/gitService.js +102 -0
  139. package/dist/src/services/gitService.js.map +1 -0
  140. package/dist/src/services/gitService.test.d.ts +6 -0
  141. package/dist/src/services/gitService.test.js +246 -0
  142. package/dist/src/services/gitService.test.js.map +1 -0
  143. package/dist/src/services/ideContext.d.ts +124 -0
  144. package/dist/src/services/ideContext.js +90 -0
  145. package/dist/src/services/ideContext.js.map +1 -0
  146. package/dist/src/services/ideContext.test.d.ts +6 -0
  147. package/dist/src/services/ideContext.test.js +101 -0
  148. package/dist/src/services/ideContext.test.js.map +1 -0
  149. package/dist/src/services/loopDetectionService.d.ts +35 -0
  150. package/dist/src/services/loopDetectionService.js +117 -0
  151. package/dist/src/services/loopDetectionService.js.map +1 -0
  152. package/dist/src/services/loopDetectionService.test.d.ts +6 -0
  153. package/dist/src/services/loopDetectionService.test.js +232 -0
  154. package/dist/src/services/loopDetectionService.test.js.map +1 -0
  155. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +35 -0
  156. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +424 -0
  157. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
  158. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +47 -0
  159. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +123 -0
  160. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
  161. package/dist/src/telemetry/constants.d.ts +20 -0
  162. package/dist/src/telemetry/constants.js +21 -0
  163. package/dist/src/telemetry/constants.js.map +1 -0
  164. package/dist/src/telemetry/index.d.ts +18 -0
  165. package/dist/src/telemetry/index.js +20 -0
  166. package/dist/src/telemetry/index.js.map +1 -0
  167. package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
  168. package/dist/src/telemetry/integration.test.circular.js +53 -0
  169. package/dist/src/telemetry/integration.test.circular.js.map +1 -0
  170. package/dist/src/telemetry/loggers.d.ts +15 -0
  171. package/dist/src/telemetry/loggers.js +229 -0
  172. package/dist/src/telemetry/loggers.js.map +1 -0
  173. package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
  174. package/dist/src/telemetry/loggers.test.circular.js +100 -0
  175. package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
  176. package/dist/src/telemetry/loggers.test.d.ts +6 -0
  177. package/dist/src/telemetry/loggers.test.js +558 -0
  178. package/dist/src/telemetry/loggers.test.js.map +1 -0
  179. package/dist/src/telemetry/metrics.d.ts +19 -0
  180. package/dist/src/telemetry/metrics.js +144 -0
  181. package/dist/src/telemetry/metrics.js.map +1 -0
  182. package/dist/src/telemetry/metrics.test.d.ts +6 -0
  183. package/dist/src/telemetry/metrics.test.js +162 -0
  184. package/dist/src/telemetry/metrics.test.js.map +1 -0
  185. package/dist/src/telemetry/sdk.d.ts +9 -0
  186. package/dist/src/telemetry/sdk.js +120 -0
  187. package/dist/src/telemetry/sdk.js.map +1 -0
  188. package/dist/src/telemetry/telemetry.test.d.ts +6 -0
  189. package/dist/src/telemetry/telemetry.test.js +52 -0
  190. package/dist/src/telemetry/telemetry.test.js.map +1 -0
  191. package/dist/src/telemetry/types.d.ts +115 -0
  192. package/dist/src/telemetry/types.js +217 -0
  193. package/dist/src/telemetry/types.js.map +1 -0
  194. package/dist/src/telemetry/uiTelemetry.d.ts +67 -0
  195. package/dist/src/telemetry/uiTelemetry.js +131 -0
  196. package/dist/src/telemetry/uiTelemetry.js.map +1 -0
  197. package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
  198. package/dist/src/telemetry/uiTelemetry.test.js +412 -0
  199. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
  200. package/dist/src/tools/diffOptions.d.ts +7 -0
  201. package/dist/src/tools/diffOptions.js +10 -0
  202. package/dist/src/tools/diffOptions.js.map +1 -0
  203. package/dist/src/tools/edit.d.ts +73 -0
  204. package/dist/src/tools/edit.js +343 -0
  205. package/dist/src/tools/edit.js.map +1 -0
  206. package/dist/src/tools/edit.test.d.ts +6 -0
  207. package/dist/src/tools/edit.test.js +500 -0
  208. package/dist/src/tools/edit.test.js.map +1 -0
  209. package/dist/src/tools/glob.d.ts +58 -0
  210. package/dist/src/tools/glob.js +193 -0
  211. package/dist/src/tools/glob.js.map +1 -0
  212. package/dist/src/tools/glob.test.d.ts +6 -0
  213. package/dist/src/tools/glob.test.js +294 -0
  214. package/dist/src/tools/glob.test.js.map +1 -0
  215. package/dist/src/tools/grep.d.ts +78 -0
  216. package/dist/src/tools/grep.js +422 -0
  217. package/dist/src/tools/grep.js.map +1 -0
  218. package/dist/src/tools/grep.test.d.ts +6 -0
  219. package/dist/src/tools/grep.test.js +188 -0
  220. package/dist/src/tools/grep.test.js.map +1 -0
  221. package/dist/src/tools/ls.d.ts +83 -0
  222. package/dist/src/tools/ls.js +194 -0
  223. package/dist/src/tools/ls.js.map +1 -0
  224. package/dist/src/tools/mcp-client.d.ts +112 -0
  225. package/dist/src/tools/mcp-client.js +332 -0
  226. package/dist/src/tools/mcp-client.js.map +1 -0
  227. package/dist/src/tools/mcp-client.test.d.ts +6 -0
  228. package/dist/src/tools/mcp-client.test.js +227 -0
  229. package/dist/src/tools/mcp-client.test.js.map +1 -0
  230. package/dist/src/tools/mcp-tool.d.ts +23 -0
  231. package/dist/src/tools/mcp-tool.js +119 -0
  232. package/dist/src/tools/mcp-tool.js.map +1 -0
  233. package/dist/src/tools/mcp-tool.test.d.ts +6 -0
  234. package/dist/src/tools/mcp-tool.test.js +173 -0
  235. package/dist/src/tools/mcp-tool.test.js.map +1 -0
  236. package/dist/src/tools/memoryTool.d.ts +28 -0
  237. package/dist/src/tools/memoryTool.js +172 -0
  238. package/dist/src/tools/memoryTool.js.map +1 -0
  239. package/dist/src/tools/memoryTool.test.d.ts +6 -0
  240. package/dist/src/tools/memoryTool.test.js +181 -0
  241. package/dist/src/tools/memoryTool.test.js.map +1 -0
  242. package/dist/src/tools/modifiable-tool.d.ts +29 -0
  243. package/dist/src/tools/modifiable-tool.js +85 -0
  244. package/dist/src/tools/modifiable-tool.js.map +1 -0
  245. package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
  246. package/dist/src/tools/modifiable-tool.test.js +204 -0
  247. package/dist/src/tools/modifiable-tool.test.js.map +1 -0
  248. package/dist/src/tools/read-file.d.ts +35 -0
  249. package/dist/src/tools/read-file.js +106 -0
  250. package/dist/src/tools/read-file.js.map +1 -0
  251. package/dist/src/tools/read-file.test.d.ts +6 -0
  252. package/dist/src/tools/read-file.test.js +181 -0
  253. package/dist/src/tools/read-file.test.js.map +1 -0
  254. package/dist/src/tools/read-many-files.d.ts +59 -0
  255. package/dist/src/tools/read-many-files.js +321 -0
  256. package/dist/src/tools/read-many-files.js.map +1 -0
  257. package/dist/src/tools/read-many-files.test.d.ts +6 -0
  258. package/dist/src/tools/read-many-files.test.js +312 -0
  259. package/dist/src/tools/read-many-files.test.js.map +1 -0
  260. package/dist/src/tools/shell.d.ts +43 -0
  261. package/dist/src/tools/shell.js +435 -0
  262. package/dist/src/tools/shell.js.map +1 -0
  263. package/dist/src/tools/shell.test.d.ts +6 -0
  264. package/dist/src/tools/shell.test.js +407 -0
  265. package/dist/src/tools/shell.test.js.map +1 -0
  266. package/dist/src/tools/todo-read.d.ts +15 -0
  267. package/dist/src/tools/todo-read.js +66 -0
  268. package/dist/src/tools/todo-read.js.map +1 -0
  269. package/dist/src/tools/todo-read.test.d.ts +6 -0
  270. package/dist/src/tools/todo-read.test.js +158 -0
  271. package/dist/src/tools/todo-read.test.js.map +1 -0
  272. package/dist/src/tools/todo-schemas.d.ts +43 -0
  273. package/dist/src/tools/todo-schemas.js +16 -0
  274. package/dist/src/tools/todo-schemas.js.map +1 -0
  275. package/dist/src/tools/todo-schemas.test.d.ts +6 -0
  276. package/dist/src/tools/todo-schemas.test.js +152 -0
  277. package/dist/src/tools/todo-schemas.test.js.map +1 -0
  278. package/dist/src/tools/todo-store.d.ts +15 -0
  279. package/dist/src/tools/todo-store.js +59 -0
  280. package/dist/src/tools/todo-store.js.map +1 -0
  281. package/dist/src/tools/todo-store.test.d.ts +6 -0
  282. package/dist/src/tools/todo-store.test.js +175 -0
  283. package/dist/src/tools/todo-store.test.js.map +1 -0
  284. package/dist/src/tools/todo-write.d.ts +17 -0
  285. package/dist/src/tools/todo-write.js +98 -0
  286. package/dist/src/tools/todo-write.js.map +1 -0
  287. package/dist/src/tools/todo-write.test.d.ts +6 -0
  288. package/dist/src/tools/todo-write.test.js +208 -0
  289. package/dist/src/tools/todo-write.test.js.map +1 -0
  290. package/dist/src/tools/tool-registry.d.ts +67 -0
  291. package/dist/src/tools/tool-registry.js +326 -0
  292. package/dist/src/tools/tool-registry.js.map +1 -0
  293. package/dist/src/tools/tool-registry.test.d.ts +6 -0
  294. package/dist/src/tools/tool-registry.test.js +398 -0
  295. package/dist/src/tools/tool-registry.test.js.map +1 -0
  296. package/dist/src/tools/tools.d.ts +184 -0
  297. package/dist/src/tools/tools.js +88 -0
  298. package/dist/src/tools/tools.js.map +1 -0
  299. package/dist/src/tools/web-fetch.d.ts +29 -0
  300. package/dist/src/tools/web-fetch.js +243 -0
  301. package/dist/src/tools/web-fetch.js.map +1 -0
  302. package/dist/src/tools/web-fetch.test.d.ts +6 -0
  303. package/dist/src/tools/web-fetch.test.js +70 -0
  304. package/dist/src/tools/web-fetch.test.js.map +1 -0
  305. package/dist/src/tools/web-search.d.ts +49 -0
  306. package/dist/src/tools/web-search.js +120 -0
  307. package/dist/src/tools/web-search.js.map +1 -0
  308. package/dist/src/tools/write-file.d.ts +42 -0
  309. package/dist/src/tools/write-file.js +248 -0
  310. package/dist/src/tools/write-file.js.map +1 -0
  311. package/dist/src/tools/write-file.test.d.ts +6 -0
  312. package/dist/src/tools/write-file.test.js +413 -0
  313. package/dist/src/tools/write-file.test.js.map +1 -0
  314. package/dist/src/utils/LruCache.d.ts +13 -0
  315. package/dist/src/utils/LruCache.js +38 -0
  316. package/dist/src/utils/LruCache.js.map +1 -0
  317. package/dist/src/utils/bfsFileSearch.d.ts +22 -0
  318. package/dist/src/utils/bfsFileSearch.js +62 -0
  319. package/dist/src/utils/bfsFileSearch.js.map +1 -0
  320. package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
  321. package/dist/src/utils/bfsFileSearch.test.js +129 -0
  322. package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
  323. package/dist/src/utils/editCorrector.d.ts +53 -0
  324. package/dist/src/utils/editCorrector.js +546 -0
  325. package/dist/src/utils/editCorrector.js.map +1 -0
  326. package/dist/src/utils/editCorrector.test.d.ts +6 -0
  327. package/dist/src/utils/editCorrector.test.js +564 -0
  328. package/dist/src/utils/editCorrector.test.js.map +1 -0
  329. package/dist/src/utils/editor.d.ts +28 -0
  330. package/dist/src/utils/editor.js +163 -0
  331. package/dist/src/utils/editor.js.map +1 -0
  332. package/dist/src/utils/editor.test.d.ts +6 -0
  333. package/dist/src/utils/editor.test.js +293 -0
  334. package/dist/src/utils/editor.test.js.map +1 -0
  335. package/dist/src/utils/errorReporting.d.ts +14 -0
  336. package/dist/src/utils/errorReporting.js +88 -0
  337. package/dist/src/utils/errorReporting.js.map +1 -0
  338. package/dist/src/utils/errorReporting.test.d.ts +6 -0
  339. package/dist/src/utils/errorReporting.test.js +124 -0
  340. package/dist/src/utils/errorReporting.test.js.map +1 -0
  341. package/dist/src/utils/errors.d.ts +14 -0
  342. package/dist/src/utils/errors.js +54 -0
  343. package/dist/src/utils/errors.js.map +1 -0
  344. package/dist/src/utils/fetch.d.ts +11 -0
  345. package/dist/src/utils/fetch.js +51 -0
  346. package/dist/src/utils/fetch.js.map +1 -0
  347. package/dist/src/utils/fileUtils.d.ts +49 -0
  348. package/dist/src/utils/fileUtils.js +286 -0
  349. package/dist/src/utils/fileUtils.js.map +1 -0
  350. package/dist/src/utils/fileUtils.test.d.ts +6 -0
  351. package/dist/src/utils/fileUtils.test.js +321 -0
  352. package/dist/src/utils/fileUtils.test.js.map +1 -0
  353. package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
  354. package/dist/src/utils/flashFallback.integration.test.js +112 -0
  355. package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
  356. package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
  357. package/dist/src/utils/generateContentResponseUtilities.js +92 -0
  358. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
  359. package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
  360. package/dist/src/utils/generateContentResponseUtilities.test.js +273 -0
  361. package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
  362. package/dist/src/utils/getFolderStructure.d.ts +30 -0
  363. package/dist/src/utils/getFolderStructure.js +247 -0
  364. package/dist/src/utils/getFolderStructure.js.map +1 -0
  365. package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
  366. package/dist/src/utils/getFolderStructure.test.js +298 -0
  367. package/dist/src/utils/getFolderStructure.test.js.map +1 -0
  368. package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
  369. package/dist/src/utils/gitIgnoreParser.js +64 -0
  370. package/dist/src/utils/gitIgnoreParser.js.map +1 -0
  371. package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
  372. package/dist/src/utils/gitIgnoreParser.test.js +145 -0
  373. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
  374. package/dist/src/utils/gitUtils.d.ts +17 -0
  375. package/dist/src/utils/gitUtils.js +61 -0
  376. package/dist/src/utils/gitUtils.js.map +1 -0
  377. package/dist/src/utils/memoryDiscovery.d.ts +14 -0
  378. package/dist/src/utils/memoryDiscovery.js +219 -0
  379. package/dist/src/utils/memoryDiscovery.js.map +1 -0
  380. package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
  381. package/dist/src/utils/memoryDiscovery.test.js +432 -0
  382. package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
  383. package/dist/src/utils/memoryImportProcessor.d.ts +35 -0
  384. package/dist/src/utils/memoryImportProcessor.js +141 -0
  385. package/dist/src/utils/memoryImportProcessor.js.map +1 -0
  386. package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
  387. package/dist/src/utils/memoryImportProcessor.test.js +170 -0
  388. package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
  389. package/dist/src/utils/messageInspectors.d.ts +8 -0
  390. package/dist/src/utils/messageInspectors.js +16 -0
  391. package/dist/src/utils/messageInspectors.js.map +1 -0
  392. package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
  393. package/dist/src/utils/nextSpeakerChecker.js +113 -0
  394. package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
  395. package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
  396. package/dist/src/utils/nextSpeakerChecker.test.js +168 -0
  397. package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
  398. package/dist/src/utils/paths.d.ts +49 -0
  399. package/dist/src/utils/paths.js +145 -0
  400. package/dist/src/utils/paths.js.map +1 -0
  401. package/dist/src/utils/quotaErrorDetection.d.ts +22 -0
  402. package/dist/src/utils/quotaErrorDetection.js +67 -0
  403. package/dist/src/utils/quotaErrorDetection.js.map +1 -0
  404. package/dist/src/utils/retry.d.ts +21 -0
  405. package/dist/src/utils/retry.js +276 -0
  406. package/dist/src/utils/retry.js.map +1 -0
  407. package/dist/src/utils/retry.test.d.ts +6 -0
  408. package/dist/src/utils/retry.test.js +322 -0
  409. package/dist/src/utils/retry.test.js.map +1 -0
  410. package/dist/src/utils/safeJsonStringify.d.ts +13 -0
  411. package/dist/src/utils/safeJsonStringify.js +25 -0
  412. package/dist/src/utils/safeJsonStringify.js.map +1 -0
  413. package/dist/src/utils/safeJsonStringify.test.d.ts +6 -0
  414. package/dist/src/utils/safeJsonStringify.test.js +61 -0
  415. package/dist/src/utils/safeJsonStringify.test.js.map +1 -0
  416. package/dist/src/utils/schemaValidator.d.ts +23 -0
  417. package/dist/src/utils/schemaValidator.js +142 -0
  418. package/dist/src/utils/schemaValidator.js.map +1 -0
  419. package/dist/src/utils/schemaValidator.test.d.ts +6 -0
  420. package/dist/src/utils/schemaValidator.test.js +146 -0
  421. package/dist/src/utils/schemaValidator.test.js.map +1 -0
  422. package/dist/src/utils/session.d.ts +6 -0
  423. package/dist/src/utils/session.js +8 -0
  424. package/dist/src/utils/session.js.map +1 -0
  425. package/dist/src/utils/summarizer.d.ts +25 -0
  426. package/dist/src/utils/summarizer.js +80 -0
  427. package/dist/src/utils/summarizer.js.map +1 -0
  428. package/dist/src/utils/summarizer.test.d.ts +6 -0
  429. package/dist/src/utils/summarizer.test.js +131 -0
  430. package/dist/src/utils/summarizer.test.js.map +1 -0
  431. package/dist/src/utils/testUtils.d.ts +29 -0
  432. package/dist/src/utils/testUtils.js +70 -0
  433. package/dist/src/utils/testUtils.js.map +1 -0
  434. package/dist/src/utils/user_account.d.ts +9 -0
  435. package/dist/src/utils/user_account.js +99 -0
  436. package/dist/src/utils/user_account.js.map +1 -0
  437. package/dist/src/utils/user_account.test.d.ts +6 -0
  438. package/dist/src/utils/user_account.test.js +153 -0
  439. package/dist/src/utils/user_account.test.js.map +1 -0
  440. package/dist/src/utils/user_id.d.ts +11 -0
  441. package/dist/src/utils/user_id.js +49 -0
  442. package/dist/src/utils/user_id.js.map +1 -0
  443. package/dist/src/utils/user_id.test.d.ts +6 -0
  444. package/dist/src/utils/user_id.test.js +21 -0
  445. package/dist/src/utils/user_id.test.js.map +1 -0
  446. package/dist/tsconfig.tsbuildinfo +1 -0
  447. package/dist/vybestack-llxprt-code-core-0.1.12.tgz +0 -0
  448. package/package.json +62 -0
@@ -0,0 +1,500 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7
+ const mockEnsureCorrectEdit = vi.hoisted(() => vi.fn());
8
+ const mockGenerateJson = vi.hoisted(() => vi.fn());
9
+ const mockOpenDiff = vi.hoisted(() => vi.fn());
10
+ vi.mock('../utils/editCorrector.js', () => ({
11
+ ensureCorrectEdit: mockEnsureCorrectEdit,
12
+ }));
13
+ vi.mock('../core/client.js', () => ({
14
+ GeminiClient: vi.fn().mockImplementation(() => ({
15
+ generateJson: mockGenerateJson,
16
+ })),
17
+ }));
18
+ vi.mock('../utils/editor.js', () => ({
19
+ openDiff: mockOpenDiff,
20
+ }));
21
+ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
22
+ import { EditTool } from './edit.js';
23
+ import path from 'path';
24
+ import fs from 'fs';
25
+ import os from 'os';
26
+ import { ApprovalMode } from '../config/config.js';
27
+ describe('EditTool', () => {
28
+ let tool;
29
+ let tempDir;
30
+ let rootDir;
31
+ let mockConfig;
32
+ let geminiClient;
33
+ beforeEach(() => {
34
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'edit-tool-test-'));
35
+ rootDir = path.join(tempDir, 'root');
36
+ fs.mkdirSync(rootDir);
37
+ geminiClient = {
38
+ generateJson: mockGenerateJson, // mockGenerateJson is already defined and hoisted
39
+ };
40
+ mockConfig = {
41
+ getGeminiClient: vi.fn().mockReturnValue(geminiClient),
42
+ getTargetDir: () => rootDir,
43
+ getApprovalMode: vi.fn(),
44
+ setApprovalMode: vi.fn(),
45
+ // getGeminiConfig: () => ({ apiKey: 'test-api-key' }), // This was not a real Config method
46
+ // Add other properties/methods of Config if EditTool uses them
47
+ // Minimal other methods to satisfy Config type if needed by EditTool constructor or other direct uses:
48
+ getApiKey: () => 'test-api-key',
49
+ getModel: () => 'test-model',
50
+ getSandbox: () => false,
51
+ getDebugMode: () => false,
52
+ getQuestion: () => undefined,
53
+ getFullContext: () => false,
54
+ getToolDiscoveryCommand: () => undefined,
55
+ getToolCallCommand: () => undefined,
56
+ getMcpServerCommand: () => undefined,
57
+ getMcpServers: () => undefined,
58
+ getUserAgent: () => 'test-agent',
59
+ getUserMemory: () => '',
60
+ setUserMemory: vi.fn(),
61
+ getLlxprtMdFileCount: () => 0,
62
+ setLlxprtMdFileCount: vi.fn(),
63
+ getToolRegistry: () => ({}), // Minimal mock for ToolRegistry
64
+ };
65
+ // Reset mocks before each test
66
+ mockConfig.getApprovalMode.mockClear();
67
+ // Default to not skipping confirmation
68
+ mockConfig.getApprovalMode.mockReturnValue(ApprovalMode.DEFAULT);
69
+ // Reset mocks and set default implementation for ensureCorrectEdit
70
+ mockEnsureCorrectEdit.mockReset();
71
+ mockEnsureCorrectEdit.mockImplementation(async (_, currentContent, params) => {
72
+ let occurrences = 0;
73
+ if (params.old_string && currentContent) {
74
+ // Simple string counting for the mock
75
+ let index = currentContent.indexOf(params.old_string);
76
+ while (index !== -1) {
77
+ occurrences++;
78
+ index = currentContent.indexOf(params.old_string, index + 1);
79
+ }
80
+ }
81
+ else if (params.old_string === '') {
82
+ occurrences = 0; // Creating a new file
83
+ }
84
+ return Promise.resolve({ params, occurrences });
85
+ });
86
+ // Default mock for generateJson to return the snippet unchanged
87
+ mockGenerateJson.mockReset();
88
+ mockGenerateJson.mockImplementation(async (contents, schema) => {
89
+ // The problematic_snippet is the last part of the user's content
90
+ const userContent = contents.find((c) => c.role === 'user');
91
+ let promptText = '';
92
+ if (userContent && userContent.parts) {
93
+ promptText = userContent.parts
94
+ .filter((p) => typeof p.text === 'string')
95
+ .map((p) => p.text)
96
+ .join('\n');
97
+ }
98
+ const snippetMatch = promptText.match(/Problematic target snippet:\n```\n([\s\S]*?)\n```/);
99
+ const problematicSnippet = snippetMatch && snippetMatch[1] ? snippetMatch[1] : '';
100
+ if (schema.properties?.corrected_target_snippet) {
101
+ return Promise.resolve({
102
+ corrected_target_snippet: problematicSnippet,
103
+ });
104
+ }
105
+ if (schema.properties?.corrected_new_string) {
106
+ // For new_string correction, we might need more sophisticated logic,
107
+ // but for now, returning original is a safe default if not specified by a test.
108
+ const originalNewStringMatch = promptText.match(/original_new_string \(what was intended to replace original_old_string\):\n```\n([\s\S]*?)\n```/);
109
+ const originalNewString = originalNewStringMatch && originalNewStringMatch[1]
110
+ ? originalNewStringMatch[1]
111
+ : '';
112
+ return Promise.resolve({ corrected_new_string: originalNewString });
113
+ }
114
+ return Promise.resolve({}); // Default empty object if schema doesn't match
115
+ });
116
+ tool = new EditTool(mockConfig);
117
+ });
118
+ afterEach(() => {
119
+ fs.rmSync(tempDir, { recursive: true, force: true });
120
+ });
121
+ describe('_applyReplacement', () => {
122
+ // Access private method for testing
123
+ // Note: `tool` is initialized in `beforeEach` of the parent describe block
124
+ it('should return newString if isNewFile is true', () => {
125
+ expect(tool._applyReplacement(null, 'old', 'new', true)).toBe('new');
126
+ expect(tool._applyReplacement('existing', 'old', 'new', true)).toBe('new');
127
+ });
128
+ it('should return newString if currentContent is null and oldString is empty (defensive)', () => {
129
+ expect(tool._applyReplacement(null, '', 'new', false)).toBe('new');
130
+ });
131
+ it('should return empty string if currentContent is null and oldString is not empty (defensive)', () => {
132
+ expect(tool._applyReplacement(null, 'old', 'new', false)).toBe('');
133
+ });
134
+ it('should replace oldString with newString in currentContent', () => {
135
+ expect(tool._applyReplacement('hello old world old', 'old', 'new', false)).toBe('hello new world new');
136
+ });
137
+ it('should return currentContent if oldString is empty and not a new file', () => {
138
+ expect(tool._applyReplacement('hello world', '', 'new', false)).toBe('hello world');
139
+ });
140
+ });
141
+ describe('validateToolParams', () => {
142
+ it('should return null for valid params', () => {
143
+ const params = {
144
+ file_path: path.join(rootDir, 'test.txt'),
145
+ old_string: 'old',
146
+ new_string: 'new',
147
+ };
148
+ expect(tool.validateToolParams(params)).toBeNull();
149
+ });
150
+ it('should return error for relative path', () => {
151
+ const params = {
152
+ file_path: 'test.txt',
153
+ old_string: 'old',
154
+ new_string: 'new',
155
+ };
156
+ expect(tool.validateToolParams(params)).toMatch(/File path must be absolute/);
157
+ });
158
+ it('should return error for path outside root', () => {
159
+ const params = {
160
+ file_path: path.join(tempDir, 'outside-root.txt'),
161
+ old_string: 'old',
162
+ new_string: 'new',
163
+ };
164
+ expect(tool.validateToolParams(params)).toMatch(/File path must be within the root directory/);
165
+ });
166
+ });
167
+ describe('shouldConfirmExecute', () => {
168
+ const testFile = 'edit_me.txt';
169
+ let filePath;
170
+ beforeEach(() => {
171
+ filePath = path.join(rootDir, testFile);
172
+ });
173
+ it('should return false if params are invalid', async () => {
174
+ const params = {
175
+ file_path: 'relative.txt',
176
+ old_string: 'old',
177
+ new_string: 'new',
178
+ };
179
+ expect(await tool.shouldConfirmExecute(params, new AbortController().signal)).toBe(false);
180
+ });
181
+ it('should request confirmation for valid edit', async () => {
182
+ fs.writeFileSync(filePath, 'some old content here');
183
+ const params = {
184
+ file_path: filePath,
185
+ old_string: 'old',
186
+ new_string: 'new',
187
+ };
188
+ // ensureCorrectEdit will be called by shouldConfirmExecute
189
+ mockEnsureCorrectEdit.mockResolvedValueOnce({ params, occurrences: 1 });
190
+ const confirmation = await tool.shouldConfirmExecute(params, new AbortController().signal);
191
+ expect(confirmation).toEqual(expect.objectContaining({
192
+ title: `Confirm Edit: ${testFile}`,
193
+ fileName: testFile,
194
+ fileDiff: expect.any(String),
195
+ }));
196
+ });
197
+ it('should return false if old_string is not found (ensureCorrectEdit returns 0)', async () => {
198
+ fs.writeFileSync(filePath, 'some content here');
199
+ const params = {
200
+ file_path: filePath,
201
+ old_string: 'not_found',
202
+ new_string: 'new',
203
+ };
204
+ mockEnsureCorrectEdit.mockResolvedValueOnce({ params, occurrences: 0 });
205
+ expect(await tool.shouldConfirmExecute(params, new AbortController().signal)).toBe(false);
206
+ });
207
+ it('should return false if multiple occurrences of old_string are found (ensureCorrectEdit returns > 1)', async () => {
208
+ fs.writeFileSync(filePath, 'old old content here');
209
+ const params = {
210
+ file_path: filePath,
211
+ old_string: 'old',
212
+ new_string: 'new',
213
+ };
214
+ mockEnsureCorrectEdit.mockResolvedValueOnce({ params, occurrences: 2 });
215
+ expect(await tool.shouldConfirmExecute(params, new AbortController().signal)).toBe(false);
216
+ });
217
+ it('should request confirmation for creating a new file (empty old_string)', async () => {
218
+ const newFileName = 'new_file.txt';
219
+ const newFilePath = path.join(rootDir, newFileName);
220
+ const params = {
221
+ file_path: newFilePath,
222
+ old_string: '',
223
+ new_string: 'new file content',
224
+ };
225
+ // ensureCorrectEdit might not be called if old_string is empty,
226
+ // as shouldConfirmExecute handles this for diff generation.
227
+ // If it is called, it should return 0 occurrences for a new file.
228
+ mockEnsureCorrectEdit.mockResolvedValueOnce({ params, occurrences: 0 });
229
+ const confirmation = await tool.shouldConfirmExecute(params, new AbortController().signal);
230
+ expect(confirmation).toEqual(expect.objectContaining({
231
+ title: `Confirm Edit: ${newFileName}`,
232
+ fileName: newFileName,
233
+ fileDiff: expect.any(String),
234
+ }));
235
+ });
236
+ it('should use corrected params from ensureCorrectEdit for diff generation', async () => {
237
+ const originalContent = 'This is the original string to be replaced.';
238
+ const originalOldString = 'original string';
239
+ const originalNewString = 'new string';
240
+ const correctedOldString = 'original string to be replaced'; // More specific
241
+ const correctedNewString = 'completely new string'; // Different replacement
242
+ const expectedFinalContent = 'This is the completely new string.';
243
+ fs.writeFileSync(filePath, originalContent);
244
+ const params = {
245
+ file_path: filePath,
246
+ old_string: originalOldString,
247
+ new_string: originalNewString,
248
+ };
249
+ // The main beforeEach already calls mockEnsureCorrectEdit.mockReset()
250
+ // Set a specific mock for this test case
251
+ let mockCalled = false;
252
+ mockEnsureCorrectEdit.mockImplementationOnce(async (_, content, p, client) => {
253
+ mockCalled = true;
254
+ expect(content).toBe(originalContent);
255
+ expect(p).toBe(params);
256
+ expect(client).toBe(geminiClient);
257
+ return {
258
+ params: {
259
+ file_path: filePath,
260
+ old_string: correctedOldString,
261
+ new_string: correctedNewString,
262
+ },
263
+ occurrences: 1,
264
+ };
265
+ });
266
+ const confirmation = (await tool.shouldConfirmExecute(params, new AbortController().signal));
267
+ expect(mockCalled).toBe(true); // Check if the mock implementation was run
268
+ // expect(mockEnsureCorrectEdit).toHaveBeenCalledWith(originalContent, params, expect.anything()); // Keep this commented for now
269
+ expect(confirmation).toEqual(expect.objectContaining({
270
+ title: `Confirm Edit: ${testFile}`,
271
+ fileName: testFile,
272
+ }));
273
+ // Check that the diff is based on the corrected strings leading to the new state
274
+ expect(confirmation.fileDiff).toContain(`-${originalContent}`);
275
+ expect(confirmation.fileDiff).toContain(`+${expectedFinalContent}`);
276
+ // Verify that applying the correctedOldString and correctedNewString to originalContent
277
+ // indeed produces the expectedFinalContent, which is what the diff should reflect.
278
+ const patchedContent = originalContent.replace(correctedOldString, // This was the string identified by ensureCorrectEdit for replacement
279
+ correctedNewString);
280
+ expect(patchedContent).toBe(expectedFinalContent);
281
+ });
282
+ });
283
+ describe('execute', () => {
284
+ const testFile = 'execute_me.txt';
285
+ let filePath;
286
+ beforeEach(() => {
287
+ filePath = path.join(rootDir, testFile);
288
+ // Default for execute tests, can be overridden
289
+ mockEnsureCorrectEdit.mockImplementation(async (_, content, params) => {
290
+ let occurrences = 0;
291
+ if (params.old_string && content) {
292
+ let index = content.indexOf(params.old_string);
293
+ while (index !== -1) {
294
+ occurrences++;
295
+ index = content.indexOf(params.old_string, index + 1);
296
+ }
297
+ }
298
+ else if (params.old_string === '') {
299
+ occurrences = 0;
300
+ }
301
+ return { params, occurrences };
302
+ });
303
+ });
304
+ it('should return error if params are invalid', async () => {
305
+ const params = {
306
+ file_path: 'relative.txt',
307
+ old_string: 'old',
308
+ new_string: 'new',
309
+ };
310
+ const result = await tool.execute(params, new AbortController().signal);
311
+ expect(result.llmContent).toMatch(/Error: Invalid parameters provided/);
312
+ expect(result.returnDisplay).toMatch(/Error: File path must be absolute/);
313
+ });
314
+ it('should edit an existing file and return diff with fileName', async () => {
315
+ const initialContent = 'This is some old text.';
316
+ const newContent = 'This is some new text.'; // old -> new
317
+ fs.writeFileSync(filePath, initialContent, 'utf8');
318
+ const params = {
319
+ file_path: filePath,
320
+ old_string: 'old',
321
+ new_string: 'new',
322
+ };
323
+ // Specific mock for this test's execution path in calculateEdit
324
+ // ensureCorrectEdit is NOT called by calculateEdit, only by shouldConfirmExecute
325
+ // So, the default mockEnsureCorrectEdit should correctly return 1 occurrence for 'old' in initialContent
326
+ // Simulate confirmation by setting shouldAlwaysEdit
327
+ tool.shouldAlwaysEdit = true;
328
+ const result = await tool.execute(params, new AbortController().signal);
329
+ tool.shouldAlwaysEdit = false; // Reset for other tests
330
+ expect(result.llmContent).toMatch(/Successfully modified file/);
331
+ expect(fs.readFileSync(filePath, 'utf8')).toBe(newContent);
332
+ const display = result.returnDisplay;
333
+ expect(display.fileDiff).toMatch(initialContent);
334
+ expect(display.fileDiff).toMatch(newContent);
335
+ expect(display.fileName).toBe(testFile);
336
+ });
337
+ it('should create a new file if old_string is empty and file does not exist, and return created message', async () => {
338
+ const newFileName = 'brand_new_file.txt';
339
+ const newFilePath = path.join(rootDir, newFileName);
340
+ const fileContent = 'Content for the new file.';
341
+ const params = {
342
+ file_path: newFilePath,
343
+ old_string: '',
344
+ new_string: fileContent,
345
+ };
346
+ mockConfig.getApprovalMode.mockReturnValueOnce(ApprovalMode.AUTO_EDIT);
347
+ const result = await tool.execute(params, new AbortController().signal);
348
+ expect(result.llmContent).toMatch(/Created new file/);
349
+ expect(fs.existsSync(newFilePath)).toBe(true);
350
+ expect(fs.readFileSync(newFilePath, 'utf8')).toBe(fileContent);
351
+ expect(result.returnDisplay).toBe(`Created ${newFileName}`);
352
+ });
353
+ it('should return error if old_string is not found in file', async () => {
354
+ fs.writeFileSync(filePath, 'Some content.', 'utf8');
355
+ const params = {
356
+ file_path: filePath,
357
+ old_string: 'nonexistent',
358
+ new_string: 'replacement',
359
+ };
360
+ // The default mockEnsureCorrectEdit will return 0 occurrences for 'nonexistent'
361
+ const result = await tool.execute(params, new AbortController().signal);
362
+ expect(result.llmContent).toMatch(/0 occurrences found for old_string in/);
363
+ expect(result.returnDisplay).toMatch(/Failed to edit, could not find the string to replace./);
364
+ });
365
+ it('should return error if multiple occurrences of old_string are found', async () => {
366
+ fs.writeFileSync(filePath, 'multiple old old strings', 'utf8');
367
+ const params = {
368
+ file_path: filePath,
369
+ old_string: 'old',
370
+ new_string: 'new',
371
+ };
372
+ // The default mockEnsureCorrectEdit will return 2 occurrences for 'old'
373
+ const result = await tool.execute(params, new AbortController().signal);
374
+ expect(result.llmContent).toMatch(/Expected 1 occurrence but found 2 for old_string in file/);
375
+ expect(result.returnDisplay).toMatch(/Failed to edit, expected 1 occurrence but found 2/);
376
+ });
377
+ it('should successfully replace multiple occurrences when expected_replacements specified', async () => {
378
+ fs.writeFileSync(filePath, 'old text old text old text', 'utf8');
379
+ const params = {
380
+ file_path: filePath,
381
+ old_string: 'old',
382
+ new_string: 'new',
383
+ expected_replacements: 3,
384
+ };
385
+ // Simulate confirmation by setting shouldAlwaysEdit
386
+ tool.shouldAlwaysEdit = true;
387
+ const result = await tool.execute(params, new AbortController().signal);
388
+ tool.shouldAlwaysEdit = false; // Reset for other tests
389
+ expect(result.llmContent).toMatch(/Successfully modified file/);
390
+ expect(fs.readFileSync(filePath, 'utf8')).toBe('new text new text new text');
391
+ const display = result.returnDisplay;
392
+ expect(display.fileDiff).toMatch(/old text old text old text/);
393
+ expect(display.fileDiff).toMatch(/new text new text new text/);
394
+ expect(display.fileName).toBe(testFile);
395
+ });
396
+ it('should return error if expected_replacements does not match actual occurrences', async () => {
397
+ fs.writeFileSync(filePath, 'old text old text', 'utf8');
398
+ const params = {
399
+ file_path: filePath,
400
+ old_string: 'old',
401
+ new_string: 'new',
402
+ expected_replacements: 3, // Expecting 3 but only 2 exist
403
+ };
404
+ const result = await tool.execute(params, new AbortController().signal);
405
+ expect(result.llmContent).toMatch(/Expected 3 occurrences but found 2 for old_string in file/);
406
+ expect(result.returnDisplay).toMatch(/Failed to edit, expected 3 occurrences but found 2/);
407
+ });
408
+ it('should return error if trying to create a file that already exists (empty old_string)', async () => {
409
+ fs.writeFileSync(filePath, 'Existing content', 'utf8');
410
+ const params = {
411
+ file_path: filePath,
412
+ old_string: '',
413
+ new_string: 'new content',
414
+ };
415
+ const result = await tool.execute(params, new AbortController().signal);
416
+ expect(result.llmContent).toMatch(/File already exists, cannot create/);
417
+ expect(result.returnDisplay).toMatch(/Attempted to create a file that already exists/);
418
+ });
419
+ it('should include modification message when proposed content is modified', async () => {
420
+ const initialContent = 'This is some old text.';
421
+ fs.writeFileSync(filePath, initialContent, 'utf8');
422
+ const params = {
423
+ file_path: filePath,
424
+ old_string: 'old',
425
+ new_string: 'new',
426
+ modified_by_user: true,
427
+ };
428
+ mockConfig.getApprovalMode.mockReturnValueOnce(ApprovalMode.AUTO_EDIT);
429
+ const result = await tool.execute(params, new AbortController().signal);
430
+ expect(result.llmContent).toMatch(/User modified the `new_string` content/);
431
+ });
432
+ it('should not include modification message when proposed content is not modified', async () => {
433
+ const initialContent = 'This is some old text.';
434
+ fs.writeFileSync(filePath, initialContent, 'utf8');
435
+ const params = {
436
+ file_path: filePath,
437
+ old_string: 'old',
438
+ new_string: 'new',
439
+ modified_by_user: false,
440
+ };
441
+ mockConfig.getApprovalMode.mockReturnValueOnce(ApprovalMode.AUTO_EDIT);
442
+ const result = await tool.execute(params, new AbortController().signal);
443
+ expect(result.llmContent).not.toMatch(/User modified the `new_string` content/);
444
+ });
445
+ it('should not include modification message when modified_by_user is not provided', async () => {
446
+ const initialContent = 'This is some old text.';
447
+ fs.writeFileSync(filePath, initialContent, 'utf8');
448
+ const params = {
449
+ file_path: filePath,
450
+ old_string: 'old',
451
+ new_string: 'new',
452
+ };
453
+ mockConfig.getApprovalMode.mockReturnValueOnce(ApprovalMode.AUTO_EDIT);
454
+ const result = await tool.execute(params, new AbortController().signal);
455
+ expect(result.llmContent).not.toMatch(/User modified the `new_string` content/);
456
+ });
457
+ });
458
+ describe('getDescription', () => {
459
+ it('should return "No file changes to..." if old_string and new_string are the same', () => {
460
+ const testFileName = 'test.txt';
461
+ const params = {
462
+ file_path: path.join(rootDir, testFileName),
463
+ old_string: 'identical_string',
464
+ new_string: 'identical_string',
465
+ };
466
+ // shortenPath will be called internally, resulting in just the file name
467
+ expect(tool.getDescription(params)).toBe(`No file changes to ${testFileName}`);
468
+ });
469
+ it('should return a snippet of old and new strings if they are different', () => {
470
+ const testFileName = 'test.txt';
471
+ const params = {
472
+ file_path: path.join(rootDir, testFileName),
473
+ old_string: 'this is the old string value',
474
+ new_string: 'this is the new string value',
475
+ };
476
+ // shortenPath will be called internally, resulting in just the file name
477
+ // The snippets are truncated at 30 chars + '...'
478
+ expect(tool.getDescription(params)).toBe(`${testFileName}: this is the old string value => this is the new string value`);
479
+ });
480
+ it('should handle very short strings correctly in the description', () => {
481
+ const testFileName = 'short.txt';
482
+ const params = {
483
+ file_path: path.join(rootDir, testFileName),
484
+ old_string: 'old',
485
+ new_string: 'new',
486
+ };
487
+ expect(tool.getDescription(params)).toBe(`${testFileName}: old => new`);
488
+ });
489
+ it('should truncate long strings in the description', () => {
490
+ const testFileName = 'long.txt';
491
+ const params = {
492
+ file_path: path.join(rootDir, testFileName),
493
+ old_string: 'this is a very long old string that will definitely be truncated',
494
+ new_string: 'this is a very long new string that will also be truncated',
495
+ };
496
+ expect(tool.getDescription(params)).toBe(`${testFileName}: this is a very long old string... => this is a very long new string...`);
497
+ });
498
+ });
499
+ });
500
+ //# sourceMappingURL=edit.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.test.js","sourceRoot":"","sources":["../../../src/tools/edit.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AAEvD,MAAM,qBAAqB,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACxD,MAAM,gBAAgB,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACnD,MAAM,YAAY,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAE/C,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1C,iBAAiB,EAAE,qBAAqB;CACzC,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;IAClC,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC9C,YAAY,EAAE,gBAAgB;KAC/B,CAAC,CAAC;CACJ,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,G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,MAAM,YAAY,GAAG,WAAW,CAAC;YACjC,MAAM,MAAM,GAAmB;gBAC7B,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC;gBAC3C,UAAU,EAAE,KAAK;gBACjB,UAAU,EAAE,KAAK;aAClB,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,YAAY,cAAc,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,YAAY,GAAG,UAAU,CAAC;YAChC,MAAM,MAAM,GAAmB;gBAC7B,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC;gBAC3C,UAAU,EACR,kEAAkE;gBACpE,UAAU,EACR,4DAA4D;aAC/D,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CACtC,GAAG,YAAY,0EAA0E,CAC1F,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { BaseTool, ToolResult } from './tools.js';
7
+ import { Config } from '../config/config.js';
8
+ export interface GlobPath {
9
+ fullpath(): string;
10
+ mtimeMs?: number;
11
+ }
12
+ /**
13
+ * Sorts file entries based on recency and then alphabetically.
14
+ * Recent files (modified within recencyThresholdMs) are listed first, newest to oldest.
15
+ * Older files are listed after recent ones, sorted alphabetically by path.
16
+ */
17
+ export declare function sortFileEntries(entries: GlobPath[], nowTimestamp: number, recencyThresholdMs: number): GlobPath[];
18
+ /**
19
+ * Parameters for the GlobTool
20
+ */
21
+ export interface GlobToolParams {
22
+ /**
23
+ * The glob pattern to match files against
24
+ */
25
+ pattern: string;
26
+ /**
27
+ * The directory to search in (optional, defaults to current directory)
28
+ */
29
+ path?: string;
30
+ /**
31
+ * Whether the search should be case-sensitive (optional, defaults to false)
32
+ */
33
+ case_sensitive?: boolean;
34
+ /**
35
+ * Whether to respect .gitignore patterns (optional, defaults to true)
36
+ */
37
+ respect_git_ignore?: boolean;
38
+ }
39
+ /**
40
+ * Implementation of the Glob tool logic
41
+ */
42
+ export declare class GlobTool extends BaseTool<GlobToolParams, ToolResult> {
43
+ private config;
44
+ static readonly Name = "glob";
45
+ constructor(config: Config);
46
+ /**
47
+ * Validates the parameters for the tool.
48
+ */
49
+ validateToolParams(params: GlobToolParams): string | null;
50
+ /**
51
+ * Gets a description of the glob operation.
52
+ */
53
+ getDescription(params: GlobToolParams): string;
54
+ /**
55
+ * Executes the glob search with the given parameters
56
+ */
57
+ execute(params: GlobToolParams, signal: AbortSignal): Promise<ToolResult>;
58
+ }