@machina.ai/cell-cli 1.10.0-rc1 → 1.13.0-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 (813) hide show
  1. package/dist/index.js +5 -5
  2. package/dist/index.js.map +1 -1
  3. package/dist/package.json +14 -12
  4. package/dist/src/commands/extensions/disable.d.ts +1 -1
  5. package/dist/src/commands/extensions/disable.js +19 -8
  6. package/dist/src/commands/extensions/disable.js.map +1 -1
  7. package/dist/src/commands/extensions/enable.d.ts +1 -1
  8. package/dist/src/commands/extensions/enable.js +19 -9
  9. package/dist/src/commands/extensions/enable.js.map +1 -1
  10. package/dist/src/commands/extensions/examples/mcp-server/example.js +46 -0
  11. package/dist/src/commands/extensions/examples/mcp-server/example.js.map +1 -0
  12. package/dist/src/commands/extensions/install.d.ts +1 -0
  13. package/dist/src/commands/extensions/install.js +29 -4
  14. package/dist/src/commands/extensions/install.js.map +1 -1
  15. package/dist/src/commands/extensions/install.test.js +39 -19
  16. package/dist/src/commands/extensions/install.test.js.map +1 -1
  17. package/dist/src/commands/extensions/link.js +16 -4
  18. package/dist/src/commands/extensions/link.js.map +1 -1
  19. package/dist/src/commands/extensions/list.js +17 -6
  20. package/dist/src/commands/extensions/list.js.map +1 -1
  21. package/dist/src/commands/extensions/new.js +14 -20
  22. package/dist/src/commands/extensions/new.js.map +1 -1
  23. package/dist/src/commands/extensions/uninstall.js +16 -4
  24. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  25. package/dist/src/commands/extensions/update.js +28 -23
  26. package/dist/src/commands/extensions/update.js.map +1 -1
  27. package/dist/src/commands/extensions/validate.d.ts +12 -0
  28. package/dist/src/commands/extensions/validate.js +83 -0
  29. package/dist/src/commands/extensions/validate.js.map +1 -0
  30. package/dist/src/commands/extensions/validate.test.d.ts +6 -0
  31. package/dist/src/commands/extensions/validate.test.js +93 -0
  32. package/dist/src/commands/extensions/validate.test.js.map +1 -0
  33. package/dist/src/commands/extensions.js +3 -0
  34. package/dist/src/commands/extensions.js.map +1 -1
  35. package/dist/src/commands/mcp/add.js +7 -4
  36. package/dist/src/commands/mcp/add.js.map +1 -1
  37. package/dist/src/commands/mcp/add.test.d.ts +6 -0
  38. package/dist/src/commands/mcp/add.test.js +247 -0
  39. package/dist/src/commands/mcp/add.test.js.map +1 -0
  40. package/dist/src/commands/mcp/list.js +18 -9
  41. package/dist/src/commands/mcp/list.js.map +1 -1
  42. package/dist/src/commands/mcp/list.test.d.ts +6 -0
  43. package/dist/src/commands/mcp/list.test.js +128 -0
  44. package/dist/src/commands/mcp/list.test.js.map +1 -0
  45. package/dist/src/commands/mcp/remove.js +3 -2
  46. package/dist/src/commands/mcp/remove.js.map +1 -1
  47. package/dist/src/commands/mcp/remove.test.d.ts +6 -0
  48. package/dist/src/commands/mcp/remove.test.js +175 -0
  49. package/dist/src/commands/mcp/remove.test.js.map +1 -0
  50. package/dist/src/commands/mcp.test.d.ts +6 -0
  51. package/dist/src/commands/mcp.test.js +62 -0
  52. package/dist/src/commands/mcp.test.js.map +1 -0
  53. package/dist/src/config/auth.js +0 -3
  54. package/dist/src/config/auth.js.map +1 -1
  55. package/dist/src/config/config.d.ts +6 -15
  56. package/dist/src/config/config.integration.test.d.ts +6 -0
  57. package/dist/src/config/config.integration.test.js +321 -0
  58. package/dist/src/config/config.integration.test.js.map +1 -0
  59. package/dist/src/config/config.js +85 -164
  60. package/dist/src/config/config.js.map +1 -1
  61. package/dist/src/config/config.test.d.ts +6 -0
  62. package/dist/src/config/config.test.js +1972 -0
  63. package/dist/src/config/config.test.js.map +1 -0
  64. package/dist/src/config/extension-manager.d.ts +63 -0
  65. package/dist/src/config/extension-manager.js +450 -0
  66. package/dist/src/config/extension-manager.js.map +1 -0
  67. package/dist/src/config/extension.d.ts +4 -61
  68. package/dist/src/config/extension.js +1 -538
  69. package/dist/src/config/extension.js.map +1 -1
  70. package/dist/src/config/extension.test.d.ts +6 -0
  71. package/dist/src/config/extension.test.js +1412 -0
  72. package/dist/src/config/extension.test.js.map +1 -0
  73. package/dist/src/config/extensions/consent.d.ts +38 -0
  74. package/dist/src/config/extensions/consent.js +123 -0
  75. package/dist/src/config/extensions/consent.js.map +1 -0
  76. package/dist/src/config/extensions/extensionEnablement.d.ts +2 -2
  77. package/dist/src/config/extensions/extensionEnablement.js +7 -5
  78. package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
  79. package/dist/src/config/extensions/extensionEnablement.test.js +31 -28
  80. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -1
  81. package/dist/src/config/extensions/extensionSettings.d.ts +15 -0
  82. package/dist/src/config/extensions/extensionSettings.js +113 -0
  83. package/dist/src/config/extensions/extensionSettings.js.map +1 -0
  84. package/dist/src/config/extensions/extensionSettings.test.d.ts +6 -0
  85. package/dist/src/config/extensions/extensionSettings.test.js +254 -0
  86. package/dist/src/config/extensions/extensionSettings.test.js.map +1 -0
  87. package/dist/src/config/extensions/github.d.ts +18 -9
  88. package/dist/src/config/extensions/github.js +108 -36
  89. package/dist/src/config/extensions/github.js.map +1 -1
  90. package/dist/src/config/extensions/github.test.js +158 -164
  91. package/dist/src/config/extensions/github.test.js.map +1 -1
  92. package/dist/src/config/extensions/github_fetch.d.ts +1 -1
  93. package/dist/src/config/extensions/github_fetch.js +13 -1
  94. package/dist/src/config/extensions/github_fetch.js.map +1 -1
  95. package/dist/src/config/extensions/github_fetch.test.d.ts +6 -0
  96. package/dist/src/config/extensions/github_fetch.test.js +169 -0
  97. package/dist/src/config/extensions/github_fetch.test.js.map +1 -0
  98. package/dist/src/config/extensions/storage.d.ts +14 -0
  99. package/dist/src/config/extensions/storage.js +32 -0
  100. package/dist/src/config/extensions/storage.js.map +1 -0
  101. package/dist/src/config/extensions/update.d.ts +5 -4
  102. package/dist/src/config/extensions/update.js +41 -37
  103. package/dist/src/config/extensions/update.js.map +1 -1
  104. package/dist/src/config/extensions/update.test.js +72 -74
  105. package/dist/src/config/extensions/update.test.js.map +1 -1
  106. package/dist/src/config/extensions/variableSchema.d.ts +0 -4
  107. package/dist/src/config/extensions/variableSchema.js.map +1 -1
  108. package/dist/src/config/extensions/variables.d.ts +4 -0
  109. package/dist/src/config/extensions/variables.js +6 -0
  110. package/dist/src/config/extensions/variables.js.map +1 -1
  111. package/dist/src/config/keyBindings.d.ts +5 -1
  112. package/dist/src/config/keyBindings.js +34 -10
  113. package/dist/src/config/keyBindings.js.map +1 -1
  114. package/dist/src/config/keyBindings.test.js +17 -0
  115. package/dist/src/config/keyBindings.test.js.map +1 -1
  116. package/dist/src/config/policies/read-only.toml +56 -0
  117. package/dist/src/config/policies/write.toml +63 -0
  118. package/dist/src/config/policies/yolo.toml +31 -0
  119. package/dist/src/config/policy-engine.integration.test.js +41 -38
  120. package/dist/src/config/policy-engine.integration.test.js.map +1 -1
  121. package/dist/src/config/policy.d.ts +4 -3
  122. package/dist/src/config/policy.js +13 -142
  123. package/dist/src/config/policy.js.map +1 -1
  124. package/dist/src/config/sandboxConfig.d.ts +1 -2
  125. package/dist/src/config/sandboxConfig.js +7 -6
  126. package/dist/src/config/sandboxConfig.js.map +1 -1
  127. package/dist/src/config/settings.d.ts +2 -1
  128. package/dist/src/config/settings.js +59 -15
  129. package/dist/src/config/settings.js.map +1 -1
  130. package/dist/src/config/settings.test.d.ts +6 -0
  131. package/dist/src/config/settings.test.js +2000 -0
  132. package/dist/src/config/settings.test.js.map +1 -0
  133. package/dist/src/config/settingsSchema.d.ts +170 -28
  134. package/dist/src/config/settingsSchema.js +418 -27
  135. package/dist/src/config/settingsSchema.js.map +1 -1
  136. package/dist/src/config/settingsSchema.test.js +42 -1
  137. package/dist/src/config/settingsSchema.test.js.map +1 -1
  138. package/dist/src/config/trustedFolders.d.ts +1 -1
  139. package/dist/src/config/trustedFolders.js +4 -2
  140. package/dist/src/config/trustedFolders.js.map +1 -1
  141. package/dist/src/core/initializer.js +2 -1
  142. package/dist/src/core/initializer.js.map +1 -1
  143. package/dist/src/gemini.d.ts +1 -1
  144. package/dist/src/gemini.js +63 -27
  145. package/dist/src/gemini.js.map +1 -1
  146. package/dist/src/gemini.test.js +123 -34
  147. package/dist/src/gemini.test.js.map +1 -1
  148. package/dist/src/generated/git-commit.d.ts +2 -2
  149. package/dist/src/generated/git-commit.js +2 -2
  150. package/dist/src/nonInteractiveCli.d.ts +9 -1
  151. package/dist/src/nonInteractiveCli.js +205 -10
  152. package/dist/src/nonInteractiveCli.js.map +1 -1
  153. package/dist/src/nonInteractiveCli.test.d.ts +6 -0
  154. package/dist/src/nonInteractiveCli.test.js +984 -0
  155. package/dist/src/nonInteractiveCli.test.js.map +1 -0
  156. package/dist/src/nonInteractiveCliCommands.js +2 -2
  157. package/dist/src/nonInteractiveCliCommands.js.map +1 -1
  158. package/dist/src/services/BuiltinCommandLoader.js +4 -0
  159. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  160. package/dist/src/services/BuiltinCommandLoader.test.js +22 -0
  161. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
  162. package/dist/src/services/CommandService.js +2 -1
  163. package/dist/src/services/CommandService.js.map +1 -1
  164. package/dist/src/services/FeedbackService.js +2 -2
  165. package/dist/src/services/FeedbackService.js.map +1 -1
  166. package/dist/src/services/FileCommandLoader.test.d.ts +6 -0
  167. package/dist/src/services/FileCommandLoader.test.js +971 -0
  168. package/dist/src/services/FileCommandLoader.test.js.map +1 -0
  169. package/dist/src/services/McpPromptLoader.js +2 -2
  170. package/dist/src/services/McpPromptLoader.js.map +1 -1
  171. package/dist/src/services/McpPromptLoader.test.js +4 -2
  172. package/dist/src/services/McpPromptLoader.test.js.map +1 -1
  173. package/dist/src/services/prompt-processors/argumentProcessor.test.d.ts +6 -0
  174. package/dist/src/services/prompt-processors/argumentProcessor.test.js +40 -0
  175. package/dist/src/services/prompt-processors/argumentProcessor.test.js.map +1 -0
  176. package/dist/src/services/prompt-processors/atFileProcessor.js +3 -2
  177. package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -1
  178. package/dist/src/services/prompt-processors/shellProcessor.test.d.ts +6 -0
  179. package/dist/src/services/prompt-processors/shellProcessor.test.js +482 -0
  180. package/dist/src/services/prompt-processors/shellProcessor.test.js.map +1 -0
  181. package/dist/src/test-utils/async.d.ts +9 -0
  182. package/dist/src/test-utils/async.js +29 -0
  183. package/dist/src/test-utils/async.js.map +1 -0
  184. package/dist/src/test-utils/createExtension.d.ts +3 -1
  185. package/dist/src/test-utils/createExtension.js +3 -3
  186. package/dist/src/test-utils/createExtension.js.map +1 -1
  187. package/dist/src/test-utils/render.d.ts +17 -2
  188. package/dist/src/test-utils/render.js +69 -4
  189. package/dist/src/test-utils/render.js.map +1 -1
  190. package/dist/src/test-utils/render.test.d.ts +6 -0
  191. package/dist/src/test-utils/render.test.js +79 -0
  192. package/dist/src/test-utils/render.test.js.map +1 -0
  193. package/dist/src/ui/App.test.d.ts +6 -0
  194. package/dist/src/ui/App.test.js +110 -0
  195. package/dist/src/ui/App.test.js.map +1 -0
  196. package/dist/src/ui/AppContainer.js +223 -92
  197. package/dist/src/ui/AppContainer.js.map +1 -1
  198. package/dist/src/ui/AppContainer.test.js +531 -147
  199. package/dist/src/ui/AppContainer.test.js.map +1 -1
  200. package/dist/src/ui/IdeIntegrationNudge.js +1 -1
  201. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
  202. package/dist/src/ui/auth/ApiAuthDialog.d.ts +14 -0
  203. package/dist/src/ui/auth/ApiAuthDialog.js +26 -0
  204. package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -0
  205. package/dist/src/ui/auth/ApiAuthDialog.test.d.ts +6 -0
  206. package/dist/src/ui/auth/ApiAuthDialog.test.js +91 -0
  207. package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -0
  208. package/dist/src/ui/auth/AuthDialog.d.ts +1 -1
  209. package/dist/src/ui/auth/AuthDialog.js +9 -3
  210. package/dist/src/ui/auth/AuthDialog.js.map +1 -1
  211. package/dist/src/ui/auth/useAuth.d.ts +3 -1
  212. package/dist/src/ui/auth/useAuth.js +35 -4
  213. package/dist/src/ui/auth/useAuth.js.map +1 -1
  214. package/dist/src/ui/colors.js +3 -0
  215. package/dist/src/ui/colors.js.map +1 -1
  216. package/dist/src/ui/commands/aboutCommand.js +1 -1
  217. package/dist/src/ui/commands/aboutCommand.test.d.ts +6 -0
  218. package/dist/src/ui/commands/aboutCommand.test.js +130 -0
  219. package/dist/src/ui/commands/aboutCommand.test.js.map +1 -0
  220. package/dist/src/ui/commands/authCommand.js +1 -1
  221. package/dist/src/ui/commands/authCommand.test.d.ts +6 -0
  222. package/dist/src/ui/commands/authCommand.test.js +30 -0
  223. package/dist/src/ui/commands/authCommand.test.js.map +1 -0
  224. package/dist/src/ui/commands/bugCommand.js +1 -1
  225. package/dist/src/ui/commands/bugCommand.test.d.ts +6 -0
  226. package/dist/src/ui/commands/bugCommand.test.js +105 -0
  227. package/dist/src/ui/commands/bugCommand.test.js.map +1 -0
  228. package/dist/src/ui/commands/chatCommand.js +1 -1
  229. package/dist/src/ui/commands/chatCommand.js.map +1 -1
  230. package/dist/src/ui/commands/chatCommand.test.d.ts +6 -0
  231. package/dist/src/ui/commands/chatCommand.test.js +555 -0
  232. package/dist/src/ui/commands/chatCommand.test.js.map +1 -0
  233. package/dist/src/ui/commands/clearCommand.js +1 -1
  234. package/dist/src/ui/commands/clearCommand.test.d.ts +6 -0
  235. package/dist/src/ui/commands/clearCommand.test.js +76 -0
  236. package/dist/src/ui/commands/clearCommand.test.js.map +1 -0
  237. package/dist/src/ui/commands/compressCommand.js +1 -1
  238. package/dist/src/ui/commands/compressCommand.js.map +1 -1
  239. package/dist/src/ui/commands/compressCommand.test.d.ts +6 -0
  240. package/dist/src/ui/commands/compressCommand.test.js +98 -0
  241. package/dist/src/ui/commands/compressCommand.test.js.map +1 -0
  242. package/dist/src/ui/commands/copyCommand.js +2 -1
  243. package/dist/src/ui/commands/copyCommand.js.map +1 -1
  244. package/dist/src/ui/commands/copyCommand.test.d.ts +6 -0
  245. package/dist/src/ui/commands/copyCommand.test.js +242 -0
  246. package/dist/src/ui/commands/copyCommand.test.js.map +1 -0
  247. package/dist/src/ui/commands/corgiCommand.js +1 -1
  248. package/dist/src/ui/commands/corgiCommand.js.map +1 -1
  249. package/dist/src/ui/commands/corgiCommand.test.d.ts +6 -0
  250. package/dist/src/ui/commands/corgiCommand.test.js +28 -0
  251. package/dist/src/ui/commands/corgiCommand.test.js.map +1 -0
  252. package/dist/src/ui/commands/directoryCommand.js +1 -1
  253. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  254. package/dist/src/ui/commands/directoryCommand.test.d.ts +6 -0
  255. package/dist/src/ui/commands/directoryCommand.test.js +144 -0
  256. package/dist/src/ui/commands/directoryCommand.test.js.map +1 -0
  257. package/dist/src/ui/commands/docsCommand.js +1 -1
  258. package/dist/src/ui/commands/docsCommand.test.d.ts +6 -0
  259. package/dist/src/ui/commands/docsCommand.test.js +72 -0
  260. package/dist/src/ui/commands/docsCommand.test.js.map +1 -0
  261. package/dist/src/ui/commands/editorCommand.js +1 -1
  262. package/dist/src/ui/commands/editorCommand.test.d.ts +6 -0
  263. package/dist/src/ui/commands/editorCommand.test.js +27 -0
  264. package/dist/src/ui/commands/editorCommand.test.js.map +1 -0
  265. package/dist/src/ui/commands/extensionsCommand.js +64 -11
  266. package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
  267. package/dist/src/ui/commands/extensionsCommand.test.d.ts +6 -0
  268. package/dist/src/ui/commands/extensionsCommand.test.js +315 -0
  269. package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -0
  270. package/dist/src/ui/commands/helpCommand.js +1 -1
  271. package/dist/src/ui/commands/helpCommand.test.d.ts +6 -0
  272. package/dist/src/ui/commands/helpCommand.test.js +42 -0
  273. package/dist/src/ui/commands/helpCommand.test.js.map +1 -0
  274. package/dist/src/ui/commands/ideCommand.js +6 -6
  275. package/dist/src/ui/commands/ideCommand.test.d.ts +6 -0
  276. package/dist/src/ui/commands/ideCommand.test.js +205 -0
  277. package/dist/src/ui/commands/ideCommand.test.js.map +1 -0
  278. package/dist/src/ui/commands/initCommand.js +1 -1
  279. package/dist/src/ui/commands/initCommand.js.map +1 -1
  280. package/dist/src/ui/commands/initCommand.test.d.ts +6 -0
  281. package/dist/src/ui/commands/initCommand.test.js +80 -0
  282. package/dist/src/ui/commands/initCommand.test.js.map +1 -0
  283. package/dist/src/ui/commands/mcpCommand.js +110 -100
  284. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  285. package/dist/src/ui/commands/mcpCommand.test.d.ts +6 -0
  286. package/dist/src/ui/commands/mcpCommand.test.js +152 -0
  287. package/dist/src/ui/commands/mcpCommand.test.js.map +1 -0
  288. package/dist/src/ui/commands/memoryCommand.js +6 -6
  289. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  290. package/dist/src/ui/commands/memoryCommand.test.d.ts +6 -0
  291. package/dist/src/ui/commands/memoryCommand.test.js +268 -0
  292. package/dist/src/ui/commands/memoryCommand.test.js.map +1 -0
  293. package/dist/src/ui/commands/policiesCommand.d.ts +7 -0
  294. package/dist/src/ui/commands/policiesCommand.js +59 -0
  295. package/dist/src/ui/commands/policiesCommand.js.map +1 -0
  296. package/dist/src/ui/commands/policiesCommand.test.d.ts +6 -0
  297. package/dist/src/ui/commands/policiesCommand.test.js +83 -0
  298. package/dist/src/ui/commands/policiesCommand.test.js.map +1 -0
  299. package/dist/src/ui/commands/privacyCommand.js +1 -1
  300. package/dist/src/ui/commands/privacyCommand.test.d.ts +6 -0
  301. package/dist/src/ui/commands/privacyCommand.test.js +32 -0
  302. package/dist/src/ui/commands/privacyCommand.test.js.map +1 -0
  303. package/dist/src/ui/commands/quitCommand.js +1 -1
  304. package/dist/src/ui/commands/quitCommand.test.d.ts +6 -0
  305. package/dist/src/ui/commands/quitCommand.test.js +50 -0
  306. package/dist/src/ui/commands/quitCommand.test.js.map +1 -0
  307. package/dist/src/ui/commands/restoreCommand.test.d.ts +6 -0
  308. package/dist/src/ui/commands/restoreCommand.test.js +190 -0
  309. package/dist/src/ui/commands/restoreCommand.test.js.map +1 -0
  310. package/dist/src/ui/commands/settingsCommand.test.d.ts +6 -0
  311. package/dist/src/ui/commands/settingsCommand.test.js +30 -0
  312. package/dist/src/ui/commands/settingsCommand.test.js.map +1 -0
  313. package/dist/src/ui/commands/setupGithubCommand.js +4 -3
  314. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
  315. package/dist/src/ui/commands/setupGithubCommand.test.js +1 -2
  316. package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
  317. package/dist/src/ui/commands/statsCommand.js +3 -3
  318. package/dist/src/ui/commands/statsCommand.js.map +1 -1
  319. package/dist/src/ui/commands/statsCommand.test.d.ts +6 -0
  320. package/dist/src/ui/commands/statsCommand.test.js +53 -0
  321. package/dist/src/ui/commands/statsCommand.test.js.map +1 -0
  322. package/dist/src/ui/commands/terminalSetupCommand.test.d.ts +6 -0
  323. package/dist/src/ui/commands/terminalSetupCommand.test.js +66 -0
  324. package/dist/src/ui/commands/terminalSetupCommand.test.js.map +1 -0
  325. package/dist/src/ui/commands/themeCommand.js +1 -1
  326. package/dist/src/ui/commands/themeCommand.test.d.ts +6 -0
  327. package/dist/src/ui/commands/themeCommand.test.js +32 -0
  328. package/dist/src/ui/commands/themeCommand.test.js.map +1 -0
  329. package/dist/src/ui/commands/toolsCommand.js +1 -1
  330. package/dist/src/ui/commands/toolsCommand.test.d.ts +6 -0
  331. package/dist/src/ui/commands/toolsCommand.test.js +100 -0
  332. package/dist/src/ui/commands/toolsCommand.test.js.map +1 -0
  333. package/dist/src/ui/commands/types.d.ts +1 -0
  334. package/dist/src/ui/commands/vimCommand.js +1 -1
  335. package/dist/src/ui/components/AnsiOutput.test.js +1 -1
  336. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
  337. package/dist/src/ui/components/AsciiArt.d.ts +3 -3
  338. package/dist/src/ui/components/AsciiArt.js +3 -3
  339. package/dist/src/ui/components/Composer.js +6 -4
  340. package/dist/src/ui/components/Composer.js.map +1 -1
  341. package/dist/src/ui/components/Composer.test.js +21 -3
  342. package/dist/src/ui/components/Composer.test.js.map +1 -1
  343. package/dist/src/ui/components/ConfigInitDisplay.js +4 -6
  344. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
  345. package/dist/src/ui/components/ConsentPrompt.test.js +18 -8
  346. package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -1
  347. package/dist/src/ui/components/ConsoleSummaryDisplay.js +1 -1
  348. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
  349. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -1
  350. package/dist/src/ui/components/ContextSummaryDisplay.js +2 -12
  351. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  352. package/dist/src/ui/components/ContextSummaryDisplay.test.d.ts +6 -0
  353. package/dist/src/ui/components/ContextSummaryDisplay.test.js +71 -0
  354. package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -0
  355. package/dist/src/ui/components/DetailedMessagesDisplay.js +1 -1
  356. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
  357. package/dist/src/ui/components/DialogManager.js +5 -5
  358. package/dist/src/ui/components/DialogManager.js.map +1 -1
  359. package/dist/src/ui/components/EditorSettingsDialog.js +1 -1
  360. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
  361. package/dist/src/ui/components/FolderTrustDialog.test.js +8 -3
  362. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
  363. package/dist/src/ui/components/Footer.js +4 -3
  364. package/dist/src/ui/components/Footer.js.map +1 -1
  365. package/dist/src/ui/components/Footer.test.d.ts +6 -0
  366. package/dist/src/ui/components/Footer.test.js +314 -0
  367. package/dist/src/ui/components/Footer.test.js.map +1 -0
  368. package/dist/src/ui/components/Header.test.js +13 -5
  369. package/dist/src/ui/components/Header.test.js.map +1 -1
  370. package/dist/src/ui/components/Help.test.js +5 -4
  371. package/dist/src/ui/components/Help.test.js.map +1 -1
  372. package/dist/src/ui/components/HistoryItemDisplay.js +1 -1
  373. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  374. package/dist/src/ui/components/InputPrompt.d.ts +4 -0
  375. package/dist/src/ui/components/InputPrompt.js +80 -12
  376. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  377. package/dist/src/ui/components/InputPrompt.test.d.ts +6 -0
  378. package/dist/src/ui/components/InputPrompt.test.js +1786 -0
  379. package/dist/src/ui/components/InputPrompt.test.js.map +1 -0
  380. package/dist/src/ui/components/LoadingIndicator.js +2 -2
  381. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  382. package/dist/src/ui/components/LoadingIndicator.test.js +28 -15
  383. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
  384. package/dist/src/ui/components/LoopDetectionConfirmation.js +1 -1
  385. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -1
  386. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +2 -2
  387. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -1
  388. package/dist/src/ui/components/MainContent.js +15 -4
  389. package/dist/src/ui/components/MainContent.js.map +1 -1
  390. package/dist/src/ui/components/ModelDialog.js +1 -1
  391. package/dist/src/ui/components/ModelDialog.js.map +1 -1
  392. package/dist/src/ui/components/ModelDialog.test.js +23 -13
  393. package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
  394. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +6 -0
  395. package/dist/src/ui/components/ModelStatsDisplay.test.js +285 -0
  396. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -0
  397. package/dist/src/ui/components/Notifications.js +38 -5
  398. package/dist/src/ui/components/Notifications.js.map +1 -1
  399. package/dist/src/ui/components/PermissionsModifyTrustDialog.js +22 -18
  400. package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
  401. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +12 -4
  402. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
  403. package/dist/src/ui/components/PrepareLabel.test.js +14 -8
  404. package/dist/src/ui/components/PrepareLabel.test.js.map +1 -1
  405. package/dist/src/ui/components/ProQuotaDialog.test.js +14 -6
  406. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
  407. package/dist/src/ui/components/QueuedMessageDisplay.js +3 -3
  408. package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -1
  409. package/dist/src/ui/components/QueuedMessageDisplay.test.js +15 -6
  410. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -1
  411. package/dist/src/ui/components/RawMarkdownIndicator.d.ts +7 -0
  412. package/dist/src/ui/components/RawMarkdownIndicator.js +8 -0
  413. package/dist/src/ui/components/RawMarkdownIndicator.js.map +1 -0
  414. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +6 -0
  415. package/dist/src/ui/components/SessionSummaryDisplay.test.js +74 -0
  416. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -0
  417. package/dist/src/ui/components/SettingsDialog.js +43 -35
  418. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  419. package/dist/src/ui/components/SettingsDialog.test.js +554 -545
  420. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  421. package/dist/src/ui/components/ShellConfirmationDialog.js +1 -1
  422. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
  423. package/dist/src/ui/components/ShellConfirmationDialog.test.js +2 -2
  424. package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -1
  425. package/dist/src/ui/components/StatsDisplay.test.d.ts +6 -0
  426. package/dist/src/ui/components/StatsDisplay.test.js +351 -0
  427. package/dist/src/ui/components/StatsDisplay.test.js.map +1 -0
  428. package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
  429. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  430. package/dist/src/ui/components/ThemeDialog.d.ts +4 -2
  431. package/dist/src/ui/components/ThemeDialog.js +3 -3
  432. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  433. package/dist/src/ui/components/ThemeDialog.test.js +14 -1
  434. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
  435. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +6 -0
  436. package/dist/src/ui/components/ToolStatsDisplay.test.js +227 -0
  437. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -0
  438. package/dist/src/ui/components/messages/CompressionMessage.test.js +25 -17
  439. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -1
  440. package/dist/src/ui/components/messages/DiffRenderer.test.js +1 -1
  441. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -1
  442. package/dist/src/ui/components/messages/GeminiMessage.js +3 -1
  443. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
  444. package/dist/src/ui/components/messages/GeminiMessage.test.d.ts +6 -0
  445. package/dist/src/ui/components/messages/GeminiMessage.test.js +35 -0
  446. package/dist/src/ui/components/messages/GeminiMessage.test.js.map +1 -0
  447. package/dist/src/ui/components/messages/GeminiMessageContent.js +3 -1
  448. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -1
  449. package/dist/src/ui/components/messages/InfoMessage.js +1 -1
  450. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
  451. package/dist/src/ui/components/messages/Todo.d.ts +7 -0
  452. package/dist/src/ui/components/messages/Todo.js +91 -0
  453. package/dist/src/ui/components/messages/Todo.js.map +1 -0
  454. package/dist/src/ui/components/messages/Todo.test.d.ts +6 -0
  455. package/dist/src/ui/components/messages/Todo.test.js +114 -0
  456. package/dist/src/ui/components/messages/Todo.test.js.map +1 -0
  457. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +1 -1
  458. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  459. package/dist/src/ui/components/messages/ToolGroupMessage.js +1 -1
  460. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  461. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +29 -15
  462. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
  463. package/dist/src/ui/components/messages/ToolMessage.js +8 -3
  464. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  465. package/dist/src/ui/components/messages/ToolMessage.test.js +2 -2
  466. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
  467. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +6 -0
  468. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +30 -0
  469. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -0
  470. package/dist/src/ui/components/messages/UserShellMessage.js +1 -1
  471. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
  472. package/dist/src/ui/components/messages/WarningMessage.js +2 -2
  473. package/dist/src/ui/components/messages/WarningMessage.js.map +1 -1
  474. package/dist/src/ui/components/shared/BaseSelectionList.test.js +34 -25
  475. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
  476. package/dist/src/ui/components/shared/MaxSizedBox.test.js +43 -22
  477. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -1
  478. package/dist/src/ui/components/shared/TextInput.d.ts +15 -0
  479. package/dist/src/ui/components/shared/TextInput.js +38 -0
  480. package/dist/src/ui/components/shared/TextInput.js.map +1 -0
  481. package/dist/src/ui/components/shared/TextInput.test.d.ts +6 -0
  482. package/dist/src/ui/components/shared/TextInput.test.js +242 -0
  483. package/dist/src/ui/components/shared/TextInput.test.js.map +1 -0
  484. package/dist/src/ui/components/shared/text-buffer.d.ts +9 -2
  485. package/dist/src/ui/components/shared/text-buffer.js +52 -14
  486. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  487. package/dist/src/ui/components/shared/text-buffer.test.d.ts +6 -0
  488. package/dist/src/ui/components/shared/text-buffer.test.js +1761 -0
  489. package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -0
  490. package/dist/src/ui/components/shared/vim-buffer-actions.test.d.ts +6 -0
  491. package/dist/src/ui/components/shared/vim-buffer-actions.test.js +951 -0
  492. package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -0
  493. package/dist/src/ui/components/views/ChatList.test.js +7 -4
  494. package/dist/src/ui/components/views/ChatList.test.js.map +1 -1
  495. package/dist/src/ui/components/views/ExtensionsList.d.ts +7 -1
  496. package/dist/src/ui/components/views/ExtensionsList.js +12 -15
  497. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -1
  498. package/dist/src/ui/components/views/ExtensionsList.test.js +43 -29
  499. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
  500. package/dist/src/ui/components/views/McpStatus.d.ts +0 -1
  501. package/dist/src/ui/components/views/McpStatus.js +4 -4
  502. package/dist/src/ui/components/views/McpStatus.js.map +1 -1
  503. package/dist/src/ui/components/views/McpStatus.test.js +23 -17
  504. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
  505. package/dist/src/ui/components/views/ToolsList.test.js +4 -4
  506. package/dist/src/ui/components/views/ToolsList.test.js.map +1 -1
  507. package/dist/src/ui/contexts/KeypressContext.d.ts +4 -2
  508. package/dist/src/ui/contexts/KeypressContext.js +635 -439
  509. package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
  510. package/dist/src/ui/contexts/KeypressContext.test.js +634 -515
  511. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
  512. package/dist/src/ui/contexts/MouseContext.d.ts +21 -0
  513. package/dist/src/ui/contexts/MouseContext.js +89 -0
  514. package/dist/src/ui/contexts/MouseContext.js.map +1 -0
  515. package/dist/src/ui/contexts/MouseContext.test.d.ts +6 -0
  516. package/dist/src/ui/contexts/MouseContext.test.js +164 -0
  517. package/dist/src/ui/contexts/MouseContext.test.js.map +1 -0
  518. package/dist/src/ui/contexts/SessionContext.test.d.ts +6 -0
  519. package/dist/src/ui/contexts/SessionContext.test.js +195 -0
  520. package/dist/src/ui/contexts/SessionContext.test.js.map +1 -0
  521. package/dist/src/ui/contexts/UIActionsContext.d.ts +7 -4
  522. package/dist/src/ui/contexts/UIStateContext.d.ts +5 -3
  523. package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
  524. package/dist/src/ui/hooks/atCommandProcessor.js +33 -11
  525. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  526. package/dist/src/ui/hooks/atCommandProcessor.test.js +163 -64
  527. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
  528. package/dist/src/ui/hooks/shellCommandProcessor.js +0 -1
  529. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  530. package/dist/src/ui/hooks/shellCommandProcessor.test.js +64 -35
  531. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
  532. package/dist/src/ui/hooks/slashCommandProcessor.js +2 -0
  533. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  534. package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +6 -0
  535. package/dist/src/ui/hooks/slashCommandProcessor.test.js +807 -0
  536. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -0
  537. package/dist/src/ui/hooks/useAtCompletion.js +2 -2
  538. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
  539. package/dist/src/ui/hooks/useAtCompletion.test.d.ts +6 -0
  540. package/dist/src/ui/hooks/useAtCompletion.test.js +396 -0
  541. package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -0
  542. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +10 -0
  543. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
  544. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +32 -2
  545. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
  546. package/dist/src/ui/hooks/useCommandCompletion.d.ts +1 -1
  547. package/dist/src/ui/hooks/useCommandCompletion.js +5 -3
  548. package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
  549. package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +6 -0
  550. package/dist/src/ui/hooks/useCommandCompletion.test.js +377 -0
  551. package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -0
  552. package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +6 -0
  553. package/dist/src/ui/hooks/useConsoleMessages.test.js +127 -0
  554. package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -0
  555. package/dist/src/ui/hooks/useEditorSettings.test.js +40 -34
  556. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
  557. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +14 -4
  558. package/dist/src/ui/hooks/useExtensionUpdates.js +18 -11
  559. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
  560. package/dist/src/ui/hooks/useExtensionUpdates.test.js +52 -35
  561. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -1
  562. package/dist/src/ui/hooks/useFlickerDetector.test.js +9 -5
  563. package/dist/src/ui/hooks/useFlickerDetector.test.js.map +1 -1
  564. package/dist/src/ui/hooks/useFocus.test.d.ts +6 -0
  565. package/dist/src/ui/hooks/useFocus.test.js +131 -0
  566. package/dist/src/ui/hooks/useFocus.test.js.map +1 -0
  567. package/dist/src/ui/hooks/useFolderTrust.test.d.ts +6 -0
  568. package/dist/src/ui/hooks/useFolderTrust.test.js +188 -0
  569. package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -0
  570. package/dist/src/ui/hooks/useGeminiStream.js +119 -74
  571. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  572. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
  573. package/dist/src/ui/hooks/useGeminiStream.test.js +1820 -0
  574. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
  575. package/dist/src/ui/hooks/useGitBranchName.js +4 -0
  576. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
  577. package/dist/src/ui/hooks/useGitBranchName.test.js +46 -34
  578. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
  579. package/dist/src/ui/hooks/useHistoryManager.test.js +2 -1
  580. package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -1
  581. package/dist/src/ui/hooks/useIdeTrustListener.test.js +40 -9
  582. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -1
  583. package/dist/src/ui/hooks/useInputHistory.test.js +2 -1
  584. package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -1
  585. package/dist/src/ui/hooks/useInputHistoryStore.js +2 -1
  586. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -1
  587. package/dist/src/ui/hooks/useInputHistoryStore.test.js +2 -1
  588. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -1
  589. package/dist/src/ui/hooks/useKeypress.test.d.ts +6 -0
  590. package/dist/src/ui/hooks/useKeypress.test.js +223 -0
  591. package/dist/src/ui/hooks/useKeypress.test.js.map +1 -0
  592. package/dist/src/ui/hooks/useLoadingIndicator.test.js +29 -6
  593. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
  594. package/dist/src/ui/hooks/useMemoryMonitor.test.js +10 -5
  595. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -1
  596. package/dist/src/ui/hooks/useMessageQueue.d.ts +1 -0
  597. package/dist/src/ui/hooks/useMessageQueue.js +14 -0
  598. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
  599. package/dist/src/ui/hooks/useMessageQueue.test.js +173 -35
  600. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
  601. package/dist/src/ui/hooks/useModelCommand.test.js +21 -11
  602. package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -1
  603. package/dist/src/ui/hooks/useMouse.d.ts +17 -0
  604. package/dist/src/ui/hooks/useMouse.js +27 -0
  605. package/dist/src/ui/hooks/useMouse.js.map +1 -0
  606. package/dist/src/ui/hooks/useMouse.test.d.ts +6 -0
  607. package/dist/src/ui/hooks/useMouse.test.js +57 -0
  608. package/dist/src/ui/hooks/useMouse.test.js.map +1 -0
  609. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +2 -2
  610. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
  611. package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -0
  612. package/dist/src/ui/hooks/usePhraseCycler.js +156 -5
  613. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  614. package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +6 -0
  615. package/dist/src/ui/hooks/usePhraseCycler.test.js +158 -0
  616. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -0
  617. package/dist/src/ui/hooks/usePrivacySettings.test.js +26 -6
  618. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
  619. package/dist/src/ui/hooks/usePromptCompletion.js +2 -2
  620. package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
  621. package/dist/src/ui/hooks/useQuotaAndFallback.js +13 -14
  622. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
  623. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +55 -48
  624. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
  625. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +8 -1
  626. package/dist/src/ui/hooks/useReactToolScheduler.js +61 -36
  627. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  628. package/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +6 -0
  629. package/dist/src/ui/hooks/useReactToolScheduler.test.js +65 -0
  630. package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -0
  631. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +2 -2
  632. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -1
  633. package/dist/src/ui/hooks/useSelectionList.js +5 -4
  634. package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
  635. package/dist/src/ui/hooks/useSelectionList.test.js +272 -183
  636. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
  637. package/dist/src/ui/hooks/useShellHistory.test.js +52 -20
  638. package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -1
  639. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +1 -1
  640. package/dist/src/ui/hooks/useShowMemoryCommand.js +4 -3
  641. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
  642. package/dist/src/ui/hooks/useSlashCompletion.js +20 -8
  643. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
  644. package/dist/src/ui/hooks/useSlashCompletion.test.js +275 -137
  645. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
  646. package/dist/src/ui/hooks/useThemeCommand.d.ts +2 -1
  647. package/dist/src/ui/hooks/useThemeCommand.js +6 -0
  648. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  649. package/dist/src/ui/hooks/useTimer.test.js +43 -14
  650. package/dist/src/ui/hooks/useTimer.test.js.map +1 -1
  651. package/dist/src/ui/hooks/useToolScheduler.test.js +229 -242
  652. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  653. package/dist/src/ui/hooks/vim.js +2 -1
  654. package/dist/src/ui/hooks/vim.js.map +1 -1
  655. package/dist/src/ui/hooks/vim.test.d.ts +6 -0
  656. package/dist/src/ui/hooks/vim.test.js +1269 -0
  657. package/dist/src/ui/hooks/vim.test.js.map +1 -0
  658. package/dist/src/ui/keyMatchers.test.js +39 -6
  659. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  660. package/dist/src/ui/state/extensions.d.ts +1 -0
  661. package/dist/src/ui/state/extensions.js +1 -0
  662. package/dist/src/ui/state/extensions.js.map +1 -1
  663. package/dist/src/ui/themes/ansi-light.js +1 -0
  664. package/dist/src/ui/themes/ansi-light.js.map +1 -1
  665. package/dist/src/ui/themes/ansi.js +1 -0
  666. package/dist/src/ui/themes/ansi.js.map +1 -1
  667. package/dist/src/ui/themes/atom-one-dark.js +2 -0
  668. package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
  669. package/dist/src/ui/themes/ayu-light.js +2 -0
  670. package/dist/src/ui/themes/ayu-light.js.map +1 -1
  671. package/dist/src/ui/themes/ayu.js +2 -0
  672. package/dist/src/ui/themes/ayu.js.map +1 -1
  673. package/dist/src/ui/themes/color-utils.d.ts +1 -0
  674. package/dist/src/ui/themes/color-utils.js +8 -1
  675. package/dist/src/ui/themes/color-utils.js.map +1 -1
  676. package/dist/src/ui/themes/color-utils.test.js +13 -1
  677. package/dist/src/ui/themes/color-utils.test.js.map +1 -1
  678. package/dist/src/ui/themes/dracula.js +2 -0
  679. package/dist/src/ui/themes/dracula.js.map +1 -1
  680. package/dist/src/ui/themes/github-dark.js +2 -0
  681. package/dist/src/ui/themes/github-dark.js.map +1 -1
  682. package/dist/src/ui/themes/github-light.js +2 -0
  683. package/dist/src/ui/themes/github-light.js.map +1 -1
  684. package/dist/src/ui/themes/googlecode.js +2 -0
  685. package/dist/src/ui/themes/googlecode.js.map +1 -1
  686. package/dist/src/ui/themes/no-color.js +3 -0
  687. package/dist/src/ui/themes/no-color.js.map +1 -1
  688. package/dist/src/ui/themes/semantic-tokens.d.ts +2 -0
  689. package/dist/src/ui/themes/semantic-tokens.js +6 -0
  690. package/dist/src/ui/themes/semantic-tokens.js.map +1 -1
  691. package/dist/src/ui/themes/shades-of-purple.js +2 -0
  692. package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
  693. package/dist/src/ui/themes/theme-manager.js +8 -7
  694. package/dist/src/ui/themes/theme-manager.js.map +1 -1
  695. package/dist/src/ui/themes/theme.d.ts +3 -0
  696. package/dist/src/ui/themes/theme.js +14 -3
  697. package/dist/src/ui/themes/theme.js.map +1 -1
  698. package/dist/src/ui/themes/theme.test.d.ts +6 -0
  699. package/dist/src/ui/themes/theme.test.js +151 -0
  700. package/dist/src/ui/themes/theme.test.js.map +1 -0
  701. package/dist/src/ui/themes/xcode.js +2 -0
  702. package/dist/src/ui/themes/xcode.js.map +1 -1
  703. package/dist/src/ui/types.d.ts +3 -2
  704. package/dist/src/ui/types.js +2 -0
  705. package/dist/src/ui/types.js.map +1 -1
  706. package/dist/src/ui/utils/CodeColorizer.d.ts +1 -1
  707. package/dist/src/ui/utils/CodeColorizer.js +6 -3
  708. package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
  709. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +1 -0
  710. package/dist/src/ui/utils/InlineMarkdownRenderer.js +11 -10
  711. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
  712. package/dist/src/ui/utils/MarkdownDisplay.d.ts +1 -0
  713. package/dist/src/ui/utils/MarkdownDisplay.js +19 -10
  714. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  715. package/dist/src/ui/utils/clipboardUtils.js +2 -2
  716. package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
  717. package/dist/src/ui/utils/commandUtils.js +20 -3
  718. package/dist/src/ui/utils/commandUtils.js.map +1 -1
  719. package/dist/src/ui/utils/commandUtils.test.js +61 -6
  720. package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
  721. package/dist/src/ui/utils/computeStats.js +5 -2
  722. package/dist/src/ui/utils/computeStats.js.map +1 -1
  723. package/dist/src/ui/utils/computeStats.test.d.ts +6 -0
  724. package/dist/src/ui/utils/computeStats.test.js +262 -0
  725. package/dist/src/ui/utils/computeStats.test.js.map +1 -0
  726. package/dist/src/ui/utils/input.d.ts +17 -0
  727. package/dist/src/ui/utils/input.js +51 -0
  728. package/dist/src/ui/utils/input.js.map +1 -0
  729. package/dist/src/ui/utils/input.test.d.ts +6 -0
  730. package/dist/src/ui/utils/input.test.js +44 -0
  731. package/dist/src/ui/utils/input.test.js.map +1 -0
  732. package/dist/src/ui/utils/kittyProtocolDetector.js +13 -4
  733. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
  734. package/dist/src/ui/utils/mouse.d.ts +31 -0
  735. package/dist/src/ui/utils/mouse.js +164 -0
  736. package/dist/src/ui/utils/mouse.js.map +1 -0
  737. package/dist/src/ui/utils/mouse.test.d.ts +6 -0
  738. package/dist/src/ui/utils/mouse.test.js +131 -0
  739. package/dist/src/ui/utils/mouse.test.js.map +1 -0
  740. package/dist/src/ui/utils/terminalSetup.js +3 -2
  741. package/dist/src/ui/utils/terminalSetup.js.map +1 -1
  742. package/dist/src/ui/utils/textOutput.d.ts +25 -0
  743. package/dist/src/ui/utils/textOutput.js +49 -0
  744. package/dist/src/ui/utils/textOutput.js.map +1 -0
  745. package/dist/src/ui/utils/textOutput.test.d.ts +6 -0
  746. package/dist/src/ui/utils/textOutput.test.js +79 -0
  747. package/dist/src/ui/utils/textOutput.test.js.map +1 -0
  748. package/dist/src/ui/utils/updateCheck.d.ts +9 -2
  749. package/dist/src/ui/utils/updateCheck.js +38 -30
  750. package/dist/src/ui/utils/updateCheck.js.map +1 -1
  751. package/dist/src/ui/utils/updateCheck.test.js +48 -59
  752. package/dist/src/ui/utils/updateCheck.test.js.map +1 -1
  753. package/dist/src/utils/cleanup.test.d.ts +6 -0
  754. package/dist/src/utils/cleanup.test.js +49 -0
  755. package/dist/src/utils/cleanup.test.js.map +1 -0
  756. package/dist/src/utils/commentJson.js +2 -2
  757. package/dist/src/utils/commentJson.js.map +1 -1
  758. package/dist/src/utils/commentJson.test.js +7 -6
  759. package/dist/src/utils/commentJson.test.js.map +1 -1
  760. package/dist/src/utils/envVarResolver.d.ts +2 -2
  761. package/dist/src/utils/envVarResolver.js +10 -7
  762. package/dist/src/utils/envVarResolver.js.map +1 -1
  763. package/dist/src/utils/errors.d.ts +1 -0
  764. package/dist/src/utils/errors.js +66 -5
  765. package/dist/src/utils/errors.js.map +1 -1
  766. package/dist/src/utils/events.d.ts +11 -2
  767. package/dist/src/utils/events.js +1 -0
  768. package/dist/src/utils/events.js.map +1 -1
  769. package/dist/src/utils/gitUtils.js +3 -2
  770. package/dist/src/utils/gitUtils.js.map +1 -1
  771. package/dist/src/utils/handleAutoUpdate.js +9 -3
  772. package/dist/src/utils/handleAutoUpdate.js.map +1 -1
  773. package/dist/src/utils/handleAutoUpdate.test.d.ts +6 -0
  774. package/dist/src/utils/handleAutoUpdate.test.js +225 -0
  775. package/dist/src/utils/handleAutoUpdate.test.js.map +1 -0
  776. package/dist/src/utils/installationInfo.js +2 -2
  777. package/dist/src/utils/installationInfo.js.map +1 -1
  778. package/dist/src/utils/installationInfo.test.js +8 -4
  779. package/dist/src/utils/installationInfo.test.js.map +1 -1
  780. package/dist/src/utils/readStdin.js +2 -1
  781. package/dist/src/utils/readStdin.js.map +1 -1
  782. package/dist/src/utils/sandbox-macos-permissive-open.sb +2 -0
  783. package/dist/src/utils/sandbox.js +28 -30
  784. package/dist/src/utils/sandbox.js.map +1 -1
  785. package/dist/src/utils/sessionCleanup.js +4 -4
  786. package/dist/src/utils/sessionCleanup.js.map +1 -1
  787. package/dist/src/utils/startupWarnings.test.d.ts +6 -0
  788. package/dist/src/utils/startupWarnings.test.js +61 -0
  789. package/dist/src/utils/startupWarnings.test.js.map +1 -0
  790. package/dist/src/utils/version.js +6 -2
  791. package/dist/src/utils/version.js.map +1 -1
  792. package/dist/src/validateNonInterActiveAuth.js +2 -2
  793. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  794. package/dist/src/zed-integration/acp.js +2 -1
  795. package/dist/src/zed-integration/acp.js.map +1 -1
  796. package/dist/src/zed-integration/schema.d.ts +4 -4
  797. package/dist/src/zed-integration/zedIntegration.d.ts +2 -2
  798. package/dist/src/zed-integration/zedIntegration.js +16 -25
  799. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  800. package/dist/tsconfig.tsbuildinfo +1 -1
  801. package/package.json +17 -17
  802. package/dist/src/config/policy.test.js +0 -336
  803. package/dist/src/config/policy.test.js.map +0 -1
  804. package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +0 -11
  805. package/dist/src/ui/components/WorkspaceMigrationDialog.js +0 -44
  806. package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +0 -1
  807. package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +0 -13
  808. package/dist/src/ui/hooks/useWorkspaceMigration.js +0 -59
  809. package/dist/src/ui/hooks/useWorkspaceMigration.js.map +0 -1
  810. package/dist/src/utils/package.d.ts +0 -12
  811. package/dist/src/utils/package.js +0 -24
  812. package/dist/src/utils/package.js.map +0 -1
  813. /package/dist/src/{config/policy.test.d.ts → commands/extensions/examples/mcp-server/example.d.ts} +0 -0
@@ -20,7 +20,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  * - Display values for inherited and overridden settings
21
21
  *
22
22
  */
23
- import { render } from 'ink-testing-library';
23
+ import { render } from '../../test-utils/render.js';
24
+ import { waitFor } from '../../test-utils/async.js';
24
25
  import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
25
26
  import { SettingsDialog } from './SettingsDialog.js';
26
27
  import { LoadedSettings, SettingScope } from '../../config/settings.js';
@@ -105,147 +106,186 @@ vi.mock('../../utils/settingsUtils.js', async () => {
105
106
  saveModifiedSettings: vi.fn(),
106
107
  };
107
108
  });
108
- // Helper function to simulate key presses (commented out for now)
109
- // const simulateKeyPress = async (keyData: Partial<Key> & { name: string }) => {
110
- // if (currentKeypressHandler) {
111
- // const key: Key = {
112
- // ctrl: false,
113
- // meta: false,
114
- // shift: false,
115
- // paste: false,
116
- // sequence: keyData.sequence || keyData.name,
117
- // ...keyData,
118
- // };
119
- // currentKeypressHandler(key);
120
- // // Allow React to process the state update
121
- // await new Promise(resolve => setTimeout(resolve, 10));
122
- // }
123
- // };
124
- // Mock console.log to avoid noise in tests
125
- // const originalConsoleLog = console.log;
126
- // const originalConsoleError = console.error;
109
+ // Shared test schemas
110
+ var StringEnum;
111
+ (function (StringEnum) {
112
+ StringEnum["FOO"] = "foo";
113
+ StringEnum["BAR"] = "bar";
114
+ StringEnum["BAZ"] = "baz";
115
+ })(StringEnum || (StringEnum = {}));
116
+ const ENUM_SETTING = {
117
+ type: 'enum',
118
+ label: 'Theme',
119
+ options: [
120
+ {
121
+ label: 'Foo',
122
+ value: StringEnum.FOO,
123
+ },
124
+ {
125
+ label: 'Bar',
126
+ value: StringEnum.BAR,
127
+ },
128
+ {
129
+ label: 'Baz',
130
+ value: StringEnum.BAZ,
131
+ },
132
+ ],
133
+ category: 'UI',
134
+ requiresRestart: false,
135
+ default: StringEnum.BAR,
136
+ description: 'The color theme for the UI.',
137
+ showInDialog: true,
138
+ };
139
+ const ENUM_FAKE_SCHEMA = {
140
+ ui: {
141
+ showInDialog: false,
142
+ properties: {
143
+ theme: {
144
+ ...ENUM_SETTING,
145
+ },
146
+ },
147
+ },
148
+ };
149
+ const TOOLS_SHELL_FAKE_SCHEMA = {
150
+ tools: {
151
+ type: 'object',
152
+ label: 'Tools',
153
+ category: 'Tools',
154
+ requiresRestart: false,
155
+ default: {},
156
+ description: 'Tool settings.',
157
+ showInDialog: false,
158
+ properties: {
159
+ shell: {
160
+ type: 'object',
161
+ label: 'Shell',
162
+ category: 'Tools',
163
+ requiresRestart: false,
164
+ default: {},
165
+ description: 'Shell tool settings.',
166
+ showInDialog: false,
167
+ properties: {
168
+ showColor: {
169
+ type: 'boolean',
170
+ label: 'Show Color',
171
+ category: 'Tools',
172
+ requiresRestart: false,
173
+ default: false,
174
+ description: 'Show color in shell output.',
175
+ showInDialog: true,
176
+ },
177
+ enableInteractiveShell: {
178
+ type: 'boolean',
179
+ label: 'Enable Interactive Shell',
180
+ category: 'Tools',
181
+ requiresRestart: true,
182
+ default: true,
183
+ description: 'Enable interactive shell mode.',
184
+ showInDialog: true,
185
+ },
186
+ pager: {
187
+ type: 'string',
188
+ label: 'Pager',
189
+ category: 'Tools',
190
+ requiresRestart: false,
191
+ default: 'cat',
192
+ description: 'The pager command to use for shell output.',
193
+ showInDialog: true,
194
+ },
195
+ },
196
+ },
197
+ },
198
+ },
199
+ };
200
+ // Helper function to render SettingsDialog with standard wrapper
201
+ const renderDialog = (settings, onSelect, options) => render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect, onRestartRequest: options?.onRestartRequest, availableTerminalHeight: options?.availableTerminalHeight }) }));
127
202
  describe('SettingsDialog', () => {
128
- // Simple delay function for remaining tests that need gradual migration
129
- const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));
130
- // Custom waitFor utility for ink testing environment (not compatible with @testing-library/react)
131
- const waitFor = async (predicate, options = {}) => {
132
- const { timeout = 1000, interval = 10 } = options;
133
- const start = Date.now();
134
- let lastError;
135
- while (Date.now() - start < timeout) {
136
- try {
137
- predicate();
138
- return;
139
- }
140
- catch (e) {
141
- lastError = e;
142
- }
143
- await new Promise((resolve) => setTimeout(resolve, interval));
144
- }
145
- if (lastError) {
146
- throw lastError;
147
- }
148
- throw new Error('waitFor timed out');
149
- };
150
203
  beforeEach(() => {
151
- // Reset keypress mock state (variables are commented out)
152
- // currentKeypressHandler = null;
153
- // isKeypressActive = false;
154
- // console.log = vi.fn();
155
- // console.error = vi.fn();
156
204
  mockToggleVimEnabled.mockResolvedValue(true);
157
205
  });
158
206
  afterEach(() => {
159
207
  TEST_ONLY.clearFlattenedSchema();
160
208
  vi.clearAllMocks();
161
209
  vi.resetAllMocks();
162
- // Reset keypress mock state (variables are commented out)
163
- // currentKeypressHandler = null;
164
- // isKeypressActive = false;
165
- // console.log = originalConsoleLog;
166
- // console.error = originalConsoleError;
167
210
  });
168
211
  describe('Initial Rendering', () => {
169
212
  it('should render the settings dialog with default state', () => {
170
213
  const settings = createMockSettings();
171
214
  const onSelect = vi.fn();
172
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
215
+ const { lastFrame } = renderDialog(settings, onSelect);
173
216
  const output = lastFrame();
174
217
  expect(output).toContain('Settings');
175
218
  expect(output).toContain('Apply To');
176
- expect(output).toContain('Use Enter to select, Tab to change focus');
219
+ // Use regex for more flexible help text matching
220
+ expect(output).toMatch(/Enter.*select.*Esc.*close/);
177
221
  });
178
222
  it('should accept availableTerminalHeight prop without errors', () => {
179
223
  const settings = createMockSettings();
180
224
  const onSelect = vi.fn();
181
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect, availableTerminalHeight: 20 }) }));
225
+ const { lastFrame } = renderDialog(settings, onSelect, {
226
+ availableTerminalHeight: 20,
227
+ });
182
228
  const output = lastFrame();
183
229
  // Should still render properly with the height prop
184
230
  expect(output).toContain('Settings');
185
- expect(output).toContain('Use Enter to select');
186
- });
187
- it('should show settings list with default values', () => {
188
- const settings = createMockSettings();
189
- const onSelect = vi.fn();
190
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
191
- const output = lastFrame();
192
- // Should show some default settings
193
- expect(output).toContain('●'); // Active indicator
231
+ // Use regex for more flexible help text matching
232
+ expect(output).toMatch(/Enter.*select.*Esc.*close/);
194
233
  });
195
- it('should highlight first setting by default', () => {
234
+ it('should render settings list with visual indicators', () => {
196
235
  const settings = createMockSettings();
197
236
  const onSelect = vi.fn();
198
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
237
+ const { lastFrame } = renderDialog(settings, onSelect);
199
238
  const output = lastFrame();
200
- // First item should be highlighted with green color and active indicator
201
- expect(output).toContain('●');
239
+ // Use snapshot to capture visual layout including indicators
240
+ expect(output).toMatchSnapshot();
202
241
  });
203
242
  });
204
243
  describe('Settings Navigation', () => {
205
- it('should navigate down with arrow key', async () => {
244
+ it.each([
245
+ {
246
+ name: 'arrow keys',
247
+ down: TerminalKeys.DOWN_ARROW,
248
+ up: TerminalKeys.UP_ARROW,
249
+ },
250
+ {
251
+ name: 'vim keys (j/k)',
252
+ down: 'j',
253
+ up: 'k',
254
+ },
255
+ ])('should navigate with $name', async ({ down, up }) => {
206
256
  const settings = createMockSettings();
207
257
  const onSelect = vi.fn();
208
- const { stdin, unmount, lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
209
- // Press down arrow
258
+ const { stdin, unmount, lastFrame } = renderDialog(settings, onSelect);
259
+ const initialFrame = lastFrame();
260
+ expect(initialFrame).toContain('Vim Mode');
261
+ // Navigate down
210
262
  act(() => {
211
- stdin.write(TerminalKeys.DOWN_ARROW); // Down arrow
263
+ stdin.write(down);
264
+ });
265
+ await waitFor(() => {
266
+ expect(lastFrame()).toContain('Disable Auto Update');
267
+ });
268
+ // Navigate up
269
+ act(() => {
270
+ stdin.write(up);
271
+ });
272
+ await waitFor(() => {
273
+ expect(lastFrame()).toContain('Vim Mode');
212
274
  });
213
- expect(lastFrame()).toContain('● Disable Auto Update');
214
- // The active index should have changed (tested indirectly through behavior)
215
- unmount();
216
- });
217
- it('should navigate up with arrow key', async () => {
218
- const settings = createMockSettings();
219
- const onSelect = vi.fn();
220
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
221
- // First go down, then up
222
- stdin.write(TerminalKeys.DOWN_ARROW); // Down arrow
223
- await wait();
224
- stdin.write(TerminalKeys.UP_ARROW);
225
- await wait();
226
- unmount();
227
- });
228
- it('should navigate with vim keys (j/k)', async () => {
229
- const settings = createMockSettings();
230
- const onSelect = vi.fn();
231
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
232
- // Navigate with vim keys
233
- stdin.write('j'); // Down
234
- await wait();
235
- stdin.write('k'); // Up
236
- await wait();
237
275
  unmount();
238
276
  });
239
277
  it('wraps around when at the top of the list', async () => {
240
278
  const settings = createMockSettings();
241
279
  const onSelect = vi.fn();
242
- const { stdin, unmount, lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
280
+ const { stdin, unmount, lastFrame } = renderDialog(settings, onSelect);
243
281
  // Try to go up from first item
244
282
  act(() => {
245
283
  stdin.write(TerminalKeys.UP_ARROW);
246
284
  });
247
- await wait();
248
- expect(lastFrame()).toContain('● Codebase Investigator Max Num Turns');
285
+ await waitFor(() => {
286
+ // Should wrap to last setting (without relying on exact bullet character)
287
+ expect(lastFrame()).toContain('Codebase Investigator Max Num Turns');
288
+ });
249
289
  unmount();
250
290
  });
251
291
  });
@@ -254,18 +294,17 @@ describe('SettingsDialog', () => {
254
294
  vi.mocked(saveModifiedSettings).mockClear();
255
295
  const settings = createMockSettings();
256
296
  const onSelect = vi.fn();
257
- const component = (_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
258
- const { stdin, unmount, lastFrame } = render(component);
297
+ const { stdin, unmount, lastFrame } = renderDialog(settings, onSelect);
259
298
  // Wait for initial render and verify we're on Vim Mode (first setting)
260
299
  await waitFor(() => {
261
- expect(lastFrame()).toContain('Vim Mode');
300
+ expect(lastFrame()).toContain('Vim Mode');
262
301
  });
263
302
  // Navigate to Disable Auto Update setting and verify we're there
264
303
  act(() => {
265
304
  stdin.write(TerminalKeys.DOWN_ARROW);
266
305
  });
267
306
  await waitFor(() => {
268
- expect(lastFrame()).toContain('Disable Auto Update');
307
+ expect(lastFrame()).toContain('Disable Auto Update');
269
308
  });
270
309
  // Toggle the setting
271
310
  act(() => {
@@ -279,116 +318,68 @@ describe('SettingsDialog', () => {
279
318
  await waitFor(() => {
280
319
  expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalled();
281
320
  });
282
- expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['general.disableAutoUpdate']), {
283
- general: {
321
+ expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['general.disableAutoUpdate']), expect.objectContaining({
322
+ general: expect.objectContaining({
284
323
  disableAutoUpdate: true,
285
- },
286
- }, expect.any(LoadedSettings), SettingScope.User);
324
+ }),
325
+ }), expect.any(LoadedSettings), SettingScope.User);
287
326
  unmount();
288
327
  });
289
328
  describe('enum values', () => {
290
- let StringEnum;
291
- (function (StringEnum) {
292
- StringEnum["FOO"] = "foo";
293
- StringEnum["BAR"] = "bar";
294
- StringEnum["BAZ"] = "baz";
295
- })(StringEnum || (StringEnum = {}));
296
- const SETTING = {
297
- type: 'enum',
298
- label: 'Theme',
299
- options: [
300
- {
301
- label: 'Foo',
302
- value: StringEnum.FOO,
303
- },
304
- {
305
- label: 'Bar',
306
- value: StringEnum.BAR,
307
- },
308
- {
309
- label: 'Baz',
310
- value: StringEnum.BAZ,
311
- },
312
- ],
313
- category: 'UI',
314
- requiresRestart: false,
315
- default: StringEnum.BAR,
316
- description: 'The color theme for the UI.',
317
- showInDialog: true,
318
- };
319
- const FAKE_SCHEMA = {
320
- ui: {
321
- showInDialog: false,
322
- properties: {
323
- theme: {
324
- ...SETTING,
325
- },
326
- },
329
+ it.each([
330
+ {
331
+ name: 'toggles to next value',
332
+ initialValue: undefined,
333
+ expectedValue: StringEnum.BAZ,
334
+ },
335
+ {
336
+ name: 'loops back to first value when at end',
337
+ initialValue: StringEnum.BAZ,
338
+ expectedValue: StringEnum.FOO,
327
339
  },
328
- };
329
- it('toggles enum values with the enter key', async () => {
340
+ ])('$name', async ({ initialValue, expectedValue }) => {
330
341
  vi.mocked(saveModifiedSettings).mockClear();
331
- vi.mocked(getSettingsSchema).mockReturnValue(FAKE_SCHEMA);
342
+ vi.mocked(getSettingsSchema).mockReturnValue(ENUM_FAKE_SCHEMA);
332
343
  const settings = createMockSettings();
344
+ if (initialValue !== undefined) {
345
+ settings.setValue(SettingScope.User, 'ui.theme', initialValue);
346
+ }
333
347
  const onSelect = vi.fn();
334
- const component = (_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
335
- const { stdin, unmount } = render(component);
336
- // Press Enter to toggle current setting
337
- stdin.write(TerminalKeys.DOWN_ARROW);
338
- await wait();
339
- stdin.write(TerminalKeys.ENTER);
340
- await wait();
341
- await waitFor(() => {
342
- expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalled();
348
+ const { stdin, unmount } = renderDialog(settings, onSelect);
349
+ act(() => {
350
+ stdin.write(TerminalKeys.DOWN_ARROW);
351
+ stdin.write(TerminalKeys.ENTER);
343
352
  });
344
- expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['ui.theme']), {
345
- ui: {
346
- theme: StringEnum.BAZ,
347
- },
348
- }, expect.any(LoadedSettings), SettingScope.User);
349
- unmount();
350
- });
351
- it('loops back when reaching the end of an enum', async () => {
352
- vi.mocked(saveModifiedSettings).mockClear();
353
- vi.mocked(getSettingsSchema).mockReturnValue(FAKE_SCHEMA);
354
- const settings = createMockSettings();
355
- settings.setValue(SettingScope.User, 'ui.theme', StringEnum.BAZ);
356
- const onSelect = vi.fn();
357
- const component = (_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
358
- const { stdin, unmount } = render(component);
359
- // Press Enter to toggle current setting
360
- stdin.write(TerminalKeys.DOWN_ARROW);
361
- await wait();
362
- stdin.write(TerminalKeys.ENTER);
363
- await wait();
364
353
  await waitFor(() => {
365
354
  expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalled();
366
355
  });
367
- expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['ui.theme']), {
368
- ui: {
369
- theme: StringEnum.FOO,
370
- },
371
- }, expect.any(LoadedSettings), SettingScope.User);
356
+ expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['ui.theme']), expect.objectContaining({
357
+ ui: expect.objectContaining({
358
+ theme: expectedValue,
359
+ }),
360
+ }), expect.any(LoadedSettings), SettingScope.User);
372
361
  unmount();
373
362
  });
374
363
  });
375
364
  it('should toggle setting with Space key', async () => {
376
365
  const settings = createMockSettings();
377
366
  const onSelect = vi.fn();
378
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
367
+ const { stdin, unmount } = renderDialog(settings, onSelect);
379
368
  // Press Space to toggle current setting
380
- stdin.write(' '); // Space key
381
- await wait();
369
+ act(() => {
370
+ stdin.write(' '); // Space key
371
+ });
382
372
  unmount();
383
373
  });
384
374
  it('should handle vim mode setting specially', async () => {
385
375
  const settings = createMockSettings();
386
376
  const onSelect = vi.fn();
387
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
377
+ const { stdin, unmount } = renderDialog(settings, onSelect);
388
378
  // Navigate to vim mode setting and toggle it
389
379
  // This would require knowing the exact position, so we'll just test that the mock is called
390
- stdin.write(TerminalKeys.ENTER); // Enter key
391
- await wait();
380
+ act(() => {
381
+ stdin.write(TerminalKeys.ENTER); // Enter key
382
+ });
392
383
  // The mock should potentially be called if vim mode was toggled
393
384
  unmount();
394
385
  });
@@ -397,26 +388,26 @@ describe('SettingsDialog', () => {
397
388
  it('should switch between scopes', async () => {
398
389
  const settings = createMockSettings();
399
390
  const onSelect = vi.fn();
400
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
391
+ const { stdin, unmount } = renderDialog(settings, onSelect);
401
392
  // Switch to scope focus
402
- stdin.write(TerminalKeys.TAB); // Tab key
403
- await wait();
404
- // Select different scope (numbers 1-3 typically available)
405
- stdin.write('2'); // Select second scope option
406
- await wait();
393
+ act(() => {
394
+ stdin.write(TerminalKeys.TAB); // Tab key
395
+ // Select different scope (numbers 1-3 typically available)
396
+ stdin.write('2'); // Select second scope option
397
+ });
407
398
  unmount();
408
399
  });
409
400
  it('should reset to settings focus when scope is selected', async () => {
410
401
  const settings = createMockSettings();
411
402
  const onSelect = vi.fn();
412
- const { lastFrame, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
403
+ const { lastFrame, unmount } = renderDialog(settings, onSelect);
413
404
  // Wait for initial render
414
405
  await waitFor(() => {
415
406
  expect(lastFrame()).toContain('Vim Mode');
416
407
  });
417
408
  // The UI should show the settings section is active and scope section is inactive
418
- expect(lastFrame()).toContain('Vim Mode'); // Settings section active
419
- expect(lastFrame()).toContain(' Apply To'); // Scope section inactive
409
+ expect(lastFrame()).toContain('Vim Mode'); // Settings section active
410
+ expect(lastFrame()).toContain('Apply To'); // Scope section (don't rely on exact spacing)
420
411
  // This test validates the initial state - scope selection behavior
421
412
  // is complex due to keypress handling, so we focus on state validation
422
413
  unmount();
@@ -426,19 +417,23 @@ describe('SettingsDialog', () => {
426
417
  it('should show restart prompt for restart-required settings', async () => {
427
418
  const settings = createMockSettings();
428
419
  const onRestartRequest = vi.fn();
429
- const { unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: () => { }, onRestartRequest: onRestartRequest }) }));
420
+ const { unmount } = renderDialog(settings, vi.fn(), {
421
+ onRestartRequest,
422
+ });
430
423
  // This test would need to trigger a restart-required setting change
431
424
  // The exact steps depend on which settings require restart
432
- await wait();
433
425
  unmount();
434
426
  });
435
427
  it('should handle restart request when r is pressed', async () => {
436
428
  const settings = createMockSettings();
437
429
  const onRestartRequest = vi.fn();
438
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: () => { }, onRestartRequest: onRestartRequest }) }));
430
+ const { stdin, unmount } = renderDialog(settings, vi.fn(), {
431
+ onRestartRequest,
432
+ });
439
433
  // Press 'r' key (this would only work if restart prompt is showing)
440
- stdin.write('r');
441
- await wait();
434
+ act(() => {
435
+ stdin.write('r');
436
+ });
442
437
  // If restart prompt was showing, onRestartRequest should be called
443
438
  unmount();
444
439
  });
@@ -447,7 +442,7 @@ describe('SettingsDialog', () => {
447
442
  it('should call onSelect with undefined when Escape is pressed', async () => {
448
443
  const settings = createMockSettings();
449
444
  const onSelect = vi.fn();
450
- const { lastFrame, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
445
+ const { lastFrame, unmount } = renderDialog(settings, onSelect);
451
446
  // Wait for initial render
452
447
  await waitFor(() => {
453
448
  expect(lastFrame()).toContain('Hide Window Title');
@@ -464,13 +459,12 @@ describe('SettingsDialog', () => {
464
459
  it('should persist settings across scope changes', async () => {
465
460
  const settings = createMockSettings({ vimMode: true });
466
461
  const onSelect = vi.fn();
467
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
468
- // Switch to scope selector
469
- stdin.write(TerminalKeys.TAB); // Tab
470
- await wait();
471
- // Change scope
472
- stdin.write('2'); // Select workspace scope
473
- await wait();
462
+ const { stdin, unmount } = renderDialog(settings, onSelect);
463
+ // Switch to scope selector and change scope
464
+ act(() => {
465
+ stdin.write(TerminalKeys.TAB); // Tab
466
+ stdin.write('2'); // Select workspace scope
467
+ });
474
468
  // Settings should be reloaded for new scope
475
469
  unmount();
476
470
  });
@@ -479,7 +473,7 @@ describe('SettingsDialog', () => {
479
473
  { vimMode: false }, // System settings
480
474
  { autoUpdate: false });
481
475
  const onSelect = vi.fn();
482
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
476
+ const { lastFrame } = renderDialog(settings, onSelect);
483
477
  // Should show user scope values initially
484
478
  const output = lastFrame();
485
479
  expect(output).toContain('Settings');
@@ -490,10 +484,11 @@ describe('SettingsDialog', () => {
490
484
  mockToggleVimEnabled.mockRejectedValue(new Error('Toggle failed'));
491
485
  const settings = createMockSettings();
492
486
  const onSelect = vi.fn();
493
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
487
+ const { stdin, unmount } = renderDialog(settings, onSelect);
494
488
  // Try to toggle a setting (this might trigger vim mode toggle)
495
- stdin.write(TerminalKeys.ENTER); // Enter
496
- await wait();
489
+ act(() => {
490
+ stdin.write(TerminalKeys.ENTER); // Enter
491
+ });
497
492
  // Should not crash
498
493
  unmount();
499
494
  });
@@ -502,27 +497,26 @@ describe('SettingsDialog', () => {
502
497
  it('should track modified settings correctly', async () => {
503
498
  const settings = createMockSettings();
504
499
  const onSelect = vi.fn();
505
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
506
- // Toggle a setting
507
- stdin.write(TerminalKeys.ENTER); // Enter
508
- await wait();
509
- // Toggle another setting
510
- stdin.write(TerminalKeys.DOWN_ARROW); // Down
511
- await wait();
512
- stdin.write(TerminalKeys.ENTER); // Enter
513
- await wait();
500
+ const { stdin, unmount } = renderDialog(settings, onSelect);
501
+ // Toggle a setting, then toggle another setting
502
+ act(() => {
503
+ stdin.write(TerminalKeys.ENTER); // Enter
504
+ stdin.write(TerminalKeys.DOWN_ARROW); // Down
505
+ stdin.write(TerminalKeys.ENTER); // Enter
506
+ });
514
507
  // Should track multiple modified settings
515
508
  unmount();
516
509
  });
517
510
  it('should handle scrolling when there are many settings', async () => {
518
511
  const settings = createMockSettings();
519
512
  const onSelect = vi.fn();
520
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
513
+ const { stdin, unmount } = renderDialog(settings, onSelect);
521
514
  // Navigate down many times to test scrolling
522
- for (let i = 0; i < 10; i++) {
523
- stdin.write(TerminalKeys.DOWN_ARROW); // Down arrow
524
- await wait(10);
525
- }
515
+ act(() => {
516
+ for (let i = 0; i < 10; i++) {
517
+ stdin.write(TerminalKeys.DOWN_ARROW); // Down arrow
518
+ }
519
+ });
526
520
  unmount();
527
521
  });
528
522
  });
@@ -533,8 +527,9 @@ describe('SettingsDialog', () => {
533
527
  const { stdin, unmount } = render(_jsx(VimModeProvider, { settings: settings, children: _jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }) }));
534
528
  // Navigate to and toggle vim mode setting
535
529
  // This would require knowing the exact position of vim mode setting
536
- stdin.write(TerminalKeys.ENTER); // Enter
537
- await wait();
530
+ act(() => {
531
+ stdin.write(TerminalKeys.ENTER); // Enter
532
+ });
538
533
  unmount();
539
534
  });
540
535
  });
@@ -544,7 +539,7 @@ describe('SettingsDialog', () => {
544
539
  { hideWindowTitle: true }, // System settings
545
540
  { ideMode: false });
546
541
  const onSelect = vi.fn();
547
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
542
+ const { lastFrame } = renderDialog(settings, onSelect);
548
543
  const output = lastFrame();
549
544
  // Should contain settings labels
550
545
  expect(output).toContain('Settings');
@@ -552,28 +547,30 @@ describe('SettingsDialog', () => {
552
547
  it('should handle immediate settings save for non-restart-required settings', async () => {
553
548
  const settings = createMockSettings();
554
549
  const onSelect = vi.fn();
555
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
550
+ const { stdin, unmount } = renderDialog(settings, onSelect);
556
551
  // Toggle a non-restart-required setting (like hideTips)
557
- stdin.write(TerminalKeys.ENTER); // Enter - toggle current setting
558
- await wait();
552
+ act(() => {
553
+ stdin.write(TerminalKeys.ENTER); // Enter - toggle current setting
554
+ });
559
555
  // Should save immediately without showing restart prompt
560
556
  unmount();
561
557
  });
562
558
  it('should show restart prompt for restart-required settings', async () => {
563
559
  const settings = createMockSettings();
564
560
  const onSelect = vi.fn();
565
- const { lastFrame, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
561
+ const { lastFrame, unmount } = renderDialog(settings, onSelect);
566
562
  // This test would need to navigate to a specific restart-required setting
567
563
  // Since we can't easily target specific settings, we test the general behavior
568
- await wait();
569
564
  // Should not show restart prompt initially
570
- expect(lastFrame()).not.toContain('To see changes, Gemini CLI must be restarted');
565
+ await waitFor(() => {
566
+ expect(lastFrame()).not.toContain('To see changes, Gemini CLI must be restarted');
567
+ });
571
568
  unmount();
572
569
  });
573
570
  it('should clear restart prompt when switching scopes', async () => {
574
571
  const settings = createMockSettings();
575
572
  const onSelect = vi.fn();
576
- const { unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
573
+ const { unmount } = renderDialog(settings, onSelect);
577
574
  // Restart prompt should be cleared when switching scopes
578
575
  unmount();
579
576
  });
@@ -583,7 +580,7 @@ describe('SettingsDialog', () => {
583
580
  const settings = createMockSettings({}, { vimMode: true, hideWindowTitle: false }, // System settings
584
581
  {});
585
582
  const onSelect = vi.fn();
586
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
583
+ const { lastFrame } = renderDialog(settings, onSelect);
587
584
  const output = lastFrame();
588
585
  // Settings should show inherited values
589
586
  expect(output).toContain('Settings');
@@ -593,68 +590,122 @@ describe('SettingsDialog', () => {
593
590
  { vimMode: true }, // System default
594
591
  {});
595
592
  const onSelect = vi.fn();
596
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
593
+ const { lastFrame } = renderDialog(settings, onSelect);
597
594
  const output = lastFrame();
598
595
  // Should show settings with override indicators
599
596
  expect(output).toContain('Settings');
600
597
  });
601
598
  });
599
+ describe('Race Condition Regression Tests', () => {
600
+ it.each([
601
+ {
602
+ name: 'not reset sibling settings when toggling a nested setting multiple times',
603
+ toggleCount: 5,
604
+ shellSettings: {
605
+ showColor: false,
606
+ enableInteractiveShell: true,
607
+ },
608
+ expectedSiblings: {
609
+ enableInteractiveShell: true,
610
+ },
611
+ },
612
+ {
613
+ name: 'preserve multiple sibling settings in nested objects during rapid toggles',
614
+ toggleCount: 3,
615
+ shellSettings: {
616
+ showColor: false,
617
+ enableInteractiveShell: true,
618
+ pager: 'less',
619
+ },
620
+ expectedSiblings: {
621
+ enableInteractiveShell: true,
622
+ pager: 'less',
623
+ },
624
+ },
625
+ ])('should $name', async ({ toggleCount, shellSettings, expectedSiblings }) => {
626
+ vi.mocked(saveModifiedSettings).mockClear();
627
+ vi.mocked(getSettingsSchema).mockReturnValue(TOOLS_SHELL_FAKE_SCHEMA);
628
+ const settings = createMockSettings({
629
+ tools: {
630
+ shell: shellSettings,
631
+ },
632
+ });
633
+ const onSelect = vi.fn();
634
+ const { stdin, unmount } = renderDialog(settings, onSelect);
635
+ for (let i = 0; i < toggleCount; i++) {
636
+ act(() => {
637
+ stdin.write(TerminalKeys.ENTER);
638
+ });
639
+ }
640
+ await waitFor(() => {
641
+ expect(vi.mocked(saveModifiedSettings).mock.calls.length).toBeGreaterThan(0);
642
+ });
643
+ const calls = vi.mocked(saveModifiedSettings).mock.calls;
644
+ calls.forEach((call) => {
645
+ const [modifiedKeys, pendingSettings] = call;
646
+ if (modifiedKeys.has('tools.shell.showColor')) {
647
+ const shellSettings = pendingSettings.tools?.shell;
648
+ Object.entries(expectedSiblings).forEach(([key, value]) => {
649
+ expect(shellSettings?.[key]).toBe(value);
650
+ expect(modifiedKeys.has(`tools.shell.${key}`)).toBe(false);
651
+ });
652
+ expect(modifiedKeys.size).toBe(1);
653
+ }
654
+ });
655
+ expect(calls.length).toBeGreaterThan(0);
656
+ unmount();
657
+ });
658
+ });
602
659
  describe('Keyboard Shortcuts Edge Cases', () => {
603
660
  it('should handle rapid key presses gracefully', async () => {
604
661
  const settings = createMockSettings();
605
662
  const onSelect = vi.fn();
606
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
663
+ const { stdin, unmount } = renderDialog(settings, onSelect);
607
664
  // Rapid navigation
608
- for (let i = 0; i < 5; i++) {
609
- stdin.write(TerminalKeys.DOWN_ARROW);
610
- stdin.write(TerminalKeys.UP_ARROW);
611
- }
612
- await wait(100);
665
+ act(() => {
666
+ for (let i = 0; i < 5; i++) {
667
+ stdin.write(TerminalKeys.DOWN_ARROW);
668
+ stdin.write(TerminalKeys.UP_ARROW);
669
+ }
670
+ });
613
671
  // Should not crash
614
672
  unmount();
615
673
  });
616
- it('should handle Ctrl+C to reset current setting to default', async () => {
617
- const settings = createMockSettings({ vimMode: true }); // Start with vimMode enabled
618
- const onSelect = vi.fn();
619
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
620
- // Press Ctrl+C to reset current setting to default
621
- stdin.write('\u0003'); // Ctrl+C
622
- await wait();
623
- // Should reset the current setting to its default value
624
- unmount();
625
- });
626
- it('should handle Ctrl+L to reset current setting to default', async () => {
627
- const settings = createMockSettings({ vimMode: true }); // Start with vimMode enabled
674
+ it.each([
675
+ { key: 'Ctrl+C', code: '\u0003' },
676
+ { key: 'Ctrl+L', code: '\u000C' },
677
+ ])('should handle $key to reset current setting to default', async ({ code }) => {
678
+ const settings = createMockSettings({ vimMode: true });
628
679
  const onSelect = vi.fn();
629
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
630
- // Press Ctrl+L to reset current setting to default
631
- stdin.write('\u000C'); // Ctrl+L
632
- await wait();
680
+ const { stdin, unmount } = renderDialog(settings, onSelect);
681
+ act(() => {
682
+ stdin.write(code);
683
+ });
633
684
  // Should reset the current setting to its default value
634
685
  unmount();
635
686
  });
636
687
  it('should handle navigation when only one setting exists', async () => {
637
688
  const settings = createMockSettings();
638
689
  const onSelect = vi.fn();
639
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
690
+ const { stdin, unmount } = renderDialog(settings, onSelect);
640
691
  // Try to navigate when potentially at bounds
641
- stdin.write(TerminalKeys.DOWN_ARROW);
642
- await wait();
643
- stdin.write(TerminalKeys.UP_ARROW);
644
- await wait();
692
+ act(() => {
693
+ stdin.write(TerminalKeys.DOWN_ARROW);
694
+ stdin.write(TerminalKeys.UP_ARROW);
695
+ });
645
696
  unmount();
646
697
  });
647
698
  it('should properly handle Tab navigation between sections', async () => {
648
699
  const settings = createMockSettings();
649
700
  const onSelect = vi.fn();
650
- const { lastFrame, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
701
+ const { lastFrame, unmount } = renderDialog(settings, onSelect);
651
702
  // Wait for initial render
652
703
  await waitFor(() => {
653
704
  expect(lastFrame()).toContain('Vim Mode');
654
705
  });
655
706
  // Verify initial state: settings section active, scope section inactive
656
- expect(lastFrame()).toContain('Vim Mode'); // Settings section active
657
- expect(lastFrame()).toContain(' Apply To'); // Scope section inactive
707
+ expect(lastFrame()).toContain('Vim Mode'); // Settings section active
708
+ expect(lastFrame()).toContain('Apply To'); // Scope section (don't rely on exact spacing)
658
709
  // This test validates the rendered UI structure for tab navigation
659
710
  // Actual tab behavior testing is complex due to keypress handling
660
711
  unmount();
@@ -666,7 +717,7 @@ describe('SettingsDialog', () => {
666
717
  const settings = createMockSettings({ vimMode: null }, // Invalid value
667
718
  {}, {});
668
719
  const onSelect = vi.fn();
669
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
720
+ const { lastFrame } = renderDialog(settings, onSelect);
670
721
  // Should still render without crashing
671
722
  expect(lastFrame()).toContain('Settings');
672
723
  });
@@ -674,7 +725,7 @@ describe('SettingsDialog', () => {
674
725
  const settings = createMockSettings();
675
726
  const onSelect = vi.fn();
676
727
  // Should not crash even if some settings are missing definitions
677
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
728
+ const { lastFrame } = renderDialog(settings, onSelect);
678
729
  expect(lastFrame()).toContain('Settings');
679
730
  });
680
731
  });
@@ -682,17 +733,18 @@ describe('SettingsDialog', () => {
682
733
  it('should handle complete user workflow: navigate, toggle, change scope, exit', async () => {
683
734
  const settings = createMockSettings();
684
735
  const onSelect = vi.fn();
685
- const { lastFrame, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
736
+ const { lastFrame, unmount } = renderDialog(settings, onSelect);
686
737
  // Wait for initial render
687
738
  await waitFor(() => {
688
739
  expect(lastFrame()).toContain('Vim Mode');
689
740
  });
690
741
  // Verify the complete UI is rendered with all necessary sections
691
742
  expect(lastFrame()).toContain('Settings'); // Title
692
- expect(lastFrame()).toContain('Vim Mode'); // Active setting
743
+ expect(lastFrame()).toContain('Vim Mode'); // Active setting
693
744
  expect(lastFrame()).toContain('Apply To'); // Scope section
694
745
  expect(lastFrame()).toContain('User Settings'); // Scope options (no numbers when settings focused)
695
- expect(lastFrame()).toContain('(Use Enter to select, Tab to change focus)'); // Help text
746
+ // Use regex for more flexible help text matching
747
+ expect(lastFrame()).toMatch(/Enter.*select.*Tab.*focus.*Esc.*close/);
696
748
  // This test validates the complete UI structure is available for user workflow
697
749
  // Individual interactions are tested in focused unit tests
698
750
  unmount();
@@ -700,20 +752,15 @@ describe('SettingsDialog', () => {
700
752
  it('should allow changing multiple settings without losing pending changes', async () => {
701
753
  const settings = createMockSettings();
702
754
  const onSelect = vi.fn();
703
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
704
- // Toggle first setting (should require restart)
705
- stdin.write(TerminalKeys.ENTER); // Enter
706
- await wait();
707
- // Navigate to next setting and toggle it (should not require restart - e.g., vimMode)
708
- stdin.write(TerminalKeys.DOWN_ARROW); // Down
709
- await wait();
710
- stdin.write(TerminalKeys.ENTER); // Enter
711
- await wait();
712
- // Navigate to another setting and toggle it (should also require restart)
713
- stdin.write(TerminalKeys.DOWN_ARROW); // Down
714
- await wait();
715
- stdin.write(TerminalKeys.ENTER); // Enter
716
- await wait();
755
+ const { stdin, unmount } = renderDialog(settings, onSelect);
756
+ // Toggle multiple settings
757
+ act(() => {
758
+ stdin.write(TerminalKeys.ENTER); // Enter
759
+ stdin.write(TerminalKeys.DOWN_ARROW); // Down
760
+ stdin.write(TerminalKeys.ENTER); // Enter
761
+ stdin.write(TerminalKeys.DOWN_ARROW); // Down
762
+ stdin.write(TerminalKeys.ENTER); // Enter
763
+ });
717
764
  // The test verifies that all changes are preserved and the dialog still works
718
765
  // This tests the fix for the bug where changing one setting would reset all pending changes
719
766
  unmount();
@@ -721,28 +768,28 @@ describe('SettingsDialog', () => {
721
768
  it('should maintain state consistency during complex interactions', async () => {
722
769
  const settings = createMockSettings({ vimMode: true });
723
770
  const onSelect = vi.fn();
724
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
771
+ const { stdin, unmount } = renderDialog(settings, onSelect);
725
772
  // Multiple scope changes
726
- stdin.write(TerminalKeys.TAB); // Tab to scope
727
- await wait();
728
- stdin.write('2'); // Workspace
729
- await wait();
730
- stdin.write(TerminalKeys.TAB); // Tab to settings
731
- await wait();
732
- stdin.write(TerminalKeys.TAB); // Tab to scope
733
- await wait();
734
- stdin.write('1'); // User
735
- await wait();
773
+ act(() => {
774
+ stdin.write(TerminalKeys.TAB); // Tab to scope
775
+ stdin.write('2'); // Workspace
776
+ stdin.write(TerminalKeys.TAB); // Tab to settings
777
+ stdin.write(TerminalKeys.TAB); // Tab to scope
778
+ stdin.write('1'); // User
779
+ });
736
780
  // Should maintain consistent state
737
781
  unmount();
738
782
  });
739
783
  it('should handle restart workflow correctly', async () => {
740
784
  const settings = createMockSettings();
741
785
  const onRestartRequest = vi.fn();
742
- const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: () => { }, onRestartRequest: onRestartRequest }) }));
786
+ const { stdin, unmount } = renderDialog(settings, vi.fn(), {
787
+ onRestartRequest,
788
+ });
743
789
  // This would test the restart workflow if we could trigger it
744
- stdin.write('r'); // Try restart key
745
- await wait();
790
+ act(() => {
791
+ stdin.write('r'); // Try restart key
792
+ });
746
793
  // Without restart prompt showing, this should have no effect
747
794
  expect(onRestartRequest).not.toHaveBeenCalled();
748
795
  unmount();
@@ -753,282 +800,244 @@ describe('SettingsDialog', () => {
753
800
  let settings = createMockSettings({ 'a.string.setting': 'initial' });
754
801
  const onSelect = vi.fn();
755
802
  const { stdin, unmount, rerender } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
756
- // Wait for the dialog to render
757
- await wait();
758
803
  // Navigate to the last setting
759
- for (let i = 0; i < 20; i++) {
760
- stdin.write('j'); // Down
761
- await wait(10);
762
- }
763
- // Press Enter to start editing
764
- stdin.write('\r');
765
- await wait();
766
- // Type a new value
767
- stdin.write('new value');
768
- await wait();
769
- // Press Enter to commit
770
- stdin.write('\r');
771
- await wait();
804
+ act(() => {
805
+ for (let i = 0; i < 20; i++) {
806
+ stdin.write('j'); // Down
807
+ }
808
+ });
809
+ // Press Enter to start editing, type new value, and commit
810
+ act(() => {
811
+ stdin.write('\r'); // Start editing
812
+ stdin.write('new value');
813
+ stdin.write('\r'); // Commit
814
+ });
772
815
  settings = createMockSettings({ 'a.string.setting': 'new value' }, {}, {});
773
816
  rerender(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
774
- await wait();
775
817
  // Press Escape to exit
776
- stdin.write('\u001B');
777
- await wait();
778
- expect(onSelect).toHaveBeenCalledWith(undefined, 'User');
818
+ act(() => {
819
+ stdin.write('\u001B');
820
+ });
821
+ await waitFor(() => {
822
+ expect(onSelect).toHaveBeenCalledWith(undefined, 'User');
823
+ });
779
824
  unmount();
780
825
  });
781
826
  });
782
827
  describe('Snapshot Tests', () => {
783
828
  /**
784
829
  * Snapshot tests for SettingsDialog component using ink-testing-library.
785
- * These tests capture the visual output of the component in various states:
786
- *
787
- * - Default rendering with no custom settings
788
- * - Various combinations of boolean settings (enabled/disabled)
789
- * - Mixed boolean and number settings configurations
790
- * - Different focus states (settings vs scope selector)
791
- * - Different scope selections (User, System, Workspace)
792
- * - Accessibility settings enabled
793
- * - File filtering configurations
794
- * - Tools and security settings
795
- * - All settings disabled state
796
- *
830
+ * These tests capture the visual output of the component in various states.
797
831
  * The snapshots help ensure UI consistency and catch unintended visual changes.
798
832
  */
799
- it('should render default state correctly', () => {
800
- const settings = createMockSettings();
801
- const onSelect = vi.fn();
802
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
803
- expect(lastFrame()).toMatchSnapshot();
804
- });
805
- it('should render with various boolean settings enabled', () => {
806
- const settings = createMockSettings({
807
- general: {
808
- vimMode: true,
809
- disableAutoUpdate: true,
810
- debugKeystrokeLogging: true,
811
- enablePromptCompletion: true,
812
- },
813
- ui: {
814
- hideWindowTitle: true,
815
- hideTips: true,
816
- showMemoryUsage: true,
817
- showLineNumbers: true,
818
- showCitations: true,
819
- accessibility: {
820
- disableLoadingPhrases: true,
821
- screenReader: true,
833
+ it.each([
834
+ {
835
+ name: 'default state',
836
+ userSettings: {},
837
+ systemSettings: {},
838
+ workspaceSettings: {},
839
+ stdinActions: undefined,
840
+ },
841
+ {
842
+ name: 'various boolean settings enabled',
843
+ userSettings: {
844
+ general: {
845
+ vimMode: true,
846
+ disableAutoUpdate: true,
847
+ debugKeystrokeLogging: true,
848
+ enablePromptCompletion: true,
822
849
  },
823
- },
824
- ide: {
825
- enabled: true,
826
- },
827
- context: {
828
- loadMemoryFromIncludeDirectories: true,
829
- fileFiltering: {
830
- respectGitIgnore: true,
831
- respectGeminiIgnore: true,
832
- enableRecursiveFileSearch: true,
833
- disableFuzzySearch: false,
850
+ ui: {
851
+ hideWindowTitle: true,
852
+ hideTips: true,
853
+ showMemoryUsage: true,
854
+ showLineNumbers: true,
855
+ showCitations: true,
856
+ accessibility: {
857
+ disableLoadingPhrases: true,
858
+ screenReader: true,
859
+ },
834
860
  },
835
- },
836
- tools: {
837
- enableInteractiveShell: true,
838
- autoAccept: true,
839
- useRipgrep: true,
840
- },
841
- security: {
842
- folderTrust: {
861
+ ide: {
843
862
  enabled: true,
844
863
  },
864
+ context: {
865
+ loadMemoryFromIncludeDirectories: true,
866
+ fileFiltering: {
867
+ respectGitIgnore: true,
868
+ respectGeminiIgnore: true,
869
+ enableRecursiveFileSearch: true,
870
+ disableFuzzySearch: false,
871
+ },
872
+ },
873
+ tools: {
874
+ enableInteractiveShell: true,
875
+ autoAccept: true,
876
+ useRipgrep: true,
877
+ },
878
+ security: {
879
+ folderTrust: {
880
+ enabled: true,
881
+ },
882
+ },
845
883
  },
846
- });
847
- const onSelect = vi.fn();
848
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
849
- expect(lastFrame()).toMatchSnapshot();
850
- });
851
- it('should render with mixed boolean and number settings', () => {
852
- const settings = createMockSettings({
853
- general: {
854
- vimMode: false,
855
- disableAutoUpdate: true,
856
- },
857
- ui: {
858
- showMemoryUsage: true,
859
- hideWindowTitle: false,
860
- },
861
- tools: {
862
- truncateToolOutputThreshold: 50000,
863
- truncateToolOutputLines: 1000,
864
- },
865
- context: {
866
- discoveryMaxDirs: 500,
867
- },
868
- model: {
869
- maxSessionTurns: 100,
870
- skipNextSpeakerCheck: false,
871
- },
872
- });
873
- const onSelect = vi.fn();
874
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
875
- expect(lastFrame()).toMatchSnapshot();
876
- });
877
- it('should render focused on scope selector', () => {
878
- const settings = createMockSettings();
879
- const onSelect = vi.fn();
880
- const { lastFrame, stdin } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
881
- // Switch focus to scope selector with Tab
882
- stdin.write('\t');
883
- expect(lastFrame()).toMatchSnapshot();
884
- });
885
- it('should render with different scope selected (System)', () => {
886
- const settings = createMockSettings({}, // userSettings
884
+ systemSettings: {},
885
+ workspaceSettings: {},
886
+ stdinActions: undefined,
887
+ },
887
888
  {
888
- // systemSettings
889
- general: {
890
- vimMode: true,
891
- disableAutoUpdate: false,
892
- },
893
- ui: {
894
- showMemoryUsage: true,
889
+ name: 'mixed boolean and number settings',
890
+ userSettings: {
891
+ general: {
892
+ vimMode: false,
893
+ disableAutoUpdate: true,
894
+ },
895
+ ui: {
896
+ showMemoryUsage: true,
897
+ hideWindowTitle: false,
898
+ },
899
+ tools: {
900
+ truncateToolOutputThreshold: 50000,
901
+ truncateToolOutputLines: 1000,
902
+ },
903
+ context: {
904
+ discoveryMaxDirs: 500,
905
+ },
906
+ model: {
907
+ maxSessionTurns: 100,
908
+ skipNextSpeakerCheck: false,
909
+ },
895
910
  },
896
- });
897
- const onSelect = vi.fn();
898
- const { lastFrame, stdin } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
899
- // Switch to scope selector
900
- stdin.write('\t');
901
- // Navigate to System scope
902
- stdin.write('ArrowDown');
903
- stdin.write('\r'); // Enter to select
904
- expect(lastFrame()).toMatchSnapshot();
905
- });
906
- it('should render with different scope selected (Workspace)', () => {
907
- const settings = createMockSettings({}, // userSettings
908
- {}, // systemSettings
911
+ systemSettings: {},
912
+ workspaceSettings: {},
913
+ stdinActions: undefined,
914
+ },
909
915
  {
910
- // workspaceSettings
911
- general: {
912
- vimMode: false,
913
- debugKeystrokeLogging: true,
914
- },
915
- tools: {
916
- useRipgrep: true,
917
- enableInteractiveShell: false,
916
+ name: 'focused on scope selector',
917
+ userSettings: {},
918
+ systemSettings: {},
919
+ workspaceSettings: {},
920
+ stdinActions: (stdin) => {
921
+ act(() => {
922
+ stdin.write('\t');
923
+ });
918
924
  },
919
- });
920
- const onSelect = vi.fn();
921
- const { lastFrame, stdin } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
922
- // Switch to scope selector
923
- stdin.write('\t');
924
- // Navigate to Workspace scope (down twice)
925
- stdin.write('ArrowDown');
926
- stdin.write('ArrowDown');
927
- stdin.write('\r'); // Enter to select
928
- expect(lastFrame()).toMatchSnapshot();
929
- });
930
- it('should render with accessibility settings enabled', () => {
931
- const settings = createMockSettings({
932
- ui: {
933
- accessibility: {
934
- disableLoadingPhrases: true,
935
- screenReader: true,
925
+ },
926
+ {
927
+ name: 'accessibility settings enabled',
928
+ userSettings: {
929
+ ui: {
930
+ accessibility: {
931
+ disableLoadingPhrases: true,
932
+ screenReader: true,
933
+ },
934
+ showMemoryUsage: true,
935
+ showLineNumbers: true,
936
936
  },
937
- showMemoryUsage: true,
938
- showLineNumbers: true,
939
- },
940
- general: {
941
- vimMode: true,
942
- },
943
- });
944
- const onSelect = vi.fn();
945
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
946
- expect(lastFrame()).toMatchSnapshot();
947
- });
948
- it('should render with file filtering settings configured', () => {
949
- const settings = createMockSettings({
950
- context: {
951
- fileFiltering: {
952
- respectGitIgnore: false,
953
- respectGeminiIgnore: true,
954
- enableRecursiveFileSearch: false,
955
- disableFuzzySearch: true,
937
+ general: {
938
+ vimMode: true,
956
939
  },
957
- loadMemoryFromIncludeDirectories: true,
958
- discoveryMaxDirs: 100,
959
940
  },
960
- });
961
- const onSelect = vi.fn();
962
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
963
- expect(lastFrame()).toMatchSnapshot();
964
- });
965
- it('should render with tools and security settings', () => {
966
- const settings = createMockSettings({
967
- tools: {
968
- enableInteractiveShell: true,
969
- autoAccept: false,
970
- useRipgrep: true,
971
- truncateToolOutputThreshold: 25000,
972
- truncateToolOutputLines: 500,
973
- },
974
- security: {
975
- folderTrust: {
976
- enabled: true,
941
+ systemSettings: {},
942
+ workspaceSettings: {},
943
+ stdinActions: undefined,
944
+ },
945
+ {
946
+ name: 'file filtering settings configured',
947
+ userSettings: {
948
+ context: {
949
+ fileFiltering: {
950
+ respectGitIgnore: false,
951
+ respectGeminiIgnore: true,
952
+ enableRecursiveFileSearch: false,
953
+ disableFuzzySearch: true,
954
+ },
955
+ loadMemoryFromIncludeDirectories: true,
956
+ discoveryMaxDirs: 100,
977
957
  },
978
958
  },
979
- model: {
980
- maxSessionTurns: 50,
981
- skipNextSpeakerCheck: true,
982
- },
983
- });
984
- const onSelect = vi.fn();
985
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
986
- expect(lastFrame()).toMatchSnapshot();
987
- });
988
- it('should render with all boolean settings disabled', () => {
989
- const settings = createMockSettings({
990
- general: {
991
- vimMode: false,
992
- disableAutoUpdate: false,
993
- debugKeystrokeLogging: false,
994
- enablePromptCompletion: false,
995
- },
996
- ui: {
997
- hideWindowTitle: false,
998
- hideTips: false,
999
- showMemoryUsage: false,
1000
- showLineNumbers: false,
1001
- showCitations: false,
1002
- accessibility: {
1003
- disableLoadingPhrases: false,
1004
- screenReader: false,
959
+ systemSettings: {},
960
+ workspaceSettings: {},
961
+ stdinActions: undefined,
962
+ },
963
+ {
964
+ name: 'tools and security settings',
965
+ userSettings: {
966
+ tools: {
967
+ enableInteractiveShell: true,
968
+ autoAccept: false,
969
+ useRipgrep: true,
970
+ truncateToolOutputThreshold: 25000,
971
+ truncateToolOutputLines: 500,
1005
972
  },
1006
- },
1007
- ide: {
1008
- enabled: false,
1009
- },
1010
- context: {
1011
- loadMemoryFromIncludeDirectories: false,
1012
- fileFiltering: {
1013
- respectGitIgnore: false,
1014
- respectGeminiIgnore: false,
1015
- enableRecursiveFileSearch: false,
1016
- disableFuzzySearch: false,
973
+ security: {
974
+ folderTrust: {
975
+ enabled: true,
976
+ },
977
+ },
978
+ model: {
979
+ maxSessionTurns: 50,
980
+ skipNextSpeakerCheck: true,
1017
981
  },
1018
982
  },
1019
- tools: {
1020
- enableInteractiveShell: false,
1021
- autoAccept: false,
1022
- useRipgrep: false,
1023
- },
1024
- security: {
1025
- folderTrust: {
983
+ systemSettings: {},
984
+ workspaceSettings: {},
985
+ stdinActions: undefined,
986
+ },
987
+ {
988
+ name: 'all boolean settings disabled',
989
+ userSettings: {
990
+ general: {
991
+ vimMode: false,
992
+ disableAutoUpdate: false,
993
+ debugKeystrokeLogging: false,
994
+ enablePromptCompletion: false,
995
+ },
996
+ ui: {
997
+ hideWindowTitle: false,
998
+ hideTips: false,
999
+ showMemoryUsage: false,
1000
+ showLineNumbers: false,
1001
+ showCitations: false,
1002
+ accessibility: {
1003
+ disableLoadingPhrases: false,
1004
+ screenReader: false,
1005
+ },
1006
+ },
1007
+ ide: {
1026
1008
  enabled: false,
1027
1009
  },
1010
+ context: {
1011
+ loadMemoryFromIncludeDirectories: false,
1012
+ fileFiltering: {
1013
+ respectGitIgnore: false,
1014
+ respectGeminiIgnore: false,
1015
+ enableRecursiveFileSearch: false,
1016
+ disableFuzzySearch: false,
1017
+ },
1018
+ },
1019
+ tools: {
1020
+ enableInteractiveShell: false,
1021
+ autoAccept: false,
1022
+ useRipgrep: false,
1023
+ },
1024
+ security: {
1025
+ folderTrust: {
1026
+ enabled: false,
1027
+ },
1028
+ },
1028
1029
  },
1029
- });
1030
+ systemSettings: {},
1031
+ workspaceSettings: {},
1032
+ stdinActions: undefined,
1033
+ },
1034
+ ])('should render $name correctly', ({ userSettings, systemSettings, workspaceSettings, stdinActions }) => {
1035
+ const settings = createMockSettings(userSettings, systemSettings, workspaceSettings);
1030
1036
  const onSelect = vi.fn();
1031
- const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
1037
+ const { lastFrame, stdin } = renderDialog(settings, onSelect);
1038
+ if (stdinActions) {
1039
+ stdinActions(stdin);
1040
+ }
1032
1041
  expect(lastFrame()).toMatchSnapshot();
1033
1042
  });
1034
1043
  });