osagent-cli 0.1.12

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 (1545) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +29 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/package.json +102 -0
  6. package/dist/src/commands/doctor.d.ts +7 -0
  7. package/dist/src/commands/doctor.js +171 -0
  8. package/dist/src/commands/doctor.js.map +1 -0
  9. package/dist/src/commands/extensions/disable.d.ts +13 -0
  10. package/dist/src/commands/extensions/disable.js +56 -0
  11. package/dist/src/commands/extensions/disable.js.map +1 -0
  12. package/dist/src/commands/extensions/enable.d.ts +13 -0
  13. package/dist/src/commands/extensions/enable.js +59 -0
  14. package/dist/src/commands/extensions/enable.js.map +1 -0
  15. package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
  16. package/dist/src/commands/extensions/examples/context/qwen-extension.json +4 -0
  17. package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
  18. package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +4 -0
  19. package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +5 -0
  20. package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
  21. package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
  22. package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +11 -0
  23. package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
  24. package/dist/src/commands/extensions/install.d.ts +14 -0
  25. package/dist/src/commands/extensions/install.js +78 -0
  26. package/dist/src/commands/extensions/install.js.map +1 -0
  27. package/dist/src/commands/extensions/install.test.d.ts +6 -0
  28. package/dist/src/commands/extensions/install.test.js +102 -0
  29. package/dist/src/commands/extensions/install.test.js.map +1 -0
  30. package/dist/src/commands/extensions/link.d.ts +12 -0
  31. package/dist/src/commands/extensions/link.js +37 -0
  32. package/dist/src/commands/extensions/link.js.map +1 -0
  33. package/dist/src/commands/extensions/list.d.ts +8 -0
  34. package/dist/src/commands/extensions/list.js +32 -0
  35. package/dist/src/commands/extensions/list.js.map +1 -0
  36. package/dist/src/commands/extensions/new.d.ts +7 -0
  37. package/dist/src/commands/extensions/new.js +90 -0
  38. package/dist/src/commands/extensions/new.js.map +1 -0
  39. package/dist/src/commands/extensions/new.test.d.ts +6 -0
  40. package/dist/src/commands/extensions/new.test.js +59 -0
  41. package/dist/src/commands/extensions/new.test.js.map +1 -0
  42. package/dist/src/commands/extensions/uninstall.d.ts +12 -0
  43. package/dist/src/commands/extensions/uninstall.js +38 -0
  44. package/dist/src/commands/extensions/uninstall.js.map +1 -0
  45. package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
  46. package/dist/src/commands/extensions/uninstall.test.js +18 -0
  47. package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
  48. package/dist/src/commands/extensions/update.d.ts +13 -0
  49. package/dist/src/commands/extensions/update.js +104 -0
  50. package/dist/src/commands/extensions/update.js.map +1 -0
  51. package/dist/src/commands/extensions.d.ts +2 -0
  52. package/dist/src/commands/extensions.js +28 -0
  53. package/dist/src/commands/extensions.js.map +1 -0
  54. package/dist/src/commands/mcp/add.d.ts +7 -0
  55. package/dist/src/commands/mcp/add.js +171 -0
  56. package/dist/src/commands/mcp/add.js.map +1 -0
  57. package/dist/src/commands/mcp/list.d.ts +8 -0
  58. package/dist/src/commands/mcp/list.js +111 -0
  59. package/dist/src/commands/mcp/list.js.map +1 -0
  60. package/dist/src/commands/mcp/remove.d.ts +7 -0
  61. package/dist/src/commands/mcp/remove.js +44 -0
  62. package/dist/src/commands/mcp/remove.js.map +1 -0
  63. package/dist/src/commands/mcp.d.ts +7 -0
  64. package/dist/src/commands/mcp.js +23 -0
  65. package/dist/src/commands/mcp.js.map +1 -0
  66. package/dist/src/config/auth.d.ts +7 -0
  67. package/dist/src/config/auth.js +46 -0
  68. package/dist/src/config/auth.js.map +1 -0
  69. package/dist/src/config/auth.test.d.ts +6 -0
  70. package/dist/src/config/auth.test.js +37 -0
  71. package/dist/src/config/auth.test.js.map +1 -0
  72. package/dist/src/config/config.d.ts +58 -0
  73. package/dist/src/config/config.js +678 -0
  74. package/dist/src/config/config.js.map +1 -0
  75. package/dist/src/config/extension.d.ts +83 -0
  76. package/dist/src/config/extension.js +534 -0
  77. package/dist/src/config/extension.js.map +1 -0
  78. package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
  79. package/dist/src/config/extensions/extensionEnablement.js +189 -0
  80. package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
  81. package/dist/src/config/extensions/extensionEnablement.test.d.ts +6 -0
  82. package/dist/src/config/extensions/extensionEnablement.test.js +333 -0
  83. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
  84. package/dist/src/config/extensions/github.d.ts +30 -0
  85. package/dist/src/config/extensions/github.js +322 -0
  86. package/dist/src/config/extensions/github.js.map +1 -0
  87. package/dist/src/config/extensions/github.test.d.ts +6 -0
  88. package/dist/src/config/extensions/github.test.js +334 -0
  89. package/dist/src/config/extensions/github.test.js.map +1 -0
  90. package/dist/src/config/extensions/update.d.ts +19 -0
  91. package/dist/src/config/extensions/update.js +113 -0
  92. package/dist/src/config/extensions/update.js.map +1 -0
  93. package/dist/src/config/extensions/update.test.d.ts +6 -0
  94. package/dist/src/config/extensions/update.test.js +342 -0
  95. package/dist/src/config/extensions/update.test.js.map +1 -0
  96. package/dist/src/config/extensions/variableSchema.d.ts +36 -0
  97. package/dist/src/config/extensions/variableSchema.js +22 -0
  98. package/dist/src/config/extensions/variableSchema.js.map +1 -0
  99. package/dist/src/config/extensions/variables.d.ts +17 -0
  100. package/dist/src/config/extensions/variables.js +40 -0
  101. package/dist/src/config/extensions/variables.js.map +1 -0
  102. package/dist/src/config/extensions/variables.test.d.ts +6 -0
  103. package/dist/src/config/extensions/variables.test.js +17 -0
  104. package/dist/src/config/extensions/variables.test.js.map +1 -0
  105. package/dist/src/config/keyBindings.d.ts +70 -0
  106. package/dist/src/config/keyBindings.js +130 -0
  107. package/dist/src/config/keyBindings.js.map +1 -0
  108. package/dist/src/config/keyBindings.test.d.ts +6 -0
  109. package/dist/src/config/keyBindings.test.js +51 -0
  110. package/dist/src/config/keyBindings.test.js.map +1 -0
  111. package/dist/src/config/sandboxConfig.d.ts +13 -0
  112. package/dist/src/config/sandboxConfig.js +73 -0
  113. package/dist/src/config/sandboxConfig.js.map +1 -0
  114. package/dist/src/config/settings.d.ts +72 -0
  115. package/dist/src/config/settings.js +631 -0
  116. package/dist/src/config/settings.js.map +1 -0
  117. package/dist/src/config/settingsSchema.d.ts +1189 -0
  118. package/dist/src/config/settingsSchema.js +1129 -0
  119. package/dist/src/config/settingsSchema.js.map +1 -0
  120. package/dist/src/config/settingsSchema.test.d.ts +6 -0
  121. package/dist/src/config/settingsSchema.test.js +201 -0
  122. package/dist/src/config/settingsSchema.test.js.map +1 -0
  123. package/dist/src/config/trustedFolders.d.ts +56 -0
  124. package/dist/src/config/trustedFolders.js +168 -0
  125. package/dist/src/config/trustedFolders.js.map +1 -0
  126. package/dist/src/config/trustedFolders.test.d.ts +6 -0
  127. package/dist/src/config/trustedFolders.test.js +340 -0
  128. package/dist/src/config/trustedFolders.test.js.map +1 -0
  129. package/dist/src/config/webSearch.d.ts +35 -0
  130. package/dist/src/config/webSearch.js +87 -0
  131. package/dist/src/config/webSearch.js.map +1 -0
  132. package/dist/src/core/auth.d.ts +13 -0
  133. package/dist/src/core/auth.js +34 -0
  134. package/dist/src/core/auth.js.map +1 -0
  135. package/dist/src/core/initializer.d.ts +21 -0
  136. package/dist/src/core/initializer.js +44 -0
  137. package/dist/src/core/initializer.js.map +1 -0
  138. package/dist/src/core/theme.d.ts +12 -0
  139. package/dist/src/core/theme.js +23 -0
  140. package/dist/src/core/theme.js.map +1 -0
  141. package/dist/src/gemini.d.ts +13 -0
  142. package/dist/src/gemini.js +328 -0
  143. package/dist/src/gemini.js.map +1 -0
  144. package/dist/src/gemini.test.d.ts +6 -0
  145. package/dist/src/gemini.test.js +507 -0
  146. package/dist/src/gemini.test.js.map +1 -0
  147. package/dist/src/generated/git-commit.d.ts +7 -0
  148. package/dist/src/generated/git-commit.js +10 -0
  149. package/dist/src/generated/git-commit.js.map +1 -0
  150. package/dist/src/i18n/index.d.ts +18 -0
  151. package/dist/src/i18n/index.js +184 -0
  152. package/dist/src/i18n/index.js.map +1 -0
  153. package/dist/src/i18n/locales/en.js +1129 -0
  154. package/dist/src/i18n/locales/zh.js +1052 -0
  155. package/dist/src/nonInteractive/control/ControlContext.d.ts +63 -0
  156. package/dist/src/nonInteractive/control/ControlContext.js +31 -0
  157. package/dist/src/nonInteractive/control/ControlContext.js.map +1 -0
  158. package/dist/src/nonInteractive/control/ControlDispatcher.d.ts +86 -0
  159. package/dist/src/nonInteractive/control/ControlDispatcher.js +238 -0
  160. package/dist/src/nonInteractive/control/ControlDispatcher.js.map +1 -0
  161. package/dist/src/nonInteractive/control/ControlDispatcher.test.d.ts +6 -0
  162. package/dist/src/nonInteractive/control/ControlDispatcher.test.js +549 -0
  163. package/dist/src/nonInteractive/control/ControlDispatcher.test.js.map +1 -0
  164. package/dist/src/nonInteractive/control/ControlService.d.ts +78 -0
  165. package/dist/src/nonInteractive/control/ControlService.js +154 -0
  166. package/dist/src/nonInteractive/control/ControlService.js.map +1 -0
  167. package/dist/src/nonInteractive/control/controllers/baseController.d.ts +50 -0
  168. package/dist/src/nonInteractive/control/controllers/baseController.js +102 -0
  169. package/dist/src/nonInteractive/control/controllers/baseController.js.map +1 -0
  170. package/dist/src/nonInteractive/control/controllers/hookController.d.ts +25 -0
  171. package/dist/src/nonInteractive/control/controllers/hookController.js +42 -0
  172. package/dist/src/nonInteractive/control/controllers/hookController.js.map +1 -0
  173. package/dist/src/nonInteractive/control/controllers/mcpController.d.ts +42 -0
  174. package/dist/src/nonInteractive/control/controllers/mcpController.js +205 -0
  175. package/dist/src/nonInteractive/control/controllers/mcpController.js.map +1 -0
  176. package/dist/src/nonInteractive/control/controllers/permissionController.d.ts +78 -0
  177. package/dist/src/nonInteractive/control/controllers/permissionController.js +358 -0
  178. package/dist/src/nonInteractive/control/controllers/permissionController.js.map +1 -0
  179. package/dist/src/nonInteractive/control/controllers/systemController.d.ts +56 -0
  180. package/dist/src/nonInteractive/control/controllers/systemController.js +166 -0
  181. package/dist/src/nonInteractive/control/controllers/systemController.js.map +1 -0
  182. package/dist/src/nonInteractive/control/types/serviceAPIs.d.ts +120 -0
  183. package/dist/src/nonInteractive/control/types/serviceAPIs.js +7 -0
  184. package/dist/src/nonInteractive/control/types/serviceAPIs.js.map +1 -0
  185. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.d.ts +446 -0
  186. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js +891 -0
  187. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js.map +1 -0
  188. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.d.ts +6 -0
  189. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js +1197 -0
  190. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js.map +1 -0
  191. package/dist/src/nonInteractive/io/JsonOutputAdapter.d.ts +29 -0
  192. package/dist/src/nonInteractive/io/JsonOutputAdapter.js +56 -0
  193. package/dist/src/nonInteractive/io/JsonOutputAdapter.js.map +1 -0
  194. package/dist/src/nonInteractive/io/JsonOutputAdapter.test.d.ts +6 -0
  195. package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js +624 -0
  196. package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js.map +1 -0
  197. package/dist/src/nonInteractive/io/StreamJsonInputReader.d.ts +16 -0
  198. package/dist/src/nonInteractive/io/StreamJsonInputReader.js +54 -0
  199. package/dist/src/nonInteractive/io/StreamJsonInputReader.js.map +1 -0
  200. package/dist/src/nonInteractive/io/StreamJsonInputReader.test.d.ts +6 -0
  201. package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js +178 -0
  202. package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js.map +1 -0
  203. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.d.ts +69 -0
  204. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js +185 -0
  205. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js.map +1 -0
  206. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.d.ts +6 -0
  207. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js +808 -0
  208. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js.map +1 -0
  209. package/dist/src/nonInteractive/session.d.ts +23 -0
  210. package/dist/src/nonInteractive/session.js +549 -0
  211. package/dist/src/nonInteractive/session.js.map +1 -0
  212. package/dist/src/nonInteractive/session.test.d.ts +6 -0
  213. package/dist/src/nonInteractive/session.test.js +407 -0
  214. package/dist/src/nonInteractive/session.test.js.map +1 -0
  215. package/dist/src/nonInteractive/types.d.ts +344 -0
  216. package/dist/src/nonInteractive/types.js +78 -0
  217. package/dist/src/nonInteractive/types.js.map +1 -0
  218. package/dist/src/nonInteractiveCli.d.ts +28 -0
  219. package/dist/src/nonInteractiveCli.js +268 -0
  220. package/dist/src/nonInteractiveCli.js.map +1 -0
  221. package/dist/src/nonInteractiveCliCommands.d.ts +35 -0
  222. package/dist/src/nonInteractiveCliCommands.js +144 -0
  223. package/dist/src/nonInteractiveCliCommands.js.map +1 -0
  224. package/dist/src/patches/is-in-ci.d.ts +7 -0
  225. package/dist/src/patches/is-in-ci.js +15 -0
  226. package/dist/src/patches/is-in-ci.js.map +1 -0
  227. package/dist/src/patches/punycode-shim.d.ts +6 -0
  228. package/dist/src/patches/punycode-shim.js +19 -0
  229. package/dist/src/patches/punycode-shim.js.map +1 -0
  230. package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
  231. package/dist/src/services/BuiltinCommandLoader.js +120 -0
  232. package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
  233. package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
  234. package/dist/src/services/BuiltinCommandLoader.test.js +167 -0
  235. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
  236. package/dist/src/services/CommandService.d.ts +55 -0
  237. package/dist/src/services/CommandService.js +90 -0
  238. package/dist/src/services/CommandService.js.map +1 -0
  239. package/dist/src/services/CommandService.test.d.ts +6 -0
  240. package/dist/src/services/CommandService.test.js +233 -0
  241. package/dist/src/services/CommandService.test.js.map +1 -0
  242. package/dist/src/services/FileCommandLoader.d.ts +51 -0
  243. package/dist/src/services/FileCommandLoader.js +230 -0
  244. package/dist/src/services/FileCommandLoader.js.map +1 -0
  245. package/dist/src/services/McpPromptLoader.d.ts +35 -0
  246. package/dist/src/services/McpPromptLoader.js +254 -0
  247. package/dist/src/services/McpPromptLoader.js.map +1 -0
  248. package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
  249. package/dist/src/services/McpPromptLoader.test.js +341 -0
  250. package/dist/src/services/McpPromptLoader.test.js.map +1 -0
  251. package/dist/src/services/ProjectAnalyzerService.d.ts +136 -0
  252. package/dist/src/services/ProjectAnalyzerService.js +433 -0
  253. package/dist/src/services/ProjectAnalyzerService.js.map +1 -0
  254. package/dist/src/services/prompt-processors/argumentProcessor.d.ts +16 -0
  255. package/dist/src/services/prompt-processors/argumentProcessor.js +21 -0
  256. package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
  257. package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
  258. package/dist/src/services/prompt-processors/atFileProcessor.js +62 -0
  259. package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
  260. package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
  261. package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
  262. package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
  263. package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
  264. package/dist/src/services/prompt-processors/injectionParser.js +60 -0
  265. package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
  266. package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
  267. package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
  268. package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
  269. package/dist/src/services/prompt-processors/shellProcessor.d.ts +27 -0
  270. package/dist/src/services/prompt-processors/shellProcessor.js +128 -0
  271. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
  272. package/dist/src/services/prompt-processors/types.d.ts +45 -0
  273. package/dist/src/services/prompt-processors/types.js +20 -0
  274. package/dist/src/services/prompt-processors/types.js.map +1 -0
  275. package/dist/src/services/types.d.ts +22 -0
  276. package/dist/src/services/types.js +7 -0
  277. package/dist/src/services/types.js.map +1 -0
  278. package/dist/src/test-utils/createExtension.d.ts +15 -0
  279. package/dist/src/test-utils/createExtension.js +25 -0
  280. package/dist/src/test-utils/createExtension.js.map +1 -0
  281. package/dist/src/test-utils/customMatchers.d.ts +14 -0
  282. package/dist/src/test-utils/customMatchers.js +40 -0
  283. package/dist/src/test-utils/customMatchers.js.map +1 -0
  284. package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
  285. package/dist/src/test-utils/mockCommandContext.js +93 -0
  286. package/dist/src/test-utils/mockCommandContext.js.map +1 -0
  287. package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
  288. package/dist/src/test-utils/mockCommandContext.test.js +51 -0
  289. package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
  290. package/dist/src/test-utils/render.d.ts +12 -0
  291. package/dist/src/test-utils/render.js +14 -0
  292. package/dist/src/test-utils/render.js.map +1 -0
  293. package/dist/src/ui/App.d.ts +6 -0
  294. package/dist/src/ui/App.js +37 -0
  295. package/dist/src/ui/App.js.map +1 -0
  296. package/dist/src/ui/AppContainer.d.ts +17 -0
  297. package/dist/src/ui/AppContainer.js +1139 -0
  298. package/dist/src/ui/AppContainer.js.map +1 -0
  299. package/dist/src/ui/AppContainer.test.d.ts +6 -0
  300. package/dist/src/ui/AppContainer.test.js +831 -0
  301. package/dist/src/ui/AppContainer.test.js.map +1 -0
  302. package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
  303. package/dist/src/ui/IdeIntegrationNudge.js +50 -0
  304. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
  305. package/dist/src/ui/auth/AuthDialog.d.ts +7 -0
  306. package/dist/src/ui/auth/AuthDialog.js +94 -0
  307. package/dist/src/ui/auth/AuthDialog.js.map +1 -0
  308. package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
  309. package/dist/src/ui/auth/AuthDialog.test.js +392 -0
  310. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
  311. package/dist/src/ui/auth/AuthInProgress.d.ts +11 -0
  312. package/dist/src/ui/auth/AuthInProgress.js +24 -0
  313. package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
  314. package/dist/src/ui/auth/useAuth.d.ts +26 -0
  315. package/dist/src/ui/auth/useAuth.js +212 -0
  316. package/dist/src/ui/auth/useAuth.js.map +1 -0
  317. package/dist/src/ui/colors.d.ts +7 -0
  318. package/dist/src/ui/colors.js +54 -0
  319. package/dist/src/ui/colors.js.map +1 -0
  320. package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
  321. package/dist/src/ui/commands/aboutCommand.js +25 -0
  322. package/dist/src/ui/commands/aboutCommand.js.map +1 -0
  323. package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
  324. package/dist/src/ui/commands/agentsCommand.js +117 -0
  325. package/dist/src/ui/commands/agentsCommand.js.map +1 -0
  326. package/dist/src/ui/commands/approvalModeCommand.d.ts +7 -0
  327. package/dist/src/ui/commands/approvalModeCommand.js +19 -0
  328. package/dist/src/ui/commands/approvalModeCommand.js.map +1 -0
  329. package/dist/src/ui/commands/approvalModeCommand.test.d.ts +6 -0
  330. package/dist/src/ui/commands/approvalModeCommand.test.js +49 -0
  331. package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -0
  332. package/dist/src/ui/commands/authCommand.d.ts +7 -0
  333. package/dist/src/ui/commands/authCommand.js +19 -0
  334. package/dist/src/ui/commands/authCommand.js.map +1 -0
  335. package/dist/src/ui/commands/bugCommand.d.ts +7 -0
  336. package/dist/src/ui/commands/bugCommand.js +51 -0
  337. package/dist/src/ui/commands/bugCommand.js.map +1 -0
  338. package/dist/src/ui/commands/chatCommand.d.ts +9 -0
  339. package/dist/src/ui/commands/chatCommand.js +351 -0
  340. package/dist/src/ui/commands/chatCommand.js.map +1 -0
  341. package/dist/src/ui/commands/clearCommand.d.ts +7 -0
  342. package/dist/src/ui/commands/clearCommand.js +30 -0
  343. package/dist/src/ui/commands/clearCommand.js.map +1 -0
  344. package/dist/src/ui/commands/compressCommand.d.ts +7 -0
  345. package/dist/src/ui/commands/compressCommand.js +71 -0
  346. package/dist/src/ui/commands/compressCommand.js.map +1 -0
  347. package/dist/src/ui/commands/consultCommand.d.ts +12 -0
  348. package/dist/src/ui/commands/consultCommand.js +193 -0
  349. package/dist/src/ui/commands/consultCommand.js.map +1 -0
  350. package/dist/src/ui/commands/contextCommand.d.ts +7 -0
  351. package/dist/src/ui/commands/contextCommand.js +89 -0
  352. package/dist/src/ui/commands/contextCommand.js.map +1 -0
  353. package/dist/src/ui/commands/continueCommand.d.ts +10 -0
  354. package/dist/src/ui/commands/continueCommand.js +218 -0
  355. package/dist/src/ui/commands/continueCommand.js.map +1 -0
  356. package/dist/src/ui/commands/copyCommand.d.ts +7 -0
  357. package/dist/src/ui/commands/copyCommand.js +62 -0
  358. package/dist/src/ui/commands/copyCommand.js.map +1 -0
  359. package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
  360. package/dist/src/ui/commands/corgiCommand.js +16 -0
  361. package/dist/src/ui/commands/corgiCommand.js.map +1 -0
  362. package/dist/src/ui/commands/dangerouslyCommand.d.ts +15 -0
  363. package/dist/src/ui/commands/dangerouslyCommand.js +100 -0
  364. package/dist/src/ui/commands/dangerouslyCommand.js.map +1 -0
  365. package/dist/src/ui/commands/delegateCommand.d.ts +7 -0
  366. package/dist/src/ui/commands/delegateCommand.js +139 -0
  367. package/dist/src/ui/commands/delegateCommand.js.map +1 -0
  368. package/dist/src/ui/commands/directoryCommand.d.ts +8 -0
  369. package/dist/src/ui/commands/directoryCommand.js +153 -0
  370. package/dist/src/ui/commands/directoryCommand.js.map +1 -0
  371. package/dist/src/ui/commands/docsCommand.d.ts +7 -0
  372. package/dist/src/ui/commands/docsCommand.js +40 -0
  373. package/dist/src/ui/commands/docsCommand.js.map +1 -0
  374. package/dist/src/ui/commands/doctorCommand.d.ts +7 -0
  375. package/dist/src/ui/commands/doctorCommand.js +230 -0
  376. package/dist/src/ui/commands/doctorCommand.js.map +1 -0
  377. package/dist/src/ui/commands/editorCommand.d.ts +7 -0
  378. package/dist/src/ui/commands/editorCommand.js +19 -0
  379. package/dist/src/ui/commands/editorCommand.js.map +1 -0
  380. package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
  381. package/dist/src/ui/commands/extensionsCommand.js +115 -0
  382. package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
  383. package/dist/src/ui/commands/helpCommand.d.ts +7 -0
  384. package/dist/src/ui/commands/helpCommand.js +24 -0
  385. package/dist/src/ui/commands/helpCommand.js.map +1 -0
  386. package/dist/src/ui/commands/ideCommand.d.ts +7 -0
  387. package/dist/src/ui/commands/ideCommand.js +241 -0
  388. package/dist/src/ui/commands/ideCommand.js.map +1 -0
  389. package/dist/src/ui/commands/initCommand.d.ts +7 -0
  390. package/dist/src/ui/commands/initCommand.js +118 -0
  391. package/dist/src/ui/commands/initCommand.js.map +1 -0
  392. package/dist/src/ui/commands/languageCommand.d.ts +7 -0
  393. package/dist/src/ui/commands/languageCommand.js +386 -0
  394. package/dist/src/ui/commands/languageCommand.js.map +1 -0
  395. package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
  396. package/dist/src/ui/commands/mcpCommand.js +269 -0
  397. package/dist/src/ui/commands/mcpCommand.js.map +1 -0
  398. package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
  399. package/dist/src/ui/commands/memoryCommand.js +254 -0
  400. package/dist/src/ui/commands/memoryCommand.js.map +1 -0
  401. package/dist/src/ui/commands/modelCommand.d.ts +7 -0
  402. package/dist/src/ui/commands/modelCommand.js +58 -0
  403. package/dist/src/ui/commands/modelCommand.js.map +1 -0
  404. package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
  405. package/dist/src/ui/commands/modelCommand.test.js +137 -0
  406. package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
  407. package/dist/src/ui/commands/openaiProfileCommand.d.ts +7 -0
  408. package/dist/src/ui/commands/openaiProfileCommand.js +135 -0
  409. package/dist/src/ui/commands/openaiProfileCommand.js.map +1 -0
  410. package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
  411. package/dist/src/ui/commands/permissionsCommand.js +19 -0
  412. package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
  413. package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
  414. package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
  415. package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
  416. package/dist/src/ui/commands/providerCommand.d.ts +11 -0
  417. package/dist/src/ui/commands/providerCommand.js +359 -0
  418. package/dist/src/ui/commands/providerCommand.js.map +1 -0
  419. package/dist/src/ui/commands/quitCommand.d.ts +8 -0
  420. package/dist/src/ui/commands/quitCommand.js +64 -0
  421. package/dist/src/ui/commands/quitCommand.js.map +1 -0
  422. package/dist/src/ui/commands/resetCommand.d.ts +11 -0
  423. package/dist/src/ui/commands/resetCommand.js +34 -0
  424. package/dist/src/ui/commands/resetCommand.js.map +1 -0
  425. package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
  426. package/dist/src/ui/commands/restoreCommand.js +124 -0
  427. package/dist/src/ui/commands/restoreCommand.js.map +1 -0
  428. package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
  429. package/dist/src/ui/commands/settingsCommand.js +19 -0
  430. package/dist/src/ui/commands/settingsCommand.js.map +1 -0
  431. package/dist/src/ui/commands/setupGithubCommand.d.ts +9 -0
  432. package/dist/src/ui/commands/setupGithubCommand.js +157 -0
  433. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
  434. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
  435. package/dist/src/ui/commands/setupGithubCommand.test.js +167 -0
  436. package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
  437. package/dist/src/ui/commands/spCommand.d.ts +7 -0
  438. package/dist/src/ui/commands/spCommand.js +352 -0
  439. package/dist/src/ui/commands/spCommand.js.map +1 -0
  440. package/dist/src/ui/commands/statsCommand.d.ts +7 -0
  441. package/dist/src/ui/commands/statsCommand.js +61 -0
  442. package/dist/src/ui/commands/statsCommand.js.map +1 -0
  443. package/dist/src/ui/commands/summaryCommand.d.ts +7 -0
  444. package/dist/src/ui/commands/summaryCommand.js +156 -0
  445. package/dist/src/ui/commands/summaryCommand.js.map +1 -0
  446. package/dist/src/ui/commands/systemPromptCommand.d.ts +7 -0
  447. package/dist/src/ui/commands/systemPromptCommand.js +322 -0
  448. package/dist/src/ui/commands/systemPromptCommand.js.map +1 -0
  449. package/dist/src/ui/commands/taskmasterCommand.d.ts +10 -0
  450. package/dist/src/ui/commands/taskmasterCommand.js +174 -0
  451. package/dist/src/ui/commands/taskmasterCommand.js.map +1 -0
  452. package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
  453. package/dist/src/ui/commands/terminalSetupCommand.js +47 -0
  454. package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
  455. package/dist/src/ui/commands/themeCommand.d.ts +7 -0
  456. package/dist/src/ui/commands/themeCommand.js +19 -0
  457. package/dist/src/ui/commands/themeCommand.js.map +1 -0
  458. package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
  459. package/dist/src/ui/commands/toolsCommand.js +45 -0
  460. package/dist/src/ui/commands/toolsCommand.js.map +1 -0
  461. package/dist/src/ui/commands/types.d.ts +188 -0
  462. package/dist/src/ui/commands/types.js +12 -0
  463. package/dist/src/ui/commands/types.js.map +1 -0
  464. package/dist/src/ui/commands/viewCommand.d.ts +7 -0
  465. package/dist/src/ui/commands/viewCommand.js +160 -0
  466. package/dist/src/ui/commands/viewCommand.js.map +1 -0
  467. package/dist/src/ui/commands/vimCommand.d.ts +7 -0
  468. package/dist/src/ui/commands/vimCommand.js +26 -0
  469. package/dist/src/ui/commands/vimCommand.js.map +1 -0
  470. package/dist/src/ui/components/AboutBox.d.ts +10 -0
  471. package/dist/src/ui/components/AboutBox.js +10 -0
  472. package/dist/src/ui/components/AboutBox.js.map +1 -0
  473. package/dist/src/ui/components/AgentResponseFooter.d.ts +19 -0
  474. package/dist/src/ui/components/AgentResponseFooter.js +43 -0
  475. package/dist/src/ui/components/AgentResponseFooter.js.map +1 -0
  476. package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
  477. package/dist/src/ui/components/AnsiOutput.js +12 -0
  478. package/dist/src/ui/components/AnsiOutput.js.map +1 -0
  479. package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
  480. package/dist/src/ui/components/AnsiOutput.test.js +97 -0
  481. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
  482. package/dist/src/ui/components/AppHeader.d.ts +10 -0
  483. package/dist/src/ui/components/AppHeader.js +19 -0
  484. package/dist/src/ui/components/AppHeader.js.map +1 -0
  485. package/dist/src/ui/components/ApprovalModeDialog.d.ts +21 -0
  486. package/dist/src/ui/components/ApprovalModeDialog.js +68 -0
  487. package/dist/src/ui/components/ApprovalModeDialog.js.map +1 -0
  488. package/dist/src/ui/components/AsciiArt.d.ts +13 -0
  489. package/dist/src/ui/components/AsciiArt.js +47 -0
  490. package/dist/src/ui/components/AsciiArt.js.map +1 -0
  491. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
  492. package/dist/src/ui/components/AutoAcceptIndicator.js +32 -0
  493. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
  494. package/dist/src/ui/components/Composer.d.ts +6 -0
  495. package/dist/src/ui/components/Composer.js +56 -0
  496. package/dist/src/ui/components/Composer.js.map +1 -0
  497. package/dist/src/ui/components/Composer.test.d.ts +6 -0
  498. package/dist/src/ui/components/Composer.test.js +337 -0
  499. package/dist/src/ui/components/Composer.test.js.map +1 -0
  500. package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
  501. package/dist/src/ui/components/ConfigInitDisplay.js +42 -0
  502. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
  503. package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
  504. package/dist/src/ui/components/ConsentPrompt.js +19 -0
  505. package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
  506. package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
  507. package/dist/src/ui/components/ConsentPrompt.test.js +67 -0
  508. package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
  509. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
  510. package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
  511. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
  512. package/dist/src/ui/components/ConsultationDisplay.d.ts +22 -0
  513. package/dist/src/ui/components/ConsultationDisplay.js +25 -0
  514. package/dist/src/ui/components/ConsultationDisplay.js.map +1 -0
  515. package/dist/src/ui/components/ConsultationPanel.d.ts +11 -0
  516. package/dist/src/ui/components/ConsultationPanel.js +35 -0
  517. package/dist/src/ui/components/ConsultationPanel.js.map +1 -0
  518. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +20 -0
  519. package/dist/src/ui/components/ContextSummaryDisplay.js +90 -0
  520. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
  521. package/dist/src/ui/components/ContextUsageDisplay.d.ts +10 -0
  522. package/dist/src/ui/components/ContextUsageDisplay.js +58 -0
  523. package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
  524. package/dist/src/ui/components/DebugProfiler.d.ts +6 -0
  525. package/dist/src/ui/components/DebugProfiler.js +27 -0
  526. package/dist/src/ui/components/DebugProfiler.js.map +1 -0
  527. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +14 -0
  528. package/dist/src/ui/components/DetailedMessagesDisplay.js +34 -0
  529. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
  530. package/dist/src/ui/components/DialogManager.d.ts +12 -0
  531. package/dist/src/ui/components/DialogManager.js +192 -0
  532. package/dist/src/ui/components/DialogManager.js.map +1 -0
  533. package/dist/src/ui/components/EditorSettingsDialog.d.ts +16 -0
  534. package/dist/src/ui/components/EditorSettingsDialog.js +85 -0
  535. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
  536. package/dist/src/ui/components/ExitWarning.d.ts +7 -0
  537. package/dist/src/ui/components/ExitWarning.js +9 -0
  538. package/dist/src/ui/components/ExitWarning.js.map +1 -0
  539. package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
  540. package/dist/src/ui/components/FolderTrustDialog.js +58 -0
  541. package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
  542. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
  543. package/dist/src/ui/components/FolderTrustDialog.test.js +88 -0
  544. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
  545. package/dist/src/ui/components/Footer.d.ts +7 -0
  546. package/dist/src/ui/components/Footer.js +48 -0
  547. package/dist/src/ui/components/Footer.js.map +1 -0
  548. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +21 -0
  549. package/dist/src/ui/components/GeminiRespondingSpinner.js +23 -0
  550. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
  551. package/dist/src/ui/components/Header.d.ts +13 -0
  552. package/dist/src/ui/components/Header.js +28 -0
  553. package/dist/src/ui/components/Header.js.map +1 -0
  554. package/dist/src/ui/components/Header.test.d.ts +6 -0
  555. package/dist/src/ui/components/Header.test.js +37 -0
  556. package/dist/src/ui/components/Header.test.js.map +1 -0
  557. package/dist/src/ui/components/Help.d.ts +12 -0
  558. package/dist/src/ui/components/Help.js +23 -0
  559. package/dist/src/ui/components/Help.js.map +1 -0
  560. package/dist/src/ui/components/Help.test.d.ts +6 -0
  561. package/dist/src/ui/components/Help.test.js +57 -0
  562. package/dist/src/ui/components/Help.test.js.map +1 -0
  563. package/dist/src/ui/components/HistoryItemDisplay.d.ts +21 -0
  564. package/dist/src/ui/components/HistoryItemDisplay.js +31 -0
  565. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
  566. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
  567. package/dist/src/ui/components/HistoryItemDisplay.test.js +183 -0
  568. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
  569. package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
  570. package/dist/src/ui/components/IdeTrustChangeDialog.js +32 -0
  571. package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
  572. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
  573. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
  574. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
  575. package/dist/src/ui/components/InputPrompt.d.ts +37 -0
  576. package/dist/src/ui/components/InputPrompt.js +583 -0
  577. package/dist/src/ui/components/InputPrompt.js.map +1 -0
  578. package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
  579. package/dist/src/ui/components/LoadingIndicator.js +39 -0
  580. package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
  581. package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
  582. package/dist/src/ui/components/LoadingIndicator.test.js +194 -0
  583. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
  584. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
  585. package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
  586. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
  587. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
  588. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
  589. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
  590. package/dist/src/ui/components/MainContent.d.ts +6 -0
  591. package/dist/src/ui/components/MainContent.js +28 -0
  592. package/dist/src/ui/components/MainContent.js.map +1 -0
  593. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
  594. package/dist/src/ui/components/MemoryUsageDisplay.js +24 -0
  595. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
  596. package/dist/src/ui/components/ModelDialog.d.ts +11 -0
  597. package/dist/src/ui/components/ModelDialog.js +43 -0
  598. package/dist/src/ui/components/ModelDialog.js.map +1 -0
  599. package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
  600. package/dist/src/ui/components/ModelDialog.test.js +158 -0
  601. package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
  602. package/dist/src/ui/components/ModelStatsDisplay.d.ts +7 -0
  603. package/dist/src/ui/components/ModelStatsDisplay.js +34 -0
  604. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
  605. package/dist/src/ui/components/ModelSwitchDialog.d.ts +15 -0
  606. package/dist/src/ui/components/ModelSwitchDialog.js +40 -0
  607. package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -0
  608. package/dist/src/ui/components/ModelSwitchDialog.test.d.ts +6 -0
  609. package/dist/src/ui/components/ModelSwitchDialog.test.js +128 -0
  610. package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -0
  611. package/dist/src/ui/components/Notifications.d.ts +6 -0
  612. package/dist/src/ui/components/Notifications.js +23 -0
  613. package/dist/src/ui/components/Notifications.js.map +1 -0
  614. package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +32 -0
  615. package/dist/src/ui/components/OpenAIKeyPrompt.js +169 -0
  616. package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -0
  617. package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +6 -0
  618. package/dist/src/ui/components/OpenAIKeyPrompt.test.js +51 -0
  619. package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -0
  620. package/dist/src/ui/components/OrchestrationStatusDisplay.d.ts +15 -0
  621. package/dist/src/ui/components/OrchestrationStatusDisplay.js +58 -0
  622. package/dist/src/ui/components/OrchestrationStatusDisplay.js.map +1 -0
  623. package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +13 -0
  624. package/dist/src/ui/components/PermissionsModifyTrustDialog.js +48 -0
  625. package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
  626. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
  627. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +154 -0
  628. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
  629. package/dist/src/ui/components/PlanSummaryDisplay.d.ts +14 -0
  630. package/dist/src/ui/components/PlanSummaryDisplay.js +9 -0
  631. package/dist/src/ui/components/PlanSummaryDisplay.js.map +1 -0
  632. package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
  633. package/dist/src/ui/components/PrepareLabel.js +72 -0
  634. package/dist/src/ui/components/PrepareLabel.js.map +1 -0
  635. package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
  636. package/dist/src/ui/components/PrepareLabel.test.js +71 -0
  637. package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
  638. package/dist/src/ui/components/ProQuotaDialog.d.ts +13 -0
  639. package/dist/src/ui/components/ProQuotaDialog.js +31 -0
  640. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
  641. package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
  642. package/dist/src/ui/components/ProQuotaDialog.test.js +58 -0
  643. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
  644. package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
  645. package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
  646. package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
  647. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
  648. package/dist/src/ui/components/QueuedMessageDisplay.test.js +56 -0
  649. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
  650. package/dist/src/ui/components/QuitConfirmationDialog.d.ts +17 -0
  651. package/dist/src/ui/components/QuitConfirmationDialog.js +49 -0
  652. package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -0
  653. package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
  654. package/dist/src/ui/components/QuittingDisplay.js +20 -0
  655. package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
  656. package/dist/src/ui/components/QwenOAuthProgress.d.ts +16 -0
  657. package/dist/src/ui/components/QwenOAuthProgress.js +111 -0
  658. package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -0
  659. package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +6 -0
  660. package/dist/src/ui/components/QwenOAuthProgress.test.js +364 -0
  661. package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -0
  662. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +11 -0
  663. package/dist/src/ui/components/SessionSummaryDisplay.js +5 -0
  664. package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
  665. package/dist/src/ui/components/SettingsDialog.d.ts +18 -0
  666. package/dist/src/ui/components/SettingsDialog.js +647 -0
  667. package/dist/src/ui/components/SettingsDialog.js.map +1 -0
  668. package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
  669. package/dist/src/ui/components/SettingsDialog.test.js +1037 -0
  670. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
  671. package/dist/src/ui/components/ShellConfirmationDialog.d.ts +15 -0
  672. package/dist/src/ui/components/ShellConfirmationDialog.js +50 -0
  673. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
  674. package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
  675. package/dist/src/ui/components/ShellConfirmationDialog.test.js +40 -0
  676. package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
  677. package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
  678. package/dist/src/ui/components/ShellInputPrompt.js +36 -0
  679. package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
  680. package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
  681. package/dist/src/ui/components/ShellModeIndicator.js +5 -0
  682. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
  683. package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
  684. package/dist/src/ui/components/ShowMoreLines.js +24 -0
  685. package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
  686. package/dist/src/ui/components/StatsDisplay.d.ts +12 -0
  687. package/dist/src/ui/components/StatsDisplay.js +44 -0
  688. package/dist/src/ui/components/StatsDisplay.js.map +1 -0
  689. package/dist/src/ui/components/StatusBar.d.ts +14 -0
  690. package/dist/src/ui/components/StatusBar.js +106 -0
  691. package/dist/src/ui/components/StatusBar.js.map +1 -0
  692. package/dist/src/ui/components/SuggestionsDisplay.d.ts +27 -0
  693. package/dist/src/ui/components/SuggestionsDisplay.js +40 -0
  694. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
  695. package/dist/src/ui/components/TaskMasterPanel.d.ts +18 -0
  696. package/dist/src/ui/components/TaskMasterPanel.js +141 -0
  697. package/dist/src/ui/components/TaskMasterPanel.js.map +1 -0
  698. package/dist/src/ui/components/ThemeDialog.d.ts +20 -0
  699. package/dist/src/ui/components/ThemeDialog.js +126 -0
  700. package/dist/src/ui/components/ThemeDialog.js.map +1 -0
  701. package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
  702. package/dist/src/ui/components/ThemeDialog.test.js +75 -0
  703. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
  704. package/dist/src/ui/components/Tips.d.ts +12 -0
  705. package/dist/src/ui/components/Tips.js +10 -0
  706. package/dist/src/ui/components/Tips.js.map +1 -0
  707. package/dist/src/ui/components/TodoDisplay.d.ts +16 -0
  708. package/dist/src/ui/components/TodoDisplay.js +27 -0
  709. package/dist/src/ui/components/TodoDisplay.js.map +1 -0
  710. package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
  711. package/dist/src/ui/components/TodoDisplay.test.js +77 -0
  712. package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
  713. package/dist/src/ui/components/ToolStatsDisplay.d.ts +7 -0
  714. package/dist/src/ui/components/ToolStatsDisplay.js +42 -0
  715. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
  716. package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
  717. package/dist/src/ui/components/UpdateNotification.js +10 -0
  718. package/dist/src/ui/components/UpdateNotification.js.map +1 -0
  719. package/dist/src/ui/components/WelcomeBackDialog.d.ts +13 -0
  720. package/dist/src/ui/components/WelcomeBackDialog.js +43 -0
  721. package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
  722. package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +11 -0
  723. package/dist/src/ui/components/WorkspaceMigrationDialog.js +45 -0
  724. package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -0
  725. package/dist/src/ui/components/messages/CompressionMessage.d.ts +10 -0
  726. package/dist/src/ui/components/messages/CompressionMessage.js +50 -0
  727. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
  728. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
  729. package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
  730. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
  731. package/dist/src/ui/components/messages/DiffRenderer.d.ts +17 -0
  732. package/dist/src/ui/components/messages/DiffRenderer.js +218 -0
  733. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
  734. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
  735. package/dist/src/ui/components/messages/DiffRenderer.test.js +239 -0
  736. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
  737. package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
  738. package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
  739. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
  740. package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
  741. package/dist/src/ui/components/messages/GeminiMessage.js +11 -0
  742. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
  743. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +14 -0
  744. package/dist/src/ui/components/messages/GeminiMessageContent.js +15 -0
  745. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
  746. package/dist/src/ui/components/messages/InfoMessage.d.ts +11 -0
  747. package/dist/src/ui/components/messages/InfoMessage.js +14 -0
  748. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
  749. package/dist/src/ui/components/messages/SummaryMessage.d.ts +11 -0
  750. package/dist/src/ui/components/messages/SummaryMessage.js +35 -0
  751. package/dist/src/ui/components/messages/SummaryMessage.js.map +1 -0
  752. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +16 -0
  753. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +245 -0
  754. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
  755. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
  756. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +165 -0
  757. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
  758. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +19 -0
  759. package/dist/src/ui/components/messages/ToolGroupMessage.js +58 -0
  760. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
  761. package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
  762. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +261 -0
  763. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
  764. package/dist/src/ui/components/messages/ToolMessage.d.ts +19 -0
  765. package/dist/src/ui/components/messages/ToolMessage.js +190 -0
  766. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
  767. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
  768. package/dist/src/ui/components/messages/ToolMessage.test.js +182 -0
  769. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
  770. package/dist/src/ui/components/messages/UserMessage.d.ts +11 -0
  771. package/dist/src/ui/components/messages/UserMessage.js +13 -0
  772. package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
  773. package/dist/src/ui/components/messages/UserShellMessage.d.ts +11 -0
  774. package/dist/src/ui/components/messages/UserShellMessage.js +9 -0
  775. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
  776. package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
  777. package/dist/src/ui/components/messages/WarningMessage.js +10 -0
  778. package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
  779. package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
  780. package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
  781. package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
  782. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
  783. package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
  784. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
  785. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
  786. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
  787. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
  788. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
  789. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
  790. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
  791. package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
  792. package/dist/src/ui/components/shared/EnumSelector.js +44 -0
  793. package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
  794. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
  795. package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
  796. package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
  797. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
  798. package/dist/src/ui/components/shared/MaxSizedBox.js +451 -0
  799. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
  800. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
  801. package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
  802. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
  803. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +45 -0
  804. package/dist/src/ui/components/shared/RadioButtonSelect.js +21 -0
  805. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
  806. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
  807. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +134 -0
  808. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
  809. package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
  810. package/dist/src/ui/components/shared/ScopeSelector.js +16 -0
  811. package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
  812. package/dist/src/ui/components/shared/TextInput.d.ts +16 -0
  813. package/dist/src/ui/components/shared/TextInput.js +127 -0
  814. package/dist/src/ui/components/shared/TextInput.js.map +1 -0
  815. package/dist/src/ui/components/shared/text-buffer.d.ts +490 -0
  816. package/dist/src/ui/components/shared/text-buffer.js +1598 -0
  817. package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
  818. package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
  819. package/dist/src/ui/components/shared/vim-buffer-actions.js +552 -0
  820. package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
  821. package/dist/src/ui/components/subagents/constants.d.ts +23 -0
  822. package/dist/src/ui/components/subagents/constants.js +67 -0
  823. package/dist/src/ui/components/subagents/constants.js.map +1 -0
  824. package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +15 -0
  825. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +186 -0
  826. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -0
  827. package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +15 -0
  828. package/dist/src/ui/components/subagents/create/ColorSelector.js +43 -0
  829. package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -0
  830. package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +10 -0
  831. package/dist/src/ui/components/subagents/create/CreationSummary.js +174 -0
  832. package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -0
  833. package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +10 -0
  834. package/dist/src/ui/components/subagents/create/DescriptionInput.js +107 -0
  835. package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -0
  836. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +10 -0
  837. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +39 -0
  838. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -0
  839. package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +10 -0
  840. package/dist/src/ui/components/subagents/create/LocationSelector.js +39 -0
  841. package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -0
  842. package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +26 -0
  843. package/dist/src/ui/components/subagents/create/TextEntryStep.js +28 -0
  844. package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -0
  845. package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +16 -0
  846. package/dist/src/ui/components/subagents/create/ToolSelector.js +145 -0
  847. package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -0
  848. package/dist/src/ui/components/subagents/index.d.ts +8 -0
  849. package/dist/src/ui/components/subagents/index.js +12 -0
  850. package/dist/src/ui/components/subagents/index.js.map +1 -0
  851. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +13 -0
  852. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +71 -0
  853. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -0
  854. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +13 -0
  855. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +36 -0
  856. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -0
  857. package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +15 -0
  858. package/dist/src/ui/components/subagents/manage/AgentEditStep.js +73 -0
  859. package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -0
  860. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +12 -0
  861. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +231 -0
  862. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -0
  863. package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +11 -0
  864. package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +20 -0
  865. package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -0
  866. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +15 -0
  867. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +212 -0
  868. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -0
  869. package/dist/src/ui/components/subagents/reducers.d.ts +14 -0
  870. package/dist/src/ui/components/subagents/reducers.js +162 -0
  871. package/dist/src/ui/components/subagents/reducers.js.map +1 -0
  872. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +20 -0
  873. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +193 -0
  874. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -0
  875. package/dist/src/ui/components/subagents/types.d.ts +137 -0
  876. package/dist/src/ui/components/subagents/types.js +15 -0
  877. package/dist/src/ui/components/subagents/types.js.map +1 -0
  878. package/dist/src/ui/components/subagents/utils.d.ts +15 -0
  879. package/dist/src/ui/components/subagents/utils.js +79 -0
  880. package/dist/src/ui/components/subagents/utils.js.map +1 -0
  881. package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
  882. package/dist/src/ui/components/views/ExtensionsList.js +47 -0
  883. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
  884. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
  885. package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
  886. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
  887. package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
  888. package/dist/src/ui/components/views/McpStatus.js +90 -0
  889. package/dist/src/ui/components/views/McpStatus.js.map +1 -0
  890. package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
  891. package/dist/src/ui/components/views/McpStatus.test.js +117 -0
  892. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
  893. package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
  894. package/dist/src/ui/components/views/ToolsList.js +8 -0
  895. package/dist/src/ui/components/views/ToolsList.js.map +1 -0
  896. package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
  897. package/dist/src/ui/components/views/ToolsList.test.js +45 -0
  898. package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
  899. package/dist/src/ui/constants.d.ts +18 -0
  900. package/dist/src/ui/constants.js +23 -0
  901. package/dist/src/ui/constants.js.map +1 -0
  902. package/dist/src/ui/contexts/AppContext.d.ts +11 -0
  903. package/dist/src/ui/contexts/AppContext.js +15 -0
  904. package/dist/src/ui/contexts/AppContext.js.map +1 -0
  905. package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
  906. package/dist/src/ui/contexts/ConfigContext.js +16 -0
  907. package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
  908. package/dist/src/ui/contexts/ConsultationContext.d.ts +63 -0
  909. package/dist/src/ui/contexts/ConsultationContext.js +186 -0
  910. package/dist/src/ui/contexts/ConsultationContext.js.map +1 -0
  911. package/dist/src/ui/contexts/IntelligentOrchestratorContext.d.ts +87 -0
  912. package/dist/src/ui/contexts/IntelligentOrchestratorContext.js +336 -0
  913. package/dist/src/ui/contexts/IntelligentOrchestratorContext.js.map +1 -0
  914. package/dist/src/ui/contexts/KeypressContext.d.ts +35 -0
  915. package/dist/src/ui/contexts/KeypressContext.js +636 -0
  916. package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
  917. package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
  918. package/dist/src/ui/contexts/KeypressContext.test.js +1180 -0
  919. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
  920. package/dist/src/ui/contexts/OrchestrationContext.d.ts +55 -0
  921. package/dist/src/ui/contexts/OrchestrationContext.js +239 -0
  922. package/dist/src/ui/contexts/OrchestrationContext.js.map +1 -0
  923. package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
  924. package/dist/src/ui/contexts/OverflowContext.js +38 -0
  925. package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
  926. package/dist/src/ui/contexts/RoadmapContext.d.ts +61 -0
  927. package/dist/src/ui/contexts/RoadmapContext.js +230 -0
  928. package/dist/src/ui/contexts/RoadmapContext.js.map +1 -0
  929. package/dist/src/ui/contexts/SessionContext.d.ts +45 -0
  930. package/dist/src/ui/contexts/SessionContext.js +157 -0
  931. package/dist/src/ui/contexts/SessionContext.js.map +1 -0
  932. package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
  933. package/dist/src/ui/contexts/SettingsContext.js +15 -0
  934. package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
  935. package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
  936. package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
  937. package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
  938. package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
  939. package/dist/src/ui/contexts/StreamingContext.js +15 -0
  940. package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
  941. package/dist/src/ui/contexts/TaskmasterContext.d.ts +87 -0
  942. package/dist/src/ui/contexts/TaskmasterContext.js +184 -0
  943. package/dist/src/ui/contexts/TaskmasterContext.js.map +1 -0
  944. package/dist/src/ui/contexts/TodoContext.d.ts +26 -0
  945. package/dist/src/ui/contexts/TodoContext.js +50 -0
  946. package/dist/src/ui/contexts/TodoContext.js.map +1 -0
  947. package/dist/src/ui/contexts/UIActionsContext.d.ts +46 -0
  948. package/dist/src/ui/contexts/UIActionsContext.js +22 -0
  949. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
  950. package/dist/src/ui/contexts/UIStateContext.d.ts +116 -0
  951. package/dist/src/ui/contexts/UIStateContext.js +17 -0
  952. package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
  953. package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
  954. package/dist/src/ui/contexts/VimModeContext.js +48 -0
  955. package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
  956. package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
  957. package/dist/src/ui/editors/editorSettingsManager.js +48 -0
  958. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
  959. package/dist/src/ui/hooks/atCommandProcessor.d.ts +31 -0
  960. package/dist/src/ui/hooks/atCommandProcessor.js +364 -0
  961. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
  962. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
  963. package/dist/src/ui/hooks/atCommandProcessor.test.js +836 -0
  964. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
  965. package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
  966. package/dist/src/ui/hooks/keyToAnsi.js +67 -0
  967. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
  968. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +18 -0
  969. package/dist/src/ui/hooks/shellCommandProcessor.js +284 -0
  970. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
  971. package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
  972. package/dist/src/ui/hooks/shellCommandProcessor.test.js +508 -0
  973. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
  974. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +53 -0
  975. package/dist/src/ui/hooks/slashCommandProcessor.js +510 -0
  976. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
  977. package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +11 -0
  978. package/dist/src/ui/hooks/useAgentsManagerDialog.js +21 -0
  979. package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +1 -0
  980. package/dist/src/ui/hooks/useApprovalModeCommand.d.ts +14 -0
  981. package/dist/src/ui/hooks/useApprovalModeCommand.js +33 -0
  982. package/dist/src/ui/hooks/useApprovalModeCommand.js.map +1 -0
  983. package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
  984. package/dist/src/ui/hooks/useAtCompletion.js +179 -0
  985. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
  986. package/dist/src/ui/hooks/useAttentionNotifications.d.ts +14 -0
  987. package/dist/src/ui/hooks/useAttentionNotifications.js +41 -0
  988. package/dist/src/ui/hooks/useAttentionNotifications.js.map +1 -0
  989. package/dist/src/ui/hooks/useAttentionNotifications.test.d.ts +6 -0
  990. package/dist/src/ui/hooks/useAttentionNotifications.test.js +113 -0
  991. package/dist/src/ui/hooks/useAttentionNotifications.test.js.map +1 -0
  992. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +13 -0
  993. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +40 -0
  994. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
  995. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
  996. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +306 -0
  997. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
  998. package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
  999. package/dist/src/ui/hooks/useBracketedPaste.js +32 -0
  1000. package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
  1001. package/dist/src/ui/hooks/useCommandCompletion.d.ts +29 -0
  1002. package/dist/src/ui/hooks/useCommandCompletion.js +164 -0
  1003. package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -0
  1004. package/dist/src/ui/hooks/useCompletion.d.ts +24 -0
  1005. package/dist/src/ui/hooks/useCompletion.js +88 -0
  1006. package/dist/src/ui/hooks/useCompletion.js.map +1 -0
  1007. package/dist/src/ui/hooks/useConsoleMessages.d.ts +12 -0
  1008. package/dist/src/ui/hooks/useConsoleMessages.js +76 -0
  1009. package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
  1010. package/dist/src/ui/hooks/useConsultationGenerator.d.ts +17 -0
  1011. package/dist/src/ui/hooks/useConsultationGenerator.js +164 -0
  1012. package/dist/src/ui/hooks/useConsultationGenerator.js.map +1 -0
  1013. package/dist/src/ui/hooks/useDialogClose.d.ts +35 -0
  1014. package/dist/src/ui/hooks/useDialogClose.js +53 -0
  1015. package/dist/src/ui/hooks/useDialogClose.js.map +1 -0
  1016. package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
  1017. package/dist/src/ui/hooks/useEditorSettings.js +43 -0
  1018. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
  1019. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
  1020. package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
  1021. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
  1022. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +21 -0
  1023. package/dist/src/ui/hooks/useExtensionUpdates.js +116 -0
  1024. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
  1025. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
  1026. package/dist/src/ui/hooks/useExtensionUpdates.test.js +243 -0
  1027. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
  1028. package/dist/src/ui/hooks/useFocus.d.ts +10 -0
  1029. package/dist/src/ui/hooks/useFocus.js +51 -0
  1030. package/dist/src/ui/hooks/useFocus.js.map +1 -0
  1031. package/dist/src/ui/hooks/useFolderTrust.d.ts +13 -0
  1032. package/dist/src/ui/hooks/useFolderTrust.js +60 -0
  1033. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
  1034. package/dist/src/ui/hooks/useGeminiStream.d.ts +39 -0
  1035. package/dist/src/ui/hooks/useGeminiStream.js +781 -0
  1036. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
  1037. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
  1038. package/dist/src/ui/hooks/useGeminiStream.test.js +2036 -0
  1039. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
  1040. package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
  1041. package/dist/src/ui/hooks/useGitBranchName.js +61 -0
  1042. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
  1043. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
  1044. package/dist/src/ui/hooks/useGitBranchName.test.js +189 -0
  1045. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
  1046. package/dist/src/ui/hooks/useHistoryManager.d.ts +22 -0
  1047. package/dist/src/ui/hooks/useHistoryManager.js +72 -0
  1048. package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
  1049. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
  1050. package/dist/src/ui/hooks/useHistoryManager.test.js +171 -0
  1051. package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
  1052. package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
  1053. package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
  1054. package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
  1055. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
  1056. package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
  1057. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
  1058. package/dist/src/ui/hooks/useInitializationAuthError.d.ts +22 -0
  1059. package/dist/src/ui/hooks/useInitializationAuthError.js +40 -0
  1060. package/dist/src/ui/hooks/useInitializationAuthError.js.map +1 -0
  1061. package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
  1062. package/dist/src/ui/hooks/useInputHistory.js +84 -0
  1063. package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
  1064. package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
  1065. package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
  1066. package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
  1067. package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
  1068. package/dist/src/ui/hooks/useInputHistoryStore.js +81 -0
  1069. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
  1070. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
  1071. package/dist/src/ui/hooks/useInputHistoryStore.test.js +234 -0
  1072. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
  1073. package/dist/src/ui/hooks/useKeypress.d.ts +17 -0
  1074. package/dist/src/ui/hooks/useKeypress.js +27 -0
  1075. package/dist/src/ui/hooks/useKeypress.js.map +1 -0
  1076. package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
  1077. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
  1078. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
  1079. package/dist/src/ui/hooks/useLaunchEditor.d.ts +10 -0
  1080. package/dist/src/ui/hooks/useLaunchEditor.js +70 -0
  1081. package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -0
  1082. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +10 -0
  1083. package/dist/src/ui/hooks/useLoadingIndicator.js +44 -0
  1084. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
  1085. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
  1086. package/dist/src/ui/hooks/useLoadingIndicator.test.js +91 -0
  1087. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
  1088. package/dist/src/ui/hooks/useLogger.d.ts +11 -0
  1089. package/dist/src/ui/hooks/useLogger.js +29 -0
  1090. package/dist/src/ui/hooks/useLogger.js.map +1 -0
  1091. package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
  1092. package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
  1093. package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
  1094. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
  1095. package/dist/src/ui/hooks/useMemoryMonitor.test.js +57 -0
  1096. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
  1097. package/dist/src/ui/hooks/useMessageQueue.d.ts +23 -0
  1098. package/dist/src/ui/hooks/useMessageQueue.js +51 -0
  1099. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
  1100. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
  1101. package/dist/src/ui/hooks/useMessageQueue.test.js +167 -0
  1102. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
  1103. package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
  1104. package/dist/src/ui/hooks/useModelCommand.js +21 -0
  1105. package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
  1106. package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
  1107. package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
  1108. package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
  1109. package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
  1110. package/dist/src/ui/hooks/usePermissionsModifyTrust.js +78 -0
  1111. package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
  1112. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
  1113. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +182 -0
  1114. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
  1115. package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
  1116. package/dist/src/ui/hooks/usePhraseCycler.js +192 -0
  1117. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
  1118. package/dist/src/ui/hooks/useQuitConfirmation.d.ts +14 -0
  1119. package/dist/src/ui/hooks/useQuitConfirmation.js +36 -0
  1120. package/dist/src/ui/hooks/useQuitConfirmation.js.map +1 -0
  1121. package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
  1122. package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
  1123. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
  1124. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
  1125. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +269 -0
  1126. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
  1127. package/dist/src/ui/hooks/useQwenAuth.d.ts +15 -0
  1128. package/dist/src/ui/hooks/useQwenAuth.js +74 -0
  1129. package/dist/src/ui/hooks/useQwenAuth.js.map +1 -0
  1130. package/dist/src/ui/hooks/useQwenAuth.test.d.ts +6 -0
  1131. package/dist/src/ui/hooks/useQwenAuth.test.js +266 -0
  1132. package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -0
  1133. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +34 -0
  1134. package/dist/src/ui/hooks/useReactToolScheduler.js +192 -0
  1135. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
  1136. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
  1137. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
  1138. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
  1139. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
  1140. package/dist/src/ui/hooks/useReverseSearchCompletion.js +103 -0
  1141. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
  1142. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
  1143. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
  1144. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
  1145. package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
  1146. package/dist/src/ui/hooks/useSelectionList.js +245 -0
  1147. package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
  1148. package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
  1149. package/dist/src/ui/hooks/useSelectionList.test.js +701 -0
  1150. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
  1151. package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
  1152. package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
  1153. package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
  1154. package/dist/src/ui/hooks/useShellHistory.d.ts +14 -0
  1155. package/dist/src/ui/hooks/useShellHistory.js +111 -0
  1156. package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
  1157. package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
  1158. package/dist/src/ui/hooks/useShellHistory.test.js +187 -0
  1159. package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
  1160. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
  1161. package/dist/src/ui/hooks/useShowMemoryCommand.js +58 -0
  1162. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
  1163. package/dist/src/ui/hooks/useSlashCompletion.d.ts +20 -0
  1164. package/dist/src/ui/hooks/useSlashCompletion.js +349 -0
  1165. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
  1166. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
  1167. package/dist/src/ui/hooks/useSlashCompletion.test.js +597 -0
  1168. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
  1169. package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
  1170. package/dist/src/ui/hooks/useStateAndRef.js +26 -0
  1171. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
  1172. package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +10 -0
  1173. package/dist/src/ui/hooks/useSubagentCreateDialog.js +21 -0
  1174. package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +1 -0
  1175. package/dist/src/ui/hooks/useTaskmasterOrchestrator.d.ts +35 -0
  1176. package/dist/src/ui/hooks/useTaskmasterOrchestrator.js +177 -0
  1177. package/dist/src/ui/hooks/useTaskmasterOrchestrator.js.map +1 -0
  1178. package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
  1179. package/dist/src/ui/hooks/useTerminalSize.js +27 -0
  1180. package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
  1181. package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
  1182. package/dist/src/ui/hooks/useThemeCommand.js +73 -0
  1183. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
  1184. package/dist/src/ui/hooks/useTimer.d.ts +12 -0
  1185. package/dist/src/ui/hooks/useTimer.js +58 -0
  1186. package/dist/src/ui/hooks/useTimer.js.map +1 -0
  1187. package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
  1188. package/dist/src/ui/hooks/useTimer.test.js +90 -0
  1189. package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
  1190. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
  1191. package/dist/src/ui/hooks/useToolScheduler.test.js +623 -0
  1192. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
  1193. package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +47 -0
  1194. package/dist/src/ui/hooks/useVisionAutoSwitch.js +262 -0
  1195. package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +1 -0
  1196. package/dist/src/ui/hooks/useVisionAutoSwitch.test.d.ts +6 -0
  1197. package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +515 -0
  1198. package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +1 -0
  1199. package/dist/src/ui/hooks/useWelcomeBack.d.ts +23 -0
  1200. package/dist/src/ui/hooks/useWelcomeBack.js +79 -0
  1201. package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
  1202. package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +13 -0
  1203. package/dist/src/ui/hooks/useWorkspaceMigration.js +54 -0
  1204. package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -0
  1205. package/dist/src/ui/hooks/vim.d.ts +28 -0
  1206. package/dist/src/ui/hooks/vim.js +639 -0
  1207. package/dist/src/ui/hooks/vim.js.map +1 -0
  1208. package/dist/src/ui/keyMatchers.d.ts +27 -0
  1209. package/dist/src/ui/keyMatchers.js +68 -0
  1210. package/dist/src/ui/keyMatchers.js.map +1 -0
  1211. package/dist/src/ui/keyMatchers.test.d.ts +6 -0
  1212. package/dist/src/ui/keyMatchers.test.js +293 -0
  1213. package/dist/src/ui/keyMatchers.test.js.map +1 -0
  1214. package/dist/src/ui/layouts/DefaultAppLayout.d.ts +9 -0
  1215. package/dist/src/ui/layouts/DefaultAppLayout.js +14 -0
  1216. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
  1217. package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
  1218. package/dist/src/ui/layouts/ScreenReaderAppLayout.js +14 -0
  1219. package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
  1220. package/dist/src/ui/models/availableModels.d.ts +56 -0
  1221. package/dist/src/ui/models/availableModels.js +223 -0
  1222. package/dist/src/ui/models/availableModels.js.map +1 -0
  1223. package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
  1224. package/dist/src/ui/noninteractive/nonInteractiveUi.js +29 -0
  1225. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
  1226. package/dist/src/ui/semantic-colors.d.ts +7 -0
  1227. package/dist/src/ui/semantic-colors.js +24 -0
  1228. package/dist/src/ui/semantic-colors.js.map +1 -0
  1229. package/dist/src/ui/state/extensions.d.ts +42 -0
  1230. package/dist/src/ui/state/extensions.js +62 -0
  1231. package/dist/src/ui/state/extensions.js.map +1 -0
  1232. package/dist/src/ui/textConstants.d.ts +9 -0
  1233. package/dist/src/ui/textConstants.js +10 -0
  1234. package/dist/src/ui/textConstants.js.map +1 -0
  1235. package/dist/src/ui/themes/ansi-light.d.ts +7 -0
  1236. package/dist/src/ui/themes/ansi-light.js +142 -0
  1237. package/dist/src/ui/themes/ansi-light.js.map +1 -0
  1238. package/dist/src/ui/themes/ansi.d.ts +7 -0
  1239. package/dist/src/ui/themes/ansi.js +152 -0
  1240. package/dist/src/ui/themes/ansi.js.map +1 -0
  1241. package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
  1242. package/dist/src/ui/themes/atom-one-dark.js +138 -0
  1243. package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
  1244. package/dist/src/ui/themes/ayu-light.d.ts +7 -0
  1245. package/dist/src/ui/themes/ayu-light.js +130 -0
  1246. package/dist/src/ui/themes/ayu-light.js.map +1 -0
  1247. package/dist/src/ui/themes/ayu.d.ts +7 -0
  1248. package/dist/src/ui/themes/ayu.js +104 -0
  1249. package/dist/src/ui/themes/ayu.js.map +1 -0
  1250. package/dist/src/ui/themes/color-utils.d.ts +21 -0
  1251. package/dist/src/ui/themes/color-utils.js +221 -0
  1252. package/dist/src/ui/themes/color-utils.js.map +1 -0
  1253. package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
  1254. package/dist/src/ui/themes/color-utils.test.js +197 -0
  1255. package/dist/src/ui/themes/color-utils.test.js.map +1 -0
  1256. package/dist/src/ui/themes/default-light.d.ts +7 -0
  1257. package/dist/src/ui/themes/default-light.js +100 -0
  1258. package/dist/src/ui/themes/default-light.js.map +1 -0
  1259. package/dist/src/ui/themes/default.d.ts +7 -0
  1260. package/dist/src/ui/themes/default.js +143 -0
  1261. package/dist/src/ui/themes/default.js.map +1 -0
  1262. package/dist/src/ui/themes/dracula.d.ts +7 -0
  1263. package/dist/src/ui/themes/dracula.js +115 -0
  1264. package/dist/src/ui/themes/dracula.js.map +1 -0
  1265. package/dist/src/ui/themes/github-dark.d.ts +7 -0
  1266. package/dist/src/ui/themes/github-dark.js +138 -0
  1267. package/dist/src/ui/themes/github-dark.js.map +1 -0
  1268. package/dist/src/ui/themes/github-light.d.ts +7 -0
  1269. package/dist/src/ui/themes/github-light.js +140 -0
  1270. package/dist/src/ui/themes/github-light.js.map +1 -0
  1271. package/dist/src/ui/themes/googlecode.d.ts +7 -0
  1272. package/dist/src/ui/themes/googlecode.js +137 -0
  1273. package/dist/src/ui/themes/googlecode.js.map +1 -0
  1274. package/dist/src/ui/themes/no-color.d.ts +7 -0
  1275. package/dist/src/ui/themes/no-color.js +115 -0
  1276. package/dist/src/ui/themes/no-color.js.map +1 -0
  1277. package/dist/src/ui/themes/qwen-dark.d.ts +7 -0
  1278. package/dist/src/ui/themes/qwen-dark.js +106 -0
  1279. package/dist/src/ui/themes/qwen-dark.js.map +1 -0
  1280. package/dist/src/ui/themes/qwen-light.d.ts +7 -0
  1281. package/dist/src/ui/themes/qwen-light.js +131 -0
  1282. package/dist/src/ui/themes/qwen-light.js.map +1 -0
  1283. package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
  1284. package/dist/src/ui/themes/semantic-tokens.js +94 -0
  1285. package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
  1286. package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
  1287. package/dist/src/ui/themes/shades-of-purple.js +304 -0
  1288. package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
  1289. package/dist/src/ui/themes/theme-manager.d.ts +66 -0
  1290. package/dist/src/ui/themes/theme-manager.js +270 -0
  1291. package/dist/src/ui/themes/theme-manager.js.map +1 -0
  1292. package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
  1293. package/dist/src/ui/themes/theme-manager.test.js +142 -0
  1294. package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
  1295. package/dist/src/ui/themes/theme.d.ts +130 -0
  1296. package/dist/src/ui/themes/theme.js +379 -0
  1297. package/dist/src/ui/themes/theme.js.map +1 -0
  1298. package/dist/src/ui/themes/xcode.d.ts +7 -0
  1299. package/dist/src/ui/themes/xcode.js +145 -0
  1300. package/dist/src/ui/themes/xcode.js.map +1 -0
  1301. package/dist/src/ui/types.d.ts +311 -0
  1302. package/dist/src/ui/types.js +60 -0
  1303. package/dist/src/ui/types.js.map +1 -0
  1304. package/dist/src/ui/utils/CodeColorizer.d.ts +17 -0
  1305. package/dist/src/ui/utils/CodeColorizer.js +111 -0
  1306. package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
  1307. package/dist/src/ui/utils/ConsolePatcher.d.ts +25 -0
  1308. package/dist/src/ui/utils/ConsolePatcher.js +52 -0
  1309. package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
  1310. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
  1311. package/dist/src/ui/utils/InlineMarkdownRenderer.js +111 -0
  1312. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
  1313. package/dist/src/ui/utils/MarkdownDisplay.d.ts +14 -0
  1314. package/dist/src/ui/utils/MarkdownDisplay.js +207 -0
  1315. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
  1316. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
  1317. package/dist/src/ui/utils/MarkdownDisplay.test.js +169 -0
  1318. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
  1319. package/dist/src/ui/utils/TableRenderer.d.ts +17 -0
  1320. package/dist/src/ui/utils/TableRenderer.js +84 -0
  1321. package/dist/src/ui/utils/TableRenderer.js.map +1 -0
  1322. package/dist/src/ui/utils/clipboardUtils.d.ts +22 -0
  1323. package/dist/src/ui/utils/clipboardUtils.js +126 -0
  1324. package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
  1325. package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
  1326. package/dist/src/ui/utils/clipboardUtils.test.js +65 -0
  1327. package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
  1328. package/dist/src/ui/utils/commandUtils.d.ts +40 -0
  1329. package/dist/src/ui/utils/commandUtils.js +146 -0
  1330. package/dist/src/ui/utils/commandUtils.js.map +1 -0
  1331. package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
  1332. package/dist/src/ui/utils/commandUtils.test.js +352 -0
  1333. package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
  1334. package/dist/src/ui/utils/computeStats.d.ts +10 -0
  1335. package/dist/src/ui/utils/computeStats.js +57 -0
  1336. package/dist/src/ui/utils/computeStats.js.map +1 -0
  1337. package/dist/src/ui/utils/displayUtils.d.ts +18 -0
  1338. package/dist/src/ui/utils/displayUtils.js +27 -0
  1339. package/dist/src/ui/utils/displayUtils.js.map +1 -0
  1340. package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
  1341. package/dist/src/ui/utils/displayUtils.test.js +61 -0
  1342. package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
  1343. package/dist/src/ui/utils/formatters.d.ts +13 -0
  1344. package/dist/src/ui/utils/formatters.js +56 -0
  1345. package/dist/src/ui/utils/formatters.js.map +1 -0
  1346. package/dist/src/ui/utils/formatters.test.d.ts +6 -0
  1347. package/dist/src/ui/utils/formatters.test.js +56 -0
  1348. package/dist/src/ui/utils/formatters.test.js.map +1 -0
  1349. package/dist/src/ui/utils/highlight.d.ts +11 -0
  1350. package/dist/src/ui/utils/highlight.js +78 -0
  1351. package/dist/src/ui/utils/highlight.js.map +1 -0
  1352. package/dist/src/ui/utils/highlight.test.d.ts +6 -0
  1353. package/dist/src/ui/utils/highlight.test.js +120 -0
  1354. package/dist/src/ui/utils/highlight.test.js.map +1 -0
  1355. package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
  1356. package/dist/src/ui/utils/isNarrowWidth.js +9 -0
  1357. package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
  1358. package/dist/src/ui/utils/kittyProtocolDetector.d.ts +13 -0
  1359. package/dist/src/ui/utils/kittyProtocolDetector.js +98 -0
  1360. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
  1361. package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
  1362. package/dist/src/ui/utils/markdownUtilities.js +110 -0
  1363. package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
  1364. package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
  1365. package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
  1366. package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
  1367. package/dist/src/ui/utils/platformConstants.d.ts +75 -0
  1368. package/dist/src/ui/utils/platformConstants.js +78 -0
  1369. package/dist/src/ui/utils/platformConstants.js.map +1 -0
  1370. package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
  1371. package/dist/src/ui/utils/terminalSetup.js +308 -0
  1372. package/dist/src/ui/utils/terminalSetup.js.map +1 -0
  1373. package/dist/src/ui/utils/textUtils.d.ts +42 -0
  1374. package/dist/src/ui/utils/textUtils.js +185 -0
  1375. package/dist/src/ui/utils/textUtils.js.map +1 -0
  1376. package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
  1377. package/dist/src/ui/utils/textUtils.test.js +132 -0
  1378. package/dist/src/ui/utils/textUtils.test.js.map +1 -0
  1379. package/dist/src/ui/utils/updateCheck.d.ts +12 -0
  1380. package/dist/src/ui/utils/updateCheck.js +78 -0
  1381. package/dist/src/ui/utils/updateCheck.js.map +1 -0
  1382. package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
  1383. package/dist/src/ui/utils/updateCheck.test.js +145 -0
  1384. package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
  1385. package/dist/src/utils/attentionNotification.d.ts +20 -0
  1386. package/dist/src/utils/attentionNotification.js +34 -0
  1387. package/dist/src/utils/attentionNotification.js.map +1 -0
  1388. package/dist/src/utils/attentionNotification.test.d.ts +6 -0
  1389. package/dist/src/utils/attentionNotification.test.js +46 -0
  1390. package/dist/src/utils/attentionNotification.test.js.map +1 -0
  1391. package/dist/src/utils/checks.d.ts +19 -0
  1392. package/dist/src/utils/checks.js +24 -0
  1393. package/dist/src/utils/checks.js.map +1 -0
  1394. package/dist/src/utils/cleanup.d.ts +8 -0
  1395. package/dist/src/utils/cleanup.js +35 -0
  1396. package/dist/src/utils/cleanup.js.map +1 -0
  1397. package/dist/src/utils/commands.d.ts +20 -0
  1398. package/dist/src/utils/commands.js +53 -0
  1399. package/dist/src/utils/commands.js.map +1 -0
  1400. package/dist/src/utils/commands.test.d.ts +6 -0
  1401. package/dist/src/utils/commands.test.js +115 -0
  1402. package/dist/src/utils/commands.test.js.map +1 -0
  1403. package/dist/src/utils/commentJson.d.ts +9 -0
  1404. package/dist/src/utils/commentJson.js +55 -0
  1405. package/dist/src/utils/commentJson.js.map +1 -0
  1406. package/dist/src/utils/commentJson.test.d.ts +6 -0
  1407. package/dist/src/utils/commentJson.test.js +146 -0
  1408. package/dist/src/utils/commentJson.test.js.map +1 -0
  1409. package/dist/src/utils/deepMerge.d.ts +9 -0
  1410. package/dist/src/utils/deepMerge.js +58 -0
  1411. package/dist/src/utils/deepMerge.js.map +1 -0
  1412. package/dist/src/utils/deepMerge.test.d.ts +6 -0
  1413. package/dist/src/utils/deepMerge.test.js +143 -0
  1414. package/dist/src/utils/deepMerge.test.js.map +1 -0
  1415. package/dist/src/utils/dialogScopeUtils.d.ts +28 -0
  1416. package/dist/src/utils/dialogScopeUtils.js +51 -0
  1417. package/dist/src/utils/dialogScopeUtils.js.map +1 -0
  1418. package/dist/src/utils/envVarResolver.d.ts +39 -0
  1419. package/dist/src/utils/envVarResolver.js +97 -0
  1420. package/dist/src/utils/envVarResolver.js.map +1 -0
  1421. package/dist/src/utils/envVarResolver.test.d.ts +6 -0
  1422. package/dist/src/utils/envVarResolver.test.js +221 -0
  1423. package/dist/src/utils/envVarResolver.test.js.map +1 -0
  1424. package/dist/src/utils/errors.d.ts +35 -0
  1425. package/dist/src/utils/errors.js +106 -0
  1426. package/dist/src/utils/errors.js.map +1 -0
  1427. package/dist/src/utils/errors.test.d.ts +6 -0
  1428. package/dist/src/utils/errors.test.js +340 -0
  1429. package/dist/src/utils/errors.test.js.map +1 -0
  1430. package/dist/src/utils/events.d.ts +12 -0
  1431. package/dist/src/utils/events.js +14 -0
  1432. package/dist/src/utils/events.js.map +1 -0
  1433. package/dist/src/utils/gitUtils.d.ts +30 -0
  1434. package/dist/src/utils/gitUtils.js +89 -0
  1435. package/dist/src/utils/gitUtils.js.map +1 -0
  1436. package/dist/src/utils/gitUtils.test.d.ts +6 -0
  1437. package/dist/src/utils/gitUtils.test.js +113 -0
  1438. package/dist/src/utils/gitUtils.test.js.map +1 -0
  1439. package/dist/src/utils/handleAutoUpdate.d.ts +11 -0
  1440. package/dist/src/utils/handleAutoUpdate.js +102 -0
  1441. package/dist/src/utils/handleAutoUpdate.js.map +1 -0
  1442. package/dist/src/utils/installationInfo.d.ts +23 -0
  1443. package/dist/src/utils/installationInfo.js +153 -0
  1444. package/dist/src/utils/installationInfo.js.map +1 -0
  1445. package/dist/src/utils/installationInfo.test.d.ts +6 -0
  1446. package/dist/src/utils/installationInfo.test.js +242 -0
  1447. package/dist/src/utils/installationInfo.test.js.map +1 -0
  1448. package/dist/src/utils/math.d.ts +13 -0
  1449. package/dist/src/utils/math.js +14 -0
  1450. package/dist/src/utils/math.js.map +1 -0
  1451. package/dist/src/utils/nonInteractiveHelpers.d.ts +88 -0
  1452. package/dist/src/utils/nonInteractiveHelpers.js +470 -0
  1453. package/dist/src/utils/nonInteractiveHelpers.js.map +1 -0
  1454. package/dist/src/utils/nonInteractiveHelpers.test.d.ts +6 -0
  1455. package/dist/src/utils/nonInteractiveHelpers.test.js +945 -0
  1456. package/dist/src/utils/nonInteractiveHelpers.test.js.map +1 -0
  1457. package/dist/src/utils/package.d.ts +12 -0
  1458. package/dist/src/utils/package.js +24 -0
  1459. package/dist/src/utils/package.js.map +1 -0
  1460. package/dist/src/utils/processUtils.d.ts +13 -0
  1461. package/dist/src/utils/processUtils.js +18 -0
  1462. package/dist/src/utils/processUtils.js.map +1 -0
  1463. package/dist/src/utils/processUtils.test.d.ts +6 -0
  1464. package/dist/src/utils/processUtils.test.js +20 -0
  1465. package/dist/src/utils/processUtils.test.js.map +1 -0
  1466. package/dist/src/utils/readStdin.d.ts +6 -0
  1467. package/dist/src/utils/readStdin.js +59 -0
  1468. package/dist/src/utils/readStdin.js.map +1 -0
  1469. package/dist/src/utils/readStdin.test.d.ts +6 -0
  1470. package/dist/src/utils/readStdin.test.js +88 -0
  1471. package/dist/src/utils/readStdin.test.js.map +1 -0
  1472. package/dist/src/utils/relaunch.d.ts +7 -0
  1473. package/dist/src/utils/relaunch.js +57 -0
  1474. package/dist/src/utils/relaunch.js.map +1 -0
  1475. package/dist/src/utils/relaunch.test.d.ts +6 -0
  1476. package/dist/src/utils/relaunch.test.js +273 -0
  1477. package/dist/src/utils/relaunch.test.js.map +1 -0
  1478. package/dist/src/utils/resolvePath.d.ts +6 -0
  1479. package/dist/src/utils/resolvePath.js +21 -0
  1480. package/dist/src/utils/resolvePath.js.map +1 -0
  1481. package/dist/src/utils/sandbox-macos-permissive-closed.sb +32 -0
  1482. package/dist/src/utils/sandbox-macos-permissive-open.sb +25 -0
  1483. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +37 -0
  1484. package/dist/src/utils/sandbox-macos-restrictive-closed.sb +93 -0
  1485. package/dist/src/utils/sandbox-macos-restrictive-open.sb +96 -0
  1486. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +98 -0
  1487. package/dist/src/utils/sandbox.d.ts +7 -0
  1488. package/dist/src/utils/sandbox.js +763 -0
  1489. package/dist/src/utils/sandbox.js.map +1 -0
  1490. package/dist/src/utils/settingsUtils.d.ts +144 -0
  1491. package/dist/src/utils/settingsUtils.js +346 -0
  1492. package/dist/src/utils/settingsUtils.js.map +1 -0
  1493. package/dist/src/utils/settingsUtils.test.d.ts +6 -0
  1494. package/dist/src/utils/settingsUtils.test.js +808 -0
  1495. package/dist/src/utils/settingsUtils.test.js.map +1 -0
  1496. package/dist/src/utils/spawnWrapper.d.ts +7 -0
  1497. package/dist/src/utils/spawnWrapper.js +8 -0
  1498. package/dist/src/utils/spawnWrapper.js.map +1 -0
  1499. package/dist/src/utils/startupWarnings.d.ts +6 -0
  1500. package/dist/src/utils/startupWarnings.js +40 -0
  1501. package/dist/src/utils/startupWarnings.js.map +1 -0
  1502. package/dist/src/utils/systemInfo.d.ts +66 -0
  1503. package/dist/src/utils/systemInfo.js +125 -0
  1504. package/dist/src/utils/systemInfo.js.map +1 -0
  1505. package/dist/src/utils/systemInfo.test.d.ts +6 -0
  1506. package/dist/src/utils/systemInfo.test.js +259 -0
  1507. package/dist/src/utils/systemInfo.test.js.map +1 -0
  1508. package/dist/src/utils/systemInfoFields.d.ts +22 -0
  1509. package/dist/src/utils/systemInfoFields.js +96 -0
  1510. package/dist/src/utils/systemInfoFields.js.map +1 -0
  1511. package/dist/src/utils/updateEventEmitter.d.ts +11 -0
  1512. package/dist/src/utils/updateEventEmitter.js +12 -0
  1513. package/dist/src/utils/updateEventEmitter.js.map +1 -0
  1514. package/dist/src/utils/userStartupWarnings.d.ts +12 -0
  1515. package/dist/src/utils/userStartupWarnings.js +74 -0
  1516. package/dist/src/utils/userStartupWarnings.js.map +1 -0
  1517. package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
  1518. package/dist/src/utils/userStartupWarnings.test.js +88 -0
  1519. package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
  1520. package/dist/src/utils/version.d.ts +6 -0
  1521. package/dist/src/utils/version.js +11 -0
  1522. package/dist/src/utils/version.js.map +1 -0
  1523. package/dist/src/utils/windowTitle.d.ts +12 -0
  1524. package/dist/src/utils/windowTitle.js +19 -0
  1525. package/dist/src/utils/windowTitle.js.map +1 -0
  1526. package/dist/src/utils/windowTitle.test.d.ts +6 -0
  1527. package/dist/src/utils/windowTitle.test.js +49 -0
  1528. package/dist/src/utils/windowTitle.test.js.map +1 -0
  1529. package/dist/src/validateNonInterActiveAuth.d.ts +9 -0
  1530. package/dist/src/validateNonInterActiveAuth.js +76 -0
  1531. package/dist/src/validateNonInterActiveAuth.js.map +1 -0
  1532. package/dist/src/zed-integration/acp.d.ts +63 -0
  1533. package/dist/src/zed-integration/acp.js +225 -0
  1534. package/dist/src/zed-integration/acp.js.map +1 -0
  1535. package/dist/src/zed-integration/fileSystemService.d.ts +20 -0
  1536. package/dist/src/zed-integration/fileSystemService.js +46 -0
  1537. package/dist/src/zed-integration/fileSystemService.js.map +1 -0
  1538. package/dist/src/zed-integration/schema.d.ts +12024 -0
  1539. package/dist/src/zed-integration/schema.js +324 -0
  1540. package/dist/src/zed-integration/schema.js.map +1 -0
  1541. package/dist/src/zed-integration/zedIntegration.d.ts +17 -0
  1542. package/dist/src/zed-integration/zedIntegration.js +1135 -0
  1543. package/dist/src/zed-integration/zedIntegration.js.map +1 -0
  1544. package/dist/tsconfig.tsbuildinfo +1 -0
  1545. package/package.json +102 -0
@@ -0,0 +1,2036 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 OSAgent OC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
7
+ import { renderHook, act, waitFor } from '@testing-library/react';
8
+ import { useOSAStream } from './useGeminiStream.js';
9
+ import { useKeypress } from './useKeypress.js';
10
+ import * as atCommandProcessor from './atCommandProcessor.js';
11
+ import { useReactToolScheduler } from './useReactToolScheduler.js';
12
+ import { ApprovalMode, AuthType, OSAEventType as ServerOSAEventType, ToolErrorType, ToolConfirmationOutcome, } from 'osagent-core';
13
+ import { MessageType, StreamingState } from '../types.js';
14
+ // --- MOCKS ---
15
+ const mockSendMessageStream = vi
16
+ .fn()
17
+ .mockReturnValue((async function* () { })());
18
+ const mockStartChat = vi.fn();
19
+ const MockedOSAClientClass = vi.hoisted(() => vi.fn().mockImplementation(function (_config) {
20
+ // _config
21
+ this.startChat = mockStartChat;
22
+ this.sendMessageStream = mockSendMessageStream;
23
+ this.addHistory = vi.fn();
24
+ this.getChatRecordingService = vi.fn().mockReturnValue({
25
+ recordThought: vi.fn(),
26
+ initialize: vi.fn(),
27
+ recordMessage: vi.fn(),
28
+ recordMessageTokens: vi.fn(),
29
+ recordToolCalls: vi.fn(),
30
+ getConversationFile: vi.fn(),
31
+ });
32
+ }));
33
+ const MockedUserPromptEvent = vi.hoisted(() => vi.fn().mockImplementation(() => { }));
34
+ const MockedApiCancelEvent = vi.hoisted(() => vi.fn().mockImplementation(() => { }));
35
+ const mockParseAndFormatApiError = vi.hoisted(() => vi.fn());
36
+ const mockLogApiCancel = vi.hoisted(() => vi.fn());
37
+ // Vision auto-switch mocks (hoisted)
38
+ const mockHandleVisionSwitch = vi.hoisted(() => vi.fn().mockResolvedValue({ shouldProceed: true }));
39
+ const mockRestoreOriginalModel = vi.hoisted(() => vi.fn().mockResolvedValue(undefined));
40
+ vi.mock('osagent-core', async (importOriginal) => {
41
+ const actualCoreModule = (await importOriginal());
42
+ return {
43
+ ...actualCoreModule,
44
+ GitService: vi.fn(),
45
+ OSAClient: MockedOSAClientClass,
46
+ UserPromptEvent: MockedUserPromptEvent,
47
+ ApiCancelEvent: MockedApiCancelEvent,
48
+ parseAndFormatApiError: mockParseAndFormatApiError,
49
+ logApiCancel: mockLogApiCancel,
50
+ };
51
+ });
52
+ const mockUseReactToolScheduler = useReactToolScheduler;
53
+ vi.mock('./useReactToolScheduler.js', async (importOriginal) => {
54
+ const actualSchedulerModule = (await importOriginal());
55
+ return {
56
+ ...(actualSchedulerModule || {}),
57
+ useReactToolScheduler: vi.fn(),
58
+ };
59
+ });
60
+ vi.mock('./useVisionAutoSwitch.js', () => ({
61
+ useVisionAutoSwitch: vi.fn(() => ({
62
+ handleVisionSwitch: mockHandleVisionSwitch,
63
+ restoreOriginalModel: mockRestoreOriginalModel,
64
+ })),
65
+ }));
66
+ vi.mock('./useKeypress.js', () => ({
67
+ useKeypress: vi.fn(),
68
+ }));
69
+ vi.mock('./shellCommandProcessor.js', () => ({
70
+ useShellCommandProcessor: vi.fn().mockReturnValue({
71
+ handleShellCommand: vi.fn(),
72
+ }),
73
+ }));
74
+ vi.mock('./atCommandProcessor.js');
75
+ vi.mock('../utils/markdownUtilities.js', () => ({
76
+ findLastSafeSplitPoint: vi.fn((s) => s.length),
77
+ }));
78
+ vi.mock('./useStateAndRef.js', () => ({
79
+ useStateAndRef: vi.fn((initial) => {
80
+ let val = initial;
81
+ const ref = { current: val };
82
+ const setVal = vi.fn((updater) => {
83
+ if (typeof updater === 'function') {
84
+ val = updater(val);
85
+ }
86
+ else {
87
+ val = updater;
88
+ }
89
+ ref.current = val;
90
+ });
91
+ return [val, ref, setVal];
92
+ }),
93
+ }));
94
+ vi.mock('./useLogger.js', () => ({
95
+ useLogger: vi.fn().mockReturnValue({
96
+ logMessage: vi.fn().mockResolvedValue(undefined),
97
+ }),
98
+ }));
99
+ const mockStartNewPrompt = vi.fn();
100
+ const mockAddUsage = vi.fn();
101
+ vi.mock('../contexts/SessionContext.js', () => ({
102
+ useSessionStats: vi.fn(() => ({
103
+ startNewPrompt: mockStartNewPrompt,
104
+ addUsage: mockAddUsage,
105
+ getPromptCount: vi.fn(() => 5),
106
+ })),
107
+ }));
108
+ vi.mock('./slashCommandProcessor.js', () => ({
109
+ handleSlashCommand: vi.fn().mockReturnValue(false),
110
+ }));
111
+ // --- END MOCKS ---
112
+ // --- Tests for useOSAStream Hook ---
113
+ describe('useOSAStream', () => {
114
+ let mockAddItem;
115
+ let mockConfig;
116
+ let mockOnDebugMessage;
117
+ let mockHandleSlashCommand;
118
+ let mockScheduleToolCalls;
119
+ let mockCancelAllToolCalls;
120
+ let mockMarkToolsAsSubmitted;
121
+ let handleAtCommandSpy;
122
+ beforeEach(() => {
123
+ vi.clearAllMocks(); // Clear mocks before each test
124
+ mockAddItem = vi.fn();
125
+ // Define the mock for getOSAClient
126
+ const mockGetOSAClient = vi.fn().mockImplementation(() => {
127
+ // MockedOSAClientClass is defined in the module scope by the previous change.
128
+ // It will use the mockStartChat and mockSendMessageStream that are managed within beforeEach.
129
+ const clientInstance = new MockedOSAClientClass(mockConfig);
130
+ return clientInstance;
131
+ });
132
+ const contentGeneratorConfig = {
133
+ model: 'test-model',
134
+ apiKey: 'test-key',
135
+ vertexai: false,
136
+ authType: AuthType.USE_OSA,
137
+ };
138
+ mockConfig = {
139
+ apiKey: 'test-api-key',
140
+ model: 'OSA-pro',
141
+ sandbox: false,
142
+ targetDir: '/test/dir',
143
+ debugMode: false,
144
+ question: undefined,
145
+ fullContext: false,
146
+ coreTools: [],
147
+ toolDiscoveryCommand: undefined,
148
+ toolCallCommand: undefined,
149
+ mcpServerCommand: undefined,
150
+ mcpServers: undefined,
151
+ userAgent: 'test-agent',
152
+ userMemory: '',
153
+ OSAMdFileCount: 0,
154
+ alwaysSkipModificationConfirmation: false,
155
+ vertexai: false,
156
+ showMemoryUsage: false,
157
+ contextFileName: undefined,
158
+ getToolRegistry: vi.fn(() => ({ getToolSchemaList: vi.fn(() => []) })),
159
+ getProjectRoot: vi.fn(() => '/test/dir'),
160
+ getCheckpointingEnabled: vi.fn(() => false),
161
+ getOSAClient: mockGetOSAClient,
162
+ getApprovalMode: () => ApprovalMode.DEFAULT,
163
+ getUsageStatisticsEnabled: () => true,
164
+ getDebugMode: () => false,
165
+ addHistory: vi.fn(),
166
+ getSessionId() {
167
+ return 'test-session-id';
168
+ },
169
+ setQuotaErrorOccurred: vi.fn(),
170
+ getQuotaErrorOccurred: vi.fn(() => false),
171
+ getModel: vi.fn(() => 'OSA-2.5-pro'),
172
+ getContentGeneratorConfig: vi
173
+ .fn()
174
+ .mockReturnValue(contentGeneratorConfig),
175
+ getMaxSessionTurns: vi.fn(() => 50),
176
+ getUseSmartEdit: () => false,
177
+ };
178
+ mockOnDebugMessage = vi.fn();
179
+ mockHandleSlashCommand = vi.fn().mockResolvedValue(false);
180
+ // Mock return value for useReactToolScheduler
181
+ mockScheduleToolCalls = vi.fn();
182
+ mockCancelAllToolCalls = vi.fn();
183
+ mockMarkToolsAsSubmitted = vi.fn();
184
+ // Default mock for useReactToolScheduler to prevent toolCalls being undefined initially
185
+ mockUseReactToolScheduler.mockReturnValue([
186
+ [], // Default to empty array for toolCalls
187
+ mockScheduleToolCalls,
188
+ mockCancelAllToolCalls,
189
+ mockMarkToolsAsSubmitted,
190
+ ]);
191
+ // Reset mocks for OSAClient instance methods (startChat and sendMessageStream)
192
+ // The OSAClient constructor itself is mocked at the module level.
193
+ mockStartChat.mockClear().mockResolvedValue({
194
+ sendMessageStream: mockSendMessageStream,
195
+ }); // OSAChat -> any
196
+ mockSendMessageStream
197
+ .mockClear()
198
+ .mockReturnValue((async function* () { })());
199
+ handleAtCommandSpy = vi.spyOn(atCommandProcessor, 'handleAtCommand');
200
+ });
201
+ const mockLoadedSettings = {
202
+ merged: { preferredEditor: 'vscode' },
203
+ user: { path: '/user/settings.json', settings: {} },
204
+ workspace: { path: '/workspace/.OSA/settings.json', settings: {} },
205
+ errors: [],
206
+ forScope: vi.fn(),
207
+ setValue: vi.fn(),
208
+ };
209
+ const renderTestHook = (initialToolCalls = [], OSAClient) => {
210
+ let currentToolCalls = initialToolCalls;
211
+ const setToolCalls = (newToolCalls) => {
212
+ currentToolCalls = newToolCalls;
213
+ };
214
+ mockUseReactToolScheduler.mockImplementation(() => [
215
+ currentToolCalls,
216
+ mockScheduleToolCalls,
217
+ mockCancelAllToolCalls,
218
+ mockMarkToolsAsSubmitted,
219
+ ]);
220
+ const client = OSAClient || mockConfig.getOSAClient();
221
+ const { result, rerender } = renderHook((props) => {
222
+ // Update the mock's return value if new toolCalls are passed in props
223
+ if (props.toolCalls) {
224
+ setToolCalls(props.toolCalls);
225
+ }
226
+ return useOSAStream(props.client, props.history, props.addItem, props.config, props.loadedSettings, props.onDebugMessage, props.handleSlashCommand, props.shellModeActive, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
227
+ () => { }, 80, 24);
228
+ }, {
229
+ initialProps: {
230
+ client,
231
+ history: [],
232
+ addItem: mockAddItem,
233
+ config: mockConfig,
234
+ onDebugMessage: mockOnDebugMessage,
235
+ handleSlashCommand: mockHandleSlashCommand,
236
+ shellModeActive: false,
237
+ loadedSettings: mockLoadedSettings,
238
+ toolCalls: initialToolCalls,
239
+ },
240
+ });
241
+ return {
242
+ result,
243
+ rerender,
244
+ mockMarkToolsAsSubmitted,
245
+ mockSendMessageStream,
246
+ client,
247
+ };
248
+ };
249
+ it('should not submit tool responses if not all tool calls are completed', () => {
250
+ const toolCalls = [
251
+ {
252
+ request: {
253
+ callId: 'call1',
254
+ name: 'tool1',
255
+ args: {},
256
+ isClientInitiated: false,
257
+ prompt_id: 'prompt-id-1',
258
+ },
259
+ status: 'success',
260
+ responseSubmittedToOSA: false,
261
+ response: {
262
+ callId: 'call1',
263
+ responseParts: [{ text: 'tool 1 response' }],
264
+ error: undefined,
265
+ errorType: undefined, // FIX: Added missing property
266
+ resultDisplay: 'Tool 1 success display',
267
+ },
268
+ tool: {
269
+ name: 'tool1',
270
+ displayName: 'tool1',
271
+ description: 'desc1',
272
+ build: vi.fn(),
273
+ },
274
+ invocation: {
275
+ getDescription: () => `Mock description`,
276
+ },
277
+ startTime: Date.now(),
278
+ endTime: Date.now(),
279
+ },
280
+ {
281
+ request: {
282
+ callId: 'call2',
283
+ name: 'tool2',
284
+ args: {},
285
+ prompt_id: 'prompt-id-1',
286
+ },
287
+ status: 'executing',
288
+ responseSubmittedToOSA: false,
289
+ tool: {
290
+ name: 'tool2',
291
+ displayName: 'tool2',
292
+ description: 'desc2',
293
+ build: vi.fn(),
294
+ },
295
+ invocation: {
296
+ getDescription: () => `Mock description`,
297
+ },
298
+ startTime: Date.now(),
299
+ liveOutput: '...',
300
+ },
301
+ ];
302
+ const { mockMarkToolsAsSubmitted, mockSendMessageStream } = renderTestHook(toolCalls);
303
+ // Effect for submitting tool responses depends on toolCalls and isResponding
304
+ // isResponding is initially false, so the effect should run.
305
+ expect(mockMarkToolsAsSubmitted).not.toHaveBeenCalled();
306
+ expect(mockSendMessageStream).not.toHaveBeenCalled(); // submitQuery uses this
307
+ });
308
+ it('should submit tool responses when all tool calls are completed and ready', async () => {
309
+ const toolCall1ResponseParts = [{ text: 'tool 1 final response' }];
310
+ const toolCall2ResponseParts = [{ text: 'tool 2 final response' }];
311
+ const completedToolCalls = [
312
+ {
313
+ request: {
314
+ callId: 'call1',
315
+ name: 'tool1',
316
+ args: {},
317
+ isClientInitiated: false,
318
+ prompt_id: 'prompt-id-2',
319
+ },
320
+ status: 'success',
321
+ responseSubmittedToOSA: false,
322
+ response: {
323
+ callId: 'call1',
324
+ responseParts: toolCall1ResponseParts,
325
+ errorType: undefined, // FIX: Added missing property
326
+ },
327
+ tool: {
328
+ displayName: 'MockTool',
329
+ },
330
+ invocation: {
331
+ getDescription: () => `Mock description`,
332
+ },
333
+ },
334
+ {
335
+ request: {
336
+ callId: 'call2',
337
+ name: 'tool2',
338
+ args: {},
339
+ isClientInitiated: false,
340
+ prompt_id: 'prompt-id-2',
341
+ },
342
+ status: 'error',
343
+ responseSubmittedToOSA: false,
344
+ response: {
345
+ callId: 'call2',
346
+ responseParts: toolCall2ResponseParts,
347
+ errorType: ToolErrorType.UNHANDLED_EXCEPTION, // FIX: Added missing property
348
+ },
349
+ },
350
+ ];
351
+ // Capture the onComplete callback
352
+ let capturedOnComplete = null;
353
+ mockUseReactToolScheduler.mockImplementation((onComplete) => {
354
+ capturedOnComplete = onComplete;
355
+ return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted];
356
+ });
357
+ renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
358
+ () => { }, 80, 24));
359
+ // Trigger the onComplete callback with completed tools
360
+ await act(async () => {
361
+ if (capturedOnComplete) {
362
+ await capturedOnComplete(completedToolCalls);
363
+ }
364
+ });
365
+ await waitFor(() => {
366
+ expect(mockMarkToolsAsSubmitted).toHaveBeenCalledTimes(1);
367
+ expect(mockSendMessageStream).toHaveBeenCalledTimes(1);
368
+ });
369
+ const expectedMergedResponse = [
370
+ ...toolCall1ResponseParts,
371
+ ...toolCall2ResponseParts,
372
+ ];
373
+ expect(mockSendMessageStream).toHaveBeenCalledWith(expectedMergedResponse, expect.any(AbortSignal), 'prompt-id-2');
374
+ });
375
+ it('should handle all tool calls being cancelled', async () => {
376
+ const cancelledToolCalls = [
377
+ {
378
+ request: {
379
+ callId: '1',
380
+ name: 'testTool',
381
+ args: {},
382
+ isClientInitiated: false,
383
+ prompt_id: 'prompt-id-3',
384
+ },
385
+ status: 'cancelled',
386
+ response: {
387
+ callId: '1',
388
+ responseParts: [{ text: 'cancelled' }],
389
+ errorType: undefined, // FIX: Added missing property
390
+ },
391
+ responseSubmittedToOSA: false,
392
+ tool: {
393
+ displayName: 'mock tool',
394
+ },
395
+ invocation: {
396
+ getDescription: () => `Mock description`,
397
+ },
398
+ },
399
+ ];
400
+ const client = new MockedOSAClientClass(mockConfig);
401
+ // Capture the onComplete callback
402
+ let capturedOnComplete = null;
403
+ mockUseReactToolScheduler.mockImplementation((onComplete) => {
404
+ capturedOnComplete = onComplete;
405
+ return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted];
406
+ });
407
+ renderHook(() => useOSAStream(client, [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
408
+ () => { }, 80, 24));
409
+ // Trigger the onComplete callback with cancelled tools
410
+ await act(async () => {
411
+ if (capturedOnComplete) {
412
+ await capturedOnComplete(cancelledToolCalls);
413
+ }
414
+ });
415
+ await waitFor(() => {
416
+ expect(mockMarkToolsAsSubmitted).toHaveBeenCalledWith(['1']);
417
+ expect(client.addHistory).toHaveBeenCalledWith({
418
+ role: 'user',
419
+ parts: [{ text: 'cancelled' }],
420
+ });
421
+ // Ensure we do NOT call back to the API
422
+ expect(mockSendMessageStream).not.toHaveBeenCalled();
423
+ });
424
+ });
425
+ it('should group multiple cancelled tool call responses into a single history entry', async () => {
426
+ const cancelledToolCall1 = {
427
+ request: {
428
+ callId: 'cancel-1',
429
+ name: 'toolA',
430
+ args: {},
431
+ isClientInitiated: false,
432
+ prompt_id: 'prompt-id-7',
433
+ },
434
+ tool: {
435
+ name: 'toolA',
436
+ displayName: 'toolA',
437
+ description: 'descA',
438
+ build: vi.fn(),
439
+ },
440
+ invocation: {
441
+ getDescription: () => `Mock description`,
442
+ },
443
+ status: 'cancelled',
444
+ response: {
445
+ callId: 'cancel-1',
446
+ responseParts: [
447
+ { functionResponse: { name: 'toolA', id: 'cancel-1' } },
448
+ ],
449
+ resultDisplay: undefined,
450
+ error: undefined,
451
+ errorType: undefined, // FIX: Added missing property
452
+ },
453
+ responseSubmittedToOSA: false,
454
+ };
455
+ const cancelledToolCall2 = {
456
+ request: {
457
+ callId: 'cancel-2',
458
+ name: 'toolB',
459
+ args: {},
460
+ isClientInitiated: false,
461
+ prompt_id: 'prompt-id-8',
462
+ },
463
+ tool: {
464
+ name: 'toolB',
465
+ displayName: 'toolB',
466
+ description: 'descB',
467
+ build: vi.fn(),
468
+ },
469
+ invocation: {
470
+ getDescription: () => `Mock description`,
471
+ },
472
+ status: 'cancelled',
473
+ response: {
474
+ callId: 'cancel-2',
475
+ responseParts: [
476
+ { functionResponse: { name: 'toolB', id: 'cancel-2' } },
477
+ ],
478
+ resultDisplay: undefined,
479
+ error: undefined,
480
+ errorType: undefined, // FIX: Added missing property
481
+ },
482
+ responseSubmittedToOSA: false,
483
+ };
484
+ const allCancelledTools = [cancelledToolCall1, cancelledToolCall2];
485
+ const client = new MockedOSAClientClass(mockConfig);
486
+ let capturedOnComplete = null;
487
+ mockUseReactToolScheduler.mockImplementation((onComplete) => {
488
+ capturedOnComplete = onComplete;
489
+ return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted];
490
+ });
491
+ renderHook(() => useOSAStream(client, [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
492
+ () => { }, 80, 24));
493
+ // Trigger the onComplete callback with multiple cancelled tools
494
+ await act(async () => {
495
+ if (capturedOnComplete) {
496
+ await capturedOnComplete(allCancelledTools);
497
+ }
498
+ });
499
+ await waitFor(() => {
500
+ // The tools should be marked as submitted locally
501
+ expect(mockMarkToolsAsSubmitted).toHaveBeenCalledWith([
502
+ 'cancel-1',
503
+ 'cancel-2',
504
+ ]);
505
+ // Crucially, addHistory should be called only ONCE
506
+ expect(client.addHistory).toHaveBeenCalledTimes(1);
507
+ // And that single call should contain BOTH function responses
508
+ expect(client.addHistory).toHaveBeenCalledWith({
509
+ role: 'user',
510
+ parts: [
511
+ ...cancelledToolCall1.response.responseParts,
512
+ ...cancelledToolCall2.response.responseParts,
513
+ ],
514
+ });
515
+ // No message should be sent back to the API for a turn with only cancellations
516
+ expect(mockSendMessageStream).not.toHaveBeenCalled();
517
+ });
518
+ });
519
+ it('should not flicker streaming state to Idle between tool completion and submission', async () => {
520
+ const toolCallResponseParts = [
521
+ { text: 'tool 1 final response' },
522
+ ];
523
+ const initialToolCalls = [
524
+ {
525
+ request: {
526
+ callId: 'call1',
527
+ name: 'tool1',
528
+ args: {},
529
+ isClientInitiated: false,
530
+ prompt_id: 'prompt-id-4',
531
+ },
532
+ status: 'executing',
533
+ responseSubmittedToOSA: false,
534
+ tool: {
535
+ name: 'tool1',
536
+ displayName: 'tool1',
537
+ description: 'desc',
538
+ build: vi.fn(),
539
+ },
540
+ invocation: {
541
+ getDescription: () => `Mock description`,
542
+ },
543
+ startTime: Date.now(),
544
+ },
545
+ ];
546
+ const completedToolCalls = [
547
+ {
548
+ ...initialToolCalls[0],
549
+ status: 'success',
550
+ response: {
551
+ callId: 'call1',
552
+ responseParts: toolCallResponseParts,
553
+ error: undefined,
554
+ errorType: undefined, // FIX: Added missing property
555
+ resultDisplay: 'Tool 1 success display',
556
+ },
557
+ endTime: Date.now(),
558
+ },
559
+ ];
560
+ // Capture the onComplete callback
561
+ let capturedOnComplete = null;
562
+ let currentToolCalls = initialToolCalls;
563
+ mockUseReactToolScheduler.mockImplementation((onComplete) => {
564
+ capturedOnComplete = onComplete;
565
+ return [
566
+ currentToolCalls,
567
+ mockScheduleToolCalls,
568
+ mockMarkToolsAsSubmitted,
569
+ ];
570
+ });
571
+ const { result, rerender } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
572
+ () => { }, 80, 24));
573
+ // 1. Initial state should be Responding because a tool is executing.
574
+ expect(result.current.streamingState).toBe(StreamingState.Responding);
575
+ // 2. Update the tool calls to completed state and rerender
576
+ currentToolCalls = completedToolCalls;
577
+ mockUseReactToolScheduler.mockImplementation((onComplete) => {
578
+ capturedOnComplete = onComplete;
579
+ return [
580
+ completedToolCalls,
581
+ mockScheduleToolCalls,
582
+ mockMarkToolsAsSubmitted,
583
+ ];
584
+ });
585
+ act(() => {
586
+ rerender();
587
+ });
588
+ // 3. The state should *still* be Responding, not Idle.
589
+ // This is because the completed tool's response has not been submitted yet.
590
+ expect(result.current.streamingState).toBe(StreamingState.Responding);
591
+ // 4. Trigger the onComplete callback to simulate tool completion
592
+ await act(async () => {
593
+ if (capturedOnComplete) {
594
+ await capturedOnComplete(completedToolCalls);
595
+ }
596
+ });
597
+ // 5. Wait for submitQuery to be called
598
+ await waitFor(() => {
599
+ expect(mockSendMessageStream).toHaveBeenCalledWith(toolCallResponseParts, expect.any(AbortSignal), 'prompt-id-4');
600
+ });
601
+ // 6. After submission, the state should remain Responding until the stream completes.
602
+ expect(result.current.streamingState).toBe(StreamingState.Responding);
603
+ });
604
+ describe('User Cancellation', () => {
605
+ let keypressCallback;
606
+ const mockUseKeypress = useKeypress;
607
+ beforeEach(() => {
608
+ // Capture the callback passed to useKeypress
609
+ mockUseKeypress.mockImplementation((callback, options) => {
610
+ if (options.isActive) {
611
+ keypressCallback = callback;
612
+ }
613
+ else {
614
+ keypressCallback = () => { };
615
+ }
616
+ });
617
+ });
618
+ const simulateEscapeKeyPress = () => {
619
+ act(() => {
620
+ keypressCallback({ name: 'escape' });
621
+ });
622
+ };
623
+ it('should cancel an in-progress stream when escape is pressed', async () => {
624
+ const mockStream = (async function* () {
625
+ yield { type: 'content', value: 'Part 1' };
626
+ // Keep the stream open
627
+ await new Promise(() => { });
628
+ })();
629
+ mockSendMessageStream.mockReturnValue(mockStream);
630
+ const { result } = renderTestHook();
631
+ // Start a query
632
+ await act(async () => {
633
+ result.current.submitQuery('test query');
634
+ });
635
+ // Wait for the first part of the response
636
+ await waitFor(() => {
637
+ expect(result.current.streamingState).toBe(StreamingState.Responding);
638
+ });
639
+ // Simulate escape key press
640
+ simulateEscapeKeyPress();
641
+ // Verify cancellation message is added
642
+ await waitFor(() => {
643
+ expect(mockAddItem).toHaveBeenCalledWith({
644
+ type: MessageType.INFO,
645
+ text: 'Request cancelled.',
646
+ }, expect.any(Number));
647
+ });
648
+ // Verify state is reset
649
+ expect(result.current.streamingState).toBe(StreamingState.Idle);
650
+ });
651
+ it('should call onCancelSubmit handler when escape is pressed', async () => {
652
+ const cancelSubmitSpy = vi.fn();
653
+ const mockStream = (async function* () {
654
+ yield { type: 'content', value: 'Part 1' };
655
+ // Keep the stream open
656
+ await new Promise(() => { });
657
+ })();
658
+ mockSendMessageStream.mockReturnValue(mockStream);
659
+ const { result } = renderHook(() => useOSAStream(mockConfig.getOSAClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, cancelSubmitSpy, false, // visionModelPreviewEnabled
660
+ () => { }, 80, 24));
661
+ // Start a query
662
+ await act(async () => {
663
+ result.current.submitQuery('test query');
664
+ });
665
+ simulateEscapeKeyPress();
666
+ expect(cancelSubmitSpy).toHaveBeenCalled();
667
+ });
668
+ it('should call setShellInputFocused(false) when escape is pressed', async () => {
669
+ const setShellInputFocusedSpy = vi.fn();
670
+ const mockStream = (async function* () {
671
+ yield { type: 'content', value: 'Part 1' };
672
+ await new Promise(() => { }); // Keep stream open
673
+ })();
674
+ mockSendMessageStream.mockReturnValue(mockStream);
675
+ const { result } = renderHook(() => useOSAStream(mockConfig.getOSAClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, vi.fn(), false, setShellInputFocusedSpy, // Pass the spy here
676
+ 80, 24));
677
+ // Start a query
678
+ await act(async () => {
679
+ result.current.submitQuery('test query');
680
+ });
681
+ simulateEscapeKeyPress();
682
+ expect(setShellInputFocusedSpy).toHaveBeenCalledWith(false);
683
+ });
684
+ it('should not do anything if escape is pressed when not responding', () => {
685
+ const { result } = renderTestHook();
686
+ expect(result.current.streamingState).toBe(StreamingState.Idle);
687
+ // Simulate escape key press
688
+ simulateEscapeKeyPress();
689
+ // No change should happen, no cancellation message
690
+ expect(mockAddItem).not.toHaveBeenCalledWith(expect.objectContaining({
691
+ text: 'Request cancelled.',
692
+ }), expect.any(Number));
693
+ });
694
+ it('should prevent further processing after cancellation', async () => {
695
+ let continueStream;
696
+ const streamPromise = new Promise((resolve) => {
697
+ continueStream = resolve;
698
+ });
699
+ const mockStream = (async function* () {
700
+ yield { type: 'content', value: 'Initial' };
701
+ await streamPromise; // Wait until we manually continue
702
+ yield { type: 'content', value: ' Canceled' };
703
+ })();
704
+ mockSendMessageStream.mockReturnValue(mockStream);
705
+ const { result } = renderTestHook();
706
+ await act(async () => {
707
+ result.current.submitQuery('long running query');
708
+ });
709
+ await waitFor(() => {
710
+ expect(result.current.streamingState).toBe(StreamingState.Responding);
711
+ });
712
+ // Cancel the request
713
+ simulateEscapeKeyPress();
714
+ // Allow the stream to continue
715
+ act(() => {
716
+ continueStream();
717
+ });
718
+ // Wait a bit to see if the second part is processed
719
+ await new Promise((resolve) => setTimeout(resolve, 50));
720
+ // The text should not have been updated with " Canceled"
721
+ const lastCall = mockAddItem.mock.calls.find((call) => call[0].type === 'OSA');
722
+ expect(lastCall?.[0].text).toBe('Initial');
723
+ // The final state should be idle after cancellation
724
+ expect(result.current.streamingState).toBe(StreamingState.Idle);
725
+ });
726
+ it('should not cancel if a tool call is in progress (not just responding)', async () => {
727
+ const toolCalls = [
728
+ {
729
+ request: { callId: 'call1', name: 'tool1', args: {} },
730
+ status: 'executing',
731
+ responseSubmittedToOSA: false,
732
+ tool: {
733
+ name: 'tool1',
734
+ description: 'desc1',
735
+ build: vi.fn().mockImplementation((_) => ({
736
+ getDescription: () => `Mock description`,
737
+ })),
738
+ },
739
+ invocation: {
740
+ getDescription: () => `Mock description`,
741
+ },
742
+ startTime: Date.now(),
743
+ liveOutput: '...',
744
+ },
745
+ ];
746
+ const abortSpy = vi.spyOn(AbortController.prototype, 'abort');
747
+ const { result } = renderTestHook(toolCalls);
748
+ // State is `Responding` because a tool is running
749
+ expect(result.current.streamingState).toBe(StreamingState.Responding);
750
+ // Try to cancel
751
+ simulateEscapeKeyPress();
752
+ // Nothing should happen because the state is not `Responding`
753
+ expect(abortSpy).not.toHaveBeenCalled();
754
+ });
755
+ });
756
+ describe('Slash Command Handling', () => {
757
+ it('should schedule a tool call when the command processor returns a schedule_tool action', async () => {
758
+ const clientToolRequest = {
759
+ type: 'schedule_tool',
760
+ toolName: 'save_memory',
761
+ toolArgs: { fact: 'test fact' },
762
+ };
763
+ mockHandleSlashCommand.mockResolvedValue(clientToolRequest);
764
+ const { result } = renderTestHook();
765
+ await act(async () => {
766
+ await result.current.submitQuery('/memory add "test fact"');
767
+ });
768
+ await waitFor(() => {
769
+ expect(mockScheduleToolCalls).toHaveBeenCalledWith([
770
+ expect.objectContaining({
771
+ name: 'save_memory',
772
+ args: { fact: 'test fact' },
773
+ isClientInitiated: true,
774
+ }),
775
+ ], expect.any(AbortSignal));
776
+ expect(mockSendMessageStream).not.toHaveBeenCalled();
777
+ });
778
+ });
779
+ it('should stop processing and not call OSA when a command is handled without a tool call', async () => {
780
+ const uiOnlyCommandResult = {
781
+ type: 'handled',
782
+ };
783
+ mockHandleSlashCommand.mockResolvedValue(uiOnlyCommandResult);
784
+ const { result } = renderTestHook();
785
+ await act(async () => {
786
+ await result.current.submitQuery('/help');
787
+ });
788
+ await waitFor(() => {
789
+ expect(mockHandleSlashCommand).toHaveBeenCalledWith('/help');
790
+ expect(mockScheduleToolCalls).not.toHaveBeenCalled();
791
+ expect(mockSendMessageStream).not.toHaveBeenCalled(); // No LLM call made
792
+ });
793
+ });
794
+ it('should call OSA with prompt content when slash command returns a `submit_prompt` action', async () => {
795
+ const customCommandResult = {
796
+ type: 'submit_prompt',
797
+ content: 'This is the actual prompt from the command file.',
798
+ };
799
+ mockHandleSlashCommand.mockResolvedValue(customCommandResult);
800
+ const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
801
+ await act(async () => {
802
+ await result.current.submitQuery('/my-custom-command');
803
+ });
804
+ await waitFor(() => {
805
+ expect(mockHandleSlashCommand).toHaveBeenCalledWith('/my-custom-command');
806
+ expect(localMockSendMessageStream).not.toHaveBeenCalledWith('/my-custom-command', expect.anything(), expect.anything());
807
+ expect(localMockSendMessageStream).toHaveBeenCalledWith('This is the actual prompt from the command file.', expect.any(AbortSignal), expect.any(String));
808
+ expect(mockScheduleToolCalls).not.toHaveBeenCalled();
809
+ });
810
+ });
811
+ it('should correctly handle a submit_prompt action with empty content', async () => {
812
+ const emptyPromptResult = {
813
+ type: 'submit_prompt',
814
+ content: '',
815
+ };
816
+ mockHandleSlashCommand.mockResolvedValue(emptyPromptResult);
817
+ const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
818
+ await act(async () => {
819
+ await result.current.submitQuery('/emptycmd');
820
+ });
821
+ await waitFor(() => {
822
+ expect(mockHandleSlashCommand).toHaveBeenCalledWith('/emptycmd');
823
+ expect(localMockSendMessageStream).toHaveBeenCalledWith('', expect.any(AbortSignal), expect.any(String));
824
+ });
825
+ });
826
+ it('should not call handleSlashCommand for line comments', async () => {
827
+ const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
828
+ await act(async () => {
829
+ await result.current.submitQuery('// This is a line comment');
830
+ });
831
+ await waitFor(() => {
832
+ expect(mockHandleSlashCommand).not.toHaveBeenCalled();
833
+ expect(localMockSendMessageStream).toHaveBeenCalledWith('// This is a line comment', expect.any(AbortSignal), expect.any(String));
834
+ });
835
+ });
836
+ it('should not call handleSlashCommand for block comments', async () => {
837
+ const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
838
+ await act(async () => {
839
+ await result.current.submitQuery('/* This is a block comment */');
840
+ });
841
+ await waitFor(() => {
842
+ expect(mockHandleSlashCommand).not.toHaveBeenCalled();
843
+ expect(localMockSendMessageStream).toHaveBeenCalledWith('/* This is a block comment */', expect.any(AbortSignal), expect.any(String));
844
+ });
845
+ });
846
+ });
847
+ describe('Memory Refresh on save_memory', () => {
848
+ it('should call performMemoryRefresh when a save_memory tool call completes successfully', async () => {
849
+ const mockPerformMemoryRefresh = vi.fn();
850
+ const completedToolCall = {
851
+ request: {
852
+ callId: 'save-mem-call-1',
853
+ name: 'save_memory',
854
+ args: { fact: 'test' },
855
+ isClientInitiated: true,
856
+ prompt_id: 'prompt-id-6',
857
+ },
858
+ status: 'success',
859
+ responseSubmittedToOSA: false,
860
+ response: {
861
+ callId: 'save-mem-call-1',
862
+ responseParts: [{ text: 'Memory saved' }],
863
+ resultDisplay: 'Success: Memory saved',
864
+ error: undefined,
865
+ errorType: undefined, // FIX: Added missing property
866
+ },
867
+ tool: {
868
+ name: 'save_memory',
869
+ displayName: 'save_memory',
870
+ description: 'Saves memory',
871
+ build: vi.fn(),
872
+ },
873
+ invocation: {
874
+ getDescription: () => `Mock description`,
875
+ },
876
+ };
877
+ // Capture the onComplete callback
878
+ let capturedOnComplete = null;
879
+ mockUseReactToolScheduler.mockImplementation((onComplete) => {
880
+ capturedOnComplete = onComplete;
881
+ return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted];
882
+ });
883
+ renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, mockPerformMemoryRefresh, false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
884
+ () => { }, 80, 24));
885
+ // Trigger the onComplete callback with the completed save_memory tool
886
+ await act(async () => {
887
+ if (capturedOnComplete) {
888
+ await capturedOnComplete([completedToolCall]);
889
+ }
890
+ });
891
+ await waitFor(() => {
892
+ expect(mockPerformMemoryRefresh).toHaveBeenCalledTimes(1);
893
+ });
894
+ });
895
+ });
896
+ describe('Error Handling', () => {
897
+ it('should call parseAndFormatApiError with the correct authType on stream initialization failure', async () => {
898
+ // 1. Setup
899
+ const mockError = new Error('Rate limit exceeded');
900
+ const mockAuthType = AuthType.LOGIN_WITH_OSAGENT;
901
+ mockParseAndFormatApiError.mockClear();
902
+ mockSendMessageStream.mockReturnValue((async function* () {
903
+ yield { type: 'content', value: '' };
904
+ throw mockError;
905
+ })());
906
+ const testConfig = {
907
+ ...mockConfig,
908
+ getContentGeneratorConfig: vi.fn(() => ({
909
+ authType: mockAuthType,
910
+ })),
911
+ getModel: vi.fn(() => 'OSA-2.5-pro'),
912
+ };
913
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(testConfig), [], mockAddItem, testConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
914
+ () => { }, 80, 24));
915
+ // 2. Action
916
+ await act(async () => {
917
+ await result.current.submitQuery('test query');
918
+ });
919
+ // 3. Assertion
920
+ await waitFor(() => {
921
+ expect(mockParseAndFormatApiError).toHaveBeenCalledWith('Rate limit exceeded', mockAuthType, undefined, 'OSA-2.5-pro', 'OSA-2.5-flash');
922
+ });
923
+ });
924
+ });
925
+ describe('handleApprovalModeChange', () => {
926
+ it('should auto-approve all pending tool calls when switching to YOLO mode', async () => {
927
+ const mockOnConfirm = vi.fn().mockResolvedValue(undefined);
928
+ const awaitingApprovalToolCalls = [
929
+ {
930
+ request: {
931
+ callId: 'call1',
932
+ name: 'replace',
933
+ args: { old_string: 'old', new_string: 'new' },
934
+ isClientInitiated: false,
935
+ prompt_id: 'prompt-id-1',
936
+ },
937
+ status: 'awaiting_approval',
938
+ responseSubmittedToOSA: false,
939
+ confirmationDetails: {
940
+ onConfirm: mockOnConfirm,
941
+ onCancel: vi.fn(),
942
+ message: 'Replace text?',
943
+ displayedText: 'Replace old with new',
944
+ },
945
+ tool: {
946
+ name: 'replace',
947
+ displayName: 'replace',
948
+ description: 'Replace text',
949
+ build: vi.fn(),
950
+ },
951
+ invocation: {
952
+ getDescription: () => 'Mock description',
953
+ },
954
+ },
955
+ {
956
+ request: {
957
+ callId: 'call2',
958
+ name: 'read_file',
959
+ args: { path: '/test/file.txt' },
960
+ isClientInitiated: false,
961
+ prompt_id: 'prompt-id-1',
962
+ },
963
+ status: 'awaiting_approval',
964
+ responseSubmittedToOSA: false,
965
+ confirmationDetails: {
966
+ onConfirm: mockOnConfirm,
967
+ onCancel: vi.fn(),
968
+ message: 'Read file?',
969
+ displayedText: 'Read /test/file.txt',
970
+ },
971
+ tool: {
972
+ name: 'read_file',
973
+ displayName: 'read_file',
974
+ description: 'Read file',
975
+ build: vi.fn(),
976
+ },
977
+ invocation: {
978
+ getDescription: () => 'Mock description',
979
+ },
980
+ },
981
+ ];
982
+ const { result } = renderTestHook(awaitingApprovalToolCalls);
983
+ await act(async () => {
984
+ await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
985
+ });
986
+ // Both tool calls should be auto-approved
987
+ expect(mockOnConfirm).toHaveBeenCalledTimes(2);
988
+ expect(mockOnConfirm).toHaveBeenNthCalledWith(1, ToolConfirmationOutcome.ProceedOnce);
989
+ expect(mockOnConfirm).toHaveBeenNthCalledWith(2, ToolConfirmationOutcome.ProceedOnce);
990
+ });
991
+ it('should only auto-approve edit tools when switching to AUTO_EDIT mode', async () => {
992
+ const mockOnConfirmReplace = vi.fn().mockResolvedValue(undefined);
993
+ const mockOnConfirmWrite = vi.fn().mockResolvedValue(undefined);
994
+ const mockOnConfirmRead = vi.fn().mockResolvedValue(undefined);
995
+ const awaitingApprovalToolCalls = [
996
+ {
997
+ request: {
998
+ callId: 'call1',
999
+ name: 'replace',
1000
+ args: { old_string: 'old', new_string: 'new' },
1001
+ isClientInitiated: false,
1002
+ prompt_id: 'prompt-id-1',
1003
+ },
1004
+ status: 'awaiting_approval',
1005
+ responseSubmittedToOSA: false,
1006
+ confirmationDetails: {
1007
+ onConfirm: mockOnConfirmReplace,
1008
+ onCancel: vi.fn(),
1009
+ message: 'Replace text?',
1010
+ displayedText: 'Replace old with new',
1011
+ },
1012
+ tool: {
1013
+ name: 'replace',
1014
+ displayName: 'replace',
1015
+ description: 'Replace text',
1016
+ build: vi.fn(),
1017
+ },
1018
+ invocation: {
1019
+ getDescription: () => 'Mock description',
1020
+ },
1021
+ },
1022
+ {
1023
+ request: {
1024
+ callId: 'call2',
1025
+ name: 'write_file',
1026
+ args: { path: '/test/new.txt', content: 'content' },
1027
+ isClientInitiated: false,
1028
+ prompt_id: 'prompt-id-1',
1029
+ },
1030
+ status: 'awaiting_approval',
1031
+ responseSubmittedToOSA: false,
1032
+ confirmationDetails: {
1033
+ onConfirm: mockOnConfirmWrite,
1034
+ onCancel: vi.fn(),
1035
+ message: 'Write file?',
1036
+ displayedText: 'Write to /test/new.txt',
1037
+ },
1038
+ tool: {
1039
+ name: 'write_file',
1040
+ displayName: 'write_file',
1041
+ description: 'Write file',
1042
+ build: vi.fn(),
1043
+ },
1044
+ invocation: {
1045
+ getDescription: () => 'Mock description',
1046
+ },
1047
+ },
1048
+ {
1049
+ request: {
1050
+ callId: 'call3',
1051
+ name: 'read_file',
1052
+ args: { path: '/test/file.txt' },
1053
+ isClientInitiated: false,
1054
+ prompt_id: 'prompt-id-1',
1055
+ },
1056
+ status: 'awaiting_approval',
1057
+ responseSubmittedToOSA: false,
1058
+ confirmationDetails: {
1059
+ onConfirm: mockOnConfirmRead,
1060
+ onCancel: vi.fn(),
1061
+ message: 'Read file?',
1062
+ displayedText: 'Read /test/file.txt',
1063
+ },
1064
+ tool: {
1065
+ name: 'read_file',
1066
+ displayName: 'read_file',
1067
+ description: 'Read file',
1068
+ build: vi.fn(),
1069
+ },
1070
+ invocation: {
1071
+ getDescription: () => 'Mock description',
1072
+ },
1073
+ },
1074
+ ];
1075
+ const { result } = renderTestHook(awaitingApprovalToolCalls);
1076
+ await act(async () => {
1077
+ await result.current.handleApprovalModeChange(ApprovalMode.AUTO_EDIT);
1078
+ });
1079
+ // Only replace and write_file should be auto-approved
1080
+ expect(mockOnConfirmReplace).toHaveBeenCalledTimes(1);
1081
+ expect(mockOnConfirmReplace).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
1082
+ expect(mockOnConfirmWrite).toHaveBeenCalledTimes(1);
1083
+ expect(mockOnConfirmWrite).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
1084
+ // read_file should not be auto-approved
1085
+ expect(mockOnConfirmRead).not.toHaveBeenCalled();
1086
+ });
1087
+ it('should not auto-approve any tools when switching to REQUIRE_CONFIRMATION mode', async () => {
1088
+ const mockOnConfirm = vi.fn().mockResolvedValue(undefined);
1089
+ const awaitingApprovalToolCalls = [
1090
+ {
1091
+ request: {
1092
+ callId: 'call1',
1093
+ name: 'replace',
1094
+ args: { old_string: 'old', new_string: 'new' },
1095
+ isClientInitiated: false,
1096
+ prompt_id: 'prompt-id-1',
1097
+ },
1098
+ status: 'awaiting_approval',
1099
+ responseSubmittedToOSA: false,
1100
+ confirmationDetails: {
1101
+ onConfirm: mockOnConfirm,
1102
+ onCancel: vi.fn(),
1103
+ message: 'Replace text?',
1104
+ displayedText: 'Replace old with new',
1105
+ },
1106
+ tool: {
1107
+ name: 'replace',
1108
+ displayName: 'replace',
1109
+ description: 'Replace text',
1110
+ build: vi.fn(),
1111
+ },
1112
+ invocation: {
1113
+ getDescription: () => 'Mock description',
1114
+ },
1115
+ },
1116
+ ];
1117
+ const { result } = renderTestHook(awaitingApprovalToolCalls);
1118
+ await act(async () => {
1119
+ await result.current.handleApprovalModeChange(ApprovalMode.DEFAULT);
1120
+ });
1121
+ // No tools should be auto-approved
1122
+ expect(mockOnConfirm).not.toHaveBeenCalled();
1123
+ });
1124
+ it('should handle errors gracefully when auto-approving tool calls', async () => {
1125
+ const consoleSpy = vi
1126
+ .spyOn(console, 'error')
1127
+ .mockImplementation(() => { });
1128
+ const mockOnConfirmSuccess = vi.fn().mockResolvedValue(undefined);
1129
+ const mockOnConfirmError = vi
1130
+ .fn()
1131
+ .mockRejectedValue(new Error('Approval failed'));
1132
+ const awaitingApprovalToolCalls = [
1133
+ {
1134
+ request: {
1135
+ callId: 'call1',
1136
+ name: 'replace',
1137
+ args: { old_string: 'old', new_string: 'new' },
1138
+ isClientInitiated: false,
1139
+ prompt_id: 'prompt-id-1',
1140
+ },
1141
+ status: 'awaiting_approval',
1142
+ responseSubmittedToOSA: false,
1143
+ confirmationDetails: {
1144
+ onConfirm: mockOnConfirmSuccess,
1145
+ onCancel: vi.fn(),
1146
+ message: 'Replace text?',
1147
+ displayedText: 'Replace old with new',
1148
+ },
1149
+ tool: {
1150
+ name: 'replace',
1151
+ displayName: 'replace',
1152
+ description: 'Replace text',
1153
+ build: vi.fn(),
1154
+ },
1155
+ invocation: {
1156
+ getDescription: () => 'Mock description',
1157
+ },
1158
+ },
1159
+ {
1160
+ request: {
1161
+ callId: 'call2',
1162
+ name: 'write_file',
1163
+ args: { path: '/test/file.txt', content: 'content' },
1164
+ isClientInitiated: false,
1165
+ prompt_id: 'prompt-id-1',
1166
+ },
1167
+ status: 'awaiting_approval',
1168
+ responseSubmittedToOSA: false,
1169
+ confirmationDetails: {
1170
+ onConfirm: mockOnConfirmError,
1171
+ onCancel: vi.fn(),
1172
+ message: 'Write file?',
1173
+ displayedText: 'Write to /test/file.txt',
1174
+ },
1175
+ tool: {
1176
+ name: 'write_file',
1177
+ displayName: 'write_file',
1178
+ description: 'Write file',
1179
+ build: vi.fn(),
1180
+ },
1181
+ invocation: {
1182
+ getDescription: () => 'Mock description',
1183
+ },
1184
+ },
1185
+ ];
1186
+ const { result } = renderTestHook(awaitingApprovalToolCalls);
1187
+ await act(async () => {
1188
+ await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
1189
+ });
1190
+ // Both confirmation methods should be called
1191
+ expect(mockOnConfirmSuccess).toHaveBeenCalledTimes(1);
1192
+ expect(mockOnConfirmError).toHaveBeenCalledTimes(1);
1193
+ // Error should be logged
1194
+ expect(consoleSpy).toHaveBeenCalledWith('Failed to auto-approve tool call call2:', expect.any(Error));
1195
+ consoleSpy.mockRestore();
1196
+ });
1197
+ it('should skip tool calls without confirmationDetails', async () => {
1198
+ const awaitingApprovalToolCalls = [
1199
+ {
1200
+ request: {
1201
+ callId: 'call1',
1202
+ name: 'replace',
1203
+ args: { old_string: 'old', new_string: 'new' },
1204
+ isClientInitiated: false,
1205
+ prompt_id: 'prompt-id-1',
1206
+ },
1207
+ status: 'awaiting_approval',
1208
+ responseSubmittedToOSA: false,
1209
+ // No confirmationDetails
1210
+ tool: {
1211
+ name: 'replace',
1212
+ displayName: 'replace',
1213
+ description: 'Replace text',
1214
+ build: vi.fn(),
1215
+ },
1216
+ invocation: {
1217
+ getDescription: () => 'Mock description',
1218
+ },
1219
+ },
1220
+ ];
1221
+ const { result } = renderTestHook(awaitingApprovalToolCalls);
1222
+ // Should not throw an error
1223
+ await act(async () => {
1224
+ await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
1225
+ });
1226
+ });
1227
+ it('should skip tool calls without onConfirm method in confirmationDetails', async () => {
1228
+ const awaitingApprovalToolCalls = [
1229
+ {
1230
+ request: {
1231
+ callId: 'call1',
1232
+ name: 'replace',
1233
+ args: { old_string: 'old', new_string: 'new' },
1234
+ isClientInitiated: false,
1235
+ prompt_id: 'prompt-id-1',
1236
+ },
1237
+ status: 'awaiting_approval',
1238
+ responseSubmittedToOSA: false,
1239
+ confirmationDetails: {
1240
+ onCancel: vi.fn(),
1241
+ message: 'Replace text?',
1242
+ displayedText: 'Replace old with new',
1243
+ // No onConfirm method
1244
+ },
1245
+ tool: {
1246
+ name: 'replace',
1247
+ displayName: 'replace',
1248
+ description: 'Replace text',
1249
+ build: vi.fn(),
1250
+ },
1251
+ invocation: {
1252
+ getDescription: () => 'Mock description',
1253
+ },
1254
+ },
1255
+ ];
1256
+ const { result } = renderTestHook(awaitingApprovalToolCalls);
1257
+ // Should not throw an error
1258
+ await act(async () => {
1259
+ await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
1260
+ });
1261
+ });
1262
+ it('should only process tool calls with awaiting_approval status', async () => {
1263
+ const mockOnConfirmAwaiting = vi.fn().mockResolvedValue(undefined);
1264
+ const mockOnConfirmExecuting = vi.fn().mockResolvedValue(undefined);
1265
+ const mixedStatusToolCalls = [
1266
+ {
1267
+ request: {
1268
+ callId: 'call1',
1269
+ name: 'replace',
1270
+ args: { old_string: 'old', new_string: 'new' },
1271
+ isClientInitiated: false,
1272
+ prompt_id: 'prompt-id-1',
1273
+ },
1274
+ status: 'awaiting_approval',
1275
+ responseSubmittedToOSA: false,
1276
+ confirmationDetails: {
1277
+ onConfirm: mockOnConfirmAwaiting,
1278
+ onCancel: vi.fn(),
1279
+ message: 'Replace text?',
1280
+ displayedText: 'Replace old with new',
1281
+ },
1282
+ tool: {
1283
+ name: 'replace',
1284
+ displayName: 'replace',
1285
+ description: 'Replace text',
1286
+ build: vi.fn(),
1287
+ },
1288
+ invocation: {
1289
+ getDescription: () => 'Mock description',
1290
+ },
1291
+ },
1292
+ {
1293
+ request: {
1294
+ callId: 'call2',
1295
+ name: 'write_file',
1296
+ args: { path: '/test/file.txt', content: 'content' },
1297
+ isClientInitiated: false,
1298
+ prompt_id: 'prompt-id-1',
1299
+ },
1300
+ status: 'executing',
1301
+ responseSubmittedToOSA: false,
1302
+ confirmationDetails: {
1303
+ onConfirm: mockOnConfirmExecuting,
1304
+ onCancel: vi.fn(),
1305
+ message: 'Write file?',
1306
+ displayedText: 'Write to /test/file.txt',
1307
+ },
1308
+ tool: {
1309
+ name: 'write_file',
1310
+ displayName: 'write_file',
1311
+ description: 'Write file',
1312
+ build: vi.fn(),
1313
+ },
1314
+ invocation: {
1315
+ getDescription: () => 'Mock description',
1316
+ },
1317
+ startTime: Date.now(),
1318
+ liveOutput: 'Writing...',
1319
+ },
1320
+ ];
1321
+ const { result } = renderTestHook(mixedStatusToolCalls);
1322
+ await act(async () => {
1323
+ await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
1324
+ });
1325
+ // Only the awaiting_approval tool should be processed
1326
+ expect(mockOnConfirmAwaiting).toHaveBeenCalledTimes(1);
1327
+ expect(mockOnConfirmExecuting).not.toHaveBeenCalled();
1328
+ });
1329
+ });
1330
+ describe('handleFinishedEvent', () => {
1331
+ it('should add info message for MAX_TOKENS finish reason', async () => {
1332
+ // Setup mock to return a stream with MAX_TOKENS finish reason
1333
+ mockSendMessageStream.mockReturnValue((async function* () {
1334
+ yield {
1335
+ type: ServerOSAEventType.Content,
1336
+ value: 'This is a truncated response...',
1337
+ };
1338
+ yield {
1339
+ type: ServerOSAEventType.Finished,
1340
+ value: { reason: 'MAX_TOKENS', usageMetadata: undefined },
1341
+ };
1342
+ })());
1343
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1344
+ () => { }, 80, 24));
1345
+ // Submit a query
1346
+ await act(async () => {
1347
+ await result.current.submitQuery('Generate long text');
1348
+ });
1349
+ // Check that the info message was added
1350
+ await waitFor(() => {
1351
+ expect(mockAddItem).toHaveBeenCalledWith({
1352
+ type: 'info',
1353
+ text: '⚠️ Response truncated due to token limits.',
1354
+ }, expect.any(Number));
1355
+ });
1356
+ });
1357
+ it('should not add message for STOP finish reason', async () => {
1358
+ // Setup mock to return a stream with STOP finish reason
1359
+ mockSendMessageStream.mockReturnValue((async function* () {
1360
+ yield {
1361
+ type: ServerOSAEventType.Content,
1362
+ value: 'Complete response',
1363
+ };
1364
+ yield {
1365
+ type: ServerOSAEventType.Finished,
1366
+ value: { reason: 'STOP', usageMetadata: undefined },
1367
+ };
1368
+ })());
1369
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1370
+ () => { }, 80, 24));
1371
+ // Submit a query
1372
+ await act(async () => {
1373
+ await result.current.submitQuery('Test normal completion');
1374
+ });
1375
+ // Wait a bit to ensure no message is added
1376
+ await new Promise((resolve) => setTimeout(resolve, 100));
1377
+ // Check that no info message was added for STOP
1378
+ const infoMessages = mockAddItem.mock.calls.filter((call) => call[0].type === 'info');
1379
+ expect(infoMessages).toHaveLength(0);
1380
+ });
1381
+ it('should not add message for FINISH_REASON_UNSPECIFIED', async () => {
1382
+ // Setup mock to return a stream with FINISH_REASON_UNSPECIFIED
1383
+ mockSendMessageStream.mockReturnValue((async function* () {
1384
+ yield {
1385
+ type: ServerOSAEventType.Content,
1386
+ value: 'Response with unspecified finish',
1387
+ };
1388
+ yield {
1389
+ type: ServerOSAEventType.Finished,
1390
+ value: {
1391
+ reason: 'FINISH_REASON_UNSPECIFIED',
1392
+ usageMetadata: undefined,
1393
+ },
1394
+ };
1395
+ })());
1396
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1397
+ () => { }, 80, 24));
1398
+ // Submit a query
1399
+ await act(async () => {
1400
+ await result.current.submitQuery('Test unspecified finish');
1401
+ });
1402
+ // Wait a bit to ensure no message is added
1403
+ await new Promise((resolve) => setTimeout(resolve, 100));
1404
+ // Check that no info message was added
1405
+ const infoMessages = mockAddItem.mock.calls.filter((call) => call[0].type === 'info');
1406
+ expect(infoMessages).toHaveLength(0);
1407
+ });
1408
+ it('should add appropriate messages for other finish reasons', async () => {
1409
+ const testCases = [
1410
+ {
1411
+ reason: 'SAFETY',
1412
+ message: '⚠️ Response stopped due to safety reasons.',
1413
+ },
1414
+ {
1415
+ reason: 'RECITATION',
1416
+ message: '⚠️ Response stopped due to recitation policy.',
1417
+ },
1418
+ {
1419
+ reason: 'LANGUAGE',
1420
+ message: '⚠️ Response stopped due to unsupported language.',
1421
+ },
1422
+ {
1423
+ reason: 'BLOCKLIST',
1424
+ message: '⚠️ Response stopped due to forbidden terms.',
1425
+ },
1426
+ {
1427
+ reason: 'PROHIBITED_CONTENT',
1428
+ message: '⚠️ Response stopped due to prohibited content.',
1429
+ },
1430
+ {
1431
+ reason: 'SPII',
1432
+ message: '⚠️ Response stopped due to sensitive personally identifiable information.',
1433
+ },
1434
+ { reason: 'OTHER', message: '⚠️ Response stopped for other reasons.' },
1435
+ {
1436
+ reason: 'MALFORMED_FUNCTION_CALL',
1437
+ message: '⚠️ Response stopped due to malformed function call.',
1438
+ },
1439
+ {
1440
+ reason: 'IMAGE_SAFETY',
1441
+ message: '⚠️ Response stopped due to image safety violations.',
1442
+ },
1443
+ {
1444
+ reason: 'UNEXPECTED_TOOL_CALL',
1445
+ message: '⚠️ Response stopped due to unexpected tool call.',
1446
+ },
1447
+ ];
1448
+ for (const { reason, message } of testCases) {
1449
+ // Reset mocks for each test case
1450
+ mockAddItem.mockClear();
1451
+ mockSendMessageStream.mockReturnValue((async function* () {
1452
+ yield {
1453
+ type: ServerOSAEventType.Content,
1454
+ value: `Response for ${reason}`,
1455
+ };
1456
+ yield {
1457
+ type: ServerOSAEventType.Finished,
1458
+ value: { reason, usageMetadata: undefined },
1459
+ };
1460
+ })());
1461
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1462
+ vi.fn(), 80, 24));
1463
+ await act(async () => {
1464
+ await result.current.submitQuery(`Test ${reason}`);
1465
+ });
1466
+ await waitFor(() => {
1467
+ expect(mockAddItem).toHaveBeenCalledWith({
1468
+ type: 'info',
1469
+ text: message,
1470
+ }, expect.any(Number));
1471
+ });
1472
+ }
1473
+ });
1474
+ });
1475
+ it('should process @include commands, adding user turn after processing to prevent race conditions', async () => {
1476
+ const rawQuery = '@include file.txt Summarize this.';
1477
+ const processedQueryParts = [
1478
+ { text: 'Summarize this with content from @file.txt' },
1479
+ { text: 'File content...' },
1480
+ ];
1481
+ const userMessageTimestamp = Date.now();
1482
+ vi.spyOn(Date, 'now').mockReturnValue(userMessageTimestamp);
1483
+ handleAtCommandSpy.mockResolvedValue({
1484
+ processedQuery: processedQueryParts,
1485
+ shouldProceed: true,
1486
+ });
1487
+ const { result } = renderHook(() => useOSAStream(mockConfig.getOSAClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, // shellModeActive
1488
+ vi.fn(), // getPreferredEditor
1489
+ vi.fn(), // onAuthError
1490
+ vi.fn(), // performMemoryRefresh
1491
+ false, // modelSwitched
1492
+ vi.fn(), // setModelSwitched
1493
+ vi.fn(), // onEditorClose
1494
+ vi.fn(), // onCancelSubmit
1495
+ false, // visionModelPreviewEnabled
1496
+ vi.fn(), // setShellInputFocused
1497
+ 80, // terminalWidth
1498
+ 24));
1499
+ await act(async () => {
1500
+ await result.current.submitQuery(rawQuery);
1501
+ });
1502
+ expect(handleAtCommandSpy).toHaveBeenCalledWith(expect.objectContaining({
1503
+ query: rawQuery,
1504
+ }));
1505
+ expect(mockAddItem).toHaveBeenCalledWith({
1506
+ type: MessageType.USER,
1507
+ text: rawQuery,
1508
+ }, userMessageTimestamp);
1509
+ // FIX: The expectation now matches the actual call signature.
1510
+ expect(mockSendMessageStream).toHaveBeenCalledWith(processedQueryParts, // Argument 1: The parts array directly
1511
+ expect.any(AbortSignal), // Argument 2: An AbortSignal
1512
+ expect.any(String));
1513
+ });
1514
+ describe('Thought Reset', () => {
1515
+ it('should reset thought to null when starting a new prompt', async () => {
1516
+ // First, simulate a response with a thought
1517
+ mockSendMessageStream.mockReturnValue((async function* () {
1518
+ yield {
1519
+ type: ServerOSAEventType.Thought,
1520
+ value: {
1521
+ subject: 'Previous thought',
1522
+ description: 'Old description',
1523
+ },
1524
+ };
1525
+ yield {
1526
+ type: ServerOSAEventType.Content,
1527
+ value: 'Some response content',
1528
+ };
1529
+ yield {
1530
+ type: ServerOSAEventType.Finished,
1531
+ value: { reason: 'STOP', usageMetadata: undefined },
1532
+ };
1533
+ })());
1534
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1535
+ () => { }, 80, 24));
1536
+ // Submit first query to set a thought
1537
+ await act(async () => {
1538
+ await result.current.submitQuery('First query');
1539
+ });
1540
+ // Wait for the first response to complete
1541
+ await waitFor(() => {
1542
+ expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
1543
+ type: 'OSA',
1544
+ text: 'Some response content',
1545
+ }), expect.any(Number));
1546
+ });
1547
+ // Now simulate a new response without a thought
1548
+ mockSendMessageStream.mockReturnValue((async function* () {
1549
+ yield {
1550
+ type: ServerOSAEventType.Content,
1551
+ value: 'New response content',
1552
+ };
1553
+ yield {
1554
+ type: ServerOSAEventType.Finished,
1555
+ value: { reason: 'STOP', usageMetadata: undefined },
1556
+ };
1557
+ })());
1558
+ // Submit second query - thought should be reset
1559
+ await act(async () => {
1560
+ await result.current.submitQuery('Second query');
1561
+ });
1562
+ // The thought should be reset to null when starting the new prompt
1563
+ // We can verify this by checking that the LoadingIndicator would not show the previous thought
1564
+ // The actual thought state is internal to the hook, but we can verify the behavior
1565
+ // by ensuring the second response doesn't show the previous thought
1566
+ await waitFor(() => {
1567
+ expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
1568
+ type: 'OSA',
1569
+ text: 'New response content',
1570
+ }), expect.any(Number));
1571
+ });
1572
+ });
1573
+ it('should memoize pendingHistoryItems', () => {
1574
+ mockUseReactToolScheduler.mockReturnValue([
1575
+ [],
1576
+ mockScheduleToolCalls,
1577
+ mockCancelAllToolCalls,
1578
+ mockMarkToolsAsSubmitted,
1579
+ ]);
1580
+ const { result, rerender } = renderHook(() => useOSAStream(mockConfig.getOSAClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1581
+ vi.fn(), // setShellInputFocused
1582
+ 80, 24));
1583
+ const firstResult = result.current.pendingHistoryItems;
1584
+ rerender();
1585
+ const secondResult = result.current.pendingHistoryItems;
1586
+ expect(firstResult).toStrictEqual(secondResult);
1587
+ const newToolCalls = [
1588
+ {
1589
+ request: { callId: 'call1', name: 'tool1', args: {} },
1590
+ status: 'executing',
1591
+ tool: {
1592
+ name: 'tool1',
1593
+ displayName: 'tool1',
1594
+ description: 'desc1',
1595
+ build: vi.fn(),
1596
+ },
1597
+ invocation: {
1598
+ getDescription: () => 'Mock description',
1599
+ },
1600
+ },
1601
+ ];
1602
+ mockUseReactToolScheduler.mockReturnValue([
1603
+ newToolCalls,
1604
+ mockScheduleToolCalls,
1605
+ mockCancelAllToolCalls,
1606
+ mockMarkToolsAsSubmitted,
1607
+ ]);
1608
+ rerender();
1609
+ const thirdResult = result.current.pendingHistoryItems;
1610
+ expect(thirdResult).not.toStrictEqual(secondResult);
1611
+ });
1612
+ it('should reset thought to null when user cancels', async () => {
1613
+ // Mock a stream that yields a thought then gets cancelled
1614
+ mockSendMessageStream.mockReturnValue((async function* () {
1615
+ yield {
1616
+ type: ServerOSAEventType.Thought,
1617
+ value: { subject: 'Some thought', description: 'Description' },
1618
+ };
1619
+ yield { type: ServerOSAEventType.UserCancelled };
1620
+ })());
1621
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1622
+ () => { }, 80, 24));
1623
+ // Submit query
1624
+ await act(async () => {
1625
+ await result.current.submitQuery('Test query');
1626
+ });
1627
+ // Verify cancellation message was added
1628
+ await waitFor(() => {
1629
+ expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
1630
+ type: 'info',
1631
+ text: 'User cancelled the request.',
1632
+ }), expect.any(Number));
1633
+ });
1634
+ // Verify state is reset to idle
1635
+ expect(result.current.streamingState).toBe(StreamingState.Idle);
1636
+ });
1637
+ it('should reset thought to null when there is an error', async () => {
1638
+ // Mock a stream that yields a thought then encounters an error
1639
+ mockSendMessageStream.mockReturnValue((async function* () {
1640
+ yield {
1641
+ type: ServerOSAEventType.Thought,
1642
+ value: { subject: 'Some thought', description: 'Description' },
1643
+ };
1644
+ yield {
1645
+ type: ServerOSAEventType.Error,
1646
+ value: { error: { message: 'Test error' } },
1647
+ };
1648
+ })());
1649
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1650
+ () => { }, 80, 24));
1651
+ // Submit query
1652
+ await act(async () => {
1653
+ await result.current.submitQuery('Test query');
1654
+ });
1655
+ // Verify error message was added
1656
+ await waitFor(() => {
1657
+ expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
1658
+ type: 'error',
1659
+ }), expect.any(Number));
1660
+ });
1661
+ // Verify parseAndFormatApiError was called
1662
+ expect(mockParseAndFormatApiError).toHaveBeenCalledWith({ message: 'Test error' }, expect.any(String), undefined, 'OSA-2.5-pro', 'OSA-2.5-flash');
1663
+ });
1664
+ });
1665
+ describe('Concurrent Execution Prevention', () => {
1666
+ it('should prevent concurrent submitQuery calls', async () => {
1667
+ let resolveFirstCall;
1668
+ let resolveSecondCall;
1669
+ const firstCallPromise = new Promise((resolve) => {
1670
+ resolveFirstCall = resolve;
1671
+ });
1672
+ const secondCallPromise = new Promise((resolve) => {
1673
+ resolveSecondCall = resolve;
1674
+ });
1675
+ // Mock a long-running stream for the first call
1676
+ const firstStream = (async function* () {
1677
+ yield {
1678
+ type: ServerOSAEventType.Content,
1679
+ value: 'First call content',
1680
+ };
1681
+ await firstCallPromise; // Wait until we manually resolve
1682
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1683
+ })();
1684
+ // Mock a stream for the second call (should not be used)
1685
+ const secondStream = (async function* () {
1686
+ yield {
1687
+ type: ServerOSAEventType.Content,
1688
+ value: 'Second call content',
1689
+ };
1690
+ await secondCallPromise;
1691
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1692
+ })();
1693
+ let callCount = 0;
1694
+ mockSendMessageStream.mockImplementation(() => {
1695
+ callCount++;
1696
+ if (callCount === 1) {
1697
+ return firstStream;
1698
+ }
1699
+ else {
1700
+ return secondStream;
1701
+ }
1702
+ });
1703
+ const { result } = renderTestHook();
1704
+ // Start first call
1705
+ const firstCallResult = act(async () => {
1706
+ await result.current.submitQuery('First query');
1707
+ });
1708
+ // Wait a bit to ensure first call has started
1709
+ await new Promise((resolve) => setTimeout(resolve, 10));
1710
+ // Try to start second call while first is still running
1711
+ const secondCallResult = act(async () => {
1712
+ await result.current.submitQuery('Second query');
1713
+ });
1714
+ // Resolve both calls
1715
+ resolveFirstCall();
1716
+ resolveSecondCall();
1717
+ await Promise.all([firstCallResult, secondCallResult]);
1718
+ // Verify only one call was made to sendMessageStream
1719
+ expect(mockSendMessageStream).toHaveBeenCalledTimes(1);
1720
+ expect(mockSendMessageStream).toHaveBeenCalledWith('First query', expect.any(AbortSignal), expect.any(String));
1721
+ // Verify only the first query was added to history
1722
+ const userMessages = mockAddItem.mock.calls.filter((call) => call[0].type === MessageType.USER);
1723
+ expect(userMessages).toHaveLength(1);
1724
+ expect(userMessages[0][0].text).toBe('First query');
1725
+ });
1726
+ it('should allow subsequent calls after first call completes', async () => {
1727
+ // Mock streams that complete immediately
1728
+ mockSendMessageStream
1729
+ .mockReturnValueOnce((async function* () {
1730
+ yield {
1731
+ type: ServerOSAEventType.Content,
1732
+ value: 'First response',
1733
+ };
1734
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1735
+ })())
1736
+ .mockReturnValueOnce((async function* () {
1737
+ yield {
1738
+ type: ServerOSAEventType.Content,
1739
+ value: 'Second response',
1740
+ };
1741
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1742
+ })());
1743
+ const { result } = renderTestHook();
1744
+ // First call
1745
+ await act(async () => {
1746
+ await result.current.submitQuery('First query');
1747
+ });
1748
+ // Second call after first completes
1749
+ await act(async () => {
1750
+ await result.current.submitQuery('Second query');
1751
+ });
1752
+ // Both calls should have been made
1753
+ expect(mockSendMessageStream).toHaveBeenCalledTimes(2);
1754
+ expect(mockSendMessageStream).toHaveBeenNthCalledWith(1, 'First query', expect.any(AbortSignal), expect.any(String));
1755
+ expect(mockSendMessageStream).toHaveBeenNthCalledWith(2, 'Second query', expect.any(AbortSignal), expect.any(String));
1756
+ });
1757
+ it('should reset execution flag even when query preparation fails', async () => {
1758
+ const { result } = renderTestHook();
1759
+ // First call with empty query (should fail in preparation)
1760
+ await act(async () => {
1761
+ await result.current.submitQuery(' '); // Empty trimmed query
1762
+ });
1763
+ // Second call should work normally
1764
+ await act(async () => {
1765
+ await result.current.submitQuery('Second query');
1766
+ });
1767
+ // Verify that only the second call was made (empty query is filtered out)
1768
+ expect(mockSendMessageStream).toHaveBeenCalledTimes(1);
1769
+ expect(mockSendMessageStream).toHaveBeenCalledWith('Second query', expect.any(AbortSignal), expect.any(String));
1770
+ });
1771
+ });
1772
+ // --- New tests focused on recent modifications ---
1773
+ describe('Vision Auto Switch Integration', () => {
1774
+ it('should call handleVisionSwitch and proceed to send when allowed', async () => {
1775
+ mockHandleVisionSwitch.mockResolvedValueOnce({ shouldProceed: true });
1776
+ mockSendMessageStream.mockReturnValue((async function* () {
1777
+ yield { type: ServerOSAEventType.Content, value: 'ok' };
1778
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1779
+ })());
1780
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1781
+ vi.fn(), // setShellInputFocused
1782
+ 80, 24));
1783
+ await act(async () => {
1784
+ await result.current.submitQuery('image prompt');
1785
+ });
1786
+ await waitFor(() => {
1787
+ expect(mockHandleVisionSwitch).toHaveBeenCalled();
1788
+ expect(mockSendMessageStream).toHaveBeenCalled();
1789
+ });
1790
+ });
1791
+ it('should gate submission when handleVisionSwitch returns shouldProceed=false', async () => {
1792
+ mockHandleVisionSwitch.mockResolvedValueOnce({ shouldProceed: false });
1793
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1794
+ vi.fn(), // setShellInputFocused
1795
+ 80, 24));
1796
+ await act(async () => {
1797
+ await result.current.submitQuery('vision-gated');
1798
+ });
1799
+ // No call to API, no restoreOriginalModel needed since no override occurred
1800
+ expect(mockSendMessageStream).not.toHaveBeenCalled();
1801
+ expect(mockRestoreOriginalModel).not.toHaveBeenCalled();
1802
+ // Next call allowed (flag reset path)
1803
+ mockHandleVisionSwitch.mockResolvedValueOnce({ shouldProceed: true });
1804
+ mockSendMessageStream.mockReturnValue((async function* () {
1805
+ yield { type: ServerOSAEventType.Content, value: 'ok' };
1806
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1807
+ })());
1808
+ await act(async () => {
1809
+ await result.current.submitQuery('after-gate');
1810
+ });
1811
+ await waitFor(() => {
1812
+ expect(mockSendMessageStream).toHaveBeenCalled();
1813
+ });
1814
+ });
1815
+ });
1816
+ describe('Model restore on completion and errors', () => {
1817
+ it('should restore model after successful stream completion', async () => {
1818
+ mockSendMessageStream.mockReturnValue((async function* () {
1819
+ yield { type: ServerOSAEventType.Content, value: 'content' };
1820
+ yield { type: ServerOSAEventType.Finished, value: 'STOP' };
1821
+ })());
1822
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1823
+ vi.fn(), // setShellInputFocused
1824
+ 80, 24));
1825
+ await act(async () => {
1826
+ await result.current.submitQuery('restore-success');
1827
+ });
1828
+ await waitFor(() => {
1829
+ expect(mockRestoreOriginalModel).toHaveBeenCalledTimes(1);
1830
+ });
1831
+ });
1832
+ it('should restore model when an error occurs during streaming', async () => {
1833
+ const testError = new Error('stream failure');
1834
+ mockSendMessageStream.mockReturnValue((async function* () {
1835
+ yield { type: ServerOSAEventType.Content, value: 'content' };
1836
+ throw testError;
1837
+ })());
1838
+ const { result } = renderHook(() => useOSAStream(new MockedOSAClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, false, // visionModelPreviewEnabled
1839
+ vi.fn(), // setShellInputFocused
1840
+ 80, 24));
1841
+ await act(async () => {
1842
+ await result.current.submitQuery('restore-error');
1843
+ });
1844
+ await waitFor(() => {
1845
+ expect(mockRestoreOriginalModel).toHaveBeenCalledTimes(1);
1846
+ });
1847
+ });
1848
+ });
1849
+ describe('Loop Detection Confirmation', () => {
1850
+ beforeEach(() => {
1851
+ // Add mock for getLoopDetectionService to the config
1852
+ const mockLoopDetectionService = {
1853
+ disableForSession: vi.fn(),
1854
+ };
1855
+ mockConfig.getOSAClient = vi.fn().mockReturnValue({
1856
+ ...new MockedOSAClientClass(mockConfig),
1857
+ getLoopDetectionService: () => mockLoopDetectionService,
1858
+ });
1859
+ });
1860
+ it('should set loopDetectionConfirmationRequest when LoopDetected event is received', async () => {
1861
+ mockSendMessageStream.mockReturnValue((async function* () {
1862
+ yield {
1863
+ type: ServerOSAEventType.Content,
1864
+ value: 'Some content',
1865
+ };
1866
+ yield {
1867
+ type: ServerOSAEventType.LoopDetected,
1868
+ };
1869
+ })());
1870
+ const { result } = renderTestHook();
1871
+ await act(async () => {
1872
+ await result.current.submitQuery('test query');
1873
+ });
1874
+ await waitFor(() => {
1875
+ expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
1876
+ expect(typeof result.current.loopDetectionConfirmationRequest?.onComplete).toBe('function');
1877
+ });
1878
+ });
1879
+ it('should disable loop detection and show message when user selects "disable"', async () => {
1880
+ const mockLoopDetectionService = {
1881
+ disableForSession: vi.fn(),
1882
+ };
1883
+ const mockClient = {
1884
+ ...new MockedOSAClientClass(mockConfig),
1885
+ getLoopDetectionService: () => mockLoopDetectionService,
1886
+ };
1887
+ mockConfig.getOSAClient = vi.fn().mockReturnValue(mockClient);
1888
+ mockSendMessageStream.mockReturnValueOnce((async function* () {
1889
+ yield {
1890
+ type: ServerOSAEventType.LoopDetected,
1891
+ };
1892
+ })());
1893
+ const { result } = renderTestHook([], mockClient);
1894
+ await act(async () => {
1895
+ await result.current.submitQuery('test query');
1896
+ });
1897
+ // Wait for confirmation request to be set
1898
+ await waitFor(() => {
1899
+ expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
1900
+ });
1901
+ // Simulate user selecting "disable"
1902
+ await act(async () => {
1903
+ result.current.loopDetectionConfirmationRequest?.onComplete({
1904
+ userSelection: 'disable',
1905
+ });
1906
+ });
1907
+ // Verify loop detection was disabled
1908
+ expect(mockLoopDetectionService.disableForSession).toHaveBeenCalledTimes(1);
1909
+ // Verify confirmation request was cleared
1910
+ expect(result.current.loopDetectionConfirmationRequest).toBeNull();
1911
+ // Verify appropriate message was added
1912
+ expect(mockAddItem).toHaveBeenCalledWith({
1913
+ type: 'info',
1914
+ text: 'Loop detection has been disabled for this session. Please try your request again.',
1915
+ }, expect.any(Number));
1916
+ });
1917
+ it('should keep loop detection enabled and show message when user selects "keep"', async () => {
1918
+ const mockLoopDetectionService = {
1919
+ disableForSession: vi.fn(),
1920
+ };
1921
+ const mockClient = {
1922
+ ...new MockedOSAClientClass(mockConfig),
1923
+ getLoopDetectionService: () => mockLoopDetectionService,
1924
+ };
1925
+ mockConfig.getOSAClient = vi.fn().mockReturnValue(mockClient);
1926
+ mockSendMessageStream.mockReturnValue((async function* () {
1927
+ yield {
1928
+ type: ServerOSAEventType.LoopDetected,
1929
+ };
1930
+ })());
1931
+ const { result } = renderTestHook();
1932
+ await act(async () => {
1933
+ await result.current.submitQuery('test query');
1934
+ });
1935
+ // Wait for confirmation request to be set
1936
+ await waitFor(() => {
1937
+ expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
1938
+ });
1939
+ // Simulate user selecting "keep"
1940
+ await act(async () => {
1941
+ result.current.loopDetectionConfirmationRequest?.onComplete({
1942
+ userSelection: 'keep',
1943
+ });
1944
+ });
1945
+ // Verify loop detection was NOT disabled
1946
+ expect(mockLoopDetectionService.disableForSession).not.toHaveBeenCalled();
1947
+ // Verify confirmation request was cleared
1948
+ expect(result.current.loopDetectionConfirmationRequest).toBeNull();
1949
+ // Verify appropriate message was added
1950
+ expect(mockAddItem).toHaveBeenCalledWith({
1951
+ type: 'info',
1952
+ text: 'A potential loop was detected. This can happen due to repetitive tool calls or other model behavior. The request has been halted.',
1953
+ }, expect.any(Number));
1954
+ });
1955
+ it('should handle multiple loop detection events properly', async () => {
1956
+ const { result } = renderTestHook();
1957
+ // First loop detection - set up fresh mock for first call
1958
+ mockSendMessageStream.mockReturnValueOnce((async function* () {
1959
+ yield {
1960
+ type: ServerOSAEventType.LoopDetected,
1961
+ };
1962
+ })());
1963
+ // First loop detection
1964
+ await act(async () => {
1965
+ await result.current.submitQuery('first query');
1966
+ });
1967
+ await waitFor(() => {
1968
+ expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
1969
+ });
1970
+ // Simulate user selecting "keep" for first request
1971
+ await act(async () => {
1972
+ result.current.loopDetectionConfirmationRequest?.onComplete({
1973
+ userSelection: 'keep',
1974
+ });
1975
+ });
1976
+ expect(result.current.loopDetectionConfirmationRequest).toBeNull();
1977
+ // Verify first message was added
1978
+ expect(mockAddItem).toHaveBeenCalledWith({
1979
+ type: 'info',
1980
+ text: 'A potential loop was detected. This can happen due to repetitive tool calls or other model behavior. The request has been halted.',
1981
+ }, expect.any(Number));
1982
+ // Second loop detection - set up fresh mock for second call
1983
+ mockSendMessageStream.mockReturnValueOnce((async function* () {
1984
+ yield {
1985
+ type: ServerOSAEventType.LoopDetected,
1986
+ };
1987
+ })());
1988
+ // Second loop detection
1989
+ await act(async () => {
1990
+ await result.current.submitQuery('second query');
1991
+ });
1992
+ await waitFor(() => {
1993
+ expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
1994
+ });
1995
+ // Simulate user selecting "disable" for second request
1996
+ await act(async () => {
1997
+ result.current.loopDetectionConfirmationRequest?.onComplete({
1998
+ userSelection: 'disable',
1999
+ });
2000
+ });
2001
+ expect(result.current.loopDetectionConfirmationRequest).toBeNull();
2002
+ // Verify second message was added
2003
+ expect(mockAddItem).toHaveBeenCalledWith({
2004
+ type: 'info',
2005
+ text: 'Loop detection has been disabled for this session. Please try your request again.',
2006
+ }, expect.any(Number));
2007
+ });
2008
+ it('should process LoopDetected event after moving pending history to history', async () => {
2009
+ mockSendMessageStream.mockReturnValue((async function* () {
2010
+ yield {
2011
+ type: ServerOSAEventType.Content,
2012
+ value: 'Some response content',
2013
+ };
2014
+ yield {
2015
+ type: ServerOSAEventType.LoopDetected,
2016
+ };
2017
+ })());
2018
+ const { result } = renderTestHook();
2019
+ await act(async () => {
2020
+ await result.current.submitQuery('test query');
2021
+ });
2022
+ // Verify that the content was added to history before the loop detection dialog
2023
+ await waitFor(() => {
2024
+ expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
2025
+ type: 'OSA',
2026
+ text: 'Some response content',
2027
+ }), expect.any(Number));
2028
+ });
2029
+ // Then verify loop detection confirmation request was set
2030
+ await waitFor(() => {
2031
+ expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
2032
+ });
2033
+ });
2034
+ });
2035
+ });
2036
+ //# sourceMappingURL=useGeminiStream.test.js.map