diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 63a507c..a0ce5c5 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -4,7 +4,7 @@ - v1 is a single-file Python app (`bterminal.py`). Changes are localized. - v2 docs are in `docs/`. Architecture decisions are in `docs/task_plan.md`. -- Phases 1-6 complete + Phase 7 (agent teams/subagent support) in progress. Extras: SSH, ctx, themes, detached mode, auto-updater, shiki, copy/paste, session resume, drag-resize, session groups, Deno sidecar, 104 vitest + 29 cargo tests. +- Phases 1-7 complete. Extras: SSH, ctx, themes, detached mode, auto-updater, shiki, copy/paste, session resume, drag-resize, session groups, Deno sidecar, 114 vitest + 29 cargo tests. - Consult Memora (tag: `bterminal`) before making architectural changes. ## Documentation References diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df418f..bae0f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Subagent cost aggregation: getTotalCost() recursive helper in agents store aggregates cost across parent + all child sessions; total cost displayed in parent pane done-bar when children present +- 10 new subagent routing tests in agent-dispatcher.test.ts: spawn, dedup, child message routing, init/cost forwarding, fallbacks (28 total dispatcher tests, 114 vitest tests overall) +- TAURI_SIGNING_PRIVATE_KEY secret set in GitHub repo for auto-update signing - Agent teams/subagent support (Phase 7): auto-detects subagent tool calls ('Agent', 'Task', 'dispatch_agent'), spawns child agent panes with parent/child navigation, routes messages via parentId field - Agent store parent/child hierarchy: AgentSession extended with parentSessionId, parentToolUseId, childSessionIds; findChildByToolUseId() and getChildSessions() query functions - AgentPane parent link bar: SUB badge with navigate-to-parent button for subagent panes @@ -16,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Session groups/folders: group_name column in sessions table, setPaneGroup in layout store, collapsible group headers in sidebar with arrow/count, right-click pane to set group - Auto-update signing key: generated minisign keypair, pubkey configured in tauri.conf.json updater section - Deno-first sidecar: SidecarCommand struct in sidecar.rs, resolve_sidecar_command() prefers Deno (runs TS directly) with Node.js fallback, both runners bundled via tauri.conf.json resources -- Vitest integration tests: layout.test.ts (30 tests), agent-bridge.test.ts (11 tests), agent-dispatcher.test.ts (18 tests) — total 104 vitest tests passing +- Vitest integration tests: layout.test.ts (30 tests), agent-bridge.test.ts (11 tests), agent-dispatcher.test.ts (28 tests) — total 114 vitest tests passing - E2E test scaffold: v2/tests/e2e/README.md documenting WebDriver approach - Terminal copy/paste: Ctrl+Shift+C copies selection, Ctrl+Shift+V pastes from clipboard to PTY (TerminalPane.svelte) - Terminal theme hot-swap: onThemeChange() callback registry in theme.svelte.ts, open terminals update immediately when flavor changes diff --git a/CLAUDE.md b/CLAUDE.md index a71d819..52601dd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,7 @@ ## Project Overview -Terminal emulator with SSH and Claude Code session management. v1 (GTK3+VTE Python) is production-stable. v2 redesign (Tauri 2.x + Svelte 5 + Claude Agent SDK) Phases 1-6 complete plus Phase 7 (agent teams/subagent support) in progress. Packaging: .deb + AppImage via GitHub Actions CI. +Terminal emulator with SSH and Claude Code session management. v1 (GTK3+VTE Python) is production-stable. v2 redesign (Tauri 2.x + Svelte 5 + Claude Agent SDK) Phases 1-7 complete. Packaging: .deb + AppImage via GitHub Actions CI. - **Repository:** github.com/DexterFromLab/BTerminal - **License:** MIT @@ -63,7 +63,7 @@ Terminal emulator with SSH and Claude Code session management. v1 (GTK3+VTE Pyth | `v2/sidecar/agent-runner-deno.ts` | Deno sidecar (preferred when deno available) | | `v2/src/lib/adapters/sdk-messages.test.ts` | Vitest tests for SDK message adapter (25 tests) | | `v2/src/lib/adapters/agent-bridge.test.ts` | Vitest tests for agent IPC bridge (11 tests) | -| `v2/src/lib/agent-dispatcher.test.ts` | Vitest tests for agent dispatcher (18 tests) | +| `v2/src/lib/agent-dispatcher.test.ts` | Vitest tests for agent dispatcher (28 tests) | | `v2/src/lib/stores/layout.test.ts` | Vitest tests for layout store (30 tests) | | `v2/src/lib/utils/agent-tree.test.ts` | Vitest tests for agent tree builder (20 tests) | @@ -74,7 +74,7 @@ Terminal emulator with SSH and Claude Code session management. v1 (GTK3+VTE Pyth - Context DB: `~/.claude-context/context.db` - Theme: Catppuccin Mocha -## v2 Stack (Phases 1-6 complete, Phase 7 in progress, branch: v2-mission-control) +## v2 Stack (Phases 1-7 complete, branch: v2-mission-control) - Tauri 2.x (Rust backend) + Svelte 5 (frontend) - xterm.js with Canvas addon (no WebGL on WebKit2GTK) diff --git a/README.md b/README.md index 7ac8c19..e017533 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Terminal with session panel (MobaXterm-style), built with GTK 3 + VTE. Catppuccin Mocha theme. -> **v2 Phases 1-6 complete, Phase 7 (agent teams) in progress:** Multi-session Claude agent dashboard using Tauri 2.x + Svelte 5. Features: multi-pane terminal with PTY backend and copy/paste, agent panes with structured output, tree visualization with subtree cost and session resume, **subagent/agent-teams support** (auto-spawns child panes for subagents with parent/child navigation), session groups/folders with collapsible sidebar headers, SSH session management, ctx context database viewer, SQLite session persistence with layout restore, live markdown file viewer with Shiki syntax highlighting, global status bar with cost tracking, toast notifications, settings dialog with theme flavors (Catppuccin Latte/Frappe/Macchiato/Mocha) and live hot-swap, detached pane mode (pop-out windows), pane drag-resize handles, auto-updater plugin with signing key configured, Deno-first sidecar with Node.js fallback, CSS Grid tiling, .deb + AppImage packaging, GitHub Actions CI, 104 vitest + 29 cargo tests. Branch `v2-mission-control`. See [docs/task_plan.md](docs/task_plan.md) for architecture and [docs/phases.md](docs/phases.md) for implementation plan. +> **v2 Phases 1-7 complete:** Multi-session Claude agent dashboard using Tauri 2.x + Svelte 5. Features: multi-pane terminal with PTY backend and copy/paste, agent panes with structured output, tree visualization with subtree cost and session resume, **subagent/agent-teams support** (auto-spawns child panes for subagents with parent/child navigation and recursive cost aggregation), session groups/folders with collapsible sidebar headers, SSH session management, ctx context database viewer, SQLite session persistence with layout restore, live markdown file viewer with Shiki syntax highlighting, global status bar with cost tracking, toast notifications, settings dialog with theme flavors (Catppuccin Latte/Frappe/Macchiato/Mocha) and live hot-swap, detached pane mode (pop-out windows), pane drag-resize handles, auto-updater plugin with signing key configured, Deno-first sidecar with Node.js fallback, CSS Grid tiling, .deb + AppImage packaging, GitHub Actions CI, 114 vitest + 29 cargo tests. Branch `v2-mission-control`. See [docs/task_plan.md](docs/task_plan.md) for architecture and [docs/phases.md](docs/phases.md) for implementation plan. ![BTerminal](screenshot.png) diff --git a/TODO.md b/TODO.md index 6c2d024..f329e58 100644 --- a/TODO.md +++ b/TODO.md @@ -2,16 +2,16 @@ ## Active -- [ ] **Set TAURI_SIGNING_PRIVATE_KEY secret** -- Private key generated; must be added to GitHub repo settings for auto-update signing to work in CI. - [ ] **Deno sidecar real-world testing** -- Integrated into sidecar.rs (Deno-first + Node.js fallback). Needs testing with real claude CLI and startup time benchmark vs Node.js. - [ ] **E2E testing (Playwright/WebDriver)** -- Scaffold at v2/tests/e2e/README.md. Needs display server to run. Test: open terminal, run command, open agent, verify output. - [ ] **Multi-machine support** -- Remote agents via WebSocket (Phase 7+ feature). - [ ] **Agent Teams real-world testing** -- Frontend routing implemented (Phase 7). Needs testing with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 and real subagent spawning. -- [ ] **Update dispatcher tests for subagent routing** -- New subagent pane spawning and message routing logic in agent-dispatcher.ts not yet covered by tests. -- [ ] **Subagent cost aggregation** -- Aggregate child session costs in parent pane display. ## Completed +- [x] **Set TAURI_SIGNING_PRIVATE_KEY secret** -- Set via `gh secret set` on DexterFromLab/BTerminal. | Done: 2026-03-06 +- [x] **Dispatcher tests for subagent routing** -- 10 new tests covering spawn, dedup, child message routing, init/cost forwarding, fallbacks. Total: 28 dispatcher tests. | Done: 2026-03-06 +- [x] **Subagent cost aggregation** -- `getTotalCost()` recursive helper in agents store, total cost shown in parent pane done-bar when children present. | Done: 2026-03-06 - [x] **Agent Teams frontend support** -- Subagent pane spawning, parent/child navigation, message routing by parentId, SUBAGENT_TOOL_NAMES detection in dispatcher. | Done: 2026-03-06 - [x] **Session groups/folders** -- group_name column in sessions table, setPaneGroup in layout store, collapsible group headers in sidebar, right-click to set group. | Done: 2026-03-06 - [x] **Auto-update signing key** -- Generated minisign keypair, pubkey set in tauri.conf.json. | Done: 2026-03-06