Clover Agent#
See docs/architecture.md for package and process ownership.
Move the flat src modules into three layers behind the unchanged public index.ts:
- editor/ codemirror layer (editor, mentions, react-grab)
- state/ wire/projection layer (store, live, replay, mutations, fixtures, compact-hint)
- components/ view layer (all .tsx, the composer hooks, the entry renderers)
index.ts, components.css, and styles/ stay at the src root so the package entry and the
harness/webview @import references need no changes. Pure relocation, no behavior change.
Assisted-by: claude-opus-4.8
- scope the mention registry to each editor instance, removing the module-global Map + id counter (unbounded leak, shared across composers)
- single source of truth for the default model (gpt-5.6-sol); collapse the host catalog/default literals; webview seeds+persists modelPrefs so the default never flashes over a real choice
- swap hand-rolled glyphs for lucide-react wrappers, keeping the branded marks and the filled stop square custom
- decompose PromptComposer into a shell + useAttachments / useComposerMenus / useComposerSuggestions
- split entries.tsx into per-kind modules behind a re-export barrel
- split components.css into per-concern files under styles/ behind an @import barrel (cascade-identical)
Assisted-by: claude-opus-4.8
Introduce the detached-session architecture across three new packages:
- agent-protocol: the wire contract between a backend session and its client.
A durable flat LogEntry log plus seq-ordered Deltas that fold in, giving
exactly-once resume across webview reloads and backend restarts. Adds the
backend-wide sync tier (backend.hello resync + revisioned entity events),
placement, session projection, and model catalog.
- agent-backend: detached workers own each provider session (claude/codex) and
its durable recording, so restarting the backend does not restart a live
harness. Sessions reused by id; per-client selection with pushed user profile
and workspace presence. HTTP + WebSocket surface, session hub/store/recorder,
process registry, idle shutdown.
- agent-ui: the webview + standalone vite harness (Conversation, PromptComposer,
pickers, context meter, markdown, live/replay store).
Rewire the extension onto backend-client/backend-process and the clover webview,
dropping the old proxy/supervisor/server/plan-review/theme-bridge tree. Rebrand
opencode -> clover (assets, svg, readme). browser-mcp gains tabs + settings and
drops the old state module. claude-bridge swaps the profile menu for the controls
tui.
Assisted-by: claude-opus-4.8
See docs/architecture.md for package and process ownership.