From 250ea17d3ef5927efef9d06e2b6ebf3c8dee09a3 Mon Sep 17 00:00:00 2001 From: Hibryda Date: Fri, 6 Mar 2026 18:46:03 +0100 Subject: [PATCH] chore: update meta files for multi-machine architecture session --- CHANGELOG.md | 1 + CLAUDE.md | 1 + README.md | 1 + docs/README.md | 1 + docs/phases.md | 12 ++++++++++++ docs/progress.md | 14 +++++++++++++- 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bae0f69..53a9ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Multi-machine support architecture design (`docs/multi-machine.md`): bterminal-relay binary, WebSocket NDJSON protocol, RemoteManager, pre-shared token + TLS auth, autonomous relay model, 4-phase implementation plan (A: extract bterminal-core crate, B: relay binary, C: RemoteManager, D: frontend integration) - 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 diff --git a/CLAUDE.md b/CLAUDE.md index 52601dd..df80f96 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -25,6 +25,7 @@ Terminal emulator with SSH and Claude Code session management. v1 (GTK3+VTE Pyth | `docs/phases.md` | v2 implementation phases (1-7) | | `docs/findings.md` | v2 research findings | | `docs/progress.md` | Session progress log | +| `docs/multi-machine.md` | Multi-machine architecture (WebSocket relay, 4-phase plan) | | `v2/src-tauri/src/pty.rs` | PTY backend (portable-pty, PtyManager) | | `v2/src-tauri/src/lib.rs` | Tauri commands (pty + agent + session + file + settings) | | `v2/src-tauri/src/sidecar.rs` | SidecarManager (Deno-first + Node.js fallback, SidecarCommand, NDJSON) | diff --git a/README.md b/README.md index e017533..c22b1e9 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ Context database: `~/.claude-context/context.db` | [docs/phases.md](docs/phases.md) | v2 implementation phases (1-7) with checklists | | [docs/findings.md](docs/findings.md) | Research findings (Agent SDK, Tauri, xterm.js, performance) | | [docs/progress.md](docs/progress.md) | Session-by-session progress log | +| [docs/multi-machine.md](docs/multi-machine.md) | Multi-machine architecture (WebSocket relay, remote agents) | ## License diff --git a/docs/README.md b/docs/README.md index 68f1412..502431a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,3 +20,4 @@ Project documentation lives here. | [phases.md](phases.md) | v2 implementation phases (1-7) with checklists | | [findings.md](findings.md) | Research findings (Agent SDK, Tauri, xterm.js, performance) | | [progress.md](progress.md) | Session-by-session progress log | +| [multi-machine.md](multi-machine.md) | Multi-machine support architecture (WebSocket, relay binary) | diff --git a/docs/phases.md b/docs/phases.md index f3fdb87..8c1bb68 100644 --- a/docs/phases.md +++ b/docs/phases.md @@ -251,3 +251,15 @@ bterminal-v2/ - Rust 1.77+ (for building from source) - WebKit2GTK 4.1+ (Tauri runtime) - Linux x86_64 (primary target) + +--- + +## Future: Multi-Machine Support [status: designed] + +Architecture designed in [multi-machine.md](multi-machine.md). Extends BTerminal to manage agents and terminals on remote machines over WebSocket. + +### Implementation Phases (A-D) +- [ ] **Phase A:** Extract `bterminal-core` crate (PtyManager + SidecarManager shared code) +- [ ] **Phase B:** Build `bterminal-relay` binary (WebSocket server, token auth, CLI flags) +- [ ] **Phase C:** Add `RemoteManager` to controller (remote.rs, WebSocket client connections) +- [ ] **Phase D:** Frontend integration (bridge adapters with remoteMachineId routing, machine management UI) diff --git a/docs/progress.md b/docs/progress.md index 9ff9620..fbdabdb 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -252,8 +252,20 @@ Design: No separate sidecar process per subagent. Parent's sidecar handles all; #### 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 + ### Next Steps - [ ] Deno sidecar: test with real claude CLI, benchmark startup time vs Node.js - [ ] E2E testing with Playwright/WebDriver (when display server available) -- [ ] Multi-machine support (remote agents via WebSocket) +- [ ] Multi-machine Phase A: extract bterminal-core crate - [ ] Test agent teams with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1