docs: restructure docs — eliminate v3- prefix, merge findings, create decisions.md
Merge v3-task_plan.md content into architecture.md (data model, layout system, keyboard shortcuts) and new decisions.md (22-entry categorized decisions log). Merge v3-findings.md into unified findings.md (16 sections covering all research). Move progress logs to progress/ subdirectory (v2.md, v3.md, v2-archive.md). Rename v3-release-notes.md to release-notes.md. Update all cross-references. Delete v3-task_plan.md and v3-findings.md (content fully incorporated).
This commit is contained in:
parent
60e2bfb857
commit
a89e2b9f69
11 changed files with 555 additions and 718 deletions
273
docs/progress/v2-archive.md
Normal file
273
docs/progress/v2-archive.md
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
# v2 Progress Log (Archive: 2026-03-05 to 2026-03-06 early)
|
||||
|
||||
> Archived from [v2.md](v2.md). Covers research, Phases 1-6, polish, testing, agent teams, and subagent support.
|
||||
|
||||
## Session: 2026-03-05
|
||||
|
||||
### Research Phase (complete)
|
||||
- [x] Analyzed current BTerminal v1 codebase (2092 lines Python, GTK3+VTE)
|
||||
- [x] Queried Memora — no existing BTerminal memories
|
||||
- [x] Researched Claude Agent SDK — found structured streaming, subagent tracking, hooks
|
||||
- [x] Researched Tauri + xterm.js ecosystem — found 4+ working projects
|
||||
- [x] Researched terminal latency benchmarks — xterm.js acceptable for AI output
|
||||
- [x] Researched 32:9 ultrawide layout patterns
|
||||
- [x] Evaluated GTK4 vs Tauri vs pure Rust — Tauri wins for this use case
|
||||
- [x] Created task_plan.md with 8 phases
|
||||
- [x] Created findings.md with 7 research areas
|
||||
|
||||
### Technology Decision (complete)
|
||||
- Decision: **Tauri 2.x + Solid.js + Claude Agent SDK + xterm.js**
|
||||
- Rationale documented in task_plan.md Phase 0
|
||||
|
||||
### Adversarial Review (complete)
|
||||
- [x] Spawned devil's advocate agent to attack the plan
|
||||
- [x] Identified 5 fatal/critical issues:
|
||||
1. Node.js sidecar requirement unacknowledged
|
||||
2. SDK 0.2.x instability — need abstraction layer
|
||||
3. Three-tier observation overengineered — simplified to two-tier
|
||||
4. Solid.js ecosystem too small — switched to Svelte 5
|
||||
5. Missing: packaging, error handling, testing, responsive design
|
||||
- [x] Revised plan (Rev 2) incorporating all corrections
|
||||
- [x] Added error handling strategy table
|
||||
- [x] Added testing strategy table
|
||||
- [x] Defined MVP boundary (Phases 1-4)
|
||||
- [x] Added responsive layout requirement (1920px degraded mode)
|
||||
|
||||
### Phase 1 Scaffolding (complete)
|
||||
- [x] Created feature branch `v2-mission-control`
|
||||
- [x] Initialized Tauri 2.x + Svelte 5 project in `v2/` directory
|
||||
- [x] Rust backend stubs: main.rs, lib.rs, pty.rs, sidecar.rs, watcher.rs, session.rs
|
||||
- [x] Svelte frontend: App.svelte with Catppuccin Mocha CSS variables, component stubs
|
||||
- [x] Node.js sidecar scaffold: agent-runner.ts with NDJSON communication pattern
|
||||
- [x] Tauri builds and launches (cargo build --release verified)
|
||||
- [x] Dev scripts: npm run dev, npm run build, npm run tauri dev/build
|
||||
- [x] 17 operational rules added to `.claude/rules/`
|
||||
- [x] Project meta files: CLAUDE.md, .claude/CLAUDE.md, TODO.md, CHANGELOG.md
|
||||
- [x] Documentation structure: docs/README.md, task_plan.md, phases.md, findings.md, progress.md
|
||||
|
||||
### Phase 2: Terminal Pane + Layout (complete)
|
||||
- [x] Rust PTY backend with portable-pty (PtyManager: spawn, write, resize, kill)
|
||||
- [x] PTY reader thread emitting Tauri events (pty-data-{id}, pty-exit-{id})
|
||||
- [x] Tauri commands: pty_spawn, pty_write, pty_resize, pty_kill
|
||||
- [x] xterm.js terminal pane with Canvas addon (explicit, no WebGL)
|
||||
- [x] Catppuccin Mocha theme for xterm.js (16 ANSI colors)
|
||||
- [x] FitAddon with ResizeObserver + 100ms debounce
|
||||
- [x] PTY bridge adapter (spawnPty, writePty, resizePty, killPty, onPtyData, onPtyExit)
|
||||
- [x] CSS Grid tiling layout with 5 presets (1-col, 2-col, 3-col, 2x2, master-stack)
|
||||
- [x] Layout store with Svelte 5 $state runes and auto-preset selection
|
||||
- [x] Sidebar with session list, layout preset selector, new terminal button
|
||||
- [x] Keyboard shortcuts: Ctrl+N new terminal, Ctrl+1-4 focus pane
|
||||
- [x] PaneContainer with header bar (title, status, close)
|
||||
- [x] Empty state welcome screen with Ctrl+N hint
|
||||
- [x] npm dependencies: @xterm/xterm, @xterm/addon-canvas, @xterm/addon-fit
|
||||
- [x] Cargo dependencies: portable-pty, uuid
|
||||
|
||||
### Phase 3: Agent SDK Integration (complete)
|
||||
- [x] Rust SidecarManager: spawn Node.js, stdio NDJSON, query/stop/shutdown (sidecar.rs, 218 lines)
|
||||
- [x] Node.js agent-runner: spawns `claude -p --output-format stream-json`, manages sessions (agent-runner.ts, 176 lines)
|
||||
- [x] Tauri commands: agent_query, agent_stop, agent_ready in lib.rs
|
||||
- [x] Sidecar auto-start on app launch
|
||||
- [x] SDK message adapter: full stream-json parser with 9 typed message types (sdk-messages.ts, 234 lines)
|
||||
- [x] Agent bridge: Tauri IPC adapter for sidecar communication (agent-bridge.ts, 53 lines)
|
||||
- [x] Agent dispatcher: routes sidecar events to agent store (agent-dispatcher.ts, 87 lines)
|
||||
- [x] Agent store: session state with messages, cost tracking (agents.svelte.ts, 91 lines)
|
||||
- [x] AgentPane component: prompt input, message rendering, stop button, cost display (AgentPane.svelte, 420 lines)
|
||||
- [x] UI integration: Ctrl+Shift+N for new agent, sidebar agent button, TilingGrid routing
|
||||
|
||||
Architecture decision: Initially used `claude` CLI with `--output-format stream-json`. Migrated to `@anthropic-ai/claude-agent-sdk` query() due to CLI piped stdio hang bug (#6775). SDK outputs same message format, so adapter unchanged.
|
||||
|
||||
### Bug Fix: Svelte 5 Rune File Extensions (2026-03-06)
|
||||
- [x] Diagnosed blank screen / "rune_outside_svelte" runtime error
|
||||
- [x] Root cause: store files used `.ts` extension but contain Svelte 5 `$state`/`$derived` runes, which only work in `.svelte` and `.svelte.ts` files
|
||||
- [x] Renamed: `layout.ts` -> `layout.svelte.ts`, `agents.ts` -> `agents.svelte.ts`, `sessions.ts` -> `sessions.svelte.ts`
|
||||
- [x] Updated all import paths in 5 files to use `.svelte` suffix (e.g., `from './stores/layout.svelte'`)
|
||||
|
||||
### Phase 3 Polish (2026-03-06)
|
||||
- [x] Sidecar crash detection: dispatcher listens for sidecar-exited event, marks running sessions as error
|
||||
- [x] Restart UI: "Restart Sidecar" button in AgentPane error bar, calls agent_restart command
|
||||
- [x] Auto-scroll lock: scroll handler disables auto-scroll when user scrolls >50px from bottom, "Scroll to bottom" button appears
|
||||
|
||||
### Phase 4: Session Management + Markdown Viewer (2026-03-06)
|
||||
- [x] rusqlite 0.31 (bundled) + dirs 5 + notify 6 added to Cargo.toml
|
||||
- [x] SessionDb: SQLite with WAL mode, sessions table + layout_state singleton
|
||||
- [x] Session CRUD: list, save, delete, update_title, touch (7 Tauri commands)
|
||||
- [x] Frontend session-bridge.ts: typed invoke wrappers for all session/layout commands
|
||||
- [x] Layout store wired to persistence: addPane/removePane/focusPane/setPreset all persist
|
||||
- [x] restoreFromDb() on app startup restores panes in layout order
|
||||
- [x] FileWatcherManager: notify crate watches files, emits Tauri "file-changed" events
|
||||
- [x] MarkdownPane component: marked.js rendering, Catppuccin-themed styles, live reload
|
||||
- [x] Sidebar "M" button opens file picker for .md/.markdown/.txt files
|
||||
- [x] TilingGrid routes markdown pane type to MarkdownPane component
|
||||
|
||||
### Phase 5: Agent Tree + Polish (2026-03-06, complete)
|
||||
- [x] Agent tree visualization (SVG): AgentTree.svelte component with horizontal tree layout, bezier edges, status-colored nodes; agent-tree.ts utility (buildAgentTree, countTreeNodes, subtreeCost)
|
||||
- [x] Agent tree toggle in AgentPane: collapsible tree view shown when tool_call messages exist
|
||||
- [x] Global status bar: StatusBar.svelte showing terminal/agent pane counts, active agents with pulse animation, total tokens and cost
|
||||
- [x] Notification system: notifications.svelte.ts store (notify, dismissNotification, max 5 toasts, 4s auto-dismiss) + ToastContainer.svelte (slide-in animation, color-coded by type)
|
||||
- [x] Agent dispatcher notifications: toast on agent_stopped (success), agent_error (error), sidecar crash (error), cost result (success with cost/turns)
|
||||
- [x] Settings dialog: SettingsDialog.svelte modal (default shell, cwd, max panes, theme flavor) with settings-bridge.ts adapter
|
||||
- [x] Settings backend: settings table (key/value) in session.rs, Tauri commands settings_get/set/list in lib.rs
|
||||
- [x] Keyboard shortcuts: Ctrl+W close focused pane, Ctrl+, open settings dialog
|
||||
- [x] CSS grid update: app.css grid-template-rows '1fr' -> '1fr auto' for status bar row
|
||||
- [x] App.svelte: integrated StatusBar, ToastContainer, SettingsDialog components
|
||||
|
||||
### Phase 6: Packaging + Distribution (2026-03-06)
|
||||
- [x] Created install-v2.sh — build-from-source installer with 6-step dependency check process
|
||||
- [x] Updated v2/src-tauri/tauri.conf.json: bundle targets ["deb", "appimage"]
|
||||
- [x] Regenerated all icons in v2/src-tauri/icons/ from bterminal.svg as RGBA PNGs
|
||||
- [x] Created .github/workflows/release.yml — CI workflow triggered on v* tags
|
||||
- [x] Build verified: .deb (4.3 MB), AppImage (103 MB) both built successfully
|
||||
|
||||
### Phase 5 continued: SSH, ctx, themes, detached mode, auto-updater (2026-03-06)
|
||||
- [x] ctx integration: Rust ctx.rs, 5 Tauri commands, ctx-bridge.ts adapter, ContextPane.svelte
|
||||
- [x] SSH session management: SshSession struct, ssh-bridge.ts, SshDialog.svelte, SshSessionList.svelte
|
||||
- [x] Catppuccin theme flavors: Latte/Frappe/Macchiato/Mocha selectable
|
||||
- [x] Detached pane mode: pop-out windows via URL params
|
||||
- [x] Syntax highlighting: Shiki lazy singleton (13 languages)
|
||||
- [x] Tauri auto-updater plugin integrated
|
||||
- [x] AgentPane markdown rendering with Shiki highlighting
|
||||
|
||||
### Session: 2026-03-06 (continued) — Polish, Testing, Extras
|
||||
|
||||
#### Terminal Copy/Paste + Theme Hot-Swap
|
||||
- [x] Copy/paste in TerminalPane via Ctrl+Shift+C/V
|
||||
- [x] Theme hot-swap: onThemeChange() callback registry
|
||||
|
||||
#### Agent Tree Enhancements
|
||||
- [x] Click tree node -> scroll to message, subtree cost display
|
||||
|
||||
#### Session Resume
|
||||
- [x] Follow-up prompt input, resume_session_id passed to SDK
|
||||
|
||||
#### Pane Drag-Resize Handles
|
||||
- [x] Splitter overlays in TilingGrid with mouse drag (min 10% / max 90%)
|
||||
|
||||
#### Auto-Update Workflow Enhancement
|
||||
- [x] release.yml: signing key env vars, latest.json generation
|
||||
|
||||
#### Deno Sidecar Evaluation
|
||||
- [x] Created agent-runner-deno.ts proof-of-concept
|
||||
|
||||
#### Testing Infrastructure
|
||||
- [x] Vitest + Cargo tests: 104 vitest + 29 cargo tests, all passing
|
||||
|
||||
### Session: 2026-03-06 (continued) — Session Groups, Auto-Update Key, Deno Sidecar, Tests
|
||||
|
||||
#### Auto-Update Signing Key
|
||||
- [x] Generated Tauri signing keypair (minisign), set pubkey in tauri.conf.json
|
||||
|
||||
#### Session Groups/Folders
|
||||
- [x] group_name column, setPaneGroup, grouped sidebar with collapsible headers
|
||||
|
||||
#### Deno Sidecar Integration (upgraded from PoC)
|
||||
- [x] SidecarCommand struct, Deno-first resolution, Node.js fallback
|
||||
|
||||
#### E2E/Integration Tests
|
||||
- [x] layout.test.ts (30), agent-bridge.test.ts (11), agent-dispatcher.test.ts (18), sdk-messages.test.ts (25)
|
||||
- [x] Total: 104 vitest tests + 29 cargo tests
|
||||
|
||||
### Session: 2026-03-06 (continued) — Agent Teams / Subagent Support
|
||||
|
||||
#### Agent Teams Frontend Support
|
||||
- [x] Parent/child hierarchy in agent store, subagent detection in dispatcher
|
||||
- [x] spawnSubagentPane(), toolUseToChildPane routing, parent/child navigation in AgentPane
|
||||
- [x] 10 new dispatcher tests for subagent routing (28 total, 114 vitest overall)
|
||||
|
||||
#### Subagent Cost Aggregation
|
||||
- [x] getTotalCost() recursive helper, total cost shown in parent pane
|
||||
|
||||
#### TAURI_SIGNING_PRIVATE_KEY
|
||||
- [x] Set via `gh secret set` on DexterFromLab/BTerminal GitHub repo
|
||||
|
||||
### Session: 2026-03-06 (continued) — Multi-Machine Architecture Design
|
||||
|
||||
#### Multi-Machine Support Architecture
|
||||
- [x] Designed full multi-machine architecture in docs/multi-machine.md (303 lines)
|
||||
- [x] Three-layer model: BTerminal (controller) + bterminal-relay (remote binary) + unified frontend
|
||||
- [x] WebSocket NDJSON protocol: RelayCommand/RelayEvent envelope wrapping existing sidecar format
|
||||
- [x] Authentication: pre-shared token + TLS, rate limiting, lockout
|
||||
- [x] Autonomous relay model: agents keep running when controller disconnects
|
||||
- [x] Reconnection with exponential backoff (1s-30s), state_sync on reconnect
|
||||
- [x] 4-phase implementation plan: A (extract bterminal-core crate), B (relay binary), C (RemoteManager), D (frontend)
|
||||
- [x] Updated TODO.md and docs/task_plan.md to reference the design
|
||||
|
||||
### Session: 2026-03-06 (continued) — Multi-Machine Implementation (Phases A-D)
|
||||
|
||||
#### Phase A: bterminal-core crate extraction
|
||||
- [x] Created Cargo workspace at v2/ level (v2/Cargo.toml, workspace members: src-tauri, bterminal-core, bterminal-relay)
|
||||
- [x] Extracted PtyManager into v2/bterminal-core/src/pty.rs
|
||||
- [x] Extracted SidecarManager into v2/bterminal-core/src/sidecar.rs
|
||||
- [x] Created EventSink trait (v2/bterminal-core/src/event.rs) to abstract event emission
|
||||
- [x] TauriEventSink (v2/src-tauri/src/event_sink.rs) implements EventSink for Tauri AppHandle
|
||||
- [x] src-tauri/src/pty.rs and sidecar.rs now thin re-export wrappers
|
||||
- [x] Cargo.lock moved from src-tauri/ to workspace root (v2/)
|
||||
|
||||
#### Phase B: bterminal-relay binary
|
||||
- [x] New Rust binary at v2/bterminal-relay/ with WebSocket server (tokio-tungstenite)
|
||||
- [x] Token auth via Authorization: Bearer header on WebSocket upgrade
|
||||
- [x] CLI flags: --port (default 9750), --token (required), --insecure (allow ws://)
|
||||
- [x] Routes RelayCommand types (pty_create/write/resize/close, agent_query/stop, sidecar_restart, ping)
|
||||
- [x] Forwards RelayEvent types (pty_data/exit, sidecar_message/exited, error, pong, ready)
|
||||
- [x] Rate limiting: 10 failed auth attempts triggers 5-minute lockout
|
||||
- [x] Per-connection isolated PtyManager + SidecarManager instances
|
||||
|
||||
#### Phase C: RemoteManager in controller
|
||||
- [x] New v2/src-tauri/src/remote.rs module — RemoteManager struct
|
||||
- [x] WebSocket client connections to relay instances (tokio-tungstenite)
|
||||
- [x] RemoteMachine struct: id, label, url, token, status (Connected/Connecting/Disconnected/Error)
|
||||
- [x] Machine lifecycle: add_machine, remove_machine, connect, disconnect
|
||||
- [x] 12 new Tauri commands: remote_add_machine, remote_remove_machine, remote_connect, remote_disconnect, remote_list_machines, remote_pty_spawn/write/resize/kill, remote_agent_query/stop, remote_sidecar_restart
|
||||
- [x] Heartbeat ping every 15s to detect stale connections
|
||||
|
||||
#### Phase D: Frontend integration
|
||||
- [x] v2/src/lib/adapters/remote-bridge.ts — IPC adapter for machine management + remote events
|
||||
- [x] v2/src/lib/stores/machines.svelte.ts — Svelte 5 store for remote machine state
|
||||
- [x] Layout store: added remoteMachineId?: string to Pane interface
|
||||
- [x] agent-bridge.ts: routes to remote_agent_query/stop when pane has remoteMachineId
|
||||
- [x] pty-bridge.ts: routes to remote_pty_spawn/write/resize/kill when pane has remoteMachineId
|
||||
- [x] SettingsDialog: new "Remote Machines" section (add/remove/connect/disconnect UI)
|
||||
- [x] SessionList sidebar: auto-groups remote panes by machine label
|
||||
|
||||
#### Verification
|
||||
- cargo check --workspace: clean (0 errors)
|
||||
- vitest: 114/114 tests passing
|
||||
- svelte-check: clean (0 errors)
|
||||
|
||||
#### New dependencies added
|
||||
- bterminal-core: serde, serde_json, log, portable-pty, uuid (extracted from src-tauri)
|
||||
- bterminal-relay: tokio, tokio-tungstenite, clap, env_logger, futures-util
|
||||
- src-tauri: tokio-tungstenite, tokio, futures-util, uuid (added for RemoteManager)
|
||||
|
||||
### Session: 2026-03-06 (continued) — Relay Hardening & Reconnection
|
||||
|
||||
#### Relay Command Response Propagation
|
||||
- [x] Shared event channel between EventSink and command response sender (sink_tx clone in bterminal-relay)
|
||||
- [x] send_error() helper function: all command failures now emit RelayEvent with commandId + error message instead of just logging
|
||||
- [x] ping command: now sends pong response via event channel (was a no-op)
|
||||
- [x] pty_create: returns pty_created event with session ID and commandId for correlation
|
||||
- [x] All error paths (pty_write, pty_resize, pty_close, agent_query, agent_stop, sidecar_restart) use send_error()
|
||||
|
||||
#### RemoteManager Reconnection
|
||||
- [x] Exponential backoff reconnection in remote.rs: spawns async tokio task on disconnect
|
||||
- [x] Backoff schedule: 1s, 2s, 4s, 8s, 16s, 30s (capped)
|
||||
- [x] attempt_tcp_probe() function: TCP-only connect probe (5s timeout, default port 9750) — avoids allocating per-connection resources on relay
|
||||
- [x] Emits remote-machine-reconnecting (with backoffSecs) and remote-machine-reconnect-ready Tauri events
|
||||
- [x] Cancellation: stops if machine removed (not in HashMap) or manually reconnected (status != disconnected)
|
||||
- [x] Fixed scoping: disconnection cleanup uses inner block to release mutex before emitting event
|
||||
|
||||
#### RemoteManager PTY Creation Confirmation
|
||||
- [x] Handles pty_created event type from relay: emits remote-pty-created Tauri event with machineId, ptyId, commandId
|
||||
|
||||
### Session: 2026-03-06 (continued) — Reconnection Hardening
|
||||
|
||||
#### TCP Probe Refactor
|
||||
- [x] Replaced attempt_ws_connect() with attempt_tcp_probe() in remote.rs: TCP-only connect (no WS upgrade), 5s timeout, default port 9750
|
||||
- [x] Avoids allocating per-connection resources (PtyManager, SidecarManager) on the relay during reconnection probes
|
||||
- [x] Probe no longer needs auth token — only checks TCP reachability
|
||||
|
||||
#### Frontend Reconnection Listeners
|
||||
- [x] Added onRemoteMachineReconnecting() listener in remote-bridge.ts: receives machineId + backoffSecs
|
||||
- [x] Added onRemoteMachineReconnectReady() listener in remote-bridge.ts: receives machineId when probe succeeds
|
||||
- [x] machines.svelte.ts: reconnecting handler sets machine status to 'reconnecting', shows toast with backoff duration
|
||||
- [x] machines.svelte.ts: reconnect-ready handler auto-calls connectMachine() to re-establish full WebSocket connection
|
||||
- [x] Updated docs/multi-machine.md to reflect TCP probe and frontend listener changes
|
||||
249
docs/progress/v2.md
Normal file
249
docs/progress/v2.md
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
# v2 Progress Log
|
||||
|
||||
> Earlier sessions (2026-03-05 to 2026-03-06 multi-machine): see [v2-archive.md](v2-archive.md)
|
||||
|
||||
### Session: 2026-03-09 — AgentPane + MarkdownPane UI Redesign
|
||||
|
||||
#### Tribunal-Elected Design (S-3-R4, 88% confidence)
|
||||
- [x] AgentPane full rewrite: sans-serif root font, tool call/result pairing via `$derived.by` toolResultMap, hook message collapsing, context window meter, cost bar minimized, session summary styling
|
||||
- [x] Two-phase scroll anchoring (`$effect.pre` + `$effect`)
|
||||
- [x] Tool-aware output truncation (Bash 500, Read/Write 50, Glob/Grep 20, default 30 lines)
|
||||
- [x] Colors softened via `color-mix(in srgb, var(--ctp-*) 65%, var(--ctp-surface1) 35%)`
|
||||
- [x] MarkdownPane: container query wrapper, shared responsive padding variable
|
||||
- [x] catppuccin.css: `--bterminal-pane-padding-inline: clamp(0.75rem, 3.5cqi, 2rem)`
|
||||
- [x] 139/139 vitest passing, 0 new TypeScript errors
|
||||
- [ ] Visual verification in dev mode (pending)
|
||||
|
||||
### Session: 2026-03-06 (continued) — Sidecar Env Var Bug Fix
|
||||
|
||||
#### CLAUDE* Environment Variable Leak (critical fix)
|
||||
- [x] Diagnosed silent hang in agent sessions when BTerminal launched from Claude Code terminal
|
||||
- [x] Root cause: Claude Code sets ~8 CLAUDE* env vars for nesting/sandbox detection
|
||||
- [x] Fixed both sidecar runners to filter out all keys starting with 'CLAUDE'
|
||||
|
||||
### Session: 2026-03-06 (continued) — Sidecar SDK Migration
|
||||
|
||||
#### Migration from CLI Spawning to Agent SDK
|
||||
- [x] Diagnosed root cause: claude CLI v2.1.69 hangs with piped stdio (bug #6775)
|
||||
- [x] Migrated both runners to @anthropic-ai/claude-agent-sdk query() function
|
||||
- [x] Added build:sidecar script (esbuild bundle, SDK included)
|
||||
- [x] SDK options: permissionMode configurable, allowDangerouslySkipPermissions conditional
|
||||
|
||||
#### Bug Found and Fixed
|
||||
- [x] AgentPane onDestroy killed running sessions on layout remounts (fixed: moved to TilingGrid onClose)
|
||||
|
||||
### Session: 2026-03-06 (continued) — Permission Mode, AgentPane Bug Fix, SDK Bundling
|
||||
|
||||
#### Permission Mode Passthrough
|
||||
- [x] permission_mode field flows Rust -> sidecar -> SDK, defaults to 'bypassPermissions'
|
||||
|
||||
#### AgentPane onDestroy Bug Fix
|
||||
- [x] Stop-on-close moved from AgentPane onDestroy to TilingGrid onClose handler
|
||||
|
||||
#### SDK Bundling Fix
|
||||
- [x] SDK bundled into agent-runner.mjs (no external dependency at runtime)
|
||||
|
||||
### Session: 2026-03-07 — Unified Sidecar Bundle
|
||||
|
||||
#### Sidecar Resolution Simplification
|
||||
- [x] Consolidated to single pre-built bundle (dist/agent-runner.mjs) running on both Deno and Node.js
|
||||
- [x] resolve_sidecar_command() checks runtime availability upfront, prefers Deno
|
||||
- [x] agent-runner-deno.ts retained in repo but not used by SidecarManager
|
||||
|
||||
### Session: 2026-03-07 (continued) — Rust-Side CLAUDE* Env Var Stripping
|
||||
|
||||
#### Dual-Layer Env Var Stripping
|
||||
- [x] Rust SidecarManager uses env_clear() + envs(clean_env) before spawn (primary defense)
|
||||
- [x] JS-side stripping retained as defense-in-depth
|
||||
|
||||
### Session: 2026-03-07 (continued) — Claude CLI Path Detection
|
||||
|
||||
#### pathToClaudeCodeExecutable for SDK
|
||||
- [x] Added findClaudeCli() to agent-runner.ts (Node.js): checks ~/.local/bin/claude, ~/.claude/local/claude, /usr/local/bin/claude, /usr/bin/claude, then falls back to `which claude`/`where claude`
|
||||
- [x] Added findClaudeCli() to agent-runner-deno.ts (Deno): same candidate paths, uses Deno.statSync() + Deno.Command("which")
|
||||
- [x] Both runners now pass pathToClaudeCodeExecutable to SDK query() options
|
||||
- [x] Early error: if Claude CLI not found, agent_error emitted immediately instead of cryptic SDK failure
|
||||
- [x] CLI path resolved once at sidecar startup, logged for debugging
|
||||
|
||||
### Session: 2026-03-07 (continued) — Claude Profiles & Skill Discovery
|
||||
|
||||
#### Claude Profile / Account Switching (switcher-claude integration)
|
||||
- [x] New Tauri commands: claude_list_profiles(), claude_list_skills(), claude_read_skill(), pick_directory()
|
||||
- [x] claude_list_profiles() reads ~/.config/switcher/profiles/ for profile directories with profile.toml metadata
|
||||
- [x] Config dir resolution: ~/.config/switcher-claude/{name}/ or fallback ~/.claude/
|
||||
- [x] extract_toml_value() simple TOML parser for profile metadata (email, subscription_type, display_name)
|
||||
- [x] Always includes "default" profile if no switcher profiles found
|
||||
|
||||
#### Skill Discovery & Autocomplete
|
||||
- [x] claude_list_skills() reads ~/.claude/skills/ directory (directories with SKILL.md or standalone .md files)
|
||||
- [x] Description extracted from first non-heading, non-empty line (max 120 chars)
|
||||
- [x] claude_read_skill(path) reads full skill file content
|
||||
- [x] New frontend adapter: v2/src/lib/adapters/claude-bridge.ts (ClaudeProfile, ClaudeSkill interfaces)
|
||||
|
||||
#### AgentPane Session Toolbar
|
||||
- [x] Working directory input (cwdInput) — editable text field, replaces fixed cwd prop
|
||||
- [x] Profile/account selector dropdown (shown when >1 profile available)
|
||||
- [x] Selected profile's config_dir passed as claude_config_dir in AgentQueryOptions
|
||||
- [x] Skill autocomplete menu: type `/` to trigger, arrow keys navigate, Tab/Enter select, Escape dismiss
|
||||
- [x] expandSkillPrompt(): reads skill content via readSkill(), prepends to prompt with optional user args
|
||||
|
||||
#### Extended AgentQueryOptions (full stack passthrough)
|
||||
- [x] New fields in Rust AgentQueryOptions struct: setting_sources, system_prompt, model, claude_config_dir, additional_directories
|
||||
- [x] Sidecar QueryMessage interface updated with matching fields
|
||||
- [x] Both sidecar runners (agent-runner.ts, agent-runner-deno.ts) pass new fields to SDK query()
|
||||
- [x] CLAUDE_CONFIG_DIR injected into cleanEnv when claudeConfigDir provided (multi-account support)
|
||||
- [x] settingSources defaults to ['user', 'project'] (loads CLAUDE.md and project settings)
|
||||
- [x] Frontend AgentQueryOptions interface updated in agent-bridge.ts
|
||||
|
||||
### Session: 2026-03-07 (continued) — v3 Mission Control Planning
|
||||
|
||||
#### v3 Architecture Planning
|
||||
- [x] Created docs/v3-task_plan.md — core concept, user requirements, architecture questions
|
||||
- [x] Created docs/v3-findings.md — codebase reuse analysis (what to keep/replace/drop)
|
||||
- [x] Created docs/v3-progress.md — v3-specific progress log
|
||||
- [x] Launched 3 adversarial architecture agents (Architect, Devil's Advocate, UX+Perf Specialist)
|
||||
- [x] Collect adversarial agent findings
|
||||
- [x] Produce final architecture plan
|
||||
- [x] Create v3 implementation phases
|
||||
|
||||
### Session: 2026-03-07 (continued) — v3 Mission Control MVP Implementation (Phases 1-5)
|
||||
|
||||
#### Phase 1: Data Model + Config
|
||||
- [x] Created v2/src/lib/types/groups.ts (ProjectConfig, GroupConfig, GroupsFile interfaces)
|
||||
- [x] Created v2/src-tauri/src/groups.rs (Rust structs + load/save groups.json + default_groups())
|
||||
- [x] Added groups_load, groups_save Tauri commands to lib.rs
|
||||
- [x] SQLite migrations in session.rs: project_id column, agent_messages table, project_agent_state table
|
||||
- [x] Created v2/src/lib/adapters/groups-bridge.ts (IPC wrapper)
|
||||
- [x] Created v2/src/lib/stores/workspace.svelte.ts (replaces layout.svelte.ts for v3, Svelte 5 runes)
|
||||
- [x] Added --group CLI argument parsing in main.rs
|
||||
- [x] 24 vitest tests for workspace store + 7 cargo tests for groups
|
||||
|
||||
#### Phase 2: Project Box Shell
|
||||
- [x] Created 12 new Workspace components in v2/src/lib/components/Workspace/
|
||||
- [x] GlobalTabBar, ProjectGrid, ProjectBox, ProjectHeader, CommandPalette, DocsTab, ContextTab, SettingsTab
|
||||
- [x] Rewrote App.svelte (no sidebar, no TilingGrid — GlobalTabBar + tab content + StatusBar)
|
||||
|
||||
#### Phase 3: Claude Session Integration
|
||||
- [x] Created ClaudeSession.svelte wrapping AgentPane per-project
|
||||
|
||||
#### Phase 4: Terminal Tabs
|
||||
- [x] Created TerminalTabs.svelte with shell/SSH/agent tab types
|
||||
|
||||
#### Phase 5: Team Agents Panel
|
||||
- [x] Created TeamAgentsPanel.svelte + AgentCard.svelte
|
||||
|
||||
#### Bug Fix
|
||||
- [x] Fixed AgentPane Svelte 5 event modifier: on:click -> onclick
|
||||
|
||||
#### Verification
|
||||
- All 138 vitest + 36 cargo tests pass, vite build succeeds
|
||||
|
||||
### Session: 2026-03-07 (continued) — v3 Phases 6-10 Completion
|
||||
|
||||
#### Phase 6: Session Continuity
|
||||
- [x] Added persistSessionForProject() to agent-dispatcher (saves state + messages to SQLite on complete)
|
||||
- [x] Added registerSessionProject() + sessionProjectMap for session->project persistence routing
|
||||
- [x] ClaudeSession restoreMessagesFromRecords() restores cached messages on mount
|
||||
- [x] Added getAgentSession() export to agents store
|
||||
|
||||
#### Phase 7: Workspace Teardown
|
||||
- [x] Added clearAllAgentSessions() to agents store
|
||||
- [x] switchGroup() calls clearAllAgentSessions() + resets terminal tabs
|
||||
- [x] Updated workspace.test.ts with clearAllAgentSessions mock
|
||||
|
||||
#### Phase 10: Dead Component Removal + Polish
|
||||
- [x] Deleted 7 dead v2 components (~1,836 lines): TilingGrid, PaneContainer, PaneHeader, SessionList, SshSessionList, SshDialog, SettingsDialog
|
||||
- [x] Removed empty directories: Layout/, Sidebar/, Settings/, SSH/
|
||||
- [x] Rewrote StatusBar for workspace store (group name, project count, "BTerminal v3")
|
||||
- [x] Fixed subagent routing: project-scoped sessions skip layout pane (render in TeamAgentsPanel)
|
||||
- [x] Updated v3-task_plan.md to mark all 10 phases complete
|
||||
|
||||
#### Verification
|
||||
- All 138 vitest + 36 cargo tests pass, vite build succeeds
|
||||
|
||||
### Session: 2026-03-07 (continued) — Multi-Theme System
|
||||
|
||||
#### Theme System Generalization (7 Editor Themes)
|
||||
- [x] Generalized CatppuccinFlavor to ThemeId union type (11 themes)
|
||||
- [x] Added 7 editor themes: VSCode Dark+, Atom One Dark, Monokai, Dracula, Nord, Solarized Dark, GitHub Dark
|
||||
- [x] Added ThemePalette, ThemeMeta, THEME_LIST types; deprecated old Catppuccin-only types
|
||||
- [x] Theme store: getCurrentTheme()/setTheme() with deprecated wrappers for backwards compat
|
||||
- [x] SettingsTab: optgroup-based theme selector, fixed input overflow with min-width:0
|
||||
- [x] All themes map to same --ctp-* CSS vars — zero component changes needed
|
||||
|
||||
#### Verification
|
||||
- All 138 vitest + 35 cargo tests pass
|
||||
|
||||
### Session: 2026-03-07 (continued) — Deep Dark Theme Group
|
||||
|
||||
#### 6 New Deep Dark Themes
|
||||
- [x] Added Tokyo Night, Gruvbox Dark, Ayu Dark, Poimandres, Vesper, Midnight to themes.ts
|
||||
- [x] Extended ThemeId from 11 to 17 values, THEME_LIST from 11 to 17 entries
|
||||
- [x] New "Deep Dark" theme group (3rd group alongside Catppuccin and Editor)
|
||||
- [x] Midnight is pure OLED black (#000000), Ayu Dark near-black (#0b0e14), Vesper warm dark (#101010)
|
||||
- [x] All 6 themes map to same 26 --ctp-* CSS vars — zero component changes needed
|
||||
|
||||
### Session: 2026-03-07 (continued) — Custom Theme Dropdown
|
||||
|
||||
#### SettingsTab Theme Picker Redesign
|
||||
- [x] Replaced native `<select>` with custom themed dropdown in SettingsTab.svelte
|
||||
- [x] Trigger: color swatch (base) + label + arrow; menu: grouped sections with styled headers
|
||||
- [x] Options show color swatch + label + 4 accent dots (red/green/blue/yellow) via getPalette()
|
||||
- [x] Click-outside and Escape to close; aria-haspopup/aria-expanded for a11y
|
||||
- [x] Uses --ctp-* CSS vars — fully themed with active theme
|
||||
|
||||
### Session: 2026-03-07 (continued) — Global Font Controls
|
||||
|
||||
#### SettingsTab Font Controls + Layout Restructure
|
||||
- [x] Added font family select (9 monospace fonts + Default) with live CSS var preview
|
||||
- [x] Added font size +/- stepper (8-24px range) with live CSS var preview
|
||||
- [x] Restructured global settings: 2-column grid layout with labels above controls (replaced inline rows)
|
||||
- [x] Added --ui-font-family and --ui-font-size CSS custom properties to catppuccin.css
|
||||
- [x] app.css body rule now uses CSS vars instead of hardcoded font values
|
||||
- [x] initTheme() in theme.svelte.ts restores saved font settings on startup (try/catch, non-fatal)
|
||||
- [x] Font settings persisted as 'font_family' and 'font_size' keys in SQLite settings table
|
||||
|
||||
### Session: 2026-03-07 (continued) — SettingsTab Global Settings Redesign
|
||||
|
||||
#### Font Settings Split (UI Font + Terminal Font)
|
||||
- [x] Split single font into UI font (sans-serif: System Sans-Serif, Inter, Roboto, etc.) and Terminal font (monospace: JetBrains Mono, Fira Code, etc.)
|
||||
- [x] Each font dropdown renders preview text in its own typeface
|
||||
- [x] Independent size steppers (8-24px) for UI and Terminal font
|
||||
- [x] Setting keys changed: font_family/font_size -> ui_font_family/ui_font_size + term_font_family/term_font_size
|
||||
|
||||
#### SettingsTab Layout + CSS Updates
|
||||
- [x] Rewrote global settings: single-column layout, "Appearance" + "Defaults" subsections
|
||||
- [x] All dropdowns are custom themed (no native `<select>` anywhere)
|
||||
- [x] Added --term-font-family and --term-font-size CSS vars to catppuccin.css
|
||||
- [x] Updated initTheme() to restore 4 font settings instead of 2
|
||||
|
||||
### Session: 2026-03-08 — CSS Relative Units Rule
|
||||
- [x] Created `.claude/rules/18-relative-units.md` — enforces rem/em for layout CSS (px only for icons/borders)
|
||||
- [x] Converted GlobalTabBar.svelte styles from px to rem (rail width, button size, gap, padding, border-radius)
|
||||
- [x] Converted App.svelte sidebar header styles from px to rem (padding, close button, border-radius)
|
||||
- [x] Changed GlobalTabBar rail-btn color from --ctp-overlay1 to --ctp-subtext0
|
||||
|
||||
### Session: 2026-03-09 — AgentPane Collapsibles, Aspect Ratio, Desktop Integration
|
||||
|
||||
#### AgentPane Collapsible Messages
|
||||
- [x] Text messages (`msg.type === 'text'`) wrapped in `<details open>` — open by default, collapsible
|
||||
- [x] Cost summary (`cost.result`) wrapped in `<details>` — collapsed by default, expandable
|
||||
- [x] CSS: `.msg-text-collapsible` and `.msg-summary-collapsible` with preview text
|
||||
|
||||
#### Project Max Aspect Ratio Setting
|
||||
- [x] New `project_max_aspect` SQLite setting (float, default 1.0, range 0.3–3.0)
|
||||
- [x] ProjectGrid: `max-width: calc(100vh * var(--project-max-aspect, 1))` on `.project-slot`
|
||||
- [x] SettingsTab: stepper UI in Appearance section
|
||||
- [x] App.svelte: restore on startup via getSetting()
|
||||
|
||||
#### Desktop Integration
|
||||
- [x] install-v2.sh: added `StartupWMClass=bterminal` to .desktop template
|
||||
- [x] GNOME auto-move extension compatible
|
||||
|
||||
#### No-Implicit-Push Rule
|
||||
- [x] Created `.claude/rules/52-no-implicit-push.md` — never push unless explicitly asked
|
||||
|
||||
### Next Steps
|
||||
- [ ] Real-world relay testing (2 machines)
|
||||
- [ ] TLS/certificate pinning for relay connections
|
||||
- [ ] Test agent teams with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
|
||||
1076
docs/progress/v3.md
Normal file
1076
docs/progress/v3.md
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue