@kabmo-labs/kabmo 0.30.1 → 0.31.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 (107) hide show
  1. package/README.md +79 -21
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +481 -462
  4. package/dist/client/static/js/{index-bwhhehnh.js → index-r3bhgvkt.js} +772 -773
  5. package/marketplace/plugins/stats/package.json +2 -2
  6. package/marketplace/plugins/stats/src/format.test.ts +7 -1
  7. package/package.json +2 -2
  8. package/src/client/components/common/context-usage-button/McpSection.tsx +133 -0
  9. package/src/client/components/common/context-usage-button/Ring.tsx +12 -6
  10. package/src/client/components/common/context-usage-button/index.test.tsx +24 -13
  11. package/src/client/components/common/context-usage-button/index.tsx +32 -34
  12. package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
  13. package/src/client/components/common/session-row/session-row.test.tsx +13 -0
  14. package/src/client/components/layout/desktop-layout/index.tsx +5 -1
  15. package/src/client/components/mobile/RightSidebar.tsx +2 -1
  16. package/src/client/components/settings/categories/McpSettings.tsx +10 -3
  17. package/src/client/components/settings/categories/mcp-settings/AdvancedSection.tsx +244 -0
  18. package/src/client/components/settings/categories/mcp-settings/ConnectionTest.tsx +3 -3
  19. package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +55 -97
  20. package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +12 -64
  21. package/src/client/components/settings/categories/mcp-settings/{EnvVarsSection.tsx → KeyValueSection.tsx} +42 -24
  22. package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +1 -1
  23. package/src/client/components/settings/categories/mcp-settings/TransportSection.tsx +101 -0
  24. package/src/client/components/workspace/browser-panel/EngineNotice.test.tsx +109 -0
  25. package/src/client/components/workspace/browser-panel/EngineNotice.tsx +112 -0
  26. package/src/client/components/workspace/browser-panel/index.tsx +45 -12
  27. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +63 -0
  28. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +18 -6
  29. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +3 -1
  30. package/src/client/components/workspace/chat-timeline/chat-input/access-levels.ts +39 -1
  31. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.test.tsx +13 -7
  32. package/src/client/components/workspace/editor/plugin-rail.test.tsx +6 -1
  33. package/src/client/components/workspace/terminal-panel/scroll-hold.test.ts +20 -5
  34. package/src/client/data/settings/mcp.ts +4 -2
  35. package/src/client/data/settings/omp-schema.json +22 -2
  36. package/src/client/hooks/browser/use-browser-engine.ts +99 -0
  37. package/src/client/hooks/chat/context/mcp.ts +159 -0
  38. package/src/client/hooks/chat/timeline/access-mode.ts +45 -15
  39. package/src/client/hooks/chat/timeline/index.ts +7 -3
  40. package/src/client/hooks/chat/timeline/timeline-mode-state.test.ts +33 -4
  41. package/src/client/hooks/ui/ui-listeners.test.ts +13 -18
  42. package/src/server/lib/browser/engine.test.ts +118 -0
  43. package/src/server/lib/browser/engine.ts +102 -0
  44. package/src/server/lib/db/schema.ts +4 -0
  45. package/src/server/lib/fs/toolchain-path.test.ts +87 -0
  46. package/src/server/lib/fs/toolchain-path.ts +49 -0
  47. package/src/server/lib/harness/acp/protocol.ts +9 -1
  48. package/src/server/lib/harness/auto-probe.server.ts +3 -2
  49. package/src/server/lib/harness/launch-table.ts +3 -2
  50. package/src/server/lib/harness/spawn.server.ts +5 -1
  51. package/src/server/lib/harness/update-queue.server.ts +2 -1
  52. package/src/server/lib/harness/update-state.server.ts +6 -2
  53. package/src/server/lib/mcp/probe.server.ts +71 -0
  54. package/src/server/lib/mcp/registry.server.ts +195 -46
  55. package/src/server/lib/mcp/registry.test.ts +76 -4
  56. package/src/server/lib/mcp/schema.server.ts +35 -0
  57. package/src/server/lib/mcp/session-mcp.test.ts +164 -0
  58. package/src/server/lib/mcp/session-overlay.server.ts +152 -0
  59. package/src/server/lib/mcp/session-state.server.ts +75 -0
  60. package/src/server/lib/mcp/store.server.ts +6 -1
  61. package/src/server/lib/omp/config/config-cli.ts +4 -0
  62. package/src/server/lib/omp/config/mcp-and-cli.test.ts +12 -183
  63. package/src/server/lib/omp/config/mcp-config.test.ts +277 -0
  64. package/src/server/lib/omp/config/mcp-shared.ts +36 -0
  65. package/src/server/lib/omp/config/mcp-test-protocol.ts +89 -0
  66. package/src/server/lib/omp/config/mcp-test-remote.ts +167 -0
  67. package/src/server/lib/omp/config/mcp-test.ts +21 -123
  68. package/src/server/lib/omp/config/mcp-write.ts +179 -0
  69. package/src/server/lib/omp/config/mcp.ts +138 -118
  70. package/src/server/lib/omp/core/cli.ts +4 -14
  71. package/src/server/lib/omp/rpc/manager.ts +12 -17
  72. package/src/server/lib/omp/rpc/reload-mcp.ts +39 -0
  73. package/src/server/lib/omp/rpc/session-registry.ts +6 -2
  74. package/src/server/lib/omp/rpc/spawn-mcp.ts +43 -0
  75. package/src/server/lib/omp/session/delete.server.ts +7 -0
  76. package/src/server/lib/plugins/mcp.server.ts +2 -2
  77. package/src/server/lib/realtime/topics/workspace.server.test.ts +44 -0
  78. package/src/server/lib/realtime/topics/workspace.server.ts +3 -2
  79. package/src/server/routes/browser/engine.test.ts +70 -0
  80. package/src/server/routes/browser/engine.ts +51 -0
  81. package/src/server/routes/browser/index.ts +5 -0
  82. package/src/server/routes/fs/git.ts +4 -3
  83. package/src/server/routes/harness/versions.test.ts +5 -0
  84. package/src/server/routes/sessions/index.ts +7 -0
  85. package/src/server/routes/sessions/mcp.test.ts +154 -0
  86. package/src/server/routes/sessions/mcp.ts +202 -0
  87. package/src/server/routes/settings/mcp-test.ts +5 -4
  88. package/src/server/routes/settings/mcp.test.ts +42 -1
  89. package/src/server/routes/settings/mcp.ts +80 -24
  90. package/src/shared/lib/code/highlight-memo.test.ts +18 -0
  91. package/src/shared/lib/code/highlight-memo.ts +46 -17
  92. package/src/shared/lib/mcp/import.ts +112 -0
  93. package/src/shared/lib/mcp/item.ts +61 -0
  94. package/src/shared/lib/mcp/key-value.ts +37 -0
  95. package/src/shared/lib/mcp/mcp-lib.test.ts +119 -0
  96. package/src/shared/lib/mcp/status.test.ts +36 -0
  97. package/src/shared/lib/mcp/status.ts +38 -0
  98. package/src/shared/lib/models/client.ts +27 -6
  99. package/src/shared/lib/models/provider/models.test.ts +31 -0
  100. package/src/shared/lib/omp/config/access-mode.test.ts +73 -0
  101. package/src/shared/lib/omp/config/access-mode.ts +49 -0
  102. package/src/shared/lib/workspace/right-panels.ts +13 -0
  103. package/src/shared/lib/workspace/workspace-modules.test.ts +3 -1
  104. package/src/shared/types/browser.ts +21 -0
  105. package/src/shared/types/settings/mcp.ts +73 -4
  106. package/src/test-support/pristine-globals.test.ts +53 -0
  107. package/src/test-support/pristine-globals.ts +6 -1
package/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- Web console and diagnostic workbench for <a href="https://github.com/can1357/oh-my-pi">Oh-My-Pi</a> (<code>omp</code>) agent sessions.<br>
6
+ Web console and diagnostic workbench for AI coding agents.<br>
7
+ <a href="https://github.com/can1357/oh-my-pi">Oh-My-Pi</a> (<code>omp</code>) by default, with Claude Code, Codex, OpenCode and any ACP agent beside it.<br>
7
8
  Watch, steer and audit autonomous coding sessions from one paper-flat dashboard.
8
9
  </p>
9
10
 
@@ -29,9 +30,9 @@
29
30
 
30
31
  ## What it is
31
32
 
32
- The web app over a live `omp` install. It is not a terminal wrapper: Kabmo reads omp's own
33
- session JSONL, project registry, config and subagent transcripts, folds them into one live view, and
34
- writes back through omp's RPC mode.
33
+ The web app over a live agent install. It is not a terminal wrapper: Kabmo reads the agent's own
34
+ session data — omp's JSONL store, project registry, config and subagent transcripts, or an ACP
35
+ agent's own protocol — folds it into one live view, and writes back through the same channel.
35
36
 
36
37
  ```bash
37
38
  kabmo serve # production server + prebuilt client on :3000
@@ -41,12 +42,17 @@ bun run dev # source checkout: one process, HMR, no build step
41
42
  - **One process.** Elysia serves the API and the client bundle, and the agent event stream is a
42
43
  first-class WebSocket route on that same listener (SSE as fallback) — no second server, no proxy,
43
44
  no separate client watcher.
45
+ - **Many harnesses, one console.** `omp` over RPC is the default; fifteen ACP agents sit beside it
46
+ — omp's own ACP surface, Claude Code, Codex, OpenCode, Command Code, deepseek-harness,
47
+ Antigravity, MiniMax, pi, qwen, kimi, Cursor, ZCode, JCode and Grok — plus a user-added ACP
48
+ agent. The composer's model dropdown picks the harness per chat; tabs, marks, capabilities and
49
+ settings follow that choice.
44
50
  - **Two data modes.** `MOCK=false` (the default, also when unset) runs on the real SQLite database
45
51
  and your real workspace; `MOCK=true` swaps in bundled demo datasets. Every screenshot and
46
52
  recording on this page was captured in `MOCK=true`, in the **glass** surface style with
47
53
  **full-colour** icons.
48
54
  - **Bun only.** The server imports `bun:sqlite` and `Bun.YAML`, the client is bundled by `Bun.build`,
49
- and sessions, config and updates shell out to the `omp` binary.
55
+ and sessions, config and updates shell out to the agent's own CLI.
50
56
 
51
57
  ## Feature tour
52
58
 
@@ -65,27 +71,40 @@ bun run dev # source checkout: one process, HMR, no build step
65
71
  | ![Panel plugins](docs/assets/settings-panel-plugins.png)<br>**Panel plugins** — every view is a plugin, the eleven built-in ones included | ![Providers](docs/assets/settings-providers.png)<br>**Providers** — dialects, discovery, hand-added models, credential removal |
66
72
  | ![Mobile view](docs/assets/mobile.png)<br>**Mobile view** — the same session on a phone: chat, sessions drawer, and the panel drawer | ![Light theme](docs/assets/hero-light.png)<br>**Any palette** — 63 light and dark themes, applied to the whole console |
67
73
 
68
- - **Chat timeline** — streaming thinking blocks (omp's narrated prose promoted to answer text), a
74
+ - **Chat timeline** — streaming thinking blocks (narrated prose promoted to answer text), a
69
75
  structured renderer per tool (bash, LSP, AST edit, `proc://` services, `wait` with a clock and
70
76
  progress, zoomable mermaid), usage footers, a persistent follow-up queue, a jump rail, drag-and-drop
71
- attachments, one-shot auto-titling and in-place undo that rewinds a session.
77
+ attachments, one-shot auto-titling, prompt recall on ArrowUp/ArrowDown and in-place undo that
78
+ rewinds a session.
72
79
  - **Steering, not cancelling** — a mid-run prompt is delivered INTO the running turn, so the answer
73
80
  you were watching survives. A subagent can be steered or stopped on its own.
81
+ - **Forks, child sessions and orchestration** — fork at any message or at the chat's tip, start child
82
+ sessions from the composer, and hand work to another agent with an `@harness` mention; the sidebar
83
+ draws parents and subagents as one branch, and every child's outcome returns as a turn in the
84
+ parent.
74
85
  - **Side questions** (`/btw [question]`) — answer from a private copy of the session file, without
75
86
  writing the parent transcript; a topic can be promoted into a session of its own.
76
- - **Workspace sidebar** — folder → session tree off omp's project registry, with search, sort,
77
- archive, per-session stream status, subagent rows, scheduled tasks, and a New Workspace dialog that
78
- registers a directory or clones a repository.
87
+ - **Workspace sidebar** — folder → session tree off the project registry, with search, sort,
88
+ archive, per-session stream status and harness mark, subagent rows, scheduled tasks, worktree
89
+ sessions, and a New Workspace dialog that registers a directory or clones a repository.
90
+ - **Schedules, held prompts and notifications** — timezone-aware background tasks with their own
91
+ harness and model, a chat's next prompt held until you release it (drafts restored on cancel), and
92
+ desktop/mobile banners when a run finishes, waits for input or fails.
79
93
  - **Eleven right-panel views, each a plugin** — context & telemetry, files, search, source control,
80
94
  wiki, terminal, your browser, the agent browser, usage, todos and plan; each remembers its own width
81
- per session. A plugin can ship a Preact view, a server half, storage, RPC methods, a realtime topic
82
- and settings; four are bundled (`Runner`, `Stats`, `Session Info`, `Forge`).
83
- - **The whole omp settings surface** — engine config generated from omp's own schema, providers,
84
- agents, `AGENTS.md` / `RULES.md`, slash commands, MCP servers with live connection tests, skills,
85
- token usage, notifications and dictation.
95
+ per session. A plugin can ship a Preact view, a server half, storage, RPC methods, a realtime topic,
96
+ a fenced-block renderer and settings; four are bundled (`command-runner`, `stats`, `session-info`,
97
+ `git-forge`).
98
+ - **Files and editor** — multi-select with archive extract/compress, and a CodeMirror 6 editor with
99
+ a symbol outline, fold guides, split view and Save As; spreadsheets edit in a cell grid, `.drawio`
100
+ files render as diagrams, and an open tab follows disk changes by content hash.
101
+ - **The whole agent settings surface** — engine config generated from omp's own schema, providers,
102
+ harnesses (launch line, env, models, modes), agents, `AGENTS.md` / `RULES.md`, slash commands, MCP
103
+ servers with live connection tests, skills, token usage, notifications and dictation.
86
104
  - **Self-update, opt-in auth, tray and dictation** — `kabmo update` and **About → Updates** restart
87
- into the new build; a password and HTTPS are opt-in; `serve --tray` puts the icon in the menu bar;
88
- the composer's mic runs omp's own local speech-to-text.
105
+ into the new build (harness updates run as a background job with a readable log); a password and
106
+ HTTPS are opt-in; `serve --tray` puts the icon in the menu bar; the composer's mic runs omp's own
107
+ local speech-to-text.
89
108
 
90
109
  ## Themes
91
110
 
@@ -126,10 +145,30 @@ opaque.
126
145
 
127
146
  ![Classic and glass surfaces, monochrome and full-colour icons, same palette](docs/assets/theme-styles.png)
128
147
 
148
+ ## Harnesses
149
+
150
+ A chat's **harness** is the agent behind it, and it is a first-class idea: a tab in the composer's
151
+ model dropdown, a mark beside the session in the sidebar, and a section in Settings.
152
+
153
+ | Harness | Transport | Notes |
154
+ |---|---|---|
155
+ | `omp` | RPC (`--mode rpc-ui`) | the default; the only path that reports todos, subagents, host tools, stats and compaction |
156
+ | `omp-acp` | ACP (`omp acp`) | the same agent over the adapter, with a slimmer surface |
157
+ | Claude Code, Codex, OpenCode, Command Code, deepseek-harness, Antigravity, MiniMax, pi, qwen, kimi, Cursor, ZCode, JCode, Grok | ACP over stdio | each launches its own CLI; models, modes, thought levels and MCP servers are probed from the agent, not hardcoded |
158
+ | your own | ACP over stdio | add a launch line in Settings → Harnesses |
159
+
160
+ Capabilities are probed, not assumed: the fork control appears only where the agent advertises
161
+ `session/fork` (at a message on omp, Claude Code and Codex; at the tip on OpenCode, MiniMax and
162
+ ZCode; nowhere else), and a harness that cannot fork says so instead of silently returning the tip.
163
+ The full measured matrix — every agent's transport, fork point, transcript store and known limits —
164
+ is in the **[Harnesses wiki page](https://github.com/kabmo-labs/kabmo/wiki/Harnesses)**.
165
+
129
166
  ## Install
130
167
 
131
168
  Kabmo is published to npm and runs on **Bun 1.4+**, not Node. Live capabilities need the `omp`
132
- binary on `PATH` (or `KABMO_OMP_BIN`); `MOCK=true` is the only mode that runs without one.
169
+ binary on `PATH` (or `KABMO_OMP_BIN`) — the server refuses to boot without it — and any ACP harness
170
+ you want to use needs its own CLI installed and signed in. `MOCK=true` is the only mode that runs
171
+ without either.
133
172
 
134
173
  ```bash
135
174
  bun install -g @oh-my-pi/pi-coding-agent # omp is a prerequisite, never installed by Kabmo
@@ -152,6 +191,25 @@ bun run start # or: bun link, then `kabmo status`
152
191
  Updating, the full CLI reference, the tray and login entry, and multi-instance ports:
153
192
  **[Installation →](https://github.com/kabmo-labs/kabmo/wiki/Installation)**
154
193
 
194
+ ## Shells
195
+
196
+ The server is the product; a shell is a window on one. Every shell is thin — the client is
197
+ same-origin relative, so a system webview on the real `http://host:port` URL runs the unmodified
198
+ page — and every shell decides which server it is on, starts and stops a local one, and owns the
199
+ window chrome.
200
+
201
+ | Shell | Stack | Notes |
202
+ |---|---|---|
203
+ | macOS | Swift 6 + AppKit + WKWebView | 660 KB app, ~40 MB RSS; no runtime in the bundle |
204
+ | Windows | .NET 8 + WPF + WebView2 | `WindowChrome` owns the resize border |
205
+ | Linux | Rust + GTK 3 + WebKitGTK 4.1 | a port of the macOS shell, same contract |
206
+ | Android | Kotlin + platform WebView | viewer only; the server runs elsewhere |
207
+ | iOS | Swift 6 + UIKit + WebKit | viewer only; the Android shell is the reference |
208
+
209
+ The three desktop shells share the server list, the ownership rule and the bridge contract
210
+ (`src/client/lib/desktop/`); the two mobile shells are viewers because Kabmo's server needs `omp`,
211
+ a POSIX PTY, `git` and `rg` on the host. Each has its own release job.
212
+
155
213
  ## Configuration
156
214
 
157
215
  Environment variables (`PORT`, `HOST`, `MOCK`, `KABMO_DATA_DIR`, `KABMO_OMP_BIN`, …), the SQLite
@@ -182,11 +240,11 @@ Bind to loopback and reach it over SSH, a VPN or a tunnel — full detail in
182
240
  ```text
183
241
  src/
184
242
  ├─ client/ Preact UI — zero React packages
185
- ├─ server/ Bun-only — Elysia routes, SQLite, omp RPC bridge, fs/git/terminal
243
+ ├─ server/ Bun-only — Elysia routes, SQLite, omp RPC and ACP bridges, fs/git/terminal
186
244
  ├─ shared/ Imported by both — types, chat timeline folding, pure helpers
187
245
  └─ cli/ kabmo command (plain ESM, runs under Bun)
188
- packages/ kabmo-sdk (plugin contract) · kabmo-ui (Preact kit)
189
- marketplace/ command-runner · stats · session-info
246
+ packages/ kabmo-sdk (plugin contract) · kabmo-ui (Preact kit) · macos · windows · linux · android · ios
247
+ marketplace/ command-runner · stats · session-info · git-forge
190
248
  ```
191
249
 
192
250
  [`AGENTS.md`](AGENTS.md) is the short binding contract for contributors and agents. The detail —
@@ -65,7 +65,7 @@
65
65
  by `scripts/build-client.ts`. A page that ships an external font must
66
66
  name it somewhere; this one did not. -->
67
67
  <!--app-head-->
68
- <link rel="stylesheet" crossorigin href="./static/js/index-naa91727.css"><script type="module" crossorigin src="./static/js/index-bwhhehnh.js"></script></head>
68
+ <link rel="stylesheet" crossorigin href="./static/js/index-naa91727.css"><script type="module" crossorigin src="./static/js/index-r3bhgvkt.js"></script></head>
69
69
  <body>
70
70
  <div id="app"></div>
71
71
  <!--app-bootstrap-->