@office-ai/aioncli-core 0.1.18-beta.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 (567) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +8 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/src/__mocks__/fs/promises.d.ts +11 -0
  6. package/dist/src/__mocks__/fs/promises.js +17 -0
  7. package/dist/src/__mocks__/fs/promises.js.map +1 -0
  8. package/dist/src/code_assist/codeAssist.d.ts +9 -0
  9. package/dist/src/code_assist/codeAssist.js +19 -0
  10. package/dist/src/code_assist/codeAssist.js.map +1 -0
  11. package/dist/src/code_assist/converter.d.ts +70 -0
  12. package/dist/src/code_assist/converter.js +126 -0
  13. package/dist/src/code_assist/converter.js.map +1 -0
  14. package/dist/src/code_assist/converter.test.d.ts +6 -0
  15. package/dist/src/code_assist/converter.test.js +279 -0
  16. package/dist/src/code_assist/converter.test.js.map +1 -0
  17. package/dist/src/code_assist/oauth2.d.ts +20 -0
  18. package/dist/src/code_assist/oauth2.js +337 -0
  19. package/dist/src/code_assist/oauth2.js.map +1 -0
  20. package/dist/src/code_assist/oauth2.test.d.ts +6 -0
  21. package/dist/src/code_assist/oauth2.test.js +334 -0
  22. package/dist/src/code_assist/oauth2.test.js.map +1 -0
  23. package/dist/src/code_assist/server.d.ts +37 -0
  24. package/dist/src/code_assist/server.js +125 -0
  25. package/dist/src/code_assist/server.js.map +1 -0
  26. package/dist/src/code_assist/server.test.d.ts +6 -0
  27. package/dist/src/code_assist/server.test.js +134 -0
  28. package/dist/src/code_assist/server.test.js.map +1 -0
  29. package/dist/src/code_assist/setup.d.ts +20 -0
  30. package/dist/src/code_assist/setup.js +70 -0
  31. package/dist/src/code_assist/setup.js.map +1 -0
  32. package/dist/src/code_assist/setup.test.d.ts +6 -0
  33. package/dist/src/code_assist/setup.test.js +65 -0
  34. package/dist/src/code_assist/setup.test.js.map +1 -0
  35. package/dist/src/code_assist/types.d.ts +148 -0
  36. package/dist/src/code_assist/types.js +46 -0
  37. package/dist/src/code_assist/types.js.map +1 -0
  38. package/dist/src/config/config.d.ts +272 -0
  39. package/dist/src/config/config.js +554 -0
  40. package/dist/src/config/config.js.map +1 -0
  41. package/dist/src/config/config.test.d.ts +6 -0
  42. package/dist/src/config/config.test.js +365 -0
  43. package/dist/src/config/config.test.js.map +1 -0
  44. package/dist/src/config/flashFallback.test.d.ts +6 -0
  45. package/dist/src/config/flashFallback.test.js +87 -0
  46. package/dist/src/config/flashFallback.test.js.map +1 -0
  47. package/dist/src/config/models.d.ts +9 -0
  48. package/dist/src/config/models.js +10 -0
  49. package/dist/src/config/models.js.map +1 -0
  50. package/dist/src/core/client.d.ts +61 -0
  51. package/dist/src/core/client.js +485 -0
  52. package/dist/src/core/client.js.map +1 -0
  53. package/dist/src/core/client.test.d.ts +6 -0
  54. package/dist/src/core/client.test.js +1008 -0
  55. package/dist/src/core/client.test.js.map +1 -0
  56. package/dist/src/core/contentGenerator.d.ts +45 -0
  57. package/dist/src/core/contentGenerator.js +81 -0
  58. package/dist/src/core/contentGenerator.js.map +1 -0
  59. package/dist/src/core/contentGenerator.test.d.ts +6 -0
  60. package/dist/src/core/contentGenerator.test.js +100 -0
  61. package/dist/src/core/contentGenerator.test.js.map +1 -0
  62. package/dist/src/core/coreToolScheduler.d.ts +117 -0
  63. package/dist/src/core/coreToolScheduler.js +530 -0
  64. package/dist/src/core/coreToolScheduler.js.map +1 -0
  65. package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
  66. package/dist/src/core/coreToolScheduler.test.js +625 -0
  67. package/dist/src/core/coreToolScheduler.test.js.map +1 -0
  68. package/dist/src/core/geminiChat.d.ts +118 -0
  69. package/dist/src/core/geminiChat.js +509 -0
  70. package/dist/src/core/geminiChat.js.map +1 -0
  71. package/dist/src/core/geminiChat.test.d.ts +6 -0
  72. package/dist/src/core/geminiChat.test.js +424 -0
  73. package/dist/src/core/geminiChat.test.js.map +1 -0
  74. package/dist/src/core/geminiRequest.d.ts +13 -0
  75. package/dist/src/core/geminiRequest.js +10 -0
  76. package/dist/src/core/geminiRequest.js.map +1 -0
  77. package/dist/src/core/logger.d.ts +37 -0
  78. package/dist/src/core/logger.js +273 -0
  79. package/dist/src/core/logger.js.map +1 -0
  80. package/dist/src/core/logger.test.d.ts +6 -0
  81. package/dist/src/core/logger.test.js +467 -0
  82. package/dist/src/core/logger.test.js.map +1 -0
  83. package/dist/src/core/loggingContentGenerator.d.ts +24 -0
  84. package/dist/src/core/loggingContentGenerator.js +89 -0
  85. package/dist/src/core/loggingContentGenerator.js.map +1 -0
  86. package/dist/src/core/modelCheck.d.ts +14 -0
  87. package/dist/src/core/modelCheck.js +62 -0
  88. package/dist/src/core/modelCheck.js.map +1 -0
  89. package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
  90. package/dist/src/core/nonInteractiveToolExecutor.js +124 -0
  91. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
  92. package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
  93. package/dist/src/core/nonInteractiveToolExecutor.test.js +165 -0
  94. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
  95. package/dist/src/core/openaiContentGenerator.d.ts +77 -0
  96. package/dist/src/core/openaiContentGenerator.js +1395 -0
  97. package/dist/src/core/openaiContentGenerator.js.map +1 -0
  98. package/dist/src/core/openaiContentGenerator.test.d.ts +6 -0
  99. package/dist/src/core/openaiContentGenerator.test.js +1904 -0
  100. package/dist/src/core/openaiContentGenerator.test.js.map +1 -0
  101. package/dist/src/core/prompts.d.ts +12 -0
  102. package/dist/src/core/prompts.js +359 -0
  103. package/dist/src/core/prompts.js.map +1 -0
  104. package/dist/src/core/prompts.test.d.ts +6 -0
  105. package/dist/src/core/prompts.test.js +214 -0
  106. package/dist/src/core/prompts.test.js.map +1 -0
  107. package/dist/src/core/subagent.d.ts +230 -0
  108. package/dist/src/core/subagent.js +447 -0
  109. package/dist/src/core/subagent.js.map +1 -0
  110. package/dist/src/core/subagent.test.d.ts +6 -0
  111. package/dist/src/core/subagent.test.js +515 -0
  112. package/dist/src/core/subagent.test.js.map +1 -0
  113. package/dist/src/core/tokenLimits.d.ts +10 -0
  114. package/dist/src/core/tokenLimits.js +28 -0
  115. package/dist/src/core/tokenLimits.js.map +1 -0
  116. package/dist/src/core/turn.d.ts +114 -0
  117. package/dist/src/core/turn.js +143 -0
  118. package/dist/src/core/turn.js.map +1 -0
  119. package/dist/src/core/turn.test.d.ts +6 -0
  120. package/dist/src/core/turn.test.js +369 -0
  121. package/dist/src/core/turn.test.js.map +1 -0
  122. package/dist/src/ide/detect-ide.d.ts +10 -0
  123. package/dist/src/ide/detect-ide.js +27 -0
  124. package/dist/src/ide/detect-ide.js.map +1 -0
  125. package/dist/src/ide/ide-client.d.ts +56 -0
  126. package/dist/src/ide/ide-client.js +268 -0
  127. package/dist/src/ide/ide-client.js.map +1 -0
  128. package/dist/src/ide/ide-installer.d.ts +14 -0
  129. package/dist/src/ide/ide-installer.js +109 -0
  130. package/dist/src/ide/ide-installer.js.map +1 -0
  131. package/dist/src/ide/ide-installer.test.d.ts +6 -0
  132. package/dist/src/ide/ide-installer.test.js +55 -0
  133. package/dist/src/ide/ide-installer.test.js.map +1 -0
  134. package/dist/src/ide/ideContext.d.ts +374 -0
  135. package/dist/src/ide/ideContext.js +147 -0
  136. package/dist/src/ide/ideContext.js.map +1 -0
  137. package/dist/src/ide/ideContext.test.d.ts +6 -0
  138. package/dist/src/ide/ideContext.test.js +265 -0
  139. package/dist/src/ide/ideContext.test.js.map +1 -0
  140. package/dist/src/index.d.ts +68 -0
  141. package/dist/src/index.js +78 -0
  142. package/dist/src/index.js.map +1 -0
  143. package/dist/src/index.test.d.ts +6 -0
  144. package/dist/src/index.test.js +12 -0
  145. package/dist/src/index.test.js.map +1 -0
  146. package/dist/src/mcp/google-auth-provider.d.ts +23 -0
  147. package/dist/src/mcp/google-auth-provider.js +63 -0
  148. package/dist/src/mcp/google-auth-provider.js.map +1 -0
  149. package/dist/src/mcp/google-auth-provider.test.d.ts +6 -0
  150. package/dist/src/mcp/google-auth-provider.test.js +54 -0
  151. package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
  152. package/dist/src/mcp/oauth-provider.d.ts +147 -0
  153. package/dist/src/mcp/oauth-provider.js +484 -0
  154. package/dist/src/mcp/oauth-provider.js.map +1 -0
  155. package/dist/src/mcp/oauth-provider.test.d.ts +6 -0
  156. package/dist/src/mcp/oauth-provider.test.js +602 -0
  157. package/dist/src/mcp/oauth-provider.test.js.map +1 -0
  158. package/dist/src/mcp/oauth-token-storage.d.ts +83 -0
  159. package/dist/src/mcp/oauth-token-storage.js +151 -0
  160. package/dist/src/mcp/oauth-token-storage.js.map +1 -0
  161. package/dist/src/mcp/oauth-token-storage.test.d.ts +6 -0
  162. package/dist/src/mcp/oauth-token-storage.test.js +205 -0
  163. package/dist/src/mcp/oauth-token-storage.test.js.map +1 -0
  164. package/dist/src/mcp/oauth-utils.d.ts +109 -0
  165. package/dist/src/mcp/oauth-utils.js +183 -0
  166. package/dist/src/mcp/oauth-utils.js.map +1 -0
  167. package/dist/src/mcp/oauth-utils.test.d.ts +6 -0
  168. package/dist/src/mcp/oauth-utils.test.js +144 -0
  169. package/dist/src/mcp/oauth-utils.test.js.map +1 -0
  170. package/dist/src/prompts/mcp-prompts.d.ts +8 -0
  171. package/dist/src/prompts/mcp-prompts.js +13 -0
  172. package/dist/src/prompts/mcp-prompts.js.map +1 -0
  173. package/dist/src/prompts/prompt-registry.d.ts +34 -0
  174. package/dist/src/prompts/prompt-registry.js +63 -0
  175. package/dist/src/prompts/prompt-registry.js.map +1 -0
  176. package/dist/src/services/fileDiscoveryService.d.ts +35 -0
  177. package/dist/src/services/fileDiscoveryService.js +91 -0
  178. package/dist/src/services/fileDiscoveryService.js.map +1 -0
  179. package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
  180. package/dist/src/services/fileDiscoveryService.test.js +143 -0
  181. package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
  182. package/dist/src/services/gitService.d.ts +21 -0
  183. package/dist/src/services/gitService.js +101 -0
  184. package/dist/src/services/gitService.js.map +1 -0
  185. package/dist/src/services/gitService.test.d.ts +6 -0
  186. package/dist/src/services/gitService.test.js +209 -0
  187. package/dist/src/services/gitService.test.js.map +1 -0
  188. package/dist/src/services/loopDetectionService.d.ts +97 -0
  189. package/dist/src/services/loopDetectionService.js +340 -0
  190. package/dist/src/services/loopDetectionService.js.map +1 -0
  191. package/dist/src/services/loopDetectionService.test.d.ts +6 -0
  192. package/dist/src/services/loopDetectionService.test.js +484 -0
  193. package/dist/src/services/loopDetectionService.test.js.map +1 -0
  194. package/dist/src/services/shellExecutionService.d.ts +70 -0
  195. package/dist/src/services/shellExecutionService.js +175 -0
  196. package/dist/src/services/shellExecutionService.js.map +1 -0
  197. package/dist/src/services/shellExecutionService.test.d.ts +6 -0
  198. package/dist/src/services/shellExecutionService.test.js +272 -0
  199. package/dist/src/services/shellExecutionService.test.js.map +1 -0
  200. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +65 -0
  201. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +652 -0
  202. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
  203. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +6 -0
  204. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +186 -0
  205. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -0
  206. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +59 -0
  207. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +159 -0
  208. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
  209. package/dist/src/telemetry/constants.d.ts +23 -0
  210. package/dist/src/telemetry/constants.js +24 -0
  211. package/dist/src/telemetry/constants.js.map +1 -0
  212. package/dist/src/telemetry/file-exporters.d.ts +28 -0
  213. package/dist/src/telemetry/file-exporters.js +62 -0
  214. package/dist/src/telemetry/file-exporters.js.map +1 -0
  215. package/dist/src/telemetry/index.d.ts +18 -0
  216. package/dist/src/telemetry/index.js +20 -0
  217. package/dist/src/telemetry/index.js.map +1 -0
  218. package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
  219. package/dist/src/telemetry/integration.test.circular.js +53 -0
  220. package/dist/src/telemetry/integration.test.circular.js.map +1 -0
  221. package/dist/src/telemetry/loggers.d.ts +18 -0
  222. package/dist/src/telemetry/loggers.js +268 -0
  223. package/dist/src/telemetry/loggers.js.map +1 -0
  224. package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
  225. package/dist/src/telemetry/loggers.test.circular.js +107 -0
  226. package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
  227. package/dist/src/telemetry/loggers.test.d.ts +6 -0
  228. package/dist/src/telemetry/loggers.test.js +568 -0
  229. package/dist/src/telemetry/loggers.test.js.map +1 -0
  230. package/dist/src/telemetry/metrics.d.ts +20 -0
  231. package/dist/src/telemetry/metrics.js +150 -0
  232. package/dist/src/telemetry/metrics.js.map +1 -0
  233. package/dist/src/telemetry/metrics.test.d.ts +6 -0
  234. package/dist/src/telemetry/metrics.test.js +212 -0
  235. package/dist/src/telemetry/metrics.test.js.map +1 -0
  236. package/dist/src/telemetry/sdk.d.ts +9 -0
  237. package/dist/src/telemetry/sdk.js +127 -0
  238. package/dist/src/telemetry/sdk.js.map +1 -0
  239. package/dist/src/telemetry/telemetry.test.d.ts +6 -0
  240. package/dist/src/telemetry/telemetry.test.js +50 -0
  241. package/dist/src/telemetry/telemetry.test.js.map +1 -0
  242. package/dist/src/telemetry/tool-call-decision.d.ts +13 -0
  243. package/dist/src/telemetry/tool-call-decision.js +29 -0
  244. package/dist/src/telemetry/tool-call-decision.js.map +1 -0
  245. package/dist/src/telemetry/types.d.ts +145 -0
  246. package/dist/src/telemetry/types.js +267 -0
  247. package/dist/src/telemetry/types.js.map +1 -0
  248. package/dist/src/telemetry/uiTelemetry.d.ts +71 -0
  249. package/dist/src/telemetry/uiTelemetry.js +140 -0
  250. package/dist/src/telemetry/uiTelemetry.js.map +1 -0
  251. package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
  252. package/dist/src/telemetry/uiTelemetry.test.js +518 -0
  253. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
  254. package/dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
  255. package/dist/src/test-utils/mockWorkspaceContext.js +24 -0
  256. package/dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
  257. package/dist/src/test-utils/tools.d.ts +23 -0
  258. package/dist/src/test-utils/tools.js +41 -0
  259. package/dist/src/test-utils/tools.js.map +1 -0
  260. package/dist/src/tools/diffOptions.d.ts +9 -0
  261. package/dist/src/tools/diffOptions.js +38 -0
  262. package/dist/src/tools/diffOptions.js.map +1 -0
  263. package/dist/src/tools/diffOptions.test.d.ts +6 -0
  264. package/dist/src/tools/diffOptions.test.js +119 -0
  265. package/dist/src/tools/diffOptions.test.js.map +1 -0
  266. package/dist/src/tools/edit.d.ts +55 -0
  267. package/dist/src/tools/edit.js +398 -0
  268. package/dist/src/tools/edit.js.map +1 -0
  269. package/dist/src/tools/edit.test.d.ts +6 -0
  270. package/dist/src/tools/edit.test.js +681 -0
  271. package/dist/src/tools/edit.test.js.map +1 -0
  272. package/dist/src/tools/glob.d.ts +51 -0
  273. package/dist/src/tools/glob.js +226 -0
  274. package/dist/src/tools/glob.js.map +1 -0
  275. package/dist/src/tools/glob.test.d.ts +6 -0
  276. package/dist/src/tools/glob.test.js +330 -0
  277. package/dist/src/tools/glob.test.js.map +1 -0
  278. package/dist/src/tools/grep.d.ts +46 -0
  279. package/dist/src/tools/grep.js +503 -0
  280. package/dist/src/tools/grep.js.map +1 -0
  281. package/dist/src/tools/grep.test.d.ts +6 -0
  282. package/dist/src/tools/grep.test.js +272 -0
  283. package/dist/src/tools/grep.test.js.map +1 -0
  284. package/dist/src/tools/ls.d.ts +86 -0
  285. package/dist/src/tools/ls.js +224 -0
  286. package/dist/src/tools/ls.js.map +1 -0
  287. package/dist/src/tools/ls.test.d.ts +6 -0
  288. package/dist/src/tools/ls.test.js +356 -0
  289. package/dist/src/tools/ls.test.js.map +1 -0
  290. package/dist/src/tools/mcp-client.d.ts +149 -0
  291. package/dist/src/tools/mcp-client.js +844 -0
  292. package/dist/src/tools/mcp-client.js.map +1 -0
  293. package/dist/src/tools/mcp-client.test.d.ts +6 -0
  294. package/dist/src/tools/mcp-client.test.js +643 -0
  295. package/dist/src/tools/mcp-client.test.js.map +1 -0
  296. package/dist/src/tools/mcp-tool.d.ts +29 -0
  297. package/dist/src/tools/mcp-tool.js +202 -0
  298. package/dist/src/tools/mcp-tool.js.map +1 -0
  299. package/dist/src/tools/mcp-tool.test.d.ts +6 -0
  300. package/dist/src/tools/mcp-tool.test.js +501 -0
  301. package/dist/src/tools/mcp-tool.test.js.map +1 -0
  302. package/dist/src/tools/memoryTool.d.ts +43 -0
  303. package/dist/src/tools/memoryTool.js +290 -0
  304. package/dist/src/tools/memoryTool.js.map +1 -0
  305. package/dist/src/tools/memoryTool.test.d.ts +6 -0
  306. package/dist/src/tools/memoryTool.test.js +266 -0
  307. package/dist/src/tools/memoryTool.test.js.map +1 -0
  308. package/dist/src/tools/modifiable-tool.d.ts +32 -0
  309. package/dist/src/tools/modifiable-tool.js +88 -0
  310. package/dist/src/tools/modifiable-tool.js.map +1 -0
  311. package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
  312. package/dist/src/tools/modifiable-tool.test.js +193 -0
  313. package/dist/src/tools/modifiable-tool.test.js.map +1 -0
  314. package/dist/src/tools/read-file.d.ts +34 -0
  315. package/dist/src/tools/read-file.js +152 -0
  316. package/dist/src/tools/read-file.js.map +1 -0
  317. package/dist/src/tools/read-file.test.d.ts +6 -0
  318. package/dist/src/tools/read-file.test.js +300 -0
  319. package/dist/src/tools/read-file.test.js.map +1 -0
  320. package/dist/src/tools/read-many-files.d.ts +61 -0
  321. package/dist/src/tools/read-many-files.js +421 -0
  322. package/dist/src/tools/read-many-files.js.map +1 -0
  323. package/dist/src/tools/read-many-files.test.d.ts +6 -0
  324. package/dist/src/tools/read-many-files.test.js +455 -0
  325. package/dist/src/tools/read-many-files.test.js.map +1 -0
  326. package/dist/src/tools/shell.d.ts +23 -0
  327. package/dist/src/tools/shell.js +313 -0
  328. package/dist/src/tools/shell.js.map +1 -0
  329. package/dist/src/tools/shell.test.d.ts +6 -0
  330. package/dist/src/tools/shell.test.js +321 -0
  331. package/dist/src/tools/shell.test.js.map +1 -0
  332. package/dist/src/tools/tool-error.d.ts +26 -0
  333. package/dist/src/tools/tool-error.js +31 -0
  334. package/dist/src/tools/tool-error.js.map +1 -0
  335. package/dist/src/tools/tool-registry.d.ts +85 -0
  336. package/dist/src/tools/tool-registry.js +390 -0
  337. package/dist/src/tools/tool-registry.js.map +1 -0
  338. package/dist/src/tools/tool-registry.test.d.ts +6 -0
  339. package/dist/src/tools/tool-registry.test.js +417 -0
  340. package/dist/src/tools/tool-registry.test.js.map +1 -0
  341. package/dist/src/tools/tools.d.ts +328 -0
  342. package/dist/src/tools/tools.js +281 -0
  343. package/dist/src/tools/tools.js.map +1 -0
  344. package/dist/src/tools/tools.test.d.ts +6 -0
  345. package/dist/src/tools/tools.test.js +117 -0
  346. package/dist/src/tools/tools.test.js.map +1 -0
  347. package/dist/src/tools/web-fetch.d.ts +29 -0
  348. package/dist/src/tools/web-fetch.js +246 -0
  349. package/dist/src/tools/web-fetch.js.map +1 -0
  350. package/dist/src/tools/web-fetch.test.d.ts +6 -0
  351. package/dist/src/tools/web-fetch.test.js +71 -0
  352. package/dist/src/tools/web-fetch.test.js.map +1 -0
  353. package/dist/src/tools/web-search.d.ts +49 -0
  354. package/dist/src/tools/web-search.js +120 -0
  355. package/dist/src/tools/web-search.js.map +1 -0
  356. package/dist/src/tools/write-file.d.ts +46 -0
  357. package/dist/src/tools/write-file.js +321 -0
  358. package/dist/src/tools/write-file.js.map +1 -0
  359. package/dist/src/tools/write-file.test.d.ts +6 -0
  360. package/dist/src/tools/write-file.test.js +572 -0
  361. package/dist/src/tools/write-file.test.js.map +1 -0
  362. package/dist/src/utils/LruCache.d.ts +13 -0
  363. package/dist/src/utils/LruCache.js +38 -0
  364. package/dist/src/utils/LruCache.js.map +1 -0
  365. package/dist/src/utils/bfsFileSearch.d.ts +24 -0
  366. package/dist/src/utils/bfsFileSearch.js +89 -0
  367. package/dist/src/utils/bfsFileSearch.js.map +1 -0
  368. package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
  369. package/dist/src/utils/bfsFileSearch.test.js +163 -0
  370. package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
  371. package/dist/src/utils/browser.d.ts +13 -0
  372. package/dist/src/utils/browser.js +49 -0
  373. package/dist/src/utils/browser.js.map +1 -0
  374. package/dist/src/utils/editCorrector.d.ts +53 -0
  375. package/dist/src/utils/editCorrector.js +546 -0
  376. package/dist/src/utils/editCorrector.js.map +1 -0
  377. package/dist/src/utils/editCorrector.test.d.ts +6 -0
  378. package/dist/src/utils/editCorrector.test.js +564 -0
  379. package/dist/src/utils/editCorrector.test.js.map +1 -0
  380. package/dist/src/utils/editor.d.ts +28 -0
  381. package/dist/src/utils/editor.js +186 -0
  382. package/dist/src/utils/editor.js.map +1 -0
  383. package/dist/src/utils/editor.test.d.ts +6 -0
  384. package/dist/src/utils/editor.test.js +445 -0
  385. package/dist/src/utils/editor.test.js.map +1 -0
  386. package/dist/src/utils/environmentContext.d.ts +21 -0
  387. package/dist/src/utils/environmentContext.js +90 -0
  388. package/dist/src/utils/environmentContext.js.map +1 -0
  389. package/dist/src/utils/environmentContext.test.d.ts +6 -0
  390. package/dist/src/utils/environmentContext.test.js +139 -0
  391. package/dist/src/utils/environmentContext.test.js.map +1 -0
  392. package/dist/src/utils/errorReporting.d.ts +14 -0
  393. package/dist/src/utils/errorReporting.js +88 -0
  394. package/dist/src/utils/errorReporting.js.map +1 -0
  395. package/dist/src/utils/errorReporting.test.d.ts +6 -0
  396. package/dist/src/utils/errorReporting.test.js +130 -0
  397. package/dist/src/utils/errorReporting.test.js.map +1 -0
  398. package/dist/src/utils/errors.d.ts +14 -0
  399. package/dist/src/utils/errors.js +54 -0
  400. package/dist/src/utils/errors.js.map +1 -0
  401. package/dist/src/utils/fetch.d.ts +11 -0
  402. package/dist/src/utils/fetch.js +51 -0
  403. package/dist/src/utils/fetch.js.map +1 -0
  404. package/dist/src/utils/fileUtils.d.ts +56 -0
  405. package/dist/src/utils/fileUtils.js +314 -0
  406. package/dist/src/utils/fileUtils.js.map +1 -0
  407. package/dist/src/utils/fileUtils.test.d.ts +6 -0
  408. package/dist/src/utils/fileUtils.test.js +363 -0
  409. package/dist/src/utils/fileUtils.test.js.map +1 -0
  410. package/dist/src/utils/filesearch/crawlCache.d.ts +25 -0
  411. package/dist/src/utils/filesearch/crawlCache.js +57 -0
  412. package/dist/src/utils/filesearch/crawlCache.js.map +1 -0
  413. package/dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
  414. package/dist/src/utils/filesearch/crawlCache.test.js +103 -0
  415. package/dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
  416. package/dist/src/utils/filesearch/fileSearch.d.ts +81 -0
  417. package/dist/src/utils/filesearch/fileSearch.js +241 -0
  418. package/dist/src/utils/filesearch/fileSearch.js.map +1 -0
  419. package/dist/src/utils/filesearch/fileSearch.test.d.ts +6 -0
  420. package/dist/src/utils/filesearch/fileSearch.test.js +654 -0
  421. package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
  422. package/dist/src/utils/filesearch/ignore.d.ts +35 -0
  423. package/dist/src/utils/filesearch/ignore.js +81 -0
  424. package/dist/src/utils/filesearch/ignore.js.map +1 -0
  425. package/dist/src/utils/filesearch/ignore.test.d.ts +6 -0
  426. package/dist/src/utils/filesearch/ignore.test.js +57 -0
  427. package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
  428. package/dist/src/utils/filesearch/result-cache.d.ts +34 -0
  429. package/dist/src/utils/filesearch/result-cache.js +61 -0
  430. package/dist/src/utils/filesearch/result-cache.js.map +1 -0
  431. package/dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
  432. package/dist/src/utils/filesearch/result-cache.test.js +47 -0
  433. package/dist/src/utils/filesearch/result-cache.test.js.map +1 -0
  434. package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
  435. package/dist/src/utils/flashFallback.integration.test.js +118 -0
  436. package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
  437. package/dist/src/utils/formatters.d.ts +6 -0
  438. package/dist/src/utils/formatters.js +16 -0
  439. package/dist/src/utils/formatters.js.map +1 -0
  440. package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
  441. package/dist/src/utils/generateContentResponseUtilities.js +92 -0
  442. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
  443. package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
  444. package/dist/src/utils/generateContentResponseUtilities.test.js +273 -0
  445. package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
  446. package/dist/src/utils/getFolderStructure.d.ts +31 -0
  447. package/dist/src/utils/getFolderStructure.js +246 -0
  448. package/dist/src/utils/getFolderStructure.js.map +1 -0
  449. package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
  450. package/dist/src/utils/getFolderStructure.test.js +282 -0
  451. package/dist/src/utils/getFolderStructure.test.js.map +1 -0
  452. package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
  453. package/dist/src/utils/gitIgnoreParser.js +61 -0
  454. package/dist/src/utils/gitIgnoreParser.js.map +1 -0
  455. package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
  456. package/dist/src/utils/gitIgnoreParser.test.js +154 -0
  457. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
  458. package/dist/src/utils/gitUtils.d.ts +17 -0
  459. package/dist/src/utils/gitUtils.js +61 -0
  460. package/dist/src/utils/gitUtils.js.map +1 -0
  461. package/dist/src/utils/memoryDiscovery.d.ts +15 -0
  462. package/dist/src/utils/memoryDiscovery.js +219 -0
  463. package/dist/src/utils/memoryDiscovery.js.map +1 -0
  464. package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
  465. package/dist/src/utils/memoryDiscovery.test.js +181 -0
  466. package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
  467. package/dist/src/utils/memoryImportProcessor.d.ts +42 -0
  468. package/dist/src/utils/memoryImportProcessor.js +300 -0
  469. package/dist/src/utils/memoryImportProcessor.js.map +1 -0
  470. package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
  471. package/dist/src/utils/memoryImportProcessor.test.js +715 -0
  472. package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
  473. package/dist/src/utils/messageInspectors.d.ts +8 -0
  474. package/dist/src/utils/messageInspectors.js +16 -0
  475. package/dist/src/utils/messageInspectors.js.map +1 -0
  476. package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
  477. package/dist/src/utils/nextSpeakerChecker.js +92 -0
  478. package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
  479. package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
  480. package/dist/src/utils/nextSpeakerChecker.test.js +168 -0
  481. package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
  482. package/dist/src/utils/openaiLogger.d.ts +42 -0
  483. package/dist/src/utils/openaiLogger.js +123 -0
  484. package/dist/src/utils/openaiLogger.js.map +1 -0
  485. package/dist/src/utils/partUtils.d.ts +14 -0
  486. package/dist/src/utils/partUtils.js +65 -0
  487. package/dist/src/utils/partUtils.js.map +1 -0
  488. package/dist/src/utils/partUtils.test.d.ts +6 -0
  489. package/dist/src/utils/partUtils.test.js +130 -0
  490. package/dist/src/utils/partUtils.test.js.map +1 -0
  491. package/dist/src/utils/paths.d.ts +68 -0
  492. package/dist/src/utils/paths.js +170 -0
  493. package/dist/src/utils/paths.js.map +1 -0
  494. package/dist/src/utils/paths.test.d.ts +6 -0
  495. package/dist/src/utils/paths.test.js +153 -0
  496. package/dist/src/utils/paths.test.js.map +1 -0
  497. package/dist/src/utils/quotaErrorDetection.d.ts +22 -0
  498. package/dist/src/utils/quotaErrorDetection.js +65 -0
  499. package/dist/src/utils/quotaErrorDetection.js.map +1 -0
  500. package/dist/src/utils/retry.d.ts +30 -0
  501. package/dist/src/utils/retry.js +276 -0
  502. package/dist/src/utils/retry.js.map +1 -0
  503. package/dist/src/utils/retry.test.d.ts +6 -0
  504. package/dist/src/utils/retry.test.js +322 -0
  505. package/dist/src/utils/retry.test.js.map +1 -0
  506. package/dist/src/utils/safeJsonStringify.d.ts +13 -0
  507. package/dist/src/utils/safeJsonStringify.js +25 -0
  508. package/dist/src/utils/safeJsonStringify.js.map +1 -0
  509. package/dist/src/utils/safeJsonStringify.test.d.ts +6 -0
  510. package/dist/src/utils/safeJsonStringify.test.js +61 -0
  511. package/dist/src/utils/safeJsonStringify.test.js.map +1 -0
  512. package/dist/src/utils/schemaValidator.d.ts +22 -0
  513. package/dist/src/utils/schemaValidator.js +65 -0
  514. package/dist/src/utils/schemaValidator.js.map +1 -0
  515. package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
  516. package/dist/src/utils/secure-browser-launcher.js +164 -0
  517. package/dist/src/utils/secure-browser-launcher.js.map +1 -0
  518. package/dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
  519. package/dist/src/utils/secure-browser-launcher.test.js +149 -0
  520. package/dist/src/utils/secure-browser-launcher.test.js.map +1 -0
  521. package/dist/src/utils/session.d.ts +6 -0
  522. package/dist/src/utils/session.js +8 -0
  523. package/dist/src/utils/session.js.map +1 -0
  524. package/dist/src/utils/shell-utils.d.ts +78 -0
  525. package/dist/src/utils/shell-utils.js +306 -0
  526. package/dist/src/utils/shell-utils.js.map +1 -0
  527. package/dist/src/utils/shell-utils.test.d.ts +6 -0
  528. package/dist/src/utils/shell-utils.test.js +200 -0
  529. package/dist/src/utils/shell-utils.test.js.map +1 -0
  530. package/dist/src/utils/summarizer.d.ts +25 -0
  531. package/dist/src/utils/summarizer.js +51 -0
  532. package/dist/src/utils/summarizer.js.map +1 -0
  533. package/dist/src/utils/summarizer.test.d.ts +6 -0
  534. package/dist/src/utils/summarizer.test.js +131 -0
  535. package/dist/src/utils/summarizer.test.js.map +1 -0
  536. package/dist/src/utils/systemEncoding.d.ts +40 -0
  537. package/dist/src/utils/systemEncoding.js +149 -0
  538. package/dist/src/utils/systemEncoding.js.map +1 -0
  539. package/dist/src/utils/systemEncoding.test.d.ts +6 -0
  540. package/dist/src/utils/systemEncoding.test.js +368 -0
  541. package/dist/src/utils/systemEncoding.test.js.map +1 -0
  542. package/dist/src/utils/testUtils.d.ts +29 -0
  543. package/dist/src/utils/testUtils.js +70 -0
  544. package/dist/src/utils/testUtils.js.map +1 -0
  545. package/dist/src/utils/textUtils.d.ts +13 -0
  546. package/dist/src/utils/textUtils.js +28 -0
  547. package/dist/src/utils/textUtils.js.map +1 -0
  548. package/dist/src/utils/user_account.d.ts +9 -0
  549. package/dist/src/utils/user_account.js +99 -0
  550. package/dist/src/utils/user_account.js.map +1 -0
  551. package/dist/src/utils/user_account.test.d.ts +6 -0
  552. package/dist/src/utils/user_account.test.js +153 -0
  553. package/dist/src/utils/user_account.test.js.map +1 -0
  554. package/dist/src/utils/user_id.d.ts +11 -0
  555. package/dist/src/utils/user_id.js +49 -0
  556. package/dist/src/utils/user_id.js.map +1 -0
  557. package/dist/src/utils/user_id.test.d.ts +6 -0
  558. package/dist/src/utils/user_id.test.js +21 -0
  559. package/dist/src/utils/user_id.test.js.map +1 -0
  560. package/dist/src/utils/workspaceContext.d.ts +51 -0
  561. package/dist/src/utils/workspaceContext.js +139 -0
  562. package/dist/src/utils/workspaceContext.js.map +1 -0
  563. package/dist/src/utils/workspaceContext.test.d.ts +6 -0
  564. package/dist/src/utils/workspaceContext.test.js +209 -0
  565. package/dist/src/utils/workspaceContext.test.js.map +1 -0
  566. package/dist/tsconfig.tsbuildinfo +1 -0
  567. package/package.json +74 -0
@@ -0,0 +1,265 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { describe, it, expect, beforeEach, vi } from 'vitest';
7
+ import { createIdeContextStore, FileSchema, IdeContextSchema, } from './ideContext.js';
8
+ describe('ideContext', () => {
9
+ describe('createIdeContextStore', () => {
10
+ let ideContext;
11
+ beforeEach(() => {
12
+ // Create a fresh, isolated instance for each test
13
+ ideContext = createIdeContextStore();
14
+ });
15
+ it('should return undefined initially for ide context', () => {
16
+ expect(ideContext.getIdeContext()).toBeUndefined();
17
+ });
18
+ it('should set and retrieve the ide context', () => {
19
+ const testFile = {
20
+ workspaceState: {
21
+ openFiles: [
22
+ {
23
+ path: '/path/to/test/file.ts',
24
+ isActive: true,
25
+ selectedText: '1234',
26
+ timestamp: 0,
27
+ },
28
+ ],
29
+ },
30
+ };
31
+ ideContext.setIdeContext(testFile);
32
+ const activeFile = ideContext.getIdeContext();
33
+ expect(activeFile).toEqual(testFile);
34
+ });
35
+ it('should update the ide context when called multiple times', () => {
36
+ const firstFile = {
37
+ workspaceState: {
38
+ openFiles: [
39
+ {
40
+ path: '/path/to/first.js',
41
+ isActive: true,
42
+ selectedText: '1234',
43
+ timestamp: 0,
44
+ },
45
+ ],
46
+ },
47
+ };
48
+ ideContext.setIdeContext(firstFile);
49
+ const secondFile = {
50
+ workspaceState: {
51
+ openFiles: [
52
+ {
53
+ path: '/path/to/second.py',
54
+ isActive: true,
55
+ cursor: { line: 20, character: 30 },
56
+ timestamp: 0,
57
+ },
58
+ ],
59
+ },
60
+ };
61
+ ideContext.setIdeContext(secondFile);
62
+ const activeFile = ideContext.getIdeContext();
63
+ expect(activeFile).toEqual(secondFile);
64
+ });
65
+ it('should handle empty string for file path', () => {
66
+ const testFile = {
67
+ workspaceState: {
68
+ openFiles: [
69
+ {
70
+ path: '',
71
+ isActive: true,
72
+ selectedText: '1234',
73
+ timestamp: 0,
74
+ },
75
+ ],
76
+ },
77
+ };
78
+ ideContext.setIdeContext(testFile);
79
+ expect(ideContext.getIdeContext()).toEqual(testFile);
80
+ });
81
+ it('should notify subscribers when ide context changes', () => {
82
+ const subscriber1 = vi.fn();
83
+ const subscriber2 = vi.fn();
84
+ ideContext.subscribeToIdeContext(subscriber1);
85
+ ideContext.subscribeToIdeContext(subscriber2);
86
+ const testFile = {
87
+ workspaceState: {
88
+ openFiles: [
89
+ {
90
+ path: '/path/to/subscribed.ts',
91
+ isActive: true,
92
+ cursor: { line: 15, character: 25 },
93
+ timestamp: 0,
94
+ },
95
+ ],
96
+ },
97
+ };
98
+ ideContext.setIdeContext(testFile);
99
+ expect(subscriber1).toHaveBeenCalledTimes(1);
100
+ expect(subscriber1).toHaveBeenCalledWith(testFile);
101
+ expect(subscriber2).toHaveBeenCalledTimes(1);
102
+ expect(subscriber2).toHaveBeenCalledWith(testFile);
103
+ // Test with another update
104
+ const newFile = {
105
+ workspaceState: {
106
+ openFiles: [
107
+ {
108
+ path: '/path/to/new.js',
109
+ isActive: true,
110
+ selectedText: '1234',
111
+ timestamp: 0,
112
+ },
113
+ ],
114
+ },
115
+ };
116
+ ideContext.setIdeContext(newFile);
117
+ expect(subscriber1).toHaveBeenCalledTimes(2);
118
+ expect(subscriber1).toHaveBeenCalledWith(newFile);
119
+ expect(subscriber2).toHaveBeenCalledTimes(2);
120
+ expect(subscriber2).toHaveBeenCalledWith(newFile);
121
+ });
122
+ it('should stop notifying a subscriber after unsubscribe', () => {
123
+ const subscriber1 = vi.fn();
124
+ const subscriber2 = vi.fn();
125
+ const unsubscribe1 = ideContext.subscribeToIdeContext(subscriber1);
126
+ ideContext.subscribeToIdeContext(subscriber2);
127
+ ideContext.setIdeContext({
128
+ workspaceState: {
129
+ openFiles: [
130
+ {
131
+ path: '/path/to/file1.txt',
132
+ isActive: true,
133
+ selectedText: '1234',
134
+ timestamp: 0,
135
+ },
136
+ ],
137
+ },
138
+ });
139
+ expect(subscriber1).toHaveBeenCalledTimes(1);
140
+ expect(subscriber2).toHaveBeenCalledTimes(1);
141
+ unsubscribe1();
142
+ ideContext.setIdeContext({
143
+ workspaceState: {
144
+ openFiles: [
145
+ {
146
+ path: '/path/to/file2.txt',
147
+ isActive: true,
148
+ selectedText: '1234',
149
+ timestamp: 0,
150
+ },
151
+ ],
152
+ },
153
+ });
154
+ expect(subscriber1).toHaveBeenCalledTimes(1); // Should not be called again
155
+ expect(subscriber2).toHaveBeenCalledTimes(2);
156
+ });
157
+ it('should clear the ide context', () => {
158
+ const testFile = {
159
+ workspaceState: {
160
+ openFiles: [
161
+ {
162
+ path: '/path/to/test/file.ts',
163
+ isActive: true,
164
+ selectedText: '1234',
165
+ timestamp: 0,
166
+ },
167
+ ],
168
+ },
169
+ };
170
+ ideContext.setIdeContext(testFile);
171
+ expect(ideContext.getIdeContext()).toEqual(testFile);
172
+ ideContext.clearIdeContext();
173
+ expect(ideContext.getIdeContext()).toBeUndefined();
174
+ });
175
+ });
176
+ describe('FileSchema', () => {
177
+ it('should validate a file with only required fields', () => {
178
+ const file = {
179
+ path: '/path/to/file.ts',
180
+ timestamp: 12345,
181
+ };
182
+ const result = FileSchema.safeParse(file);
183
+ expect(result.success).toBe(true);
184
+ });
185
+ it('should validate a file with all fields', () => {
186
+ const file = {
187
+ path: '/path/to/file.ts',
188
+ timestamp: 12345,
189
+ isActive: true,
190
+ selectedText: 'const x = 1;',
191
+ cursor: {
192
+ line: 10,
193
+ character: 20,
194
+ },
195
+ };
196
+ const result = FileSchema.safeParse(file);
197
+ expect(result.success).toBe(true);
198
+ });
199
+ it('should fail validation if path is missing', () => {
200
+ const file = {
201
+ timestamp: 12345,
202
+ };
203
+ const result = FileSchema.safeParse(file);
204
+ expect(result.success).toBe(false);
205
+ });
206
+ it('should fail validation if timestamp is missing', () => {
207
+ const file = {
208
+ path: '/path/to/file.ts',
209
+ };
210
+ const result = FileSchema.safeParse(file);
211
+ expect(result.success).toBe(false);
212
+ });
213
+ });
214
+ describe('IdeContextSchema', () => {
215
+ it('should validate an empty context', () => {
216
+ const context = {};
217
+ const result = IdeContextSchema.safeParse(context);
218
+ expect(result.success).toBe(true);
219
+ });
220
+ it('should validate a context with an empty workspaceState', () => {
221
+ const context = {
222
+ workspaceState: {},
223
+ };
224
+ const result = IdeContextSchema.safeParse(context);
225
+ expect(result.success).toBe(true);
226
+ });
227
+ it('should validate a context with an empty openFiles array', () => {
228
+ const context = {
229
+ workspaceState: {
230
+ openFiles: [],
231
+ },
232
+ };
233
+ const result = IdeContextSchema.safeParse(context);
234
+ expect(result.success).toBe(true);
235
+ });
236
+ it('should validate a context with a valid file', () => {
237
+ const context = {
238
+ workspaceState: {
239
+ openFiles: [
240
+ {
241
+ path: '/path/to/file.ts',
242
+ timestamp: 12345,
243
+ },
244
+ ],
245
+ },
246
+ };
247
+ const result = IdeContextSchema.safeParse(context);
248
+ expect(result.success).toBe(true);
249
+ });
250
+ it('should fail validation with an invalid file', () => {
251
+ const context = {
252
+ workspaceState: {
253
+ openFiles: [
254
+ {
255
+ timestamp: 12345, // path is missing
256
+ },
257
+ ],
258
+ },
259
+ };
260
+ const result = IdeContextSchema.safeParse(context);
261
+ expect(result.success).toBe(false);
262
+ });
263
+ });
264
+ });
265
+ //# sourceMappingURL=ideContext.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ideContext.test.js","sourceRoot":"","sources":["../../../src/ide/ideContext.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,IAAI,UAAoD,CAAC;QAEzD,UA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AAG,EAAE;YACrD,MAAM,OAAO,GAAG;gBACd,cAAc,EAAE;oBACd,SAAS,EAAE;wBACT;4BACE,SAAS,EAAE,KAAK,EAAE,kBAAkB;yBACrC;qBACF;iBACF;aACF,CAAC;YACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export * from './config/config.js';
7
+ export * from './core/client.js';
8
+ export * from './core/contentGenerator.js';
9
+ export * from './core/geminiChat.js';
10
+ export * from './core/logger.js';
11
+ export * from './core/prompts.js';
12
+ export * from './core/tokenLimits.js';
13
+ export * from './core/turn.js';
14
+ export * from './core/geminiRequest.js';
15
+ export * from './core/coreToolScheduler.js';
16
+ export * from './core/nonInteractiveToolExecutor.js';
17
+ export * from './code_assist/codeAssist.js';
18
+ export * from './code_assist/oauth2.js';
19
+ export * from './code_assist/server.js';
20
+ export * from './code_assist/types.js';
21
+ export * from './utils/paths.js';
22
+ export * from './utils/schemaValidator.js';
23
+ export * from './utils/errors.js';
24
+ export * from './utils/getFolderStructure.js';
25
+ export * from './utils/memoryDiscovery.js';
26
+ export * from './utils/gitIgnoreParser.js';
27
+ export * from './utils/gitUtils.js';
28
+ export * from './utils/editor.js';
29
+ export * from './utils/quotaErrorDetection.js';
30
+ export * from './utils/fileUtils.js';
31
+ export * from './utils/retry.js';
32
+ export * from './utils/shell-utils.js';
33
+ export * from './utils/systemEncoding.js';
34
+ export * from './utils/textUtils.js';
35
+ export * from './utils/formatters.js';
36
+ export * from './utils/filesearch/fileSearch.js';
37
+ export * from './services/fileDiscoveryService.js';
38
+ export * from './services/gitService.js';
39
+ export * from './ide/ide-client.js';
40
+ export * from './ide/ideContext.js';
41
+ export * from './ide/ide-installer.js';
42
+ export { getIdeDisplayName, DetectedIde } from './ide/detect-ide.js';
43
+ export * from './services/shellExecutionService.js';
44
+ export * from './tools/tools.js';
45
+ export * from './tools/tool-error.js';
46
+ export * from './tools/tool-registry.js';
47
+ export * from './prompts/mcp-prompts.js';
48
+ export * from './tools/read-file.js';
49
+ export * from './tools/ls.js';
50
+ export * from './tools/grep.js';
51
+ export * from './tools/glob.js';
52
+ export * from './tools/edit.js';
53
+ export * from './tools/write-file.js';
54
+ export * from './tools/web-fetch.js';
55
+ export * from './tools/memoryTool.js';
56
+ export * from './tools/shell.js';
57
+ export * from './tools/web-search.js';
58
+ export * from './tools/read-many-files.js';
59
+ export * from './tools/mcp-client.js';
60
+ export * from './tools/mcp-tool.js';
61
+ export { MCPOAuthProvider } from './mcp/oauth-provider.js';
62
+ export { MCPOAuthToken, MCPOAuthCredentials, MCPOAuthTokenStorage, } from './mcp/oauth-token-storage.js';
63
+ export type { MCPOAuthConfig } from './mcp/oauth-provider.js';
64
+ export type { OAuthAuthorizationServerMetadata, OAuthProtectedResourceMetadata, } from './mcp/oauth-utils.js';
65
+ export { OAuthUtils } from './mcp/oauth-utils.js';
66
+ export * from './telemetry/index.js';
67
+ export { sessionId } from './utils/session.js';
68
+ export * from './utils/browser.js';
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ // Export config
7
+ export * from './config/config.js';
8
+ // Export Core Logic
9
+ export * from './core/client.js';
10
+ export * from './core/contentGenerator.js';
11
+ export * from './core/geminiChat.js';
12
+ export * from './core/logger.js';
13
+ export * from './core/prompts.js';
14
+ export * from './core/tokenLimits.js';
15
+ export * from './core/turn.js';
16
+ export * from './core/geminiRequest.js';
17
+ export * from './core/coreToolScheduler.js';
18
+ export * from './core/nonInteractiveToolExecutor.js';
19
+ export * from './code_assist/codeAssist.js';
20
+ export * from './code_assist/oauth2.js';
21
+ export * from './code_assist/server.js';
22
+ export * from './code_assist/types.js';
23
+ // Export utilities
24
+ export * from './utils/paths.js';
25
+ export * from './utils/schemaValidator.js';
26
+ export * from './utils/errors.js';
27
+ export * from './utils/getFolderStructure.js';
28
+ export * from './utils/memoryDiscovery.js';
29
+ export * from './utils/gitIgnoreParser.js';
30
+ export * from './utils/gitUtils.js';
31
+ export * from './utils/editor.js';
32
+ export * from './utils/quotaErrorDetection.js';
33
+ export * from './utils/fileUtils.js';
34
+ export * from './utils/retry.js';
35
+ export * from './utils/shell-utils.js';
36
+ export * from './utils/systemEncoding.js';
37
+ export * from './utils/textUtils.js';
38
+ export * from './utils/formatters.js';
39
+ export * from './utils/filesearch/fileSearch.js';
40
+ // Export services
41
+ export * from './services/fileDiscoveryService.js';
42
+ export * from './services/gitService.js';
43
+ // Export IDE specific logic
44
+ export * from './ide/ide-client.js';
45
+ export * from './ide/ideContext.js';
46
+ export * from './ide/ide-installer.js';
47
+ export { getIdeDisplayName, DetectedIde } from './ide/detect-ide.js';
48
+ // Export Shell Execution Service
49
+ export * from './services/shellExecutionService.js';
50
+ // Export base tool definitions
51
+ export * from './tools/tools.js';
52
+ export * from './tools/tool-error.js';
53
+ export * from './tools/tool-registry.js';
54
+ // Export prompt logic
55
+ export * from './prompts/mcp-prompts.js';
56
+ // Export specific tool logic
57
+ export * from './tools/read-file.js';
58
+ export * from './tools/ls.js';
59
+ export * from './tools/grep.js';
60
+ export * from './tools/glob.js';
61
+ export * from './tools/edit.js';
62
+ export * from './tools/write-file.js';
63
+ export * from './tools/web-fetch.js';
64
+ export * from './tools/memoryTool.js';
65
+ export * from './tools/shell.js';
66
+ export * from './tools/web-search.js';
67
+ export * from './tools/read-many-files.js';
68
+ export * from './tools/mcp-client.js';
69
+ export * from './tools/mcp-tool.js';
70
+ // MCP OAuth
71
+ export { MCPOAuthProvider } from './mcp/oauth-provider.js';
72
+ export { MCPOAuthTokenStorage, } from './mcp/oauth-token-storage.js';
73
+ export { OAuthUtils } from './mcp/oauth-utils.js';
74
+ // Export telemetry functions
75
+ export * from './telemetry/index.js';
76
+ export { sessionId } from './utils/session.js';
77
+ export * from './utils/browser.js';
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gBAAgB;AAChB,cAAc,oBAAoB,CAAC;AAEnC,oBAAoB;AACpB,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AAErD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AAEvC,mBAAmB;AACnB,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AAEjD,kBAAkB;AAClB,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AAEzC,4BAA4B;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAErE,iCAAiC;AACjC,cAAc,qCAAqC,CAAC;AAEpD,+BAA+B;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AAEzC,sBAAsB;AACtB,cAAc,0BAA0B,CAAC;AAEzC,6BAA6B;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAGL,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,6BAA6B;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { describe, it, expect } from 'vitest';
7
+ describe('placeholder tests', () => {
8
+ it('should pass', () => {
9
+ expect(true).toBe(true);
10
+ });
11
+ });
12
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/index.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QACrB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
7
+ import { OAuthClientInformation, OAuthClientInformationFull, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
8
+ import { MCPServerConfig } from '../config/config.js';
9
+ export declare class GoogleCredentialProvider implements OAuthClientProvider {
10
+ private readonly config?;
11
+ private readonly auth;
12
+ readonly redirectUrl = "";
13
+ readonly clientMetadata: OAuthClientMetadata;
14
+ private _clientInformation?;
15
+ constructor(config?: MCPServerConfig | undefined);
16
+ clientInformation(): OAuthClientInformation | undefined;
17
+ saveClientInformation(clientInformation: OAuthClientInformationFull): void;
18
+ tokens(): Promise<OAuthTokens | undefined>;
19
+ saveTokens(_tokens: OAuthTokens): void;
20
+ redirectToAuthorization(_authorizationUrl: URL): void;
21
+ saveCodeVerifier(_codeVerifier: string): void;
22
+ codeVerifier(): string;
23
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GoogleAuth } from 'google-auth-library';
7
+ export class GoogleCredentialProvider {
8
+ config;
9
+ auth;
10
+ // Properties required by OAuthClientProvider, with no-op values
11
+ redirectUrl = '';
12
+ clientMetadata = {
13
+ client_name: 'Gemini CLI (Google ADC)',
14
+ redirect_uris: [],
15
+ grant_types: [],
16
+ response_types: [],
17
+ token_endpoint_auth_method: 'none',
18
+ };
19
+ _clientInformation;
20
+ constructor(config) {
21
+ this.config = config;
22
+ const scopes = this.config?.oauth?.scopes;
23
+ if (!scopes || scopes.length === 0) {
24
+ throw new Error('Scopes must be provided in the oauth config for Google Credentials provider');
25
+ }
26
+ this.auth = new GoogleAuth({
27
+ scopes,
28
+ });
29
+ }
30
+ clientInformation() {
31
+ return this._clientInformation;
32
+ }
33
+ saveClientInformation(clientInformation) {
34
+ this._clientInformation = clientInformation;
35
+ }
36
+ async tokens() {
37
+ const client = await this.auth.getClient();
38
+ const accessTokenResponse = await client.getAccessToken();
39
+ if (!accessTokenResponse.token) {
40
+ console.error('Failed to get access token from Google ADC');
41
+ return undefined;
42
+ }
43
+ const tokens = {
44
+ access_token: accessTokenResponse.token,
45
+ token_type: 'Bearer',
46
+ };
47
+ return tokens;
48
+ }
49
+ saveTokens(_tokens) {
50
+ // No-op, ADC manages tokens.
51
+ }
52
+ redirectToAuthorization(_authorizationUrl) {
53
+ // No-op
54
+ }
55
+ saveCodeVerifier(_codeVerifier) {
56
+ // No-op
57
+ }
58
+ codeVerifier() {
59
+ // No-op
60
+ return '';
61
+ }
62
+ }
63
+ //# sourceMappingURL=google-auth-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-auth-provider.js","sourceRoot":"","sources":["../../../src/mcp/google-auth-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,OAAO,wBAAwB;IAcN;IAbZ,IAAI,CAAa;IAElC,gEAAgE;IACvD,WAAW,GAAG,EAAE,CA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CAAC,aAAqB;QACpC,QAAQ;IACV,CAAC;IAED,YAAY;QACV,QAAQ;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export {};
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GoogleAuth } from 'google-auth-library';
7
+ import { GoogleCredentialProvider } from './google-auth-provider.js';
8
+ import { vi, describe, beforeEach, it, expect } from 'vitest';
9
+ vi.mock('google-auth-library');
10
+ describe('GoogleCredentialProvider', () => {
11
+ it('should throw an error if no scopes are provided', () => {
12
+ expect(() => new GoogleCredentialProvider()).toThrow('Scopes must be provided in the oauth config for Google Credentials provider');
13
+ });
14
+ it('should use scopes from the config if provided', () => {
15
+ const config = {
16
+ oauth: {
17
+ scopes: ['scope1', 'scope2'],
18
+ },
19
+ };
20
+ new GoogleCredentialProvider(config);
21
+ expect(GoogleAuth).toHaveBeenCalledWith({
22
+ scopes: ['scope1', 'scope2'],
23
+ });
24
+ });
25
+ describe('with provider instance', () => {
26
+ let provider;
27
+ beforeEach(() => {
28
+ const config = {
29
+ oauth: {
30
+ scopes: ['scope1', 'scope2'],
31
+ },
32
+ };
33
+ provider = new GoogleCredentialProvider(config);
34
+ vi.clearAllMocks();
35
+ });
36
+ it('should return credentials', async () => {
37
+ const mockClient = {
38
+ getAccessToken: vi.fn().mockResolvedValue({ token: 'test-token' }),
39
+ };
40
+ GoogleAuth.prototype.getClient.mockResolvedValue(mockClient);
41
+ const credentials = await provider.tokens();
42
+ expect(credentials?.access_token).toBe('test-token');
43
+ });
44
+ it('should return undefined if access token is not available', async () => {
45
+ const mockClient = {
46
+ getAccessToken: vi.fn().mockResolvedValue({ token: null }),
47
+ };
48
+ GoogleAuth.prototype.getClient.mockResolvedValue(mockClient);
49
+ const credentials = await provider.tokens();
50
+ expect(credentials).toBeUndefined();
51
+ });
52
+ });
53
+ });
54
+ //# sourceMappingURL=google-auth-provider.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-auth-provider.test.js","sourceRoot":"","sources":["../../../src/mcp/google-auth-provider.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AAGpE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAE/B,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAClD,6EAA6E,CAC9E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,MAAM,GAAG;YACb,KAAK,EAAE;gBACL,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAC7B;SACiB,CAAC;QACrB,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;SAC7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,IAAI,QAAkC,CAAC;QAEvC,UAAU,CAAC,GAAG,EAAE;YACd,MAAM,MAAM,GAAG;gBACb,KAAK,EAAE;oBACL,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,C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