@kabmo-labs/kabmo 0.22.0 → 0.24.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 (446) hide show
  1. package/README.md +1 -1
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +873 -524
  4. package/dist/client/static/js/{index-297dck9a.js → index-jcr5twtp.js} +799 -795
  5. package/dist/client/static/js/index-z3w7n85q.css +1 -0
  6. package/marketplace/plugins/stats/package.json +2 -2
  7. package/marketplace/plugins/stats/src/groups.test.ts +14 -0
  8. package/marketplace/plugins/stats/src/groups.ts +20 -0
  9. package/marketplace/plugins/stats/src/labels.test.ts +9 -0
  10. package/marketplace/plugins/stats/src/labels.ts +7 -0
  11. package/marketplace/plugins/stats/src/server.ts +1 -1
  12. package/package.json +1 -1
  13. package/src/client/App.tsx +20 -19
  14. package/src/client/components/common/ComposerTextarea.tsx +10 -1
  15. package/src/client/components/common/Modal.tsx +2 -6
  16. package/src/client/components/common/PWAInstallButton.tsx +3 -2
  17. package/src/client/components/common/Toast.test.tsx +298 -0
  18. package/src/client/components/common/Toast.tsx +103 -37
  19. package/src/client/components/common/ToastStack.tsx +33 -12
  20. package/src/client/components/common/ViewportSelector.tsx +122 -114
  21. package/src/client/components/common/context-usage-button/Ring.tsx +38 -1
  22. package/src/client/components/common/context-usage-button/index.test.tsx +19 -3
  23. package/src/client/components/common/context-usage-button/index.tsx +5 -2
  24. package/src/client/components/common/harness-glyph/brands.ts +65 -0
  25. package/src/client/components/common/harness-glyph/harness-glyph.test.ts +185 -0
  26. package/src/client/components/common/harness-glyph/index.tsx +131 -0
  27. package/src/client/components/common/header-controls/MoreMenu.tsx +2 -1
  28. package/src/client/components/common/header-controls/index.tsx +16 -8
  29. package/src/client/components/common/header-panel-buttons/index.tsx +4 -3
  30. package/src/client/components/common/panel-mark/index.test.tsx +2 -2
  31. package/src/client/components/common/panel-mark/index.tsx +11 -2
  32. package/src/client/components/common/search-select/index.tsx +305 -0
  33. package/src/client/components/common/search-select/search-select.test.tsx +217 -0
  34. package/src/client/components/common/server-control/index.tsx +3 -2
  35. package/src/client/components/common/session-row/index.tsx +18 -1
  36. package/src/client/components/common/toolbar-row/index.tsx +57 -20
  37. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +1 -3
  38. package/src/client/components/layout/desktop-layout/TopNavbar.tsx +3 -2
  39. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +7 -1
  40. package/src/client/components/layout/desktop-layout/index.tsx +1 -3
  41. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +1 -0
  42. package/src/client/components/layout/session-sidebar/SessionItem.tsx +18 -1
  43. package/src/client/components/layout/session-sidebar/SessionsView.tsx +1 -3
  44. package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.test.tsx +332 -0
  45. package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +310 -0
  46. package/src/client/components/layout/session-sidebar/about-modal/SocialLinks.tsx +63 -51
  47. package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +4 -2
  48. package/src/client/components/layout/session-sidebar/about-modal/index.test.tsx +122 -0
  49. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +136 -35
  50. package/src/client/components/layout/session-sidebar/harness-mark.test.tsx +126 -0
  51. package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +4 -3
  52. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -0
  53. package/src/client/components/mobile/LayoutWrapper.tsx +1 -7
  54. package/src/client/components/mobile/SessionSidebar.tsx +1 -3
  55. package/src/client/components/mobile/mobile-main-view/Header.tsx +3 -2
  56. package/src/client/components/mobile/mobile-session-sidebar/Dialogs.tsx +0 -8
  57. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +1 -0
  58. package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +17 -1
  59. package/src/client/components/settings/Modal.tsx +26 -22
  60. package/src/client/components/settings/Sidebar.tsx +45 -5
  61. package/src/client/components/settings/categories/HarnessSettings.tsx +207 -0
  62. package/src/client/components/settings/categories/ProjectSettings.tsx +1 -3
  63. package/src/client/components/settings/categories/ProviderSettings.tsx +0 -4
  64. package/src/client/components/settings/categories/SkillCatalogSettings.tsx +13 -23
  65. package/src/client/components/settings/categories/agent-settings/ModelPicker.tsx +23 -30
  66. package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +20 -11
  67. package/src/client/components/settings/categories/chat-settings/GoalSection.tsx +16 -16
  68. package/src/client/components/settings/categories/harness-settings/AddProviderForm.tsx +219 -0
  69. package/src/client/components/settings/categories/harness-settings/ConfigForm.tsx +268 -0
  70. package/src/client/components/settings/categories/harness-settings/EnvProviderForm.tsx +146 -0
  71. package/src/client/components/settings/categories/harness-settings/HarnessCard.tsx +278 -0
  72. package/src/client/components/settings/categories/harness-settings/ImportSection.tsx +195 -0
  73. package/src/client/components/settings/categories/harness-settings/ProviderPanel.tsx +152 -0
  74. package/src/client/components/settings/categories/harness-settings/ToggleList.tsx +147 -0
  75. package/src/client/components/settings/categories/harness-settings/parts.test.tsx +97 -0
  76. package/src/client/components/settings/categories/harness-settings/parts.tsx +84 -0
  77. package/src/client/components/settings/categories/harness-settings/provider-panel.test.tsx +313 -0
  78. package/src/client/components/settings/categories/omp-settings/RoleEditor.test.ts +60 -39
  79. package/src/client/components/settings/categories/omp-settings/RoleRow.tsx +32 -41
  80. package/src/client/components/settings/categories/omp-settings/role-picker.test-util.ts +45 -0
  81. package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +1 -1
  82. package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +11 -4
  83. package/src/client/components/settings/groups.test.tsx +160 -0
  84. package/src/client/components/settings/harness-icons.test.tsx +134 -0
  85. package/src/client/components/workspace/browser-panel/AddressBar.tsx +3 -13
  86. package/src/client/components/workspace/browser-toolbar/clusters.tsx +237 -0
  87. package/src/client/components/workspace/browser-toolbar/index.test.tsx +167 -0
  88. package/src/client/components/workspace/browser-toolbar/index.tsx +99 -100
  89. package/src/client/components/workspace/btw-panel/Messages.tsx +4 -1
  90. package/src/client/components/workspace/btw-panel/index.tsx +2 -0
  91. package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +11 -7
  92. package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +5 -2
  93. package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +13 -0
  94. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +13 -0
  95. package/src/client/components/workspace/chat-timeline/GeneratingIndicator.test.ts +41 -0
  96. package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +19 -14
  97. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +14 -0
  98. package/src/client/components/workspace/chat-timeline/MessageList.tsx +6 -0
  99. package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +14 -0
  100. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +4 -0
  101. package/src/client/components/workspace/chat-timeline/RunMark.tsx +58 -0
  102. package/src/client/components/workspace/chat-timeline/SubagentView.tsx +4 -1
  103. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +4 -0
  104. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +1 -0
  105. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +11 -0
  106. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +13 -0
  107. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +8 -1
  108. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +27 -1
  109. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +48 -23
  110. package/src/client/components/workspace/chat-timeline/chat-input/composer-portal.test.tsx +1 -0
  111. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +21 -1
  112. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +7 -0
  113. package/src/client/components/workspace/chat-timeline/chat-input/props.ts +13 -0
  114. package/src/client/components/workspace/chat-timeline/chat-input/selection.ts +11 -2
  115. package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +1 -0
  116. package/src/client/components/workspace/chat-timeline/index.tsx +17 -15
  117. package/src/client/components/workspace/chat-timeline/pending-harness.test.tsx +157 -0
  118. package/src/client/components/workspace/chat-timeline/run-mark.test.ts +104 -0
  119. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl.tsx +11 -20
  120. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk.tsx +1 -1
  121. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +1 -1
  122. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts.ts +1 -1
  123. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +2 -1
  124. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.test.ts +31 -3
  125. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +5 -1
  126. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +56 -45
  127. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +38 -94
  128. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/wait-parts.tsx +76 -0
  129. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +2 -1
  130. package/src/client/components/workspace/file-explorer/index.test.ts +25 -0
  131. package/src/client/components/workspace/file-explorer/index.tsx +10 -6
  132. package/src/client/components/workspace/git-panel/index.test.ts +13 -3
  133. package/src/client/components/workspace/git-panel/index.tsx +1 -3
  134. package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +92 -0
  135. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +290 -0
  136. package/src/client/components/workspace/model-dropdown/Item.tsx +11 -0
  137. package/src/client/components/workspace/model-dropdown/Panel.tsx +119 -8
  138. package/src/client/components/workspace/model-dropdown/Section.tsx +4 -0
  139. package/src/client/components/workspace/model-dropdown/fullscreen-picker.ts +51 -0
  140. package/src/client/components/workspace/model-dropdown/harness-models.test.ts +177 -0
  141. package/src/client/components/workspace/model-dropdown/harness-models.ts +148 -0
  142. package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +336 -0
  143. package/src/client/components/workspace/model-dropdown/index.tsx +114 -85
  144. package/src/client/components/workspace/model-dropdown/placement.test.tsx +127 -0
  145. package/src/client/components/workspace/model-dropdown/popover-metrics.test.ts +107 -0
  146. package/src/client/components/workspace/model-dropdown/popover-metrics.ts +118 -0
  147. package/src/client/components/workspace/model-dropdown/row-mutations.ts +106 -0
  148. package/src/client/components/workspace/model-dropdown/trigger.test.ts +22 -2
  149. package/src/client/components/workspace/model-dropdown/use-popover-size.ts +89 -0
  150. package/src/client/data/settings/omp-schema.json +224 -17
  151. package/src/client/hooks/chat/composer/index.ts +11 -2
  152. package/src/client/hooks/chat/composer/items.test.ts +11 -0
  153. package/src/client/hooks/chat/composer/items.ts +4 -2
  154. package/src/client/hooks/chat/composer/model-selection.test.ts +110 -0
  155. package/src/client/hooks/chat/composer/model-selection.ts +45 -4
  156. package/src/client/hooks/chat/omp/prompt-send.ts +4 -2
  157. package/src/client/hooks/chat/timeline/actions.ts +10 -5
  158. package/src/client/hooks/chat/timeline/ask-frames.ts +5 -4
  159. package/src/client/hooks/chat/timeline/composer-local-actions.test.ts +19 -81
  160. package/src/client/hooks/chat/timeline/composer-modes.ts +11 -2
  161. package/src/client/hooks/chat/timeline/composer-refs.ts +16 -1
  162. package/src/client/hooks/chat/timeline/index.ts +27 -35
  163. package/src/client/hooks/chat/timeline/mode-availability.test.ts +51 -0
  164. package/src/client/hooks/chat/timeline/modes-contract.ts +6 -0
  165. package/src/client/hooks/chat/timeline/modes.ts +41 -2
  166. package/src/client/hooks/chat/timeline/new-chat-open.test.ts +86 -0
  167. package/src/client/hooks/chat/timeline/new-chat-open.ts +23 -5
  168. package/src/client/hooks/chat/timeline/new-chat.test.ts +32 -4
  169. package/src/client/hooks/chat/timeline/new-chat.ts +18 -6
  170. package/src/client/hooks/chat/timeline/prompt-text.test.ts +7 -0
  171. package/src/client/hooks/chat/timeline/prompt-text.ts +15 -6
  172. package/src/client/hooks/chat/timeline/rewind-actions.test.ts +51 -1
  173. package/src/client/hooks/chat/timeline/rewind-actions.ts +23 -1
  174. package/src/client/hooks/chat/timeline/run-identity.test.ts +52 -0
  175. package/src/client/hooks/chat/timeline/run-identity.ts +23 -11
  176. package/src/client/hooks/chat/timeline/send-execute.test.ts +55 -0
  177. package/src/client/hooks/chat/timeline/send-props.ts +11 -3
  178. package/src/client/hooks/chat/timeline/send-steer.test.ts +2 -3
  179. package/src/client/hooks/chat/timeline/send.test-util.ts +3 -2
  180. package/src/client/hooks/chat/timeline/send.test.ts +2 -3
  181. package/src/client/hooks/chat/timeline/send.ts +34 -8
  182. package/src/client/hooks/chat/timeline/session-harness.test.ts +163 -0
  183. package/src/client/hooks/chat/timeline/session-harness.ts +164 -0
  184. package/src/client/hooks/chat/timeline/session-load.test-util.ts +6 -2
  185. package/src/client/hooks/chat/timeline/session-load.test.ts +31 -0
  186. package/src/client/hooks/chat/timeline/session-load.ts +6 -14
  187. package/src/client/hooks/chat/timeline/session-shapes.ts +32 -0
  188. package/src/client/hooks/chat/timeline/spawn-harness.ts +41 -0
  189. package/src/client/hooks/chat/timeline/timeline-running.ts +55 -0
  190. package/src/client/hooks/chat/timeline/tui-only-guard.ts +9 -0
  191. package/src/client/hooks/chat/timeline/undo-confirmation.test.ts +131 -0
  192. package/src/client/hooks/models/harness-catalog.ts +114 -0
  193. package/src/client/hooks/models/provider-writes.test.ts +81 -0
  194. package/src/client/hooks/models/provider-writes.ts +144 -0
  195. package/src/client/hooks/models/use-harness-versions.test.ts +152 -0
  196. package/src/client/hooks/models/use-harness-versions.ts +136 -0
  197. package/src/client/hooks/models/use-harnesses-controller.ts +57 -0
  198. package/src/client/hooks/models/use-harnesses-signal.test.ts +128 -0
  199. package/src/client/hooks/models/use-harnesses.test.ts +187 -0
  200. package/src/client/hooks/models/use-harnesses.ts +215 -0
  201. package/src/client/hooks/settings/providers/index.ts +1 -3
  202. package/src/client/hooks/ui/editor-error-toast.ts +10 -3
  203. package/src/client/hooks/ui/icon-style.ts +28 -0
  204. package/src/client/hooks/ui/on-click-outside.test.ts +104 -0
  205. package/src/client/hooks/ui/on-click-outside.ts +14 -2
  206. package/src/client/hooks/ui/theme.ts +6 -0
  207. package/src/client/hooks/ui/toast-queue.test.ts +126 -0
  208. package/src/client/hooks/ui/toasts.ts +132 -27
  209. package/src/client/hooks/ui/ui-feedback.test.ts +4 -91
  210. package/src/client/lib/ui/control-plate.test.ts +76 -0
  211. package/src/client/lib/ui/control-plate.ts +65 -0
  212. package/src/client/tailwind.css +47 -1
  213. package/src/server/lib/assets/shell-attributes.server.ts +9 -2
  214. package/src/server/lib/assets/shell-attributes.test.ts +22 -6
  215. package/src/server/lib/db/schema.ts +4 -0
  216. package/src/server/lib/harness/acp/acp-audit.server.ts +107 -0
  217. package/src/server/lib/harness/acp/acp-goal-driver.server.ts +153 -0
  218. package/src/server/lib/harness/acp/acp-goal-state.server.ts +136 -0
  219. package/src/server/lib/harness/acp/acp-goal.server.ts +273 -0
  220. package/src/server/lib/harness/acp/acp-goal.test.ts +229 -0
  221. package/src/server/lib/harness/acp/acp-telemetry.server.ts +133 -0
  222. package/src/server/lib/harness/acp/acp-telemetry.test.ts +85 -0
  223. package/src/server/lib/harness/acp/acp-todos.server.ts +45 -0
  224. package/src/server/lib/harness/acp/acp-todos.test.ts +43 -0
  225. package/src/server/lib/harness/acp/activation.test.ts +81 -0
  226. package/src/server/lib/harness/acp/activation.ts +72 -0
  227. package/src/server/lib/harness/acp/calls.ts +97 -0
  228. package/src/server/lib/harness/acp/client.test.ts +73 -0
  229. package/src/server/lib/harness/acp/client.ts +339 -0
  230. package/src/server/lib/harness/acp/commands.test.ts +92 -0
  231. package/src/server/lib/harness/acp/commands.ts +165 -0
  232. package/src/server/lib/harness/acp/frames.test.ts +315 -0
  233. package/src/server/lib/harness/acp/frames.ts +349 -0
  234. package/src/server/lib/harness/acp/mapper.ts +204 -0
  235. package/src/server/lib/harness/acp/permissions.test.ts +66 -0
  236. package/src/server/lib/harness/acp/permissions.ts +155 -0
  237. package/src/server/lib/harness/acp/prompt.test.ts +130 -0
  238. package/src/server/lib/harness/acp/prompt.ts +134 -0
  239. package/src/server/lib/harness/acp/protocol.ts +162 -0
  240. package/src/server/lib/harness/acp/session-config.test.ts +73 -0
  241. package/src/server/lib/harness/acp/session-config.ts +148 -0
  242. package/src/server/lib/harness/acp/session-facts.ts +71 -0
  243. package/src/server/lib/harness/acp/session-handshake.ts +89 -0
  244. package/src/server/lib/harness/acp/session-idle.ts +51 -0
  245. package/src/server/lib/harness/acp/session-notifications.ts +95 -0
  246. package/src/server/lib/harness/acp/session-observers.test.ts +193 -0
  247. package/src/server/lib/harness/acp/session-options.ts +33 -0
  248. package/src/server/lib/harness/acp/session-permissions.test.ts +105 -0
  249. package/src/server/lib/harness/acp/session-permissions.ts +74 -0
  250. package/src/server/lib/harness/acp/session-reaper.test.ts +96 -0
  251. package/src/server/lib/harness/acp/session-turns.ts +95 -0
  252. package/src/server/lib/harness/acp/session-usage.ts +60 -0
  253. package/src/server/lib/harness/acp/session-web-state.ts +61 -0
  254. package/src/server/lib/harness/acp/session.test-util.ts +160 -0
  255. package/src/server/lib/harness/acp/session.test.ts +233 -0
  256. package/src/server/lib/harness/acp/session.ts +350 -0
  257. package/src/server/lib/harness/acp/turn.ts +199 -0
  258. package/src/server/lib/harness/acp/verbs.ts +87 -0
  259. package/src/server/lib/harness/auto-probe.server.test.ts +121 -0
  260. package/src/server/lib/harness/auto-probe.server.ts +178 -0
  261. package/src/server/lib/harness/capabilities.ts +67 -0
  262. package/src/server/lib/harness/config-invalidation.test.ts +91 -0
  263. package/src/server/lib/harness/config.server.test.ts +105 -0
  264. package/src/server/lib/harness/config.server.ts +98 -0
  265. package/src/server/lib/harness/enabled.server.test.ts +87 -0
  266. package/src/server/lib/harness/enabled.server.ts +61 -0
  267. package/src/server/lib/harness/launch-table.ts +195 -0
  268. package/src/server/lib/harness/launch.test.ts +220 -0
  269. package/src/server/lib/harness/launch.ts +216 -0
  270. package/src/server/lib/harness/probe-cache.server.test.ts +154 -0
  271. package/src/server/lib/harness/probe-cache.server.ts +177 -0
  272. package/src/server/lib/harness/provider-entry.ts +212 -0
  273. package/src/server/lib/harness/provider-file.server.ts +67 -0
  274. package/src/server/lib/harness/provider-import.test.ts +191 -0
  275. package/src/server/lib/harness/provider-probe.server.ts +123 -0
  276. package/src/server/lib/harness/provider-sources.server.test.ts +45 -0
  277. package/src/server/lib/harness/provider-sources.server.ts +308 -0
  278. package/src/server/lib/harness/provider-write-error.ts +19 -0
  279. package/src/server/lib/harness/provider-write.server.test.ts +308 -0
  280. package/src/server/lib/harness/provider-write.server.ts +339 -0
  281. package/src/server/lib/harness/provider-zcode.server.test.ts +270 -0
  282. package/src/server/lib/harness/provider-zcode.server.ts +324 -0
  283. package/src/server/lib/harness/register.server.ts +36 -0
  284. package/src/server/lib/harness/registry.ts +58 -0
  285. package/src/server/lib/harness/schema.server.ts +129 -0
  286. package/src/server/lib/harness/session-store.server.test.ts +175 -0
  287. package/src/server/lib/harness/session-store.server.ts +206 -0
  288. package/src/server/lib/harness/session-title.server.test.ts +109 -0
  289. package/src/server/lib/harness/session-title.server.ts +70 -0
  290. package/src/server/lib/harness/session.ts +74 -0
  291. package/src/server/lib/harness/spawn.server.ts +133 -0
  292. package/src/server/lib/harness/update-state.server.ts +185 -0
  293. package/src/server/lib/lifecycle/after-listen.ts +7 -0
  294. package/src/server/lib/models/provider-items.server.ts +1 -1
  295. package/src/server/lib/models/registry-refresh.server.test.ts +87 -0
  296. package/src/server/lib/models/registry-refresh.server.ts +98 -0
  297. package/src/server/lib/omp/config/models-config.ts +4 -0
  298. package/src/server/lib/omp/core/cli.ts +13 -0
  299. package/src/server/lib/omp/core/host-resolution.test.ts +6 -3
  300. package/src/server/lib/omp/rpc/child-config.ts +5 -4
  301. package/src/server/lib/omp/rpc/constants.test.ts +2 -1
  302. package/src/server/lib/omp/rpc/event-fanout.ts +9 -0
  303. package/src/server/lib/omp/rpc/forked-resume.test.ts +14 -3
  304. package/src/server/lib/omp/rpc/rpc-primitives.test.ts +11 -0
  305. package/src/server/lib/omp/rpc/session-registration.ts +7 -2
  306. package/src/server/lib/omp/rpc/session-registry.test.ts +2 -1
  307. package/src/server/lib/omp/rpc/session-registry.ts +74 -5
  308. package/src/server/lib/omp/session/acp-rows.server.ts +79 -0
  309. package/src/server/lib/omp/session/delete-flow.server.ts +15 -8
  310. package/src/server/lib/omp/session/delete.server.ts +12 -0
  311. package/src/server/lib/omp/session/sidebar-data.harness.test.ts +247 -0
  312. package/src/server/lib/omp/session/sidebar-data.server.ts +56 -3
  313. package/src/server/lib/queue/delivery.server.test.ts +4 -2
  314. package/src/server/lib/queue/payload.test.ts +67 -0
  315. package/src/server/lib/queue/payload.ts +9 -3
  316. package/src/server/lib/realtime/signals.server.test.ts +99 -0
  317. package/src/server/lib/realtime/signals.server.ts +25 -5
  318. package/src/server/lib/realtime/topics/session-data.server.ts +29 -0
  319. package/src/server/lib/realtime/topics/session.server.ts +3 -3
  320. package/src/server/routes/agent/command-resume.test.ts +77 -0
  321. package/src/server/routes/agent/command.test.ts +243 -2
  322. package/src/server/routes/agent/command.ts +78 -15
  323. package/src/server/routes/agent/harness-command.ts +133 -0
  324. package/src/server/routes/agent/new.ts +63 -1
  325. package/src/server/routes/chat/rewind.test.ts +147 -0
  326. package/src/server/routes/chat/rewind.ts +29 -7
  327. package/src/server/routes/chat/session.test.ts +240 -0
  328. package/src/server/routes/chat/session.ts +96 -4
  329. package/src/server/routes/harness/add-provider.test.ts +233 -0
  330. package/src/server/routes/harness/import-action.ts +272 -0
  331. package/src/server/routes/harness/import.test.ts +196 -0
  332. package/src/server/routes/harness/index.ts +13 -0
  333. package/src/server/routes/harness/root.ts +280 -0
  334. package/src/server/routes/harness/toggle.test.ts +127 -0
  335. package/src/server/routes/harness/update.ts +259 -0
  336. package/src/server/routes/harness/versions.test.ts +148 -0
  337. package/src/server/routes/harness/versions.ts +105 -0
  338. package/src/server/routes/index.ts +2 -0
  339. package/src/server/routes/sessions/delete-acp.test.ts +227 -0
  340. package/src/server/routes/sessions/queue.ts +7 -2
  341. package/src/server/routes/sessions/routes-queue.test.ts +52 -0
  342. package/src/server/routes/sessions/routes.test.ts +47 -13
  343. package/src/server/routes/sessions/session.ts +35 -0
  344. package/src/server/routes/settings/commands-harness.test.ts +92 -0
  345. package/src/server/routes/settings/commands.ts +26 -0
  346. package/src/server/routes/settings/model-override.ts +5 -2
  347. package/src/server/routes/settings/provider-entry.ts +2 -2
  348. package/src/server/routes/settings/provider-model.ts +2 -2
  349. package/src/server/routes/settings/provider-models.ts +2 -2
  350. package/src/server/routes/settings/provider-refresh.ts +6 -4
  351. package/src/server/routes/settings/providers.ts +3 -1
  352. package/src/server/routes/settings/settings-config-routes.test.ts +10 -2
  353. package/src/server/routes/settings/skills.ts +12 -0
  354. package/src/shared/lib/chat/ask-form/fields.ts +76 -0
  355. package/src/shared/lib/chat/ask-form/index.ts +323 -0
  356. package/src/shared/lib/chat/ask-form/tokens.ts +199 -0
  357. package/src/shared/lib/chat/ask-form/types.ts +43 -0
  358. package/src/shared/lib/chat/ask-form.test.ts +137 -0
  359. package/src/shared/lib/chat/ask-questions.test.ts +65 -1
  360. package/src/shared/lib/chat/ask-questions.ts +51 -145
  361. package/src/shared/lib/chat/ask-results.ts +198 -0
  362. package/src/shared/lib/chat/composer/client.ts +20 -8
  363. package/src/shared/lib/chat/context/usage.test.ts +8 -4
  364. package/src/shared/lib/chat/context/usage.ts +17 -3
  365. package/src/shared/lib/chat/omp/abort.test.ts +61 -0
  366. package/src/shared/lib/chat/omp/abort.ts +8 -2
  367. package/src/shared/lib/chat/omp/tool-frames.test.ts +23 -0
  368. package/src/shared/lib/chat/omp/tool-frames.ts +12 -2
  369. package/src/shared/lib/chat/timeline/omp-callbacks.ts +13 -1
  370. package/src/shared/lib/chat/timeline/prompt-error.test.ts +146 -0
  371. package/src/shared/lib/chat/timeline/prompt-error.ts +88 -0
  372. package/src/shared/lib/chat/tool/summary-wait.test.ts +18 -8
  373. package/src/shared/lib/chat/tool/wait-facts.ts +14 -8
  374. package/src/shared/lib/harness/brand-color.test.ts +66 -0
  375. package/src/shared/lib/harness/brand-color.ts +96 -0
  376. package/src/shared/lib/harness/catalog.test.ts +88 -0
  377. package/src/shared/lib/harness/catalog.ts +169 -0
  378. package/src/shared/lib/harness/config-fields.test.ts +139 -0
  379. package/src/shared/lib/harness/config-fields.ts +168 -0
  380. package/src/shared/lib/harness/config.test.ts +153 -0
  381. package/src/shared/lib/harness/config.ts +206 -0
  382. package/src/shared/lib/harness/dialects.test.ts +140 -0
  383. package/src/shared/lib/harness/dialects.ts +249 -0
  384. package/src/shared/lib/harness/enabled.test.ts +79 -0
  385. package/src/shared/lib/harness/enabled.ts +72 -0
  386. package/src/shared/lib/harness/menu.test.ts +94 -0
  387. package/src/shared/lib/harness/menu.ts +88 -0
  388. package/src/shared/lib/harness/provider-facts.test.ts +199 -0
  389. package/src/shared/lib/harness/provider-facts.ts +349 -0
  390. package/src/shared/lib/harness/provider-slug.ts +46 -0
  391. package/src/shared/lib/harness/providers.ts +175 -0
  392. package/src/shared/lib/harness/rewind.ts +24 -0
  393. package/src/shared/lib/harness/status.test.ts +158 -0
  394. package/src/shared/lib/harness/status.ts +112 -0
  395. package/src/shared/lib/harness/update-plan.test.ts +163 -0
  396. package/src/shared/lib/harness/update-plan.ts +140 -0
  397. package/src/shared/lib/harness/updates.test.ts +106 -0
  398. package/src/shared/lib/harness/updates.ts +177 -0
  399. package/src/shared/lib/icons/icon-paint-authority.test.ts +16 -4
  400. package/src/shared/lib/icons/icon-paint-authority.ts +57 -12
  401. package/src/shared/lib/icons/icon-paint-bucket.test.ts +84 -0
  402. package/src/shared/lib/icons/icon-paint-css.test.ts +23 -25
  403. package/src/shared/lib/icons/icon-paint-css.ts +69 -55
  404. package/src/shared/lib/icons/icon-paint-harness.test.ts +73 -0
  405. package/src/shared/lib/icons/icon-paint-harness.ts +75 -0
  406. package/src/shared/lib/icons/icon-paint-ink.ts +108 -0
  407. package/src/shared/lib/icons/icon-paint-panel.ts +19 -4
  408. package/src/shared/lib/icons/icon-paint-weight.ts +21 -2
  409. package/src/shared/lib/icons/icon-tone.ts +118 -21
  410. package/src/shared/lib/icons/tint-hues.generated.ts +100 -284
  411. package/src/shared/lib/icons/tint-tones.test.ts +79 -25
  412. package/src/shared/lib/icons/tint.ts +66 -6
  413. package/src/shared/lib/models/client.ts +10 -1
  414. package/src/shared/lib/models/provider/vendors.ts +72 -0
  415. package/src/shared/lib/omp/config/schema.test.ts +36 -0
  416. package/src/shared/lib/omp/dialog-methods.ts +4 -3
  417. package/src/shared/lib/omp/session/messages-map-trace.test.ts +42 -0
  418. package/src/shared/lib/omp/session/messages-map.ts +6 -1
  419. package/src/shared/lib/omp/session/parse-message-blocks-toolcall.test.ts +8 -0
  420. package/src/shared/lib/omp/session/parse-message-blocks.ts +6 -1
  421. package/src/shared/lib/omp/session/shell-trace.test.ts +69 -0
  422. package/src/shared/lib/omp/session/shell-trace.ts +63 -0
  423. package/src/shared/lib/omp/session/sidebar.ts +37 -10
  424. package/src/shared/lib/omp/session/wait-idle.test.ts +47 -0
  425. package/src/shared/lib/omp/session/wait-idle.ts +93 -0
  426. package/src/shared/lib/omp/session/wait.test.ts +34 -33
  427. package/src/shared/lib/omp/session/wait.ts +25 -39
  428. package/src/shared/lib/settings/sections.ts +24 -0
  429. package/src/shared/lib/theme/css.ts +2 -0
  430. package/src/shared/lib/theme/ink-scale.ts +21 -1
  431. package/src/shared/lib/theme/theme.test.ts +25 -9
  432. package/src/shared/lib/ui/safe-area.test.ts +28 -0
  433. package/src/shared/lib/ui/safe-area.ts +42 -0
  434. package/src/shared/lib/ui/toast-duration.test.ts +74 -0
  435. package/src/shared/lib/ui/toast-duration.ts +70 -0
  436. package/src/shared/types/harness-version.ts +59 -0
  437. package/src/shared/types/harness.ts +201 -0
  438. package/src/shared/types/index.ts +2 -0
  439. package/src/shared/types/omp/agent.ts +13 -0
  440. package/src/shared/types/settings/state.ts +10 -1
  441. package/src/shared/types/workspace.ts +10 -0
  442. package/src/test-support/env.ts +38 -0
  443. package/src/test-support/file-explorer-render.test-util.ts +37 -0
  444. package/src/test-support/file-explorer.test-util.ts +20 -18
  445. package/src/test-support/harness-table.test-util.ts +108 -0
  446. package/dist/client/static/js/index-7ppta1pb.css +0 -1
@@ -0,0 +1,310 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The Agents table: ONE row per harness, carrying everything About knows about it
8
+ * and nothing twice.
9
+ *
10
+ * The card used to draw the same fourteen agents in two places — a status grid
11
+ * and, below it, a versions table — which is why it grew to 980px tall. A reader
12
+ * scanning for "is this working, and is it current?" was reading the same names
13
+ * twice to answer two halves of one question. The row answers both, and the card
14
+ * is roughly half its height.
15
+ *
16
+ * What each row states, and why:
17
+ *
18
+ * - **state** — `ready` / `needs setup` / `not installed` / `not probed`, from
19
+ * `harnessStatus`. Carried by a SHAPE, not only a tone.
20
+ * - **version** — what the agent reported. A dash when it has never answered,
21
+ * with the reason in the title, because a number here would be invented.
22
+ * - **one action**, chosen by what the harness can do: `Update` (npm), the
23
+ * vendor's own command (self / vendor-managed), or nothing but a link to its
24
+ * settings page.
25
+ *
26
+ * A row is a LINK first: clicking it opens that harness's settings page. Editing
27
+ * lives there; About is where you learn which page to open and whether anything
28
+ * needs doing first.
29
+ */
30
+
31
+ import { useState } from 'preact/hooks';
32
+ import { Download, Loader2 } from 'lucide-preact';
33
+ import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
34
+ import { harnessStatus, type HarnessState } from '@/shared/lib/harness/status';
35
+ import { harnessCategoryId } from '@/shared/lib/harness/menu';
36
+ import type { HarnessSummary } from '@/shared/types/harness';
37
+ import type { HarnessVersionRow } from '@/shared/types/harness-version';
38
+
39
+ interface HarnessTableProps {
40
+ harnesses: HarnessSummary[];
41
+ versions: HarnessVersionRow[];
42
+ loading?: boolean;
43
+ onOpenHarness: (id: string) => void;
44
+ /** Runs one npm harness's update; resolves to a refusal, or null. */
45
+ onUpdate: (id: string) => Promise<string | null>;
46
+ /** Which harness is mid-update. */
47
+ updating: string | null;
48
+ }
49
+
50
+ /** The state mark. Shape carries the state, so tone is reinforcement only. */
51
+ function StateMark({ state }: { state: HarnessState }) {
52
+ if (state === 'ready') return <span aria-hidden="true" className="h-1.5 w-1.5 rounded-full bg-success" />;
53
+ if (state === 'not-installed') return <span aria-hidden="true" className="h-1.5 w-1.5 rounded-full border border-ink/35" />;
54
+ if (state === 'needs-setup') return <span aria-hidden="true" className="h-1.5 w-1.5 rounded-full bg-ink/45" />;
55
+ return <span aria-hidden="true" className="h-1.5 w-1.5 rounded-full bg-ink/15" />;
56
+ }
57
+
58
+ /**
59
+ * The three-column grid every data row uses.
60
+ *
61
+ * The widths are the point, and every earlier guess was wrong:
62
+ *
63
+ * - the ACTION column held `7rem` for a single icon, stealing space from the
64
+ * version cell — so `0.100.0 → 0.101.0` truncated while the action cell sat
65
+ * mostly empty. It is `1.75rem` now: one 24px button and nothing else.
66
+ * - the VERSION column held `7.5rem` (120px), which clipped the widest thing
67
+ * it ever holds — an adapter's `adapter 0.100.0 → 0.101.0` line, measured at
68
+ * 151px in this face. It is `9.5rem` (152px), the content's own width.
69
+ * - on a PHONE it is `7rem`: the About card is 512px at most, and the 152px
70
+ * track left the agent's own name ~130px, so `command-code` and
71
+ * `deepseek-harness` were the cells that truncated while the name is the one
72
+ * thing a reader is scanning for. The version line ellipsizes instead, and
73
+ * carries its full text in `title`.
74
+ *
75
+ * It stays a FIXED track rather than `auto`: every row is its own grid, so an
76
+ * `auto` track is measured per row and the version numbers stop lining up in a
77
+ * column (measured: a name cell of 352px on one row and 208px on the next).
78
+ *
79
+ * The name takes the slack and ellipsizes. The card's own width is FIXED
80
+ * (`md:w-[880px]`), so the name track cannot collapse the dialog — that only
81
+ * happened while the card was `w-auto`.
82
+ *
83
+ * `items-start`, not `items-center`: each cell holds two lines whose heights
84
+ * differ from row to row (a version cell is 16px alone and 31px with an
85
+ * `adapter …` line under it), and centering measured the number 7.5px BELOW the
86
+ * name it belongs to. Top-aligned, line one of every cell shares one baseline.
87
+ */
88
+ const COLUMNS = 'grid grid-cols-[minmax(0,1fr)_7rem_1.75rem] items-start gap-x-2 md:grid-cols-[minmax(0,1fr)_9.5rem_1.75rem]';
89
+
90
+ export function HarnessTable({
91
+ harnesses, versions, loading = false, onOpenHarness, onUpdate, updating,
92
+ }: HarnessTableProps) {
93
+ const [problem, setProblem] = useState<{ id: string; message: string } | null>(null);
94
+
95
+ const byId = new Map(versions.map((row) => [row.id, row]));
96
+ // The built-in transport is the default every discovered session runs on, with
97
+ // nothing to install, probe or update; listing it would inflate the count with
98
+ // the one entry nobody has to decide about.
99
+ const entries = harnesses.filter((entry) => !entry.builtIn);
100
+ const ready = entries.filter((entry) => harnessStatus(entry).state === 'ready').length;
101
+ const updatable = entries.filter((entry) => byId.get(entry.id)?.updateAvailable).length;
102
+
103
+ const runUpdate = async (id: string) => {
104
+ const message = await onUpdate(id);
105
+ setProblem(message ? { id, message } : null);
106
+ };
107
+
108
+ return (
109
+ <section className="text-left" aria-labelledby="agents-heading">
110
+ <div className="mb-1.5 flex items-baseline justify-between gap-2 border-b border-ink/10 pb-1.5">
111
+ <h3 id="agents-heading" className="text-[10px] font-semibold uppercase tracking-wider text-ink/45">
112
+ Agents
113
+ </h3>
114
+ {/* The tally and the exit sit on the heading's row, at the right edge,
115
+ instead of under a 200px table: both are ABOUT this section rather
116
+ than a continuation of it. */}
117
+ <div className="flex items-center gap-3">
118
+ <span className="text-[10px] text-ink/40">
119
+ {loading ? 'reading…' : `${ready}/${entries.length} ready`}
120
+ {updatable > 0 ? ` · ${updatable} update${updatable === 1 ? '' : 's'}` : ''}
121
+ </span>
122
+ <button
123
+ type="button"
124
+ onClick={() => onOpenHarness('')}
125
+ className="cursor-pointer text-[10px] text-ink/45 transition-colors hover:text-ink"
126
+ >
127
+ Open Settings → Harnesses
128
+ </button>
129
+ </div>
130
+ </div>
131
+
132
+ {/* No column header: the three cells are self-describing (a glyph + name,
133
+ a version line, one icon) and the labels cost a line of height while
134
+ their widths fought the cells they described. The heading row above
135
+ already names the section. */}
136
+
137
+ {loading && entries.length === 0 ? (
138
+ <div className="space-y-1 py-1">
139
+ {Array.from({ length: 6 }, (_, index) => (
140
+ <div key={index} className="h-7 animate-pulse rounded bg-ink/[0.05]" />
141
+ ))}
142
+ </div>
143
+ ) : (
144
+ // ONE list, no scroll cap of its own. It used to be `max-h-[46vh]
145
+ // overflow-y-auto` on a phone, which scroll-trapped fourteen rows inside
146
+ // a card that had most of the screen empty below them — two nested
147
+ // scrollers, and the inner one had no reason to exist. The About panel's
148
+ // own body is the single scroller now, so the list simply grows.
149
+ <div data-harness-rows="" className="grid grid-cols-1 gap-x-6 md:grid-cols-2">
150
+ {entries.map((entry) => {
151
+ const status = harnessStatus(entry);
152
+ const version = byId.get(entry.id);
153
+ const isUpdating = updating === entry.id;
154
+ // The number a reader calls "the version": the CLI when the harness is
155
+ // an adapter, otherwise the agent itself. Each part carries its own
156
+ // `latest` and its own ability to move, so the two are never compared
157
+ // across each other.
158
+ //
159
+ // A CLI part EXISTS for every adapter even when its `--version` could
160
+ // not be read (the binary is absent, or its launcher is broken). Taking
161
+ // that empty part as the lead painted `—` over a known adapter number:
162
+ // measured on `zcode` (adapter 0.82.3 probed, no `zcode` runtime) and
163
+ // `claude` (`claude --version` fails while the adapter answers). The
164
+ // part that HAS a number leads.
165
+ const cli = version?.cli ?? null;
166
+ const agent = version?.agent ?? null;
167
+ const lead = cli?.version ? cli : agent;
168
+ const showAdapterLine = Boolean(
169
+ cli?.version && agent?.version && agent.version !== cli.version,
170
+ );
171
+ // What the press would install, named: an adapter and a CLI are two
172
+ // different products, so the accessible name says which is moving.
173
+ const targets = version
174
+ ? [
175
+ version.agent.updateAvailable && version.agent.latest
176
+ ? version.cli ? `adapter ${version.agent.latest}` : version.agent.latest
177
+ : null,
178
+ version.cli?.updateAvailable && version.cli.latest
179
+ ? `${version.cli.name} ${version.cli.latest}`
180
+ : null,
181
+ ].filter((target): target is string => Boolean(target))
182
+ : [];
183
+ const updateLabel = `Update ${entry.label}${targets.length > 0 ? ` to ${targets.join(' + ')}` : ''}`;
184
+ return (
185
+ <div key={entry.id} className={`${COLUMNS} border-b border-ink/5 py-1.5`}>
186
+ {/* The name is the link: one target per row, and the row's other
187
+ cells stay selectable text.
188
+ TWO lines per cell, and the same two line boxes on both
189
+ sides: the name and its version share row one (16px), the
190
+ state label and the adapter line share row two (15px). Every
191
+ cell is a flex COLUMN of those two rows, which is what makes
192
+ `ready` sit exactly under `2.1.318` and beside
193
+ `adapter 0.100.0 →` (measured 8px apart when the cells were
194
+ centered independently). */}
195
+ <button
196
+ type="button"
197
+ onClick={() => onOpenHarness(entry.id)}
198
+ title={status.detail ?? undefined}
199
+ aria-label={`${entry.label} — ${status.label}. Open its settings.`}
200
+ className="flex min-w-0 cursor-pointer items-start gap-1.5 text-left"
201
+ >
202
+ {/* The glyph rides the FIRST row, not the middle of the pair:
203
+ centered on both rows it landed between the name and the
204
+ state label. */}
205
+ <span className="flex h-4 shrink-0 items-center">
206
+ <HarnessGlyph harness={entry.id} size={HARNESS_GLYPH_SIZE.compact} />
207
+ </span>
208
+ {/* The state mark sits in the label's TOP-RIGHT CORNER, not in
209
+ the flow: as a trailing child it took a column of its own and
210
+ every agent name lost ~14px to a 6px dot. Positioned, the
211
+ label keeps its width and the mark still reads as a status
212
+ light on that name. */}
213
+ <span className="flex min-w-0 flex-1 flex-col">
214
+ {/* The mark sits at the top-right of the NAME ITSELF, so the
215
+ wrapper must HUG the text — a `flex-1` wrapper anchored the
216
+ dot to the column's edge instead, which read as a marker on
217
+ the version beside it. `max-w-full` keeps it on the name and
218
+ still allows the truncation. */}
219
+ <span className="flex max-w-full items-center gap-1.5">
220
+ <span className={`truncate text-[11px] leading-4 ${status.state === 'ready' ? 'font-medium text-ink' : 'text-ink/70'}`}>
221
+ {entry.label}
222
+ </span>
223
+ <StateMark state={status.state} />
224
+ </span>
225
+ <span className="block truncate text-[10px] leading-[15px] text-ink/40">{status.label}</span>
226
+ </span>
227
+ </button>
228
+
229
+ {/* TWO number lines, each with its OWN arrow.
230
+ A harness can be an adapter over a CLI, and the two move
231
+ independently: the row leads with the CLI's `2.1.318` and states
232
+ `adapter 0.101.0` underneath, so `→` may only ever join the two
233
+ numbers on ITS line. Joining `2.1.318` with the adapter's latest
234
+ would compare two different products — the fiction this cell
235
+ exists to prevent. */}
236
+ <span
237
+ className="flex min-w-0 flex-col items-end text-right font-mono text-[11px] leading-4 text-ink/70"
238
+ title={version?.note ?? undefined}
239
+ >
240
+ <span className="block max-w-full truncate">
241
+ {/* The CLI's version leads when the harness is an ADAPTER: it
242
+ is the number a user recognises (`claude --version` →
243
+ 2.1.318). */}
244
+ {lead?.version ?? <span className="text-ink/30">—</span>}
245
+ {lead?.updateAvailable && lead.latest && (
246
+ <>
247
+ <span aria-hidden="true" className="ml-1 text-ink/35">→</span>
248
+ <span className="ml-1 text-ink">{lead.latest}</span>
249
+ </>
250
+ )}
251
+ </span>
252
+ {/* The adapter's own number and its own move. It lives INSIDE
253
+ the version cell — as a fourth grid child it shifted every
254
+ row one track and moved the action button onto its own line. */}
255
+ {showAdapterLine && version && (
256
+ <span
257
+ className="block max-w-full truncate text-[10px] leading-[15px] text-ink/35"
258
+ title={`${version.cli?.name ?? 'CLI'} ${version.cli?.version ?? 'unknown'} · adapter ${version.agent.version}`}
259
+ >
260
+ adapter {version.agent.version}
261
+ {version.agent.updateAvailable && version.agent.latest
262
+ ? ` → ${version.agent.latest}`
263
+ : ''}
264
+ </span>
265
+ )}
266
+ </span>
267
+
268
+ <div className="flex min-w-0 justify-end">
269
+ {/* ICON ONLY, and only when there is something to move to.
270
+ A row with no newer version shows nothing: a permanent action
271
+ button claims work that does not exist. The label lives in
272
+ `title` + `aria-label`, so the meaning is not lost — it is just
273
+ not spent on every row. The icon is a DOWNLOAD arrow because
274
+ that is what the press does; it used to be `ArrowUpRight`, which
275
+ reads as "open this elsewhere". */}
276
+ {version?.updateAvailable ? (
277
+ <button
278
+ type="button"
279
+ onClick={() => void runUpdate(entry.id)}
280
+ disabled={isUpdating}
281
+ aria-label={updateLabel}
282
+ title={updateLabel}
283
+ className="inline-flex cursor-pointer items-center justify-center rounded border border-ink/25 p-1 text-ink transition-colors hover:border-ink/50 hover:bg-ink/5 disabled:cursor-not-allowed disabled:opacity-50"
284
+ >
285
+ {isUpdating
286
+ ? <Loader2 size={11} className="animate-spin motion-reduce:animate-none" />
287
+ : <Download size={11} />}
288
+ </button>
289
+ ) : (
290
+ <span className="text-[10px] text-ink/25">—</span>
291
+ )}
292
+ </div>
293
+
294
+ {problem?.id === entry.id && (
295
+ <span className="col-span-3 pb-1 text-[10px] text-ink/70">{problem.message}</span>
296
+ )}
297
+ </div>
298
+ );
299
+ })}
300
+ </div>
301
+ )}
302
+
303
+ </section>
304
+ );
305
+ }
306
+
307
+ /** The category a harness row opens. `''` means the overview page. */
308
+ export function harnessCategoryFor(id: string): string {
309
+ return id ? harnessCategoryId(id) : 'harness-index';
310
+ }
@@ -1,59 +1,71 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The project's links, as ONE centred row.
8
+ *
9
+ * Four links are one line's worth of content; split into two left-aligned groups
10
+ * they read as a list of unrelated things, and left-aligned inside a centred card
11
+ * they read as an afterthought. A single centred row is what they are.
12
+ *
13
+ * Each mark is the vendor's own and each is paired with its NAME in text: a logo
14
+ * alone is not an accessible label.
15
+ */
16
+
1
17
  export function SocialLinks() {
2
18
  return (
3
- <div className="flex flex-col items-center gap-4 mt-6 pt-1">
4
- <div className="flex items-center justify-center gap-6">
5
- <a
6
- href="https://discord.gg/TWYp6K2jd"
7
- target="_blank"
8
- rel="noreferrer"
9
- className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
10
- >
11
- {/* viewBox scaled 113.4% so this wide mark's ink mass matches the other three */}
12
- <svg className="w-4 h-4 fill-current" viewBox="-1.611 -1.611 27.223 27.223">
13
- <path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z" />
14
- </svg>
15
- <span>Discord</span>
16
- </a>
19
+ <div className="mt-3 flex flex-wrap items-center justify-center gap-x-5 gap-y-2">
20
+ <a
21
+ href="https://discord.gg/TWYp6K2jd"
22
+ target="_blank"
23
+ rel="noreferrer"
24
+ className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
25
+ >
26
+ {/* viewBox scaled 113.4% so this wide mark's ink mass matches the other three */}
27
+ <svg className="w-4 h-4 fill-current" viewBox="-1.611 -1.611 27.223 27.223">
28
+ <path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z" />
29
+ </svg>
30
+ <span>Discord</span>
31
+ </a>
17
32
 
18
- <a
19
- href="https://www.instagram.com/kabmo-labs/"
20
- target="_blank"
21
- rel="noreferrer"
22
- className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
23
- >
24
- <svg className="w-4 h-4 fill-current" viewBox="0 0 24 24">
25
- <path d="M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077" />
26
- </svg>
27
- <span>Instagram</span>
28
- </a>
33
+ <a
34
+ href="https://www.instagram.com/kabmo-labs/"
35
+ target="_blank"
36
+ rel="noreferrer"
37
+ className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
38
+ >
39
+ <svg className="w-4 h-4 fill-current" viewBox="0 0 24 24">
40
+ <path d="M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077" />
41
+ </svg>
42
+ <span>Instagram</span>
43
+ </a>
29
44
 
30
- <a
31
- href="https://www.threads.com/@kabmo-labs"
32
- target="_blank"
33
- rel="noreferrer"
34
- className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
35
- >
36
- <svg className="w-4 h-4 fill-current" viewBox="0 0 24 24">
37
- <path d="M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z" />
38
- </svg>
39
- <span>Threads</span>
40
- </a>
41
- </div>
45
+ <a
46
+ href="https://www.threads.com/@kabmo-labs"
47
+ target="_blank"
48
+ rel="noreferrer"
49
+ className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
50
+ >
51
+ <svg className="w-4 h-4 fill-current" viewBox="0 0 24 24">
52
+ <path d="M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z" />
53
+ </svg>
54
+ <span>Threads</span>
55
+ </a>
42
56
 
43
- <div className="flex items-center justify-center gap-6">
44
- <a
45
- href="https://github.com/kabmo-labs/kabmo"
46
- target="_blank"
47
- rel="noreferrer"
48
- className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
49
- >
50
- {/* viewBox cropped 84.2% so this dense mark's ink mass matches the other three */}
51
- <svg className="w-4 h-4 fill-current" viewBox="1.902 1.902 20.196 20.196">
52
- <path fillRule="evenodd" clipRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" />
53
- </svg>
54
- <span>GitHub</span>
55
- </a>
56
- </div>
57
+ <a
58
+ href="https://github.com/kabmo-labs/kabmo"
59
+ target="_blank"
60
+ rel="noreferrer"
61
+ className="flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors"
62
+ >
63
+ {/* viewBox cropped 84.2% so this dense mark's ink mass matches the other three */}
64
+ <svg className="w-4 h-4 fill-current" viewBox="1.902 1.902 20.196 20.196">
65
+ <path fillRule="evenodd" clipRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" />
66
+ </svg>
67
+ <span>GitHub</span>
68
+ </a>
57
69
  </div>
58
70
  );
59
71
  }
@@ -76,9 +76,11 @@ export function UpdateSection({ updates, onToast }: UpdateSectionProps) {
76
76
  const showResult = Boolean(updates.info && !updates.checking && !updates.error);
77
77
 
78
78
  return (
79
- <section className="mt-5 border-y border-ink/10 py-3 text-left" aria-labelledby="updates-heading">
79
+ <section className="border-y border-ink/10 py-3 text-left" aria-labelledby="updates-heading">
80
80
  <div className="flex items-center justify-between gap-3">
81
- <h3 id="updates-heading" className="text-xs font-semibold text-ink">Updates</h3>
81
+ {/* Same heading treatment as the Agents pane, so the two columns read as
82
+ one card rather than a header beside a paragraph. */}
83
+ <h3 id="updates-heading" className="text-[10px] font-semibold uppercase tracking-wider text-ink/45">Updates</h3>
82
84
  {updates.info && <span className="font-mono text-[10px] text-ink/40">checked</span>}
83
85
  </div>
84
86
 
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The About card's FRAME, at both sizes.
8
+ *
9
+ * The phone used to get a full-bleed sheet (`h-full w-full`, no gutters), which
10
+ * put the card's own header against the viewport's top edge — under the status
11
+ * bar on a `viewport-fit: cover` surface — and capped the harness list at `46vh`
12
+ * inside it, so the list scrolled while most of the screen sat empty below it.
13
+ *
14
+ * Two things are guarded here, and both are properties of the TREE rather than
15
+ * of a stylesheet: the card is a bounded floating card sized by the same width
16
+ * cap the composer's model picker uses, and the card carries exactly ONE scroll
17
+ * container (its body) — the harness list must not be a second one.
18
+ */
19
+
20
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
21
+ import { Window } from 'happy-dom';
22
+ import { render } from 'preact';
23
+ import { act } from 'preact/test-utils';
24
+ import { AboutModal } from '@/client/components/layout/session-sidebar/about-modal';
25
+ import { MAX_WIDTH } from '@/client/components/workspace/model-dropdown/popover-metrics';
26
+ import { resetHarnessVersions } from '@/client/hooks/models/use-harness-versions';
27
+ import { resetHarnessesStore } from '@/client/hooks/models/harness-catalog';
28
+ import { delay } from '@/client/hooks/chat/composer/file-reads';
29
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
30
+ import type { UseUpdatesResult } from '@/client/hooks/ui/updates';
31
+
32
+ /** A console with nothing to install: this suite reads the frame, not the data. */
33
+ const UPDATES: UseUpdatesResult = {
34
+ info: null,
35
+ checking: false,
36
+ applying: null,
37
+ progress: null,
38
+ error: null,
39
+ hasUpdate: false,
40
+ check: async () => {},
41
+ apply: async () => null,
42
+ };
43
+
44
+ const nativeFetch = globalThis.fetch;
45
+
46
+ beforeAll(() => {
47
+ installDomGlobals(new Window({ url: 'http://localhost' }));
48
+ // Both catalogs are module-level stores: a suite that ran earlier and left a
49
+ // read in flight (or the "already loaded" flag set) makes this card mount
50
+ // against that state instead of its own 501, and the harness list then renders
51
+ // its skeleton forever — the frame assertions still pass, the ROWS assertion
52
+ // does not. Cold stores make the suite order-independent.
53
+ resetHarnessesStore();
54
+ resetHarnessVersions();
55
+ // The card reads two catalogs on mount; a 501 makes both hooks report their
56
+ // error state instead of dialing a server that is not there.
57
+ globalThis.fetch = (async () => ({
58
+ ok: false,
59
+ status: 501,
60
+ json: async () => ({}),
61
+ })) as unknown as typeof fetch;
62
+ });
63
+
64
+ afterAll(() => {
65
+ globalThis.fetch = nativeFetch;
66
+ restoreDomGlobals();
67
+ });
68
+
69
+ let container: HTMLElement | null = null;
70
+
71
+ afterEach(() => {
72
+ if (container) act(() => render(null, container!));
73
+ container?.remove();
74
+ container = null;
75
+ for (const node of Array.from(document.body.children)) node.remove();
76
+ });
77
+
78
+ /** Mount the card and return its `role="dialog"` panel. */
79
+ async function mountCard(): Promise<HTMLElement> {
80
+ container = document.createElement('div');
81
+ document.body.appendChild(container);
82
+ act(() => render(<AboutModal isOpen onClose={() => {}} updates={UPDATES} />, container!));
83
+ // The two catalog reads land after the first paint; the harness list only
84
+ // exists once the store reports it is done loading.
85
+ await act(() => delay(0));
86
+ const panel = document.querySelector('[role="dialog"][aria-label="About Kabmo"]');
87
+ if (!panel) throw new Error('About card did not mount');
88
+ return panel as HTMLElement;
89
+ }
90
+
91
+ describe('the About card frame', () => {
92
+ test('a floating card sized by the model picker’s cap, not the whole screen', async () => {
93
+ const panel = await mountCard();
94
+ // `h-full` was the full-bleed sheet: a card stretched to the screen's top
95
+ // edge is exactly what drew its header under the status bar.
96
+ expect(panel.classList.contains('h-full')).toBe(false);
97
+ expect(panel.style.getPropertyValue('--about-card-max')).toBe(`min(${MAX_WIDTH}px, 100%)`);
98
+ expect(panel.classList.contains('max-h-full')).toBe(true);
99
+ expect(panel.classList.contains('rounded-2xl')).toBe(true);
100
+ });
101
+
102
+ test('the card is centered with a capped height, never stretched', async () => {
103
+ const panel = await mountCard();
104
+ const backdrop = panel.parentElement!;
105
+ // `items-stretch` + `h-full` was the sheet; a stretched card has no gutter to
106
+ // keep the safe area clear, and no height cap to scroll inside.
107
+ expect(backdrop.className).toContain('items-center');
108
+ expect(backdrop.className).not.toContain('items-stretch');
109
+ expect(panel.classList.contains('max-h-full')).toBe(true);
110
+ });
111
+
112
+ test('exactly ONE scroll container inside the card', async () => {
113
+ const panel = await mountCard();
114
+ const scrollers = panel.querySelectorAll('.scrollbar-overlay-container');
115
+ expect(scrollers).toHaveLength(1);
116
+ // …and the harness list is not it.
117
+ const list = panel.querySelector('[data-harness-rows]');
118
+ expect(list).not.toBeNull();
119
+ expect(list!.classList.contains('scrollbar-overlay-container')).toBe(false);
120
+ expect(list!.classList.contains('overflow-y-auto')).toBe(false);
121
+ });
122
+ });