@didim365/agent-cli 0.1.1 → 0.1.2

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 (1034) hide show
  1. package/package.json +6 -3
  2. package/dist/src/commands/extensions/configure.test.d.ts +0 -1
  3. package/dist/src/commands/extensions/configure.test.js +0 -197
  4. package/dist/src/commands/extensions/configure.test.js.map +0 -1
  5. package/dist/src/commands/extensions/disable.test.d.ts +0 -6
  6. package/dist/src/commands/extensions/disable.test.js +0 -169
  7. package/dist/src/commands/extensions/disable.test.js.map +0 -1
  8. package/dist/src/commands/extensions/enable.test.d.ts +0 -6
  9. package/dist/src/commands/extensions/enable.test.js +0 -199
  10. package/dist/src/commands/extensions/enable.test.js.map +0 -1
  11. package/dist/src/commands/extensions/install.test.d.ts +0 -6
  12. package/dist/src/commands/extensions/install.test.js +0 -140
  13. package/dist/src/commands/extensions/install.test.js.map +0 -1
  14. package/dist/src/commands/extensions/link.test.d.ts +0 -6
  15. package/dist/src/commands/extensions/link.test.js +0 -137
  16. package/dist/src/commands/extensions/link.test.js.map +0 -1
  17. package/dist/src/commands/extensions/list.test.d.ts +0 -6
  18. package/dist/src/commands/extensions/list.test.js +0 -148
  19. package/dist/src/commands/extensions/list.test.js.map +0 -1
  20. package/dist/src/commands/extensions/new.test.d.ts +0 -6
  21. package/dist/src/commands/extensions/new.test.js +0 -62
  22. package/dist/src/commands/extensions/new.test.js.map +0 -1
  23. package/dist/src/commands/extensions/uninstall.test.d.ts +0 -6
  24. package/dist/src/commands/extensions/uninstall.test.js +0 -199
  25. package/dist/src/commands/extensions/uninstall.test.js.map +0 -1
  26. package/dist/src/commands/extensions/update.test.d.ts +0 -6
  27. package/dist/src/commands/extensions/update.test.js +0 -170
  28. package/dist/src/commands/extensions/update.test.js.map +0 -1
  29. package/dist/src/commands/extensions/validate.test.d.ts +0 -6
  30. package/dist/src/commands/extensions/validate.test.js +0 -96
  31. package/dist/src/commands/extensions/validate.test.js.map +0 -1
  32. package/dist/src/commands/extensions.test.d.ts +0 -6
  33. package/dist/src/commands/extensions.test.js +0 -67
  34. package/dist/src/commands/extensions.test.js.map +0 -1
  35. package/dist/src/commands/hooks/migrate.test.d.ts +0 -6
  36. package/dist/src/commands/hooks/migrate.test.js +0 -388
  37. package/dist/src/commands/hooks/migrate.test.js.map +0 -1
  38. package/dist/src/commands/mcp/add.test.d.ts +0 -6
  39. package/dist/src/commands/mcp/add.test.js +0 -274
  40. package/dist/src/commands/mcp/add.test.js.map +0 -1
  41. package/dist/src/commands/mcp/list.test.d.ts +0 -6
  42. package/dist/src/commands/mcp/list.test.js +0 -150
  43. package/dist/src/commands/mcp/list.test.js.map +0 -1
  44. package/dist/src/commands/mcp/remove.test.d.ts +0 -6
  45. package/dist/src/commands/mcp/remove.test.js +0 -189
  46. package/dist/src/commands/mcp/remove.test.js.map +0 -1
  47. package/dist/src/commands/mcp.test.d.ts +0 -6
  48. package/dist/src/commands/mcp.test.js +0 -65
  49. package/dist/src/commands/mcp.test.js.map +0 -1
  50. package/dist/src/commands/skills/disable.test.d.ts +0 -6
  51. package/dist/src/commands/skills/disable.test.js +0 -96
  52. package/dist/src/commands/skills/disable.test.js.map +0 -1
  53. package/dist/src/commands/skills/enable.test.d.ts +0 -6
  54. package/dist/src/commands/skills/enable.test.js +0 -107
  55. package/dist/src/commands/skills/enable.test.js.map +0 -1
  56. package/dist/src/commands/skills/install.test.d.ts +0 -6
  57. package/dist/src/commands/skills/install.test.js +0 -95
  58. package/dist/src/commands/skills/install.test.js.map +0 -1
  59. package/dist/src/commands/skills/list.test.d.ts +0 -6
  60. package/dist/src/commands/skills/list.test.js +0 -136
  61. package/dist/src/commands/skills/list.test.js.map +0 -1
  62. package/dist/src/commands/skills/uninstall.test.d.ts +0 -6
  63. package/dist/src/commands/skills/uninstall.test.js +0 -61
  64. package/dist/src/commands/skills/uninstall.test.js.map +0 -1
  65. package/dist/src/commands/skills.test.d.ts +0 -6
  66. package/dist/src/commands/skills.test.js +0 -49
  67. package/dist/src/commands/skills.test.js.map +0 -1
  68. package/dist/src/commands/utils.test.d.ts +0 -6
  69. package/dist/src/commands/utils.test.js +0 -35
  70. package/dist/src/commands/utils.test.js.map +0 -1
  71. package/dist/src/config/auth.test.d.ts +0 -6
  72. package/dist/src/config/auth.test.js +0 -89
  73. package/dist/src/config/auth.test.js.map +0 -1
  74. package/dist/src/config/config.integration.test.d.ts +0 -6
  75. package/dist/src/config/config.integration.test.js +0 -205
  76. package/dist/src/config/config.integration.test.js.map +0 -1
  77. package/dist/src/config/config.test.d.ts +0 -6
  78. package/dist/src/config/config.test.js +0 -2413
  79. package/dist/src/config/config.test.js.map +0 -1
  80. package/dist/src/config/extension-manager-agents.test.d.ts +0 -6
  81. package/dist/src/config/extension-manager-agents.test.js +0 -114
  82. package/dist/src/config/extension-manager-agents.test.js.map +0 -1
  83. package/dist/src/config/extension-manager-scope.test.d.ts +0 -6
  84. package/dist/src/config/extension-manager-scope.test.js +0 -153
  85. package/dist/src/config/extension-manager-scope.test.js.map +0 -1
  86. package/dist/src/config/extension-manager-skills.test.d.ts +0 -6
  87. package/dist/src/config/extension-manager-skills.test.js +0 -148
  88. package/dist/src/config/extension-manager-skills.test.js.map +0 -1
  89. package/dist/src/config/extension.test.d.ts +0 -6
  90. package/dist/src/config/extension.test.js +0 -1671
  91. package/dist/src/config/extension.test.js.map +0 -1
  92. package/dist/src/config/extensions/consent.test.d.ts +0 -6
  93. package/dist/src/config/extensions/consent.test.js +0 -280
  94. package/dist/src/config/extensions/consent.test.js.map +0 -1
  95. package/dist/src/config/extensions/extensionEnablement.test.d.ts +0 -6
  96. package/dist/src/config/extensions/extensionEnablement.test.js +0 -404
  97. package/dist/src/config/extensions/extensionEnablement.test.js.map +0 -1
  98. package/dist/src/config/extensions/extensionSettings.test.d.ts +0 -6
  99. package/dist/src/config/extensions/extensionSettings.test.js +0 -493
  100. package/dist/src/config/extensions/extensionSettings.test.js.map +0 -1
  101. package/dist/src/config/extensions/extensionUpdates.test.d.ts +0 -6
  102. package/dist/src/config/extensions/extensionUpdates.test.js +0 -230
  103. package/dist/src/config/extensions/extensionUpdates.test.js.map +0 -1
  104. package/dist/src/config/extensions/github.test.d.ts +0 -6
  105. package/dist/src/config/extensions/github.test.js +0 -441
  106. package/dist/src/config/extensions/github.test.js.map +0 -1
  107. package/dist/src/config/extensions/github_fetch.test.d.ts +0 -6
  108. package/dist/src/config/extensions/github_fetch.test.js +0 -169
  109. package/dist/src/config/extensions/github_fetch.test.js.map +0 -1
  110. package/dist/src/config/extensions/storage.test.d.ts +0 -6
  111. package/dist/src/config/extensions/storage.test.js +0 -64
  112. package/dist/src/config/extensions/storage.test.js.map +0 -1
  113. package/dist/src/config/extensions/update.test.d.ts +0 -6
  114. package/dist/src/config/extensions/update.test.js +0 -231
  115. package/dist/src/config/extensions/update.test.js.map +0 -1
  116. package/dist/src/config/extensions/variables.test.d.ts +0 -6
  117. package/dist/src/config/extensions/variables.test.js +0 -103
  118. package/dist/src/config/extensions/variables.test.js.map +0 -1
  119. package/dist/src/config/keyBindings.test.d.ts +0 -6
  120. package/dist/src/config/keyBindings.test.js +0 -108
  121. package/dist/src/config/keyBindings.test.js.map +0 -1
  122. package/dist/src/config/mcp/mcpServerEnablement.test.d.ts +0 -6
  123. package/dist/src/config/mcp/mcpServerEnablement.test.js +0 -147
  124. package/dist/src/config/mcp/mcpServerEnablement.test.js.map +0 -1
  125. package/dist/src/config/policy-engine.integration.test.d.ts +0 -6
  126. package/dist/src/config/policy-engine.integration.test.js +0 -353
  127. package/dist/src/config/policy-engine.integration.test.js.map +0 -1
  128. package/dist/src/config/sandboxConfig.test.d.ts +0 -6
  129. package/dist/src/config/sandboxConfig.test.js +0 -184
  130. package/dist/src/config/sandboxConfig.test.js.map +0 -1
  131. package/dist/src/config/settingPaths.test.d.ts +0 -6
  132. package/dist/src/config/settingPaths.test.js +0 -22
  133. package/dist/src/config/settingPaths.test.js.map +0 -1
  134. package/dist/src/config/settings-validation.test.d.ts +0 -6
  135. package/dist/src/config/settings-validation.test.js +0 -370
  136. package/dist/src/config/settings-validation.test.js.map +0 -1
  137. package/dist/src/config/settings.test.d.ts +0 -6
  138. package/dist/src/config/settings.test.js +0 -1822
  139. package/dist/src/config/settings.test.js.map +0 -1
  140. package/dist/src/config/settingsSchema.test.d.ts +0 -6
  141. package/dist/src/config/settingsSchema.test.js +0 -309
  142. package/dist/src/config/settingsSchema.test.js.map +0 -1
  143. package/dist/src/config/settings_repro.test.d.ts +0 -6
  144. package/dist/src/config/settings_repro.test.js +0 -166
  145. package/dist/src/config/settings_repro.test.js.map +0 -1
  146. package/dist/src/config/settings_validation_warning.test.d.ts +0 -6
  147. package/dist/src/config/settings_validation_warning.test.js +0 -123
  148. package/dist/src/config/settings_validation_warning.test.js.map +0 -1
  149. package/dist/src/config/skills-backward-compatibility.test.d.ts +0 -6
  150. package/dist/src/config/skills-backward-compatibility.test.js +0 -99
  151. package/dist/src/config/skills-backward-compatibility.test.js.map +0 -1
  152. package/dist/src/config/trustedFolders.test.d.ts +0 -6
  153. package/dist/src/config/trustedFolders.test.js +0 -385
  154. package/dist/src/config/trustedFolders.test.js.map +0 -1
  155. package/dist/src/core/auth.test.d.ts +0 -6
  156. package/dist/src/core/auth.test.js +0 -47
  157. package/dist/src/core/auth.test.js.map +0 -1
  158. package/dist/src/core/initializer.test.d.ts +0 -6
  159. package/dist/src/core/initializer.test.js +0 -101
  160. package/dist/src/core/initializer.test.js.map +0 -1
  161. package/dist/src/core/theme.test.d.ts +0 -6
  162. package/dist/src/core/theme.test.js +0 -46
  163. package/dist/src/core/theme.test.js.map +0 -1
  164. package/dist/src/deferred.test.d.ts +0 -6
  165. package/dist/src/deferred.test.js +0 -164
  166. package/dist/src/deferred.test.js.map +0 -1
  167. package/dist/src/gemini.test.d.ts +0 -6
  168. package/dist/src/gemini.test.js +0 -1334
  169. package/dist/src/gemini.test.js.map +0 -1
  170. package/dist/src/gemini_cleanup.test.d.ts +0 -6
  171. package/dist/src/gemini_cleanup.test.js +0 -208
  172. package/dist/src/gemini_cleanup.test.js.map +0 -1
  173. package/dist/src/nonInteractiveCli.test.d.ts +0 -6
  174. package/dist/src/nonInteractiveCli.test.js +0 -1687
  175. package/dist/src/nonInteractiveCli.test.js.map +0 -1
  176. package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
  177. package/dist/src/services/BuiltinCommandLoader.test.js +0 -254
  178. package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
  179. package/dist/src/services/CommandService.test.d.ts +0 -6
  180. package/dist/src/services/CommandService.test.js +0 -234
  181. package/dist/src/services/CommandService.test.js.map +0 -1
  182. package/dist/src/services/FileCommandLoader.test.d.ts +0 -6
  183. package/dist/src/services/FileCommandLoader.test.js +0 -1102
  184. package/dist/src/services/FileCommandLoader.test.js.map +0 -1
  185. package/dist/src/services/McpPromptLoader.test.d.ts +0 -6
  186. package/dist/src/services/McpPromptLoader.test.js +0 -411
  187. package/dist/src/services/McpPromptLoader.test.js.map +0 -1
  188. package/dist/src/services/prompt-processors/argumentProcessor.test.d.ts +0 -6
  189. package/dist/src/services/prompt-processors/argumentProcessor.test.js +0 -40
  190. package/dist/src/services/prompt-processors/argumentProcessor.test.js.map +0 -1
  191. package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +0 -6
  192. package/dist/src/services/prompt-processors/atFileProcessor.test.js +0 -174
  193. package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +0 -1
  194. package/dist/src/services/prompt-processors/injectionParser.test.d.ts +0 -6
  195. package/dist/src/services/prompt-processors/injectionParser.test.js +0 -189
  196. package/dist/src/services/prompt-processors/injectionParser.test.js.map +0 -1
  197. package/dist/src/services/prompt-processors/shellProcessor.test.d.ts +0 -6
  198. package/dist/src/services/prompt-processors/shellProcessor.test.js +0 -514
  199. package/dist/src/services/prompt-processors/shellProcessor.test.js.map +0 -1
  200. package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
  201. package/dist/src/test-utils/mockCommandContext.test.js +0 -51
  202. package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
  203. package/dist/src/test-utils/render.test.d.ts +0 -6
  204. package/dist/src/test-utils/render.test.js +0 -79
  205. package/dist/src/test-utils/render.test.js.map +0 -1
  206. package/dist/src/ui/App.test.d.ts +0 -6
  207. package/dist/src/ui/App.test.js +0 -218
  208. package/dist/src/ui/App.test.js.map +0 -1
  209. package/dist/src/ui/AppContainer.test.d.ts +0 -6
  210. package/dist/src/ui/AppContainer.test.js +0 -2072
  211. package/dist/src/ui/AppContainer.test.js.map +0 -1
  212. package/dist/src/ui/IdeIntegrationNudge.test.d.ts +0 -6
  213. package/dist/src/ui/IdeIntegrationNudge.test.js +0 -158
  214. package/dist/src/ui/IdeIntegrationNudge.test.js.map +0 -1
  215. package/dist/src/ui/auth/ApiAuthDialog.test.d.ts +0 -6
  216. package/dist/src/ui/auth/ApiAuthDialog.test.js +0 -109
  217. package/dist/src/ui/auth/ApiAuthDialog.test.js.map +0 -1
  218. package/dist/src/ui/auth/AuthDialog.test.d.ts +0 -6
  219. package/dist/src/ui/auth/AuthDialog.test.js +0 -309
  220. package/dist/src/ui/auth/AuthDialog.test.js.map +0 -1
  221. package/dist/src/ui/auth/AuthInProgress.test.d.ts +0 -6
  222. package/dist/src/ui/auth/AuthInProgress.test.js +0 -81
  223. package/dist/src/ui/auth/AuthInProgress.test.js.map +0 -1
  224. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.d.ts +0 -6
  225. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +0 -66
  226. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +0 -1
  227. package/dist/src/ui/auth/useAuth.test.d.ts +0 -6
  228. package/dist/src/ui/auth/useAuth.test.js +0 -189
  229. package/dist/src/ui/auth/useAuth.test.js.map +0 -1
  230. package/dist/src/ui/commands/aboutCommand.test.d.ts +0 -6
  231. package/dist/src/ui/commands/aboutCommand.test.js +0 -143
  232. package/dist/src/ui/commands/aboutCommand.test.js.map +0 -1
  233. package/dist/src/ui/commands/agentsCommand.test.d.ts +0 -6
  234. package/dist/src/ui/commands/agentsCommand.test.js +0 -344
  235. package/dist/src/ui/commands/agentsCommand.test.js.map +0 -1
  236. package/dist/src/ui/commands/authCommand.test.d.ts +0 -6
  237. package/dist/src/ui/commands/authCommand.test.js +0 -98
  238. package/dist/src/ui/commands/authCommand.test.js.map +0 -1
  239. package/dist/src/ui/commands/bugCommand.test.d.ts +0 -6
  240. package/dist/src/ui/commands/bugCommand.test.js +0 -186
  241. package/dist/src/ui/commands/bugCommand.test.js.map +0 -1
  242. package/dist/src/ui/commands/chatCommand.test.d.ts +0 -6
  243. package/dist/src/ui/commands/chatCommand.test.js +0 -620
  244. package/dist/src/ui/commands/chatCommand.test.js.map +0 -1
  245. package/dist/src/ui/commands/clearCommand.test.d.ts +0 -6
  246. package/dist/src/ui/commands/clearCommand.test.js +0 -87
  247. package/dist/src/ui/commands/clearCommand.test.js.map +0 -1
  248. package/dist/src/ui/commands/compressCommand.test.d.ts +0 -6
  249. package/dist/src/ui/commands/compressCommand.test.js +0 -98
  250. package/dist/src/ui/commands/compressCommand.test.js.map +0 -1
  251. package/dist/src/ui/commands/copyCommand.test.d.ts +0 -6
  252. package/dist/src/ui/commands/copyCommand.test.js +0 -242
  253. package/dist/src/ui/commands/copyCommand.test.js.map +0 -1
  254. package/dist/src/ui/commands/corgiCommand.test.d.ts +0 -6
  255. package/dist/src/ui/commands/corgiCommand.test.js +0 -28
  256. package/dist/src/ui/commands/corgiCommand.test.js.map +0 -1
  257. package/dist/src/ui/commands/directoryCommand.test.d.ts +0 -6
  258. package/dist/src/ui/commands/directoryCommand.test.js +0 -353
  259. package/dist/src/ui/commands/directoryCommand.test.js.map +0 -1
  260. package/dist/src/ui/commands/docsCommand.test.d.ts +0 -6
  261. package/dist/src/ui/commands/docsCommand.test.js +0 -72
  262. package/dist/src/ui/commands/docsCommand.test.js.map +0 -1
  263. package/dist/src/ui/commands/editorCommand.test.d.ts +0 -6
  264. package/dist/src/ui/commands/editorCommand.test.js +0 -27
  265. package/dist/src/ui/commands/editorCommand.test.js.map +0 -1
  266. package/dist/src/ui/commands/extensionsCommand.test.d.ts +0 -6
  267. package/dist/src/ui/commands/extensionsCommand.test.js +0 -778
  268. package/dist/src/ui/commands/extensionsCommand.test.js.map +0 -1
  269. package/dist/src/ui/commands/helpCommand.test.d.ts +0 -6
  270. package/dist/src/ui/commands/helpCommand.test.js +0 -42
  271. package/dist/src/ui/commands/helpCommand.test.js.map +0 -1
  272. package/dist/src/ui/commands/hooksCommand.test.d.ts +0 -6
  273. package/dist/src/ui/commands/hooksCommand.test.js +0 -572
  274. package/dist/src/ui/commands/hooksCommand.test.js.map +0 -1
  275. package/dist/src/ui/commands/ideCommand.test.d.ts +0 -6
  276. package/dist/src/ui/commands/ideCommand.test.js +0 -203
  277. package/dist/src/ui/commands/ideCommand.test.js.map +0 -1
  278. package/dist/src/ui/commands/initCommand.test.d.ts +0 -6
  279. package/dist/src/ui/commands/initCommand.test.js +0 -84
  280. package/dist/src/ui/commands/initCommand.test.js.map +0 -1
  281. package/dist/src/ui/commands/mcpCommand.test.d.ts +0 -6
  282. package/dist/src/ui/commands/mcpCommand.test.js +0 -189
  283. package/dist/src/ui/commands/mcpCommand.test.js.map +0 -1
  284. package/dist/src/ui/commands/memoryCommand.test.d.ts +0 -6
  285. package/dist/src/ui/commands/memoryCommand.test.js +0 -350
  286. package/dist/src/ui/commands/memoryCommand.test.js.map +0 -1
  287. package/dist/src/ui/commands/modelCommand.test.d.ts +0 -6
  288. package/dist/src/ui/commands/modelCommand.test.js +0 -41
  289. package/dist/src/ui/commands/modelCommand.test.js.map +0 -1
  290. package/dist/src/ui/commands/permissionsCommand.test.d.ts +0 -6
  291. package/dist/src/ui/commands/permissionsCommand.test.js +0 -86
  292. package/dist/src/ui/commands/permissionsCommand.test.js.map +0 -1
  293. package/dist/src/ui/commands/policiesCommand.test.d.ts +0 -6
  294. package/dist/src/ui/commands/policiesCommand.test.js +0 -87
  295. package/dist/src/ui/commands/policiesCommand.test.js.map +0 -1
  296. package/dist/src/ui/commands/privacyCommand.test.d.ts +0 -6
  297. package/dist/src/ui/commands/privacyCommand.test.js +0 -32
  298. package/dist/src/ui/commands/privacyCommand.test.js.map +0 -1
  299. package/dist/src/ui/commands/quitCommand.test.d.ts +0 -6
  300. package/dist/src/ui/commands/quitCommand.test.js +0 -50
  301. package/dist/src/ui/commands/quitCommand.test.js.map +0 -1
  302. package/dist/src/ui/commands/restoreCommand.test.d.ts +0 -6
  303. package/dist/src/ui/commands/restoreCommand.test.js +0 -190
  304. package/dist/src/ui/commands/restoreCommand.test.js.map +0 -1
  305. package/dist/src/ui/commands/rewindCommand.test.d.ts +0 -6
  306. package/dist/src/ui/commands/rewindCommand.test.js +0 -242
  307. package/dist/src/ui/commands/rewindCommand.test.js.map +0 -1
  308. package/dist/src/ui/commands/settingsCommand.test.d.ts +0 -6
  309. package/dist/src/ui/commands/settingsCommand.test.js +0 -30
  310. package/dist/src/ui/commands/settingsCommand.test.js.map +0 -1
  311. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
  312. package/dist/src/ui/commands/setupGithubCommand.test.js +0 -238
  313. package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
  314. package/dist/src/ui/commands/skillsCommand.test.d.ts +0 -6
  315. package/dist/src/ui/commands/skillsCommand.test.js +0 -426
  316. package/dist/src/ui/commands/skillsCommand.test.js.map +0 -1
  317. package/dist/src/ui/commands/statsCommand.test.d.ts +0 -6
  318. package/dist/src/ui/commands/statsCommand.test.js +0 -70
  319. package/dist/src/ui/commands/statsCommand.test.js.map +0 -1
  320. package/dist/src/ui/commands/terminalSetupCommand.test.d.ts +0 -6
  321. package/dist/src/ui/commands/terminalSetupCommand.test.js +0 -66
  322. package/dist/src/ui/commands/terminalSetupCommand.test.js.map +0 -1
  323. package/dist/src/ui/commands/themeCommand.test.d.ts +0 -6
  324. package/dist/src/ui/commands/themeCommand.test.js +0 -32
  325. package/dist/src/ui/commands/themeCommand.test.js.map +0 -1
  326. package/dist/src/ui/commands/toolsCommand.test.d.ts +0 -6
  327. package/dist/src/ui/commands/toolsCommand.test.js +0 -100
  328. package/dist/src/ui/commands/toolsCommand.test.js.map +0 -1
  329. package/dist/src/ui/components/AboutBox.test.d.ts +0 -6
  330. package/dist/src/ui/components/AboutBox.test.js +0 -59
  331. package/dist/src/ui/components/AboutBox.test.js.map +0 -1
  332. package/dist/src/ui/components/AdminSettingsChangedDialog.test.d.ts +0 -6
  333. package/dist/src/ui/components/AdminSettingsChangedDialog.test.js +0 -43
  334. package/dist/src/ui/components/AdminSettingsChangedDialog.test.js.map +0 -1
  335. package/dist/src/ui/components/AgentConfigDialog.test.d.ts +0 -6
  336. package/dist/src/ui/components/AgentConfigDialog.test.js +0 -241
  337. package/dist/src/ui/components/AgentConfigDialog.test.js.map +0 -1
  338. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.d.ts +0 -6
  339. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +0 -190
  340. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +0 -1
  341. package/dist/src/ui/components/AnsiOutput.test.d.ts +0 -6
  342. package/dist/src/ui/components/AnsiOutput.test.js +0 -92
  343. package/dist/src/ui/components/AnsiOutput.test.js.map +0 -1
  344. package/dist/src/ui/components/AppHeader.test.d.ts +0 -6
  345. package/dist/src/ui/components/AppHeader.test.js +0 -225
  346. package/dist/src/ui/components/AppHeader.test.js.map +0 -1
  347. package/dist/src/ui/components/ApprovalModeIndicator.test.d.ts +0 -6
  348. package/dist/src/ui/components/ApprovalModeIndicator.test.js +0 -37
  349. package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +0 -1
  350. package/dist/src/ui/components/AskUserDialog.test.d.ts +0 -6
  351. package/dist/src/ui/components/AskUserDialog.test.js +0 -598
  352. package/dist/src/ui/components/AskUserDialog.test.js.map +0 -1
  353. package/dist/src/ui/components/Banner.test.d.ts +0 -6
  354. package/dist/src/ui/components/Banner.test.js +0 -24
  355. package/dist/src/ui/components/Banner.test.js.map +0 -1
  356. package/dist/src/ui/components/CliSpinner.test.d.ts +0 -6
  357. package/dist/src/ui/components/CliSpinner.test.js +0 -28
  358. package/dist/src/ui/components/CliSpinner.test.js.map +0 -1
  359. package/dist/src/ui/components/Composer.test.d.ts +0 -6
  360. package/dist/src/ui/components/Composer.test.js +0 -383
  361. package/dist/src/ui/components/Composer.test.js.map +0 -1
  362. package/dist/src/ui/components/ConfigInitDisplay.test.d.ts +0 -6
  363. package/dist/src/ui/components/ConfigInitDisplay.test.js +0 -117
  364. package/dist/src/ui/components/ConfigInitDisplay.test.js.map +0 -1
  365. package/dist/src/ui/components/ConsentPrompt.test.d.ts +0 -6
  366. package/dist/src/ui/components/ConsentPrompt.test.js +0 -77
  367. package/dist/src/ui/components/ConsentPrompt.test.js.map +0 -1
  368. package/dist/src/ui/components/ConsoleSummaryDisplay.test.d.ts +0 -6
  369. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +0 -26
  370. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +0 -1
  371. package/dist/src/ui/components/ContextSummaryDisplay.test.d.ts +0 -6
  372. package/dist/src/ui/components/ContextSummaryDisplay.test.js +0 -102
  373. package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +0 -1
  374. package/dist/src/ui/components/ContextUsageDisplay.test.d.ts +0 -6
  375. package/dist/src/ui/components/ContextUsageDisplay.test.js +0 -43
  376. package/dist/src/ui/components/ContextUsageDisplay.test.js.map +0 -1
  377. package/dist/src/ui/components/CopyModeWarning.test.d.ts +0 -6
  378. package/dist/src/ui/components/CopyModeWarning.test.js +0 -33
  379. package/dist/src/ui/components/CopyModeWarning.test.js.map +0 -1
  380. package/dist/src/ui/components/DebugProfiler.test.d.ts +0 -6
  381. package/dist/src/ui/components/DebugProfiler.test.js +0 -229
  382. package/dist/src/ui/components/DebugProfiler.test.js.map +0 -1
  383. package/dist/src/ui/components/DetailedMessagesDisplay.test.d.ts +0 -6
  384. package/dist/src/ui/components/DetailedMessagesDisplay.test.js +0 -39
  385. package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +0 -1
  386. package/dist/src/ui/components/DialogManager.test.d.ts +0 -6
  387. package/dist/src/ui/components/DialogManager.test.js +0 -177
  388. package/dist/src/ui/components/DialogManager.test.js.map +0 -1
  389. package/dist/src/ui/components/EditorSettingsDialog.test.d.ts +0 -6
  390. package/dist/src/ui/components/EditorSettingsDialog.test.js +0 -119
  391. package/dist/src/ui/components/EditorSettingsDialog.test.js.map +0 -1
  392. package/dist/src/ui/components/ExitWarning.test.d.ts +0 -6
  393. package/dist/src/ui/components/ExitWarning.test.js +0 -54
  394. package/dist/src/ui/components/ExitWarning.test.js.map +0 -1
  395. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
  396. package/dist/src/ui/components/FolderTrustDialog.test.js +0 -102
  397. package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
  398. package/dist/src/ui/components/Footer.test.d.ts +0 -6
  399. package/dist/src/ui/components/Footer.test.js +0 -321
  400. package/dist/src/ui/components/Footer.test.js.map +0 -1
  401. package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +0 -6
  402. package/dist/src/ui/components/GeminiRespondingSpinner.test.js +0 -61
  403. package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +0 -1
  404. package/dist/src/ui/components/GradientRegression.test.d.ts +0 -6
  405. package/dist/src/ui/components/GradientRegression.test.js +0 -105
  406. package/dist/src/ui/components/GradientRegression.test.js.map +0 -1
  407. package/dist/src/ui/components/Header.test.d.ts +0 -6
  408. package/dist/src/ui/components/Header.test.js +0 -147
  409. package/dist/src/ui/components/Header.test.js.map +0 -1
  410. package/dist/src/ui/components/Help.test.d.ts +0 -6
  411. package/dist/src/ui/components/Help.test.js +0 -67
  412. package/dist/src/ui/components/Help.test.js.map +0 -1
  413. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  414. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -207
  415. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  416. package/dist/src/ui/components/HookStatusDisplay.test.d.ts +0 -6
  417. package/dist/src/ui/components/HookStatusDisplay.test.js +0 -51
  418. package/dist/src/ui/components/HookStatusDisplay.test.js.map +0 -1
  419. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +0 -6
  420. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +0 -58
  421. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +0 -1
  422. package/dist/src/ui/components/InputPrompt.test.d.ts +0 -6
  423. package/dist/src/ui/components/InputPrompt.test.js +0 -2596
  424. package/dist/src/ui/components/InputPrompt.test.js.map +0 -1
  425. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  426. package/dist/src/ui/components/LoadingIndicator.test.js +0 -207
  427. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  428. package/dist/src/ui/components/LogoutConfirmationDialog.test.d.ts +0 -6
  429. package/dist/src/ui/components/LogoutConfirmationDialog.test.js +0 -59
  430. package/dist/src/ui/components/LogoutConfirmationDialog.test.js.map +0 -1
  431. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +0 -6
  432. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +0 -25
  433. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +0 -1
  434. package/dist/src/ui/components/MainContent.test.d.ts +0 -6
  435. package/dist/src/ui/components/MainContent.test.js +0 -83
  436. package/dist/src/ui/components/MainContent.test.js.map +0 -1
  437. package/dist/src/ui/components/MemoryUsageDisplay.test.d.ts +0 -6
  438. package/dist/src/ui/components/MemoryUsageDisplay.test.js +0 -49
  439. package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +0 -1
  440. package/dist/src/ui/components/ModelDialog.test.d.ts +0 -6
  441. package/dist/src/ui/components/ModelDialog.test.js +0 -197
  442. package/dist/src/ui/components/ModelDialog.test.js.map +0 -1
  443. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +0 -6
  444. package/dist/src/ui/components/ModelStatsDisplay.test.js +0 -343
  445. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +0 -1
  446. package/dist/src/ui/components/MultiFolderTrustDialog.test.d.ts +0 -6
  447. package/dist/src/ui/components/MultiFolderTrustDialog.test.js +0 -162
  448. package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +0 -1
  449. package/dist/src/ui/components/NewAgentsNotification.test.d.ts +0 -6
  450. package/dist/src/ui/components/NewAgentsNotification.test.js +0 -48
  451. package/dist/src/ui/components/NewAgentsNotification.test.js.map +0 -1
  452. package/dist/src/ui/components/Notifications.test.d.ts +0 -6
  453. package/dist/src/ui/components/Notifications.test.js +0 -164
  454. package/dist/src/ui/components/Notifications.test.js.map +0 -1
  455. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +0 -6
  456. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +0 -162
  457. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +0 -1
  458. package/dist/src/ui/components/ProQuotaDialog.test.d.ts +0 -6
  459. package/dist/src/ui/components/ProQuotaDialog.test.js +0 -191
  460. package/dist/src/ui/components/ProQuotaDialog.test.js.map +0 -1
  461. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +0 -6
  462. package/dist/src/ui/components/QueuedMessageDisplay.test.js +0 -65
  463. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +0 -1
  464. package/dist/src/ui/components/QuittingDisplay.test.d.ts +0 -6
  465. package/dist/src/ui/components/QuittingDisplay.test.js +0 -49
  466. package/dist/src/ui/components/QuittingDisplay.test.js.map +0 -1
  467. package/dist/src/ui/components/RawMarkdownIndicator.test.d.ts +0 -6
  468. package/dist/src/ui/components/RawMarkdownIndicator.test.js +0 -34
  469. package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +0 -1
  470. package/dist/src/ui/components/RewindConfirmation.test.d.ts +0 -6
  471. package/dist/src/ui/components/RewindConfirmation.test.js +0 -53
  472. package/dist/src/ui/components/RewindConfirmation.test.js.map +0 -1
  473. package/dist/src/ui/components/RewindViewer.test.d.ts +0 -6
  474. package/dist/src/ui/components/RewindViewer.test.js +0 -241
  475. package/dist/src/ui/components/RewindViewer.test.js.map +0 -1
  476. package/dist/src/ui/components/SessionBrowser.test.d.ts +0 -6
  477. package/dist/src/ui/components/SessionBrowser.test.js +0 -256
  478. package/dist/src/ui/components/SessionBrowser.test.js.map +0 -1
  479. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +0 -6
  480. package/dist/src/ui/components/SessionSummaryDisplay.test.js +0 -75
  481. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +0 -1
  482. package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
  483. package/dist/src/ui/components/SettingsDialog.test.js +0 -1150
  484. package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
  485. package/dist/src/ui/components/ShellInputPrompt.test.d.ts +0 -6
  486. package/dist/src/ui/components/ShellInputPrompt.test.js +0 -91
  487. package/dist/src/ui/components/ShellInputPrompt.test.js.map +0 -1
  488. package/dist/src/ui/components/ShellModeIndicator.test.d.ts +0 -6
  489. package/dist/src/ui/components/ShellModeIndicator.test.js +0 -17
  490. package/dist/src/ui/components/ShellModeIndicator.test.js.map +0 -1
  491. package/dist/src/ui/components/ShowMoreLines.test.d.ts +0 -6
  492. package/dist/src/ui/components/ShowMoreLines.test.js +0 -40
  493. package/dist/src/ui/components/ShowMoreLines.test.js.map +0 -1
  494. package/dist/src/ui/components/StatsDisplay.test.d.ts +0 -6
  495. package/dist/src/ui/components/StatsDisplay.test.js +0 -438
  496. package/dist/src/ui/components/StatsDisplay.test.js.map +0 -1
  497. package/dist/src/ui/components/StatusDisplay.test.d.ts +0 -6
  498. package/dist/src/ui/components/StatusDisplay.test.js +0 -155
  499. package/dist/src/ui/components/StatusDisplay.test.js.map +0 -1
  500. package/dist/src/ui/components/StickyHeader.test.d.ts +0 -6
  501. package/dist/src/ui/components/StickyHeader.test.js +0 -17
  502. package/dist/src/ui/components/StickyHeader.test.js.map +0 -1
  503. package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +0 -6
  504. package/dist/src/ui/components/SuggestionsDisplay.test.js +0 -56
  505. package/dist/src/ui/components/SuggestionsDisplay.test.js.map +0 -1
  506. package/dist/src/ui/components/Table.test.d.ts +0 -6
  507. package/dist/src/ui/components/Table.test.js +0 -53
  508. package/dist/src/ui/components/Table.test.js.map +0 -1
  509. package/dist/src/ui/components/ThemeDialog.test.d.ts +0 -6
  510. package/dist/src/ui/components/ThemeDialog.test.js +0 -167
  511. package/dist/src/ui/components/ThemeDialog.test.js.map +0 -1
  512. package/dist/src/ui/components/ThemedGradient.test.d.ts +0 -6
  513. package/dist/src/ui/components/ThemedGradient.test.js +0 -30
  514. package/dist/src/ui/components/ThemedGradient.test.js.map +0 -1
  515. package/dist/src/ui/components/Tips.test.d.ts +0 -6
  516. package/dist/src/ui/components/Tips.test.js +0 -23
  517. package/dist/src/ui/components/Tips.test.js.map +0 -1
  518. package/dist/src/ui/components/ToolConfirmationQueue.test.d.ts +0 -6
  519. package/dist/src/ui/components/ToolConfirmationQueue.test.js +0 -71
  520. package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +0 -1
  521. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +0 -6
  522. package/dist/src/ui/components/ToolStatsDisplay.test.js +0 -227
  523. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +0 -1
  524. package/dist/src/ui/components/UpdateNotification.test.d.ts +0 -6
  525. package/dist/src/ui/components/UpdateNotification.test.js +0 -16
  526. package/dist/src/ui/components/UpdateNotification.test.js.map +0 -1
  527. package/dist/src/ui/components/ValidationDialog.test.d.ts +0 -6
  528. package/dist/src/ui/components/ValidationDialog.test.js +0 -153
  529. package/dist/src/ui/components/ValidationDialog.test.js.map +0 -1
  530. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +0 -6
  531. package/dist/src/ui/components/messages/CompressionMessage.test.js +0 -191
  532. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +0 -1
  533. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  534. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -240
  535. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  536. package/dist/src/ui/components/messages/ErrorMessage.test.d.ts +0 -6
  537. package/dist/src/ui/components/messages/ErrorMessage.test.js +0 -23
  538. package/dist/src/ui/components/messages/ErrorMessage.test.js.map +0 -1
  539. package/dist/src/ui/components/messages/GeminiMessage.test.d.ts +0 -6
  540. package/dist/src/ui/components/messages/GeminiMessage.test.js +0 -35
  541. package/dist/src/ui/components/messages/GeminiMessage.test.js.map +0 -1
  542. package/dist/src/ui/components/messages/InfoMessage.test.d.ts +0 -6
  543. package/dist/src/ui/components/messages/InfoMessage.test.js +0 -28
  544. package/dist/src/ui/components/messages/InfoMessage.test.js.map +0 -1
  545. package/dist/src/ui/components/messages/RedirectionConfirmation.test.d.ts +0 -6
  546. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +0 -33
  547. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +0 -1
  548. package/dist/src/ui/components/messages/ShellToolMessage.test.d.ts +0 -6
  549. package/dist/src/ui/components/messages/ShellToolMessage.test.js +0 -123
  550. package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +0 -1
  551. package/dist/src/ui/components/messages/Todo.test.d.ts +0 -6
  552. package/dist/src/ui/components/messages/Todo.test.js +0 -114
  553. package/dist/src/ui/components/messages/Todo.test.js.map +0 -1
  554. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  555. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -232
  556. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  557. package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +0 -6
  558. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +0 -529
  559. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +0 -1
  560. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  561. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -217
  562. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  563. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.d.ts +0 -6
  564. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +0 -89
  565. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +0 -1
  566. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +0 -6
  567. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +0 -62
  568. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +0 -1
  569. package/dist/src/ui/components/messages/ToolResultDisplay.test.d.ts +0 -6
  570. package/dist/src/ui/components/messages/ToolResultDisplay.test.js +0 -114
  571. package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +0 -1
  572. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.d.ts +0 -6
  573. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +0 -134
  574. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +0 -1
  575. package/dist/src/ui/components/messages/UserMessage.test.d.ts +0 -6
  576. package/dist/src/ui/components/messages/UserMessage.test.js +0 -32
  577. package/dist/src/ui/components/messages/UserMessage.test.js.map +0 -1
  578. package/dist/src/ui/components/messages/WarningMessage.test.d.ts +0 -6
  579. package/dist/src/ui/components/messages/WarningMessage.test.js +0 -23
  580. package/dist/src/ui/components/messages/WarningMessage.test.js.map +0 -1
  581. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +0 -6
  582. package/dist/src/ui/components/shared/BaseSelectionList.test.js +0 -386
  583. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +0 -1
  584. package/dist/src/ui/components/shared/BaseSettingsDialog.test.d.ts +0 -6
  585. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +0 -434
  586. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +0 -1
  587. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +0 -6
  588. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +0 -79
  589. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +0 -1
  590. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +0 -6
  591. package/dist/src/ui/components/shared/EnumSelector.test.js +0 -70
  592. package/dist/src/ui/components/shared/EnumSelector.test.js.map +0 -1
  593. package/dist/src/ui/components/shared/ExpandableText.test.d.ts +0 -6
  594. package/dist/src/ui/components/shared/ExpandableText.test.js +0 -88
  595. package/dist/src/ui/components/shared/ExpandableText.test.js.map +0 -1
  596. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.d.ts +0 -6
  597. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js +0 -34
  598. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js.map +0 -1
  599. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  600. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -90
  601. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  602. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
  603. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -134
  604. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
  605. package/dist/src/ui/components/shared/Scrollable.test.d.ts +0 -6
  606. package/dist/src/ui/components/shared/Scrollable.test.js +0 -74
  607. package/dist/src/ui/components/shared/Scrollable.test.js.map +0 -1
  608. package/dist/src/ui/components/shared/ScrollableList.test.d.ts +0 -6
  609. package/dist/src/ui/components/shared/ScrollableList.test.js +0 -241
  610. package/dist/src/ui/components/shared/ScrollableList.test.js.map +0 -1
  611. package/dist/src/ui/components/shared/TabHeader.test.d.ts +0 -6
  612. package/dist/src/ui/components/shared/TabHeader.test.js +0 -106
  613. package/dist/src/ui/components/shared/TabHeader.test.js.map +0 -1
  614. package/dist/src/ui/components/shared/TextInput.test.d.ts +0 -6
  615. package/dist/src/ui/components/shared/TextInput.test.js +0 -242
  616. package/dist/src/ui/components/shared/TextInput.test.js.map +0 -1
  617. package/dist/src/ui/components/shared/VirtualizedList.test.d.ts +0 -6
  618. package/dist/src/ui/components/shared/VirtualizedList.test.js +0 -171
  619. package/dist/src/ui/components/shared/VirtualizedList.test.js.map +0 -1
  620. package/dist/src/ui/components/shared/performance.test.d.ts +0 -1
  621. package/dist/src/ui/components/shared/performance.test.js +0 -67
  622. package/dist/src/ui/components/shared/performance.test.js.map +0 -1
  623. package/dist/src/ui/components/shared/text-buffer.test.d.ts +0 -6
  624. package/dist/src/ui/components/shared/text-buffer.test.js +0 -2490
  625. package/dist/src/ui/components/shared/text-buffer.test.js.map +0 -1
  626. package/dist/src/ui/components/shared/vim-buffer-actions.test.d.ts +0 -6
  627. package/dist/src/ui/components/shared/vim-buffer-actions.test.js +0 -964
  628. package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +0 -1
  629. package/dist/src/ui/components/views/ChatList.test.d.ts +0 -6
  630. package/dist/src/ui/components/views/ChatList.test.js +0 -45
  631. package/dist/src/ui/components/views/ChatList.test.js.map +0 -1
  632. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +0 -6
  633. package/dist/src/ui/components/views/ExtensionsList.test.js +0 -148
  634. package/dist/src/ui/components/views/ExtensionsList.test.js.map +0 -1
  635. package/dist/src/ui/components/views/McpStatus.test.d.ts +0 -6
  636. package/dist/src/ui/components/views/McpStatus.test.js +0 -153
  637. package/dist/src/ui/components/views/McpStatus.test.js.map +0 -1
  638. package/dist/src/ui/components/views/SkillsList.test.d.ts +0 -6
  639. package/dist/src/ui/components/views/SkillsList.test.js +0 -97
  640. package/dist/src/ui/components/views/SkillsList.test.js.map +0 -1
  641. package/dist/src/ui/components/views/ToolsList.test.d.ts +0 -6
  642. package/dist/src/ui/components/views/ToolsList.test.js +0 -45
  643. package/dist/src/ui/components/views/ToolsList.test.js.map +0 -1
  644. package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
  645. package/dist/src/ui/contexts/KeypressContext.test.js +0 -957
  646. package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
  647. package/dist/src/ui/contexts/MouseContext.test.d.ts +0 -6
  648. package/dist/src/ui/contexts/MouseContext.test.js +0 -198
  649. package/dist/src/ui/contexts/MouseContext.test.js.map +0 -1
  650. package/dist/src/ui/contexts/ScrollProvider.drag.test.d.ts +0 -6
  651. package/dist/src/ui/contexts/ScrollProvider.drag.test.js +0 -319
  652. package/dist/src/ui/contexts/ScrollProvider.drag.test.js.map +0 -1
  653. package/dist/src/ui/contexts/ScrollProvider.test.d.ts +0 -6
  654. package/dist/src/ui/contexts/ScrollProvider.test.js +0 -377
  655. package/dist/src/ui/contexts/ScrollProvider.test.js.map +0 -1
  656. package/dist/src/ui/contexts/SessionContext.test.d.ts +0 -6
  657. package/dist/src/ui/contexts/SessionContext.test.js +0 -198
  658. package/dist/src/ui/contexts/SessionContext.test.js.map +0 -1
  659. package/dist/src/ui/contexts/ToolActionsContext.test.d.ts +0 -6
  660. package/dist/src/ui/contexts/ToolActionsContext.test.js +0 -166
  661. package/dist/src/ui/contexts/ToolActionsContext.test.js.map +0 -1
  662. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
  663. package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -1032
  664. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
  665. package/dist/src/ui/hooks/atCommandProcessor_agents.test.d.ts +0 -6
  666. package/dist/src/ui/hooks/atCommandProcessor_agents.test.js +0 -183
  667. package/dist/src/ui/hooks/atCommandProcessor_agents.test.js.map +0 -1
  668. package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +0 -6
  669. package/dist/src/ui/hooks/shellCommandProcessor.test.js +0 -521
  670. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
  671. package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +0 -6
  672. package/dist/src/ui/hooks/slashCommandProcessor.test.js +0 -796
  673. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +0 -1
  674. package/dist/src/ui/hooks/toolMapping.test.d.ts +0 -6
  675. package/dist/src/ui/hooks/toolMapping.test.js +0 -209
  676. package/dist/src/ui/hooks/toolMapping.test.js.map +0 -1
  677. package/dist/src/ui/hooks/useAnimatedScrollbar.test.d.ts +0 -6
  678. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +0 -85
  679. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +0 -1
  680. package/dist/src/ui/hooks/useApprovalModeIndicator.test.d.ts +0 -6
  681. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js +0 -435
  682. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js.map +0 -1
  683. package/dist/src/ui/hooks/useAtCompletion.test.d.ts +0 -6
  684. package/dist/src/ui/hooks/useAtCompletion.test.js +0 -417
  685. package/dist/src/ui/hooks/useAtCompletion.test.js.map +0 -1
  686. package/dist/src/ui/hooks/useAtCompletion_agents.test.d.ts +0 -6
  687. package/dist/src/ui/hooks/useAtCompletion_agents.test.js +0 -87
  688. package/dist/src/ui/hooks/useAtCompletion_agents.test.js.map +0 -1
  689. package/dist/src/ui/hooks/useBanner.test.d.ts +0 -6
  690. package/dist/src/ui/hooks/useBanner.test.js +0 -92
  691. package/dist/src/ui/hooks/useBanner.test.js.map +0 -1
  692. package/dist/src/ui/hooks/useBatchedScroll.test.d.ts +0 -6
  693. package/dist/src/ui/hooks/useBatchedScroll.test.js +0 -62
  694. package/dist/src/ui/hooks/useBatchedScroll.test.js.map +0 -1
  695. package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +0 -6
  696. package/dist/src/ui/hooks/useCommandCompletion.test.js +0 -462
  697. package/dist/src/ui/hooks/useCommandCompletion.test.js.map +0 -1
  698. package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +0 -6
  699. package/dist/src/ui/hooks/useConsoleMessages.test.js +0 -159
  700. package/dist/src/ui/hooks/useConsoleMessages.test.js.map +0 -1
  701. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
  702. package/dist/src/ui/hooks/useEditorSettings.test.js +0 -179
  703. package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
  704. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +0 -6
  705. package/dist/src/ui/hooks/useExtensionUpdates.test.js +0 -279
  706. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +0 -1
  707. package/dist/src/ui/hooks/useFlickerDetector.test.d.ts +0 -6
  708. package/dist/src/ui/hooks/useFlickerDetector.test.js +0 -106
  709. package/dist/src/ui/hooks/useFlickerDetector.test.js.map +0 -1
  710. package/dist/src/ui/hooks/useFocus.test.d.ts +0 -6
  711. package/dist/src/ui/hooks/useFocus.test.js +0 -131
  712. package/dist/src/ui/hooks/useFocus.test.js.map +0 -1
  713. package/dist/src/ui/hooks/useFolderTrust.test.d.ts +0 -6
  714. package/dist/src/ui/hooks/useFolderTrust.test.js +0 -218
  715. package/dist/src/ui/hooks/useFolderTrust.test.js.map +0 -1
  716. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
  717. package/dist/src/ui/hooks/useGeminiStream.test.js +0 -2149
  718. package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
  719. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
  720. package/dist/src/ui/hooks/useGitBranchName.test.js +0 -183
  721. package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
  722. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
  723. package/dist/src/ui/hooks/useHistoryManager.test.js +0 -188
  724. package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
  725. package/dist/src/ui/hooks/useHookDisplayState.test.d.ts +0 -6
  726. package/dist/src/ui/hooks/useHookDisplayState.test.js +0 -180
  727. package/dist/src/ui/hooks/useHookDisplayState.test.js.map +0 -1
  728. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +0 -6
  729. package/dist/src/ui/hooks/useIdeTrustListener.test.js +0 -214
  730. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +0 -1
  731. package/dist/src/ui/hooks/useIncludeDirsTrust.test.d.ts +0 -6
  732. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +0 -172
  733. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +0 -1
  734. package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
  735. package/dist/src/ui/hooks/useInputHistory.test.js +0 -208
  736. package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
  737. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +0 -6
  738. package/dist/src/ui/hooks/useInputHistoryStore.test.js +0 -238
  739. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +0 -1
  740. package/dist/src/ui/hooks/useKeypress.test.d.ts +0 -6
  741. package/dist/src/ui/hooks/useKeypress.test.js +0 -205
  742. package/dist/src/ui/hooks/useKeypress.test.js.map +0 -1
  743. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
  744. package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -145
  745. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
  746. package/dist/src/ui/hooks/useMcpStatus.test.d.ts +0 -6
  747. package/dist/src/ui/hooks/useMcpStatus.test.js +0 -69
  748. package/dist/src/ui/hooks/useMcpStatus.test.js.map +0 -1
  749. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +0 -6
  750. package/dist/src/ui/hooks/useMemoryMonitor.test.js +0 -62
  751. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +0 -1
  752. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
  753. package/dist/src/ui/hooks/useMessageQueue.test.js +0 -327
  754. package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
  755. package/dist/src/ui/hooks/useModelCommand.test.d.ts +0 -6
  756. package/dist/src/ui/hooks/useModelCommand.test.js +0 -45
  757. package/dist/src/ui/hooks/useModelCommand.test.js.map +0 -1
  758. package/dist/src/ui/hooks/useMouse.test.d.ts +0 -6
  759. package/dist/src/ui/hooks/useMouse.test.js +0 -57
  760. package/dist/src/ui/hooks/useMouse.test.js.map +0 -1
  761. package/dist/src/ui/hooks/useMouseClick.test.d.ts +0 -6
  762. package/dist/src/ui/hooks/useMouseClick.test.js +0 -59
  763. package/dist/src/ui/hooks/useMouseClick.test.js.map +0 -1
  764. package/dist/src/ui/hooks/useMouseDoubleClick.test.d.ts +0 -6
  765. package/dist/src/ui/hooks/useMouseDoubleClick.test.js +0 -125
  766. package/dist/src/ui/hooks/useMouseDoubleClick.test.js.map +0 -1
  767. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +0 -6
  768. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +0 -291
  769. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +0 -1
  770. package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +0 -6
  771. package/dist/src/ui/hooks/usePhraseCycler.test.js +0 -208
  772. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +0 -1
  773. package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
  774. package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -104
  775. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
  776. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +0 -6
  777. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +0 -477
  778. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +0 -1
  779. package/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +0 -6
  780. package/dist/src/ui/hooks/useReactToolScheduler.test.js +0 -58
  781. package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +0 -1
  782. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
  783. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -169
  784. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
  785. package/dist/src/ui/hooks/useRewind.test.d.ts +0 -6
  786. package/dist/src/ui/hooks/useRewind.test.js +0 -100
  787. package/dist/src/ui/hooks/useRewind.test.js.map +0 -1
  788. package/dist/src/ui/hooks/useSelectionList.test.d.ts +0 -6
  789. package/dist/src/ui/hooks/useSelectionList.test.js +0 -848
  790. package/dist/src/ui/hooks/useSelectionList.test.js.map +0 -1
  791. package/dist/src/ui/hooks/useSessionBrowser.test.d.ts +0 -6
  792. package/dist/src/ui/hooks/useSessionBrowser.test.js +0 -203
  793. package/dist/src/ui/hooks/useSessionBrowser.test.js.map +0 -1
  794. package/dist/src/ui/hooks/useSessionResume.test.d.ts +0 -6
  795. package/dist/src/ui/hooks/useSessionResume.test.js +0 -336
  796. package/dist/src/ui/hooks/useSessionResume.test.js.map +0 -1
  797. package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
  798. package/dist/src/ui/hooks/useShellHistory.test.js +0 -223
  799. package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
  800. package/dist/src/ui/hooks/useShellInactivityStatus.test.d.ts +0 -6
  801. package/dist/src/ui/hooks/useShellInactivityStatus.test.js +0 -84
  802. package/dist/src/ui/hooks/useShellInactivityStatus.test.js.map +0 -1
  803. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -9
  804. package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -845
  805. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
  806. package/dist/src/ui/hooks/useSnowfall.test.d.ts +0 -6
  807. package/dist/src/ui/hooks/useSnowfall.test.js +0 -88
  808. package/dist/src/ui/hooks/useSnowfall.test.js.map +0 -1
  809. package/dist/src/ui/hooks/useTabbedNavigation.test.d.ts +0 -6
  810. package/dist/src/ui/hooks/useTabbedNavigation.test.js +0 -187
  811. package/dist/src/ui/hooks/useTabbedNavigation.test.js.map +0 -1
  812. package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
  813. package/dist/src/ui/hooks/useTimer.test.js +0 -119
  814. package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
  815. package/dist/src/ui/hooks/useTips.test.d.ts +0 -6
  816. package/dist/src/ui/hooks/useTips.test.js +0 -33
  817. package/dist/src/ui/hooks/useTips.test.js.map +0 -1
  818. package/dist/src/ui/hooks/useToolExecutionScheduler.test.d.ts +0 -6
  819. package/dist/src/ui/hooks/useToolExecutionScheduler.test.js +0 -376
  820. package/dist/src/ui/hooks/useToolExecutionScheduler.test.js.map +0 -1
  821. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
  822. package/dist/src/ui/hooks/useToolScheduler.test.js +0 -881
  823. package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
  824. package/dist/src/ui/hooks/useToolSchedulerFacade.test.d.ts +0 -6
  825. package/dist/src/ui/hooks/useToolSchedulerFacade.test.js +0 -45
  826. package/dist/src/ui/hooks/useToolSchedulerFacade.test.js.map +0 -1
  827. package/dist/src/ui/hooks/useTurnActivityMonitor.test.d.ts +0 -6
  828. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js +0 -97
  829. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js.map +0 -1
  830. package/dist/src/ui/hooks/vim.test.d.ts +0 -6
  831. package/dist/src/ui/hooks/vim.test.js +0 -1384
  832. package/dist/src/ui/hooks/vim.test.js.map +0 -1
  833. package/dist/src/ui/keyMatchers.test.d.ts +0 -6
  834. package/dist/src/ui/keyMatchers.test.js +0 -386
  835. package/dist/src/ui/keyMatchers.test.js.map +0 -1
  836. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.d.ts +0 -6
  837. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +0 -121
  838. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +0 -1
  839. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.d.ts +0 -6
  840. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +0 -34
  841. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +0 -1
  842. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.d.ts +0 -6
  843. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +0 -34
  844. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +0 -1
  845. package/dist/src/ui/privacy/PrivacyNotice.test.d.ts +0 -6
  846. package/dist/src/ui/privacy/PrivacyNotice.test.js +0 -62
  847. package/dist/src/ui/privacy/PrivacyNotice.test.js.map +0 -1
  848. package/dist/src/ui/state/extensions.test.d.ts +0 -6
  849. package/dist/src/ui/state/extensions.test.js +0 -219
  850. package/dist/src/ui/state/extensions.test.js.map +0 -1
  851. package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
  852. package/dist/src/ui/themes/color-utils.test.js +0 -245
  853. package/dist/src/ui/themes/color-utils.test.js.map +0 -1
  854. package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
  855. package/dist/src/ui/themes/theme-manager.test.js +0 -150
  856. package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
  857. package/dist/src/ui/themes/theme.test.d.ts +0 -6
  858. package/dist/src/ui/themes/theme.test.js +0 -174
  859. package/dist/src/ui/themes/theme.test.js.map +0 -1
  860. package/dist/src/ui/utils/CodeColorizer.test.d.ts +0 -6
  861. package/dist/src/ui/utils/CodeColorizer.test.js +0 -38
  862. package/dist/src/ui/utils/CodeColorizer.test.js.map +0 -1
  863. package/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +0 -6
  864. package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +0 -21
  865. package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +0 -1
  866. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  867. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -159
  868. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
  869. package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
  870. package/dist/src/ui/utils/clipboardUtils.test.js +0 -359
  871. package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
  872. package/dist/src/ui/utils/clipboardUtils.windows.test.d.ts +0 -6
  873. package/dist/src/ui/utils/clipboardUtils.windows.test.js +0 -55
  874. package/dist/src/ui/utils/clipboardUtils.windows.test.js.map +0 -1
  875. package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
  876. package/dist/src/ui/utils/commandUtils.test.js +0 -479
  877. package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
  878. package/dist/src/ui/utils/computeStats.test.d.ts +0 -6
  879. package/dist/src/ui/utils/computeStats.test.js +0 -271
  880. package/dist/src/ui/utils/computeStats.test.js.map +0 -1
  881. package/dist/src/ui/utils/directoryUtils.test.d.ts +0 -6
  882. package/dist/src/ui/utils/directoryUtils.test.js +0 -244
  883. package/dist/src/ui/utils/directoryUtils.test.js.map +0 -1
  884. package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
  885. package/dist/src/ui/utils/displayUtils.test.js +0 -61
  886. package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
  887. package/dist/src/ui/utils/formatters.test.d.ts +0 -6
  888. package/dist/src/ui/utils/formatters.test.js +0 -124
  889. package/dist/src/ui/utils/formatters.test.js.map +0 -1
  890. package/dist/src/ui/utils/highlight.test.d.ts +0 -6
  891. package/dist/src/ui/utils/highlight.test.js +0 -198
  892. package/dist/src/ui/utils/highlight.test.js.map +0 -1
  893. package/dist/src/ui/utils/input.test.d.ts +0 -6
  894. package/dist/src/ui/utils/input.test.js +0 -44
  895. package/dist/src/ui/utils/input.test.js.map +0 -1
  896. package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
  897. package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
  898. package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
  899. package/dist/src/ui/utils/mouse.test.d.ts +0 -6
  900. package/dist/src/ui/utils/mouse.test.js +0 -136
  901. package/dist/src/ui/utils/mouse.test.js.map +0 -1
  902. package/dist/src/ui/utils/rewindFileOps.test.d.ts +0 -6
  903. package/dist/src/ui/utils/rewindFileOps.test.js +0 -375
  904. package/dist/src/ui/utils/rewindFileOps.test.js.map +0 -1
  905. package/dist/src/ui/utils/terminalCapabilityManager.test.d.ts +0 -6
  906. package/dist/src/ui/utils/terminalCapabilityManager.test.js +0 -220
  907. package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +0 -1
  908. package/dist/src/ui/utils/terminalSetup.test.d.ts +0 -6
  909. package/dist/src/ui/utils/terminalSetup.test.js +0 -147
  910. package/dist/src/ui/utils/terminalSetup.test.js.map +0 -1
  911. package/dist/src/ui/utils/terminalUtils.test.d.ts +0 -6
  912. package/dist/src/ui/utils/terminalUtils.test.js +0 -40
  913. package/dist/src/ui/utils/terminalUtils.test.js.map +0 -1
  914. package/dist/src/ui/utils/textOutput.test.d.ts +0 -6
  915. package/dist/src/ui/utils/textOutput.test.js +0 -79
  916. package/dist/src/ui/utils/textOutput.test.js.map +0 -1
  917. package/dist/src/ui/utils/textUtils.test.d.ts +0 -6
  918. package/dist/src/ui/utils/textUtils.test.js +0 -168
  919. package/dist/src/ui/utils/textUtils.test.js.map +0 -1
  920. package/dist/src/ui/utils/ui-sizing.test.d.ts +0 -6
  921. package/dist/src/ui/utils/ui-sizing.test.js +0 -38
  922. package/dist/src/ui/utils/ui-sizing.test.js.map +0 -1
  923. package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
  924. package/dist/src/ui/utils/updateCheck.test.js +0 -134
  925. package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
  926. package/dist/src/utils/agentUtils.test.d.ts +0 -6
  927. package/dist/src/utils/agentUtils.test.js +0 -121
  928. package/dist/src/utils/agentUtils.test.js.map +0 -1
  929. package/dist/src/utils/checks.test.d.ts +0 -6
  930. package/dist/src/utils/checks.test.js +0 -29
  931. package/dist/src/utils/checks.test.js.map +0 -1
  932. package/dist/src/utils/cleanup.test.d.ts +0 -6
  933. package/dist/src/utils/cleanup.test.js +0 -92
  934. package/dist/src/utils/cleanup.test.js.map +0 -1
  935. package/dist/src/utils/commands.test.d.ts +0 -6
  936. package/dist/src/utils/commands.test.js +0 -115
  937. package/dist/src/utils/commands.test.js.map +0 -1
  938. package/dist/src/utils/commentJson.test.d.ts +0 -6
  939. package/dist/src/utils/commentJson.test.js +0 -308
  940. package/dist/src/utils/commentJson.test.js.map +0 -1
  941. package/dist/src/utils/deepMerge.test.d.ts +0 -6
  942. package/dist/src/utils/deepMerge.test.js +0 -201
  943. package/dist/src/utils/deepMerge.test.js.map +0 -1
  944. package/dist/src/utils/dialogScopeUtils.test.d.ts +0 -6
  945. package/dist/src/utils/dialogScopeUtils.test.js +0 -81
  946. package/dist/src/utils/dialogScopeUtils.test.js.map +0 -1
  947. package/dist/src/utils/envVarResolver.test.d.ts +0 -6
  948. package/dist/src/utils/envVarResolver.test.js +0 -221
  949. package/dist/src/utils/envVarResolver.test.js.map +0 -1
  950. package/dist/src/utils/errors.test.d.ts +0 -6
  951. package/dist/src/utils/errors.test.js +0 -435
  952. package/dist/src/utils/errors.test.js.map +0 -1
  953. package/dist/src/utils/events.test.d.ts +0 -6
  954. package/dist/src/utils/events.test.js +0 -24
  955. package/dist/src/utils/events.test.js.map +0 -1
  956. package/dist/src/utils/gitUtils.test.d.ts +0 -6
  957. package/dist/src/utils/gitUtils.test.js +0 -113
  958. package/dist/src/utils/gitUtils.test.js.map +0 -1
  959. package/dist/src/utils/handleAutoUpdate.test.d.ts +0 -6
  960. package/dist/src/utils/handleAutoUpdate.test.js +0 -310
  961. package/dist/src/utils/handleAutoUpdate.test.js.map +0 -1
  962. package/dist/src/utils/installationInfo.test.d.ts +0 -6
  963. package/dist/src/utils/installationInfo.test.js +0 -296
  964. package/dist/src/utils/installationInfo.test.js.map +0 -1
  965. package/dist/src/utils/jsonoutput.test.d.ts +0 -6
  966. package/dist/src/utils/jsonoutput.test.js +0 -74
  967. package/dist/src/utils/jsonoutput.test.js.map +0 -1
  968. package/dist/src/utils/math.test.d.ts +0 -6
  969. package/dist/src/utils/math.test.js +0 -23
  970. package/dist/src/utils/math.test.js.map +0 -1
  971. package/dist/src/utils/persistentState.test.d.ts +0 -6
  972. package/dist/src/utils/persistentState.test.js +0 -68
  973. package/dist/src/utils/persistentState.test.js.map +0 -1
  974. package/dist/src/utils/processUtils.test.d.ts +0 -6
  975. package/dist/src/utils/processUtils.test.js +0 -20
  976. package/dist/src/utils/processUtils.test.js.map +0 -1
  977. package/dist/src/utils/readStdin.test.d.ts +0 -6
  978. package/dist/src/utils/readStdin.test.js +0 -117
  979. package/dist/src/utils/readStdin.test.js.map +0 -1
  980. package/dist/src/utils/readStdin_safety.test.d.ts +0 -6
  981. package/dist/src/utils/readStdin_safety.test.js +0 -68
  982. package/dist/src/utils/readStdin_safety.test.js.map +0 -1
  983. package/dist/src/utils/relaunch.test.d.ts +0 -6
  984. package/dist/src/utils/relaunch.test.js +0 -279
  985. package/dist/src/utils/relaunch.test.js.map +0 -1
  986. package/dist/src/utils/resolvePath.test.d.ts +0 -6
  987. package/dist/src/utils/resolvePath.test.js +0 -34
  988. package/dist/src/utils/resolvePath.test.js.map +0 -1
  989. package/dist/src/utils/sandbox.test.d.ts +0 -6
  990. package/dist/src/utils/sandbox.test.js +0 -314
  991. package/dist/src/utils/sandbox.test.js.map +0 -1
  992. package/dist/src/utils/sandboxUtils.test.d.ts +0 -6
  993. package/dist/src/utils/sandboxUtils.test.js +0 -122
  994. package/dist/src/utils/sandboxUtils.test.js.map +0 -1
  995. package/dist/src/utils/sessionCleanup.integration.test.d.ts +0 -6
  996. package/dist/src/utils/sessionCleanup.integration.test.js +0 -182
  997. package/dist/src/utils/sessionCleanup.integration.test.js.map +0 -1
  998. package/dist/src/utils/sessionCleanup.test.d.ts +0 -6
  999. package/dist/src/utils/sessionCleanup.test.js +0 -1298
  1000. package/dist/src/utils/sessionCleanup.test.js.map +0 -1
  1001. package/dist/src/utils/sessionUtils.test.d.ts +0 -6
  1002. package/dist/src/utils/sessionUtils.test.js +0 -503
  1003. package/dist/src/utils/sessionUtils.test.js.map +0 -1
  1004. package/dist/src/utils/sessions.test.d.ts +0 -6
  1005. package/dist/src/utils/sessions.test.js +0 -581
  1006. package/dist/src/utils/sessions.test.js.map +0 -1
  1007. package/dist/src/utils/settingsUtils.test.d.ts +0 -6
  1008. package/dist/src/utils/settingsUtils.test.js +0 -808
  1009. package/dist/src/utils/settingsUtils.test.js.map +0 -1
  1010. package/dist/src/utils/skillUtils.test.d.ts +0 -6
  1011. package/dist/src/utils/skillUtils.test.js +0 -70
  1012. package/dist/src/utils/skillUtils.test.js.map +0 -1
  1013. package/dist/src/utils/startupWarnings.test.d.ts +0 -6
  1014. package/dist/src/utils/startupWarnings.test.js +0 -61
  1015. package/dist/src/utils/startupWarnings.test.js.map +0 -1
  1016. package/dist/src/utils/updateEventEmitter.test.d.ts +0 -6
  1017. package/dist/src/utils/updateEventEmitter.test.js +0 -18
  1018. package/dist/src/utils/updateEventEmitter.test.js.map +0 -1
  1019. package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
  1020. package/dist/src/utils/userStartupWarnings.test.js +0 -98
  1021. package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
  1022. package/dist/src/utils/windowTitle.test.d.ts +0 -6
  1023. package/dist/src/utils/windowTitle.test.js +0 -216
  1024. package/dist/src/utils/windowTitle.test.js.map +0 -1
  1025. package/dist/src/validateNonInterActiveAuth.test.d.ts +0 -6
  1026. package/dist/src/validateNonInterActiveAuth.test.js +0 -319
  1027. package/dist/src/validateNonInterActiveAuth.test.js.map +0 -1
  1028. package/dist/src/zed-integration/fileSystemService.test.d.ts +0 -6
  1029. package/dist/src/zed-integration/fileSystemService.test.js +0 -88
  1030. package/dist/src/zed-integration/fileSystemService.test.js.map +0 -1
  1031. package/dist/src/zed-integration/zedIntegration.test.d.ts +0 -6
  1032. package/dist/src/zed-integration/zedIntegration.test.js +0 -625
  1033. package/dist/src/zed-integration/zedIntegration.test.js.map +0 -1
  1034. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,2596 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license
4
- * Copyright 2025 Google LLC
5
- * SPDX-License-Identifier: Apache-2.0
6
- */
7
- import { renderWithProviders, createMockSettings, } from '../../test-utils/render.js';
8
- import { waitFor } from '../../test-utils/async.js';
9
- import { act, useState } from 'react';
10
- import { InputPrompt } from './InputPrompt.js';
11
- import { calculateTransformationsForLine, calculateTransformedLine, } from './shared/text-buffer.js';
12
- import { ApprovalMode, debugLogger } from '@didim365/agent-cli-core';
13
- import * as path from 'node:path';
14
- import { CommandKind } from '../commands/types.js';
15
- import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
16
- import { useShellHistory } from '../hooks/useShellHistory.js';
17
- import { useCommandCompletion, CompletionMode, } from '../hooks/useCommandCompletion.js';
18
- import { useInputHistory } from '../hooks/useInputHistory.js';
19
- import { useReverseSearchCompletion } from '../hooks/useReverseSearchCompletion.js';
20
- import clipboardy from 'clipboardy';
21
- import * as clipboardUtils from '../utils/clipboardUtils.js';
22
- import { useKittyKeyboardProtocol } from '../hooks/useKittyKeyboardProtocol.js';
23
- import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
24
- import stripAnsi from 'strip-ansi';
25
- import chalk from 'chalk';
26
- import { StreamingState } from '../types.js';
27
- import { terminalCapabilityManager } from '../utils/terminalCapabilityManager.js';
28
- import { isLowColorDepth } from '../utils/terminalUtils.js';
29
- vi.mock('../hooks/useShellHistory.js');
30
- vi.mock('../hooks/useCommandCompletion.js');
31
- vi.mock('../hooks/useInputHistory.js');
32
- vi.mock('../hooks/useReverseSearchCompletion.js');
33
- vi.mock('clipboardy');
34
- vi.mock('../utils/clipboardUtils.js');
35
- vi.mock('../hooks/useKittyKeyboardProtocol.js');
36
- vi.mock('../utils/terminalUtils.js', () => ({
37
- isLowColorDepth: vi.fn(() => false),
38
- }));
39
- const mockSlashCommands = [
40
- {
41
- name: 'clear',
42
- kind: CommandKind.BUILT_IN,
43
- description: 'Clear screen',
44
- action: vi.fn(),
45
- },
46
- {
47
- name: 'memory',
48
- kind: CommandKind.BUILT_IN,
49
- description: 'Manage memory',
50
- subCommands: [
51
- {
52
- name: 'show',
53
- kind: CommandKind.BUILT_IN,
54
- description: 'Show memory',
55
- action: vi.fn(),
56
- },
57
- {
58
- name: 'add',
59
- kind: CommandKind.BUILT_IN,
60
- description: 'Add to memory',
61
- action: vi.fn(),
62
- },
63
- {
64
- name: 'refresh',
65
- kind: CommandKind.BUILT_IN,
66
- description: 'Refresh memory',
67
- action: vi.fn(),
68
- },
69
- ],
70
- },
71
- {
72
- name: 'chat',
73
- description: 'Manage chats',
74
- kind: CommandKind.BUILT_IN,
75
- subCommands: [
76
- {
77
- name: 'resume',
78
- description: 'Resume a chat',
79
- kind: CommandKind.BUILT_IN,
80
- action: vi.fn(),
81
- completion: async () => ['fix-foo', 'fix-bar'],
82
- },
83
- ],
84
- },
85
- {
86
- name: 'resume',
87
- description: 'Browse and resume sessions',
88
- kind: CommandKind.BUILT_IN,
89
- action: vi.fn(),
90
- },
91
- ];
92
- describe('InputPrompt', () => {
93
- let props;
94
- let mockShellHistory;
95
- let mockCommandCompletion;
96
- let mockInputHistory;
97
- let mockReverseSearchCompletion;
98
- let mockBuffer;
99
- let mockCommandContext;
100
- const mockedUseShellHistory = vi.mocked(useShellHistory);
101
- const mockedUseCommandCompletion = vi.mocked(useCommandCompletion);
102
- const mockedUseInputHistory = vi.mocked(useInputHistory);
103
- const mockedUseReverseSearchCompletion = vi.mocked(useReverseSearchCompletion);
104
- const mockedUseKittyKeyboardProtocol = vi.mocked(useKittyKeyboardProtocol);
105
- const mockSetEmbeddedShellFocused = vi.fn();
106
- const uiActions = {
107
- setEmbeddedShellFocused: mockSetEmbeddedShellFocused,
108
- };
109
- beforeEach(() => {
110
- vi.resetAllMocks();
111
- vi.spyOn(terminalCapabilityManager, 'isKittyProtocolEnabled').mockReturnValue(true);
112
- mockCommandContext = createMockCommandContext();
113
- mockBuffer = {
114
- text: '',
115
- cursor: [0, 0],
116
- lines: [''],
117
- setText: vi.fn((newText) => {
118
- mockBuffer.text = newText;
119
- mockBuffer.lines = [newText];
120
- mockBuffer.cursor = [0, newText.length];
121
- mockBuffer.viewportVisualLines = [newText];
122
- mockBuffer.allVisualLines = [newText];
123
- mockBuffer.visualToLogicalMap = [[0, 0]];
124
- }),
125
- replaceRangeByOffset: vi.fn(),
126
- viewportVisualLines: [''],
127
- allVisualLines: [''],
128
- visualCursor: [0, 0],
129
- visualScrollRow: 0,
130
- handleInput: vi.fn(),
131
- move: vi.fn(),
132
- moveToOffset: vi.fn((offset) => {
133
- mockBuffer.cursor = [0, offset];
134
- }),
135
- moveToVisualPosition: vi.fn(),
136
- killLineRight: vi.fn(),
137
- killLineLeft: vi.fn(),
138
- openInExternalEditor: vi.fn(),
139
- newline: vi.fn(),
140
- undo: vi.fn(),
141
- redo: vi.fn(),
142
- backspace: vi.fn(),
143
- preferredCol: null,
144
- selectionAnchor: null,
145
- insert: vi.fn(),
146
- del: vi.fn(),
147
- replaceRange: vi.fn(),
148
- deleteWordLeft: vi.fn(),
149
- deleteWordRight: vi.fn(),
150
- visualToLogicalMap: [[0, 0]],
151
- visualToTransformedMap: [0],
152
- transformationsByLine: [],
153
- getOffset: vi.fn().mockReturnValue(0),
154
- pastedContent: {},
155
- };
156
- mockShellHistory = {
157
- history: [],
158
- addCommandToHistory: vi.fn(),
159
- getPreviousCommand: vi.fn().mockReturnValue(null),
160
- getNextCommand: vi.fn().mockReturnValue(null),
161
- resetHistoryPosition: vi.fn(),
162
- };
163
- mockedUseShellHistory.mockReturnValue(mockShellHistory);
164
- mockCommandCompletion = {
165
- suggestions: [],
166
- activeSuggestionIndex: -1,
167
- isLoadingSuggestions: false,
168
- showSuggestions: false,
169
- visibleStartIndex: 0,
170
- isPerfectMatch: false,
171
- navigateUp: vi.fn(),
172
- navigateDown: vi.fn(),
173
- resetCompletionState: vi.fn(),
174
- setActiveSuggestionIndex: vi.fn(),
175
- setShowSuggestions: vi.fn(),
176
- handleAutocomplete: vi.fn(),
177
- promptCompletion: {
178
- text: '',
179
- accept: vi.fn(),
180
- clear: vi.fn(),
181
- isLoading: false,
182
- isActive: false,
183
- markSelected: vi.fn(),
184
- },
185
- getCommandFromSuggestion: vi.fn().mockReturnValue(undefined),
186
- slashCompletionRange: {
187
- completionStart: -1,
188
- completionEnd: -1,
189
- getCommandFromSuggestion: vi.fn().mockReturnValue(undefined),
190
- isArgumentCompletion: false,
191
- leafCommand: null,
192
- },
193
- getCompletedText: vi.fn().mockReturnValue(null),
194
- completionMode: CompletionMode.IDLE,
195
- };
196
- mockedUseCommandCompletion.mockReturnValue(mockCommandCompletion);
197
- mockInputHistory = {
198
- navigateUp: vi.fn(),
199
- navigateDown: vi.fn(),
200
- handleSubmit: vi.fn(),
201
- };
202
- mockedUseInputHistory.mockReturnValue(mockInputHistory);
203
- mockReverseSearchCompletion = {
204
- suggestions: [],
205
- activeSuggestionIndex: -1,
206
- visibleStartIndex: 0,
207
- showSuggestions: false,
208
- isLoadingSuggestions: false,
209
- navigateUp: vi.fn(),
210
- navigateDown: vi.fn(),
211
- handleAutocomplete: vi.fn(),
212
- resetCompletionState: vi.fn(),
213
- };
214
- mockedUseReverseSearchCompletion.mockReturnValue(mockReverseSearchCompletion);
215
- mockedUseKittyKeyboardProtocol.mockReturnValue({
216
- enabled: false,
217
- checking: false,
218
- });
219
- vi.mocked(clipboardy.read).mockResolvedValue('');
220
- props = {
221
- buffer: mockBuffer,
222
- onSubmit: vi.fn(),
223
- userMessages: [],
224
- onClearScreen: vi.fn(),
225
- config: {
226
- getProjectRoot: () => path.join('test', 'project'),
227
- getTargetDir: () => path.join('test', 'project', 'src'),
228
- getVimMode: () => false,
229
- getUseBackgroundColor: () => true,
230
- getTerminalBackground: () => undefined,
231
- getWorkspaceContext: () => ({
232
- getDirectories: () => ['/test/project/src'],
233
- }),
234
- },
235
- slashCommands: mockSlashCommands,
236
- commandContext: mockCommandContext,
237
- shellModeActive: false,
238
- setShellModeActive: vi.fn(),
239
- approvalMode: ApprovalMode.DEFAULT,
240
- inputWidth: 80,
241
- suggestionsWidth: 80,
242
- focus: true,
243
- setQueueErrorMessage: vi.fn(),
244
- streamingState: StreamingState.Idle,
245
- setBannerVisible: vi.fn(),
246
- };
247
- });
248
- it('should call shellHistory.getPreviousCommand on up arrow in shell mode', async () => {
249
- props.shellModeActive = true;
250
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
251
- uiActions,
252
- });
253
- await act(async () => {
254
- stdin.write('\u001B[A');
255
- });
256
- await waitFor(() => expect(mockShellHistory.getPreviousCommand).toHaveBeenCalled());
257
- unmount();
258
- });
259
- it('should call shellHistory.getNextCommand on down arrow in shell mode', async () => {
260
- props.shellModeActive = true;
261
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
262
- uiActions,
263
- });
264
- await act(async () => {
265
- stdin.write('\u001B[B');
266
- await waitFor(() => expect(mockShellHistory.getNextCommand).toHaveBeenCalled());
267
- });
268
- unmount();
269
- });
270
- it('should set the buffer text when a shell history command is retrieved', async () => {
271
- props.shellModeActive = true;
272
- vi.mocked(mockShellHistory.getPreviousCommand).mockReturnValue('previous command');
273
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
274
- uiActions,
275
- });
276
- await act(async () => {
277
- stdin.write('\u001B[A');
278
- });
279
- await waitFor(() => {
280
- expect(mockShellHistory.getPreviousCommand).toHaveBeenCalled();
281
- expect(props.buffer.setText).toHaveBeenCalledWith('previous command');
282
- });
283
- unmount();
284
- });
285
- it('should call shellHistory.addCommandToHistory on submit in shell mode', async () => {
286
- props.shellModeActive = true;
287
- props.buffer.setText('ls -l');
288
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
289
- uiActions,
290
- });
291
- await act(async () => {
292
- stdin.write('\r');
293
- });
294
- await waitFor(() => {
295
- expect(mockShellHistory.addCommandToHistory).toHaveBeenCalledWith('ls -l');
296
- expect(props.onSubmit).toHaveBeenCalledWith('ls -l');
297
- });
298
- unmount();
299
- });
300
- it('should NOT call shell history methods when not in shell mode', async () => {
301
- props.buffer.setText('some text');
302
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
303
- uiActions,
304
- });
305
- await act(async () => {
306
- stdin.write('\u001B[A'); // Up arrow
307
- });
308
- await waitFor(() => expect(mockInputHistory.navigateUp).toHaveBeenCalled());
309
- await act(async () => {
310
- stdin.write('\u001B[B'); // Down arrow
311
- });
312
- await waitFor(() => expect(mockInputHistory.navigateDown).toHaveBeenCalled());
313
- await act(async () => {
314
- stdin.write('\r'); // Enter
315
- });
316
- await waitFor(() => expect(props.onSubmit).toHaveBeenCalledWith('some text'));
317
- expect(mockShellHistory.getPreviousCommand).not.toHaveBeenCalled();
318
- expect(mockShellHistory.getNextCommand).not.toHaveBeenCalled();
319
- expect(mockShellHistory.addCommandToHistory).not.toHaveBeenCalled();
320
- unmount();
321
- });
322
- it('should call completion.navigateUp for both up arrow and Ctrl+P when suggestions are showing', async () => {
323
- mockedUseCommandCompletion.mockReturnValue({
324
- ...mockCommandCompletion,
325
- showSuggestions: true,
326
- suggestions: [
327
- { label: 'memory', value: 'memory' },
328
- { label: 'memcache', value: 'memcache' },
329
- ],
330
- });
331
- props.buffer.setText('/mem');
332
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
333
- uiActions,
334
- });
335
- // Test up arrow
336
- await act(async () => {
337
- stdin.write('\u001B[A'); // Up arrow
338
- });
339
- await waitFor(() => expect(mockCommandCompletion.navigateUp).toHaveBeenCalledTimes(1));
340
- await act(async () => {
341
- stdin.write('\u0010'); // Ctrl+P
342
- });
343
- await waitFor(() => expect(mockCommandCompletion.navigateUp).toHaveBeenCalledTimes(2));
344
- expect(mockCommandCompletion.navigateDown).not.toHaveBeenCalled();
345
- unmount();
346
- });
347
- it('should call completion.navigateDown for both down arrow and Ctrl+N when suggestions are showing', async () => {
348
- mockedUseCommandCompletion.mockReturnValue({
349
- ...mockCommandCompletion,
350
- showSuggestions: true,
351
- suggestions: [
352
- { label: 'memory', value: 'memory' },
353
- { label: 'memcache', value: 'memcache' },
354
- ],
355
- });
356
- props.buffer.setText('/mem');
357
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
358
- uiActions,
359
- });
360
- // Test down arrow
361
- await act(async () => {
362
- stdin.write('\u001B[B'); // Down arrow
363
- });
364
- await waitFor(() => expect(mockCommandCompletion.navigateDown).toHaveBeenCalledTimes(1));
365
- await act(async () => {
366
- stdin.write('\u000E'); // Ctrl+N
367
- });
368
- await waitFor(() => expect(mockCommandCompletion.navigateDown).toHaveBeenCalledTimes(2));
369
- expect(mockCommandCompletion.navigateUp).not.toHaveBeenCalled();
370
- unmount();
371
- });
372
- it('should NOT call completion navigation when suggestions are not showing', async () => {
373
- mockedUseCommandCompletion.mockReturnValue({
374
- ...mockCommandCompletion,
375
- showSuggestions: false,
376
- });
377
- props.buffer.setText('some text');
378
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
379
- uiActions,
380
- });
381
- await act(async () => {
382
- stdin.write('\u001B[A'); // Up arrow
383
- });
384
- await waitFor(() => expect(mockInputHistory.navigateUp).toHaveBeenCalled());
385
- await act(async () => {
386
- stdin.write('\u001B[B'); // Down arrow
387
- });
388
- await waitFor(() => expect(mockInputHistory.navigateDown).toHaveBeenCalled());
389
- await act(async () => {
390
- stdin.write('\u0010'); // Ctrl+P
391
- });
392
- await act(async () => {
393
- stdin.write('\u000E'); // Ctrl+N
394
- });
395
- await waitFor(() => {
396
- expect(mockCommandCompletion.navigateUp).not.toHaveBeenCalled();
397
- expect(mockCommandCompletion.navigateDown).not.toHaveBeenCalled();
398
- });
399
- unmount();
400
- });
401
- describe('clipboard image paste', () => {
402
- beforeEach(() => {
403
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
404
- vi.mocked(clipboardUtils.saveClipboardImage).mockResolvedValue(null);
405
- vi.mocked(clipboardUtils.cleanupOldClipboardImages).mockResolvedValue(undefined);
406
- });
407
- it('should handle Ctrl+V when clipboard has an image', async () => {
408
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(true);
409
- vi.mocked(clipboardUtils.saveClipboardImage).mockResolvedValue('/test/.gemini-clipboard/clipboard-123.png');
410
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
411
- // Send Ctrl+V
412
- await act(async () => {
413
- stdin.write('\x16'); // Ctrl+V
414
- });
415
- await waitFor(() => {
416
- expect(clipboardUtils.clipboardHasImage).toHaveBeenCalled();
417
- expect(clipboardUtils.saveClipboardImage).toHaveBeenCalledWith(props.config.getTargetDir());
418
- expect(clipboardUtils.cleanupOldClipboardImages).toHaveBeenCalledWith(props.config.getTargetDir());
419
- expect(mockBuffer.replaceRangeByOffset).toHaveBeenCalled();
420
- });
421
- unmount();
422
- });
423
- it('should not insert anything when clipboard has no image', async () => {
424
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
425
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
426
- await act(async () => {
427
- stdin.write('\x16'); // Ctrl+V
428
- });
429
- await waitFor(() => {
430
- expect(clipboardUtils.clipboardHasImage).toHaveBeenCalled();
431
- });
432
- expect(clipboardUtils.saveClipboardImage).not.toHaveBeenCalled();
433
- expect(mockBuffer.setText).not.toHaveBeenCalled();
434
- unmount();
435
- });
436
- it('should handle image save failure gracefully', async () => {
437
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(true);
438
- vi.mocked(clipboardUtils.saveClipboardImage).mockResolvedValue(null);
439
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
440
- await act(async () => {
441
- stdin.write('\x16'); // Ctrl+V
442
- });
443
- await waitFor(() => {
444
- expect(clipboardUtils.saveClipboardImage).toHaveBeenCalled();
445
- });
446
- expect(mockBuffer.setText).not.toHaveBeenCalled();
447
- unmount();
448
- });
449
- it('should insert image path at cursor position with proper spacing', async () => {
450
- const imagePath = path.join('test', '.gemini-clipboard', 'clipboard-456.png');
451
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(true);
452
- vi.mocked(clipboardUtils.saveClipboardImage).mockResolvedValue(imagePath);
453
- // Set initial text and cursor position
454
- mockBuffer.text = 'Hello world';
455
- mockBuffer.cursor = [0, 5]; // Cursor after "Hello"
456
- vi.mocked(mockBuffer.getOffset).mockReturnValue(5);
457
- mockBuffer.lines = ['Hello world'];
458
- mockBuffer.replaceRangeByOffset = vi.fn();
459
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
460
- await act(async () => {
461
- stdin.write('\x16'); // Ctrl+V
462
- });
463
- await waitFor(() => {
464
- // Should insert at cursor position with spaces
465
- expect(mockBuffer.replaceRangeByOffset).toHaveBeenCalled();
466
- });
467
- // Get the actual call to see what path was used
468
- const actualCall = vi.mocked(mockBuffer.replaceRangeByOffset).mock
469
- .calls[0];
470
- expect(actualCall[0]).toBe(5); // start offset
471
- expect(actualCall[1]).toBe(5); // end offset
472
- expect(actualCall[2]).toBe(' @' + path.relative(path.join('test', 'project', 'src'), imagePath));
473
- unmount();
474
- });
475
- it('should handle errors during clipboard operations', async () => {
476
- const debugLoggerErrorSpy = vi
477
- .spyOn(debugLogger, 'error')
478
- .mockImplementation(() => { });
479
- vi.mocked(clipboardUtils.clipboardHasImage).mockRejectedValue(new Error('Clipboard error'));
480
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
481
- await act(async () => {
482
- stdin.write('\x16'); // Ctrl+V
483
- });
484
- await waitFor(() => {
485
- expect(debugLoggerErrorSpy).toHaveBeenCalledWith('Error handling paste:', expect.any(Error));
486
- });
487
- expect(mockBuffer.setText).not.toHaveBeenCalled();
488
- debugLoggerErrorSpy.mockRestore();
489
- unmount();
490
- });
491
- });
492
- describe('clipboard text paste', () => {
493
- it('should insert text from clipboard on Ctrl+V', async () => {
494
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
495
- vi.mocked(clipboardy.read).mockResolvedValue('pasted text');
496
- vi.mocked(mockBuffer.replaceRangeByOffset).mockClear();
497
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
498
- await act(async () => {
499
- stdin.write('\x16'); // Ctrl+V
500
- });
501
- await waitFor(() => {
502
- expect(clipboardy.read).toHaveBeenCalled();
503
- expect(mockBuffer.insert).toHaveBeenCalledWith('pasted text', expect.objectContaining({ paste: true }));
504
- });
505
- unmount();
506
- });
507
- it('should use OSC 52 when useOSC52Paste setting is enabled', async () => {
508
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
509
- const settings = createMockSettings({
510
- experimental: { useOSC52Paste: true },
511
- });
512
- const { stdout, stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), { settings });
513
- const writeSpy = vi.spyOn(stdout, 'write');
514
- await act(async () => {
515
- stdin.write('\x16'); // Ctrl+V
516
- });
517
- await waitFor(() => {
518
- expect(writeSpy).toHaveBeenCalledWith('\x1b]52;c;?\x07');
519
- });
520
- // Should NOT call clipboardy.read()
521
- expect(clipboardy.read).not.toHaveBeenCalled();
522
- unmount();
523
- });
524
- });
525
- it.each([
526
- {
527
- name: 'should complete a partial parent command',
528
- bufferText: '/mem',
529
- suggestions: [{ label: 'memory', value: 'memory', description: '...' }],
530
- activeIndex: 0,
531
- },
532
- {
533
- name: 'should append a sub-command when parent command is complete',
534
- bufferText: '/memory ',
535
- suggestions: [
536
- { label: 'show', value: 'show' },
537
- { label: 'add', value: 'add' },
538
- ],
539
- activeIndex: 1,
540
- },
541
- {
542
- name: 'should handle the backspace edge case correctly',
543
- bufferText: '/memory',
544
- suggestions: [
545
- { label: 'show', value: 'show' },
546
- { label: 'add', value: 'add' },
547
- ],
548
- activeIndex: 0,
549
- },
550
- {
551
- name: 'should complete a partial argument for a command',
552
- bufferText: '/chat resume fi-',
553
- suggestions: [{ label: 'fix-foo', value: 'fix-foo' }],
554
- activeIndex: 0,
555
- },
556
- ])('$name', async ({ bufferText, suggestions, activeIndex }) => {
557
- mockedUseCommandCompletion.mockReturnValue({
558
- ...mockCommandCompletion,
559
- showSuggestions: true,
560
- suggestions,
561
- activeSuggestionIndex: activeIndex,
562
- });
563
- props.buffer.setText(bufferText);
564
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
565
- uiActions,
566
- });
567
- await act(async () => stdin.write('\t'));
568
- await waitFor(() => expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(activeIndex));
569
- unmount();
570
- });
571
- it('should autocomplete on Enter when suggestions are active, without submitting', async () => {
572
- mockedUseCommandCompletion.mockReturnValue({
573
- ...mockCommandCompletion,
574
- showSuggestions: true,
575
- suggestions: [{ label: 'memory', value: 'memory' }],
576
- activeSuggestionIndex: 0,
577
- });
578
- props.buffer.setText('/mem');
579
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
580
- uiActions,
581
- });
582
- await act(async () => {
583
- stdin.write('\r');
584
- });
585
- await waitFor(() => {
586
- // The app should autocomplete the text, NOT submit.
587
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0);
588
- });
589
- expect(props.onSubmit).not.toHaveBeenCalled();
590
- unmount();
591
- });
592
- it('should complete a command based on its altNames', async () => {
593
- props.slashCommands = [
594
- {
595
- name: 'help',
596
- altNames: ['?'],
597
- kind: CommandKind.BUILT_IN,
598
- description: '...',
599
- },
600
- ];
601
- mockedUseCommandCompletion.mockReturnValue({
602
- ...mockCommandCompletion,
603
- showSuggestions: true,
604
- suggestions: [{ label: 'help', value: 'help' }],
605
- activeSuggestionIndex: 0,
606
- });
607
- props.buffer.setText('/?');
608
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
609
- uiActions,
610
- });
611
- await act(async () => {
612
- stdin.write('\t'); // Press Tab for autocomplete
613
- });
614
- await waitFor(() => expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0));
615
- unmount();
616
- });
617
- it('should not submit on Enter when the buffer is empty or only contains whitespace', async () => {
618
- props.buffer.setText(' '); // Set buffer to whitespace
619
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
620
- uiActions,
621
- });
622
- await act(async () => {
623
- stdin.write('\r'); // Press Enter
624
- });
625
- await waitFor(() => {
626
- expect(props.onSubmit).not.toHaveBeenCalled();
627
- });
628
- unmount();
629
- });
630
- it('should submit directly on Enter when isPerfectMatch is true', async () => {
631
- mockedUseCommandCompletion.mockReturnValue({
632
- ...mockCommandCompletion,
633
- showSuggestions: false,
634
- isPerfectMatch: true,
635
- });
636
- props.buffer.setText('/clear');
637
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
638
- uiActions,
639
- });
640
- await act(async () => {
641
- stdin.write('\r');
642
- });
643
- await waitFor(() => expect(props.onSubmit).toHaveBeenCalledWith('/clear'));
644
- unmount();
645
- });
646
- it('should execute perfect match on Enter even if suggestions are showing, if at first suggestion', async () => {
647
- mockedUseCommandCompletion.mockReturnValue({
648
- ...mockCommandCompletion,
649
- showSuggestions: true,
650
- suggestions: [
651
- { label: 'review', value: 'review' }, // Match is now at index 0
652
- { label: 'review-frontend', value: 'review-frontend' },
653
- ],
654
- activeSuggestionIndex: 0,
655
- isPerfectMatch: true,
656
- });
657
- props.buffer.text = '/review';
658
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
659
- uiActions,
660
- });
661
- await act(async () => {
662
- stdin.write('\r');
663
- });
664
- await waitFor(() => {
665
- expect(props.onSubmit).toHaveBeenCalledWith('/review');
666
- });
667
- unmount();
668
- });
669
- it('should autocomplete and NOT execute on Enter if a DIFFERENT suggestion is selected even if perfect match', async () => {
670
- mockedUseCommandCompletion.mockReturnValue({
671
- ...mockCommandCompletion,
672
- showSuggestions: true,
673
- suggestions: [
674
- { label: 'review', value: 'review' },
675
- { label: 'review-frontend', value: 'review-frontend' },
676
- ],
677
- activeSuggestionIndex: 1, // review-frontend selected (not the perfect match at 0)
678
- isPerfectMatch: true, // /review is a perfect match
679
- });
680
- props.buffer.text = '/review';
681
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
682
- uiActions,
683
- });
684
- await act(async () => {
685
- stdin.write('\r');
686
- });
687
- await waitFor(() => {
688
- // Should handle autocomplete for index 1
689
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(1);
690
- // Should NOT submit
691
- expect(props.onSubmit).not.toHaveBeenCalled();
692
- });
693
- unmount();
694
- });
695
- it('should submit directly on Enter when a complete leaf command is typed', async () => {
696
- mockedUseCommandCompletion.mockReturnValue({
697
- ...mockCommandCompletion,
698
- showSuggestions: false,
699
- isPerfectMatch: false, // Added explicit isPerfectMatch false
700
- });
701
- props.buffer.setText('/clear');
702
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
703
- uiActions,
704
- });
705
- await act(async () => {
706
- stdin.write('\r');
707
- });
708
- await waitFor(() => expect(props.onSubmit).toHaveBeenCalledWith('/clear'));
709
- unmount();
710
- });
711
- it('should auto-execute commands with autoExecute: true on Enter', async () => {
712
- const aboutCommand = {
713
- name: 'about',
714
- kind: CommandKind.BUILT_IN,
715
- description: 'About command',
716
- action: vi.fn(),
717
- autoExecute: true,
718
- };
719
- const suggestion = { label: 'about', value: 'about' };
720
- mockedUseCommandCompletion.mockReturnValue({
721
- ...mockCommandCompletion,
722
- showSuggestions: true,
723
- suggestions: [suggestion],
724
- activeSuggestionIndex: 0,
725
- getCommandFromSuggestion: vi.fn().mockReturnValue(aboutCommand),
726
- getCompletedText: vi.fn().mockReturnValue('/about'),
727
- slashCompletionRange: {
728
- completionStart: 1,
729
- completionEnd: 3, // "/ab" -> start at 1, end at 3
730
- getCommandFromSuggestion: vi.fn(),
731
- isArgumentCompletion: false,
732
- leafCommand: null,
733
- },
734
- });
735
- // User typed partial command
736
- props.buffer.setText('/ab');
737
- props.buffer.lines = ['/ab'];
738
- props.buffer.cursor = [0, 3];
739
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
740
- uiActions,
741
- });
742
- await act(async () => {
743
- stdin.write('\r'); // Enter
744
- });
745
- await waitFor(() => {
746
- // Should submit the full command constructed from buffer + suggestion
747
- expect(props.onSubmit).toHaveBeenCalledWith('/about');
748
- // Should NOT handle autocomplete (which just fills text)
749
- expect(mockCommandCompletion.handleAutocomplete).not.toHaveBeenCalled();
750
- });
751
- unmount();
752
- });
753
- it('should autocomplete commands with autoExecute: false on Enter', async () => {
754
- const shareCommand = {
755
- name: 'share',
756
- kind: CommandKind.BUILT_IN,
757
- description: 'Share conversation to file',
758
- action: vi.fn(),
759
- autoExecute: false, // Explicitly set to false
760
- };
761
- const suggestion = { label: 'share', value: 'share' };
762
- mockedUseCommandCompletion.mockReturnValue({
763
- ...mockCommandCompletion,
764
- showSuggestions: true,
765
- suggestions: [suggestion],
766
- activeSuggestionIndex: 0,
767
- getCommandFromSuggestion: vi.fn().mockReturnValue(shareCommand),
768
- getCompletedText: vi.fn().mockReturnValue('/share'),
769
- });
770
- props.buffer.setText('/sh');
771
- props.buffer.lines = ['/sh'];
772
- props.buffer.cursor = [0, 3];
773
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
774
- uiActions,
775
- });
776
- await act(async () => {
777
- stdin.write('\r'); // Enter
778
- });
779
- await waitFor(() => {
780
- // Should autocomplete to allow adding file argument
781
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0);
782
- expect(props.onSubmit).not.toHaveBeenCalled();
783
- });
784
- unmount();
785
- });
786
- it('should autocomplete on Tab, even for executable commands', async () => {
787
- const executableCommand = {
788
- name: 'about',
789
- kind: CommandKind.BUILT_IN,
790
- description: 'About info',
791
- action: vi.fn(),
792
- autoExecute: true,
793
- };
794
- const suggestion = { label: 'about', value: 'about' };
795
- mockedUseCommandCompletion.mockReturnValue({
796
- ...mockCommandCompletion,
797
- showSuggestions: true,
798
- suggestions: [suggestion],
799
- activeSuggestionIndex: 0,
800
- getCommandFromSuggestion: vi.fn().mockReturnValue(executableCommand),
801
- getCompletedText: vi.fn().mockReturnValue('/about'),
802
- });
803
- props.buffer.setText('/ab');
804
- props.buffer.lines = ['/ab'];
805
- props.buffer.cursor = [0, 3];
806
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
807
- uiActions,
808
- });
809
- await act(async () => {
810
- stdin.write('\t'); // Tab
811
- });
812
- await waitFor(() => {
813
- // Tab always autocompletes, never executes
814
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0);
815
- expect(props.onSubmit).not.toHaveBeenCalled();
816
- });
817
- unmount();
818
- });
819
- it('should autocomplete custom commands from .toml files on Enter', async () => {
820
- const customCommand = {
821
- name: 'find-capital',
822
- kind: CommandKind.FILE,
823
- description: 'Find capital of a country',
824
- action: vi.fn(),
825
- // No autoExecute flag - custom commands default to undefined
826
- };
827
- const suggestion = { label: 'find-capital', value: 'find-capital' };
828
- mockedUseCommandCompletion.mockReturnValue({
829
- ...mockCommandCompletion,
830
- showSuggestions: true,
831
- suggestions: [suggestion],
832
- activeSuggestionIndex: 0,
833
- getCommandFromSuggestion: vi.fn().mockReturnValue(customCommand),
834
- getCompletedText: vi.fn().mockReturnValue('/find-capital'),
835
- });
836
- props.buffer.setText('/find');
837
- props.buffer.lines = ['/find'];
838
- props.buffer.cursor = [0, 5];
839
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
840
- uiActions,
841
- });
842
- await act(async () => {
843
- stdin.write('\r'); // Enter
844
- });
845
- await waitFor(() => {
846
- // Should autocomplete (not execute) since autoExecute is undefined
847
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0);
848
- expect(props.onSubmit).not.toHaveBeenCalled();
849
- });
850
- unmount();
851
- });
852
- it('should auto-execute argument completion when command has autoExecute: true', async () => {
853
- // Simulates: /mcp auth <server> where user selects a server from completions
854
- const authCommand = {
855
- name: 'auth',
856
- kind: CommandKind.BUILT_IN,
857
- description: 'Authenticate with MCP server',
858
- action: vi.fn(),
859
- autoExecute: true,
860
- completion: vi.fn().mockResolvedValue(['server1', 'server2']),
861
- };
862
- const suggestion = { label: 'server1', value: 'server1' };
863
- mockedUseCommandCompletion.mockReturnValue({
864
- ...mockCommandCompletion,
865
- showSuggestions: true,
866
- suggestions: [suggestion],
867
- activeSuggestionIndex: 0,
868
- getCommandFromSuggestion: vi.fn().mockReturnValue(authCommand),
869
- getCompletedText: vi.fn().mockReturnValue('/mcp auth server1'),
870
- slashCompletionRange: {
871
- completionStart: 10,
872
- completionEnd: 10,
873
- getCommandFromSuggestion: vi.fn(),
874
- isArgumentCompletion: true,
875
- leafCommand: authCommand,
876
- },
877
- });
878
- props.buffer.setText('/mcp auth ');
879
- props.buffer.lines = ['/mcp auth '];
880
- props.buffer.cursor = [0, 10];
881
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
882
- uiActions,
883
- });
884
- await act(async () => {
885
- stdin.write('\r'); // Enter
886
- });
887
- await waitFor(() => {
888
- // Should auto-execute with the completed command
889
- expect(props.onSubmit).toHaveBeenCalledWith('/mcp auth server1');
890
- expect(mockCommandCompletion.handleAutocomplete).not.toHaveBeenCalled();
891
- });
892
- unmount();
893
- });
894
- it('should autocomplete argument completion when command has autoExecute: false', async () => {
895
- // Simulates: /extensions enable <ext> where multi-arg completions should NOT auto-execute
896
- const enableCommand = {
897
- name: 'enable',
898
- kind: CommandKind.BUILT_IN,
899
- description: 'Enable an extension',
900
- action: vi.fn(),
901
- autoExecute: false,
902
- completion: vi.fn().mockResolvedValue(['ext1 --scope user']),
903
- };
904
- const suggestion = {
905
- label: 'ext1 --scope user',
906
- value: 'ext1 --scope user',
907
- };
908
- mockedUseCommandCompletion.mockReturnValue({
909
- ...mockCommandCompletion,
910
- showSuggestions: true,
911
- suggestions: [suggestion],
912
- activeSuggestionIndex: 0,
913
- getCommandFromSuggestion: vi.fn().mockReturnValue(enableCommand),
914
- getCompletedText: vi
915
- .fn()
916
- .mockReturnValue('/extensions enable ext1 --scope user'),
917
- slashCompletionRange: {
918
- completionStart: 19,
919
- completionEnd: 19,
920
- getCommandFromSuggestion: vi.fn(),
921
- isArgumentCompletion: true,
922
- leafCommand: enableCommand,
923
- },
924
- });
925
- props.buffer.setText('/extensions enable ');
926
- props.buffer.lines = ['/extensions enable '];
927
- props.buffer.cursor = [0, 19];
928
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
929
- uiActions,
930
- });
931
- await act(async () => {
932
- stdin.write('\r'); // Enter
933
- });
934
- await waitFor(() => {
935
- // Should autocomplete (not execute) to allow user to modify
936
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0);
937
- expect(props.onSubmit).not.toHaveBeenCalled();
938
- });
939
- unmount();
940
- });
941
- it('should autocomplete command name even with autoExecute: true if command has completion function', async () => {
942
- // Simulates: /chat resu -> should NOT auto-execute, should autocomplete to show arg completions
943
- const resumeCommand = {
944
- name: 'resume',
945
- kind: CommandKind.BUILT_IN,
946
- description: 'Resume a conversation',
947
- action: vi.fn(),
948
- autoExecute: true,
949
- completion: vi.fn().mockResolvedValue(['chat1', 'chat2']),
950
- };
951
- const suggestion = { label: 'resume', value: 'resume' };
952
- mockedUseCommandCompletion.mockReturnValue({
953
- ...mockCommandCompletion,
954
- showSuggestions: true,
955
- suggestions: [suggestion],
956
- activeSuggestionIndex: 0,
957
- getCommandFromSuggestion: vi.fn().mockReturnValue(resumeCommand),
958
- getCompletedText: vi.fn().mockReturnValue('/chat resume'),
959
- slashCompletionRange: {
960
- completionStart: 6,
961
- completionEnd: 10,
962
- getCommandFromSuggestion: vi.fn(),
963
- isArgumentCompletion: false,
964
- leafCommand: null,
965
- },
966
- });
967
- props.buffer.setText('/chat resu');
968
- props.buffer.lines = ['/chat resu'];
969
- props.buffer.cursor = [0, 10];
970
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
971
- uiActions,
972
- });
973
- await act(async () => {
974
- stdin.write('\r'); // Enter
975
- });
976
- await waitFor(() => {
977
- // Should autocomplete to allow selecting an argument, NOT auto-execute
978
- expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0);
979
- expect(props.onSubmit).not.toHaveBeenCalled();
980
- });
981
- unmount();
982
- });
983
- it('should autocomplete an @-path on Enter without submitting', async () => {
984
- mockedUseCommandCompletion.mockReturnValue({
985
- ...mockCommandCompletion,
986
- showSuggestions: true,
987
- suggestions: [{ label: 'index.ts', value: 'index.ts' }],
988
- activeSuggestionIndex: 0,
989
- });
990
- props.buffer.setText('@src/components/');
991
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
992
- uiActions,
993
- });
994
- await act(async () => {
995
- stdin.write('\r');
996
- });
997
- await waitFor(() => expect(mockCommandCompletion.handleAutocomplete).toHaveBeenCalledWith(0));
998
- expect(props.onSubmit).not.toHaveBeenCalled();
999
- unmount();
1000
- });
1001
- it('should add a newline on enter when the line ends with a backslash', async () => {
1002
- // This test simulates multi-line input, not submission
1003
- mockBuffer.text = 'first line\\';
1004
- mockBuffer.cursor = [0, 11];
1005
- mockBuffer.lines = ['first line\\'];
1006
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1007
- uiActions,
1008
- });
1009
- await act(async () => {
1010
- stdin.write('\r');
1011
- });
1012
- await waitFor(() => {
1013
- expect(props.buffer.backspace).toHaveBeenCalled();
1014
- expect(props.buffer.newline).toHaveBeenCalled();
1015
- });
1016
- expect(props.onSubmit).not.toHaveBeenCalled();
1017
- unmount();
1018
- });
1019
- it('should clear the buffer on Ctrl+C if it has text', async () => {
1020
- await act(async () => {
1021
- props.buffer.setText('some text to clear');
1022
- });
1023
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1024
- uiActions,
1025
- });
1026
- await act(async () => {
1027
- stdin.write('\x03'); // Ctrl+C character
1028
- });
1029
- await waitFor(() => {
1030
- expect(props.buffer.setText).toHaveBeenCalledWith('');
1031
- expect(mockCommandCompletion.resetCompletionState).toHaveBeenCalled();
1032
- });
1033
- expect(props.onSubmit).not.toHaveBeenCalled();
1034
- unmount();
1035
- });
1036
- it('should render correctly in plan mode', async () => {
1037
- props.approvalMode = ApprovalMode.PLAN;
1038
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1039
- await waitFor(() => {
1040
- const frame = stdout.lastFrame();
1041
- // In plan mode it uses '>' but with success color.
1042
- // We check that it contains '>' and not '*' or '!'.
1043
- expect(frame).toContain('>');
1044
- expect(frame).not.toContain('*');
1045
- expect(frame).not.toContain('!');
1046
- });
1047
- unmount();
1048
- });
1049
- it('should NOT clear the buffer on Ctrl+C if it is empty', async () => {
1050
- props.buffer.text = '';
1051
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1052
- uiActions,
1053
- });
1054
- await act(async () => {
1055
- stdin.write('\x03'); // Ctrl+C character
1056
- });
1057
- await waitFor(() => {
1058
- expect(props.buffer.setText).not.toHaveBeenCalled();
1059
- });
1060
- unmount();
1061
- });
1062
- it('should call setBannerVisible(false) when clear screen key is pressed', async () => {
1063
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1064
- uiActions,
1065
- });
1066
- await act(async () => {
1067
- stdin.write('\x0C'); // Ctrl+L
1068
- });
1069
- await waitFor(() => {
1070
- expect(props.setBannerVisible).toHaveBeenCalledWith(false);
1071
- });
1072
- unmount();
1073
- });
1074
- describe('Background Color Styles', () => {
1075
- beforeEach(() => {
1076
- vi.mocked(isLowColorDepth).mockReturnValue(false);
1077
- });
1078
- afterEach(() => {
1079
- vi.restoreAllMocks();
1080
- });
1081
- it('should render with background color by default', async () => {
1082
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1083
- await waitFor(() => {
1084
- const frame = stdout.lastFrame();
1085
- expect(frame).toContain('▀');
1086
- expect(frame).toContain('▄');
1087
- });
1088
- unmount();
1089
- });
1090
- it.each([
1091
- { color: 'black', name: 'black' },
1092
- { color: '#000000', name: '#000000' },
1093
- { color: '#000', name: '#000' },
1094
- { color: undefined, name: 'default (black)' },
1095
- { color: 'white', name: 'white' },
1096
- { color: '#ffffff', name: '#ffffff' },
1097
- { color: '#fff', name: '#fff' },
1098
- ])('should render with safe grey background but NO side borders in 8-bit mode when background is $name', async ({ color }) => {
1099
- vi.mocked(isLowColorDepth).mockReturnValue(true);
1100
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1101
- uiState: {
1102
- terminalBackgroundColor: color,
1103
- },
1104
- });
1105
- const isWhite = color === 'white' || color === '#ffffff' || color === '#fff';
1106
- const expectedBgColor = isWhite ? '#eeeeee' : '#1c1c1c';
1107
- await waitFor(() => {
1108
- const frame = stdout.lastFrame();
1109
- // Use chalk to get the expected background color escape sequence
1110
- const bgCheck = chalk.bgHex(expectedBgColor)(' ');
1111
- const bgCode = bgCheck.substring(0, bgCheck.indexOf(' '));
1112
- // Background color code should be present
1113
- expect(frame).toContain(bgCode);
1114
- // Background characters should be rendered
1115
- expect(frame).toContain('▀');
1116
- expect(frame).toContain('▄');
1117
- // Side borders should STILL be removed
1118
- expect(frame).not.toContain('│');
1119
- });
1120
- unmount();
1121
- });
1122
- it('should NOT render with background color but SHOULD render horizontal lines when color depth is < 24 and background is NOT black', async () => {
1123
- vi.mocked(isLowColorDepth).mockReturnValue(true);
1124
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1125
- uiState: {
1126
- terminalBackgroundColor: '#333333',
1127
- },
1128
- });
1129
- await waitFor(() => {
1130
- const frame = stdout.lastFrame();
1131
- expect(frame).not.toContain('▀');
1132
- expect(frame).not.toContain('▄');
1133
- // It SHOULD have horizontal fallback lines
1134
- expect(frame).toContain('─');
1135
- // It SHOULD NOT have vertical side borders (standard Box borders have │)
1136
- expect(frame).not.toContain('│');
1137
- });
1138
- unmount();
1139
- });
1140
- it('should handle 4-bit color mode (16 colors) as low color depth', async () => {
1141
- vi.mocked(isLowColorDepth).mockReturnValue(true);
1142
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1143
- await waitFor(() => {
1144
- const frame = stdout.lastFrame();
1145
- expect(frame).toContain('▀');
1146
- expect(frame).not.toContain('│');
1147
- });
1148
- unmount();
1149
- });
1150
- it('should render horizontal lines (but NO background) in 8-bit mode when background is blue', async () => {
1151
- vi.mocked(isLowColorDepth).mockReturnValue(true);
1152
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1153
- uiState: {
1154
- terminalBackgroundColor: 'blue',
1155
- },
1156
- });
1157
- await waitFor(() => {
1158
- const frame = stdout.lastFrame();
1159
- // Should NOT have background characters
1160
- expect(frame).not.toContain('▀');
1161
- expect(frame).not.toContain('▄');
1162
- // Should HAVE horizontal lines from the fallback Box borders
1163
- // Box style "round" uses these for top/bottom
1164
- expect(frame).toContain('─');
1165
- // Should NOT have vertical side borders
1166
- expect(frame).not.toContain('│');
1167
- });
1168
- unmount();
1169
- });
1170
- it('should render with plain borders when useBackgroundColor is false', async () => {
1171
- props.config.getUseBackgroundColor = () => false;
1172
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1173
- await waitFor(() => {
1174
- const frame = stdout.lastFrame();
1175
- expect(frame).not.toContain('▀');
1176
- expect(frame).not.toContain('▄');
1177
- // Check for Box borders (round style uses unicode box chars)
1178
- expect(frame).toMatch(/[─│┐└┘┌]/);
1179
- });
1180
- unmount();
1181
- });
1182
- });
1183
- describe('cursor-based completion trigger', () => {
1184
- it.each([
1185
- {
1186
- name: 'should trigger completion when cursor is after @ without spaces',
1187
- text: '@src/components',
1188
- cursor: [0, 15],
1189
- showSuggestions: true,
1190
- },
1191
- {
1192
- name: 'should trigger completion when cursor is after / without spaces',
1193
- text: '/memory',
1194
- cursor: [0, 7],
1195
- showSuggestions: true,
1196
- },
1197
- {
1198
- name: 'should NOT trigger completion when cursor is after space following @',
1199
- text: '@src/file.ts hello',
1200
- cursor: [0, 18],
1201
- showSuggestions: false,
1202
- },
1203
- {
1204
- name: 'should NOT trigger completion when cursor is after space following /',
1205
- text: '/memory add',
1206
- cursor: [0, 11],
1207
- showSuggestions: false,
1208
- },
1209
- {
1210
- name: 'should NOT trigger completion when cursor is not after @ or /',
1211
- text: 'hello world',
1212
- cursor: [0, 5],
1213
- showSuggestions: false,
1214
- },
1215
- {
1216
- name: 'should handle multiline text correctly',
1217
- text: 'first line\n/memory',
1218
- cursor: [1, 7],
1219
- showSuggestions: false,
1220
- },
1221
- {
1222
- name: 'should handle Unicode characters (emojis) correctly in paths',
1223
- text: '@src/file👍.txt',
1224
- cursor: [0, 14],
1225
- showSuggestions: true,
1226
- },
1227
- {
1228
- name: 'should handle Unicode characters with spaces after them',
1229
- text: '@src/file👍.txt hello',
1230
- cursor: [0, 20],
1231
- showSuggestions: false,
1232
- },
1233
- {
1234
- name: 'should handle escaped spaces in paths correctly',
1235
- text: '@src/my\\ file.txt',
1236
- cursor: [0, 16],
1237
- showSuggestions: true,
1238
- },
1239
- {
1240
- name: 'should NOT trigger completion after unescaped space following escaped space',
1241
- text: '@path/my\\ file.txt hello',
1242
- cursor: [0, 24],
1243
- showSuggestions: false,
1244
- },
1245
- {
1246
- name: 'should handle multiple escaped spaces in paths',
1247
- text: '@docs/my\\ long\\ file\\ name.md',
1248
- cursor: [0, 29],
1249
- showSuggestions: true,
1250
- },
1251
- {
1252
- name: 'should handle escaped spaces in slash commands',
1253
- text: '/memory\\ test',
1254
- cursor: [0, 13],
1255
- showSuggestions: true,
1256
- },
1257
- {
1258
- name: 'should handle Unicode characters with escaped spaces',
1259
- text: `@${path.join('files', 'emoji\\ 👍\\ test.txt')}`,
1260
- cursor: [0, 25],
1261
- showSuggestions: true,
1262
- },
1263
- ])('$name', async ({ text, cursor, showSuggestions }) => {
1264
- mockBuffer.text = text;
1265
- mockBuffer.lines = text.split('\n');
1266
- mockBuffer.cursor = cursor;
1267
- mockedUseCommandCompletion.mockReturnValue({
1268
- ...mockCommandCompletion,
1269
- showSuggestions,
1270
- suggestions: showSuggestions
1271
- ? [{ label: 'suggestion', value: 'suggestion' }]
1272
- : [],
1273
- });
1274
- const { unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1275
- uiActions,
1276
- });
1277
- await waitFor(() => {
1278
- expect(mockedUseCommandCompletion).toHaveBeenCalledWith(mockBuffer, path.join('test', 'project', 'src'), mockSlashCommands, mockCommandContext, false, false, expect.any(Object));
1279
- });
1280
- unmount();
1281
- });
1282
- });
1283
- describe('vim mode', () => {
1284
- it.each([
1285
- {
1286
- name: 'should not call buffer.handleInput when vim handles input',
1287
- vimHandled: true,
1288
- expectBufferHandleInput: false,
1289
- },
1290
- {
1291
- name: 'should call buffer.handleInput when vim does not handle input',
1292
- vimHandled: false,
1293
- expectBufferHandleInput: true,
1294
- },
1295
- {
1296
- name: 'should call handleInput when vim mode is disabled',
1297
- vimHandled: false,
1298
- expectBufferHandleInput: true,
1299
- },
1300
- ])('$name', async ({ vimHandled, expectBufferHandleInput }) => {
1301
- props.vimHandleInput = vi.fn().mockReturnValue(vimHandled);
1302
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1303
- await act(async () => stdin.write('i'));
1304
- await waitFor(() => {
1305
- expect(props.vimHandleInput).toHaveBeenCalled();
1306
- if (expectBufferHandleInput) {
1307
- expect(mockBuffer.handleInput).toHaveBeenCalled();
1308
- }
1309
- else {
1310
- expect(mockBuffer.handleInput).not.toHaveBeenCalled();
1311
- }
1312
- });
1313
- unmount();
1314
- });
1315
- });
1316
- describe('unfocused paste', () => {
1317
- it('should handle bracketed paste when not focused', async () => {
1318
- props.focus = false;
1319
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1320
- await act(async () => {
1321
- stdin.write('\x1B[200~pasted text\x1B[201~');
1322
- });
1323
- await waitFor(() => {
1324
- expect(mockBuffer.handleInput).toHaveBeenCalledWith(expect.objectContaining({
1325
- name: 'paste',
1326
- sequence: 'pasted text',
1327
- }));
1328
- });
1329
- unmount();
1330
- });
1331
- it('should ignore regular keypresses when not focused', async () => {
1332
- props.focus = false;
1333
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1334
- await act(async () => {
1335
- stdin.write('a');
1336
- });
1337
- await waitFor(() => { });
1338
- expect(mockBuffer.handleInput).not.toHaveBeenCalled();
1339
- unmount();
1340
- });
1341
- });
1342
- describe('Highlighting and Cursor Display', () => {
1343
- describe('single-line scenarios', () => {
1344
- it.each([
1345
- {
1346
- name: 'mid-word',
1347
- text: 'hello world',
1348
- visualCursor: [0, 3],
1349
- expected: `hel${chalk.inverse('l')}o world`,
1350
- },
1351
- {
1352
- name: 'at the beginning of the line',
1353
- text: 'hello',
1354
- visualCursor: [0, 0],
1355
- expected: `${chalk.inverse('h')}ello`,
1356
- },
1357
- {
1358
- name: 'at the end of the line',
1359
- text: 'hello',
1360
- visualCursor: [0, 5],
1361
- expected: `hello${chalk.inverse(' ')}`,
1362
- },
1363
- {
1364
- name: 'on a highlighted token',
1365
- text: 'run @path/to/file',
1366
- visualCursor: [0, 9],
1367
- expected: `@path/${chalk.inverse('t')}o/file`,
1368
- },
1369
- {
1370
- name: 'for multi-byte unicode characters',
1371
- text: 'hello 👍 world',
1372
- visualCursor: [0, 6],
1373
- expected: `hello ${chalk.inverse('👍')} world`,
1374
- },
1375
- {
1376
- name: 'at the end of a line with unicode characters',
1377
- text: 'hello 👍',
1378
- visualCursor: [0, 8],
1379
- expected: `hello 👍${chalk.inverse(' ')}`,
1380
- },
1381
- {
1382
- name: 'on an empty line',
1383
- text: '',
1384
- visualCursor: [0, 0],
1385
- expected: chalk.inverse(' '),
1386
- },
1387
- {
1388
- name: 'on a space between words',
1389
- text: 'hello world',
1390
- visualCursor: [0, 5],
1391
- expected: `hello${chalk.inverse(' ')}world`,
1392
- },
1393
- ])('should display cursor correctly $name', async ({ text, visualCursor, expected }) => {
1394
- mockBuffer.text = text;
1395
- mockBuffer.lines = [text];
1396
- mockBuffer.viewportVisualLines = [text];
1397
- mockBuffer.visualCursor = visualCursor;
1398
- props.config.getUseBackgroundColor = () => false;
1399
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1400
- await waitFor(() => {
1401
- const frame = stdout.lastFrame();
1402
- expect(frame).toContain(expected);
1403
- });
1404
- unmount();
1405
- });
1406
- });
1407
- describe('multi-line scenarios', () => {
1408
- it.each([
1409
- {
1410
- name: 'in the middle of a line',
1411
- text: 'first line\nsecond line\nthird line',
1412
- visualCursor: [1, 3],
1413
- visualToLogicalMap: [
1414
- [0, 0],
1415
- [1, 0],
1416
- [2, 0],
1417
- ],
1418
- expected: `sec${chalk.inverse('o')}nd line`,
1419
- },
1420
- {
1421
- name: 'at the beginning of a line',
1422
- text: 'first line\nsecond line',
1423
- visualCursor: [1, 0],
1424
- visualToLogicalMap: [
1425
- [0, 0],
1426
- [1, 0],
1427
- ],
1428
- expected: `${chalk.inverse('s')}econd line`,
1429
- },
1430
- {
1431
- name: 'at the end of a line',
1432
- text: 'first line\nsecond line',
1433
- visualCursor: [0, 10],
1434
- visualToLogicalMap: [
1435
- [0, 0],
1436
- [1, 0],
1437
- ],
1438
- expected: `first line${chalk.inverse(' ')}`,
1439
- },
1440
- ])('should display cursor correctly $name in a multiline block', async ({ text, visualCursor, expected, visualToLogicalMap }) => {
1441
- mockBuffer.text = text;
1442
- mockBuffer.lines = text.split('\n');
1443
- mockBuffer.viewportVisualLines = text.split('\n');
1444
- mockBuffer.visualCursor = visualCursor;
1445
- mockBuffer.visualToLogicalMap = visualToLogicalMap;
1446
- props.config.getUseBackgroundColor = () => false;
1447
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1448
- await waitFor(() => {
1449
- const frame = stdout.lastFrame();
1450
- expect(frame).toContain(expected);
1451
- });
1452
- unmount();
1453
- });
1454
- it('should display cursor on a blank line in a multiline block', async () => {
1455
- const text = 'first line\n\nthird line';
1456
- mockBuffer.text = text;
1457
- mockBuffer.lines = text.split('\n');
1458
- mockBuffer.viewportVisualLines = text.split('\n');
1459
- mockBuffer.visualCursor = [1, 0]; // cursor on the blank line
1460
- mockBuffer.visualToLogicalMap = [
1461
- [0, 0],
1462
- [1, 0],
1463
- [2, 0],
1464
- ];
1465
- props.config.getUseBackgroundColor = () => false;
1466
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1467
- await waitFor(() => {
1468
- const frame = stdout.lastFrame();
1469
- const lines = frame.split('\n');
1470
- // The line with the cursor should just be an inverted space inside the box border
1471
- expect(lines.find((l) => l.includes(chalk.inverse(' ')))).not.toBeUndefined();
1472
- });
1473
- unmount();
1474
- });
1475
- });
1476
- });
1477
- describe('multiline rendering', () => {
1478
- it('should correctly render multiline input including blank lines', async () => {
1479
- const text = 'hello\n\nworld';
1480
- mockBuffer.text = text;
1481
- mockBuffer.lines = text.split('\n');
1482
- mockBuffer.viewportVisualLines = text.split('\n');
1483
- mockBuffer.allVisualLines = text.split('\n');
1484
- mockBuffer.visualCursor = [2, 5]; // cursor at the end of "world"
1485
- // Provide a visual-to-logical mapping for each visual line
1486
- mockBuffer.visualToLogicalMap = [
1487
- [0, 0],
1488
- [1, 0],
1489
- [2, 0],
1490
- ];
1491
- props.config.getUseBackgroundColor = () => false;
1492
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1493
- await waitFor(() => {
1494
- const frame = stdout.lastFrame();
1495
- // Check that all lines, including the empty one, are rendered.
1496
- // This implicitly tests that the Box wrapper provides height for the empty line.
1497
- expect(frame).toContain('hello');
1498
- expect(frame).toContain(`world${chalk.inverse(' ')}`);
1499
- const outputLines = frame.split('\n');
1500
- // The number of lines should be 2 for the border plus 3 for the content.
1501
- expect(outputLines.length).toBe(5);
1502
- });
1503
- unmount();
1504
- });
1505
- });
1506
- describe('multiline paste', () => {
1507
- it.each([
1508
- {
1509
- description: 'with \n newlines',
1510
- pastedText: 'This \n is \n a \n multiline \n paste.',
1511
- },
1512
- {
1513
- description: 'with extra slashes before \n newlines',
1514
- pastedText: 'This \\\n is \\\n a \\\n multiline \\\n paste.',
1515
- },
1516
- {
1517
- description: 'with \r\n newlines',
1518
- pastedText: 'This\r\nis\r\na\r\nmultiline\r\npaste.',
1519
- },
1520
- ])('should handle multiline paste $description', async ({ pastedText }) => {
1521
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1522
- // Simulate a bracketed paste event from the terminal
1523
- await act(async () => {
1524
- stdin.write(`\x1b[200~${pastedText}\x1b[201~`);
1525
- });
1526
- await waitFor(() => {
1527
- // Verify that the buffer's handleInput was called once with the full text
1528
- expect(props.buffer.handleInput).toHaveBeenCalledTimes(1);
1529
- expect(props.buffer.handleInput).toHaveBeenCalledWith(expect.objectContaining({
1530
- name: 'paste',
1531
- sequence: pastedText,
1532
- }));
1533
- });
1534
- unmount();
1535
- });
1536
- });
1537
- describe('large paste placeholder', () => {
1538
- it('should handle large clipboard paste (lines > 5) by calling buffer.insert', async () => {
1539
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
1540
- const largeText = '1\n2\n3\n4\n5\n6';
1541
- vi.mocked(clipboardy.read).mockResolvedValue(largeText);
1542
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1543
- await act(async () => {
1544
- stdin.write('\x16'); // Ctrl+V
1545
- });
1546
- await waitFor(() => {
1547
- expect(mockBuffer.insert).toHaveBeenCalledWith(largeText, expect.objectContaining({ paste: true }));
1548
- });
1549
- unmount();
1550
- });
1551
- it('should handle large clipboard paste (chars > 500) by calling buffer.insert', async () => {
1552
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
1553
- const largeText = 'a'.repeat(501);
1554
- vi.mocked(clipboardy.read).mockResolvedValue(largeText);
1555
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1556
- await act(async () => {
1557
- stdin.write('\x16'); // Ctrl+V
1558
- });
1559
- await waitFor(() => {
1560
- expect(mockBuffer.insert).toHaveBeenCalledWith(largeText, expect.objectContaining({ paste: true }));
1561
- });
1562
- unmount();
1563
- });
1564
- it('should handle normal clipboard paste by calling buffer.insert', async () => {
1565
- vi.mocked(clipboardUtils.clipboardHasImage).mockResolvedValue(false);
1566
- const smallText = 'hello world';
1567
- vi.mocked(clipboardy.read).mockResolvedValue(smallText);
1568
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1569
- await act(async () => {
1570
- stdin.write('\x16'); // Ctrl+V
1571
- });
1572
- await waitFor(() => {
1573
- expect(mockBuffer.insert).toHaveBeenCalledWith(smallText, expect.objectContaining({ paste: true }));
1574
- });
1575
- unmount();
1576
- });
1577
- it('should replace placeholder with actual content on submit', async () => {
1578
- // Setup buffer to have the placeholder
1579
- const largeText = '1\n2\n3\n4\n5\n6';
1580
- const id = '[Pasted Text: 6 lines]';
1581
- mockBuffer.text = `Check this: ${id}`;
1582
- mockBuffer.pastedContent = { [id]: largeText };
1583
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1584
- await act(async () => {
1585
- stdin.write('\r'); // Enter
1586
- });
1587
- await waitFor(() => {
1588
- expect(props.onSubmit).toHaveBeenCalledWith(`Check this: ${largeText}`);
1589
- });
1590
- unmount();
1591
- });
1592
- });
1593
- describe('paste auto-submission protection', () => {
1594
- beforeEach(() => {
1595
- vi.useFakeTimers();
1596
- mockedUseKittyKeyboardProtocol.mockReturnValue({
1597
- enabled: false,
1598
- checking: false,
1599
- });
1600
- });
1601
- afterEach(() => {
1602
- vi.useRealTimers();
1603
- vi.restoreAllMocks();
1604
- });
1605
- it('should prevent auto-submission immediately after an unsafe paste', async () => {
1606
- // isTerminalPasteTrusted will be false due to beforeEach setup.
1607
- props.buffer.text = 'some command';
1608
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1609
- await act(async () => {
1610
- await vi.runAllTimersAsync();
1611
- });
1612
- // Simulate a paste operation (this should set the paste protection)
1613
- await act(async () => {
1614
- stdin.write(`\x1b[200~pasted content\x1b[201~`);
1615
- });
1616
- // Simulate an Enter key press immediately after paste
1617
- await act(async () => {
1618
- stdin.write('\r');
1619
- });
1620
- await act(async () => {
1621
- await vi.runAllTimersAsync();
1622
- });
1623
- // Verify that onSubmit was NOT called due to recent paste protection
1624
- expect(props.onSubmit).not.toHaveBeenCalled();
1625
- // It should call newline() instead
1626
- expect(props.buffer.newline).toHaveBeenCalled();
1627
- unmount();
1628
- });
1629
- it('should allow submission after unsafe paste protection timeout', async () => {
1630
- // isTerminalPasteTrusted will be false due to beforeEach setup.
1631
- props.buffer.text = 'pasted text';
1632
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1633
- await act(async () => {
1634
- await vi.runAllTimersAsync();
1635
- });
1636
- // Simulate a paste operation (this sets the protection)
1637
- await act(async () => {
1638
- stdin.write('\x1b[200~pasted text\x1b[201~');
1639
- });
1640
- await act(async () => {
1641
- await vi.runAllTimersAsync();
1642
- });
1643
- // Advance timers past the protection timeout
1644
- await act(async () => {
1645
- await vi.advanceTimersByTimeAsync(50);
1646
- });
1647
- // Now Enter should work normally
1648
- await act(async () => {
1649
- stdin.write('\r');
1650
- });
1651
- await act(async () => {
1652
- await vi.runAllTimersAsync();
1653
- });
1654
- expect(props.onSubmit).toHaveBeenCalledWith('pasted text');
1655
- expect(props.buffer.newline).not.toHaveBeenCalled();
1656
- unmount();
1657
- });
1658
- it.each([
1659
- {
1660
- name: 'kitty',
1661
- setup: () => mockedUseKittyKeyboardProtocol.mockReturnValue({
1662
- enabled: true,
1663
- checking: false,
1664
- }),
1665
- },
1666
- ])('should allow immediate submission for a trusted paste ($name)', async ({ setup }) => {
1667
- setup();
1668
- props.buffer.text = 'pasted command';
1669
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1670
- await act(async () => {
1671
- await vi.runAllTimersAsync();
1672
- });
1673
- // Simulate a paste operation
1674
- await act(async () => {
1675
- stdin.write('\x1b[200~some pasted stuff\x1b[201~');
1676
- });
1677
- await act(async () => {
1678
- await vi.runAllTimersAsync();
1679
- });
1680
- // Simulate an Enter key press immediately after paste
1681
- await act(async () => {
1682
- stdin.write('\r');
1683
- });
1684
- await act(async () => {
1685
- await vi.runAllTimersAsync();
1686
- });
1687
- // Verify that onSubmit was called
1688
- expect(props.onSubmit).toHaveBeenCalledWith('pasted command');
1689
- unmount();
1690
- });
1691
- it('should not interfere with normal Enter key submission when no recent paste', async () => {
1692
- // Set up buffer with text before rendering to ensure submission works
1693
- props.buffer.text = 'normal command';
1694
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1695
- await act(async () => {
1696
- await vi.runAllTimersAsync();
1697
- });
1698
- // Press Enter without any recent paste
1699
- await act(async () => {
1700
- stdin.write('\r');
1701
- });
1702
- await act(async () => {
1703
- await vi.runAllTimersAsync();
1704
- });
1705
- // Verify that onSubmit was called normally
1706
- expect(props.onSubmit).toHaveBeenCalledWith('normal command');
1707
- unmount();
1708
- });
1709
- });
1710
- describe('enhanced input UX - keyboard shortcuts', () => {
1711
- beforeEach(() => vi.useFakeTimers());
1712
- afterEach(() => vi.useRealTimers());
1713
- it('should clear buffer on Ctrl-C', async () => {
1714
- const onEscapePromptChange = vi.fn();
1715
- props.onEscapePromptChange = onEscapePromptChange;
1716
- props.buffer.setText('text to clear');
1717
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1718
- await act(async () => {
1719
- stdin.write('\x03');
1720
- vi.advanceTimersByTime(100);
1721
- expect(props.buffer.setText).toHaveBeenCalledWith('');
1722
- expect(mockCommandCompletion.resetCompletionState).toHaveBeenCalled();
1723
- });
1724
- unmount();
1725
- });
1726
- it('should submit /rewind on double ESC when buffer is empty', async () => {
1727
- const onEscapePromptChange = vi.fn();
1728
- props.onEscapePromptChange = onEscapePromptChange;
1729
- props.buffer.setText('');
1730
- vi.mocked(props.buffer.setText).mockClear();
1731
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
1732
- uiState: {
1733
- history: [{ id: 1, type: 'user', text: 'test' }],
1734
- },
1735
- });
1736
- await act(async () => {
1737
- stdin.write('\x1B\x1B');
1738
- vi.advanceTimersByTime(100);
1739
- });
1740
- await waitFor(() => {
1741
- expect(props.onSubmit).toHaveBeenCalledWith('/rewind');
1742
- });
1743
- unmount();
1744
- });
1745
- it('should clear the buffer on esc esc if it has text', async () => {
1746
- const onEscapePromptChange = vi.fn();
1747
- props.onEscapePromptChange = onEscapePromptChange;
1748
- props.buffer.setText('some text');
1749
- vi.mocked(props.buffer.setText).mockClear();
1750
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1751
- await act(async () => {
1752
- stdin.write('\x1B\x1B');
1753
- vi.advanceTimersByTime(100);
1754
- expect(props.buffer.setText).toHaveBeenCalledWith('');
1755
- expect(props.onSubmit).not.toHaveBeenCalledWith('/rewind');
1756
- });
1757
- unmount();
1758
- });
1759
- it('should reset escape state on any non-ESC key', async () => {
1760
- const onEscapePromptChange = vi.fn();
1761
- props.onEscapePromptChange = onEscapePromptChange;
1762
- props.buffer.setText('some text');
1763
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1764
- await act(async () => {
1765
- stdin.write('\x1B');
1766
- await waitFor(() => {
1767
- expect(onEscapePromptChange).toHaveBeenCalledWith(false);
1768
- });
1769
- });
1770
- await act(async () => {
1771
- stdin.write('a');
1772
- await waitFor(() => {
1773
- expect(onEscapePromptChange).toHaveBeenCalledWith(false);
1774
- });
1775
- });
1776
- unmount();
1777
- });
1778
- it('should handle ESC in shell mode by disabling shell mode', async () => {
1779
- props.shellModeActive = true;
1780
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1781
- await act(async () => {
1782
- stdin.write('\x1B');
1783
- vi.advanceTimersByTime(100);
1784
- expect(props.setShellModeActive).toHaveBeenCalledWith(false);
1785
- });
1786
- unmount();
1787
- });
1788
- it('should handle ESC when completion suggestions are showing', async () => {
1789
- mockedUseCommandCompletion.mockReturnValue({
1790
- ...mockCommandCompletion,
1791
- showSuggestions: true,
1792
- suggestions: [{ label: 'suggestion', value: 'suggestion' }],
1793
- });
1794
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1795
- await act(async () => {
1796
- stdin.write('\x1B');
1797
- vi.advanceTimersByTime(100);
1798
- expect(mockCommandCompletion.resetCompletionState).toHaveBeenCalled();
1799
- });
1800
- unmount();
1801
- });
1802
- it('should not call onEscapePromptChange when not provided', async () => {
1803
- props.onEscapePromptChange = undefined;
1804
- props.buffer.setText('some text');
1805
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1806
- await act(async () => {
1807
- await vi.runAllTimersAsync();
1808
- });
1809
- await act(async () => {
1810
- stdin.write('\x1B');
1811
- });
1812
- await act(async () => {
1813
- await vi.runAllTimersAsync();
1814
- });
1815
- unmount();
1816
- });
1817
- it('should not interfere with existing keyboard shortcuts', async () => {
1818
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1819
- await act(async () => {
1820
- stdin.write('\x0C');
1821
- });
1822
- await waitFor(() => expect(props.onClearScreen).toHaveBeenCalled());
1823
- await act(async () => {
1824
- stdin.write('\x01');
1825
- });
1826
- await waitFor(() => expect(props.buffer.move).toHaveBeenCalledWith('home'));
1827
- unmount();
1828
- });
1829
- });
1830
- describe('reverse search', () => {
1831
- beforeEach(async () => {
1832
- props.shellModeActive = true;
1833
- vi.mocked(useShellHistory).mockReturnValue({
1834
- history: ['echo hello', 'echo world', 'ls'],
1835
- getPreviousCommand: vi.fn(),
1836
- getNextCommand: vi.fn(),
1837
- addCommandToHistory: vi.fn(),
1838
- resetHistoryPosition: vi.fn(),
1839
- });
1840
- });
1841
- it('invokes reverse search on Ctrl+R', async () => {
1842
- // Mock the reverse search completion to return suggestions
1843
- mockedUseReverseSearchCompletion.mockReturnValue({
1844
- ...mockReverseSearchCompletion,
1845
- suggestions: [
1846
- { label: 'echo hello', value: 'echo hello' },
1847
- { label: 'echo world', value: 'echo world' },
1848
- { label: 'ls', value: 'ls' },
1849
- ],
1850
- showSuggestions: true,
1851
- activeSuggestionIndex: 0,
1852
- });
1853
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1854
- // Trigger reverse search with Ctrl+R
1855
- await act(async () => {
1856
- stdin.write('\x12');
1857
- });
1858
- await waitFor(() => {
1859
- const frame = stdout.lastFrame();
1860
- expect(frame).toContain('(r:)');
1861
- expect(frame).toContain('echo hello');
1862
- expect(frame).toContain('echo world');
1863
- expect(frame).toContain('ls');
1864
- });
1865
- unmount();
1866
- });
1867
- it.each([
1868
- { name: 'standard', escapeSequence: '\x1B' },
1869
- { name: 'kitty', escapeSequence: '\u001b[27u' },
1870
- ])('resets reverse search state on Escape ($name)', async ({ escapeSequence }) => {
1871
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1872
- await act(async () => {
1873
- stdin.write('\x12');
1874
- });
1875
- // Wait for reverse search to be active
1876
- await waitFor(() => {
1877
- expect(stdout.lastFrame()).toContain('(r:)');
1878
- });
1879
- await act(async () => {
1880
- stdin.write(escapeSequence);
1881
- });
1882
- await waitFor(() => {
1883
- expect(stdout.lastFrame()).not.toContain('(r:)');
1884
- expect(stdout.lastFrame()).not.toContain('echo hello');
1885
- });
1886
- unmount();
1887
- });
1888
- it('completes the highlighted entry on Tab and exits reverse-search', async () => {
1889
- // Mock the reverse search completion
1890
- const mockHandleAutocomplete = vi.fn(() => {
1891
- props.buffer.setText('echo hello');
1892
- });
1893
- mockedUseReverseSearchCompletion.mockImplementation((buffer, shellHistory, reverseSearchActive) => ({
1894
- ...mockReverseSearchCompletion,
1895
- suggestions: reverseSearchActive
1896
- ? [
1897
- { label: 'echo hello', value: 'echo hello' },
1898
- { label: 'echo world', value: 'echo world' },
1899
- { label: 'ls', value: 'ls' },
1900
- ]
1901
- : [],
1902
- showSuggestions: reverseSearchActive,
1903
- activeSuggestionIndex: reverseSearchActive ? 0 : -1,
1904
- handleAutocomplete: mockHandleAutocomplete,
1905
- }));
1906
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1907
- // Enter reverse search mode with Ctrl+R
1908
- await act(async () => {
1909
- stdin.write('\x12');
1910
- });
1911
- // Verify reverse search is active
1912
- await waitFor(() => {
1913
- expect(stdout.lastFrame()).toContain('(r:)');
1914
- });
1915
- // Press Tab to complete the highlighted entry
1916
- await act(async () => {
1917
- stdin.write('\t');
1918
- });
1919
- await waitFor(() => {
1920
- expect(mockHandleAutocomplete).toHaveBeenCalledWith(0);
1921
- expect(props.buffer.setText).toHaveBeenCalledWith('echo hello');
1922
- });
1923
- unmount();
1924
- }, 15000);
1925
- it('submits the highlighted entry on Enter and exits reverse-search', async () => {
1926
- // Mock the reverse search completion to return suggestions
1927
- mockedUseReverseSearchCompletion.mockReturnValue({
1928
- ...mockReverseSearchCompletion,
1929
- suggestions: [
1930
- { label: 'echo hello', value: 'echo hello' },
1931
- { label: 'echo world', value: 'echo world' },
1932
- { label: 'ls', value: 'ls' },
1933
- ],
1934
- showSuggestions: true,
1935
- activeSuggestionIndex: 0,
1936
- });
1937
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1938
- await act(async () => {
1939
- stdin.write('\x12');
1940
- });
1941
- await waitFor(() => {
1942
- expect(stdout.lastFrame()).toContain('(r:)');
1943
- });
1944
- await act(async () => {
1945
- stdin.write('\r');
1946
- });
1947
- await waitFor(() => {
1948
- expect(stdout.lastFrame()).not.toContain('(r:)');
1949
- });
1950
- expect(props.onSubmit).toHaveBeenCalledWith('echo hello');
1951
- unmount();
1952
- });
1953
- it('should restore text and cursor position after reverse search"', async () => {
1954
- const initialText = 'initial text';
1955
- const initialCursor = [0, 3];
1956
- props.buffer.setText(initialText);
1957
- props.buffer.cursor = initialCursor;
1958
- // Mock the reverse search completion to be active and then reset
1959
- mockedUseReverseSearchCompletion.mockImplementation((buffer, shellHistory, reverseSearchActiveFromInputPrompt) => ({
1960
- ...mockReverseSearchCompletion,
1961
- suggestions: reverseSearchActiveFromInputPrompt
1962
- ? [{ label: 'history item', value: 'history item' }]
1963
- : [],
1964
- showSuggestions: reverseSearchActiveFromInputPrompt,
1965
- }));
1966
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1967
- // reverse search with Ctrl+R
1968
- await act(async () => {
1969
- stdin.write('\x12');
1970
- });
1971
- await waitFor(() => {
1972
- expect(stdout.lastFrame()).toContain('(r:)');
1973
- });
1974
- // Press kitty escape key
1975
- await act(async () => {
1976
- stdin.write('\u001b[27u');
1977
- });
1978
- await waitFor(() => {
1979
- expect(stdout.lastFrame()).not.toContain('(r:)');
1980
- expect(props.buffer.text).toBe(initialText);
1981
- expect(props.buffer.cursor).toEqual(initialCursor);
1982
- });
1983
- unmount();
1984
- });
1985
- });
1986
- describe('Ctrl+E keyboard shortcut', () => {
1987
- it('should move cursor to end of current line in multiline input', async () => {
1988
- props.buffer.text = 'line 1\nline 2\nline 3';
1989
- props.buffer.cursor = [1, 2];
1990
- props.buffer.lines = ['line 1', 'line 2', 'line 3'];
1991
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
1992
- await act(async () => {
1993
- stdin.write('\x05'); // Ctrl+E
1994
- });
1995
- await waitFor(() => {
1996
- expect(props.buffer.move).toHaveBeenCalledWith('end');
1997
- });
1998
- expect(props.buffer.moveToOffset).not.toHaveBeenCalled();
1999
- unmount();
2000
- });
2001
- it('should move cursor to end of current line for single line input', async () => {
2002
- props.buffer.text = 'single line text';
2003
- props.buffer.cursor = [0, 5];
2004
- props.buffer.lines = ['single line text'];
2005
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2006
- await act(async () => {
2007
- stdin.write('\x05'); // Ctrl+E
2008
- });
2009
- await waitFor(() => {
2010
- expect(props.buffer.move).toHaveBeenCalledWith('end');
2011
- });
2012
- expect(props.buffer.moveToOffset).not.toHaveBeenCalled();
2013
- unmount();
2014
- });
2015
- });
2016
- describe('command search (Ctrl+R when not in shell)', () => {
2017
- it('enters command search on Ctrl+R and shows suggestions', async () => {
2018
- props.shellModeActive = false;
2019
- vi.mocked(useReverseSearchCompletion).mockImplementation((buffer, data, isActive) => ({
2020
- ...mockReverseSearchCompletion,
2021
- suggestions: isActive
2022
- ? [
2023
- { label: 'git commit -m "msg"', value: 'git commit -m "msg"' },
2024
- { label: 'git push', value: 'git push' },
2025
- ]
2026
- : [],
2027
- showSuggestions: !!isActive,
2028
- activeSuggestionIndex: isActive ? 0 : -1,
2029
- }));
2030
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2031
- await act(async () => {
2032
- stdin.write('\x12'); // Ctrl+R
2033
- });
2034
- await waitFor(() => {
2035
- const frame = stdout.lastFrame() ?? '';
2036
- expect(frame).toContain('(r:)');
2037
- expect(frame).toContain('git commit');
2038
- expect(frame).toContain('git push');
2039
- });
2040
- unmount();
2041
- });
2042
- it('expands and collapses long suggestion via Right/Left arrows', async () => {
2043
- props.shellModeActive = false;
2044
- const longValue = 'l'.repeat(200);
2045
- vi.mocked(useReverseSearchCompletion).mockReturnValue({
2046
- ...mockReverseSearchCompletion,
2047
- suggestions: [{ label: longValue, value: longValue, matchedIndex: 0 }],
2048
- showSuggestions: true,
2049
- activeSuggestionIndex: 0,
2050
- visibleStartIndex: 0,
2051
- isLoadingSuggestions: false,
2052
- });
2053
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2054
- await act(async () => {
2055
- stdin.write('\x12');
2056
- });
2057
- await waitFor(() => {
2058
- expect(clean(stdout.lastFrame())).toContain('→');
2059
- });
2060
- await act(async () => {
2061
- stdin.write('\u001B[C');
2062
- });
2063
- await waitFor(() => {
2064
- expect(clean(stdout.lastFrame())).toContain('←');
2065
- });
2066
- expect(stdout.lastFrame()).toMatchSnapshot('command-search-render-expanded-match');
2067
- await act(async () => {
2068
- stdin.write('\u001B[D');
2069
- });
2070
- await waitFor(() => {
2071
- expect(clean(stdout.lastFrame())).toContain('→');
2072
- });
2073
- expect(stdout.lastFrame()).toMatchSnapshot('command-search-render-collapsed-match');
2074
- unmount();
2075
- });
2076
- it('renders match window and expanded view (snapshots)', async () => {
2077
- props.shellModeActive = false;
2078
- props.buffer.setText('commit');
2079
- const label = 'git commit -m "feat: add search" in src/app';
2080
- const matchedIndex = label.indexOf('commit');
2081
- vi.mocked(useReverseSearchCompletion).mockReturnValue({
2082
- ...mockReverseSearchCompletion,
2083
- suggestions: [{ label, value: label, matchedIndex }],
2084
- showSuggestions: true,
2085
- activeSuggestionIndex: 0,
2086
- visibleStartIndex: 0,
2087
- isLoadingSuggestions: false,
2088
- });
2089
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2090
- await act(async () => {
2091
- stdin.write('\x12');
2092
- });
2093
- await waitFor(() => {
2094
- expect(stdout.lastFrame()).toContain('(r:)');
2095
- });
2096
- expect(stdout.lastFrame()).toMatchSnapshot('command-search-render-collapsed-match');
2097
- await act(async () => {
2098
- stdin.write('\u001B[C');
2099
- });
2100
- await waitFor(() => {
2101
- // Just wait for any update to ensure it is stable.
2102
- // We could also wait for specific text if we knew it.
2103
- expect(stdout.lastFrame()).toContain('(r:)');
2104
- });
2105
- expect(stdout.lastFrame()).toMatchSnapshot('command-search-render-expanded-match');
2106
- unmount();
2107
- });
2108
- it('does not show expand/collapse indicator for short suggestions', async () => {
2109
- props.shellModeActive = false;
2110
- const shortValue = 'echo hello';
2111
- vi.mocked(useReverseSearchCompletion).mockReturnValue({
2112
- ...mockReverseSearchCompletion,
2113
- suggestions: [{ label: shortValue, value: shortValue }],
2114
- showSuggestions: true,
2115
- activeSuggestionIndex: 0,
2116
- visibleStartIndex: 0,
2117
- isLoadingSuggestions: false,
2118
- });
2119
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2120
- await act(async () => {
2121
- stdin.write('\x12');
2122
- });
2123
- await waitFor(() => {
2124
- const frame = clean(stdout.lastFrame());
2125
- // Ensure it rendered the search mode
2126
- expect(frame).toContain('(r:)');
2127
- expect(frame).not.toContain('→');
2128
- expect(frame).not.toContain('←');
2129
- });
2130
- unmount();
2131
- });
2132
- });
2133
- describe('Tab focus toggle', () => {
2134
- it.each([
2135
- {
2136
- name: 'should toggle focus in on Tab when no suggestions or ghost text',
2137
- showSuggestions: false,
2138
- ghostText: '',
2139
- suggestions: [],
2140
- expectedFocusToggle: true,
2141
- },
2142
- {
2143
- name: 'should accept ghost text and NOT toggle focus on Tab',
2144
- showSuggestions: false,
2145
- ghostText: 'ghost text',
2146
- suggestions: [],
2147
- expectedFocusToggle: false,
2148
- expectedAcceptCall: true,
2149
- },
2150
- {
2151
- name: 'should NOT toggle focus on Tab when suggestions are present',
2152
- showSuggestions: true,
2153
- ghostText: '',
2154
- suggestions: [{ label: 'test', value: 'test' }],
2155
- expectedFocusToggle: false,
2156
- },
2157
- ])('$name', async ({ showSuggestions, ghostText, suggestions, expectedFocusToggle, expectedAcceptCall, }) => {
2158
- const mockAccept = vi.fn();
2159
- mockedUseCommandCompletion.mockReturnValue({
2160
- ...mockCommandCompletion,
2161
- showSuggestions,
2162
- suggestions,
2163
- promptCompletion: {
2164
- text: ghostText,
2165
- accept: mockAccept,
2166
- clear: vi.fn(),
2167
- isLoading: false,
2168
- isActive: ghostText !== '',
2169
- markSelected: vi.fn(),
2170
- },
2171
- });
2172
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
2173
- uiActions,
2174
- uiState: { activePtyId: 1 },
2175
- });
2176
- await act(async () => {
2177
- stdin.write('\t');
2178
- });
2179
- await waitFor(() => {
2180
- if (expectedFocusToggle) {
2181
- expect(uiActions.setEmbeddedShellFocused).toHaveBeenCalledWith(true);
2182
- }
2183
- else {
2184
- expect(uiActions.setEmbeddedShellFocused).not.toHaveBeenCalled();
2185
- }
2186
- if (expectedAcceptCall) {
2187
- expect(mockAccept).toHaveBeenCalled();
2188
- }
2189
- });
2190
- unmount();
2191
- });
2192
- });
2193
- describe('mouse interaction', () => {
2194
- it.each([
2195
- {
2196
- name: 'first line, first char',
2197
- relX: 0,
2198
- relY: 0,
2199
- mouseCol: 4,
2200
- mouseRow: 2,
2201
- },
2202
- {
2203
- name: 'first line, middle char',
2204
- relX: 6,
2205
- relY: 0,
2206
- mouseCol: 10,
2207
- mouseRow: 2,
2208
- },
2209
- {
2210
- name: 'second line, first char',
2211
- relX: 0,
2212
- relY: 1,
2213
- mouseCol: 4,
2214
- mouseRow: 3,
2215
- },
2216
- {
2217
- name: 'second line, end char',
2218
- relX: 5,
2219
- relY: 1,
2220
- mouseCol: 9,
2221
- mouseRow: 3,
2222
- },
2223
- ])('should move cursor on mouse click - $name', async ({ relX, relY, mouseCol, mouseRow }) => {
2224
- props.buffer.text = 'hello world\nsecond line';
2225
- props.buffer.lines = ['hello world', 'second line'];
2226
- props.buffer.viewportVisualLines = ['hello world', 'second line'];
2227
- props.buffer.visualToLogicalMap = [
2228
- [0, 0],
2229
- [1, 0],
2230
- ];
2231
- props.buffer.visualCursor = [0, 11];
2232
- props.buffer.visualScrollRow = 0;
2233
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), { mouseEventsEnabled: true, uiActions });
2234
- // Wait for initial render
2235
- await waitFor(() => {
2236
- expect(stdout.lastFrame()).toContain('hello world');
2237
- });
2238
- // Simulate left mouse press at calculated coordinates.
2239
- // Without left border: inner box is at x=3, y=1 based on padding(1)+prompt(2) and border-top(1).
2240
- await act(async () => {
2241
- stdin.write(`\x1b[<0;${mouseCol};${mouseRow}M`);
2242
- });
2243
- await waitFor(() => {
2244
- expect(props.buffer.moveToVisualPosition).toHaveBeenCalledWith(relY, relX);
2245
- });
2246
- unmount();
2247
- });
2248
- it('should unfocus embedded shell on click', async () => {
2249
- props.buffer.text = 'hello';
2250
- props.buffer.lines = ['hello'];
2251
- props.buffer.viewportVisualLines = ['hello'];
2252
- props.buffer.visualToLogicalMap = [[0, 0]];
2253
- props.isEmbeddedShellFocused = true;
2254
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), { mouseEventsEnabled: true, uiActions });
2255
- await waitFor(() => {
2256
- expect(stdout.lastFrame()).toContain('hello');
2257
- });
2258
- await act(async () => {
2259
- // Click somewhere in the prompt
2260
- stdin.write(`\x1b[<0;5;2M`);
2261
- });
2262
- await waitFor(() => {
2263
- expect(mockSetEmbeddedShellFocused).toHaveBeenCalledWith(false);
2264
- });
2265
- unmount();
2266
- });
2267
- it('should toggle paste expansion on double-click', async () => {
2268
- const id = '[Pasted Text: 10 lines]';
2269
- const largeText = 'line1\nline2\nline3\nline4\nline5\nline6\nline7\nline8\nline9\nline10';
2270
- const baseProps = props;
2271
- const TestWrapper = () => {
2272
- const [isExpanded, setIsExpanded] = useState(false);
2273
- const currentLines = isExpanded ? largeText.split('\n') : [id];
2274
- const currentText = isExpanded ? largeText : id;
2275
- const buffer = {
2276
- ...baseProps.buffer,
2277
- text: currentText,
2278
- lines: currentLines,
2279
- viewportVisualLines: currentLines,
2280
- allVisualLines: currentLines,
2281
- pastedContent: { [id]: largeText },
2282
- transformationsByLine: isExpanded
2283
- ? currentLines.map(() => [])
2284
- : [
2285
- [
2286
- {
2287
- logStart: 0,
2288
- logEnd: id.length,
2289
- logicalText: id,
2290
- collapsedText: id,
2291
- type: 'paste',
2292
- id,
2293
- },
2294
- ],
2295
- ],
2296
- visualScrollRow: 0,
2297
- visualToLogicalMap: currentLines.map((_, i) => [i, 0]),
2298
- visualToTransformedMap: currentLines.map(() => 0),
2299
- getLogicalPositionFromVisual: vi.fn().mockReturnValue({
2300
- row: 0,
2301
- col: 2,
2302
- }),
2303
- togglePasteExpansion: vi.fn().mockImplementation(() => {
2304
- setIsExpanded(!isExpanded);
2305
- }),
2306
- getExpandedPasteAtLine: vi
2307
- .fn()
2308
- .mockReturnValue(isExpanded ? id : null),
2309
- };
2310
- return _jsx(InputPrompt, { ...baseProps, buffer: buffer });
2311
- };
2312
- const { stdin, stdout, unmount, simulateClick } = renderWithProviders(_jsx(TestWrapper, {}), {
2313
- mouseEventsEnabled: true,
2314
- useAlternateBuffer: true,
2315
- uiActions,
2316
- });
2317
- // 1. Verify initial placeholder
2318
- await waitFor(() => {
2319
- expect(stdout.lastFrame()).toMatchSnapshot();
2320
- });
2321
- // Simulate double-click to expand
2322
- await simulateClick(stdin, 5, 2);
2323
- await simulateClick(stdin, 5, 2);
2324
- // 2. Verify expanded content is visible
2325
- await waitFor(() => {
2326
- expect(stdout.lastFrame()).toMatchSnapshot();
2327
- });
2328
- // Simulate double-click to collapse
2329
- await simulateClick(stdin, 5, 2);
2330
- await simulateClick(stdin, 5, 2);
2331
- // 3. Verify placeholder is restored
2332
- await waitFor(() => {
2333
- expect(stdout.lastFrame()).toMatchSnapshot();
2334
- });
2335
- unmount();
2336
- });
2337
- it('should move cursor on mouse click with plain borders', async () => {
2338
- props.config.getUseBackgroundColor = () => false;
2339
- props.buffer.text = 'hello world';
2340
- props.buffer.lines = ['hello world'];
2341
- props.buffer.viewportVisualLines = ['hello world'];
2342
- props.buffer.visualToLogicalMap = [[0, 0]];
2343
- props.buffer.visualCursor = [0, 11];
2344
- props.buffer.visualScrollRow = 0;
2345
- const { stdin, stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), { mouseEventsEnabled: true, uiActions });
2346
- // Wait for initial render
2347
- await waitFor(() => {
2348
- expect(stdout.lastFrame()).toContain('hello world');
2349
- });
2350
- // With plain borders: 1(border) + 1(padding) + 2(prompt) = 4 offset (x=4, col=5)
2351
- await act(async () => {
2352
- stdin.write(`\x1b[<0;5;2M`); // Click at col 5, row 2
2353
- });
2354
- await waitFor(() => {
2355
- expect(props.buffer.moveToVisualPosition).toHaveBeenCalledWith(0, 0);
2356
- });
2357
- unmount();
2358
- });
2359
- });
2360
- describe('queued message editing', () => {
2361
- it('should load all queued messages when up arrow is pressed with empty input', async () => {
2362
- const mockPopAllMessages = vi.fn();
2363
- mockPopAllMessages.mockReturnValue('Message 1\n\nMessage 2\n\nMessage 3');
2364
- props.popAllMessages = mockPopAllMessages;
2365
- props.buffer.text = '';
2366
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2367
- await act(async () => {
2368
- stdin.write('\u001B[A');
2369
- });
2370
- await waitFor(() => expect(mockPopAllMessages).toHaveBeenCalled());
2371
- expect(props.buffer.setText).toHaveBeenCalledWith('Message 1\n\nMessage 2\n\nMessage 3');
2372
- unmount();
2373
- });
2374
- it('should not load queued messages when input is not empty', async () => {
2375
- const mockPopAllMessages = vi.fn();
2376
- props.popAllMessages = mockPopAllMessages;
2377
- props.buffer.text = 'some text';
2378
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2379
- await act(async () => {
2380
- stdin.write('\u001B[A');
2381
- });
2382
- await waitFor(() => expect(mockInputHistory.navigateUp).toHaveBeenCalled());
2383
- expect(mockPopAllMessages).not.toHaveBeenCalled();
2384
- unmount();
2385
- });
2386
- it('should handle undefined messages from popAllMessages', async () => {
2387
- const mockPopAllMessages = vi.fn();
2388
- mockPopAllMessages.mockReturnValue(undefined);
2389
- props.popAllMessages = mockPopAllMessages;
2390
- props.buffer.text = '';
2391
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2392
- await act(async () => {
2393
- stdin.write('\u001B[A');
2394
- });
2395
- await waitFor(() => expect(mockPopAllMessages).toHaveBeenCalled());
2396
- expect(props.buffer.setText).not.toHaveBeenCalled();
2397
- expect(mockInputHistory.navigateUp).toHaveBeenCalled();
2398
- unmount();
2399
- });
2400
- it('should work with NAVIGATION_UP key as well', async () => {
2401
- const mockPopAllMessages = vi.fn();
2402
- props.popAllMessages = mockPopAllMessages;
2403
- props.buffer.text = '';
2404
- props.buffer.allVisualLines = [''];
2405
- props.buffer.visualCursor = [0, 0];
2406
- props.buffer.visualScrollRow = 0;
2407
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2408
- await act(async () => {
2409
- stdin.write('\u001B[A');
2410
- });
2411
- await waitFor(() => expect(mockPopAllMessages).toHaveBeenCalled());
2412
- unmount();
2413
- });
2414
- it('should handle single queued message', async () => {
2415
- const mockPopAllMessages = vi.fn();
2416
- mockPopAllMessages.mockReturnValue('Single message');
2417
- props.popAllMessages = mockPopAllMessages;
2418
- props.buffer.text = '';
2419
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2420
- await act(async () => {
2421
- stdin.write('\u001B[A');
2422
- });
2423
- await waitFor(() => expect(mockPopAllMessages).toHaveBeenCalled());
2424
- expect(props.buffer.setText).toHaveBeenCalledWith('Single message');
2425
- unmount();
2426
- });
2427
- it('should only check for queued messages when buffer text is trimmed empty', async () => {
2428
- const mockPopAllMessages = vi.fn();
2429
- props.popAllMessages = mockPopAllMessages;
2430
- props.buffer.text = ' '; // Whitespace only
2431
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2432
- await act(async () => {
2433
- stdin.write('\u001B[A');
2434
- });
2435
- await waitFor(() => expect(mockPopAllMessages).toHaveBeenCalled());
2436
- unmount();
2437
- });
2438
- it('should not call popAllMessages if it is not provided', async () => {
2439
- props.popAllMessages = undefined;
2440
- props.buffer.text = '';
2441
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2442
- await act(async () => {
2443
- stdin.write('\u001B[A');
2444
- });
2445
- await waitFor(() => expect(mockInputHistory.navigateUp).toHaveBeenCalled());
2446
- unmount();
2447
- });
2448
- it('should navigate input history on fresh start when no queued messages exist', async () => {
2449
- const mockPopAllMessages = vi.fn();
2450
- mockPopAllMessages.mockReturnValue(undefined);
2451
- props.popAllMessages = mockPopAllMessages;
2452
- props.buffer.text = '';
2453
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2454
- await act(async () => {
2455
- stdin.write('\u001B[A');
2456
- });
2457
- await waitFor(() => expect(mockPopAllMessages).toHaveBeenCalled());
2458
- expect(mockInputHistory.navigateUp).toHaveBeenCalled();
2459
- expect(props.buffer.setText).not.toHaveBeenCalled();
2460
- unmount();
2461
- });
2462
- });
2463
- describe('snapshots', () => {
2464
- it('should render correctly in shell mode', async () => {
2465
- props.shellModeActive = true;
2466
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2467
- await waitFor(() => expect(stdout.lastFrame()).toContain('!'));
2468
- expect(stdout.lastFrame()).toMatchSnapshot();
2469
- unmount();
2470
- });
2471
- it('should render correctly when accepting edits', async () => {
2472
- props.approvalMode = ApprovalMode.AUTO_EDIT;
2473
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2474
- await waitFor(() => expect(stdout.lastFrame()).toContain('>'));
2475
- expect(stdout.lastFrame()).toMatchSnapshot();
2476
- unmount();
2477
- });
2478
- it('should render correctly in yolo mode', async () => {
2479
- props.approvalMode = ApprovalMode.YOLO;
2480
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2481
- await waitFor(() => expect(stdout.lastFrame()).toContain('*'));
2482
- expect(stdout.lastFrame()).toMatchSnapshot();
2483
- unmount();
2484
- });
2485
- it('should not show inverted cursor when shell is focused', async () => {
2486
- props.isEmbeddedShellFocused = true;
2487
- props.focus = false;
2488
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2489
- await waitFor(() => {
2490
- expect(stdout.lastFrame()).not.toContain(`{chalk.inverse(' ')}`);
2491
- });
2492
- expect(stdout.lastFrame()).toMatchSnapshot();
2493
- unmount();
2494
- });
2495
- });
2496
- it('should still allow input when shell is not focused', async () => {
2497
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }), {
2498
- shellFocus: false,
2499
- });
2500
- await act(async () => {
2501
- stdin.write('a');
2502
- });
2503
- await waitFor(() => expect(mockBuffer.handleInput).toHaveBeenCalled());
2504
- unmount();
2505
- });
2506
- describe('command queuing while streaming', () => {
2507
- beforeEach(() => {
2508
- props.streamingState = StreamingState.Responding;
2509
- props.setQueueErrorMessage = vi.fn();
2510
- props.onSubmit = vi.fn();
2511
- });
2512
- it.each([
2513
- {
2514
- name: 'should prevent slash commands',
2515
- bufferText: '/help',
2516
- shellMode: false,
2517
- shouldSubmit: false,
2518
- errorMessage: 'Slash commands cannot be queued',
2519
- },
2520
- {
2521
- name: 'should prevent shell commands',
2522
- bufferText: 'ls',
2523
- shellMode: true,
2524
- shouldSubmit: false,
2525
- errorMessage: 'Shell commands cannot be queued',
2526
- },
2527
- {
2528
- name: 'should allow regular messages',
2529
- bufferText: 'regular message',
2530
- shellMode: false,
2531
- shouldSubmit: true,
2532
- errorMessage: null,
2533
- },
2534
- ])('$name', async ({ bufferText, shellMode, shouldSubmit, errorMessage }) => {
2535
- props.buffer.text = bufferText;
2536
- props.shellModeActive = shellMode;
2537
- const { stdin, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2538
- await act(async () => {
2539
- stdin.write('\r');
2540
- });
2541
- await waitFor(() => {
2542
- if (shouldSubmit) {
2543
- expect(props.onSubmit).toHaveBeenCalledWith(bufferText);
2544
- expect(props.setQueueErrorMessage).not.toHaveBeenCalled();
2545
- }
2546
- else {
2547
- expect(props.onSubmit).not.toHaveBeenCalled();
2548
- expect(props.setQueueErrorMessage).toHaveBeenCalledWith(errorMessage);
2549
- }
2550
- });
2551
- unmount();
2552
- });
2553
- });
2554
- describe('image path transformation snapshots', () => {
2555
- const logicalLine = '@/path/to/screenshots/screenshot2x.png';
2556
- const transformations = calculateTransformationsForLine(logicalLine);
2557
- const applyVisualState = (visualLine, cursorCol) => {
2558
- mockBuffer.text = logicalLine;
2559
- mockBuffer.lines = [logicalLine];
2560
- mockBuffer.viewportVisualLines = [visualLine];
2561
- mockBuffer.allVisualLines = [visualLine];
2562
- mockBuffer.visualToLogicalMap = [[0, 0]];
2563
- mockBuffer.visualToTransformedMap = [0];
2564
- mockBuffer.transformationsByLine = [transformations];
2565
- mockBuffer.cursor = [0, cursorCol];
2566
- mockBuffer.visualCursor = [0, 0];
2567
- };
2568
- it('should snapshot collapsed image path', async () => {
2569
- const { transformedLine } = calculateTransformedLine(logicalLine, 0, [0, transformations[0].logEnd + 5], transformations);
2570
- applyVisualState(transformedLine, transformations[0].logEnd + 5);
2571
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2572
- await waitFor(() => {
2573
- expect(stdout.lastFrame()).toContain('[Image');
2574
- });
2575
- expect(stdout.lastFrame()).toMatchSnapshot();
2576
- unmount();
2577
- });
2578
- it('should snapshot expanded image path when cursor is on it', async () => {
2579
- const { transformedLine } = calculateTransformedLine(logicalLine, 0, [0, transformations[0].logStart + 1], transformations);
2580
- applyVisualState(transformedLine, transformations[0].logStart + 1);
2581
- const { stdout, unmount } = renderWithProviders(_jsx(InputPrompt, { ...props }));
2582
- await waitFor(() => {
2583
- expect(stdout.lastFrame()).toContain('@/path/to/screenshots');
2584
- });
2585
- expect(stdout.lastFrame()).toMatchSnapshot();
2586
- unmount();
2587
- });
2588
- });
2589
- });
2590
- function clean(str) {
2591
- if (!str)
2592
- return '';
2593
- // Remove ANSI escape codes and trim whitespace
2594
- return stripAnsi(str).trim();
2595
- }
2596
- //# sourceMappingURL=InputPrompt.test.js.map