@quantum-ai/gemini-cli 0.45.4 → 0.45.5

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 (1440) hide show
  1. package/README.md +394 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +12 -11
  5. package/dist/src/config/settingsSchema.d.ts +1 -1
  6. package/dist/src/index.d.ts +1 -0
  7. package/dist/src/index.js +1 -0
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/ui/App.d.ts +1 -1
  10. package/dist/src/ui/AppContainer.d.ts +1 -1
  11. package/dist/src/ui/IdeIntegrationNudge.d.ts +1 -1
  12. package/dist/src/ui/auth/LoginRestartDialog.d.ts +1 -1
  13. package/dist/src/ui/components/AdminSettingsChangedDialog.d.ts +1 -1
  14. package/dist/src/ui/components/AlternateBufferQuittingDisplay.d.ts +1 -1
  15. package/dist/src/ui/components/AppHeader.d.ts +1 -1
  16. package/dist/src/ui/components/BackgroundTaskDisplay.d.ts +1 -1
  17. package/dist/src/ui/components/Banner.d.ts +1 -1
  18. package/dist/src/ui/components/CliSpinner.d.ts +1 -1
  19. package/dist/src/ui/components/Composer.d.ts +1 -1
  20. package/dist/src/ui/components/ConfigInitDisplay.d.ts +1 -1
  21. package/dist/src/ui/components/ConsentPrompt.d.ts +1 -1
  22. package/dist/src/ui/components/ContextUsageDisplay.d.ts +1 -1
  23. package/dist/src/ui/components/DebugProfiler.d.ts +1 -1
  24. package/dist/src/ui/components/DialogManager.d.ts +1 -1
  25. package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +1 -1
  26. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +1 -1
  27. package/dist/src/ui/components/MainContent.d.ts +1 -1
  28. package/dist/src/ui/components/ModelQuotaDisplay.d.ts +1 -1
  29. package/dist/src/ui/components/NewAgentsNotification.d.ts +1 -1
  30. package/dist/src/ui/components/Notifications.d.ts +1 -1
  31. package/dist/src/ui/components/QueuedMessageDisplay.d.ts +1 -1
  32. package/dist/src/ui/components/QuittingDisplay.d.ts +1 -1
  33. package/dist/src/ui/components/ShowMoreLines.d.ts +1 -1
  34. package/dist/src/ui/components/SuggestionsDisplay.d.ts +1 -1
  35. package/dist/src/ui/components/Table.d.ts +1 -1
  36. package/dist/src/ui/components/UpdateNotification.d.ts +1 -1
  37. package/dist/src/ui/components/shared/SlicingMaxSizedBox.d.ts +1 -1
  38. package/dist/src/ui/components/triage/TriageDuplicates.d.ts +1 -1
  39. package/dist/src/ui/components/triage/TriageIssues.d.ts +1 -1
  40. package/dist/src/ui/contexts/KeypressContext.d.ts +1 -1
  41. package/dist/src/ui/contexts/MouseContext.d.ts +1 -1
  42. package/dist/src/ui/contexts/TerminalContext.d.ts +1 -1
  43. package/dist/src/ui/contexts/VimModeContext.d.ts +1 -1
  44. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +2 -2
  45. package/dist/src/ui/hooks/useInlineEditBuffer.d.ts +1 -1
  46. package/dist/src/ui/hooks/useStateAndRef.d.ts +1 -1
  47. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +1 -1
  48. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +1 -1
  49. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +1 -1
  50. package/dist/src/ui/privacy/PrivacyNotice.d.ts +1 -1
  51. package/dist/src/utils/devtoolsService.js +1 -1
  52. package/dist/src/utils/devtoolsService.js.map +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +12 -11
  55. package/dist/src/acp/acpCommandHandler.test.d.ts +0 -6
  56. package/dist/src/acp/acpCommandHandler.test.js +0 -28
  57. package/dist/src/acp/acpCommandHandler.test.js.map +0 -1
  58. package/dist/src/acp/acpErrors.test.d.ts +0 -6
  59. package/dist/src/acp/acpErrors.test.js +0 -38
  60. package/dist/src/acp/acpErrors.test.js.map +0 -1
  61. package/dist/src/acp/acpFileSystemService.test.d.ts +0 -6
  62. package/dist/src/acp/acpFileSystemService.test.js +0 -162
  63. package/dist/src/acp/acpFileSystemService.test.js.map +0 -1
  64. package/dist/src/acp/acpResume.test.d.ts +0 -6
  65. package/dist/src/acp/acpResume.test.js +0 -260
  66. package/dist/src/acp/acpResume.test.js.map +0 -1
  67. package/dist/src/acp/acpRpcDispatcher.test.d.ts +0 -6
  68. package/dist/src/acp/acpRpcDispatcher.test.js +0 -238
  69. package/dist/src/acp/acpRpcDispatcher.test.js.map +0 -1
  70. package/dist/src/acp/acpSession.test.d.ts +0 -6
  71. package/dist/src/acp/acpSession.test.js +0 -742
  72. package/dist/src/acp/acpSession.test.js.map +0 -1
  73. package/dist/src/acp/acpSessionManager.test.d.ts +0 -6
  74. package/dist/src/acp/acpSessionManager.test.js +0 -283
  75. package/dist/src/acp/acpSessionManager.test.js.map +0 -1
  76. package/dist/src/acp/commands/extensions.test.d.ts +0 -6
  77. package/dist/src/acp/commands/extensions.test.js +0 -70
  78. package/dist/src/acp/commands/extensions.test.js.map +0 -1
  79. package/dist/src/acp/commands/help.test.d.ts +0 -6
  80. package/dist/src/acp/commands/help.test.js +0 -40
  81. package/dist/src/acp/commands/help.test.js.map +0 -1
  82. package/dist/src/acp/commands/restore.test.d.ts +0 -6
  83. package/dist/src/acp/commands/restore.test.js +0 -173
  84. package/dist/src/acp/commands/restore.test.js.map +0 -1
  85. package/dist/src/commands/extensions/configure.test.d.ts +0 -1
  86. package/dist/src/commands/extensions/configure.test.js +0 -195
  87. package/dist/src/commands/extensions/configure.test.js.map +0 -1
  88. package/dist/src/commands/extensions/disable.test.d.ts +0 -6
  89. package/dist/src/commands/extensions/disable.test.js +0 -169
  90. package/dist/src/commands/extensions/disable.test.js.map +0 -1
  91. package/dist/src/commands/extensions/enable.test.d.ts +0 -6
  92. package/dist/src/commands/extensions/enable.test.js +0 -199
  93. package/dist/src/commands/extensions/enable.test.js.map +0 -1
  94. package/dist/src/commands/extensions/install.test.d.ts +0 -6
  95. package/dist/src/commands/extensions/install.test.js +0 -311
  96. package/dist/src/commands/extensions/install.test.js.map +0 -1
  97. package/dist/src/commands/extensions/link.test.d.ts +0 -6
  98. package/dist/src/commands/extensions/link.test.js +0 -121
  99. package/dist/src/commands/extensions/link.test.js.map +0 -1
  100. package/dist/src/commands/extensions/list.test.d.ts +0 -6
  101. package/dist/src/commands/extensions/list.test.js +0 -132
  102. package/dist/src/commands/extensions/list.test.js.map +0 -1
  103. package/dist/src/commands/extensions/new.test.d.ts +0 -6
  104. package/dist/src/commands/extensions/new.test.js +0 -62
  105. package/dist/src/commands/extensions/new.test.js.map +0 -1
  106. package/dist/src/commands/extensions/uninstall.test.d.ts +0 -6
  107. package/dist/src/commands/extensions/uninstall.test.js +0 -240
  108. package/dist/src/commands/extensions/uninstall.test.js.map +0 -1
  109. package/dist/src/commands/extensions/update.test.d.ts +0 -6
  110. package/dist/src/commands/extensions/update.test.js +0 -196
  111. package/dist/src/commands/extensions/update.test.js.map +0 -1
  112. package/dist/src/commands/extensions/validate.test.d.ts +0 -6
  113. package/dist/src/commands/extensions/validate.test.js +0 -96
  114. package/dist/src/commands/extensions/validate.test.js.map +0 -1
  115. package/dist/src/commands/extensions.test.d.ts +0 -6
  116. package/dist/src/commands/extensions.test.js +0 -67
  117. package/dist/src/commands/extensions.test.js.map +0 -1
  118. package/dist/src/commands/gemma/logs.test.d.ts +0 -6
  119. package/dist/src/commands/gemma/logs.test.js +0 -122
  120. package/dist/src/commands/gemma/logs.test.js.map +0 -1
  121. package/dist/src/commands/gemma/platform.test.d.ts +0 -6
  122. package/dist/src/commands/gemma/platform.test.js +0 -108
  123. package/dist/src/commands/gemma/platform.test.js.map +0 -1
  124. package/dist/src/commands/gemma/setup.test.d.ts +0 -6
  125. package/dist/src/commands/gemma/setup.test.js +0 -36
  126. package/dist/src/commands/gemma/setup.test.js.map +0 -1
  127. package/dist/src/commands/gemma/stop.test.d.ts +0 -6
  128. package/dist/src/commands/gemma/stop.test.js +0 -89
  129. package/dist/src/commands/gemma/stop.test.js.map +0 -1
  130. package/dist/src/commands/hooks/migrate.test.d.ts +0 -6
  131. package/dist/src/commands/hooks/migrate.test.js +0 -388
  132. package/dist/src/commands/hooks/migrate.test.js.map +0 -1
  133. package/dist/src/commands/mcp/add.test.d.ts +0 -6
  134. package/dist/src/commands/mcp/add.test.js +0 -274
  135. package/dist/src/commands/mcp/add.test.js.map +0 -1
  136. package/dist/src/commands/mcp/list.test.d.ts +0 -6
  137. package/dist/src/commands/mcp/list.test.js +0 -477
  138. package/dist/src/commands/mcp/list.test.js.map +0 -1
  139. package/dist/src/commands/mcp/remove.test.d.ts +0 -6
  140. package/dist/src/commands/mcp/remove.test.js +0 -206
  141. package/dist/src/commands/mcp/remove.test.js.map +0 -1
  142. package/dist/src/commands/mcp.test.d.ts +0 -6
  143. package/dist/src/commands/mcp.test.js +0 -64
  144. package/dist/src/commands/mcp.test.js.map +0 -1
  145. package/dist/src/commands/skills/disable.test.d.ts +0 -6
  146. package/dist/src/commands/skills/disable.test.js +0 -93
  147. package/dist/src/commands/skills/disable.test.js.map +0 -1
  148. package/dist/src/commands/skills/enable.test.d.ts +0 -6
  149. package/dist/src/commands/skills/enable.test.js +0 -104
  150. package/dist/src/commands/skills/enable.test.js.map +0 -1
  151. package/dist/src/commands/skills/install.test.d.ts +0 -6
  152. package/dist/src/commands/skills/install.test.js +0 -99
  153. package/dist/src/commands/skills/install.test.js.map +0 -1
  154. package/dist/src/commands/skills/link.test.d.ts +0 -6
  155. package/dist/src/commands/skills/link.test.js +0 -53
  156. package/dist/src/commands/skills/link.test.js.map +0 -1
  157. package/dist/src/commands/skills/list.test.d.ts +0 -6
  158. package/dist/src/commands/skills/list.test.js +0 -127
  159. package/dist/src/commands/skills/list.test.js.map +0 -1
  160. package/dist/src/commands/skills/uninstall.test.d.ts +0 -6
  161. package/dist/src/commands/skills/uninstall.test.js +0 -65
  162. package/dist/src/commands/skills/uninstall.test.js.map +0 -1
  163. package/dist/src/commands/skills.test.d.ts +0 -6
  164. package/dist/src/commands/skills.test.js +0 -49
  165. package/dist/src/commands/skills.test.js.map +0 -1
  166. package/dist/src/commands/utils.test.d.ts +0 -6
  167. package/dist/src/commands/utils.test.js +0 -35
  168. package/dist/src/commands/utils.test.js.map +0 -1
  169. package/dist/src/config/auth.test.d.ts +0 -6
  170. package/dist/src/config/auth.test.js +0 -96
  171. package/dist/src/config/auth.test.js.map +0 -1
  172. package/dist/src/config/config.integration.test.d.ts +0 -6
  173. package/dist/src/config/config.integration.test.js +0 -205
  174. package/dist/src/config/config.integration.test.js.map +0 -1
  175. package/dist/src/config/config.test.d.ts +0 -6
  176. package/dist/src/config/config.test.js +0 -3124
  177. package/dist/src/config/config.test.js.map +0 -1
  178. package/dist/src/config/extension-manager-agents.test.d.ts +0 -6
  179. package/dist/src/config/extension-manager-agents.test.js +0 -116
  180. package/dist/src/config/extension-manager-agents.test.js.map +0 -1
  181. package/dist/src/config/extension-manager-hydration.test.d.ts +0 -6
  182. package/dist/src/config/extension-manager-hydration.test.js +0 -262
  183. package/dist/src/config/extension-manager-hydration.test.js.map +0 -1
  184. package/dist/src/config/extension-manager-permissions.test.d.ts +0 -6
  185. package/dist/src/config/extension-manager-permissions.test.js +0 -107
  186. package/dist/src/config/extension-manager-permissions.test.js.map +0 -1
  187. package/dist/src/config/extension-manager-scope.test.d.ts +0 -6
  188. package/dist/src/config/extension-manager-scope.test.js +0 -158
  189. package/dist/src/config/extension-manager-scope.test.js.map +0 -1
  190. package/dist/src/config/extension-manager-skills.test.d.ts +0 -6
  191. package/dist/src/config/extension-manager-skills.test.js +0 -157
  192. package/dist/src/config/extension-manager-skills.test.js.map +0 -1
  193. package/dist/src/config/extension-manager.test.d.ts +0 -6
  194. package/dist/src/config/extension-manager.test.js +0 -430
  195. package/dist/src/config/extension-manager.test.js.map +0 -1
  196. package/dist/src/config/extension.test.d.ts +0 -6
  197. package/dist/src/config/extension.test.js +0 -1800
  198. package/dist/src/config/extension.test.js.map +0 -1
  199. package/dist/src/config/extensionRegistryClient.test.d.ts +0 -6
  200. package/dist/src/config/extensionRegistryClient.test.js +0 -261
  201. package/dist/src/config/extensionRegistryClient.test.js.map +0 -1
  202. package/dist/src/config/extensions/consent.test.d.ts +0 -6
  203. package/dist/src/config/extensions/consent.test.js +0 -302
  204. package/dist/src/config/extensions/consent.test.js.map +0 -1
  205. package/dist/src/config/extensions/extensionEnablement.test.d.ts +0 -6
  206. package/dist/src/config/extensions/extensionEnablement.test.js +0 -404
  207. package/dist/src/config/extensions/extensionEnablement.test.js.map +0 -1
  208. package/dist/src/config/extensions/extensionSettings.test.d.ts +0 -6
  209. package/dist/src/config/extensions/extensionSettings.test.js +0 -575
  210. package/dist/src/config/extensions/extensionSettings.test.js.map +0 -1
  211. package/dist/src/config/extensions/extensionUpdates.test.d.ts +0 -6
  212. package/dist/src/config/extensions/extensionUpdates.test.js +0 -265
  213. package/dist/src/config/extensions/extensionUpdates.test.js.map +0 -1
  214. package/dist/src/config/extensions/github.test.d.ts +0 -6
  215. package/dist/src/config/extensions/github.test.js +0 -454
  216. package/dist/src/config/extensions/github.test.js.map +0 -1
  217. package/dist/src/config/extensions/github_fetch.test.d.ts +0 -6
  218. package/dist/src/config/extensions/github_fetch.test.js +0 -171
  219. package/dist/src/config/extensions/github_fetch.test.js.map +0 -1
  220. package/dist/src/config/extensions/storage.test.d.ts +0 -6
  221. package/dist/src/config/extensions/storage.test.js +0 -64
  222. package/dist/src/config/extensions/storage.test.js.map +0 -1
  223. package/dist/src/config/extensions/update.test.d.ts +0 -6
  224. package/dist/src/config/extensions/update.test.js +0 -296
  225. package/dist/src/config/extensions/update.test.js.map +0 -1
  226. package/dist/src/config/extensions/variables.test.d.ts +0 -6
  227. package/dist/src/config/extensions/variables.test.js +0 -119
  228. package/dist/src/config/extensions/variables.test.js.map +0 -1
  229. package/dist/src/config/footerItems.test.d.ts +0 -6
  230. package/dist/src/config/footerItems.test.js +0 -180
  231. package/dist/src/config/footerItems.test.js.map +0 -1
  232. package/dist/src/config/mcp/mcpServerEnablement.test.d.ts +0 -6
  233. package/dist/src/config/mcp/mcpServerEnablement.test.js +0 -148
  234. package/dist/src/config/mcp/mcpServerEnablement.test.js.map +0 -1
  235. package/dist/src/config/mutual-exclusivity.test.d.ts +0 -6
  236. package/dist/src/config/mutual-exclusivity.test.js +0 -33
  237. package/dist/src/config/mutual-exclusivity.test.js.map +0 -1
  238. package/dist/src/config/policy-engine.integration.test.d.ts +0 -6
  239. package/dist/src/config/policy-engine.integration.test.js +0 -394
  240. package/dist/src/config/policy-engine.integration.test.js.map +0 -1
  241. package/dist/src/config/policy.test.d.ts +0 -6
  242. package/dist/src/config/policy.test.js +0 -199
  243. package/dist/src/config/policy.test.js.map +0 -1
  244. package/dist/src/config/sandboxConfig.test.d.ts +0 -6
  245. package/dist/src/config/sandboxConfig.test.js +0 -401
  246. package/dist/src/config/sandboxConfig.test.js.map +0 -1
  247. package/dist/src/config/settingPaths.test.d.ts +0 -6
  248. package/dist/src/config/settingPaths.test.js +0 -22
  249. package/dist/src/config/settingPaths.test.js.map +0 -1
  250. package/dist/src/config/settings-env-isolation.test.d.ts +0 -6
  251. package/dist/src/config/settings-env-isolation.test.js +0 -188
  252. package/dist/src/config/settings-env-isolation.test.js.map +0 -1
  253. package/dist/src/config/settings-validation.test.d.ts +0 -6
  254. package/dist/src/config/settings-validation.test.js +0 -464
  255. package/dist/src/config/settings-validation.test.js.map +0 -1
  256. package/dist/src/config/settings.test.d.ts +0 -6
  257. package/dist/src/config/settings.test.js +0 -2660
  258. package/dist/src/config/settings.test.js.map +0 -1
  259. package/dist/src/config/settingsSchema.test.d.ts +0 -6
  260. package/dist/src/config/settingsSchema.test.js +0 -450
  261. package/dist/src/config/settingsSchema.test.js.map +0 -1
  262. package/dist/src/config/settings_repro.test.d.ts +0 -6
  263. package/dist/src/config/settings_repro.test.js +0 -163
  264. package/dist/src/config/settings_repro.test.js.map +0 -1
  265. package/dist/src/config/settings_validation_warning.test.d.ts +0 -6
  266. package/dist/src/config/settings_validation_warning.test.js +0 -124
  267. package/dist/src/config/settings_validation_warning.test.js.map +0 -1
  268. package/dist/src/config/skipExtensions.test.d.ts +0 -6
  269. package/dist/src/config/skipExtensions.test.js +0 -49
  270. package/dist/src/config/skipExtensions.test.js.map +0 -1
  271. package/dist/src/config/trustedFolders.test.d.ts +0 -6
  272. package/dist/src/config/trustedFolders.test.js +0 -411
  273. package/dist/src/config/trustedFolders.test.js.map +0 -1
  274. package/dist/src/config/workspace-policy-cli.test.d.ts +0 -6
  275. package/dist/src/config/workspace-policy-cli.test.js +0 -204
  276. package/dist/src/config/workspace-policy-cli.test.js.map +0 -1
  277. package/dist/src/core/auth.test.d.ts +0 -6
  278. package/dist/src/core/auth.test.js +0 -93
  279. package/dist/src/core/auth.test.js.map +0 -1
  280. package/dist/src/core/initializer.test.d.ts +0 -6
  281. package/dist/src/core/initializer.test.js +0 -111
  282. package/dist/src/core/initializer.test.js.map +0 -1
  283. package/dist/src/core/theme.test.d.ts +0 -6
  284. package/dist/src/core/theme.test.js +0 -46
  285. package/dist/src/core/theme.test.js.map +0 -1
  286. package/dist/src/deferred.test.d.ts +0 -6
  287. package/dist/src/deferred.test.js +0 -180
  288. package/dist/src/deferred.test.js.map +0 -1
  289. package/dist/src/gemini.test.d.ts +0 -6
  290. package/dist/src/gemini.test.js +0 -1432
  291. package/dist/src/gemini.test.js.map +0 -1
  292. package/dist/src/gemini_cleanup.test.d.ts +0 -6
  293. package/dist/src/gemini_cleanup.test.js +0 -391
  294. package/dist/src/gemini_cleanup.test.js.map +0 -1
  295. package/dist/src/integration-tests/modelSteering.test.d.ts +0 -6
  296. package/dist/src/integration-tests/modelSteering.test.js +0 -62
  297. package/dist/src/integration-tests/modelSteering.test.js.map +0 -1
  298. package/dist/src/nonInteractiveCli.test.d.ts +0 -6
  299. package/dist/src/nonInteractiveCli.test.js +0 -1921
  300. package/dist/src/nonInteractiveCli.test.js.map +0 -1
  301. package/dist/src/nonInteractiveCliAgentSession.test.d.ts +0 -6
  302. package/dist/src/nonInteractiveCliAgentSession.test.js +0 -2015
  303. package/dist/src/nonInteractiveCliAgentSession.test.js.map +0 -1
  304. package/dist/src/output-redirection.test.d.ts +0 -6
  305. package/dist/src/output-redirection.test.js +0 -77
  306. package/dist/src/output-redirection.test.js.map +0 -1
  307. package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
  308. package/dist/src/services/BuiltinCommandLoader.test.js +0 -369
  309. package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
  310. package/dist/src/services/CommandService.test.d.ts +0 -6
  311. package/dist/src/services/CommandService.test.js +0 -74
  312. package/dist/src/services/CommandService.test.js.map +0 -1
  313. package/dist/src/services/FileCommandLoader.test.d.ts +0 -6
  314. package/dist/src/services/FileCommandLoader.test.js +0 -1128
  315. package/dist/src/services/FileCommandLoader.test.js.map +0 -1
  316. package/dist/src/services/McpPromptLoader.test.d.ts +0 -6
  317. package/dist/src/services/McpPromptLoader.test.js +0 -411
  318. package/dist/src/services/McpPromptLoader.test.js.map +0 -1
  319. package/dist/src/services/SkillCommandLoader.test.d.ts +0 -6
  320. package/dist/src/services/SkillCommandLoader.test.js +0 -113
  321. package/dist/src/services/SkillCommandLoader.test.js.map +0 -1
  322. package/dist/src/services/SlashCommandConflictHandler.test.d.ts +0 -6
  323. package/dist/src/services/SlashCommandConflictHandler.test.js +0 -144
  324. package/dist/src/services/SlashCommandConflictHandler.test.js.map +0 -1
  325. package/dist/src/services/SlashCommandResolver.test.d.ts +0 -6
  326. package/dist/src/services/SlashCommandResolver.test.js +0 -186
  327. package/dist/src/services/SlashCommandResolver.test.js.map +0 -1
  328. package/dist/src/services/liteRtServerManager.test.d.ts +0 -6
  329. package/dist/src/services/liteRtServerManager.test.js +0 -54
  330. package/dist/src/services/liteRtServerManager.test.js.map +0 -1
  331. package/dist/src/services/prompt-processors/argumentProcessor.test.d.ts +0 -6
  332. package/dist/src/services/prompt-processors/argumentProcessor.test.js +0 -40
  333. package/dist/src/services/prompt-processors/argumentProcessor.test.js.map +0 -1
  334. package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +0 -6
  335. package/dist/src/services/prompt-processors/atFileProcessor.test.js +0 -177
  336. package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +0 -1
  337. package/dist/src/services/prompt-processors/injectionParser.test.d.ts +0 -6
  338. package/dist/src/services/prompt-processors/injectionParser.test.js +0 -189
  339. package/dist/src/services/prompt-processors/injectionParser.test.js.map +0 -1
  340. package/dist/src/services/prompt-processors/shellProcessor.test.d.ts +0 -6
  341. package/dist/src/services/prompt-processors/shellProcessor.test.js +0 -525
  342. package/dist/src/services/prompt-processors/shellProcessor.test.js.map +0 -1
  343. package/dist/src/test-utils/AppRig.test.d.ts +0 -6
  344. package/dist/src/test-utils/AppRig.test.js +0 -60
  345. package/dist/src/test-utils/AppRig.test.js.map +0 -1
  346. package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
  347. package/dist/src/test-utils/mockCommandContext.test.js +0 -51
  348. package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
  349. package/dist/src/test-utils/render.test.d.ts +0 -6
  350. package/dist/src/test-utils/render.test.js +0 -84
  351. package/dist/src/test-utils/render.test.js.map +0 -1
  352. package/dist/src/ui/App.test.d.ts +0 -6
  353. package/dist/src/ui/App.test.js +0 -244
  354. package/dist/src/ui/App.test.js.map +0 -1
  355. package/dist/src/ui/AppContainer.test.d.ts +0 -6
  356. package/dist/src/ui/AppContainer.test.js +0 -2824
  357. package/dist/src/ui/AppContainer.test.js.map +0 -1
  358. package/dist/src/ui/IdeIntegrationNudge.test.d.ts +0 -6
  359. package/dist/src/ui/IdeIntegrationNudge.test.js +0 -149
  360. package/dist/src/ui/IdeIntegrationNudge.test.js.map +0 -1
  361. package/dist/src/ui/ToolConfirmationFullFrame.test.d.ts +0 -1
  362. package/dist/src/ui/ToolConfirmationFullFrame.test.js +0 -153
  363. package/dist/src/ui/ToolConfirmationFullFrame.test.js.map +0 -1
  364. package/dist/src/ui/auth/ApiAuthDialog.test.d.ts +0 -6
  365. package/dist/src/ui/auth/ApiAuthDialog.test.js +0 -127
  366. package/dist/src/ui/auth/ApiAuthDialog.test.js.map +0 -1
  367. package/dist/src/ui/auth/AuthDialog.test.d.ts +0 -6
  368. package/dist/src/ui/auth/AuthDialog.test.js +0 -350
  369. package/dist/src/ui/auth/AuthDialog.test.js.map +0 -1
  370. package/dist/src/ui/auth/AuthInProgress.test.d.ts +0 -6
  371. package/dist/src/ui/auth/AuthInProgress.test.js +0 -99
  372. package/dist/src/ui/auth/AuthInProgress.test.js.map +0 -1
  373. package/dist/src/ui/auth/BannedAccountDialog.test.d.ts +0 -6
  374. package/dist/src/ui/auth/BannedAccountDialog.test.js +0 -141
  375. package/dist/src/ui/auth/BannedAccountDialog.test.js.map +0 -1
  376. package/dist/src/ui/auth/LoginRestartDialog.test.d.ts +0 -6
  377. package/dist/src/ui/auth/LoginRestartDialog.test.js +0 -79
  378. package/dist/src/ui/auth/LoginRestartDialog.test.js.map +0 -1
  379. package/dist/src/ui/auth/useAuth.test.d.ts +0 -6
  380. package/dist/src/ui/auth/useAuth.test.js +0 -214
  381. package/dist/src/ui/auth/useAuth.test.js.map +0 -1
  382. package/dist/src/ui/commands/aboutCommand.test.d.ts +0 -6
  383. package/dist/src/ui/commands/aboutCommand.test.js +0 -145
  384. package/dist/src/ui/commands/aboutCommand.test.js.map +0 -1
  385. package/dist/src/ui/commands/agentsCommand.test.d.ts +0 -6
  386. package/dist/src/ui/commands/agentsCommand.test.js +0 -382
  387. package/dist/src/ui/commands/agentsCommand.test.js.map +0 -1
  388. package/dist/src/ui/commands/authCommand.test.d.ts +0 -6
  389. package/dist/src/ui/commands/authCommand.test.js +0 -103
  390. package/dist/src/ui/commands/authCommand.test.js.map +0 -1
  391. package/dist/src/ui/commands/bugCommand.test.d.ts +0 -6
  392. package/dist/src/ui/commands/bugCommand.test.js +0 -305
  393. package/dist/src/ui/commands/bugCommand.test.js.map +0 -1
  394. package/dist/src/ui/commands/bugMemoryCommand.test.d.ts +0 -6
  395. package/dist/src/ui/commands/bugMemoryCommand.test.js +0 -100
  396. package/dist/src/ui/commands/bugMemoryCommand.test.js.map +0 -1
  397. package/dist/src/ui/commands/chatCommand.test.d.ts +0 -6
  398. package/dist/src/ui/commands/chatCommand.test.js +0 -627
  399. package/dist/src/ui/commands/chatCommand.test.js.map +0 -1
  400. package/dist/src/ui/commands/clearCommand.test.d.ts +0 -6
  401. package/dist/src/ui/commands/clearCommand.test.js +0 -98
  402. package/dist/src/ui/commands/clearCommand.test.js.map +0 -1
  403. package/dist/src/ui/commands/commandsCommand.test.d.ts +0 -6
  404. package/dist/src/ui/commands/commandsCommand.test.js +0 -115
  405. package/dist/src/ui/commands/commandsCommand.test.js.map +0 -1
  406. package/dist/src/ui/commands/compressCommand.test.d.ts +0 -6
  407. package/dist/src/ui/commands/compressCommand.test.js +0 -110
  408. package/dist/src/ui/commands/compressCommand.test.js.map +0 -1
  409. package/dist/src/ui/commands/copyCommand.test.d.ts +0 -6
  410. package/dist/src/ui/commands/copyCommand.test.js +0 -244
  411. package/dist/src/ui/commands/copyCommand.test.js.map +0 -1
  412. package/dist/src/ui/commands/corgiCommand.test.d.ts +0 -6
  413. package/dist/src/ui/commands/corgiCommand.test.js +0 -28
  414. package/dist/src/ui/commands/corgiCommand.test.js.map +0 -1
  415. package/dist/src/ui/commands/directoryCommand.test.d.ts +0 -6
  416. package/dist/src/ui/commands/directoryCommand.test.js +0 -365
  417. package/dist/src/ui/commands/directoryCommand.test.js.map +0 -1
  418. package/dist/src/ui/commands/docsCommand.test.d.ts +0 -6
  419. package/dist/src/ui/commands/docsCommand.test.js +0 -72
  420. package/dist/src/ui/commands/docsCommand.test.js.map +0 -1
  421. package/dist/src/ui/commands/editorCommand.test.d.ts +0 -6
  422. package/dist/src/ui/commands/editorCommand.test.js +0 -27
  423. package/dist/src/ui/commands/editorCommand.test.js.map +0 -1
  424. package/dist/src/ui/commands/exportSessionCommand.test.d.ts +0 -6
  425. package/dist/src/ui/commands/exportSessionCommand.test.js +0 -100
  426. package/dist/src/ui/commands/exportSessionCommand.test.js.map +0 -1
  427. package/dist/src/ui/commands/extensionsCommand.test.d.ts +0 -6
  428. package/dist/src/ui/commands/extensionsCommand.test.js +0 -947
  429. package/dist/src/ui/commands/extensionsCommand.test.js.map +0 -1
  430. package/dist/src/ui/commands/helpCommand.test.d.ts +0 -6
  431. package/dist/src/ui/commands/helpCommand.test.js +0 -94
  432. package/dist/src/ui/commands/helpCommand.test.js.map +0 -1
  433. package/dist/src/ui/commands/hooksCommand.test.d.ts +0 -6
  434. package/dist/src/ui/commands/hooksCommand.test.js +0 -562
  435. package/dist/src/ui/commands/hooksCommand.test.js.map +0 -1
  436. package/dist/src/ui/commands/ideCommand.test.d.ts +0 -6
  437. package/dist/src/ui/commands/ideCommand.test.js +0 -205
  438. package/dist/src/ui/commands/ideCommand.test.js.map +0 -1
  439. package/dist/src/ui/commands/initCommand.test.d.ts +0 -6
  440. package/dist/src/ui/commands/initCommand.test.js +0 -86
  441. package/dist/src/ui/commands/initCommand.test.js.map +0 -1
  442. package/dist/src/ui/commands/mcpCommand.test.d.ts +0 -6
  443. package/dist/src/ui/commands/mcpCommand.test.js +0 -231
  444. package/dist/src/ui/commands/mcpCommand.test.js.map +0 -1
  445. package/dist/src/ui/commands/memoryCommand.test.d.ts +0 -6
  446. package/dist/src/ui/commands/memoryCommand.test.js +0 -361
  447. package/dist/src/ui/commands/memoryCommand.test.js.map +0 -1
  448. package/dist/src/ui/commands/modelCommand.test.d.ts +0 -6
  449. package/dist/src/ui/commands/modelCommand.test.js +0 -135
  450. package/dist/src/ui/commands/modelCommand.test.js.map +0 -1
  451. package/dist/src/ui/commands/permissionsCommand.test.d.ts +0 -6
  452. package/dist/src/ui/commands/permissionsCommand.test.js +0 -86
  453. package/dist/src/ui/commands/permissionsCommand.test.js.map +0 -1
  454. package/dist/src/ui/commands/planCommand.test.d.ts +0 -6
  455. package/dist/src/ui/commands/planCommand.test.js +0 -146
  456. package/dist/src/ui/commands/planCommand.test.js.map +0 -1
  457. package/dist/src/ui/commands/policiesCommand.test.d.ts +0 -6
  458. package/dist/src/ui/commands/policiesCommand.test.js +0 -133
  459. package/dist/src/ui/commands/policiesCommand.test.js.map +0 -1
  460. package/dist/src/ui/commands/privacyCommand.test.d.ts +0 -6
  461. package/dist/src/ui/commands/privacyCommand.test.js +0 -32
  462. package/dist/src/ui/commands/privacyCommand.test.js.map +0 -1
  463. package/dist/src/ui/commands/quitCommand.test.d.ts +0 -6
  464. package/dist/src/ui/commands/quitCommand.test.js +0 -95
  465. package/dist/src/ui/commands/quitCommand.test.js.map +0 -1
  466. package/dist/src/ui/commands/restoreCommand.test.d.ts +0 -6
  467. package/dist/src/ui/commands/restoreCommand.test.js +0 -193
  468. package/dist/src/ui/commands/restoreCommand.test.js.map +0 -1
  469. package/dist/src/ui/commands/resumeCommand.test.d.ts +0 -6
  470. package/dist/src/ui/commands/resumeCommand.test.js +0 -28
  471. package/dist/src/ui/commands/resumeCommand.test.js.map +0 -1
  472. package/dist/src/ui/commands/rewindCommand.test.d.ts +0 -6
  473. package/dist/src/ui/commands/rewindCommand.test.js +0 -256
  474. package/dist/src/ui/commands/rewindCommand.test.js.map +0 -1
  475. package/dist/src/ui/commands/settingsCommand.test.d.ts +0 -6
  476. package/dist/src/ui/commands/settingsCommand.test.js +0 -30
  477. package/dist/src/ui/commands/settingsCommand.test.js.map +0 -1
  478. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
  479. package/dist/src/ui/commands/setupGithubCommand.test.js +0 -238
  480. package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
  481. package/dist/src/ui/commands/skillsCommand.test.d.ts +0 -6
  482. package/dist/src/ui/commands/skillsCommand.test.js +0 -500
  483. package/dist/src/ui/commands/skillsCommand.test.js.map +0 -1
  484. package/dist/src/ui/commands/statsCommand.test.d.ts +0 -6
  485. package/dist/src/ui/commands/statsCommand.test.js +0 -122
  486. package/dist/src/ui/commands/statsCommand.test.js.map +0 -1
  487. package/dist/src/ui/commands/tasksCommand.test.d.ts +0 -6
  488. package/dist/src/ui/commands/tasksCommand.test.js +0 -30
  489. package/dist/src/ui/commands/tasksCommand.test.js.map +0 -1
  490. package/dist/src/ui/commands/terminalSetupCommand.test.d.ts +0 -6
  491. package/dist/src/ui/commands/terminalSetupCommand.test.js +0 -66
  492. package/dist/src/ui/commands/terminalSetupCommand.test.js.map +0 -1
  493. package/dist/src/ui/commands/themeCommand.test.d.ts +0 -6
  494. package/dist/src/ui/commands/themeCommand.test.js +0 -32
  495. package/dist/src/ui/commands/themeCommand.test.js.map +0 -1
  496. package/dist/src/ui/commands/toolsCommand.test.d.ts +0 -6
  497. package/dist/src/ui/commands/toolsCommand.test.js +0 -187
  498. package/dist/src/ui/commands/toolsCommand.test.js.map +0 -1
  499. package/dist/src/ui/commands/upgradeCommand.test.d.ts +0 -6
  500. package/dist/src/ui/commands/upgradeCommand.test.js +0 -102
  501. package/dist/src/ui/commands/upgradeCommand.test.js.map +0 -1
  502. package/dist/src/ui/components/AboutBox.test.d.ts +0 -6
  503. package/dist/src/ui/components/AboutBox.test.js +0 -63
  504. package/dist/src/ui/components/AboutBox.test.js.map +0 -1
  505. package/dist/src/ui/components/AdminSettingsChangedDialog.test.d.ts +0 -6
  506. package/dist/src/ui/components/AdminSettingsChangedDialog.test.js +0 -43
  507. package/dist/src/ui/components/AdminSettingsChangedDialog.test.js.map +0 -1
  508. package/dist/src/ui/components/AgentConfigDialog.test.d.ts +0 -6
  509. package/dist/src/ui/components/AgentConfigDialog.test.js +0 -267
  510. package/dist/src/ui/components/AgentConfigDialog.test.js.map +0 -1
  511. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.d.ts +0 -6
  512. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +0 -196
  513. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +0 -1
  514. package/dist/src/ui/components/AnsiOutput.test.d.ts +0 -6
  515. package/dist/src/ui/components/AnsiOutput.test.js +0 -142
  516. package/dist/src/ui/components/AnsiOutput.test.js.map +0 -1
  517. package/dist/src/ui/components/AppHeader.test.d.ts +0 -6
  518. package/dist/src/ui/components/AppHeader.test.js +0 -212
  519. package/dist/src/ui/components/AppHeader.test.js.map +0 -1
  520. package/dist/src/ui/components/AppHeaderIcon.test.d.ts +0 -6
  521. package/dist/src/ui/components/AppHeaderIcon.test.js +0 -39
  522. package/dist/src/ui/components/AppHeaderIcon.test.js.map +0 -1
  523. package/dist/src/ui/components/ApprovalModeIndicator.test.d.ts +0 -6
  524. package/dist/src/ui/components/ApprovalModeIndicator.test.js +0 -37
  525. package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +0 -1
  526. package/dist/src/ui/components/AskUserDialog.test.d.ts +0 -6
  527. package/dist/src/ui/components/AskUserDialog.test.js +0 -1121
  528. package/dist/src/ui/components/AskUserDialog.test.js.map +0 -1
  529. package/dist/src/ui/components/BackgroundTaskDisplay.test.d.ts +0 -6
  530. package/dist/src/ui/components/BackgroundTaskDisplay.test.js +0 -209
  531. package/dist/src/ui/components/BackgroundTaskDisplay.test.js.map +0 -1
  532. package/dist/src/ui/components/Banner.test.d.ts +0 -6
  533. package/dist/src/ui/components/Banner.test.js +0 -29
  534. package/dist/src/ui/components/Banner.test.js.map +0 -1
  535. package/dist/src/ui/components/BubblingRegression.test.d.ts +0 -6
  536. package/dist/src/ui/components/BubblingRegression.test.js +0 -60
  537. package/dist/src/ui/components/BubblingRegression.test.js.map +0 -1
  538. package/dist/src/ui/components/Checklist.test.d.ts +0 -6
  539. package/dist/src/ui/components/Checklist.test.js +0 -46
  540. package/dist/src/ui/components/Checklist.test.js.map +0 -1
  541. package/dist/src/ui/components/ChecklistItem.test.d.ts +0 -6
  542. package/dist/src/ui/components/ChecklistItem.test.js +0 -40
  543. package/dist/src/ui/components/ChecklistItem.test.js.map +0 -1
  544. package/dist/src/ui/components/CliSpinner.test.d.ts +0 -6
  545. package/dist/src/ui/components/CliSpinner.test.js +0 -32
  546. package/dist/src/ui/components/CliSpinner.test.js.map +0 -1
  547. package/dist/src/ui/components/ColorsDisplay.test.d.ts +0 -6
  548. package/dist/src/ui/components/ColorsDisplay.test.js +0 -107
  549. package/dist/src/ui/components/ColorsDisplay.test.js.map +0 -1
  550. package/dist/src/ui/components/Composer.test.d.ts +0 -6
  551. package/dist/src/ui/components/Composer.test.js +0 -853
  552. package/dist/src/ui/components/Composer.test.js.map +0 -1
  553. package/dist/src/ui/components/ConfigInitDisplay.test.d.ts +0 -6
  554. package/dist/src/ui/components/ConfigInitDisplay.test.js +0 -118
  555. package/dist/src/ui/components/ConfigInitDisplay.test.js.map +0 -1
  556. package/dist/src/ui/components/ConsentPrompt.test.d.ts +0 -6
  557. package/dist/src/ui/components/ConsentPrompt.test.js +0 -80
  558. package/dist/src/ui/components/ConsentPrompt.test.js.map +0 -1
  559. package/dist/src/ui/components/ConsoleSummaryDisplay.test.d.ts +0 -6
  560. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +0 -28
  561. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +0 -1
  562. package/dist/src/ui/components/ContextSummaryDisplay.test.d.ts +0 -6
  563. package/dist/src/ui/components/ContextSummaryDisplay.test.js +0 -81
  564. package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +0 -1
  565. package/dist/src/ui/components/ContextUsageDisplay.test.d.ts +0 -6
  566. package/dist/src/ui/components/ContextUsageDisplay.test.js +0 -50
  567. package/dist/src/ui/components/ContextUsageDisplay.test.js.map +0 -1
  568. package/dist/src/ui/components/CopyModeWarning.test.d.ts +0 -6
  569. package/dist/src/ui/components/CopyModeWarning.test.js +0 -35
  570. package/dist/src/ui/components/CopyModeWarning.test.js.map +0 -1
  571. package/dist/src/ui/components/DebugProfiler.test.d.ts +0 -6
  572. package/dist/src/ui/components/DebugProfiler.test.js +0 -228
  573. package/dist/src/ui/components/DebugProfiler.test.js.map +0 -1
  574. package/dist/src/ui/components/DetailedMessagesDisplay.test.d.ts +0 -6
  575. package/dist/src/ui/components/DetailedMessagesDisplay.test.js +0 -81
  576. package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +0 -1
  577. package/dist/src/ui/components/DialogManager.test.d.ts +0 -6
  578. package/dist/src/ui/components/DialogManager.test.js +0 -187
  579. package/dist/src/ui/components/DialogManager.test.js.map +0 -1
  580. package/dist/src/ui/components/EditorSettingsDialog.test.d.ts +0 -6
  581. package/dist/src/ui/components/EditorSettingsDialog.test.js +0 -145
  582. package/dist/src/ui/components/EditorSettingsDialog.test.js.map +0 -1
  583. package/dist/src/ui/components/EmptyWalletDialog.test.d.ts +0 -6
  584. package/dist/src/ui/components/EmptyWalletDialog.test.js +0 -116
  585. package/dist/src/ui/components/EmptyWalletDialog.test.js.map +0 -1
  586. package/dist/src/ui/components/ExitPlanModeDialog.test.d.ts +0 -6
  587. package/dist/src/ui/components/ExitPlanModeDialog.test.js +0 -443
  588. package/dist/src/ui/components/ExitPlanModeDialog.test.js.map +0 -1
  589. package/dist/src/ui/components/ExitWarning.test.d.ts +0 -6
  590. package/dist/src/ui/components/ExitWarning.test.js +0 -58
  591. package/dist/src/ui/components/ExitWarning.test.js.map +0 -1
  592. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
  593. package/dist/src/ui/components/FolderTrustDialog.test.js +0 -342
  594. package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
  595. package/dist/src/ui/components/Footer.test.d.ts +0 -6
  596. package/dist/src/ui/components/Footer.test.js +0 -806
  597. package/dist/src/ui/components/Footer.test.js.map +0 -1
  598. package/dist/src/ui/components/FooterConfigDialog.test.d.ts +0 -6
  599. package/dist/src/ui/components/FooterConfigDialog.test.js +0 -191
  600. package/dist/src/ui/components/FooterConfigDialog.test.js.map +0 -1
  601. package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +0 -6
  602. package/dist/src/ui/components/GeminiRespondingSpinner.test.js +0 -63
  603. package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +0 -1
  604. package/dist/src/ui/components/GradientRegression.test.d.ts +0 -6
  605. package/dist/src/ui/components/GradientRegression.test.js +0 -116
  606. package/dist/src/ui/components/GradientRegression.test.js.map +0 -1
  607. package/dist/src/ui/components/Header.test.d.ts +0 -6
  608. package/dist/src/ui/components/Header.test.js +0 -131
  609. package/dist/src/ui/components/Header.test.js.map +0 -1
  610. package/dist/src/ui/components/Help.test.d.ts +0 -6
  611. package/dist/src/ui/components/Help.test.js +0 -67
  612. package/dist/src/ui/components/Help.test.js.map +0 -1
  613. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  614. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -302
  615. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  616. package/dist/src/ui/components/HookStatusDisplay.test.d.ts +0 -6
  617. package/dist/src/ui/components/HookStatusDisplay.test.js +0 -77
  618. package/dist/src/ui/components/HookStatusDisplay.test.js.map +0 -1
  619. package/dist/src/ui/components/HooksDialog.test.d.ts +0 -6
  620. package/dist/src/ui/components/HooksDialog.test.js +0 -175
  621. package/dist/src/ui/components/HooksDialog.test.js.map +0 -1
  622. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +0 -6
  623. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +0 -78
  624. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +0 -1
  625. package/dist/src/ui/components/InboxDialog.test.d.ts +0 -6
  626. package/dist/src/ui/components/InboxDialog.test.js +0 -804
  627. package/dist/src/ui/components/InboxDialog.test.js.map +0 -1
  628. package/dist/src/ui/components/InputPrompt.test.d.ts +0 -17
  629. package/dist/src/ui/components/InputPrompt.test.js +0 -4078
  630. package/dist/src/ui/components/InputPrompt.test.js.map +0 -1
  631. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  632. package/dist/src/ui/components/LoadingIndicator.test.js +0 -325
  633. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  634. package/dist/src/ui/components/LogoutConfirmationDialog.test.d.ts +0 -6
  635. package/dist/src/ui/components/LogoutConfirmationDialog.test.js +0 -74
  636. package/dist/src/ui/components/LogoutConfirmationDialog.test.js.map +0 -1
  637. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +0 -6
  638. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +0 -27
  639. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +0 -1
  640. package/dist/src/ui/components/MainContent.test.d.ts +0 -6
  641. package/dist/src/ui/components/MainContent.test.js +0 -750
  642. package/dist/src/ui/components/MainContent.test.js.map +0 -1
  643. package/dist/src/ui/components/MemoryUsageDisplay.test.d.ts +0 -6
  644. package/dist/src/ui/components/MemoryUsageDisplay.test.js +0 -52
  645. package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +0 -1
  646. package/dist/src/ui/components/ModelDialog.test.d.ts +0 -6
  647. package/dist/src/ui/components/ModelDialog.test.js +0 -356
  648. package/dist/src/ui/components/ModelDialog.test.js.map +0 -1
  649. package/dist/src/ui/components/ModelQuotaDisplay.test.d.ts +0 -6
  650. package/dist/src/ui/components/ModelQuotaDisplay.test.js +0 -62
  651. package/dist/src/ui/components/ModelQuotaDisplay.test.js.map +0 -1
  652. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +0 -6
  653. package/dist/src/ui/components/ModelStatsDisplay.test.js +0 -651
  654. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +0 -1
  655. package/dist/src/ui/components/MultiFolderTrustDialog.test.d.ts +0 -6
  656. package/dist/src/ui/components/MultiFolderTrustDialog.test.js +0 -177
  657. package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +0 -1
  658. package/dist/src/ui/components/NewAgentsNotification.test.d.ts +0 -6
  659. package/dist/src/ui/components/NewAgentsNotification.test.js +0 -83
  660. package/dist/src/ui/components/NewAgentsNotification.test.js.map +0 -1
  661. package/dist/src/ui/components/Notifications.test.d.ts +0 -6
  662. package/dist/src/ui/components/Notifications.test.js +0 -285
  663. package/dist/src/ui/components/Notifications.test.js.map +0 -1
  664. package/dist/src/ui/components/OverageMenuDialog.test.d.ts +0 -6
  665. package/dist/src/ui/components/OverageMenuDialog.test.js +0 -118
  666. package/dist/src/ui/components/OverageMenuDialog.test.js.map +0 -1
  667. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +0 -6
  668. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +0 -181
  669. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +0 -1
  670. package/dist/src/ui/components/PolicyUpdateDialog.test.d.ts +0 -6
  671. package/dist/src/ui/components/PolicyUpdateDialog.test.js +0 -92
  672. package/dist/src/ui/components/PolicyUpdateDialog.test.js.map +0 -1
  673. package/dist/src/ui/components/ProQuotaDialog.test.d.ts +0 -6
  674. package/dist/src/ui/components/ProQuotaDialog.test.js +0 -222
  675. package/dist/src/ui/components/ProQuotaDialog.test.js.map +0 -1
  676. package/dist/src/ui/components/ProgressBar.test.d.ts +0 -6
  677. package/dist/src/ui/components/ProgressBar.test.js +0 -28
  678. package/dist/src/ui/components/ProgressBar.test.js.map +0 -1
  679. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +0 -6
  680. package/dist/src/ui/components/QueuedMessageDisplay.test.js +0 -65
  681. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +0 -1
  682. package/dist/src/ui/components/QuittingDisplay.test.d.ts +0 -6
  683. package/dist/src/ui/components/QuittingDisplay.test.js +0 -60
  684. package/dist/src/ui/components/QuittingDisplay.test.js.map +0 -1
  685. package/dist/src/ui/components/QuotaDisplay.test.d.ts +0 -6
  686. package/dist/src/ui/components/QuotaDisplay.test.js +0 -68
  687. package/dist/src/ui/components/QuotaDisplay.test.js.map +0 -1
  688. package/dist/src/ui/components/RawMarkdownIndicator.test.d.ts +0 -6
  689. package/dist/src/ui/components/RawMarkdownIndicator.test.js +0 -38
  690. package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +0 -1
  691. package/dist/src/ui/components/RewindConfirmation.test.d.ts +0 -6
  692. package/dist/src/ui/components/RewindConfirmation.test.js +0 -57
  693. package/dist/src/ui/components/RewindConfirmation.test.js.map +0 -1
  694. package/dist/src/ui/components/RewindViewer.test.d.ts +0 -6
  695. package/dist/src/ui/components/RewindViewer.test.js +0 -334
  696. package/dist/src/ui/components/RewindViewer.test.js.map +0 -1
  697. package/dist/src/ui/components/SessionBrowser/SessionBrowserSearchNav.test.d.ts +0 -6
  698. package/dist/src/ui/components/SessionBrowser/SessionBrowserSearchNav.test.js +0 -47
  699. package/dist/src/ui/components/SessionBrowser/SessionBrowserSearchNav.test.js.map +0 -1
  700. package/dist/src/ui/components/SessionBrowser/SessionBrowserStates.test.d.ts +0 -6
  701. package/dist/src/ui/components/SessionBrowser/SessionBrowserStates.test.js +0 -27
  702. package/dist/src/ui/components/SessionBrowser/SessionBrowserStates.test.js.map +0 -1
  703. package/dist/src/ui/components/SessionBrowser/utils.test.d.ts +0 -6
  704. package/dist/src/ui/components/SessionBrowser/utils.test.js +0 -108
  705. package/dist/src/ui/components/SessionBrowser/utils.test.js.map +0 -1
  706. package/dist/src/ui/components/SessionBrowser.test.d.ts +0 -6
  707. package/dist/src/ui/components/SessionBrowser.test.js +0 -266
  708. package/dist/src/ui/components/SessionBrowser.test.js.map +0 -1
  709. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +0 -6
  710. package/dist/src/ui/components/SessionSummaryDisplay.test.js +0 -164
  711. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +0 -1
  712. package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
  713. package/dist/src/ui/components/SettingsDialog.test.js +0 -1499
  714. package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
  715. package/dist/src/ui/components/ShellInputPrompt.test.d.ts +0 -6
  716. package/dist/src/ui/components/ShellInputPrompt.test.js +0 -201
  717. package/dist/src/ui/components/ShellInputPrompt.test.js.map +0 -1
  718. package/dist/src/ui/components/ShellModeIndicator.test.d.ts +0 -6
  719. package/dist/src/ui/components/ShellModeIndicator.test.js +0 -18
  720. package/dist/src/ui/components/ShellModeIndicator.test.js.map +0 -1
  721. package/dist/src/ui/components/ShortcutsHelp.test.d.ts +0 -6
  722. package/dist/src/ui/components/ShortcutsHelp.test.js +0 -45
  723. package/dist/src/ui/components/ShortcutsHelp.test.js.map +0 -1
  724. package/dist/src/ui/components/ShowMoreLines.test.d.ts +0 -6
  725. package/dist/src/ui/components/ShowMoreLines.test.js +0 -79
  726. package/dist/src/ui/components/ShowMoreLines.test.js.map +0 -1
  727. package/dist/src/ui/components/ShowMoreLinesLayout.test.d.ts +0 -1
  728. package/dist/src/ui/components/ShowMoreLinesLayout.test.js +0 -68
  729. package/dist/src/ui/components/ShowMoreLinesLayout.test.js.map +0 -1
  730. package/dist/src/ui/components/StatsDisplay.test.d.ts +0 -6
  731. package/dist/src/ui/components/StatsDisplay.test.js +0 -489
  732. package/dist/src/ui/components/StatsDisplay.test.js.map +0 -1
  733. package/dist/src/ui/components/StatusDisplay.test.d.ts +0 -6
  734. package/dist/src/ui/components/StatusDisplay.test.js +0 -117
  735. package/dist/src/ui/components/StatusDisplay.test.js.map +0 -1
  736. package/dist/src/ui/components/StatusRow.test.d.ts +0 -6
  737. package/dist/src/ui/components/StatusRow.test.js +0 -99
  738. package/dist/src/ui/components/StatusRow.test.js.map +0 -1
  739. package/dist/src/ui/components/StickyHeader.test.d.ts +0 -6
  740. package/dist/src/ui/components/StickyHeader.test.js +0 -19
  741. package/dist/src/ui/components/StickyHeader.test.js.map +0 -1
  742. package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +0 -6
  743. package/dist/src/ui/components/SuggestionsDisplay.test.js +0 -82
  744. package/dist/src/ui/components/SuggestionsDisplay.test.js.map +0 -1
  745. package/dist/src/ui/components/Table.test.d.ts +0 -6
  746. package/dist/src/ui/components/Table.test.js +0 -72
  747. package/dist/src/ui/components/Table.test.js.map +0 -1
  748. package/dist/src/ui/components/ThemeDialog.test.d.ts +0 -6
  749. package/dist/src/ui/components/ThemeDialog.test.js +0 -162
  750. package/dist/src/ui/components/ThemeDialog.test.js.map +0 -1
  751. package/dist/src/ui/components/ThemedGradient.test.d.ts +0 -6
  752. package/dist/src/ui/components/ThemedGradient.test.js +0 -35
  753. package/dist/src/ui/components/ThemedGradient.test.js.map +0 -1
  754. package/dist/src/ui/components/Tips.test.d.ts +0 -6
  755. package/dist/src/ui/components/Tips.test.js +0 -23
  756. package/dist/src/ui/components/Tips.test.js.map +0 -1
  757. package/dist/src/ui/components/ToastDisplay.test.d.ts +0 -6
  758. package/dist/src/ui/components/ToastDisplay.test.js +0 -167
  759. package/dist/src/ui/components/ToastDisplay.test.js.map +0 -1
  760. package/dist/src/ui/components/ToolConfirmationQueue.test.d.ts +0 -6
  761. package/dist/src/ui/components/ToolConfirmationQueue.test.js +0 -444
  762. package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +0 -1
  763. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +0 -6
  764. package/dist/src/ui/components/ToolStatsDisplay.test.js +0 -234
  765. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +0 -1
  766. package/dist/src/ui/components/UpdateNotification.test.d.ts +0 -6
  767. package/dist/src/ui/components/UpdateNotification.test.js +0 -17
  768. package/dist/src/ui/components/UpdateNotification.test.js.map +0 -1
  769. package/dist/src/ui/components/UserIdentity.test.d.ts +0 -6
  770. package/dist/src/ui/components/UserIdentity.test.js +0 -138
  771. package/dist/src/ui/components/UserIdentity.test.js.map +0 -1
  772. package/dist/src/ui/components/ValidationDialog.test.d.ts +0 -6
  773. package/dist/src/ui/components/ValidationDialog.test.js +0 -162
  774. package/dist/src/ui/components/ValidationDialog.test.js.map +0 -1
  775. package/dist/src/ui/components/VoiceModelDialog.test.d.ts +0 -6
  776. package/dist/src/ui/components/VoiceModelDialog.test.js +0 -68
  777. package/dist/src/ui/components/VoiceModelDialog.test.js.map +0 -1
  778. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +0 -6
  779. package/dist/src/ui/components/messages/CompressionMessage.test.js +0 -180
  780. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +0 -1
  781. package/dist/src/ui/components/messages/DenseToolMessage.test.d.ts +0 -6
  782. package/dist/src/ui/components/messages/DenseToolMessage.test.js +0 -406
  783. package/dist/src/ui/components/messages/DenseToolMessage.test.js.map +0 -1
  784. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  785. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -269
  786. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  787. package/dist/src/ui/components/messages/ErrorMessage.test.d.ts +0 -6
  788. package/dist/src/ui/components/messages/ErrorMessage.test.js +0 -25
  789. package/dist/src/ui/components/messages/ErrorMessage.test.js.map +0 -1
  790. package/dist/src/ui/components/messages/ExportSessionMessage.test.d.ts +0 -6
  791. package/dist/src/ui/components/messages/ExportSessionMessage.test.js +0 -32
  792. package/dist/src/ui/components/messages/ExportSessionMessage.test.js.map +0 -1
  793. package/dist/src/ui/components/messages/GeminiMessage.test.d.ts +0 -6
  794. package/dist/src/ui/components/messages/GeminiMessage.test.js +0 -46
  795. package/dist/src/ui/components/messages/GeminiMessage.test.js.map +0 -1
  796. package/dist/src/ui/components/messages/HintMessage.test.d.ts +0 -6
  797. package/dist/src/ui/components/messages/HintMessage.test.js +0 -42
  798. package/dist/src/ui/components/messages/HintMessage.test.js.map +0 -1
  799. package/dist/src/ui/components/messages/InfoMessage.test.d.ts +0 -6
  800. package/dist/src/ui/components/messages/InfoMessage.test.js +0 -31
  801. package/dist/src/ui/components/messages/InfoMessage.test.js.map +0 -1
  802. package/dist/src/ui/components/messages/RedirectionConfirmation.test.d.ts +0 -6
  803. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +0 -35
  804. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +0 -1
  805. package/dist/src/ui/components/messages/ShellToolMessage.test.d.ts +0 -6
  806. package/dist/src/ui/components/messages/ShellToolMessage.test.js +0 -290
  807. package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +0 -1
  808. package/dist/src/ui/components/messages/SubagentGroupDisplay.test.d.ts +0 -1
  809. package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js +0 -92
  810. package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js.map +0 -1
  811. package/dist/src/ui/components/messages/SubagentHistoryMessage.test.d.ts +0 -6
  812. package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js +0 -69
  813. package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js.map +0 -1
  814. package/dist/src/ui/components/messages/SubagentProgressDisplay.test.d.ts +0 -6
  815. package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js +0 -164
  816. package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js.map +0 -1
  817. package/dist/src/ui/components/messages/ThinkingMessage.test.d.ts +0 -6
  818. package/dist/src/ui/components/messages/ThinkingMessage.test.js +0 -104
  819. package/dist/src/ui/components/messages/ThinkingMessage.test.js.map +0 -1
  820. package/dist/src/ui/components/messages/Todo.test.d.ts +0 -6
  821. package/dist/src/ui/components/messages/Todo.test.js +0 -129
  822. package/dist/src/ui/components/messages/Todo.test.js.map +0 -1
  823. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  824. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -558
  825. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  826. package/dist/src/ui/components/messages/ToolGroupDisplay.test.d.ts +0 -6
  827. package/dist/src/ui/components/messages/ToolGroupDisplay.test.js +0 -210
  828. package/dist/src/ui/components/messages/ToolGroupDisplay.test.js.map +0 -1
  829. package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.d.ts +0 -6
  830. package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.js +0 -147
  831. package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.js.map +0 -1
  832. package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +0 -6
  833. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +0 -828
  834. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +0 -1
  835. package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.d.ts +0 -6
  836. package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.js +0 -101
  837. package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.js.map +0 -1
  838. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  839. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -292
  840. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  841. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.d.ts +0 -6
  842. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +0 -96
  843. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +0 -1
  844. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +0 -6
  845. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +0 -72
  846. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +0 -1
  847. package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.d.ts +0 -6
  848. package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js +0 -88
  849. package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js.map +0 -1
  850. package/dist/src/ui/components/messages/ToolResultDisplay.test.d.ts +0 -6
  851. package/dist/src/ui/components/messages/ToolResultDisplay.test.js +0 -333
  852. package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +0 -1
  853. package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.d.ts +0 -6
  854. package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js +0 -77
  855. package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js.map +0 -1
  856. package/dist/src/ui/components/messages/ToolShared.test.d.ts +0 -6
  857. package/dist/src/ui/components/messages/ToolShared.test.js +0 -65
  858. package/dist/src/ui/components/messages/ToolShared.test.js.map +0 -1
  859. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.d.ts +0 -6
  860. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +0 -142
  861. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +0 -1
  862. package/dist/src/ui/components/messages/TopicMessage.test.d.ts +0 -6
  863. package/dist/src/ui/components/messages/TopicMessage.test.js +0 -77
  864. package/dist/src/ui/components/messages/TopicMessage.test.js.map +0 -1
  865. package/dist/src/ui/components/messages/UserMessage.test.d.ts +0 -6
  866. package/dist/src/ui/components/messages/UserMessage.test.js +0 -67
  867. package/dist/src/ui/components/messages/UserMessage.test.js.map +0 -1
  868. package/dist/src/ui/components/messages/UserShellMessage.test.d.ts +0 -6
  869. package/dist/src/ui/components/messages/UserShellMessage.test.js +0 -40
  870. package/dist/src/ui/components/messages/UserShellMessage.test.js.map +0 -1
  871. package/dist/src/ui/components/messages/WarningMessage.test.d.ts +0 -6
  872. package/dist/src/ui/components/messages/WarningMessage.test.js +0 -25
  873. package/dist/src/ui/components/messages/WarningMessage.test.js.map +0 -1
  874. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +0 -6
  875. package/dist/src/ui/components/shared/BaseSelectionList.test.js +0 -441
  876. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +0 -1
  877. package/dist/src/ui/components/shared/BaseSettingsDialog.test.d.ts +0 -6
  878. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +0 -710
  879. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +0 -1
  880. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +0 -6
  881. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +0 -89
  882. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +0 -1
  883. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +0 -6
  884. package/dist/src/ui/components/shared/EnumSelector.test.js +0 -83
  885. package/dist/src/ui/components/shared/EnumSelector.test.js.map +0 -1
  886. package/dist/src/ui/components/shared/ExpandableText.test.d.ts +0 -6
  887. package/dist/src/ui/components/shared/ExpandableText.test.js +0 -95
  888. package/dist/src/ui/components/shared/ExpandableText.test.js.map +0 -1
  889. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.d.ts +0 -1
  890. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js +0 -47
  891. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js.map +0 -1
  892. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  893. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -161
  894. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  895. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
  896. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -146
  897. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
  898. package/dist/src/ui/components/shared/Scrollable.test.d.ts +0 -6
  899. package/dist/src/ui/components/shared/Scrollable.test.js +0 -143
  900. package/dist/src/ui/components/shared/Scrollable.test.js.map +0 -1
  901. package/dist/src/ui/components/shared/ScrollableList.test.d.ts +0 -6
  902. package/dist/src/ui/components/shared/ScrollableList.test.js +0 -438
  903. package/dist/src/ui/components/shared/ScrollableList.test.js.map +0 -1
  904. package/dist/src/ui/components/shared/SearchableList.test.d.ts +0 -6
  905. package/dist/src/ui/components/shared/SearchableList.test.js +0 -169
  906. package/dist/src/ui/components/shared/SearchableList.test.js.map +0 -1
  907. package/dist/src/ui/components/shared/SectionHeader.test.d.ts +0 -6
  908. package/dist/src/ui/components/shared/SectionHeader.test.js +0 -42
  909. package/dist/src/ui/components/shared/SectionHeader.test.js.map +0 -1
  910. package/dist/src/ui/components/shared/SlicingMaxSizedBox.test.d.ts +0 -6
  911. package/dist/src/ui/components/shared/SlicingMaxSizedBox.test.js +0 -54
  912. package/dist/src/ui/components/shared/SlicingMaxSizedBox.test.js.map +0 -1
  913. package/dist/src/ui/components/shared/TabHeader.test.d.ts +0 -6
  914. package/dist/src/ui/components/shared/TabHeader.test.js +0 -144
  915. package/dist/src/ui/components/shared/TabHeader.test.js.map +0 -1
  916. package/dist/src/ui/components/shared/TextInput.test.d.ts +0 -6
  917. package/dist/src/ui/components/shared/TextInput.test.js +0 -353
  918. package/dist/src/ui/components/shared/TextInput.test.js.map +0 -1
  919. package/dist/src/ui/components/shared/VirtualizedList.test.d.ts +0 -6
  920. package/dist/src/ui/components/shared/VirtualizedList.test.js +0 -174
  921. package/dist/src/ui/components/shared/VirtualizedList.test.js.map +0 -1
  922. package/dist/src/ui/components/shared/performance.test.d.ts +0 -1
  923. package/dist/src/ui/components/shared/performance.test.js +0 -74
  924. package/dist/src/ui/components/shared/performance.test.js.map +0 -1
  925. package/dist/src/ui/components/shared/text-buffer.test.d.ts +0 -6
  926. package/dist/src/ui/components/shared/text-buffer.test.js +0 -2965
  927. package/dist/src/ui/components/shared/text-buffer.test.js.map +0 -1
  928. package/dist/src/ui/components/shared/vim-buffer-actions.test.d.ts +0 -6
  929. package/dist/src/ui/components/shared/vim-buffer-actions.test.js +0 -2272
  930. package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +0 -1
  931. package/dist/src/ui/components/views/ChatList.test.d.ts +0 -6
  932. package/dist/src/ui/components/views/ChatList.test.js +0 -45
  933. package/dist/src/ui/components/views/ChatList.test.js.map +0 -1
  934. package/dist/src/ui/components/views/ExtensionDetails.test.d.ts +0 -6
  935. package/dist/src/ui/components/views/ExtensionDetails.test.js +0 -154
  936. package/dist/src/ui/components/views/ExtensionDetails.test.js.map +0 -1
  937. package/dist/src/ui/components/views/ExtensionRegistryView.test.d.ts +0 -6
  938. package/dist/src/ui/components/views/ExtensionRegistryView.test.js +0 -222
  939. package/dist/src/ui/components/views/ExtensionRegistryView.test.js.map +0 -1
  940. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +0 -6
  941. package/dist/src/ui/components/views/ExtensionsList.test.js +0 -145
  942. package/dist/src/ui/components/views/ExtensionsList.test.js.map +0 -1
  943. package/dist/src/ui/components/views/McpStatus.test.d.ts +0 -6
  944. package/dist/src/ui/components/views/McpStatus.test.js +0 -174
  945. package/dist/src/ui/components/views/McpStatus.test.js.map +0 -1
  946. package/dist/src/ui/components/views/SkillsList.test.d.ts +0 -6
  947. package/dist/src/ui/components/views/SkillsList.test.js +0 -99
  948. package/dist/src/ui/components/views/SkillsList.test.js.map +0 -1
  949. package/dist/src/ui/components/views/ToolsList.test.d.ts +0 -6
  950. package/dist/src/ui/components/views/ToolsList.test.js +0 -45
  951. package/dist/src/ui/components/views/ToolsList.test.js.map +0 -1
  952. package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
  953. package/dist/src/ui/contexts/KeypressContext.test.js +0 -1133
  954. package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
  955. package/dist/src/ui/contexts/MouseContext.test.d.ts +0 -6
  956. package/dist/src/ui/contexts/MouseContext.test.js +0 -269
  957. package/dist/src/ui/contexts/MouseContext.test.js.map +0 -1
  958. package/dist/src/ui/contexts/ScrollProvider.drag.test.d.ts +0 -6
  959. package/dist/src/ui/contexts/ScrollProvider.drag.test.js +0 -320
  960. package/dist/src/ui/contexts/ScrollProvider.drag.test.js.map +0 -1
  961. package/dist/src/ui/contexts/ScrollProvider.test.d.ts +0 -6
  962. package/dist/src/ui/contexts/ScrollProvider.test.js +0 -478
  963. package/dist/src/ui/contexts/ScrollProvider.test.js.map +0 -1
  964. package/dist/src/ui/contexts/SessionContext.test.d.ts +0 -6
  965. package/dist/src/ui/contexts/SessionContext.test.js +0 -213
  966. package/dist/src/ui/contexts/SessionContext.test.js.map +0 -1
  967. package/dist/src/ui/contexts/SettingsContext.test.d.ts +0 -6
  968. package/dist/src/ui/contexts/SettingsContext.test.js +0 -106
  969. package/dist/src/ui/contexts/SettingsContext.test.js.map +0 -1
  970. package/dist/src/ui/contexts/TerminalContext.test.d.ts +0 -6
  971. package/dist/src/ui/contexts/TerminalContext.test.js +0 -75
  972. package/dist/src/ui/contexts/TerminalContext.test.js.map +0 -1
  973. package/dist/src/ui/contexts/ToolActionsContext.test.d.ts +0 -6
  974. package/dist/src/ui/contexts/ToolActionsContext.test.js +0 -247
  975. package/dist/src/ui/contexts/ToolActionsContext.test.js.map +0 -1
  976. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
  977. package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -1265
  978. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
  979. package/dist/src/ui/hooks/atCommandProcessor_agents.test.d.ts +0 -6
  980. package/dist/src/ui/hooks/atCommandProcessor_agents.test.js +0 -210
  981. package/dist/src/ui/hooks/atCommandProcessor_agents.test.js.map +0 -1
  982. package/dist/src/ui/hooks/creditsFlowHandler.test.d.ts +0 -6
  983. package/dist/src/ui/hooks/creditsFlowHandler.test.js +0 -211
  984. package/dist/src/ui/hooks/creditsFlowHandler.test.js.map +0 -1
  985. package/dist/src/ui/hooks/shell-completions/gitProvider.test.d.ts +0 -6
  986. package/dist/src/ui/hooks/shell-completions/gitProvider.test.js +0 -73
  987. package/dist/src/ui/hooks/shell-completions/gitProvider.test.js.map +0 -1
  988. package/dist/src/ui/hooks/shell-completions/npmProvider.test.d.ts +0 -6
  989. package/dist/src/ui/hooks/shell-completions/npmProvider.test.js +0 -69
  990. package/dist/src/ui/hooks/shell-completions/npmProvider.test.js.map +0 -1
  991. package/dist/src/ui/hooks/shellReducer.test.d.ts +0 -6
  992. package/dist/src/ui/hooks/shellReducer.test.js +0 -341
  993. package/dist/src/ui/hooks/shellReducer.test.js.map +0 -1
  994. package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +0 -6
  995. package/dist/src/ui/hooks/slashCommandProcessor.test.js +0 -881
  996. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +0 -1
  997. package/dist/src/ui/hooks/toolMapping.test.d.ts +0 -6
  998. package/dist/src/ui/hooks/toolMapping.test.js +0 -292
  999. package/dist/src/ui/hooks/toolMapping.test.js.map +0 -1
  1000. package/dist/src/ui/hooks/useAgentStream.test.d.ts +0 -6
  1001. package/dist/src/ui/hooks/useAgentStream.test.js +0 -161
  1002. package/dist/src/ui/hooks/useAgentStream.test.js.map +0 -1
  1003. package/dist/src/ui/hooks/useAlternateBuffer.test.d.ts +0 -6
  1004. package/dist/src/ui/hooks/useAlternateBuffer.test.js +0 -62
  1005. package/dist/src/ui/hooks/useAlternateBuffer.test.js.map +0 -1
  1006. package/dist/src/ui/hooks/useAnimatedScrollbar.test.d.ts +0 -6
  1007. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +0 -85
  1008. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +0 -1
  1009. package/dist/src/ui/hooks/useApprovalModeIndicator.test.d.ts +0 -6
  1010. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js +0 -477
  1011. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js.map +0 -1
  1012. package/dist/src/ui/hooks/useAtCompletion.test.d.ts +0 -6
  1013. package/dist/src/ui/hooks/useAtCompletion.test.js +0 -567
  1014. package/dist/src/ui/hooks/useAtCompletion.test.js.map +0 -1
  1015. package/dist/src/ui/hooks/useAtCompletion_agents.test.d.ts +0 -6
  1016. package/dist/src/ui/hooks/useAtCompletion_agents.test.js +0 -87
  1017. package/dist/src/ui/hooks/useAtCompletion_agents.test.js.map +0 -1
  1018. package/dist/src/ui/hooks/useBackgroundTaskManager.test.d.ts +0 -6
  1019. package/dist/src/ui/hooks/useBackgroundTaskManager.test.js +0 -168
  1020. package/dist/src/ui/hooks/useBackgroundTaskManager.test.js.map +0 -1
  1021. package/dist/src/ui/hooks/useBanner.test.d.ts +0 -6
  1022. package/dist/src/ui/hooks/useBanner.test.js +0 -144
  1023. package/dist/src/ui/hooks/useBanner.test.js.map +0 -1
  1024. package/dist/src/ui/hooks/useBatchedScroll.test.d.ts +0 -6
  1025. package/dist/src/ui/hooks/useBatchedScroll.test.js +0 -62
  1026. package/dist/src/ui/hooks/useBatchedScroll.test.js.map +0 -1
  1027. package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +0 -6
  1028. package/dist/src/ui/hooks/useCommandCompletion.test.js +0 -722
  1029. package/dist/src/ui/hooks/useCommandCompletion.test.js.map +0 -1
  1030. package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +0 -6
  1031. package/dist/src/ui/hooks/useConsoleMessages.test.js +0 -201
  1032. package/dist/src/ui/hooks/useConsoleMessages.test.js.map +0 -1
  1033. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
  1034. package/dist/src/ui/hooks/useEditorSettings.test.js +0 -179
  1035. package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
  1036. package/dist/src/ui/hooks/useExecutionLifecycle.test.d.ts +0 -6
  1037. package/dist/src/ui/hooks/useExecutionLifecycle.test.js +0 -903
  1038. package/dist/src/ui/hooks/useExecutionLifecycle.test.js.map +0 -1
  1039. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +0 -6
  1040. package/dist/src/ui/hooks/useExtensionUpdates.test.js +0 -280
  1041. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +0 -1
  1042. package/dist/src/ui/hooks/useFlickerDetector.test.d.ts +0 -6
  1043. package/dist/src/ui/hooks/useFlickerDetector.test.js +0 -106
  1044. package/dist/src/ui/hooks/useFlickerDetector.test.js.map +0 -1
  1045. package/dist/src/ui/hooks/useFocus.test.d.ts +0 -6
  1046. package/dist/src/ui/hooks/useFocus.test.js +0 -140
  1047. package/dist/src/ui/hooks/useFocus.test.js.map +0 -1
  1048. package/dist/src/ui/hooks/useFolderTrust.test.d.ts +0 -6
  1049. package/dist/src/ui/hooks/useFolderTrust.test.js +0 -268
  1050. package/dist/src/ui/hooks/useFolderTrust.test.js.map +0 -1
  1051. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
  1052. package/dist/src/ui/hooks/useGeminiStream.test.js +0 -2855
  1053. package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
  1054. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
  1055. package/dist/src/ui/hooks/useGitBranchName.test.js +0 -237
  1056. package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
  1057. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
  1058. package/dist/src/ui/hooks/useHistoryManager.test.js +0 -259
  1059. package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
  1060. package/dist/src/ui/hooks/useHookDisplayState.test.d.ts +0 -6
  1061. package/dist/src/ui/hooks/useHookDisplayState.test.js +0 -200
  1062. package/dist/src/ui/hooks/useHookDisplayState.test.js.map +0 -1
  1063. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +0 -6
  1064. package/dist/src/ui/hooks/useIdeTrustListener.test.js +0 -225
  1065. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +0 -1
  1066. package/dist/src/ui/hooks/useIncludeDirsTrust.test.d.ts +0 -6
  1067. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +0 -174
  1068. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +0 -1
  1069. package/dist/src/ui/hooks/useInlineEditBuffer.test.d.ts +0 -6
  1070. package/dist/src/ui/hooks/useInlineEditBuffer.test.js +0 -112
  1071. package/dist/src/ui/hooks/useInlineEditBuffer.test.js.map +0 -1
  1072. package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
  1073. package/dist/src/ui/hooks/useInputHistory.test.js +0 -389
  1074. package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
  1075. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +0 -6
  1076. package/dist/src/ui/hooks/useInputHistoryStore.test.js +0 -238
  1077. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +0 -1
  1078. package/dist/src/ui/hooks/useKeypress.test.d.ts +0 -6
  1079. package/dist/src/ui/hooks/useKeypress.test.js +0 -198
  1080. package/dist/src/ui/hooks/useKeypress.test.js.map +0 -1
  1081. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
  1082. package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -177
  1083. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
  1084. package/dist/src/ui/hooks/useLogger.test.d.ts +0 -6
  1085. package/dist/src/ui/hooks/useLogger.test.js +0 -44
  1086. package/dist/src/ui/hooks/useLogger.test.js.map +0 -1
  1087. package/dist/src/ui/hooks/useMcpStatus.test.d.ts +0 -6
  1088. package/dist/src/ui/hooks/useMcpStatus.test.js +0 -69
  1089. package/dist/src/ui/hooks/useMcpStatus.test.js.map +0 -1
  1090. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +0 -6
  1091. package/dist/src/ui/hooks/useMemoryMonitor.test.js +0 -62
  1092. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +0 -1
  1093. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
  1094. package/dist/src/ui/hooks/useMessageQueue.test.js +0 -365
  1095. package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
  1096. package/dist/src/ui/hooks/useModelCommand.test.d.ts +0 -6
  1097. package/dist/src/ui/hooks/useModelCommand.test.js +0 -45
  1098. package/dist/src/ui/hooks/useModelCommand.test.js.map +0 -1
  1099. package/dist/src/ui/hooks/useMouse.test.d.ts +0 -6
  1100. package/dist/src/ui/hooks/useMouse.test.js +0 -52
  1101. package/dist/src/ui/hooks/useMouse.test.js.map +0 -1
  1102. package/dist/src/ui/hooks/useMouseClick.test.d.ts +0 -6
  1103. package/dist/src/ui/hooks/useMouseClick.test.js +0 -68
  1104. package/dist/src/ui/hooks/useMouseClick.test.js.map +0 -1
  1105. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +0 -6
  1106. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +0 -291
  1107. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +0 -1
  1108. package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +0 -6
  1109. package/dist/src/ui/hooks/usePhraseCycler.test.js +0 -187
  1110. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +0 -1
  1111. package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
  1112. package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -113
  1113. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
  1114. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +0 -6
  1115. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +0 -817
  1116. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +0 -1
  1117. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
  1118. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -168
  1119. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
  1120. package/dist/src/ui/hooks/useRewind.test.d.ts +0 -6
  1121. package/dist/src/ui/hooks/useRewind.test.js +0 -100
  1122. package/dist/src/ui/hooks/useRewind.test.js.map +0 -1
  1123. package/dist/src/ui/hooks/useSelectionList.test.d.ts +0 -6
  1124. package/dist/src/ui/hooks/useSelectionList.test.js +0 -960
  1125. package/dist/src/ui/hooks/useSelectionList.test.js.map +0 -1
  1126. package/dist/src/ui/hooks/useSessionBrowser.test.d.ts +0 -6
  1127. package/dist/src/ui/hooks/useSessionBrowser.test.js +0 -277
  1128. package/dist/src/ui/hooks/useSessionBrowser.test.js.map +0 -1
  1129. package/dist/src/ui/hooks/useSessionResume.test.d.ts +0 -6
  1130. package/dist/src/ui/hooks/useSessionResume.test.js +0 -402
  1131. package/dist/src/ui/hooks/useSessionResume.test.js.map +0 -1
  1132. package/dist/src/ui/hooks/useSettingsNavigation.test.d.ts +0 -6
  1133. package/dist/src/ui/hooks/useSettingsNavigation.test.js +0 -87
  1134. package/dist/src/ui/hooks/useSettingsNavigation.test.js.map +0 -1
  1135. package/dist/src/ui/hooks/useShellCompletion.test.d.ts +0 -6
  1136. package/dist/src/ui/hooks/useShellCompletion.test.js +0 -354
  1137. package/dist/src/ui/hooks/useShellCompletion.test.js.map +0 -1
  1138. package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
  1139. package/dist/src/ui/hooks/useShellHistory.test.js +0 -226
  1140. package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
  1141. package/dist/src/ui/hooks/useShellInactivityStatus.test.d.ts +0 -6
  1142. package/dist/src/ui/hooks/useShellInactivityStatus.test.js +0 -84
  1143. package/dist/src/ui/hooks/useShellInactivityStatus.test.js.map +0 -1
  1144. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -10
  1145. package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -977
  1146. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
  1147. package/dist/src/ui/hooks/useSnowfall.test.d.ts +0 -6
  1148. package/dist/src/ui/hooks/useSnowfall.test.js +0 -92
  1149. package/dist/src/ui/hooks/useSnowfall.test.js.map +0 -1
  1150. package/dist/src/ui/hooks/useSuspend.test.d.ts +0 -6
  1151. package/dist/src/ui/hooks/useSuspend.test.js +0 -136
  1152. package/dist/src/ui/hooks/useSuspend.test.js.map +0 -1
  1153. package/dist/src/ui/hooks/useTabbedNavigation.test.d.ts +0 -6
  1154. package/dist/src/ui/hooks/useTabbedNavigation.test.js +0 -243
  1155. package/dist/src/ui/hooks/useTabbedNavigation.test.js.map +0 -1
  1156. package/dist/src/ui/hooks/useTerminalTheme.test.d.ts +0 -6
  1157. package/dist/src/ui/hooks/useTerminalTheme.test.js +0 -169
  1158. package/dist/src/ui/hooks/useTerminalTheme.test.js.map +0 -1
  1159. package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
  1160. package/dist/src/ui/hooks/useTimer.test.js +0 -119
  1161. package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
  1162. package/dist/src/ui/hooks/useTips.test.d.ts +0 -6
  1163. package/dist/src/ui/hooks/useTips.test.js +0 -33
  1164. package/dist/src/ui/hooks/useTips.test.js.map +0 -1
  1165. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
  1166. package/dist/src/ui/hooks/useToolScheduler.test.js +0 -534
  1167. package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
  1168. package/dist/src/ui/hooks/useTurnActivityMonitor.test.d.ts +0 -6
  1169. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js +0 -99
  1170. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js.map +0 -1
  1171. package/dist/src/ui/hooks/vim-passthrough.test.d.ts +0 -6
  1172. package/dist/src/ui/hooks/vim-passthrough.test.js +0 -84
  1173. package/dist/src/ui/hooks/vim-passthrough.test.js.map +0 -1
  1174. package/dist/src/ui/hooks/vim.test.d.ts +0 -6
  1175. package/dist/src/ui/hooks/vim.test.js +0 -2156
  1176. package/dist/src/ui/hooks/vim.test.js.map +0 -1
  1177. package/dist/src/ui/key/keyBindings.test.d.ts +0 -6
  1178. package/dist/src/ui/key/keyBindings.test.js +0 -225
  1179. package/dist/src/ui/key/keyBindings.test.js.map +0 -1
  1180. package/dist/src/ui/key/keyMatchers.test.d.ts +0 -6
  1181. package/dist/src/ui/key/keyMatchers.test.js +0 -524
  1182. package/dist/src/ui/key/keyMatchers.test.js.map +0 -1
  1183. package/dist/src/ui/key/keybindingUtils.test.d.ts +0 -6
  1184. package/dist/src/ui/key/keybindingUtils.test.js +0 -121
  1185. package/dist/src/ui/key/keybindingUtils.test.js.map +0 -1
  1186. package/dist/src/ui/layouts/DefaultAppLayout.test.d.ts +0 -6
  1187. package/dist/src/ui/layouts/DefaultAppLayout.test.js +0 -126
  1188. package/dist/src/ui/layouts/DefaultAppLayout.test.js.map +0 -1
  1189. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.d.ts +0 -6
  1190. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +0 -134
  1191. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +0 -1
  1192. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.d.ts +0 -6
  1193. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +0 -43
  1194. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +0 -1
  1195. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.d.ts +0 -6
  1196. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +0 -43
  1197. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +0 -1
  1198. package/dist/src/ui/privacy/PrivacyNotice.test.d.ts +0 -6
  1199. package/dist/src/ui/privacy/PrivacyNotice.test.js +0 -63
  1200. package/dist/src/ui/privacy/PrivacyNotice.test.js.map +0 -1
  1201. package/dist/src/ui/state/extensions.test.d.ts +0 -6
  1202. package/dist/src/ui/state/extensions.test.js +0 -219
  1203. package/dist/src/ui/state/extensions.test.js.map +0 -1
  1204. package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
  1205. package/dist/src/ui/themes/color-utils.test.js +0 -326
  1206. package/dist/src/ui/themes/color-utils.test.js.map +0 -1
  1207. package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
  1208. package/dist/src/ui/themes/theme-manager.test.js +0 -274
  1209. package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
  1210. package/dist/src/ui/themes/theme.test.d.ts +0 -6
  1211. package/dist/src/ui/themes/theme.test.js +0 -171
  1212. package/dist/src/ui/themes/theme.test.js.map +0 -1
  1213. package/dist/src/ui/utils/CodeColorizer.test.d.ts +0 -6
  1214. package/dist/src/ui/utils/CodeColorizer.test.js +0 -74
  1215. package/dist/src/ui/utils/CodeColorizer.test.js.map +0 -1
  1216. package/dist/src/ui/utils/ConsolePatcher.test.d.ts +0 -6
  1217. package/dist/src/ui/utils/ConsolePatcher.test.js +0 -199
  1218. package/dist/src/ui/utils/ConsolePatcher.test.js.map +0 -1
  1219. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  1220. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -175
  1221. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
  1222. package/dist/src/ui/utils/TableRenderer.test.d.ts +0 -1
  1223. package/dist/src/ui/utils/TableRenderer.test.js +0 -396
  1224. package/dist/src/ui/utils/TableRenderer.test.js.map +0 -1
  1225. package/dist/src/ui/utils/antigravityUtils.test.d.ts +0 -6
  1226. package/dist/src/ui/utils/antigravityUtils.test.js +0 -54
  1227. package/dist/src/ui/utils/antigravityUtils.test.js.map +0 -1
  1228. package/dist/src/ui/utils/borderStyles.test.d.ts +0 -6
  1229. package/dist/src/ui/utils/borderStyles.test.js +0 -172
  1230. package/dist/src/ui/utils/borderStyles.test.js.map +0 -1
  1231. package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
  1232. package/dist/src/ui/utils/clipboardUtils.test.js +0 -442
  1233. package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
  1234. package/dist/src/ui/utils/clipboardUtils.windows.test.d.ts +0 -6
  1235. package/dist/src/ui/utils/clipboardUtils.windows.test.js +0 -56
  1236. package/dist/src/ui/utils/clipboardUtils.windows.test.js.map +0 -1
  1237. package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
  1238. package/dist/src/ui/utils/commandUtils.test.js +0 -511
  1239. package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
  1240. package/dist/src/ui/utils/computeStats.test.d.ts +0 -6
  1241. package/dist/src/ui/utils/computeStats.test.js +0 -279
  1242. package/dist/src/ui/utils/computeStats.test.js.map +0 -1
  1243. package/dist/src/ui/utils/directoryUtils.test.d.ts +0 -6
  1244. package/dist/src/ui/utils/directoryUtils.test.js +0 -239
  1245. package/dist/src/ui/utils/directoryUtils.test.js.map +0 -1
  1246. package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
  1247. package/dist/src/ui/utils/displayUtils.test.js +0 -61
  1248. package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
  1249. package/dist/src/ui/utils/formatters.test.d.ts +0 -6
  1250. package/dist/src/ui/utils/formatters.test.js +0 -152
  1251. package/dist/src/ui/utils/formatters.test.js.map +0 -1
  1252. package/dist/src/ui/utils/highlight.test.d.ts +0 -6
  1253. package/dist/src/ui/utils/highlight.test.js +0 -205
  1254. package/dist/src/ui/utils/highlight.test.js.map +0 -1
  1255. package/dist/src/ui/utils/input.test.d.ts +0 -6
  1256. package/dist/src/ui/utils/input.test.js +0 -44
  1257. package/dist/src/ui/utils/input.test.js.map +0 -1
  1258. package/dist/src/ui/utils/latexToUnicode.test.d.ts +0 -6
  1259. package/dist/src/ui/utils/latexToUnicode.test.js +0 -222
  1260. package/dist/src/ui/utils/latexToUnicode.test.js.map +0 -1
  1261. package/dist/src/ui/utils/markdownParsingUtils.test.d.ts +0 -6
  1262. package/dist/src/ui/utils/markdownParsingUtils.test.js +0 -201
  1263. package/dist/src/ui/utils/markdownParsingUtils.test.js.map +0 -1
  1264. package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
  1265. package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
  1266. package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
  1267. package/dist/src/ui/utils/memorySnapshot.test.d.ts +0 -6
  1268. package/dist/src/ui/utils/memorySnapshot.test.js +0 -62
  1269. package/dist/src/ui/utils/memorySnapshot.test.js.map +0 -1
  1270. package/dist/src/ui/utils/mouse.test.d.ts +0 -6
  1271. package/dist/src/ui/utils/mouse.test.js +0 -136
  1272. package/dist/src/ui/utils/mouse.test.js.map +0 -1
  1273. package/dist/src/ui/utils/pendingAttentionNotification.test.d.ts +0 -6
  1274. package/dist/src/ui/utils/pendingAttentionNotification.test.js +0 -79
  1275. package/dist/src/ui/utils/pendingAttentionNotification.test.js.map +0 -1
  1276. package/dist/src/ui/utils/rewindFileOps.test.d.ts +0 -6
  1277. package/dist/src/ui/utils/rewindFileOps.test.js +0 -375
  1278. package/dist/src/ui/utils/rewindFileOps.test.js.map +0 -1
  1279. package/dist/src/ui/utils/terminalCapabilityManager.test.d.ts +0 -6
  1280. package/dist/src/ui/utils/terminalCapabilityManager.test.js +0 -400
  1281. package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +0 -1
  1282. package/dist/src/ui/utils/terminalSetup.test.d.ts +0 -6
  1283. package/dist/src/ui/utils/terminalSetup.test.js +0 -201
  1284. package/dist/src/ui/utils/terminalSetup.test.js.map +0 -1
  1285. package/dist/src/ui/utils/textOutput.test.d.ts +0 -6
  1286. package/dist/src/ui/utils/textOutput.test.js +0 -80
  1287. package/dist/src/ui/utils/textOutput.test.js.map +0 -1
  1288. package/dist/src/ui/utils/textUtils.test.d.ts +0 -6
  1289. package/dist/src/ui/utils/textUtils.test.js +0 -430
  1290. package/dist/src/ui/utils/textUtils.test.js.map +0 -1
  1291. package/dist/src/ui/utils/toolLayoutUtils.test.d.ts +0 -6
  1292. package/dist/src/ui/utils/toolLayoutUtils.test.js +0 -187
  1293. package/dist/src/ui/utils/toolLayoutUtils.test.js.map +0 -1
  1294. package/dist/src/ui/utils/ui-sizing.test.d.ts +0 -6
  1295. package/dist/src/ui/utils/ui-sizing.test.js +0 -25
  1296. package/dist/src/ui/utils/ui-sizing.test.js.map +0 -1
  1297. package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
  1298. package/dist/src/ui/utils/updateCheck.test.js +0 -207
  1299. package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
  1300. package/dist/src/ui/utils/urlSecurityUtils.test.d.ts +0 -6
  1301. package/dist/src/ui/utils/urlSecurityUtils.test.js +0 -49
  1302. package/dist/src/ui/utils/urlSecurityUtils.test.js.map +0 -1
  1303. package/dist/src/utils/activityLogger.test.d.ts +0 -6
  1304. package/dist/src/utils/activityLogger.test.js +0 -196
  1305. package/dist/src/utils/activityLogger.test.js.map +0 -1
  1306. package/dist/src/utils/agentSettings.test.d.ts +0 -6
  1307. package/dist/src/utils/agentSettings.test.js +0 -111
  1308. package/dist/src/utils/agentSettings.test.js.map +0 -1
  1309. package/dist/src/utils/agentUtils.test.d.ts +0 -6
  1310. package/dist/src/utils/agentUtils.test.js +0 -121
  1311. package/dist/src/utils/agentUtils.test.js.map +0 -1
  1312. package/dist/src/utils/cleanup.test.d.ts +0 -6
  1313. package/dist/src/utils/cleanup.test.js +0 -256
  1314. package/dist/src/utils/cleanup.test.js.map +0 -1
  1315. package/dist/src/utils/commands.test.d.ts +0 -6
  1316. package/dist/src/utils/commands.test.js +0 -194
  1317. package/dist/src/utils/commands.test.js.map +0 -1
  1318. package/dist/src/utils/commentJson.test.d.ts +0 -6
  1319. package/dist/src/utils/commentJson.test.js +0 -308
  1320. package/dist/src/utils/commentJson.test.js.map +0 -1
  1321. package/dist/src/utils/deepMerge.test.d.ts +0 -6
  1322. package/dist/src/utils/deepMerge.test.js +0 -211
  1323. package/dist/src/utils/deepMerge.test.js.map +0 -1
  1324. package/dist/src/utils/devtoolsService.test.d.ts +0 -6
  1325. package/dist/src/utils/devtoolsService.test.js +0 -346
  1326. package/dist/src/utils/devtoolsService.test.js.map +0 -1
  1327. package/dist/src/utils/dialogScopeUtils.test.d.ts +0 -6
  1328. package/dist/src/utils/dialogScopeUtils.test.js +0 -81
  1329. package/dist/src/utils/dialogScopeUtils.test.js.map +0 -1
  1330. package/dist/src/utils/envVarResolver.test.d.ts +0 -6
  1331. package/dist/src/utils/envVarResolver.test.js +0 -238
  1332. package/dist/src/utils/envVarResolver.test.js.map +0 -1
  1333. package/dist/src/utils/errors.test.d.ts +0 -6
  1334. package/dist/src/utils/errors.test.js +0 -420
  1335. package/dist/src/utils/errors.test.js.map +0 -1
  1336. package/dist/src/utils/events.test.d.ts +0 -6
  1337. package/dist/src/utils/events.test.js +0 -24
  1338. package/dist/src/utils/events.test.js.map +0 -1
  1339. package/dist/src/utils/featureToggleUtils.test.d.ts +0 -6
  1340. package/dist/src/utils/featureToggleUtils.test.js +0 -126
  1341. package/dist/src/utils/featureToggleUtils.test.js.map +0 -1
  1342. package/dist/src/utils/gitUtils.test.d.ts +0 -6
  1343. package/dist/src/utils/gitUtils.test.js +0 -172
  1344. package/dist/src/utils/gitUtils.test.js.map +0 -1
  1345. package/dist/src/utils/handleAutoUpdate.test.d.ts +0 -6
  1346. package/dist/src/utils/handleAutoUpdate.test.js +0 -399
  1347. package/dist/src/utils/handleAutoUpdate.test.js.map +0 -1
  1348. package/dist/src/utils/hookSettings.test.d.ts +0 -6
  1349. package/dist/src/utils/hookSettings.test.js +0 -117
  1350. package/dist/src/utils/hookSettings.test.js.map +0 -1
  1351. package/dist/src/utils/hookUtils.test.d.ts +0 -6
  1352. package/dist/src/utils/hookUtils.test.js +0 -113
  1353. package/dist/src/utils/hookUtils.test.js.map +0 -1
  1354. package/dist/src/utils/installationInfo.test.d.ts +0 -6
  1355. package/dist/src/utils/installationInfo.test.js +0 -322
  1356. package/dist/src/utils/installationInfo.test.js.map +0 -1
  1357. package/dist/src/utils/jsonoutput.test.d.ts +0 -6
  1358. package/dist/src/utils/jsonoutput.test.js +0 -74
  1359. package/dist/src/utils/jsonoutput.test.js.map +0 -1
  1360. package/dist/src/utils/logCleanup.test.d.ts +0 -6
  1361. package/dist/src/utils/logCleanup.test.js +0 -87
  1362. package/dist/src/utils/logCleanup.test.js.map +0 -1
  1363. package/dist/src/utils/math.test.d.ts +0 -6
  1364. package/dist/src/utils/math.test.js +0 -23
  1365. package/dist/src/utils/math.test.js.map +0 -1
  1366. package/dist/src/utils/persistentState.test.d.ts +0 -6
  1367. package/dist/src/utils/persistentState.test.js +0 -68
  1368. package/dist/src/utils/persistentState.test.js.map +0 -1
  1369. package/dist/src/utils/processUtils.test.d.ts +0 -6
  1370. package/dist/src/utils/processUtils.test.js +0 -150
  1371. package/dist/src/utils/processUtils.test.js.map +0 -1
  1372. package/dist/src/utils/readStdin.test.d.ts +0 -6
  1373. package/dist/src/utils/readStdin.test.js +0 -149
  1374. package/dist/src/utils/readStdin.test.js.map +0 -1
  1375. package/dist/src/utils/readStdin_safety.test.d.ts +0 -6
  1376. package/dist/src/utils/readStdin_safety.test.js +0 -68
  1377. package/dist/src/utils/readStdin_safety.test.js.map +0 -1
  1378. package/dist/src/utils/relaunch.test.d.ts +0 -6
  1379. package/dist/src/utils/relaunch.test.js +0 -275
  1380. package/dist/src/utils/relaunch.test.js.map +0 -1
  1381. package/dist/src/utils/resolvePath.test.d.ts +0 -6
  1382. package/dist/src/utils/resolvePath.test.js +0 -34
  1383. package/dist/src/utils/resolvePath.test.js.map +0 -1
  1384. package/dist/src/utils/sandbox.test.d.ts +0 -6
  1385. package/dist/src/utils/sandbox.test.js +0 -725
  1386. package/dist/src/utils/sandbox.test.js.map +0 -1
  1387. package/dist/src/utils/sandboxUtils.test.d.ts +0 -6
  1388. package/dist/src/utils/sandboxUtils.test.js +0 -190
  1389. package/dist/src/utils/sandboxUtils.test.js.map +0 -1
  1390. package/dist/src/utils/sessionCleanup.integration.test.d.ts +0 -6
  1391. package/dist/src/utils/sessionCleanup.integration.test.js +0 -276
  1392. package/dist/src/utils/sessionCleanup.integration.test.js.map +0 -1
  1393. package/dist/src/utils/sessionCleanup.test.d.ts +0 -6
  1394. package/dist/src/utils/sessionCleanup.test.js +0 -829
  1395. package/dist/src/utils/sessionCleanup.test.js.map +0 -1
  1396. package/dist/src/utils/sessionUtils.test.d.ts +0 -6
  1397. package/dist/src/utils/sessionUtils.test.js +0 -815
  1398. package/dist/src/utils/sessionUtils.test.js.map +0 -1
  1399. package/dist/src/utils/sessions.test.d.ts +0 -6
  1400. package/dist/src/utils/sessions.test.js +0 -580
  1401. package/dist/src/utils/sessions.test.js.map +0 -1
  1402. package/dist/src/utils/settingsUtils.test.d.ts +0 -6
  1403. package/dist/src/utils/settingsUtils.test.js +0 -673
  1404. package/dist/src/utils/settingsUtils.test.js.map +0 -1
  1405. package/dist/src/utils/skillSettings.test.d.ts +0 -6
  1406. package/dist/src/utils/skillSettings.test.js +0 -142
  1407. package/dist/src/utils/skillSettings.test.js.map +0 -1
  1408. package/dist/src/utils/skillUtils.test.d.ts +0 -6
  1409. package/dist/src/utils/skillUtils.test.js +0 -248
  1410. package/dist/src/utils/skillUtils.test.js.map +0 -1
  1411. package/dist/src/utils/startupWarnings.test.d.ts +0 -6
  1412. package/dist/src/utils/startupWarnings.test.js +0 -61
  1413. package/dist/src/utils/startupWarnings.test.js.map +0 -1
  1414. package/dist/src/utils/terminalNotifications.test.d.ts +0 -6
  1415. package/dist/src/utils/terminalNotifications.test.js +0 -219
  1416. package/dist/src/utils/terminalNotifications.test.js.map +0 -1
  1417. package/dist/src/utils/terminalTheme.test.d.ts +0 -6
  1418. package/dist/src/utils/terminalTheme.test.js +0 -91
  1419. package/dist/src/utils/terminalTheme.test.js.map +0 -1
  1420. package/dist/src/utils/tierUtils.test.d.ts +0 -6
  1421. package/dist/src/utils/tierUtils.test.js +0 -25
  1422. package/dist/src/utils/tierUtils.test.js.map +0 -1
  1423. package/dist/src/utils/toolOutputCleanup.test.d.ts +0 -6
  1424. package/dist/src/utils/toolOutputCleanup.test.js +0 -280
  1425. package/dist/src/utils/toolOutputCleanup.test.js.map +0 -1
  1426. package/dist/src/utils/updateEventEmitter.test.d.ts +0 -6
  1427. package/dist/src/utils/updateEventEmitter.test.js +0 -18
  1428. package/dist/src/utils/updateEventEmitter.test.js.map +0 -1
  1429. package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
  1430. package/dist/src/utils/userStartupWarnings.test.js +0 -225
  1431. package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
  1432. package/dist/src/utils/windowTitle.test.d.ts +0 -6
  1433. package/dist/src/utils/windowTitle.test.js +0 -216
  1434. package/dist/src/utils/windowTitle.test.js.map +0 -1
  1435. package/dist/src/utils/worktreeSetup.test.d.ts +0 -6
  1436. package/dist/src/utils/worktreeSetup.test.js +0 -89
  1437. package/dist/src/utils/worktreeSetup.test.js.map +0 -1
  1438. package/dist/src/validateNonInterActiveAuth.test.d.ts +0 -6
  1439. package/dist/src/validateNonInterActiveAuth.test.js +0 -319
  1440. package/dist/src/validateNonInterActiveAuth.test.js.map +0 -1
@@ -1,1921 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { ToolErrorType, GeminiEventType, OutputFormat, uiTelemetryService, FatalInputError, CoreEvent, CoreToolCallStatus, JsonStreamEventType, } from '@google/gemini-cli-core';
7
- import { runNonInteractive } from './nonInteractiveCli.js';
8
- import { describe, it, expect, beforeEach, afterEach, vi, } from 'vitest';
9
- // Mock core modules
10
- vi.mock('./ui/hooks/atCommandProcessor.js');
11
- const mockSetupInitialActivityLogger = vi.hoisted(() => vi.fn());
12
- vi.mock('./utils/devtoolsService.js', () => ({
13
- setupInitialActivityLogger: mockSetupInitialActivityLogger,
14
- }));
15
- const mockCoreEvents = vi.hoisted(() => ({
16
- on: vi.fn(),
17
- off: vi.fn(),
18
- emit: vi.fn(),
19
- emitConsoleLog: vi.fn(),
20
- emitFeedback: vi.fn(),
21
- drainBacklogs: vi.fn(),
22
- }));
23
- const mockSchedulerSchedule = vi.hoisted(() => vi.fn());
24
- vi.mock('@google/gemini-cli-core', async (importOriginal) => {
25
- const original = await importOriginal();
26
- class MockChatRecordingService {
27
- initialize = vi.fn();
28
- recordMessage = vi.fn();
29
- recordMessageTokens = vi.fn();
30
- recordToolCalls = vi.fn();
31
- }
32
- return {
33
- ...original,
34
- Scheduler: class {
35
- schedule = mockSchedulerSchedule;
36
- cancelAll = vi.fn();
37
- dispose = vi.fn();
38
- },
39
- isTelemetrySdkInitialized: vi.fn().mockReturnValue(true),
40
- ChatRecordingService: MockChatRecordingService,
41
- uiTelemetryService: {
42
- getMetrics: vi.fn(),
43
- },
44
- coreEvents: mockCoreEvents,
45
- createWorkingStdio: vi.fn(() => ({
46
- stdout: process.stdout,
47
- stderr: process.stderr,
48
- })),
49
- };
50
- });
51
- const mockGetCommands = vi.hoisted(() => vi.fn());
52
- const mockCommandServiceCreate = vi.hoisted(() => vi.fn());
53
- vi.mock('./services/CommandService.js', () => ({
54
- CommandService: {
55
- create: mockCommandServiceCreate,
56
- },
57
- }));
58
- vi.mock('./services/FileCommandLoader.js');
59
- vi.mock('./services/McpPromptLoader.js');
60
- vi.mock('./services/BuiltinCommandLoader.js');
61
- describe('runNonInteractive', () => {
62
- let mockConfig;
63
- let mockSettings;
64
- let mockToolRegistry;
65
- let consoleErrorSpy;
66
- let processStdoutSpy;
67
- let processStderrSpy;
68
- let mockGeminiClient;
69
- const MOCK_SESSION_METRICS = {
70
- models: {},
71
- tools: {
72
- totalCalls: 0,
73
- totalSuccess: 0,
74
- totalFail: 0,
75
- totalDurationMs: 0,
76
- totalDecisions: {
77
- accept: 0,
78
- reject: 0,
79
- modify: 0,
80
- auto_accept: 0,
81
- },
82
- byName: {},
83
- },
84
- files: {
85
- totalLinesAdded: 0,
86
- totalLinesRemoved: 0,
87
- },
88
- };
89
- beforeEach(async () => {
90
- mockSchedulerSchedule.mockReset();
91
- mockCommandServiceCreate.mockResolvedValue({
92
- getCommands: mockGetCommands,
93
- });
94
- consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
95
- processStdoutSpy = vi
96
- .spyOn(process.stdout, 'write')
97
- .mockImplementation(() => true);
98
- vi.spyOn(process.stdout, 'on').mockImplementation(() => process.stdout);
99
- processStderrSpy = vi
100
- .spyOn(process.stderr, 'write')
101
- .mockImplementation(() => true);
102
- vi.spyOn(process, 'exit').mockImplementation((code) => {
103
- throw new Error(`process.exit(${code}) called`);
104
- });
105
- mockToolRegistry = {
106
- getTool: vi.fn(),
107
- getFunctionDeclarations: vi.fn().mockReturnValue([]),
108
- };
109
- mockGeminiClient = {
110
- sendMessageStream: vi.fn(),
111
- resumeChat: vi.fn().mockResolvedValue(undefined),
112
- getChatRecordingService: vi.fn(() => ({
113
- initialize: vi.fn(),
114
- recordMessage: vi.fn(),
115
- recordMessageTokens: vi.fn(),
116
- recordToolCalls: vi.fn(),
117
- })),
118
- };
119
- mockConfig = {
120
- initialize: vi.fn().mockReturnValue(Promise.resolve(undefined)),
121
- getMessageBus: vi.fn().mockReturnValue({
122
- subscribe: vi.fn(),
123
- unsubscribe: vi.fn(),
124
- publish: vi.fn(),
125
- }),
126
- getGeminiClient: vi.fn().mockReturnValue(mockGeminiClient),
127
- getToolRegistry: vi.fn().mockReturnValue(mockToolRegistry),
128
- getMaxSessionTurns: vi.fn().mockReturnValue(10),
129
- getSessionId: vi.fn().mockReturnValue('test-session-id'),
130
- getProjectRoot: vi.fn().mockReturnValue('/test/project'),
131
- storage: {
132
- getProjectTempDir: vi.fn().mockReturnValue('/test/project/.gemini/tmp'),
133
- },
134
- getIdeMode: vi.fn().mockReturnValue(false),
135
- getContentGeneratorConfig: vi.fn().mockReturnValue({}),
136
- getDebugMode: vi.fn().mockReturnValue(false),
137
- getOutputFormat: vi.fn().mockReturnValue('text'),
138
- getModel: vi.fn().mockReturnValue('test-model'),
139
- getFolderTrust: vi.fn().mockReturnValue(false),
140
- isTrustedFolder: vi.fn().mockReturnValue(false),
141
- getRawOutput: vi.fn().mockReturnValue(false),
142
- getAcceptRawOutputRisk: vi.fn().mockReturnValue(false),
143
- getAgentSessionNoninteractiveEnabled: vi.fn().mockReturnValue(false),
144
- };
145
- mockSettings = {
146
- system: { path: '', settings: {} },
147
- systemDefaults: { path: '', settings: {} },
148
- user: { path: '', settings: {} },
149
- workspace: { path: '', settings: {} },
150
- errors: [],
151
- setValue: vi.fn(),
152
- merged: {
153
- security: {
154
- auth: {
155
- enforcedType: undefined,
156
- },
157
- },
158
- },
159
- isTrusted: true,
160
- migratedInMemoryScopes: new Set(),
161
- forScope: vi.fn(),
162
- computeMergedSettings: vi.fn(),
163
- };
164
- const { handleAtCommand } = await import('./ui/hooks/atCommandProcessor.js');
165
- vi.mocked(handleAtCommand).mockImplementation(async ({ query }) => ({
166
- processedQuery: [{ text: query }],
167
- }));
168
- });
169
- afterEach(() => {
170
- vi.restoreAllMocks();
171
- });
172
- async function* createStreamFromEvents(events) {
173
- for (const event of events) {
174
- yield event;
175
- }
176
- }
177
- const getWrittenOutput = () => processStdoutSpy.mock.calls.map((c) => c[0]).join('');
178
- it('should process input and write text output', async () => {
179
- const events = [
180
- { type: GeminiEventType.Content, value: 'Hello' },
181
- { type: GeminiEventType.Content, value: ' World' },
182
- {
183
- type: GeminiEventType.Finished,
184
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
185
- },
186
- ];
187
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
188
- await runNonInteractive({
189
- config: mockConfig,
190
- settings: mockSettings,
191
- input: 'Test input',
192
- prompt_id: 'prompt-id-1',
193
- });
194
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Test input' }], expect.any(AbortSignal), 'prompt-id-1', undefined, 'Test input');
195
- expect(getWrittenOutput()).toBe('Hello World\n');
196
- // Note: Telemetry shutdown is now handled in runExitCleanup() in cleanup.ts
197
- // so we no longer expect shutdownTelemetry to be called directly here
198
- });
199
- it('should register activity logger when GEMINI_CLI_ACTIVITY_LOG_TARGET is set', async () => {
200
- vi.stubEnv('GEMINI_CLI_ACTIVITY_LOG_TARGET', '/tmp/test.jsonl');
201
- const events = [
202
- {
203
- type: GeminiEventType.Finished,
204
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
205
- },
206
- ];
207
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
208
- await runNonInteractive({
209
- config: mockConfig,
210
- settings: mockSettings,
211
- input: 'test',
212
- prompt_id: 'prompt-id-activity-logger',
213
- });
214
- expect(mockSetupInitialActivityLogger).toHaveBeenCalledWith(mockConfig);
215
- vi.unstubAllEnvs();
216
- });
217
- it('should not register activity logger when GEMINI_CLI_ACTIVITY_LOG_TARGET is not set', async () => {
218
- vi.stubEnv('GEMINI_CLI_ACTIVITY_LOG_TARGET', '');
219
- const events = [
220
- {
221
- type: GeminiEventType.Finished,
222
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
223
- },
224
- ];
225
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
226
- await runNonInteractive({
227
- config: mockConfig,
228
- settings: mockSettings,
229
- input: 'test',
230
- prompt_id: 'prompt-id-activity-logger-off',
231
- });
232
- expect(mockSetupInitialActivityLogger).not.toHaveBeenCalled();
233
- vi.unstubAllEnvs();
234
- });
235
- it('should handle a single tool call and respond', async () => {
236
- const toolCallEvent = {
237
- type: GeminiEventType.ToolCallRequest,
238
- value: {
239
- callId: 'tool-1',
240
- name: 'testTool',
241
- args: { arg1: 'value1' },
242
- isClientInitiated: false,
243
- prompt_id: 'prompt-id-2',
244
- },
245
- };
246
- const toolResponse = [{ text: 'Tool response' }];
247
- mockSchedulerSchedule.mockResolvedValue([
248
- {
249
- status: CoreToolCallStatus.Success,
250
- request: {
251
- callId: 'tool-1',
252
- name: 'testTool',
253
- args: { arg1: 'value1' },
254
- isClientInitiated: false,
255
- prompt_id: 'prompt-id-2',
256
- },
257
- tool: {},
258
- invocation: {},
259
- response: {
260
- responseParts: toolResponse,
261
- callId: 'tool-1',
262
- error: undefined,
263
- errorType: undefined,
264
- contentLength: undefined,
265
- },
266
- },
267
- ]);
268
- const firstCallEvents = [toolCallEvent];
269
- const secondCallEvents = [
270
- { type: GeminiEventType.Content, value: 'Final answer' },
271
- {
272
- type: GeminiEventType.Finished,
273
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
274
- },
275
- ];
276
- mockGeminiClient.sendMessageStream
277
- .mockReturnValueOnce(createStreamFromEvents(firstCallEvents))
278
- .mockReturnValueOnce(createStreamFromEvents(secondCallEvents));
279
- await runNonInteractive({
280
- config: mockConfig,
281
- settings: mockSettings,
282
- input: 'Use a tool',
283
- prompt_id: 'prompt-id-2',
284
- });
285
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(2);
286
- expect(mockSchedulerSchedule).toHaveBeenCalledWith([expect.objectContaining({ name: 'testTool' })], expect.any(AbortSignal));
287
- expect(mockGeminiClient.sendMessageStream).toHaveBeenNthCalledWith(2, [{ text: 'Tool response' }], expect.any(AbortSignal), 'prompt-id-2', undefined, undefined);
288
- expect(getWrittenOutput()).toBe('Final answer\n');
289
- });
290
- it('should write a single newline between sequential text outputs from the model', async () => {
291
- // This test simulates a multi-turn conversation to ensure that a single newline
292
- // is printed between each block of text output from the model.
293
- // 1. Define the tool requests that the model will ask the CLI to run.
294
- const toolCallEvent = {
295
- type: GeminiEventType.ToolCallRequest,
296
- value: {
297
- callId: 'mock-tool',
298
- name: 'mockTool',
299
- args: {},
300
- isClientInitiated: false,
301
- prompt_id: 'prompt-id-multi',
302
- },
303
- };
304
- // 2. Mock the execution of the tools. We just need them to succeed.
305
- mockSchedulerSchedule.mockResolvedValue([
306
- {
307
- status: CoreToolCallStatus.Success,
308
- request: toolCallEvent.value, // This is generic enough for both calls
309
- tool: {},
310
- invocation: {},
311
- response: {
312
- responseParts: [],
313
- callId: 'mock-tool',
314
- },
315
- },
316
- ]);
317
- // 3. Define the sequence of events streamed from the mock model.
318
- // Turn 1: Model outputs text, then requests a tool call.
319
- const modelTurn1 = [
320
- { type: GeminiEventType.Content, value: 'Use mock tool' },
321
- toolCallEvent,
322
- ];
323
- // Turn 2: Model outputs more text, then requests another tool call.
324
- const modelTurn2 = [
325
- { type: GeminiEventType.Content, value: 'Use mock tool again' },
326
- toolCallEvent,
327
- ];
328
- // Turn 3: Model outputs a final answer.
329
- const modelTurn3 = [
330
- { type: GeminiEventType.Content, value: 'Finished.' },
331
- {
332
- type: GeminiEventType.Finished,
333
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
334
- },
335
- ];
336
- mockGeminiClient.sendMessageStream
337
- .mockReturnValueOnce(createStreamFromEvents(modelTurn1))
338
- .mockReturnValueOnce(createStreamFromEvents(modelTurn2))
339
- .mockReturnValueOnce(createStreamFromEvents(modelTurn3));
340
- // 4. Run the command.
341
- await runNonInteractive({
342
- config: mockConfig,
343
- settings: mockSettings,
344
- input: 'Use mock tool multiple times',
345
- prompt_id: 'prompt-id-multi',
346
- });
347
- // 5. Verify the output.
348
- // The rendered output should contain the text from each turn, separated by a
349
- // single newline, with a final newline at the end.
350
- expect(getWrittenOutput()).toMatchSnapshot();
351
- // Also verify the tools were called as expected.
352
- expect(mockSchedulerSchedule).toHaveBeenCalledTimes(2);
353
- });
354
- it('should handle error during tool execution and should send error back to the model', async () => {
355
- const toolCallEvent = {
356
- type: GeminiEventType.ToolCallRequest,
357
- value: {
358
- callId: 'tool-1',
359
- name: 'errorTool',
360
- args: {},
361
- isClientInitiated: false,
362
- prompt_id: 'prompt-id-3',
363
- },
364
- };
365
- mockSchedulerSchedule.mockResolvedValue([
366
- {
367
- status: CoreToolCallStatus.Error,
368
- request: {
369
- callId: 'tool-1',
370
- name: 'errorTool',
371
- args: {},
372
- isClientInitiated: false,
373
- prompt_id: 'prompt-id-3',
374
- },
375
- tool: {},
376
- response: {
377
- callId: 'tool-1',
378
- error: new Error('Execution failed'),
379
- errorType: ToolErrorType.EXECUTION_FAILED,
380
- responseParts: [
381
- {
382
- functionResponse: {
383
- name: 'errorTool',
384
- response: {
385
- output: 'Error: Execution failed',
386
- },
387
- },
388
- },
389
- ],
390
- resultDisplay: 'Execution failed',
391
- contentLength: undefined,
392
- },
393
- },
394
- ]);
395
- const finalResponse = [
396
- {
397
- type: GeminiEventType.Content,
398
- value: 'Sorry, let me try again.',
399
- },
400
- {
401
- type: GeminiEventType.Finished,
402
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
403
- },
404
- ];
405
- mockGeminiClient.sendMessageStream
406
- .mockReturnValueOnce(createStreamFromEvents([toolCallEvent]))
407
- .mockReturnValueOnce(createStreamFromEvents(finalResponse));
408
- await runNonInteractive({
409
- config: mockConfig,
410
- settings: mockSettings,
411
- input: 'Trigger tool error',
412
- prompt_id: 'prompt-id-3',
413
- });
414
- expect(mockSchedulerSchedule).toHaveBeenCalled();
415
- expect(consoleErrorSpy).toHaveBeenCalledWith('Error executing tool errorTool: Execution failed');
416
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(2);
417
- expect(mockGeminiClient.sendMessageStream).toHaveBeenNthCalledWith(2, [
418
- {
419
- functionResponse: {
420
- name: 'errorTool',
421
- response: {
422
- output: 'Error: Execution failed',
423
- },
424
- },
425
- },
426
- ], expect.any(AbortSignal), 'prompt-id-3', undefined, undefined);
427
- expect(getWrittenOutput()).toBe('Sorry, let me try again.\n');
428
- });
429
- it('should exit with error if sendMessageStream throws initially', async () => {
430
- const apiError = new Error('API connection failed');
431
- mockGeminiClient.sendMessageStream.mockImplementation(() => {
432
- throw apiError;
433
- });
434
- await expect(runNonInteractive({
435
- config: mockConfig,
436
- settings: mockSettings,
437
- input: 'Initial fail',
438
- prompt_id: 'prompt-id-4',
439
- })).rejects.toThrow(apiError);
440
- });
441
- it('should not exit if a tool is not found, and should send error back to model', async () => {
442
- const toolCallEvent = {
443
- type: GeminiEventType.ToolCallRequest,
444
- value: {
445
- callId: 'tool-1',
446
- name: 'nonexistentTool',
447
- args: {},
448
- isClientInitiated: false,
449
- prompt_id: 'prompt-id-5',
450
- },
451
- };
452
- mockSchedulerSchedule.mockResolvedValue([
453
- {
454
- status: CoreToolCallStatus.Error,
455
- request: {
456
- callId: 'tool-1',
457
- name: 'nonexistentTool',
458
- args: {},
459
- isClientInitiated: false,
460
- prompt_id: 'prompt-id-5',
461
- },
462
- response: {
463
- callId: 'tool-1',
464
- error: new Error('Tool "nonexistentTool" not found in registry.'),
465
- resultDisplay: 'Tool "nonexistentTool" not found in registry.',
466
- responseParts: [],
467
- errorType: undefined,
468
- contentLength: undefined,
469
- },
470
- },
471
- ]);
472
- const finalResponse = [
473
- {
474
- type: GeminiEventType.Content,
475
- value: "Sorry, I can't find that tool.",
476
- },
477
- {
478
- type: GeminiEventType.Finished,
479
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
480
- },
481
- ];
482
- mockGeminiClient.sendMessageStream
483
- .mockReturnValueOnce(createStreamFromEvents([toolCallEvent]))
484
- .mockReturnValueOnce(createStreamFromEvents(finalResponse));
485
- await runNonInteractive({
486
- config: mockConfig,
487
- settings: mockSettings,
488
- input: 'Trigger tool not found',
489
- prompt_id: 'prompt-id-5',
490
- });
491
- expect(mockSchedulerSchedule).toHaveBeenCalled();
492
- expect(consoleErrorSpy).toHaveBeenCalledWith('Error executing tool nonexistentTool: Tool "nonexistentTool" not found in registry.');
493
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(2);
494
- expect(getWrittenOutput()).toBe("Sorry, I can't find that tool.\n");
495
- });
496
- it('should exit when max session turns are exceeded', async () => {
497
- vi.mocked(mockConfig.getMaxSessionTurns).mockReturnValue(0);
498
- await expect(runNonInteractive({
499
- config: mockConfig,
500
- settings: mockSettings,
501
- input: 'Trigger loop',
502
- prompt_id: 'prompt-id-6',
503
- })).rejects.toThrow('process.exit(53) called');
504
- });
505
- it('should preprocess @include commands before sending to the model', async () => {
506
- // 1. Mock the imported atCommandProcessor
507
- const { handleAtCommand } = await import('./ui/hooks/atCommandProcessor.js');
508
- const mockHandleAtCommand = vi.mocked(handleAtCommand);
509
- // 2. Define the raw input and the expected processed output
510
- const rawInput = 'Summarize @file.txt';
511
- const processedParts = [
512
- { text: 'Summarize @file.txt' },
513
- { text: '\n--- Content from referenced files ---\n' },
514
- { text: 'This is the content of the file.' },
515
- { text: '\n--- End of content ---' },
516
- ];
517
- // 3. Setup the mock to return the processed parts
518
- mockHandleAtCommand.mockResolvedValue({
519
- processedQuery: processedParts,
520
- });
521
- // Mock a simple stream response from the Gemini client
522
- const events = [
523
- { type: GeminiEventType.Content, value: 'Summary complete.' },
524
- {
525
- type: GeminiEventType.Finished,
526
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
527
- },
528
- ];
529
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
530
- // 4. Run the non-interactive mode with the raw input
531
- await runNonInteractive({
532
- config: mockConfig,
533
- settings: mockSettings,
534
- input: rawInput,
535
- prompt_id: 'prompt-id-7',
536
- });
537
- // 5. Assert that sendMessageStream was called with the PROCESSED parts, not the raw input
538
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith(processedParts, expect.any(AbortSignal), 'prompt-id-7', undefined, rawInput);
539
- // 6. Assert the final output is correct
540
- expect(getWrittenOutput()).toBe('Summary complete.\n');
541
- });
542
- it('should process input and write JSON output with stats', async () => {
543
- const events = [
544
- { type: GeminiEventType.Content, value: 'Hello World' },
545
- {
546
- type: GeminiEventType.Finished,
547
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
548
- },
549
- ];
550
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
551
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
552
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
553
- await runNonInteractive({
554
- config: mockConfig,
555
- settings: mockSettings,
556
- input: 'Test input',
557
- prompt_id: 'prompt-id-1',
558
- });
559
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Test input' }], expect.any(AbortSignal), 'prompt-id-1', undefined, 'Test input');
560
- expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
561
- session_id: 'test-session-id',
562
- response: 'Hello World',
563
- stats: MOCK_SESSION_METRICS,
564
- }, null, 2));
565
- });
566
- it('should write JSON output with stats for tool-only commands (no text response)', async () => {
567
- // Test the scenario where a command completes successfully with only tool calls
568
- // but no text response - this would have caught the original bug
569
- const toolCallEvent = {
570
- type: GeminiEventType.ToolCallRequest,
571
- value: {
572
- callId: 'tool-1',
573
- name: 'testTool',
574
- args: { arg1: 'value1' },
575
- isClientInitiated: false,
576
- prompt_id: 'prompt-id-tool-only',
577
- },
578
- };
579
- const toolResponse = [{ text: 'Tool executed successfully' }];
580
- mockSchedulerSchedule.mockResolvedValue([
581
- {
582
- status: CoreToolCallStatus.Success,
583
- request: {
584
- callId: 'tool-1',
585
- name: 'testTool',
586
- args: { arg1: 'value1' },
587
- isClientInitiated: false,
588
- prompt_id: 'prompt-id-tool-only',
589
- },
590
- tool: {},
591
- invocation: {},
592
- response: {
593
- responseParts: toolResponse,
594
- callId: 'tool-1',
595
- error: undefined,
596
- errorType: undefined,
597
- contentLength: undefined,
598
- },
599
- },
600
- ]);
601
- // First call returns only tool call, no content
602
- const firstCallEvents = [
603
- toolCallEvent,
604
- {
605
- type: GeminiEventType.Finished,
606
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
607
- },
608
- ];
609
- // Second call returns no content (tool-only completion)
610
- const secondCallEvents = [
611
- {
612
- type: GeminiEventType.Finished,
613
- value: { reason: undefined, usageMetadata: { totalTokenCount: 3 } },
614
- },
615
- ];
616
- mockGeminiClient.sendMessageStream
617
- .mockReturnValueOnce(createStreamFromEvents(firstCallEvents))
618
- .mockReturnValueOnce(createStreamFromEvents(secondCallEvents));
619
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
620
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
621
- await runNonInteractive({
622
- config: mockConfig,
623
- settings: mockSettings,
624
- input: 'Execute tool only',
625
- prompt_id: 'prompt-id-tool-only',
626
- });
627
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(2);
628
- expect(mockSchedulerSchedule).toHaveBeenCalledWith([expect.objectContaining({ name: 'testTool' })], expect.any(AbortSignal));
629
- // This should output JSON with empty response but include stats
630
- expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
631
- session_id: 'test-session-id',
632
- response: '',
633
- stats: MOCK_SESSION_METRICS,
634
- }, null, 2));
635
- });
636
- it('should write JSON output with stats for empty response commands', async () => {
637
- // Test the scenario where a command completes but produces no content at all
638
- const events = [
639
- {
640
- type: GeminiEventType.Finished,
641
- value: { reason: undefined, usageMetadata: { totalTokenCount: 1 } },
642
- },
643
- ];
644
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
645
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
646
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
647
- await runNonInteractive({
648
- config: mockConfig,
649
- settings: mockSettings,
650
- input: 'Empty response test',
651
- prompt_id: 'prompt-id-empty',
652
- });
653
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Empty response test' }], expect.any(AbortSignal), 'prompt-id-empty', undefined, 'Empty response test');
654
- // This should output JSON with empty response but include stats
655
- expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
656
- session_id: 'test-session-id',
657
- response: '',
658
- stats: MOCK_SESSION_METRICS,
659
- }, null, 2));
660
- });
661
- it('should handle errors in JSON format', async () => {
662
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
663
- const testError = new Error('Invalid input provided');
664
- mockGeminiClient.sendMessageStream.mockImplementation(() => {
665
- throw testError;
666
- });
667
- let thrownError = null;
668
- try {
669
- await runNonInteractive({
670
- config: mockConfig,
671
- settings: mockSettings,
672
- input: 'Test input',
673
- prompt_id: 'prompt-id-error',
674
- });
675
- // Should not reach here
676
- expect.fail('Expected process.exit to be called');
677
- }
678
- catch (error) {
679
- thrownError = error;
680
- }
681
- // Should throw because of mocked process.exit
682
- expect(thrownError?.message).toBe('process.exit(1) called');
683
- expect(mockCoreEvents.emitFeedback).toHaveBeenCalledWith('error', JSON.stringify({
684
- session_id: 'test-session-id',
685
- error: {
686
- type: 'Error',
687
- message: 'Invalid input provided',
688
- code: 1,
689
- },
690
- }, null, 2));
691
- });
692
- it('should handle FatalInputError with custom exit code in JSON format', async () => {
693
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
694
- const fatalError = new FatalInputError('Invalid command syntax provided');
695
- mockGeminiClient.sendMessageStream.mockImplementation(() => {
696
- throw fatalError;
697
- });
698
- let thrownError = null;
699
- try {
700
- await runNonInteractive({
701
- config: mockConfig,
702
- settings: mockSettings,
703
- input: 'Invalid syntax',
704
- prompt_id: 'prompt-id-fatal',
705
- });
706
- // Should not reach here
707
- expect.fail('Expected process.exit to be called');
708
- }
709
- catch (error) {
710
- thrownError = error;
711
- }
712
- // Should throw because of mocked process.exit with custom exit code
713
- expect(thrownError?.message).toBe('process.exit(42) called');
714
- expect(mockCoreEvents.emitFeedback).toHaveBeenCalledWith('error', JSON.stringify({
715
- session_id: 'test-session-id',
716
- error: {
717
- type: 'FatalInputError',
718
- message: 'Invalid command syntax provided',
719
- code: 42,
720
- },
721
- }, null, 2));
722
- });
723
- it('should execute a slash command that returns a prompt', async () => {
724
- const mockCommand = {
725
- name: 'testcommand',
726
- description: 'a test command',
727
- action: vi.fn().mockResolvedValue({
728
- type: 'submit_prompt',
729
- content: [{ text: 'Prompt from command' }],
730
- }),
731
- };
732
- mockGetCommands.mockReturnValue([mockCommand]);
733
- const events = [
734
- { type: GeminiEventType.Content, value: 'Response from command' },
735
- {
736
- type: GeminiEventType.Finished,
737
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
738
- },
739
- ];
740
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
741
- await runNonInteractive({
742
- config: mockConfig,
743
- settings: mockSettings,
744
- input: '/testcommand',
745
- prompt_id: 'prompt-id-slash',
746
- });
747
- // Ensure the prompt sent to the model is from the command, not the raw input
748
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Prompt from command' }], expect.any(AbortSignal), 'prompt-id-slash', undefined, '/testcommand');
749
- expect(getWrittenOutput()).toBe('Response from command\n');
750
- });
751
- it('should handle slash commands', async () => {
752
- const nonInteractiveCliCommands = await import('./nonInteractiveCliCommands.js');
753
- const handleSlashCommandSpy = vi.spyOn(nonInteractiveCliCommands, 'handleSlashCommand');
754
- handleSlashCommandSpy.mockResolvedValue([{ text: 'Slash command output' }]);
755
- const events = [
756
- { type: GeminiEventType.Content, value: 'Response to slash command' },
757
- {
758
- type: GeminiEventType.Finished,
759
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
760
- },
761
- ];
762
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
763
- await runNonInteractive({
764
- config: mockConfig,
765
- settings: mockSettings,
766
- input: '/help',
767
- prompt_id: 'prompt-id-slash',
768
- });
769
- expect(handleSlashCommandSpy).toHaveBeenCalledWith('/help', expect.any(AbortController), mockConfig, mockSettings);
770
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Slash command output' }], expect.any(AbortSignal), 'prompt-id-slash', undefined, '/help');
771
- expect(getWrittenOutput()).toBe('Response to slash command\n');
772
- handleSlashCommandSpy.mockRestore();
773
- });
774
- it('should handle cancellation (Ctrl+C)', async () => {
775
- // Mock isTTY and setRawMode safely
776
- const originalIsTTY = process.stdin.isTTY;
777
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
778
- const originalSetRawMode = process.stdin.setRawMode;
779
- Object.defineProperty(process.stdin, 'isTTY', {
780
- value: true,
781
- configurable: true,
782
- });
783
- if (!originalSetRawMode) {
784
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
785
- process.stdin.setRawMode = vi.fn();
786
- }
787
- const stdinOnSpy = vi
788
- .spyOn(process.stdin, 'on')
789
- .mockImplementation(() => process.stdin);
790
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
791
- vi.spyOn(process.stdin, 'setRawMode').mockImplementation(() => true);
792
- vi.spyOn(process.stdin, 'resume').mockImplementation(() => process.stdin);
793
- vi.spyOn(process.stdin, 'pause').mockImplementation(() => process.stdin);
794
- vi.spyOn(process.stdin, 'removeAllListeners').mockImplementation(() => process.stdin);
795
- // Spy on handleCancellationError to verify it's called
796
- const errors = await import('./utils/errors.js');
797
- const handleCancellationErrorSpy = vi
798
- .spyOn(errors, 'handleCancellationError')
799
- .mockImplementation(() => {
800
- throw new Error('Cancelled');
801
- });
802
- const events = [
803
- { type: GeminiEventType.Content, value: 'Thinking...' },
804
- ];
805
- // Create a stream that responds to abortion
806
- mockGeminiClient.sendMessageStream.mockImplementation((_messages, signal) => (async function* () {
807
- yield events[0];
808
- await new Promise((resolve, reject) => {
809
- const timeout = setTimeout(resolve, 1000);
810
- signal.addEventListener('abort', () => {
811
- clearTimeout(timeout);
812
- setTimeout(() => {
813
- reject(new Error('Aborted')); // This will be caught by nonInteractiveCli and passed to handleError
814
- }, 300);
815
- });
816
- });
817
- })());
818
- const runPromise = runNonInteractive({
819
- config: mockConfig,
820
- settings: mockSettings,
821
- input: 'Long running query',
822
- prompt_id: 'prompt-id-cancel',
823
- });
824
- // Wait a bit for setup to complete and listeners to be registered
825
- await new Promise((resolve) => setTimeout(resolve, 100));
826
- // Find the keypress handler registered by runNonInteractive
827
- const keypressCall = stdinOnSpy.mock.calls.find(
828
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
829
- (call) => call[0] === 'keypress');
830
- expect(keypressCall).toBeDefined();
831
- const keypressHandler = keypressCall?.[1];
832
- if (keypressHandler) {
833
- // Simulate Ctrl+C
834
- keypressHandler('\u0003', { ctrl: true, name: 'c' });
835
- }
836
- // The promise should reject with 'Aborted' because our mock stream throws it,
837
- // and nonInteractiveCli catches it and calls handleError, which doesn't necessarily throw.
838
- // Wait, if handleError is called, we should check that.
839
- // But here we want to check if Ctrl+C works.
840
- // In our current setup, Ctrl+C aborts the signal. The stream throws 'Aborted'.
841
- // nonInteractiveCli catches 'Aborted' and calls handleError.
842
- // If we want to test that handleCancellationError is called, we need the loop to detect abortion.
843
- // But our stream throws before the loop can detect it.
844
- // Let's just check that the promise rejects with 'Aborted' for now,
845
- // which proves the abortion signal reached the stream.
846
- await expect(runPromise).rejects.toThrow('Aborted');
847
- expect(processStderrSpy.mock.calls.some(
848
- // eslint-disable-next-line no-restricted-syntax
849
- (call) => typeof call[0] === 'string' && call[0].includes('Cancelling'))).toBe(true);
850
- handleCancellationErrorSpy.mockRestore();
851
- // Restore original values
852
- Object.defineProperty(process.stdin, 'isTTY', {
853
- value: originalIsTTY,
854
- configurable: true,
855
- });
856
- if (originalSetRawMode) {
857
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
858
- process.stdin.setRawMode = originalSetRawMode;
859
- }
860
- else {
861
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
862
- delete process.stdin.setRawMode;
863
- }
864
- // Spies are automatically restored by vi.restoreAllMocks() in afterEach,
865
- // but we can also do it manually if needed.
866
- });
867
- it('should throw FatalInputError if a command requires confirmation', async () => {
868
- const mockCommand = {
869
- name: 'confirm',
870
- description: 'a command that needs confirmation',
871
- action: vi.fn().mockResolvedValue({
872
- type: 'confirm_shell_commands',
873
- commands: ['rm -rf /'],
874
- }),
875
- };
876
- mockGetCommands.mockReturnValue([mockCommand]);
877
- await expect(runNonInteractive({
878
- config: mockConfig,
879
- settings: mockSettings,
880
- input: '/confirm',
881
- prompt_id: 'prompt-id-confirm',
882
- })).rejects.toThrow('Exiting due to a confirmation prompt requested by the command.');
883
- });
884
- it('should treat an unknown slash command as a regular prompt', async () => {
885
- // No commands are mocked, so any slash command is "unknown"
886
- mockGetCommands.mockReturnValue([]);
887
- const events = [
888
- { type: GeminiEventType.Content, value: 'Response to unknown' },
889
- {
890
- type: GeminiEventType.Finished,
891
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
892
- },
893
- ];
894
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
895
- await runNonInteractive({
896
- config: mockConfig,
897
- settings: mockSettings,
898
- input: '/unknowncommand',
899
- prompt_id: 'prompt-id-unknown',
900
- });
901
- // Ensure the raw input is sent to the model
902
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: '/unknowncommand' }], expect.any(AbortSignal), 'prompt-id-unknown', undefined, '/unknowncommand');
903
- expect(getWrittenOutput()).toBe('Response to unknown\n');
904
- });
905
- it('should throw for unhandled command result types', async () => {
906
- const mockCommand = {
907
- name: 'noaction',
908
- description: 'unhandled type',
909
- action: vi.fn().mockResolvedValue({
910
- type: 'unhandled',
911
- }),
912
- };
913
- mockGetCommands.mockReturnValue([mockCommand]);
914
- await expect(runNonInteractive({
915
- config: mockConfig,
916
- settings: mockSettings,
917
- input: '/noaction',
918
- prompt_id: 'prompt-id-unhandled',
919
- })).rejects.toThrow('Exiting due to command result that is not supported in non-interactive mode.');
920
- });
921
- it('should pass arguments to the slash command action', async () => {
922
- const mockAction = vi.fn().mockResolvedValue({
923
- type: 'submit_prompt',
924
- content: [{ text: 'Prompt from command' }],
925
- });
926
- const mockCommand = {
927
- name: 'testargs',
928
- description: 'a test command',
929
- action: mockAction,
930
- };
931
- mockGetCommands.mockReturnValue([mockCommand]);
932
- const events = [
933
- { type: GeminiEventType.Content, value: 'Acknowledged' },
934
- {
935
- type: GeminiEventType.Finished,
936
- value: { reason: undefined, usageMetadata: { totalTokenCount: 1 } },
937
- },
938
- ];
939
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
940
- await runNonInteractive({
941
- config: mockConfig,
942
- settings: mockSettings,
943
- input: '/testargs arg1 arg2',
944
- prompt_id: 'prompt-id-args',
945
- });
946
- expect(mockAction).toHaveBeenCalledWith(expect.any(Object), 'arg1 arg2');
947
- expect(getWrittenOutput()).toBe('Acknowledged\n');
948
- });
949
- it('should instantiate CommandService with correct loaders for slash commands', async () => {
950
- // This test indirectly checks that handleSlashCommand is using the right loaders.
951
- const { FileCommandLoader } = await import('./services/FileCommandLoader.js');
952
- const { McpPromptLoader } = await import('./services/McpPromptLoader.js');
953
- const { BuiltinCommandLoader } = await import('./services/BuiltinCommandLoader.js');
954
- mockGetCommands.mockReturnValue([]); // No commands found, so it will fall through
955
- const events = [
956
- { type: GeminiEventType.Content, value: 'Acknowledged' },
957
- {
958
- type: GeminiEventType.Finished,
959
- value: { reason: undefined, usageMetadata: { totalTokenCount: 1 } },
960
- },
961
- ];
962
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
963
- await runNonInteractive({
964
- config: mockConfig,
965
- settings: mockSettings,
966
- input: '/mycommand',
967
- prompt_id: 'prompt-id-loaders',
968
- });
969
- // Check that loaders were instantiated with the config
970
- expect(FileCommandLoader).toHaveBeenCalledTimes(1);
971
- expect(FileCommandLoader).toHaveBeenCalledWith(mockConfig);
972
- expect(McpPromptLoader).toHaveBeenCalledTimes(1);
973
- expect(McpPromptLoader).toHaveBeenCalledWith(mockConfig);
974
- expect(BuiltinCommandLoader).toHaveBeenCalledWith(mockConfig);
975
- // Check that instances were passed to CommandService.create
976
- expect(mockCommandServiceCreate).toHaveBeenCalledTimes(1);
977
- const loadersArg = mockCommandServiceCreate.mock.calls[0][0];
978
- expect(loadersArg).toHaveLength(3);
979
- expect(loadersArg[0]).toBe(vi.mocked(BuiltinCommandLoader).mock.instances[0]);
980
- expect(loadersArg[1]).toBe(vi.mocked(McpPromptLoader).mock.instances[0]);
981
- expect(loadersArg[2]).toBe(vi.mocked(FileCommandLoader).mock.instances[0]);
982
- });
983
- it('should allow a normally-excluded tool when --allowed-tools is set', async () => {
984
- // By default, ShellTool is excluded in non-interactive mode.
985
- // This test ensures that --allowed-tools overrides this exclusion.
986
- vi.mocked(mockConfig.getToolRegistry).mockReturnValue({
987
- getTool: vi.fn().mockReturnValue({
988
- name: 'ShellTool',
989
- description: 'A shell tool',
990
- run: vi.fn(),
991
- }),
992
- getFunctionDeclarations: vi.fn().mockReturnValue([{ name: 'ShellTool' }]),
993
- });
994
- const toolCallEvent = {
995
- type: GeminiEventType.ToolCallRequest,
996
- value: {
997
- callId: 'tool-shell-1',
998
- name: 'ShellTool',
999
- args: { command: 'ls' },
1000
- isClientInitiated: false,
1001
- prompt_id: 'prompt-id-allowed',
1002
- },
1003
- };
1004
- const toolResponse = [{ text: 'file.txt' }];
1005
- mockSchedulerSchedule.mockResolvedValue([
1006
- {
1007
- status: CoreToolCallStatus.Success,
1008
- request: {
1009
- callId: 'tool-shell-1',
1010
- name: 'ShellTool',
1011
- args: { command: 'ls' },
1012
- isClientInitiated: false,
1013
- prompt_id: 'prompt-id-allowed',
1014
- },
1015
- tool: {},
1016
- invocation: {},
1017
- response: {
1018
- responseParts: toolResponse,
1019
- callId: 'tool-shell-1',
1020
- error: undefined,
1021
- errorType: undefined,
1022
- contentLength: undefined,
1023
- },
1024
- },
1025
- ]);
1026
- const firstCallEvents = [toolCallEvent];
1027
- const secondCallEvents = [
1028
- { type: GeminiEventType.Content, value: 'file.txt' },
1029
- {
1030
- type: GeminiEventType.Finished,
1031
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1032
- },
1033
- ];
1034
- mockGeminiClient.sendMessageStream
1035
- .mockReturnValueOnce(createStreamFromEvents(firstCallEvents))
1036
- .mockReturnValueOnce(createStreamFromEvents(secondCallEvents));
1037
- await runNonInteractive({
1038
- config: mockConfig,
1039
- settings: mockSettings,
1040
- input: 'List the files',
1041
- prompt_id: 'prompt-id-allowed',
1042
- });
1043
- expect(mockSchedulerSchedule).toHaveBeenCalledWith([expect.objectContaining({ name: 'ShellTool' })], expect.any(AbortSignal));
1044
- expect(getWrittenOutput()).toBe('file.txt\n');
1045
- });
1046
- describe('CoreEvents Integration', () => {
1047
- it('subscribes to UserFeedback and drains backlog on start', async () => {
1048
- const events = [
1049
- {
1050
- type: GeminiEventType.Finished,
1051
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1052
- },
1053
- ];
1054
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1055
- await runNonInteractive({
1056
- config: mockConfig,
1057
- settings: mockSettings,
1058
- input: 'test',
1059
- prompt_id: 'prompt-id-events',
1060
- });
1061
- expect(mockCoreEvents.on).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
1062
- expect(mockCoreEvents.drainBacklogs).toHaveBeenCalledTimes(1);
1063
- });
1064
- it('unsubscribes from UserFeedback on finish', async () => {
1065
- const events = [
1066
- {
1067
- type: GeminiEventType.Finished,
1068
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1069
- },
1070
- ];
1071
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1072
- await runNonInteractive({
1073
- config: mockConfig,
1074
- settings: mockSettings,
1075
- input: 'test',
1076
- prompt_id: 'prompt-id-events',
1077
- });
1078
- expect(mockCoreEvents.off).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
1079
- });
1080
- it('logs to process.stderr when UserFeedback event is received', async () => {
1081
- const events = [
1082
- {
1083
- type: GeminiEventType.Finished,
1084
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1085
- },
1086
- ];
1087
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1088
- await runNonInteractive({
1089
- config: mockConfig,
1090
- settings: mockSettings,
1091
- input: 'test',
1092
- prompt_id: 'prompt-id-events',
1093
- });
1094
- // Get the registered handler
1095
- const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.UserFeedback)?.[1];
1096
- expect(handler).toBeDefined();
1097
- // Simulate an event
1098
- const payload = {
1099
- severity: 'error',
1100
- message: 'Test error message',
1101
- };
1102
- handler(payload);
1103
- expect(processStderrSpy).toHaveBeenCalledWith('[ERROR] Test error message\n');
1104
- });
1105
- it('logs optional error object to process.stderr in debug mode', async () => {
1106
- vi.mocked(mockConfig.getDebugMode).mockReturnValue(true);
1107
- const events = [
1108
- {
1109
- type: GeminiEventType.Finished,
1110
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1111
- },
1112
- ];
1113
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1114
- await runNonInteractive({
1115
- config: mockConfig,
1116
- settings: mockSettings,
1117
- input: 'test',
1118
- prompt_id: 'prompt-id-events',
1119
- });
1120
- // Get the registered handler
1121
- const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.UserFeedback)?.[1];
1122
- expect(handler).toBeDefined();
1123
- // Simulate an event with error object
1124
- const errorObj = new Error('Original error');
1125
- // Mock stack for deterministic testing
1126
- errorObj.stack = 'Error: Original error\n at test';
1127
- const payload = {
1128
- severity: 'warning',
1129
- message: 'Test warning message',
1130
- error: errorObj,
1131
- };
1132
- handler(payload);
1133
- expect(processStderrSpy).toHaveBeenCalledWith('[WARNING] Test warning message\n');
1134
- expect(processStderrSpy).toHaveBeenCalledWith('Error: Original error\n at test\n');
1135
- });
1136
- });
1137
- it('should emit appropriate events for streaming JSON output', async () => {
1138
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
1139
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1140
- const toolCallEvent = {
1141
- type: GeminiEventType.ToolCallRequest,
1142
- value: {
1143
- callId: 'tool-1',
1144
- name: 'testTool',
1145
- args: { arg1: 'value1' },
1146
- isClientInitiated: false,
1147
- prompt_id: 'prompt-id-stream',
1148
- },
1149
- };
1150
- mockSchedulerSchedule.mockResolvedValue([
1151
- {
1152
- status: CoreToolCallStatus.Success,
1153
- request: toolCallEvent.value,
1154
- tool: {},
1155
- invocation: {},
1156
- response: {
1157
- responseParts: [{ text: 'Tool response' }],
1158
- callId: 'tool-1',
1159
- error: undefined,
1160
- errorType: undefined,
1161
- contentLength: undefined,
1162
- resultDisplay: 'Tool executed successfully',
1163
- },
1164
- },
1165
- ]);
1166
- const firstCallEvents = [
1167
- { type: GeminiEventType.Content, value: 'Thinking...' },
1168
- toolCallEvent,
1169
- ];
1170
- const secondCallEvents = [
1171
- { type: GeminiEventType.Content, value: 'Final answer' },
1172
- {
1173
- type: GeminiEventType.Finished,
1174
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1175
- },
1176
- ];
1177
- mockGeminiClient.sendMessageStream
1178
- .mockReturnValueOnce(createStreamFromEvents(firstCallEvents))
1179
- .mockReturnValueOnce(createStreamFromEvents(secondCallEvents));
1180
- await runNonInteractive({
1181
- config: mockConfig,
1182
- settings: mockSettings,
1183
- input: 'Stream test',
1184
- prompt_id: 'prompt-id-stream',
1185
- });
1186
- const output = getWrittenOutput();
1187
- const sanitizedOutput = output
1188
- .replace(/"timestamp":"[^"]+"/g, '"timestamp":"<TIMESTAMP>"')
1189
- .replace(/"duration_ms":\d+/g, '"duration_ms":<DURATION>');
1190
- expect(sanitizedOutput).toMatchSnapshot();
1191
- });
1192
- it('should handle EPIPE error gracefully', async () => {
1193
- const events = [
1194
- { type: GeminiEventType.Content, value: 'Hello' },
1195
- { type: GeminiEventType.Content, value: ' World' },
1196
- ];
1197
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1198
- // Mock process.exit to track calls without throwing
1199
- vi.spyOn(process, 'exit').mockImplementation((_code) => undefined);
1200
- // Simulate EPIPE error on stdout
1201
- const stdoutErrorCallback = process.stdout.on.mock.calls.find((call) => call[0] === 'error')?.[1];
1202
- if (stdoutErrorCallback) {
1203
- stdoutErrorCallback({ code: 'EPIPE' });
1204
- }
1205
- await runNonInteractive({
1206
- config: mockConfig,
1207
- settings: mockSettings,
1208
- input: 'EPIPE test',
1209
- prompt_id: 'prompt-id-epipe',
1210
- });
1211
- // Since EPIPE is simulated, it might exit early or continue depending on timing,
1212
- // but our main goal is to verify the handler is registered and handles EPIPE.
1213
- expect(process.stdout.on).toHaveBeenCalledWith('error', expect.any(Function));
1214
- });
1215
- it('should resume chat when resumedSessionData is provided', async () => {
1216
- const events = [
1217
- { type: GeminiEventType.Content, value: 'Resumed' },
1218
- {
1219
- type: GeminiEventType.Finished,
1220
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
1221
- },
1222
- ];
1223
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1224
- const resumedSessionData = {
1225
- conversation: {
1226
- sessionId: 'resumed-session-id',
1227
- messages: [
1228
- { role: 'user', parts: [{ text: 'Previous message' }] },
1229
- ], // eslint-disable-line @typescript-eslint/no-explicit-any
1230
- startTime: new Date().toISOString(),
1231
- lastUpdated: new Date().toISOString(),
1232
- firstUserMessage: 'Previous message',
1233
- projectHash: 'test-hash',
1234
- },
1235
- filePath: '/path/to/session.json',
1236
- };
1237
- await runNonInteractive({
1238
- config: mockConfig,
1239
- settings: mockSettings,
1240
- input: 'Continue',
1241
- prompt_id: 'prompt-id-resume',
1242
- resumedSessionData,
1243
- });
1244
- expect(mockGeminiClient.resumeChat).toHaveBeenCalledWith(expect.any(Array), resumedSessionData);
1245
- expect(getWrittenOutput()).toBe('Resumed\n');
1246
- });
1247
- it.each([
1248
- {
1249
- name: 'loop detected',
1250
- events: [
1251
- { type: GeminiEventType.LoopDetected },
1252
- ],
1253
- input: 'Loop test',
1254
- promptId: 'prompt-id-loop',
1255
- },
1256
- {
1257
- name: 'max session turns',
1258
- events: [
1259
- { type: GeminiEventType.MaxSessionTurns },
1260
- ],
1261
- input: 'Max turns test',
1262
- promptId: 'prompt-id-max-turns',
1263
- },
1264
- ])('should emit appropriate error event in streaming JSON mode: $name', async ({ events, input, promptId }) => {
1265
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
1266
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1267
- const streamEvents = [
1268
- ...events,
1269
- {
1270
- type: GeminiEventType.Finished,
1271
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1272
- },
1273
- ];
1274
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(streamEvents));
1275
- try {
1276
- await runNonInteractive({
1277
- config: mockConfig,
1278
- settings: mockSettings,
1279
- input,
1280
- prompt_id: promptId,
1281
- });
1282
- }
1283
- catch {
1284
- // Expected exit
1285
- }
1286
- const output = getWrittenOutput();
1287
- const sanitizedOutput = output
1288
- .replace(/"timestamp":"[^"]+"/g, '"timestamp":"<TIMESTAMP>"')
1289
- .replace(/"duration_ms":\d+/g, '"duration_ms":<DURATION>');
1290
- expect(sanitizedOutput).toMatchSnapshot();
1291
- });
1292
- it.each([
1293
- {
1294
- name: 'loop detected',
1295
- events: [
1296
- { type: GeminiEventType.LoopDetected },
1297
- ],
1298
- expectedWarning: 'Loop detected, stopping execution',
1299
- },
1300
- {
1301
- name: 'max session turns',
1302
- events: [
1303
- { type: GeminiEventType.MaxSessionTurns },
1304
- ],
1305
- expectedWarning: 'Maximum session turns exceeded',
1306
- },
1307
- ])('should include warning in JSON mode for: $name', async ({ events, expectedWarning }) => {
1308
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
1309
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1310
- const streamEvents = [
1311
- ...events,
1312
- {
1313
- type: GeminiEventType.Finished,
1314
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1315
- },
1316
- ];
1317
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(streamEvents));
1318
- await runNonInteractive({
1319
- config: mockConfig,
1320
- settings: mockSettings,
1321
- input: 'test',
1322
- prompt_id: 'test',
1323
- });
1324
- const output = JSON.parse(getWrittenOutput());
1325
- expect(output.warnings).toBeDefined();
1326
- expect(output.warnings).toContain(expectedWarning);
1327
- });
1328
- it('should log error when tool recording fails', async () => {
1329
- const toolCallEvent = {
1330
- type: GeminiEventType.ToolCallRequest,
1331
- value: {
1332
- callId: 'tool-1',
1333
- name: 'testTool',
1334
- args: {},
1335
- isClientInitiated: false,
1336
- prompt_id: 'prompt-id-tool-error',
1337
- },
1338
- };
1339
- mockSchedulerSchedule.mockResolvedValue([
1340
- {
1341
- status: CoreToolCallStatus.Success,
1342
- request: toolCallEvent.value,
1343
- tool: {},
1344
- invocation: {},
1345
- response: {
1346
- responseParts: [],
1347
- callId: 'tool-1',
1348
- error: undefined,
1349
- errorType: undefined,
1350
- contentLength: undefined,
1351
- },
1352
- },
1353
- ]);
1354
- const events = [
1355
- toolCallEvent,
1356
- { type: GeminiEventType.Content, value: 'Done' },
1357
- {
1358
- type: GeminiEventType.Finished,
1359
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
1360
- },
1361
- ];
1362
- mockGeminiClient.sendMessageStream
1363
- .mockReturnValueOnce(createStreamFromEvents(events))
1364
- .mockReturnValueOnce(createStreamFromEvents([
1365
- { type: GeminiEventType.Content, value: 'Done' },
1366
- {
1367
- type: GeminiEventType.Finished,
1368
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
1369
- },
1370
- ]));
1371
- // Mock getChat to throw when recording tool calls
1372
- const mockChat = {
1373
- recordCompletedToolCalls: vi.fn().mockImplementation(() => {
1374
- throw new Error('Recording failed');
1375
- }),
1376
- };
1377
- // @ts-expect-error - Mocking internal structure
1378
- mockGeminiClient.getChat = vi.fn().mockReturnValue(mockChat);
1379
- // @ts-expect-error - Mocking internal structure
1380
- mockGeminiClient.getCurrentSequenceModel = vi
1381
- .fn()
1382
- .mockReturnValue('model-1');
1383
- // Mock debugLogger.error
1384
- const { debugLogger } = await import('@google/gemini-cli-core');
1385
- const debugLoggerErrorSpy = vi
1386
- .spyOn(debugLogger, 'error')
1387
- .mockImplementation(() => { });
1388
- await runNonInteractive({
1389
- config: mockConfig,
1390
- settings: mockSettings,
1391
- input: 'Tool recording error test',
1392
- prompt_id: 'prompt-id-tool-error',
1393
- });
1394
- expect(debugLoggerErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Error recording completed tool call information: Error: Recording failed'));
1395
- expect(getWrittenOutput()).toContain('Done');
1396
- });
1397
- it('should stop agent execution immediately when a tool call returns STOP_EXECUTION error', async () => {
1398
- const toolCallEvent = {
1399
- type: GeminiEventType.ToolCallRequest,
1400
- value: {
1401
- callId: 'stop-call',
1402
- name: 'stopTool',
1403
- args: {},
1404
- isClientInitiated: false,
1405
- prompt_id: 'prompt-id-stop',
1406
- },
1407
- };
1408
- // Mock tool execution returning STOP_EXECUTION
1409
- mockSchedulerSchedule.mockResolvedValue([
1410
- {
1411
- status: CoreToolCallStatus.Error,
1412
- request: toolCallEvent.value,
1413
- tool: {},
1414
- invocation: {},
1415
- response: {
1416
- callId: 'stop-call',
1417
- responseParts: [{ text: 'error occurred' }],
1418
- errorType: ToolErrorType.STOP_EXECUTION,
1419
- error: new Error('Stop reason from hook'),
1420
- resultDisplay: undefined,
1421
- },
1422
- },
1423
- ]);
1424
- const firstCallEvents = [
1425
- { type: GeminiEventType.Content, value: 'Executing tool...' },
1426
- toolCallEvent,
1427
- ];
1428
- // Setup the mock to return events for the first call.
1429
- // We expect the loop to terminate after the tool execution.
1430
- // If it doesn't, it might call sendMessageStream again, which we'll assert against.
1431
- mockGeminiClient.sendMessageStream
1432
- .mockReturnValueOnce(createStreamFromEvents(firstCallEvents))
1433
- .mockReturnValueOnce(createStreamFromEvents([]));
1434
- await runNonInteractive({
1435
- config: mockConfig,
1436
- settings: mockSettings,
1437
- input: 'Run stop tool',
1438
- prompt_id: 'prompt-id-stop',
1439
- });
1440
- expect(mockSchedulerSchedule).toHaveBeenCalled();
1441
- // The key assertion: sendMessageStream should have been called ONLY ONCE (initial user input).
1442
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
1443
- expect(processStderrSpy).toHaveBeenCalledWith('Agent execution stopped: Stop reason from hook\n');
1444
- });
1445
- it('should write JSON output when a tool call returns STOP_EXECUTION error', async () => {
1446
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
1447
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1448
- const toolCallEvent = {
1449
- type: GeminiEventType.ToolCallRequest,
1450
- value: {
1451
- callId: 'stop-call',
1452
- name: 'stopTool',
1453
- args: {},
1454
- isClientInitiated: false,
1455
- prompt_id: 'prompt-id-stop-json',
1456
- },
1457
- };
1458
- mockSchedulerSchedule.mockResolvedValue([
1459
- {
1460
- status: CoreToolCallStatus.Error,
1461
- request: toolCallEvent.value,
1462
- tool: {},
1463
- invocation: {},
1464
- response: {
1465
- callId: 'stop-call',
1466
- responseParts: [{ text: 'error occurred' }],
1467
- errorType: ToolErrorType.STOP_EXECUTION,
1468
- error: new Error('Stop reason'),
1469
- resultDisplay: undefined,
1470
- },
1471
- },
1472
- ]);
1473
- const firstCallEvents = [
1474
- { type: GeminiEventType.Content, value: 'Partial content' },
1475
- toolCallEvent,
1476
- ];
1477
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(firstCallEvents));
1478
- await runNonInteractive({
1479
- config: mockConfig,
1480
- settings: mockSettings,
1481
- input: 'Run stop tool',
1482
- prompt_id: 'prompt-id-stop-json',
1483
- });
1484
- expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
1485
- session_id: 'test-session-id',
1486
- response: 'Partial content',
1487
- stats: MOCK_SESSION_METRICS,
1488
- }, null, 2));
1489
- });
1490
- it('should emit result event when a tool call returns STOP_EXECUTION error in streaming JSON mode', async () => {
1491
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
1492
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1493
- const toolCallEvent = {
1494
- type: GeminiEventType.ToolCallRequest,
1495
- value: {
1496
- callId: 'stop-call',
1497
- name: 'stopTool',
1498
- args: {},
1499
- isClientInitiated: false,
1500
- prompt_id: 'prompt-id-stop-stream',
1501
- },
1502
- };
1503
- mockSchedulerSchedule.mockResolvedValue([
1504
- {
1505
- status: CoreToolCallStatus.Error,
1506
- request: toolCallEvent.value,
1507
- tool: {},
1508
- invocation: {},
1509
- response: {
1510
- callId: 'stop-call',
1511
- responseParts: [{ text: 'error occurred' }],
1512
- errorType: ToolErrorType.STOP_EXECUTION,
1513
- error: new Error('Stop reason'),
1514
- resultDisplay: undefined,
1515
- },
1516
- },
1517
- ]);
1518
- const firstCallEvents = [toolCallEvent];
1519
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(firstCallEvents));
1520
- await runNonInteractive({
1521
- config: mockConfig,
1522
- settings: mockSettings,
1523
- input: 'Run stop tool',
1524
- prompt_id: 'prompt-id-stop-stream',
1525
- });
1526
- const output = getWrittenOutput();
1527
- expect(output).toContain('"type":"result"');
1528
- expect(output).toContain('"status":"success"');
1529
- });
1530
- describe('Agent Execution Events', () => {
1531
- it('should handle AgentExecutionStopped event', async () => {
1532
- const events = [
1533
- {
1534
- type: GeminiEventType.AgentExecutionStopped,
1535
- value: { reason: 'Stopped by hook' },
1536
- },
1537
- ];
1538
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1539
- await runNonInteractive({
1540
- config: mockConfig,
1541
- settings: mockSettings,
1542
- input: 'test stop',
1543
- prompt_id: 'prompt-id-stop',
1544
- });
1545
- expect(processStderrSpy).toHaveBeenCalledWith('Agent execution stopped: Stopped by hook\n');
1546
- // Should exit without calling sendMessageStream again
1547
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
1548
- });
1549
- it('should write JSON output when AgentExecutionStopped event occurs', async () => {
1550
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
1551
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1552
- const events = [
1553
- { type: GeminiEventType.Content, value: 'Partial content' },
1554
- {
1555
- type: GeminiEventType.AgentExecutionStopped,
1556
- value: { reason: 'Stopped by hook' },
1557
- },
1558
- ];
1559
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1560
- await runNonInteractive({
1561
- config: mockConfig,
1562
- settings: mockSettings,
1563
- input: 'test stop',
1564
- prompt_id: 'prompt-id-stop-json',
1565
- });
1566
- expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
1567
- session_id: 'test-session-id',
1568
- response: 'Partial content',
1569
- stats: MOCK_SESSION_METRICS,
1570
- warnings: ['Agent execution stopped: Stopped by hook'],
1571
- }, null, 2));
1572
- });
1573
- it('should emit result event when AgentExecutionStopped event occurs in streaming JSON mode', async () => {
1574
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
1575
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1576
- const events = [
1577
- { type: GeminiEventType.Content, value: 'Partial content' },
1578
- {
1579
- type: GeminiEventType.AgentExecutionStopped,
1580
- value: { reason: 'Stopped by hook' },
1581
- },
1582
- ];
1583
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1584
- await runNonInteractive({
1585
- config: mockConfig,
1586
- settings: mockSettings,
1587
- input: 'test stop',
1588
- prompt_id: 'prompt-id-stop-stream',
1589
- });
1590
- const output = getWrittenOutput();
1591
- expect(output).toContain('"type":"result"');
1592
- expect(output).toContain('"status":"success"');
1593
- });
1594
- it('should handle AgentExecutionBlocked event', async () => {
1595
- const allEvents = [
1596
- {
1597
- type: GeminiEventType.AgentExecutionBlocked,
1598
- value: { reason: 'Blocked by hook' },
1599
- },
1600
- { type: GeminiEventType.Content, value: 'Final answer' },
1601
- {
1602
- type: GeminiEventType.Finished,
1603
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1604
- },
1605
- ];
1606
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(allEvents));
1607
- await runNonInteractive({
1608
- config: mockConfig,
1609
- settings: mockSettings,
1610
- input: 'test block',
1611
- prompt_id: 'prompt-id-block',
1612
- });
1613
- expect(processStderrSpy).toHaveBeenCalledWith('[WARNING] Agent execution blocked: Blocked by hook\n');
1614
- // sendMessageStream is called once, recursion is internal to it and transparent to the caller
1615
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
1616
- expect(getWrittenOutput()).toBe('Final answer\n');
1617
- });
1618
- it('should emit ERROR event in STREAM_JSON mode when AgentExecutionBlocked occurs', async () => {
1619
- const allEvents = [
1620
- {
1621
- type: GeminiEventType.AgentExecutionBlocked,
1622
- value: { reason: 'Blocked by hook' },
1623
- },
1624
- { type: GeminiEventType.Content, value: 'Final answer' },
1625
- {
1626
- type: GeminiEventType.Finished,
1627
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1628
- },
1629
- ];
1630
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(allEvents));
1631
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1632
- // Setup stream-json format
1633
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
1634
- await runNonInteractive({
1635
- config: mockConfig,
1636
- settings: mockSettings,
1637
- input: 'test block',
1638
- prompt_id: 'prompt-id-block',
1639
- });
1640
- const calls = processStdoutSpy.mock.calls.map((call) => JSON.parse(call[0]));
1641
- const errorEvent = calls.find((c) => c.type === JsonStreamEventType.ERROR);
1642
- expect(errorEvent).toBeDefined();
1643
- expect(errorEvent.message).toContain('Agent execution blocked: Blocked by hook');
1644
- expect(errorEvent.severity).toBe('warning');
1645
- });
1646
- it('should include warning in JSON mode when AgentExecutionBlocked occurs', async () => {
1647
- const allEvents = [
1648
- {
1649
- type: GeminiEventType.AgentExecutionBlocked,
1650
- value: { reason: 'Blocked by hook' },
1651
- },
1652
- { type: GeminiEventType.Content, value: 'Final answer' },
1653
- {
1654
- type: GeminiEventType.Finished,
1655
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1656
- },
1657
- ];
1658
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(allEvents));
1659
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
1660
- await runNonInteractive({
1661
- config: mockConfig,
1662
- settings: mockSettings,
1663
- input: 'test block',
1664
- prompt_id: 'prompt-id-block',
1665
- });
1666
- const output = JSON.parse(getWrittenOutput());
1667
- expect(output.warnings).toBeDefined();
1668
- expect(output.warnings).toContain('Agent execution blocked: Blocked by hook');
1669
- });
1670
- it('should handle multiple AgentExecutionBlocked events and collect all warnings', async () => {
1671
- const allEvents = [
1672
- {
1673
- type: GeminiEventType.AgentExecutionBlocked,
1674
- value: { reason: 'Block 1', systemMessage: 'Reason 1' },
1675
- },
1676
- {
1677
- type: GeminiEventType.AgentExecutionBlocked,
1678
- value: { reason: 'Block 2', systemMessage: 'Reason 2' },
1679
- },
1680
- { type: GeminiEventType.Content, value: 'Final answer' },
1681
- {
1682
- type: GeminiEventType.Finished,
1683
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1684
- },
1685
- ];
1686
- mockGeminiClient.sendMessageStream.mockImplementation(() => createStreamFromEvents(allEvents));
1687
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1688
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
1689
- await runNonInteractive({
1690
- config: mockConfig,
1691
- settings: mockSettings,
1692
- input: 'test',
1693
- prompt_id: 'test',
1694
- });
1695
- const output = JSON.parse(getWrittenOutput());
1696
- expect(output.warnings).toHaveLength(2);
1697
- expect(output.warnings).toContain('Agent execution blocked: Reason 1');
1698
- expect(output.warnings).toContain('Agent execution blocked: Reason 2');
1699
- });
1700
- it('should not include warnings field in JSON output if no blocks occur', async () => {
1701
- const allEvents = [
1702
- { type: GeminiEventType.Content, value: 'Clean answer' },
1703
- {
1704
- type: GeminiEventType.Finished,
1705
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1706
- },
1707
- ];
1708
- mockGeminiClient.sendMessageStream.mockImplementation(() => createStreamFromEvents(allEvents));
1709
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1710
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
1711
- await runNonInteractive({
1712
- config: mockConfig,
1713
- settings: mockSettings,
1714
- input: 'test',
1715
- prompt_id: 'test',
1716
- });
1717
- const output = JSON.parse(getWrittenOutput());
1718
- expect(output.warnings).toBeUndefined();
1719
- });
1720
- it('should handle InvalidStream event gracefully in TEXT mode', async () => {
1721
- const events = [
1722
- { type: GeminiEventType.InvalidStream },
1723
- ];
1724
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1725
- await runNonInteractive({
1726
- config: mockConfig,
1727
- settings: mockSettings,
1728
- input: 'test invalid stream',
1729
- prompt_id: 'prompt-id-invalid',
1730
- });
1731
- expect(processStderrSpy).toHaveBeenCalledWith('[ERROR] Invalid stream: The model returned an empty response or malformed tool call.\n');
1732
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
1733
- });
1734
- it('should handle InvalidStream event gracefully in STREAM_JSON mode', async () => {
1735
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1736
- vi.spyOn(mockConfig, 'getOutputFormat').mockReturnValue(OutputFormat.STREAM_JSON);
1737
- const events = [
1738
- { type: GeminiEventType.InvalidStream },
1739
- ];
1740
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1741
- await runNonInteractive({
1742
- config: mockConfig,
1743
- settings: mockSettings,
1744
- input: 'test invalid stream',
1745
- prompt_id: 'prompt-id-invalid',
1746
- });
1747
- const output = getWrittenOutput();
1748
- expect(output).toContain('"type":"error"');
1749
- expect(output).toContain('"severity":"error"');
1750
- expect(output).toContain('Invalid stream: The model returned an empty response or malformed tool call.');
1751
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
1752
- });
1753
- it('should handle InvalidStream event gracefully in JSON mode', async () => {
1754
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1755
- vi.spyOn(mockConfig, 'getOutputFormat').mockReturnValue(OutputFormat.JSON);
1756
- const events = [
1757
- { type: GeminiEventType.InvalidStream },
1758
- ];
1759
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1760
- await runNonInteractive({
1761
- config: mockConfig,
1762
- settings: mockSettings,
1763
- input: 'test invalid stream',
1764
- prompt_id: 'prompt-id-invalid',
1765
- });
1766
- const output = getWrittenOutput();
1767
- expect(output).toContain('"error": {');
1768
- expect(output).toContain('"type": "INVALID_STREAM"');
1769
- expect(output).toContain('Invalid stream: The model returned an empty response or malformed tool call.');
1770
- expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
1771
- });
1772
- });
1773
- describe('Output Sanitization', () => {
1774
- const ANSI_SEQUENCE = '\u001B[31mRed Text\u001B[0m';
1775
- const OSC_HYPERLINK = '\u001B]8;;http://example.com\u001B\\Link\u001B]8;;\u001B\\';
1776
- const PLAIN_TEXT_RED = 'Red Text';
1777
- const PLAIN_TEXT_LINK = 'Link';
1778
- it('should sanitize ANSI output by default', async () => {
1779
- const events = [
1780
- { type: GeminiEventType.Content, value: ANSI_SEQUENCE },
1781
- { type: GeminiEventType.Content, value: ' ' },
1782
- { type: GeminiEventType.Content, value: OSC_HYPERLINK },
1783
- {
1784
- type: GeminiEventType.Finished,
1785
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1786
- },
1787
- ];
1788
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1789
- vi.mocked(mockConfig.getRawOutput).mockReturnValue(false);
1790
- await runNonInteractive({
1791
- config: mockConfig,
1792
- settings: mockSettings,
1793
- input: 'Test input',
1794
- prompt_id: 'prompt-id-sanitization',
1795
- });
1796
- expect(getWrittenOutput()).toBe(`${PLAIN_TEXT_RED} ${PLAIN_TEXT_LINK}\n`);
1797
- });
1798
- it('should allow ANSI output when rawOutput is true', async () => {
1799
- const events = [
1800
- { type: GeminiEventType.Content, value: ANSI_SEQUENCE },
1801
- { type: GeminiEventType.Content, value: ' ' },
1802
- { type: GeminiEventType.Content, value: OSC_HYPERLINK },
1803
- {
1804
- type: GeminiEventType.Finished,
1805
- value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
1806
- },
1807
- ];
1808
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1809
- vi.mocked(mockConfig.getRawOutput).mockReturnValue(true);
1810
- vi.mocked(mockConfig.getAcceptRawOutputRisk).mockReturnValue(true);
1811
- await runNonInteractive({
1812
- config: mockConfig,
1813
- settings: mockSettings,
1814
- input: 'Test input',
1815
- prompt_id: 'prompt-id-raw',
1816
- });
1817
- expect(getWrittenOutput()).toBe(`${ANSI_SEQUENCE} ${OSC_HYPERLINK}\n`);
1818
- });
1819
- it('should allow ANSI output when only acceptRawOutputRisk is true', async () => {
1820
- const events = [
1821
- { type: GeminiEventType.Content, value: ANSI_SEQUENCE },
1822
- {
1823
- type: GeminiEventType.Finished,
1824
- value: { reason: undefined, usageMetadata: { totalTokenCount: 5 } },
1825
- },
1826
- ];
1827
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1828
- vi.mocked(mockConfig.getRawOutput).mockReturnValue(false);
1829
- vi.mocked(mockConfig.getAcceptRawOutputRisk).mockReturnValue(true);
1830
- await runNonInteractive({
1831
- config: mockConfig,
1832
- settings: mockSettings,
1833
- input: 'Test input',
1834
- prompt_id: 'prompt-id-accept-only',
1835
- });
1836
- expect(getWrittenOutput()).toBe(`${ANSI_SEQUENCE}\n`);
1837
- });
1838
- it('should warn when rawOutput is true and acceptRisk is false', async () => {
1839
- const events = [
1840
- {
1841
- type: GeminiEventType.Finished,
1842
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1843
- },
1844
- ];
1845
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1846
- vi.mocked(mockConfig.getRawOutput).mockReturnValue(true);
1847
- vi.mocked(mockConfig.getAcceptRawOutputRisk).mockReturnValue(false);
1848
- await runNonInteractive({
1849
- config: mockConfig,
1850
- settings: mockSettings,
1851
- input: 'Test input',
1852
- prompt_id: 'prompt-id-warn',
1853
- });
1854
- expect(processStderrSpy).toHaveBeenCalledWith(expect.stringContaining('[WARNING] --raw-output is enabled'));
1855
- });
1856
- it('should not warn when rawOutput is true and acceptRisk is true', async () => {
1857
- const events = [
1858
- {
1859
- type: GeminiEventType.Finished,
1860
- value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
1861
- },
1862
- ];
1863
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1864
- vi.mocked(mockConfig.getRawOutput).mockReturnValue(true);
1865
- vi.mocked(mockConfig.getAcceptRawOutputRisk).mockReturnValue(true);
1866
- await runNonInteractive({
1867
- config: mockConfig,
1868
- settings: mockSettings,
1869
- input: 'Test input',
1870
- prompt_id: 'prompt-id-no-warn',
1871
- });
1872
- expect(processStderrSpy).not.toHaveBeenCalledWith(expect.stringContaining('[WARNING] --raw-output is enabled'));
1873
- });
1874
- it('should report cancelled tool calls as success in stream-json mode (legacy parity)', async () => {
1875
- const toolCallEvent = {
1876
- type: GeminiEventType.ToolCallRequest,
1877
- value: {
1878
- callId: 'tool-1',
1879
- name: 'testTool',
1880
- args: { arg1: 'value1' },
1881
- isClientInitiated: false,
1882
- prompt_id: 'prompt-id-cancel',
1883
- },
1884
- };
1885
- // Mock the scheduler to return a cancelled status
1886
- mockSchedulerSchedule.mockResolvedValue([
1887
- {
1888
- status: CoreToolCallStatus.Cancelled,
1889
- request: toolCallEvent.value,
1890
- tool: {},
1891
- invocation: {},
1892
- response: {
1893
- callId: 'tool-1',
1894
- responseParts: [{ text: 'Operation cancelled' }],
1895
- resultDisplay: 'Cancelled',
1896
- },
1897
- },
1898
- ]);
1899
- const events = [
1900
- toolCallEvent,
1901
- {
1902
- type: GeminiEventType.Content,
1903
- value: 'Model continues...',
1904
- },
1905
- ];
1906
- mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
1907
- vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
1908
- vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
1909
- await runNonInteractive({
1910
- config: mockConfig,
1911
- settings: mockSettings,
1912
- input: 'Test input',
1913
- prompt_id: 'prompt-id-cancel',
1914
- });
1915
- const output = getWrittenOutput();
1916
- expect(output).toContain('"type":"tool_result"');
1917
- expect(output).toContain('"status":"success"');
1918
- });
1919
- });
1920
- });
1921
- //# sourceMappingURL=nonInteractiveCli.test.js.map