@umsai/ums-code 0.0.14-v2 → 0.1.4-v2

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 (827) hide show
  1. package/dist/package.json +16 -11
  2. package/dist/src/commands/extensions/disable.d.ts +2 -3
  3. package/dist/src/commands/extensions/disable.js +20 -6
  4. package/dist/src/commands/extensions/disable.js.map +1 -1
  5. package/dist/src/commands/extensions/enable.d.ts +2 -3
  6. package/dist/src/commands/extensions/enable.js +21 -10
  7. package/dist/src/commands/extensions/enable.js.map +1 -1
  8. package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
  9. package/dist/src/commands/extensions/examples/context/qwen-extension.json +4 -0
  10. package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
  11. package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +4 -0
  12. package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +5 -0
  13. package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
  14. package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
  15. package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +11 -0
  16. package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
  17. package/dist/src/commands/extensions/install.d.ts +3 -2
  18. package/dist/src/commands/extensions/install.js +47 -17
  19. package/dist/src/commands/extensions/install.js.map +1 -1
  20. package/dist/src/commands/extensions/install.test.js +86 -9
  21. package/dist/src/commands/extensions/install.test.js.map +1 -1
  22. package/dist/src/commands/extensions/link.d.ts +12 -0
  23. package/dist/src/commands/extensions/link.js +37 -0
  24. package/dist/src/commands/extensions/link.js.map +1 -0
  25. package/dist/src/commands/extensions/list.js +1 -1
  26. package/dist/src/commands/extensions/list.js.map +1 -1
  27. package/dist/src/commands/extensions/new.d.ts +7 -0
  28. package/dist/src/commands/extensions/new.js +90 -0
  29. package/dist/src/commands/extensions/new.js.map +1 -0
  30. package/dist/src/commands/extensions/new.test.js +59 -0
  31. package/dist/src/commands/extensions/new.test.js.map +1 -0
  32. package/dist/src/commands/extensions/uninstall.js +1 -1
  33. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  34. package/dist/src/commands/extensions/uninstall.test.js +2 -2
  35. package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
  36. package/dist/src/commands/extensions/update.d.ts +2 -1
  37. package/dist/src/commands/extensions/update.js +80 -14
  38. package/dist/src/commands/extensions/update.js.map +1 -1
  39. package/dist/src/commands/extensions.js +4 -0
  40. package/dist/src/commands/extensions.js.map +1 -1
  41. package/dist/src/commands/mcp/add.js +6 -1
  42. package/dist/src/commands/mcp/add.js.map +1 -1
  43. package/dist/src/commands/mcp/list.js +4 -3
  44. package/dist/src/commands/mcp/list.js.map +1 -1
  45. package/dist/src/commands/mcp/remove.js +1 -1
  46. package/dist/src/commands/mcp/remove.js.map +1 -1
  47. package/dist/src/config/auth.d.ts +2 -4
  48. package/dist/src/config/auth.js +10 -36
  49. package/dist/src/config/auth.js.map +1 -1
  50. package/dist/src/config/auth.test.js +12 -32
  51. package/dist/src/config/auth.test.js.map +1 -1
  52. package/dist/src/config/config.d.ts +7 -2
  53. package/dist/src/config/config.js +183 -124
  54. package/dist/src/config/config.js.map +1 -1
  55. package/dist/src/config/extension.d.ts +41 -18
  56. package/dist/src/config/extension.js +352 -195
  57. package/dist/src/config/extension.js.map +1 -1
  58. package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
  59. package/dist/src/config/extensions/extensionEnablement.js +189 -0
  60. package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
  61. package/dist/src/config/extensions/extensionEnablement.test.js +333 -0
  62. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
  63. package/dist/src/config/extensions/github.d.ts +30 -0
  64. package/dist/src/config/extensions/github.js +322 -0
  65. package/dist/src/config/extensions/github.js.map +1 -0
  66. package/dist/src/{ui/components/ModelSelectionDialog.test.d.ts → config/extensions/github.test.d.ts} +1 -1
  67. package/dist/src/config/extensions/github.test.js +334 -0
  68. package/dist/src/config/extensions/github.test.js.map +1 -0
  69. package/dist/src/config/extensions/update.d.ts +19 -0
  70. package/dist/src/config/extensions/update.js +113 -0
  71. package/dist/src/config/extensions/update.js.map +1 -0
  72. package/dist/src/config/extensions/update.test.d.ts +6 -0
  73. package/dist/src/config/extensions/update.test.js +342 -0
  74. package/dist/src/config/extensions/update.test.js.map +1 -0
  75. package/dist/src/config/extensions/variableSchema.d.ts +8 -0
  76. package/dist/src/config/extensions/variableSchema.js +4 -0
  77. package/dist/src/config/extensions/variableSchema.js.map +1 -1
  78. package/dist/src/config/keyBindings.d.ts +5 -1
  79. package/dist/src/config/keyBindings.js +14 -25
  80. package/dist/src/config/keyBindings.js.map +1 -1
  81. package/dist/src/config/settings.d.ts +10 -5
  82. package/dist/src/config/settings.js +218 -275
  83. package/dist/src/config/settings.js.map +1 -1
  84. package/dist/src/config/settingsSchema.d.ts +358 -140
  85. package/dist/src/config/settingsSchema.js +347 -136
  86. package/dist/src/config/settingsSchema.js.map +1 -1
  87. package/dist/src/config/settingsSchema.test.js +64 -57
  88. package/dist/src/config/settingsSchema.test.js.map +1 -1
  89. package/dist/src/config/trustedFolders.d.ts +24 -5
  90. package/dist/src/config/trustedFolders.js +98 -48
  91. package/dist/src/config/trustedFolders.js.map +1 -1
  92. package/dist/src/config/trustedFolders.test.js +196 -20
  93. package/dist/src/config/trustedFolders.test.js.map +1 -1
  94. package/dist/src/core/auth.d.ts +13 -0
  95. package/dist/src/core/auth.js +27 -0
  96. package/dist/src/core/auth.js.map +1 -0
  97. package/dist/src/core/initializer.d.ts +21 -0
  98. package/dist/src/core/initializer.js +33 -0
  99. package/dist/src/core/initializer.js.map +1 -0
  100. package/dist/src/core/theme.d.ts +12 -0
  101. package/dist/src/core/theme.js +20 -0
  102. package/dist/src/core/theme.js.map +1 -0
  103. package/dist/src/gemini.d.ts +3 -2
  104. package/dist/src/gemini.js +167 -138
  105. package/dist/src/gemini.js.map +1 -1
  106. package/dist/src/gemini.test.js +190 -47
  107. package/dist/src/gemini.test.js.map +1 -1
  108. package/dist/src/generated/git-commit.d.ts +2 -2
  109. package/dist/src/generated/git-commit.js +2 -2
  110. package/dist/src/generated/git-commit.js.map +1 -1
  111. package/dist/src/nonInteractiveCli.d.ts +2 -1
  112. package/dist/src/nonInteractiveCli.js +101 -72
  113. package/dist/src/nonInteractiveCli.js.map +1 -1
  114. package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
  115. package/dist/src/nonInteractiveCliCommands.js +79 -0
  116. package/dist/src/nonInteractiveCliCommands.js.map +1 -0
  117. package/dist/src/services/BuiltinCommandLoader.js +3 -3
  118. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  119. package/dist/src/services/BuiltinCommandLoader.test.js +53 -19
  120. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
  121. package/dist/src/services/FileCommandLoader.d.ts +2 -0
  122. package/dist/src/services/FileCommandLoader.js +7 -0
  123. package/dist/src/services/FileCommandLoader.js.map +1 -1
  124. package/dist/src/services/McpPromptLoader.js +43 -8
  125. package/dist/src/services/McpPromptLoader.js.map +1 -1
  126. package/dist/src/services/McpPromptLoader.test.js +228 -1
  127. package/dist/src/services/McpPromptLoader.test.js.map +1 -1
  128. package/dist/src/services/prompt-processors/shellProcessor.js +8 -1
  129. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
  130. package/dist/src/test-utils/createExtension.d.ts +15 -0
  131. package/dist/src/test-utils/createExtension.js +25 -0
  132. package/dist/src/test-utils/createExtension.js.map +1 -0
  133. package/dist/src/test-utils/mockCommandContext.js +2 -0
  134. package/dist/src/test-utils/mockCommandContext.js.map +1 -1
  135. package/dist/src/test-utils/render.d.ts +5 -1
  136. package/dist/src/test-utils/render.js +5 -1
  137. package/dist/src/test-utils/render.js.map +1 -1
  138. package/dist/src/ui/App.d.ts +1 -10
  139. package/dist/src/ui/App.js +26 -833
  140. package/dist/src/ui/App.js.map +1 -1
  141. package/dist/src/ui/AppContainer.d.ts +17 -0
  142. package/dist/src/ui/AppContainer.js +1069 -0
  143. package/dist/src/ui/AppContainer.js.map +1 -0
  144. package/dist/src/ui/AppContainer.test.d.ts +6 -0
  145. package/dist/src/ui/AppContainer.test.js +831 -0
  146. package/dist/src/ui/AppContainer.test.js.map +1 -0
  147. package/dist/src/ui/IdeIntegrationNudge.d.ts +2 -2
  148. package/dist/src/ui/IdeIntegrationNudge.js +6 -8
  149. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
  150. package/dist/src/ui/{components → auth}/AuthDialog.d.ts +5 -1
  151. package/dist/src/ui/{components → auth}/AuthDialog.js +26 -29
  152. package/dist/src/ui/auth/AuthDialog.js.map +1 -0
  153. package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
  154. package/dist/src/ui/{components → auth}/AuthDialog.test.js +92 -10
  155. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
  156. package/dist/src/ui/{components → auth}/AuthInProgress.js +2 -2
  157. package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
  158. package/dist/src/ui/auth/useAuth.d.ts +24 -0
  159. package/dist/src/ui/auth/useAuth.js +108 -0
  160. package/dist/src/ui/auth/useAuth.js.map +1 -0
  161. package/dist/src/ui/commands/aboutCommand.js +9 -3
  162. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  163. package/dist/src/ui/commands/bugCommand.js +19 -5
  164. package/dist/src/ui/commands/bugCommand.js.map +1 -1
  165. package/dist/src/ui/commands/chatCommand.d.ts +2 -0
  166. package/dist/src/ui/commands/chatCommand.js +95 -5
  167. package/dist/src/ui/commands/chatCommand.js.map +1 -1
  168. package/dist/src/ui/commands/clearCommand.js +1 -1
  169. package/dist/src/ui/commands/clearCommand.js.map +1 -1
  170. package/dist/src/ui/commands/corgiCommand.js +1 -0
  171. package/dist/src/ui/commands/corgiCommand.js.map +1 -1
  172. package/dist/src/ui/commands/directoryCommand.js +1 -1
  173. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  174. package/dist/src/ui/commands/extensionsCommand.js +92 -15
  175. package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
  176. package/dist/src/ui/commands/ideCommand.d.ts +1 -2
  177. package/dist/src/ui/commands/ideCommand.js +19 -10
  178. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  179. package/dist/src/ui/commands/mcpCommand.js +88 -263
  180. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  181. package/dist/src/ui/commands/memoryCommand.js +1 -1
  182. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  183. package/dist/src/ui/commands/modelCommand.js +1 -16
  184. package/dist/src/ui/commands/modelCommand.js.map +1 -1
  185. package/dist/src/ui/commands/modelCommand.test.js +10 -11
  186. package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
  187. package/dist/src/ui/commands/{privacyCommand.d.ts → permissionsCommand.d.ts} +1 -1
  188. package/dist/src/ui/commands/{privacyCommand.js → permissionsCommand.js} +5 -5
  189. package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
  190. package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
  191. package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
  192. package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
  193. package/dist/src/ui/commands/summaryCommand.js +1 -1
  194. package/dist/src/ui/commands/summaryCommand.js.map +1 -1
  195. package/dist/src/ui/commands/toolsCommand.js +10 -24
  196. package/dist/src/ui/commands/toolsCommand.js.map +1 -1
  197. package/dist/src/ui/commands/types.d.ts +8 -3
  198. package/dist/src/ui/commands/types.js +0 -1
  199. package/dist/src/ui/commands/types.js.map +1 -1
  200. package/dist/src/ui/components/AboutBox.js +2 -2
  201. package/dist/src/ui/components/AboutBox.js.map +1 -1
  202. package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
  203. package/dist/src/ui/components/AnsiOutput.js +12 -0
  204. package/dist/src/ui/components/AnsiOutput.js.map +1 -0
  205. package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
  206. package/dist/src/ui/components/AnsiOutput.test.js +97 -0
  207. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
  208. package/dist/src/ui/components/AppHeader.d.ts +10 -0
  209. package/dist/src/ui/components/AppHeader.js +19 -0
  210. package/dist/src/ui/components/AppHeader.js.map +1 -0
  211. package/dist/src/ui/components/AutoAcceptIndicator.js +5 -5
  212. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
  213. package/dist/src/ui/components/Composer.d.ts +6 -0
  214. package/dist/src/ui/components/Composer.js +54 -0
  215. package/dist/src/ui/components/Composer.js.map +1 -0
  216. package/dist/src/ui/components/Composer.test.d.ts +6 -0
  217. package/dist/src/ui/components/Composer.test.js +337 -0
  218. package/dist/src/ui/components/Composer.test.js.map +1 -0
  219. package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
  220. package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
  221. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
  222. package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
  223. package/dist/src/ui/components/ConsentPrompt.js +19 -0
  224. package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
  225. package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
  226. package/dist/src/ui/components/ConsentPrompt.test.js +67 -0
  227. package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
  228. package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
  229. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
  230. package/dist/src/ui/components/ContextSummaryDisplay.js +3 -3
  231. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  232. package/dist/src/ui/components/ContextUsageDisplay.d.ts +4 -1
  233. package/dist/src/ui/components/ContextUsageDisplay.js +27 -5
  234. package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
  235. package/dist/src/ui/components/DebugProfiler.js +2 -2
  236. package/dist/src/ui/components/DebugProfiler.js.map +1 -1
  237. package/dist/src/ui/components/DetailedMessagesDisplay.js +7 -7
  238. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
  239. package/dist/src/ui/components/DialogManager.d.ts +12 -0
  240. package/dist/src/ui/components/DialogManager.js +130 -0
  241. package/dist/src/ui/components/DialogManager.js.map +1 -0
  242. package/dist/src/ui/components/EditorSettingsDialog.js +16 -7
  243. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
  244. package/dist/src/ui/components/ExitWarning.d.ts +7 -0
  245. package/dist/src/ui/components/ExitWarning.js +9 -0
  246. package/dist/src/ui/components/ExitWarning.js.map +1 -0
  247. package/dist/src/ui/components/FolderTrustDialog.js +22 -9
  248. package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
  249. package/dist/src/ui/components/FolderTrustDialog.test.js +37 -12
  250. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
  251. package/dist/src/ui/components/Footer.d.ts +1 -17
  252. package/dist/src/ui/components/Footer.js +33 -11
  253. package/dist/src/ui/components/Footer.js.map +1 -1
  254. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +5 -0
  255. package/dist/src/ui/components/GeminiRespondingSpinner.js +7 -2
  256. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
  257. package/dist/src/ui/components/Header.js +2 -2
  258. package/dist/src/ui/components/Header.js.map +1 -1
  259. package/dist/src/ui/components/Help.d.ts +1 -1
  260. package/dist/src/ui/components/Help.js +9 -6
  261. package/dist/src/ui/components/Help.js.map +1 -1
  262. package/dist/src/ui/components/Help.test.d.ts +6 -0
  263. package/dist/src/ui/components/Help.test.js +57 -0
  264. package/dist/src/ui/components/Help.test.js.map +1 -0
  265. package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -4
  266. package/dist/src/ui/components/HistoryItemDisplay.js +13 -4
  267. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  268. package/dist/src/ui/components/HistoryItemDisplay.test.js +90 -9
  269. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
  270. package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
  271. package/dist/src/ui/components/IdeTrustChangeDialog.js +32 -0
  272. package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
  273. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
  274. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
  275. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
  276. package/dist/src/ui/components/InputPrompt.d.ts +9 -0
  277. package/dist/src/ui/components/InputPrompt.js +192 -46
  278. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  279. package/dist/src/ui/components/LoadingIndicator.js +2 -2
  280. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  281. package/dist/src/ui/components/LoadingIndicator.test.js +4 -0
  282. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
  283. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
  284. package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
  285. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
  286. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
  287. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
  288. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
  289. package/dist/src/ui/components/MainContent.d.ts +6 -0
  290. package/dist/src/ui/components/MainContent.js +28 -0
  291. package/dist/src/ui/components/MainContent.js.map +1 -0
  292. package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
  293. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
  294. package/dist/src/ui/components/ModelDialog.d.ts +11 -0
  295. package/dist/src/ui/components/ModelDialog.js +42 -0
  296. package/dist/src/ui/components/ModelDialog.js.map +1 -0
  297. package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
  298. package/dist/src/ui/components/ModelDialog.test.js +158 -0
  299. package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
  300. package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
  301. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
  302. package/dist/src/ui/components/ModelSwitchDialog.d.ts +3 -1
  303. package/dist/src/ui/components/ModelSwitchDialog.js +11 -7
  304. package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -1
  305. package/dist/src/ui/components/ModelSwitchDialog.test.js +14 -10
  306. package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -1
  307. package/dist/src/ui/components/Notifications.d.ts +6 -0
  308. package/dist/src/ui/components/Notifications.js +23 -0
  309. package/dist/src/ui/components/Notifications.js.map +1 -0
  310. package/dist/src/ui/components/OpenAIKeyPrompt.js +63 -39
  311. package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
  312. package/dist/src/ui/components/OpenAIKeyPrompt.test.js +8 -1
  313. package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -1
  314. package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +13 -0
  315. package/dist/src/ui/components/PermissionsModifyTrustDialog.js +48 -0
  316. package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
  317. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
  318. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +154 -0
  319. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
  320. package/dist/src/ui/components/PrepareLabel.d.ts +5 -5
  321. package/dist/src/ui/components/PrepareLabel.js +67 -11
  322. package/dist/src/ui/components/PrepareLabel.js.map +1 -1
  323. package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
  324. package/dist/src/ui/components/PrepareLabel.test.js +71 -0
  325. package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
  326. package/dist/src/ui/components/ProQuotaDialog.d.ts +13 -0
  327. package/dist/src/ui/components/ProQuotaDialog.js +23 -0
  328. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
  329. package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
  330. package/dist/src/ui/components/ProQuotaDialog.test.js +58 -0
  331. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
  332. package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
  333. package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
  334. package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
  335. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
  336. package/dist/src/ui/components/QueuedMessageDisplay.test.js +56 -0
  337. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
  338. package/dist/src/ui/components/QuitConfirmationDialog.js +4 -0
  339. package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -1
  340. package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
  341. package/dist/src/ui/components/QuittingDisplay.js +20 -0
  342. package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
  343. package/dist/src/ui/components/QwenOAuthProgress.js +7 -6
  344. package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
  345. package/dist/src/ui/components/QwenOAuthProgress.test.js +84 -13
  346. package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -1
  347. package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
  348. package/dist/src/ui/components/SettingsDialog.js +97 -23
  349. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  350. package/dist/src/ui/components/SettingsDialog.test.js +474 -84
  351. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  352. package/dist/src/ui/components/ShellConfirmationDialog.js +5 -2
  353. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
  354. package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
  355. package/dist/src/ui/components/ShellInputPrompt.js +36 -0
  356. package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
  357. package/dist/src/ui/components/ShellModeIndicator.js +2 -2
  358. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
  359. package/dist/src/ui/components/ShowMoreLines.js +2 -2
  360. package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
  361. package/dist/src/ui/components/StatsDisplay.js +6 -6
  362. package/dist/src/ui/components/StatsDisplay.js.map +1 -1
  363. package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
  364. package/dist/src/ui/components/SuggestionsDisplay.js +17 -17
  365. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  366. package/dist/src/ui/components/ThemeDialog.js +14 -29
  367. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  368. package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
  369. package/dist/src/ui/components/ThemeDialog.test.js +75 -0
  370. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
  371. package/dist/src/ui/components/Tips.js +2 -2
  372. package/dist/src/ui/components/Tips.js.map +1 -1
  373. package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
  374. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
  375. package/dist/src/ui/components/UpdateNotification.js +2 -2
  376. package/dist/src/ui/components/UpdateNotification.js.map +1 -1
  377. package/dist/src/ui/components/WelcomeBackDialog.js +2 -0
  378. package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -1
  379. package/dist/src/ui/components/WorkspaceMigrationDialog.js +14 -11
  380. package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -1
  381. package/dist/src/ui/components/messages/CompressionMessage.d.ts +1 -2
  382. package/dist/src/ui/components/messages/CompressionMessage.js +37 -8
  383. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
  384. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
  385. package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
  386. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
  387. package/dist/src/ui/components/messages/DiffRenderer.d.ts +2 -1
  388. package/dist/src/ui/components/messages/DiffRenderer.js +14 -22
  389. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
  390. package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
  391. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
  392. package/dist/src/ui/components/messages/GeminiMessage.js +2 -2
  393. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
  394. package/dist/src/ui/components/messages/InfoMessage.js +2 -2
  395. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
  396. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +56 -21
  397. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  398. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +36 -8
  399. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
  400. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -2
  401. package/dist/src/ui/components/messages/ToolGroupMessage.js +18 -10
  402. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  403. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +17 -15
  404. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
  405. package/dist/src/ui/components/messages/ToolMessage.d.ts +3 -1
  406. package/dist/src/ui/components/messages/ToolMessage.js +53 -11
  407. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  408. package/dist/src/ui/components/messages/ToolMessage.test.js +34 -1
  409. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
  410. package/dist/src/ui/components/messages/UserMessage.js +3 -4
  411. package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
  412. package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
  413. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
  414. package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
  415. package/dist/src/ui/components/messages/WarningMessage.js +10 -0
  416. package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
  417. package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
  418. package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
  419. package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
  420. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
  421. package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
  422. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
  423. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
  424. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
  425. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
  426. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
  427. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
  428. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
  429. package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
  430. package/dist/src/ui/components/shared/EnumSelector.js +44 -0
  431. package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
  432. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
  433. package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
  434. package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
  435. package/dist/src/ui/components/shared/MaxSizedBox.js +2 -2
  436. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
  437. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +2 -3
  438. package/dist/src/ui/components/shared/RadioButtonSelect.js +10 -105
  439. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
  440. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +115 -92
  441. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -1
  442. package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
  443. package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
  444. package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
  445. package/dist/src/ui/components/shared/text-buffer.d.ts +25 -2
  446. package/dist/src/ui/components/shared/text-buffer.js +296 -187
  447. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  448. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +2 -3
  449. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -1
  450. package/dist/src/ui/components/subagents/create/ColorSelector.js +3 -2
  451. package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -1
  452. package/dist/src/ui/components/subagents/create/CreationSummary.js +6 -5
  453. package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -1
  454. package/dist/src/ui/components/subagents/create/DescriptionInput.js +2 -3
  455. package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -1
  456. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +1 -0
  457. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -1
  458. package/dist/src/ui/components/subagents/create/LocationSelector.js +1 -0
  459. package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -1
  460. package/dist/src/ui/components/subagents/create/TextEntryStep.js +2 -2
  461. package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -1
  462. package/dist/src/ui/components/subagents/create/ToolSelector.js +4 -3
  463. package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -1
  464. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +4 -4
  465. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -1
  466. package/dist/src/ui/components/subagents/manage/AgentEditStep.js +1 -0
  467. package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -1
  468. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +1 -2
  469. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -1
  470. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +1 -2
  471. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -1
  472. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +9 -10
  473. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -1
  474. package/dist/src/ui/components/ums/UMSKeyPrompt.d.ts +2 -2
  475. package/dist/src/ui/components/ums/UMSKeyPrompt.js +66 -64
  476. package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
  477. package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
  478. package/dist/src/ui/components/views/ExtensionsList.js +47 -0
  479. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
  480. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
  481. package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
  482. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
  483. package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
  484. package/dist/src/ui/components/views/McpStatus.js +77 -0
  485. package/dist/src/ui/components/views/McpStatus.js.map +1 -0
  486. package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
  487. package/dist/src/ui/components/views/McpStatus.test.js +117 -0
  488. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
  489. package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
  490. package/dist/src/ui/components/views/ToolsList.js +7 -0
  491. package/dist/src/ui/components/views/ToolsList.js.map +1 -0
  492. package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
  493. package/dist/src/ui/components/views/ToolsList.test.js +45 -0
  494. package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
  495. package/dist/src/ui/constants.d.ts +1 -0
  496. package/dist/src/ui/constants.js +1 -0
  497. package/dist/src/ui/constants.js.map +1 -1
  498. package/dist/src/ui/contexts/AppContext.d.ts +11 -0
  499. package/dist/src/ui/contexts/AppContext.js +15 -0
  500. package/dist/src/ui/contexts/AppContext.js.map +1 -0
  501. package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
  502. package/dist/src/ui/contexts/ConfigContext.js +16 -0
  503. package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
  504. package/dist/src/ui/contexts/KeypressContext.d.ts +3 -0
  505. package/dist/src/ui/contexts/KeypressContext.js +309 -44
  506. package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
  507. package/dist/src/ui/contexts/KeypressContext.test.js +288 -2
  508. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
  509. package/dist/src/ui/contexts/SessionContext.d.ts +6 -0
  510. package/dist/src/ui/contexts/SessionContext.js +107 -5
  511. package/dist/src/ui/contexts/SessionContext.js.map +1 -1
  512. package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
  513. package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
  514. package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
  515. package/dist/src/ui/contexts/UIActionsContext.d.ts +45 -0
  516. package/dist/src/ui/contexts/UIActionsContext.js +21 -0
  517. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
  518. package/dist/src/ui/contexts/UIStateContext.d.ts +117 -0
  519. package/dist/src/ui/contexts/UIStateContext.js +17 -0
  520. package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
  521. package/dist/src/ui/hooks/atCommandProcessor.js +12 -12
  522. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  523. package/dist/src/ui/hooks/atCommandProcessor.test.js +21 -19
  524. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
  525. package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
  526. package/dist/src/ui/hooks/keyToAnsi.js +67 -0
  527. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
  528. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
  529. package/dist/src/ui/hooks/shellCommandProcessor.js +65 -15
  530. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  531. package/dist/src/ui/hooks/shellCommandProcessor.test.js +196 -17
  532. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
  533. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +20 -3
  534. package/dist/src/ui/hooks/slashCommandProcessor.js +48 -90
  535. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  536. package/dist/src/ui/hooks/useAtCompletion.js +1 -1
  537. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
  538. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +3 -2
  539. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +20 -18
  540. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
  541. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +43 -0
  542. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
  543. package/dist/src/ui/hooks/useDialogClose.d.ts +0 -2
  544. package/dist/src/ui/hooks/useDialogClose.js +0 -14
  545. package/dist/src/ui/hooks/useDialogClose.js.map +1 -1
  546. package/dist/src/ui/hooks/useEditorSettings.js +1 -1
  547. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
  548. package/dist/src/ui/hooks/useEditorSettings.test.js +4 -4
  549. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
  550. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +21 -0
  551. package/dist/src/ui/hooks/useExtensionUpdates.js +116 -0
  552. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
  553. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
  554. package/dist/src/ui/hooks/useExtensionUpdates.test.js +243 -0
  555. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
  556. package/dist/src/ui/hooks/useFocus.js +10 -0
  557. package/dist/src/ui/hooks/useFocus.js.map +1 -1
  558. package/dist/src/ui/hooks/useFolderTrust.js +6 -10
  559. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
  560. package/dist/src/ui/hooks/useGeminiStream.d.ts +14 -3
  561. package/dist/src/ui/hooks/useGeminiStream.js +184 -83
  562. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  563. package/dist/src/ui/hooks/useGitBranchName.js +15 -18
  564. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
  565. package/dist/src/ui/hooks/useGitBranchName.test.js +49 -53
  566. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
  567. package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
  568. package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
  569. package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
  570. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
  571. package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
  572. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
  573. package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
  574. package/dist/src/ui/hooks/useInputHistoryStore.js +81 -0
  575. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
  576. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
  577. package/dist/src/ui/hooks/useInputHistoryStore.test.js +234 -0
  578. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
  579. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
  580. package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
  581. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
  582. package/dist/src/ui/hooks/useLoadingIndicator.test.js +2 -2
  583. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
  584. package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
  585. package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
  586. package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
  587. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
  588. package/dist/src/ui/hooks/useMemoryMonitor.test.js +57 -0
  589. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
  590. package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
  591. package/dist/src/ui/hooks/useMessageQueue.js +5 -3
  592. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
  593. package/dist/src/ui/hooks/useMessageQueue.test.js +9 -0
  594. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
  595. package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
  596. package/dist/src/ui/hooks/useModelCommand.js +21 -0
  597. package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
  598. package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
  599. package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
  600. package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
  601. package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
  602. package/dist/src/ui/hooks/usePermissionsModifyTrust.js +78 -0
  603. package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
  604. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
  605. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +182 -0
  606. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
  607. package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -1
  608. package/dist/src/ui/hooks/usePhraseCycler.js +11 -8
  609. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  610. package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
  611. package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
  612. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
  613. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
  614. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +269 -0
  615. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
  616. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
  617. package/dist/src/ui/hooks/useReactToolScheduler.js +23 -17
  618. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  619. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +1 -1
  620. package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
  621. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
  622. package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
  623. package/dist/src/ui/hooks/useSelectionList.js +245 -0
  624. package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
  625. package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
  626. package/dist/src/ui/hooks/useSelectionList.test.js +701 -0
  627. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
  628. package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
  629. package/dist/src/ui/hooks/useSlashCompletion.js +281 -67
  630. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
  631. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +4 -1
  632. package/dist/src/ui/hooks/useSlashCompletion.test.js +390 -65
  633. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
  634. package/dist/src/ui/hooks/useStateAndRef.d.ts +1 -1
  635. package/dist/src/ui/hooks/useStateAndRef.js +2 -2
  636. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
  637. package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
  638. package/dist/src/ui/hooks/useThemeCommand.js +3 -14
  639. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  640. package/dist/src/ui/hooks/useToolScheduler.test.js +64 -291
  641. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  642. package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +1 -1
  643. package/dist/src/ui/hooks/useVisionAutoSwitch.js +36 -6
  644. package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +1 -1
  645. package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +3 -3
  646. package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +1 -1
  647. package/dist/src/ui/hooks/useWelcomeBack.js +2 -2
  648. package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -1
  649. package/dist/src/ui/hooks/useWorkspaceMigration.js +2 -1
  650. package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -1
  651. package/dist/src/ui/keyMatchers.test.js +17 -0
  652. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  653. package/dist/src/ui/layouts/DefaultAppLayout.d.ts +9 -0
  654. package/dist/src/ui/layouts/DefaultAppLayout.js +13 -0
  655. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
  656. package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
  657. package/dist/src/ui/layouts/ScreenReaderAppLayout.js +14 -0
  658. package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
  659. package/dist/src/ui/models/availableModels.d.ts +11 -5
  660. package/dist/src/ui/models/availableModels.js +89 -3
  661. package/dist/src/ui/models/availableModels.js.map +1 -1
  662. package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
  663. package/dist/src/ui/noninteractive/nonInteractiveUi.js +28 -0
  664. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
  665. package/dist/src/ui/state/extensions.d.ts +42 -0
  666. package/dist/src/ui/state/extensions.js +62 -0
  667. package/dist/src/ui/state/extensions.js.map +1 -0
  668. package/dist/src/ui/themes/ayu.js +1 -1
  669. package/dist/src/ui/themes/dracula.js +2 -2
  670. package/dist/src/ui/themes/github-dark.js +1 -1
  671. package/dist/src/ui/themes/theme.js +19 -19
  672. package/dist/src/ui/themes/theme.js.map +1 -1
  673. package/dist/src/ui/types.d.ts +79 -3
  674. package/dist/src/ui/types.js +14 -0
  675. package/dist/src/ui/types.js.map +1 -1
  676. package/dist/src/ui/utils/CodeColorizer.js +3 -2
  677. package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
  678. package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -7
  679. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
  680. package/dist/src/ui/utils/MarkdownDisplay.js +11 -11
  681. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  682. package/dist/src/ui/utils/MarkdownDisplay.test.js +95 -87
  683. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
  684. package/dist/src/ui/utils/TableRenderer.js +4 -4
  685. package/dist/src/ui/utils/TableRenderer.js.map +1 -1
  686. package/dist/src/ui/utils/clipboardUtils.js +5 -6
  687. package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
  688. package/dist/src/ui/utils/displayUtils.d.ts +1 -0
  689. package/dist/src/ui/utils/displayUtils.js +7 -4
  690. package/dist/src/ui/utils/displayUtils.js.map +1 -1
  691. package/dist/src/ui/utils/displayUtils.test.js +37 -18
  692. package/dist/src/ui/utils/displayUtils.test.js.map +1 -1
  693. package/dist/src/ui/utils/highlight.d.ts +11 -0
  694. package/dist/src/ui/utils/highlight.js +78 -0
  695. package/dist/src/ui/utils/highlight.js.map +1 -0
  696. package/dist/src/ui/utils/highlight.test.d.ts +6 -0
  697. package/dist/src/ui/utils/highlight.test.js +120 -0
  698. package/dist/src/ui/utils/highlight.test.js.map +1 -0
  699. package/dist/src/ui/utils/kittyProtocolDetector.js +39 -29
  700. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
  701. package/dist/src/ui/utils/platformConstants.d.ts +24 -1
  702. package/dist/src/ui/utils/platformConstants.js +26 -1
  703. package/dist/src/ui/utils/platformConstants.js.map +1 -1
  704. package/dist/src/ui/utils/textUtils.d.ts +10 -0
  705. package/dist/src/ui/utils/textUtils.js +108 -3
  706. package/dist/src/ui/utils/textUtils.js.map +1 -1
  707. package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
  708. package/dist/src/ui/utils/textUtils.test.js +132 -0
  709. package/dist/src/ui/utils/textUtils.test.js.map +1 -0
  710. package/dist/src/ui/utils/updateCheck.d.ts +1 -0
  711. package/dist/src/ui/utils/updateCheck.js +53 -2
  712. package/dist/src/ui/utils/updateCheck.js.map +1 -1
  713. package/dist/src/utils/commands.d.ts +20 -0
  714. package/dist/src/utils/commands.js +53 -0
  715. package/dist/src/utils/commands.js.map +1 -0
  716. package/dist/src/utils/commands.test.d.ts +6 -0
  717. package/dist/src/utils/commands.test.js +115 -0
  718. package/dist/src/utils/commands.test.js.map +1 -0
  719. package/dist/src/utils/commentJson.d.ts +9 -0
  720. package/dist/src/utils/commentJson.js +48 -0
  721. package/dist/src/utils/commentJson.js.map +1 -0
  722. package/dist/src/utils/commentJson.test.d.ts +6 -0
  723. package/dist/src/utils/commentJson.test.js +146 -0
  724. package/dist/src/utils/commentJson.test.js.map +1 -0
  725. package/dist/src/utils/deepMerge.d.ts +9 -0
  726. package/dist/src/utils/deepMerge.js +58 -0
  727. package/dist/src/utils/deepMerge.js.map +1 -0
  728. package/dist/src/utils/deepMerge.test.d.ts +6 -0
  729. package/dist/src/utils/deepMerge.test.js +143 -0
  730. package/dist/src/utils/deepMerge.test.js.map +1 -0
  731. package/dist/src/utils/envVarResolver.d.ts +39 -0
  732. package/dist/src/utils/envVarResolver.js +97 -0
  733. package/dist/src/utils/envVarResolver.js.map +1 -0
  734. package/dist/src/utils/envVarResolver.test.d.ts +6 -0
  735. package/dist/src/utils/envVarResolver.test.js +221 -0
  736. package/dist/src/utils/envVarResolver.test.js.map +1 -0
  737. package/dist/src/utils/errors.d.ts +21 -0
  738. package/dist/src/utils/errors.js +93 -0
  739. package/dist/src/utils/errors.js.map +1 -1
  740. package/dist/src/utils/errors.test.d.ts +6 -0
  741. package/dist/src/utils/errors.test.js +303 -0
  742. package/dist/src/utils/errors.test.js.map +1 -0
  743. package/dist/src/utils/events.d.ts +2 -1
  744. package/dist/src/utils/events.js +1 -0
  745. package/dist/src/utils/events.js.map +1 -1
  746. package/dist/src/utils/handleAutoUpdate.js +6 -3
  747. package/dist/src/utils/handleAutoUpdate.js.map +1 -1
  748. package/dist/src/utils/math.d.ts +13 -0
  749. package/dist/src/utils/math.js +14 -0
  750. package/dist/src/utils/math.js.map +1 -0
  751. package/dist/src/utils/processUtils.d.ts +13 -0
  752. package/dist/src/utils/processUtils.js +18 -0
  753. package/dist/src/utils/processUtils.js.map +1 -0
  754. package/dist/src/utils/processUtils.test.d.ts +6 -0
  755. package/dist/src/utils/processUtils.test.js +20 -0
  756. package/dist/src/utils/processUtils.test.js.map +1 -0
  757. package/dist/src/utils/relaunch.d.ts +7 -0
  758. package/dist/src/utils/relaunch.js +57 -0
  759. package/dist/src/utils/relaunch.js.map +1 -0
  760. package/dist/src/utils/relaunch.test.d.ts +6 -0
  761. package/dist/src/utils/relaunch.test.js +273 -0
  762. package/dist/src/utils/relaunch.test.js.map +1 -0
  763. package/dist/src/utils/sandbox.d.ts +1 -1
  764. package/dist/src/utils/sandbox.js +42 -17
  765. package/dist/src/utils/sandbox.js.map +1 -1
  766. package/dist/src/utils/settingsUtils.d.ts +16 -6
  767. package/dist/src/utils/settingsUtils.js +35 -25
  768. package/dist/src/utils/settingsUtils.js.map +1 -1
  769. package/dist/src/utils/settingsUtils.test.js +455 -158
  770. package/dist/src/utils/settingsUtils.test.js.map +1 -1
  771. package/dist/src/utils/startupWarnings.js +1 -1
  772. package/dist/src/utils/startupWarnings.js.map +1 -1
  773. package/dist/src/utils/userStartupWarnings.d.ts +7 -1
  774. package/dist/src/utils/userStartupWarnings.js +21 -6
  775. package/dist/src/utils/userStartupWarnings.js.map +1 -1
  776. package/dist/src/utils/userStartupWarnings.test.js +26 -5
  777. package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
  778. package/dist/src/utils/windowTitle.d.ts +12 -0
  779. package/dist/src/utils/windowTitle.js +19 -0
  780. package/dist/src/utils/windowTitle.js.map +1 -0
  781. package/dist/src/utils/windowTitle.test.d.ts +6 -0
  782. package/dist/src/utils/windowTitle.test.js +49 -0
  783. package/dist/src/utils/windowTitle.test.js.map +1 -0
  784. package/dist/src/validateNonInterActiveAuth.d.ts +4 -2
  785. package/dist/src/validateNonInterActiveAuth.js +36 -21
  786. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  787. package/dist/src/zed-integration/fileSystemService.d.ts +1 -0
  788. package/dist/src/zed-integration/fileSystemService.js +3 -0
  789. package/dist/src/zed-integration/fileSystemService.js.map +1 -1
  790. package/dist/src/zed-integration/schema.d.ts +282 -282
  791. package/dist/src/zed-integration/zedIntegration.d.ts +8 -1
  792. package/dist/src/zed-integration/zedIntegration.js +34 -30
  793. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  794. package/dist/tsconfig.tsbuildinfo +1 -1
  795. package/package.json +16 -11
  796. package/dist/src/ui/commands/privacyCommand.js.map +0 -1
  797. package/dist/src/ui/components/AuthDialog.js.map +0 -1
  798. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  799. package/dist/src/ui/components/AuthInProgress.js.map +0 -1
  800. package/dist/src/ui/components/ModelSelectionDialog.d.ts +0 -14
  801. package/dist/src/ui/components/ModelSelectionDialog.js +0 -26
  802. package/dist/src/ui/components/ModelSelectionDialog.js.map +0 -1
  803. package/dist/src/ui/components/ModelSelectionDialog.test.js +0 -124
  804. package/dist/src/ui/components/ModelSelectionDialog.test.js.map +0 -1
  805. package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
  806. package/dist/src/ui/hooks/useAuthCommand.js +0 -66
  807. package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
  808. package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
  809. package/dist/src/ui/hooks/usePrivacySettings.js +0 -119
  810. package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
  811. package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
  812. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
  813. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
  814. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -41
  815. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
  816. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
  817. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -18
  818. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
  819. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
  820. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -18
  821. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
  822. package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
  823. package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
  824. package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
  825. /package/dist/src/{ui/components/AuthDialog.test.d.ts → commands/extensions/new.test.d.ts} +0 -0
  826. /package/dist/src/{ui/hooks/usePrivacySettings.test.d.ts → config/extensions/extensionEnablement.test.d.ts} +0 -0
  827. /package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +0 -0
@@ -3,11 +3,9 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { exec } from 'node:child_process';
7
- import { promisify } from 'node:util';
8
6
  import * as fs from 'node:fs/promises';
9
7
  import * as path from 'node:path';
10
- const execAsync = promisify(exec);
8
+ import { spawnAsync } from '@umsai/ums-code-core';
11
9
  /**
12
10
  * Checks if the system clipboard contains an image (macOS only for now)
13
11
  * @returns true if clipboard contains an image
@@ -18,8 +16,9 @@ export async function clipboardHasImage() {
18
16
  }
19
17
  try {
20
18
  // Use osascript to check clipboard type
21
- const { stdout } = await execAsync(`osascript -e 'clipboard info' 2>/dev/null | grep -qE "«class PNGf»|TIFF picture|JPEG picture|GIF picture|«class JPEG»|«class TIFF»" && echo "true" || echo "false"`, { shell: '/bin/bash' });
22
- return stdout.trim() === 'true';
19
+ const { stdout } = await spawnAsync('osascript', ['-e', 'clipboard info']);
20
+ const imageRegex = /«class PNGf»|TIFF picture|JPEG picture|GIF picture|«class JPEG»|«class TIFF»/;
21
+ return imageRegex.test(stdout);
23
22
  }
24
23
  catch {
25
24
  return false;
@@ -66,7 +65,7 @@ export async function saveClipboardImage(targetDir) {
66
65
  return "error"
67
66
  end try
68
67
  `;
69
- const { stdout } = await execAsync(`osascript -e '${script}'`);
68
+ const { stdout } = await spawnAsync('osascript', ['-e', script]);
70
69
  if (stdout.trim() === 'success') {
71
70
  // Verify the file was created and has content
72
71
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"clipboardUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/clipboardUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,wCAAwC;QACxC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAChC,oKAAoK,EACpK,EAAE,KAAK,EAAE,WAAW,EAAE,CACvB,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,SAAkB;IAElB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,gFAAgF;QAChF,0EAA0E;QAC1E,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3C,MAAM,OA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C,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,2BAA2B;IAC7B,CAAC;AACH,CAAC"}
@@ -12,6 +12,7 @@ export declare const CACHE_EFFICIENCY_MEDIUM = 15;
12
12
  export declare const getStatusColor: (value: number, thresholds: {
13
13
  green: number;
14
14
  yellow: number;
15
+ red?: number;
15
16
  }, options?: {
16
17
  defaultColor?: string;
17
18
  }) => string;
@@ -3,7 +3,7 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { Colors } from '../colors.js';
6
+ import { theme } from '../semantic-colors.js';
7
7
  // --- Thresholds ---
8
8
  export const TOOL_SUCCESS_RATE_HIGH = 95;
9
9
  export const TOOL_SUCCESS_RATE_MEDIUM = 85;
@@ -14,11 +14,14 @@ export const CACHE_EFFICIENCY_MEDIUM = 15;
14
14
  // --- Color Logic ---
15
15
  export const getStatusColor = (value, thresholds, options = {}) => {
16
16
  if (value >= thresholds.green) {
17
- return Colors.AccentGreen;
17
+ return theme.status.success;
18
18
  }
19
19
  if (value >= thresholds.yellow) {
20
- return Colors.AccentYellow;
20
+ return theme.status.warning;
21
21
  }
22
- return options.defaultColor || Colors.AccentRed;
22
+ if (thresholds.red != null && value >= thresholds.red) {
23
+ return theme.status.error;
24
+ }
25
+ return options.defaultColor ?? theme.status.error;
23
26
  };
24
27
  //# sourceMappingURL=displayUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"displayUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/displayUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAqB;AACrB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CA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AC;IAC9B,CAAC;IACD,IAAI,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAC9B,CAAC;IACD,IAAI,UAAU,CAAC,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AACpD,CAAC,CAAC"}
@@ -5,27 +5,46 @@
5
5
  */
6
6
  import { describe, it, expect } from 'vitest';
7
7
  import { getStatusColor, TOOL_SUCCESS_RATE_HIGH, TOOL_SUCCESS_RATE_MEDIUM, USER_AGREEMENT_RATE_HIGH, USER_AGREEMENT_RATE_MEDIUM, CACHE_EFFICIENCY_HIGH, CACHE_EFFICIENCY_MEDIUM, } from './displayUtils.js';
8
- import { Colors } from '../colors.js';
8
+ import { theme } from '../semantic-colors.js';
9
9
  describe('displayUtils', () => {
10
10
  describe('getStatusColor', () => {
11
- const thresholds = {
12
- green: 80,
13
- yellow: 50,
14
- };
15
- it('should return green for values >= green threshold', () => {
16
- expect(getStatusColor(90, thresholds)).toBe(Colors.AccentGreen);
17
- expect(getStatusColor(80, thresholds)).toBe(Colors.AccentGreen);
11
+ describe('with red threshold', () => {
12
+ const thresholds = {
13
+ green: 80,
14
+ yellow: 50,
15
+ red: 20,
16
+ };
17
+ it('should return green for values >= green threshold', () => {
18
+ expect(getStatusColor(90, thresholds)).toBe(theme.status.success);
19
+ expect(getStatusColor(80, thresholds)).toBe(theme.status.success);
20
+ });
21
+ it('should return yellow for values < green and >= yellow threshold', () => {
22
+ expect(getStatusColor(79, thresholds)).toBe(theme.status.warning);
23
+ expect(getStatusColor(50, thresholds)).toBe(theme.status.warning);
24
+ });
25
+ it('should return red for values < yellow and >= red threshold', () => {
26
+ expect(getStatusColor(49, thresholds)).toBe(theme.status.error);
27
+ expect(getStatusColor(20, thresholds)).toBe(theme.status.error);
28
+ });
29
+ it('should return error for values < red threshold', () => {
30
+ expect(getStatusColor(19, thresholds)).toBe(theme.status.error);
31
+ expect(getStatusColor(0, thresholds)).toBe(theme.status.error);
32
+ });
33
+ it('should return defaultColor for values < red threshold when provided', () => {
34
+ expect(getStatusColor(19, thresholds, { defaultColor: theme.text.primary })).toBe(theme.text.primary);
35
+ });
18
36
  });
19
- it('should return yellow for values < green and >= yellow threshold', () => {
20
- expect(getStatusColor(79, thresholds)).toBe(Colors.AccentYellow);
21
- expect(getStatusColor(50, thresholds)).toBe(Colors.AccentYellow);
22
- });
23
- it('should return red for values < yellow threshold', () => {
24
- expect(getStatusColor(49, thresholds)).toBe(Colors.AccentRed);
25
- expect(getStatusColor(0, thresholds)).toBe(Colors.AccentRed);
26
- });
27
- it('should return defaultColor for values < yellow threshold when provided', () => {
28
- expect(getStatusColor(49, thresholds, { defaultColor: Colors.Foreground })).toBe(Colors.Foreground);
37
+ describe('when red threshold is not provided', () => {
38
+ const thresholds = {
39
+ green: 80,
40
+ yellow: 50,
41
+ };
42
+ it('should return error color for values < yellow threshold', () => {
43
+ expect(getStatusColor(49, thresholds)).toBe(theme.status.error);
44
+ });
45
+ it('should return defaultColor for values < yellow threshold when provided', () => {
46
+ expect(getStatusColor(49, thresholds, { defaultColor: theme.text.primary })).toBe(theme.text.primary);
47
+ });
29
48
  });
30
49
  });
31
50
  describe('Threshold Constants', () => {
@@ -1 +1 @@
1
- {"version":3,"file":"displayUtils.test.js","sourceRoot":"","sources":["../../../../src/ui/utils/displayUtils.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,uB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C,MAAM,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1C,MAAM,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC5C,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export type HighlightToken = {
7
+ text: string;
8
+ type: 'default' | 'command' | 'file';
9
+ };
10
+ export declare function parseInputForHighlighting(text: string, index: number): readonly HighlightToken[];
11
+ export declare function buildSegmentsForVisualSlice(tokens: readonly HighlightToken[], sliceStart: number, sliceEnd: number): readonly HighlightToken[];
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { cpLen, cpSlice } from './textUtils.js';
7
+ const HIGHLIGHT_REGEX = /(^\/[a-zA-Z0-9_-]+|@(?:\\ |[a-zA-Z0-9_./-])+)/g;
8
+ export function parseInputForHighlighting(text, index) {
9
+ if (!text) {
10
+ return [{ text: '', type: 'default' }];
11
+ }
12
+ const tokens = [];
13
+ let lastIndex = 0;
14
+ let match;
15
+ while ((match = HIGHLIGHT_REGEX.exec(text)) !== null) {
16
+ const [fullMatch] = match;
17
+ const matchIndex = match.index;
18
+ // Add the text before the match as a default token
19
+ if (matchIndex > lastIndex) {
20
+ tokens.push({
21
+ text: text.slice(lastIndex, matchIndex),
22
+ type: 'default',
23
+ });
24
+ }
25
+ // Add the matched token
26
+ const type = fullMatch.startsWith('/') ? 'command' : 'file';
27
+ // Only highlight slash commands if the index is 0.
28
+ if (type === 'command' && index !== 0) {
29
+ tokens.push({
30
+ text: fullMatch,
31
+ type: 'default',
32
+ });
33
+ }
34
+ else {
35
+ tokens.push({
36
+ text: fullMatch,
37
+ type,
38
+ });
39
+ }
40
+ lastIndex = matchIndex + fullMatch.length;
41
+ }
42
+ // Add any remaining text after the last match
43
+ if (lastIndex < text.length) {
44
+ tokens.push({
45
+ text: text.slice(lastIndex),
46
+ type: 'default',
47
+ });
48
+ }
49
+ return tokens;
50
+ }
51
+ export function buildSegmentsForVisualSlice(tokens, sliceStart, sliceEnd) {
52
+ if (sliceStart >= sliceEnd)
53
+ return [];
54
+ const segments = [];
55
+ let tokenCpStart = 0;
56
+ for (const token of tokens) {
57
+ const tokenLen = cpLen(token.text);
58
+ const tokenStart = tokenCpStart;
59
+ const tokenEnd = tokenStart + tokenLen;
60
+ const overlapStart = Math.max(tokenStart, sliceStart);
61
+ const overlapEnd = Math.min(tokenEnd, sliceEnd);
62
+ if (overlapStart < overlapEnd) {
63
+ const sliceStartInToken = overlapStart - tokenStart;
64
+ const sliceEndInToken = overlapEnd - tokenStart;
65
+ const rawSlice = cpSlice(token.text, sliceStartInToken, sliceEndInToken);
66
+ const last = segments[segments.length - 1];
67
+ if (last && last.type === token.type) {
68
+ last.text += rawSlice;
69
+ }
70
+ else {
71
+ segments.push({ type: token.type, text: rawSlice });
72
+ }
73
+ }
74
+ tokenCpStart += tokenLen;
75
+ }
76
+ return segments;
77
+ }
78
+ //# sourceMappingURL=highlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight.js","sourceRoot":"","sources":["../../../../src/ui/utils/highlight.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAOhD,MAAM,eAAe,GAAG,gDAAgD,CAAC;AAEzE,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,KAAa;IAEb,IAAI,CAAC,IAAI,EAAE,CAA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YACtD,CAAC;QACH,CAAC;QAED,YAAY,IAAI,QAAQ,CAAC;IAC3B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export {};
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { describe, it, expect } from 'vitest';
7
+ import { parseInputForHighlighting } from './highlight.js';
8
+ describe('parseInputForHighlighting', () => {
9
+ it('should handle an empty string', () => {
10
+ expect(parseInputForHighlighting('', 0)).toEqual([
11
+ { text: '', type: 'default' },
12
+ ]);
13
+ });
14
+ it('should handle text with no commands or files', () => {
15
+ const text = 'this is a normal sentence';
16
+ expect(parseInputForHighlighting(text, 0)).toEqual([
17
+ { text, type: 'default' },
18
+ ]);
19
+ });
20
+ it('should highlight a single command at the beginning when index is 0', () => {
21
+ const text = '/help me';
22
+ expect(parseInputForHighlighting(text, 0)).toEqual([
23
+ { text: '/help', type: 'command' },
24
+ { text: ' me', type: 'default' },
25
+ ]);
26
+ });
27
+ it('should NOT highlight a command at the beginning when index is not 0', () => {
28
+ const text = '/help me';
29
+ expect(parseInputForHighlighting(text, 1)).toEqual([
30
+ { text: '/help', type: 'default' },
31
+ { text: ' me', type: 'default' },
32
+ ]);
33
+ });
34
+ it('should highlight a single file path at the beginning', () => {
35
+ const text = '@path/to/file.txt please';
36
+ expect(parseInputForHighlighting(text, 0)).toEqual([
37
+ { text: '@path/to/file.txt', type: 'file' },
38
+ { text: ' please', type: 'default' },
39
+ ]);
40
+ });
41
+ it('should not highlight a command in the middle', () => {
42
+ const text = 'I need /help with this';
43
+ expect(parseInputForHighlighting(text, 0)).toEqual([
44
+ { text: 'I need /help with this', type: 'default' },
45
+ ]);
46
+ });
47
+ it('should highlight a file path in the middle', () => {
48
+ const text = 'Please check @path/to/file.txt for details';
49
+ expect(parseInputForHighlighting(text, 0)).toEqual([
50
+ { text: 'Please check ', type: 'default' },
51
+ { text: '@path/to/file.txt', type: 'file' },
52
+ { text: ' for details', type: 'default' },
53
+ ]);
54
+ });
55
+ it('should highlight files but not commands not at the start', () => {
56
+ const text = 'Use /run with @file.js and also /format @another/file.ts';
57
+ expect(parseInputForHighlighting(text, 0)).toEqual([
58
+ { text: 'Use /run with ', type: 'default' },
59
+ { text: '@file.js', type: 'file' },
60
+ { text: ' and also /format ', type: 'default' },
61
+ { text: '@another/file.ts', type: 'file' },
62
+ ]);
63
+ });
64
+ it('should handle adjacent highlights at start', () => {
65
+ const text = '/run@file.js';
66
+ expect(parseInputForHighlighting(text, 0)).toEqual([
67
+ { text: '/run', type: 'command' },
68
+ { text: '@file.js', type: 'file' },
69
+ ]);
70
+ });
71
+ it('should not highlight command at the end of the string', () => {
72
+ const text = 'Get help with /help';
73
+ expect(parseInputForHighlighting(text, 0)).toEqual([
74
+ { text: 'Get help with /help', type: 'default' },
75
+ ]);
76
+ });
77
+ it('should handle file paths with dots and dashes', () => {
78
+ const text = 'Check @./path-to/file-name.v2.txt';
79
+ expect(parseInputForHighlighting(text, 0)).toEqual([
80
+ { text: 'Check ', type: 'default' },
81
+ { text: '@./path-to/file-name.v2.txt', type: 'file' },
82
+ ]);
83
+ });
84
+ it('should not highlight command with dashes and numbers not at start', () => {
85
+ const text = 'Run /command-123 now';
86
+ expect(parseInputForHighlighting(text, 0)).toEqual([
87
+ { text: 'Run /command-123 now', type: 'default' },
88
+ ]);
89
+ });
90
+ it('should highlight command with dashes and numbers at start', () => {
91
+ const text = '/command-123 now';
92
+ expect(parseInputForHighlighting(text, 0)).toEqual([
93
+ { text: '/command-123', type: 'command' },
94
+ { text: ' now', type: 'default' },
95
+ ]);
96
+ });
97
+ it('should still highlight a file path on a non-zero line', () => {
98
+ const text = 'some text @path/to/file.txt';
99
+ expect(parseInputForHighlighting(text, 1)).toEqual([
100
+ { text: 'some text ', type: 'default' },
101
+ { text: '@path/to/file.txt', type: 'file' },
102
+ ]);
103
+ });
104
+ it('should not highlight command but highlight file on a non-zero line', () => {
105
+ const text = '/cmd @file.txt';
106
+ expect(parseInputForHighlighting(text, 2)).toEqual([
107
+ { text: '/cmd', type: 'default' },
108
+ { text: ' ', type: 'default' },
109
+ { text: '@file.txt', type: 'file' },
110
+ ]);
111
+ });
112
+ it('should highlight a file path with escaped spaces', () => {
113
+ const text = 'cat @/my\\ path/file.txt';
114
+ expect(parseInputForHighlighting(text, 0)).toEqual([
115
+ { text: 'cat ', type: 'default' },
116
+ { text: '@/my\\ path/file.txt', type: 'file' },
117
+ ]);
118
+ });
119
+ });
120
+ //# sourceMappingURL=highlight.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight.test.js","sourceRoot":"","sources":["../../../../src/ui/utils/highlight.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,yBAAyB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC/C,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC9B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,IAAI,GAAG,2BAA2B,CAAC;QACzC,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACjD,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;SAC1B,CAAC,CAAC;IACL,CAAC,CAAC,C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AC3C,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACjD,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,IAAI,GAAG,gBAAgB,CAAC;QAC9B,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACjD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YACjC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9B,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE;SACpC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,IAAI,GAAG,0BAA0B,CAAC;QACxC,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACjD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YACjC,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -27,50 +27,60 @@ export async function detectAndEnableKittyProtocol() {
27
27
  }
28
28
  let responseBuffer = '';
29
29
  let progressiveEnhancementReceived = false;
30
- let checkFinished = false;
30
+ let timeoutId;
31
+ const onTimeout = () => {
32
+ timeoutId = undefined;
33
+ process.stdin.removeListener('data', handleData);
34
+ if (!originalRawMode) {
35
+ process.stdin.setRawMode(false);
36
+ }
37
+ detectionComplete = true;
38
+ resolve(false);
39
+ };
31
40
  const handleData = (data) => {
41
+ if (timeoutId === undefined) {
42
+ // Race condition. We have already timed out.
43
+ return;
44
+ }
32
45
  responseBuffer += data.toString();
33
46
  // Check for progressive enhancement response (CSI ? <flags> u)
34
47
  if (responseBuffer.includes('\x1b[?') && responseBuffer.includes('u')) {
35
48
  progressiveEnhancementReceived = true;
49
+ // Give more time to get the full set of kitty responses if we have an
50
+ // indication the terminal probably supports kitty and we just need to
51
+ // wait a bit longer for a response.
52
+ clearTimeout(timeoutId);
53
+ timeoutId = setTimeout(onTimeout, 1000);
36
54
  }
37
55
  // Check for device attributes response (CSI ? <attrs> c)
38
56
  if (responseBuffer.includes('\x1b[?') && responseBuffer.includes('c')) {
39
- if (!checkFinished) {
40
- checkFinished = true;
41
- process.stdin.removeListener('data', handleData);
42
- if (!originalRawMode) {
43
- process.stdin.setRawMode(false);
44
- }
45
- if (progressiveEnhancementReceived) {
46
- // Enable the protocol
47
- process.stdout.write('\x1b[>1u');
48
- protocolSupported = true;
49
- protocolEnabled = true;
50
- // Set up cleanup on exit
51
- process.on('exit', disableProtocol);
52
- process.on('SIGTERM', disableProtocol);
53
- }
54
- detectionComplete = true;
55
- resolve(protocolSupported);
57
+ clearTimeout(timeoutId);
58
+ timeoutId = undefined;
59
+ process.stdin.removeListener('data', handleData);
60
+ if (!originalRawMode) {
61
+ process.stdin.setRawMode(false);
56
62
  }
63
+ if (progressiveEnhancementReceived) {
64
+ // Enable the protocol
65
+ process.stdout.write('\x1b[>1u');
66
+ protocolSupported = true;
67
+ protocolEnabled = true;
68
+ // Set up cleanup on exit
69
+ process.on('exit', disableProtocol);
70
+ process.on('SIGTERM', disableProtocol);
71
+ }
72
+ detectionComplete = true;
73
+ resolve(protocolSupported);
57
74
  }
58
75
  };
59
76
  process.stdin.on('data', handleData);
60
77
  // Send queries
61
78
  process.stdout.write('\x1b[?u'); // Query progressive enhancement
62
79
  process.stdout.write('\x1b[c'); // Query device attributes
63
- // Timeout after 50ms
64
- setTimeout(() => {
65
- if (!checkFinished) {
66
- process.stdin.removeListener('data', handleData);
67
- if (!originalRawMode) {
68
- process.stdin.setRawMode(false);
69
- }
70
- detectionComplete = true;
71
- resolve(false);
72
- }
73
- }, 50);
80
+ // Timeout after 200ms
81
+ // When a iterm2 terminal does not have focus this can take over 90s on a
82
+ // fast macbook so we need a somewhat longer threshold than would be ideal.
83
+ timeoutId = setTimeout(onTimeout, 200);
74
84
  });
75
85
  }
76
86
  function disableProtocol() {
@@ -1 +1 @@
1
- {"version":3,"file":"kittyProtocolDetector.js","sourceRoot":"","sources":["../../../../src/ui/utils/kittyProtocolDetector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,IAAI,eAAe,GAAG,KAAK,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B;IAChD,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClD,iBAAiB,GAAG,IAAI,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;QAC5C,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,cAAc,GAAG,EAAE,CAAC;QACxB,IAAI,8BAA8B,GAAG,KAAK,CAAC;QAC3C,IAAI,aAAa,GAAG,KAAK,CAAC;QAE1B,MAAM,UAAU,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OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAChC,eAAe,GAAG,KAAK,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -21,6 +21,29 @@ export declare const KITTY_KEYCODE_ENTER = 13;
21
21
  export declare const KITTY_KEYCODE_NUMPAD_ENTER = 57414;
22
22
  export declare const KITTY_KEYCODE_TAB = 9;
23
23
  export declare const KITTY_KEYCODE_BACKSPACE = 127;
24
+ /**
25
+ * Kitty modifier decoding constants
26
+ *
27
+ * In Kitty/Ghostty, the modifier parameter is encoded as (1 + bitmask).
28
+ * Some terminals also set bit 7 (i.e., add 128) when reporting event types.
29
+ */
30
+ export declare const KITTY_MODIFIER_BASE = 1;
31
+ export declare const KITTY_MODIFIER_EVENT_TYPES_OFFSET = 128;
32
+ /**
33
+ * Modifier bit flags for Kitty/Xterm-style parameters.
34
+ *
35
+ * Per spec, the modifiers parameter encodes (1 + bitmask) where:
36
+ * - 1: no modifiers
37
+ * - bit 0 (1): Shift
38
+ * - bit 1 (2): Alt/Option (reported as "alt" in spec; we map to meta)
39
+ * - bit 2 (4): Ctrl
40
+ *
41
+ * Some terminals add 128 to the entire modifiers field when reporting event types.
42
+ * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
43
+ */
44
+ export declare const MODIFIER_SHIFT_BIT = 1;
45
+ export declare const MODIFIER_ALT_BIT = 2;
46
+ export declare const MODIFIER_CTRL_BIT = 4;
24
47
  /**
25
48
  * Timing constants for terminal interactions
26
49
  */
@@ -42,7 +65,7 @@ export declare const BACKSLASH_ENTER_DETECTION_WINDOW_MS = 5;
42
65
  * Longest reasonable: \x1b[127;15~ = 11 chars (Del with all modifiers)
43
66
  * We use 12 to provide a small buffer.
44
67
  */
45
- export declare const MAX_KITTY_SEQUENCE_LENGTH = 12;
68
+ export declare const MAX_KITTY_SEQUENCE_LENGTH = 32;
46
69
  /**
47
70
  * Character codes for common escape sequences
48
71
  */
@@ -21,6 +21,29 @@ export const KITTY_KEYCODE_ENTER = 13;
21
21
  export const KITTY_KEYCODE_NUMPAD_ENTER = 57414;
22
22
  export const KITTY_KEYCODE_TAB = 9;
23
23
  export const KITTY_KEYCODE_BACKSPACE = 127;
24
+ /**
25
+ * Kitty modifier decoding constants
26
+ *
27
+ * In Kitty/Ghostty, the modifier parameter is encoded as (1 + bitmask).
28
+ * Some terminals also set bit 7 (i.e., add 128) when reporting event types.
29
+ */
30
+ export const KITTY_MODIFIER_BASE = 1; // Base value per spec before bitmask decode
31
+ export const KITTY_MODIFIER_EVENT_TYPES_OFFSET = 128; // Added when event types are included
32
+ /**
33
+ * Modifier bit flags for Kitty/Xterm-style parameters.
34
+ *
35
+ * Per spec, the modifiers parameter encodes (1 + bitmask) where:
36
+ * - 1: no modifiers
37
+ * - bit 0 (1): Shift
38
+ * - bit 1 (2): Alt/Option (reported as "alt" in spec; we map to meta)
39
+ * - bit 2 (4): Ctrl
40
+ *
41
+ * Some terminals add 128 to the entire modifiers field when reporting event types.
42
+ * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
43
+ */
44
+ export const MODIFIER_SHIFT_BIT = 1;
45
+ export const MODIFIER_ALT_BIT = 2;
46
+ export const MODIFIER_CTRL_BIT = 4;
24
47
  /**
25
48
  * Timing constants for terminal interactions
26
49
  */
@@ -42,7 +65,9 @@ export const BACKSLASH_ENTER_DETECTION_WINDOW_MS = 5;
42
65
  * Longest reasonable: \x1b[127;15~ = 11 chars (Del with all modifiers)
43
66
  * We use 12 to provide a small buffer.
44
67
  */
45
- export const MAX_KITTY_SEQUENCE_LENGTH = 12;
68
+ // Increased to accommodate parameterized forms and occasional colon subfields
69
+ // while still being small enough to avoid pathological buffering.
70
+ export const MAX_KITTY_SEQUENCE_LENGTH = 32;
46
71
  /**
47
72
  * Character codes for common escape sequences
48
73
  */
@@ -1 +1 @@
1
- {"version":3,"file":"platformConstants.js","sourceRoot":"","sources":["../../../../src/ui/utils/platformConstants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,QAAQ,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"platformConstants.js","sourceRoot":"","sources":["../../../../src/ui/utils/platformConstants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,CAAC,4CAA4C;AAClF,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAC,CAAC,sCAAsC;AAE5F;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,QAAQ,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,8EAA8E;AAC9E,kEAAkE;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC"}
@@ -30,3 +30,13 @@ export declare function cpSlice(str: string, start: number, end?: number): strin
30
30
  * - CR/LF (0x0D/0x0A) - needed for line breaks
31
31
  */
32
32
  export declare function stripUnsafeCharacters(str: string): string;
33
+ /**
34
+ * Cached version of stringWidth function for better performance
35
+ * Follows Ink's approach with unlimited cache (no eviction)
36
+ */
37
+ export declare const getCachedStringWidth: (str: string) => number;
38
+ /**
39
+ * Clear the string width cache
40
+ */
41
+ export declare const clearStringWidthCache: () => void;
42
+ export declare function escapeAnsiCtrlCodes<T>(obj: T): T;