@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,63 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * omp's embedded-shell trace is not transcript data, so it never enters one.
8
+ *
9
+ * 18.17.0 attached `details.trace` — the run's `ShellTrace`, `{units, history}`
10
+ * — to EVERY `bash` progress frame and to the final result, whether or not
11
+ * anyone asked for a visualization, because the tool wires `onTrace` whenever it
12
+ * has an `onUpdate` callback. 18.18.0 gates that on `display.shellVisualization`
13
+ * (default `true`), so the field still arrives unless the operator turns the row
14
+ * off — Kabmo draws no visualization and reads no field of it either way. Its
15
+ * `history` repeats the command's output as `Output` records, so the field is
16
+ * roughly a second copy of the result:
17
+ *
18
+ * - 40 output lines over 8 s → 192 KB of frames, against 19 KB on 18.16.0;
19
+ * - 120 lines over 73 s → 242 update frames, 9.2 MB in total;
20
+ * - a 40 000-line result → 311 KB progress frames, 1.15 MB for the call;
21
+ * - `seq 1 30000` → a 201 KB trace on the result alone (history 201 KB,
22
+ * `units` 619 B), carried in the session JSONL as well.
23
+ *
24
+ * The `session:<id>` topic publishes every frame to each open tab and `details`
25
+ * reaches the client's per-session tool-result map, so the trace is dropped
26
+ * where a child's frames reach subscribers ({@link stripShellTrace}) and again
27
+ * when a transcript is read back from disk ({@link withoutShellTrace}), because
28
+ * omp writes it into the JSONL itself.
29
+ */
30
+
31
+ import { isRecord } from '@/shared/lib/util/guards';
32
+
33
+ /**
34
+ * `details` without its shell trace, or the same value when it has none.
35
+ *
36
+ * Returns the SAME reference for a details bag that carries no `trace` — the
37
+ * usual case for every tool but a live `bash` — so callers pay nothing.
38
+ */
39
+ export function withoutShellTrace<T>(details: T): T {
40
+ if (!isRecord(details) || !('trace' in details)) return details;
41
+ const { trace: _trace, ...rest } = details;
42
+ return rest as T;
43
+ }
44
+
45
+ /**
46
+ * Drop the trace from a live frame, in place, and hand the frame back.
47
+ *
48
+ * The three carriers, all measured on 18.17.0: `partialResult.details` on
49
+ * `tool_execution_update`, `result.details` on `tool_execution_end`, and
50
+ * `message.details` on a `message_end` toolResult (the same result again, on the
51
+ * message the transcript keeps). In place rather than a copy because the frame
52
+ * is ours — parsed from the child's stdout a moment ago and discarded after the
53
+ * fan-out — and a 300 KB copy per progress frame is the cost this exists to
54
+ * avoid.
55
+ */
56
+ export function stripShellTrace<T extends Record<string, unknown>>(frame: T): T {
57
+ for (const holder of [frame.partialResult, frame.result, frame.message]) {
58
+ if (!isRecord(holder)) continue;
59
+ const details = holder.details;
60
+ if (isRecord(details) && 'trace' in details) delete details.trace;
61
+ }
62
+ return frame;
63
+ }
@@ -18,20 +18,47 @@
18
18
  import type { OmpProject, OmpSession, OmpSidebarData } from '@/shared/types/omp/session';
19
19
  import { formatNewSessionTitle } from '@/shared/lib/omp/session/default-title';
20
20
 
21
- /** Display title of a session: name, else first message, else a timestamped
22
- * `New Session - yyyy-mm-ddThh:mm:ss` default (unique per session — an
23
- * identical placeholder row made fresh sessions indistinguishable). */
24
- export function sessionTitleFor(session: OmpSession): string {
25
- if (session.name?.trim()) {
26
- const n = session.name.trim();
27
- return n.charAt(0).toUpperCase() + n.slice(1);
28
- }
29
- const first = (session.firstMessage || '').trim();
21
+ /**
22
+ * Display title of a chat, from the two things that can name it.
23
+ *
24
+ * ONE rule for both row sources: an omp session (whose JSONL carries `name` and
25
+ * `firstMessage`) and a recorded ACP chat (whose agent writes no session file, so
26
+ * Kabmo stores those same facts in `harness_sessions`). Two copies of this
27
+ * precedence is how one row source starts saying `Untitled` where the other says
28
+ * the first prompt.
29
+ */
30
+ export function deriveSessionTitle(parts: {
31
+ /** The chat's own name: omp's JSONL title slot, or an ACP agent's own
32
+ * `session_info_update`. */
33
+ name?: string | null;
34
+ /** The first user message, used only when no name exists. */
35
+ firstMessage?: string | null;
36
+ /**
37
+ * The chat's creation stamp, for the title a nameless chat is drawn with.
38
+ * Either shape the two row sources hold: an omp session carries an ISO
39
+ * string, a `harness_sessions` row an epoch in milliseconds.
40
+ */
41
+ created: number | string;
42
+ }): string {
43
+ const name = parts.name?.trim();
44
+ if (name) return name.charAt(0).toUpperCase() + name.slice(1);
45
+ const first = (parts.firstMessage || '').trim();
30
46
  if (first && first !== '(no messages)') {
31
47
  const text = first.slice(0, 120);
32
48
  return text.charAt(0).toUpperCase() + text.slice(1);
33
49
  }
34
- return formatNewSessionTitle(new Date(session.created));
50
+ return formatNewSessionTitle(new Date(parts.created));
51
+ }
52
+
53
+ /** Display title of a session: name, else first message, else a timestamped
54
+ * `New Session - yyyy-mm-ddThh:mm:ss` default (unique per session — an
55
+ * identical placeholder row made fresh sessions indistinguishable). */
56
+ export function sessionTitleFor(session: OmpSession): string {
57
+ return deriveSessionTitle({
58
+ name: session.name,
59
+ firstMessage: session.firstMessage,
60
+ created: session.created,
61
+ });
35
62
  }
36
63
 
37
64
  /** Project display name: alias, else lowercase basename of the path. */
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The idle ladder omp 18.17.0 gives a blocking `wait`, read from the prose it
8
+ * answers with: the window this call ran, and — from the second back-to-back
9
+ * idle wait on — the running total across the streak.
10
+ */
11
+
12
+ import { describe, expect, test } from 'bun:test';
13
+ import { WAIT_LADDER_MS, waitIdleLabel, waitIdleOf } from '@/shared/lib/omp/session/wait-idle';
14
+
15
+ describe('the idle ladder', () => {
16
+ test('mirrors the windows omp 18.17.0 gives a blocking wait', () => {
17
+ // The 30-minute cap is GONE: a wait returns when its window elapses, and the
18
+ // window climbs one rung for each back-to-back idle wait.
19
+ expect([...WAIT_LADDER_MS]).toEqual([5_000, 10_000, 30_000, 60_000, 300_000]);
20
+ });
21
+
22
+ test('reads the window omp names on a first idle return', () => {
23
+ // The FIRST rung carries no notice, only its own sentence.
24
+ expect(waitIdleOf('No reply within 5.0s.')).toEqual({ windowMs: 5_000 });
25
+ expect(waitIdleOf('No service finished within 30s. Read proc:// for status.')).toEqual({ windowMs: 30_000 });
26
+ });
27
+
28
+ test('reads the streak omp names from the second idle wait on', () => {
29
+ // `WAIT_NOTICE_RUNG` appends the notice whose span is the RUNNING TOTAL:
30
+ // 5 s + 10 s, then + 30 s, then + 60 s, then + 300 s.
31
+ expect(waitIdleOf('Nothing new after 15.0s of back-to-back waits. Waiting is not progress: …'))
32
+ .toEqual({ streakMs: 15_000 });
33
+ expect(waitIdleOf('Nothing new after 1m45s of back-to-back waits. …')).toEqual({ streakMs: 105_000 });
34
+ });
35
+
36
+ test('a settle is not an idle return', () => {
37
+ expect(waitIdleOf('A service finished. Read proc:// for its status and output.')).toBeUndefined();
38
+ expect(waitIdleOf('1\n2\n3')).toBeUndefined();
39
+ expect(waitIdleOf(undefined)).toBeUndefined();
40
+ });
41
+
42
+ test('labels the rung, or the streak once omp states it', () => {
43
+ expect(waitIdleLabel({ windowMs: 10_000 })).toBe('idle 10s');
44
+ expect(waitIdleLabel({ streakMs: 45_000 })).toBe('idle 45s total');
45
+ expect(waitIdleLabel({})).toBe('idle');
46
+ });
47
+ });
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * What a `wait` result says when it returned with nothing new.
8
+ *
9
+ * omp 18.17.0 removed the 30-minute cap (`WAIT_MAX_MS`) and with it the "Wait
10
+ * limit reached" answer the `wait` card used to name. A blocking wait now
11
+ * returns when its window elapses, and the window climbs one rung for every
12
+ * back-to-back idle wait — 5 s, 10 s, 30 s, 60 s, then 5 minutes — restarting at
13
+ * the floor once the agent has done other work in between. So there is no
14
+ * ceiling to count down to any more.
15
+ *
16
+ * Neither the rung nor the streak is a field on the result: both are stated in
17
+ * omp's prose, which is what this module parses. It lives beside `wait.ts`
18
+ * rather than inside it because the card's parser (jobs, agents, messages) and
19
+ * the outcomes omp words are separate subjects, and the file ceiling is real.
20
+ */
21
+
22
+ import { formatToolMs } from '@/shared/lib/chat/tool/labels';
23
+
24
+ /**
25
+ * How long a blocking `wait` gives its first wake, per rung of omp's ladder.
26
+ */
27
+ export const WAIT_LADDER_MS = [5_000, 10_000, 30_000, 60_000, 300_000] as const;
28
+
29
+ /** A span in omp's `formatDuration` spelling: `250ms`, `5.0s`, `30s`, `1m45s`, `5m`, `2h5m`. */
30
+ const OMP_DURATION = String.raw`(?:\d+d)?(?:\d+h)?(?:\d+m)?(?:[\d.]+s)?(?:\d+ms)?`;
31
+
32
+ /** `No reply within 5.0s.` / `No service finished within 30s. Read proc:// for status.` */
33
+ const WAIT_WINDOW_TEXT = new RegExp(`^No (?:reply|service finished) within (${OMP_DURATION})\\.`, 'm');
34
+
35
+ /** `Nothing new after 15.0s of back-to-back waits.` — appended from the SECOND
36
+ * consecutive idle wait, inside a `<system-notice>` block, and the only place
37
+ * the running streak is stated. */
38
+ const WAIT_IDLE_NOTICE = new RegExp(
39
+ `^(?:<system-notice>\\s*)?Nothing new after (${OMP_DURATION}) of back-to-back waits\\b`,
40
+ 'm',
41
+ );
42
+
43
+ /** What one idle return says, read from omp's prose — the result carries no field
44
+ * for it. `windowMs` is the rung this call ran; `streakMs` the total across the
45
+ * consecutive idle waits that led to it. */
46
+ export interface WaitIdle {
47
+ windowMs?: number;
48
+ streakMs?: number;
49
+ }
50
+
51
+ /**
52
+ * The idle return this result reports, or undefined when the wait settled
53
+ * something.
54
+ *
55
+ * Text is the only signal: `{op:'wait', jobs:[]}` is what an idle return, a
56
+ * service wake and a reply that can never arrive all answer with. omp names the
57
+ * window in its own sentence from the FIRST rung, and from the second on it
58
+ * appends the notice that tells the model waiting is not progress — whose span
59
+ * is the running total, so it is read first.
60
+ */
61
+ export function waitIdleOf(output: string | undefined): WaitIdle | undefined {
62
+ const text = output ?? '';
63
+ const notice = WAIT_IDLE_NOTICE.exec(text);
64
+ if (notice) return { streakMs: parseOmpDuration(notice[1] ?? '') };
65
+ const window = WAIT_WINDOW_TEXT.exec(text);
66
+ if (window) return { windowMs: parseOmpDuration(window[1] ?? '') };
67
+ return undefined;
68
+ }
69
+
70
+ /** `idle 10s` for the rung a call ran, `idle 15s total` once omp names the streak. */
71
+ export function waitIdleLabel(idle: WaitIdle): string {
72
+ if (idle.streakMs !== undefined) return `idle ${formatToolMs(idle.streakMs)} total`;
73
+ if (idle.windowMs !== undefined) return `idle ${formatToolMs(idle.windowMs)}`;
74
+ return 'idle';
75
+ }
76
+
77
+ /**
78
+ * omp's `formatDuration` (`@oh-my-pi/pi-utils`): `250ms`, `4.5s`, `1m30s`,
79
+ * `1m`, `2h5m`. Parsed back because the notice states the window as prose.
80
+ */
81
+ function parseOmpDuration(text: string): number | undefined {
82
+ const trimmed = text.trim();
83
+ const match = /^(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:([\d.]+)s)?(?:(\d+)ms)?$/.exec(trimmed);
84
+ if (!match || !trimmed) return undefined;
85
+ const [, days, hours, minutes, seconds, millis] = match;
86
+ const total =
87
+ Number(days ?? 0) * 86_400_000 +
88
+ Number(hours ?? 0) * 3_600_000 +
89
+ Number(minutes ?? 0) * 60_000 +
90
+ Number(seconds ?? 0) * 1000 +
91
+ Number(millis ?? 0);
92
+ return Number.isFinite(total) && total > 0 ? total : undefined;
93
+ }
@@ -9,8 +9,8 @@
9
9
  * The fixtures are the shapes omp actually sends (measured on 443 results in
10
10
  * the author's session store): a blocking snapshot with running jobs, a
11
11
  * settled snapshot with a completion, an interrupted wait with no jobs, a peer
12
- * message that woke it, and the 30-minute cap's empty result. The empty result
13
- * is the load-bearing one — it is a real ANSWER ("Wait limit reached"), and a
12
+ * message that woke it, and the empty result of an idle window. The empty result
13
+ * is the load-bearing one — it is a real ANSWER ("No reply within 5.0s."), and a
14
14
  * reader that treated "no jobs" as "not a wait" drew the most interesting wait
15
15
  * of all as a generic card.
16
16
  *
@@ -20,8 +20,6 @@
20
20
  import { describe, expect, test } from 'bun:test';
21
21
  import {
22
22
  formatWaitClock,
23
- WAIT_MAX_MS,
24
- waitHitLimit,
25
23
  waitCounts,
26
24
  waitJobSpanMs,
27
25
  waitSummaryLine,
@@ -76,8 +74,9 @@ describe('waitViewOf', () => {
76
74
  });
77
75
 
78
76
  test('an empty job list is an answer, not an absence', () => {
79
- // `{op:'wait', jobs:[]}` is what omp returns when the 30-minute cap elapses
80
- // and when a SERVICE rather than a job woke the call.
77
+ // `{op:'wait', jobs:[]}` is what omp returns when the call's idle window
78
+ // elapses, when a SERVICE rather than a job woke the call, and when every
79
+ // agent asked can no longer answer.
81
80
  const view = waitViewOf({ details: { op: 'wait', jobs: [] } });
82
81
  expect(view?.jobs).toEqual([]);
83
82
  expect(view?.interrupted).toBe(false);
@@ -88,11 +87,37 @@ describe('waitViewOf', () => {
88
87
  expect(view?.interrupted).toBe(true);
89
88
  });
90
89
 
91
- test('reads the peer message that ended the wait', () => {
90
+ test('reads the peer messages that ended the wait', () => {
91
+ // omp 18.17.0: a wake returns EVERY message queued by then, oldest first.
92
92
  const view = waitViewOf({
93
- details: { op: 'wait', from: 'main', waited: { from: 'Sleeper', to: 'main', body: 'done', ts: 1_791_000_000_000 } },
93
+ details: {
94
+ op: 'wait',
95
+ from: 'main',
96
+ waited: [
97
+ { from: 'Sleeper', to: 'main', body: 'done', ts: 1_791_000_000_000 },
98
+ { from: 'Scout', to: 'main', body: 'found it', ts: 1_791_000_000_001 },
99
+ ],
100
+ },
94
101
  });
95
- expect(view?.waited).toMatchObject({ from: 'Sleeper', body: 'done' });
102
+ expect(view?.waited).toHaveLength(2);
103
+ expect(view?.waited[0]).toMatchObject({ from: 'Sleeper', body: 'done' });
104
+ expect(view?.waited[1]).toMatchObject({ from: 'Scout', body: 'found it' });
105
+ });
106
+
107
+ test('reads the single-message shape a session recorded before 18.17.0 keeps', () => {
108
+ // The JSONL is authoritative for reloads, and the field was an OBJECT until
109
+ // 18.17.0. `isRecord` refuses an array, so the old parser answered undefined
110
+ // — the message block vanished silently on every new wait.
111
+ const view = waitViewOf({
112
+ details: { op: 'wait', from: 'main', waited: { from: 'Sleeper', to: 'main', body: 'done', ts: 1 } },
113
+ });
114
+ expect(view?.waited).toHaveLength(1);
115
+ expect(view?.waited[0]).toMatchObject({ from: 'Sleeper', body: 'done' });
116
+ });
117
+
118
+ test('a wait that woke on nothing reports no messages', () => {
119
+ expect(waitViewOf({ details: { op: 'wait', jobs: [] } })?.waited).toEqual([]);
120
+ expect(waitViewOf({ name: 'wait' })?.waited).toEqual([]);
96
121
  });
97
122
 
98
123
  test('does not claim a proc:// or hub listing', () => {
@@ -179,30 +204,6 @@ describe('waitCounts and the summary line', () => {
179
204
  });
180
205
  });
181
206
 
182
- describe('the 30-minute cap', () => {
183
- test('is the runtime’s own ceiling, not a client guess', () => {
184
- // omp 18.12.0: `WAIT_MAX_MS = 30 * 60_000`, and the tool's schema is
185
- // `type({})` — a caller cannot ask for a longer wait.
186
- expect(WAIT_MAX_MS).toBe(1_800_000);
187
- expect(formatWaitClock(WAIT_MAX_MS)).toBe('30:00');
188
- });
189
-
190
- test('the limit-reached result is recognised from its prose', () => {
191
- // The result carries NO flag for this: `{op:'wait', jobs:[]}` is also what a
192
- // service wake answers, so the sentence is the only discriminator.
193
- const view = waitViewOf({ details: { op: 'wait', jobs: [] } })!;
194
- expect(waitHitLimit(view, 'Wait limit reached; background work may still be running. Read proc:// for status.')).toBe(true);
195
- });
196
-
197
- test('a service wake and a normal settle are not the cap', () => {
198
- const empty = waitViewOf({ details: { op: 'wait', jobs: [] } })!;
199
- expect(waitHitLimit(empty, 'A service finished. Read proc:// for its status and output.')).toBe(false);
200
- expect(waitHitLimit(empty, undefined)).toBe(false);
201
- const settled = waitViewOf({ details: { op: 'wait', jobs: [{ id: 'bg_1', status: 'completed' }] } })!;
202
- expect(waitHitLimit(settled, 'Wait limit reached')).toBe(false);
203
- });
204
- });
205
-
206
207
  describe('formatWaitClock', () => {
207
208
  test('keeps a fixed width per scale so the digits do not re-flow', () => {
208
209
  expect(formatWaitClock(7_000)).toBe('0:07');
@@ -15,7 +15,7 @@
15
15
  * resolvedModel?,resolvedThinkingLevel?,resultText?,errorText?,
16
16
  * agentUrlId?}] }
17
17
  * { op:'wait', jobs:[], interrupted:true } // cut short by a message
18
- * { op:'wait', from:<sender>, waited:{from,to,body,ts} } // a peer message woke it
18
+ * { op:'wait', from:<sender>, waited:[{from,to,body,ts}] } // peer messages woke it
19
19
  * { op:'cancel', jobs:[...], cancelled:[{id,status}] }
20
20
  *
21
21
  * While the call is still blocking omp re-emits the SAME snapshot every 500 ms
@@ -93,7 +93,9 @@ export interface WaitView {
93
93
  /** The wait was cut short by steering, a peer message or a completion notice. */
94
94
  interrupted: boolean;
95
95
  cancelled: { id?: string; status?: string }[];
96
- waited?: WaitMessage;
96
+ /** The messages a wake consumed, oldest first (omp 18.17.0 returns an array;
97
+ * a session recorded earlier carries one object, which is still read). */
98
+ waited: WaitMessage[];
97
99
  /** The message a `send` delivered to, for the `send` op. */
98
100
  from?: string;
99
101
  to?: string;
@@ -169,6 +171,21 @@ function messageOf(value: unknown): WaitMessage | undefined {
169
171
  };
170
172
  }
171
173
 
174
+ /**
175
+ * The messages a wake consumed, oldest first.
176
+ *
177
+ * omp 18.17.0 changed the field from ONE message to an ARRAY — a wake returns
178
+ * every message queued by then (`messageResult(senderId, waited: IrcMessage[])`)
179
+ * — and the old single-object shape is still read, because a session recorded
180
+ * on 18.16.0 keeps it in its JSONL. Reading only the array dropped the message
181
+ * block and the `message received` chip on every new wait, silently: `isRecord`
182
+ * refuses an array, so the old code answered `undefined` rather than failing.
183
+ */
184
+ function messagesOf(value: unknown): WaitMessage[] {
185
+ const rows = Array.isArray(value) ? value : [value];
186
+ return rows.map(messageOf).filter(Boolean) as WaitMessage[];
187
+ }
188
+
172
189
  const WAIT_OPS: Record<string, true> = { wait: true, send: true };
173
190
 
174
191
  /** The tool names that ARE a coordination call, independent of their result. */
@@ -190,10 +207,10 @@ function opOfTool(tool: { name?: string; type?: string }): string | undefined {
190
207
  * `jobs` belong to `proc://` and are already read by `procViewOf`.
191
208
  *
192
209
  * An EMPTY job list is a real answer, not an absence: omp returns
193
- * `{op:'wait', jobs:[]}` when the 30-minute cap elapses ("Wait limit reached;
194
- * background work may still be running") and when a service rather than a job
195
- * woke the call. Rejecting it drew the most interesting wait of all as a
196
- * generic card.
210
+ * `{op:'wait', jobs:[]}` when the call ran out its idle window with nothing new
211
+ * ("No reply within 10s."), when a service rather than a job woke the call, and
212
+ * when every agent asked can no longer answer. Rejecting it drew the most
213
+ * interesting wait of all as a generic card.
197
214
  *
198
215
  * A wait with NO result at all is still a wait, and the tool's own name is the
199
216
  * only evidence left — a page reloaded while the call blocks reads the JSONL's
@@ -213,7 +230,7 @@ export function waitViewOf(tool: {
213
230
  const op = reportedOp ?? opOfTool(tool);
214
231
  if (!op || !WAIT_OPS[op]) return undefined;
215
232
  if (!details) {
216
- return { op, jobs: [], agents: [], interrupted: false, cancelled: [], reported: false };
233
+ return { op, jobs: [], agents: [], interrupted: false, cancelled: [], waited: [], reported: false };
217
234
  }
218
235
 
219
236
  return {
@@ -226,7 +243,7 @@ export function waitViewOf(tool: {
226
243
  cancelled: Array.isArray(details.cancelled)
227
244
  ? details.cancelled.filter(isRecord).map((row) => ({ id: asString(row.id), status: asString(row.status) }))
228
245
  : [],
229
- waited: messageOf(details.waited),
246
+ waited: details.waited === undefined ? [] : messagesOf(details.waited),
230
247
  from: asString(details.from),
231
248
  to: asString(details.to),
232
249
  reported: reportedOp !== undefined,
@@ -288,34 +305,3 @@ export function formatWaitClock(ms: number): string {
288
305
  const hours = Math.floor(totalSeconds / 3600);
289
306
  return hours > 0 ? `${hours}:${String(minutes).padStart(2, '0')}:${seconds}` : `${minutes}:${seconds}`;
290
307
  }
291
-
292
- /**
293
- * How long a single `wait` call may block, as omp enforces it.
294
- *
295
- * Hardcoded in omp's own tool (`WAIT_MAX_MS = 30 * 60_000`, verified on 18.12.0)
296
- * and NOT a parameter: its schema is `type({})`, so the model cannot ask for
297
- * more. When the timer wins the race, omp returns `{op:'wait', jobs:[]}` and the
298
- * sentence "Wait limit reached; background work may still be running."
299
- *
300
- * The panel shows this because a blocking call is watched for minutes, and
301
- * without the ceiling a reader has no way to tell "still waiting" from "waiting
302
- * for something that can never arrive".
303
- */
304
- export const WAIT_MAX_MS = 30 * 60_000;
305
-
306
- /** The sentence omp returns when its own cap fired. Matched on the text because
307
- * the result carries no flag for it — `jobs: []` is also what a service wake
308
- * answers, and those two must not be reported as the same event. */
309
- const WAIT_LIMIT_TEXT = /wait limit reached/i;
310
-
311
- /**
312
- * Whether this result is the cap firing rather than a normal settle.
313
- *
314
- * Text is the only signal: measured across 443 real `wait` results, the
315
- * limit-reached answer and a service wake both carry `{op:'wait', jobs:[]}`,
316
- * and only the prose distinguishes them.
317
- */
318
- export function waitHitLimit(view: WaitView, output: string | undefined): boolean {
319
- if (view.jobs.length > 0) return false;
320
- return WAIT_LIMIT_TEXT.test(output ?? '');
321
- }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The settings sidebar's groups, in the order they are drawn.
8
+ *
9
+ * ONE list, imported by both the sidebar's type and its render loop. It used to
10
+ * be written twice — once in the `section` union, once in the `sections` array
11
+ * beside the drawer — so adding a group meant editing two string literals in
12
+ * two places and a missed one silently dropped every category under it from the
13
+ * sidebar (no error, no empty state: the loop just never asked for that group).
14
+ *
15
+ * `HARNESSES` is its own group rather than a member of `OMP`: omp's pages are one
16
+ * engine's own config (engine state, providers, agents, behavior, commands,
17
+ * MCP), while that group holds OTHER agents entirely — a different transport, a
18
+ * different config file, and per-agent sections. Filing them together made the
19
+ * sidebar read as "omp settings" followed by seven pages that are not omp.
20
+ */
21
+
22
+ export const SETTINGS_SECTIONS = ['KABMO', 'WORKSPACE', 'OMP', 'HARNESSES', 'LIBRARY'] as const;
23
+
24
+ export type SettingsSection = (typeof SETTINGS_SECTIONS)[number];
@@ -58,6 +58,8 @@ function paletteBlock(theme: ThemePalette): string {
58
58
  ` --theme-ink: ${theme.ink};`,
59
59
  // Fifteen distinct values: the ink at N% over this palette's paper.
60
60
  ...scale.ladder.map((value, index) => ` --theme-ink-${MUTED_STEPS[index]}: ${value};`),
61
+ // The inline-code chip's OWN fill, opaque (see `CODE_FILL_PERCENT`).
62
+ ` --theme-code-fill: ${scale.codeFill};`,
61
63
  // Muted text on an inverted surface: an alpha reads 2.91:1 on `solarized-light`.
62
64
  ` --theme-on-ink-muted: ${onInkTextColor(theme)};`,
63
65
  // The one level that clears AA on THIS palette. No single rung can be legal
@@ -11,6 +11,18 @@ export const MUTED_STEPS = [20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80,
11
11
  * `/60` is 4.46:1, so the boundary sits where it is needed, not safely above it. */
12
12
  export const TEXT_CONTRAST_FLOOR = 65;
13
13
 
14
+ /**
15
+ * Strength of the inline-code chip's fill, as a percentage of ink over paper.
16
+ *
17
+ * The chip is SOLVED, not an alpha: `color-mix(… 8%, transparent)` composites
18
+ * with whatever is painted behind the chip, so a hovered block's tint showed
19
+ * through it and the code changed colour mid-hover (measured on a real session
20
+ * in the browser: the same `/Applications/Obsidian.app` chip read `#e4e9ed` at
21
+ * rest and `#dce2e5` with the hover tint behind it). An opaque value also pins
22
+ * the contrast between the code and its chip, which an alpha cannot.
23
+ */
24
+ export const CODE_FILL_PERCENT = 8;
25
+
14
26
  /** AA for small text. Named so the floor above can be read as a contrast. */
15
27
  export const MUTED_CONTRAST_FLOOR = 4.5;
16
28
 
@@ -39,6 +51,8 @@ export interface InkScale {
39
51
  ladder: readonly string[];
40
52
  /** The lightest step that clears AA on both surfaces; the OS shells read it. */
41
53
  muted: string;
54
+ /** The inline-code chip's fill: opaque ink over this palette's paper. */
55
+ codeFill: string;
42
56
  }
43
57
 
44
58
  /** Cached per palette object, so a render pass costs no arithmetic. */
@@ -58,7 +72,13 @@ export function inkScale(palette: ThemePalette): InkScale {
58
72
  ladder.find((color) => worstTextContrast(color, palette) >= MUTED_CONTRAST_FLOOR) ??
59
73
  palette.ink;
60
74
 
61
- const scale: InkScale = { ink: palette.ink, ladder, muted };
75
+ const scale: InkScale = {
76
+ ink: palette.ink,
77
+ ladder,
78
+ muted,
79
+ // Opaque: the paper base is what makes the chip independent of its backdrop.
80
+ codeFill: mixHex(palette.paper, palette.ink, CODE_FILL_PERCENT / 100),
81
+ };
62
82
  cache.set(palette, scale);
63
83
  return scale;
64
84
  }
@@ -28,7 +28,7 @@ import { describe, expect, test } from 'bun:test';
28
28
 
29
29
  import { mixHex, parseHexColor, relativeLuminance, rgbaToHex } from '@/shared/lib/theme/color';
30
30
  import { THEME_STYLE_ELEMENT_ID, themeStyleSheet } from '@/shared/lib/theme/css';
31
- import { MUTED_STEPS, inkScale, onInkTextColor, signalTextColor } from '@/shared/lib/theme/ink-scale';
31
+ import { CODE_FILL_PERCENT, MUTED_STEPS, inkScale, onInkTextColor, signalTextColor } from '@/shared/lib/theme/ink-scale';
32
32
  import { KABMO_PALETTES } from '@/shared/lib/theme/palettes/kabmo';
33
33
  import { DARK_PALETTES } from '@/shared/lib/theme/palettes/dark';
34
34
  import { DARK_EXTENDED_PALETTES } from '@/shared/lib/theme/palettes/dark-extended';
@@ -141,6 +141,9 @@ describe('generated stylesheet', () => {
141
141
  // the ink cannot clear AA on every one (`ink-scale.ts`). One token per
142
142
  // step: bucketing them onto four collapsed the ladder.
143
143
  ...MUTED_STEPS.map((step, index) => ` --theme-ink-${step}: ${inkScale(paper).ladder[index]};`),
144
+ // The inline-code chip's own opaque fill (never an alpha: see the
145
+ // `--theme-code-fill` rule in `tailwind.css`).
146
+ ` --theme-code-fill: ${inkScale(paper).codeFill};`,
144
147
  // Muted text for an inverted surface (`bg-ink`).
145
148
  ` --theme-on-ink-muted: ${onInkTextColor(paper)};`,
146
149
  ` --theme-muted: ${inkScale(paper).muted};`,
@@ -166,19 +169,32 @@ describe('generated stylesheet', () => {
166
169
 
167
170
  test('names every slot --theme-* and nothing else', () => {
168
171
  const names = [...css.matchAll(/--theme-[a-z0-9-]+:/g)].map((match) => match[0]);
169
- // Eight palette slots, fifteen muted steps, the inverted-surface level, the
170
- // palette's own AA level (`--theme-muted`), the five solved signal levels,
171
- // and the two hover mixes.
172
- expect(new Set(names).size).toBe(32);
172
+ // Eight palette slots, fifteen muted steps, the inline-code chip's fill,
173
+ // the inverted-surface level, the palette's own AA level (`--theme-muted`),
174
+ // the five solved signal levels, and the two hover mixes.
175
+ expect(new Set(names).size).toBe(33);
173
176
  expect(names[0]).toBe('--theme-paper:');
174
177
  // Slot order is the swatch order the appearance cards render.
175
178
  expect(names[2]).toBe('--theme-ink:');
176
179
  expect(names[3]).toBe('--theme-ink-20:');
177
180
  expect(names[17]).toBe('--theme-ink-90:');
178
- expect(names[18]).toBe('--theme-on-ink-muted:');
179
- expect(names[19]).toBe('--theme-muted:');
180
- expect(names[24]).toBe('--theme-meta:');
181
- expect(names[25]).toBe('--theme-error-text:');
181
+ expect(names[18]).toBe('--theme-code-fill:');
182
+ expect(names[19]).toBe('--theme-on-ink-muted:');
183
+ expect(names[20]).toBe('--theme-muted:');
184
+ expect(names[25]).toBe('--theme-meta:');
185
+ expect(names[26]).toBe('--theme-error-text:');
186
+ });
187
+
188
+ test('states the inline-code chip fill as an opaque colour, per palette', () => {
189
+ // The chip must NOT be an alpha: a translucent fill composites with whatever
190
+ // is painted behind it, so a hovered block changed the code's colour.
191
+ expect(css).not.toContain('--theme-code-fill: color-mix');
192
+ for (const palette of [KABMO_PALETTES[0], DARK_PALETTES[0]]) {
193
+ const fill = inkScale(palette).codeFill;
194
+ expect(fill).toBe(mixHex(palette.paper, palette.ink, CODE_FILL_PERCENT / 100));
195
+ expect(fill).toMatch(/^#[0-9a-f]{6}$/);
196
+ expect(css).toContain(`--theme-code-fill: ${fill};`);
197
+ }
182
198
  });
183
199
 
184
200
  test('is cached for the life of the process', () => {
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { describe, expect, test } from 'bun:test';
7
+ import { DIALOG_GUTTER_REM, safeAreaPadding } from '@/shared/lib/ui/safe-area';
8
+
9
+ describe('safeAreaPadding', () => {
10
+ test('every edge takes the LARGER of the gutter and the device inset', () => {
11
+ // `max()`, never a sum: a notched phone would otherwise get gutter + inset,
12
+ // which is twice the clearance the dialog needs.
13
+ const style = safeAreaPadding();
14
+ expect(style.paddingTop).toBe(`max(${DIALOG_GUTTER_REM}rem, env(safe-area-inset-top, 0px))`);
15
+ expect(style.paddingBottom).toBe(`max(${DIALOG_GUTTER_REM}rem, env(safe-area-inset-bottom, 0px))`);
16
+ expect(style.paddingLeft).toBe(`max(${DIALOG_GUTTER_REM}rem, env(safe-area-inset-left, 0px))`);
17
+ expect(style.paddingRight).toBe(`max(${DIALOG_GUTTER_REM}rem, env(safe-area-inset-right, 0px))`);
18
+ });
19
+
20
+ test('a caller with its own gutter keeps it on all four edges', () => {
21
+ const style = safeAreaPadding(1);
22
+ expect(style.paddingTop).toBe('max(1rem, env(safe-area-inset-top, 0px))');
23
+ expect(style.paddingBottom).toBe('max(1rem, env(safe-area-inset-bottom, 0px))');
24
+ // Both horizontal edges, because a landscape phone's notch is on a SIDE.
25
+ expect(style.paddingLeft).toBe('max(1rem, env(safe-area-inset-left, 0px))');
26
+ expect(style.paddingRight).toBe('max(1rem, env(safe-area-inset-right, 0px))');
27
+ });
28
+ });