@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
@@ -16,6 +16,10 @@ import { parsePastedPaths } from '../../utils/clipboardUtils.js';
16
16
  import { keyMatchers, Command } from '../../keyMatchers.js';
17
17
  import { handleVimAction } from './vim-buffer-actions.js';
18
18
  import { LRU_BUFFER_PERF_CACHE_LIMIT } from '../../constants.js';
19
+ const LARGE_PASTE_LINE_THRESHOLD = 5;
20
+ const LARGE_PASTE_CHAR_THRESHOLD = 500;
21
+ // Regex to match paste placeholders like [Pasted Text: 6 lines] or [Pasted Text: 501 chars #2]
22
+ export const PASTED_TEXT_PLACEHOLDER_REGEX = /\[Pasted Text: \d+ (?:lines|chars)(?: #\d+)?\]/g;
19
23
  // Helper functions for line-based word navigation
20
24
  export const isWordCharStrict = (char) => /[\w\p{L}\p{N}]/u.test(char); // Matches a single character that is any Unicode letter, any Unicode number, or an underscore
21
25
  export const isWhitespace = (char) => /\s/.test(char);
@@ -513,9 +517,9 @@ export function calculateTransformationsForLine(line) {
513
517
  return cached;
514
518
  }
515
519
  const transformations = [];
516
- let match;
517
- // Reset regex state to ensure clean matching from start of line
520
+ // 1. Detect image paths
518
521
  imagePathRegex.lastIndex = 0;
522
+ let match;
519
523
  while ((match = imagePathRegex.exec(line)) !== null) {
520
524
  const logicalText = match[0];
521
525
  const logStart = cpLen(line.substring(0, match.index));
@@ -525,8 +529,26 @@ export function calculateTransformationsForLine(line) {
525
529
  logEnd,
526
530
  logicalText,
527
531
  collapsedText: getTransformedImagePath(logicalText),
532
+ type: 'image',
533
+ });
534
+ }
535
+ // 2. Detect paste placeholders
536
+ const pasteRegex = new RegExp(PASTED_TEXT_PLACEHOLDER_REGEX.source, 'g');
537
+ while ((match = pasteRegex.exec(line)) !== null) {
538
+ const logicalText = match[0];
539
+ const logStart = cpLen(line.substring(0, match.index));
540
+ const logEnd = logStart + cpLen(logicalText);
541
+ transformations.push({
542
+ logStart,
543
+ logEnd,
544
+ logicalText,
545
+ collapsedText: logicalText,
546
+ type: 'paste',
547
+ id: logicalText,
528
548
  });
529
549
  }
550
+ // Sort transformations by logStart to maintain consistency
551
+ transformations.sort((a, b) => a.logStart - b.logStart);
530
552
  transformationsCache.set(line, transformations);
531
553
  return transformations;
532
554
  }
@@ -546,6 +568,39 @@ export function getTransformUnderCursor(row, col, spansByLine) {
546
568
  }
547
569
  return null;
548
570
  }
571
+ /**
572
+ * Find atomic placeholder at cursor for backspace (cursor at end).
573
+ * Checks all placeholder types in priority order.
574
+ */
575
+ function findAtomicPlaceholderForBackspace(line, cursorCol, transformations) {
576
+ for (const transform of transformations) {
577
+ if (cursorCol === transform.logEnd) {
578
+ return {
579
+ start: transform.logStart,
580
+ end: transform.logEnd,
581
+ type: transform.type,
582
+ id: transform.id,
583
+ };
584
+ }
585
+ }
586
+ return null;
587
+ }
588
+ /**
589
+ * Find atomic placeholder at cursor for delete (cursor at start).
590
+ */
591
+ function findAtomicPlaceholderForDelete(line, cursorCol, transformations) {
592
+ for (const transform of transformations) {
593
+ if (cursorCol === transform.logStart) {
594
+ return {
595
+ start: transform.logStart,
596
+ end: transform.logEnd,
597
+ type: transform.type,
598
+ id: transform.id,
599
+ };
600
+ }
601
+ }
602
+ return null;
603
+ }
549
604
  export function calculateTransformedLine(logLine, logIndex, logicalCursor, transformations) {
550
605
  let transformedLine = '';
551
606
  const transformedToLogMap = [];
@@ -558,7 +613,8 @@ export function calculateTransformedLine(logLine, logIndex, logicalCursor, trans
558
613
  for (let i = 0; i < cpLen(textBeforeTransformation); i++) {
559
614
  transformedToLogMap.push(lastLogPos + i);
560
615
  }
561
- const isExpanded = cursorIsOnThisLine &&
616
+ const isExpanded = transform.type === 'image' &&
617
+ cursorIsOnThisLine &&
562
618
  cursorCol >= transform.logStart &&
563
619
  cursorCol <= transform.logEnd;
564
620
  const transformedText = isExpanded
@@ -817,6 +873,7 @@ export const pushUndo = (currentState) => {
817
873
  lines: [...currentState.lines],
818
874
  cursorRow: currentState.cursorRow,
819
875
  cursorCol: currentState.cursorCol,
876
+ pastedContent: { ...currentState.pastedContent },
820
877
  };
821
878
  const newStack = [...currentState.undoStack, snapshot];
822
879
  if (newStack.length > historyLimit) {
@@ -824,6 +881,18 @@ export const pushUndo = (currentState) => {
824
881
  }
825
882
  return { ...currentState, undoStack: newStack, redoStack: [] };
826
883
  };
884
+ function generatePastedTextId(content, lineCount, pastedContent) {
885
+ const base = lineCount > LARGE_PASTE_LINE_THRESHOLD
886
+ ? `[Pasted Text: ${lineCount} lines]`
887
+ : `[Pasted Text: ${content.length} chars]`;
888
+ let id = base;
889
+ let suffix = 2;
890
+ while (pastedContent[id]) {
891
+ id = base.replace(']', ` #${suffix}]`);
892
+ suffix++;
893
+ }
894
+ return id;
895
+ }
827
896
  function textBufferReducerLogic(state, action, options = {}) {
828
897
  const pushUndoLocal = pushUndo;
829
898
  const currentLine = (r) => state.lines[r] ?? '';
@@ -845,6 +914,7 @@ function textBufferReducerLogic(state, action, options = {}) {
845
914
  cursorRow: lastNewLineIndex,
846
915
  cursorCol: cpLen(lines[lastNewLineIndex] ?? ''),
847
916
  preferredCol: null,
917
+ pastedContent: action.payload === '' ? {} : nextState.pastedContent,
848
918
  };
849
919
  }
850
920
  case 'insert': {
@@ -854,6 +924,21 @@ function textBufferReducerLogic(state, action, options = {}) {
854
924
  let newCursorCol = nextState.cursorCol;
855
925
  const currentLine = (r) => newLines[r] ?? '';
856
926
  let payload = action.payload;
927
+ let newPastedContent = nextState.pastedContent;
928
+ if (action.isPaste) {
929
+ // Normalize line endings for pastes
930
+ payload = payload.replace(/\r\n|\r/g, '\n');
931
+ const lineCount = payload.split('\n').length;
932
+ if (lineCount > LARGE_PASTE_LINE_THRESHOLD ||
933
+ payload.length > LARGE_PASTE_CHAR_THRESHOLD) {
934
+ const id = generatePastedTextId(payload, lineCount, newPastedContent);
935
+ newPastedContent = {
936
+ ...newPastedContent,
937
+ [id]: payload,
938
+ };
939
+ payload = id;
940
+ }
941
+ }
857
942
  if (options.singleLine) {
858
943
  payload = payload.replace(/[\r\n]/g, '');
859
944
  }
@@ -887,16 +972,57 @@ function textBufferReducerLogic(state, action, options = {}) {
887
972
  cursorRow: newCursorRow,
888
973
  cursorCol: newCursorCol,
889
974
  preferredCol: null,
975
+ pastedContent: newPastedContent,
976
+ };
977
+ }
978
+ case 'add_pasted_content': {
979
+ const { id, text } = action.payload;
980
+ return {
981
+ ...state,
982
+ pastedContent: {
983
+ ...state.pastedContent,
984
+ [id]: text,
985
+ },
890
986
  };
891
987
  }
892
988
  case 'backspace': {
989
+ const { cursorRow, cursorCol, lines, transformationsByLine } = state;
990
+ // Early return if at start of buffer
991
+ if (cursorCol === 0 && cursorRow === 0)
992
+ return state;
993
+ // Check if cursor is at end of an atomic placeholder
994
+ const transformations = transformationsByLine[cursorRow] ?? [];
995
+ const placeholder = findAtomicPlaceholderForBackspace(lines[cursorRow], cursorCol, transformations);
996
+ if (placeholder) {
997
+ const nextState = pushUndoLocal(state);
998
+ const newLines = [...nextState.lines];
999
+ newLines[cursorRow] =
1000
+ cpSlice(newLines[cursorRow], 0, placeholder.start) +
1001
+ cpSlice(newLines[cursorRow], placeholder.end);
1002
+ // Recalculate transformations for the modified line
1003
+ const newTransformations = [...nextState.transformationsByLine];
1004
+ newTransformations[cursorRow] = calculateTransformationsForLine(newLines[cursorRow]);
1005
+ // Clean up pastedContent if this was a paste placeholder
1006
+ let newPastedContent = nextState.pastedContent;
1007
+ if (placeholder.type === 'paste' && placeholder.id) {
1008
+ const { [placeholder.id]: _, ...remaining } = nextState.pastedContent;
1009
+ newPastedContent = remaining;
1010
+ }
1011
+ return {
1012
+ ...nextState,
1013
+ lines: newLines,
1014
+ cursorCol: placeholder.start,
1015
+ preferredCol: null,
1016
+ transformationsByLine: newTransformations,
1017
+ pastedContent: newPastedContent,
1018
+ };
1019
+ }
1020
+ // Standard backspace logic
893
1021
  const nextState = pushUndoLocal(state);
894
1022
  const newLines = [...nextState.lines];
895
1023
  let newCursorRow = nextState.cursorRow;
896
1024
  let newCursorCol = nextState.cursorCol;
897
1025
  const currentLine = (r) => newLines[r] ?? '';
898
- if (newCursorCol === 0 && newCursorRow === 0)
899
- return state;
900
1026
  if (newCursorCol > 0) {
901
1027
  const lineContent = currentLine(newCursorRow);
902
1028
  newLines[newCursorRow] =
@@ -1078,7 +1204,35 @@ function textBufferReducerLogic(state, action, options = {}) {
1078
1204
  };
1079
1205
  }
1080
1206
  case 'delete': {
1081
- const { cursorRow, cursorCol, lines } = state;
1207
+ const { cursorRow, cursorCol, lines, transformationsByLine } = state;
1208
+ // Check if cursor is at start of an atomic placeholder
1209
+ const transformations = transformationsByLine[cursorRow] ?? [];
1210
+ const placeholder = findAtomicPlaceholderForDelete(lines[cursorRow], cursorCol, transformations);
1211
+ if (placeholder) {
1212
+ const nextState = pushUndoLocal(state);
1213
+ const newLines = [...nextState.lines];
1214
+ newLines[cursorRow] =
1215
+ cpSlice(newLines[cursorRow], 0, placeholder.start) +
1216
+ cpSlice(newLines[cursorRow], placeholder.end);
1217
+ // Recalculate transformations for the modified line
1218
+ const newTransformations = [...nextState.transformationsByLine];
1219
+ newTransformations[cursorRow] = calculateTransformationsForLine(newLines[cursorRow]);
1220
+ // Clean up pastedContent if this was a paste placeholder
1221
+ let newPastedContent = nextState.pastedContent;
1222
+ if (placeholder.type === 'paste' && placeholder.id) {
1223
+ const { [placeholder.id]: _, ...remaining } = nextState.pastedContent;
1224
+ newPastedContent = remaining;
1225
+ }
1226
+ return {
1227
+ ...nextState,
1228
+ lines: newLines,
1229
+ // cursorCol stays the same
1230
+ preferredCol: null,
1231
+ transformationsByLine: newTransformations,
1232
+ pastedContent: newPastedContent,
1233
+ };
1234
+ }
1235
+ // Standard delete logic
1082
1236
  const lineContent = currentLine(cursorRow);
1083
1237
  if (cursorCol < currentLineLen(cursorRow)) {
1084
1238
  const nextState = pushUndoLocal(state);
@@ -1218,6 +1372,7 @@ function textBufferReducerLogic(state, action, options = {}) {
1218
1372
  lines: [...state.lines],
1219
1373
  cursorRow: state.cursorRow,
1220
1374
  cursorCol: state.cursorCol,
1375
+ pastedContent: { ...state.pastedContent },
1221
1376
  };
1222
1377
  return {
1223
1378
  ...state,
@@ -1234,6 +1389,7 @@ function textBufferReducerLogic(state, action, options = {}) {
1234
1389
  lines: [...state.lines],
1235
1390
  cursorRow: state.cursorRow,
1236
1391
  cursorCol: state.cursorCol,
1392
+ pastedContent: { ...state.pastedContent },
1237
1393
  };
1238
1394
  return {
1239
1395
  ...state,
@@ -1349,10 +1505,11 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
1349
1505
  viewportWidth: viewport.width,
1350
1506
  viewportHeight: viewport.height,
1351
1507
  visualLayout,
1508
+ pastedContent: {},
1352
1509
  };
1353
1510
  }, [initialText, initialCursorOffset, viewport.width, viewport.height]);
1354
1511
  const [state, dispatch] = useReducer((s, a) => textBufferReducer(s, a, { inputFilter, singleLine }), initialState);
1355
- const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, transformationsByLine, } = state;
1512
+ const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, transformationsByLine, pastedContent, } = state;
1356
1513
  const text = useMemo(() => lines.join('\n'), [lines]);
1357
1514
  const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
1358
1515
  const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
@@ -1388,10 +1545,10 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
1388
1545
  }
1389
1546
  }, [visualCursor, visualScrollRow, viewport, visualLines.length]);
1390
1547
  const insert = useCallback((ch, { paste = false } = {}) => {
1391
- if (!singleLine && /[\n\r]/.test(ch)) {
1392
- dispatch({ type: 'insert', payload: ch });
1548
+ if (typeof ch !== 'string') {
1393
1549
  return;
1394
1550
  }
1551
+ let textToInsert = ch;
1395
1552
  const minLengthToInferAsDragDrop = 3;
1396
1553
  if (ch.length >= minLengthToInferAsDragDrop &&
1397
1554
  !shellModeActive &&
@@ -1404,14 +1561,14 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
1404
1561
  potentialPath = potentialPath.trim();
1405
1562
  const processed = parsePastedPaths(potentialPath, isValidPath);
1406
1563
  if (processed) {
1407
- ch = processed;
1564
+ textToInsert = processed;
1408
1565
  }
1409
1566
  }
1410
1567
  let currentText = '';
1411
- for (const char of toCodePoints(ch)) {
1568
+ for (const char of toCodePoints(textToInsert)) {
1412
1569
  if (char.codePointAt(0) === 127) {
1413
1570
  if (currentText.length > 0) {
1414
- dispatch({ type: 'insert', payload: currentText });
1571
+ dispatch({ type: 'insert', payload: currentText, isPaste: paste });
1415
1572
  currentText = '';
1416
1573
  }
1417
1574
  dispatch({ type: 'backspace' });
@@ -1421,9 +1578,9 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
1421
1578
  }
1422
1579
  }
1423
1580
  if (currentText.length > 0) {
1424
- dispatch({ type: 'insert', payload: currentText });
1581
+ dispatch({ type: 'insert', payload: currentText, isPaste: paste });
1425
1582
  }
1426
- }, [isValidPath, shellModeActive, singleLine]);
1583
+ }, [isValidPath, shellModeActive]);
1427
1584
  const newline = useCallback(() => {
1428
1585
  if (singleLine) {
1429
1586
  return;
@@ -1727,6 +1884,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
1727
1884
  cursor: [cursorRow, cursorCol],
1728
1885
  preferredCol,
1729
1886
  selectionAnchor,
1887
+ pastedContent,
1730
1888
  allVisualLines: visualLines,
1731
1889
  viewportVisualLines: renderedVisualLines,
1732
1890
  visualCursor,
@@ -1795,6 +1953,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
1795
1953
  cursorCol,
1796
1954
  preferredCol,
1797
1955
  selectionAnchor,
1956
+ pastedContent,
1798
1957
  visualLines,
1799
1958
  renderedVisualLines,
1800
1959
  visualCursor,