@kabmo-labs/kabmo 0.26.0 → 0.28.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 (354) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +502 -474
  3. package/dist/client/static/js/index-81f7berm.css +1 -0
  4. package/dist/client/static/js/{index-95b3n20k.js → index-xzvyrxya.js} +799 -799
  5. package/marketplace/plugins/command-runner/package.json +3 -17
  6. package/marketplace/plugins/command-runner/settings-schema.json +14 -0
  7. package/marketplace/plugins/git-forge/README.md +17 -7
  8. package/marketplace/plugins/git-forge/package.json +4 -30
  9. package/marketplace/plugins/git-forge/panel.css +16 -0
  10. package/marketplace/plugins/git-forge/settings-schema.json +27 -0
  11. package/marketplace/plugins/git-forge/src/panel/Badge.tsx +35 -22
  12. package/marketplace/plugins/git-forge/src/panel/Change.tsx +20 -24
  13. package/marketplace/plugins/git-forge/src/panel/CiBadge.tsx +16 -7
  14. package/marketplace/plugins/git-forge/src/panel/Credential.tsx +31 -26
  15. package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +18 -2
  16. package/marketplace/plugins/git-forge/src/panel/Header.tsx +160 -96
  17. package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +60 -44
  18. package/marketplace/plugins/git-forge/src/panel/List.tsx +150 -22
  19. package/marketplace/plugins/git-forge/src/panel/Row.tsx +11 -5
  20. package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +17 -15
  21. package/marketplace/plugins/git-forge/src/panel/Write.tsx +84 -61
  22. package/marketplace/plugins/git-forge/src/panel/format.test.ts +99 -0
  23. package/marketplace/plugins/git-forge/src/panel/format.ts +59 -16
  24. package/marketplace/plugins/git-forge/src/panel/index.test.tsx +109 -5
  25. package/marketplace/plugins/git-forge/src/panel/index.tsx +37 -4
  26. package/marketplace/plugins/git-forge/src/panel/use-forge.ts +17 -0
  27. package/marketplace/plugins/git-forge/src/panel/write.test.tsx +31 -0
  28. package/marketplace/plugins/session-info/package.json +2 -10
  29. package/marketplace/plugins/session-info/settings-schema.json +8 -0
  30. package/marketplace/plugins/stats/README.md +17 -5
  31. package/marketplace/plugins/stats/package.json +3 -23
  32. package/marketplace/plugins/stats/settings-schema.json +20 -0
  33. package/marketplace/plugins/stats/src/app.tsx +1 -1
  34. package/marketplace/plugins/stats/src/groups.test.ts +46 -1
  35. package/marketplace/plugins/stats/src/groups.ts +22 -11
  36. package/marketplace/plugins/stats/src/harness-leases.test.ts +84 -0
  37. package/marketplace/plugins/stats/src/harness-leases.ts +132 -0
  38. package/marketplace/plugins/stats/src/labels.test.ts +54 -1
  39. package/marketplace/plugins/stats/src/labels.ts +33 -7
  40. package/marketplace/plugins/stats/src/sampler.test.ts +61 -0
  41. package/marketplace/plugins/stats/src/sampler.ts +39 -5
  42. package/marketplace/plugins/stats/src/snapshot.ts +6 -0
  43. package/package.json +2 -2
  44. package/src/client/components/common/Toast.test.tsx +28 -2
  45. package/src/client/components/common/Toast.tsx +21 -9
  46. package/src/client/components/common/harness-glyph/index.tsx +18 -1
  47. package/src/client/components/common/session-actions-menu/index.test.tsx +106 -0
  48. package/src/client/components/common/session-actions-menu/index.tsx +43 -1
  49. package/src/client/components/common/session-row/TrailingSlot.tsx +9 -4
  50. package/src/client/components/common/session-row/index.tsx +4 -0
  51. package/src/client/components/common/session-row/session-row.test.tsx +6 -0
  52. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +2 -1
  53. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +4 -2
  54. package/src/client/components/layout/session-sidebar/SessionItem.tsx +9 -1
  55. package/src/client/components/layout/session-sidebar/SessionList.tsx +2 -1
  56. package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +3 -2
  57. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +2 -1
  58. package/src/client/components/layout/session-sidebar/modern/RevealRow.tsx +56 -0
  59. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +12 -29
  60. package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +104 -0
  61. package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +202 -0
  62. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +80 -19
  63. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +23 -3
  64. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +5 -1
  65. package/src/client/components/layout/session-sidebar/variant-props.ts +2 -1
  66. package/src/client/components/mobile/SessionSidebar.tsx +2 -1
  67. package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +156 -0
  68. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +41 -86
  69. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +2 -1
  70. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +4 -2
  71. package/src/client/components/mobile/mobile-session-sidebar/List.tsx +2 -1
  72. package/src/client/components/mobile/mobile-session-sidebar/SessionRow.test.ts +6 -0
  73. package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +9 -1
  74. package/src/client/components/settings/Modal.tsx +7 -3
  75. package/src/client/components/settings/Sidebar.tsx +30 -3
  76. package/src/client/components/settings/categories/HarnessSettings.tsx +11 -7
  77. package/src/client/components/settings/categories/NotificationSettings.test.tsx +40 -15
  78. package/src/client/components/settings/categories/NotificationSettings.tsx +142 -64
  79. package/src/client/components/settings/categories/PanelPluginSettings.tsx +1 -1
  80. package/src/client/components/settings/categories/harness-settings/CustomHarnessForm.tsx +186 -0
  81. package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +11 -0
  82. package/src/client/components/settings/categories/panel-plugins/PluginCard.test.tsx +1 -0
  83. package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +15 -1
  84. package/src/client/components/settings/categories/panel-plugins/SettingsModal.test.tsx +165 -0
  85. package/src/client/components/settings/categories/panel-plugins/SettingsModal.tsx +260 -0
  86. package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -1
  87. package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +39 -19
  88. package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +1 -0
  89. package/src/client/components/settings/categories/usage-settings/limit-groups.test.ts +94 -0
  90. package/src/client/components/settings/categories/usage-settings/limit-groups.ts +118 -0
  91. package/src/client/components/settings/categories/usage-settings/limits-section.test.tsx +118 -0
  92. package/src/client/components/workspace/chat-timeline/AiMessageFooter.fork.test.ts +24 -0
  93. package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +8 -4
  94. package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +34 -0
  95. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +61 -56
  96. package/src/client/components/workspace/chat-timeline/MessageItem.fork.test.ts +80 -0
  97. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +9 -3
  98. package/src/client/components/workspace/chat-timeline/MessageList.tsx +3 -1
  99. package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +11 -1
  100. package/src/client/components/workspace/chat-timeline/PendingTranscript.tsx +130 -0
  101. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +2 -1
  102. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +2 -1
  103. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +8 -0
  104. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +9 -0
  105. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +4 -1
  106. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +24 -0
  107. package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +13 -20
  108. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +2 -0
  109. package/src/client/components/workspace/chat-timeline/chat-input/props.ts +5 -5
  110. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +141 -0
  111. package/src/client/components/workspace/chat-timeline/index.tsx +17 -6
  112. package/src/client/components/workspace/chat-timeline/target-picker/DraftTargetRow.tsx +3 -10
  113. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +101 -0
  114. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +2 -2
  115. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +5 -4
  116. package/src/client/components/workspace/editor/FilePane.tsx +9 -4
  117. package/src/client/components/workspace/editor/Notices.tsx +2 -2
  118. package/src/client/components/workspace/editor/Pane.tsx +2 -2
  119. package/src/client/components/workspace/editor/Toolbar.tsx +16 -10
  120. package/src/client/components/workspace/editor/index.tsx +6 -10
  121. package/src/client/components/workspace/editor/toolbar-clusters.test.ts +4 -3
  122. package/src/client/components/workspace/editor/toolbar-clusters.tsx +23 -14
  123. package/src/client/components/workspace/git-panel/index.tsx +2 -2
  124. package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +17 -6
  125. package/src/client/components/workspace/terminal-panel/focus.test.ts +70 -0
  126. package/src/client/components/workspace/terminal-panel/focus.ts +46 -0
  127. package/src/client/components/workspace/terminal-panel/index.tsx +17 -1
  128. package/src/client/components/workspace/terminal-panel/mount.ts +17 -9
  129. package/src/client/components/workspace/terminal-panel/scroll-hold.test.ts +158 -0
  130. package/src/client/components/workspace/terminal-panel/scroll-hold.ts +136 -0
  131. package/src/client/hooks/chat/composer/use-draft.ts +45 -1
  132. package/src/client/hooks/chat/omp/pending-sessions.waiting.test.ts +11 -10
  133. package/src/client/hooks/chat/omp/pending-waiting.ts +15 -7
  134. package/src/client/hooks/chat/omp/prompt-send.test.ts +11 -0
  135. package/src/client/hooks/chat/omp/prompt-send.ts +3 -0
  136. package/src/client/hooks/chat/omp/session-list.tsx +5 -0
  137. package/src/client/hooks/chat/omp/sidebar-reload.test.ts +85 -0
  138. package/src/client/hooks/chat/omp/sidebar-reload.ts +30 -0
  139. package/src/client/hooks/chat/timeline/actions.ts +4 -4
  140. package/src/client/hooks/chat/timeline/composer-modes.ts +13 -2
  141. package/src/client/hooks/chat/timeline/fork-open.ts +52 -0
  142. package/src/client/hooks/chat/timeline/fork-preview.test.ts +148 -0
  143. package/src/client/hooks/chat/timeline/fork-preview.ts +104 -0
  144. package/src/client/hooks/chat/timeline/fork-send.test.ts +139 -0
  145. package/src/client/hooks/chat/timeline/index.ts +5 -2
  146. package/src/client/hooks/chat/timeline/mode-availability.ts +7 -0
  147. package/src/client/hooks/chat/timeline/modes-contract.ts +6 -0
  148. package/src/client/hooks/chat/timeline/modes-hydrate.ts +93 -0
  149. package/src/client/hooks/chat/timeline/modes.ts +32 -52
  150. package/src/client/hooks/chat/timeline/new-chat-open.ts +7 -6
  151. package/src/client/hooks/chat/timeline/new-chat.ts +10 -1
  152. package/src/client/hooks/chat/timeline/pending-branch.ts +9 -0
  153. package/src/client/hooks/chat/timeline/pending-dispatch.ts +53 -0
  154. package/src/client/hooks/chat/timeline/pending-session-mode.test.ts +136 -0
  155. package/src/client/hooks/chat/timeline/pending-session-mode.ts +69 -0
  156. package/src/client/hooks/chat/timeline/pending-warmup.test.ts +147 -0
  157. package/src/client/hooks/chat/timeline/pending-warmup.ts +62 -0
  158. package/src/client/hooks/chat/timeline/run-identity.test.ts +12 -0
  159. package/src/client/hooks/chat/timeline/run-identity.ts +4 -1
  160. package/src/client/hooks/chat/timeline/send-props.ts +2 -0
  161. package/src/client/hooks/chat/timeline/send-steer.test.ts +1 -0
  162. package/src/client/hooks/chat/timeline/send.test-util.ts +1 -0
  163. package/src/client/hooks/chat/timeline/send.test.ts +1 -0
  164. package/src/client/hooks/chat/timeline/session-harness.ts +4 -0
  165. package/src/client/hooks/chat/timeline/stop-with-queue.ts +1 -1
  166. package/src/client/hooks/chat/timeline/use-fork-session.ts +9 -22
  167. package/src/client/hooks/chat/waiting/cancel.ts +15 -7
  168. package/src/client/hooks/chat/waiting/choice.ts +13 -16
  169. package/src/client/hooks/chat/waiting/composer-wait.ts +70 -0
  170. package/src/client/hooks/chat/waiting/dispatch.ts +50 -29
  171. package/src/client/hooks/chat/waiting/held.ts +38 -13
  172. package/src/client/hooks/chat/waiting/hold.test.ts +22 -0
  173. package/src/client/hooks/chat/waiting/hold.ts +20 -11
  174. package/src/client/hooks/chat/waiting/restore.test.ts +69 -0
  175. package/src/client/hooks/chat/waiting/restore.ts +34 -0
  176. package/src/client/hooks/chat/waiting/store.ts +9 -3
  177. package/src/client/hooks/editor/file-editor-types.ts +21 -12
  178. package/src/client/hooks/editor/save-file.test.ts +1 -1
  179. package/src/client/hooks/editor/save-file.ts +35 -8
  180. package/src/client/hooks/editor/target-key.ts +17 -0
  181. package/src/client/hooks/editor/use-disk-digest.test.ts +82 -0
  182. package/src/client/hooks/editor/use-disk-digest.ts +164 -0
  183. package/src/client/hooks/editor/use-disk-sync.ts +212 -0
  184. package/src/client/hooks/editor/use-file-cache.ts +113 -0
  185. package/src/client/hooks/editor/use-file-editor.test.ts +90 -0
  186. package/src/client/hooks/editor/use-file-editor.ts +90 -52
  187. package/src/client/hooks/editor/use-file-read.ts +24 -10
  188. package/src/client/hooks/editor/use-file-writes.ts +4 -4
  189. package/src/client/hooks/models/harness-catalog.ts +15 -0
  190. package/src/client/hooks/settings/providers/actions.ts +3 -2
  191. package/src/client/hooks/settings/providers/messages.ts +9 -7
  192. package/src/client/hooks/settings/providers/model-actions.ts +2 -1
  193. package/src/client/hooks/ui/editor-error-toast.ts +2 -1
  194. package/src/client/hooks/ui/notifications.ts +17 -8
  195. package/src/client/hooks/workspace/batch-archive.test.ts +2 -2
  196. package/src/client/hooks/workspace/batch-archive.ts +4 -2
  197. package/src/client/hooks/workspace/git-action-outcome.ts +4 -3
  198. package/src/client/hooks/workspace/navbar-session-actions.ts +2 -1
  199. package/src/client/hooks/workspace/panel-registry.ts +1 -1
  200. package/src/client/hooks/workspace/scheduled-tasks.ts +26 -11
  201. package/src/client/hooks/workspace/session-actions.test.ts +2 -1
  202. package/src/client/hooks/workspace/session-actions.ts +2 -1
  203. package/src/client/hooks/workspace/terminal/connection.test.ts +63 -0
  204. package/src/client/hooks/workspace/terminal/connection.ts +47 -0
  205. package/src/client/hooks/workspace/terminal/index.ts +35 -4
  206. package/src/client/hooks/workspace/workspace-folder-actions.ts +2 -1
  207. package/src/client/lib/notifications/os.test.ts +1 -30
  208. package/src/client/lib/notifications/os.ts +0 -15
  209. package/src/client/lib/notifications/platform.test.ts +68 -0
  210. package/src/client/lib/notifications/platform.ts +36 -0
  211. package/src/server/index.ts +7 -0
  212. package/src/server/lib/harness/acp/client.ts +81 -87
  213. package/src/server/lib/harness/acp/prewarm.server.ts +237 -0
  214. package/src/server/lib/harness/acp/prewarm.test.ts +171 -0
  215. package/src/server/lib/harness/acp/prompt.test.ts +70 -1
  216. package/src/server/lib/harness/acp/prompt.ts +32 -1
  217. package/src/server/lib/harness/acp/protocol.ts +23 -0
  218. package/src/server/lib/harness/acp/session-handshake.test.ts +26 -0
  219. package/src/server/lib/harness/acp/session-handshake.ts +22 -20
  220. package/src/server/lib/harness/acp/session-options.ts +16 -0
  221. package/src/server/lib/harness/acp/session-process.ts +43 -0
  222. package/src/server/lib/harness/acp/session.ts +11 -12
  223. package/src/server/lib/harness/acp/stdio.ts +129 -0
  224. package/src/server/lib/harness/acp/verbs.test.ts +97 -0
  225. package/src/server/lib/harness/acp/verbs.ts +16 -6
  226. package/src/server/lib/harness/auto-probe.server.ts +4 -3
  227. package/src/server/lib/harness/capabilities.ts +8 -0
  228. package/src/server/lib/harness/config.server.ts +3 -2
  229. package/src/server/lib/harness/custom.server.ts +209 -0
  230. package/src/server/lib/harness/launch.ts +6 -1
  231. package/src/server/lib/harness/register.server.ts +8 -1
  232. package/src/server/lib/harness/schema.server.ts +21 -0
  233. package/src/server/lib/harness/session-lease.server.test.ts +99 -0
  234. package/src/server/lib/harness/session-lease.server.ts +193 -0
  235. package/src/server/lib/harness/session-store.server.test.ts +8 -8
  236. package/src/server/lib/harness/session-store.server.ts +25 -4
  237. package/src/server/lib/harness/session-title.server.ts +12 -2
  238. package/src/server/lib/harness/spawn.server.ts +123 -20
  239. package/src/server/lib/harness/update-queue.server.ts +3 -3
  240. package/src/server/lib/lifecycle/after-listen.ts +12 -1
  241. package/src/server/lib/lifecycle/paths.ts +19 -1
  242. package/src/server/lib/mcp/registry.server.ts +155 -0
  243. package/src/server/lib/mcp/registry.test.ts +169 -0
  244. package/src/server/lib/mcp/store.server.ts +38 -0
  245. package/src/server/lib/omp/rpc/frame-fold-contract.ts +59 -0
  246. package/src/server/lib/omp/rpc/frame-fold-frames.test.ts +64 -1
  247. package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +2 -1
  248. package/src/server/lib/omp/rpc/frame-fold.test.ts +2 -1
  249. package/src/server/lib/omp/rpc/frame-fold.ts +6 -45
  250. package/src/server/lib/omp/rpc/prewarm-pool.ts +19 -5
  251. package/src/server/lib/omp/rpc/run-model.test.ts +116 -0
  252. package/src/server/lib/omp/rpc/run-model.ts +4 -2
  253. package/src/server/lib/omp/session/sidebar-data.harness.test.ts +6 -3
  254. package/src/server/lib/omp/session/standby.server.ts +13 -2
  255. package/src/server/lib/panels/manifest.test.ts +47 -1
  256. package/src/server/lib/panels/manifest.ts +19 -0
  257. package/src/server/lib/panels/registry.server.ts +19 -2
  258. package/src/server/lib/panels/scan.server.ts +26 -2
  259. package/src/server/lib/panels/settings-schema.server.ts +72 -0
  260. package/src/server/lib/plugins/background.server.ts +21 -3
  261. package/src/server/lib/plugins/background.test.ts +13 -0
  262. package/src/server/lib/plugins/loader.server.ts +35 -51
  263. package/src/server/lib/plugins/mcp.server.ts +100 -0
  264. package/src/server/lib/plugins/mcp.test.ts +75 -0
  265. package/src/server/lib/plugins/schedule-runner.server.ts +153 -0
  266. package/src/server/lib/plugins/schedule-runner.test.ts +186 -0
  267. package/src/server/lib/plugins/schedule-store.server.ts +107 -0
  268. package/src/server/lib/plugins/schema.server.ts +8 -0
  269. package/src/server/lib/plugins/settings.server.ts +56 -19
  270. package/src/server/lib/plugins/shutdown.server.ts +58 -0
  271. package/src/server/lib/plugins/shutdown.test.ts +28 -3
  272. package/src/server/lib/realtime/topics/global.server.ts +5 -1
  273. package/src/server/lib/schedule/rows.server.ts +9 -0
  274. package/src/server/lib/schedule/runtime.server.test.ts +91 -0
  275. package/src/server/lib/schedule/runtime.server.ts +101 -23
  276. package/src/server/lib/schedule/schema.server.ts +15 -0
  277. package/src/server/lib/schedule/store.server.test.ts +34 -0
  278. package/src/server/lib/schedule/store.server.ts +33 -9
  279. package/src/server/lib/sessions/fork.server.test.ts +47 -0
  280. package/src/server/lib/sessions/fork.server.ts +17 -1
  281. package/src/server/lib/sessions/spawn.server.ts +2 -2
  282. package/src/server/lib/usage/report.server.ts +57 -0
  283. package/src/server/lib/waiting/runtime.server.test.ts +48 -0
  284. package/src/server/lib/waiting/runtime.server.ts +22 -0
  285. package/src/server/lib/waiting/schema.server.ts +8 -0
  286. package/src/server/lib/waiting/store.server.test.ts +14 -0
  287. package/src/server/lib/waiting/store.server.ts +6 -2
  288. package/src/server/routes/agent/command-resume.test.ts +9 -4
  289. package/src/server/routes/agent/new-mode.test.ts +40 -0
  290. package/src/server/routes/agent/new.ts +31 -10
  291. package/src/server/routes/agent/prewarm.ts +48 -7
  292. package/src/server/routes/fs/action.ts +9 -1
  293. package/src/server/routes/fs/digest.test.ts +100 -0
  294. package/src/server/routes/fs/digest.ts +106 -0
  295. package/src/server/routes/fs/index.ts +2 -0
  296. package/src/server/routes/fs/read.ts +6 -1
  297. package/src/server/routes/harness/custom.test.ts +131 -0
  298. package/src/server/routes/harness/import-action.ts +2 -2
  299. package/src/server/routes/harness/root.ts +41 -8
  300. package/src/server/routes/harness/update.ts +2 -2
  301. package/src/server/routes/panels/bindings.ts +2 -0
  302. package/src/server/routes/panels/settings.test.ts +165 -0
  303. package/src/server/routes/panels/settings.ts +106 -0
  304. package/src/server/routes/schedule/body.ts +14 -0
  305. package/src/server/routes/schedule/index.ts +28 -4
  306. package/src/server/routes/settings/mcp.ts +9 -26
  307. package/src/server/routes/waiting/index.ts +21 -2
  308. package/src/server/routes/waiting/routes.test.ts +21 -0
  309. package/src/shared/lib/chat/composer/delegation.ts +3 -3
  310. package/src/shared/lib/chat/timeline/fork-anchor.test.ts +97 -0
  311. package/src/shared/lib/chat/timeline/fork-anchor.ts +47 -0
  312. package/src/shared/lib/chat/timeline/fork-preview.test.ts +62 -0
  313. package/src/shared/lib/chat/timeline/fork-preview.ts +36 -0
  314. package/src/shared/lib/fs/content-hash.ts +29 -0
  315. package/src/shared/lib/harness/catalog.ts +48 -6
  316. package/src/shared/lib/harness/fork.ts +60 -0
  317. package/src/shared/lib/harness/mcp-facts.test.ts +30 -0
  318. package/src/shared/lib/harness/mcp-facts.ts +65 -0
  319. package/src/shared/lib/harness/menu.test.ts +16 -1
  320. package/src/shared/lib/harness/menu.ts +2 -2
  321. package/src/shared/lib/harness/rewind.ts +6 -6
  322. package/src/shared/lib/harness/session-modes.ts +31 -0
  323. package/src/shared/lib/harness/transcript.test.ts +29 -0
  324. package/src/shared/lib/harness/transcript.ts +19 -0
  325. package/src/shared/lib/notifications/settings.test.ts +21 -0
  326. package/src/shared/lib/notifications/settings.ts +24 -0
  327. package/src/shared/lib/omp/session/prewarm.test.ts +28 -4
  328. package/src/shared/lib/omp/session/prewarm.ts +25 -6
  329. package/src/shared/lib/omp/session/stream-state.server.test.ts +25 -0
  330. package/src/shared/lib/omp/session/stream-state.server.ts +8 -4
  331. package/src/shared/lib/panels/capabilities.test.ts +1 -1
  332. package/src/shared/lib/panels/capabilities.ts +3 -0
  333. package/src/shared/lib/plugins/settings.ts +22 -0
  334. package/src/shared/lib/schedule/parse.test.ts +48 -0
  335. package/src/shared/lib/schedule/parse.ts +69 -45
  336. package/src/shared/lib/schedule/timezone.ts +128 -0
  337. package/src/shared/lib/settings/defaults.ts +2 -0
  338. package/src/shared/lib/ui/toast-duration.test.ts +25 -1
  339. package/src/shared/lib/ui/toast-duration.ts +22 -4
  340. package/src/shared/lib/workspace/refresh-cadence.test.ts +25 -1
  341. package/src/shared/lib/workspace/relative-time.ts +16 -0
  342. package/src/shared/lib/workspace/session-state/store.ts +4 -0
  343. package/src/shared/types/harness.ts +7 -0
  344. package/src/shared/types/omp/agent.ts +6 -0
  345. package/src/shared/types/panels-registry.ts +3 -3
  346. package/src/shared/types/panels.ts +4 -2
  347. package/src/shared/types/schedule.ts +13 -0
  348. package/src/shared/types/settings/state.ts +12 -1
  349. package/src/shared/types/waiting.ts +9 -0
  350. package/src/test-support/file-editor.test-util.ts +70 -5
  351. package/dist/client/static/js/index-p2yw9ywf.css +0 -1
  352. package/src/client/hooks/editor/use-external-change-notice.ts +0 -71
  353. package/src/client/hooks/editor/use-external-change.test.ts +0 -88
  354. package/src/client/hooks/editor/use-external-change.ts +0 -146
@@ -25,6 +25,7 @@ import { TaskForm } from '@/client/components/layout/session-sidebar/scheduler-m
25
25
  import { TaskList } from '@/client/components/layout/session-sidebar/scheduler-modal/TaskList';
26
26
  import { useScheduleFolders } from '@/client/components/layout/session-sidebar/scheduler-modal/folders';
27
27
  import type { ScheduledTask } from '@/shared/types/schedule';
28
+ import type { ToastTone } from '@/shared/lib/ui/toast-duration';
28
29
 
29
30
  export interface SchedulerModalProps {
30
31
  isOpen: boolean;
@@ -32,7 +33,7 @@ export interface SchedulerModalProps {
32
33
  /** Session the composer is on, offered as "resume this conversation". */
33
34
  activeSessionId?: string | null;
34
35
  /** Surfaces a failure outside the modal (the sidebar's toast stack). */
35
- onToast?: (message: string, type?: 'success' | 'error') => void;
36
+ onToast?: (message: string, type?: ToastTone) => void;
36
37
  }
37
38
 
38
39
  /** The editor's shape: a draft plus the id it edits, or null when creating. */
@@ -164,6 +165,7 @@ export function SchedulerModal({
164
165
  folders={folders}
165
166
  initial={editor}
166
167
  activeSessionId={activeSessionId}
168
+ serverTimeZone={controller.serverTimeZone}
167
169
  busy={busy}
168
170
  onSubmit={submit}
169
171
  onCancel={() => {
@@ -195,6 +197,8 @@ export function SchedulerModal({
195
197
  prompt: task.prompt,
196
198
  kind: task.kind,
197
199
  spec: task.spec,
200
+ harness: task.harness,
201
+ timezone: task.timezone,
198
202
  folderId: task.folderId,
199
203
  sessionId: task.sessionId,
200
204
  model: task.model,
@@ -21,6 +21,7 @@
21
21
 
22
22
  import type { SessionSortOption, WorkspaceFolderData } from '@/shared/types';
23
23
  import type { BatchBinding } from '@/client/components/common/batch-selection/types';
24
+ import type { ToastTone } from '@/shared/lib/ui/toast-duration';
24
25
 
25
26
  export type SessionStatusMap = Record<string, 'stream' | 'finish' | 'abort'>;
26
27
 
@@ -67,7 +68,7 @@ export interface SessionSidebarVariantProps {
67
68
  /** Start a chat in a worktree made from this folder. */
68
69
  onNewWorktreeSession?: (folderId: number, worktreePath: string) => void;
69
70
  /** Reports a refused folder action (the reveal endpoint's own reason). */
70
- onToast: (message: string, type?: 'success' | 'error') => void;
71
+ onToast: (message: string, type?: ToastTone) => void;
71
72
  onCancelWait?: (waitId: string) => void;
72
73
 
73
74
  /** The active batch mode, or undefined when the list is not selecting. */
@@ -11,6 +11,7 @@ import { useWaitingDispatch } from '@/client/hooks/chat/waiting/dispatch';
11
11
  import { useUpdates } from '@/client/hooks/ui/updates';
12
12
  import { useSidebarStyle } from '@/client/hooks/workspace/sidebar-style';
13
13
  import { UPDATE_REQUEST_EVENT } from '@/shared/lib/updates/popup-state';
14
+ import { updateOutcomeTone } from '@/shared/lib/ui/toast-duration';
14
15
  import { useScheduledTaskCount } from '@/client/hooks/workspace/scheduled-tasks';
15
16
  import { phoneLeftStripVisible } from '@/shared/lib/workspace/mobile-dock';
16
17
  import { MobileDockBody, MobileDockStrip } from '@/client/components/mobile/mobile-session-sidebar/Dock';
@@ -123,7 +124,7 @@ export function MobileSessionSidebar({
123
124
  setAboutOpen(true);
124
125
  void updates.apply('kabmo').then((result) => {
125
126
  if (!result) return;
126
- pushToast(result.message, result.success && !result.manual ? 'success' : 'error');
127
+ pushToast(result.message, updateOutcomeTone(result));
127
128
  });
128
129
  });
129
130
 
@@ -0,0 +1,156 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The phone editor's content area: which surface draws the open file.
8
+ *
9
+ * The dispatch, in order, because every branch before the code surface exists
10
+ * for a reason the editor would get WRONG rather than merely worse:
11
+ *
12
+ * - a byte viewer (image, PDF, DOCX, workbook) draws its own bytes and has no
13
+ * text buffer, so the code surface would paint mojibake;
14
+ * - a rendered text view (markdown, CSV grid, SVG) is the same buffer drawn as
15
+ * what the file IS, and it is gated on the preview toggle;
16
+ * - the loading / refusal states and the markdown preview share one scroller,
17
+ * which is also where the outline's heading jump looks;
18
+ * - the code surface owns its own (CodeMirror) scroller and must NOT be wrapped
19
+ * in one: an outer `overflow-auto` resolves the editor's `height: 100%`
20
+ * against an auto-height box, so the panel grows to the document's height and
21
+ * has nothing to scroll.
22
+ *
23
+ * Split out of `FullEditor.tsx` for the repository's per-file ceiling; the
24
+ * order above is the whole contract, so it lives in one place.
25
+ */
26
+
27
+ import type { RefObject } from 'preact';
28
+ import { CodeSurface, type CodeSurfaceHandle } from '@/client/components/common/code-surface';
29
+ import { ImageViewer } from '@/client/components/common/image-viewer';
30
+ import { PreviewScroller } from '@/client/components/mobile/mobile-right-sidebar/PreviewScroller';
31
+ import type { MobileEditorFile } from '@/client/components/mobile/open-file-payload';
32
+ import { ViewerSurface, hasViewerSurface } from '@/client/components/workspace/editor/viewers/dispatch';
33
+ import type { UseFileEditorResult } from '@/client/hooks/editor/file-editor-types';
34
+ import type { ScrollRestoreBinding } from '@/client/hooks/editor/use-scroll-restore';
35
+ import type { EditorTypingOptions } from '@/client/components/common/code-surface/typing';
36
+ import type { EditorThemeState } from '@/client/hooks/editor/theme';
37
+ import { EDITOR_LINE_HEIGHT } from '@/shared/lib/code/editor/typography';
38
+ import type { ViewerKind } from '@/shared/lib/fs/document-kind';
39
+
40
+ interface MobileEditorSurfaceProps {
41
+ file: MobileEditorFile;
42
+ editor: UseFileEditorResult;
43
+ viewerKind: ViewerKind;
44
+ /** A byte-drawing viewer: its surface fetches the bytes itself. */
45
+ byteViewer: boolean;
46
+ isPreview: boolean;
47
+ /** The file is markdown, so the preview branch is the document view. */
48
+ isMd: boolean;
49
+ content: string;
50
+ language: string;
51
+ wordWrap: boolean;
52
+ fileKey: string;
53
+ revealMarks: readonly { start: number; end: number }[] | undefined;
54
+ currentMark: number;
55
+ surfaceRef: RefObject<CodeSurfaceHandle>;
56
+ setCodeScroller: (element: HTMLElement | null) => void;
57
+ previewRef: (element: HTMLElement | null) => void;
58
+ scroll: ScrollRestoreBinding;
59
+ fontSize: number;
60
+ reviewActive: boolean;
61
+ onExitReview: () => void;
62
+ editorTheme: EditorThemeState;
63
+ editorFontFamily: string;
64
+ indentUnitText: string;
65
+ typing: EditorTypingOptions;
66
+ }
67
+
68
+ export function MobileEditorSurface({
69
+ file,
70
+ editor,
71
+ viewerKind,
72
+ byteViewer,
73
+ isPreview,
74
+ isMd,
75
+ content,
76
+ language,
77
+ wordWrap,
78
+ fileKey,
79
+ revealMarks,
80
+ currentMark,
81
+ surfaceRef,
82
+ setCodeScroller,
83
+ previewRef,
84
+ scroll,
85
+ fontSize,
86
+ reviewActive,
87
+ onExitReview,
88
+ editorTheme,
89
+ editorFontFamily,
90
+ indentUnitText,
91
+ typing,
92
+ }: MobileEditorSurfaceProps) {
93
+ if (editor.isImage && editor.imageUrl) {
94
+ return <ImageViewer src={editor.imageUrl} name={file.name} className="flex-1 min-h-0" />;
95
+ }
96
+ if (editor.isImage || (hasViewerSurface(viewerKind) && (byteViewer || isPreview))) {
97
+ return (
98
+ <ViewerSurface
99
+ kind={viewerKind}
100
+ path={file.path ?? file.name}
101
+ name={file.name}
102
+ source={editor.byteSource}
103
+ content={editor.content}
104
+ revision={editor.revision}
105
+ />
106
+ );
107
+ }
108
+ if (editor.isLoading || editor.unsupported || editor.loadError || (isMd && isPreview)) {
109
+ return (
110
+ <PreviewScroller
111
+ fileName={file.name}
112
+ content={content}
113
+ path={file.path ?? file.name}
114
+ root={file.root}
115
+ repo={file.repo}
116
+ fontSize={fontSize}
117
+ scrollRef={previewRef}
118
+ onScroll={scroll.onScroll}
119
+ isLoading={editor.isLoading}
120
+ unsupported={editor.unsupported}
121
+ loadError={editor.loadError}
122
+ reviewActive={reviewActive}
123
+ onExitReview={onExitReview}
124
+ />
125
+ );
126
+ }
127
+ return (
128
+ <CodeSurface
129
+ ref={surfaceRef}
130
+ value={content}
131
+ onValueChange={editor.onChange}
132
+ language={language}
133
+ wordWrap={wordWrap}
134
+ documentKey={fileKey}
135
+ marks={revealMarks}
136
+ currentMark={currentMark}
137
+ onScroller={setCodeScroller}
138
+ scrollTestId="editor-scroller"
139
+ // No `bg-paper`: an explicit editor theme paints its own surface, and the
140
+ // panel's colour under it would be a border of the wrong shade.
141
+ // `select-text` is the desktop pane's rule, and it matters more here: the
142
+ // sheet's own root is `select-none` (it is a header-and-status layout), and
143
+ // the editor is a `contenteditable` whose selection and caret are the
144
+ // BROWSER's business — an inherited `user-select: none` is the one thing
145
+ // that can take that away on a phone.
146
+ className="flex-1 min-h-0 text-ink select-text"
147
+ themeVars={editorTheme.vars}
148
+ themes={editorTheme.themes}
149
+ indentUnitText={indentUnitText}
150
+ typing={typing}
151
+ padding={12}
152
+ placeholder="This file is empty"
153
+ style={{ fontFamily: editorFontFamily, fontSize: `${fontSize}px`, lineHeight: EDITOR_LINE_HEIGHT }}
154
+ />
155
+ );
156
+ }
@@ -1,10 +1,10 @@
1
1
  import { useCallback, useRef, useState } from 'preact/hooks';
2
- import { CodeSurface, type CodeSurfaceHandle } from '@/client/components/common/code-surface';
2
+ import type { CodeSurfaceHandle } from '@/client/components/common/code-surface';
3
3
  import { countConflicts } from '@/client/components/common/code-surface/conflict-markers';
4
- import { ImageViewer } from '@/client/components/common/image-viewer';
5
4
  import { EditorHeader } from '@/client/components/mobile/mobile-right-sidebar/Header';
6
- import { PreviewScroller } from '@/client/components/mobile/mobile-right-sidebar/PreviewScroller';
7
5
  import { SaveDeletedFileModal } from '@/client/components/workspace/editor/SaveDeletedFileModal';
6
+ import { ExternalChangeStrip } from '@/client/components/workspace/editor/ExternalChangeStrip';
7
+ import { MobileEditorSurface } from '@/client/components/mobile/mobile-right-sidebar/EditorSurface';
8
8
  import { MissingFileBanner } from '@/client/components/mobile/mobile-right-sidebar/MissingFileBanner';
9
9
  import { EditorStatusBar } from '@/client/components/mobile/mobile-right-sidebar/StatusBar';
10
10
  import { EditorDropOverlay } from '@/client/components/workspace/editor/EditorDropOverlay';
@@ -20,7 +20,6 @@ import { MobileOutlineButton } from '@/client/components/mobile/mobile-right-sid
20
20
  import { useOutlineView } from '@/client/hooks/editor/use-outline-view';
21
21
  import {
22
22
  EDITOR_DEFAULT_FONT_SIZE,
23
- EDITOR_LINE_HEIGHT,
24
23
  EDITOR_MAX_FONT_SIZE,
25
24
  EDITOR_MIN_FONT_SIZE,
26
25
  } from '@/shared/lib/code/editor/typography';
@@ -30,7 +29,6 @@ import { indentUnitFor, useEditorIndent } from '@/client/hooks/editor/indent-set
30
29
  import { useEditorTyping } from '@/client/hooks/editor/typing-settings';
31
30
  import { useFileReviewMode } from '@/client/hooks/editor/use-file-review-mode';
32
31
  import { MOBILE_SCROLL_POSITIONS_KEY } from '@/shared/lib/workspace/scroll-positions';
33
- import { ViewerSurface, hasViewerSurface } from '@/client/components/workspace/editor/viewers/dispatch';
34
32
  import { BINARY_VIEWERS, RENDERED_VIEWERS, VIEWER_LABELS, viewerKindFor } from '@/shared/lib/fs/document-kind';
35
33
  import type { MobileFullEditorProps } from '@/client/components/mobile/mobile-right-sidebar/editor-props';
36
34
 
@@ -211,6 +209,17 @@ export function MobileFullEditor({ file, missing = false, onClose, onFileSaved,
211
209
 
212
210
  {missing && <MissingFileBanner />}
213
211
 
212
+ {/* The same strip the desktop pane draws, from the same verdict: the disk
213
+ bytes differ from a buffer that has edits. A clean buffer never reaches
214
+ here — the watcher re-reads it, because there is nothing to lose. */}
215
+ {editor.diskChange && (
216
+ <ExternalChangeStrip
217
+ fileName={file.name}
218
+ onReload={editor.reloadFromDisk}
219
+ onKeepMine={editor.keepMineAgainstDisk}
220
+ />
221
+ )}
222
+
214
223
  {/* Find/replace, as a ROW under the header rather than a floating card: the
215
224
  desktop bar is 330px wide, and on a 390px screen a floating card would cover
216
225
  the very lines it is searching. `FindWidget` is absolutely positioned in its
@@ -221,87 +230,33 @@ export function MobileFullEditor({ file, missing = false, onClose, onFileSaved,
221
230
  </div>
222
231
  )}
223
232
 
224
- {/* Editor Content Area - Desktop styled: bg-paper text-ink. An image owns
225
- its own pan/zoom, so it replaces the scrolling text container rather
226
- than living inside it; the same is true of every other byte viewer and
227
- of the rendered text views (a CSV grid, an SVG picture). */}
228
- {editor.isImage && editor.imageUrl ? (
229
- <ImageViewer src={editor.imageUrl} name={file.name} className="flex-1 min-h-0" />
230
- ) : editor.isImage ? (
231
- <ViewerSurface
232
- kind="image"
233
- path={file.path ?? file.name}
234
- name={file.name}
235
- source={editor.byteSource}
236
- content={editor.content}
237
- revision={editor.revision}
238
- />
239
- ) : hasViewerSurface(viewerKind) && (byteViewer || isPreview) ? (
240
- <ViewerSurface
241
- kind={viewerKind}
242
- path={file.path ?? file.name}
243
- name={file.name}
244
- source={editor.byteSource}
245
- content={editor.content}
246
- revision={editor.revision}
247
- />
248
- ) : editor.isLoading || editor.unsupported || editor.loadError || (isMd && isPreview) ? (
249
- // The states that draw their own scrolling content — and the markdown
250
- // preview, which is a document, not an editor — share one scroller. The
251
- // outline's table of contents finds its headings inside it, which is why
252
- // the ref is the same one the scroll restore uses.
253
- <PreviewScroller
254
- fileName={file.name}
255
- content={content}
256
- path={file.path ?? file.name}
257
- root={file.root}
258
- repo={file.repo}
259
- fontSize={fontSize}
260
- scrollRef={previewRef}
261
- onScroll={scroll.onScroll}
262
- isLoading={editor.isLoading}
263
- unsupported={editor.unsupported}
264
- loadError={editor.loadError}
265
- reviewActive={hasReview && review.active}
266
- onExitReview={review.toggle}
267
- />
268
- ) : (
269
- /* The code surface owns its own scroller (CodeMirror's), so it is NOT
270
- wrapped in one: an outer `overflow-auto` resolves the editor's
271
- `height: 100%` against an auto-height box, so the editor grew to the
272
- document's full height and the panel had nothing to scroll. */
273
- <CodeSurface
274
- ref={surfaceRef}
275
- value={content}
276
- onValueChange={editor.onChange}
277
- language={lang}
278
- wordWrap={wordWrap}
279
- documentKey={fileKey}
280
- marks={revealMarks}
281
- currentMark={currentMark}
282
- onScroller={setCodeScroller}
283
- scrollTestId="editor-scroller"
284
- // No `bg-paper`: an explicit editor theme paints its own surface, and
285
- // the panel's colour under it would be a border of the wrong shade.
286
- // `select-text` is the desktop pane's rule, and it matters more here:
287
- // the sheet's own root is `select-none` (it is a header-and-status
288
- // layout), and the editor is now a `contenteditable` whose selection
289
- // and caret are the BROWSER's business — an inherited `user-select:
290
- // none` is the one thing that can take that away on a phone.
291
- className="flex-1 min-h-0 text-ink select-text"
292
- themeVars={editorTheme.vars}
293
- themes={editorTheme.themes}
294
- indentUnitText={indentUnitFor(editorIndent)}
295
- typing={editorTyping}
296
- padding={12}
297
- placeholder="This file is empty"
298
- style={{
299
- fontFamily: editorFontFamily,
300
- fontSize: `${fontSize}px`,
301
- lineHeight: EDITOR_LINE_HEIGHT,
302
- }}
303
- />
304
- )}
233
+ {/* Which surface draws this file — see `EditorSurface.tsx` for the dispatch
234
+ and why the code surface is never wrapped in a scroller. */}
235
+ <MobileEditorSurface
236
+ file={file}
237
+ editor={editor}
238
+ viewerKind={viewerKind}
239
+ byteViewer={byteViewer}
240
+ isPreview={isPreview}
241
+ isMd={isMd}
242
+ content={content}
243
+ language={lang}
244
+ wordWrap={wordWrap}
245
+ fileKey={fileKey}
246
+ revealMarks={revealMarks}
247
+ currentMark={currentMark}
248
+ surfaceRef={surfaceRef}
249
+ setCodeScroller={setCodeScroller}
250
+ previewRef={previewRef}
251
+ scroll={scroll}
252
+ fontSize={fontSize}
253
+ reviewActive={hasReview && review.active}
254
+ onExitReview={review.toggle}
255
+ editorTheme={editorTheme}
256
+ editorFontFamily={editorFontFamily}
257
+ indentUnitText={indentUnitFor(editorIndent)}
258
+ typing={editorTyping}
259
+ />
305
260
 
306
261
  {/* The outline is a floating control rather than a panel section: on a
307
262
  phone the drawer and this editor are separate screens, so a section
@@ -20,6 +20,7 @@ import { MobileSessionListSkeleton } from '@/client/components/mobile/mobile-ses
20
20
  import { SessionListNotice } from '@/client/components/layout/session-sidebar/SessionListNotice';
21
21
  import type { BatchBinding } from '@/client/components/common/batch-selection/types';
22
22
  import type { SessionSortOption, WorkspaceFolderData } from '@/shared/types';
23
+ import type { ToastTone } from '@/shared/lib/ui/toast-duration';
23
24
 
24
25
  export interface ClassicDrawerProps {
25
26
  folders: WorkspaceFolderData[];
@@ -54,7 +55,7 @@ export interface ClassicDrawerProps {
54
55
  onNewSessionForFolder: (folderId: number) => void;
55
56
  onNewWorktreeSession?: (folderId: number, worktreePath: string) => void;
56
57
  onToggleFolder: (folderId: number) => void;
57
- onToast: (message: string, type?: 'success' | 'error') => void;
58
+ onToast: (message: string, type?: ToastTone) => void;
58
59
  onStartSessionSelection: (folderId: number) => void;
59
60
  onCancelWait?: (waitId: string) => void;
60
61
  }
@@ -4,6 +4,7 @@ import { useSearchParams } from '@/client/lib/router/search-params';
4
4
  import { MobileSessionRow, MOBILE_BRANCH_STYLE } from '@/client/components/mobile/mobile-session-sidebar/SessionRow';
5
5
  import { SessionBranch, branchControlFor } from '@/client/components/common/session-branch';
6
6
  import type { BranchControl } from '@/client/components/common/session-branch';
7
+ import type { ToastTone } from '@/shared/lib/ui/toast-duration';
7
8
  import { buildSessionTree } from '@/client/lib/session-tree';
8
9
  import { useWorktreeDialog } from '@/client/components/mobile/mobile-session-sidebar/WorktreeDialog';
9
10
  import { useShowMore } from '@/client/hooks/ui/show-more';
@@ -12,7 +13,7 @@ import { useWorkspaceFolderActions } from '@/client/hooks/workspace/workspace-fo
12
13
  import { useSessionDelete } from '@/client/hooks/workspace/session-delete';
13
14
  import { SessionDeleteModal } from '@/client/components/common/session-delete-modal';
14
15
  import { getProjectIcon } from '@/shared/lib/workspace/project-icon';
15
- import { relativeTimeAgo } from '@/shared/lib/workspace/relative-time';
16
+ import { formatFullDate, relativeTimeAgo } from '@/shared/lib/workspace/relative-time';
16
17
  import { isPendingSessionId } from '@/shared/lib/omp/session/default-title';
17
18
  import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
18
19
  import type { SessionItemData, WorkspaceFolderData } from '@/shared/types';
@@ -33,7 +34,7 @@ interface MobileSessionCategoryProps {
33
34
  onToggleExpand: () => void;
34
35
  showArchived?: boolean;
35
36
  sessionStatus?: Record<string, 'stream' | 'finish' | 'abort'>;
36
- onToast?: (message: string, type?: 'success' | 'error') => void;
37
+ onToast?: (message: string, type?: ToastTone) => void;
37
38
  /** Present only while a batch selection is active; absent is the normal list. */
38
39
  batch?: BatchBinding;
39
40
  /** Start a session selection scoped to this workspace, from its `⋯` menu. */
@@ -136,6 +137,7 @@ export function MobileSessionCategory({
136
137
  status={sessionStatus[sessionKey]}
137
138
  awaitingInput={Boolean(session.awaitingInput)}
138
139
  timeAgo={relativeTimeAgo(session.updated_at ?? session.created_at)}
140
+ timeTitle={formatFullDate(session.updated_at ?? session.created_at)}
139
141
  expandable={control.expandable} isChild={control.isChild}
140
142
  isExpanded={control.isExpanded}
141
143
  onToggleExpand={control.onToggleExpand}
@@ -1,6 +1,7 @@
1
1
  import { MobileSessionCategory } from '@/client/components/mobile/mobile-session-sidebar/Item';
2
2
  import type { BatchBinding } from '@/client/components/common/batch-selection/types';
3
3
  import type { WorkspaceFolderData } from '@/shared/types';
4
+ import type { ToastTone } from '@/shared/lib/ui/toast-duration';
4
5
 
5
6
  interface MobileSessionListProps {
6
7
  folders: WorkspaceFolderData[];
@@ -14,7 +15,7 @@ interface MobileSessionListProps {
14
15
  onNewWorktreeSession?: (folderId: number, worktreePath: string) => void;
15
16
  onToggleFolder: (folderId: number) => void;
16
17
  /** Surfaces a refused folder action (the reveal endpoint's own reason). */
17
- onToast?: (message: string, type?: 'success' | 'error') => void;
18
+ onToast?: (message: string, type?: ToastTone) => void;
18
19
  /** Present only while a batch selection is active. */
19
20
  batch?: BatchBinding;
20
21
  onStartSessionSelection?: (folderId: number) => void;
@@ -94,6 +94,12 @@ describe('mobile session row status slot', () => {
94
94
  const el = await mount({ isChild: true });
95
95
  expect(el.querySelector('[data-testid="child-indicator"] svg')).not.toBeNull();
96
96
  });
97
+
98
+ test('the age carries the full timestamp as its hover tooltip', async () => {
99
+ const el = await mount({ timeAgo: '3w', timeTitle: 'Wed, 12 Nov 2026, 02:30 PM' });
100
+ const age = el.querySelector('[title="Wed, 12 Nov 2026, 02:30 PM"]');
101
+ expect(age?.textContent).toBe('3w');
102
+ });
97
103
  });
98
104
 
99
105
  /**
@@ -29,6 +29,8 @@ export interface MobileSessionRowProps {
29
29
  awaitingInput?: boolean;
30
30
  /** Relative age of the session, or null when no usable timestamp exists. */
31
31
  timeAgo: string | null;
32
+ /** Full timestamp shown as the age's hover tooltip. */
33
+ timeTitle?: string | null;
32
34
  /** The session has a branch (child sessions and/or a subagent roster). */
33
35
  expandable?: boolean;
34
36
  isExpanded?: boolean;
@@ -66,6 +68,7 @@ export function MobileSessionRow({
66
68
  status,
67
69
  awaitingInput = false,
68
70
  timeAgo,
71
+ timeTitle,
69
72
  expandable = false,
70
73
  isExpanded = false,
71
74
  onToggleExpand,
@@ -221,7 +224,12 @@ export function MobileSessionRow({
221
224
  </span>
222
225
  </div>
223
226
 
224
- <span className="text-[11px] text-ink/45 font-mono flex-shrink-0 ml-2">{timeAgo ?? ''}</span>
227
+ <span
228
+ className="text-[11px] text-ink/45 font-mono flex-shrink-0 ml-2"
229
+ title={timeTitle ?? undefined}
230
+ >
231
+ {timeAgo ?? ''}
232
+ </span>
225
233
  </button>
226
234
 
227
235
  {/* One trigger for rename / archive / delete, always visible: a touch
@@ -11,7 +11,7 @@ import { applySettingsSideEffects } from '@/client/components/settings/apply-sid
11
11
  import { useKabmoEvent } from '@/client/hooks/ui/window-event';
12
12
  import { useToasts } from '@/client/hooks/ui/toasts';
13
13
  import { useDialogBehaviour } from '@/client/hooks/ui/dialog-behaviour';
14
- import { SETTINGS_CATEGORIES, SettingsSidebar } from '@/client/components/settings/Sidebar';
14
+ import { SettingsSidebar, settingsCategoriesFor } from '@/client/components/settings/Sidebar';
15
15
  import { harnessIdFromCategory } from '@/shared/lib/harness/menu';
16
16
  import { useHarnesses } from '@/client/hooks/models/use-harnesses';
17
17
  import { AppearanceSettings } from '@/client/components/settings/categories/AppearanceSettings';
@@ -122,7 +122,7 @@ export function SettingsModal({
122
122
  writeKabmoSettings(diffSettings(prev, next, updater));
123
123
  return next;
124
124
  });
125
- showToast('Setting was saved');
125
+ showToast('Setting was saved', 'success');
126
126
  };
127
127
 
128
128
  const handleReloadOmp = async () => {
@@ -145,7 +145,10 @@ export function SettingsModal({
145
145
 
146
146
  if (!isOpen) return null;
147
147
 
148
- const currentCategoryDef = SETTINGS_CATEGORIES.find(c => c.id === activeCategory) || SETTINGS_CATEGORIES[0];
148
+ // The roster's own list: a user-added harness has a page but no entry in the
149
+ // build's static table, so the header would otherwise fall back to Appearance.
150
+ const categories = settingsCategoriesFor(harnesses.map((entry) => entry.id));
151
+ const currentCategoryDef = categories.find(c => c.id === activeCategory) || categories[0];
149
152
 
150
153
  const renderCategoryContent = () => {
151
154
  switch (activeCategory) {
@@ -234,6 +237,7 @@ export function SettingsModal({
234
237
  onRestartKabmo={handleRestartKabmo}
235
238
  isRestarting={isRestarting}
236
239
  disabledHarnesses={disabledHarnesses}
240
+ categories={categories}
237
241
  className="w-full"
238
242
  />
239
243
  </div>
@@ -23,10 +23,10 @@ export const SETTINGS_CATEGORIES: CategoryDef[] = [
23
23
  // KABMO
24
24
  { id: 'appearance', label: 'Appearance', icon: Palette, section: 'KABMO', description: 'Custom themes, typography scale, and layout density.' },
25
25
  { id: 'chats', label: 'Chats', icon: MessageSquare, section: 'KABMO', description: 'Chat width, composer style, tool call rendering, session titles, goal mode, and keybindings.' },
26
- { id: 'notifications', label: 'Notifications', icon: Bell, section: 'KABMO', description: 'Completion sound, plus system notifications for finished, waiting-for-you and failed runs.' },
26
+ { id: 'notifications', label: 'Notifications', icon: Bell, section: 'KABMO', description: 'Completion sound, separate Desktop and Mobile delivery switches, and the finished, waiting-for-you and failed run triggers.' },
27
27
  { id: 'usage', label: 'Usage', icon: BarChart3, section: 'KABMO', description: 'Build minutes quota, storage, and general usage.' },
28
28
  { id: 'token-usage', label: 'Token Usage', icon: Coins, section: 'KABMO', description: 'Token telemetry, cache, and cost breakdown.' },
29
- { id: 'panel-plugins', label: 'Panel Plugins', icon: Puzzle, section: 'KABMO', description: 'Panels a plugin adds to Kabmo: right-panel views, navbar readouts and editor tabs.' },
29
+ { id: 'panel-plugins', label: 'Plugins Kabmo', icon: Puzzle, section: 'KABMO', description: 'Plugins installed into Kabmo: panels, background services, and the MCP servers they register.' },
30
30
  // WORKSPACE
31
31
  { id: 'projects', label: 'Projects', icon: FolderGit, section: 'WORKSPACE', description: 'Workspace directories, roots, and ignored paths.' },
32
32
  // OMP
@@ -55,6 +55,30 @@ export const SETTINGS_CATEGORIES: CategoryDef[] = [
55
55
  { id: 'skills-catalog', label: 'Skills Catalog', icon: BookOpen, section: 'LIBRARY', description: 'Browse and install new skills.' },
56
56
  ];
57
57
 
58
+ /**
59
+ * The category list for a roster.
60
+ *
61
+ * `SETTINGS_CATEGORIES` is the build's own list; a user-added harness is not in
62
+ * it, so the HARNESSES section is rebuilt from the ids the catalog answered.
63
+ * The rest of the list keeps its order, which is why the harness block is
64
+ * spliced back in front of LIBRARY rather than appended.
65
+ */
66
+ export function settingsCategoriesFor(harnessIds?: readonly string[]): CategoryDef[] {
67
+ // Before the catalog answers, the build's own list is the honest one: an
68
+ // empty roster would hide every built-in harness page until the fetch lands.
69
+ const harnessEntries = harnessMenuEntries(harnessIds && harnessIds.length > 0 ? harnessIds : undefined).map((entry) => ({
70
+ id: entry.id,
71
+ label: entry.label,
72
+ icon: Waypoints,
73
+ section: 'HARNESSES' as const,
74
+ ...(entry.harness ? { harness: entry.harness } : {}),
75
+ description: entry.description,
76
+ }));
77
+ const rest = SETTINGS_CATEGORIES.filter((category) => category.section !== 'HARNESSES');
78
+ const library = rest.findIndex((category) => category.section === 'LIBRARY');
79
+ return [...rest.slice(0, library), ...harnessEntries, ...rest.slice(library)];
80
+ }
81
+
58
82
  interface SettingsSidebarProps {
59
83
  activeCategory: SettingsCategoryId;
60
84
  onSelectCategory: (id: SettingsCategoryId) => void;
@@ -66,6 +90,8 @@ interface SettingsSidebarProps {
66
90
  isRestarting: boolean;
67
91
  /** Harness ids the user switched OFF: their rows leave the drawer. */
68
92
  disabledHarnesses?: string[];
93
+ /** The roster's categories, when the caller has a live harness list. */
94
+ categories?: CategoryDef[];
69
95
  className?: string;
70
96
  }
71
97
 
@@ -79,6 +105,7 @@ export function SettingsSidebar({
79
105
  onRestartKabmo,
80
106
  isRestarting,
81
107
  disabledHarnesses = [],
108
+ categories = SETTINGS_CATEGORIES,
82
109
  className = ''
83
110
  }: SettingsSidebarProps) {
84
111
  // A switched-off agent has no row here. The catalog list above stays complete
@@ -86,7 +113,7 @@ export function SettingsSidebar({
86
113
  // every entry in it with the switch that decides this. The ids arrive as a
87
114
  // PROP rather than from `useHarnesses()` so the drawer stays presentational:
88
115
  // it is drawn in table tests that must not fire a catalog read.
89
- const filteredCategories = SETTINGS_CATEGORIES.filter(cat => {
116
+ const filteredCategories = categories.filter(cat => {
90
117
  if (cat.harness && disabledHarnesses.includes(cat.harness)) return false;
91
118
  if (!searchQuery.trim()) return true;
92
119
  const q = searchQuery.toLowerCase();
@@ -29,6 +29,7 @@ import { RefreshCw } from 'lucide-preact';
29
29
  import { useHarnesses } from '@/client/hooks/models/use-harnesses';
30
30
  import { HarnessCard } from '@/client/components/settings/categories/harness-settings/HarnessCard';
31
31
  import { HarnessToggleList } from '@/client/components/settings/categories/harness-settings/ToggleList';
32
+ import { CustomHarnessForm } from '@/client/components/settings/categories/harness-settings/CustomHarnessForm';
32
33
  import { SettingsNotice, SettingsSearchField } from '@/client/components/settings/categories/harness-settings/parts';
33
34
  import { harnessCategoryId } from '@/shared/lib/harness/menu';
34
35
 
@@ -194,13 +195,16 @@ export function HarnessSettings({ only }: HarnessSettingsProps = {}) {
194
195
  No harness matches “{query}”.
195
196
  </div>
196
197
  ) : (
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
- />
198
+ <>
199
+ <HarnessToggleList
200
+ harnesses={filtered}
201
+ busy={busy}
202
+ onSetEnabled={(id, enabled) => void toggle(id, enabled)}
203
+ onOpen={openHarness}
204
+ onProbe={(id) => void check(id)}
205
+ />
206
+ <CustomHarnessForm harnesses={harnesses} onChanged={reload} />
207
+ </>
204
208
  )}
205
209
  </div>
206
210
  );