@google/gemini-cli-core 0.1.0-development.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +156 -0
  3. package/dist/.last_build +0 -0
  4. package/dist/index.d.ts +7 -0
  5. package/dist/index.js +8 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/__mocks__/fs/promises.d.ts +11 -0
  8. package/dist/src/__mocks__/fs/promises.js +17 -0
  9. package/dist/src/__mocks__/fs/promises.js.map +1 -0
  10. package/dist/src/code_assist/codeAssist.d.ts +8 -0
  11. package/dist/src/code_assist/codeAssist.js +19 -0
  12. package/dist/src/code_assist/codeAssist.js.map +1 -0
  13. package/dist/src/code_assist/converter.d.ts +68 -0
  14. package/dist/src/code_assist/converter.js +125 -0
  15. package/dist/src/code_assist/converter.js.map +1 -0
  16. package/dist/src/code_assist/converter.test.d.ts +6 -0
  17. package/dist/src/code_assist/converter.test.js +229 -0
  18. package/dist/src/code_assist/converter.test.js.map +1 -0
  19. package/dist/src/code_assist/oauth2.d.ts +26 -0
  20. package/dist/src/code_assist/oauth2.js +277 -0
  21. package/dist/src/code_assist/oauth2.js.map +1 -0
  22. package/dist/src/code_assist/oauth2.test.d.ts +6 -0
  23. package/dist/src/code_assist/oauth2.test.js +195 -0
  24. package/dist/src/code_assist/oauth2.test.js.map +1 -0
  25. package/dist/src/code_assist/server.d.ts +35 -0
  26. package/dist/src/code_assist/server.js +123 -0
  27. package/dist/src/code_assist/server.js.map +1 -0
  28. package/dist/src/code_assist/server.test.d.ts +6 -0
  29. package/dist/src/code_assist/server.test.js +123 -0
  30. package/dist/src/code_assist/server.test.js.map +1 -0
  31. package/dist/src/code_assist/setup.d.ts +15 -0
  32. package/dist/src/code_assist/setup.js +67 -0
  33. package/dist/src/code_assist/setup.js.map +1 -0
  34. package/dist/src/code_assist/types.d.ts +148 -0
  35. package/dist/src/code_assist/types.js +46 -0
  36. package/dist/src/code_assist/types.js.map +1 -0
  37. package/dist/src/config/config.d.ts +175 -0
  38. package/dist/src/config/config.js +385 -0
  39. package/dist/src/config/config.js.map +1 -0
  40. package/dist/src/config/config.test.d.ts +6 -0
  41. package/dist/src/config/config.test.js +263 -0
  42. package/dist/src/config/config.test.js.map +1 -0
  43. package/dist/src/config/flashFallback.test.d.ts +6 -0
  44. package/dist/src/config/flashFallback.test.js +115 -0
  45. package/dist/src/config/flashFallback.test.js.map +1 -0
  46. package/dist/src/config/models.d.ts +8 -0
  47. package/dist/src/config/models.js +9 -0
  48. package/dist/src/config/models.js.map +1 -0
  49. package/dist/src/core/client.d.ts +39 -0
  50. package/dist/src/core/client.js +386 -0
  51. package/dist/src/core/client.js.map +1 -0
  52. package/dist/src/core/client.test.d.ts +6 -0
  53. package/dist/src/core/client.test.js +630 -0
  54. package/dist/src/core/client.test.js.map +1 -0
  55. package/dist/src/core/contentGenerator.d.ts +29 -0
  56. package/dist/src/core/contentGenerator.js +71 -0
  57. package/dist/src/core/contentGenerator.js.map +1 -0
  58. package/dist/src/core/contentGenerator.test.d.ts +6 -0
  59. package/dist/src/core/contentGenerator.test.js +45 -0
  60. package/dist/src/core/contentGenerator.test.js.map +1 -0
  61. package/dist/src/core/coreToolScheduler.d.ts +104 -0
  62. package/dist/src/core/coreToolScheduler.js +397 -0
  63. package/dist/src/core/coreToolScheduler.js.map +1 -0
  64. package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
  65. package/dist/src/core/coreToolScheduler.test.js +318 -0
  66. package/dist/src/core/coreToolScheduler.test.js.map +1 -0
  67. package/dist/src/core/geminiChat.d.ts +116 -0
  68. package/dist/src/core/geminiChat.js +491 -0
  69. package/dist/src/core/geminiChat.js.map +1 -0
  70. package/dist/src/core/geminiChat.test.d.ts +6 -0
  71. package/dist/src/core/geminiChat.test.js +422 -0
  72. package/dist/src/core/geminiChat.test.js.map +1 -0
  73. package/dist/src/core/geminiRequest.d.ts +13 -0
  74. package/dist/src/core/geminiRequest.js +45 -0
  75. package/dist/src/core/geminiRequest.js.map +1 -0
  76. package/dist/src/core/geminiRequest.test.d.ts +6 -0
  77. package/dist/src/core/geminiRequest.test.js +72 -0
  78. package/dist/src/core/geminiRequest.test.js.map +1 -0
  79. package/dist/src/core/logger.d.ts +35 -0
  80. package/dist/src/core/logger.js +235 -0
  81. package/dist/src/core/logger.js.map +1 -0
  82. package/dist/src/core/logger.test.d.ts +6 -0
  83. package/dist/src/core/logger.test.js +387 -0
  84. package/dist/src/core/logger.test.js.map +1 -0
  85. package/dist/src/core/modelCheck.d.ts +14 -0
  86. package/dist/src/core/modelCheck.js +55 -0
  87. package/dist/src/core/modelCheck.js.map +1 -0
  88. package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
  89. package/dist/src/core/nonInteractiveToolExecutor.js +92 -0
  90. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
  91. package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
  92. package/dist/src/core/nonInteractiveToolExecutor.test.js +181 -0
  93. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
  94. package/dist/src/core/prompts.d.ts +12 -0
  95. package/dist/src/core/prompts.js +334 -0
  96. package/dist/src/core/prompts.js.map +1 -0
  97. package/dist/src/core/prompts.test.d.ts +6 -0
  98. package/dist/src/core/prompts.test.js +97 -0
  99. package/dist/src/core/prompts.test.js.map +1 -0
  100. package/dist/src/core/tokenLimits.d.ts +10 -0
  101. package/dist/src/core/tokenLimits.js +27 -0
  102. package/dist/src/core/tokenLimits.js.map +1 -0
  103. package/dist/src/core/turn.d.ts +96 -0
  104. package/dist/src/core/turn.js +125 -0
  105. package/dist/src/core/turn.js.map +1 -0
  106. package/dist/src/core/turn.test.d.ts +6 -0
  107. package/dist/src/core/turn.test.js +236 -0
  108. package/dist/src/core/turn.test.js.map +1 -0
  109. package/dist/src/index.d.ts +46 -0
  110. package/dist/src/index.js +54 -0
  111. package/dist/src/index.js.map +1 -0
  112. package/dist/src/index.test.d.ts +6 -0
  113. package/dist/src/index.test.js +12 -0
  114. package/dist/src/index.test.js.map +1 -0
  115. package/dist/src/services/fileDiscoveryService.d.ts +35 -0
  116. package/dist/src/services/fileDiscoveryService.js +91 -0
  117. package/dist/src/services/fileDiscoveryService.js.map +1 -0
  118. package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
  119. package/dist/src/services/fileDiscoveryService.test.js +102 -0
  120. package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
  121. package/dist/src/services/gitService.d.ts +21 -0
  122. package/dist/src/services/gitService.js +105 -0
  123. package/dist/src/services/gitService.js.map +1 -0
  124. package/dist/src/services/gitService.test.d.ts +6 -0
  125. package/dist/src/services/gitService.test.js +233 -0
  126. package/dist/src/services/gitService.test.js.map +1 -0
  127. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +33 -0
  128. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +364 -0
  129. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
  130. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +43 -0
  131. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +109 -0
  132. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
  133. package/dist/src/telemetry/constants.d.ts +19 -0
  134. package/dist/src/telemetry/constants.js +20 -0
  135. package/dist/src/telemetry/constants.js.map +1 -0
  136. package/dist/src/telemetry/index.d.ts +18 -0
  137. package/dist/src/telemetry/index.js +20 -0
  138. package/dist/src/telemetry/index.js.map +1 -0
  139. package/dist/src/telemetry/loggers.d.ts +13 -0
  140. package/dist/src/telemetry/loggers.js +187 -0
  141. package/dist/src/telemetry/loggers.js.map +1 -0
  142. package/dist/src/telemetry/loggers.test.d.ts +6 -0
  143. package/dist/src/telemetry/loggers.test.js +525 -0
  144. package/dist/src/telemetry/loggers.test.js.map +1 -0
  145. package/dist/src/telemetry/metrics.d.ts +19 -0
  146. package/dist/src/telemetry/metrics.js +144 -0
  147. package/dist/src/telemetry/metrics.js.map +1 -0
  148. package/dist/src/telemetry/metrics.test.d.ts +6 -0
  149. package/dist/src/telemetry/metrics.test.js +162 -0
  150. package/dist/src/telemetry/metrics.test.js.map +1 -0
  151. package/dist/src/telemetry/sdk.d.ts +9 -0
  152. package/dist/src/telemetry/sdk.js +116 -0
  153. package/dist/src/telemetry/sdk.js.map +1 -0
  154. package/dist/src/telemetry/telemetry.test.d.ts +6 -0
  155. package/dist/src/telemetry/telemetry.test.js +50 -0
  156. package/dist/src/telemetry/telemetry.test.js.map +1 -0
  157. package/dist/src/telemetry/types.d.ts +91 -0
  158. package/dist/src/telemetry/types.js +176 -0
  159. package/dist/src/telemetry/types.js.map +1 -0
  160. package/dist/src/telemetry/uiTelemetry.d.ts +67 -0
  161. package/dist/src/telemetry/uiTelemetry.js +131 -0
  162. package/dist/src/telemetry/uiTelemetry.js.map +1 -0
  163. package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
  164. package/dist/src/telemetry/uiTelemetry.test.js +411 -0
  165. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
  166. package/dist/src/tools/diffOptions.d.ts +7 -0
  167. package/dist/src/tools/diffOptions.js +10 -0
  168. package/dist/src/tools/diffOptions.js.map +1 -0
  169. package/dist/src/tools/edit.d.ts +84 -0
  170. package/dist/src/tools/edit.js +359 -0
  171. package/dist/src/tools/edit.js.map +1 -0
  172. package/dist/src/tools/edit.test.d.ts +6 -0
  173. package/dist/src/tools/edit.test.js +500 -0
  174. package/dist/src/tools/edit.test.js.map +1 -0
  175. package/dist/src/tools/glob.d.ts +71 -0
  176. package/dist/src/tools/glob.js +215 -0
  177. package/dist/src/tools/glob.js.map +1 -0
  178. package/dist/src/tools/glob.test.d.ts +6 -0
  179. package/dist/src/tools/glob.test.js +293 -0
  180. package/dist/src/tools/glob.test.js.map +1 -0
  181. package/dist/src/tools/grep.d.ts +81 -0
  182. package/dist/src/tools/grep.js +427 -0
  183. package/dist/src/tools/grep.js.map +1 -0
  184. package/dist/src/tools/grep.test.d.ts +6 -0
  185. package/dist/src/tools/grep.test.js +185 -0
  186. package/dist/src/tools/grep.test.js.map +1 -0
  187. package/dist/src/tools/ls.d.ts +94 -0
  188. package/dist/src/tools/ls.js +215 -0
  189. package/dist/src/tools/ls.js.map +1 -0
  190. package/dist/src/tools/mcp-client.d.ts +56 -0
  191. package/dist/src/tools/mcp-client.js +302 -0
  192. package/dist/src/tools/mcp-client.js.map +1 -0
  193. package/dist/src/tools/mcp-client.test.d.ts +6 -0
  194. package/dist/src/tools/mcp-client.test.js +608 -0
  195. package/dist/src/tools/mcp-client.test.js.map +1 -0
  196. package/dist/src/tools/mcp-tool.d.ts +23 -0
  197. package/dist/src/tools/mcp-tool.js +119 -0
  198. package/dist/src/tools/mcp-tool.js.map +1 -0
  199. package/dist/src/tools/mcp-tool.test.d.ts +6 -0
  200. package/dist/src/tools/mcp-tool.test.js +173 -0
  201. package/dist/src/tools/mcp-tool.test.js.map +1 -0
  202. package/dist/src/tools/memoryTool.d.ts +28 -0
  203. package/dist/src/tools/memoryTool.js +171 -0
  204. package/dist/src/tools/memoryTool.js.map +1 -0
  205. package/dist/src/tools/memoryTool.test.d.ts +6 -0
  206. package/dist/src/tools/memoryTool.test.js +181 -0
  207. package/dist/src/tools/memoryTool.test.js.map +1 -0
  208. package/dist/src/tools/modifiable-tool.d.ts +29 -0
  209. package/dist/src/tools/modifiable-tool.js +85 -0
  210. package/dist/src/tools/modifiable-tool.js.map +1 -0
  211. package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
  212. package/dist/src/tools/modifiable-tool.test.js +204 -0
  213. package/dist/src/tools/modifiable-tool.test.js.map +1 -0
  214. package/dist/src/tools/read-file.d.ts +36 -0
  215. package/dist/src/tools/read-file.js +103 -0
  216. package/dist/src/tools/read-file.js.map +1 -0
  217. package/dist/src/tools/read-file.test.d.ts +6 -0
  218. package/dist/src/tools/read-file.test.js +180 -0
  219. package/dist/src/tools/read-file.test.js.map +1 -0
  220. package/dist/src/tools/read-many-files.d.ts +65 -0
  221. package/dist/src/tools/read-many-files.js +344 -0
  222. package/dist/src/tools/read-many-files.js.map +1 -0
  223. package/dist/src/tools/read-many-files.test.d.ts +6 -0
  224. package/dist/src/tools/read-many-files.test.js +300 -0
  225. package/dist/src/tools/read-many-files.test.js.map +1 -0
  226. package/dist/src/tools/shell.d.ts +43 -0
  227. package/dist/src/tools/shell.js +421 -0
  228. package/dist/src/tools/shell.js.map +1 -0
  229. package/dist/src/tools/shell.test.d.ts +6 -0
  230. package/dist/src/tools/shell.test.js +321 -0
  231. package/dist/src/tools/shell.test.js.map +1 -0
  232. package/dist/src/tools/tool-registry.d.ts +67 -0
  233. package/dist/src/tools/tool-registry.js +326 -0
  234. package/dist/src/tools/tool-registry.js.map +1 -0
  235. package/dist/src/tools/tool-registry.test.d.ts +6 -0
  236. package/dist/src/tools/tool-registry.test.js +353 -0
  237. package/dist/src/tools/tool-registry.test.js.map +1 -0
  238. package/dist/src/tools/tools.d.ts +179 -0
  239. package/dist/src/tools/tools.js +88 -0
  240. package/dist/src/tools/tools.js.map +1 -0
  241. package/dist/src/tools/web-fetch.d.ts +29 -0
  242. package/dist/src/tools/web-fetch.js +240 -0
  243. package/dist/src/tools/web-fetch.js.map +1 -0
  244. package/dist/src/tools/web-fetch.test.d.ts +6 -0
  245. package/dist/src/tools/web-fetch.test.js +70 -0
  246. package/dist/src/tools/web-fetch.test.js.map +1 -0
  247. package/dist/src/tools/web-search.d.ts +49 -0
  248. package/dist/src/tools/web-search.js +119 -0
  249. package/dist/src/tools/web-search.js.map +1 -0
  250. package/dist/src/tools/write-file.d.ts +50 -0
  251. package/dist/src/tools/write-file.js +261 -0
  252. package/dist/src/tools/write-file.js.map +1 -0
  253. package/dist/src/tools/write-file.test.d.ts +6 -0
  254. package/dist/src/tools/write-file.test.js +413 -0
  255. package/dist/src/tools/write-file.test.js.map +1 -0
  256. package/dist/src/utils/LruCache.d.ts +13 -0
  257. package/dist/src/utils/LruCache.js +38 -0
  258. package/dist/src/utils/LruCache.js.map +1 -0
  259. package/dist/src/utils/bfsFileSearch.d.ts +22 -0
  260. package/dist/src/utils/bfsFileSearch.js +62 -0
  261. package/dist/src/utils/bfsFileSearch.js.map +1 -0
  262. package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
  263. package/dist/src/utils/bfsFileSearch.test.js +129 -0
  264. package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
  265. package/dist/src/utils/editCorrector.d.ts +53 -0
  266. package/dist/src/utils/editCorrector.js +546 -0
  267. package/dist/src/utils/editCorrector.js.map +1 -0
  268. package/dist/src/utils/editCorrector.test.d.ts +6 -0
  269. package/dist/src/utils/editCorrector.test.js +560 -0
  270. package/dist/src/utils/editCorrector.test.js.map +1 -0
  271. package/dist/src/utils/editor.d.ts +28 -0
  272. package/dist/src/utils/editor.js +163 -0
  273. package/dist/src/utils/editor.js.map +1 -0
  274. package/dist/src/utils/editor.test.d.ts +6 -0
  275. package/dist/src/utils/editor.test.js +293 -0
  276. package/dist/src/utils/editor.test.js.map +1 -0
  277. package/dist/src/utils/errorReporting.d.ts +14 -0
  278. package/dist/src/utils/errorReporting.js +88 -0
  279. package/dist/src/utils/errorReporting.js.map +1 -0
  280. package/dist/src/utils/errorReporting.test.d.ts +6 -0
  281. package/dist/src/utils/errorReporting.test.js +124 -0
  282. package/dist/src/utils/errorReporting.test.js.map +1 -0
  283. package/dist/src/utils/errors.d.ts +14 -0
  284. package/dist/src/utils/errors.js +54 -0
  285. package/dist/src/utils/errors.js.map +1 -0
  286. package/dist/src/utils/fetch.d.ts +11 -0
  287. package/dist/src/utils/fetch.js +51 -0
  288. package/dist/src/utils/fetch.js.map +1 -0
  289. package/dist/src/utils/fileUtils.d.ts +49 -0
  290. package/dist/src/utils/fileUtils.js +284 -0
  291. package/dist/src/utils/fileUtils.js.map +1 -0
  292. package/dist/src/utils/fileUtils.test.d.ts +6 -0
  293. package/dist/src/utils/fileUtils.test.js +321 -0
  294. package/dist/src/utils/fileUtils.test.js.map +1 -0
  295. package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
  296. package/dist/src/utils/flashFallback.integration.test.js +112 -0
  297. package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
  298. package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
  299. package/dist/src/utils/generateContentResponseUtilities.js +92 -0
  300. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
  301. package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
  302. package/dist/src/utils/generateContentResponseUtilities.test.js +273 -0
  303. package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
  304. package/dist/src/utils/getFolderStructure.d.ts +30 -0
  305. package/dist/src/utils/getFolderStructure.js +247 -0
  306. package/dist/src/utils/getFolderStructure.js.map +1 -0
  307. package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
  308. package/dist/src/utils/getFolderStructure.test.js +300 -0
  309. package/dist/src/utils/getFolderStructure.test.js.map +1 -0
  310. package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
  311. package/dist/src/utils/gitIgnoreParser.js +64 -0
  312. package/dist/src/utils/gitIgnoreParser.js.map +1 -0
  313. package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
  314. package/dist/src/utils/gitIgnoreParser.test.js +145 -0
  315. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
  316. package/dist/src/utils/gitUtils.d.ts +17 -0
  317. package/dist/src/utils/gitUtils.js +61 -0
  318. package/dist/src/utils/gitUtils.js.map +1 -0
  319. package/dist/src/utils/memoryDiscovery.d.ts +14 -0
  320. package/dist/src/utils/memoryDiscovery.js +219 -0
  321. package/dist/src/utils/memoryDiscovery.js.map +1 -0
  322. package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
  323. package/dist/src/utils/memoryDiscovery.test.js +432 -0
  324. package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
  325. package/dist/src/utils/memoryImportProcessor.d.ts +35 -0
  326. package/dist/src/utils/memoryImportProcessor.js +141 -0
  327. package/dist/src/utils/memoryImportProcessor.js.map +1 -0
  328. package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
  329. package/dist/src/utils/memoryImportProcessor.test.js +170 -0
  330. package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
  331. package/dist/src/utils/messageInspectors.d.ts +8 -0
  332. package/dist/src/utils/messageInspectors.js +16 -0
  333. package/dist/src/utils/messageInspectors.js.map +1 -0
  334. package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
  335. package/dist/src/utils/nextSpeakerChecker.js +111 -0
  336. package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
  337. package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
  338. package/dist/src/utils/nextSpeakerChecker.test.js +152 -0
  339. package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
  340. package/dist/src/utils/paths.d.ts +47 -0
  341. package/dist/src/utils/paths.js +136 -0
  342. package/dist/src/utils/paths.js.map +1 -0
  343. package/dist/src/utils/retry.d.ts +21 -0
  344. package/dist/src/utils/retry.js +220 -0
  345. package/dist/src/utils/retry.js.map +1 -0
  346. package/dist/src/utils/retry.test.d.ts +6 -0
  347. package/dist/src/utils/retry.test.js +322 -0
  348. package/dist/src/utils/retry.test.js.map +1 -0
  349. package/dist/src/utils/schemaValidator.d.ts +17 -0
  350. package/dist/src/utils/schemaValidator.js +50 -0
  351. package/dist/src/utils/schemaValidator.js.map +1 -0
  352. package/dist/src/utils/session.d.ts +6 -0
  353. package/dist/src/utils/session.js +8 -0
  354. package/dist/src/utils/session.js.map +1 -0
  355. package/dist/src/utils/testUtils.d.ts +29 -0
  356. package/dist/src/utils/testUtils.js +70 -0
  357. package/dist/src/utils/testUtils.js.map +1 -0
  358. package/dist/src/utils/user_id.d.ts +17 -0
  359. package/dist/src/utils/user_id.js +70 -0
  360. package/dist/src/utils/user_id.js.map +1 -0
  361. package/dist/src/utils/user_id.test.d.ts +6 -0
  362. package/dist/src/utils/user_id.test.js +42 -0
  363. package/dist/src/utils/user_id.test.js.map +1 -0
  364. package/dist/tsconfig.tsbuildinfo +1 -0
  365. package/package.json +60 -0
@@ -0,0 +1,136 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import path from 'node:path';
7
+ import os from 'os';
8
+ import * as crypto from 'crypto';
9
+ export const GEMINI_DIR = '.gemini';
10
+ const TMP_DIR_NAME = 'tmp';
11
+ /**
12
+ * Replaces the home directory with a tilde.
13
+ * @param path - The path to tildeify.
14
+ * @returns The tildeified path.
15
+ */
16
+ export function tildeifyPath(path) {
17
+ const homeDir = os.homedir();
18
+ if (path.startsWith(homeDir)) {
19
+ return path.replace(homeDir, '~');
20
+ }
21
+ return path;
22
+ }
23
+ /**
24
+ * Shortens a path string if it exceeds maxLen, prioritizing the start and end segments.
25
+ * Example: /path/to/a/very/long/file.txt -> /path/.../long/file.txt
26
+ */
27
+ export function shortenPath(filePath, maxLen = 35) {
28
+ if (filePath.length <= maxLen) {
29
+ return filePath;
30
+ }
31
+ const parsedPath = path.parse(filePath);
32
+ const root = parsedPath.root;
33
+ const separator = path.sep;
34
+ // Get segments of the path *after* the root
35
+ const relativePath = filePath.substring(root.length);
36
+ const segments = relativePath.split(separator).filter((s) => s !== ''); // Filter out empty segments
37
+ // Handle cases with no segments after root (e.g., "/", "C:\") or only one segment
38
+ if (segments.length <= 1) {
39
+ // Fallback to simple start/end truncation for very short paths or single segments
40
+ const keepLen = Math.floor((maxLen - 3) / 2);
41
+ // Ensure keepLen is not negative if maxLen is very small
42
+ if (keepLen <= 0) {
43
+ return filePath.substring(0, maxLen - 3) + '...';
44
+ }
45
+ const start = filePath.substring(0, keepLen);
46
+ const end = filePath.substring(filePath.length - keepLen);
47
+ return `${start}...${end}`;
48
+ }
49
+ const firstDir = segments[0];
50
+ const lastSegment = segments[segments.length - 1];
51
+ const startComponent = root + firstDir;
52
+ const endPartSegments = [];
53
+ // Base length: separator + "..." + lastDir
54
+ let currentLength = separator.length + lastSegment.length;
55
+ // Iterate backwards through segments (excluding the first one)
56
+ for (let i = segments.length - 2; i >= 0; i--) {
57
+ const segment = segments[i];
58
+ // Length needed if we add this segment: current + separator + segment
59
+ const lengthWithSegment = currentLength + separator.length + segment.length;
60
+ if (lengthWithSegment <= maxLen) {
61
+ endPartSegments.unshift(segment); // Add to the beginning of the end part
62
+ currentLength = lengthWithSegment;
63
+ }
64
+ else {
65
+ break;
66
+ }
67
+ }
68
+ let result = endPartSegments.join(separator) + separator + lastSegment;
69
+ if (currentLength > maxLen) {
70
+ return result;
71
+ }
72
+ // Construct the final path
73
+ result = startComponent + separator + result;
74
+ // As a final check, if the result is somehow still too long
75
+ // truncate the result string from the beginning, prefixing with "...".
76
+ if (result.length > maxLen) {
77
+ return '...' + result.substring(result.length - maxLen - 3);
78
+ }
79
+ return result;
80
+ }
81
+ /**
82
+ * Calculates the relative path from a root directory to a target path.
83
+ * Ensures both paths are resolved before calculating.
84
+ * Returns '.' if the target path is the same as the root directory.
85
+ *
86
+ * @param targetPath The absolute or relative path to make relative.
87
+ * @param rootDirectory The absolute path of the directory to make the target path relative to.
88
+ * @returns The relative path from rootDirectory to targetPath.
89
+ */
90
+ export function makeRelative(targetPath, rootDirectory) {
91
+ const resolvedTargetPath = path.resolve(targetPath);
92
+ const resolvedRootDirectory = path.resolve(rootDirectory);
93
+ const relativePath = path.relative(resolvedRootDirectory, resolvedTargetPath);
94
+ // If the paths are the same, path.relative returns '', return '.' instead
95
+ return relativePath || '.';
96
+ }
97
+ /**
98
+ * Escapes spaces in a file path.
99
+ */
100
+ export function escapePath(filePath) {
101
+ let result = '';
102
+ for (let i = 0; i < filePath.length; i++) {
103
+ // Only escape spaces that are not already escaped.
104
+ if (filePath[i] === ' ' && (i === 0 || filePath[i - 1] !== '\\')) {
105
+ result += '\\ ';
106
+ }
107
+ else {
108
+ result += filePath[i];
109
+ }
110
+ }
111
+ return result;
112
+ }
113
+ /**
114
+ * Unescapes spaces in a file path.
115
+ */
116
+ export function unescapePath(filePath) {
117
+ return filePath.replace(/\\ /g, ' ');
118
+ }
119
+ /**
120
+ * Generates a unique hash for a project based on its root path.
121
+ * @param projectRoot The absolute path to the project's root directory.
122
+ * @returns A SHA256 hash of the project root path.
123
+ */
124
+ export function getProjectHash(projectRoot) {
125
+ return crypto.createHash('sha256').update(projectRoot).digest('hex');
126
+ }
127
+ /**
128
+ * Generates a unique temporary directory path for a project.
129
+ * @param projectRoot The absolute path to the project's root directory.
130
+ * @returns The path to the project's temporary directory.
131
+ */
132
+ export function getProjectTempDir(projectRoot) {
133
+ const hash = getProjectHash(projectRoot);
134
+ return path.join(os.homedir(), GEMINI_DIR, TMP_DIR_NAME, hash);
135
+ }
136
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AACpC,MAAM,YAAY,GAAG,KAAK,CAAC;AAE3B;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC7B,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,SAAiB,EAAE;IAC/D,IAAI,QAAQ,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;Q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AC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export interface RetryOptions {
7
+ maxAttempts: number;
8
+ initialDelayMs: number;
9
+ maxDelayMs: number;
10
+ shouldRetry: (error: Error) => boolean;
11
+ onPersistent429?: (authType?: string) => Promise<string | null>;
12
+ authType?: string;
13
+ }
14
+ /**
15
+ * Retries a function with exponential backoff and jitter.
16
+ * @param fn The asynchronous function to retry.
17
+ * @param options Optional retry configuration.
18
+ * @returns A promise that resolves with the result of the function if successful.
19
+ * @throws The last error encountered if all attempts fail.
20
+ */
21
+ export declare function retryWithBackoff<T>(fn: () => Promise<T>, options?: Partial<RetryOptions>): Promise<T>;
@@ -0,0 +1,220 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { AuthType } from '../core/contentGenerator.js';
7
+ const DEFAULT_RETRY_OPTIONS = {
8
+ maxAttempts: 5,
9
+ initialDelayMs: 5000,
10
+ maxDelayMs: 30000, // 30 seconds
11
+ shouldRetry: defaultShouldRetry,
12
+ };
13
+ /**
14
+ * Default predicate function to determine if a retry should be attempted.
15
+ * Retries on 429 (Too Many Requests) and 5xx server errors.
16
+ * @param error The error object.
17
+ * @returns True if the error is a transient error, false otherwise.
18
+ */
19
+ function defaultShouldRetry(error) {
20
+ // Check for common transient error status codes either in message or a status property
21
+ if (error && typeof error.status === 'number') {
22
+ const status = error.status;
23
+ if (status === 429 || (status >= 500 && status < 600)) {
24
+ return true;
25
+ }
26
+ }
27
+ if (error instanceof Error && error.message) {
28
+ if (error.message.includes('429'))
29
+ return true;
30
+ if (error.message.match(/5\d{2}/))
31
+ return true;
32
+ }
33
+ return false;
34
+ }
35
+ /**
36
+ * Delays execution for a specified number of milliseconds.
37
+ * @param ms The number of milliseconds to delay.
38
+ * @returns A promise that resolves after the delay.
39
+ */
40
+ function delay(ms) {
41
+ return new Promise((resolve) => setTimeout(resolve, ms));
42
+ }
43
+ /**
44
+ * Retries a function with exponential backoff and jitter.
45
+ * @param fn The asynchronous function to retry.
46
+ * @param options Optional retry configuration.
47
+ * @returns A promise that resolves with the result of the function if successful.
48
+ * @throws The last error encountered if all attempts fail.
49
+ */
50
+ export async function retryWithBackoff(fn, options) {
51
+ const { maxAttempts, initialDelayMs, maxDelayMs, onPersistent429, authType, shouldRetry, } = {
52
+ ...DEFAULT_RETRY_OPTIONS,
53
+ ...options,
54
+ };
55
+ let attempt = 0;
56
+ let currentDelay = initialDelayMs;
57
+ let consecutive429Count = 0;
58
+ while (attempt < maxAttempts) {
59
+ attempt++;
60
+ try {
61
+ return await fn();
62
+ }
63
+ catch (error) {
64
+ const errorStatus = getErrorStatus(error);
65
+ // Track consecutive 429 errors
66
+ if (errorStatus === 429) {
67
+ consecutive429Count++;
68
+ }
69
+ else {
70
+ consecutive429Count = 0;
71
+ }
72
+ // If we have persistent 429s and a fallback callback for OAuth
73
+ if (consecutive429Count >= 2 &&
74
+ onPersistent429 &&
75
+ authType === AuthType.LOGIN_WITH_GOOGLE) {
76
+ try {
77
+ const fallbackModel = await onPersistent429(authType);
78
+ if (fallbackModel) {
79
+ // Reset attempt counter and try with new model
80
+ attempt = 0;
81
+ consecutive429Count = 0;
82
+ currentDelay = initialDelayMs;
83
+ // With the model updated, we continue to the next attempt
84
+ continue;
85
+ }
86
+ }
87
+ catch (fallbackError) {
88
+ // If fallback fails, continue with original error
89
+ console.warn('Fallback to Flash model failed:', fallbackError);
90
+ }
91
+ }
92
+ // Check if we've exhausted retries or shouldn't retry
93
+ if (attempt >= maxAttempts || !shouldRetry(error)) {
94
+ throw error;
95
+ }
96
+ const { delayDurationMs, errorStatus: delayErrorStatus } = getDelayDurationAndStatus(error);
97
+ if (delayDurationMs > 0) {
98
+ // Respect Retry-After header if present and parsed
99
+ console.warn(`Attempt ${attempt} failed with status ${delayErrorStatus ?? 'unknown'}. Retrying after explicit delay of ${delayDurationMs}ms...`, error);
100
+ await delay(delayDurationMs);
101
+ // Reset currentDelay for next potential non-429 error, or if Retry-After is not present next time
102
+ currentDelay = initialDelayMs;
103
+ }
104
+ else {
105
+ // Fallback to exponential backoff with jitter
106
+ logRetryAttempt(attempt, error, errorStatus);
107
+ // Add jitter: +/- 30% of currentDelay
108
+ const jitter = currentDelay * 0.3 * (Math.random() * 2 - 1);
109
+ const delayWithJitter = Math.max(0, currentDelay + jitter);
110
+ await delay(delayWithJitter);
111
+ currentDelay = Math.min(maxDelayMs, currentDelay * 2);
112
+ }
113
+ }
114
+ }
115
+ // This line should theoretically be unreachable due to the throw in the catch block.
116
+ // Added for type safety and to satisfy the compiler that a promise is always returned.
117
+ throw new Error('Retry attempts exhausted');
118
+ }
119
+ /**
120
+ * Extracts the HTTP status code from an error object.
121
+ * @param error The error object.
122
+ * @returns The HTTP status code, or undefined if not found.
123
+ */
124
+ function getErrorStatus(error) {
125
+ if (typeof error === 'object' && error !== null) {
126
+ if ('status' in error && typeof error.status === 'number') {
127
+ return error.status;
128
+ }
129
+ // Check for error.response.status (common in axios errors)
130
+ if ('response' in error &&
131
+ typeof error.response === 'object' &&
132
+ error.response !== null) {
133
+ const response = error.response;
134
+ if ('status' in response && typeof response.status === 'number') {
135
+ return response.status;
136
+ }
137
+ }
138
+ }
139
+ return undefined;
140
+ }
141
+ /**
142
+ * Extracts the Retry-After delay from an error object's headers.
143
+ * @param error The error object.
144
+ * @returns The delay in milliseconds, or 0 if not found or invalid.
145
+ */
146
+ function getRetryAfterDelayMs(error) {
147
+ if (typeof error === 'object' && error !== null) {
148
+ // Check for error.response.headers (common in axios errors)
149
+ if ('response' in error &&
150
+ typeof error.response === 'object' &&
151
+ error.response !== null) {
152
+ const response = error.response;
153
+ if ('headers' in response &&
154
+ typeof response.headers === 'object' &&
155
+ response.headers !== null) {
156
+ const headers = response.headers;
157
+ const retryAfterHeader = headers['retry-after'];
158
+ if (typeof retryAfterHeader === 'string') {
159
+ const retryAfterSeconds = parseInt(retryAfterHeader, 10);
160
+ if (!isNaN(retryAfterSeconds)) {
161
+ return retryAfterSeconds * 1000;
162
+ }
163
+ // It might be an HTTP date
164
+ const retryAfterDate = new Date(retryAfterHeader);
165
+ if (!isNaN(retryAfterDate.getTime())) {
166
+ return Math.max(0, retryAfterDate.getTime() - Date.now());
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ return 0;
173
+ }
174
+ /**
175
+ * Determines the delay duration based on the error, prioritizing Retry-After header.
176
+ * @param error The error object.
177
+ * @returns An object containing the delay duration in milliseconds and the error status.
178
+ */
179
+ function getDelayDurationAndStatus(error) {
180
+ const errorStatus = getErrorStatus(error);
181
+ let delayDurationMs = 0;
182
+ if (errorStatus === 429) {
183
+ delayDurationMs = getRetryAfterDelayMs(error);
184
+ }
185
+ return { delayDurationMs, errorStatus };
186
+ }
187
+ /**
188
+ * Logs a message for a retry attempt when using exponential backoff.
189
+ * @param attempt The current attempt number.
190
+ * @param error The error that caused the retry.
191
+ * @param errorStatus The HTTP status code of the error, if available.
192
+ */
193
+ function logRetryAttempt(attempt, error, errorStatus) {
194
+ let message = `Attempt ${attempt} failed. Retrying with backoff...`;
195
+ if (errorStatus) {
196
+ message = `Attempt ${attempt} failed with status ${errorStatus}. Retrying with backoff...`;
197
+ }
198
+ if (errorStatus === 429) {
199
+ console.warn(message, error);
200
+ }
201
+ else if (errorStatus && errorStatus >= 500 && errorStatus < 600) {
202
+ console.error(message, error);
203
+ }
204
+ else if (error instanceof Error) {
205
+ // Fallback for errors that might not have a status but have a message
206
+ if (error.message.includes('429')) {
207
+ console.warn(`Attempt ${attempt} failed with 429 error (no Retry-After header). Retrying with backoff...`, error);
208
+ }
209
+ else if (error.message.match(/5\d{2}/)) {
210
+ console.error(`Attempt ${attempt} failed with 5xx error. Retrying with backoff...`, error);
211
+ }
212
+ else {
213
+ console.warn(message, error); // Default to warn for other errors
214
+ }
215
+ }
216
+ else {
217
+ console.warn(message, error); // Default to warn if error type is unknown
218
+ }
219
+ }
220
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../src/utils/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAWvD,MAAM,qBAAqB,GAAiB;IAC1C,WAAW,EAAE,CAAC;IACd,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK,EAAE,aAAa;IAChC,WAAW,EAAE,kBAAkB;CAChC,CAAC;AAEF;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,KAAsB;IAChD,uFAAuF;IACvF,IAAI,KAAK,IAAI,OAAQ,KAA6B,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACvE,MAAM,MAAM,GAAI,KAA4B,CAAC,MAAM,CAAC;QACpD,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,EAAoB,EACpB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