@google/gemini-cli-core 0.31.0-preview.3 → 0.32.0-preview.0

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 (308) hide show
  1. package/dist/docs/changelogs/index.md +22 -0
  2. package/dist/docs/changelogs/latest.md +307 -352
  3. package/dist/docs/changelogs/preview.md +391 -293
  4. package/dist/docs/cli/plan-mode.md +29 -7
  5. package/dist/docs/cli/settings.md +15 -6
  6. package/dist/docs/cli/telemetry.md +39 -11
  7. package/dist/docs/extensions/reference.md +36 -0
  8. package/dist/docs/get-started/installation.md +1 -1
  9. package/dist/docs/local-development.md +49 -43
  10. package/dist/docs/reference/configuration.md +32 -0
  11. package/dist/docs/reference/keyboard-shortcuts.md +6 -6
  12. package/dist/docs/reference/policy-engine.md +4 -3
  13. package/dist/docs/resources/faq.md +13 -0
  14. package/dist/docs/resources/tos-privacy.md +6 -0
  15. package/dist/docs/resources/uninstall.md +1 -10
  16. package/dist/docs/tools/mcp-server.md +22 -0
  17. package/dist/src/agents/a2a-client-manager.d.ts +7 -6
  18. package/dist/src/agents/a2a-client-manager.js +8 -9
  19. package/dist/src/agents/a2a-client-manager.js.map +1 -1
  20. package/dist/src/agents/a2a-client-manager.test.js +45 -31
  21. package/dist/src/agents/a2a-client-manager.test.js.map +1 -1
  22. package/dist/src/agents/a2aUtils.d.ts +25 -7
  23. package/dist/src/agents/a2aUtils.js +165 -58
  24. package/dist/src/agents/a2aUtils.js.map +1 -1
  25. package/dist/src/agents/a2aUtils.test.js +170 -27
  26. package/dist/src/agents/a2aUtils.test.js.map +1 -1
  27. package/dist/src/agents/generalist-agent.js +1 -2
  28. package/dist/src/agents/generalist-agent.js.map +1 -1
  29. package/dist/src/agents/registry.test.js +4 -2
  30. package/dist/src/agents/registry.test.js.map +1 -1
  31. package/dist/src/agents/remote-invocation.d.ts +2 -1
  32. package/dist/src/agents/remote-invocation.js +41 -22
  33. package/dist/src/agents/remote-invocation.js.map +1 -1
  34. package/dist/src/agents/remote-invocation.test.js +196 -56
  35. package/dist/src/agents/remote-invocation.test.js.map +1 -1
  36. package/dist/src/agents/subagent-tool-wrapper.js +1 -1
  37. package/dist/src/agents/subagent-tool-wrapper.test.js +1 -1
  38. package/dist/src/agents/subagent-tool.js +15 -2
  39. package/dist/src/agents/subagent-tool.js.map +1 -1
  40. package/dist/src/agents/subagent-tool.test.js +31 -0
  41. package/dist/src/agents/subagent-tool.test.js.map +1 -1
  42. package/dist/src/billing/billing.d.ts +80 -0
  43. package/dist/src/billing/billing.js +127 -0
  44. package/dist/src/billing/billing.js.map +1 -0
  45. package/dist/src/billing/billing.test.d.ts +6 -0
  46. package/dist/src/billing/billing.test.js +182 -0
  47. package/dist/src/billing/billing.test.js.map +1 -0
  48. package/dist/src/billing/index.d.ts +6 -0
  49. package/dist/src/billing/index.js +7 -0
  50. package/dist/src/billing/index.js.map +1 -0
  51. package/dist/src/code_assist/codeAssist.js +1 -1
  52. package/dist/src/code_assist/codeAssist.js.map +1 -1
  53. package/dist/src/code_assist/codeAssist.test.js +2 -2
  54. package/dist/src/code_assist/codeAssist.test.js.map +1 -1
  55. package/dist/src/code_assist/converter.d.ts +9 -4
  56. package/dist/src/code_assist/converter.js +17 -2
  57. package/dist/src/code_assist/converter.js.map +1 -1
  58. package/dist/src/code_assist/converter.test.js.map +1 -1
  59. package/dist/src/code_assist/oauth2.js +6 -3
  60. package/dist/src/code_assist/oauth2.js.map +1 -1
  61. package/dist/src/code_assist/oauth2.test.js +1 -0
  62. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  63. package/dist/src/code_assist/server.d.ts +9 -4
  64. package/dist/src/code_assist/server.js +86 -5
  65. package/dist/src/code_assist/server.js.map +1 -1
  66. package/dist/src/code_assist/server.test.js +11 -0
  67. package/dist/src/code_assist/server.test.js.map +1 -1
  68. package/dist/src/code_assist/setup.d.ts +2 -1
  69. package/dist/src/code_assist/setup.js +15 -4
  70. package/dist/src/code_assist/setup.js.map +1 -1
  71. package/dist/src/code_assist/types.d.ts +33 -10
  72. package/dist/src/code_assist/types.js.map +1 -1
  73. package/dist/src/config/config.d.ts +50 -4
  74. package/dist/src/config/config.js +77 -3
  75. package/dist/src/config/config.js.map +1 -1
  76. package/dist/src/config/config.test.js +151 -1
  77. package/dist/src/config/config.test.js.map +1 -1
  78. package/dist/src/config/storage.d.ts +1 -0
  79. package/dist/src/config/storage.js +3 -0
  80. package/dist/src/config/storage.js.map +1 -1
  81. package/dist/src/core/contentGenerator.d.ts +3 -2
  82. package/dist/src/core/contentGenerator.js +9 -2
  83. package/dist/src/core/contentGenerator.js.map +1 -1
  84. package/dist/src/core/coreToolScheduler.js +2 -1
  85. package/dist/src/core/coreToolScheduler.js.map +1 -1
  86. package/dist/src/core/coreToolScheduler.test.js +21 -2
  87. package/dist/src/core/coreToolScheduler.test.js.map +1 -1
  88. package/dist/src/core/fakeContentGenerator.d.ts +2 -1
  89. package/dist/src/core/fakeContentGenerator.js +1 -0
  90. package/dist/src/core/fakeContentGenerator.js.map +1 -1
  91. package/dist/src/core/geminiChat.js +6 -2
  92. package/dist/src/core/geminiChat.js.map +1 -1
  93. package/dist/src/core/geminiChat.test.js +34 -0
  94. package/dist/src/core/geminiChat.test.js.map +1 -1
  95. package/dist/src/core/localLiteRtLmClient.d.ts +24 -0
  96. package/dist/src/core/localLiteRtLmClient.js +77 -0
  97. package/dist/src/core/localLiteRtLmClient.js.map +1 -0
  98. package/dist/src/core/localLiteRtLmClient.test.d.ts +6 -0
  99. package/dist/src/core/localLiteRtLmClient.test.js +87 -0
  100. package/dist/src/core/localLiteRtLmClient.test.js.map +1 -0
  101. package/dist/src/core/loggingContentGenerator.d.ts +2 -1
  102. package/dist/src/core/loggingContentGenerator.js +39 -17
  103. package/dist/src/core/loggingContentGenerator.js.map +1 -1
  104. package/dist/src/core/loggingContentGenerator.test.js +122 -5
  105. package/dist/src/core/loggingContentGenerator.test.js.map +1 -1
  106. package/dist/src/core/prompts.test.js +1 -1
  107. package/dist/src/core/prompts.test.js.map +1 -1
  108. package/dist/src/fallback/handler.js +2 -0
  109. package/dist/src/fallback/handler.js.map +1 -1
  110. package/dist/src/fallback/types.d.ts +1 -1
  111. package/dist/src/generated/git-commit.d.ts +2 -2
  112. package/dist/src/generated/git-commit.js +2 -2
  113. package/dist/src/index.d.ts +5 -0
  114. package/dist/src/index.js +5 -0
  115. package/dist/src/index.js.map +1 -1
  116. package/dist/src/policy/config.d.ts +18 -6
  117. package/dist/src/policy/config.js +50 -12
  118. package/dist/src/policy/config.js.map +1 -1
  119. package/dist/src/policy/config.test.js +26 -26
  120. package/dist/src/policy/config.test.js.map +1 -1
  121. package/dist/src/policy/policies/plan.toml +1 -1
  122. package/dist/src/policy/policy-engine.d.ts +8 -0
  123. package/dist/src/policy/policy-engine.js +12 -0
  124. package/dist/src/policy/policy-engine.js.map +1 -1
  125. package/dist/src/policy/policy-engine.test.js +93 -0
  126. package/dist/src/policy/policy-engine.test.js.map +1 -1
  127. package/dist/src/policy/toml-loader.d.ts +1 -1
  128. package/dist/src/policy/toml-loader.js +4 -2
  129. package/dist/src/policy/toml-loader.js.map +1 -1
  130. package/dist/src/policy/toml-loader.test.js +15 -12
  131. package/dist/src/policy/toml-loader.test.js.map +1 -1
  132. package/dist/src/policy/workspace-policy.test.js +10 -10
  133. package/dist/src/prompts/snippets.js +43 -27
  134. package/dist/src/prompts/snippets.js.map +1 -1
  135. package/dist/src/routing/modelRouterService.js +19 -11
  136. package/dist/src/routing/modelRouterService.js.map +1 -1
  137. package/dist/src/routing/modelRouterService.test.js +38 -1
  138. package/dist/src/routing/modelRouterService.test.js.map +1 -1
  139. package/dist/src/routing/routingStrategy.d.ts +3 -2
  140. package/dist/src/routing/strategies/classifierStrategy.d.ts +2 -1
  141. package/dist/src/routing/strategies/classifierStrategy.js +1 -1
  142. package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
  143. package/dist/src/routing/strategies/classifierStrategy.test.js +15 -13
  144. package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
  145. package/dist/src/routing/strategies/compositeStrategy.d.ts +2 -1
  146. package/dist/src/routing/strategies/compositeStrategy.js +3 -3
  147. package/dist/src/routing/strategies/compositeStrategy.js.map +1 -1
  148. package/dist/src/routing/strategies/compositeStrategy.test.js +10 -8
  149. package/dist/src/routing/strategies/compositeStrategy.test.js.map +1 -1
  150. package/dist/src/routing/strategies/defaultStrategy.d.ts +2 -1
  151. package/dist/src/routing/strategies/defaultStrategy.js +1 -1
  152. package/dist/src/routing/strategies/defaultStrategy.js.map +1 -1
  153. package/dist/src/routing/strategies/defaultStrategy.test.js +8 -4
  154. package/dist/src/routing/strategies/defaultStrategy.test.js.map +1 -1
  155. package/dist/src/routing/strategies/fallbackStrategy.d.ts +2 -1
  156. package/dist/src/routing/strategies/fallbackStrategy.js +1 -1
  157. package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
  158. package/dist/src/routing/strategies/fallbackStrategy.test.js +6 -5
  159. package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
  160. package/dist/src/routing/strategies/gemmaClassifierStrategy.d.ts +14 -0
  161. package/dist/src/routing/strategies/gemmaClassifierStrategy.js +182 -0
  162. package/dist/src/routing/strategies/gemmaClassifierStrategy.js.map +1 -0
  163. package/dist/src/routing/strategies/gemmaClassifierStrategy.test.d.ts +6 -0
  164. package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js +218 -0
  165. package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js.map +1 -0
  166. package/dist/src/routing/strategies/numericalClassifierStrategy.d.ts +2 -1
  167. package/dist/src/routing/strategies/numericalClassifierStrategy.js +1 -1
  168. package/dist/src/routing/strategies/numericalClassifierStrategy.js.map +1 -1
  169. package/dist/src/routing/strategies/numericalClassifierStrategy.test.js +24 -22
  170. package/dist/src/routing/strategies/numericalClassifierStrategy.test.js.map +1 -1
  171. package/dist/src/routing/strategies/overrideStrategy.d.ts +2 -1
  172. package/dist/src/routing/strategies/overrideStrategy.js +1 -1
  173. package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
  174. package/dist/src/routing/strategies/overrideStrategy.test.js +5 -4
  175. package/dist/src/routing/strategies/overrideStrategy.test.js.map +1 -1
  176. package/dist/src/scheduler/scheduler.d.ts +1 -0
  177. package/dist/src/scheduler/scheduler.js +18 -7
  178. package/dist/src/scheduler/scheduler.js.map +1 -1
  179. package/dist/src/scheduler/scheduler.test.js +19 -1
  180. package/dist/src/scheduler/scheduler.test.js.map +1 -1
  181. package/dist/src/scheduler/scheduler_parallel.test.js +94 -3
  182. package/dist/src/scheduler/scheduler_parallel.test.js.map +1 -1
  183. package/dist/src/scheduler/tool-executor.js +21 -12
  184. package/dist/src/scheduler/tool-executor.js.map +1 -1
  185. package/dist/src/scheduler/tool-executor.test.js +54 -0
  186. package/dist/src/scheduler/tool-executor.test.js.map +1 -1
  187. package/dist/src/services/trackerService.d.ts +49 -0
  188. package/dist/src/services/trackerService.js +172 -0
  189. package/dist/src/services/trackerService.js.map +1 -0
  190. package/dist/src/services/trackerService.test.d.ts +6 -0
  191. package/dist/src/services/trackerService.test.js +117 -0
  192. package/dist/src/services/trackerService.test.js.map +1 -0
  193. package/dist/src/services/trackerTypes.d.ts +51 -0
  194. package/dist/src/services/trackerTypes.js +33 -0
  195. package/dist/src/services/trackerTypes.js.map +1 -0
  196. package/dist/src/telemetry/billingEvents.d.ts +75 -0
  197. package/dist/src/telemetry/billingEvents.js +181 -0
  198. package/dist/src/telemetry/billingEvents.js.map +1 -0
  199. package/dist/src/telemetry/billingEvents.test.d.ts +6 -0
  200. package/dist/src/telemetry/billingEvents.test.js +139 -0
  201. package/dist/src/telemetry/billingEvents.test.js.map +1 -0
  202. package/dist/src/telemetry/conseca-logger.test.js +1 -0
  203. package/dist/src/telemetry/conseca-logger.test.js.map +1 -1
  204. package/dist/src/telemetry/constants.d.ts +25 -0
  205. package/dist/src/telemetry/constants.js +29 -0
  206. package/dist/src/telemetry/constants.js.map +1 -1
  207. package/dist/src/telemetry/index.d.ts +3 -1
  208. package/dist/src/telemetry/index.js +5 -1
  209. package/dist/src/telemetry/index.js.map +1 -1
  210. package/dist/src/telemetry/loggers.d.ts +2 -0
  211. package/dist/src/telemetry/loggers.js +10 -0
  212. package/dist/src/telemetry/loggers.js.map +1 -1
  213. package/dist/src/telemetry/loggers.test.js +16 -0
  214. package/dist/src/telemetry/loggers.test.js.map +1 -1
  215. package/dist/src/telemetry/metrics.d.ts +28 -0
  216. package/dist/src/telemetry/metrics.js +40 -0
  217. package/dist/src/telemetry/metrics.js.map +1 -1
  218. package/dist/src/telemetry/sanitize.test.js +1 -0
  219. package/dist/src/telemetry/sanitize.test.js.map +1 -1
  220. package/dist/src/telemetry/sdk.test.js +1 -0
  221. package/dist/src/telemetry/sdk.test.js.map +1 -1
  222. package/dist/src/telemetry/telemetryAttributes.js +2 -0
  223. package/dist/src/telemetry/telemetryAttributes.js.map +1 -1
  224. package/dist/src/telemetry/trace.d.ts +2 -1
  225. package/dist/src/telemetry/trace.js +13 -18
  226. package/dist/src/telemetry/trace.js.map +1 -1
  227. package/dist/src/telemetry/trace.test.d.ts +6 -0
  228. package/dist/src/telemetry/trace.test.js +116 -0
  229. package/dist/src/telemetry/trace.test.js.map +1 -0
  230. package/dist/src/tools/confirmation-policy.test.js +1 -0
  231. package/dist/src/tools/confirmation-policy.test.js.map +1 -1
  232. package/dist/src/tools/definitions/model-family-sets/default-legacy.js +2 -2
  233. package/dist/src/tools/definitions/model-family-sets/default-legacy.js.map +1 -1
  234. package/dist/src/tools/definitions/model-family-sets/gemini-3.js +3 -3
  235. package/dist/src/tools/definitions/model-family-sets/gemini-3.js.map +1 -1
  236. package/dist/src/tools/grep-utils.d.ts +1 -1
  237. package/dist/src/tools/grep-utils.js +4 -4
  238. package/dist/src/tools/grep-utils.js.map +1 -1
  239. package/dist/src/tools/grep.d.ts +1 -1
  240. package/dist/src/tools/grep.js +9 -9
  241. package/dist/src/tools/grep.js.map +1 -1
  242. package/dist/src/tools/grep.test.js +8 -5
  243. package/dist/src/tools/grep.test.js.map +1 -1
  244. package/dist/src/tools/line-endings.test.js +3 -11
  245. package/dist/src/tools/line-endings.test.js.map +1 -1
  246. package/dist/src/tools/mcp-client-manager.d.ts +25 -0
  247. package/dist/src/tools/mcp-client-manager.js +66 -3
  248. package/dist/src/tools/mcp-client-manager.js.map +1 -1
  249. package/dist/src/tools/mcp-client-manager.test.js +47 -0
  250. package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
  251. package/dist/src/tools/mcp-client.d.ts +20 -9
  252. package/dist/src/tools/mcp-client.js +50 -46
  253. package/dist/src/tools/mcp-client.js.map +1 -1
  254. package/dist/src/tools/mcp-client.test.js +96 -84
  255. package/dist/src/tools/mcp-client.test.js.map +1 -1
  256. package/dist/src/tools/mcp-tool.d.ts +3 -3
  257. package/dist/src/tools/mcp-tool.js +1 -0
  258. package/dist/src/tools/mcp-tool.js.map +1 -1
  259. package/dist/src/tools/ripGrep.d.ts +1 -1
  260. package/dist/src/tools/ripGrep.js +7 -7
  261. package/dist/src/tools/ripGrep.js.map +1 -1
  262. package/dist/src/tools/ripGrep.test.js +10 -7
  263. package/dist/src/tools/ripGrep.test.js.map +1 -1
  264. package/dist/src/tools/tools.d.ts +1 -0
  265. package/dist/src/tools/tools.js +1 -0
  266. package/dist/src/tools/tools.js.map +1 -1
  267. package/dist/src/tools/write-file.js +4 -17
  268. package/dist/src/tools/write-file.js.map +1 -1
  269. package/dist/src/tools/write-file.test.js +29 -83
  270. package/dist/src/tools/write-file.test.js.map +1 -1
  271. package/dist/src/utils/editCorrector.d.ts +1 -42
  272. package/dist/src/utils/editCorrector.js +9 -461
  273. package/dist/src/utils/editCorrector.js.map +1 -1
  274. package/dist/src/utils/editCorrector.test.js +17 -421
  275. package/dist/src/utils/editCorrector.test.js.map +1 -1
  276. package/dist/src/utils/envExpansion.js.map +1 -1
  277. package/dist/src/utils/errors.js +7 -0
  278. package/dist/src/utils/errors.js.map +1 -1
  279. package/dist/src/utils/errors_timeout.test.d.ts +6 -0
  280. package/dist/src/utils/errors_timeout.test.js +40 -0
  281. package/dist/src/utils/errors_timeout.test.js.map +1 -0
  282. package/dist/src/utils/extensionLoader.js +35 -0
  283. package/dist/src/utils/extensionLoader.js.map +1 -1
  284. package/dist/src/utils/extensionLoader.test.js +36 -0
  285. package/dist/src/utils/extensionLoader.test.js.map +1 -1
  286. package/dist/src/utils/fetch.js +13 -2
  287. package/dist/src/utils/fetch.js.map +1 -1
  288. package/dist/src/utils/fileUtils.js +0 -1
  289. package/dist/src/utils/fileUtils.js.map +1 -1
  290. package/dist/src/utils/fileUtils.test.js +0 -1
  291. package/dist/src/utils/fileUtils.test.js.map +1 -1
  292. package/dist/src/utils/flashFallback.test.js +24 -0
  293. package/dist/src/utils/flashFallback.test.js.map +1 -1
  294. package/dist/src/utils/googleErrors.d.ts +2 -2
  295. package/dist/src/utils/googleQuotaErrors.d.ts +3 -1
  296. package/dist/src/utils/googleQuotaErrors.js +22 -12
  297. package/dist/src/utils/googleQuotaErrors.js.map +1 -1
  298. package/dist/src/utils/googleQuotaErrors.test.js +33 -1
  299. package/dist/src/utils/googleQuotaErrors.test.js.map +1 -1
  300. package/dist/src/utils/retry.js +4 -2
  301. package/dist/src/utils/retry.js.map +1 -1
  302. package/dist/src/utils/retry.test.js +20 -0
  303. package/dist/src/utils/retry.test.js.map +1 -1
  304. package/dist/src/utils/schemaValidator.js +0 -1
  305. package/dist/src/utils/schemaValidator.js.map +1 -1
  306. package/dist/tsconfig.tsbuildinfo +1 -1
  307. package/package.json +1 -1
  308. package/dist/google-gemini-cli-core-0.31.0-preview.2.tgz +0 -0
@@ -3,9 +3,6 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { EDIT_TOOL_NAME, GREP_TOOL_NAME, READ_FILE_TOOL_NAME, READ_MANY_FILES_TOOL_NAME, WRITE_FILE_TOOL_NAME, } from '../tools/tool-names.js';
7
- import { isFunctionResponse, isFunctionCall, } from '../utils/messageInspectors.js';
8
- import * as fs from 'node:fs';
9
6
  import { promptIdContext } from './promptIdContext.js';
10
7
  import { debugLogger } from './debugLogger.js';
11
8
  import { LRUCache } from 'mnemonist';
@@ -21,437 +18,30 @@ function getPromptId() {
21
18
  return promptIdContext.getStore() ?? `edit-corrector-${Date.now()}`;
22
19
  }
23
20
  const MAX_CACHE_SIZE = 50;
24
- // Cache for ensureCorrectEdit results
25
- const editCorrectionCache = new LRUCache(MAX_CACHE_SIZE);
26
21
  // Cache for ensureCorrectFileContent results
27
22
  const fileContentCorrectionCache = new LRUCache(MAX_CACHE_SIZE);
28
- /**
29
- * Extracts the timestamp from the .id value, which is in format
30
- * <tool.name>-<timestamp>-<uuid>
31
- * @param fcnId the ID value of a functionCall or functionResponse object
32
- * @returns -1 if the timestamp could not be extracted, else the timestamp (as a number)
33
- */
34
- function getTimestampFromFunctionId(fcnId) {
35
- const idParts = fcnId.split('-');
36
- if (idParts.length > 2) {
37
- const timestamp = parseInt(idParts[1], 10);
38
- if (!isNaN(timestamp)) {
39
- return timestamp;
40
- }
41
- }
42
- return -1;
43
- }
44
- /**
45
- * Will look through the gemini client history and determine when the most recent
46
- * edit to a target file occurred. If no edit happened, it will return -1
47
- * @param filePath the path to the file
48
- * @param client the geminiClient, so that we can get the history
49
- * @returns a DateTime (as a number) of when the last edit occurred, or -1 if no edit was found.
50
- */
51
- async function findLastEditTimestamp(filePath, client) {
52
- const history = client.getHistory() ?? [];
53
- // Tools that may reference the file path in their FunctionResponse `output`.
54
- const toolsInResp = new Set([
55
- WRITE_FILE_TOOL_NAME,
56
- EDIT_TOOL_NAME,
57
- READ_MANY_FILES_TOOL_NAME,
58
- GREP_TOOL_NAME,
59
- ]);
60
- // Tools that may reference the file path in their FunctionCall `args`.
61
- const toolsInCall = new Set([...toolsInResp, READ_FILE_TOOL_NAME]);
62
- // Iterate backwards to find the most recent relevant action.
63
- for (const entry of history.slice().reverse()) {
64
- if (!entry.parts)
65
- continue;
66
- for (const part of entry.parts) {
67
- let id;
68
- let content;
69
- // Check for a relevant FunctionCall with the file path in its arguments.
70
- if (isFunctionCall(entry) &&
71
- part.functionCall?.name &&
72
- toolsInCall.has(part.functionCall.name)) {
73
- id = part.functionCall.id;
74
- content = part.functionCall.args;
75
- }
76
- // Check for a relevant FunctionResponse with the file path in its output.
77
- else if (isFunctionResponse(entry) &&
78
- part.functionResponse?.name &&
79
- toolsInResp.has(part.functionResponse.name)) {
80
- const { response } = part.functionResponse;
81
- if (response && !('error' in response) && 'output' in response) {
82
- id = part.functionResponse.id;
83
- content = response['output'];
84
- }
85
- }
86
- if (!id || content === undefined)
87
- continue;
88
- // Use the "blunt hammer" approach to find the file path in the content.
89
- // Note that the tool response data is inconsistent in their formatting
90
- // with successes and errors - so, we just check for the existence
91
- // as the best guess to if error/failed occurred with the response.
92
- const stringified = JSON.stringify(content);
93
- if (!stringified.includes('Error') && // only applicable for functionResponse
94
- !stringified.includes('Failed') && // only applicable for functionResponse
95
- stringified.includes(filePath)) {
96
- return getTimestampFromFunctionId(id);
97
- }
98
- }
99
- }
100
- return -1;
101
- }
102
- /**
103
- * Attempts to correct edit parameters if the original old_string is not found.
104
- * It tries unescaping, and then LLM-based correction.
105
- * Results are cached to avoid redundant processing.
106
- *
107
- * @param currentContent The current content of the file.
108
- * @param originalParams The original EditToolParams
109
- * @param client The GeminiClient for LLM calls.
110
- * @returns A promise resolving to an object containing the (potentially corrected)
111
- * EditToolParams (as CorrectedEditParams) and the final occurrences count.
112
- */
113
- export async function ensureCorrectEdit(filePath, currentContent, originalParams, // This is the EditToolParams from edit.ts, without 'corrected'
114
- geminiClient, baseLlmClient, abortSignal, disableLLMCorrection) {
115
- const cacheKey = `${currentContent}---${originalParams.old_string}---${originalParams.new_string}`;
116
- const cachedResult = editCorrectionCache.get(cacheKey);
117
- if (cachedResult) {
118
- return cachedResult;
119
- }
120
- let finalNewString = originalParams.new_string;
121
- const newStringPotentiallyEscaped = unescapeStringForGeminiBug(originalParams.new_string) !==
122
- originalParams.new_string;
123
- const allowMultiple = originalParams.allow_multiple ?? false;
124
- let finalOldString = originalParams.old_string;
125
- let occurrences = countOccurrences(currentContent, finalOldString);
126
- const isOccurrencesMatch = allowMultiple
127
- ? occurrences > 0
128
- : occurrences === 1;
129
- if (isOccurrencesMatch) {
130
- if (newStringPotentiallyEscaped && !disableLLMCorrection) {
131
- finalNewString = await correctNewStringEscaping(baseLlmClient, finalOldString, originalParams.new_string, abortSignal);
132
- }
133
- }
134
- else if (occurrences > 1 && !allowMultiple) {
135
- // If user doesn't allow multiple but found multiple, return as-is (will fail validation later)
136
- const result = {
137
- params: { ...originalParams },
138
- occurrences,
139
- };
140
- editCorrectionCache.set(cacheKey, result);
141
- return result;
142
- }
143
- else {
144
- // occurrences is 0 or some other unexpected state initially
145
- const unescapedOldStringAttempt = unescapeStringForGeminiBug(originalParams.old_string);
146
- occurrences = countOccurrences(currentContent, unescapedOldStringAttempt);
147
- const isUnescapedOccurrencesMatch = allowMultiple
148
- ? occurrences > 0
149
- : occurrences === 1;
150
- if (isUnescapedOccurrencesMatch) {
151
- finalOldString = unescapedOldStringAttempt;
152
- if (newStringPotentiallyEscaped && !disableLLMCorrection) {
153
- finalNewString = await correctNewString(baseLlmClient, originalParams.old_string, // original old
154
- unescapedOldStringAttempt, // corrected old
155
- originalParams.new_string, // original new (which is potentially escaped)
156
- abortSignal);
157
- }
158
- }
159
- else if (occurrences === 0) {
160
- if (filePath) {
161
- // In order to keep from clobbering edits made outside our system,
162
- // let's check if there was a more recent edit to the file than what
163
- // our system has done
164
- const lastEditedByUsTime = await findLastEditTimestamp(filePath, geminiClient);
165
- // Add a 1-second buffer to account for timing inaccuracies. If the file
166
- // was modified more than a second after the last edit tool was run, we
167
- // can assume it was modified by something else.
168
- if (lastEditedByUsTime > 0) {
169
- const stats = fs.statSync(filePath);
170
- const diff = stats.mtimeMs - lastEditedByUsTime;
171
- if (diff > 2000) {
172
- // Hard coded for 2 seconds
173
- // This file was edited sooner
174
- const result = {
175
- params: { ...originalParams },
176
- occurrences: 0, // Explicitly 0 as LLM failed
177
- };
178
- editCorrectionCache.set(cacheKey, result);
179
- return result;
180
- }
181
- }
182
- }
183
- if (disableLLMCorrection) {
184
- const result = {
185
- params: { ...originalParams },
186
- occurrences: 0,
187
- };
188
- editCorrectionCache.set(cacheKey, result);
189
- return result;
190
- }
191
- const llmCorrectedOldString = await correctOldStringMismatch(baseLlmClient, currentContent, unescapedOldStringAttempt, abortSignal);
192
- const llmOldOccurrences = countOccurrences(currentContent, llmCorrectedOldString);
193
- const isLlmOccurrencesMatch = allowMultiple
194
- ? llmOldOccurrences > 0
195
- : llmOldOccurrences === 1;
196
- if (isLlmOccurrencesMatch) {
197
- finalOldString = llmCorrectedOldString;
198
- occurrences = llmOldOccurrences;
199
- if (newStringPotentiallyEscaped) {
200
- const baseNewStringForLLMCorrection = unescapeStringForGeminiBug(originalParams.new_string);
201
- finalNewString = await correctNewString(baseLlmClient, originalParams.old_string, // original old
202
- llmCorrectedOldString, // corrected old
203
- baseNewStringForLLMCorrection, // base new for correction
204
- abortSignal);
205
- }
206
- }
207
- else {
208
- // LLM correction also failed for old_string
209
- const result = {
210
- params: { ...originalParams },
211
- occurrences: 0, // Explicitly 0 as LLM failed
212
- };
213
- editCorrectionCache.set(cacheKey, result);
214
- return result;
215
- }
216
- }
217
- else {
218
- // Unescaping old_string resulted in > 1 occurrence but not allowMultiple
219
- const result = {
220
- params: { ...originalParams },
221
- occurrences, // This will be > 1
222
- };
223
- editCorrectionCache.set(cacheKey, result);
224
- return result;
225
- }
226
- }
227
- const { targetString, pair } = trimPairIfPossible(finalOldString, finalNewString, currentContent, allowMultiple);
228
- finalOldString = targetString;
229
- finalNewString = pair;
230
- // Final result construction
231
- const result = {
232
- params: {
233
- file_path: originalParams.file_path,
234
- old_string: finalOldString,
235
- new_string: finalNewString,
236
- },
237
- occurrences: countOccurrences(currentContent, finalOldString), // Recalculate occurrences with the final old_string
238
- };
239
- editCorrectionCache.set(cacheKey, result);
240
- return result;
241
- }
242
- export async function ensureCorrectFileContent(content, baseLlmClient, abortSignal, disableLLMCorrection = true) {
23
+ export async function ensureCorrectFileContent(content, baseLlmClient, abortSignal, disableLLMCorrection = true, aggressiveUnescape = false) {
243
24
  const cachedResult = fileContentCorrectionCache.get(content);
244
25
  if (cachedResult) {
245
26
  return cachedResult;
246
27
  }
247
- const contentPotentiallyEscaped = unescapeStringForGeminiBug(content) !== content;
248
- if (!contentPotentiallyEscaped) {
28
+ const unescapedContent = unescapeStringForGeminiBug(content);
29
+ if (unescapedContent === content) {
249
30
  fileContentCorrectionCache.set(content, content);
250
31
  return content;
251
32
  }
252
33
  if (disableLLMCorrection) {
253
- // If we can't use LLM, we should at least use the unescaped content
254
- // as it's likely better than the original if it was detected as potentially escaped.
255
- // unescapeStringForGeminiBug is a heuristic, not an LLM call.
256
- const unescaped = unescapeStringForGeminiBug(content);
257
- fileContentCorrectionCache.set(content, unescaped);
258
- return unescaped;
34
+ if (aggressiveUnescape) {
35
+ fileContentCorrectionCache.set(content, unescapedContent);
36
+ return unescapedContent;
37
+ }
38
+ fileContentCorrectionCache.set(content, content);
39
+ return content;
259
40
  }
260
41
  const correctedContent = await correctStringEscaping(content, baseLlmClient, abortSignal);
261
42
  fileContentCorrectionCache.set(content, correctedContent);
262
43
  return correctedContent;
263
44
  }
264
- // Define the expected JSON schema for the LLM response for old_string correction
265
- const OLD_STRING_CORRECTION_SCHEMA = {
266
- type: 'object',
267
- properties: {
268
- corrected_target_snippet: {
269
- type: 'string',
270
- description: 'The corrected version of the target snippet that exactly and uniquely matches a segment within the provided file content.',
271
- },
272
- },
273
- required: ['corrected_target_snippet'],
274
- };
275
- export async function correctOldStringMismatch(baseLlmClient, fileContent, problematicSnippet, abortSignal) {
276
- const prompt = `
277
- Context: A process needs to find an exact literal, unique match for a specific text snippet within a file's content. The provided snippet failed to match exactly. This is most likely because it has been overly escaped.
278
-
279
- Task: Analyze the provided file content and the problematic target snippet. Identify the segment in the file content that the snippet was *most likely* intended to match. Output the *exact*, literal text of that segment from the file content. Focus *only* on removing extra escape characters and correcting formatting, whitespace, or minor differences to achieve a PERFECT literal match. The output must be the exact literal text as it appears in the file.
280
-
281
- Problematic target snippet:
282
- \`\`\`
283
- ${problematicSnippet}
284
- \`\`\`
285
-
286
- File Content:
287
- \`\`\`
288
- ${fileContent}
289
- \`\`\`
290
-
291
- For example, if the problematic target snippet was "\\\\\\nconst greeting = \`Hello \\\\\`\${name}\\\\\`\`;" and the file content had content that looked like "\nconst greeting = \`Hello ${'\\`'}\${name}${'\\`'}\`;", then corrected_target_snippet should likely be "\nconst greeting = \`Hello ${'\\`'}\${name}${'\\`'}\`;" to fix the incorrect escaping to match the original file content.
292
- If the differences are only in whitespace or formatting, apply similar whitespace/formatting changes to the corrected_target_snippet.
293
-
294
- Return ONLY the corrected target snippet in the specified JSON format with the key 'corrected_target_snippet'. If no clear, unique match can be found, return an empty string for 'corrected_target_snippet'.
295
- `.trim();
296
- const contents = [{ role: 'user', parts: [{ text: prompt }] }];
297
- try {
298
- const result = await baseLlmClient.generateJson({
299
- modelConfigKey: { model: 'edit-corrector' },
300
- contents,
301
- schema: OLD_STRING_CORRECTION_SCHEMA,
302
- abortSignal,
303
- systemInstruction: CODE_CORRECTION_SYSTEM_PROMPT,
304
- promptId: getPromptId(),
305
- role: LlmRole.UTILITY_EDIT_CORRECTOR,
306
- });
307
- if (result &&
308
- typeof result['corrected_target_snippet'] === 'string' &&
309
- result['corrected_target_snippet'].length > 0) {
310
- return result['corrected_target_snippet'];
311
- }
312
- else {
313
- return problematicSnippet;
314
- }
315
- }
316
- catch (error) {
317
- if (abortSignal.aborted) {
318
- throw error;
319
- }
320
- debugLogger.warn('Error during LLM call for old string snippet correction:', error);
321
- return problematicSnippet;
322
- }
323
- }
324
- // Define the expected JSON schema for the new_string correction LLM response
325
- const NEW_STRING_CORRECTION_SCHEMA = {
326
- type: 'object',
327
- properties: {
328
- corrected_new_string: {
329
- type: 'string',
330
- description: 'The original_new_string adjusted to be a suitable replacement for the corrected_old_string, while maintaining the original intent of the change.',
331
- },
332
- },
333
- required: ['corrected_new_string'],
334
- };
335
- /**
336
- * Adjusts the new_string to align with a corrected old_string, maintaining the original intent.
337
- */
338
- export async function correctNewString(baseLlmClient, originalOldString, correctedOldString, originalNewString, abortSignal) {
339
- if (originalOldString === correctedOldString) {
340
- return originalNewString;
341
- }
342
- const prompt = `
343
- Context: A text replacement operation was planned. The original text to be replaced (original_old_string) was slightly different from the actual text in the file (corrected_old_string). The original_old_string has now been corrected to match the file content.
344
- We now need to adjust the replacement text (original_new_string) so that it makes sense as a replacement for the corrected_old_string, while preserving the original intent of the change.
345
-
346
- original_old_string (what was initially intended to be found):
347
- \`\`\`
348
- ${originalOldString}
349
- \`\`\`
350
-
351
- corrected_old_string (what was actually found in the file and will be replaced):
352
- \`\`\`
353
- ${correctedOldString}
354
- \`\`\`
355
-
356
- original_new_string (what was intended to replace original_old_string):
357
- \`\`\`
358
- ${originalNewString}
359
- \`\`\`
360
-
361
- Task: Based on the differences between original_old_string and corrected_old_string, and the content of original_new_string, generate a corrected_new_string. This corrected_new_string should be what original_new_string would have been if it was designed to replace corrected_old_string directly, while maintaining the spirit of the original transformation.
362
-
363
- For example, if original_old_string was "\\\\\\nconst greeting = \`Hello \\\\\`\${name}\\\\\`\`;" and corrected_old_string is "\nconst greeting = \`Hello ${'\\`'}\${name}${'\\`'}\`;", and original_new_string was "\\\\\\nconst greeting = \`Hello \\\\\`\${name} \${lastName}\\\\\`\`;", then corrected_new_string should likely be "\nconst greeting = \`Hello ${'\\`'}\${name} \${lastName}${'\\`'}\`;" to fix the incorrect escaping.
364
- If the differences are only in whitespace or formatting, apply similar whitespace/formatting changes to the corrected_new_string.
365
-
366
- Return ONLY the corrected string in the specified JSON format with the key 'corrected_new_string'. If no adjustment is deemed necessary or possible, return the original_new_string.
367
- `.trim();
368
- const contents = [{ role: 'user', parts: [{ text: prompt }] }];
369
- try {
370
- const result = await baseLlmClient.generateJson({
371
- modelConfigKey: { model: 'edit-corrector' },
372
- contents,
373
- schema: NEW_STRING_CORRECTION_SCHEMA,
374
- abortSignal,
375
- systemInstruction: CODE_CORRECTION_SYSTEM_PROMPT,
376
- promptId: getPromptId(),
377
- role: LlmRole.UTILITY_EDIT_CORRECTOR,
378
- });
379
- if (result &&
380
- typeof result['corrected_new_string'] === 'string' &&
381
- result['corrected_new_string'].length > 0) {
382
- return result['corrected_new_string'];
383
- }
384
- else {
385
- return originalNewString;
386
- }
387
- }
388
- catch (error) {
389
- if (abortSignal.aborted) {
390
- throw error;
391
- }
392
- debugLogger.warn('Error during LLM call for new_string correction:', error);
393
- return originalNewString;
394
- }
395
- }
396
- const CORRECT_NEW_STRING_ESCAPING_SCHEMA = {
397
- type: 'object',
398
- properties: {
399
- corrected_new_string_escaping: {
400
- type: 'string',
401
- description: 'The new_string with corrected escaping, ensuring it is a proper replacement for the old_string, especially considering potential over-escaping issues from previous LLM generations.',
402
- },
403
- },
404
- required: ['corrected_new_string_escaping'],
405
- };
406
- export async function correctNewStringEscaping(baseLlmClient, oldString, potentiallyProblematicNewString, abortSignal) {
407
- const prompt = `
408
- Context: A text replacement operation is planned. The text to be replaced (old_string) has been correctly identified in the file. However, the replacement text (new_string) might have been improperly escaped by a previous LLM generation (e.g. too many backslashes for newlines like \\n instead of \n, or unnecessarily quotes like \\"Hello\\" instead of "Hello").
409
-
410
- old_string (this is the exact text that will be replaced):
411
- \`\`\`
412
- ${oldString}
413
- \`\`\`
414
-
415
- potentially_problematic_new_string (this is the text that should replace old_string, but MIGHT have bad escaping, or might be entirely correct):
416
- \`\`\`
417
- ${potentiallyProblematicNewString}
418
- \`\`\`
419
-
420
- Task: Analyze the potentially_problematic_new_string. If it's syntactically invalid due to incorrect escaping (e.g., "\n", "\t", "\\", "\\'", "\\""), correct the invalid syntax. The goal is to ensure the new_string, when inserted into the code, will be a valid and correctly interpreted.
421
-
422
- For example, if old_string is "foo" and potentially_problematic_new_string is "bar\\nbaz", the corrected_new_string_escaping should be "bar\nbaz".
423
- If potentially_problematic_new_string is console.log(\\"Hello World\\"), it should be console.log("Hello World").
424
-
425
- Return ONLY the corrected string in the specified JSON format with the key 'corrected_new_string_escaping'. If no escaping correction is needed, return the original potentially_problematic_new_string.
426
- `.trim();
427
- const contents = [{ role: 'user', parts: [{ text: prompt }] }];
428
- try {
429
- const result = await baseLlmClient.generateJson({
430
- modelConfigKey: { model: 'edit-corrector' },
431
- contents,
432
- schema: CORRECT_NEW_STRING_ESCAPING_SCHEMA,
433
- abortSignal,
434
- systemInstruction: CODE_CORRECTION_SYSTEM_PROMPT,
435
- promptId: getPromptId(),
436
- role: LlmRole.UTILITY_EDIT_CORRECTOR,
437
- });
438
- if (result &&
439
- typeof result['corrected_new_string_escaping'] === 'string' &&
440
- result['corrected_new_string_escaping'].length > 0) {
441
- return result['corrected_new_string_escaping'];
442
- }
443
- else {
444
- return potentiallyProblematicNewString;
445
- }
446
- }
447
- catch (error) {
448
- if (abortSignal.aborted) {
449
- throw error;
450
- }
451
- debugLogger.warn('Error during LLM call for new_string escaping correction:', error);
452
- return potentiallyProblematicNewString;
453
- }
454
- }
455
45
  const CORRECT_STRING_ESCAPING_SCHEMA = {
456
46
  type: 'object',
457
47
  properties: {
@@ -506,32 +96,6 @@ Return ONLY the corrected string in the specified JSON format with the key 'corr
506
96
  return potentiallyProblematicString;
507
97
  }
508
98
  }
509
- function trimPreservingTrailingNewline(str) {
510
- const trimmedEnd = str.trimEnd();
511
- const trailingWhitespace = str.slice(trimmedEnd.length);
512
- const trailingNewlines = trailingWhitespace.replace(/[^\r\n]/g, '');
513
- return str.trim() + trailingNewlines;
514
- }
515
- function trimPairIfPossible(target, trimIfTargetTrims, currentContent, allowMultiple) {
516
- const trimmedTargetString = trimPreservingTrailingNewline(target);
517
- if (target.length !== trimmedTargetString.length) {
518
- const trimmedTargetOccurrences = countOccurrences(currentContent, trimmedTargetString);
519
- const isMatch = allowMultiple
520
- ? trimmedTargetOccurrences > 0
521
- : trimmedTargetOccurrences === 1;
522
- if (isMatch) {
523
- const trimmedReactiveString = trimPreservingTrailingNewline(trimIfTargetTrims);
524
- return {
525
- targetString: trimmedTargetString,
526
- pair: trimmedReactiveString,
527
- };
528
- }
529
- }
530
- return {
531
- targetString: target,
532
- pair: trimIfTargetTrims,
533
- };
534
- }
535
99
  /**
536
100
  * Unescapes a string that might have been overly escaped by an LLM.
537
101
  */
@@ -572,23 +136,7 @@ export function unescapeStringForGeminiBug(inputString) {
572
136
  }
573
137
  });
574
138
  }
575
- /**
576
- * Counts occurrences of a substring in a string
577
- */
578
- export function countOccurrences(str, substr) {
579
- if (substr === '') {
580
- return 0;
581
- }
582
- let count = 0;
583
- let pos = str.indexOf(substr);
584
- while (pos !== -1) {
585
- count++;
586
- pos = str.indexOf(substr, pos + substr.length); // Start search after the current match
587
- }
588
- return count;
589
- }
590
139
  export function resetEditCorrectorCaches_TEST_ONLY() {
591
- editCorrectionCache.clear();
592
140
  fileContentCorrectionCache.clear();
593
141
  }
594
142
  //# sourceMappingURL=editCorrector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editCorrector.js","sourceRoot":"","sources":["../../../src/utils/editCorrector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,MAAM,6BAA6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