@machina.ai/cell-cli 1.16.0-rc2 → 1.19.4-rc1

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 (695) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +8 -7
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +10 -9
  5. package/dist/src/commands/extensions/disable.js +2 -0
  6. package/dist/src/commands/extensions/disable.js.map +1 -1
  7. package/dist/src/commands/extensions/disable.test.d.ts +6 -0
  8. package/dist/src/commands/extensions/disable.test.js +169 -0
  9. package/dist/src/commands/extensions/disable.test.js.map +1 -0
  10. package/dist/src/commands/extensions/enable.js +2 -0
  11. package/dist/src/commands/extensions/enable.js.map +1 -1
  12. package/dist/src/commands/extensions/enable.test.d.ts +6 -0
  13. package/dist/src/commands/extensions/enable.test.js +150 -0
  14. package/dist/src/commands/extensions/enable.test.js.map +1 -0
  15. package/dist/src/commands/extensions/examples/mcp-server/example.test.d.ts +6 -0
  16. package/dist/src/commands/extensions/examples/mcp-server/example.test.js +111 -0
  17. package/dist/src/commands/extensions/examples/mcp-server/example.test.js.map +1 -0
  18. package/dist/src/commands/extensions/examples/mcp-server/example.test.ts +143 -0
  19. package/dist/src/commands/extensions/examples/mcp-server/package.json +1 -1
  20. package/dist/src/commands/extensions/install.js +2 -0
  21. package/dist/src/commands/extensions/install.js.map +1 -1
  22. package/dist/src/commands/extensions/install.test.js +3 -0
  23. package/dist/src/commands/extensions/install.test.js.map +1 -1
  24. package/dist/src/commands/extensions/link.js +2 -0
  25. package/dist/src/commands/extensions/link.js.map +1 -1
  26. package/dist/src/commands/extensions/link.test.d.ts +6 -0
  27. package/dist/src/commands/extensions/link.test.js +131 -0
  28. package/dist/src/commands/extensions/link.test.js.map +1 -0
  29. package/dist/src/commands/extensions/list.js +2 -0
  30. package/dist/src/commands/extensions/list.js.map +1 -1
  31. package/dist/src/commands/extensions/list.test.d.ts +6 -0
  32. package/dist/src/commands/extensions/list.test.js +112 -0
  33. package/dist/src/commands/extensions/list.test.js.map +1 -0
  34. package/dist/src/commands/extensions/new.js +2 -0
  35. package/dist/src/commands/extensions/new.js.map +1 -1
  36. package/dist/src/commands/extensions/new.test.js +3 -0
  37. package/dist/src/commands/extensions/new.test.js.map +1 -1
  38. package/dist/src/commands/extensions/uninstall.d.ts +1 -1
  39. package/dist/src/commands/extensions/uninstall.js +26 -9
  40. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  41. package/dist/src/commands/extensions/uninstall.test.js +190 -9
  42. package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
  43. package/dist/src/commands/extensions/update.js +2 -0
  44. package/dist/src/commands/extensions/update.js.map +1 -1
  45. package/dist/src/commands/extensions/update.test.d.ts +6 -0
  46. package/dist/src/commands/extensions/update.test.js +170 -0
  47. package/dist/src/commands/extensions/update.test.js.map +1 -0
  48. package/dist/src/commands/extensions/validate.js +2 -0
  49. package/dist/src/commands/extensions/validate.js.map +1 -1
  50. package/dist/src/commands/extensions/validate.test.js +3 -0
  51. package/dist/src/commands/extensions/validate.test.js.map +1 -1
  52. package/dist/src/commands/extensions.js +2 -0
  53. package/dist/src/commands/extensions.js.map +1 -1
  54. package/dist/src/commands/extensions.test.d.ts +6 -0
  55. package/dist/src/commands/extensions.test.js +67 -0
  56. package/dist/src/commands/extensions.test.js.map +1 -0
  57. package/dist/src/commands/mcp/add.js +2 -0
  58. package/dist/src/commands/mcp/add.js.map +1 -1
  59. package/dist/src/commands/mcp/add.test.js +11 -3
  60. package/dist/src/commands/mcp/add.test.js.map +1 -1
  61. package/dist/src/commands/mcp/list.js +2 -0
  62. package/dist/src/commands/mcp/list.js.map +1 -1
  63. package/dist/src/commands/mcp/list.test.js +4 -6
  64. package/dist/src/commands/mcp/list.test.js.map +1 -1
  65. package/dist/src/commands/mcp/remove.js +2 -0
  66. package/dist/src/commands/mcp/remove.js.map +1 -1
  67. package/dist/src/commands/mcp/remove.test.js +26 -12
  68. package/dist/src/commands/mcp/remove.test.js.map +1 -1
  69. package/dist/src/commands/mcp.js +2 -0
  70. package/dist/src/commands/mcp.js.map +1 -1
  71. package/dist/src/commands/mcp.test.js +1 -0
  72. package/dist/src/commands/mcp.test.js.map +1 -1
  73. package/dist/src/commands/utils.d.ts +6 -0
  74. package/dist/src/commands/utils.js +11 -0
  75. package/dist/src/commands/utils.js.map +1 -0
  76. package/dist/src/commands/utils.test.d.ts +6 -0
  77. package/dist/src/commands/utils.test.js +35 -0
  78. package/dist/src/commands/utils.test.js.map +1 -0
  79. package/dist/src/config/auth.js +4 -0
  80. package/dist/src/config/auth.js.map +1 -1
  81. package/dist/src/config/auth.test.js +1 -2
  82. package/dist/src/config/auth.test.js.map +1 -1
  83. package/dist/src/config/config.d.ts +2 -1
  84. package/dist/src/config/config.integration.test.js +81 -198
  85. package/dist/src/config/config.integration.test.js.map +1 -1
  86. package/dist/src/config/config.js +38 -31
  87. package/dist/src/config/config.js.map +1 -1
  88. package/dist/src/config/config.test.js +235 -294
  89. package/dist/src/config/config.test.js.map +1 -1
  90. package/dist/src/config/extension.test.js +30 -48
  91. package/dist/src/config/extension.test.js.map +1 -1
  92. package/dist/src/config/extensions/consent.test.d.ts +6 -0
  93. package/dist/src/config/extensions/consent.test.js +152 -0
  94. package/dist/src/config/extensions/consent.test.js.map +1 -0
  95. package/dist/src/config/extensions/extensionEnablement.test.js +82 -15
  96. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -1
  97. package/dist/src/config/extensions/extensionSettings.test.js +105 -1
  98. package/dist/src/config/extensions/extensionSettings.test.js.map +1 -1
  99. package/dist/src/config/extensions/github.d.ts +1 -0
  100. package/dist/src/config/extensions/github.js +21 -5
  101. package/dist/src/config/extensions/github.js.map +1 -1
  102. package/dist/src/config/extensions/github.test.js +201 -318
  103. package/dist/src/config/extensions/github.test.js.map +1 -1
  104. package/dist/src/config/extensions/storage.test.d.ts +6 -0
  105. package/dist/src/config/extensions/storage.test.js +64 -0
  106. package/dist/src/config/extensions/storage.test.js.map +1 -0
  107. package/dist/src/config/extensions/update.test.js +154 -263
  108. package/dist/src/config/extensions/update.test.js.map +1 -1
  109. package/dist/src/config/extensions/variables.test.js +87 -1
  110. package/dist/src/config/extensions/variables.test.js.map +1 -1
  111. package/dist/src/config/keyBindings.d.ts +1 -1
  112. package/dist/src/config/keyBindings.js +4 -4
  113. package/dist/src/config/keyBindings.js.map +1 -1
  114. package/dist/src/config/sandboxConfig.d.ts +1 -1
  115. package/dist/src/config/sandboxConfig.js.map +1 -1
  116. package/dist/src/config/sandboxConfig.test.d.ts +6 -0
  117. package/dist/src/config/sandboxConfig.test.js +178 -0
  118. package/dist/src/config/sandboxConfig.test.js.map +1 -0
  119. package/dist/src/config/settingPaths.test.d.ts +6 -0
  120. package/dist/src/config/settingPaths.test.js +22 -0
  121. package/dist/src/config/settingPaths.test.js.map +1 -0
  122. package/dist/src/config/settings.js +12 -1
  123. package/dist/src/config/settings.js.map +1 -1
  124. package/dist/src/config/settings.test.js +228 -227
  125. package/dist/src/config/settings.test.js.map +1 -1
  126. package/dist/src/config/settingsSchema.d.ts +25 -7
  127. package/dist/src/config/settingsSchema.js +26 -8
  128. package/dist/src/config/settingsSchema.js.map +1 -1
  129. package/dist/src/config/settingsSchema.test.js +11 -6
  130. package/dist/src/config/settingsSchema.test.js.map +1 -1
  131. package/dist/src/config/trustedFolders.d.ts +1 -1
  132. package/dist/src/config/trustedFolders.js +24 -17
  133. package/dist/src/config/trustedFolders.js.map +1 -1
  134. package/dist/src/core/auth.test.d.ts +6 -0
  135. package/dist/src/core/auth.test.js +43 -0
  136. package/dist/src/core/auth.test.js.map +1 -0
  137. package/dist/src/core/initializer.test.d.ts +6 -0
  138. package/dist/src/core/initializer.test.js +101 -0
  139. package/dist/src/core/initializer.test.js.map +1 -0
  140. package/dist/src/core/theme.test.d.ts +6 -0
  141. package/dist/src/core/theme.test.js +46 -0
  142. package/dist/src/core/theme.test.js.map +1 -0
  143. package/dist/src/gemini.d.ts +3 -1
  144. package/dist/src/gemini.js +80 -17
  145. package/dist/src/gemini.js.map +1 -1
  146. package/dist/src/gemini.test.js +681 -16
  147. package/dist/src/gemini.test.js.map +1 -1
  148. package/dist/src/gemini_cleanup.test.d.ts +6 -0
  149. package/dist/src/gemini_cleanup.test.js +201 -0
  150. package/dist/src/gemini_cleanup.test.js.map +1 -0
  151. package/dist/src/generated/git-commit.d.ts +2 -2
  152. package/dist/src/generated/git-commit.js +2 -2
  153. package/dist/src/nonInteractiveCli.js +4 -1
  154. package/dist/src/nonInteractiveCli.js.map +1 -1
  155. package/dist/src/nonInteractiveCli.test.js +338 -2
  156. package/dist/src/nonInteractiveCli.test.js.map +1 -1
  157. package/dist/src/services/BuiltinCommandLoader.js +3 -1
  158. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  159. package/dist/src/services/BuiltinCommandLoader.test.js +1 -22
  160. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
  161. package/dist/src/services/CommandService.test.js +3 -2
  162. package/dist/src/services/CommandService.test.js.map +1 -1
  163. package/dist/src/services/McpPromptLoader.js +5 -3
  164. package/dist/src/services/McpPromptLoader.js.map +1 -1
  165. package/dist/src/services/McpPromptLoader.test.js +29 -1
  166. package/dist/src/services/McpPromptLoader.test.js.map +1 -1
  167. package/dist/src/test-utils/mockCommandContext.js +1 -1
  168. package/dist/src/test-utils/render.d.ts +26 -2
  169. package/dist/src/test-utils/render.js +80 -3
  170. package/dist/src/test-utils/render.js.map +1 -1
  171. package/dist/src/ui/App.test.js +28 -14
  172. package/dist/src/ui/App.test.js.map +1 -1
  173. package/dist/src/ui/AppContainer.js +142 -48
  174. package/dist/src/ui/AppContainer.js.map +1 -1
  175. package/dist/src/ui/AppContainer.test.js +181 -103
  176. package/dist/src/ui/AppContainer.test.js.map +1 -1
  177. package/dist/src/ui/IdeIntegrationNudge.test.d.ts +6 -0
  178. package/dist/src/ui/IdeIntegrationNudge.test.js +147 -0
  179. package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -0
  180. package/dist/src/ui/auth/ApiAuthDialog.test.js +12 -17
  181. package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
  182. package/dist/src/ui/auth/AuthDialog.js +17 -10
  183. package/dist/src/ui/auth/AuthDialog.js.map +1 -1
  184. package/dist/src/ui/auth/AuthDialog.test.js +55 -21
  185. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
  186. package/dist/src/ui/auth/AuthInProgress.test.d.ts +6 -0
  187. package/dist/src/ui/auth/AuthInProgress.test.js +71 -0
  188. package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -0
  189. package/dist/src/ui/auth/useAuth.d.ts +2 -0
  190. package/dist/src/ui/auth/useAuth.js +6 -1
  191. package/dist/src/ui/auth/useAuth.js.map +1 -1
  192. package/dist/src/ui/auth/useAuth.test.d.ts +6 -0
  193. package/dist/src/ui/auth/useAuth.test.js +178 -0
  194. package/dist/src/ui/auth/useAuth.test.js.map +1 -0
  195. package/dist/src/ui/commands/aboutCommand.js +8 -1
  196. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  197. package/dist/src/ui/commands/aboutCommand.test.js +4 -0
  198. package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
  199. package/dist/src/ui/commands/clearCommand.js +12 -0
  200. package/dist/src/ui/commands/clearCommand.js.map +1 -1
  201. package/dist/src/ui/commands/clearCommand.test.js +5 -0
  202. package/dist/src/ui/commands/clearCommand.test.js.map +1 -1
  203. package/dist/src/ui/commands/directoryCommand.d.ts +0 -1
  204. package/dist/src/ui/commands/directoryCommand.js +104 -43
  205. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  206. package/dist/src/ui/commands/directoryCommand.test.js +91 -2
  207. package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
  208. package/dist/src/ui/commands/extensionsCommand.js +28 -6
  209. package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
  210. package/dist/src/ui/commands/extensionsCommand.test.js +32 -0
  211. package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
  212. package/dist/src/ui/commands/memoryCommand.js +1 -0
  213. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  214. package/dist/src/ui/commands/memoryCommand.test.js +3 -0
  215. package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
  216. package/dist/src/ui/commands/permissionsCommand.js +62 -5
  217. package/dist/src/ui/commands/permissionsCommand.js.map +1 -1
  218. package/dist/src/ui/commands/permissionsCommand.test.js +60 -4
  219. package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -1
  220. package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
  221. package/dist/src/ui/commands/resumeCommand.js +16 -0
  222. package/dist/src/ui/commands/resumeCommand.js.map +1 -0
  223. package/dist/src/ui/commands/setupGithubCommand.d.ts +1 -0
  224. package/dist/src/ui/commands/setupGithubCommand.js +82 -45
  225. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
  226. package/dist/src/ui/commands/setupGithubCommand.test.js +35 -5
  227. package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
  228. package/dist/src/ui/commands/statsCommand.js +27 -16
  229. package/dist/src/ui/commands/statsCommand.js.map +1 -1
  230. package/dist/src/ui/commands/types.d.ts +8 -2
  231. package/dist/src/ui/commands/types.js.map +1 -1
  232. package/dist/src/ui/components/AboutBox.d.ts +1 -0
  233. package/dist/src/ui/components/AboutBox.js +1 -1
  234. package/dist/src/ui/components/AboutBox.js.map +1 -1
  235. package/dist/src/ui/components/AboutBox.test.d.ts +6 -0
  236. package/dist/src/ui/components/AboutBox.test.js +53 -0
  237. package/dist/src/ui/components/AboutBox.test.js.map +1 -0
  238. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +62 -11
  239. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
  240. package/dist/src/ui/components/AnsiOutput.test.js +18 -23
  241. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
  242. package/dist/src/ui/components/AppHeader.js +3 -22
  243. package/dist/src/ui/components/AppHeader.js.map +1 -1
  244. package/dist/src/ui/components/AppHeader.test.js +10 -4
  245. package/dist/src/ui/components/AppHeader.test.js.map +1 -1
  246. package/dist/src/ui/components/AsciiArt.d.ts +6 -6
  247. package/dist/src/ui/components/AsciiArt.js +6 -6
  248. package/dist/src/ui/components/AutoAcceptIndicator.test.d.ts +6 -0
  249. package/dist/src/ui/components/AutoAcceptIndicator.test.js +31 -0
  250. package/dist/src/ui/components/AutoAcceptIndicator.test.js.map +1 -0
  251. package/dist/src/ui/components/Banner.d.ts +4 -2
  252. package/dist/src/ui/components/Banner.js +18 -4
  253. package/dist/src/ui/components/Banner.js.map +1 -1
  254. package/dist/src/ui/components/Banner.test.d.ts +6 -0
  255. package/dist/src/ui/components/Banner.test.js +24 -0
  256. package/dist/src/ui/components/Banner.test.js.map +1 -0
  257. package/dist/src/ui/components/ConfigInitDisplay.test.d.ts +6 -0
  258. package/dist/src/ui/components/ConfigInitDisplay.test.js +103 -0
  259. package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -0
  260. package/dist/src/ui/components/ConsoleSummaryDisplay.test.d.ts +6 -0
  261. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +26 -0
  262. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +1 -0
  263. package/dist/src/ui/components/ContextUsageDisplay.test.d.ts +6 -0
  264. package/dist/src/ui/components/ContextUsageDisplay.test.js +39 -0
  265. package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -0
  266. package/dist/src/ui/components/CopyModeWarning.test.d.ts +6 -0
  267. package/dist/src/ui/components/CopyModeWarning.test.js +33 -0
  268. package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -0
  269. package/dist/src/ui/components/DebugProfiler.d.ts +1 -0
  270. package/dist/src/ui/components/DebugProfiler.js +24 -35
  271. package/dist/src/ui/components/DebugProfiler.js.map +1 -1
  272. package/dist/src/ui/components/DebugProfiler.test.js +47 -1
  273. package/dist/src/ui/components/DebugProfiler.test.js.map +1 -1
  274. package/dist/src/ui/components/DetailedMessagesDisplay.test.d.ts +6 -0
  275. package/dist/src/ui/components/DetailedMessagesDisplay.test.js +49 -0
  276. package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -0
  277. package/dist/src/ui/components/DialogManager.js +11 -2
  278. package/dist/src/ui/components/DialogManager.js.map +1 -1
  279. package/dist/src/ui/components/DialogManager.test.d.ts +6 -0
  280. package/dist/src/ui/components/DialogManager.test.js +167 -0
  281. package/dist/src/ui/components/DialogManager.test.js.map +1 -0
  282. package/dist/src/ui/components/EditorSettingsDialog.test.d.ts +6 -0
  283. package/dist/src/ui/components/EditorSettingsDialog.test.js +111 -0
  284. package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -0
  285. package/dist/src/ui/components/ExitWarning.test.d.ts +6 -0
  286. package/dist/src/ui/components/ExitWarning.test.js +54 -0
  287. package/dist/src/ui/components/ExitWarning.test.js.map +1 -0
  288. package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +6 -0
  289. package/dist/src/ui/components/GeminiRespondingSpinner.test.js +58 -0
  290. package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -0
  291. package/dist/src/ui/components/GradientRegression.test.js +22 -1
  292. package/dist/src/ui/components/GradientRegression.test.js.map +1 -1
  293. package/dist/src/ui/components/Header.test.js +27 -2
  294. package/dist/src/ui/components/Header.test.js.map +1 -1
  295. package/dist/src/ui/components/HistoryItemDisplay.js +2 -1
  296. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  297. package/dist/src/ui/components/InputPrompt.js +30 -36
  298. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  299. package/dist/src/ui/components/InputPrompt.test.js +110 -24
  300. package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
  301. package/dist/src/ui/components/LoadingIndicator.js +6 -1
  302. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  303. package/dist/src/ui/components/MainContent.test.d.ts +6 -0
  304. package/dist/src/ui/components/MainContent.test.js +73 -0
  305. package/dist/src/ui/components/MainContent.test.js.map +1 -0
  306. package/dist/src/ui/components/MemoryUsageDisplay.test.d.ts +6 -0
  307. package/dist/src/ui/components/MemoryUsageDisplay.test.js +49 -0
  308. package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +1 -0
  309. package/dist/src/ui/components/ModelDialog.js +2 -2
  310. package/dist/src/ui/components/ModelDialog.js.map +1 -1
  311. package/dist/src/ui/components/ModelDialog.test.js +1 -1
  312. package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
  313. package/dist/src/ui/components/MultiFolderTrustDialog.d.ts +23 -0
  314. package/dist/src/ui/components/MultiFolderTrustDialog.js +90 -0
  315. package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -0
  316. package/dist/src/ui/components/MultiFolderTrustDialog.test.d.ts +6 -0
  317. package/dist/src/ui/components/MultiFolderTrustDialog.test.js +161 -0
  318. package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -0
  319. package/dist/src/ui/components/Notifications.js +5 -3
  320. package/dist/src/ui/components/Notifications.js.map +1 -1
  321. package/dist/src/ui/components/Notifications.test.d.ts +6 -0
  322. package/dist/src/ui/components/Notifications.test.js +153 -0
  323. package/dist/src/ui/components/Notifications.test.js.map +1 -0
  324. package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +5 -2
  325. package/dist/src/ui/components/PermissionsModifyTrustDialog.js +12 -7
  326. package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
  327. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +2 -2
  328. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
  329. package/dist/src/ui/components/ProQuotaDialog.js +2 -2
  330. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
  331. package/dist/src/ui/components/QuittingDisplay.test.d.ts +6 -0
  332. package/dist/src/ui/components/QuittingDisplay.test.js +49 -0
  333. package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -0
  334. package/dist/src/ui/components/RawMarkdownIndicator.test.d.ts +6 -0
  335. package/dist/src/ui/components/RawMarkdownIndicator.test.js +34 -0
  336. package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +1 -0
  337. package/dist/src/ui/components/SessionBrowser.d.ts +98 -0
  338. package/dist/src/ui/components/SessionBrowser.js +457 -0
  339. package/dist/src/ui/components/SessionBrowser.js.map +1 -0
  340. package/dist/src/ui/components/SessionBrowser.test.d.ts +6 -0
  341. package/dist/src/ui/components/SessionBrowser.test.js +250 -0
  342. package/dist/src/ui/components/SessionBrowser.test.js.map +1 -0
  343. package/dist/src/ui/components/SettingsDialog.d.ts +3 -1
  344. package/dist/src/ui/components/SettingsDialog.js +4 -1
  345. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  346. package/dist/src/ui/components/ShellInputPrompt.test.d.ts +6 -0
  347. package/dist/src/ui/components/ShellInputPrompt.test.js +82 -0
  348. package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -0
  349. package/dist/src/ui/components/ShellModeIndicator.test.d.ts +6 -0
  350. package/dist/src/ui/components/ShellModeIndicator.test.js +17 -0
  351. package/dist/src/ui/components/ShellModeIndicator.test.js.map +1 -0
  352. package/dist/src/ui/components/ShowMoreLines.test.d.ts +6 -0
  353. package/dist/src/ui/components/ShowMoreLines.test.js +40 -0
  354. package/dist/src/ui/components/ShowMoreLines.test.js.map +1 -0
  355. package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +6 -0
  356. package/dist/src/ui/components/SuggestionsDisplay.test.js +56 -0
  357. package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -0
  358. package/dist/src/ui/components/ThemeDialog.js +6 -2
  359. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  360. package/dist/src/ui/components/ThemeDialog.test.js +20 -6
  361. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
  362. package/dist/src/ui/components/ThemedGradient.js +2 -1
  363. package/dist/src/ui/components/ThemedGradient.js.map +1 -1
  364. package/dist/src/ui/components/ThemedGradient.test.d.ts +6 -0
  365. package/dist/src/ui/components/ThemedGradient.test.js +30 -0
  366. package/dist/src/ui/components/ThemedGradient.test.js.map +1 -0
  367. package/dist/src/ui/components/Tips.test.d.ts +6 -0
  368. package/dist/src/ui/components/Tips.test.js +23 -0
  369. package/dist/src/ui/components/Tips.test.js.map +1 -0
  370. package/dist/src/ui/components/UpdateNotification.test.d.ts +6 -0
  371. package/dist/src/ui/components/UpdateNotification.test.js +16 -0
  372. package/dist/src/ui/components/UpdateNotification.test.js.map +1 -0
  373. package/dist/src/ui/components/messages/ErrorMessage.test.d.ts +6 -0
  374. package/dist/src/ui/components/messages/ErrorMessage.test.js +23 -0
  375. package/dist/src/ui/components/messages/ErrorMessage.test.js.map +1 -0
  376. package/dist/src/ui/components/messages/InfoMessage.test.d.ts +6 -0
  377. package/dist/src/ui/components/messages/InfoMessage.test.js +28 -0
  378. package/dist/src/ui/components/messages/InfoMessage.test.js.map +1 -0
  379. package/dist/src/ui/components/messages/ModelMessage.d.ts +11 -0
  380. package/dist/src/ui/components/messages/ModelMessage.js +5 -0
  381. package/dist/src/ui/components/messages/ModelMessage.js.map +1 -0
  382. package/dist/src/ui/components/messages/ShellToolMessage.d.ts +14 -0
  383. package/dist/src/ui/components/messages/ShellToolMessage.js +76 -0
  384. package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -0
  385. package/dist/src/ui/components/messages/ShellToolMessage.test.d.ts +6 -0
  386. package/dist/src/ui/components/messages/ShellToolMessage.test.js +123 -0
  387. package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -0
  388. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +5 -6
  389. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
  390. package/dist/src/ui/components/messages/ToolGroupMessage.js +19 -1
  391. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  392. package/dist/src/ui/components/messages/ToolMessage.d.ts +6 -4
  393. package/dist/src/ui/components/messages/ToolMessage.js +15 -102
  394. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  395. package/dist/src/ui/components/messages/ToolMessage.test.js +26 -26
  396. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
  397. package/dist/src/ui/components/messages/ToolResultDisplay.d.ts +13 -0
  398. package/dist/src/ui/components/messages/ToolResultDisplay.js +54 -0
  399. package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -0
  400. package/dist/src/ui/components/messages/ToolResultDisplay.test.d.ts +6 -0
  401. package/dist/src/ui/components/messages/ToolResultDisplay.test.js +96 -0
  402. package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -0
  403. package/dist/src/ui/components/messages/ToolShared.d.ts +23 -0
  404. package/dist/src/ui/components/messages/ToolShared.js +40 -0
  405. package/dist/src/ui/components/messages/ToolShared.js.map +1 -0
  406. package/dist/src/ui/components/messages/UserMessage.test.d.ts +6 -0
  407. package/dist/src/ui/components/messages/UserMessage.test.js +32 -0
  408. package/dist/src/ui/components/messages/UserMessage.test.js.map +1 -0
  409. package/dist/src/ui/components/messages/WarningMessage.test.d.ts +6 -0
  410. package/dist/src/ui/components/messages/WarningMessage.test.js +23 -0
  411. package/dist/src/ui/components/messages/WarningMessage.test.js.map +1 -0
  412. package/dist/src/ui/components/shared/text-buffer.d.ts +1 -0
  413. package/dist/src/ui/components/shared/text-buffer.js +27 -5
  414. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  415. package/dist/src/ui/components/shared/text-buffer.test.js +20 -0
  416. package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
  417. package/dist/src/ui/constants/tips.d.ts +6 -0
  418. package/dist/src/ui/constants/tips.js +168 -0
  419. package/dist/src/ui/constants/tips.js.map +1 -0
  420. package/dist/src/ui/constants/wittyPhrases.d.ts +6 -0
  421. package/dist/src/ui/constants/wittyPhrases.js +137 -0
  422. package/dist/src/ui/constants/wittyPhrases.js.map +1 -0
  423. package/dist/src/ui/constants.d.ts +1 -0
  424. package/dist/src/ui/constants.js +1 -0
  425. package/dist/src/ui/constants.js.map +1 -1
  426. package/dist/src/ui/contexts/KeypressContext.js +21 -11
  427. package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
  428. package/dist/src/ui/contexts/KeypressContext.test.js +29 -10
  429. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
  430. package/dist/src/ui/contexts/UIActionsContext.d.ts +8 -0
  431. package/dist/src/ui/contexts/UIActionsContext.js +1 -0
  432. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
  433. package/dist/src/ui/contexts/UIStateContext.d.ts +5 -0
  434. package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
  435. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +1 -0
  436. package/dist/src/ui/hooks/shellCommandProcessor.js +11 -5
  437. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  438. package/dist/src/ui/hooks/shellCommandProcessor.test.js +4 -3
  439. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
  440. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -3
  441. package/dist/src/ui/hooks/slashCommandProcessor.js +17 -5
  442. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  443. package/dist/src/ui/hooks/slashCommandProcessor.test.js +2 -0
  444. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
  445. package/dist/src/ui/hooks/useAlternateBuffer.js +1 -1
  446. package/dist/src/ui/hooks/useAlternateBuffer.js.map +1 -1
  447. package/dist/src/ui/hooks/useBanner.d.ts +14 -0
  448. package/dist/src/ui/hooks/useBanner.js +48 -0
  449. package/dist/src/ui/hooks/useBanner.js.map +1 -0
  450. package/dist/src/ui/hooks/useBanner.test.d.ts +6 -0
  451. package/dist/src/ui/hooks/useBanner.test.js +92 -0
  452. package/dist/src/ui/hooks/useBanner.test.js.map +1 -0
  453. package/dist/src/ui/hooks/useBracketedPaste.js +3 -4
  454. package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -1
  455. package/dist/src/ui/hooks/useCommandCompletion.test.js +5 -5
  456. package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
  457. package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -1
  458. package/dist/src/ui/hooks/useConsoleMessages.js +26 -1
  459. package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
  460. package/dist/src/ui/hooks/useConsoleMessages.test.js +37 -5
  461. package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -1
  462. package/dist/src/ui/hooks/useEditorSettings.d.ts +2 -2
  463. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
  464. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
  465. package/dist/src/ui/hooks/useFolderTrust.js +11 -1
  466. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
  467. package/dist/src/ui/hooks/useFolderTrust.test.js +22 -0
  468. package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
  469. package/dist/src/ui/hooks/useGeminiStream.d.ts +2 -1
  470. package/dist/src/ui/hooks/useGeminiStream.js +69 -12
  471. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  472. package/dist/src/ui/hooks/useGeminiStream.test.js +21 -22
  473. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
  474. package/dist/src/ui/hooks/useHistoryManager.d.ts +5 -2
  475. package/dist/src/ui/hooks/useHistoryManager.js +39 -3
  476. package/dist/src/ui/hooks/useHistoryManager.js.map +1 -1
  477. package/dist/src/ui/hooks/useInactivityTimer.d.ts +14 -0
  478. package/dist/src/ui/hooks/useInactivityTimer.js +30 -0
  479. package/dist/src/ui/hooks/useInactivityTimer.js.map +1 -0
  480. package/dist/src/ui/hooks/useIncludeDirsTrust.d.ts +8 -0
  481. package/dist/src/ui/hooks/useIncludeDirsTrust.js +119 -0
  482. package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -0
  483. package/dist/src/ui/hooks/useIncludeDirsTrust.test.d.ts +6 -0
  484. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +151 -0
  485. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -0
  486. package/dist/src/ui/hooks/useInputHistoryStore.test.js +4 -1
  487. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -1
  488. package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -1
  489. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +1 -2
  490. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -1
  491. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
  492. package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
  493. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
  494. package/dist/src/ui/hooks/useLoadingIndicator.test.js +21 -9
  495. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
  496. package/dist/src/ui/hooks/useMouseClick.d.ts +12 -0
  497. package/dist/src/ui/hooks/useMouseClick.js +28 -0
  498. package/dist/src/ui/hooks/useMouseClick.js.map +1 -0
  499. package/dist/src/ui/hooks/useMouseClick.test.d.ts +6 -0
  500. package/dist/src/ui/hooks/useMouseClick.test.js +59 -0
  501. package/dist/src/ui/hooks/useMouseClick.test.js.map +1 -0
  502. package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +2 -2
  503. package/dist/src/ui/hooks/usePermissionsModifyTrust.js +44 -7
  504. package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -1
  505. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +191 -89
  506. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
  507. package/dist/src/ui/hooks/usePhraseCycler.d.ts +4 -3
  508. package/dist/src/ui/hooks/usePhraseCycler.js +54 -305
  509. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  510. package/dist/src/ui/hooks/usePhraseCycler.test.js +109 -30
  511. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
  512. package/dist/src/ui/hooks/useQuotaAndFallback.js +9 -3
  513. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
  514. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +25 -3
  515. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
  516. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
  517. package/dist/src/ui/hooks/useReactToolScheduler.js +4 -8
  518. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  519. package/dist/src/ui/hooks/useReactToolScheduler.test.js +1 -8
  520. package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -1
  521. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +18 -12
  522. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -1
  523. package/dist/src/ui/hooks/useSessionBrowser.d.ts +18 -1
  524. package/dist/src/ui/hooks/useSessionBrowser.js +76 -4
  525. package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
  526. package/dist/src/ui/hooks/useSessionBrowser.test.js +154 -489
  527. package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -1
  528. package/dist/src/ui/hooks/useSessionResume.js +1 -1
  529. package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
  530. package/dist/src/ui/hooks/useSessionResume.test.js +4 -4
  531. package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -1
  532. package/dist/src/ui/hooks/useSlashCompletion.test.js +5 -5
  533. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
  534. package/dist/src/ui/hooks/useThemeCommand.d.ts +2 -2
  535. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  536. package/dist/src/ui/hooks/useToolScheduler.test.js +8 -4
  537. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  538. package/dist/src/ui/keyMatchers.test.js +2 -2
  539. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  540. package/dist/src/ui/layouts/DefaultAppLayout.js +1 -1
  541. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
  542. package/dist/src/ui/noninteractive/nonInteractiveUi.js +1 -0
  543. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -1
  544. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.d.ts +6 -0
  545. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +121 -0
  546. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -0
  547. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.d.ts +6 -0
  548. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +34 -0
  549. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +1 -0
  550. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.d.ts +6 -0
  551. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +34 -0
  552. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +1 -0
  553. package/dist/src/ui/privacy/PrivacyNotice.test.d.ts +6 -0
  554. package/dist/src/ui/privacy/PrivacyNotice.test.js +62 -0
  555. package/dist/src/ui/privacy/PrivacyNotice.test.js.map +1 -0
  556. package/dist/src/ui/state/extensions.test.js +208 -51
  557. package/dist/src/ui/state/extensions.test.js.map +1 -1
  558. package/dist/src/ui/themes/holiday.d.ts +7 -0
  559. package/dist/src/ui/themes/holiday.js +162 -0
  560. package/dist/src/ui/themes/holiday.js.map +1 -0
  561. package/dist/src/ui/themes/theme-manager.js +2 -0
  562. package/dist/src/ui/themes/theme-manager.js.map +1 -1
  563. package/dist/src/ui/themes/theme-manager.test.js +2 -1
  564. package/dist/src/ui/themes/theme-manager.test.js.map +1 -1
  565. package/dist/src/ui/types.d.ts +7 -1
  566. package/dist/src/ui/types.js +1 -1
  567. package/dist/src/ui/types.js.map +1 -1
  568. package/dist/src/ui/utils/ConsolePatcher.js +6 -9
  569. package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
  570. package/dist/src/ui/utils/bracketedPaste.d.ts +7 -0
  571. package/dist/src/ui/utils/bracketedPaste.js +15 -0
  572. package/dist/src/ui/utils/bracketedPaste.js.map +1 -0
  573. package/dist/src/ui/utils/commandUtils.js +3 -86
  574. package/dist/src/ui/utils/commandUtils.js.map +1 -1
  575. package/dist/src/ui/utils/commandUtils.test.js +21 -273
  576. package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
  577. package/dist/src/ui/utils/directoryUtils.d.ts +6 -0
  578. package/dist/src/ui/utils/directoryUtils.js +21 -0
  579. package/dist/src/ui/utils/directoryUtils.js.map +1 -0
  580. package/dist/src/ui/utils/directoryUtils.test.d.ts +6 -0
  581. package/dist/src/ui/utils/directoryUtils.test.js +52 -0
  582. package/dist/src/ui/utils/directoryUtils.test.js.map +1 -0
  583. package/dist/src/ui/utils/kittyProtocolDetector.d.ts +6 -2
  584. package/dist/src/ui/utils/kittyProtocolDetector.js +47 -43
  585. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
  586. package/dist/src/ui/utils/kittyProtocolDetector.test.d.ts +6 -0
  587. package/dist/src/ui/utils/kittyProtocolDetector.test.js +113 -0
  588. package/dist/src/ui/utils/kittyProtocolDetector.test.js.map +1 -0
  589. package/dist/src/ui/utils/mouse.d.ts +2 -2
  590. package/dist/src/ui/utils/mouse.js +2 -11
  591. package/dist/src/ui/utils/mouse.js.map +1 -1
  592. package/dist/src/ui/utils/terminalSetup.js +39 -38
  593. package/dist/src/ui/utils/terminalSetup.js.map +1 -1
  594. package/dist/src/ui/utils/terminalSetup.test.d.ts +6 -0
  595. package/dist/src/ui/utils/terminalSetup.test.js +132 -0
  596. package/dist/src/ui/utils/terminalSetup.test.js.map +1 -0
  597. package/dist/src/ui/utils/ui-sizing.test.d.ts +6 -0
  598. package/dist/src/ui/utils/ui-sizing.test.js +56 -0
  599. package/dist/src/ui/utils/ui-sizing.test.js.map +1 -0
  600. package/dist/src/utils/checks.test.d.ts +6 -0
  601. package/dist/src/utils/checks.test.js +29 -0
  602. package/dist/src/utils/checks.test.js.map +1 -0
  603. package/dist/src/utils/cleanup.d.ts +2 -0
  604. package/dist/src/utils/cleanup.js +16 -0
  605. package/dist/src/utils/cleanup.js.map +1 -1
  606. package/dist/src/utils/cleanup.test.js +69 -16
  607. package/dist/src/utils/cleanup.test.js.map +1 -1
  608. package/dist/src/utils/dialogScopeUtils.test.d.ts +6 -0
  609. package/dist/src/utils/dialogScopeUtils.test.js +81 -0
  610. package/dist/src/utils/dialogScopeUtils.test.js.map +1 -0
  611. package/dist/src/utils/errors.js +10 -0
  612. package/dist/src/utils/errors.js.map +1 -1
  613. package/dist/src/utils/errors.test.js +62 -0
  614. package/dist/src/utils/errors.test.js.map +1 -1
  615. package/dist/src/utils/events.d.ts +0 -2
  616. package/dist/src/utils/events.js +0 -1
  617. package/dist/src/utils/events.js.map +1 -1
  618. package/dist/src/utils/events.test.d.ts +6 -0
  619. package/dist/src/utils/events.test.js +24 -0
  620. package/dist/src/utils/events.test.js.map +1 -0
  621. package/dist/src/utils/handleAutoUpdate.test.js +103 -24
  622. package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
  623. package/dist/src/utils/installationInfo.test.js +8 -9
  624. package/dist/src/utils/installationInfo.test.js.map +1 -1
  625. package/dist/src/utils/math.test.d.ts +6 -0
  626. package/dist/src/utils/math.test.js +23 -0
  627. package/dist/src/utils/math.test.js.map +1 -0
  628. package/dist/src/utils/persistentState.d.ts +1 -1
  629. package/dist/src/utils/persistentState.test.d.ts +6 -0
  630. package/dist/src/utils/persistentState.test.js +68 -0
  631. package/dist/src/utils/persistentState.test.js.map +1 -0
  632. package/dist/src/utils/readStdin.js +1 -0
  633. package/dist/src/utils/readStdin.js.map +1 -1
  634. package/dist/src/utils/readStdin.test.js +25 -0
  635. package/dist/src/utils/readStdin.test.js.map +1 -1
  636. package/dist/src/utils/resolvePath.test.d.ts +6 -0
  637. package/dist/src/utils/resolvePath.test.js +31 -0
  638. package/dist/src/utils/resolvePath.test.js.map +1 -0
  639. package/dist/src/utils/sandbox.js +6 -137
  640. package/dist/src/utils/sandbox.js.map +1 -1
  641. package/dist/src/utils/sandbox.test.d.ts +6 -0
  642. package/dist/src/utils/sandbox.test.js +302 -0
  643. package/dist/src/utils/sandbox.test.js.map +1 -0
  644. package/dist/src/utils/sandboxUtils.d.ts +14 -0
  645. package/dist/src/utils/sandboxUtils.js +120 -0
  646. package/dist/src/utils/sandboxUtils.js.map +1 -0
  647. package/dist/src/utils/sandboxUtils.test.d.ts +6 -0
  648. package/dist/src/utils/sandboxUtils.test.js +119 -0
  649. package/dist/src/utils/sandboxUtils.test.js.map +1 -0
  650. package/dist/src/utils/sessionCleanup.test.js +42 -2
  651. package/dist/src/utils/sessionCleanup.test.js.map +1 -1
  652. package/dist/src/utils/sessionUtils.d.ts +54 -4
  653. package/dist/src/utils/sessionUtils.js +106 -26
  654. package/dist/src/utils/sessionUtils.js.map +1 -1
  655. package/dist/src/utils/sessionUtils.test.js +46 -3
  656. package/dist/src/utils/sessionUtils.test.js.map +1 -1
  657. package/dist/src/utils/sessions.js +4 -1
  658. package/dist/src/utils/sessions.js.map +1 -1
  659. package/dist/src/utils/sessions.test.d.ts +6 -0
  660. package/dist/src/utils/sessions.test.js +558 -0
  661. package/dist/src/utils/sessions.test.js.map +1 -0
  662. package/dist/src/utils/updateEventEmitter.test.d.ts +6 -0
  663. package/dist/src/utils/updateEventEmitter.test.js +18 -0
  664. package/dist/src/utils/updateEventEmitter.test.js.map +1 -0
  665. package/dist/src/utils/version.test.d.ts +6 -0
  666. package/dist/src/utils/version.test.js +39 -0
  667. package/dist/src/utils/version.test.js.map +1 -0
  668. package/dist/src/validateNonInterActiveAuth.js +2 -0
  669. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  670. package/dist/src/zed-integration/acp.d.ts +2 -24
  671. package/dist/src/zed-integration/acp.js +2 -156
  672. package/dist/src/zed-integration/acp.js.map +1 -1
  673. package/dist/src/zed-integration/acp.test.d.ts +6 -0
  674. package/dist/src/zed-integration/acp.test.js +227 -0
  675. package/dist/src/zed-integration/acp.test.js.map +1 -0
  676. package/dist/src/zed-integration/connection.d.ts +28 -0
  677. package/dist/src/zed-integration/connection.js +163 -0
  678. package/dist/src/zed-integration/connection.js.map +1 -0
  679. package/dist/src/zed-integration/connection.test.d.ts +6 -0
  680. package/dist/src/zed-integration/connection.test.js +175 -0
  681. package/dist/src/zed-integration/connection.test.js.map +1 -0
  682. package/dist/src/zed-integration/fileSystemService.test.d.ts +6 -0
  683. package/dist/src/zed-integration/fileSystemService.test.js +98 -0
  684. package/dist/src/zed-integration/fileSystemService.test.js.map +1 -0
  685. package/dist/src/zed-integration/schema.d.ts +69 -13
  686. package/dist/src/zed-integration/schema.js +6 -5
  687. package/dist/src/zed-integration/schema.js.map +1 -1
  688. package/dist/src/zed-integration/zedIntegration.d.ts +31 -8
  689. package/dist/src/zed-integration/zedIntegration.js +14 -23
  690. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  691. package/dist/src/zed-integration/zedIntegration.test.d.ts +6 -0
  692. package/dist/src/zed-integration/zedIntegration.test.js +619 -0
  693. package/dist/src/zed-integration/zedIntegration.test.js.map +1 -0
  694. package/dist/tsconfig.tsbuildinfo +1 -1
  695. package/package.json +10 -9
@@ -4,339 +4,88 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { useState, useEffect, useRef } from 'react';
7
- export const WITTY_LOADING_PHRASES = [
8
- "I'm Feeling Lucky",
9
- 'Shipping awesomeness... ',
10
- 'Painting the serifs back on...',
11
- 'Navigating the slime mold...',
12
- 'Consulting the digital spirits...',
13
- 'Reticulating splines...',
14
- 'Warming up the AI hamsters...',
15
- 'Asking the magic conch shell...',
16
- 'Generating witty retort...',
17
- 'Polishing the algorithms...',
18
- "Don't rush perfection (or my code)...",
19
- 'Brewing fresh bytes...',
20
- 'Counting electrons...',
21
- 'Engaging cognitive processors...',
22
- 'Checking for syntax errors in the universe...',
23
- 'One moment, optimizing humor...',
24
- 'Shuffling punchlines...',
25
- 'Untangling neural nets...',
26
- 'Compiling brilliance...',
27
- 'Loading wit.exe...',
28
- 'Summoning the cloud of wisdom...',
29
- 'Preparing a witty response...',
30
- "Just a sec, I'm debugging reality...",
31
- 'Confuzzling the options...',
32
- 'Tuning the cosmic frequencies...',
33
- 'Crafting a response worthy of your patience...',
34
- 'Compiling the 1s and 0s...',
35
- 'Resolving dependencies... and existential crises...',
36
- 'Defragmenting memories... both RAM and personal...',
37
- 'Rebooting the humor module...',
38
- 'Caching the essentials (mostly cat memes)...',
39
- 'Optimizing for ludicrous speed',
40
- "Swapping bits... don't tell the bytes...",
41
- 'Garbage collecting... be right back...',
42
- 'Assembling the interwebs...',
43
- 'Converting coffee into code...',
44
- 'Updating the syntax for reality...',
45
- 'Rewiring the synapses...',
46
- 'Looking for a misplaced semicolon...',
47
- "Greasin' the cogs of the machine...",
48
- 'Pre-heating the servers...',
49
- 'Calibrating the flux capacitor...',
50
- 'Engaging the improbability drive...',
51
- 'Channeling the Force...',
52
- 'Aligning the stars for optimal response...',
53
- 'So say we all...',
54
- 'Loading the next great idea...',
55
- "Just a moment, I'm in the zone...",
56
- 'Preparing to dazzle you with brilliance...',
57
- "Just a tick, I'm polishing my wit...",
58
- "Hold tight, I'm crafting a masterpiece...",
59
- "Just a jiffy, I'm debugging the universe...",
60
- "Just a moment, I'm aligning the pixels...",
61
- "Just a sec, I'm optimizing the humor...",
62
- "Just a moment, I'm tuning the algorithms...",
63
- 'Warp speed engaged...',
64
- 'Mining for more Dilithium crystals...',
65
- "Don't panic...",
66
- 'Following the white rabbit...',
67
- 'The truth is in here... somewhere...',
68
- 'Blowing on the cartridge...',
69
- 'Loading... Do a barrel roll!',
70
- 'Waiting for the respawn...',
71
- 'Finishing the Kessel Run in less than 12 parsecs...',
72
- "The cake is not a lie, it's just still loading...",
73
- 'Fiddling with the character creation screen...',
74
- "Just a moment, I'm finding the right meme...",
75
- "Pressing 'A' to continue...",
76
- 'Herding digital cats...',
77
- 'Polishing the pixels...',
78
- 'Finding a suitable loading screen pun...',
79
- 'Distracting you with this witty phrase...',
80
- 'Almost there... probably...',
81
- 'Our hamsters are working as fast as they can...',
82
- 'Giving Cloudy a pat on the head...',
83
- 'Petting the cat...',
84
- 'Rickrolling my boss...',
85
- 'Never gonna give you up, never gonna let you down...',
86
- 'Slapping the bass...',
87
- 'Tasting the snozberries...',
88
- "I'm going the distance, I'm going for speed...",
89
- 'Is this the real life? Is this just fantasy?...',
90
- "I've got a good feeling about this...",
91
- 'Poking the bear...',
92
- 'Doing research on the latest memes...',
93
- 'Figuring out how to make this more witty...',
94
- 'Hmmm... let me think...',
95
- 'What do you call a fish with no eyes? A fsh...',
96
- 'Why did the computer go to therapy? It had too many bytes...',
97
- "Why don't programmers like nature? It has too many bugs...",
98
- 'Why do programmers prefer dark mode? Because light attracts bugs...',
99
- 'Why did the developer go broke? Because they used up all their cache...',
100
- "What can you do with a broken pencil? Nothing, it's pointless...",
101
- 'Applying percussive maintenance...',
102
- 'Searching for the correct USB orientation...',
103
- 'Ensuring the magic smoke stays inside the wires...',
104
- 'Rewriting in Rust for no particular reason...',
105
- 'Trying to exit Vim...',
106
- 'Spinning up the hamster wheel...',
107
- "That's not a bug, it's an undocumented feature...",
108
- 'Engage.',
109
- "I'll be back... with an answer.",
110
- 'My other process is a TARDIS...',
111
- 'Communing with the machine spirit...',
112
- 'Letting the thoughts marinate...',
113
- 'Just remembered where I put my keys...',
114
- 'Pondering the orb...',
115
- "I've seen things you people wouldn't believe... like a user who reads loading messages.",
116
- 'Initiating thoughtful gaze...',
117
- "What's a computer's favorite snack? Microchips.",
118
- "Why do Java developers wear glasses? Because they don't C#.",
119
- 'Charging the laser... pew pew!',
120
- 'Dividing by zero... just kidding!',
121
- 'Looking for an adult superviso... I mean, processing.',
122
- 'Making it go beep boop.',
123
- 'Buffering... because even AIs need a moment.',
124
- 'Entangling quantum particles for a faster response...',
125
- 'Polishing the chrome... on the algorithms.',
126
- 'Are you not entertained? (Working on it!)',
127
- 'Summoning the code gremlins... to help, of course.',
128
- 'Just waiting for the dial-up tone to finish...',
129
- 'Recalibrating the humor-o-meter.',
130
- 'My other loading screen is even funnier.',
131
- "Pretty sure there's a cat walking on the keyboard somewhere...",
132
- 'Enhancing... Enhancing... Still loading.',
133
- "It's not a bug, it's a feature... of this loading screen.",
134
- 'Have you tried turning it off and on again? (The loading screen, not me.)',
135
- 'Constructing additional pylons...',
136
- 'New line? That’s Ctrl+J.',
137
- 'Releasing the HypnoDrones...',
138
- ];
139
- export const INFORMATIVE_TIPS = [
140
- //Settings tips start here
141
- 'Set your preferred editor for opening files (/settings)...',
142
- 'Toggle Vim mode for a modal editing experience (/settings)...',
143
- 'Disable automatic updates if you prefer manual control (/settings)...',
144
- 'Turn off nagging update notifications (settings.json)...',
145
- 'Enable checkpointing to recover your session after a crash (settings.json)...',
146
- 'Change CLI output format to JSON for scripting (/settings)...',
147
- 'Personalize your CLI with a new color theme (/settings)...',
148
- 'Create and use your own custom themes (settings.json)...',
149
- 'Hide window title for a more minimal UI (/settings)...',
150
- "Don't like these tips? You can hide them (/settings)...",
151
- 'Hide the startup banner for a cleaner launch (/settings)...',
152
- 'Reclaim vertical space by hiding the footer (/settings)...',
153
- 'Show memory usage for performance monitoring (/settings)...',
154
- 'Show citations to see where the model gets information (/settings)...',
155
- 'Disable loading phrases for a quieter experience (/settings)...',
156
- 'Add custom witty phrases to the loading screen (settings.json)...',
157
- 'Choose a specific Gemini model for conversations (/settings)...',
158
- 'Limit the number of turns in your session history (/settings)...',
159
- 'Automatically summarize large tool outputs to save tokens (settings.json)...',
160
- 'Control when chat history gets compressed based on token usage (settings.json)...',
161
- 'Define custom context file names, like CONTEXT.md (settings.json)...',
162
- 'Set max directories to scan for context files (/settings)...',
163
- 'Expand your workspace with additional directories (/directory)...',
164
- 'Control how /memory refresh loads context files (/settings)...',
165
- 'Toggle respect for .gitignore files in context (/settings)...',
166
- 'Toggle respect for .geminiignore files in context (/settings)...',
167
- 'Enable recursive file search for @-file completions (/settings)...',
168
- 'Run tools in a secure sandbox environment (settings.json)...',
169
- 'Use an interactive terminal for shell commands (/settings)...',
170
- 'Restrict available built-in tools (settings.json)...',
171
- 'Exclude specific tools from being used (settings.json)...',
172
- 'Bypass confirmation for trusted tools (settings.json)...',
173
- 'Use a custom command for tool discovery (settings.json)...',
174
- 'Define a custom command for calling discovered tools (settings.json)...',
175
- 'Define and manage connections to MCP servers (settings.json)...',
176
- 'Enable folder trust to enhance security (/settings)...',
177
- 'Change your authentication method (/settings)...',
178
- 'Enforce auth type for enterprise use (settings.json)...',
179
- 'Let Node.js auto-configure memory (settings.json)...',
180
- 'Customize the DNS resolution order (settings.json)...',
181
- 'Exclude env vars from the context (settings.json)...',
182
- 'Configure a custom command for filing bug reports (settings.json)...',
183
- 'Enable or disable telemetry collection (/settings)...',
184
- 'Send telemetry data to a local file or GCP (settings.json)...',
185
- 'Configure the OTLP endpoint for telemetry (settings.json)...',
186
- 'Choose whether to log prompt content (settings.json)...',
187
- 'Enable AI-powered prompt completion while typing (/settings)...',
188
- 'Enable debug logging of keystrokes to the console (/settings)...',
189
- 'Enable automatic session cleanup of old conversations (/settings)...',
190
- 'Show Cell CLI status in the terminal window title (/settings)...',
191
- 'Use the entire width of the terminal for output (/settings)...',
192
- 'Enable screen reader mode for better accessibility (/settings)...',
193
- 'Skip the next speaker check for faster responses (/settings)...',
194
- 'Use ripgrep for faster file content search (/settings)...',
195
- 'Enable truncation of large tool outputs to save tokens (/settings)...',
196
- 'Set the character threshold for truncating tool outputs (/settings)...',
197
- 'Set the number of lines to keep when truncating outputs (/settings)...',
198
- 'Enable policy-based tool confirmation via message bus (/settings)...',
199
- 'Enable smart-edit tool for more precise editing (/settings)...',
200
- 'Enable write_todos tool to generate task lists (/settings)...',
201
- 'Enable model routing based on complexity (/settings)...',
202
- 'Enable experimental subagents for task delegation (/settings)...',
203
- //Settings tips end here
204
- // Keyboard shortcut tips start here
205
- 'Close dialogs and suggestions with Esc...',
206
- 'Cancel a request with Ctrl+C, or press twice to exit...',
207
- 'Exit the app with Ctrl+D on an empty line...',
208
- 'Clear your screen at any time with Ctrl+L...',
209
- 'Toggle the debug console display with F12...',
210
- 'See full, untruncated responses with Ctrl+S...',
211
- 'Toggle auto-approval (YOLO mode) for all tools with Ctrl+Y...',
212
- 'Toggle shell mode by typing ! in an empty prompt...',
213
- 'Insert a newline with a backslash (\\) followed by Enter...',
214
- 'Navigate your prompt history with the Up and Down arrows...',
215
- 'You can also use Ctrl+P (up) and Ctrl+N (down) for history...',
216
- 'Submit your prompt to Gemini with Enter...',
217
- 'Accept an autocomplete suggestion with Tab or Enter...',
218
- 'Move to the start of the line with Ctrl+A or Home...',
219
- 'Move to the end of the line with Ctrl+E or End...',
220
- 'Move one character left or right with Ctrl+B/F or the arrow keys...',
221
- 'Move one word left or right with Ctrl+Left/Right Arrow...',
222
- 'Delete the character to the left with Ctrl+H or Backspace...',
223
- 'Delete the character to the right with Ctrl+D or Delete...',
224
- 'Delete the word to the left of the cursor with Ctrl+W...',
225
- 'Delete the word to the right of the cursor with Ctrl+Delete...',
226
- 'Delete from the cursor to the start of the line with Ctrl+U...',
227
- 'Delete from the cursor to the end of the line with Ctrl+K...',
228
- 'Clear the entire input prompt with a double-press of Esc...',
229
- 'Paste from your clipboard with Ctrl+V...',
230
- 'Open the current prompt in an external editor with Ctrl+X...',
231
- 'In menus, move up/down with k/j or the arrow keys...',
232
- 'In menus, select an item by typing its number...',
233
- "If you're using an IDE, see the context with Ctrl+G...",
234
- // Keyboard shortcut tips end here
235
- // Command tips start here
236
- 'Show version info with /about...',
237
- 'Change your authentication method with /auth...',
238
- 'File a bug report directly with /bug...',
239
- 'List your saved chat checkpoints with /chat list...',
240
- 'Save your current conversation with /chat save <tag>...',
241
- 'Resume a saved conversation with /chat resume <tag>...',
242
- 'Delete a conversation checkpoint with /chat delete <tag>...',
243
- 'Share your conversation to a file with /chat share <file>...',
244
- 'Clear the screen and history with /clear...',
245
- 'Save tokens by summarizing the context with /compress...',
246
- 'Copy the last response to your clipboard with /copy...',
247
- 'Open the full documentation in your browser with /docs...',
248
- 'Add directories to your workspace with /directory add <path>...',
249
- 'Show all directories in your workspace with /directory show...',
250
- 'Set your preferred external editor with /editor...',
251
- 'List all active extensions with /extensions list...',
252
- 'Update all or specific extensions with /extensions update...',
253
- 'Get help on commands with /help...',
254
- 'Manage IDE integration with /ide...',
255
- 'Create a project-specific GEMINI.md file with /init...',
256
- 'List configured MCP servers and tools with /mcp list...',
257
- 'Authenticate with an OAuth-enabled MCP server with /mcp auth...',
258
- 'Restart MCP servers with /mcp refresh...',
259
- 'See the current instructional context with /memory show...',
260
- 'Add content to the instructional memory with /memory add...',
261
- 'Reload instructional context from GEMINI.md files with /memory refresh...',
262
- 'List the paths of the GEMINI.md files in use with /memory list...',
263
- 'Display the privacy notice with /privacy...',
264
- 'Exit the CLI with /quit or /exit...',
265
- 'Check model-specific usage stats with /stats model...',
266
- 'Check tool-specific usage stats with /stats tools...',
267
- "Change the CLI's color theme with /theme...",
268
- 'List all available tools with /tools...',
269
- 'View and edit settings with the /settings editor...',
270
- 'Toggle Vim keybindings on and off with /vim...',
271
- 'Set up GitHub Actions with /setup-github...',
272
- 'Configure terminal keybindings for multiline input with /terminal-setup...',
273
- 'Find relevant documentation with /find-docs...',
274
- 'Review a pull request with /oncall:pr-review...',
275
- 'Go back to main and clean up the branch with /github:cleanup-back-to-main...',
276
- 'Execute any shell command with !<command>...',
277
- // Command tips end here
278
- ];
7
+ import { SHELL_FOCUS_HINT_DELAY_MS } from '../constants.js';
8
+ import { INFORMATIVE_TIPS } from '../constants/tips.js';
9
+ import { WITTY_LOADING_PHRASES } from '../constants/wittyPhrases.js';
10
+ import { useInactivityTimer } from './useInactivityTimer.js';
279
11
  export const PHRASE_CHANGE_INTERVAL_MS = 15000;
12
+ export const INTERACTIVE_SHELL_WAITING_PHRASE = 'Interactive shell awaiting input... press Ctrl+f to focus shell';
280
13
  /**
281
14
  * Custom hook to manage cycling through loading phrases.
282
15
  * @param isActive Whether the phrase cycling should be active.
283
16
  * @param isWaiting Whether to show a specific waiting phrase.
17
+ * @param isInteractiveShellWaiting Whether an interactive shell is waiting for input but not focused.
18
+ * @param customPhrases Optional list of custom phrases to use.
284
19
  * @returns The current loading phrase.
285
20
  */
286
- export const usePhraseCycler = (isActive, isWaiting, customPhrases) => {
21
+ export const usePhraseCycler = (isActive, isWaiting, isInteractiveShellWaiting, lastOutputTime = 0, customPhrases) => {
287
22
  const loadingPhrases = customPhrases && customPhrases.length > 0
288
23
  ? customPhrases
289
24
  : WITTY_LOADING_PHRASES;
290
25
  const [currentLoadingPhrase, setCurrentLoadingPhrase] = useState(loadingPhrases[0]);
26
+ const showShellFocusHint = useInactivityTimer(isInteractiveShellWaiting && lastOutputTime > 0, lastOutputTime, SHELL_FOCUS_HINT_DELAY_MS);
291
27
  const phraseIntervalRef = useRef(null);
28
+ const hasShownFirstRequestTipRef = useRef(false);
292
29
  useEffect(() => {
30
+ // Always clear on re-run
31
+ if (phraseIntervalRef.current) {
32
+ clearInterval(phraseIntervalRef.current);
33
+ phraseIntervalRef.current = null;
34
+ }
35
+ if (isInteractiveShellWaiting && showShellFocusHint) {
36
+ setCurrentLoadingPhrase(INTERACTIVE_SHELL_WAITING_PHRASE);
37
+ return;
38
+ }
293
39
  if (isWaiting) {
294
40
  setCurrentLoadingPhrase('Waiting for user confirmation...');
295
- if (phraseIntervalRef.current) {
296
- clearInterval(phraseIntervalRef.current);
297
- phraseIntervalRef.current = null;
298
- }
41
+ return;
299
42
  }
300
- else if (isActive) {
301
- if (phraseIntervalRef.current) {
302
- clearInterval(phraseIntervalRef.current);
43
+ if (!isActive) {
44
+ setCurrentLoadingPhrase(loadingPhrases[0]);
45
+ return;
46
+ }
47
+ const setRandomPhrase = () => {
48
+ if (customPhrases && customPhrases.length > 0) {
49
+ const randomIndex = Math.floor(Math.random() * customPhrases.length);
50
+ setCurrentLoadingPhrase(customPhrases[randomIndex]);
303
51
  }
304
- const setRandomPhrase = () => {
305
- if (customPhrases && customPhrases.length > 0) {
306
- const randomIndex = Math.floor(Math.random() * customPhrases.length);
307
- setCurrentLoadingPhrase(customPhrases[randomIndex]);
52
+ else {
53
+ let phraseList;
54
+ // Show a tip on the first request after startup, then continue with 1/6 chance
55
+ if (!hasShownFirstRequestTipRef.current) {
56
+ // Show a tip during the first request
57
+ phraseList = INFORMATIVE_TIPS;
58
+ hasShownFirstRequestTipRef.current = true;
308
59
  }
309
60
  else {
310
- // Roughly 1 in 6 chance to show a tip.
61
+ // Roughly 1 in 6 chance to show a tip after the first request
311
62
  const showTip = Math.random() < 1 / 6;
312
- const phraseList = showTip ? INFORMATIVE_TIPS : WITTY_LOADING_PHRASES;
313
- const randomIndex = Math.floor(Math.random() * phraseList.length);
314
- setCurrentLoadingPhrase(phraseList[randomIndex]);
63
+ phraseList = showTip ? INFORMATIVE_TIPS : WITTY_LOADING_PHRASES;
315
64
  }
316
- };
317
- // Select an initial random phrase
318
- setRandomPhrase();
319
- phraseIntervalRef.current = setInterval(() => {
320
- // Select a new random phrase
321
- setRandomPhrase();
322
- }, PHRASE_CHANGE_INTERVAL_MS);
323
- }
324
- else {
325
- // Idle or other states, clear the phrase interval
326
- // and reset to the first phrase for next active state.
327
- if (phraseIntervalRef.current) {
328
- clearInterval(phraseIntervalRef.current);
329
- phraseIntervalRef.current = null;
65
+ const randomIndex = Math.floor(Math.random() * phraseList.length);
66
+ setCurrentLoadingPhrase(phraseList[randomIndex]);
330
67
  }
331
- setCurrentLoadingPhrase(loadingPhrases[0]);
332
- }
68
+ };
69
+ // Select an initial random phrase
70
+ setRandomPhrase();
71
+ phraseIntervalRef.current = setInterval(() => {
72
+ // Select a new random phrase
73
+ setRandomPhrase();
74
+ }, PHRASE_CHANGE_INTERVAL_MS);
333
75
  return () => {
334
76
  if (phraseIntervalRef.current) {
335
77
  clearInterval(phraseIntervalRef.current);
336
78
  phraseIntervalRef.current = null;
337
79
  }
338
80
  };
339
- }, [isActive, isWaiting, customPhrases, loadingPhrases]);
81
+ }, [
82
+ isActive,
83
+ isWaiting,
84
+ isInteractiveShellWaiting,
85
+ customPhrases,
86
+ loadingPhrases,
87
+ showShellFocusHint,
88
+ ]);
340
89
  return currentLoadingPhrase;
341
90
  };
342
91
  //# sourceMappingURL=usePhraseCycler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePhraseCycler.js","sourceRoot":"","sources":["../../../../src/ui/hooks/usePhraseCycler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB;IACnB,0BAA0B;IAC1B,gCAAgC;IAChC,8BAA8B;IAC9B,mCAAmC;IACnC,yBAAyB;IACzB,+BAA+B;IAC/B,iCAAiC;IACjC,4BAA4B;IAC5B,6BAA6B;IAC7B,uCAAuC;IACvC,wBAAwB;IACxB,uBAAuB;IACvB,kCAAkC;IAClC,+CAA+C;IAC/C,iCAAiC;IACjC,yBAAyB;IACzB,2BAA2B;IAC3B,yBAAyB;IACzB,oBAAoB;IACpB,kCAAkC;IAClC,+BAA+B;IAC/B,sCAAsC;IACtC,4BAA4B;IAC5B,kCAAkC;IAClC,gDAAgD;IAChD,4BAA4B;IAC5B,qDAAqD;IACrD,oDAAoD;IACpD,+BAA+B;IAC/B,8CAA8C;IAC9C,gCAAgC;IAChC,0CAA0C;IAC1C,wCAAwC;IACxC,6BAA6B;IAC7B,gCAAgC;IAChC,oCAAoC;IACpC,0BAA0B;IAC1B,sCAAsC;IACtC,qCAAqC;IACrC,4BAA4B;IAC5B,mCAAmC;IACnC,qCAAqC;IACrC,yBAAyB;IACzB,4CAA4C;IAC5C,kBAAkB;IAClB,gCAAgC;IAChC,mCAAmC;IACnC,4CAA4C;IAC5C,sCAAsC;IACtC,2CAA2C;IAC3C,6CAA6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AC"}
@@ -8,10 +8,12 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
8
8
  import { act } from 'react';
9
9
  import { render } from '../../test-utils/render.js';
10
10
  import { Text } from 'ink';
11
- import { usePhraseCycler, WITTY_LOADING_PHRASES, PHRASE_CHANGE_INTERVAL_MS, } from './usePhraseCycler.js';
11
+ import { usePhraseCycler, PHRASE_CHANGE_INTERVAL_MS, INTERACTIVE_SHELL_WAITING_PHRASE, } from './usePhraseCycler.js';
12
+ import { INFORMATIVE_TIPS } from '../constants/tips.js';
13
+ import { WITTY_LOADING_PHRASES } from '../constants/wittyPhrases.js';
12
14
  // Test component to consume the hook
13
- const TestComponent = ({ isActive, isWaiting, customPhrases, }) => {
14
- const phrase = usePhraseCycler(isActive, isWaiting, customPhrases);
15
+ const TestComponent = ({ isActive, isWaiting, isInteractiveShellWaiting = false, lastOutputTime = 0, customPhrases, }) => {
16
+ const phrase = usePhraseCycler(isActive, isWaiting, isInteractiveShellWaiting, lastOutputTime, customPhrases);
15
17
  return _jsx(Text, { children: phrase });
16
18
  };
17
19
  describe('usePhraseCycler', () => {
@@ -34,6 +36,55 @@ describe('usePhraseCycler', () => {
34
36
  });
35
37
  expect(lastFrame()).toBe('Waiting for user confirmation...');
36
38
  });
39
+ it('should show interactive shell waiting message when isInteractiveShellWaiting is true after 5s', async () => {
40
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
41
+ const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
42
+ rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, isInteractiveShellWaiting: true, lastOutputTime: 1 }));
43
+ await act(async () => {
44
+ await vi.advanceTimersByTimeAsync(0);
45
+ });
46
+ // Should still be showing a witty phrase or tip initially
47
+ expect([...WITTY_LOADING_PHRASES, ...INFORMATIVE_TIPS]).toContain(lastFrame());
48
+ await act(async () => {
49
+ await vi.advanceTimersByTimeAsync(5000);
50
+ });
51
+ expect(lastFrame()).toBe(INTERACTIVE_SHELL_WAITING_PHRASE);
52
+ });
53
+ it('should reset interactive shell waiting timer when lastOutputTime changes', async () => {
54
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
55
+ const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, isInteractiveShellWaiting: true, lastOutputTime: 1000 }));
56
+ // Advance 3 seconds
57
+ await act(async () => {
58
+ await vi.advanceTimersByTimeAsync(3000);
59
+ });
60
+ // Should still be witty phrase or tip
61
+ expect([...WITTY_LOADING_PHRASES, ...INFORMATIVE_TIPS]).toContain(lastFrame());
62
+ // Update lastOutputTime
63
+ rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, isInteractiveShellWaiting: true, lastOutputTime: 4000 }));
64
+ // Advance another 3 seconds (total 6s from start, but only 3s from last output)
65
+ await act(async () => {
66
+ await vi.advanceTimersByTimeAsync(3000);
67
+ });
68
+ // Should STILL be witty phrase or tip because timer reset
69
+ expect([...WITTY_LOADING_PHRASES, ...INFORMATIVE_TIPS]).toContain(lastFrame());
70
+ // Advance another 2 seconds (total 5s from last output)
71
+ await act(async () => {
72
+ await vi.advanceTimersByTimeAsync(2000);
73
+ });
74
+ expect(lastFrame()).toBe(INTERACTIVE_SHELL_WAITING_PHRASE);
75
+ });
76
+ it('should prioritize interactive shell waiting over normal waiting after 5s', async () => {
77
+ const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: true }));
78
+ await act(async () => {
79
+ await vi.advanceTimersByTimeAsync(0);
80
+ });
81
+ expect(lastFrame()).toBe('Waiting for user confirmation...');
82
+ rerender(_jsx(TestComponent, { isActive: true, isWaiting: true, isInteractiveShellWaiting: true, lastOutputTime: 1 }));
83
+ await act(async () => {
84
+ await vi.advanceTimersByTimeAsync(5000);
85
+ });
86
+ expect(lastFrame()).toBe(INTERACTIVE_SHELL_WAITING_PHRASE);
87
+ });
37
88
  it('should not cycle phrases if isActive is false and not waiting', async () => {
38
89
  const { lastFrame } = render(_jsx(TestComponent, { isActive: false, isWaiting: false }));
39
90
  const initialPhrase = lastFrame();
@@ -42,14 +93,29 @@ describe('usePhraseCycler', () => {
42
93
  });
43
94
  expect(lastFrame()).toBe(initialPhrase);
44
95
  });
45
- it('should cycle through witty phrases when isActive is true and not waiting', async () => {
46
- vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
96
+ it('should show a tip on first activation, then a witty phrase', async () => {
97
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.99); // Subsequent phrases are witty
47
98
  const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
48
- // Initial phrase should be one of the witty phrases
99
+ // Initial phrase on first activation should be a tip
49
100
  await act(async () => {
50
101
  await vi.advanceTimersByTimeAsync(0);
51
102
  });
103
+ expect(INFORMATIVE_TIPS).toContain(lastFrame());
104
+ // After the first interval, it should be a witty phrase
105
+ await act(async () => {
106
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
107
+ });
52
108
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
109
+ });
110
+ it('should cycle through phrases when isActive is true and not waiting', async () => {
111
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
112
+ const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
113
+ // Initial phrase on first activation will be a tip, not necessarily from witty phrases
114
+ await act(async () => {
115
+ await vi.advanceTimersByTimeAsync(0);
116
+ });
117
+ // First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
118
+ // After the first interval, it should follow the random pattern (witty phrases due to mock)
53
119
  await act(async () => {
54
120
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
55
121
  });
@@ -71,29 +137,30 @@ describe('usePhraseCycler', () => {
71
137
  return val;
72
138
  });
73
139
  const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
74
- // Activate -> callCount 0 -> returns 0 -> 'Phrase A'
140
+ // Activate -> On first activation will show tip on initial call, then first interval will use first mock value for 'Phrase A'
75
141
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
76
142
  await act(async () => {
77
- await vi.advanceTimersByTimeAsync(0);
143
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // First interval after initial state -> callCount 0 -> 'Phrase A'
78
144
  });
79
- expect(lastFrame()).toBe('Phrase A');
80
- // Interval -> callCount 1 -> returns 0.99 -> 'Phrase B'
145
+ expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
146
+ // Second interval -> callCount 1 -> returns 0.99 -> 'Phrase B'
81
147
  await act(async () => {
82
148
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
83
149
  });
84
- expect(lastFrame()).toBe('Phrase B');
85
- // Deactivate -> resets to customPhrases[0] -> 'Phrase A'
150
+ expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
151
+ // Deactivate -> resets to first phrase in sequence
86
152
  rerender(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
87
153
  await act(async () => {
88
154
  await vi.advanceTimersByTimeAsync(0);
89
155
  });
90
- expect(lastFrame()).toBe('Phrase A');
91
- // Activate again -> callCount 2 -> returns 0 -> 'Phrase A'
156
+ // The phrase should be the first phrase after reset
157
+ expect(customPhrases).toContain(lastFrame());
158
+ // Activate again -> this will show a tip on first activation, then cycle from where mock is
92
159
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
93
160
  await act(async () => {
94
- await vi.advanceTimersByTimeAsync(0);
161
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // First interval after re-activation -> should contain phrase
95
162
  });
96
- expect(lastFrame()).toBe('Phrase A');
163
+ expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
97
164
  });
98
165
  it('should clear phrase interval on unmount when active', () => {
99
166
  const { unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
@@ -104,39 +171,51 @@ describe('usePhraseCycler', () => {
104
171
  it('should use custom phrases when provided', async () => {
105
172
  const customPhrases = ['Custom Phrase 1', 'Custom Phrase 2'];
106
173
  const randomMock = vi.spyOn(Math, 'random');
107
- randomMock.mockReturnValue(0);
108
174
  const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
109
- expect(lastFrame()).toBe('Custom Phrase 1');
110
- randomMock.mockReturnValue(0.99);
175
+ // After first interval, it should use custom phrases
176
+ await act(async () => {
177
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
178
+ });
179
+ randomMock.mockReturnValue(0);
180
+ rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
111
181
  await act(async () => {
112
182
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
113
183
  });
114
- expect(lastFrame()).toBe('Custom Phrase 2');
184
+ expect(customPhrases).toContain(lastFrame());
185
+ randomMock.mockReturnValue(0.99);
186
+ await act(async () => {
187
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
188
+ });
189
+ expect(customPhrases).toContain(lastFrame());
115
190
  // Test fallback to default phrases.
116
191
  randomMock.mockRestore();
117
192
  vi.spyOn(Math, 'random').mockReturnValue(0.5); // Always witty
118
193
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: [] }));
119
194
  await act(async () => {
120
- await vi.advanceTimersByTimeAsync(0);
195
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Wait for first cycle
121
196
  });
122
197
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
123
198
  });
124
199
  it('should fall back to witty phrases if custom phrases are an empty array', async () => {
125
- vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
200
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
126
201
  const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: [] }));
127
202
  await act(async () => {
128
- await vi.advanceTimersByTimeAsync(0);
203
+ await vi.advanceTimersByTimeAsync(0); // First activation will be a tip
204
+ });
205
+ // First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
206
+ await act(async () => {
207
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Next phrase after tip
129
208
  });
130
209
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
131
210
  });
132
- it('should reset to a witty phrase when transitioning from waiting to active', async () => {
133
- vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
211
+ it('should reset phrase when transitioning from waiting to active', async () => {
212
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
134
213
  const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
135
214
  await act(async () => {
136
- await vi.advanceTimersByTimeAsync(0);
215
+ await vi.advanceTimersByTimeAsync(0); // First activation will be a tip
137
216
  });
138
- expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
139
- // Cycle to a different phrase (potentially)
217
+ // First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
218
+ // Cycle to a different phrase (should be witty due to mock)
140
219
  await act(async () => {
141
220
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
142
221
  });
@@ -147,10 +226,10 @@ describe('usePhraseCycler', () => {
147
226
  await vi.advanceTimersByTimeAsync(0);
148
227
  });
149
228
  expect(lastFrame()).toBe('Waiting for user confirmation...');
150
- // Go back to active cycling - should pick a random witty phrase
229
+ // Go back to active cycling - should pick a phrase based on the logic (witty due to mock)
151
230
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false }));
152
231
  await act(async () => {
153
- await vi.advanceTimersByTimeAsync(0);
232
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Skip the tip and get next phrase
154
233
  });
155
234
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
156
235
  });