@google/gemini-cli-core 0.0.3-preview.4 → 0.0.3

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 (490) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +12 -2
  3. package/dist/index.d.ts +6 -2
  4. package/dist/index.js +6 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/src/code_assist/codeAssist.d.ts +2 -0
  7. package/dist/src/code_assist/codeAssist.js +12 -0
  8. package/dist/src/code_assist/codeAssist.js.map +1 -1
  9. package/dist/src/code_assist/converter.d.ts +3 -1
  10. package/dist/src/code_assist/converter.js +2 -1
  11. package/dist/src/code_assist/converter.js.map +1 -1
  12. package/dist/src/code_assist/converter.test.js +10 -0
  13. package/dist/src/code_assist/converter.test.js.map +1 -1
  14. package/dist/src/code_assist/oauth-credential-storage.d.ts +25 -0
  15. package/dist/src/code_assist/oauth-credential-storage.js +109 -0
  16. package/dist/src/code_assist/oauth-credential-storage.js.map +1 -0
  17. package/dist/src/code_assist/oauth-credential-storage.test.js +136 -0
  18. package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -0
  19. package/dist/src/code_assist/oauth2.js +92 -29
  20. package/dist/src/code_assist/oauth2.js.map +1 -1
  21. package/dist/src/code_assist/oauth2.test.js +729 -339
  22. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  23. package/dist/src/code_assist/server.d.ts +1 -1
  24. package/dist/src/code_assist/server.js +24 -1
  25. package/dist/src/code_assist/server.js.map +1 -1
  26. package/dist/src/code_assist/server.test.js +25 -0
  27. package/dist/src/code_assist/server.test.js.map +1 -1
  28. package/dist/src/code_assist/types.d.ts +17 -2
  29. package/dist/src/config/config.d.ts +72 -12
  30. package/dist/src/config/config.js +196 -64
  31. package/dist/src/config/config.js.map +1 -1
  32. package/dist/src/config/config.test.js +305 -178
  33. package/dist/src/config/config.test.js.map +1 -1
  34. package/dist/src/config/models.d.ts +16 -0
  35. package/dist/src/config/models.js +29 -0
  36. package/dist/src/config/models.js.map +1 -1
  37. package/dist/src/config/models.test.d.ts +6 -0
  38. package/dist/src/config/models.test.js +55 -0
  39. package/dist/src/config/models.test.js.map +1 -0
  40. package/dist/src/config/storage.d.ts +2 -0
  41. package/dist/src/config/storage.js +6 -1
  42. package/dist/src/config/storage.js.map +1 -1
  43. package/dist/src/config/storage.test.js +4 -0
  44. package/dist/src/config/storage.test.js.map +1 -1
  45. package/dist/src/confirmation-bus/index.d.ts +7 -0
  46. package/dist/src/confirmation-bus/index.js +8 -0
  47. package/dist/src/confirmation-bus/index.js.map +1 -0
  48. package/dist/src/confirmation-bus/message-bus.d.ts +17 -0
  49. package/dist/src/confirmation-bus/message-bus.js +81 -0
  50. package/dist/src/confirmation-bus/message-bus.js.map +1 -0
  51. package/dist/src/confirmation-bus/message-bus.test.d.ts +6 -0
  52. package/dist/src/confirmation-bus/message-bus.test.js +164 -0
  53. package/dist/src/confirmation-bus/message-bus.test.js.map +1 -0
  54. package/dist/src/confirmation-bus/types.d.ts +38 -0
  55. package/dist/src/confirmation-bus/types.js +15 -0
  56. package/dist/src/confirmation-bus/types.js.map +1 -0
  57. package/dist/src/core/baseLlmClient.d.ts +46 -0
  58. package/dist/src/core/baseLlmClient.js +112 -0
  59. package/dist/src/core/baseLlmClient.js.map +1 -0
  60. package/dist/src/core/baseLlmClient.test.d.ts +6 -0
  61. package/dist/src/core/baseLlmClient.test.js +253 -0
  62. package/dist/src/core/baseLlmClient.test.js.map +1 -0
  63. package/dist/src/core/client.d.ts +16 -21
  64. package/dist/src/core/client.js +145 -232
  65. package/dist/src/core/client.js.map +1 -1
  66. package/dist/src/core/client.test.js +393 -492
  67. package/dist/src/core/client.test.js.map +1 -1
  68. package/dist/src/core/contentGenerator.d.ts +2 -3
  69. package/dist/src/core/contentGenerator.js +0 -4
  70. package/dist/src/core/contentGenerator.js.map +1 -1
  71. package/dist/src/core/contentGenerator.test.js +1 -3
  72. package/dist/src/core/contentGenerator.test.js.map +1 -1
  73. package/dist/src/core/coreToolScheduler.d.ts +8 -3
  74. package/dist/src/core/coreToolScheduler.js +106 -5
  75. package/dist/src/core/coreToolScheduler.js.map +1 -1
  76. package/dist/src/core/coreToolScheduler.test.js +233 -5
  77. package/dist/src/core/coreToolScheduler.test.js.map +1 -1
  78. package/dist/src/core/geminiChat.d.ts +38 -32
  79. package/dist/src/core/geminiChat.js +209 -219
  80. package/dist/src/core/geminiChat.js.map +1 -1
  81. package/dist/src/core/geminiChat.test.js +674 -386
  82. package/dist/src/core/geminiChat.test.js.map +1 -1
  83. package/dist/src/core/loggingContentGenerator.js +13 -16
  84. package/dist/src/core/loggingContentGenerator.js.map +1 -1
  85. package/dist/src/core/nonInteractiveToolExecutor.test.js +59 -1
  86. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
  87. package/dist/src/core/prompts.d.ts +5 -0
  88. package/dist/src/core/prompts.js +63 -42
  89. package/dist/src/core/prompts.js.map +1 -1
  90. package/dist/src/core/prompts.test.js +130 -1
  91. package/dist/src/core/prompts.test.js.map +1 -1
  92. package/dist/src/core/subagent.js +7 -10
  93. package/dist/src/core/subagent.js.map +1 -1
  94. package/dist/src/core/subagent.test.js +32 -22
  95. package/dist/src/core/subagent.test.js.map +1 -1
  96. package/dist/src/core/turn.d.ts +21 -5
  97. package/dist/src/core/turn.js +45 -11
  98. package/dist/src/core/turn.js.map +1 -1
  99. package/dist/src/core/turn.test.js +340 -100
  100. package/dist/src/core/turn.test.js.map +1 -1
  101. package/dist/src/fallback/handler.d.ts +7 -0
  102. package/dist/src/fallback/handler.js +51 -0
  103. package/dist/src/fallback/handler.js.map +1 -0
  104. package/dist/src/fallback/handler.test.d.ts +6 -0
  105. package/dist/src/fallback/handler.test.js +130 -0
  106. package/dist/src/fallback/handler.test.js.map +1 -0
  107. package/dist/src/fallback/types.d.ts +14 -0
  108. package/dist/src/fallback/types.js +7 -0
  109. package/dist/src/fallback/types.js.map +1 -0
  110. package/dist/src/generated/git-commit.d.ts +2 -2
  111. package/dist/src/generated/git-commit.js +2 -2
  112. package/dist/src/generated/git-commit.js.map +1 -1
  113. package/dist/src/ide/constants.d.ts +3 -0
  114. package/dist/src/ide/constants.js +3 -0
  115. package/dist/src/ide/constants.js.map +1 -1
  116. package/dist/src/ide/detect-ide.d.ts +42 -14
  117. package/dist/src/ide/detect-ide.js +22 -68
  118. package/dist/src/ide/detect-ide.js.map +1 -1
  119. package/dist/src/ide/detect-ide.test.js +11 -51
  120. package/dist/src/ide/detect-ide.test.js.map +1 -1
  121. package/dist/src/ide/ide-client.d.ts +60 -18
  122. package/dist/src/ide/ide-client.js +275 -53
  123. package/dist/src/ide/ide-client.js.map +1 -1
  124. package/dist/src/ide/ide-client.test.js +239 -6
  125. package/dist/src/ide/ide-client.test.js.map +1 -1
  126. package/dist/src/ide/ide-installer.d.ts +2 -2
  127. package/dist/src/ide/ide-installer.js +15 -11
  128. package/dist/src/ide/ide-installer.js.map +1 -1
  129. package/dist/src/ide/ide-installer.test.js +30 -12
  130. package/dist/src/ide/ide-installer.test.js.map +1 -1
  131. package/dist/src/ide/ideContext.d.ts +35 -365
  132. package/dist/src/ide/ideContext.js +60 -106
  133. package/dist/src/ide/ideContext.js.map +1 -1
  134. package/dist/src/ide/ideContext.test.js +152 -24
  135. package/dist/src/ide/ideContext.test.js.map +1 -1
  136. package/dist/src/ide/process-utils.d.ts +0 -1
  137. package/dist/src/ide/process-utils.js +43 -25
  138. package/dist/src/ide/process-utils.js.map +1 -1
  139. package/dist/src/ide/process-utils.test.js +90 -4
  140. package/dist/src/ide/process-utils.test.js.map +1 -1
  141. package/dist/src/ide/types.d.ts +486 -0
  142. package/dist/src/ide/types.js +138 -0
  143. package/dist/src/ide/types.js.map +1 -0
  144. package/dist/src/index.d.ts +10 -2
  145. package/dist/src/index.js +11 -2
  146. package/dist/src/index.js.map +1 -1
  147. package/dist/src/mcp/oauth-provider.d.ts +15 -12
  148. package/dist/src/mcp/oauth-provider.js +63 -56
  149. package/dist/src/mcp/oauth-provider.js.map +1 -1
  150. package/dist/src/mcp/oauth-provider.test.js +74 -35
  151. package/dist/src/mcp/oauth-provider.test.js.map +1 -1
  152. package/dist/src/mcp/oauth-token-storage.d.ts +14 -10
  153. package/dist/src/mcp/oauth-token-storage.js +52 -20
  154. package/dist/src/mcp/oauth-token-storage.js.map +1 -1
  155. package/dist/src/mcp/oauth-token-storage.test.js +255 -162
  156. package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
  157. package/dist/src/mcp/token-storage/base-token-storage.d.ts +1 -1
  158. package/dist/src/mcp/token-storage/base-token-storage.js +1 -1
  159. package/dist/src/mcp/token-storage/base-token-storage.js.map +1 -1
  160. package/dist/src/mcp/token-storage/base-token-storage.test.js +1 -1
  161. package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -1
  162. package/dist/src/mcp/token-storage/file-token-storage.d.ts +24 -0
  163. package/dist/src/mcp/token-storage/file-token-storage.js +144 -0
  164. package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -0
  165. package/dist/src/mcp/token-storage/file-token-storage.test.d.ts +6 -0
  166. package/dist/src/mcp/token-storage/file-token-storage.test.js +235 -0
  167. package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -0
  168. package/dist/src/mcp/token-storage/hybrid-token-storage.d.ts +23 -0
  169. package/dist/src/mcp/token-storage/hybrid-token-storage.js +78 -0
  170. package/dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
  171. package/dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +6 -0
  172. package/dist/src/mcp/token-storage/hybrid-token-storage.test.js +193 -0
  173. package/dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +1 -0
  174. package/dist/src/mcp/token-storage/index.d.ts +11 -0
  175. package/dist/src/mcp/token-storage/index.js +12 -0
  176. package/dist/src/mcp/token-storage/index.js.map +1 -0
  177. package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +31 -0
  178. package/dist/src/mcp/token-storage/keychain-token-storage.js +190 -0
  179. package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
  180. package/dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +6 -0
  181. package/dist/src/mcp/token-storage/keychain-token-storage.test.js +254 -0
  182. package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -0
  183. package/dist/src/mcp/token-storage/types.d.ts +4 -0
  184. package/dist/src/mcp/token-storage/types.js +5 -1
  185. package/dist/src/mcp/token-storage/types.js.map +1 -1
  186. package/dist/src/output/json-formatter.d.ts +11 -0
  187. package/dist/src/output/json-formatter.js +30 -0
  188. package/dist/src/output/json-formatter.js.map +1 -0
  189. package/dist/src/output/json-formatter.test.d.ts +6 -0
  190. package/dist/src/output/json-formatter.test.js +266 -0
  191. package/dist/src/output/json-formatter.test.js.map +1 -0
  192. package/dist/src/output/types.d.ts +20 -0
  193. package/dist/src/output/types.js +11 -0
  194. package/dist/src/output/types.js.map +1 -0
  195. package/dist/src/policy/index.d.ts +7 -0
  196. package/dist/src/policy/index.js +8 -0
  197. package/dist/src/policy/index.js.map +1 -0
  198. package/dist/src/policy/policy-engine.d.ts +30 -0
  199. package/dist/src/policy/policy-engine.js +92 -0
  200. package/dist/src/policy/policy-engine.js.map +1 -0
  201. package/dist/src/policy/policy-engine.test.d.ts +6 -0
  202. package/dist/src/policy/policy-engine.test.js +515 -0
  203. package/dist/src/policy/policy-engine.test.js.map +1 -0
  204. package/dist/src/policy/stable-stringify.d.ts +58 -0
  205. package/dist/src/policy/stable-stringify.js +122 -0
  206. package/dist/src/policy/stable-stringify.js.map +1 -0
  207. package/dist/src/policy/types.d.ts +47 -0
  208. package/dist/src/policy/types.js +12 -0
  209. package/dist/src/policy/types.js.map +1 -0
  210. package/dist/src/routing/modelRouterService.d.ts +23 -0
  211. package/dist/src/routing/modelRouterService.js +70 -0
  212. package/dist/src/routing/modelRouterService.js.map +1 -0
  213. package/dist/src/routing/modelRouterService.test.d.ts +6 -0
  214. package/dist/src/routing/modelRouterService.test.js +98 -0
  215. package/dist/src/routing/modelRouterService.test.js.map +1 -0
  216. package/dist/src/routing/routingStrategy.d.ts +62 -0
  217. package/dist/src/routing/routingStrategy.js +7 -0
  218. package/dist/src/routing/routingStrategy.js.map +1 -0
  219. package/dist/src/routing/strategies/classifierStrategy.d.ts +12 -0
  220. package/dist/src/routing/strategies/classifierStrategy.js +173 -0
  221. package/dist/src/routing/strategies/classifierStrategy.js.map +1 -0
  222. package/dist/src/routing/strategies/classifierStrategy.test.d.ts +6 -0
  223. package/dist/src/routing/strategies/classifierStrategy.test.js +192 -0
  224. package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -0
  225. package/dist/src/routing/strategies/compositeStrategy.d.ts +26 -0
  226. package/dist/src/routing/strategies/compositeStrategy.js +67 -0
  227. package/dist/src/routing/strategies/compositeStrategy.js.map +1 -0
  228. package/dist/src/routing/strategies/compositeStrategy.test.d.ts +6 -0
  229. package/dist/src/routing/strategies/compositeStrategy.test.js +123 -0
  230. package/dist/src/routing/strategies/compositeStrategy.test.js.map +1 -0
  231. package/dist/src/routing/strategies/defaultStrategy.d.ts +12 -0
  232. package/dist/src/routing/strategies/defaultStrategy.js +20 -0
  233. package/dist/src/routing/strategies/defaultStrategy.js.map +1 -0
  234. package/dist/src/routing/strategies/defaultStrategy.test.d.ts +6 -0
  235. package/dist/src/routing/strategies/defaultStrategy.test.js +26 -0
  236. package/dist/src/routing/strategies/defaultStrategy.test.js.map +1 -0
  237. package/dist/src/routing/strategies/fallbackStrategy.d.ts +12 -0
  238. package/dist/src/routing/strategies/fallbackStrategy.js +25 -0
  239. package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -0
  240. package/dist/src/routing/strategies/fallbackStrategy.test.d.ts +6 -0
  241. package/dist/src/routing/strategies/fallbackStrategy.test.js +55 -0
  242. package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -0
  243. package/dist/src/routing/strategies/overrideStrategy.d.ts +15 -0
  244. package/dist/src/routing/strategies/overrideStrategy.js +28 -0
  245. package/dist/src/routing/strategies/overrideStrategy.js.map +1 -0
  246. package/dist/src/routing/strategies/overrideStrategy.test.d.ts +6 -0
  247. package/dist/src/routing/strategies/overrideStrategy.test.js +42 -0
  248. package/dist/src/routing/strategies/overrideStrategy.test.js.map +1 -0
  249. package/dist/src/services/chatRecordingService.d.ts +7 -13
  250. package/dist/src/services/chatRecordingService.js +28 -19
  251. package/dist/src/services/chatRecordingService.js.map +1 -1
  252. package/dist/src/services/chatRecordingService.test.js +62 -20
  253. package/dist/src/services/chatRecordingService.test.js.map +1 -1
  254. package/dist/src/services/fileDiscoveryService.d.ts +10 -0
  255. package/dist/src/services/fileDiscoveryService.js +31 -17
  256. package/dist/src/services/fileDiscoveryService.js.map +1 -1
  257. package/dist/src/services/gitService.js +9 -12
  258. package/dist/src/services/gitService.js.map +1 -1
  259. package/dist/src/services/gitService.test.js +10 -20
  260. package/dist/src/services/gitService.test.js.map +1 -1
  261. package/dist/src/services/loopDetectionService.d.ts +5 -0
  262. package/dist/src/services/loopDetectionService.js +36 -20
  263. package/dist/src/services/loopDetectionService.js.map +1 -1
  264. package/dist/src/services/loopDetectionService.test.js +41 -12
  265. package/dist/src/services/loopDetectionService.test.js.map +1 -1
  266. package/dist/src/services/shellExecutionService.d.ts +34 -2
  267. package/dist/src/services/shellExecutionService.js +192 -43
  268. package/dist/src/services/shellExecutionService.js.map +1 -1
  269. package/dist/src/services/shellExecutionService.test.js +184 -55
  270. package/dist/src/services/shellExecutionService.test.js.map +1 -1
  271. package/dist/src/telemetry/activity-detector.d.ts +41 -0
  272. package/dist/src/telemetry/activity-detector.js +61 -0
  273. package/dist/src/telemetry/activity-detector.js.map +1 -0
  274. package/dist/src/telemetry/activity-detector.test.d.ts +6 -0
  275. package/dist/src/telemetry/activity-detector.test.js +136 -0
  276. package/dist/src/telemetry/activity-detector.test.js.map +1 -0
  277. package/dist/src/telemetry/activity-types.d.ts +19 -0
  278. package/dist/src/telemetry/activity-types.js +21 -0
  279. package/dist/src/telemetry/activity-types.js.map +1 -0
  280. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +16 -2
  281. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +143 -24
  282. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  283. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +101 -1
  284. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
  285. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +19 -2
  286. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +48 -2
  287. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  288. package/dist/src/telemetry/constants.d.ts +8 -0
  289. package/dist/src/telemetry/constants.js +8 -0
  290. package/dist/src/telemetry/constants.js.map +1 -1
  291. package/dist/src/telemetry/gcp-exporters.d.ts +34 -0
  292. package/dist/src/telemetry/gcp-exporters.js +117 -0
  293. package/dist/src/telemetry/gcp-exporters.js.map +1 -0
  294. package/dist/src/telemetry/gcp-exporters.test.d.ts +6 -0
  295. package/dist/src/telemetry/gcp-exporters.test.js +318 -0
  296. package/dist/src/telemetry/gcp-exporters.test.js.map +1 -0
  297. package/dist/src/telemetry/high-water-mark-tracker.d.ts +43 -0
  298. package/dist/src/telemetry/high-water-mark-tracker.js +88 -0
  299. package/dist/src/telemetry/high-water-mark-tracker.js.map +1 -0
  300. package/dist/src/telemetry/high-water-mark-tracker.test.d.ts +6 -0
  301. package/dist/src/telemetry/high-water-mark-tracker.test.js +152 -0
  302. package/dist/src/telemetry/high-water-mark-tracker.test.js.map +1 -0
  303. package/dist/src/telemetry/index.d.ts +7 -2
  304. package/dist/src/telemetry/index.js +7 -2
  305. package/dist/src/telemetry/index.js.map +1 -1
  306. package/dist/src/telemetry/loggers.d.ts +8 -1
  307. package/dist/src/telemetry/loggers.js +140 -8
  308. package/dist/src/telemetry/loggers.js.map +1 -1
  309. package/dist/src/telemetry/loggers.test.js +268 -39
  310. package/dist/src/telemetry/loggers.test.js.map +1 -1
  311. package/dist/src/telemetry/metrics.d.ts +4 -3
  312. package/dist/src/telemetry/metrics.js +33 -10
  313. package/dist/src/telemetry/metrics.js.map +1 -1
  314. package/dist/src/telemetry/metrics.test.js +47 -25
  315. package/dist/src/telemetry/metrics.test.js.map +1 -1
  316. package/dist/src/telemetry/rate-limiter.d.ts +48 -0
  317. package/dist/src/telemetry/rate-limiter.js +100 -0
  318. package/dist/src/telemetry/rate-limiter.js.map +1 -0
  319. package/dist/src/telemetry/rate-limiter.test.d.ts +6 -0
  320. package/dist/src/telemetry/rate-limiter.test.js +207 -0
  321. package/dist/src/telemetry/rate-limiter.test.js.map +1 -0
  322. package/dist/src/telemetry/sdk.js +16 -1
  323. package/dist/src/telemetry/sdk.js.map +1 -1
  324. package/dist/src/telemetry/sdk.test.js +95 -0
  325. package/dist/src/telemetry/sdk.test.js.map +1 -1
  326. package/dist/src/telemetry/types.d.ts +70 -6
  327. package/dist/src/telemetry/types.js +112 -8
  328. package/dist/src/telemetry/types.js.map +1 -1
  329. package/dist/src/telemetry/uiTelemetry.d.ts +1 -1
  330. package/dist/src/telemetry/uiTelemetry.js +6 -7
  331. package/dist/src/telemetry/uiTelemetry.js.map +1 -1
  332. package/dist/src/telemetry/uiTelemetry.test.js +15 -15
  333. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
  334. package/dist/src/test-utils/index.d.ts +6 -0
  335. package/dist/src/test-utils/index.js +7 -0
  336. package/dist/src/test-utils/index.js.map +1 -0
  337. package/dist/src/test-utils/mock-tool.d.ts +41 -0
  338. package/dist/src/test-utils/mock-tool.js +51 -0
  339. package/dist/src/test-utils/mock-tool.js.map +1 -0
  340. package/dist/src/tools/diffOptions.js +21 -13
  341. package/dist/src/tools/diffOptions.js.map +1 -1
  342. package/dist/src/tools/diffOptions.test.js +58 -22
  343. package/dist/src/tools/diffOptions.test.js.map +1 -1
  344. package/dist/src/tools/edit.d.ts +2 -2
  345. package/dist/src/tools/edit.js +35 -44
  346. package/dist/src/tools/edit.js.map +1 -1
  347. package/dist/src/tools/edit.test.js +124 -13
  348. package/dist/src/tools/edit.test.js.map +1 -1
  349. package/dist/src/tools/glob.d.ts +5 -1
  350. package/dist/src/tools/glob.js +24 -17
  351. package/dist/src/tools/glob.js.map +1 -1
  352. package/dist/src/tools/glob.test.js +51 -0
  353. package/dist/src/tools/glob.test.js.map +1 -1
  354. package/dist/src/tools/ls.js +19 -32
  355. package/dist/src/tools/ls.js.map +1 -1
  356. package/dist/src/tools/ls.test.js +140 -280
  357. package/dist/src/tools/ls.test.js.map +1 -1
  358. package/dist/src/tools/mcp-client-manager.d.ts +5 -3
  359. package/dist/src/tools/mcp-client-manager.js +13 -4
  360. package/dist/src/tools/mcp-client-manager.js.map +1 -1
  361. package/dist/src/tools/mcp-client-manager.test.js +20 -1
  362. package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
  363. package/dist/src/tools/mcp-client.d.ts +5 -5
  364. package/dist/src/tools/mcp-client.js +40 -35
  365. package/dist/src/tools/mcp-client.js.map +1 -1
  366. package/dist/src/tools/mcp-client.test.js +3 -3
  367. package/dist/src/tools/mcp-client.test.js.map +1 -1
  368. package/dist/src/tools/mcp-tool.d.ts +3 -2
  369. package/dist/src/tools/mcp-tool.js +9 -9
  370. package/dist/src/tools/mcp-tool.js.map +1 -1
  371. package/dist/src/tools/mcp-tool.test.js +28 -7
  372. package/dist/src/tools/mcp-tool.test.js.map +1 -1
  373. package/dist/src/tools/memoryTool.js +5 -33
  374. package/dist/src/tools/memoryTool.js.map +1 -1
  375. package/dist/src/tools/read-file.js +8 -3
  376. package/dist/src/tools/read-file.js.map +1 -1
  377. package/dist/src/tools/read-file.test.js +29 -0
  378. package/dist/src/tools/read-file.test.js.map +1 -1
  379. package/dist/src/tools/read-many-files.d.ts +1 -1
  380. package/dist/src/tools/read-many-files.js +18 -50
  381. package/dist/src/tools/read-many-files.js.map +1 -1
  382. package/dist/src/tools/read-many-files.test.js +4 -4
  383. package/dist/src/tools/read-many-files.test.js.map +1 -1
  384. package/dist/src/tools/ripGrep.d.ts +8 -0
  385. package/dist/src/tools/ripGrep.js +26 -1
  386. package/dist/src/tools/ripGrep.js.map +1 -1
  387. package/dist/src/tools/ripGrep.test.js +107 -5
  388. package/dist/src/tools/ripGrep.test.js.map +1 -1
  389. package/dist/src/tools/shell.d.ts +12 -2
  390. package/dist/src/tools/shell.js +20 -24
  391. package/dist/src/tools/shell.js.map +1 -1
  392. package/dist/src/tools/shell.test.js +35 -70
  393. package/dist/src/tools/shell.test.js.map +1 -1
  394. package/dist/src/tools/smart-edit.d.ts +72 -0
  395. package/dist/src/tools/smart-edit.js +594 -0
  396. package/dist/src/tools/smart-edit.js.map +1 -0
  397. package/dist/src/tools/smart-edit.test.d.ts +6 -0
  398. package/dist/src/tools/smart-edit.test.js +419 -0
  399. package/dist/src/tools/smart-edit.test.js.map +1 -0
  400. package/dist/src/tools/tool-registry.d.ts +2 -1
  401. package/dist/src/tools/tool-registry.js +6 -5
  402. package/dist/src/tools/tool-registry.js.map +1 -1
  403. package/dist/src/tools/tools.d.ts +14 -7
  404. package/dist/src/tools/tools.js +9 -2
  405. package/dist/src/tools/tools.js.map +1 -1
  406. package/dist/src/tools/web-fetch.js +4 -3
  407. package/dist/src/tools/web-fetch.js.map +1 -1
  408. package/dist/src/tools/web-search.d.ts +1 -1
  409. package/dist/src/tools/web-search.js +3 -1
  410. package/dist/src/tools/web-search.js.map +1 -1
  411. package/dist/src/tools/write-file.js +14 -19
  412. package/dist/src/tools/write-file.js.map +1 -1
  413. package/dist/src/tools/write-file.test.js +99 -19
  414. package/dist/src/tools/write-file.test.js.map +1 -1
  415. package/dist/src/utils/bfsFileSearch.js +11 -5
  416. package/dist/src/utils/bfsFileSearch.js.map +1 -1
  417. package/dist/src/utils/editCorrector.d.ts +7 -6
  418. package/dist/src/utils/editCorrector.js +61 -18
  419. package/dist/src/utils/editCorrector.js.map +1 -1
  420. package/dist/src/utils/editCorrector.test.js +30 -79
  421. package/dist/src/utils/editCorrector.test.js.map +1 -1
  422. package/dist/src/utils/editor.js +31 -44
  423. package/dist/src/utils/editor.js.map +1 -1
  424. package/dist/src/utils/editor.test.js +61 -75
  425. package/dist/src/utils/editor.test.js.map +1 -1
  426. package/dist/src/utils/errorParsing.js +2 -2
  427. package/dist/src/utils/errorParsing.js.map +1 -1
  428. package/dist/src/utils/errorParsing.test.js +7 -7
  429. package/dist/src/utils/errorParsing.test.js.map +1 -1
  430. package/dist/src/utils/errors.d.ts +6 -0
  431. package/dist/src/utils/errors.js +10 -0
  432. package/dist/src/utils/errors.js.map +1 -1
  433. package/dist/src/utils/fileUtils.d.ts +20 -3
  434. package/dist/src/utils/fileUtils.js +154 -32
  435. package/dist/src/utils/fileUtils.js.map +1 -1
  436. package/dist/src/utils/fileUtils.test.js +347 -29
  437. package/dist/src/utils/fileUtils.test.js.map +1 -1
  438. package/dist/src/utils/flashFallback.test.d.ts +6 -0
  439. package/dist/src/utils/{flashFallback.integration.test.js → flashFallback.test.js} +31 -27
  440. package/dist/src/utils/flashFallback.test.js.map +1 -0
  441. package/dist/src/utils/geminiIgnoreParser.d.ts +18 -0
  442. package/dist/src/utils/geminiIgnoreParser.js +61 -0
  443. package/dist/src/utils/geminiIgnoreParser.js.map +1 -0
  444. package/dist/src/utils/geminiIgnoreParser.test.d.ts +6 -0
  445. package/dist/src/utils/geminiIgnoreParser.test.js +50 -0
  446. package/dist/src/utils/geminiIgnoreParser.test.js.map +1 -0
  447. package/dist/src/utils/gitIgnoreParser.d.ts +3 -7
  448. package/dist/src/utils/gitIgnoreParser.js +125 -34
  449. package/dist/src/utils/gitIgnoreParser.js.map +1 -1
  450. package/dist/src/utils/gitIgnoreParser.test.js +66 -35
  451. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
  452. package/dist/src/utils/llm-edit-fixer.d.ts +26 -0
  453. package/dist/src/utils/llm-edit-fixer.js +121 -0
  454. package/dist/src/utils/llm-edit-fixer.js.map +1 -0
  455. package/dist/src/utils/llm-edit-fixer.test.d.ts +6 -0
  456. package/dist/src/utils/llm-edit-fixer.test.js +105 -0
  457. package/dist/src/utils/llm-edit-fixer.test.js.map +1 -0
  458. package/dist/src/utils/memoryDiscovery.d.ts +5 -4
  459. package/dist/src/utils/memoryDiscovery.js +10 -9
  460. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  461. package/dist/src/utils/memoryDiscovery.test.js +50 -25
  462. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  463. package/dist/src/utils/nextSpeakerChecker.d.ts +2 -2
  464. package/dist/src/utils/nextSpeakerChecker.js +8 -2
  465. package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
  466. package/dist/src/utils/nextSpeakerChecker.test.js +75 -64
  467. package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
  468. package/dist/src/utils/promptIdContext.d.ts +7 -0
  469. package/dist/src/utils/promptIdContext.js +8 -0
  470. package/dist/src/utils/promptIdContext.js.map +1 -0
  471. package/dist/src/utils/shell-utils.d.ts +5 -0
  472. package/dist/src/utils/shell-utils.js +23 -0
  473. package/dist/src/utils/shell-utils.js.map +1 -1
  474. package/dist/src/utils/terminalSerializer.d.ts +28 -0
  475. package/dist/src/utils/terminalSerializer.js +432 -0
  476. package/dist/src/utils/terminalSerializer.js.map +1 -0
  477. package/dist/src/utils/terminalSerializer.test.d.ts +6 -0
  478. package/dist/src/utils/terminalSerializer.test.js +176 -0
  479. package/dist/src/utils/terminalSerializer.test.js.map +1 -0
  480. package/dist/src/utils/textUtils.d.ts +5 -0
  481. package/dist/src/utils/textUtils.js +14 -0
  482. package/dist/src/utils/textUtils.js.map +1 -1
  483. package/dist/src/utils/textUtils.test.d.ts +6 -0
  484. package/dist/src/utils/textUtils.test.js +59 -0
  485. package/dist/src/utils/textUtils.test.js.map +1 -0
  486. package/dist/tsconfig.tsbuildinfo +1 -1
  487. package/package.json +9 -3
  488. package/dist/google-gemini-cli-core-0.3.0-preview.3.tgz +0 -0
  489. package/dist/src/utils/flashFallback.integration.test.js.map +0 -1
  490. /package/dist/src/{utils/flashFallback.integration.test.d.ts → code_assist/oauth-credential-storage.test.d.ts} +0 -0
@@ -0,0 +1,486 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * A file that is open in the IDE.
9
+ */
10
+ export declare const FileSchema: z.ZodObject<{
11
+ /**
12
+ * The absolute path to the file.
13
+ */
14
+ path: z.ZodString;
15
+ /**
16
+ * The unix timestamp of when the file was last focused.
17
+ */
18
+ timestamp: z.ZodNumber;
19
+ /**
20
+ * Whether the file is the currently active file. Only one file can be active at a time.
21
+ */
22
+ isActive: z.ZodOptional<z.ZodBoolean>;
23
+ /**
24
+ * The text that is currently selected in the active file.
25
+ */
26
+ selectedText: z.ZodOptional<z.ZodString>;
27
+ /**
28
+ * The cursor position in the active file.
29
+ */
30
+ cursor: z.ZodOptional<z.ZodObject<{
31
+ /**
32
+ * The 1-based line number.
33
+ */
34
+ line: z.ZodNumber;
35
+ /**
36
+ * The 1-based character offset.
37
+ */
38
+ character: z.ZodNumber;
39
+ }, "strip", z.ZodTypeAny, {
40
+ line: number;
41
+ character: number;
42
+ }, {
43
+ line: number;
44
+ character: number;
45
+ }>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ path: string;
48
+ timestamp: number;
49
+ cursor?: {
50
+ line: number;
51
+ character: number;
52
+ } | undefined;
53
+ isActive?: boolean | undefined;
54
+ selectedText?: string | undefined;
55
+ }, {
56
+ path: string;
57
+ timestamp: number;
58
+ cursor?: {
59
+ line: number;
60
+ character: number;
61
+ } | undefined;
62
+ isActive?: boolean | undefined;
63
+ selectedText?: string | undefined;
64
+ }>;
65
+ export type File = z.infer<typeof FileSchema>;
66
+ /**
67
+ * The context of the IDE.
68
+ */
69
+ export declare const IdeContextSchema: z.ZodObject<{
70
+ workspaceState: z.ZodOptional<z.ZodObject<{
71
+ /**
72
+ * The list of files that are currently open.
73
+ */
74
+ openFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
75
+ /**
76
+ * The absolute path to the file.
77
+ */
78
+ path: z.ZodString;
79
+ /**
80
+ * The unix timestamp of when the file was last focused.
81
+ */
82
+ timestamp: z.ZodNumber;
83
+ /**
84
+ * Whether the file is the currently active file. Only one file can be active at a time.
85
+ */
86
+ isActive: z.ZodOptional<z.ZodBoolean>;
87
+ /**
88
+ * The text that is currently selected in the active file.
89
+ */
90
+ selectedText: z.ZodOptional<z.ZodString>;
91
+ /**
92
+ * The cursor position in the active file.
93
+ */
94
+ cursor: z.ZodOptional<z.ZodObject<{
95
+ /**
96
+ * The 1-based line number.
97
+ */
98
+ line: z.ZodNumber;
99
+ /**
100
+ * The 1-based character offset.
101
+ */
102
+ character: z.ZodNumber;
103
+ }, "strip", z.ZodTypeAny, {
104
+ line: number;
105
+ character: number;
106
+ }, {
107
+ line: number;
108
+ character: number;
109
+ }>>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ path: string;
112
+ timestamp: number;
113
+ cursor?: {
114
+ line: number;
115
+ character: number;
116
+ } | undefined;
117
+ isActive?: boolean | undefined;
118
+ selectedText?: string | undefined;
119
+ }, {
120
+ path: string;
121
+ timestamp: number;
122
+ cursor?: {
123
+ line: number;
124
+ character: number;
125
+ } | undefined;
126
+ isActive?: boolean | undefined;
127
+ selectedText?: string | undefined;
128
+ }>, "many">>;
129
+ /**
130
+ * Whether the workspace is trusted.
131
+ */
132
+ isTrusted: z.ZodOptional<z.ZodBoolean>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ openFiles?: {
135
+ path: string;
136
+ timestamp: number;
137
+ cursor?: {
138
+ line: number;
139
+ character: number;
140
+ } | undefined;
141
+ isActive?: boolean | undefined;
142
+ selectedText?: string | undefined;
143
+ }[] | undefined;
144
+ isTrusted?: boolean | undefined;
145
+ }, {
146
+ openFiles?: {
147
+ path: string;
148
+ timestamp: number;
149
+ cursor?: {
150
+ line: number;
151
+ character: number;
152
+ } | undefined;
153
+ isActive?: boolean | undefined;
154
+ selectedText?: string | undefined;
155
+ }[] | undefined;
156
+ isTrusted?: boolean | undefined;
157
+ }>>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ workspaceState?: {
160
+ openFiles?: {
161
+ path: string;
162
+ timestamp: number;
163
+ cursor?: {
164
+ line: number;
165
+ character: number;
166
+ } | undefined;
167
+ isActive?: boolean | undefined;
168
+ selectedText?: string | undefined;
169
+ }[] | undefined;
170
+ isTrusted?: boolean | undefined;
171
+ } | undefined;
172
+ }, {
173
+ workspaceState?: {
174
+ openFiles?: {
175
+ path: string;
176
+ timestamp: number;
177
+ cursor?: {
178
+ line: number;
179
+ character: number;
180
+ } | undefined;
181
+ isActive?: boolean | undefined;
182
+ selectedText?: string | undefined;
183
+ }[] | undefined;
184
+ isTrusted?: boolean | undefined;
185
+ } | undefined;
186
+ }>;
187
+ export type IdeContext = z.infer<typeof IdeContextSchema>;
188
+ /**
189
+ * A notification that the IDE context has been updated.
190
+ */
191
+ export declare const IdeContextNotificationSchema: z.ZodObject<{
192
+ jsonrpc: z.ZodLiteral<"2.0">;
193
+ method: z.ZodLiteral<"ide/contextUpdate">;
194
+ params: z.ZodObject<{
195
+ workspaceState: z.ZodOptional<z.ZodObject<{
196
+ /**
197
+ * The list of files that are currently open.
198
+ */
199
+ openFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
200
+ /**
201
+ * The absolute path to the file.
202
+ */
203
+ path: z.ZodString;
204
+ /**
205
+ * The unix timestamp of when the file was last focused.
206
+ */
207
+ timestamp: z.ZodNumber;
208
+ /**
209
+ * Whether the file is the currently active file. Only one file can be active at a time.
210
+ */
211
+ isActive: z.ZodOptional<z.ZodBoolean>;
212
+ /**
213
+ * The text that is currently selected in the active file.
214
+ */
215
+ selectedText: z.ZodOptional<z.ZodString>;
216
+ /**
217
+ * The cursor position in the active file.
218
+ */
219
+ cursor: z.ZodOptional<z.ZodObject<{
220
+ /**
221
+ * The 1-based line number.
222
+ */
223
+ line: z.ZodNumber;
224
+ /**
225
+ * The 1-based character offset.
226
+ */
227
+ character: z.ZodNumber;
228
+ }, "strip", z.ZodTypeAny, {
229
+ line: number;
230
+ character: number;
231
+ }, {
232
+ line: number;
233
+ character: number;
234
+ }>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ path: string;
237
+ timestamp: number;
238
+ cursor?: {
239
+ line: number;
240
+ character: number;
241
+ } | undefined;
242
+ isActive?: boolean | undefined;
243
+ selectedText?: string | undefined;
244
+ }, {
245
+ path: string;
246
+ timestamp: number;
247
+ cursor?: {
248
+ line: number;
249
+ character: number;
250
+ } | undefined;
251
+ isActive?: boolean | undefined;
252
+ selectedText?: string | undefined;
253
+ }>, "many">>;
254
+ /**
255
+ * Whether the workspace is trusted.
256
+ */
257
+ isTrusted: z.ZodOptional<z.ZodBoolean>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ openFiles?: {
260
+ path: string;
261
+ timestamp: number;
262
+ cursor?: {
263
+ line: number;
264
+ character: number;
265
+ } | undefined;
266
+ isActive?: boolean | undefined;
267
+ selectedText?: string | undefined;
268
+ }[] | undefined;
269
+ isTrusted?: boolean | undefined;
270
+ }, {
271
+ openFiles?: {
272
+ path: string;
273
+ timestamp: number;
274
+ cursor?: {
275
+ line: number;
276
+ character: number;
277
+ } | undefined;
278
+ isActive?: boolean | undefined;
279
+ selectedText?: string | undefined;
280
+ }[] | undefined;
281
+ isTrusted?: boolean | undefined;
282
+ }>>;
283
+ }, "strip", z.ZodTypeAny, {
284
+ workspaceState?: {
285
+ openFiles?: {
286
+ path: string;
287
+ timestamp: number;
288
+ cursor?: {
289
+ line: number;
290
+ character: number;
291
+ } | undefined;
292
+ isActive?: boolean | undefined;
293
+ selectedText?: string | undefined;
294
+ }[] | undefined;
295
+ isTrusted?: boolean | undefined;
296
+ } | undefined;
297
+ }, {
298
+ workspaceState?: {
299
+ openFiles?: {
300
+ path: string;
301
+ timestamp: number;
302
+ cursor?: {
303
+ line: number;
304
+ character: number;
305
+ } | undefined;
306
+ isActive?: boolean | undefined;
307
+ selectedText?: string | undefined;
308
+ }[] | undefined;
309
+ isTrusted?: boolean | undefined;
310
+ } | undefined;
311
+ }>;
312
+ }, "strip", z.ZodTypeAny, {
313
+ params: {
314
+ workspaceState?: {
315
+ openFiles?: {
316
+ path: string;
317
+ timestamp: number;
318
+ cursor?: {
319
+ line: number;
320
+ character: number;
321
+ } | undefined;
322
+ isActive?: boolean | undefined;
323
+ selectedText?: string | undefined;
324
+ }[] | undefined;
325
+ isTrusted?: boolean | undefined;
326
+ } | undefined;
327
+ };
328
+ jsonrpc: "2.0";
329
+ method: "ide/contextUpdate";
330
+ }, {
331
+ params: {
332
+ workspaceState?: {
333
+ openFiles?: {
334
+ path: string;
335
+ timestamp: number;
336
+ cursor?: {
337
+ line: number;
338
+ character: number;
339
+ } | undefined;
340
+ isActive?: boolean | undefined;
341
+ selectedText?: string | undefined;
342
+ }[] | undefined;
343
+ isTrusted?: boolean | undefined;
344
+ } | undefined;
345
+ };
346
+ jsonrpc: "2.0";
347
+ method: "ide/contextUpdate";
348
+ }>;
349
+ /**
350
+ * A notification that a diff has been accepted in the IDE.
351
+ */
352
+ export declare const IdeDiffAcceptedNotificationSchema: z.ZodObject<{
353
+ jsonrpc: z.ZodLiteral<"2.0">;
354
+ method: z.ZodLiteral<"ide/diffAccepted">;
355
+ params: z.ZodObject<{
356
+ /**
357
+ * The absolute path to the file that was diffed.
358
+ */
359
+ filePath: z.ZodString;
360
+ /**
361
+ * The full content of the file after the diff was accepted, which includes any manual edits the user may have made.
362
+ */
363
+ content: z.ZodString;
364
+ }, "strip", z.ZodTypeAny, {
365
+ filePath: string;
366
+ content: string;
367
+ }, {
368
+ filePath: string;
369
+ content: string;
370
+ }>;
371
+ }, "strip", z.ZodTypeAny, {
372
+ params: {
373
+ filePath: string;
374
+ content: string;
375
+ };
376
+ jsonrpc: "2.0";
377
+ method: "ide/diffAccepted";
378
+ }, {
379
+ params: {
380
+ filePath: string;
381
+ content: string;
382
+ };
383
+ jsonrpc: "2.0";
384
+ method: "ide/diffAccepted";
385
+ }>;
386
+ /**
387
+ * A notification that a diff has been rejected in the IDE.
388
+ */
389
+ export declare const IdeDiffRejectedNotificationSchema: z.ZodObject<{
390
+ jsonrpc: z.ZodLiteral<"2.0">;
391
+ method: z.ZodLiteral<"ide/diffRejected">;
392
+ params: z.ZodObject<{
393
+ /**
394
+ * The absolute path to the file that was diffed.
395
+ */
396
+ filePath: z.ZodString;
397
+ }, "strip", z.ZodTypeAny, {
398
+ filePath: string;
399
+ }, {
400
+ filePath: string;
401
+ }>;
402
+ }, "strip", z.ZodTypeAny, {
403
+ params: {
404
+ filePath: string;
405
+ };
406
+ jsonrpc: "2.0";
407
+ method: "ide/diffRejected";
408
+ }, {
409
+ params: {
410
+ filePath: string;
411
+ };
412
+ jsonrpc: "2.0";
413
+ method: "ide/diffRejected";
414
+ }>;
415
+ /**
416
+ * This is defineded for backwards compatability only. Newer extension versions
417
+ * will only send IdeDiffRejectedNotificationSchema.
418
+ *
419
+ * A notification that a diff has been closed in the IDE.
420
+ */
421
+ export declare const IdeDiffClosedNotificationSchema: z.ZodObject<{
422
+ jsonrpc: z.ZodLiteral<"2.0">;
423
+ method: z.ZodLiteral<"ide/diffClosed">;
424
+ params: z.ZodObject<{
425
+ filePath: z.ZodString;
426
+ content: z.ZodOptional<z.ZodString>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ filePath: string;
429
+ content?: string | undefined;
430
+ }, {
431
+ filePath: string;
432
+ content?: string | undefined;
433
+ }>;
434
+ }, "strip", z.ZodTypeAny, {
435
+ params: {
436
+ filePath: string;
437
+ content?: string | undefined;
438
+ };
439
+ jsonrpc: "2.0";
440
+ method: "ide/diffClosed";
441
+ }, {
442
+ params: {
443
+ filePath: string;
444
+ content?: string | undefined;
445
+ };
446
+ jsonrpc: "2.0";
447
+ method: "ide/diffClosed";
448
+ }>;
449
+ /**
450
+ * The request to open a diff view in the IDE.
451
+ */
452
+ export declare const OpenDiffRequestSchema: z.ZodObject<{
453
+ /**
454
+ * The absolute path to the file to be diffed.
455
+ */
456
+ filePath: z.ZodString;
457
+ /**
458
+ * The proposed new content for the file.
459
+ */
460
+ newContent: z.ZodString;
461
+ }, "strip", z.ZodTypeAny, {
462
+ filePath: string;
463
+ newContent: string;
464
+ }, {
465
+ filePath: string;
466
+ newContent: string;
467
+ }>;
468
+ /**
469
+ * The request to close a diff view in the IDE.
470
+ */
471
+ export declare const CloseDiffRequestSchema: z.ZodObject<{
472
+ /**
473
+ * The absolute path to the file to be diffed.
474
+ */
475
+ filePath: z.ZodString;
476
+ /**
477
+ * @deprecated
478
+ */
479
+ suppressNotification: z.ZodOptional<z.ZodBoolean>;
480
+ }, "strip", z.ZodTypeAny, {
481
+ filePath: string;
482
+ suppressNotification?: boolean | undefined;
483
+ }, {
484
+ filePath: string;
485
+ suppressNotification?: boolean | undefined;
486
+ }>;
@@ -0,0 +1,138 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * A file that is open in the IDE.
9
+ */
10
+ export const FileSchema = z.object({
11
+ /**
12
+ * The absolute path to the file.
13
+ */
14
+ path: z.string(),
15
+ /**
16
+ * The unix timestamp of when the file was last focused.
17
+ */
18
+ timestamp: z.number(),
19
+ /**
20
+ * Whether the file is the currently active file. Only one file can be active at a time.
21
+ */
22
+ isActive: z.boolean().optional(),
23
+ /**
24
+ * The text that is currently selected in the active file.
25
+ */
26
+ selectedText: z.string().optional(),
27
+ /**
28
+ * The cursor position in the active file.
29
+ */
30
+ cursor: z
31
+ .object({
32
+ /**
33
+ * The 1-based line number.
34
+ */
35
+ line: z.number(),
36
+ /**
37
+ * The 1-based character offset.
38
+ */
39
+ character: z.number(),
40
+ })
41
+ .optional(),
42
+ });
43
+ /**
44
+ * The context of the IDE.
45
+ */
46
+ export const IdeContextSchema = z.object({
47
+ workspaceState: z
48
+ .object({
49
+ /**
50
+ * The list of files that are currently open.
51
+ */
52
+ openFiles: z.array(FileSchema).optional(),
53
+ /**
54
+ * Whether the workspace is trusted.
55
+ */
56
+ isTrusted: z.boolean().optional(),
57
+ })
58
+ .optional(),
59
+ });
60
+ /**
61
+ * A notification that the IDE context has been updated.
62
+ */
63
+ export const IdeContextNotificationSchema = z.object({
64
+ jsonrpc: z.literal('2.0'),
65
+ method: z.literal('ide/contextUpdate'),
66
+ params: IdeContextSchema,
67
+ });
68
+ /**
69
+ * A notification that a diff has been accepted in the IDE.
70
+ */
71
+ export const IdeDiffAcceptedNotificationSchema = z.object({
72
+ jsonrpc: z.literal('2.0'),
73
+ method: z.literal('ide/diffAccepted'),
74
+ params: z.object({
75
+ /**
76
+ * The absolute path to the file that was diffed.
77
+ */
78
+ filePath: z.string(),
79
+ /**
80
+ * The full content of the file after the diff was accepted, which includes any manual edits the user may have made.
81
+ */
82
+ content: z.string(),
83
+ }),
84
+ });
85
+ /**
86
+ * A notification that a diff has been rejected in the IDE.
87
+ */
88
+ export const IdeDiffRejectedNotificationSchema = z.object({
89
+ jsonrpc: z.literal('2.0'),
90
+ method: z.literal('ide/diffRejected'),
91
+ params: z.object({
92
+ /**
93
+ * The absolute path to the file that was diffed.
94
+ */
95
+ filePath: z.string(),
96
+ }),
97
+ });
98
+ /**
99
+ * This is defineded for backwards compatability only. Newer extension versions
100
+ * will only send IdeDiffRejectedNotificationSchema.
101
+ *
102
+ * A notification that a diff has been closed in the IDE.
103
+ */
104
+ export const IdeDiffClosedNotificationSchema = z.object({
105
+ jsonrpc: z.literal('2.0'),
106
+ method: z.literal('ide/diffClosed'),
107
+ params: z.object({
108
+ filePath: z.string(),
109
+ content: z.string().optional(),
110
+ }),
111
+ });
112
+ /**
113
+ * The request to open a diff view in the IDE.
114
+ */
115
+ export const OpenDiffRequestSchema = z.object({
116
+ /**
117
+ * The absolute path to the file to be diffed.
118
+ */
119
+ filePath: z.string(),
120
+ /**
121
+ * The proposed new content for the file.
122
+ */
123
+ newContent: z.string(),
124
+ });
125
+ /**
126
+ * The request to close a diff view in the IDE.
127
+ */
128
+ export const CloseDiffRequestSchema = z.object({
129
+ /**
130
+ * The absolute path to the file to be diffed.
131
+ */
132
+ filePath: z.string(),
133
+ /**
134
+ * @deprecated
135
+ */
136
+ suppressNotification: z.boolean().optional(),
137
+ });
138
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ide/types.ts"],"names":[],"mappings":"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"}
@@ -4,6 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  export * from './config/config.js';
7
+ export * from './output/types.js';
8
+ export * from './output/json-formatter.js';
9
+ export * from './policy/types.js';
10
+ export * from './policy/policy-engine.js';
7
11
  export * from './core/client.js';
8
12
  export * from './core/contentGenerator.js';
9
13
  export * from './core/loggingContentGenerator.js';
@@ -15,6 +19,7 @@ export * from './core/turn.js';
15
19
  export * from './core/geminiRequest.js';
16
20
  export * from './core/coreToolScheduler.js';
17
21
  export * from './core/nonInteractiveToolExecutor.js';
22
+ export * from './fallback/types.js';
18
23
  export * from './code_assist/codeAssist.js';
19
24
  export * from './code_assist/oauth2.js';
20
25
  export * from './code_assist/server.js';
@@ -31,6 +36,7 @@ export * from './utils/quotaErrorDetection.js';
31
36
  export * from './utils/fileUtils.js';
32
37
  export * from './utils/retry.js';
33
38
  export * from './utils/shell-utils.js';
39
+ export * from './utils/terminalSerializer.js';
34
40
  export * from './utils/systemEncoding.js';
35
41
  export * from './utils/textUtils.js';
36
42
  export * from './utils/formatters.js';
@@ -40,6 +46,7 @@ export * from './utils/errorParsing.js';
40
46
  export * from './utils/workspaceContext.js';
41
47
  export * from './utils/ignorePatterns.js';
42
48
  export * from './utils/partUtils.js';
49
+ export * from './utils/promptIdContext.js';
43
50
  export * from './services/fileDiscoveryService.js';
44
51
  export * from './services/gitService.js';
45
52
  export * from './services/chatRecordingService.js';
@@ -47,9 +54,9 @@ export * from './services/fileSystemService.js';
47
54
  export * from './ide/ide-client.js';
48
55
  export * from './ide/ideContext.js';
49
56
  export * from './ide/ide-installer.js';
50
- export { getIdeInfo, DetectedIde } from './ide/detect-ide.js';
51
- export { type IdeInfo } from './ide/detect-ide.js';
57
+ export { IDE_DEFINITIONS, type IdeInfo } from './ide/detect-ide.js';
52
58
  export * from './ide/constants.js';
59
+ export * from './ide/types.js';
53
60
  export * from './services/shellExecutionService.js';
54
61
  export * from './tools/tools.js';
55
62
  export * from './tools/tool-error.js';
@@ -79,3 +86,4 @@ export * from './telemetry/index.js';
79
86
  export { sessionId } from './utils/session.js';
80
87
  export * from './utils/browser.js';
81
88
  export { Storage } from './config/storage.js';
89
+ export * from './test-utils/index.js';