@machina.ai/cell-cli-core 1.0.13-rc9 → 1.0.21-rc1

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 (484) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.js +3 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +12 -4
  5. package/dist/src/code_assist/converter.d.ts +6 -3
  6. package/dist/src/code_assist/converter.js +4 -2
  7. package/dist/src/code_assist/converter.js.map +1 -1
  8. package/dist/src/code_assist/converter.test.js +61 -11
  9. package/dist/src/code_assist/converter.test.js.map +1 -1
  10. package/dist/src/code_assist/oauth2.d.ts +1 -0
  11. package/dist/src/code_assist/oauth2.js +43 -18
  12. package/dist/src/code_assist/oauth2.js.map +1 -1
  13. package/dist/src/code_assist/oauth2.test.js +142 -9
  14. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  15. package/dist/src/code_assist/server.d.ts +2 -2
  16. package/dist/src/code_assist/server.js +5 -5
  17. package/dist/src/code_assist/server.js.map +1 -1
  18. package/dist/src/code_assist/server.test.js +13 -10
  19. package/dist/src/code_assist/server.test.js.map +1 -1
  20. package/dist/src/code_assist/setup.js +49 -18
  21. package/dist/src/code_assist/setup.js.map +1 -1
  22. package/dist/src/code_assist/setup.test.js +115 -9
  23. package/dist/src/code_assist/setup.test.js.map +1 -1
  24. package/dist/src/config/config.d.ts +71 -13
  25. package/dist/src/config/config.js +154 -41
  26. package/dist/src/config/config.js.map +1 -1
  27. package/dist/src/config/config.test.js +206 -21
  28. package/dist/src/config/config.test.js.map +1 -1
  29. package/dist/src/config/flashFallback.test.js +19 -47
  30. package/dist/src/config/flashFallback.test.js.map +1 -1
  31. package/dist/src/config/models.d.ts +1 -0
  32. package/dist/src/config/models.js +1 -0
  33. package/dist/src/config/models.js.map +1 -1
  34. package/dist/src/core/client.d.ts +15 -16
  35. package/dist/src/core/client.js +247 -104
  36. package/dist/src/core/client.js.map +1 -1
  37. package/dist/src/core/client.test.js +798 -49
  38. package/dist/src/core/client.test.js.map +1 -1
  39. package/dist/src/core/contentGenerator.d.ts +2 -2
  40. package/dist/src/core/contentGenerator.js +23 -21
  41. package/dist/src/core/contentGenerator.js.map +1 -1
  42. package/dist/src/core/contentGenerator.test.js +30 -126
  43. package/dist/src/core/contentGenerator.test.js.map +1 -1
  44. package/dist/src/core/coreToolScheduler.d.ts +23 -10
  45. package/dist/src/core/coreToolScheduler.js +201 -77
  46. package/dist/src/core/coreToolScheduler.js.map +1 -1
  47. package/dist/src/core/coreToolScheduler.test.js +322 -94
  48. package/dist/src/core/coreToolScheduler.test.js.map +1 -1
  49. package/dist/src/core/geminiChat.d.ts +8 -6
  50. package/dist/src/core/geminiChat.js +49 -51
  51. package/dist/src/core/geminiChat.js.map +1 -1
  52. package/dist/src/core/geminiChat.test.js +2 -2
  53. package/dist/src/core/geminiChat.test.js.map +1 -1
  54. package/dist/src/core/geminiRequest.js +2 -37
  55. package/dist/src/core/geminiRequest.js.map +1 -1
  56. package/dist/src/core/logger.d.ts +24 -1
  57. package/dist/src/core/logger.js +128 -4
  58. package/dist/src/core/logger.js.map +1 -1
  59. package/dist/src/core/logger.test.js +157 -11
  60. package/dist/src/core/logger.test.js.map +1 -1
  61. package/dist/src/core/loggingContentGenerator.d.ts +25 -0
  62. package/dist/src/core/loggingContentGenerator.js +95 -0
  63. package/dist/src/core/loggingContentGenerator.js.map +1 -0
  64. package/dist/src/core/nonInteractiveToolExecutor.js +39 -4
  65. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
  66. package/dist/src/core/nonInteractiveToolExecutor.test.js +85 -62
  67. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
  68. package/dist/src/core/prompts.js +43 -19
  69. package/dist/src/core/prompts.js.map +1 -1
  70. package/dist/src/core/prompts.test.js +118 -1
  71. package/dist/src/core/prompts.test.js.map +1 -1
  72. package/dist/src/core/subagent.d.ts +230 -0
  73. package/dist/src/core/subagent.js +447 -0
  74. package/dist/src/core/subagent.js.map +1 -0
  75. package/dist/src/core/subagent.test.js +515 -0
  76. package/dist/src/core/subagent.test.js.map +1 -0
  77. package/dist/src/core/tokenLimits.js +1 -0
  78. package/dist/src/core/tokenLimits.js.map +1 -1
  79. package/dist/src/core/turn.d.ts +3 -0
  80. package/dist/src/core/turn.js +4 -0
  81. package/dist/src/core/turn.js.map +1 -1
  82. package/dist/src/core/turn.test.js +4 -0
  83. package/dist/src/core/turn.test.js.map +1 -1
  84. package/dist/src/generated/git-commit.d.ts +7 -0
  85. package/dist/src/generated/git-commit.js +10 -0
  86. package/dist/src/generated/git-commit.js.map +1 -0
  87. package/dist/src/ide/constants.d.ts +6 -0
  88. package/dist/src/ide/constants.js +7 -0
  89. package/dist/src/ide/constants.js.map +1 -0
  90. package/dist/src/ide/detect-ide.d.ts +20 -0
  91. package/dist/src/ide/detect-ide.js +86 -0
  92. package/dist/src/ide/detect-ide.js.map +1 -0
  93. package/dist/src/ide/detect-ide.test.js +65 -0
  94. package/dist/src/ide/detect-ide.test.js.map +1 -0
  95. package/dist/src/ide/ide-client.d.ts +63 -0
  96. package/dist/src/ide/ide-client.js +320 -0
  97. package/dist/src/ide/ide-client.js.map +1 -0
  98. package/dist/src/ide/ide-client.test.d.ts +6 -0
  99. package/dist/src/ide/ide-client.test.js +43 -0
  100. package/dist/src/ide/ide-client.test.js.map +1 -0
  101. package/dist/src/ide/ide-installer.d.ts +14 -0
  102. package/dist/src/ide/ide-installer.js +98 -0
  103. package/dist/src/ide/ide-installer.js.map +1 -0
  104. package/dist/src/ide/ide-installer.test.d.ts +6 -0
  105. package/dist/src/ide/ide-installer.test.js +53 -0
  106. package/dist/src/ide/ide-installer.test.js.map +1 -0
  107. package/dist/src/ide/ideContext.d.ts +374 -0
  108. package/dist/src/ide/ideContext.js +147 -0
  109. package/dist/src/ide/ideContext.js.map +1 -0
  110. package/dist/src/ide/ideContext.test.d.ts +6 -0
  111. package/dist/src/ide/ideContext.test.js +265 -0
  112. package/dist/src/ide/ideContext.test.js.map +1 -0
  113. package/dist/src/ide/process-utils.d.ts +14 -0
  114. package/dist/src/ide/process-utils.js +57 -0
  115. package/dist/src/ide/process-utils.js.map +1 -0
  116. package/dist/src/index.d.ts +17 -1
  117. package/dist/src/index.js +20 -1
  118. package/dist/src/index.js.map +1 -1
  119. package/dist/src/mcp/google-auth-provider.d.ts +23 -0
  120. package/dist/src/mcp/google-auth-provider.js +72 -0
  121. package/dist/src/mcp/google-auth-provider.js.map +1 -0
  122. package/dist/src/mcp/google-auth-provider.test.d.ts +6 -0
  123. package/dist/src/mcp/google-auth-provider.test.js +89 -0
  124. package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
  125. package/dist/src/mcp/oauth-provider.d.ts +6 -2
  126. package/dist/src/mcp/oauth-provider.js +208 -53
  127. package/dist/src/mcp/oauth-provider.js.map +1 -1
  128. package/dist/src/mcp/oauth-provider.test.js +222 -70
  129. package/dist/src/mcp/oauth-provider.test.js.map +1 -1
  130. package/dist/src/mcp/oauth-token-storage.d.ts +3 -1
  131. package/dist/src/mcp/oauth-token-storage.js +3 -1
  132. package/dist/src/mcp/oauth-token-storage.js.map +1 -1
  133. package/dist/src/mcp/oauth-utils.d.ts +3 -1
  134. package/dist/src/mcp/oauth-utils.js +52 -14
  135. package/dist/src/mcp/oauth-utils.js.map +1 -1
  136. package/dist/src/mcp/oauth-utils.test.js +18 -3
  137. package/dist/src/mcp/oauth-utils.test.js.map +1 -1
  138. package/dist/src/mocks/msw.d.ts +6 -0
  139. package/dist/src/mocks/msw.js +8 -0
  140. package/dist/src/mocks/msw.js.map +1 -0
  141. package/dist/src/prompts/mcp-prompts.d.ts +8 -0
  142. package/dist/src/prompts/mcp-prompts.js +13 -0
  143. package/dist/src/prompts/mcp-prompts.js.map +1 -0
  144. package/dist/src/prompts/prompt-registry.d.ts +34 -0
  145. package/dist/src/prompts/prompt-registry.js +63 -0
  146. package/dist/src/prompts/prompt-registry.js.map +1 -0
  147. package/dist/src/services/chatRecordingService.d.ts +150 -0
  148. package/dist/src/services/chatRecordingService.js +318 -0
  149. package/dist/src/services/chatRecordingService.js.map +1 -0
  150. package/dist/src/services/chatRecordingService.test.d.ts +6 -0
  151. package/dist/src/services/chatRecordingService.test.js +288 -0
  152. package/dist/src/services/chatRecordingService.test.js.map +1 -0
  153. package/dist/src/services/fileDiscoveryService.test.js +101 -60
  154. package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
  155. package/dist/src/services/fileSystemService.d.ts +31 -0
  156. package/dist/src/services/fileSystemService.js +18 -0
  157. package/dist/src/services/fileSystemService.js.map +1 -0
  158. package/dist/src/services/fileSystemService.test.d.ts +6 -0
  159. package/dist/src/services/fileSystemService.test.js +41 -0
  160. package/dist/src/services/fileSystemService.test.js.map +1 -0
  161. package/dist/src/services/gitService.test.js +67 -86
  162. package/dist/src/services/gitService.test.js.map +1 -1
  163. package/dist/src/services/loopDetectionService.d.ts +51 -5
  164. package/dist/src/services/loopDetectionService.js +152 -45
  165. package/dist/src/services/loopDetectionService.js.map +1 -1
  166. package/dist/src/services/loopDetectionService.test.js +286 -89
  167. package/dist/src/services/loopDetectionService.test.js.map +1 -1
  168. package/dist/src/services/shellExecutionService.d.ts +70 -0
  169. package/dist/src/services/shellExecutionService.js +175 -0
  170. package/dist/src/services/shellExecutionService.js.map +1 -0
  171. package/dist/src/services/shellExecutionService.test.d.ts +6 -0
  172. package/dist/src/services/shellExecutionService.test.js +282 -0
  173. package/dist/src/services/shellExecutionService.test.js.map +1 -0
  174. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +81 -9
  175. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +356 -182
  176. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  177. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +17 -0
  178. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +342 -0
  179. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -0
  180. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +19 -2
  181. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +51 -9
  182. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  183. package/dist/src/telemetry/constants.d.ts +4 -0
  184. package/dist/src/telemetry/constants.js +4 -0
  185. package/dist/src/telemetry/constants.js.map +1 -1
  186. package/dist/src/telemetry/file-exporters.d.ts +28 -0
  187. package/dist/src/telemetry/file-exporters.js +62 -0
  188. package/dist/src/telemetry/file-exporters.js.map +1 -0
  189. package/dist/src/telemetry/index.d.ts +2 -2
  190. package/dist/src/telemetry/index.js +2 -2
  191. package/dist/src/telemetry/index.js.map +1 -1
  192. package/dist/src/telemetry/integration.test.circular.js +1 -0
  193. package/dist/src/telemetry/integration.test.circular.js.map +1 -1
  194. package/dist/src/telemetry/loggers.d.ts +6 -1
  195. package/dist/src/telemetry/loggers.js +87 -6
  196. package/dist/src/telemetry/loggers.js.map +1 -1
  197. package/dist/src/telemetry/loggers.test.circular.js +9 -2
  198. package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
  199. package/dist/src/telemetry/loggers.test.js +51 -11
  200. package/dist/src/telemetry/loggers.test.js.map +1 -1
  201. package/dist/src/telemetry/metrics.d.ts +7 -2
  202. package/dist/src/telemetry/metrics.js +26 -6
  203. package/dist/src/telemetry/metrics.js.map +1 -1
  204. package/dist/src/telemetry/metrics.test.js +81 -1
  205. package/dist/src/telemetry/metrics.test.js.map +1 -1
  206. package/dist/src/telemetry/sdk.d.ts +1 -1
  207. package/dist/src/telemetry/sdk.js +77 -30
  208. package/dist/src/telemetry/sdk.js.map +1 -1
  209. package/dist/src/telemetry/sdk.test.d.ts +6 -0
  210. package/dist/src/telemetry/sdk.test.js +82 -0
  211. package/dist/src/telemetry/sdk.test.js.map +1 -0
  212. package/dist/src/telemetry/telemetry.test.js +2 -2
  213. package/dist/src/telemetry/telemetry.test.js.map +1 -1
  214. package/dist/src/telemetry/tool-call-decision.d.ts +13 -0
  215. package/dist/src/telemetry/tool-call-decision.js +29 -0
  216. package/dist/src/telemetry/tool-call-decision.js.map +1 -0
  217. package/dist/src/telemetry/types.d.ts +74 -18
  218. package/dist/src/telemetry/types.js +110 -32
  219. package/dist/src/telemetry/types.js.map +1 -1
  220. package/dist/src/telemetry/uiTelemetry.d.ts +8 -1
  221. package/dist/src/telemetry/uiTelemetry.js +17 -2
  222. package/dist/src/telemetry/uiTelemetry.js.map +1 -1
  223. package/dist/src/telemetry/uiTelemetry.test.js +60 -10
  224. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
  225. package/dist/src/test-utils/config.d.ts +16 -0
  226. package/dist/src/test-utils/config.js +32 -0
  227. package/dist/src/test-utils/config.js.map +1 -0
  228. package/dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
  229. package/dist/src/test-utils/mockWorkspaceContext.js +24 -0
  230. package/dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
  231. package/dist/src/test-utils/tools.d.ts +44 -0
  232. package/dist/src/test-utils/tools.js +105 -0
  233. package/dist/src/test-utils/tools.js.map +1 -0
  234. package/dist/src/tools/diffOptions.d.ts +2 -0
  235. package/dist/src/tools/diffOptions.js +28 -0
  236. package/dist/src/tools/diffOptions.js.map +1 -1
  237. package/dist/src/tools/diffOptions.test.d.ts +6 -0
  238. package/dist/src/tools/diffOptions.test.js +119 -0
  239. package/dist/src/tools/diffOptions.test.js.map +1 -0
  240. package/dist/src/tools/edit.d.ts +10 -34
  241. package/dist/src/tools/edit.js +171 -131
  242. package/dist/src/tools/edit.js.map +1 -1
  243. package/dist/src/tools/edit.test.js +220 -43
  244. package/dist/src/tools/edit.test.js.map +1 -1
  245. package/dist/src/tools/glob.d.ts +4 -11
  246. package/dist/src/tools/glob.js +129 -97
  247. package/dist/src/tools/glob.js.map +1 -1
  248. package/dist/src/tools/glob.test.js +73 -17
  249. package/dist/src/tools/glob.test.js.map +1 -1
  250. package/dist/src/tools/grep.d.ts +5 -37
  251. package/dist/src/tools/grep.js +175 -100
  252. package/dist/src/tools/grep.js.map +1 -1
  253. package/dist/src/tools/grep.test.js +112 -28
  254. package/dist/src/tools/grep.test.js.map +1 -1
  255. package/dist/src/tools/ls.d.ts +4 -23
  256. package/dist/src/tools/ls.js +77 -78
  257. package/dist/src/tools/ls.js.map +1 -1
  258. package/dist/src/tools/ls.test.d.ts +6 -0
  259. package/dist/src/tools/ls.test.js +384 -0
  260. package/dist/src/tools/ls.test.js.map +1 -0
  261. package/dist/src/tools/mcp-client-manager.d.ts +38 -0
  262. package/dist/src/tools/mcp-client-manager.js +74 -0
  263. package/dist/src/tools/mcp-client-manager.js.map +1 -0
  264. package/dist/src/tools/mcp-client-manager.test.d.ts +6 -0
  265. package/dist/src/tools/mcp-client-manager.test.js +39 -0
  266. package/dist/src/tools/mcp-client-manager.test.js.map +1 -0
  267. package/dist/src/tools/mcp-client.d.ts +86 -4
  268. package/dist/src/tools/mcp-client.js +730 -59
  269. package/dist/src/tools/mcp-client.js.map +1 -1
  270. package/dist/src/tools/mcp-client.test.js +295 -22
  271. package/dist/src/tools/mcp-client.test.js.map +1 -1
  272. package/dist/src/tools/mcp-tool.d.ts +6 -13
  273. package/dist/src/tools/mcp-tool.js +163 -76
  274. package/dist/src/tools/mcp-tool.js.map +1 -1
  275. package/dist/src/tools/mcp-tool.test.js +400 -29
  276. package/dist/src/tools/mcp-tool.test.js.map +1 -1
  277. package/dist/src/tools/memoryTool.d.ts +14 -3
  278. package/dist/src/tools/memoryTool.js +159 -40
  279. package/dist/src/tools/memoryTool.js.map +1 -1
  280. package/dist/src/tools/memoryTool.test.js +116 -11
  281. package/dist/src/tools/memoryTool.test.js.map +1 -1
  282. package/dist/src/tools/modifiable-tool.d.ts +9 -6
  283. package/dist/src/tools/modifiable-tool.js +6 -3
  284. package/dist/src/tools/modifiable-tool.js.map +1 -1
  285. package/dist/src/tools/modifiable-tool.test.js +63 -74
  286. package/dist/src/tools/modifiable-tool.test.js.map +1 -1
  287. package/dist/src/tools/read-file.d.ts +4 -6
  288. package/dist/src/tools/read-file.js +100 -53
  289. package/dist/src/tools/read-file.js.map +1 -1
  290. package/dist/src/tools/read-file.test.js +238 -111
  291. package/dist/src/tools/read-file.test.js.map +1 -1
  292. package/dist/src/tools/read-many-files.d.ts +3 -6
  293. package/dist/src/tools/read-many-files.js +232 -157
  294. package/dist/src/tools/read-many-files.js.map +1 -1
  295. package/dist/src/tools/read-many-files.test.js +231 -34
  296. package/dist/src/tools/read-many-files.test.js.map +1 -1
  297. package/dist/src/tools/shell.d.ts +6 -28
  298. package/dist/src/tools/shell.js +249 -366
  299. package/dist/src/tools/shell.js.map +1 -1
  300. package/dist/src/tools/shell.test.js +305 -384
  301. package/dist/src/tools/shell.test.js.map +1 -1
  302. package/dist/src/tools/tool-error.d.ts +27 -0
  303. package/dist/src/tools/tool-error.js +32 -0
  304. package/dist/src/tools/tool-error.js.map +1 -0
  305. package/dist/src/tools/tool-registry.d.ts +38 -23
  306. package/dist/src/tools/tool-registry.js +127 -99
  307. package/dist/src/tools/tool-registry.js.map +1 -1
  308. package/dist/src/tools/tool-registry.test.js +37 -212
  309. package/dist/src/tools/tool-registry.test.js.map +1 -1
  310. package/dist/src/tools/tools.d.ts +145 -92
  311. package/dist/src/tools/tools.js +188 -61
  312. package/dist/src/tools/tools.js.map +1 -1
  313. package/dist/src/tools/tools.test.d.ts +6 -0
  314. package/dist/src/tools/tools.test.js +206 -0
  315. package/dist/src/tools/tools.test.js.map +1 -0
  316. package/dist/src/tools/web-fetch.d.ts +4 -7
  317. package/dist/src/tools/web-fetch.js +58 -64
  318. package/dist/src/tools/web-fetch.js.map +1 -1
  319. package/dist/src/tools/web-fetch.test.js +8 -4
  320. package/dist/src/tools/web-fetch.test.js.map +1 -1
  321. package/dist/src/tools/web-search.d.ts +4 -5
  322. package/dist/src/tools/web-search.js +47 -51
  323. package/dist/src/tools/web-search.js.map +1 -1
  324. package/dist/src/tools/web-search.test.d.ts +6 -0
  325. package/dist/src/tools/web-search.test.js +139 -0
  326. package/dist/src/tools/web-search.test.js.map +1 -0
  327. package/dist/src/tools/write-file.d.ts +20 -11
  328. package/dist/src/tools/write-file.js +198 -141
  329. package/dist/src/tools/write-file.js.map +1 -1
  330. package/dist/src/tools/write-file.test.js +190 -76
  331. package/dist/src/tools/write-file.test.js.map +1 -1
  332. package/dist/src/utils/bfsFileSearch.js +51 -27
  333. package/dist/src/utils/bfsFileSearch.js.map +1 -1
  334. package/dist/src/utils/bfsFileSearch.test.js +137 -136
  335. package/dist/src/utils/bfsFileSearch.test.js.map +1 -1
  336. package/dist/src/utils/browser.js +4 -3
  337. package/dist/src/utils/browser.js.map +1 -1
  338. package/dist/src/utils/editCorrector.js +23 -24
  339. package/dist/src/utils/editCorrector.js.map +1 -1
  340. package/dist/src/utils/editor.d.ts +2 -2
  341. package/dist/src/utils/editor.js +23 -6
  342. package/dist/src/utils/editor.js.map +1 -1
  343. package/dist/src/utils/editor.test.js +67 -15
  344. package/dist/src/utils/editor.test.js.map +1 -1
  345. package/dist/src/utils/environmentContext.d.ts +21 -0
  346. package/dist/src/utils/environmentContext.js +90 -0
  347. package/dist/src/utils/environmentContext.js.map +1 -0
  348. package/dist/src/utils/environmentContext.test.d.ts +6 -0
  349. package/dist/src/utils/environmentContext.test.js +140 -0
  350. package/dist/src/utils/environmentContext.test.js.map +1 -0
  351. package/dist/src/utils/errorParsing.d.ts +8 -0
  352. package/dist/src/utils/errorParsing.js +93 -0
  353. package/dist/src/utils/errorParsing.js.map +1 -0
  354. package/dist/src/utils/errorParsing.test.d.ts +6 -0
  355. package/dist/src/utils/errorParsing.test.js +172 -0
  356. package/dist/src/utils/errorParsing.test.js.map +1 -0
  357. package/dist/src/utils/errorReporting.d.ts +1 -1
  358. package/dist/src/utils/errorReporting.js +2 -2
  359. package/dist/src/utils/errorReporting.js.map +1 -1
  360. package/dist/src/utils/errorReporting.test.js +44 -38
  361. package/dist/src/utils/errorReporting.test.js.map +1 -1
  362. package/dist/src/utils/fileUtils.d.ts +9 -1
  363. package/dist/src/utils/fileUtils.js +27 -13
  364. package/dist/src/utils/fileUtils.js.map +1 -1
  365. package/dist/src/utils/fileUtils.test.js +61 -18
  366. package/dist/src/utils/fileUtils.test.js.map +1 -1
  367. package/dist/src/utils/filesearch/crawlCache.d.ts +25 -0
  368. package/dist/src/utils/filesearch/crawlCache.js +57 -0
  369. package/dist/src/utils/filesearch/crawlCache.js.map +1 -0
  370. package/dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
  371. package/dist/src/utils/filesearch/crawlCache.test.js +103 -0
  372. package/dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
  373. package/dist/src/utils/filesearch/crawler.d.ts +15 -0
  374. package/dist/src/utils/filesearch/crawler.js +50 -0
  375. package/dist/src/utils/filesearch/crawler.js.map +1 -0
  376. package/dist/src/utils/filesearch/crawler.test.d.ts +6 -0
  377. package/dist/src/utils/filesearch/crawler.test.js +468 -0
  378. package/dist/src/utils/filesearch/crawler.test.js.map +1 -0
  379. package/dist/src/utils/filesearch/fileSearch.d.ts +37 -0
  380. package/dist/src/utils/filesearch/fileSearch.js +186 -0
  381. package/dist/src/utils/filesearch/fileSearch.js.map +1 -0
  382. package/dist/src/utils/filesearch/fileSearch.test.d.ts +6 -0
  383. package/dist/src/utils/filesearch/fileSearch.test.js +552 -0
  384. package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
  385. package/dist/src/utils/filesearch/ignore.d.ts +42 -0
  386. package/dist/src/utils/filesearch/ignore.js +106 -0
  387. package/dist/src/utils/filesearch/ignore.js.map +1 -0
  388. package/dist/src/utils/filesearch/ignore.test.d.ts +6 -0
  389. package/dist/src/utils/filesearch/ignore.test.js +144 -0
  390. package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
  391. package/dist/src/utils/filesearch/result-cache.d.ts +33 -0
  392. package/dist/src/utils/filesearch/result-cache.js +59 -0
  393. package/dist/src/utils/filesearch/result-cache.js.map +1 -0
  394. package/dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
  395. package/dist/src/utils/filesearch/result-cache.test.js +46 -0
  396. package/dist/src/utils/filesearch/result-cache.test.js.map +1 -0
  397. package/dist/src/utils/flashFallback.integration.test.js +6 -0
  398. package/dist/src/utils/flashFallback.integration.test.js.map +1 -1
  399. package/dist/src/utils/formatters.d.ts +6 -0
  400. package/dist/src/utils/formatters.js +16 -0
  401. package/dist/src/utils/formatters.js.map +1 -0
  402. package/dist/src/utils/getFolderStructure.test.js +11 -13
  403. package/dist/src/utils/getFolderStructure.test.js.map +1 -1
  404. package/dist/src/utils/gitIgnoreParser.js +5 -11
  405. package/dist/src/utils/gitIgnoreParser.js.map +1 -1
  406. package/dist/src/utils/gitIgnoreParser.test.js +58 -61
  407. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
  408. package/dist/src/utils/memoryDiscovery.d.ts +1 -1
  409. package/dist/src/utils/memoryDiscovery.js +76 -83
  410. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  411. package/dist/src/utils/memoryDiscovery.test.js +122 -372
  412. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  413. package/dist/src/utils/memoryImportProcessor.d.ts +19 -12
  414. package/dist/src/utils/memoryImportProcessor.js +240 -85
  415. package/dist/src/utils/memoryImportProcessor.js.map +1 -1
  416. package/dist/src/utils/memoryImportProcessor.test.js +593 -51
  417. package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
  418. package/dist/src/utils/nextSpeakerChecker.js +4 -25
  419. package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
  420. package/dist/src/utils/partUtils.d.ts +14 -0
  421. package/dist/src/utils/partUtils.js +65 -0
  422. package/dist/src/utils/partUtils.js.map +1 -0
  423. package/dist/src/utils/partUtils.test.d.ts +6 -0
  424. package/dist/src/utils/partUtils.test.js +130 -0
  425. package/dist/src/utils/partUtils.test.js.map +1 -0
  426. package/dist/src/utils/paths.d.ts +18 -2
  427. package/dist/src/utils/paths.js +39 -7
  428. package/dist/src/utils/paths.js.map +1 -1
  429. package/dist/src/utils/paths.test.d.ts +6 -0
  430. package/dist/src/utils/paths.test.js +225 -0
  431. package/dist/src/utils/paths.test.js.map +1 -0
  432. package/dist/src/utils/quotaErrorDetection.d.ts +1 -5
  433. package/dist/src/utils/quotaErrorDetection.js.map +1 -1
  434. package/dist/src/utils/retry.d.ts +3 -0
  435. package/dist/src/utils/retry.js.map +1 -1
  436. package/dist/src/utils/retry.test.js.map +1 -1
  437. package/dist/src/utils/schemaValidator.d.ts +1 -8
  438. package/dist/src/utils/schemaValidator.js +1 -32
  439. package/dist/src/utils/schemaValidator.js.map +1 -1
  440. package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
  441. package/dist/src/utils/secure-browser-launcher.js +165 -0
  442. package/dist/src/utils/secure-browser-launcher.js.map +1 -0
  443. package/dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
  444. package/dist/src/utils/secure-browser-launcher.test.js +149 -0
  445. package/dist/src/utils/secure-browser-launcher.test.js.map +1 -0
  446. package/dist/src/utils/shell-utils.d.ts +117 -0
  447. package/dist/src/utils/shell-utils.js +376 -0
  448. package/dist/src/utils/shell-utils.js.map +1 -0
  449. package/dist/src/utils/shell-utils.test.d.ts +6 -0
  450. package/dist/src/utils/shell-utils.test.js +328 -0
  451. package/dist/src/utils/shell-utils.test.js.map +1 -0
  452. package/dist/src/utils/summarizer.js +3 -32
  453. package/dist/src/utils/summarizer.js.map +1 -1
  454. package/dist/src/utils/systemEncoding.js +1 -1
  455. package/dist/src/utils/systemEncoding.js.map +1 -1
  456. package/dist/src/utils/systemEncoding.test.js +23 -23
  457. package/dist/src/utils/systemEncoding.test.js.map +1 -1
  458. package/dist/src/utils/textUtils.d.ts +13 -0
  459. package/dist/src/utils/textUtils.js +28 -0
  460. package/dist/src/utils/textUtils.js.map +1 -0
  461. package/dist/src/utils/user_account.js +58 -48
  462. package/dist/src/utils/user_account.js.map +1 -1
  463. package/dist/src/utils/user_account.test.js +76 -9
  464. package/dist/src/utils/user_account.test.js.map +1 -1
  465. package/dist/src/utils/workspaceContext.d.ts +66 -0
  466. package/dist/src/utils/workspaceContext.js +165 -0
  467. package/dist/src/utils/workspaceContext.js.map +1 -0
  468. package/dist/src/utils/workspaceContext.test.d.ts +6 -0
  469. package/dist/src/utils/workspaceContext.test.js +293 -0
  470. package/dist/src/utils/workspaceContext.test.js.map +1 -0
  471. package/dist/tsconfig.tsbuildinfo +1 -1
  472. package/package.json +14 -3
  473. package/dist/src/core/geminiRequest.test.js +0 -72
  474. package/dist/src/core/geminiRequest.test.js.map +0 -1
  475. package/dist/src/core/modelCheck.d.ts +0 -14
  476. package/dist/src/core/modelCheck.js +0 -62
  477. package/dist/src/core/modelCheck.js.map +0 -1
  478. package/dist/src/services/ideContext.d.ts +0 -178
  479. package/dist/src/services/ideContext.js +0 -105
  480. package/dist/src/services/ideContext.js.map +0 -1
  481. package/dist/src/services/ideContext.test.js +0 -111
  482. package/dist/src/services/ideContext.test.js.map +0 -1
  483. /package/dist/src/core/{geminiRequest.test.d.ts → subagent.test.d.ts} +0 -0
  484. /package/dist/src/{services/ideContext.test.d.ts → ide/detect-ide.test.d.ts} +0 -0
@@ -3,178 +3,305 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
6
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
7
7
  import { ReadFileTool } from './read-file.js';
8
- import * as fileUtils from '../utils/fileUtils.js';
8
+ import { ToolErrorType } from './tool-error.js';
9
9
  import path from 'path';
10
10
  import os from 'os';
11
- import fs from 'fs'; // For actual fs operations in setup
11
+ import fs from 'fs';
12
+ import fsp from 'fs/promises';
12
13
  import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
13
- // Mock fileUtils.processSingleFileContent
14
- vi.mock('../utils/fileUtils', async () => {
15
- const actualFileUtils = await vi.importActual('../utils/fileUtils');
16
- return {
17
- ...actualFileUtils, // Spread actual implementations
18
- processSingleFileContent: vi.fn(), // Mock specific function
19
- };
20
- });
21
- const mockProcessSingleFileContent = fileUtils.processSingleFileContent;
14
+ import { StandardFileSystemService } from '../services/fileSystemService.js';
15
+ import { createMockWorkspaceContext } from '../test-utils/mockWorkspaceContext.js';
22
16
  describe('ReadFileTool', () => {
23
17
  let tempRootDir;
24
18
  let tool;
25
19
  const abortSignal = new AbortController().signal;
26
- beforeEach(() => {
20
+ beforeEach(async () => {
27
21
  // Create a unique temporary root directory for each test run
28
- tempRootDir = fs.mkdtempSync(path.join(os.tmpdir(), 'read-file-tool-root-'));
29
- fs.writeFileSync(path.join(tempRootDir, '.geminiignore'), ['foo.*'].join('\n'));
30
- const fileService = new FileDiscoveryService(tempRootDir);
22
+ tempRootDir = await fsp.mkdtemp(path.join(os.tmpdir(), 'read-file-tool-root-'));
31
23
  const mockConfigInstance = {
32
- getFileService: () => fileService,
24
+ getFileService: () => new FileDiscoveryService(tempRootDir),
25
+ getFileSystemService: () => new StandardFileSystemService(),
33
26
  getTargetDir: () => tempRootDir,
27
+ getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir),
34
28
  };
35
29
  tool = new ReadFileTool(mockConfigInstance);
36
- mockProcessSingleFileContent.mockReset();
37
30
  });
38
- afterEach(() => {
31
+ afterEach(async () => {
39
32
  // Clean up the temporary root directory
40
33
  if (fs.existsSync(tempRootDir)) {
41
- fs.rmSync(tempRootDir, { recursive: true, force: true });
34
+ await fsp.rm(tempRootDir, { recursive: true, force: true });
42
35
  }
43
36
  });
44
- describe('validateToolParams', () => {
45
- it('should return null for valid params (absolute path within root)', () => {
37
+ describe('build', () => {
38
+ it('should return an invocation for valid params (absolute path within root)', () => {
46
39
  const params = {
47
40
  absolute_path: path.join(tempRootDir, 'test.txt'),
48
41
  };
49
- expect(tool.validateToolParams(params)).toBeNull();
42
+ const result = tool.build(params);
43
+ expect(typeof result).not.toBe('string');
50
44
  });
51
- it('should return null for valid params with offset and limit', () => {
45
+ it('should throw error if file path is relative', () => {
52
46
  const params = {
53
- absolute_path: path.join(tempRootDir, 'test.txt'),
54
- offset: 0,
55
- limit: 10,
47
+ absolute_path: 'relative/path.txt',
56
48
  };
57
- expect(tool.validateToolParams(params)).toBeNull();
49
+ expect(() => tool.build(params)).toThrow('File path must be absolute, but was relative: relative/path.txt. You must provide an absolute path.');
58
50
  });
59
- it('should return error for relative path', () => {
60
- const params = { absolute_path: 'test.txt' };
61
- expect(tool.validateToolParams(params)).toBe(`File path must be absolute, but was relative: test.txt. You must provide an absolute path.`);
51
+ it('should throw error if path is outside root', () => {
52
+ const params = {
53
+ absolute_path: '/outside/root.txt',
54
+ };
55
+ expect(() => tool.build(params)).toThrow(/File path must be within one of the workspace directories/);
62
56
  });
63
- it('should return error for path outside root', () => {
64
- const outsidePath = path.resolve(os.tmpdir(), 'outside-root.txt');
65
- const params = { absolute_path: outsidePath };
66
- expect(tool.validateToolParams(params)).toMatch(/File path must be within the root directory/);
57
+ it('should throw error if path is empty', () => {
58
+ const params = {
59
+ absolute_path: '',
60
+ };
61
+ expect(() => tool.build(params)).toThrow(/The 'absolute_path' parameter must be non-empty./);
67
62
  });
68
- it('should return error for negative offset', () => {
63
+ it('should throw error if offset is negative', () => {
69
64
  const params = {
70
65
  absolute_path: path.join(tempRootDir, 'test.txt'),
71
66
  offset: -1,
72
- limit: 10,
73
67
  };
74
- expect(tool.validateToolParams(params)).toBe('Offset must be a non-negative number');
68
+ expect(() => tool.build(params)).toThrow('Offset must be a non-negative number');
75
69
  });
76
- it('should return error for non-positive limit', () => {
77
- const paramsZero = {
70
+ it('should throw error if limit is zero or negative', () => {
71
+ const params = {
78
72
  absolute_path: path.join(tempRootDir, 'test.txt'),
79
- offset: 0,
80
73
  limit: 0,
81
74
  };
82
- expect(tool.validateToolParams(paramsZero)).toBe('Limit must be a positive number');
83
- const paramsNegative = {
84
- absolute_path: path.join(tempRootDir, 'test.txt'),
85
- offset: 0,
86
- limit: -5,
87
- };
88
- expect(tool.validateToolParams(paramsNegative)).toBe('Limit must be a positive number');
89
- });
90
- it('should return error for schema validation failure (e.g. missing path)', () => {
91
- const params = { offset: 0 };
92
- expect(tool.validateToolParams(params)).toBe(`params must have required property 'absolute_path'`);
75
+ expect(() => tool.build(params)).toThrow('Limit must be a positive number');
93
76
  });
94
77
  });
95
78
  describe('getDescription', () => {
96
- it('should return a shortened, relative path', () => {
97
- const filePath = path.join(tempRootDir, 'sub', 'dir', 'file.txt');
98
- const params = { absolute_path: filePath };
99
- // Assuming tempRootDir is something like /tmp/read-file-tool-root-XXXXXX
100
- // The relative path would be sub/dir/file.txt
101
- expect(tool.getDescription(params)).toBe('sub/dir/file.txt');
79
+ it('should return relative path without limit/offset', () => {
80
+ const subDir = path.join(tempRootDir, 'sub', 'dir');
81
+ const params = {
82
+ absolute_path: path.join(subDir, 'file.txt'),
83
+ };
84
+ const invocation = tool.build(params);
85
+ expect(typeof invocation).not.toBe('string');
86
+ expect(invocation.getDescription()).toBe(path.join('sub', 'dir', 'file.txt'));
87
+ });
88
+ it('should return shortened path when file path is deep', () => {
89
+ const deepPath = path.join(tempRootDir, 'very', 'deep', 'directory', 'structure', 'that', 'exceeds', 'the', 'normal', 'limit', 'file.txt');
90
+ const params = { absolute_path: deepPath };
91
+ const invocation = tool.build(params);
92
+ expect(typeof invocation).not.toBe('string');
93
+ const desc = invocation.getDescription();
94
+ expect(desc).toContain('...');
95
+ expect(desc).toContain('file.txt');
96
+ });
97
+ it('should handle non-normalized file paths correctly', () => {
98
+ const subDir = path.join(tempRootDir, 'sub', 'dir');
99
+ const params = {
100
+ absolute_path: path.join(subDir, '..', 'dir', 'file.txt'),
101
+ };
102
+ const invocation = tool.build(params);
103
+ expect(typeof invocation).not.toBe('string');
104
+ expect(invocation.getDescription()).toBe(path.join('sub', 'dir', 'file.txt'));
102
105
  });
103
106
  it('should return . if path is the root directory', () => {
104
107
  const params = { absolute_path: tempRootDir };
105
- expect(tool.getDescription(params)).toBe('.');
108
+ const invocation = tool.build(params);
109
+ expect(typeof invocation).not.toBe('string');
110
+ expect(invocation.getDescription()).toBe('.');
106
111
  });
107
112
  });
108
113
  describe('execute', () => {
109
- it('should return validation error if params are invalid', async () => {
110
- const params = { absolute_path: 'relative/path.txt' };
111
- const result = await tool.execute(params, abortSignal);
112
- expect(result.llmContent).toBe('Error: Invalid parameters provided. Reason: File path must be absolute, but was relative: relative/path.txt. You must provide an absolute path.');
113
- expect(result.returnDisplay).toBe('File path must be absolute, but was relative: relative/path.txt. You must provide an absolute path.');
114
- });
115
- it('should return error from processSingleFileContent if it fails', async () => {
116
- const filePath = path.join(tempRootDir, 'error.txt');
114
+ it('should return error if file does not exist', async () => {
115
+ const filePath = path.join(tempRootDir, 'nonexistent.txt');
117
116
  const params = { absolute_path: filePath };
118
- const errorMessage = 'Simulated read error';
119
- mockProcessSingleFileContent.mockResolvedValue({
120
- llmContent: `Error reading file ${filePath}: ${errorMessage}`,
121
- returnDisplay: `Error reading file ${filePath}: ${errorMessage}`,
122
- error: errorMessage,
117
+ const invocation = tool.build(params);
118
+ const result = await invocation.execute(abortSignal);
119
+ expect(result).toEqual({
120
+ llmContent: 'Could not read file because no file was found at the specified path.',
121
+ returnDisplay: 'File not found.',
122
+ error: {
123
+ message: `File not found: ${filePath}`,
124
+ type: ToolErrorType.FILE_NOT_FOUND,
125
+ },
123
126
  });
124
- const result = await tool.execute(params, abortSignal);
125
- expect(mockProcessSingleFileContent).toHaveBeenCalledWith(filePath, tempRootDir, undefined, undefined);
126
- expect(result.llmContent).toContain(errorMessage);
127
- expect(result.returnDisplay).toContain(errorMessage);
128
127
  });
129
128
  it('should return success result for a text file', async () => {
130
129
  const filePath = path.join(tempRootDir, 'textfile.txt');
131
130
  const fileContent = 'This is a test file.';
131
+ await fsp.writeFile(filePath, fileContent, 'utf-8');
132
132
  const params = { absolute_path: filePath };
133
- mockProcessSingleFileContent.mockResolvedValue({
133
+ const invocation = tool.build(params);
134
+ expect(await invocation.execute(abortSignal)).toEqual({
134
135
  llmContent: fileContent,
135
- returnDisplay: `Read text file: ${path.basename(filePath)}`,
136
+ returnDisplay: '',
136
137
  });
137
- const result = await tool.execute(params, abortSignal);
138
- expect(mockProcessSingleFileContent).toHaveBeenCalledWith(filePath, tempRootDir, undefined, undefined);
139
- expect(result.llmContent).toBe(fileContent);
140
- expect(result.returnDisplay).toBe(`Read text file: ${path.basename(filePath)}`);
141
- });
142
- it('should return success result for an image file', async () => {
143
- const filePath = path.join(tempRootDir, 'image.png');
144
- const imageData = {
145
- inlineData: { mimeType: 'image/png', data: 'base64...' },
146
- };
138
+ });
139
+ it('should return error if path is a directory', async () => {
140
+ const dirPath = path.join(tempRootDir, 'directory');
141
+ await fsp.mkdir(dirPath);
142
+ const params = { absolute_path: dirPath };
143
+ const invocation = tool.build(params);
144
+ const result = await invocation.execute(abortSignal);
145
+ expect(result).toEqual({
146
+ llmContent: 'Could not read file because the provided path is a directory, not a file.',
147
+ returnDisplay: 'Path is a directory.',
148
+ error: {
149
+ message: `Path is a directory, not a file: ${dirPath}`,
150
+ type: ToolErrorType.INVALID_TOOL_PARAMS,
151
+ },
152
+ });
153
+ });
154
+ it('should return error for a file that is too large', async () => {
155
+ const filePath = path.join(tempRootDir, 'largefile.txt');
156
+ // 21MB of content exceeds 20MB limit
157
+ const largeContent = 'x'.repeat(21 * 1024 * 1024);
158
+ await fsp.writeFile(filePath, largeContent, 'utf-8');
147
159
  const params = { absolute_path: filePath };
148
- mockProcessSingleFileContent.mockResolvedValue({
149
- llmContent: imageData,
150
- returnDisplay: `Read image file: ${path.basename(filePath)}`,
160
+ const invocation = tool.build(params);
161
+ const result = await invocation.execute(abortSignal);
162
+ expect(result).toHaveProperty('error');
163
+ expect(result.error?.type).toBe(ToolErrorType.FILE_TOO_LARGE);
164
+ expect(result.error?.message).toContain('File size exceeds the 20MB limit');
165
+ });
166
+ it('should handle text file with lines exceeding maximum length', async () => {
167
+ const filePath = path.join(tempRootDir, 'longlines.txt');
168
+ const longLine = 'a'.repeat(2500); // Exceeds MAX_LINE_LENGTH_TEXT_FILE (2000)
169
+ const fileContent = `Short line\n${longLine}\nAnother short line`;
170
+ await fsp.writeFile(filePath, fileContent, 'utf-8');
171
+ const params = { absolute_path: filePath };
172
+ const invocation = tool.build(params);
173
+ const result = await invocation.execute(abortSignal);
174
+ expect(result.llmContent).toContain('IMPORTANT: The file content has been truncated');
175
+ expect(result.llmContent).toContain('--- FILE CONTENT (truncated) ---');
176
+ expect(result.returnDisplay).toContain('some lines were shortened');
177
+ });
178
+ it('should handle image file and return appropriate content', async () => {
179
+ const imagePath = path.join(tempRootDir, 'image.png');
180
+ // Minimal PNG header
181
+ const pngHeader = Buffer.from([
182
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
183
+ ]);
184
+ await fsp.writeFile(imagePath, pngHeader);
185
+ const params = { absolute_path: imagePath };
186
+ const invocation = tool.build(params);
187
+ const result = await invocation.execute(abortSignal);
188
+ expect(result.llmContent).toEqual({
189
+ inlineData: {
190
+ data: pngHeader.toString('base64'),
191
+ mimeType: 'image/png',
192
+ },
151
193
  });
152
- const result = await tool.execute(params, abortSignal);
153
- expect(mockProcessSingleFileContent).toHaveBeenCalledWith(filePath, tempRootDir, undefined, undefined);
154
- expect(result.llmContent).toEqual(imageData);
155
- expect(result.returnDisplay).toBe(`Read image file: ${path.basename(filePath)}`);
194
+ expect(result.returnDisplay).toBe('Read image file: image.png');
195
+ });
196
+ it('should handle PDF file and return appropriate content', async () => {
197
+ const pdfPath = path.join(tempRootDir, 'document.pdf');
198
+ // Minimal PDF header
199
+ const pdfHeader = Buffer.from('%PDF-1.4');
200
+ await fsp.writeFile(pdfPath, pdfHeader);
201
+ const params = { absolute_path: pdfPath };
202
+ const invocation = tool.build(params);
203
+ const result = await invocation.execute(abortSignal);
204
+ expect(result.llmContent).toEqual({
205
+ inlineData: {
206
+ data: pdfHeader.toString('base64'),
207
+ mimeType: 'application/pdf',
208
+ },
209
+ });
210
+ expect(result.returnDisplay).toBe('Read pdf file: document.pdf');
211
+ });
212
+ it('should handle binary file and skip content', async () => {
213
+ const binPath = path.join(tempRootDir, 'binary.bin');
214
+ // Binary data with null bytes
215
+ const binaryData = Buffer.from([0x00, 0xff, 0x00, 0xff]);
216
+ await fsp.writeFile(binPath, binaryData);
217
+ const params = { absolute_path: binPath };
218
+ const invocation = tool.build(params);
219
+ const result = await invocation.execute(abortSignal);
220
+ expect(result.llmContent).toBe('Cannot display content of binary file: binary.bin');
221
+ expect(result.returnDisplay).toBe('Skipped binary file: binary.bin');
222
+ });
223
+ it('should handle SVG file as text', async () => {
224
+ const svgPath = path.join(tempRootDir, 'image.svg');
225
+ const svgContent = '<svg><circle cx="50" cy="50" r="40"/></svg>';
226
+ await fsp.writeFile(svgPath, svgContent, 'utf-8');
227
+ const params = { absolute_path: svgPath };
228
+ const invocation = tool.build(params);
229
+ const result = await invocation.execute(abortSignal);
230
+ expect(result.llmContent).toBe(svgContent);
231
+ expect(result.returnDisplay).toBe('Read SVG as text: image.svg');
156
232
  });
157
- it('should pass offset and limit to processSingleFileContent', async () => {
233
+ it('should handle large SVG file', async () => {
234
+ const svgPath = path.join(tempRootDir, 'large.svg');
235
+ // Create SVG content larger than 1MB
236
+ const largeContent = '<svg>' + 'x'.repeat(1024 * 1024 + 1) + '</svg>';
237
+ await fsp.writeFile(svgPath, largeContent, 'utf-8');
238
+ const params = { absolute_path: svgPath };
239
+ const invocation = tool.build(params);
240
+ const result = await invocation.execute(abortSignal);
241
+ expect(result.llmContent).toBe('Cannot display content of SVG file larger than 1MB: large.svg');
242
+ expect(result.returnDisplay).toBe('Skipped large SVG file (>1MB): large.svg');
243
+ });
244
+ it('should handle empty file', async () => {
245
+ const emptyPath = path.join(tempRootDir, 'empty.txt');
246
+ await fsp.writeFile(emptyPath, '', 'utf-8');
247
+ const params = { absolute_path: emptyPath };
248
+ const invocation = tool.build(params);
249
+ const result = await invocation.execute(abortSignal);
250
+ expect(result.llmContent).toBe('');
251
+ expect(result.returnDisplay).toBe('');
252
+ });
253
+ it('should support offset and limit for text files', async () => {
158
254
  const filePath = path.join(tempRootDir, 'paginated.txt');
255
+ const lines = Array.from({ length: 20 }, (_, i) => `Line ${i + 1}`);
256
+ const fileContent = lines.join('\n');
257
+ await fsp.writeFile(filePath, fileContent, 'utf-8');
159
258
  const params = {
160
259
  absolute_path: filePath,
161
- offset: 10,
162
- limit: 5,
260
+ offset: 5, // Start from line 6
261
+ limit: 3,
163
262
  };
164
- mockProcessSingleFileContent.mockResolvedValue({
165
- llmContent: 'some lines',
166
- returnDisplay: 'Read text file (paginated)',
167
- });
168
- await tool.execute(params, abortSignal);
169
- expect(mockProcessSingleFileContent).toHaveBeenCalledWith(filePath, tempRootDir, 10, 5);
263
+ const invocation = tool.build(params);
264
+ const result = await invocation.execute(abortSignal);
265
+ expect(result.llmContent).toContain('IMPORTANT: The file content has been truncated');
266
+ expect(result.llmContent).toContain('Status: Showing lines 6-8 of 20 total lines');
267
+ expect(result.llmContent).toContain('Line 6');
268
+ expect(result.llmContent).toContain('Line 7');
269
+ expect(result.llmContent).toContain('Line 8');
270
+ expect(result.returnDisplay).toBe('Read lines 6-8 of 20 from paginated.txt');
170
271
  });
171
- it('should return error if path is ignored by a .geminiignore pattern', async () => {
172
- const params = {
173
- absolute_path: path.join(tempRootDir, 'foo.bar'),
174
- };
175
- const result = await tool.execute(params, abortSignal);
176
- expect(result.returnDisplay).toContain('foo.bar');
177
- expect(result.returnDisplay).not.toContain('foo.baz');
272
+ describe('with .geminiignore', () => {
273
+ beforeEach(async () => {
274
+ await fsp.writeFile(path.join(tempRootDir, '.geminiignore'), ['foo.*', 'ignored/'].join('\n'));
275
+ });
276
+ it('should throw error if path is ignored by a .geminiignore pattern', async () => {
277
+ const ignoredFilePath = path.join(tempRootDir, 'foo.bar');
278
+ await fsp.writeFile(ignoredFilePath, 'content', 'utf-8');
279
+ const params = {
280
+ absolute_path: ignoredFilePath,
281
+ };
282
+ const expectedError = `File path '${ignoredFilePath}' is ignored by .geminiignore pattern(s).`;
283
+ expect(() => tool.build(params)).toThrow(expectedError);
284
+ });
285
+ it('should throw error if file is in an ignored directory', async () => {
286
+ const ignoredDirPath = path.join(tempRootDir, 'ignored');
287
+ await fsp.mkdir(ignoredDirPath, { recursive: true });
288
+ const ignoredFilePath = path.join(ignoredDirPath, 'file.txt');
289
+ await fsp.writeFile(ignoredFilePath, 'content', 'utf-8');
290
+ const params = {
291
+ absolute_path: ignoredFilePath,
292
+ };
293
+ const expectedError = `File path '${ignoredFilePath}' is ignored by .geminiignore pattern(s).`;
294
+ expect(() => tool.build(params)).toThrow(expectedError);
295
+ });
296
+ it('should allow reading non-ignored files', async () => {
297
+ const allowedFilePath = path.join(tempRootDir, 'allowed.txt');
298
+ await fsp.writeFile(allowedFilePath, 'content', 'utf-8');
299
+ const params = {
300
+ absolute_path: allowedFilePath,
301
+ };
302
+ const invocation = tool.build(params);
303
+ expect(typeof invocation).not.toBe('string');
304
+ });
178
305
  });
179
306
  });
180
307
  });
@@ -1 +1 @@
1
- {"version":3,"file":"read-file.test.js","sourceRoot":"","sources":["../../../src/tools/read-file.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAQ,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,oCAAoC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,0CAA0C;AAC1C,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;IACvC,MAAM,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@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { BaseTool, ToolResult } from './tools.js';
6
+ import { BaseDeclarativeTool, ToolInvocation, ToolResult } from './tools.js';
7
7
  import { Config } from '../config/config.js';
8
8
  /**
9
9
  * Parameters for the ReadManyFilesTool.
@@ -51,12 +51,9 @@ export interface ReadManyFilesParams {
51
51
  * within a specified target directory. The content is concatenated.
52
52
  * It is intended to run in an environment with access to the local file system (e.g., a Node.js backend).
53
53
  */
54
- export declare class ReadManyFilesTool extends BaseTool<ReadManyFilesParams, ToolResult> {
54
+ export declare class ReadManyFilesTool extends BaseDeclarativeTool<ReadManyFilesParams, ToolResult> {
55
55
  private config;
56
56
  static readonly Name: string;
57
- private readonly geminiIgnorePatterns;
58
57
  constructor(config: Config);
59
- validateParams(params: ReadManyFilesParams): string | null;
60
- getDescription(params: ReadManyFilesParams): string;
61
- execute(params: ReadManyFilesParams, signal: AbortSignal): Promise<ToolResult>;
58
+ protected createInvocation(params: ReadManyFilesParams): ToolInvocation<ReadManyFilesParams, ToolResult>;
62
59
  }