@machina.ai/cell-cli 1.4.0-rc2 → 1.6.1-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 (492) hide show
  1. package/dist/package.json +12 -8
  2. package/dist/src/commands/extensions/disable.d.ts +2 -3
  3. package/dist/src/commands/extensions/disable.js +20 -6
  4. package/dist/src/commands/extensions/disable.js.map +1 -1
  5. package/dist/src/commands/extensions/enable.d.ts +2 -3
  6. package/dist/src/commands/extensions/enable.js +20 -9
  7. package/dist/src/commands/extensions/enable.js.map +1 -1
  8. package/dist/src/commands/extensions/install.d.ts +2 -0
  9. package/dist/src/commands/extensions/install.js +20 -4
  10. package/dist/src/commands/extensions/install.js.map +1 -1
  11. package/dist/src/commands/extensions/install.test.js +80 -3
  12. package/dist/src/commands/extensions/install.test.js.map +1 -1
  13. package/dist/src/commands/extensions/link.js +1 -1
  14. package/dist/src/commands/extensions/link.js.map +1 -1
  15. package/dist/src/commands/extensions/uninstall.js +1 -1
  16. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  17. package/dist/src/commands/extensions/update.js +42 -11
  18. package/dist/src/commands/extensions/update.js.map +1 -1
  19. package/dist/src/config/config.d.ts +2 -1
  20. package/dist/src/config/config.js +33 -16
  21. package/dist/src/config/config.js.map +1 -1
  22. package/dist/src/config/extension.d.ts +10 -14
  23. package/dist/src/config/extension.js +160 -145
  24. package/dist/src/config/extension.js.map +1 -1
  25. package/dist/src/config/extensions/extensionEnablement.d.ts +44 -0
  26. package/dist/src/config/extensions/extensionEnablement.js +161 -0
  27. package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
  28. package/dist/src/config/extensions/extensionEnablement.test.js +261 -0
  29. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
  30. package/dist/src/config/extensions/github.d.ts +29 -0
  31. package/dist/src/config/extensions/github.js +306 -0
  32. package/dist/src/config/extensions/github.js.map +1 -0
  33. package/dist/src/config/extensions/github.test.d.ts +6 -0
  34. package/dist/src/config/extensions/github.test.js +267 -0
  35. package/dist/src/config/extensions/github.test.js.map +1 -0
  36. package/dist/src/config/extensions/update.d.ts +20 -0
  37. package/dist/src/config/extensions/update.js +94 -0
  38. package/dist/src/config/extensions/update.js.map +1 -0
  39. package/dist/src/config/extensions/update.test.d.ts +6 -0
  40. package/dist/src/config/extensions/update.test.js +324 -0
  41. package/dist/src/config/extensions/update.test.js.map +1 -0
  42. package/dist/src/config/extensions/variableSchema.d.ts +8 -0
  43. package/dist/src/config/extensions/variableSchema.js +4 -0
  44. package/dist/src/config/extensions/variableSchema.js.map +1 -1
  45. package/dist/src/config/keyBindings.d.ts +4 -1
  46. package/dist/src/config/keyBindings.js +8 -0
  47. package/dist/src/config/keyBindings.js.map +1 -1
  48. package/dist/src/config/settings.d.ts +3 -0
  49. package/dist/src/config/settings.js +58 -18
  50. package/dist/src/config/settings.js.map +1 -1
  51. package/dist/src/config/settingsSchema.d.ts +121 -12
  52. package/dist/src/config/settingsSchema.js +112 -9
  53. package/dist/src/config/settingsSchema.js.map +1 -1
  54. package/dist/src/config/settingsSchema.test.js +68 -55
  55. package/dist/src/config/settingsSchema.test.js.map +1 -1
  56. package/dist/src/config/trustedFolders.d.ts +1 -1
  57. package/dist/src/config/trustedFolders.js +9 -4
  58. package/dist/src/config/trustedFolders.js.map +1 -1
  59. package/dist/src/config/trustedFolders.test.js +41 -25
  60. package/dist/src/config/trustedFolders.test.js.map +1 -1
  61. package/dist/src/core/auth.d.ts +13 -0
  62. package/dist/src/core/auth.js +27 -0
  63. package/dist/src/core/auth.js.map +1 -0
  64. package/dist/src/core/initializer.d.ts +21 -0
  65. package/dist/src/core/initializer.js +33 -0
  66. package/dist/src/core/initializer.js.map +1 -0
  67. package/dist/src/core/theme.d.ts +12 -0
  68. package/dist/src/core/theme.js +20 -0
  69. package/dist/src/core/theme.js.map +1 -0
  70. package/dist/src/gemini.d.ts +2 -1
  71. package/dist/src/gemini.js +110 -69
  72. package/dist/src/gemini.js.map +1 -1
  73. package/dist/src/gemini.test.js +124 -14
  74. package/dist/src/gemini.test.js.map +1 -1
  75. package/dist/src/generated/git-commit.d.ts +2 -2
  76. package/dist/src/generated/git-commit.js +2 -2
  77. package/dist/src/generated/git-commit.js.map +1 -1
  78. package/dist/src/nonInteractiveCli.js +87 -71
  79. package/dist/src/nonInteractiveCli.js.map +1 -1
  80. package/dist/src/services/BuiltinCommandLoader.test.js +16 -17
  81. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
  82. package/dist/src/services/FeedbackService.d.ts +21 -0
  83. package/dist/src/services/FeedbackService.js +124 -0
  84. package/dist/src/services/FeedbackService.js.map +1 -0
  85. package/dist/src/services/McpPromptLoader.js +43 -8
  86. package/dist/src/services/McpPromptLoader.js.map +1 -1
  87. package/dist/src/services/McpPromptLoader.test.js +228 -1
  88. package/dist/src/services/McpPromptLoader.test.js.map +1 -1
  89. package/dist/src/services/prompt-processors/shellProcessor.js +8 -1
  90. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
  91. package/dist/src/test-utils/createExtension.d.ts +15 -0
  92. package/dist/src/test-utils/createExtension.js +25 -0
  93. package/dist/src/test-utils/createExtension.js.map +1 -0
  94. package/dist/src/test-utils/mockCommandContext.js +2 -0
  95. package/dist/src/test-utils/mockCommandContext.js.map +1 -1
  96. package/dist/src/ui/App.d.ts +1 -10
  97. package/dist/src/ui/App.js +17 -729
  98. package/dist/src/ui/App.js.map +1 -1
  99. package/dist/src/ui/AppContainer.d.ts +17 -0
  100. package/dist/src/ui/AppContainer.js +905 -0
  101. package/dist/src/ui/AppContainer.js.map +1 -0
  102. package/dist/src/ui/AppContainer.test.d.ts +6 -0
  103. package/dist/src/ui/AppContainer.test.js +422 -0
  104. package/dist/src/ui/AppContainer.test.js.map +1 -0
  105. package/dist/src/ui/IdeIntegrationNudge.js +2 -1
  106. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
  107. package/dist/src/ui/auth/AuthDialog.d.ts +18 -0
  108. package/dist/src/ui/auth/AuthDialog.js +81 -0
  109. package/dist/src/ui/auth/AuthDialog.js.map +1 -0
  110. package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
  111. package/dist/src/ui/auth/AuthDialog.test.js +176 -0
  112. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
  113. package/dist/src/ui/{components → auth}/AuthInProgress.js +2 -2
  114. package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
  115. package/dist/src/ui/auth/useAuth.d.ts +15 -0
  116. package/dist/src/ui/auth/useAuth.js +73 -0
  117. package/dist/src/ui/auth/useAuth.js.map +1 -0
  118. package/dist/src/ui/commands/chatCommand.d.ts +2 -0
  119. package/dist/src/ui/commands/chatCommand.js +82 -3
  120. package/dist/src/ui/commands/chatCommand.js.map +1 -1
  121. package/dist/src/ui/commands/corgiCommand.js +1 -0
  122. package/dist/src/ui/commands/corgiCommand.js.map +1 -1
  123. package/dist/src/ui/commands/extensionsCommand.js +86 -16
  124. package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
  125. package/dist/src/ui/commands/ideCommand.js +2 -2
  126. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  127. package/dist/src/ui/commands/mcpCommand.js +1 -1
  128. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  129. package/dist/src/ui/commands/types.d.ts +5 -1
  130. package/dist/src/ui/commands/types.js +0 -1
  131. package/dist/src/ui/commands/types.js.map +1 -1
  132. package/dist/src/ui/components/AboutBox.js +2 -2
  133. package/dist/src/ui/components/AboutBox.js.map +1 -1
  134. package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
  135. package/dist/src/ui/components/AnsiOutput.js +12 -0
  136. package/dist/src/ui/components/AnsiOutput.js.map +1 -0
  137. package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
  138. package/dist/src/ui/components/AnsiOutput.test.js +97 -0
  139. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
  140. package/dist/src/ui/components/AppHeader.d.ts +10 -0
  141. package/dist/src/ui/components/AppHeader.js +22 -0
  142. package/dist/src/ui/components/AppHeader.js.map +1 -0
  143. package/dist/src/ui/components/AsciiArt.d.ts +3 -3
  144. package/dist/src/ui/components/AsciiArt.js +3 -3
  145. package/dist/src/ui/components/AutoAcceptIndicator.js +4 -4
  146. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
  147. package/dist/src/ui/components/Composer.d.ts +6 -0
  148. package/dist/src/ui/components/Composer.js +74 -0
  149. package/dist/src/ui/components/Composer.js.map +1 -0
  150. package/dist/src/ui/components/Composer.test.d.ts +6 -0
  151. package/dist/src/ui/components/Composer.test.js +340 -0
  152. package/dist/src/ui/components/Composer.test.js.map +1 -0
  153. package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
  154. package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
  155. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
  156. package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
  157. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
  158. package/dist/src/ui/components/ContextSummaryDisplay.js +3 -3
  159. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  160. package/dist/src/ui/components/ContextUsageDisplay.js +2 -2
  161. package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
  162. package/dist/src/ui/components/DebugProfiler.js +2 -2
  163. package/dist/src/ui/components/DebugProfiler.js.map +1 -1
  164. package/dist/src/ui/components/DetailedMessagesDisplay.js +7 -7
  165. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
  166. package/dist/src/ui/components/DialogManager.d.ts +6 -0
  167. package/dist/src/ui/components/DialogManager.js +85 -0
  168. package/dist/src/ui/components/DialogManager.js.map +1 -0
  169. package/dist/src/ui/components/EditorSettingsDialog.js +5 -5
  170. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
  171. package/dist/src/ui/components/FolderTrustDialog.js +16 -8
  172. package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
  173. package/dist/src/ui/components/FolderTrustDialog.test.js +18 -8
  174. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
  175. package/dist/src/ui/components/Footer.d.ts +1 -2
  176. package/dist/src/ui/components/Footer.js +6 -2
  177. package/dist/src/ui/components/Footer.js.map +1 -1
  178. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +5 -0
  179. package/dist/src/ui/components/GeminiRespondingSpinner.js +7 -2
  180. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
  181. package/dist/src/ui/components/Header.js +2 -2
  182. package/dist/src/ui/components/Header.js.map +1 -1
  183. package/dist/src/ui/components/Help.d.ts +1 -1
  184. package/dist/src/ui/components/Help.js +9 -6
  185. package/dist/src/ui/components/Help.js.map +1 -1
  186. package/dist/src/ui/components/Help.test.d.ts +6 -0
  187. package/dist/src/ui/components/Help.test.js +57 -0
  188. package/dist/src/ui/components/Help.test.js.map +1 -0
  189. package/dist/src/ui/components/HistoryItemDisplay.d.ts +2 -2
  190. package/dist/src/ui/components/HistoryItemDisplay.js +2 -1
  191. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  192. package/dist/src/ui/components/InputPrompt.d.ts +3 -0
  193. package/dist/src/ui/components/InputPrompt.js +122 -22
  194. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  195. package/dist/src/ui/components/LoadingIndicator.js +2 -2
  196. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  197. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
  198. package/dist/src/ui/components/LoopDetectionConfirmation.js +35 -0
  199. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
  200. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
  201. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +25 -0
  202. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
  203. package/dist/src/ui/components/MainContent.d.ts +6 -0
  204. package/dist/src/ui/components/MainContent.js +23 -0
  205. package/dist/src/ui/components/MainContent.js.map +1 -0
  206. package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
  207. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
  208. package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
  209. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
  210. package/dist/src/ui/components/Notifications.d.ts +6 -0
  211. package/dist/src/ui/components/Notifications.js +23 -0
  212. package/dist/src/ui/components/Notifications.js.map +1 -0
  213. package/dist/src/ui/components/PrepareLabel.d.ts +5 -5
  214. package/dist/src/ui/components/PrepareLabel.js +67 -11
  215. package/dist/src/ui/components/PrepareLabel.js.map +1 -1
  216. package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
  217. package/dist/src/ui/components/PrepareLabel.test.js +71 -0
  218. package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
  219. package/dist/src/ui/components/ProQuotaDialog.d.ts +2 -2
  220. package/dist/src/ui/components/ProQuotaDialog.js +3 -3
  221. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
  222. package/dist/src/ui/components/ProQuotaDialog.test.js +3 -3
  223. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
  224. package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
  225. package/dist/src/ui/components/QuittingDisplay.js +20 -0
  226. package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
  227. package/dist/src/ui/components/RatingWidget.d.ts +14 -0
  228. package/dist/src/ui/components/RatingWidget.js +56 -0
  229. package/dist/src/ui/components/RatingWidget.js.map +1 -0
  230. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +4 -0
  231. package/dist/src/ui/components/SessionSummaryDisplay.js +1 -1
  232. package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
  233. package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
  234. package/dist/src/ui/components/SettingsDialog.js +93 -22
  235. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  236. package/dist/src/ui/components/SettingsDialog.test.js +435 -79
  237. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  238. package/dist/src/ui/components/ShellConfirmationDialog.js +2 -2
  239. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
  240. package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
  241. package/dist/src/ui/components/ShellInputPrompt.js +36 -0
  242. package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
  243. package/dist/src/ui/components/ShellModeIndicator.js +2 -2
  244. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
  245. package/dist/src/ui/components/ShowMoreLines.js +2 -2
  246. package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
  247. package/dist/src/ui/components/StatsDisplay.d.ts +4 -0
  248. package/dist/src/ui/components/StatsDisplay.js +10 -7
  249. package/dist/src/ui/components/StatsDisplay.js.map +1 -1
  250. package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
  251. package/dist/src/ui/components/SuggestionsDisplay.js +17 -17
  252. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  253. package/dist/src/ui/components/ThemeDialog.js +12 -29
  254. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  255. package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
  256. package/dist/src/ui/components/ThemeDialog.test.js +75 -0
  257. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
  258. package/dist/src/ui/components/Tips.js +2 -2
  259. package/dist/src/ui/components/Tips.js.map +1 -1
  260. package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
  261. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
  262. package/dist/src/ui/components/UpdateNotification.js +2 -2
  263. package/dist/src/ui/components/UpdateNotification.js.map +1 -1
  264. package/dist/src/ui/components/WorkspaceMigrationDialog.js +4 -4
  265. package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -1
  266. package/dist/src/ui/components/messages/CompressionMessage.d.ts +1 -2
  267. package/dist/src/ui/components/messages/CompressionMessage.js +37 -8
  268. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
  269. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
  270. package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
  271. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
  272. package/dist/src/ui/components/messages/DiffRenderer.d.ts +2 -1
  273. package/dist/src/ui/components/messages/DiffRenderer.js +14 -22
  274. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
  275. package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
  276. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
  277. package/dist/src/ui/components/messages/GeminiMessage.js +2 -2
  278. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
  279. package/dist/src/ui/components/messages/InfoMessage.js +2 -2
  280. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
  281. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +31 -19
  282. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  283. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -2
  284. package/dist/src/ui/components/messages/ToolGroupMessage.js +17 -9
  285. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  286. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +17 -15
  287. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
  288. package/dist/src/ui/components/messages/ToolMessage.d.ts +4 -0
  289. package/dist/src/ui/components/messages/ToolMessage.js +24 -10
  290. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  291. package/dist/src/ui/components/messages/ToolMessage.test.js +33 -1
  292. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
  293. package/dist/src/ui/components/messages/UserMessage.js +3 -3
  294. package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
  295. package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
  296. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
  297. package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
  298. package/dist/src/ui/components/shared/EnumSelector.js +44 -0
  299. package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
  300. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
  301. package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
  302. package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
  303. package/dist/src/ui/components/shared/MaxSizedBox.js +2 -2
  304. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
  305. package/dist/src/ui/components/shared/RadioButtonSelect.js +12 -12
  306. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
  307. package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
  308. package/dist/src/ui/components/shared/ScopeSelector.js +11 -0
  309. package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
  310. package/dist/src/ui/components/shared/text-buffer.d.ts +19 -2
  311. package/dist/src/ui/components/shared/text-buffer.js +191 -133
  312. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  313. package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
  314. package/dist/src/ui/components/views/ExtensionsList.js +47 -0
  315. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
  316. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
  317. package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
  318. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
  319. package/dist/src/ui/constants.d.ts +1 -0
  320. package/dist/src/ui/constants.js +1 -0
  321. package/dist/src/ui/constants.js.map +1 -1
  322. package/dist/src/ui/contexts/AppContext.d.ts +11 -0
  323. package/dist/src/ui/contexts/AppContext.js +15 -0
  324. package/dist/src/ui/contexts/AppContext.js.map +1 -0
  325. package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
  326. package/dist/src/ui/contexts/ConfigContext.js +16 -0
  327. package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
  328. package/dist/src/ui/contexts/KeypressContext.d.ts +3 -0
  329. package/dist/src/ui/contexts/KeypressContext.js +51 -2
  330. package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
  331. package/dist/src/ui/contexts/KeypressContext.test.js +173 -1
  332. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
  333. package/dist/src/ui/contexts/UIActionsContext.d.ts +36 -0
  334. package/dist/src/ui/contexts/UIActionsContext.js +20 -0
  335. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
  336. package/dist/src/ui/contexts/UIStateContext.d.ts +103 -0
  337. package/dist/src/ui/contexts/UIStateContext.js +15 -0
  338. package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
  339. package/dist/src/ui/hooks/atCommandProcessor.test.js +7 -5
  340. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
  341. package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
  342. package/dist/src/ui/hooks/keyToAnsi.js +67 -0
  343. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
  344. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
  345. package/dist/src/ui/hooks/shellCommandProcessor.js +60 -15
  346. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  347. package/dist/src/ui/hooks/shellCommandProcessor.test.js +196 -17
  348. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
  349. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +16 -2
  350. package/dist/src/ui/hooks/slashCommandProcessor.js +28 -70
  351. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  352. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +3 -2
  353. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +9 -5
  354. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
  355. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +69 -0
  356. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
  357. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +12 -0
  358. package/dist/src/ui/hooks/useExtensionUpdates.js +64 -0
  359. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
  360. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
  361. package/dist/src/ui/hooks/useExtensionUpdates.test.js +162 -0
  362. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
  363. package/dist/src/ui/hooks/useFolderTrust.d.ts +1 -1
  364. package/dist/src/ui/hooks/useFolderTrust.js +12 -13
  365. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
  366. package/dist/src/ui/hooks/useGeminiStream.d.ts +11 -1
  367. package/dist/src/ui/hooks/useGeminiStream.js +124 -59
  368. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  369. package/dist/src/ui/hooks/useGitBranchName.js +15 -18
  370. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
  371. package/dist/src/ui/hooks/useGitBranchName.test.js +49 -53
  372. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
  373. package/dist/src/ui/hooks/useIdeTrustListener.js +2 -2
  374. package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -1
  375. package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
  376. package/dist/src/ui/hooks/useMessageQueue.js +5 -3
  377. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
  378. package/dist/src/ui/hooks/useMessageQueue.test.js +9 -0
  379. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
  380. package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
  381. package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
  382. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
  383. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
  384. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +267 -0
  385. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
  386. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
  387. package/dist/src/ui/hooks/useReactToolScheduler.js +23 -17
  388. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  389. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +1 -1
  390. package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
  391. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
  392. package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
  393. package/dist/src/ui/hooks/useSlashCompletion.js +16 -3
  394. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
  395. package/dist/src/ui/hooks/useSlashCompletion.test.js +169 -270
  396. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
  397. package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
  398. package/dist/src/ui/hooks/useThemeCommand.js +3 -14
  399. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  400. package/dist/src/ui/hooks/useToolScheduler.test.js +12 -5
  401. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  402. package/dist/src/ui/keyMatchers.test.js +8 -0
  403. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  404. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +8 -8
  405. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
  406. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +2 -2
  407. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
  408. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +2 -2
  409. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
  410. package/dist/src/ui/state/extensions.d.ts +15 -0
  411. package/dist/src/ui/state/extensions.js +17 -0
  412. package/dist/src/ui/state/extensions.js.map +1 -0
  413. package/dist/src/ui/themes/ayu.js +1 -1
  414. package/dist/src/ui/themes/dracula.js +2 -2
  415. package/dist/src/ui/themes/github-dark.js +1 -1
  416. package/dist/src/ui/themes/theme.js +17 -17
  417. package/dist/src/ui/themes/theme.js.map +1 -1
  418. package/dist/src/ui/types.d.ts +29 -3
  419. package/dist/src/ui/types.js +11 -0
  420. package/dist/src/ui/types.js.map +1 -1
  421. package/dist/src/ui/utils/CodeColorizer.js +3 -2
  422. package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
  423. package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -7
  424. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
  425. package/dist/src/ui/utils/MarkdownDisplay.js +10 -10
  426. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  427. package/dist/src/ui/utils/MarkdownDisplay.test.js +6 -2
  428. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
  429. package/dist/src/ui/utils/TableRenderer.js +4 -4
  430. package/dist/src/ui/utils/TableRenderer.js.map +1 -1
  431. package/dist/src/ui/utils/clipboardUtils.js +5 -6
  432. package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
  433. package/dist/src/ui/utils/displayUtils.js +4 -4
  434. package/dist/src/ui/utils/displayUtils.js.map +1 -1
  435. package/dist/src/ui/utils/highlight.d.ts +1 -1
  436. package/dist/src/ui/utils/highlight.js +15 -6
  437. package/dist/src/ui/utils/highlight.js.map +1 -1
  438. package/dist/src/ui/utils/highlight.test.js +56 -29
  439. package/dist/src/ui/utils/highlight.test.js.map +1 -1
  440. package/dist/src/ui/utils/kittyProtocolDetector.js +39 -29
  441. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
  442. package/dist/src/ui/utils/textUtils.d.ts +9 -0
  443. package/dist/src/ui/utils/textUtils.js +52 -3
  444. package/dist/src/ui/utils/textUtils.js.map +1 -1
  445. package/dist/src/utils/commands.d.ts +20 -0
  446. package/dist/src/utils/commands.js +53 -0
  447. package/dist/src/utils/commands.js.map +1 -0
  448. package/dist/src/utils/commands.test.d.ts +6 -0
  449. package/dist/src/utils/commands.test.js +115 -0
  450. package/dist/src/utils/commands.test.js.map +1 -0
  451. package/dist/src/utils/commentJson.d.ts +9 -0
  452. package/dist/src/utils/commentJson.js +48 -0
  453. package/dist/src/utils/commentJson.js.map +1 -0
  454. package/dist/src/utils/commentJson.test.d.ts +6 -0
  455. package/dist/src/utils/commentJson.test.js +146 -0
  456. package/dist/src/utils/commentJson.test.js.map +1 -0
  457. package/dist/src/utils/errors.d.ts +21 -0
  458. package/dist/src/utils/errors.js +93 -0
  459. package/dist/src/utils/errors.js.map +1 -1
  460. package/dist/src/utils/errors.test.d.ts +6 -0
  461. package/dist/src/utils/errors.test.js +303 -0
  462. package/dist/src/utils/errors.test.js.map +1 -0
  463. package/dist/src/utils/processUtils.d.ts +13 -0
  464. package/dist/src/utils/processUtils.js +18 -0
  465. package/dist/src/utils/processUtils.js.map +1 -0
  466. package/dist/src/utils/processUtils.test.d.ts +6 -0
  467. package/dist/src/utils/processUtils.test.js +20 -0
  468. package/dist/src/utils/processUtils.test.js.map +1 -0
  469. package/dist/src/utils/sandbox.d.ts +1 -1
  470. package/dist/src/utils/sandbox.js +19 -8
  471. package/dist/src/utils/sandbox.js.map +1 -1
  472. package/dist/src/utils/settingsUtils.d.ts +16 -6
  473. package/dist/src/utils/settingsUtils.js +35 -25
  474. package/dist/src/utils/settingsUtils.js.map +1 -1
  475. package/dist/src/utils/settingsUtils.test.js +455 -158
  476. package/dist/src/utils/settingsUtils.test.js.map +1 -1
  477. package/dist/src/zed-integration/schema.d.ts +596 -596
  478. package/dist/src/zed-integration/zedIntegration.js +10 -7
  479. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  480. package/dist/tsconfig.tsbuildinfo +1 -1
  481. package/package.json +13 -9
  482. package/dist/src/ui/components/AuthDialog.d.ts +0 -16
  483. package/dist/src/ui/components/AuthDialog.js +0 -62
  484. package/dist/src/ui/components/AuthDialog.js.map +0 -1
  485. package/dist/src/ui/components/AuthDialog.test.js +0 -175
  486. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  487. package/dist/src/ui/components/AuthInProgress.js.map +0 -1
  488. package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -15
  489. package/dist/src/ui/hooks/useAuthCommand.js +0 -68
  490. package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
  491. /package/dist/src/{ui/components/AuthDialog.test.d.ts → config/extensions/extensionEnablement.test.d.ts} +0 -0
  492. /package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +0 -0
@@ -8,14 +8,140 @@ import {
8
8
  // Schema utilities
9
9
  getSettingsByCategory, getSettingDefinition, requiresRestart, getDefaultValue, getRestartRequiredSettings, getEffectiveValue, getAllSettingKeys, getSettingsByType, getSettingsRequiringRestart, isValidSettingKey, getSettingCategory, shouldShowInDialog, getDialogSettingsByCategory, getDialogSettingsByType, getDialogSettingKeys,
10
10
  // Business logic utilities
11
- getSettingValue, isSettingModified, settingExistsInScope, setPendingSettingValue, hasRestartRequiredSettings, getRestartRequiredFromModified, getDisplayValue, isDefaultValue, isValueInherited, getEffectiveDisplayValue, } from './settingsUtils.js';
11
+ getSettingValue, isSettingModified, TEST_ONLY, settingExistsInScope, setPendingSettingValue, hasRestartRequiredSettings, getRestartRequiredFromModified, getDisplayValue, isDefaultValue, isValueInherited, getEffectiveDisplayValue, } from './settingsUtils.js';
12
+ import { getSettingsSchema, } from '../config/settingsSchema.js';
13
+ vi.mock('../config/settingsSchema.js', async (importOriginal) => {
14
+ const original = await importOriginal();
15
+ return {
16
+ ...original,
17
+ getSettingsSchema: vi.fn(),
18
+ };
19
+ });
20
+ function makeMockSettings(settings) {
21
+ return settings;
22
+ }
12
23
  describe('SettingsUtils', () => {
24
+ beforeEach(() => {
25
+ const SETTINGS_SCHEMA = {
26
+ mcpServers: {
27
+ type: 'object',
28
+ label: 'MCP Servers',
29
+ category: 'Advanced',
30
+ requiresRestart: true,
31
+ default: {},
32
+ description: 'Configuration for MCP servers.',
33
+ showInDialog: false,
34
+ },
35
+ test: {
36
+ type: 'string',
37
+ label: 'Test',
38
+ category: 'Basic',
39
+ requiresRestart: false,
40
+ default: 'hello',
41
+ description: 'A test field',
42
+ showInDialog: true,
43
+ },
44
+ advanced: {
45
+ type: 'object',
46
+ label: 'Advanced',
47
+ category: 'Advanced',
48
+ requiresRestart: true,
49
+ default: {},
50
+ description: 'Advanced settings for power users.',
51
+ showInDialog: false,
52
+ },
53
+ ui: {
54
+ type: 'object',
55
+ label: 'UI',
56
+ category: 'UI',
57
+ requiresRestart: false,
58
+ default: {},
59
+ description: 'User interface settings.',
60
+ showInDialog: false,
61
+ properties: {
62
+ theme: {
63
+ type: 'string',
64
+ label: 'Theme',
65
+ category: 'UI',
66
+ requiresRestart: false,
67
+ default: undefined,
68
+ description: 'The color theme for the UI.',
69
+ showInDialog: false,
70
+ },
71
+ requiresRestart: {
72
+ type: 'boolean',
73
+ label: 'Requires Restart',
74
+ category: 'UI',
75
+ default: false,
76
+ requiresRestart: true,
77
+ },
78
+ accessibility: {
79
+ type: 'object',
80
+ label: 'Accessibility',
81
+ category: 'UI',
82
+ requiresRestart: true,
83
+ default: {},
84
+ description: 'Accessibility settings.',
85
+ showInDialog: false,
86
+ properties: {
87
+ disableLoadingPhrases: {
88
+ type: 'boolean',
89
+ label: 'Disable Loading Phrases',
90
+ category: 'UI',
91
+ requiresRestart: true,
92
+ default: false,
93
+ description: 'Disable loading phrases for accessibility',
94
+ showInDialog: true,
95
+ },
96
+ },
97
+ },
98
+ },
99
+ },
100
+ tools: {
101
+ type: 'object',
102
+ label: 'Tools',
103
+ category: 'Tools',
104
+ requiresRestart: false,
105
+ default: {},
106
+ description: 'Tool settings.',
107
+ showInDialog: false,
108
+ properties: {
109
+ shell: {
110
+ type: 'object',
111
+ label: 'Shell',
112
+ category: 'Tools',
113
+ requiresRestart: false,
114
+ default: {},
115
+ description: 'Shell tool settings.',
116
+ showInDialog: false,
117
+ properties: {
118
+ pager: {
119
+ type: 'string',
120
+ label: 'Pager',
121
+ category: 'Tools',
122
+ requiresRestart: false,
123
+ default: 'less',
124
+ description: 'The pager to use for long output.',
125
+ showInDialog: true,
126
+ },
127
+ },
128
+ },
129
+ },
130
+ },
131
+ };
132
+ vi.mocked(getSettingsSchema).mockReturnValue(SETTINGS_SCHEMA);
133
+ });
134
+ afterEach(() => {
135
+ TEST_ONLY.clearFlattenedSchema();
136
+ vi.clearAllMocks();
137
+ vi.resetAllMocks();
138
+ });
13
139
  describe('Schema Utilities', () => {
14
140
  describe('getSettingsByCategory', () => {
15
141
  it('should group settings by category', () => {
16
142
  const categories = getSettingsByCategory();
17
- expect(categories).toHaveProperty('General');
18
- expect(categories).toHaveProperty('UI');
143
+ expect(categories).toHaveProperty('Advanced');
144
+ expect(categories).toHaveProperty('Basic');
19
145
  });
20
146
  it('should include key property in grouped settings', () => {
21
147
  const categories = getSettingsByCategory();
@@ -28,9 +154,9 @@ describe('SettingsUtils', () => {
28
154
  });
29
155
  describe('getSettingDefinition', () => {
30
156
  it('should return definition for valid setting', () => {
31
- const definition = getSettingDefinition('ui.showMemoryUsage');
157
+ const definition = getSettingDefinition('ui.theme');
32
158
  expect(definition).toBeDefined();
33
- expect(definition?.label).toBe('Show Memory Usage');
159
+ expect(definition?.label).toBe('Theme');
34
160
  });
35
161
  it('should return undefined for invalid setting', () => {
36
162
  const definition = getSettingDefinition('invalidSetting');
@@ -39,12 +165,10 @@ describe('SettingsUtils', () => {
39
165
  });
40
166
  describe('requiresRestart', () => {
41
167
  it('should return true for settings that require restart', () => {
42
- expect(requiresRestart('advanced.autoConfigureMemory')).toBe(true);
43
- expect(requiresRestart('general.checkpointing.enabled')).toBe(true);
168
+ expect(requiresRestart('ui.requiresRestart')).toBe(true);
44
169
  });
45
170
  it('should return false for settings that do not require restart', () => {
46
- expect(requiresRestart('ui.showMemoryUsage')).toBe(false);
47
- expect(requiresRestart('ui.hideTips')).toBe(false);
171
+ expect(requiresRestart('ui.theme')).toBe(false);
48
172
  });
49
173
  it('should return false for invalid settings', () => {
50
174
  expect(requiresRestart('invalidSetting')).toBe(false);
@@ -52,8 +176,8 @@ describe('SettingsUtils', () => {
52
176
  });
53
177
  describe('getDefaultValue', () => {
54
178
  it('should return correct default values', () => {
55
- expect(getDefaultValue('ui.showMemoryUsage')).toBe(false);
56
- expect(getDefaultValue('context.fileFiltering.enableRecursiveFileSearch')).toBe(true);
179
+ expect(getDefaultValue('test')).toBe('hello');
180
+ expect(getDefaultValue('ui.requiresRestart')).toBe(false);
57
181
  });
58
182
  it('should return undefined for invalid settings', () => {
59
183
  expect(getDefaultValue('invalidSetting')).toBeUndefined();
@@ -62,43 +186,46 @@ describe('SettingsUtils', () => {
62
186
  describe('getRestartRequiredSettings', () => {
63
187
  it('should return all settings that require restart', () => {
64
188
  const restartSettings = getRestartRequiredSettings();
65
- expect(restartSettings).toContain('advanced.autoConfigureMemory');
66
- expect(restartSettings).toContain('general.checkpointing.enabled');
67
- expect(restartSettings).not.toContain('ui.showMemoryUsage');
189
+ expect(restartSettings).toContain('mcpServers');
190
+ expect(restartSettings).toContain('ui.requiresRestart');
68
191
  });
69
192
  });
70
193
  describe('getEffectiveValue', () => {
71
194
  it('should return value from settings when set', () => {
72
- const settings = { ui: { showMemoryUsage: true } };
73
- const mergedSettings = { ui: { showMemoryUsage: false } };
74
- const value = getEffectiveValue('ui.showMemoryUsage', settings, mergedSettings);
195
+ const settings = makeMockSettings({ ui: { requiresRestart: true } });
196
+ const mergedSettings = makeMockSettings({
197
+ ui: { requiresRestart: false },
198
+ });
199
+ const value = getEffectiveValue('ui.requiresRestart', settings, mergedSettings);
75
200
  expect(value).toBe(true);
76
201
  });
77
202
  it('should return value from merged settings when not set in current scope', () => {
78
- const settings = {};
79
- const mergedSettings = { ui: { showMemoryUsage: true } };
80
- const value = getEffectiveValue('ui.showMemoryUsage', settings, mergedSettings);
203
+ const settings = makeMockSettings({});
204
+ const mergedSettings = makeMockSettings({
205
+ ui: { requiresRestart: true },
206
+ });
207
+ const value = getEffectiveValue('ui.requiresRestart', settings, mergedSettings);
81
208
  expect(value).toBe(true);
82
209
  });
83
210
  it('should return default value when not set anywhere', () => {
84
- const settings = {};
85
- const mergedSettings = {};
86
- const value = getEffectiveValue('ui.showMemoryUsage', settings, mergedSettings);
211
+ const settings = makeMockSettings({});
212
+ const mergedSettings = makeMockSettings({});
213
+ const value = getEffectiveValue('ui.requiresRestart', settings, mergedSettings);
87
214
  expect(value).toBe(false); // default value
88
215
  });
89
216
  it('should handle nested settings correctly', () => {
90
- const settings = {
217
+ const settings = makeMockSettings({
91
218
  ui: { accessibility: { disableLoadingPhrases: true } },
92
- };
93
- const mergedSettings = {
219
+ });
220
+ const mergedSettings = makeMockSettings({
94
221
  ui: { accessibility: { disableLoadingPhrases: false } },
95
- };
222
+ });
96
223
  const value = getEffectiveValue('ui.accessibility.disableLoadingPhrases', settings, mergedSettings);
97
224
  expect(value).toBe(true);
98
225
  });
99
226
  it('should return undefined for invalid settings', () => {
100
- const settings = {};
101
- const mergedSettings = {};
227
+ const settings = makeMockSettings({});
228
+ const mergedSettings = makeMockSettings({});
102
229
  const value = getEffectiveValue('invalidSetting', settings, mergedSettings);
103
230
  expect(value).toBeUndefined();
104
231
  });
@@ -106,9 +233,8 @@ describe('SettingsUtils', () => {
106
233
  describe('getAllSettingKeys', () => {
107
234
  it('should return all setting keys', () => {
108
235
  const keys = getAllSettingKeys();
109
- expect(keys).toContain('ui.showMemoryUsage');
236
+ expect(keys).toContain('test');
110
237
  expect(keys).toContain('ui.accessibility.disableLoadingPhrases');
111
- expect(keys).toContain('general.checkpointing.enabled');
112
238
  });
113
239
  });
114
240
  describe('getSettingsByType', () => {
@@ -131,7 +257,7 @@ describe('SettingsUtils', () => {
131
257
  });
132
258
  describe('isValidSettingKey', () => {
133
259
  it('should return true for valid setting keys', () => {
134
- expect(isValidSettingKey('ui.showMemoryUsage')).toBe(true);
260
+ expect(isValidSettingKey('ui.requiresRestart')).toBe(true);
135
261
  expect(isValidSettingKey('ui.accessibility.disableLoadingPhrases')).toBe(true);
136
262
  });
137
263
  it('should return false for invalid setting keys', () => {
@@ -141,7 +267,7 @@ describe('SettingsUtils', () => {
141
267
  });
142
268
  describe('getSettingCategory', () => {
143
269
  it('should return correct category for valid settings', () => {
144
- expect(getSettingCategory('ui.showMemoryUsage')).toBe('UI');
270
+ expect(getSettingCategory('ui.requiresRestart')).toBe('UI');
145
271
  expect(getSettingCategory('ui.accessibility.disableLoadingPhrases')).toBe('UI');
146
272
  });
147
273
  it('should return undefined for invalid settings', () => {
@@ -150,17 +276,12 @@ describe('SettingsUtils', () => {
150
276
  });
151
277
  describe('shouldShowInDialog', () => {
152
278
  it('should return true for settings marked to show in dialog', () => {
153
- expect(shouldShowInDialog('ui.showMemoryUsage')).toBe(true);
279
+ expect(shouldShowInDialog('ui.requiresRestart')).toBe(true);
154
280
  expect(shouldShowInDialog('general.vimMode')).toBe(true);
155
281
  expect(shouldShowInDialog('ui.hideWindowTitle')).toBe(true);
156
- expect(shouldShowInDialog('privacy.usageStatisticsEnabled')).toBe(false);
157
282
  });
158
283
  it('should return false for settings marked to hide from dialog', () => {
159
- expect(shouldShowInDialog('security.auth.selectedType')).toBe(false);
160
- expect(shouldShowInDialog('tools.core')).toBe(false);
161
- expect(shouldShowInDialog('ui.customThemes')).toBe(false);
162
- expect(shouldShowInDialog('ui.theme')).toBe(false); // Changed to false
163
- expect(shouldShowInDialog('general.preferredEditor')).toBe(false); // Changed to false
284
+ expect(shouldShowInDialog('ui.theme')).toBe(false);
164
285
  });
165
286
  it('should return true for invalid settings (default behavior)', () => {
166
287
  expect(shouldShowInDialog('invalidSetting')).toBe(true);
@@ -173,9 +294,8 @@ describe('SettingsUtils', () => {
173
294
  expect(categories['UI']).toBeDefined();
174
295
  const uiSettings = categories['UI'];
175
296
  const uiKeys = uiSettings.map((s) => s.key);
176
- expect(uiKeys).toContain('ui.showMemoryUsage');
177
- expect(uiKeys).toContain('ui.hideWindowTitle');
178
- expect(uiKeys).not.toContain('ui.customThemes'); // This is marked false
297
+ expect(uiKeys).toContain('ui.requiresRestart');
298
+ expect(uiKeys).toContain('ui.accessibility.disableLoadingPhrases');
179
299
  expect(uiKeys).not.toContain('ui.theme'); // This is now marked false
180
300
  });
181
301
  it('should not include Advanced category settings', () => {
@@ -187,13 +307,8 @@ describe('SettingsUtils', () => {
187
307
  const categories = getDialogSettingsByCategory();
188
308
  const allSettings = Object.values(categories).flat();
189
309
  const allKeys = allSettings.map((s) => s.key);
190
- expect(allKeys).toContain('general.vimMode');
191
- expect(allKeys).toContain('ide.enabled');
192
- expect(allKeys).toContain('general.disableAutoUpdate');
193
- expect(allKeys).toContain('ui.showMemoryUsage');
194
- expect(allKeys).not.toContain('privacy.usageStatisticsEnabled');
195
- expect(allKeys).not.toContain('security.auth.selectedType');
196
- expect(allKeys).not.toContain('tools.core');
310
+ expect(allKeys).toContain('test');
311
+ expect(allKeys).toContain('ui.requiresRestart');
197
312
  expect(allKeys).not.toContain('ui.theme'); // Now hidden
198
313
  expect(allKeys).not.toContain('general.preferredEditor'); // Now hidden
199
314
  });
@@ -202,9 +317,8 @@ describe('SettingsUtils', () => {
202
317
  it('should return only boolean dialog settings', () => {
203
318
  const booleanSettings = getDialogSettingsByType('boolean');
204
319
  const keys = booleanSettings.map((s) => s.key);
205
- expect(keys).toContain('ui.showMemoryUsage');
206
- expect(keys).toContain('general.vimMode');
207
- expect(keys).toContain('ui.hideWindowTitle');
320
+ expect(keys).toContain('ui.requiresRestart');
321
+ expect(keys).toContain('ui.accessibility.disableLoadingPhrases');
208
322
  expect(keys).not.toContain('privacy.usageStatisticsEnabled');
209
323
  expect(keys).not.toContain('security.auth.selectedType'); // Advanced setting
210
324
  expect(keys).not.toContain('security.auth.useExternal'); // Advanced setting
@@ -216,32 +330,23 @@ describe('SettingsUtils', () => {
216
330
  expect(keys).not.toContain('ui.theme'); // Now marked false
217
331
  expect(keys).not.toContain('general.preferredEditor'); // Now marked false
218
332
  expect(keys).not.toContain('security.auth.selectedType'); // Advanced setting
219
- // Most string settings are now hidden, so let's just check they exclude advanced ones
220
- expect(keys.every((key) => !key.startsWith('tool'))).toBe(true); // No tool-related settings
333
+ // Check that user-facing tool settings are included
334
+ expect(keys).toContain('tools.shell.pager');
335
+ // Check that advanced/hidden tool settings are excluded
336
+ expect(keys).not.toContain('tools.discoveryCommand');
337
+ expect(keys).not.toContain('tools.callCommand');
338
+ expect(keys.every((key) => !key.startsWith('advanced.'))).toBe(true);
221
339
  });
222
340
  });
223
341
  describe('getDialogSettingKeys', () => {
224
342
  it('should return only settings marked for dialog display', () => {
225
343
  const dialogKeys = getDialogSettingKeys();
226
344
  // Should include settings marked for dialog
227
- expect(dialogKeys).toContain('ui.showMemoryUsage');
228
- expect(dialogKeys).toContain('general.vimMode');
229
- expect(dialogKeys).toContain('ui.hideWindowTitle');
230
- expect(dialogKeys).not.toContain('privacy.usageStatisticsEnabled');
231
- expect(dialogKeys).toContain('ide.enabled');
232
- expect(dialogKeys).toContain('general.disableAutoUpdate');
345
+ expect(dialogKeys).toContain('ui.requiresRestart');
233
346
  // Should include nested settings marked for dialog
234
- expect(dialogKeys).toContain('context.fileFiltering.respectGitIgnore');
235
- expect(dialogKeys).toContain('context.fileFiltering.respectGeminiIgnore');
236
- expect(dialogKeys).toContain('context.fileFiltering.enableRecursiveFileSearch');
347
+ expect(dialogKeys).toContain('ui.accessibility.disableLoadingPhrases');
237
348
  // Should NOT include settings marked as hidden
238
349
  expect(dialogKeys).not.toContain('ui.theme'); // Hidden
239
- expect(dialogKeys).not.toContain('ui.customThemes'); // Hidden
240
- expect(dialogKeys).not.toContain('general.preferredEditor'); // Hidden
241
- expect(dialogKeys).not.toContain('security.auth.selectedType'); // Advanced
242
- expect(dialogKeys).not.toContain('tools.core'); // Advanced
243
- expect(dialogKeys).not.toContain('mcpServers'); // Advanced
244
- expect(dialogKeys).not.toContain('telemetry'); // Advanced
245
350
  });
246
351
  it('should return fewer keys than getAllSettingKeys', () => {
247
352
  const allKeys = getAllSettingKeys();
@@ -250,10 +355,43 @@ describe('SettingsUtils', () => {
250
355
  expect(dialogKeys.length).toBeGreaterThan(0);
251
356
  });
252
357
  it('should handle nested settings display correctly', () => {
358
+ vi.mocked(getSettingsSchema).mockReturnValue({
359
+ context: {
360
+ type: 'object',
361
+ label: 'Context',
362
+ category: 'Context',
363
+ requiresRestart: false,
364
+ default: {},
365
+ description: 'Settings for managing context provided to the model.',
366
+ showInDialog: false,
367
+ properties: {
368
+ fileFiltering: {
369
+ type: 'object',
370
+ label: 'File Filtering',
371
+ category: 'Context',
372
+ requiresRestart: true,
373
+ default: {},
374
+ description: 'Settings for git-aware file filtering.',
375
+ showInDialog: false,
376
+ properties: {
377
+ respectGitIgnore: {
378
+ type: 'boolean',
379
+ label: 'Respect .gitignore',
380
+ category: 'Context',
381
+ requiresRestart: true,
382
+ default: true,
383
+ description: 'Respect .gitignore files when searching',
384
+ showInDialog: true,
385
+ },
386
+ },
387
+ },
388
+ },
389
+ },
390
+ });
253
391
  // Test the specific issue with fileFiltering.respectGitIgnore
254
392
  const key = 'context.fileFiltering.respectGitIgnore';
255
- const initialSettings = {};
256
- const pendingSettings = {};
393
+ const initialSettings = makeMockSettings({});
394
+ const pendingSettings = makeMockSettings({});
257
395
  // Set the nested setting to true
258
396
  const updatedPendingSettings = setPendingSettingValue(key, true, pendingSettings);
259
397
  // Check if the setting exists in pending settings
@@ -275,79 +413,83 @@ describe('SettingsUtils', () => {
275
413
  describe('Business Logic Utilities', () => {
276
414
  describe('getSettingValue', () => {
277
415
  it('should return value from settings when set', () => {
278
- const settings = { ui: { showMemoryUsage: true } };
279
- const mergedSettings = { ui: { showMemoryUsage: false } };
280
- const value = getSettingValue('ui.showMemoryUsage', settings, mergedSettings);
416
+ const settings = makeMockSettings({ ui: { requiresRestart: true } });
417
+ const mergedSettings = makeMockSettings({
418
+ ui: { requiresRestart: false },
419
+ });
420
+ const value = getSettingValue('ui.requiresRestart', settings, mergedSettings);
281
421
  expect(value).toBe(true);
282
422
  });
283
423
  it('should return value from merged settings when not set in current scope', () => {
284
- const settings = {};
285
- const mergedSettings = { ui: { showMemoryUsage: true } };
286
- const value = getSettingValue('ui.showMemoryUsage', settings, mergedSettings);
424
+ const settings = makeMockSettings({});
425
+ const mergedSettings = makeMockSettings({
426
+ ui: { requiresRestart: true },
427
+ });
428
+ const value = getSettingValue('ui.requiresRestart', settings, mergedSettings);
287
429
  expect(value).toBe(true);
288
430
  });
289
431
  it('should return default value for invalid setting', () => {
290
- const settings = {};
291
- const mergedSettings = {};
432
+ const settings = makeMockSettings({});
433
+ const mergedSettings = makeMockSettings({});
292
434
  const value = getSettingValue('invalidSetting', settings, mergedSettings);
293
435
  expect(value).toBe(false); // Default fallback
294
436
  });
295
437
  });
296
438
  describe('isSettingModified', () => {
297
439
  it('should return true when value differs from default', () => {
298
- expect(isSettingModified('ui.showMemoryUsage', true)).toBe(true);
299
- expect(isSettingModified('context.fileFiltering.enableRecursiveFileSearch', false)).toBe(true);
440
+ expect(isSettingModified('ui.requiresRestart', true)).toBe(true);
441
+ expect(isSettingModified('ui.accessibility.disableLoadingPhrases', true)).toBe(true);
300
442
  });
301
443
  it('should return false when value matches default', () => {
302
- expect(isSettingModified('ui.showMemoryUsage', false)).toBe(false);
303
- expect(isSettingModified('context.fileFiltering.enableRecursiveFileSearch', true)).toBe(false);
444
+ expect(isSettingModified('ui.requiresRestart', false)).toBe(false);
445
+ expect(isSettingModified('ui.accessibility.disableLoadingPhrases', false)).toBe(false);
304
446
  });
305
447
  });
306
448
  describe('settingExistsInScope', () => {
307
449
  it('should return true for top-level settings that exist', () => {
308
- const settings = { ui: { showMemoryUsage: true } };
309
- expect(settingExistsInScope('ui.showMemoryUsage', settings)).toBe(true);
450
+ const settings = makeMockSettings({ ui: { requiresRestart: true } });
451
+ expect(settingExistsInScope('ui.requiresRestart', settings)).toBe(true);
310
452
  });
311
453
  it('should return false for top-level settings that do not exist', () => {
312
- const settings = {};
313
- expect(settingExistsInScope('ui.showMemoryUsage', settings)).toBe(false);
454
+ const settings = makeMockSettings({});
455
+ expect(settingExistsInScope('ui.requiresRestart', settings)).toBe(false);
314
456
  });
315
457
  it('should return true for nested settings that exist', () => {
316
- const settings = {
458
+ const settings = makeMockSettings({
317
459
  ui: { accessibility: { disableLoadingPhrases: true } },
318
- };
460
+ });
319
461
  expect(settingExistsInScope('ui.accessibility.disableLoadingPhrases', settings)).toBe(true);
320
462
  });
321
463
  it('should return false for nested settings that do not exist', () => {
322
- const settings = {};
464
+ const settings = makeMockSettings({});
323
465
  expect(settingExistsInScope('ui.accessibility.disableLoadingPhrases', settings)).toBe(false);
324
466
  });
325
467
  it('should return false when parent exists but child does not', () => {
326
- const settings = { ui: { accessibility: {} } };
468
+ const settings = makeMockSettings({ ui: { accessibility: {} } });
327
469
  expect(settingExistsInScope('ui.accessibility.disableLoadingPhrases', settings)).toBe(false);
328
470
  });
329
471
  });
330
472
  describe('setPendingSettingValue', () => {
331
473
  it('should set top-level setting value', () => {
332
- const pendingSettings = {};
333
- const result = setPendingSettingValue('ui.showMemoryUsage', true, pendingSettings);
334
- expect(result.ui?.showMemoryUsage).toBe(true);
474
+ const pendingSettings = makeMockSettings({});
475
+ const result = setPendingSettingValue('ui.hideWindowTitle', true, pendingSettings);
476
+ expect(result.ui?.hideWindowTitle).toBe(true);
335
477
  });
336
478
  it('should set nested setting value', () => {
337
- const pendingSettings = {};
479
+ const pendingSettings = makeMockSettings({});
338
480
  const result = setPendingSettingValue('ui.accessibility.disableLoadingPhrases', true, pendingSettings);
339
481
  expect(result.ui?.accessibility?.disableLoadingPhrases).toBe(true);
340
482
  });
341
483
  it('should preserve existing nested settings', () => {
342
- const pendingSettings = {
484
+ const pendingSettings = makeMockSettings({
343
485
  ui: { accessibility: { disableLoadingPhrases: false } },
344
- };
486
+ });
345
487
  const result = setPendingSettingValue('ui.accessibility.disableLoadingPhrases', true, pendingSettings);
346
488
  expect(result.ui?.accessibility?.disableLoadingPhrases).toBe(true);
347
489
  });
348
490
  it('should not mutate original settings', () => {
349
- const pendingSettings = {};
350
- setPendingSettingValue('ui.showMemoryUsage', true, pendingSettings);
491
+ const pendingSettings = makeMockSettings({});
492
+ setPendingSettingValue('ui.requiresRestart', true, pendingSettings);
351
493
  expect(pendingSettings).toEqual({});
352
494
  });
353
495
  });
@@ -355,15 +497,12 @@ describe('SettingsUtils', () => {
355
497
  it('should return true when modified settings require restart', () => {
356
498
  const modifiedSettings = new Set([
357
499
  'advanced.autoConfigureMemory',
358
- 'ui.showMemoryUsage',
500
+ 'ui.requiresRestart',
359
501
  ]);
360
502
  expect(hasRestartRequiredSettings(modifiedSettings)).toBe(true);
361
503
  });
362
504
  it('should return false when no modified settings require restart', () => {
363
- const modifiedSettings = new Set([
364
- 'ui.showMemoryUsage',
365
- 'ui.hideTips',
366
- ]);
505
+ const modifiedSettings = new Set(['test']);
367
506
  expect(hasRestartRequiredSettings(modifiedSettings)).toBe(false);
368
507
  });
369
508
  it('should return false for empty set', () => {
@@ -374,18 +513,16 @@ describe('SettingsUtils', () => {
374
513
  describe('getRestartRequiredFromModified', () => {
375
514
  it('should return only settings that require restart', () => {
376
515
  const modifiedSettings = new Set([
377
- 'advanced.autoConfigureMemory',
378
- 'ui.showMemoryUsage',
379
- 'general.checkpointing.enabled',
516
+ 'ui.requiresRestart',
517
+ 'test',
380
518
  ]);
381
519
  const result = getRestartRequiredFromModified(modifiedSettings);
382
- expect(result).toContain('advanced.autoConfigureMemory');
383
- expect(result).toContain('general.checkpointing.enabled');
384
- expect(result).not.toContain('ui.showMemoryUsage');
520
+ expect(result).toContain('ui.requiresRestart');
521
+ expect(result).not.toContain('test');
385
522
  });
386
523
  it('should return empty array when no settings require restart', () => {
387
524
  const modifiedSettings = new Set([
388
- 'showMemoryUsage',
525
+ 'requiresRestart',
389
526
  'hideTips',
390
527
  ]);
391
528
  const result = getRestartRequiredFromModified(modifiedSettings);
@@ -393,116 +530,276 @@ describe('SettingsUtils', () => {
393
530
  });
394
531
  });
395
532
  describe('getDisplayValue', () => {
533
+ describe('enum behavior', () => {
534
+ let StringEnum;
535
+ (function (StringEnum) {
536
+ StringEnum["FOO"] = "foo";
537
+ StringEnum["BAR"] = "bar";
538
+ StringEnum["BAZ"] = "baz";
539
+ })(StringEnum || (StringEnum = {}));
540
+ let NumberEnum;
541
+ (function (NumberEnum) {
542
+ NumberEnum[NumberEnum["ONE"] = 1] = "ONE";
543
+ NumberEnum[NumberEnum["TWO"] = 2] = "TWO";
544
+ NumberEnum[NumberEnum["THREE"] = 3] = "THREE";
545
+ })(NumberEnum || (NumberEnum = {}));
546
+ const SETTING = {
547
+ type: 'enum',
548
+ label: 'Theme',
549
+ options: [
550
+ {
551
+ value: StringEnum.FOO,
552
+ label: 'Foo',
553
+ },
554
+ {
555
+ value: StringEnum.BAR,
556
+ label: 'Bar',
557
+ },
558
+ {
559
+ value: StringEnum.BAZ,
560
+ label: 'Baz',
561
+ },
562
+ ],
563
+ category: 'UI',
564
+ requiresRestart: false,
565
+ default: StringEnum.BAR,
566
+ description: 'The color theme for the UI.',
567
+ showInDialog: false,
568
+ };
569
+ it('handles display of number-based enums', () => {
570
+ vi.mocked(getSettingsSchema).mockReturnValue({
571
+ ui: {
572
+ properties: {
573
+ theme: {
574
+ ...SETTING,
575
+ options: [
576
+ {
577
+ value: NumberEnum.ONE,
578
+ label: 'One',
579
+ },
580
+ {
581
+ value: NumberEnum.TWO,
582
+ label: 'Two',
583
+ },
584
+ {
585
+ value: NumberEnum.THREE,
586
+ label: 'Three',
587
+ },
588
+ ],
589
+ },
590
+ },
591
+ },
592
+ });
593
+ const settings = makeMockSettings({
594
+ ui: { theme: NumberEnum.THREE },
595
+ });
596
+ const mergedSettings = makeMockSettings({
597
+ ui: { theme: NumberEnum.THREE },
598
+ });
599
+ const modifiedSettings = new Set();
600
+ const result = getDisplayValue('ui.theme', settings, mergedSettings, modifiedSettings);
601
+ expect(result).toBe('Three*');
602
+ });
603
+ it('handles default values for number-based enums', () => {
604
+ vi.mocked(getSettingsSchema).mockReturnValue({
605
+ ui: {
606
+ properties: {
607
+ theme: {
608
+ ...SETTING,
609
+ default: NumberEnum.THREE,
610
+ options: [
611
+ {
612
+ value: NumberEnum.ONE,
613
+ label: 'One',
614
+ },
615
+ {
616
+ value: NumberEnum.TWO,
617
+ label: 'Two',
618
+ },
619
+ {
620
+ value: NumberEnum.THREE,
621
+ label: 'Three',
622
+ },
623
+ ],
624
+ },
625
+ },
626
+ },
627
+ });
628
+ const modifiedSettings = new Set();
629
+ const result = getDisplayValue('ui.theme', makeMockSettings({}), makeMockSettings({}), modifiedSettings);
630
+ expect(result).toBe('Three');
631
+ });
632
+ it('shows the enum display value', () => {
633
+ vi.mocked(getSettingsSchema).mockReturnValue({
634
+ ui: { properties: { theme: { ...SETTING } } },
635
+ });
636
+ const settings = makeMockSettings({ ui: { theme: StringEnum.BAR } });
637
+ const mergedSettings = makeMockSettings({
638
+ ui: { theme: StringEnum.BAR },
639
+ });
640
+ const modifiedSettings = new Set();
641
+ const result = getDisplayValue('ui.theme', settings, mergedSettings, modifiedSettings);
642
+ expect(result).toBe('Bar*');
643
+ });
644
+ it('passes through unknown values verbatim', () => {
645
+ vi.mocked(getSettingsSchema).mockReturnValue({
646
+ ui: {
647
+ properties: {
648
+ theme: { ...SETTING },
649
+ },
650
+ },
651
+ });
652
+ const settings = makeMockSettings({ ui: { theme: 'xyz' } });
653
+ const mergedSettings = makeMockSettings({ ui: { theme: 'xyz' } });
654
+ const modifiedSettings = new Set();
655
+ const result = getDisplayValue('ui.theme', settings, mergedSettings, modifiedSettings);
656
+ expect(result).toBe('xyz*');
657
+ });
658
+ it('shows the default value for string enums', () => {
659
+ vi.mocked(getSettingsSchema).mockReturnValue({
660
+ ui: {
661
+ properties: {
662
+ theme: { ...SETTING, default: StringEnum.BAR },
663
+ },
664
+ },
665
+ });
666
+ const modifiedSettings = new Set();
667
+ const result = getDisplayValue('ui.theme', makeMockSettings({}), makeMockSettings({}), modifiedSettings);
668
+ expect(result).toBe('Bar');
669
+ });
670
+ });
396
671
  it('should show value without * when setting matches default', () => {
397
- const settings = { ui: { showMemoryUsage: false } }; // false matches default, so no *
398
- const mergedSettings = { ui: { showMemoryUsage: false } };
672
+ const settings = makeMockSettings({
673
+ ui: { requiresRestart: false },
674
+ }); // false matches default, so no *
675
+ const mergedSettings = makeMockSettings({
676
+ ui: { requiresRestart: false },
677
+ });
399
678
  const modifiedSettings = new Set();
400
- const result = getDisplayValue('ui.showMemoryUsage', settings, mergedSettings, modifiedSettings);
679
+ const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
401
680
  expect(result).toBe('false*');
402
681
  });
403
682
  it('should show default value when setting is not in scope', () => {
404
- const settings = {}; // no setting in scope
405
- const mergedSettings = { ui: { showMemoryUsage: false } };
683
+ const settings = makeMockSettings({}); // no setting in scope
684
+ const mergedSettings = makeMockSettings({
685
+ ui: { requiresRestart: false },
686
+ });
406
687
  const modifiedSettings = new Set();
407
- const result = getDisplayValue('ui.showMemoryUsage', settings, mergedSettings, modifiedSettings);
688
+ const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
408
689
  expect(result).toBe('false'); // shows default value
409
690
  });
410
691
  it('should show value with * when changed from default', () => {
411
- const settings = { ui: { showMemoryUsage: true } }; // true is different from default (false)
412
- const mergedSettings = { ui: { showMemoryUsage: true } };
692
+ const settings = makeMockSettings({ ui: { requiresRestart: true } }); // true is different from default (false)
693
+ const mergedSettings = makeMockSettings({
694
+ ui: { requiresRestart: true },
695
+ });
413
696
  const modifiedSettings = new Set();
414
- const result = getDisplayValue('ui.showMemoryUsage', settings, mergedSettings, modifiedSettings);
697
+ const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
415
698
  expect(result).toBe('true*');
416
699
  });
417
700
  it('should show default value without * when setting does not exist in scope', () => {
418
- const settings = {}; // setting doesn't exist in scope, show default
419
- const mergedSettings = { ui: { showMemoryUsage: false } };
701
+ const settings = makeMockSettings({}); // setting doesn't exist in scope, show default
702
+ const mergedSettings = makeMockSettings({
703
+ ui: { requiresRestart: false },
704
+ });
420
705
  const modifiedSettings = new Set();
421
- const result = getDisplayValue('ui.showMemoryUsage', settings, mergedSettings, modifiedSettings);
706
+ const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
422
707
  expect(result).toBe('false'); // default value (false) without *
423
708
  });
424
709
  it('should show value with * when user changes from default', () => {
425
- const settings = {}; // setting doesn't exist in scope originally
426
- const mergedSettings = { ui: { showMemoryUsage: false } };
427
- const modifiedSettings = new Set(['ui.showMemoryUsage']);
428
- const pendingSettings = { ui: { showMemoryUsage: true } }; // user changed to true
429
- const result = getDisplayValue('ui.showMemoryUsage', settings, mergedSettings, modifiedSettings, pendingSettings);
710
+ const settings = makeMockSettings({}); // setting doesn't exist in scope originally
711
+ const mergedSettings = makeMockSettings({
712
+ ui: { requiresRestart: false },
713
+ });
714
+ const modifiedSettings = new Set(['ui.requiresRestart']);
715
+ const pendingSettings = makeMockSettings({
716
+ ui: { requiresRestart: true },
717
+ }); // user changed to true
718
+ const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings, pendingSettings);
430
719
  expect(result).toBe('true*'); // changed from default (false) to true
431
720
  });
432
721
  });
433
722
  describe('isDefaultValue', () => {
434
723
  it('should return true when setting does not exist in scope', () => {
435
- const settings = {}; // setting doesn't exist
436
- const result = isDefaultValue('ui.showMemoryUsage', settings);
724
+ const settings = makeMockSettings({}); // setting doesn't exist
725
+ const result = isDefaultValue('ui.requiresRestart', settings);
437
726
  expect(result).toBe(true);
438
727
  });
439
728
  it('should return false when setting exists in scope', () => {
440
- const settings = { ui: { showMemoryUsage: true } }; // setting exists
441
- const result = isDefaultValue('ui.showMemoryUsage', settings);
729
+ const settings = makeMockSettings({ ui: { requiresRestart: true } }); // setting exists
730
+ const result = isDefaultValue('ui.requiresRestart', settings);
442
731
  expect(result).toBe(false);
443
732
  });
444
733
  it('should return true when nested setting does not exist in scope', () => {
445
- const settings = {}; // nested setting doesn't exist
734
+ const settings = makeMockSettings({}); // nested setting doesn't exist
446
735
  const result = isDefaultValue('ui.accessibility.disableLoadingPhrases', settings);
447
736
  expect(result).toBe(true);
448
737
  });
449
738
  it('should return false when nested setting exists in scope', () => {
450
- const settings = {
739
+ const settings = makeMockSettings({
451
740
  ui: { accessibility: { disableLoadingPhrases: true } },
452
- }; // nested setting exists
741
+ }); // nested setting exists
453
742
  const result = isDefaultValue('ui.accessibility.disableLoadingPhrases', settings);
454
743
  expect(result).toBe(false);
455
744
  });
456
745
  });
457
746
  describe('isValueInherited', () => {
458
747
  it('should return false for top-level settings that exist in scope', () => {
459
- const settings = { ui: { showMemoryUsage: true } };
460
- const mergedSettings = { ui: { showMemoryUsage: true } };
461
- const result = isValueInherited('ui.showMemoryUsage', settings, mergedSettings);
748
+ const settings = makeMockSettings({ ui: { requiresRestart: true } });
749
+ const mergedSettings = makeMockSettings({
750
+ ui: { requiresRestart: true },
751
+ });
752
+ const result = isValueInherited('ui.requiresRestart', settings, mergedSettings);
462
753
  expect(result).toBe(false);
463
754
  });
464
755
  it('should return true for top-level settings that do not exist in scope', () => {
465
- const settings = {};
466
- const mergedSettings = { ui: { showMemoryUsage: true } };
467
- const result = isValueInherited('ui.showMemoryUsage', settings, mergedSettings);
756
+ const settings = makeMockSettings({});
757
+ const mergedSettings = makeMockSettings({
758
+ ui: { requiresRestart: true },
759
+ });
760
+ const result = isValueInherited('ui.requiresRestart', settings, mergedSettings);
468
761
  expect(result).toBe(true);
469
762
  });
470
763
  it('should return false for nested settings that exist in scope', () => {
471
- const settings = {
764
+ const settings = makeMockSettings({
472
765
  ui: { accessibility: { disableLoadingPhrases: true } },
473
- };
474
- const mergedSettings = {
766
+ });
767
+ const mergedSettings = makeMockSettings({
475
768
  ui: { accessibility: { disableLoadingPhrases: true } },
476
- };
769
+ });
477
770
  const result = isValueInherited('ui.accessibility.disableLoadingPhrases', settings, mergedSettings);
478
771
  expect(result).toBe(false);
479
772
  });
480
773
  it('should return true for nested settings that do not exist in scope', () => {
481
- const settings = {};
482
- const mergedSettings = {
774
+ const settings = makeMockSettings({});
775
+ const mergedSettings = makeMockSettings({
483
776
  ui: { accessibility: { disableLoadingPhrases: true } },
484
- };
777
+ });
485
778
  const result = isValueInherited('ui.accessibility.disableLoadingPhrases', settings, mergedSettings);
486
779
  expect(result).toBe(true);
487
780
  });
488
781
  });
489
782
  describe('getEffectiveDisplayValue', () => {
490
783
  it('should return value from settings when available', () => {
491
- const settings = { ui: { showMemoryUsage: true } };
492
- const mergedSettings = { ui: { showMemoryUsage: false } };
493
- const result = getEffectiveDisplayValue('ui.showMemoryUsage', settings, mergedSettings);
784
+ const settings = makeMockSettings({ ui: { requiresRestart: true } });
785
+ const mergedSettings = makeMockSettings({
786
+ ui: { requiresRestart: false },
787
+ });
788
+ const result = getEffectiveDisplayValue('ui.requiresRestart', settings, mergedSettings);
494
789
  expect(result).toBe(true);
495
790
  });
496
791
  it('should return value from merged settings when not in scope', () => {
497
- const settings = {};
498
- const mergedSettings = { ui: { showMemoryUsage: true } };
499
- const result = getEffectiveDisplayValue('ui.showMemoryUsage', settings, mergedSettings);
792
+ const settings = makeMockSettings({});
793
+ const mergedSettings = makeMockSettings({
794
+ ui: { requiresRestart: true },
795
+ });
796
+ const result = getEffectiveDisplayValue('ui.requiresRestart', settings, mergedSettings);
500
797
  expect(result).toBe(true);
501
798
  });
502
799
  it('should return default value for undefined values', () => {
503
- const settings = {};
504
- const mergedSettings = {};
505
- const result = getEffectiveDisplayValue('ui.showMemoryUsage', settings, mergedSettings);
800
+ const settings = makeMockSettings({});
801
+ const mergedSettings = makeMockSettings({});
802
+ const result = getEffectiveDisplayValue('ui.requiresRestart', settings, mergedSettings);
506
803
  expect(result).toBe(false); // Default value
507
804
  });
508
805
  });