@kabmo-labs/kabmo 0.21.1 → 0.22.0

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 (295) hide show
  1. package/README.md +7 -2
  2. package/dist/client/index.html +9 -8
  3. package/dist/client/index.js +334 -334
  4. package/dist/client/static/js/{index-thwqf24c.js → index-297dck9a.js} +784 -791
  5. package/dist/client/static/js/index-7ppta1pb.css +1 -0
  6. package/extensions/kabmo-modes/commands.ts +17 -3
  7. package/extensions/kabmo-modes/goal-start.ts +101 -0
  8. package/extensions/kabmo-modes/goal.test.ts +80 -5
  9. package/extensions/kabmo-modes/goal.ts +13 -38
  10. package/extensions/kabmo-modes/prompts.test.ts +12 -0
  11. package/extensions/kabmo-modes/prompts.ts +9 -2
  12. package/index.html +8 -7
  13. package/package.json +2 -2
  14. package/src/cli/lib/args.js +9 -0
  15. package/src/cli/lib/args.test.js +26 -0
  16. package/src/cli/lib/commands/doctor.js +153 -0
  17. package/src/cli/lib/commands/doctor.test.js +139 -0
  18. package/src/cli/lib/commands/serve.js +23 -10
  19. package/src/cli/lib/commands/status.js +22 -3
  20. package/src/cli/lib/omp-setup.js +131 -0
  21. package/src/cli/lib/omp-setup.test.js +115 -0
  22. package/src/cli/main.js +1 -1
  23. package/src/client/components/common/DemoDataBadge.tsx +52 -0
  24. package/src/client/components/common/FolderPicker.tsx +2 -2
  25. package/src/client/components/common/Modal.tsx +15 -1
  26. package/src/client/components/common/code-surface/blame-panel.ts +1 -1
  27. package/src/client/components/common/context-usage-button/index.test.tsx +1 -1
  28. package/src/client/components/common/context-usage-button/index.tsx +4 -4
  29. package/src/client/components/common/demo-data-badge.test.tsx +58 -0
  30. package/src/client/components/common/diagram-viewer/index.tsx +2 -2
  31. package/src/client/components/common/editor-view-buttons/index.tsx +2 -2
  32. package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
  33. package/src/client/components/common/header-controls/index.tsx +4 -1
  34. package/src/client/components/common/markdown-review/ReviewPopover.tsx +2 -2
  35. package/src/client/components/common/markdown-review/ReviewSummary.tsx +1 -1
  36. package/src/client/components/common/panel-mark/index.tsx +2 -1
  37. package/src/client/components/common/server-control/Panel.tsx +3 -3
  38. package/src/client/components/common/server-control/index.tsx +1 -1
  39. package/src/client/components/common/shell-update-button/Modal.tsx +1 -1
  40. package/src/client/components/common/todo-row/index.tsx +1 -1
  41. package/src/client/components/layout/ActivityBar.tsx +4 -0
  42. package/src/client/components/layout/ShellNotice.tsx +33 -0
  43. package/src/client/components/layout/desktop-layout/index.tsx +14 -16
  44. package/src/client/components/layout/desktop-layout/resizer/index.tsx +14 -1
  45. package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +2 -1
  46. package/src/client/components/layout/session-sidebar/ClassicView.tsx +5 -1
  47. package/src/client/components/layout/session-sidebar/SessionList.tsx +1 -1
  48. package/src/client/components/layout/session-sidebar/SessionListNotice.tsx +56 -0
  49. package/src/client/components/layout/session-sidebar/SessionsView.tsx +2 -0
  50. package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +1 -1
  51. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +12 -1
  52. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +2 -1
  53. package/src/client/components/layout/session-sidebar/modern/index.tsx +6 -2
  54. package/src/client/components/layout/session-sidebar/new-workspace-modal/CloneField.tsx +1 -1
  55. package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +2 -2
  56. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +1 -1
  57. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +3 -3
  58. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
  59. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +150 -0
  60. package/src/client/components/layout/session-sidebar/variant-props.ts +6 -0
  61. package/src/client/components/mobile/LayoutWrapper.tsx +20 -30
  62. package/src/client/components/mobile/MainView.tsx +5 -2
  63. package/src/client/components/mobile/RightSidebar.tsx +1 -1
  64. package/src/client/components/mobile/SessionSidebar.tsx +3 -0
  65. package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
  66. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +7 -1
  67. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
  68. package/src/client/components/settings/Modal.tsx +15 -1
  69. package/src/client/components/settings/ProjectSelectorDropdown.tsx +1 -1
  70. package/src/client/components/settings/Sidebar.tsx +2 -2
  71. package/src/client/components/settings/categories/OmpSettings.tsx +1 -1
  72. package/src/client/components/settings/categories/TokenUsageSettings.tsx +1 -1
  73. package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +3 -3
  74. package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +1 -1
  75. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +2 -2
  76. package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +5 -5
  77. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +1 -1
  78. package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +1 -1
  79. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +1 -1
  80. package/src/client/components/settings/categories/chat-settings/ComposerStyleSection.tsx +1 -1
  81. package/src/client/components/settings/categories/chat-settings/GoalSection.tsx +1 -1
  82. package/src/client/components/settings/categories/command-settings/DetailPane.tsx +2 -2
  83. package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +5 -5
  84. package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +3 -3
  85. package/src/client/components/settings/categories/omp-settings/RoleRow.tsx +2 -2
  86. package/src/client/components/settings/categories/panel-plugins/LeftDockSettings.tsx +1 -1
  87. package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
  88. package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +4 -3
  89. package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +2 -2
  90. package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +1 -1
  91. package/src/client/components/settings/categories/project-settings/NameInput.tsx +1 -1
  92. package/src/client/components/settings/categories/project-settings/PathField.tsx +1 -1
  93. package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +3 -3
  94. package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +1 -1
  95. package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +2 -2
  96. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
  97. package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +4 -4
  98. package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +2 -2
  99. package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +1 -1
  100. package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +1 -1
  101. package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +2 -2
  102. package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +1 -1
  103. package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +4 -4
  104. package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +2 -2
  105. package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +1 -1
  106. package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +1 -1
  107. package/src/client/components/settings/categories/usage-settings/KenariCard.tsx +5 -5
  108. package/src/client/components/workspace/browser-panel/AddressBar.tsx +1 -1
  109. package/src/client/components/workspace/browser-panel/Screencast.tsx +6 -6
  110. package/src/client/components/workspace/browser-panel/TabStrip.tsx +1 -1
  111. package/src/client/components/workspace/browser-panel/index.tsx +1 -1
  112. package/src/client/components/workspace/browser-toolbar/index.tsx +5 -5
  113. package/src/client/components/workspace/chat-timeline/AttachmentChips.tsx +1 -1
  114. package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +13 -26
  115. package/src/client/components/workspace/chat-timeline/GoalNotice.tsx +2 -2
  116. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +1 -1
  117. package/src/client/components/workspace/chat-timeline/MinimapShortcuts.tsx +1 -1
  118. package/src/client/components/workspace/chat-timeline/QueueList.tsx +1 -1
  119. package/src/client/components/workspace/chat-timeline/SubagentView.tsx +1 -1
  120. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +5 -5
  121. package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +2 -2
  122. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +4 -4
  123. package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -1
  124. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
  125. package/src/client/components/workspace/chat-timeline/chat-input/ArmedGoalStrip.tsx +71 -0
  126. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +4 -3
  127. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +1 -1
  128. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +3 -3
  129. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.test.ts +176 -0
  130. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +70 -81
  131. package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +10 -1
  132. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +20 -0
  133. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +13 -7
  134. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
  135. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +65 -3
  136. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +69 -19
  137. package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +2 -2
  138. package/src/client/components/workspace/chat-timeline/chat-input/composer-portal.test.tsx +174 -0
  139. package/src/client/components/workspace/chat-timeline/chat-input/goal-modal-parts.tsx +80 -0
  140. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +15 -3
  141. package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +3 -1
  142. package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
  143. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -1
  144. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +1 -1
  145. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl.tsx +1 -1
  146. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +1 -1
  147. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
  148. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +2 -2
  149. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +4 -4
  150. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +2 -2
  151. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Header.tsx +1 -1
  152. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/SelectBody.tsx +1 -1
  153. package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +4 -4
  154. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +6 -6
  155. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +13 -13
  156. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Checkpoint.tsx +1 -1
  157. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ContextNotes.tsx +2 -2
  158. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +3 -3
  159. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +9 -9
  160. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +10 -10
  161. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/FileMatches.tsx +1 -1
  162. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +5 -5
  163. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +5 -5
  164. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +6 -6
  165. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +5 -5
  166. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +2 -2
  167. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Memory.tsx +3 -3
  168. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +15 -15
  169. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +2 -2
  170. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +4 -4
  171. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchFs.tsx +2 -2
  172. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchTool.tsx +1 -1
  173. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +4 -4
  174. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +7 -7
  175. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Think.tsx +2 -2
  176. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +2 -2
  177. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.missing.test.ts +4 -2
  178. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +17 -17
  179. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +3 -3
  180. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +1 -1
  181. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +2 -2
  182. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ExcerptCode.tsx +3 -3
  183. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +3 -3
  184. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/JsonCodeBlock.tsx +3 -3
  185. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/OutputWindow.tsx +2 -2
  186. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +2 -2
  187. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +2 -2
  188. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader.tsx +1 -1
  189. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +1 -1
  190. package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +2 -2
  191. package/src/client/components/workspace/context-panel/StatsGrid.tsx +1 -1
  192. package/src/client/components/workspace/context-panel/index.tsx +1 -1
  193. package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +1 -1
  194. package/src/client/components/workspace/editor/EmptyEditor.tsx +1 -1
  195. package/src/client/components/workspace/editor/FindWidget.tsx +1 -1
  196. package/src/client/components/workspace/editor/Tabs.tsx +1 -1
  197. package/src/client/components/workspace/editor/Toolbar.tsx +1 -1
  198. package/src/client/components/workspace/file-explorer/OutlineSection.tsx +2 -2
  199. package/src/client/components/workspace/file-explorer/RowLabel.tsx +1 -1
  200. package/src/client/components/workspace/file-explorer/index.tsx +1 -1
  201. package/src/client/components/workspace/git-panel/BranchToolbar.tsx +2 -2
  202. package/src/client/components/workspace/git-panel/ChangesList.tsx +3 -3
  203. package/src/client/components/workspace/git-panel/ConflictItem.tsx +3 -3
  204. package/src/client/components/workspace/git-panel/FileItem.tsx +2 -2
  205. package/src/client/components/workspace/git-panel/StashSection.tsx +5 -5
  206. package/src/client/components/workspace/git-panel/TreeItem.tsx +2 -2
  207. package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +4 -4
  208. package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -2
  209. package/src/client/components/workspace/git-panel/index.tsx +1 -1
  210. package/src/client/components/workspace/model-dropdown/Item.tsx +3 -3
  211. package/src/client/components/workspace/model-dropdown/Section.tsx +1 -1
  212. package/src/client/components/workspace/model-dropdown/index.tsx +3 -3
  213. package/src/client/components/workspace/plan-panel/index.tsx +2 -2
  214. package/src/client/components/workspace/repo-picker/Modal.tsx +1 -1
  215. package/src/client/components/workspace/repo-picker/Row.tsx +6 -6
  216. package/src/client/components/workspace/search-panel/Body.tsx +2 -2
  217. package/src/client/components/workspace/search-panel/Results.tsx +1 -1
  218. package/src/client/components/workspace/search-panel/index.tsx +1 -1
  219. package/src/client/components/workspace/terminal-panel/index.tsx +1 -1
  220. package/src/client/components/workspace/todo-panel/PhaseGroup.tsx +1 -1
  221. package/src/client/components/workspace/todo-panel/index.tsx +2 -2
  222. package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +5 -5
  223. package/src/client/components/workspace/user-browser-panel/AnnotateBar.test.tsx +13 -13
  224. package/src/client/components/workspace/user-browser-panel/AnnotateBar.tsx +4 -4
  225. package/src/client/components/workspace/user-browser-panel/AnnotateLayer.tsx +1 -1
  226. package/src/client/components/workspace/user-browser-panel/AnnotateTarget.tsx +7 -7
  227. package/src/client/components/workspace/user-browser-panel/Frame.tsx +1 -1
  228. package/src/client/components/workspace/wiki-panel/Nav.tsx +1 -1
  229. package/src/client/components/workspace/wiki-panel/index.tsx +2 -2
  230. package/src/client/glass.css +50 -0
  231. package/src/client/glass.test.ts +68 -24
  232. package/src/client/hooks/chat/composer/browser-context.test.ts +6 -6
  233. package/src/client/hooks/chat/composer/use-draft.test.ts +2 -2
  234. package/src/client/hooks/chat/omp/prompt-send.test.ts +36 -0
  235. package/src/client/hooks/chat/omp/prompt-send.ts +24 -18
  236. package/src/client/hooks/chat/omp/session-list.tsx +24 -70
  237. package/src/client/hooks/chat/omp/session-merges.ts +89 -0
  238. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -1
  239. package/src/client/hooks/chat/timeline/armed-goal-send.test.ts +168 -0
  240. package/src/client/hooks/chat/timeline/armed-goal.test.ts +178 -0
  241. package/src/client/hooks/chat/timeline/goal-command.ts +57 -27
  242. package/src/client/hooks/chat/timeline/index.ts +7 -4
  243. package/src/client/hooks/chat/timeline/mode-post.ts +46 -0
  244. package/src/client/hooks/chat/timeline/modes-contract.ts +94 -0
  245. package/src/client/hooks/chat/timeline/modes.ts +60 -95
  246. package/src/client/hooks/chat/timeline/send-props.ts +97 -0
  247. package/src/client/hooks/chat/timeline/send-steer.test.ts +6 -0
  248. package/src/client/hooks/chat/timeline/send.test-util.ts +55 -8
  249. package/src/client/hooks/chat/timeline/send.test.ts +17 -1
  250. package/src/client/hooks/chat/timeline/send.ts +64 -72
  251. package/src/client/hooks/ui/dialog-behaviour.ts +143 -0
  252. package/src/client/hooks/ui/theme.ts +17 -0
  253. package/src/client/hooks/workspace/copy-tab-path.ts +23 -0
  254. package/src/client/hooks/workspace/mobile-back.ts +71 -0
  255. package/src/client/palette-class.test.ts +93 -0
  256. package/src/client/tailwind-contrast.test.ts +194 -0
  257. package/src/client/tailwind.css +327 -8
  258. package/src/server/lib/assets/theme-shell.server.ts +4 -10
  259. package/src/server/lib/omp/config/provider-seeds.test.ts +39 -1
  260. package/src/server/lib/omp/config/provider-seeds.ts +32 -3
  261. package/src/server/lib/omp/config/provider-vision-compat.test.ts +140 -0
  262. package/src/server/lib/omp/core/host-resolution.test.ts +1 -55
  263. package/src/server/lib/omp/core/install-hint.test.ts +48 -0
  264. package/src/server/lib/omp/core/install-hint.ts +64 -0
  265. package/src/server/lib/omp/core/startup.test.ts +125 -0
  266. package/src/server/lib/omp/core/startup.ts +5 -1
  267. package/src/server/lib/omp/mode/request.ts +14 -6
  268. package/src/server/plugins/ssr.ts +2 -1
  269. package/src/shared/lib/browser/annotate.test.ts +22 -22
  270. package/src/shared/lib/browser/annotate.ts +14 -14
  271. package/src/shared/lib/browser/page-context.ts +6 -6
  272. package/src/shared/lib/icons/icon-paint-authority.test.ts +86 -0
  273. package/src/shared/lib/icons/icon-paint-authority.ts +94 -0
  274. package/src/shared/lib/icons/icon-paint-css.test.ts +44 -8
  275. package/src/shared/lib/icons/icon-paint-css.ts +18 -1
  276. package/src/shared/lib/icons/icon-paint-panel.ts +15 -18
  277. package/src/shared/lib/icons/icon-paint-weight.ts +20 -1
  278. package/src/shared/lib/icons/icon-tone.ts +58 -13
  279. package/src/shared/lib/icons/tint-hues.generated.ts +51 -6
  280. package/src/shared/lib/icons/tint-tones.test.ts +257 -0
  281. package/src/shared/lib/icons/tint.test.ts +3 -211
  282. package/src/shared/lib/icons/tint.ts +23 -25
  283. package/src/shared/lib/omp/mode/actions.ts +40 -0
  284. package/src/shared/lib/omp/mode/types.ts +12 -0
  285. package/src/shared/lib/theme/css.ts +21 -0
  286. package/src/shared/lib/theme/first-frame.ts +38 -0
  287. package/src/shared/lib/theme/ink-scale.test.ts +151 -0
  288. package/src/shared/lib/theme/ink-scale.ts +103 -0
  289. package/src/shared/lib/theme/shell-palette.test.ts +22 -5
  290. package/src/shared/lib/theme/shell-palette.ts +9 -4
  291. package/src/shared/lib/theme/theme.test.ts +28 -3
  292. package/src/shared/lib/workspace/project-accent.test.ts +33 -1
  293. package/src/shared/lib/workspace/project-accent.ts +23 -0
  294. package/src/shared/types/omp/agent.ts +24 -9
  295. package/dist/client/static/js/index-0721wrkf.css +0 -1
@@ -0,0 +1,194 @@
1
+ /**
2
+ * The `text-ink/NN` ramp, against the palettes it serves: a fixed lightness
3
+ * ramp, plus the one solved level (`text-muted`) that clears AA everywhere.
4
+ */
5
+
6
+ import { describe, expect, test } from 'bun:test';
7
+ import { readFileSync } from 'node:fs';
8
+ import { resolve } from 'node:path';
9
+
10
+ import { THEMES } from '@/shared/lib/theme/catalog';
11
+ import { themeStyleSheet } from '@/shared/lib/theme/css';
12
+ import {
13
+ MUTED_STEPS,
14
+ SIGNAL_SLOTS,
15
+ TEXT_CONTRAST_FLOOR,
16
+ inkScale,
17
+ signalTextColor,
18
+ worstTextContrast,
19
+ } from '@/shared/lib/theme/ink-scale';
20
+ import { parseHexColor } from '@/shared/lib/theme/color';
21
+
22
+ const CSS = readFileSync(resolve(import.meta.dir, 'tailwind.css'), 'utf8');
23
+
24
+ /** The fifteen steps the ramp has to cover, each with its own colour. */
25
+ const STEPS = MUTED_STEPS;
26
+
27
+ /** OKLab lightness, so the ramp's SHAPE is measurable rather than asserted. */
28
+ function lightness(hex: string): number {
29
+ const color = parseHexColor(hex);
30
+ if (!color) return Number.NaN;
31
+ const linear = (value: number) => {
32
+ const v = value / 255;
33
+ return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
34
+ };
35
+ const r = linear(color.r);
36
+ const g = linear(color.g);
37
+ const b = linear(color.b);
38
+ const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
39
+ const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
40
+ const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
41
+ return 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
42
+ }
43
+
44
+ describe('the muted-text ramp', () => {
45
+ test('the ramp is a steady lightness ladder, not a contrast curve', () => {
46
+ // This is the property two "fixes" destroyed. Fitting the steps to a
47
+ // contrast target compressed the dark end (ΔL 0.193 at `/35`, 0.098 at
48
+ // `/90`), which collapsed a tool card's header/subtitle pair and darkened
49
+ // the composer placeholder into looking like a typed value. A constant ΔL is
50
+ // what the eye reads as "evenly spaced ranks".
51
+ const ladder = inkScale(THEMES.find((theme) => theme.id === 'paper')!).ladder;
52
+ const deltas = ladder.slice(1).map((color, index) => lightness(ladder[index]) - lightness(color));
53
+ const min = Math.min(...deltas);
54
+ const max = Math.max(...deltas);
55
+ expect(min).toBeGreaterThan(0.025);
56
+ expect(max / min).toBeLessThan(1.5);
57
+ });
58
+
59
+ test('raising one step is always a move, and a visible one where the palette can afford it', () => {
60
+ // A light palette's ramp darkens as the step rises; a dark palette's ramp
61
+ // lightens. The invariant is the SIZE of the move, not its sign.
62
+ //
63
+ // The size is bounded by the palette's own range: `solarized-light` puts its
64
+ // ink 4.85:1 from its paper, so fifteen steps have less room and its
65
+ // smallest gap is 0.0198. Asserting 0.02 there would be asserting that the
66
+ // palette has more contrast than it does.
67
+ for (const theme of THEMES) {
68
+ const ladder = inkScale(theme).ladder;
69
+ const headroom = worstTextContrast(theme.ink, theme) >= 10;
70
+ for (let index = 1; index < ladder.length; index += 1) {
71
+ const gap = Math.abs(lightness(ladder[index - 1]) - lightness(ladder[index]));
72
+ expect(gap, `${theme.id} /${STEPS[index]}`).toBeGreaterThan(0.015);
73
+ if (headroom) expect(gap, `${theme.id} /${STEPS[index]}`).toBeGreaterThan(0.025);
74
+ }
75
+ }
76
+ });
77
+
78
+ test('the lightest step that carries meaning clears AA on the default palette', () => {
79
+ const paper = THEMES.find((theme) => theme.id === 'paper')!;
80
+ const floor = inkScale(paper).ladder[STEPS.indexOf(TEXT_CONTRAST_FLOOR)];
81
+ expect(worstTextContrast(floor, paper)).toBeGreaterThanOrEqual(4.5);
82
+ // And the step below it does NOT, so the boundary sits where it is needed
83
+ // rather than somewhere comfortably safe.
84
+ const below = inkScale(paper).ladder[STEPS.indexOf(TEXT_CONTRAST_FLOOR) - 1];
85
+ expect(worstTextContrast(below, paper)).toBeLessThan(4.5);
86
+ });
87
+
88
+ test('the muted level is the same floor, not a second convention', () => {
89
+ const paper = THEMES.find((theme) => theme.id === 'paper')!;
90
+ expect(inkScale(paper).muted).toBe(inkScale(paper).ladder[STEPS.indexOf(TEXT_CONTRAST_FLOOR)]);
91
+ });
92
+
93
+ test('`text-muted` is the one rung that is legal on every palette', () => {
94
+ // The numbered rungs are a fixed lightness ladder, so their contrast varies
95
+ // with the palette: measured in the running app, `/65` is 5.31:1 on `paper`
96
+ // but 3.67:1 on `one-dark-pro-soft` and 3.29:1 on `solarized-light`. Text
97
+ // that must read uses this token, which is solved per palette.
98
+ const failing: string[] = [];
99
+ for (const theme of THEMES) {
100
+ if (worstTextContrast(inkScale(theme).muted, theme) < 4.5) failing.push(theme.id);
101
+ }
102
+ expect(failing).toEqual([]);
103
+ // Every palette states it once, so the OS shells and the client agree.
104
+ expect(themeStyleSheet().match(/--theme-muted:/g)?.length).toBe(THEMES.length);
105
+ });
106
+
107
+ test('each rung maps to its own token, so fifteen steps stay fifteen colours', () => {
108
+ // Bucketing onto a shared token is what collapsed the ladder twice. Every
109
+ // palette must state all fifteen, and none may repeat a value within itself.
110
+ const css = themeStyleSheet();
111
+ for (const theme of THEMES) {
112
+ const block = css.slice(css.indexOf(`html[data-theme="${theme.id}"]`));
113
+ const closed = block.slice(0, block.indexOf('}'));
114
+ const values = [...closed.matchAll(/--theme-ink-\d+: (#[0-9a-f]{6});/g)].map((m) => m[1]);
115
+ expect(values.length, theme.id).toBe(STEPS.length);
116
+ if (theme.id === 'solarized-light') continue; // too little range to spread
117
+ expect(new Set(values).size, theme.id).toBe(STEPS.length);
118
+ }
119
+ });
120
+
121
+ test('placeholder text has its own band, dimmer than a label', () => {
122
+ expect(CSS).toContain('.placeholder-ink\\/30::placeholder');
123
+ expect(CSS).toContain('.placeholder\\:text-ink\\/30::placeholder');
124
+ expect(CSS).toContain('color: var(--theme-ink-30)');
125
+ });
126
+ });
127
+
128
+ describe('the signal colours as text', () => {
129
+ test('every slot clears AA on every palette once solved', () => {
130
+ // Measured before: `text-success` 1.75:1 on `nord-light`, `text-warning`
131
+ // 1.53:1 on `carbonfox-light`, and every slot failing on 14-22 of 63
132
+ // palettes — the palette hexes are chosen for a FILL, not for an 11px word.
133
+ const failing: string[] = [];
134
+ for (const theme of THEMES) {
135
+ for (const slot of SIGNAL_SLOTS) {
136
+ const color = signalTextColor(theme, slot);
137
+ if (worstTextContrast(color, theme) < 4.5 - 0.001) failing.push(`${theme.id}/${slot}`);
138
+ }
139
+ }
140
+ expect(failing).toEqual([]);
141
+ });
142
+
143
+ test('a palette whose signal already reads keeps its own hex', () => {
144
+ const paper = THEMES.find((theme) => theme.id === 'paper')!;
145
+ expect(signalTextColor(paper, 'error')).toBe(paper.error);
146
+ // `paper`'s info is 3.86:1 on canvas, so it IS solved — and only by as much
147
+ // as the floor requires.
148
+ expect(signalTextColor(paper, 'info')).not.toBe(paper.info);
149
+ expect(worstTextContrast(signalTextColor(paper, 'info'), paper)).toBeGreaterThanOrEqual(4.5);
150
+ });
151
+
152
+ test('the override exists and cannot reach an icon', () => {
153
+ expect(CSS).toContain('html :is(span, div, p, a, li, td, th');
154
+ expect(CSS).toContain('.text-error');
155
+ expect(CSS).toContain('var(--theme-error-text)');
156
+ // The `:is(...)` subject list must not include `svg`, or the icon colour
157
+ // mode would be overridden by a solved text colour.
158
+ expect(CSS).not.toContain('svg).text-error');
159
+ });
160
+
161
+ test('every palette states a solved text token for all five slots', () => {
162
+ const css = themeStyleSheet();
163
+ for (const slot of SIGNAL_SLOTS) {
164
+ expect(css.match(new RegExp(`--theme-${slot}-text:`, 'g'))?.length).toBe(THEMES.length);
165
+ }
166
+ });
167
+ });
168
+
169
+ describe('touch targets', () => {
170
+ test('the floor is real geometry, and only on a coarse pointer', () => {
171
+ // Measured before: 15 of 28 phone controls under 44px. An invisible
172
+ // pseudo-element was tried first and rejected: headless Chromium never
173
+ // reports `pointer: coarse` (so it could not be verified), and a 44px
174
+ // overlay on a 32px button with a 4px gap steals its neighbour's taps.
175
+ expect(CSS).toContain('@media (pointer: coarse)');
176
+ expect(CSS).toContain('min-width: 44px');
177
+ expect(CSS).toContain('min-height: 44px');
178
+ // No overlapping overlay: the pseudo-element approach must not come back.
179
+ expect(CSS).not.toContain('.tap-target::after');
180
+ });
181
+ });
182
+
183
+ describe('motion', () => {
184
+ test('the user\'s reduced-motion preference stops the ambient animation once', () => {
185
+ // Measured with the preference active: `.animate-spin` still computed
186
+ // `spin 1s infinite` and `.animate-pulse` `pulse 2s infinite`, because only
187
+ // three hand-written places honoured it.
188
+ const block = CSS.slice(CSS.indexOf('Motion, under the user'));
189
+ expect(block).toContain('@media (prefers-reduced-motion: reduce)');
190
+ expect(block).toContain('.animate-pulse');
191
+ expect(block).toContain('animation: none');
192
+ });
193
+ });
194
+
@@ -28,14 +28,43 @@
28
28
  * `NERD_SYMBOLS_FAMILY`, which `nerd-symbols.test.ts` asserts. */
29
29
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "FiraCode Nerd Font Mono", "FiraCode Nerd Font", "JetBrainsMono Nerd Font", "JetBrainsMono NF", "JetBrains Mono Nerd Font", "Hack Nerd Font", "MesloLGS NF", "MesloLGM Nerd Font", "CaskaydiaCove Nerd Font", "SauceCodePro Nerd Font", "Symbols Nerd Font Mono", "Symbols Nerd Font", "PowerlineSymbols", "Kabmo Nerd Symbols";
30
30
  --color-ink: var(--theme-ink);
31
+ /* One token per `text-ink/NN` step, each the ink at that percentage over the
32
+ paper. Emitted per palette by `shared/lib/theme/css.ts`. */
33
+ --color-ink-20: var(--theme-ink-20);
34
+ --color-ink-25: var(--theme-ink-25);
35
+ --color-ink-30: var(--theme-ink-30);
36
+ --color-ink-35: var(--theme-ink-35);
37
+ --color-ink-40: var(--theme-ink-40);
38
+ --color-ink-45: var(--theme-ink-45);
39
+ --color-ink-50: var(--theme-ink-50);
40
+ --color-ink-55: var(--theme-ink-55);
41
+ --color-ink-60: var(--theme-ink-60);
42
+ --color-ink-65: var(--theme-ink-65);
43
+ --color-ink-70: var(--theme-ink-70);
44
+ --color-ink-75: var(--theme-ink-75);
45
+ --color-ink-80: var(--theme-ink-80);
46
+ --color-ink-85: var(--theme-ink-85);
47
+ --color-ink-90: var(--theme-ink-90);
48
+ /* Muted text for an INVERTED surface (`bg-ink`), solved like the rest: an
49
+ alpha over the canvas reads 2.91:1 there on `solarized-light`. */
50
+ --color-on-ink-muted: var(--theme-on-ink-muted);
31
51
  --color-paper: var(--theme-paper);
32
52
  --color-canvas: var(--theme-canvas);
53
+ /* Signal colours, twice: the FILL (`bg-error`, a chip's ground) keeps the
54
+ palette's own hex, and the TEXT token is the same hue solved until it can
55
+ be read. Measured before: `text-success` reached 1.75:1 on `nord-light`,
56
+ and every slot failed AA on 14-22 of the 63 palettes. */
33
57
  --color-error: var(--theme-error);
58
+ --color-error-text: var(--theme-error-text);
34
59
  --color-success: var(--theme-success);
60
+ --color-success-text: var(--theme-success-text);
35
61
  --color-meta: var(--theme-meta);
62
+ --color-meta-text: var(--theme-meta-text);
36
63
  --color-info: var(--theme-info);
64
+ --color-info-text: var(--theme-info-text);
37
65
  --color-info-hover: var(--theme-info-hover);
38
66
  --color-warning: var(--theme-warning);
67
+ --color-warning-text: var(--theme-warning-text);
39
68
  --color-warning-hover: var(--theme-warning-hover);
40
69
  /* The brand mark's own colour, and deliberately NOT a theme token: the logo
41
70
  is the same mark in every palette, so a theme flip must not repaint the
@@ -61,7 +90,37 @@
61
90
  --theme-paper: #faf8f3;
62
91
  --theme-canvas: #f4f1ea;
63
92
  --theme-ink: #141310;
93
+ /* The fifteen steps as `inkScale()` derives them for this palette: the ink
94
+ at N% over the paper, which is the shipped lightness ramp. Not solved for
95
+ contrast — a separator is allowed to be a separator. The SSR sheet
96
+ re-states them for every other theme. */
97
+ --theme-ink-20: #cccac6;
98
+ --theme-ink-25: #c1bfba;
99
+ --theme-ink-30: #b5b3af;
100
+ --theme-ink-35: #aaa8a4;
101
+ --theme-ink-40: #9e9c98;
102
+ --theme-ink-45: #93918d;
103
+ --theme-ink-50: #878682;
104
+ --theme-ink-55: #7b7a76;
105
+ --theme-ink-60: #706f6b;
106
+ --theme-ink-65: #65635f;
107
+ --theme-ink-70: #595854;
108
+ --theme-ink-75: #4e4c49;
109
+ --theme-ink-80: #42413d;
110
+ --theme-ink-85: #373532;
111
+ --theme-ink-90: #2b2a27;
112
+ --theme-on-ink-muted: #f4f1ea;
113
+ /* The one level guaranteed to clear AA on this palette (`inkScale().muted`).
114
+ `text-muted` uses it; the numbered rungs do not promise AA. */
115
+ --theme-muted: #65635f;
64
116
  --theme-error: #c8321e;
117
+ /* Solved by `signalTextColor()` for this palette; the SSR sheet restates all
118
+ five for every other theme (see `ink-scale.ts`). */
119
+ --theme-error-text: #c8321e;
120
+ --theme-success-text: #047857;
121
+ --theme-info-text: #0274af;
122
+ --theme-warning-text: #c2410c;
123
+ --theme-meta-text: #4f46e5;
65
124
  --theme-success: #047857;
66
125
  --theme-meta: #4f46e5;
67
126
  --theme-info: #0284c7;
@@ -74,14 +133,24 @@
74
133
  --paper-raised: var(--theme-paper);
75
134
  --paper-card: var(--theme-paper);
76
135
  --ink-primary: var(--theme-ink);
77
- --ink-secondary: color-mix(in srgb, var(--theme-ink) 62%, transparent);
78
- --ink-muted: color-mix(in srgb, var(--theme-ink) 42%, transparent);
136
+ /* Two derived inks. Text goes through `--theme-ink-muted` (see
137
+ `ink-scale.ts`); `--ink-hairline` is borders only. */
138
+ --ink-secondary: var(--theme-ink-50);
139
+ --ink-muted: var(--theme-ink-40);
79
140
  --ink-hairline: color-mix(in srgb, var(--theme-ink) 14%, transparent);
80
141
  --signal-red: var(--theme-error);
81
142
  }
82
143
 
83
144
  body {
84
- font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
145
+ /* One UI stack, and it is the one that actually renders. The previous
146
+ value named `IBM Plex Sans` first, and no stylesheet ever shipped that
147
+ face: measured in the running app, `document.fonts.check('16px "IBM Plex
148
+ Sans"')` resolved against the fallback, so every heading was drawn in the
149
+ system UI face while the code claimed otherwise. The system stack IS the
150
+ product's voice (a console that looks like the machine it runs on), and
151
+ the mono face is bundled, so data stays on one family everywhere.
152
+ `--font-sans` in `@theme` carries the same stack for `font-sans`. */
153
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "FiraCode Nerd Font Mono", "FiraCode Nerd Font", "JetBrainsMono Nerd Font", "JetBrainsMono NF", "JetBrains Mono Nerd Font", "Hack Nerd Font", "MesloLGS NF", "MesloLGM Nerd Font", "CaskaydiaCove Nerd Font", "SauceCodePro Nerd Font", "Symbols Nerd Font Mono", "Symbols Nerd Font", PowerlineSymbols, "Kabmo Nerd Symbols";
85
154
  background-color: var(--theme-canvas);
86
155
  color: var(--theme-ink);
87
156
  }
@@ -295,11 +364,9 @@
295
364
  background-color: color-mix(in srgb, var(--theme-error) 75%, var(--theme-ink));
296
365
  }
297
366
 
298
- /* Dot grain texture for Hero production card */
299
- .dot-grain-texture {
300
- background-image: radial-gradient(color-mix(in srgb, var(--theme-ink) 6%, transparent) 0.65px, transparent 0.65px);
301
- background-size: 4px 4px;
302
- }
367
+ /* (The hero card's dot-grain texture lived here and was used by nothing: the
368
+ deploy hero it decorated is not part of this product. A texture with no
369
+ consumer is a rule that only drifts.) */
303
370
 
304
371
  /* ============================================================================
305
372
  * Scrollbars — ONE size, ONE palette, ONE reveal rule, for every scroll
@@ -1170,3 +1237,255 @@ html[data-theme-variant='dark'] .brand-wordmark-glow {
1170
1237
  .md-review-active .prose-content [data-md-block] a {
1171
1238
  cursor: pointer;
1172
1239
  }
1240
+
1241
+ /* The `text-ink/NN` ramp: a weight, not a translucency. Each step points at its
1242
+ * own token, so `text-ink/40` is the ink at 40% over the paper.
1243
+ *
1244
+ * Rungs are a fixed lightness ramp, not a contrast curve: fitting them to AA
1245
+ * compresses the dark end until a header and its subtitle read as one grey. Text
1246
+ * that must clear AA uses `text-muted`; the numbers live in `ink-scale.ts`.
1247
+ *
1248
+ * Inside `utilities` so the icon colour mode (0,4,1) still wins; `html` plus the
1249
+ * class is (0,2,0), and variants are restated so `hover:` still moves. */
1250
+ @layer utilities {
1251
+ html .text-ink\/20 {
1252
+ color: var(--theme-ink-20);
1253
+ }
1254
+ html .text-ink\/25 {
1255
+ color: var(--theme-ink-25);
1256
+ }
1257
+ html .text-ink\/30 {
1258
+ color: var(--theme-ink-30);
1259
+ }
1260
+ html .text-ink\/35 {
1261
+ color: var(--theme-ink-35);
1262
+ }
1263
+ html .text-ink\/40 {
1264
+ color: var(--theme-ink-40);
1265
+ }
1266
+ html .text-ink\/45 {
1267
+ color: var(--theme-ink-45);
1268
+ }
1269
+ html .text-ink\/50 {
1270
+ color: var(--theme-ink-50);
1271
+ }
1272
+ html .text-ink\/55 {
1273
+ color: var(--theme-ink-55);
1274
+ }
1275
+ html .text-ink\/60 {
1276
+ color: var(--theme-ink-60);
1277
+ }
1278
+ html .text-ink\/65 {
1279
+ color: var(--theme-ink-65);
1280
+ }
1281
+ html .text-ink\/70 {
1282
+ color: var(--theme-ink-70);
1283
+ }
1284
+ html .text-ink\/75 {
1285
+ color: var(--theme-ink-75);
1286
+ }
1287
+ html .text-ink\/80 {
1288
+ color: var(--theme-ink-80);
1289
+ }
1290
+ html .text-ink\/85 {
1291
+ color: var(--theme-ink-85);
1292
+ }
1293
+ html .text-ink\/90 {
1294
+ color: var(--theme-ink-90);
1295
+ }
1296
+
1297
+ /* Hover and press states step one rung louder than the resting weight, so a
1298
+ muted row still responds rather than looking dead. */
1299
+ html .hover\:text-ink\/50:hover {
1300
+ color: var(--theme-ink-60);
1301
+ }
1302
+
1303
+ html .hover\:text-ink\/60:hover {
1304
+ color: var(--theme-ink-70);
1305
+ }
1306
+
1307
+ html .hover\:text-ink\/70:hover {
1308
+ color: var(--theme-ink-85);
1309
+ }
1310
+
1311
+ html .hover\:text-ink\/80:hover {
1312
+ color: var(--theme-ink);
1313
+ }
1314
+
1315
+ html .group:hover .group-hover\:text-ink\/50 {
1316
+ color: var(--theme-ink-60);
1317
+ }
1318
+
1319
+ html .group:hover .group-hover\:text-ink\/80 {
1320
+ color: var(--theme-ink);
1321
+ }
1322
+
1323
+ html .disabled\:hover\:text-ink\/45:disabled:hover,
1324
+ html .disabled\:hover\:text-ink\/45:hover:disabled {
1325
+ color: var(--theme-ink-50);
1326
+ }
1327
+
1328
+ /* The one rung legal on every palette. Measured, `/65` is 5.31:1 on `paper`
1329
+ but 3.67:1 on `one-dark-pro-soft`; this resolves to the palette's own solved
1330
+ level instead. `html` plus the class keeps the icon mode (0,4,1) winning. */
1331
+ html .text-muted {
1332
+ color: var(--theme-muted);
1333
+ }
1334
+ html .hover\:text-muted:hover {
1335
+ color: var(--theme-muted);
1336
+ }
1337
+
1338
+ /* Placeholders: their own steps, still the solved colours. */
1339
+ html .placeholder-ink\/30::placeholder,
1340
+ html .placeholder\:text-ink\/30::placeholder {
1341
+ color: var(--theme-ink-30);
1342
+ }
1343
+ html .placeholder-ink\/35::placeholder,
1344
+ html .placeholder\:text-ink\/35::placeholder {
1345
+ color: var(--theme-ink-35);
1346
+ }
1347
+ html .placeholder-ink\/40::placeholder,
1348
+ html .placeholder\:text-ink\/40::placeholder {
1349
+ color: var(--theme-ink-40);
1350
+ }
1351
+ }
1352
+
1353
+ /* The generating indicator's three dots.
1354
+ *
1355
+ * They used to be a `<style>` block inside the component — the ONLY inline
1356
+ * stylesheet in `src/client` — which re-declared the same keyframes on every
1357
+ * render of every indicator a transcript held. Stated here once instead, and
1358
+ * parked under `prefers-reduced-motion` like every other moving thing. */
1359
+ @keyframes indicator-dot {
1360
+ 0%,
1361
+ 100% {
1362
+ opacity: 0.35;
1363
+ transform: translateY(0);
1364
+ }
1365
+ 50% {
1366
+ opacity: 1;
1367
+ transform: translateY(-15%);
1368
+ }
1369
+ }
1370
+
1371
+ .dot-anim-1,
1372
+ .dot-anim-2,
1373
+ .dot-anim-3 {
1374
+ animation: indicator-dot 1.2s infinite both;
1375
+ }
1376
+
1377
+ .dot-anim-2 {
1378
+ animation-delay: 0.2s;
1379
+ }
1380
+
1381
+ .dot-anim-3 {
1382
+ animation-delay: 0.4s;
1383
+ }
1384
+
1385
+ @media (prefers-reduced-motion: reduce) {
1386
+ .dot-anim-1,
1387
+ .dot-anim-2,
1388
+ .dot-anim-3 {
1389
+ animation: none;
1390
+ opacity: 0.7;
1391
+ }
1392
+ }
1393
+
1394
+ /* ============================================================================
1395
+ * Motion, under the user's own switch.
1396
+ *
1397
+ * Measured with `prefers-reduced-motion: reduce` active, `.animate-spin` still
1398
+ * computed `spin 1s infinite` and `.animate-pulse` `pulse 2s infinite`: the app
1399
+ * honoured the preference in three hand-written places (the section reveal, the
1400
+ * extension dialog, the wait bar) and nowhere else, so 107 `animate-spin` call
1401
+ * sites and every skeleton kept moving for a user who had asked them not to.
1402
+ *
1403
+ * The rule stops the ANIMATION, not the element: a loader that disappears is
1404
+ * worse than one that moves, so it keeps its shape and takes a static opacity
1405
+ * that still reads as "in progress". A spinner has no non-animated equivalent,
1406
+ * which is why `spin` is slowed rather than switched off mid-rotation.
1407
+ * ------------------------------------------------------------------------- */
1408
+ @media (prefers-reduced-motion: reduce) {
1409
+ .animate-pulse {
1410
+ animation: none;
1411
+ opacity: 0.6;
1412
+ }
1413
+
1414
+ .animate-spin {
1415
+ animation-duration: 3s;
1416
+ }
1417
+
1418
+ .animate-bounce,
1419
+ .animate-ping {
1420
+ animation: none;
1421
+ }
1422
+ }
1423
+
1424
+ /* ============================================================================
1425
+ * `text-error` and friends: the same signal, as READABLE text.
1426
+ *
1427
+ * The five signal slots are chosen for a FILL: a failed chip's ground, a 2px
1428
+ * severity rule. The UI also prints them as words (`text-error`, `text-warning`,
1429
+ * `text-success`, `text-info`, `text-meta` — 514 call sites between them), and a
1430
+ * status word is text a user reads. Measured as text on the palette's own
1431
+ * surface, `success` reaches 1.75:1 on `nord-light` and `warning` 1.53:1 on
1432
+ * `carbonfox-light`; every slot fails AA on 14-22 of the 63 palettes.
1433
+ *
1434
+ * So the fill keeps the palette hex and the TEXT resolves to the solved level
1435
+ * (`signalTextColor`, emitted as `--theme-<slot>-text`). The override lives here
1436
+ * rather than at 514 call sites for the same reason the ink ramp does: one
1437
+ * mapping, and the call sites keep the name that says what the colour MEANS.
1438
+ * Unlayered, so it outranks Tailwind's own utility at any specificity.
1439
+ *
1440
+ * The subject list is load-bearing: a glyph carries the class on the `<svg>`
1441
+ * itself, and the icon colour mode must keep deciding its paint. Only text
1442
+ * elements move.
1443
+ * ------------------------------------------------------------------------- */
1444
+ html :is(span, div, p, a, li, td, th, h1, h2, h3, h4, h5, h6, label, strong, em, small, code, kbd, output, summary).text-error {
1445
+ color: var(--theme-error-text);
1446
+ }
1447
+
1448
+ html :is(span, div, p, a, li, td, th, h1, h2, h3, h4, h5, h6, label, strong, em, small, code, kbd, output, summary).text-success {
1449
+ color: var(--theme-success-text);
1450
+ }
1451
+
1452
+ html :is(span, div, p, a, li, td, th, h1, h2, h3, h4, h5, h6, label, strong, em, small, code, kbd, output, summary).text-info {
1453
+ color: var(--theme-info-text);
1454
+ }
1455
+
1456
+ html :is(span, div, p, a, li, td, th, h1, h2, h3, h4, h5, h6, label, strong, em, small, code, kbd, output, summary).text-warning {
1457
+ color: var(--theme-warning-text);
1458
+ }
1459
+
1460
+ html :is(span, div, p, a, li, td, th, h1, h2, h3, h4, h5, h6, label, strong, em, small, code, kbd, output, summary).text-meta {
1461
+ color: var(--theme-meta-text);
1462
+ }
1463
+
1464
+ /* ============================================================================
1465
+ * The touch target floor: 44px, as real geometry.
1466
+ *
1467
+ * Measured on the running phone layout (390x844), 15 of 28 controls were below
1468
+ * the 44px minimum: header buttons at 32x32, the composer's plan/goal toggles at
1469
+ * 28x20, attach and maximize at 22x22, the access chip at 32x20.
1470
+ *
1471
+ * The first attempt put an invisible 44px pseudo-element over each one. Two
1472
+ * measured problems killed it: headless Chromium never reports `pointer: coarse`
1473
+ * (so the rule could not be verified at all), and a 44px overlay on a 32px button
1474
+ * with a 4px gap overlaps its neighbour by 8px — a tap near the edge would go to
1475
+ * whichever button paints last. A hit area that can steal a neighbour's click is
1476
+ * worse than a small target.
1477
+ *
1478
+ * So the size is real and part of the layout, and scoped to a coarse pointer so
1479
+ * the desktop keeps the density it was measured at.
1480
+ * ------------------------------------------------------------------------- */
1481
+ @media (pointer: coarse) {
1482
+ .tap-target {
1483
+ min-width: 44px;
1484
+ min-height: 44px;
1485
+ }
1486
+
1487
+ .tap-chip {
1488
+ min-width: 44px;
1489
+ min-height: 44px;
1490
+ }
1491
+ }
@@ -26,7 +26,6 @@
26
26
 
27
27
  import { resolve } from 'path';
28
28
 
29
- import { parseHexColor, rgbaToHex } from '@/shared/lib/theme/color';
30
29
  import { packageDir } from '@/server/lib/fs/package-root';
31
30
  import type { ThemePalette } from '@/shared/types/theme';
32
31
 
@@ -106,13 +105,8 @@ export function themedManifest(source: string, palette: ThemePalette): string {
106
105
  }
107
106
 
108
107
  /**
109
- * The inline style that paints the first frame.
110
- *
111
- * Unlayered on purpose: Tailwind's base layer declares the same values, and an
112
- * unlayered author rule wins over a layered one — so this cannot lose to the
113
- * bundle it is standing in for. It carries no `!important`, because the values
114
- * ARE the document's own and nothing needs overriding once the bundle lands.
108
+ * The inline style that paints the first frame, re-exported from the shared
109
+ * module: the CLIENT rewrites this same rule on every theme switch, so the
110
+ * two writers cannot be allowed to state it differently.
115
111
  */
116
- export function firstFrameStyle(palette: ThemePalette): string {
117
- return `html,body{background-color:${rgbaToHex(parseHexColor(palette.canvas) ?? { r: 0, g: 0, b: 0, a: 1 })};}`;
118
- }
112
+ export { firstFrameStyle } from '@/shared/lib/theme/first-frame';
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { describe, expect, test } from 'bun:test';
18
18
 
19
- import { manualModelSeed, toModelEntry } from '@/server/lib/omp/config/provider-seeds';
19
+ import { backfillableIds, manualModelSeed, toModelEntry } from '@/server/lib/omp/config/provider-seeds';
20
20
  import { validateModelsDocument, sanitizeModelEntry } from '@/server/lib/omp/config/models-validation';
21
21
 
22
22
  describe('manualModelSeed', () => {
@@ -136,6 +136,44 @@ describe('manualModelSeed — reasoning ladder', () => {
136
136
  });
137
137
  });
138
138
 
139
+ describe('toModelEntry — image input', () => {
140
+ test('a vision model declares the compat that makes omp send the pixels', () => {
141
+ const entry = toModelEntry(manualModelSeed({ id: 'deepseek-v4-1-flash', imageInput: true }));
142
+ expect(entry.input).toEqual(['text', 'image']);
143
+ expect(entry.compat).toEqual({ stripImageInput: false });
144
+ expect(validateModelsDocument({
145
+ providers: { p: { baseUrl: 'https://x/v1', apiKey: 'k', api: 'openai-completions', models: [entry] } },
146
+ })).toEqual([]);
147
+ });
148
+
149
+ test('a text-only model writes neither the image input nor the compat block', () => {
150
+ const entry = toModelEntry(manualModelSeed({ id: 'm', imageInput: false }));
151
+ expect(entry.input).toEqual(['text']);
152
+ expect(entry.compat).toBeUndefined();
153
+ });
154
+ });
155
+
156
+ describe('backfillableIds — image input', () => {
157
+ const seed = (imageInput: boolean) => new Map([['m', { id: 'm', imageInput }]]);
158
+
159
+ test('an entry that names the image input but no compat is worth repairing', () => {
160
+ // This is the pair omp reads as "vision declared, every picture stripped",
161
+ // so re-importing the provider has to touch it.
162
+ expect(backfillableIds([{ id: 'm', input: ['text', 'image'] }], seed(true))).toEqual(['m']);
163
+ });
164
+
165
+ test('an entry that already carries compat is left alone', () => {
166
+ expect(backfillableIds(
167
+ [{ id: 'm', input: ['text', 'image'], compat: { stripImageInput: false } }],
168
+ seed(true),
169
+ )).toEqual([]);
170
+ });
171
+
172
+ test('a text-only seed never invites a compat block', () => {
173
+ expect(backfillableIds([{ id: 'm', input: ['text'] }], seed(false))).toEqual([]);
174
+ });
175
+ });
176
+
139
177
  describe('validateModelsDocument — thinking', () => {
140
178
  test('refuses a ladder omp does not know', () => {
141
179
  const errors = validateModelsDocument({