@google/gemini-cli 0.26.0-preview.4 → 0.27.0-nightly.20260126.cb772a5b7

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 (461) hide show
  1. package/README.md +18 -1
  2. package/dist/google-gemini-cli-0.27.0-nightly.20260121.97aac696f.tgz +0 -0
  3. package/dist/package.json +3 -4
  4. package/dist/src/commands/extensions.js +4 -1
  5. package/dist/src/commands/extensions.js.map +1 -1
  6. package/dist/src/commands/hooks.js +4 -1
  7. package/dist/src/commands/hooks.js.map +1 -1
  8. package/dist/src/commands/mcp/enableDisable.d.ts +13 -0
  9. package/dist/src/commands/mcp/enableDisable.js +122 -0
  10. package/dist/src/commands/mcp/enableDisable.js.map +1 -0
  11. package/dist/src/commands/mcp/list.d.ts +2 -0
  12. package/dist/src/commands/mcp/list.js +1 -1
  13. package/dist/src/commands/mcp/list.js.map +1 -1
  14. package/dist/src/commands/mcp.js +7 -1
  15. package/dist/src/commands/mcp.js.map +1 -1
  16. package/dist/src/commands/mcp.test.js +3 -1
  17. package/dist/src/commands/mcp.test.js.map +1 -1
  18. package/dist/src/commands/skills.js +4 -1
  19. package/dist/src/commands/skills.js.map +1 -1
  20. package/dist/src/config/config.d.ts +4 -0
  21. package/dist/src/config/config.js +41 -20
  22. package/dist/src/config/config.js.map +1 -1
  23. package/dist/src/config/config.test.js +181 -15
  24. package/dist/src/config/config.test.js.map +1 -1
  25. package/dist/src/config/keyBindings.d.ts +8 -5
  26. package/dist/src/config/keyBindings.js +38 -32
  27. package/dist/src/config/keyBindings.js.map +1 -1
  28. package/dist/src/config/keyBindings.test.js +8 -5
  29. package/dist/src/config/keyBindings.test.js.map +1 -1
  30. package/dist/src/config/mcp/index.d.ts +6 -0
  31. package/dist/src/config/mcp/index.js +7 -0
  32. package/dist/src/config/mcp/index.js.map +1 -0
  33. package/dist/src/config/mcp/mcpServerEnablement.d.ts +145 -0
  34. package/dist/src/config/mcp/mcpServerEnablement.js +254 -0
  35. package/dist/src/config/mcp/mcpServerEnablement.js.map +1 -0
  36. package/dist/src/config/mcp/mcpServerEnablement.test.js +147 -0
  37. package/dist/src/config/mcp/mcpServerEnablement.test.js.map +1 -0
  38. package/dist/src/config/sandboxConfig.test.js +11 -5
  39. package/dist/src/config/sandboxConfig.test.js.map +1 -1
  40. package/dist/src/config/settings.js +76 -0
  41. package/dist/src/config/settings.js.map +1 -1
  42. package/dist/src/config/settings.test.js +44 -0
  43. package/dist/src/config/settings.test.js.map +1 -1
  44. package/dist/src/config/settingsSchema.d.ts +21 -78
  45. package/dist/src/config/settingsSchema.js +21 -79
  46. package/dist/src/config/settingsSchema.js.map +1 -1
  47. package/dist/src/config/settingsSchema.test.js +1 -1
  48. package/dist/src/config/settingsSchema.test.js.map +1 -1
  49. package/dist/src/config/settings_repro.test.js +6 -2
  50. package/dist/src/config/settings_repro.test.js.map +1 -1
  51. package/dist/src/gemini.js +12 -7
  52. package/dist/src/gemini.js.map +1 -1
  53. package/dist/src/gemini.test.js +140 -10
  54. package/dist/src/gemini.test.js.map +1 -1
  55. package/dist/src/generated/git-commit.d.ts +2 -2
  56. package/dist/src/generated/git-commit.js +2 -2
  57. package/dist/src/generated/git-commit.js.map +1 -1
  58. package/dist/src/nonInteractiveCli.js +11 -3
  59. package/dist/src/nonInteractiveCli.js.map +1 -1
  60. package/dist/src/nonInteractiveCli.test.js +193 -3
  61. package/dist/src/nonInteractiveCli.test.js.map +1 -1
  62. package/dist/src/nonInteractiveCliCommands.js +6 -1
  63. package/dist/src/nonInteractiveCliCommands.js.map +1 -1
  64. package/dist/src/services/BuiltinCommandLoader.js +2 -0
  65. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  66. package/dist/src/services/FileCommandLoader.js +12 -4
  67. package/dist/src/services/FileCommandLoader.js.map +1 -1
  68. package/dist/src/services/FileCommandLoader.test.js +56 -0
  69. package/dist/src/services/FileCommandLoader.test.js.map +1 -1
  70. package/dist/src/test-utils/mockCommandContext.js +2 -0
  71. package/dist/src/test-utils/mockCommandContext.js.map +1 -1
  72. package/dist/src/test-utils/persistentStateFake.d.ts +26 -0
  73. package/dist/src/test-utils/persistentStateFake.js +39 -0
  74. package/dist/src/test-utils/persistentStateFake.js.map +1 -0
  75. package/dist/src/test-utils/render.d.ts +10 -1
  76. package/dist/src/test-utils/render.js +45 -16
  77. package/dist/src/test-utils/render.js.map +1 -1
  78. package/dist/src/ui/App.test.js +96 -38
  79. package/dist/src/ui/App.test.js.map +1 -1
  80. package/dist/src/ui/AppContainer.js +78 -18
  81. package/dist/src/ui/AppContainer.js.map +1 -1
  82. package/dist/src/ui/AppContainer.test.js +185 -19
  83. package/dist/src/ui/AppContainer.test.js.map +1 -1
  84. package/dist/src/ui/auth/ApiAuthDialog.test.js +5 -5
  85. package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
  86. package/dist/src/ui/auth/AuthDialog.test.js +13 -9
  87. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
  88. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +6 -6
  89. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +1 -1
  90. package/dist/src/ui/commands/aboutCommand.js +2 -0
  91. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  92. package/dist/src/ui/commands/aboutCommand.test.js +12 -0
  93. package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
  94. package/dist/src/ui/commands/agentsCommand.js +75 -4
  95. package/dist/src/ui/commands/agentsCommand.js.map +1 -1
  96. package/dist/src/ui/commands/agentsCommand.test.js +114 -0
  97. package/dist/src/ui/commands/agentsCommand.test.js.map +1 -1
  98. package/dist/src/ui/commands/directoryCommand.js +53 -49
  99. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  100. package/dist/src/ui/commands/directoryCommand.test.js +79 -23
  101. package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
  102. package/dist/src/ui/commands/initCommand.test.js +8 -4
  103. package/dist/src/ui/commands/initCommand.test.js.map +1 -1
  104. package/dist/src/ui/commands/mcpCommand.js +136 -5
  105. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  106. package/dist/src/ui/commands/policiesCommand.js +33 -20
  107. package/dist/src/ui/commands/policiesCommand.js.map +1 -1
  108. package/dist/src/ui/commands/policiesCommand.test.js +7 -4
  109. package/dist/src/ui/commands/policiesCommand.test.js.map +1 -1
  110. package/dist/src/ui/commands/rewindCommand.d.ts +7 -0
  111. package/dist/src/ui/commands/rewindCommand.js +132 -0
  112. package/dist/src/ui/commands/rewindCommand.js.map +1 -0
  113. package/dist/src/ui/commands/rewindCommand.test.js +242 -0
  114. package/dist/src/ui/commands/rewindCommand.test.js.map +1 -0
  115. package/dist/src/ui/commands/skillsCommand.js +6 -4
  116. package/dist/src/ui/commands/skillsCommand.js.map +1 -1
  117. package/dist/src/ui/commands/skillsCommand.test.js +17 -3
  118. package/dist/src/ui/commands/skillsCommand.test.js.map +1 -1
  119. package/dist/src/ui/commands/types.d.ts +5 -3
  120. package/dist/src/ui/commands/types.js.map +1 -1
  121. package/dist/src/ui/components/AboutBox.d.ts +1 -0
  122. package/dist/src/ui/components/AboutBox.js +5 -1
  123. package/dist/src/ui/components/AboutBox.js.map +1 -1
  124. package/dist/src/ui/components/AboutBox.test.js +8 -2
  125. package/dist/src/ui/components/AboutBox.test.js.map +1 -1
  126. package/dist/src/ui/components/AgentConfigDialog.d.ts +18 -0
  127. package/dist/src/ui/components/AgentConfigDialog.js +296 -0
  128. package/dist/src/ui/components/AgentConfigDialog.js.map +1 -0
  129. package/dist/src/ui/components/AgentConfigDialog.test.js +241 -0
  130. package/dist/src/ui/components/AgentConfigDialog.test.js.map +1 -0
  131. package/dist/src/ui/components/AlternateBufferQuittingDisplay.js +9 -2
  132. package/dist/src/ui/components/AlternateBufferQuittingDisplay.js.map +1 -1
  133. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +54 -25
  134. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
  135. package/dist/src/ui/components/AppHeader.js +4 -1
  136. package/dist/src/ui/components/AppHeader.js.map +1 -1
  137. package/dist/src/ui/components/AppHeader.test.js +95 -22
  138. package/dist/src/ui/components/AppHeader.test.js.map +1 -1
  139. package/dist/src/ui/components/{AutoAcceptIndicator.d.ts → ApprovalModeIndicator.d.ts} +2 -2
  140. package/dist/src/ui/components/{AutoAcceptIndicator.js → ApprovalModeIndicator.js} +8 -3
  141. package/dist/src/ui/components/ApprovalModeIndicator.js.map +1 -0
  142. package/dist/src/ui/components/ApprovalModeIndicator.test.d.ts +6 -0
  143. package/dist/src/ui/components/{AutoAcceptIndicator.test.js → ApprovalModeIndicator.test.js} +13 -7
  144. package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +1 -0
  145. package/dist/src/ui/components/AskUserDialog.d.ts +39 -0
  146. package/dist/src/ui/components/AskUserDialog.js +618 -0
  147. package/dist/src/ui/components/AskUserDialog.js.map +1 -0
  148. package/dist/src/ui/components/AskUserDialog.test.d.ts +6 -0
  149. package/dist/src/ui/components/AskUserDialog.test.js +598 -0
  150. package/dist/src/ui/components/AskUserDialog.test.js.map +1 -0
  151. package/dist/src/ui/components/Composer.d.ts +3 -1
  152. package/dist/src/ui/components/Composer.js +5 -5
  153. package/dist/src/ui/components/Composer.js.map +1 -1
  154. package/dist/src/ui/components/Composer.test.js +6 -6
  155. package/dist/src/ui/components/Composer.test.js.map +1 -1
  156. package/dist/src/ui/components/ConfigInitDisplay.js +3 -4
  157. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
  158. package/dist/src/ui/components/ConfigInitDisplay.test.js +13 -29
  159. package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -1
  160. package/dist/src/ui/components/ContextUsageDisplay.test.js +7 -3
  161. package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -1
  162. package/dist/src/ui/components/DialogManager.js +13 -0
  163. package/dist/src/ui/components/DialogManager.js.map +1 -1
  164. package/dist/src/ui/components/DialogManager.test.js +24 -0
  165. package/dist/src/ui/components/DialogManager.test.js.map +1 -1
  166. package/dist/src/ui/components/FolderTrustDialog.test.js +3 -1
  167. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
  168. package/dist/src/ui/components/Footer.test.js +7 -0
  169. package/dist/src/ui/components/Footer.test.js.map +1 -1
  170. package/dist/src/ui/components/Help.js +5 -2
  171. package/dist/src/ui/components/Help.js.map +1 -1
  172. package/dist/src/ui/components/HistoryItemDisplay.js +1 -1
  173. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  174. package/dist/src/ui/components/InputPrompt.js +32 -20
  175. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  176. package/dist/src/ui/components/InputPrompt.test.js +75 -1
  177. package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
  178. package/dist/src/ui/components/MultiFolderTrustDialog.js +2 -1
  179. package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -1
  180. package/dist/src/ui/components/MultiFolderTrustDialog.test.js +12 -10
  181. package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -1
  182. package/dist/src/ui/components/Notifications.js +14 -20
  183. package/dist/src/ui/components/Notifications.js.map +1 -1
  184. package/dist/src/ui/components/Notifications.test.js +45 -35
  185. package/dist/src/ui/components/Notifications.test.js.map +1 -1
  186. package/dist/src/ui/components/RewindViewer.d.ts +1 -1
  187. package/dist/src/ui/components/RewindViewer.js +65 -17
  188. package/dist/src/ui/components/RewindViewer.js.map +1 -1
  189. package/dist/src/ui/components/RewindViewer.test.js +5 -3
  190. package/dist/src/ui/components/RewindViewer.test.js.map +1 -1
  191. package/dist/src/ui/components/SessionBrowser.js +3 -2
  192. package/dist/src/ui/components/SessionBrowser.js.map +1 -1
  193. package/dist/src/ui/components/SessionBrowser.test.js +10 -3
  194. package/dist/src/ui/components/SessionBrowser.test.js.map +1 -1
  195. package/dist/src/ui/components/SettingsDialog.d.ts +1 -1
  196. package/dist/src/ui/components/SettingsDialog.js +266 -516
  197. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  198. package/dist/src/ui/components/SettingsDialog.test.js +2 -2
  199. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  200. package/dist/src/ui/components/ShellInputPrompt.test.js +17 -8
  201. package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -1
  202. package/dist/src/ui/components/SuggestionsDisplay.d.ts +1 -1
  203. package/dist/src/ui/components/SuggestionsDisplay.js +4 -3
  204. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  205. package/dist/src/ui/components/ToolConfirmationQueue.d.ts +12 -0
  206. package/dist/src/ui/components/ToolConfirmationQueue.js +30 -0
  207. package/dist/src/ui/components/ToolConfirmationQueue.js.map +1 -0
  208. package/dist/src/ui/components/ToolConfirmationQueue.test.d.ts +6 -0
  209. package/dist/src/ui/components/ToolConfirmationQueue.test.js +71 -0
  210. package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -0
  211. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +2 -4
  212. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +1 -1
  213. package/dist/src/ui/components/messages/ShellToolMessage.js +6 -41
  214. package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
  215. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +3 -2
  216. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +61 -76
  217. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  218. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +20 -7
  219. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
  220. package/dist/src/ui/components/messages/ToolGroupMessage.js +34 -18
  221. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  222. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +209 -24
  223. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
  224. package/dist/src/ui/components/messages/ToolMessage.d.ts +1 -1
  225. package/dist/src/ui/components/messages/ToolMessage.js +7 -29
  226. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  227. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.d.ts +6 -0
  228. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +89 -0
  229. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +1 -0
  230. package/dist/src/ui/components/messages/ToolShared.d.ts +26 -0
  231. package/dist/src/ui/components/messages/ToolShared.js +59 -6
  232. package/dist/src/ui/components/messages/ToolShared.js.map +1 -1
  233. package/dist/src/ui/components/shared/BaseSelectionList.d.ts +3 -1
  234. package/dist/src/ui/components/shared/BaseSelectionList.js +4 -2
  235. package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -1
  236. package/dist/src/ui/components/shared/BaseSelectionList.test.js +1 -0
  237. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
  238. package/dist/src/ui/components/shared/BaseSettingsDialog.d.ts +72 -0
  239. package/dist/src/ui/components/shared/BaseSettingsDialog.js +293 -0
  240. package/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -0
  241. package/dist/src/ui/components/shared/BaseSettingsDialog.test.d.ts +6 -0
  242. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +434 -0
  243. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +1 -0
  244. package/dist/src/ui/components/shared/ExpandableText.d.ts +17 -0
  245. package/dist/src/ui/components/{PrepareLabel.js → shared/ExpandableText.js} +30 -15
  246. package/dist/src/ui/components/shared/ExpandableText.js.map +1 -0
  247. package/dist/src/ui/components/shared/ExpandableText.test.d.ts +6 -0
  248. package/dist/src/ui/components/{PrepareLabel.test.js → shared/ExpandableText.test.js} +22 -11
  249. package/dist/src/ui/components/shared/ExpandableText.test.js.map +1 -0
  250. package/dist/src/ui/components/shared/TabHeader.d.ts +51 -0
  251. package/dist/src/ui/components/shared/TabHeader.js +42 -0
  252. package/dist/src/ui/components/shared/TabHeader.js.map +1 -0
  253. package/dist/src/ui/components/shared/TabHeader.test.d.ts +6 -0
  254. package/dist/src/ui/components/shared/TabHeader.test.js +106 -0
  255. package/dist/src/ui/components/shared/TabHeader.test.js.map +1 -0
  256. package/dist/src/ui/components/shared/TextInput.test.js +32 -24
  257. package/dist/src/ui/components/shared/TextInput.test.js.map +1 -1
  258. package/dist/src/ui/components/shared/text-buffer.d.ts +13 -0
  259. package/dist/src/ui/components/shared/text-buffer.js +173 -14
  260. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  261. package/dist/src/ui/components/shared/text-buffer.test.js +256 -44
  262. package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
  263. package/dist/src/ui/components/shared/vim-buffer-actions.test.js +4 -1
  264. package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -1
  265. package/dist/src/ui/components/views/McpStatus.d.ts +1 -0
  266. package/dist/src/ui/components/views/McpStatus.js +30 -18
  267. package/dist/src/ui/components/views/McpStatus.js.map +1 -1
  268. package/dist/src/ui/components/views/McpStatus.test.js +7 -0
  269. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
  270. package/dist/src/ui/constants/tips.js +2 -2
  271. package/dist/src/ui/constants/tips.js.map +1 -1
  272. package/dist/src/ui/constants.d.ts +1 -0
  273. package/dist/src/ui/constants.js +1 -0
  274. package/dist/src/ui/constants.js.map +1 -1
  275. package/dist/src/ui/contexts/KeypressContext.d.ts +3 -2
  276. package/dist/src/ui/contexts/KeypressContext.js +33 -25
  277. package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
  278. package/dist/src/ui/contexts/KeypressContext.test.js +151 -41
  279. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
  280. package/dist/src/ui/contexts/MouseContext.test.js +8 -8
  281. package/dist/src/ui/contexts/MouseContext.test.js.map +1 -1
  282. package/dist/src/ui/contexts/ToolActionsContext.d.ts +20 -0
  283. package/dist/src/ui/contexts/ToolActionsContext.js +74 -0
  284. package/dist/src/ui/contexts/ToolActionsContext.js.map +1 -0
  285. package/dist/src/ui/contexts/ToolActionsContext.test.d.ts +6 -0
  286. package/dist/src/ui/contexts/ToolActionsContext.test.js +135 -0
  287. package/dist/src/ui/contexts/ToolActionsContext.test.js.map +1 -0
  288. package/dist/src/ui/contexts/UIActionsContext.d.ts +3 -1
  289. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
  290. package/dist/src/ui/contexts/UIStateContext.d.ts +6 -2
  291. package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
  292. package/dist/src/ui/hooks/atCommandProcessor.js +19 -4
  293. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  294. package/dist/src/ui/hooks/keyToAnsi.js +1 -1
  295. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -1
  296. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +3 -1
  297. package/dist/src/ui/hooks/slashCommandProcessor.js +24 -7
  298. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  299. package/dist/src/ui/hooks/slashCommandProcessor.test.js +126 -30
  300. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
  301. package/dist/src/ui/hooks/toolMapping.js +8 -11
  302. package/dist/src/ui/hooks/toolMapping.js.map +1 -1
  303. package/dist/src/ui/hooks/toolMapping.test.js +27 -6
  304. package/dist/src/ui/hooks/toolMapping.test.js.map +1 -1
  305. package/dist/src/ui/hooks/{useAutoAcceptIndicator.d.ts → useApprovalModeIndicator.d.ts} +2 -2
  306. package/dist/src/ui/hooks/{useAutoAcceptIndicator.js → useApprovalModeIndicator.js} +25 -11
  307. package/dist/src/ui/hooks/useApprovalModeIndicator.js.map +1 -0
  308. package/dist/src/ui/hooks/useApprovalModeIndicator.test.d.ts +6 -0
  309. package/dist/src/ui/hooks/{useAutoAcceptIndicator.test.js → useApprovalModeIndicator.test.js} +56 -31
  310. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js.map +1 -0
  311. package/dist/src/ui/hooks/useConfirmingTool.d.ts +16 -0
  312. package/dist/src/ui/hooks/useConfirmingTool.js +39 -0
  313. package/dist/src/ui/hooks/useConfirmingTool.js.map +1 -0
  314. package/dist/src/ui/hooks/useGeminiStream.d.ts +1 -1
  315. package/dist/src/ui/hooks/useGeminiStream.js +20 -8
  316. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  317. package/dist/src/ui/hooks/useGeminiStream.test.js +79 -19
  318. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
  319. package/dist/src/ui/hooks/useIncludeDirsTrust.d.ts +1 -1
  320. package/dist/src/ui/hooks/useIncludeDirsTrust.js +9 -20
  321. package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -1
  322. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +33 -12
  323. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -1
  324. package/dist/src/ui/hooks/useKeypress.test.js +10 -3
  325. package/dist/src/ui/hooks/useKeypress.test.js.map +1 -1
  326. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +7 -1
  327. package/dist/src/ui/hooks/useLoadingIndicator.js +3 -3
  328. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
  329. package/dist/src/ui/hooks/useLoadingIndicator.test.js +17 -9
  330. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
  331. package/dist/src/ui/hooks/usePhraseCycler.d.ts +2 -2
  332. package/dist/src/ui/hooks/usePhraseCycler.js +4 -14
  333. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  334. package/dist/src/ui/hooks/usePhraseCycler.test.js +13 -42
  335. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
  336. package/dist/src/ui/hooks/useSelectionList.d.ts +4 -1
  337. package/dist/src/ui/hooks/useSelectionList.js +51 -13
  338. package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
  339. package/dist/src/ui/hooks/useSelectionList.test.js +35 -3
  340. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
  341. package/dist/src/ui/hooks/useSessionResume.test.js +3 -2
  342. package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -1
  343. package/dist/src/ui/hooks/useShellInactivityStatus.d.ts +26 -0
  344. package/dist/src/ui/hooks/useShellInactivityStatus.js +46 -0
  345. package/dist/src/ui/hooks/useShellInactivityStatus.js.map +1 -0
  346. package/dist/src/ui/hooks/useShellInactivityStatus.test.d.ts +6 -0
  347. package/dist/src/ui/hooks/useShellInactivityStatus.test.js +84 -0
  348. package/dist/src/ui/hooks/useShellInactivityStatus.test.js.map +1 -0
  349. package/dist/src/ui/hooks/useTabbedNavigation.d.ts +53 -0
  350. package/dist/src/ui/hooks/useTabbedNavigation.js +150 -0
  351. package/dist/src/ui/hooks/useTabbedNavigation.js.map +1 -0
  352. package/dist/src/ui/hooks/useTabbedNavigation.test.d.ts +6 -0
  353. package/dist/src/ui/hooks/useTabbedNavigation.test.js +187 -0
  354. package/dist/src/ui/hooks/useTabbedNavigation.test.js.map +1 -0
  355. package/dist/src/ui/hooks/useTips.d.ts +10 -0
  356. package/dist/src/ui/hooks/useTips.js +18 -0
  357. package/dist/src/ui/hooks/useTips.js.map +1 -0
  358. package/dist/src/ui/hooks/useTips.test.d.ts +6 -0
  359. package/dist/src/ui/hooks/useTips.test.js +33 -0
  360. package/dist/src/ui/hooks/useTips.test.js.map +1 -0
  361. package/dist/src/ui/hooks/useToolExecutionScheduler.d.ts +30 -0
  362. package/dist/src/ui/hooks/useToolExecutionScheduler.js +113 -0
  363. package/dist/src/ui/hooks/useToolExecutionScheduler.js.map +1 -0
  364. package/dist/src/ui/hooks/useToolExecutionScheduler.test.d.ts +6 -0
  365. package/dist/src/ui/hooks/useToolExecutionScheduler.test.js +296 -0
  366. package/dist/src/ui/hooks/useToolExecutionScheduler.test.js.map +1 -0
  367. package/dist/src/ui/hooks/useToolScheduler.d.ts +29 -0
  368. package/dist/src/ui/hooks/useToolScheduler.js +30 -0
  369. package/dist/src/ui/hooks/useToolScheduler.js.map +1 -0
  370. package/dist/src/ui/hooks/useToolScheduler.test.js +1 -1
  371. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  372. package/dist/src/ui/hooks/useToolSchedulerFacade.test.d.ts +6 -0
  373. package/dist/src/ui/hooks/useToolSchedulerFacade.test.js +45 -0
  374. package/dist/src/ui/hooks/useToolSchedulerFacade.test.js.map +1 -0
  375. package/dist/src/ui/hooks/useTurnActivityMonitor.d.ts +16 -0
  376. package/dist/src/ui/hooks/useTurnActivityMonitor.js +49 -0
  377. package/dist/src/ui/hooks/useTurnActivityMonitor.js.map +1 -0
  378. package/dist/src/ui/hooks/useTurnActivityMonitor.test.d.ts +6 -0
  379. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js +97 -0
  380. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js.map +1 -0
  381. package/dist/src/ui/hooks/vim.js +5 -3
  382. package/dist/src/ui/hooks/vim.js.map +1 -1
  383. package/dist/src/ui/hooks/vim.test.js +4 -2
  384. package/dist/src/ui/hooks/vim.test.js.map +1 -1
  385. package/dist/src/ui/keyMatchers.js +5 -13
  386. package/dist/src/ui/keyMatchers.js.map +1 -1
  387. package/dist/src/ui/keyMatchers.test.js +23 -20
  388. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  389. package/dist/src/ui/layouts/DefaultAppLayout.js +10 -2
  390. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
  391. package/dist/src/ui/noninteractive/nonInteractiveUi.js +1 -0
  392. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -1
  393. package/dist/src/ui/types.d.ts +11 -3
  394. package/dist/src/ui/types.js.map +1 -1
  395. package/dist/src/ui/utils/clipboardUtils.d.ts +4 -4
  396. package/dist/src/ui/utils/clipboardUtils.js +198 -12
  397. package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
  398. package/dist/src/ui/utils/clipboardUtils.test.js +219 -47
  399. package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -1
  400. package/dist/src/ui/utils/clipboardUtils.windows.test.js +3 -0
  401. package/dist/src/ui/utils/clipboardUtils.windows.test.js.map +1 -1
  402. package/dist/src/ui/utils/commandUtils.test.js +11 -3
  403. package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
  404. package/dist/src/ui/utils/directoryUtils.d.ts +10 -0
  405. package/dist/src/ui/utils/directoryUtils.js +12 -0
  406. package/dist/src/ui/utils/directoryUtils.js.map +1 -1
  407. package/dist/src/ui/utils/directoryUtils.test.js +8 -4
  408. package/dist/src/ui/utils/directoryUtils.test.js.map +1 -1
  409. package/dist/src/ui/utils/formatters.d.ts +1 -1
  410. package/dist/src/ui/utils/formatters.js +2 -3
  411. package/dist/src/ui/utils/formatters.js.map +1 -1
  412. package/dist/src/ui/utils/highlight.d.ts +2 -2
  413. package/dist/src/ui/utils/highlight.js +9 -3
  414. package/dist/src/ui/utils/highlight.js.map +1 -1
  415. package/dist/src/ui/utils/highlight.test.js +3 -0
  416. package/dist/src/ui/utils/highlight.test.js.map +1 -1
  417. package/dist/src/ui/utils/terminalCapabilityManager.d.ts +1 -2
  418. package/dist/src/ui/utils/terminalCapabilityManager.js +2 -8
  419. package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -1
  420. package/dist/src/ui/utils/terminalCapabilityManager.test.js +2 -3
  421. package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -1
  422. package/dist/src/ui/utils/terminalSetup.test.js +5 -3
  423. package/dist/src/ui/utils/terminalSetup.test.js.map +1 -1
  424. package/dist/src/ui/utils/textUtils.d.ts +5 -0
  425. package/dist/src/ui/utils/textUtils.js +14 -0
  426. package/dist/src/ui/utils/textUtils.js.map +1 -1
  427. package/dist/src/ui/utils/textUtils.test.js +19 -1
  428. package/dist/src/ui/utils/textUtils.test.js.map +1 -1
  429. package/dist/src/utils/cleanup.js +15 -0
  430. package/dist/src/utils/cleanup.js.map +1 -1
  431. package/dist/src/utils/events.d.ts +1 -6
  432. package/dist/src/utils/events.js +0 -2
  433. package/dist/src/utils/events.js.map +1 -1
  434. package/dist/src/utils/events.test.js +4 -4
  435. package/dist/src/utils/events.test.js.map +1 -1
  436. package/dist/src/utils/handleAutoUpdate.test.js +3 -0
  437. package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
  438. package/dist/src/utils/installationInfo.js +4 -2
  439. package/dist/src/utils/installationInfo.js.map +1 -1
  440. package/dist/src/utils/persistentState.d.ts +2 -0
  441. package/dist/src/utils/persistentState.js.map +1 -1
  442. package/dist/src/utils/windowTitle.d.ts +2 -1
  443. package/dist/src/utils/windowTitle.js +8 -1
  444. package/dist/src/utils/windowTitle.js.map +1 -1
  445. package/dist/src/utils/windowTitle.test.js +25 -1
  446. package/dist/src/utils/windowTitle.test.js.map +1 -1
  447. package/dist/src/zed-integration/zedIntegration.js +26 -5
  448. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  449. package/dist/tsconfig.tsbuildinfo +1 -1
  450. package/package.json +4 -5
  451. package/dist/google-gemini-cli-0.26.0-preview.3.tgz +0 -0
  452. package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
  453. package/dist/src/ui/components/AutoAcceptIndicator.test.js.map +0 -1
  454. package/dist/src/ui/components/PrepareLabel.d.ts +0 -15
  455. package/dist/src/ui/components/PrepareLabel.js.map +0 -1
  456. package/dist/src/ui/components/PrepareLabel.test.js.map +0 -1
  457. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
  458. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
  459. /package/dist/src/{ui/components/AutoAcceptIndicator.test.d.ts → config/mcp/mcpServerEnablement.test.d.ts} +0 -0
  460. /package/dist/src/ui/{components/PrepareLabel.test.d.ts → commands/rewindCommand.test.d.ts} +0 -0
  461. /package/dist/src/ui/{hooks/useAutoAcceptIndicator.test.d.ts → components/AgentConfigDialog.test.d.ts} +0 -0
@@ -29,7 +29,18 @@ const initialState = {
29
29
  viewportHeight: 24,
30
30
  transformationsByLine: [[]],
31
31
  visualLayout: defaultVisualLayout,
32
+ pastedContent: {},
32
33
  };
34
+ /**
35
+ * Helper to create a TextBufferState with properly calculated transformations.
36
+ */
37
+ function createStateWithTransformations(partial) {
38
+ const state = { ...initialState, ...partial };
39
+ return {
40
+ ...state,
41
+ transformationsByLine: state.lines.map((l) => calculateTransformationsForLine(l)),
42
+ };
43
+ }
33
44
  describe('textBufferReducer', () => {
34
45
  afterEach(() => {
35
46
  vi.restoreAllMocks();
@@ -117,6 +128,18 @@ describe('textBufferReducer', () => {
117
128
  expect(state.cursorCol).toBe(5);
118
129
  });
119
130
  });
131
+ describe('add_pasted_content action', () => {
132
+ it('should add content to pastedContent Record', () => {
133
+ const action = {
134
+ type: 'add_pasted_content',
135
+ payload: { id: '[Pasted Text: 6 lines]', text: 'large content' },
136
+ };
137
+ const state = textBufferReducer(initialState, action);
138
+ expect(state.pastedContent).toEqual({
139
+ '[Pasted Text: 6 lines]': 'large content',
140
+ });
141
+ });
142
+ });
120
143
  describe('backspace action', () => {
121
144
  it('should remove a character', () => {
122
145
  const stateWithText = {
@@ -146,6 +169,130 @@ describe('textBufferReducer', () => {
146
169
  expect(state.cursorCol).toBe(5);
147
170
  });
148
171
  });
172
+ describe('atomic placeholder deletion', () => {
173
+ describe('paste placeholders', () => {
174
+ it('backspace at end of paste placeholder removes entire placeholder', () => {
175
+ const placeholder = '[Pasted Text: 6 lines]';
176
+ const stateWithPlaceholder = createStateWithTransformations({
177
+ lines: [placeholder],
178
+ cursorRow: 0,
179
+ cursorCol: placeholder.length, // cursor at end
180
+ pastedContent: {
181
+ [placeholder]: 'line1\nline2\nline3\nline4\nline5\nline6',
182
+ },
183
+ });
184
+ const action = { type: 'backspace' };
185
+ const state = textBufferReducer(stateWithPlaceholder, action);
186
+ expect(state).toHaveOnlyValidCharacters();
187
+ expect(state.lines).toEqual(['']);
188
+ expect(state.cursorCol).toBe(0);
189
+ // pastedContent should be cleaned up
190
+ expect(state.pastedContent[placeholder]).toBeUndefined();
191
+ });
192
+ it('delete at start of paste placeholder removes entire placeholder', () => {
193
+ const placeholder = '[Pasted Text: 6 lines]';
194
+ const stateWithPlaceholder = createStateWithTransformations({
195
+ lines: [placeholder],
196
+ cursorRow: 0,
197
+ cursorCol: 0, // cursor at start
198
+ pastedContent: {
199
+ [placeholder]: 'line1\nline2\nline3\nline4\nline5\nline6',
200
+ },
201
+ });
202
+ const action = { type: 'delete' };
203
+ const state = textBufferReducer(stateWithPlaceholder, action);
204
+ expect(state).toHaveOnlyValidCharacters();
205
+ expect(state.lines).toEqual(['']);
206
+ expect(state.cursorCol).toBe(0);
207
+ // pastedContent should be cleaned up
208
+ expect(state.pastedContent[placeholder]).toBeUndefined();
209
+ });
210
+ it('backspace inside paste placeholder does normal deletion', () => {
211
+ const placeholder = '[Pasted Text: 6 lines]';
212
+ const stateWithPlaceholder = createStateWithTransformations({
213
+ lines: [placeholder],
214
+ cursorRow: 0,
215
+ cursorCol: 10, // cursor in middle
216
+ pastedContent: {
217
+ [placeholder]: 'line1\nline2\nline3\nline4\nline5\nline6',
218
+ },
219
+ });
220
+ const action = { type: 'backspace' };
221
+ const state = textBufferReducer(stateWithPlaceholder, action);
222
+ expect(state).toHaveOnlyValidCharacters();
223
+ // Should only delete one character
224
+ expect(state.lines[0].length).toBe(placeholder.length - 1);
225
+ expect(state.cursorCol).toBe(9);
226
+ // pastedContent should NOT be cleaned up (placeholder is broken)
227
+ expect(state.pastedContent[placeholder]).toBeDefined();
228
+ });
229
+ });
230
+ describe('image placeholders', () => {
231
+ it('backspace at end of image path removes entire path', () => {
232
+ const imagePath = '@test.png';
233
+ const stateWithImage = createStateWithTransformations({
234
+ lines: [imagePath],
235
+ cursorRow: 0,
236
+ cursorCol: imagePath.length, // cursor at end
237
+ });
238
+ const action = { type: 'backspace' };
239
+ const state = textBufferReducer(stateWithImage, action);
240
+ expect(state).toHaveOnlyValidCharacters();
241
+ expect(state.lines).toEqual(['']);
242
+ expect(state.cursorCol).toBe(0);
243
+ });
244
+ it('delete at start of image path removes entire path', () => {
245
+ const imagePath = '@test.png';
246
+ const stateWithImage = createStateWithTransformations({
247
+ lines: [imagePath],
248
+ cursorRow: 0,
249
+ cursorCol: 0, // cursor at start
250
+ });
251
+ const action = { type: 'delete' };
252
+ const state = textBufferReducer(stateWithImage, action);
253
+ expect(state).toHaveOnlyValidCharacters();
254
+ expect(state.lines).toEqual(['']);
255
+ expect(state.cursorCol).toBe(0);
256
+ });
257
+ it('backspace inside image path does normal deletion', () => {
258
+ const imagePath = '@test.png';
259
+ const stateWithImage = createStateWithTransformations({
260
+ lines: [imagePath],
261
+ cursorRow: 0,
262
+ cursorCol: 5, // cursor in middle
263
+ });
264
+ const action = { type: 'backspace' };
265
+ const state = textBufferReducer(stateWithImage, action);
266
+ expect(state).toHaveOnlyValidCharacters();
267
+ // Should only delete one character
268
+ expect(state.lines[0].length).toBe(imagePath.length - 1);
269
+ expect(state.cursorCol).toBe(4);
270
+ });
271
+ });
272
+ describe('undo behavior', () => {
273
+ it('undo after placeholder deletion restores everything', () => {
274
+ const placeholder = '[Pasted Text: 6 lines]';
275
+ const pasteContent = 'line1\nline2\nline3\nline4\nline5\nline6';
276
+ const stateWithPlaceholder = createStateWithTransformations({
277
+ lines: [placeholder],
278
+ cursorRow: 0,
279
+ cursorCol: placeholder.length,
280
+ pastedContent: { [placeholder]: pasteContent },
281
+ });
282
+ // Delete the placeholder
283
+ const deleteAction = { type: 'backspace' };
284
+ const stateAfterDelete = textBufferReducer(stateWithPlaceholder, deleteAction);
285
+ expect(stateAfterDelete.lines).toEqual(['']);
286
+ expect(stateAfterDelete.pastedContent[placeholder]).toBeUndefined();
287
+ // Undo should restore
288
+ const undoAction = { type: 'undo' };
289
+ const stateAfterUndo = textBufferReducer(stateAfterDelete, undoAction);
290
+ expect(stateAfterUndo).toHaveOnlyValidCharacters();
291
+ expect(stateAfterUndo.lines).toEqual([placeholder]);
292
+ expect(stateAfterUndo.pastedContent[placeholder]).toBe(pasteContent);
293
+ });
294
+ });
295
+ });
149
296
  describe('undo/redo actions', () => {
150
297
  it('should undo and redo a change', () => {
151
298
  // 1. Insert text
@@ -448,6 +595,43 @@ describe('useTextBuffer', () => {
448
595
  expect(state.text).toBe('a-NEW-bc');
449
596
  expect(state.cursor).toEqual([0, 6]);
450
597
  });
598
+ it('insert: should use placeholder for large text paste', () => {
599
+ const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
600
+ const largeText = '1\n2\n3\n4\n5\n6';
601
+ act(() => result.current.insert(largeText, { paste: true }));
602
+ const state = getBufferState(result);
603
+ expect(state.text).toBe('[Pasted Text: 6 lines]');
604
+ expect(result.current.pastedContent['[Pasted Text: 6 lines]']).toBe(largeText);
605
+ });
606
+ it('insert: should NOT use placeholder for large text if NOT a paste', () => {
607
+ const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
608
+ const largeText = '1\n2\n3\n4\n5\n6';
609
+ act(() => result.current.insert(largeText, { paste: false }));
610
+ const state = getBufferState(result);
611
+ expect(state.text).toBe(largeText);
612
+ });
613
+ it('insert: should clean up pastedContent when placeholder is deleted', () => {
614
+ const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
615
+ const largeText = '1\n2\n3\n4\n5\n6';
616
+ act(() => result.current.insert(largeText, { paste: true }));
617
+ expect(result.current.pastedContent['[Pasted Text: 6 lines]']).toBe(largeText);
618
+ // Delete the placeholder using setText
619
+ act(() => result.current.setText(''));
620
+ expect(Object.keys(result.current.pastedContent)).toHaveLength(0);
621
+ });
622
+ it('insert: should clean up pastedContent when placeholder is removed via atomic backspace', () => {
623
+ const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
624
+ const largeText = '1\n2\n3\n4\n5\n6';
625
+ act(() => result.current.insert(largeText, { paste: true }));
626
+ expect(result.current.pastedContent['[Pasted Text: 6 lines]']).toBe(largeText);
627
+ // Single backspace at end of placeholder removes entire placeholder
628
+ act(() => {
629
+ result.current.backspace();
630
+ });
631
+ expect(getBufferState(result).text).toBe('');
632
+ // pastedContent is cleaned up when placeholder is deleted atomically
633
+ expect(Object.keys(result.current.pastedContent)).toHaveLength(0);
634
+ });
451
635
  it('newline: should create a new line and move cursor', () => {
452
636
  const { result } = renderHook(() => useTextBuffer({
453
637
  initialText: 'ab',
@@ -849,17 +1033,19 @@ describe('useTextBuffer', () => {
849
1033
  const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
850
1034
  act(() => result.current.handleInput({
851
1035
  name: 'h',
852
- ctrl: false,
853
- meta: false,
854
1036
  shift: false,
1037
+ alt: false,
1038
+ ctrl: false,
1039
+ cmd: false,
855
1040
  insertable: true,
856
1041
  sequence: 'h',
857
1042
  }));
858
1043
  act(() => result.current.handleInput({
859
1044
  name: 'i',
860
- ctrl: false,
861
- meta: false,
862
1045
  shift: false,
1046
+ alt: false,
1047
+ ctrl: false,
1048
+ cmd: false,
863
1049
  insertable: true,
864
1050
  sequence: 'i',
865
1051
  }));
@@ -869,9 +1055,10 @@ describe('useTextBuffer', () => {
869
1055
  const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
870
1056
  act(() => result.current.handleInput({
871
1057
  name: 'return',
872
- ctrl: false,
873
- meta: false,
874
1058
  shift: false,
1059
+ alt: false,
1060
+ ctrl: false,
1061
+ cmd: false,
875
1062
  insertable: true,
876
1063
  sequence: '\r',
877
1064
  }));
@@ -881,9 +1068,10 @@ describe('useTextBuffer', () => {
881
1068
  const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
882
1069
  act(() => result.current.handleInput({
883
1070
  name: 'j',
884
- ctrl: true,
885
- meta: false,
886
1071
  shift: false,
1072
+ alt: false,
1073
+ ctrl: true,
1074
+ cmd: false,
887
1075
  insertable: false,
888
1076
  sequence: '\n',
889
1077
  }));
@@ -893,9 +1081,10 @@ describe('useTextBuffer', () => {
893
1081
  const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
894
1082
  act(() => result.current.handleInput({
895
1083
  name: 'tab',
896
- ctrl: false,
897
- meta: false,
898
1084
  shift: false,
1085
+ alt: false,
1086
+ ctrl: false,
1087
+ cmd: false,
899
1088
  insertable: false,
900
1089
  sequence: '\t',
901
1090
  }));
@@ -905,9 +1094,10 @@ describe('useTextBuffer', () => {
905
1094
  const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
906
1095
  act(() => result.current.handleInput({
907
1096
  name: 'tab',
908
- ctrl: false,
909
- meta: false,
910
1097
  shift: true,
1098
+ alt: false,
1099
+ ctrl: false,
1100
+ cmd: false,
911
1101
  insertable: false,
912
1102
  sequence: '\u001b[9;2u',
913
1103
  }));
@@ -922,9 +1112,10 @@ describe('useTextBuffer', () => {
922
1112
  act(() => result.current.move('end'));
923
1113
  act(() => result.current.handleInput({
924
1114
  name: 'backspace',
925
- ctrl: false,
926
- meta: false,
927
1115
  shift: false,
1116
+ alt: false,
1117
+ ctrl: false,
1118
+ cmd: false,
928
1119
  insertable: false,
929
1120
  sequence: '\x7f',
930
1121
  }));
@@ -941,25 +1132,28 @@ describe('useTextBuffer', () => {
941
1132
  act(() => {
942
1133
  result.current.handleInput({
943
1134
  name: 'backspace',
944
- ctrl: false,
945
- meta: false,
946
1135
  shift: false,
1136
+ alt: false,
1137
+ ctrl: false,
1138
+ cmd: false,
947
1139
  insertable: false,
948
1140
  sequence: '\x7f',
949
1141
  });
950
1142
  result.current.handleInput({
951
1143
  name: 'backspace',
952
- ctrl: false,
953
- meta: false,
954
1144
  shift: false,
1145
+ alt: false,
1146
+ ctrl: false,
1147
+ cmd: false,
955
1148
  insertable: false,
956
1149
  sequence: '\x7f',
957
1150
  });
958
1151
  result.current.handleInput({
959
1152
  name: 'backspace',
960
- ctrl: false,
961
- meta: false,
962
1153
  shift: false,
1154
+ alt: false,
1155
+ ctrl: false,
1156
+ cmd: false,
963
1157
  insertable: false,
964
1158
  sequence: '\x7f',
965
1159
  });
@@ -1004,21 +1198,23 @@ describe('useTextBuffer', () => {
1004
1198
  act(() => result.current.move('end')); // cursor [0,2]
1005
1199
  act(() => result.current.handleInput({
1006
1200
  name: 'left',
1007
- ctrl: false,
1008
- meta: false,
1009
1201
  shift: false,
1202
+ alt: false,
1203
+ ctrl: false,
1204
+ cmd: false,
1010
1205
  insertable: false,
1011
1206
  sequence: '\x1b[D',
1012
- })); // cursor [0,1]
1207
+ }));
1013
1208
  expect(getBufferState(result).cursor).toEqual([0, 1]);
1014
1209
  act(() => result.current.handleInput({
1015
1210
  name: 'right',
1016
- ctrl: false,
1017
- meta: false,
1018
1211
  shift: false,
1212
+ alt: false,
1213
+ ctrl: false,
1214
+ cmd: false,
1019
1215
  insertable: false,
1020
1216
  sequence: '\x1b[C',
1021
- })); // cursor [0,2]
1217
+ }));
1022
1218
  expect(getBufferState(result).cursor).toEqual([0, 2]);
1023
1219
  });
1024
1220
  it('should strip ANSI escape codes when pasting text', () => {
@@ -1027,9 +1223,10 @@ describe('useTextBuffer', () => {
1027
1223
  // Simulate pasting by calling handleInput with a string longer than 1 char
1028
1224
  act(() => result.current.handleInput({
1029
1225
  name: '',
1030
- ctrl: false,
1031
- meta: false,
1032
1226
  shift: false,
1227
+ alt: false,
1228
+ ctrl: false,
1229
+ cmd: false,
1033
1230
  insertable: true,
1034
1231
  sequence: textWithAnsi,
1035
1232
  }));
@@ -1039,9 +1236,10 @@ describe('useTextBuffer', () => {
1039
1236
  const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
1040
1237
  act(() => result.current.handleInput({
1041
1238
  name: 'return',
1042
- ctrl: false,
1043
- meta: false,
1044
1239
  shift: true,
1240
+ alt: false,
1241
+ ctrl: false,
1242
+ cmd: false,
1045
1243
  insertable: true,
1046
1244
  sequence: '\r',
1047
1245
  })); // Simulates Shift+Enter in VSCode terminal
@@ -1064,8 +1262,14 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1064
1262
  result.current.insert(longText, { paste: true });
1065
1263
  });
1066
1264
  const state = getBufferState(result);
1067
- // Check that the text is the result of three concatenations.
1068
- expect(state.lines).toStrictEqual((longText + longText + longText).split('\n'));
1265
+ // Check that the text is the result of three concatenations of unique placeholders.
1266
+ // Now that ID generation is in the reducer, they are correctly unique even when batched.
1267
+ expect(state.lines).toStrictEqual([
1268
+ '[Pasted Text: 8 lines][Pasted Text: 8 lines #2][Pasted Text: 8 lines #3]',
1269
+ ]);
1270
+ expect(result.current.pastedContent['[Pasted Text: 8 lines]']).toBe(longText);
1271
+ expect(result.current.pastedContent['[Pasted Text: 8 lines #2]']).toBe(longText);
1272
+ expect(result.current.pastedContent['[Pasted Text: 8 lines #3]']).toBe(longText);
1069
1273
  const expectedCursorPos = offsetToLogicalPos(state.text, state.text.length);
1070
1274
  expect(state.cursor).toEqual(expectedCursorPos);
1071
1275
  });
@@ -1198,9 +1402,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1198
1402
  describe('Input Sanitization', () => {
1199
1403
  const createInput = (sequence) => ({
1200
1404
  name: '',
1201
- ctrl: false,
1202
- meta: false,
1203
1405
  shift: false,
1406
+ alt: false,
1407
+ ctrl: false,
1408
+ cmd: false,
1204
1409
  insertable: true,
1205
1410
  sequence,
1206
1411
  });
@@ -1243,9 +1448,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1243
1448
  expect(largeTextWithUnsafe.length).toBeGreaterThan(5000);
1244
1449
  act(() => result.current.handleInput({
1245
1450
  name: '',
1246
- ctrl: false,
1247
- meta: false,
1248
1451
  shift: false,
1452
+ alt: false,
1453
+ ctrl: false,
1454
+ cmd: false,
1249
1455
  insertable: true,
1250
1456
  sequence: largeTextWithUnsafe,
1251
1457
  }));
@@ -1268,9 +1474,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1268
1474
  expect(largeTextWithAnsi.length).toBeGreaterThan(5000);
1269
1475
  act(() => result.current.handleInput({
1270
1476
  name: '',
1271
- ctrl: false,
1272
- meta: false,
1273
1477
  shift: false,
1478
+ alt: false,
1479
+ ctrl: false,
1480
+ cmd: false,
1274
1481
  insertable: true,
1275
1482
  sequence: largeTextWithAnsi,
1276
1483
  }));
@@ -1286,9 +1493,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1286
1493
  const emojis = '🐍🐳🦀🦄';
1287
1494
  act(() => result.current.handleInput({
1288
1495
  name: '',
1289
- ctrl: false,
1290
- meta: false,
1291
1496
  shift: false,
1497
+ alt: false,
1498
+ ctrl: false,
1499
+ cmd: false,
1292
1500
  insertable: true,
1293
1501
  sequence: emojis,
1294
1502
  }));
@@ -1429,9 +1637,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1429
1637
  }));
1430
1638
  act(() => result.current.handleInput({
1431
1639
  name: 'return',
1432
- ctrl: false,
1433
- meta: false,
1434
1640
  shift: false,
1641
+ alt: false,
1642
+ ctrl: false,
1643
+ cmd: false,
1435
1644
  insertable: true,
1436
1645
  sequence: '\r',
1437
1646
  }));
@@ -1445,9 +1654,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
1445
1654
  }));
1446
1655
  act(() => result.current.handleInput({
1447
1656
  name: 'f1',
1448
- ctrl: false,
1449
- meta: false,
1450
1657
  shift: false,
1658
+ alt: false,
1659
+ ctrl: false,
1660
+ cmd: false,
1451
1661
  insertable: false,
1452
1662
  sequence: '\u001bOP',
1453
1663
  }));
@@ -1994,12 +2204,14 @@ describe('Transformation Utilities', () => {
1994
2204
  logEnd: 14,
1995
2205
  logicalText: '@test.png',
1996
2206
  collapsedText: '[Image @test.png]',
2207
+ type: 'image',
1997
2208
  },
1998
2209
  {
1999
2210
  logStart: 20,
2000
2211
  logEnd: 31,
2001
2212
  logicalText: '@another.jpg',
2002
2213
  collapsedText: '[Image @another.jpg]',
2214
+ type: 'image',
2003
2215
  },
2004
2216
  ];
2005
2217
  it('should find transformation when cursor is inside it', () => {