@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
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef, useState } from 'preact/hooks';
2
- import { AlertCircle, Check, ChevronLeft, X } from 'lucide-preact';
2
+ import { ChevronLeft, X } from 'lucide-preact';
3
3
  import type { SettingsCategoryId, SettingsState } from '@/shared/types';
4
4
  import { mergeKabmoSettings } from '@/shared/lib/settings/client';
5
5
  import { diffSettings } from '@/shared/lib/settings/diff';
@@ -9,8 +9,11 @@ import { useReloadOmpEngine } from '@/client/hooks/settings/reload-engine';
9
9
  import { useRestartKabmo } from '@/client/hooks/settings/restart-kabmo';
10
10
  import { applySettingsSideEffects } from '@/client/components/settings/apply-side-effects';
11
11
  import { useKabmoEvent } from '@/client/hooks/ui/window-event';
12
+ import { useToasts } from '@/client/hooks/ui/toasts';
12
13
  import { useDialogBehaviour } from '@/client/hooks/ui/dialog-behaviour';
13
14
  import { SETTINGS_CATEGORIES, SettingsSidebar } from '@/client/components/settings/Sidebar';
15
+ import { harnessIdFromCategory } from '@/shared/lib/harness/menu';
16
+ import { useHarnesses } from '@/client/hooks/models/use-harnesses';
14
17
  import { AppearanceSettings } from '@/client/components/settings/categories/AppearanceSettings';
15
18
  import { ChatSettings } from '@/client/components/settings/categories/ChatSettings';
16
19
  import { ProjectSettings } from '@/client/components/settings/categories/ProjectSettings';
@@ -19,6 +22,7 @@ import { AgentSettings } from '@/client/components/settings/categories/AgentSett
19
22
  import { BehaviorSettings } from '@/client/components/settings/categories/BehaviorSettings';
20
23
  import { CommandSettings } from '@/client/components/settings/categories/CommandSettings';
21
24
  import { McpSettings } from '@/client/components/settings/categories/McpSettings';
25
+ import { HarnessSettings } from '@/client/components/settings/categories/HarnessSettings';
22
26
  import { SkillSettings } from '@/client/components/settings/categories/SkillSettings';
23
27
  import { PluginSettings } from '@/client/components/settings/categories/PluginSettings';
24
28
  import { PanelPluginSettings } from '@/client/components/settings/categories/PanelPluginSettings';
@@ -51,20 +55,20 @@ export function SettingsModal({
51
55
  const [autoOpenAdd, setAutoOpenAdd] = useState(autoOpenAddProvider);
52
56
  const [searchQuery, setSearchQuery] = useState('');
53
57
  const [isMobileDrilled, setIsMobileDrilled] = useState(false);
54
- const [toastMessage, setToastMessage] = useState<string | null>(null);
55
- const [toastTone, setToastTone] = useState<'success' | 'error'>('success');
56
58
  const writeKabmoSettings = useKabmoSettingsWriter();
57
59
  const { isReloading, reload: reloadEngine } = useReloadOmpEngine();
58
60
  const { isRestarting, restart: restartKabmo } = useRestartKabmo();
59
61
 
60
- /** One toast slot for the whole modal: a later message replaces the earlier
61
- * one rather than queueing, and the tone is carried so a failed action
62
- * cannot render under a check mark. */
63
- const showToast = (message: string, tone: 'success' | 'error' = 'success') => {
64
- setToastMessage(message);
65
- setToastTone(tone);
66
- setTimeout(() => setToastMessage((current) => (current === message ? null : current)), 3000);
67
- };
62
+ const { pushToast: showToast } = useToasts();
63
+
64
+ // The roster, for the drawer and for the page being drawn. A harness the user
65
+ // switched off has no menu row AND no page: leaving the page reachable from a
66
+ // stale `activeCategory` would show a card for an agent that is not in the
67
+ // roster any more.
68
+ const { harnesses } = useHarnesses();
69
+ const disabledHarnesses = harnesses
70
+ .filter((entry) => !entry.builtIn && !entry.enabled)
71
+ .map((entry) => entry.id);
68
72
 
69
73
  const [settings, setSettings] = useState<SettingsState>(() =>
70
74
  mergeKabmoSettings(DEFAULT_SETTINGS, appSettings),
@@ -160,6 +164,8 @@ export function SettingsModal({
160
164
  );
161
165
  case 'agents':
162
166
  return <AgentSettings settings={settings} onUpdate={handleUpdateSettings} />;
167
+ case 'harness-index':
168
+ return <HarnessSettings />;
163
169
  case 'behavior':
164
170
  return <BehaviorSettings />;
165
171
  case 'commands':
@@ -191,8 +197,14 @@ export function SettingsModal({
191
197
  return <OmpSettings settings={settings} onUpdate={handleUpdateSettings} />;
192
198
  case 'usage':
193
199
  return <UsageSettings />;
194
- default:
200
+ default: {
201
+ // A single harness page: its own card, verbatim — the same component the
202
+ // overview draws, because a second renderer for one agent is how the two
203
+ // views start disagreeing about what it can do.
204
+ const harnessId = harnessIdFromCategory(activeCategory);
205
+ if (harnessId) return <HarnessSettings only={harnessId} />;
195
206
  return <OtherSettings category={activeCategory} />;
207
+ }
196
208
  }
197
209
  };
198
210
 
@@ -221,6 +233,7 @@ export function SettingsModal({
221
233
  isReloading={isReloading}
222
234
  onRestartKabmo={handleRestartKabmo}
223
235
  isRestarting={isRestarting}
236
+ disabledHarnesses={disabledHarnesses}
224
237
  className="w-full"
225
238
  />
226
239
  </div>
@@ -318,20 +331,11 @@ export function SettingsModal({
318
331
  isReloading={isReloading}
319
332
  onRestartKabmo={handleRestartKabmo}
320
333
  isRestarting={isRestarting}
334
+ disabledHarnesses={disabledHarnesses}
321
335
  className="w-full border-r-0"
322
336
  />
323
337
  </div>
324
338
  </div>
325
-
326
- {/* Toast Notification */}
327
- {toastMessage && (
328
- <div className="absolute bottom-6 left-1/2 transform -translate-x-1/2 bg-ink text-canvas px-4 py-2 rounded-lg text-xs font-semibold shadow-lg animate-in fade-in slide-in-from-bottom-2 z-50 flex items-center space-x-2 max-w-[calc(100%-2rem)]">
329
- {toastTone === 'error'
330
- ? <AlertCircle size={14} className="text-error shrink-0" />
331
- : <Check size={14} className="text-success shrink-0" />}
332
- <span>{toastMessage}</span>
333
- </div>
334
- )}
335
339
  </div>
336
340
  </div>
337
341
  );
@@ -1,12 +1,20 @@
1
1
  import type { LucideIcon } from 'lucide-preact';
2
- import { BarChart3, Bell, BookOpen, Bot, Boxes, Cloud, Coins, Cpu, FolderGit, Library, MessageSquare, Palette, Plug, Power, Puzzle, RefreshCw, Search, Sliders, Terminal, X } from 'lucide-preact';
2
+ import { BarChart3, Bell, BookOpen, Bot, Boxes, Cloud, Coins, Cpu, FolderGit, Library, MessageSquare, Palette, Plug, Power, Puzzle, RefreshCw, Search, Sliders, Terminal, Waypoints, X } from 'lucide-preact';
3
+ import { HarnessGlyph } from '@/client/components/common/harness-glyph';
3
4
  import type { SettingsCategoryId } from '@/shared/types';
5
+ import { SETTINGS_SECTIONS, type SettingsSection } from '@/shared/lib/settings/sections';
6
+ import { harnessMenuEntries } from '@/shared/lib/harness/menu';
4
7
 
5
8
  export interface CategoryDef {
6
9
  id: SettingsCategoryId;
7
10
  label: string;
8
11
  icon: LucideIcon;
9
- section: 'KABMO' | 'WORKSPACE' | 'OMP' | 'LIBRARY';
12
+ section: SettingsSection;
13
+ /** The AGENT this entry is a page for, when it is one. Its row then draws the
14
+ * vendor's own mark instead of a lucide shape — the sidebar is where a reader
15
+ * identifies an agent by its logo everywhere else in the app, and a generic
16
+ * `Waypoints` glyph beside "claude" is a shape nobody recognises. */
17
+ harness?: string;
10
18
  badge?: string;
11
19
  description: string;
12
20
  }
@@ -28,6 +36,19 @@ export const SETTINGS_CATEGORIES: CategoryDef[] = [
28
36
  { id: 'behavior', label: 'Behavior', icon: Sliders, section: 'OMP', description: 'Native AGENTS.md and RULES.md: global instructions, permission gates, and safety filters.' },
29
37
  { id: 'commands', label: 'Commands', icon: Terminal, section: 'OMP', description: 'Slash command macros and terminal shortcuts.' },
30
38
  { id: 'mcp', label: 'MCP', icon: Boxes, section: 'OMP', description: 'Model Context Protocol servers and dynamic tools.' },
39
+ // HARNESSES
40
+ // HARNESSES — one page per agent, derived from the catalog. `harnessMenuEntries`
41
+ // returns the overview first, then each non-built-in harness in catalog order.
42
+ ...harnessMenuEntries().map((entry) => ({
43
+ id: entry.id,
44
+ label: entry.label,
45
+ // The overview keeps a lucide glyph: it is not an agent, so a brand mark
46
+ // would claim it were one.
47
+ icon: Waypoints,
48
+ section: 'HARNESSES' as const,
49
+ ...(entry.harness ? { harness: entry.harness } : {}),
50
+ description: entry.description,
51
+ })),
31
52
  // LIBRARY
32
53
  { id: 'plugins', label: 'Plugins', icon: Plug, section: 'LIBRARY', description: 'Installed omp plugins, marketplaces, features, and plugin settings.' },
33
54
  { id: 'skills', label: 'Skills', icon: Library, section: 'LIBRARY', description: 'Manage downloaded skills and scripts.' },
@@ -43,6 +64,8 @@ interface SettingsSidebarProps {
43
64
  isReloading: boolean;
44
65
  onRestartKabmo: () => void;
45
66
  isRestarting: boolean;
67
+ /** Harness ids the user switched OFF: their rows leave the drawer. */
68
+ disabledHarnesses?: string[];
46
69
  className?: string;
47
70
  }
48
71
 
@@ -55,9 +78,16 @@ export function SettingsSidebar({
55
78
  isReloading,
56
79
  onRestartKabmo,
57
80
  isRestarting,
81
+ disabledHarnesses = [],
58
82
  className = ''
59
83
  }: SettingsSidebarProps) {
84
+ // A switched-off agent has no row here. The catalog list above stays complete
85
+ // on purpose — it is what the build KNOWS, and the All Harnesses page draws
86
+ // every entry in it with the switch that decides this. The ids arrive as a
87
+ // PROP rather than from `useHarnesses()` so the drawer stays presentational:
88
+ // it is drawn in table tests that must not fire a catalog read.
60
89
  const filteredCategories = SETTINGS_CATEGORIES.filter(cat => {
90
+ if (cat.harness && disabledHarnesses.includes(cat.harness)) return false;
61
91
  if (!searchQuery.trim()) return true;
62
92
  const q = searchQuery.toLowerCase();
63
93
  return cat.label.toLowerCase().includes(q) ||
@@ -65,7 +95,6 @@ export function SettingsSidebar({
65
95
  cat.description.toLowerCase().includes(q);
66
96
  });
67
97
 
68
- const sections: Array<'KABMO' | 'WORKSPACE' | 'OMP' | 'LIBRARY'> = ['KABMO', 'WORKSPACE', 'OMP', 'LIBRARY'];
69
98
 
70
99
  return (
71
100
  <div className={`flex flex-col h-full bg-canvas border-r border-ink/10 text-ink select-none ${className}`}>
@@ -99,7 +128,7 @@ export function SettingsSidebar({
99
128
  No matching settings found
100
129
  </div>
101
130
  ) : (
102
- sections.map(section => {
131
+ SETTINGS_SECTIONS.map(section => {
103
132
  const items = filteredCategories.filter(c => c.section === section);
104
133
  if (items.length === 0) return null;
105
134
 
@@ -124,7 +153,18 @@ export function SettingsSidebar({
124
153
  }`}
125
154
  >
126
155
  <div className="flex items-center space-x-2.5 truncate">
127
- <Icon size={14} className={isActive ? 'text-ink' : 'text-ink/60'} />
156
+ {/* The agent's own mark, at the size the lucide glyphs
157
+ draw, so a mixed list keeps one rhythm. The slot is
158
+ fixed width because the marks' viewBoxes differ
159
+ (omp is 64x64, the rest 24x24) and a bare inline
160
+ svg would shift every label beside it. */}
161
+ {item.harness ? (
162
+ <span className="flex w-[14px] shrink-0 items-center justify-center">
163
+ <HarnessGlyph harness={item.harness} size={14} />
164
+ </span>
165
+ ) : (
166
+ <Icon size={14} className={isActive ? 'text-ink' : 'text-ink/60'} />
167
+ )}
128
168
  <span className="truncate">{item.label}</span>
129
169
  </div>
130
170
  {item.badge && (
@@ -0,0 +1,207 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Settings → Harnesses: the roster, and one page per agent in it.
8
+ *
9
+ * Two shapes, and they answer two different questions:
10
+ *
11
+ * - **the overview** (`only` absent) is a LIST with a switch per row. The
12
+ * roster question is "which agents do I run here?", and twelve full cards —
13
+ * capabilities, config form, provider panel each — turned it into a page you
14
+ * scroll. Switching one ON probes it once (server-side, in the same request)
15
+ * so its models are ready; switching one OFF removes its settings page and
16
+ * its tab in the composer's model picker.
17
+ * - **one harness** (`only` set) is that agent's CARD: live status, what it
18
+ * advertised, its launch command and providers. The card is the same component
19
+ * the drawer's per-agent pages draw, so a single view cannot disagree with the
20
+ * overview about what an agent can do.
21
+ *
22
+ * What this page deliberately does NOT own: omp's own settings. Those live under
23
+ * OMP Engine and Providers and are omp-specific; duplicating them here would be
24
+ * two write paths for one config file.
25
+ */
26
+
27
+ import { useMemo, useState } from 'preact/hooks';
28
+ import { RefreshCw } from 'lucide-preact';
29
+ import { useHarnesses } from '@/client/hooks/models/use-harnesses';
30
+ import { HarnessCard } from '@/client/components/settings/categories/harness-settings/HarnessCard';
31
+ import { HarnessToggleList } from '@/client/components/settings/categories/harness-settings/ToggleList';
32
+ import { SettingsNotice, SettingsSearchField } from '@/client/components/settings/categories/harness-settings/parts';
33
+ import { harnessCategoryId } from '@/shared/lib/harness/menu';
34
+
35
+ interface HarnessSettingsProps {
36
+ /**
37
+ * Render ONE harness instead of the overview.
38
+ *
39
+ * A harness has its own menu entry, and the card it draws is the same one the
40
+ * overview uses — a second renderer for a single agent is how the two views
41
+ * start disagreeing about what that agent can do.
42
+ */
43
+ only?: string;
44
+ }
45
+
46
+ export function HarnessSettings({ only }: HarnessSettingsProps = {}) {
47
+ const {
48
+ harnesses, configs, providerSupport, isLoading, error, reload, probe, saveConfig, importProvider, addProvider,
49
+ setEnabled,
50
+ } = useHarnesses();
51
+ const [query, setQuery] = useState('');
52
+ // Which switch, or which Check, is in flight. ONE field for both because both
53
+ // are the same row's busy state and the row draws one spinner.
54
+ const [busy, setBusy] = useState<string | null>(null);
55
+ const [problem, setProblem] = useState<string | null>(null);
56
+ // The catalog error the user closed, by its TEXT rather than a boolean: a
57
+ // dismissal must not also swallow the NEXT, different failure — which a
58
+ // boolean would, leaving a broken catalog silent forever.
59
+ const [dismissedError, setDismissedError] = useState<string | null>(null);
60
+
61
+ // The built-in transport is NOT listed: `omp` over RPC is the default every
62
+ // discovered session already runs on, with nothing to install, probe or
63
+ // configure — its card could only say "no launch command is configured" beside
64
+ // a Check status button that could never succeed. It stays in the catalog
65
+ // because a session row still names the transport that ran it.
66
+ const installable = useMemo(() => harnesses.filter((entry) => !entry.builtIn), [harnesses]);
67
+
68
+ const filtered = useMemo(() => {
69
+ // A single-harness page is not a search surface: it shows the one agent the
70
+ // menu names, and nothing else can match. It also shows a SWITCHED-OFF agent
71
+ // if the user gets here from a stale link, with the switch right there.
72
+ if (only) return installable.filter((entry) => entry.id === only);
73
+ const needle = query.trim().toLowerCase();
74
+ if (!needle) return installable;
75
+ return installable.filter((entry) =>
76
+ entry.label.toLowerCase().includes(needle)
77
+ || entry.id.includes(needle)
78
+ || (entry.note ?? '').toLowerCase().includes(needle),
79
+ );
80
+ }, [installable, query, only]);
81
+
82
+ const enabledCount = installable.filter((entry) => entry.enabled).length;
83
+ const ready = installable.filter(
84
+ (entry) => entry.enabled && entry.probe && !entry.probe.capabilities.blocked,
85
+ ).length;
86
+
87
+ /** Switch a row and keep its busy state and refusal in one place. */
88
+ const toggle = async (id: string, enabled: boolean) => {
89
+ setBusy(id);
90
+ setProblem(null);
91
+ try {
92
+ setProblem(await setEnabled(id, enabled));
93
+ } finally {
94
+ setBusy(null);
95
+ }
96
+ };
97
+
98
+ const check = async (id: string) => {
99
+ setBusy(id);
100
+ setProblem(null);
101
+ try {
102
+ setProblem(await probe(id));
103
+ } finally {
104
+ setBusy(null);
105
+ }
106
+ };
107
+
108
+ /** Open that agent's settings page. A full navigation would lose the modal, so
109
+ * it is the same event the rest of the app uses to ask for a category. */
110
+ const openHarness = (id: string) => {
111
+ window.dispatchEvent(
112
+ new CustomEvent('omp:open-settings', { detail: { category: harnessCategoryId(id) } }),
113
+ );
114
+ };
115
+
116
+ return (
117
+ <div className="space-y-4">
118
+ <header className="flex flex-wrap items-start justify-between gap-3">
119
+ <div>
120
+ <h2 className="text-base font-semibold text-ink">
121
+ {only ? (harnesses.find((entry) => entry.id === only)?.label ?? only) : 'All Harnesses'}
122
+ </h2>
123
+ <p className="mt-0.5 text-xs text-ink/50">
124
+ {only
125
+ ? 'Providers, launch command, and the defaults a new chat on this agent starts on.'
126
+ : 'Switch on the agents you run. An agent that is off keeps no settings page and no tab in the model picker; switching one on probes it once.'}
127
+ </p>
128
+ </div>
129
+ <button
130
+ type="button"
131
+ onClick={reload}
132
+ className="inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-ink/20 px-2.5 py-1.5 text-[11px] text-ink/70 transition-colors hover:border-ink/40 hover:text-ink"
133
+ >
134
+ <RefreshCw size={12} /> Reload catalog
135
+ </button>
136
+ </header>
137
+
138
+ {/* The overview counts and searches; a single-harness page has one card and
139
+ needs neither. */}
140
+ {!only && (
141
+ <div className="flex flex-wrap items-center gap-3">
142
+ <SettingsSearchField value={query} onChange={setQuery} placeholder="Search harnesses" />
143
+ <span className="text-[11px] text-ink/45">
144
+ {enabledCount}/{installable.length} on · {ready} probed ready
145
+ </span>
146
+ </div>
147
+ )}
148
+
149
+ {error && error !== dismissedError && (
150
+ <SettingsNotice
151
+ message={error}
152
+ onDismiss={() => setDismissedError(error)}
153
+ dismissLabel="Dismiss the catalog error"
154
+ />
155
+ )}
156
+
157
+ {/* A refused switch or a refused probe is the agent's own words, shown
158
+ above the list rather than in a toast that would close with them. */}
159
+ {problem && (
160
+ <SettingsNotice
161
+ message={problem}
162
+ onDismiss={() => setProblem(null)}
163
+ dismissLabel="Dismiss this message"
164
+ />
165
+ )}
166
+
167
+ {isLoading && harnesses.length === 0 ? (
168
+ <div className="rounded-xl border border-ink/10 p-6 text-center text-xs text-ink/40">Reading the harness catalog…</div>
169
+ ) : only ? (
170
+ <div className="space-y-3">
171
+ {filtered.map((summary) => (
172
+ <HarnessCard
173
+ key={summary.id}
174
+ summary={summary}
175
+ onProbe={probe}
176
+ install={summary.install}
177
+ config={configs[summary.id]}
178
+ onSaveConfig={saveConfig}
179
+ onSetEnabled={(enabled) => void toggle(summary.id, enabled)}
180
+ busy={busy === summary.id}
181
+ {...(providerSupport[summary.id] ? { providerSupport: providerSupport[summary.id] } : {})}
182
+ onImportProvider={importProvider}
183
+ onAddProvider={addProvider}
184
+ />
185
+ ))}
186
+ {filtered.length === 0 && (
187
+ <div className="rounded-xl border border-ink/10 p-6 text-center text-xs text-ink/40">
188
+ This build does not list a harness named “{only}”.
189
+ </div>
190
+ )}
191
+ </div>
192
+ ) : filtered.length === 0 ? (
193
+ <div className="rounded-xl border border-ink/10 p-6 text-center text-xs text-ink/40">
194
+ No harness matches “{query}”.
195
+ </div>
196
+ ) : (
197
+ <HarnessToggleList
198
+ harnesses={filtered}
199
+ busy={busy}
200
+ onSetEnabled={(id, enabled) => void toggle(id, enabled)}
201
+ onOpen={openHarness}
202
+ onProbe={(id) => void check(id)}
203
+ />
204
+ )}
205
+ </div>
206
+ );
207
+ }
@@ -5,7 +5,6 @@ import { AddProjectModal } from '@/client/components/settings/categories/project
5
5
  import { DeleteProjectModal } from '@/client/components/settings/categories/project-settings/DeleteProjectModal';
6
6
  import { WorktreeSettings } from '@/client/components/settings/categories/project-settings/WorktreeSettings';
7
7
  import { LoadingState } from '@/client/components/settings/LoadingState';
8
- import { ToastStack } from '@/client/components/common/ToastStack';
9
8
  import { SettingsMasterDetail } from '@/client/components/settings/master-detail';
10
9
  import { useSettingsMasterDetail } from '@/client/hooks/settings/master-detail';
11
10
  import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
@@ -24,7 +23,7 @@ import type { ProjectConfigItem } from '@/shared/types';
24
23
  */
25
24
  export function ProjectSettings() {
26
25
  const masterDetail = useSettingsMasterDetail();
27
- const { toasts, pushToast, dismissToast } = useToasts();
26
+ const { pushToast } = useToasts();
28
27
 
29
28
  const [isAddOpen, setIsAddOpen] = useState(false);
30
29
  const [deleteTarget, setDeleteTarget] = useState<ProjectConfigItem | null>(null);
@@ -169,7 +168,6 @@ export function ProjectSettings() {
169
168
  onConfirm={() => void confirmDelete()}
170
169
  />
171
170
 
172
- <ToastStack toasts={toasts} onDismiss={dismissToast} />
173
171
  </div>
174
172
  );
175
173
  }
@@ -1,4 +1,3 @@
1
- import { ToastStack } from '@/client/components/common/ToastStack';
2
1
  import { useProviderSettings } from '@/client/hooks/settings/providers';
3
2
  import { ProviderSidebarList } from '@/client/components/settings/categories/provider-settings/SidebarList';
4
3
  import { ProviderHeader } from '@/client/components/settings/categories/provider-settings/Header';
@@ -39,9 +38,7 @@ export function ProviderSettings({
39
38
  isFetchingModels,
40
39
  isRefreshingIcon,
41
40
  handleRefreshIcon,
42
- toasts,
43
41
  pushToast,
44
- dismissToast,
45
42
  isAddModelModalOpen,
46
43
  setIsAddModelModalOpen,
47
44
  handleModelAdded,
@@ -148,7 +145,6 @@ export function ProviderSettings({
148
145
  }
149
146
  />
150
147
 
151
- <ToastStack toasts={toasts} onDismiss={dismissToast} />
152
148
 
153
149
  <AddProviderModal
154
150
  isOpen={isAddModalOpen}
@@ -1,7 +1,8 @@
1
1
  import { useEffect, useRef, useState } from 'preact/hooks';
2
- import { Check, Loader2, RefreshCw, Search, X } from 'lucide-preact';
2
+ import { Loader2, RefreshCw, Search, X } from 'lucide-preact';
3
3
  import type { CatalogSkillItem } from '@/shared/types';
4
4
  import { invalidateComposerCache } from '@/shared/lib/chat/composer/client';
5
+ import { useToasts } from '@/client/hooks/ui/toasts';
5
6
  import { useSkillCatalog } from '@/client/hooks/settings/skill-catalog';
6
7
  import { useSkillGitImport } from '@/client/hooks/settings/skill-git-import';
7
8
  import { SkillCard } from '@/client/components/settings/categories/skill-catalog/SkillCard';
@@ -37,7 +38,6 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
37
38
  const [query, setQuery] = useState('');
38
39
  const [searching, setSearching] = useState(false);
39
40
  const [refreshing, setRefreshing] = useState(false);
40
- const [toast, setToast] = useState<string | null>(null);
41
41
  const [busySkill, setBusySkill] = useState<string | null>(null);
42
42
  const [scanningSource, setScanningSource] = useState<string | null>(null);
43
43
  const [sourceBusy, setSourceBusy] = useState(false);
@@ -45,10 +45,7 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
45
45
 
46
46
  const installed = new Set(catalog.userSkills.map((skill) => skill.name));
47
47
 
48
- const showToast = (message: string) => {
49
- setToast(message);
50
- setTimeout(() => setToast(null), 3000);
51
- };
48
+ const { pushToast } = useToasts();
52
49
 
53
50
  useEffect(() => () => clearTimeout(debounce.current), []);
54
51
 
@@ -63,7 +60,7 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
63
60
  setSearching(true);
64
61
  catalog
65
62
  .search(value)
66
- .catch((error) => showToast(error instanceof Error ? error.message : String(error)))
63
+ .catch((error) => pushToast(error instanceof Error ? error.message : String(error), 'error'))
67
64
  .finally(() => setSearching(false));
68
65
  }, SEARCH_DEBOUNCE_MS);
69
66
  };
@@ -81,9 +78,9 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
81
78
  if (!response.ok || data?.error) throw new Error(data?.error || `Request failed (${response.status})`);
82
79
  if (Array.isArray(data?.skills)) catalog.setUserSkills(data.skills);
83
80
  invalidateComposerCache('command');
84
- showToast(isInstalled ? `Uninstalled "${skill.name}"` : `Installed "${skill.name}"`);
81
+ pushToast(isInstalled ? `Uninstalled "${skill.name}"` : `Installed "${skill.name}"`, 'success');
85
82
  } catch (error) {
86
- showToast(error instanceof Error ? error.message : String(error));
83
+ pushToast(error instanceof Error ? error.message : String(error), 'error');
87
84
  } finally {
88
85
  setBusySkill(null);
89
86
  }
@@ -93,8 +90,8 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
93
90
  setRefreshing(true);
94
91
  catalog
95
92
  .reload()
96
- .then(() => showToast('Catalog refreshed'))
97
- .catch((error) => showToast(error instanceof Error ? error.message : String(error)))
93
+ .then(() => pushToast('Catalog refreshed', 'success'))
94
+ .catch((error) => pushToast(error instanceof Error ? error.message : String(error), 'error'))
98
95
  .finally(() => setRefreshing(false));
99
96
  };
100
97
 
@@ -102,8 +99,8 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
102
99
  setScanningSource(id);
103
100
  catalog
104
101
  .scanSource(id)
105
- .then(({ skills }) => showToast(`Found ${skills.filter((skill) => skill.loadable).length} loadable skill(s)`))
106
- .catch((error) => showToast(error instanceof Error ? error.message : String(error)))
102
+ .then(({ skills }) => pushToast(`Found ${skills.filter((skill) => skill.loadable).length} loadable skill(s)`, 'success'))
103
+ .catch((error) => pushToast(error instanceof Error ? error.message : String(error), 'error'))
107
104
  .finally(() => setScanningSource(null));
108
105
  };
109
106
 
@@ -116,8 +113,8 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
116
113
  setSourceBusy(true);
117
114
  catalog
118
115
  .removeSource(id)
119
- .then(() => showToast('Source removed'))
120
- .catch((error) => showToast(error instanceof Error ? error.message : String(error)))
116
+ .then(() => pushToast('Source removed', 'success'))
117
+ .catch((error) => pushToast(error instanceof Error ? error.message : String(error), 'error'))
121
118
  .finally(() => setSourceBusy(false));
122
119
  };
123
120
 
@@ -220,7 +217,7 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
220
217
  onInstalled={() => {
221
218
  catalog.reload().catch(console.error);
222
219
  invalidateComposerCache('command');
223
- showToast('Skills installed — omp sessions were reloaded');
220
+ pushToast('Skills installed — omp sessions were reloaded', 'success');
224
221
  }}
225
222
  />
226
223
  ) : null}
@@ -237,13 +234,6 @@ export function SkillCatalogSettings({ initialTab = 'browse' }: { initialTab?: C
237
234
  />
238
235
  ) : null}
239
236
  </div>
240
-
241
- {toast ? (
242
- <div className="fixed bottom-6 right-6 z-50 bg-ink text-paper text-xs font-medium px-4 py-2.5 rounded-lg shadow-lg flex items-center gap-2 max-w-[calc(100vw-3rem)]">
243
- <Check size={14} className="flex-shrink-0" />
244
- <span className="leading-relaxed">{toast}</span>
245
- </div>
246
- ) : null}
247
237
  </div>
248
238
  );
249
239
  }
@@ -11,10 +11,14 @@
11
11
  * the model-role rows already avoid. The list is `/api/models` (the catalog the
12
12
  * composer uses), grouped by provider; a stored selector the catalog no longer
13
13
  * lists stays selectable so the form never rewrites a value it could not show.
14
+ *
15
+ * Searchable, not a native `<select>`: the catalog is close to a hundred rows on
16
+ * a real install, and picking one by scrolling an OS popup is the reason the
17
+ * roles' picker was rebuilt.
14
18
  */
15
19
 
16
- import { useMemo } from 'preact/hooks';
17
20
  import { useModelsCatalog } from '@/client/hooks/models/use-models-catalog';
21
+ import { SearchSelect } from '@/client/components/common/search-select';
18
22
 
19
23
  interface ModelPickerProps {
20
24
  value: string;
@@ -34,38 +38,27 @@ export function AgentModelPicker({ value, disabled, onChange }: ModelPickerProps
34
38
  }));
35
39
  }) ?? [];
36
40
 
37
- const groups = useMemo(() => {
38
- const byProvider = new Map<string, Array<{ selector: string; name: string }>>();
39
- for (const model of models) {
40
- const bucket = byProvider.get(model.provider);
41
- if (bucket) bucket.push(model);
42
- else byProvider.set(model.provider, [model]);
43
- }
44
- return [...byProvider.entries()];
45
- }, [models]);
46
-
47
41
  const known = models.some((model) => model.selector === value);
48
42
 
49
43
  return (
50
- <select
51
- aria-label="Override model"
52
- value={value || NOT_SELECTED}
53
- onChange={(event) => {
54
- const next = event.currentTarget.value;
55
- onChange(next === NOT_SELECTED ? '' : next);
56
- }}
44
+ <SearchSelect
45
+ ariaLabel="Override model"
46
+ value={value}
47
+ // "Not selected" is a real choice — it is how the override is removed, and
48
+ // the row inherits the session model again.
49
+ placeholder={NOT_SELECTED}
50
+ onChange={onChange}
57
51
  disabled={disabled}
58
- className="w-full cursor-pointer rounded-lg border border-ink/20 bg-paper py-2 pl-2 pr-3 font-mono text-xs text-ink transition-colors hover:border-ink/40 focus:border-ink focus:outline-none disabled:opacity-60"
59
- >
60
- <option value={NOT_SELECTED}>{NOT_SELECTED} — inherits the session model</option>
61
- {value && !known && <option value={value}>{value} (not in catalog)</option>}
62
- {groups.map(([provider, entries]) => (
63
- <optgroup key={provider} label={provider}>
64
- {entries.map((model) => (
65
- <option key={model.selector} value={model.selector}>{model.name}</option>
66
- ))}
67
- </optgroup>
68
- ))}
69
- </select>
52
+ className="w-full rounded-lg py-2 pl-2 pr-3 text-xs hover:border-ink/40 focus:border-ink disabled:opacity-60"
53
+ options={[
54
+ ...(value && !known ? [{ value, label: `${value} (not in catalog)` }] : []),
55
+ ...models.map((model) => ({
56
+ value: model.selector,
57
+ label: model.name,
58
+ hint: model.selector,
59
+ group: model.provider,
60
+ })),
61
+ ]}
62
+ />
70
63
  );
71
64
  }