@umsai/ums-code 0.0.11-post6 → 0.0.14-v1

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 (632) hide show
  1. package/dist/package.json +5 -5
  2. package/dist/src/acp/acp.d.ts +208 -0
  3. package/dist/src/{zed-integration → acp}/acp.js +44 -76
  4. package/dist/src/acp/acp.js.map +1 -0
  5. package/dist/src/acp/acpPeer.d.ts +8 -0
  6. package/dist/src/acp/acpPeer.js +537 -0
  7. package/dist/src/acp/acpPeer.js.map +1 -0
  8. package/dist/src/config/auth.js +11 -12
  9. package/dist/src/config/auth.js.map +1 -1
  10. package/dist/src/config/config.d.ts +3 -3
  11. package/dist/src/config/config.js +86 -164
  12. package/dist/src/config/config.js.map +1 -1
  13. package/dist/src/config/extension.d.ts +1 -2
  14. package/dist/src/config/extension.js +4 -9
  15. package/dist/src/config/extension.js.map +1 -1
  16. package/dist/src/config/sandboxConfig.js +3 -3
  17. package/dist/src/config/sandboxConfig.js.map +1 -1
  18. package/dist/src/config/settings.d.ts +64 -3
  19. package/dist/src/config/settings.js +38 -58
  20. package/dist/src/config/settings.js.map +1 -1
  21. package/dist/src/gemini.js +41 -37
  22. package/dist/src/gemini.js.map +1 -1
  23. package/dist/src/generated/git-commit.d.ts +1 -2
  24. package/dist/src/generated/git-commit.js +1 -2
  25. package/dist/src/generated/git-commit.js.map +1 -1
  26. package/dist/src/nonInteractiveCli.js +8 -3
  27. package/dist/src/nonInteractiveCli.js.map +1 -1
  28. package/dist/src/services/BuiltinCommandLoader.d.ts +1 -0
  29. package/dist/src/services/BuiltinCommandLoader.js +4 -11
  30. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  31. package/dist/src/services/FileCommandLoader.js +8 -10
  32. package/dist/src/services/FileCommandLoader.js.map +1 -1
  33. package/dist/src/services/McpPromptLoader.js +3 -3
  34. package/dist/src/services/McpPromptLoader.js.map +1 -1
  35. package/dist/src/services/prompt-processors/argumentProcessor.d.ts +7 -2
  36. package/dist/src/services/prompt-processors/argumentProcessor.js +10 -2
  37. package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -1
  38. package/dist/src/services/prompt-processors/shellProcessor.d.ts +13 -16
  39. package/dist/src/services/prompt-processors/shellProcessor.js +40 -125
  40. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
  41. package/dist/src/services/prompt-processors/types.d.ts +0 -2
  42. package/dist/src/services/prompt-processors/types.js +0 -2
  43. package/dist/src/services/prompt-processors/types.js.map +1 -1
  44. package/dist/src/ui/App.js +46 -224
  45. package/dist/src/ui/App.js.map +1 -1
  46. package/dist/src/ui/commands/aboutCommand.js +5 -9
  47. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  48. package/dist/src/ui/commands/bugCommand.js +5 -13
  49. package/dist/src/ui/commands/bugCommand.js.map +1 -1
  50. package/dist/src/ui/commands/chatCommand.js +6 -23
  51. package/dist/src/ui/commands/chatCommand.js.map +1 -1
  52. package/dist/src/ui/commands/clearCommand.js +1 -0
  53. package/dist/src/ui/commands/clearCommand.js.map +1 -1
  54. package/dist/src/ui/commands/directoryCommand.js +21 -18
  55. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  56. package/dist/src/ui/commands/docsCommand.js +1 -1
  57. package/dist/src/ui/commands/docsCommand.js.map +1 -1
  58. package/dist/src/ui/commands/ideCommand.js +18 -90
  59. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  60. package/dist/src/ui/commands/initCommand.d.ts +1 -1
  61. package/dist/src/ui/commands/initCommand.js +7 -17
  62. package/dist/src/ui/commands/initCommand.js.map +1 -1
  63. package/dist/src/ui/commands/mcpCommand.js +7 -11
  64. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  65. package/dist/src/ui/commands/memoryCommand.js +6 -139
  66. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  67. package/dist/src/ui/commands/quitCommand.d.ts +0 -1
  68. package/dist/src/ui/commands/quitCommand.js +0 -25
  69. package/dist/src/ui/commands/quitCommand.js.map +1 -1
  70. package/dist/src/ui/commands/setupGithubCommand.d.ts +0 -2
  71. package/dist/src/ui/commands/setupGithubCommand.js +26 -132
  72. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
  73. package/dist/src/ui/commands/toolsCommand.js +2 -2
  74. package/dist/src/ui/commands/toolsCommand.js.map +1 -1
  75. package/dist/src/ui/commands/types.d.ts +3 -19
  76. package/dist/src/ui/commands/types.js.map +1 -1
  77. package/dist/src/ui/commands/ums/umsInitCommand.js +21 -55
  78. package/dist/src/ui/commands/ums/umsInitCommand.js.map +1 -1
  79. package/dist/src/ui/components/AboutBox.d.ts +0 -1
  80. package/dist/src/ui/components/AboutBox.js +1 -1
  81. package/dist/src/ui/components/AboutBox.js.map +1 -1
  82. package/dist/src/ui/components/AsciiArt.d.ts +0 -1
  83. package/dist/src/ui/components/AsciiArt.js +0 -8
  84. package/dist/src/ui/components/AsciiArt.js.map +1 -1
  85. package/dist/src/ui/components/AuthDialog.d.ts +1 -1
  86. package/dist/src/ui/components/AuthDialog.js +15 -17
  87. package/dist/src/ui/components/AuthDialog.js.map +1 -1
  88. package/dist/src/ui/components/AuthInProgress.js +5 -6
  89. package/dist/src/ui/components/AuthInProgress.js.map +1 -1
  90. package/dist/src/ui/components/ContextSummaryDisplay.js +25 -22
  91. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  92. package/dist/src/ui/components/DebugProfiler.js +4 -5
  93. package/dist/src/ui/components/DebugProfiler.js.map +1 -1
  94. package/dist/src/ui/components/EditorSettingsDialog.js +5 -6
  95. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
  96. package/dist/src/ui/components/Footer.d.ts +0 -1
  97. package/dist/src/ui/components/Footer.js +6 -16
  98. package/dist/src/ui/components/Footer.js.map +1 -1
  99. package/dist/src/ui/components/Header.d.ts +1 -0
  100. package/dist/src/ui/components/Header.js +5 -13
  101. package/dist/src/ui/components/Header.js.map +1 -1
  102. package/dist/src/ui/components/Help.js +1 -1
  103. package/dist/src/ui/components/Help.js.map +1 -1
  104. package/dist/src/ui/components/HistoryItemDisplay.js +1 -2
  105. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  106. package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +12 -0
  107. package/dist/src/ui/components/IDEContextDetailDisplay.js +12 -0
  108. package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -0
  109. package/dist/src/ui/components/InputPrompt.d.ts +0 -1
  110. package/dist/src/ui/components/InputPrompt.js +35 -98
  111. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  112. package/dist/src/ui/components/LoadingIndicator.js +5 -10
  113. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  114. package/dist/src/ui/components/ShellConfirmationDialog.js +5 -7
  115. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
  116. package/dist/src/ui/components/StatsDisplay.js +7 -8
  117. package/dist/src/ui/components/StatsDisplay.js.map +1 -1
  118. package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
  119. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  120. package/dist/src/ui/components/ThemeDialog.js +20 -10
  121. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  122. package/dist/src/ui/components/messages/DiffRenderer.js +1 -10
  123. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
  124. package/dist/src/ui/components/messages/InfoMessage.js +1 -6
  125. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
  126. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +14 -36
  127. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  128. package/dist/src/ui/components/messages/ToolGroupMessage.js +1 -1
  129. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  130. package/dist/src/ui/components/messages/ToolMessage.js +10 -75
  131. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  132. package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
  133. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
  134. package/dist/src/ui/components/shared/RadioButtonSelect.js +9 -11
  135. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
  136. package/dist/src/ui/components/shared/text-buffer.d.ts +4 -17
  137. package/dist/src/ui/components/shared/text-buffer.js +80 -262
  138. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  139. package/dist/src/ui/components/shared/vim-buffer-actions.js +152 -139
  140. package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
  141. package/dist/src/ui/components/ums/UMSKeyPrompt.js +3 -3
  142. package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
  143. package/dist/src/ui/contexts/SessionContext.d.ts +1 -3
  144. package/dist/src/ui/contexts/SessionContext.js +11 -3
  145. package/dist/src/ui/contexts/SessionContext.js.map +1 -1
  146. package/dist/src/ui/hooks/atCommandProcessor.js +16 -17
  147. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  148. package/dist/src/ui/hooks/shellCommandProcessor.js +13 -8
  149. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  150. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +2 -9
  151. package/dist/src/ui/hooks/slashCommandProcessor.js +62 -234
  152. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  153. package/dist/src/ui/hooks/useAtCompletion.js +3 -4
  154. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
  155. package/dist/src/ui/hooks/useAuthCommand.js +1 -1
  156. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +6 -6
  157. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
  158. package/dist/src/ui/hooks/useFocus.d.ts +0 -4
  159. package/dist/src/ui/hooks/useFocus.js +4 -4
  160. package/dist/src/ui/hooks/useFocus.js.map +1 -1
  161. package/dist/src/ui/hooks/useGeminiStream.d.ts +3 -4
  162. package/dist/src/ui/hooks/useGeminiStream.js +33 -50
  163. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  164. package/dist/src/ui/hooks/useKeypress.d.ts +16 -4
  165. package/dist/src/ui/hooks/useKeypress.js +140 -8
  166. package/dist/src/ui/hooks/useKeypress.js.map +1 -1
  167. package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
  168. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  169. package/dist/src/ui/hooks/usePrivacySettings.js +2 -6
  170. package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
  171. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +1 -1
  172. package/dist/src/ui/hooks/useReactToolScheduler.js +15 -15
  173. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  174. package/dist/src/ui/hooks/useThemeCommand.js +1 -1
  175. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  176. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +4 -5
  177. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
  178. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +4 -5
  179. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
  180. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +4 -5
  181. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
  182. package/dist/src/ui/themes/ansi-light.js +1 -2
  183. package/dist/src/ui/themes/ansi-light.js.map +1 -1
  184. package/dist/src/ui/themes/ansi.js +1 -2
  185. package/dist/src/ui/themes/ansi.js.map +1 -1
  186. package/dist/src/ui/themes/atom-one-dark.js +1 -2
  187. package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
  188. package/dist/src/ui/themes/ayu-light.js +1 -2
  189. package/dist/src/ui/themes/ayu-light.js.map +1 -1
  190. package/dist/src/ui/themes/ayu.js +1 -2
  191. package/dist/src/ui/themes/ayu.js.map +1 -1
  192. package/dist/src/ui/themes/default-light.js +1 -2
  193. package/dist/src/ui/themes/default-light.js.map +1 -1
  194. package/dist/src/ui/themes/default.js +1 -2
  195. package/dist/src/ui/themes/default.js.map +1 -1
  196. package/dist/src/ui/themes/dracula.js +1 -2
  197. package/dist/src/ui/themes/dracula.js.map +1 -1
  198. package/dist/src/ui/themes/github-dark.js +1 -2
  199. package/dist/src/ui/themes/github-dark.js.map +1 -1
  200. package/dist/src/ui/themes/github-light.js +1 -2
  201. package/dist/src/ui/themes/github-light.js.map +1 -1
  202. package/dist/src/ui/themes/googlecode.js +1 -2
  203. package/dist/src/ui/themes/googlecode.js.map +1 -1
  204. package/dist/src/ui/themes/no-color.js +1 -30
  205. package/dist/src/ui/themes/no-color.js.map +1 -1
  206. package/dist/src/ui/themes/qwen-dark.js +1 -2
  207. package/dist/src/ui/themes/qwen-dark.js.map +1 -1
  208. package/dist/src/ui/themes/qwen-light.js +1 -2
  209. package/dist/src/ui/themes/qwen-light.js.map +1 -1
  210. package/dist/src/ui/themes/shades-of-purple.js +1 -2
  211. package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
  212. package/dist/src/ui/themes/theme-manager.d.ts +0 -6
  213. package/dist/src/ui/themes/theme-manager.js +1 -8
  214. package/dist/src/ui/themes/theme-manager.js.map +1 -1
  215. package/dist/src/ui/themes/theme.d.ts +2 -45
  216. package/dist/src/ui/themes/theme.js +107 -92
  217. package/dist/src/ui/themes/theme.js.map +1 -1
  218. package/dist/src/ui/themes/xcode.js +1 -2
  219. package/dist/src/ui/themes/xcode.js.map +1 -1
  220. package/dist/src/ui/types.d.ts +4 -30
  221. package/dist/src/ui/types.js +0 -2
  222. package/dist/src/ui/types.js.map +1 -1
  223. package/dist/src/ui/utils/CodeColorizer.d.ts +1 -2
  224. package/dist/src/ui/utils/CodeColorizer.js +4 -5
  225. package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
  226. package/dist/src/ui/utils/ConsolePatcher.d.ts +0 -1
  227. package/dist/src/ui/utils/ConsolePatcher.js +0 -3
  228. package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
  229. package/dist/src/ui/utils/InlineMarkdownRenderer.js +1 -8
  230. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
  231. package/dist/src/ui/utils/MarkdownDisplay.js +2 -4
  232. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  233. package/dist/src/ui/utils/commandUtils.d.ts +0 -1
  234. package/dist/src/ui/utils/commandUtils.js +1 -22
  235. package/dist/src/ui/utils/commandUtils.js.map +1 -1
  236. package/dist/src/ui/utils/computeStats.js +1 -3
  237. package/dist/src/ui/utils/computeStats.js.map +1 -1
  238. package/dist/src/ui/utils/errorParsing.d.ts +7 -0
  239. package/dist/src/ui/utils/errorParsing.js +90 -0
  240. package/dist/src/ui/utils/errorParsing.js.map +1 -0
  241. package/dist/src/ui/utils/updateCheck.d.ts +1 -1
  242. package/dist/src/ui/utils/updateCheck.js +10 -4
  243. package/dist/src/ui/utils/updateCheck.js.map +1 -1
  244. package/dist/src/utils/cleanup.d.ts +2 -2
  245. package/dist/src/utils/cleanup.js +2 -2
  246. package/dist/src/utils/cleanup.js.map +1 -1
  247. package/dist/src/utils/gitUtils.d.ts +1 -21
  248. package/dist/src/utils/gitUtils.js +3 -68
  249. package/dist/src/utils/gitUtils.js.map +1 -1
  250. package/dist/src/utils/installationInfo.js +5 -5
  251. package/dist/src/utils/installationInfo.js.map +1 -1
  252. package/dist/src/utils/readStdin.js +0 -10
  253. package/dist/src/utils/readStdin.js.map +1 -1
  254. package/dist/src/utils/sandbox.js +434 -457
  255. package/dist/src/utils/sandbox.js.map +1 -1
  256. package/dist/src/utils/version.js +1 -1
  257. package/dist/src/utils/version.js.map +1 -1
  258. package/dist/src/validateNonInterActiveAuth.js +7 -4
  259. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  260. package/dist/tsconfig.tsbuildinfo +1 -1
  261. package/package.json +6 -6
  262. package/dist/src/commands/mcp/add.d.ts +0 -7
  263. package/dist/src/commands/mcp/add.js +0 -166
  264. package/dist/src/commands/mcp/add.js.map +0 -1
  265. package/dist/src/commands/mcp/list.d.ts +0 -8
  266. package/dist/src/commands/mcp/list.js +0 -110
  267. package/dist/src/commands/mcp/list.js.map +0 -1
  268. package/dist/src/commands/mcp/remove.d.ts +0 -7
  269. package/dist/src/commands/mcp/remove.js +0 -44
  270. package/dist/src/commands/mcp/remove.js.map +0 -1
  271. package/dist/src/commands/mcp.d.ts +0 -7
  272. package/dist/src/commands/mcp.js +0 -23
  273. package/dist/src/commands/mcp.js.map +0 -1
  274. package/dist/src/config/auth.test.d.ts +0 -6
  275. package/dist/src/config/auth.test.js +0 -57
  276. package/dist/src/config/auth.test.js.map +0 -1
  277. package/dist/src/config/keyBindings.d.ts +0 -66
  278. package/dist/src/config/keyBindings.js +0 -141
  279. package/dist/src/config/keyBindings.js.map +0 -1
  280. package/dist/src/config/keyBindings.test.d.ts +0 -6
  281. package/dist/src/config/keyBindings.test.js +0 -51
  282. package/dist/src/config/keyBindings.test.js.map +0 -1
  283. package/dist/src/config/settingsSchema.d.ts +0 -613
  284. package/dist/src/config/settingsSchema.js +0 -586
  285. package/dist/src/config/settingsSchema.js.map +0 -1
  286. package/dist/src/config/settingsSchema.test.d.ts +0 -6
  287. package/dist/src/config/settingsSchema.test.js +0 -196
  288. package/dist/src/config/settingsSchema.test.js.map +0 -1
  289. package/dist/src/config/trustedFolders.d.ts +0 -37
  290. package/dist/src/config/trustedFolders.js +0 -118
  291. package/dist/src/config/trustedFolders.js.map +0 -1
  292. package/dist/src/config/trustedFolders.test.d.ts +0 -6
  293. package/dist/src/config/trustedFolders.test.js +0 -160
  294. package/dist/src/config/trustedFolders.test.js.map +0 -1
  295. package/dist/src/gemini.test.d.ts +0 -6
  296. package/dist/src/gemini.test.js +0 -193
  297. package/dist/src/gemini.test.js.map +0 -1
  298. package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
  299. package/dist/src/services/BuiltinCommandLoader.test.js +0 -111
  300. package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
  301. package/dist/src/services/CommandService.test.d.ts +0 -6
  302. package/dist/src/services/CommandService.test.js +0 -232
  303. package/dist/src/services/CommandService.test.js.map +0 -1
  304. package/dist/src/test-utils/customMatchers.d.ts +0 -14
  305. package/dist/src/test-utils/customMatchers.js +0 -46
  306. package/dist/src/test-utils/customMatchers.js.map +0 -1
  307. package/dist/src/test-utils/mockCommandContext.d.ts +0 -18
  308. package/dist/src/test-utils/mockCommandContext.js +0 -87
  309. package/dist/src/test-utils/mockCommandContext.js.map +0 -1
  310. package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
  311. package/dist/src/test-utils/mockCommandContext.test.js +0 -51
  312. package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
  313. package/dist/src/test-utils/render.d.ts +0 -8
  314. package/dist/src/test-utils/render.js +0 -10
  315. package/dist/src/test-utils/render.js.map +0 -1
  316. package/dist/src/ui/IdeIntegrationNudge.d.ts +0 -16
  317. package/dist/src/ui/IdeIntegrationNudge.js +0 -52
  318. package/dist/src/ui/IdeIntegrationNudge.js.map +0 -1
  319. package/dist/src/ui/commands/agentsCommand.d.ts +0 -7
  320. package/dist/src/ui/commands/agentsCommand.js +0 -32
  321. package/dist/src/ui/commands/agentsCommand.js.map +0 -1
  322. package/dist/src/ui/commands/settingsCommand.d.ts +0 -7
  323. package/dist/src/ui/commands/settingsCommand.js +0 -16
  324. package/dist/src/ui/commands/settingsCommand.js.map +0 -1
  325. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
  326. package/dist/src/ui/commands/setupGithubCommand.test.js +0 -167
  327. package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
  328. package/dist/src/ui/commands/summaryCommand.d.ts +0 -7
  329. package/dist/src/ui/commands/summaryCommand.js +0 -149
  330. package/dist/src/ui/commands/summaryCommand.js.map +0 -1
  331. package/dist/src/ui/commands/terminalSetupCommand.d.ts +0 -13
  332. package/dist/src/ui/commands/terminalSetupCommand.js +0 -41
  333. package/dist/src/ui/commands/terminalSetupCommand.js.map +0 -1
  334. package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
  335. package/dist/src/ui/components/AuthDialog.test.js +0 -220
  336. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  337. package/dist/src/ui/components/ContextUsageDisplay.d.ts +0 -9
  338. package/dist/src/ui/components/ContextUsageDisplay.js +0 -14
  339. package/dist/src/ui/components/ContextUsageDisplay.js.map +0 -1
  340. package/dist/src/ui/components/FolderTrustDialog.d.ts +0 -16
  341. package/dist/src/ui/components/FolderTrustDialog.js +0 -39
  342. package/dist/src/ui/components/FolderTrustDialog.js.map +0 -1
  343. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
  344. package/dist/src/ui/components/FolderTrustDialog.test.js +0 -26
  345. package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
  346. package/dist/src/ui/components/Header.test.d.ts +0 -6
  347. package/dist/src/ui/components/Header.test.js +0 -37
  348. package/dist/src/ui/components/Header.test.js.map +0 -1
  349. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  350. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -91
  351. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  352. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  353. package/dist/src/ui/components/LoadingIndicator.test.js +0 -190
  354. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  355. package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +0 -6
  356. package/dist/src/ui/components/OpenAIKeyPrompt.test.js +0 -44
  357. package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +0 -1
  358. package/dist/src/ui/components/QuitConfirmationDialog.d.ts +0 -17
  359. package/dist/src/ui/components/QuitConfirmationDialog.js +0 -44
  360. package/dist/src/ui/components/QuitConfirmationDialog.js.map +0 -1
  361. package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +0 -6
  362. package/dist/src/ui/components/QwenOAuthProgress.test.js +0 -292
  363. package/dist/src/ui/components/QwenOAuthProgress.test.js.map +0 -1
  364. package/dist/src/ui/components/SettingsDialog.d.ts +0 -14
  365. package/dist/src/ui/components/SettingsDialog.js +0 -519
  366. package/dist/src/ui/components/SettingsDialog.js.map +0 -1
  367. package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
  368. package/dist/src/ui/components/SettingsDialog.test.js +0 -568
  369. package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
  370. package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +0 -6
  371. package/dist/src/ui/components/ShellConfirmationDialog.test.js +0 -40
  372. package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +0 -1
  373. package/dist/src/ui/components/TodoDisplay.d.ts +0 -16
  374. package/dist/src/ui/components/TodoDisplay.js +0 -27
  375. package/dist/src/ui/components/TodoDisplay.js.map +0 -1
  376. package/dist/src/ui/components/TodoDisplay.test.d.ts +0 -6
  377. package/dist/src/ui/components/TodoDisplay.test.js +0 -77
  378. package/dist/src/ui/components/TodoDisplay.test.js.map +0 -1
  379. package/dist/src/ui/components/WelcomeBackDialog.d.ts +0 -13
  380. package/dist/src/ui/components/WelcomeBackDialog.js +0 -31
  381. package/dist/src/ui/components/WelcomeBackDialog.js.map +0 -1
  382. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  383. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
  384. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  385. package/dist/src/ui/components/messages/SummaryMessage.d.ts +0 -11
  386. package/dist/src/ui/components/messages/SummaryMessage.js +0 -35
  387. package/dist/src/ui/components/messages/SummaryMessage.js.map +0 -1
  388. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  389. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
  390. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  391. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  392. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -146
  393. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  394. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  395. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -154
  396. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  397. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
  398. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -111
  399. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
  400. package/dist/src/ui/components/shared/TextInput.d.ts +0 -16
  401. package/dist/src/ui/components/shared/TextInput.js +0 -127
  402. package/dist/src/ui/components/shared/TextInput.js.map +0 -1
  403. package/dist/src/ui/components/subagents/constants.d.ts +0 -23
  404. package/dist/src/ui/components/subagents/constants.js +0 -67
  405. package/dist/src/ui/components/subagents/constants.js.map +0 -1
  406. package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +0 -15
  407. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +0 -171
  408. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +0 -1
  409. package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +0 -15
  410. package/dist/src/ui/components/subagents/create/ColorSelector.js +0 -41
  411. package/dist/src/ui/components/subagents/create/ColorSelector.js.map +0 -1
  412. package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +0 -10
  413. package/dist/src/ui/components/subagents/create/CreationSummary.js +0 -163
  414. package/dist/src/ui/components/subagents/create/CreationSummary.js.map +0 -1
  415. package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +0 -10
  416. package/dist/src/ui/components/subagents/create/DescriptionInput.js +0 -105
  417. package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +0 -1
  418. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +0 -10
  419. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +0 -33
  420. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +0 -1
  421. package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +0 -10
  422. package/dist/src/ui/components/subagents/create/LocationSelector.js +0 -33
  423. package/dist/src/ui/components/subagents/create/LocationSelector.js.map +0 -1
  424. package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +0 -26
  425. package/dist/src/ui/components/subagents/create/TextEntryStep.js +0 -28
  426. package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +0 -1
  427. package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +0 -16
  428. package/dist/src/ui/components/subagents/create/ToolSelector.js +0 -143
  429. package/dist/src/ui/components/subagents/create/ToolSelector.js.map +0 -1
  430. package/dist/src/ui/components/subagents/index.d.ts +0 -8
  431. package/dist/src/ui/components/subagents/index.js +0 -12
  432. package/dist/src/ui/components/subagents/index.js.map +0 -1
  433. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +0 -13
  434. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +0 -45
  435. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +0 -1
  436. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +0 -13
  437. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +0 -32
  438. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +0 -1
  439. package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +0 -15
  440. package/dist/src/ui/components/subagents/manage/AgentEditStep.js +0 -62
  441. package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +0 -1
  442. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +0 -12
  443. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +0 -224
  444. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +0 -1
  445. package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +0 -11
  446. package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +0 -18
  447. package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +0 -1
  448. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +0 -15
  449. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +0 -220
  450. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +0 -1
  451. package/dist/src/ui/components/subagents/reducers.d.ts +0 -14
  452. package/dist/src/ui/components/subagents/reducers.js +0 -161
  453. package/dist/src/ui/components/subagents/reducers.js.map +0 -1
  454. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +0 -19
  455. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +0 -184
  456. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +0 -1
  457. package/dist/src/ui/components/subagents/types.d.ts +0 -137
  458. package/dist/src/ui/components/subagents/types.js +0 -15
  459. package/dist/src/ui/components/subagents/types.js.map +0 -1
  460. package/dist/src/ui/components/subagents/utils.d.ts +0 -15
  461. package/dist/src/ui/components/subagents/utils.js +0 -79
  462. package/dist/src/ui/components/subagents/utils.js.map +0 -1
  463. package/dist/src/ui/contexts/KeypressContext.d.ts +0 -31
  464. package/dist/src/ui/contexts/KeypressContext.js +0 -388
  465. package/dist/src/ui/contexts/KeypressContext.js.map +0 -1
  466. package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
  467. package/dist/src/ui/contexts/KeypressContext.test.js +0 -754
  468. package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
  469. package/dist/src/ui/contexts/SettingsContext.d.ts +0 -9
  470. package/dist/src/ui/contexts/SettingsContext.js +0 -15
  471. package/dist/src/ui/contexts/SettingsContext.js.map +0 -1
  472. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
  473. package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -824
  474. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
  475. package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +0 -6
  476. package/dist/src/ui/hooks/shellCommandProcessor.test.js +0 -328
  477. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
  478. package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +0 -11
  479. package/dist/src/ui/hooks/useAgentsManagerDialog.js +0 -21
  480. package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +0 -1
  481. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +0 -6
  482. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +0 -191
  483. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
  484. package/dist/src/ui/hooks/useDialogClose.d.ts +0 -34
  485. package/dist/src/ui/hooks/useDialogClose.js +0 -62
  486. package/dist/src/ui/hooks/useDialogClose.js.map +0 -1
  487. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
  488. package/dist/src/ui/hooks/useEditorSettings.test.js +0 -164
  489. package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
  490. package/dist/src/ui/hooks/useFolderTrust.d.ts +0 -12
  491. package/dist/src/ui/hooks/useFolderTrust.js +0 -55
  492. package/dist/src/ui/hooks/useFolderTrust.js.map +0 -1
  493. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
  494. package/dist/src/ui/hooks/useGitBranchName.test.js +0 -239
  495. package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
  496. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
  497. package/dist/src/ui/hooks/useHistoryManager.test.js +0 -171
  498. package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
  499. package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
  500. package/dist/src/ui/hooks/useInputHistory.test.js +0 -207
  501. package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
  502. package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -15
  503. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +0 -20
  504. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +0 -1
  505. package/dist/src/ui/hooks/useLaunchEditor.d.ts +0 -10
  506. package/dist/src/ui/hooks/useLaunchEditor.js +0 -70
  507. package/dist/src/ui/hooks/useLaunchEditor.js.map +0 -1
  508. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
  509. package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -91
  510. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
  511. package/dist/src/ui/hooks/useMessageQueue.d.ts +0 -22
  512. package/dist/src/ui/hooks/useMessageQueue.js +0 -49
  513. package/dist/src/ui/hooks/useMessageQueue.js.map +0 -1
  514. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
  515. package/dist/src/ui/hooks/useMessageQueue.test.js +0 -158
  516. package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
  517. package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
  518. package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
  519. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
  520. package/dist/src/ui/hooks/useQuitConfirmation.d.ts +0 -14
  521. package/dist/src/ui/hooks/useQuitConfirmation.js +0 -36
  522. package/dist/src/ui/hooks/useQuitConfirmation.js.map +0 -1
  523. package/dist/src/ui/hooks/useQwenAuth.test.d.ts +0 -6
  524. package/dist/src/ui/hooks/useQwenAuth.test.js +0 -288
  525. package/dist/src/ui/hooks/useQwenAuth.test.js.map +0 -1
  526. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
  527. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -163
  528. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
  529. package/dist/src/ui/hooks/useSettingsCommand.d.ts +0 -10
  530. package/dist/src/ui/hooks/useSettingsCommand.js +0 -21
  531. package/dist/src/ui/hooks/useSettingsCommand.js.map +0 -1
  532. package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
  533. package/dist/src/ui/hooks/useShellHistory.test.js +0 -162
  534. package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
  535. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -6
  536. package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -272
  537. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
  538. package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +0 -10
  539. package/dist/src/ui/hooks/useSubagentCreateDialog.js +0 -21
  540. package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +0 -1
  541. package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
  542. package/dist/src/ui/hooks/useTimer.test.js +0 -90
  543. package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
  544. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
  545. package/dist/src/ui/hooks/useToolScheduler.test.js +0 -846
  546. package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
  547. package/dist/src/ui/hooks/useWelcomeBack.d.ts +0 -23
  548. package/dist/src/ui/hooks/useWelcomeBack.js +0 -78
  549. package/dist/src/ui/hooks/useWelcomeBack.js.map +0 -1
  550. package/dist/src/ui/keyMatchers.d.ts +0 -26
  551. package/dist/src/ui/keyMatchers.js +0 -68
  552. package/dist/src/ui/keyMatchers.js.map +0 -1
  553. package/dist/src/ui/keyMatchers.test.d.ts +0 -6
  554. package/dist/src/ui/keyMatchers.test.js +0 -276
  555. package/dist/src/ui/keyMatchers.test.js.map +0 -1
  556. package/dist/src/ui/semantic-colors.d.ts +0 -7
  557. package/dist/src/ui/semantic-colors.js +0 -24
  558. package/dist/src/ui/semantic-colors.js.map +0 -1
  559. package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
  560. package/dist/src/ui/themes/color-utils.test.js +0 -197
  561. package/dist/src/ui/themes/color-utils.test.js.map +0 -1
  562. package/dist/src/ui/themes/semantic-tokens.d.ts +0 -37
  563. package/dist/src/ui/themes/semantic-tokens.js +0 -94
  564. package/dist/src/ui/themes/semantic-tokens.js.map +0 -1
  565. package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
  566. package/dist/src/ui/themes/theme-manager.test.js +0 -83
  567. package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
  568. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  569. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -151
  570. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
  571. package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
  572. package/dist/src/ui/utils/clipboardUtils.test.js +0 -65
  573. package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
  574. package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
  575. package/dist/src/ui/utils/commandUtils.test.js +0 -294
  576. package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
  577. package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
  578. package/dist/src/ui/utils/displayUtils.test.js +0 -42
  579. package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
  580. package/dist/src/ui/utils/formatters.test.d.ts +0 -6
  581. package/dist/src/ui/utils/formatters.test.js +0 -56
  582. package/dist/src/ui/utils/formatters.test.js.map +0 -1
  583. package/dist/src/ui/utils/isNarrowWidth.d.ts +0 -6
  584. package/dist/src/ui/utils/isNarrowWidth.js +0 -9
  585. package/dist/src/ui/utils/isNarrowWidth.js.map +0 -1
  586. package/dist/src/ui/utils/kittyProtocolDetector.d.ts +0 -13
  587. package/dist/src/ui/utils/kittyProtocolDetector.js +0 -88
  588. package/dist/src/ui/utils/kittyProtocolDetector.js.map +0 -1
  589. package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
  590. package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
  591. package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
  592. package/dist/src/ui/utils/platformConstants.d.ts +0 -45
  593. package/dist/src/ui/utils/platformConstants.js +0 -46
  594. package/dist/src/ui/utils/platformConstants.js.map +0 -1
  595. package/dist/src/ui/utils/terminalSetup.d.ts +0 -30
  596. package/dist/src/ui/utils/terminalSetup.js +0 -281
  597. package/dist/src/ui/utils/terminalSetup.js.map +0 -1
  598. package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
  599. package/dist/src/ui/utils/updateCheck.test.js +0 -145
  600. package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
  601. package/dist/src/utils/checks.d.ts +0 -19
  602. package/dist/src/utils/checks.js +0 -24
  603. package/dist/src/utils/checks.js.map +0 -1
  604. package/dist/src/utils/dialogScopeUtils.d.ts +0 -31
  605. package/dist/src/utils/dialogScopeUtils.js +0 -48
  606. package/dist/src/utils/dialogScopeUtils.js.map +0 -1
  607. package/dist/src/utils/gitUtils.test.d.ts +0 -6
  608. package/dist/src/utils/gitUtils.test.js +0 -113
  609. package/dist/src/utils/gitUtils.test.js.map +0 -1
  610. package/dist/src/utils/installationInfo.test.d.ts +0 -6
  611. package/dist/src/utils/installationInfo.test.js +0 -242
  612. package/dist/src/utils/installationInfo.test.js.map +0 -1
  613. package/dist/src/utils/settingsUtils.d.ts +0 -134
  614. package/dist/src/utils/settingsUtils.js +0 -336
  615. package/dist/src/utils/settingsUtils.js.map +0 -1
  616. package/dist/src/utils/settingsUtils.test.d.ts +0 -6
  617. package/dist/src/utils/settingsUtils.test.js +0 -514
  618. package/dist/src/utils/settingsUtils.test.js.map +0 -1
  619. package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
  620. package/dist/src/utils/userStartupWarnings.test.js +0 -67
  621. package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
  622. package/dist/src/zed-integration/acp.d.ts +0 -63
  623. package/dist/src/zed-integration/acp.js.map +0 -1
  624. package/dist/src/zed-integration/fileSystemService.d.ts +0 -19
  625. package/dist/src/zed-integration/fileSystemService.js +0 -43
  626. package/dist/src/zed-integration/fileSystemService.js.map +0 -1
  627. package/dist/src/zed-integration/schema.d.ts +0 -11782
  628. package/dist/src/zed-integration/schema.js +0 -311
  629. package/dist/src/zed-integration/schema.js.map +0 -1
  630. package/dist/src/zed-integration/zedIntegration.d.ts +0 -10
  631. package/dist/src/zed-integration/zedIntegration.js +0 -765
  632. package/dist/src/zed-integration/zedIntegration.js.map +0 -1
@@ -1,846 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /* eslint-disable @typescript-eslint/no-explicit-any */
7
- import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
8
- import { renderHook, act } from '@testing-library/react';
9
- import { useReactToolScheduler, mapToDisplay, } from './useReactToolScheduler.js';
10
- import { ToolConfirmationOutcome, ApprovalMode, Kind, BaseDeclarativeTool, BaseToolInvocation, } from '@umsai/ums-code-core';
11
- import { ToolCallStatus, } from '../types.js';
12
- // Mocks
13
- vi.mock('@umsai/ums-code-core', async () => {
14
- const actual = await vi.importActual('@umsai/ums-code-core');
15
- return {
16
- ...actual,
17
- ToolRegistry: vi.fn(),
18
- Config: vi.fn(),
19
- };
20
- });
21
- const mockToolRegistry = {
22
- getTool: vi.fn(),
23
- };
24
- const mockConfig = {
25
- getToolRegistry: vi.fn(() => mockToolRegistry),
26
- getApprovalMode: vi.fn(() => ApprovalMode.DEFAULT),
27
- getUsageStatisticsEnabled: () => true,
28
- getDebugMode: () => false,
29
- getSessionId: () => 'test-session-id',
30
- getContentGeneratorConfig: () => ({
31
- model: 'test-model',
32
- authType: 'oauth-personal',
33
- }),
34
- };
35
- class MockToolInvocation extends BaseToolInvocation {
36
- tool;
37
- constructor(tool, params) {
38
- super(params);
39
- this.tool = tool;
40
- }
41
- getDescription() {
42
- return JSON.stringify(this.params);
43
- }
44
- shouldConfirmExecute(abortSignal) {
45
- return this.tool.shouldConfirmExecute(this.params, abortSignal);
46
- }
47
- execute(signal, updateOutput, terminalColumns, terminalRows) {
48
- return this.tool.execute(this.params, signal, updateOutput, terminalColumns, terminalRows);
49
- }
50
- }
51
- class MockTool extends BaseDeclarativeTool {
52
- constructor(name, displayName, canUpdateOutput = false, shouldConfirm = false, isOutputMarkdown = false) {
53
- super(name, displayName, 'A mock tool for testing', Kind.Other, {}, isOutputMarkdown, canUpdateOutput);
54
- if (shouldConfirm) {
55
- this.shouldConfirmExecute.mockImplementation(async () => ({
56
- type: 'edit',
57
- title: 'Mock Tool Requires Confirmation',
58
- onConfirm: mockOnUserConfirmForToolConfirmation,
59
- filePath: 'mock',
60
- fileName: 'mockToolRequiresConfirmation.ts',
61
- fileDiff: 'Mock tool requires confirmation',
62
- originalContent: 'Original content',
63
- newContent: 'New content',
64
- }));
65
- }
66
- }
67
- execute = vi.fn();
68
- shouldConfirmExecute = vi.fn();
69
- createInvocation(params) {
70
- return new MockToolInvocation(this, params);
71
- }
72
- }
73
- const mockTool = new MockTool('mockTool', 'Mock Tool');
74
- const mockToolWithLiveOutput = new MockTool('mockToolWithLiveOutput', 'Mock Tool With Live Output', true);
75
- let mockOnUserConfirmForToolConfirmation;
76
- const mockToolRequiresConfirmation = new MockTool('mockToolRequiresConfirmation', 'Mock Tool Requires Confirmation', false, true);
77
- describe('useReactToolScheduler in YOLO Mode', () => {
78
- let onComplete;
79
- let setPendingHistoryItem;
80
- beforeEach(() => {
81
- onComplete = vi.fn();
82
- setPendingHistoryItem = vi.fn();
83
- mockToolRegistry.getTool.mockClear();
84
- mockToolRequiresConfirmation.execute.mockClear();
85
- mockToolRequiresConfirmation.shouldConfirmExecute.mockClear();
86
- // IMPORTANT: Enable YOLO mode for this test suite
87
- mockConfig.getApprovalMode.mockReturnValue(ApprovalMode.YOLO);
88
- vi.useFakeTimers();
89
- });
90
- afterEach(() => {
91
- vi.clearAllTimers();
92
- vi.useRealTimers();
93
- // IMPORTANT: Disable YOLO mode after this test suite
94
- mockConfig.getApprovalMode.mockReturnValue(ApprovalMode.DEFAULT);
95
- });
96
- const renderSchedulerInYoloMode = () => renderHook(() => useReactToolScheduler(onComplete, mockConfig, setPendingHistoryItem, () => undefined, () => { }));
97
- it('should skip confirmation and execute tool directly when yoloMode is true', async () => {
98
- mockToolRegistry.getTool.mockReturnValue(mockToolRequiresConfirmation);
99
- const expectedOutput = 'YOLO Confirmed output';
100
- mockToolRequiresConfirmation.execute.mockResolvedValue({
101
- llmContent: expectedOutput,
102
- returnDisplay: 'YOLO Formatted tool output',
103
- summary: 'YOLO summary',
104
- });
105
- const { result } = renderSchedulerInYoloMode();
106
- const schedule = result.current[1];
107
- const request = {
108
- callId: 'yoloCall',
109
- name: 'mockToolRequiresConfirmation',
110
- args: { data: 'any data' },
111
- };
112
- act(() => {
113
- schedule(request, new AbortController().signal);
114
- });
115
- await act(async () => {
116
- await vi.runAllTimersAsync(); // Process validation
117
- });
118
- await act(async () => {
119
- await vi.runAllTimersAsync(); // Process scheduling
120
- });
121
- await act(async () => {
122
- await vi.runAllTimersAsync(); // Process execution
123
- });
124
- // Check that shouldConfirmExecute was NOT called
125
- expect(mockToolRequiresConfirmation.shouldConfirmExecute).not.toHaveBeenCalled();
126
- // Check that execute WAS called
127
- expect(mockToolRequiresConfirmation.execute).toHaveBeenCalledWith(request.args, expect.any(AbortSignal), undefined, undefined, undefined);
128
- // Check that onComplete was called with success
129
- expect(onComplete).toHaveBeenCalledWith([
130
- expect.objectContaining({
131
- status: 'success',
132
- request,
133
- response: expect.objectContaining({
134
- resultDisplay: 'YOLO Formatted tool output',
135
- responseParts: {
136
- functionResponse: {
137
- id: 'yoloCall',
138
- name: 'mockToolRequiresConfirmation',
139
- response: { output: expectedOutput },
140
- },
141
- },
142
- }),
143
- }),
144
- ]);
145
- // Ensure no confirmation UI was triggered (setPendingHistoryItem should not have been called with confirmation details)
146
- const setPendingHistoryItemCalls = setPendingHistoryItem.mock.calls;
147
- const confirmationCall = setPendingHistoryItemCalls.find((call) => {
148
- const item = typeof call[0] === 'function' ? call[0]({}) : call[0];
149
- return item?.tools?.[0]?.confirmationDetails;
150
- });
151
- expect(confirmationCall).toBeUndefined();
152
- });
153
- });
154
- describe('useReactToolScheduler', () => {
155
- // TODO(ntaylormullen): The following tests are skipped due to difficulties in
156
- // reliably testing the asynchronous state updates and interactions with timers.
157
- // These tests involve complex sequences of events, including confirmations,
158
- // live output updates, and cancellations, which are challenging to assert
159
- // correctly with the current testing setup. Further investigation is needed
160
- // to find a robust way to test these scenarios.
161
- let onComplete;
162
- let setPendingHistoryItem;
163
- let capturedOnConfirmForTest;
164
- beforeEach(() => {
165
- onComplete = vi.fn();
166
- capturedOnConfirmForTest = undefined;
167
- setPendingHistoryItem = vi.fn((updaterOrValue) => {
168
- let pendingItem = null;
169
- if (typeof updaterOrValue === 'function') {
170
- // Loosen the type for prevState to allow for more flexible updates in tests
171
- const prevState = {
172
- type: 'tool_group', // Still default to tool_group for most cases
173
- tools: [],
174
- };
175
- pendingItem = updaterOrValue(prevState); // Allow any for more flexibility
176
- }
177
- else {
178
- pendingItem = updaterOrValue;
179
- }
180
- // Capture onConfirm if it exists, regardless of the exact type of pendingItem
181
- // This is a common pattern in these tests.
182
- if (pendingItem?.tools?.[0]?.confirmationDetails
183
- ?.onConfirm) {
184
- capturedOnConfirmForTest = pendingItem
185
- .tools[0].confirmationDetails?.onConfirm;
186
- }
187
- });
188
- mockToolRegistry.getTool.mockClear();
189
- mockTool.execute.mockClear();
190
- mockTool.shouldConfirmExecute.mockClear();
191
- mockToolWithLiveOutput.execute.mockClear();
192
- mockToolWithLiveOutput.shouldConfirmExecute.mockClear();
193
- mockToolRequiresConfirmation.execute.mockClear();
194
- mockToolRequiresConfirmation.shouldConfirmExecute.mockClear();
195
- mockOnUserConfirmForToolConfirmation = vi.fn();
196
- mockToolRequiresConfirmation.shouldConfirmExecute.mockImplementation(async () => ({
197
- onConfirm: mockOnUserConfirmForToolConfirmation,
198
- fileName: 'mockToolRequiresConfirmation.ts',
199
- fileDiff: 'Mock tool requires confirmation',
200
- type: 'edit',
201
- title: 'Mock Tool Requires Confirmation',
202
- }));
203
- vi.useFakeTimers();
204
- });
205
- afterEach(() => {
206
- vi.clearAllTimers();
207
- vi.useRealTimers();
208
- });
209
- const renderScheduler = () => renderHook(() => useReactToolScheduler(onComplete, mockConfig, setPendingHistoryItem, () => undefined, () => { }));
210
- it('initial state should be empty', () => {
211
- const { result } = renderScheduler();
212
- expect(result.current[0]).toEqual([]);
213
- });
214
- it('should schedule and execute a tool call successfully', async () => {
215
- mockToolRegistry.getTool.mockReturnValue(mockTool);
216
- mockTool.execute.mockResolvedValue({
217
- llmContent: 'Tool output',
218
- returnDisplay: 'Formatted tool output',
219
- summary: 'Formatted summary',
220
- });
221
- mockTool.shouldConfirmExecute.mockResolvedValue(null);
222
- const { result } = renderScheduler();
223
- const schedule = result.current[1];
224
- const request = {
225
- callId: 'call1',
226
- name: 'mockTool',
227
- args: { param: 'value' },
228
- };
229
- act(() => {
230
- schedule(request, new AbortController().signal);
231
- });
232
- await act(async () => {
233
- await vi.runAllTimersAsync();
234
- });
235
- await act(async () => {
236
- await vi.runAllTimersAsync();
237
- });
238
- await act(async () => {
239
- await vi.runAllTimersAsync();
240
- });
241
- expect(mockTool.execute).toHaveBeenCalledWith(request.args, expect.any(AbortSignal), undefined, undefined, undefined);
242
- expect(onComplete).toHaveBeenCalledWith([
243
- expect.objectContaining({
244
- status: 'success',
245
- request,
246
- response: expect.objectContaining({
247
- resultDisplay: 'Formatted tool output',
248
- responseParts: {
249
- functionResponse: {
250
- id: 'call1',
251
- name: 'mockTool',
252
- response: { output: 'Tool output' },
253
- },
254
- },
255
- }),
256
- }),
257
- ]);
258
- expect(result.current[0]).toEqual([]);
259
- });
260
- it('should handle tool not found', async () => {
261
- mockToolRegistry.getTool.mockReturnValue(undefined);
262
- const { result } = renderScheduler();
263
- const schedule = result.current[1];
264
- const request = {
265
- callId: 'call1',
266
- name: 'nonexistentTool',
267
- args: {},
268
- };
269
- act(() => {
270
- schedule(request, new AbortController().signal);
271
- });
272
- await act(async () => {
273
- await vi.runAllTimersAsync();
274
- });
275
- await act(async () => {
276
- await vi.runAllTimersAsync();
277
- });
278
- expect(onComplete).toHaveBeenCalledWith([
279
- expect.objectContaining({
280
- status: 'error',
281
- request,
282
- response: expect.objectContaining({
283
- error: expect.objectContaining({
284
- message: 'Tool "nonexistentTool" not found in registry.',
285
- }),
286
- }),
287
- }),
288
- ]);
289
- expect(result.current[0]).toEqual([]);
290
- });
291
- it('should handle error during shouldConfirmExecute', async () => {
292
- mockToolRegistry.getTool.mockReturnValue(mockTool);
293
- const confirmError = new Error('Confirmation check failed');
294
- mockTool.shouldConfirmExecute.mockRejectedValue(confirmError);
295
- const { result } = renderScheduler();
296
- const schedule = result.current[1];
297
- const request = {
298
- callId: 'call1',
299
- name: 'mockTool',
300
- args: {},
301
- };
302
- act(() => {
303
- schedule(request, new AbortController().signal);
304
- });
305
- await act(async () => {
306
- await vi.runAllTimersAsync();
307
- });
308
- await act(async () => {
309
- await vi.runAllTimersAsync();
310
- });
311
- expect(onComplete).toHaveBeenCalledWith([
312
- expect.objectContaining({
313
- status: 'error',
314
- request,
315
- response: expect.objectContaining({
316
- error: confirmError,
317
- }),
318
- }),
319
- ]);
320
- expect(result.current[0]).toEqual([]);
321
- });
322
- it('should handle error during execute', async () => {
323
- mockToolRegistry.getTool.mockReturnValue(mockTool);
324
- mockTool.shouldConfirmExecute.mockResolvedValue(null);
325
- const execError = new Error('Execution failed');
326
- mockTool.execute.mockRejectedValue(execError);
327
- const { result } = renderScheduler();
328
- const schedule = result.current[1];
329
- const request = {
330
- callId: 'call1',
331
- name: 'mockTool',
332
- args: {},
333
- };
334
- act(() => {
335
- schedule(request, new AbortController().signal);
336
- });
337
- await act(async () => {
338
- await vi.runAllTimersAsync();
339
- });
340
- await act(async () => {
341
- await vi.runAllTimersAsync();
342
- });
343
- await act(async () => {
344
- await vi.runAllTimersAsync();
345
- });
346
- expect(onComplete).toHaveBeenCalledWith([
347
- expect.objectContaining({
348
- status: 'error',
349
- request,
350
- response: expect.objectContaining({
351
- error: execError,
352
- }),
353
- }),
354
- ]);
355
- expect(result.current[0]).toEqual([]);
356
- });
357
- it.skip('should handle tool requiring confirmation - approved', async () => {
358
- mockToolRegistry.getTool.mockReturnValue(mockToolRequiresConfirmation);
359
- const expectedOutput = 'Confirmed output';
360
- mockToolRequiresConfirmation.execute.mockResolvedValue({
361
- llmContent: expectedOutput,
362
- returnDisplay: 'Confirmed display',
363
- summary: 'Confirmed summary',
364
- });
365
- const { result } = renderScheduler();
366
- const schedule = result.current[1];
367
- const request = {
368
- callId: 'callConfirm',
369
- name: 'mockToolRequiresConfirmation',
370
- args: { data: 'sensitive' },
371
- };
372
- act(() => {
373
- schedule(request, new AbortController().signal);
374
- });
375
- await act(async () => {
376
- await vi.runAllTimersAsync();
377
- });
378
- expect(setPendingHistoryItem).toHaveBeenCalled();
379
- expect(capturedOnConfirmForTest).toBeDefined();
380
- await act(async () => {
381
- await capturedOnConfirmForTest?.(ToolConfirmationOutcome.ProceedOnce);
382
- });
383
- await act(async () => {
384
- await vi.runAllTimersAsync();
385
- });
386
- await act(async () => {
387
- await vi.runAllTimersAsync();
388
- });
389
- await act(async () => {
390
- await vi.runAllTimersAsync();
391
- });
392
- expect(mockOnUserConfirmForToolConfirmation).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
393
- expect(mockToolRequiresConfirmation.execute).toHaveBeenCalled();
394
- expect(onComplete).toHaveBeenCalledWith([
395
- expect.objectContaining({
396
- status: 'success',
397
- request,
398
- response: expect.objectContaining({
399
- resultDisplay: 'Confirmed display',
400
- responseParts: expect.arrayContaining([
401
- expect.objectContaining({
402
- functionResponse: expect.objectContaining({
403
- response: { output: expectedOutput },
404
- }),
405
- }),
406
- ]),
407
- }),
408
- }),
409
- ]);
410
- });
411
- it.skip('should handle tool requiring confirmation - cancelled by user', async () => {
412
- mockToolRegistry.getTool.mockReturnValue(mockToolRequiresConfirmation);
413
- const { result } = renderScheduler();
414
- const schedule = result.current[1];
415
- const request = {
416
- callId: 'callConfirmCancel',
417
- name: 'mockToolRequiresConfirmation',
418
- args: {},
419
- };
420
- act(() => {
421
- schedule(request, new AbortController().signal);
422
- });
423
- await act(async () => {
424
- await vi.runAllTimersAsync();
425
- });
426
- expect(setPendingHistoryItem).toHaveBeenCalled();
427
- expect(capturedOnConfirmForTest).toBeDefined();
428
- await act(async () => {
429
- await capturedOnConfirmForTest?.(ToolConfirmationOutcome.Cancel);
430
- });
431
- await act(async () => {
432
- await vi.runAllTimersAsync();
433
- });
434
- await act(async () => {
435
- await vi.runAllTimersAsync();
436
- });
437
- expect(mockOnUserConfirmForToolConfirmation).toHaveBeenCalledWith(ToolConfirmationOutcome.Cancel);
438
- expect(onComplete).toHaveBeenCalledWith([
439
- expect.objectContaining({
440
- status: 'cancelled',
441
- request,
442
- response: expect.objectContaining({
443
- responseParts: expect.arrayContaining([
444
- expect.objectContaining({
445
- functionResponse: expect.objectContaining({
446
- response: expect.objectContaining({
447
- error: `User did not allow tool call ${request.name}. Reason: User cancelled.`,
448
- }),
449
- }),
450
- }),
451
- ]),
452
- }),
453
- }),
454
- ]);
455
- });
456
- it.skip('should handle live output updates', async () => {
457
- mockToolRegistry.getTool.mockReturnValue(mockToolWithLiveOutput);
458
- let liveUpdateFn;
459
- let resolveExecutePromise;
460
- const executePromise = new Promise((resolve) => {
461
- resolveExecutePromise = resolve;
462
- });
463
- mockToolWithLiveOutput.execute.mockImplementation(async (_args, _signal, updateFn) => {
464
- liveUpdateFn = updateFn;
465
- return executePromise;
466
- });
467
- mockToolWithLiveOutput.shouldConfirmExecute.mockResolvedValue(null);
468
- const { result } = renderScheduler();
469
- const schedule = result.current[1];
470
- const request = {
471
- callId: 'liveCall',
472
- name: 'mockToolWithLiveOutput',
473
- args: {},
474
- };
475
- act(() => {
476
- schedule(request, new AbortController().signal);
477
- });
478
- await act(async () => {
479
- await vi.runAllTimersAsync();
480
- });
481
- expect(liveUpdateFn).toBeDefined();
482
- expect(setPendingHistoryItem).toHaveBeenCalled();
483
- await act(async () => {
484
- liveUpdateFn?.('Live output 1');
485
- });
486
- await act(async () => {
487
- await vi.runAllTimersAsync();
488
- });
489
- await act(async () => {
490
- liveUpdateFn?.('Live output 2');
491
- });
492
- await act(async () => {
493
- await vi.runAllTimersAsync();
494
- });
495
- act(() => {
496
- resolveExecutePromise({
497
- llmContent: 'Final output',
498
- returnDisplay: 'Final display',
499
- summary: 'Final summary',
500
- });
501
- });
502
- await act(async () => {
503
- await vi.runAllTimersAsync();
504
- });
505
- await act(async () => {
506
- await vi.runAllTimersAsync();
507
- });
508
- expect(onComplete).toHaveBeenCalledWith([
509
- expect.objectContaining({
510
- status: 'success',
511
- request,
512
- response: expect.objectContaining({
513
- resultDisplay: 'Final display',
514
- responseParts: expect.arrayContaining([
515
- expect.objectContaining({
516
- functionResponse: expect.objectContaining({
517
- response: { output: 'Final output' },
518
- }),
519
- }),
520
- ]),
521
- }),
522
- }),
523
- ]);
524
- expect(result.current[0]).toEqual([]);
525
- });
526
- it('should schedule and execute multiple tool calls', async () => {
527
- const tool1 = new MockTool('tool1', 'Tool 1');
528
- tool1.execute.mockResolvedValue({
529
- llmContent: 'Output 1',
530
- returnDisplay: 'Display 1',
531
- summary: 'Summary 1',
532
- });
533
- tool1.shouldConfirmExecute.mockResolvedValue(null);
534
- const tool2 = new MockTool('tool2', 'Tool 2');
535
- tool2.execute.mockResolvedValue({
536
- llmContent: 'Output 2',
537
- returnDisplay: 'Display 2',
538
- summary: 'Summary 2',
539
- });
540
- tool2.shouldConfirmExecute.mockResolvedValue(null);
541
- mockToolRegistry.getTool.mockImplementation((name) => {
542
- if (name === 'tool1')
543
- return tool1;
544
- if (name === 'tool2')
545
- return tool2;
546
- return undefined;
547
- });
548
- const { result } = renderScheduler();
549
- const schedule = result.current[1];
550
- const requests = [
551
- { callId: 'multi1', name: 'tool1', args: { p: 1 } },
552
- { callId: 'multi2', name: 'tool2', args: { p: 2 } },
553
- ];
554
- act(() => {
555
- schedule(requests, new AbortController().signal);
556
- });
557
- await act(async () => {
558
- await vi.runAllTimersAsync();
559
- });
560
- await act(async () => {
561
- await vi.runAllTimersAsync();
562
- });
563
- await act(async () => {
564
- await vi.runAllTimersAsync();
565
- });
566
- await act(async () => {
567
- await vi.runAllTimersAsync();
568
- });
569
- expect(onComplete).toHaveBeenCalledTimes(1);
570
- const completedCalls = onComplete.mock.calls[0][0];
571
- expect(completedCalls.length).toBe(2);
572
- const call1Result = completedCalls.find((c) => c.request.callId === 'multi1');
573
- const call2Result = completedCalls.find((c) => c.request.callId === 'multi2');
574
- expect(call1Result).toMatchObject({
575
- status: 'success',
576
- request: requests[0],
577
- response: expect.objectContaining({
578
- resultDisplay: 'Display 1',
579
- responseParts: {
580
- functionResponse: {
581
- id: 'multi1',
582
- name: 'tool1',
583
- response: { output: 'Output 1' },
584
- },
585
- },
586
- }),
587
- });
588
- expect(call2Result).toMatchObject({
589
- status: 'success',
590
- request: requests[1],
591
- response: expect.objectContaining({
592
- resultDisplay: 'Display 2',
593
- responseParts: {
594
- functionResponse: {
595
- id: 'multi2',
596
- name: 'tool2',
597
- response: { output: 'Output 2' },
598
- },
599
- },
600
- }),
601
- });
602
- expect(result.current[0]).toEqual([]);
603
- });
604
- it.skip('should throw error if scheduling while already running', async () => {
605
- mockToolRegistry.getTool.mockReturnValue(mockTool);
606
- const longExecutePromise = new Promise((resolve) => setTimeout(() => resolve({
607
- llmContent: 'done',
608
- returnDisplay: 'done display',
609
- summary: 'done summary',
610
- }), 50));
611
- mockTool.execute.mockReturnValue(longExecutePromise);
612
- mockTool.shouldConfirmExecute.mockResolvedValue(null);
613
- const { result } = renderScheduler();
614
- const schedule = result.current[1];
615
- const request1 = {
616
- callId: 'run1',
617
- name: 'mockTool',
618
- args: {},
619
- };
620
- const request2 = {
621
- callId: 'run2',
622
- name: 'mockTool',
623
- args: {},
624
- };
625
- act(() => {
626
- schedule(request1, new AbortController().signal);
627
- });
628
- await act(async () => {
629
- await vi.runAllTimersAsync();
630
- });
631
- expect(() => schedule(request2, new AbortController().signal)).toThrow('Cannot schedule tool calls while other tool calls are running');
632
- await act(async () => {
633
- await vi.advanceTimersByTimeAsync(50);
634
- await vi.runAllTimersAsync();
635
- await act(async () => {
636
- await vi.runAllTimersAsync();
637
- });
638
- });
639
- expect(onComplete).toHaveBeenCalledWith([
640
- expect.objectContaining({
641
- status: 'success',
642
- request: request1,
643
- response: expect.objectContaining({ resultDisplay: 'done display' }),
644
- }),
645
- ]);
646
- expect(result.current[0]).toEqual([]);
647
- });
648
- });
649
- describe('mapToDisplay', () => {
650
- const baseRequest = {
651
- callId: 'testCallId',
652
- name: 'testTool',
653
- args: { foo: 'bar' },
654
- };
655
- const baseTool = new MockTool('testTool', 'Test Tool Display');
656
- const baseResponse = {
657
- callId: 'testCallId',
658
- responseParts: [
659
- {
660
- functionResponse: {
661
- name: 'testTool',
662
- id: 'testCallId',
663
- response: { output: 'Test output' },
664
- },
665
- },
666
- ],
667
- resultDisplay: 'Test display output',
668
- error: undefined,
669
- };
670
- const baseInvocation = baseTool.build(baseRequest.args);
671
- const testCases = [
672
- {
673
- name: 'validating',
674
- status: 'validating',
675
- extraProps: { tool: baseTool, invocation: baseInvocation },
676
- expectedStatus: ToolCallStatus.Executing,
677
- expectedName: baseTool.displayName,
678
- expectedDescription: baseInvocation.getDescription(),
679
- },
680
- {
681
- name: 'awaiting_approval',
682
- status: 'awaiting_approval',
683
- extraProps: {
684
- tool: baseTool,
685
- invocation: baseInvocation,
686
- confirmationDetails: {
687
- onConfirm: vi.fn(),
688
- type: 'edit',
689
- title: 'Test Tool Display',
690
- serverName: 'testTool',
691
- toolName: 'testTool',
692
- toolDisplayName: 'Test Tool Display',
693
- filePath: 'mock',
694
- fileName: 'test.ts',
695
- fileDiff: 'Test diff',
696
- originalContent: 'Original content',
697
- newContent: 'New content',
698
- },
699
- },
700
- expectedStatus: ToolCallStatus.Confirming,
701
- expectedName: baseTool.displayName,
702
- expectedDescription: baseInvocation.getDescription(),
703
- },
704
- {
705
- name: 'scheduled',
706
- status: 'scheduled',
707
- extraProps: { tool: baseTool, invocation: baseInvocation },
708
- expectedStatus: ToolCallStatus.Pending,
709
- expectedName: baseTool.displayName,
710
- expectedDescription: baseInvocation.getDescription(),
711
- },
712
- {
713
- name: 'executing no live output',
714
- status: 'executing',
715
- extraProps: { tool: baseTool, invocation: baseInvocation },
716
- expectedStatus: ToolCallStatus.Executing,
717
- expectedName: baseTool.displayName,
718
- expectedDescription: baseInvocation.getDescription(),
719
- },
720
- {
721
- name: 'executing with live output',
722
- status: 'executing',
723
- extraProps: {
724
- tool: baseTool,
725
- invocation: baseInvocation,
726
- liveOutput: 'Live test output',
727
- },
728
- expectedStatus: ToolCallStatus.Executing,
729
- expectedResultDisplay: 'Live test output',
730
- expectedName: baseTool.displayName,
731
- expectedDescription: baseInvocation.getDescription(),
732
- },
733
- {
734
- name: 'success',
735
- status: 'success',
736
- extraProps: {
737
- tool: baseTool,
738
- invocation: baseInvocation,
739
- response: baseResponse,
740
- },
741
- expectedStatus: ToolCallStatus.Success,
742
- expectedResultDisplay: baseResponse.resultDisplay,
743
- expectedName: baseTool.displayName,
744
- expectedDescription: baseInvocation.getDescription(),
745
- },
746
- {
747
- name: 'error tool not found',
748
- status: 'error',
749
- extraProps: {
750
- response: {
751
- ...baseResponse,
752
- error: new Error('Test error tool not found'),
753
- resultDisplay: 'Error display tool not found',
754
- },
755
- },
756
- expectedStatus: ToolCallStatus.Error,
757
- expectedResultDisplay: 'Error display tool not found',
758
- expectedName: baseRequest.name,
759
- expectedDescription: JSON.stringify(baseRequest.args),
760
- },
761
- {
762
- name: 'error tool execution failed',
763
- status: 'error',
764
- extraProps: {
765
- tool: baseTool,
766
- response: {
767
- ...baseResponse,
768
- error: new Error('Tool execution failed'),
769
- resultDisplay: 'Execution failed display',
770
- },
771
- },
772
- expectedStatus: ToolCallStatus.Error,
773
- expectedResultDisplay: 'Execution failed display',
774
- expectedName: baseTool.displayName, // Changed from baseTool.name
775
- expectedDescription: baseInvocation.getDescription(),
776
- },
777
- {
778
- name: 'cancelled',
779
- status: 'cancelled',
780
- extraProps: {
781
- tool: baseTool,
782
- invocation: baseInvocation,
783
- response: {
784
- ...baseResponse,
785
- resultDisplay: 'Cancelled display',
786
- },
787
- },
788
- expectedStatus: ToolCallStatus.Canceled,
789
- expectedResultDisplay: 'Cancelled display',
790
- expectedName: baseTool.displayName,
791
- expectedDescription: baseInvocation.getDescription(),
792
- },
793
- ];
794
- testCases.forEach(({ name: testName, status, extraProps, expectedStatus, expectedResultDisplay, expectedName, expectedDescription, }) => {
795
- it(`should map ToolCall with status '${status}' (${testName}) correctly`, () => {
796
- const toolCall = {
797
- request: baseRequest,
798
- status,
799
- ...(extraProps || {}),
800
- };
801
- const display = mapToDisplay(toolCall);
802
- expect(display.type).toBe('tool_group');
803
- expect(display.tools.length).toBe(1);
804
- const toolDisplay = display.tools[0];
805
- expect(toolDisplay.callId).toBe(baseRequest.callId);
806
- expect(toolDisplay.status).toBe(expectedStatus);
807
- expect(toolDisplay.resultDisplay).toBe(expectedResultDisplay);
808
- expect(toolDisplay.name).toBe(expectedName);
809
- expect(toolDisplay.description).toBe(expectedDescription);
810
- expect(toolDisplay.renderOutputAsMarkdown).toBe(extraProps?.tool?.isOutputMarkdown ?? false);
811
- if (status === 'awaiting_approval') {
812
- expect(toolDisplay.confirmationDetails).toBe(extraProps.confirmationDetails);
813
- }
814
- else {
815
- expect(toolDisplay.confirmationDetails).toBeUndefined();
816
- }
817
- });
818
- });
819
- it('should map an array of ToolCalls correctly', () => {
820
- const toolCall1 = {
821
- request: { ...baseRequest, callId: 'call1' },
822
- status: 'success',
823
- tool: baseTool,
824
- invocation: baseTool.build(baseRequest.args),
825
- response: { ...baseResponse, callId: 'call1' },
826
- };
827
- const toolForCall2 = new MockTool(baseTool.name, baseTool.displayName, false, false, true);
828
- const toolCall2 = {
829
- request: { ...baseRequest, callId: 'call2' },
830
- status: 'executing',
831
- tool: toolForCall2,
832
- invocation: toolForCall2.build(baseRequest.args),
833
- liveOutput: 'markdown output',
834
- };
835
- const display = mapToDisplay([toolCall1, toolCall2]);
836
- expect(display.tools.length).toBe(2);
837
- expect(display.tools[0].callId).toBe('call1');
838
- expect(display.tools[0].status).toBe(ToolCallStatus.Success);
839
- expect(display.tools[0].renderOutputAsMarkdown).toBe(false);
840
- expect(display.tools[1].callId).toBe('call2');
841
- expect(display.tools[1].status).toBe(ToolCallStatus.Executing);
842
- expect(display.tools[1].resultDisplay).toBe('markdown output');
843
- expect(display.tools[1].renderOutputAsMarkdown).toBe(true);
844
- });
845
- });
846
- //# sourceMappingURL=useToolScheduler.test.js.map