Commit graph

95 commits

Author SHA1 Message Date
Hibryda
3b2c1353fa feat(v3): add global settings section to SettingsTab
Add Global section with theme flavor dropdown, default shell input, and
default CWD input. All settings persisted via settings-bridge. Fix a11y
by using wrapping <label> elements for project fields. Clean up unused
CSS selectors.
2026-03-07 21:31:42 +01:00
Hibryda
6ea1ed1dfd chore(v2): remove dead update_ssh_session method and fix stale comment
- Remove unused SessionDb::update_ssh_session() and its test (SshDialog
  was deleted in P10, this method had no callers)
- Fix stale TilingGrid reference in AgentPane comment
- Eliminates the last Rust compiler warning
2026-03-07 16:51:15 +01:00
Hibryda
67c416dc10 docs: update meta files for v3 Phases 6-10 completion 2026-03-07 16:34:00 +01:00
Hibryda
ab0811ca2b docs(v3): update progress logs and task plan for Phases 6-10 completion 2026-03-07 16:33:54 +01:00
Hibryda
86da302aa6 test(v3): add clearAllAgentSessions mock to workspace store tests 2026-03-07 16:33:47 +01:00
Hibryda
160712de50 refactor(v3): remove dead v2 components and empty directories
Delete 7 components no longer used in v3 Mission Control (~1,836 lines):
TilingGrid, PaneContainer, PaneHeader, SessionList, SshSessionList,
SshDialog, SettingsDialog. Empty directories (Layout/, Sidebar/,
Settings/, SSH/) removed.
2026-03-07 16:33:39 +01:00
Hibryda
e0056f811f feat(v3): implement session continuity, workspace teardown, StatusBar rewrite, subagent routing fix
P6: persistSessionForProject() saves agent state + messages to SQLite on
session complete. registerSessionProject() maps sessionId -> projectId.
ClaudeSession restoreMessagesFromRecords() restores cached messages on mount.

P7: clearAllAgentSessions() clears sessions on group switch. switchGroup()
calls clearAllAgentSessions() + resets terminal tabs.

P10: StatusBar rewritten for workspace store (group name, project count,
agent count, "BTerminal v3"). Subagent routing fixed: project-scoped
sessions skip layout pane creation (render in TeamAgentsPanel instead).
2026-03-07 16:33:27 +01:00
Hibryda
9766a480ed docs: update meta files for v3 Mission Control MVP
- CLAUDE.md: add v3 key paths, update overview and test counts
- .claude/CLAUDE.md: add v3 constraints and Svelte 5 event syntax note
- README.md: update description for v3 MVP status
- TODO.md: move v3 planning to completed, add Phases 6-10 active items
- CHANGELOG.md: add v3 MVP entries under Unreleased
2026-03-07 16:06:39 +01:00
Hibryda
4f29582aac docs(v3): update architecture docs and progress for MVP completion
- v3-task_plan.md: mark Phases 1-5 complete, update adversarial review
  results with 12 resolved issues, finalize component tree and layout
- v3-findings.md: add adversarial review agent findings
- v3-progress.md: document Phases 1-5 implementation details
- progress.md: add v3 MVP session entry
- docs/README.md: reorganize with v2/v3 sections
2026-03-07 16:06:27 +01:00
Hibryda
a11e7f9d2c test(v3): add workspace store tests (24 tests)
Tests for loadGroups, setActiveGroup, setActiveTab, focusProject,
resetWorkspace, derived state (activeGroup, activeProjects), and
edge cases. All 138 vitest + 36 cargo tests pass.
2026-03-07 16:06:17 +01:00
Hibryda
ab79dac4b3 feat(v3): implement Mission Control MVP (Phases 1-5)
Phase 1: Data model - groups.rs (Rust structs + load/save groups.json),
groups.ts (TypeScript interfaces), groups-bridge.ts (IPC adapter),
workspace.svelte.ts (replaces layout store), SQLite migrations
(agent_messages, project_agent_state tables, project_id column),
--group CLI argument.

Phase 2: Project shell layout - GlobalTabBar, ProjectGrid, ProjectBox,
ProjectHeader, CommandPalette, DocsTab, ContextTab, SettingsTab,
App.svelte full rewrite (no sidebar/TilingGrid).

Phase 3: ClaudeSession.svelte wrapping AgentPane per-project.
Phase 4: TerminalTabs.svelte with shell/SSH/agent tab types.
Phase 5: TeamAgentsPanel + AgentCard for compact subagent view.

Also fixes AgentPane Svelte 5 event modifier (on:click -> onclick).
2026-03-07 16:06:07 +01:00
Hibryda
293bed6dc5 docs: update meta files for v3 Mission Control planning
Add v3 doc references to CLAUDE.md, .claude/CLAUDE.md, README.md, and
docs index. Add v3 planning TODOs. Update progress log with v3 session.
Update CHANGELOG with v3 planning entry. Trim oldest completed TODOs.
2026-03-07 15:23:03 +01:00
Hibryda
03e9f34e07 docs(v3): add Mission Control redesign planning docs
v3 architecture planning: task plan with core concept, user requirements,
and architecture questions for adversarial review. Findings doc with
codebase reuse analysis (keep/replace/drop). Progress log for v3 sessions.
2026-03-07 15:22:55 +01:00
Hibryda
761070251f fix(v2): default systemPrompt to claude_code preset for CLAUDE.md loading
Without the preset, settingSources loads files but the system prompt has
no slot to inject CLAUDE.md content. The claude_code preset enables the
full Claude Code system prompt including project instructions.
2026-03-07 01:59:51 +01:00
Hibryda
17c5f9b88a docs: update meta files for Claude profiles, skill discovery, and extended agent options 2026-03-07 01:58:37 +01:00
Hibryda
ff49e7e176 feat(v2): add Claude profile switching, skill discovery, and extended agent options
Add switcher-claude multi-account support with profile selector in AgentPane
toolbar, skill autocomplete menu (type / in prompt), and 5 new AgentQueryOptions
fields (setting_sources, system_prompt, model, claude_config_dir,
additional_directories) flowing through full stack from Rust to SDK.

New Tauri commands: claude_list_profiles, claude_list_skills, claude_read_skill,
pick_directory. New frontend adapter: claude-bridge.ts.
2026-03-07 01:58:29 +01:00
Hibryda
768db420d3 docs: update meta files for Claude CLI path detection and split progress log
- Added pathToClaudeCodeExecutable and findClaudeCli() docs to CLAUDE.md,
  .claude/CLAUDE.md, task_plan.md decisions log, and CHANGELOG.md
- Split docs/progress.md (425 lines) into progress.md (153 lines) +
  progress-archive.md (180 lines) to stay under 300-line threshold
- Updated docs/README.md, README.md with archive file reference
- Updated TODO.md with completed items from this session
2026-03-07 01:28:13 +01:00
Hibryda
d35b3dc7fc feat(v2): auto-detect Claude CLI path and pass to SDK via pathToClaudeCodeExecutable
Both sidecar runners (agent-runner.ts and agent-runner-deno.ts) now include
findClaudeCli() which checks common paths (~/.local/bin/claude,
~/.claude/local/claude, /usr/local/bin/claude, /usr/bin/claude) and falls
back to `which claude`. The resolved path is passed to the SDK query()
options as pathToClaudeCodeExecutable. If the CLI is not found, an
agent_error is emitted immediately instead of a cryptic SDK failure.
2026-03-07 01:28:04 +01:00
Hibryda
14b62da729 docs: update meta files for Rust-side CLAUDE* env var stripping
- .claude/CLAUDE.md: document dual-layer env var stripping (Rust + JS)
- docs/progress.md: add session entry for Rust-side stripping
- docs/task_plan.md: add CLAUDE* env var leak to errors table
- CHANGELOG.md: add fix entry under Unreleased
- .gitignore: exclude debug/, plugins/, projects/ (Claude Code working dirs)
2026-03-07 01:15:10 +01:00
Hibryda
a3d9933221 fix(v2): strip CLAUDE* env vars at Rust level in SidecarManager
Add env_clear() + envs(clean_env) to Command in SidecarManager to
filter all CLAUDE-prefixed environment variables before spawning the
sidecar process. This provides primary defense against SDK nesting
detection when BTerminal is launched from a Claude Code terminal.
The JS-side stripping via SDK env option is retained as defense-in-depth.
2026-03-07 01:15:01 +01:00
Hibryda
f97e7391a9 docs: update meta files for unified sidecar bundle
Updated all docs, CLAUDE.md files, README, and CHANGELOG to reflect
the consolidated sidecar approach (single agent-runner.mjs for both
Deno and Node.js). Removed references to agent-runner-deno.ts as
active runner. Added progress log entry for 2026-03-07 session.
2026-03-07 01:07:13 +01:00
Hibryda
2409642925 refactor(v2): unify sidecar to single agent-runner.mjs bundle
Consolidated from two separate runners (agent-runner-deno.ts +
agent-runner.ts) to a single pre-built agent-runner.mjs that runs
under both Deno and Node.js. resolve_sidecar_command() now checks
runtime availability upfront before path search, with improved
error messages. Removed agent-runner-deno.ts from tauri.conf.json
bundled resources.
2026-03-07 01:07:06 +01:00
Hibryda
658dc4715e docs: update meta files for permission mode, agent stop-on-close fix, SDK bundling 2026-03-06 23:34:09 +01:00
Hibryda
e7c957d650 docs: update docs for permission mode, agent stop-on-close fix, SDK bundling 2026-03-06 23:34:00 +01:00
Hibryda
d5eb08ed42 feat(v2): add permission mode passthrough and fix agent stop-on-close
- Add permission_mode field to AgentQueryOptions (Rust, sidecar, bridge)
  flowing from controller through sidecar to SDK; defaults to
  bypassPermissions, supports default mode
- Fix AgentPane onDestroy bug: remove stopAgent() from onDestroy (fires
  on layout remounts), move stop-on-close to TilingGrid onClose handler
- Bundle SDK into sidecar via esbuild (remove --external flag)
2026-03-06 23:33:51 +01:00
Hibryda
af0eb362e6 docs: update meta files for SDK migration and AgentPane onDestroy bug 2026-03-06 22:57:55 +01:00
Hibryda
bb530edd28 docs: update docs for sidecar SDK migration and AgentPane bug discovery 2026-03-06 22:57:47 +01:00
Hibryda
323703caba feat(v2): migrate sidecar from raw CLI spawning to @anthropic-ai/claude-agent-sdk
Claude CLI v2.1.69 hangs silently when spawned via child_process.spawn()
with piped stdio (known bug github.com/anthropics/claude-code/issues/6775).

Replace raw CLI spawning in both sidecar runners with the SDK's query()
function, which handles subprocess management internally. SDK message
format matches CLI stream-json, so the sdk-messages.ts adapter is
unchanged.

- agent-runner.ts: use SDK query() with AbortController for stop
- agent-runner-deno.ts: use npm:@anthropic-ai/claude-agent-sdk import
- sidecar.rs: add --allow-write and --allow-net Deno permissions
- package.json: add @anthropic-ai/claude-agent-sdk ^0.2.70, build:sidecar script
2026-03-06 22:57:36 +01:00
Hibryda
fdd1884015 docs: update meta files for CLAUDE* env var fix and sidecar constraint 2026-03-06 22:12:23 +01:00
Hibryda
ce79ae671a fix(v2): strip all CLAUDE* env vars in sidecar to prevent CLI nesting detection
When BTerminal is launched from a Claude Code terminal, ~8 CLAUDE*
env vars leak into the sidecar child processes. The claude CLI detects
these as nesting indicators and silently hangs. Previously only
CLAUDECODE was removed; now all CLAUDE-prefixed vars are stripped
in both Node.js and Deno sidecar runners.
2026-03-06 22:12:16 +01:00
Hibryda
4c06b5f121 docs: update docs for TCP probe refactor and frontend reconnection listeners
Replace stale attempt_ws_connect() references with attempt_tcp_probe()
across all docs. Add progress entry for reconnection hardening session.
Update CHANGELOG with new entries and probe refactor change.
2026-03-06 21:50:54 +01:00
Hibryda
71100da125 feat(v2): refactor reconnection probe to TCP-only and add frontend listeners
Replace attempt_ws_connect() with attempt_tcp_probe() in RemoteManager to
avoid allocating per-connection resources (PtyManager, SidecarManager) on
the relay during reconnection probes. Add onRemoteMachineReconnecting and
onRemoteMachineReconnectReady event listeners in remote-bridge.ts. Wire
machines store to auto-reconnect when relay becomes reachable.
2026-03-06 21:50:45 +01:00
Hibryda
218570ac35 docs: update docs for relay hardening, reconnection, and session wrap
Update multi-machine docs with reconnection implementation details,
command response propagation, and pty_created confirmation flow.
Mark reconnection as complete in phases.md, progress.md, TODO.md.
Update CLAUDE.md files with reconnection and relay response info.
Add CHANGELOG entries for new features.
2026-03-06 19:49:28 +01:00
Hibryda
b0cce7ae4f feat(v2): add relay response propagation and reconnection with exponential backoff
Relay (bterminal-relay): command handlers now send structured responses
(pty_created, pong, error) back via shared event channel with commandId
for correlation. New send_error() helper replaces log-only error
reporting.

RemoteManager (remote.rs): exponential backoff reconnection on
disconnect (1s/2s/4s/8s/16s/30s cap). Uses attempt_ws_connect() probe
with 5s timeout. Emits remote-machine-reconnecting and
remote-machine-reconnect-ready events. Handles pty_created relay event
as remote-pty-created Tauri event.
2026-03-06 19:49:19 +01:00
Hibryda
0a17c09a46 docs: update docs for multi-machine implementation (Phases A-D)
Update phases.md with completed multi-machine phases A-D. Add session
entry to progress.md. Update task_plan.md decisions log and open
questions. Update multi-machine.md status to implemented. Update
CLAUDE.md files with new paths and deps. Add multi-machine section to
README.md. Mark multi-machine as done in TODO.md with new follow-up
items. Add changelog entries for all multi-machine components.
2026-03-06 19:06:00 +01:00
Hibryda
5503340e87 feat(v2): add frontend remote machine integration
remote-bridge.ts adapter for machine management IPC. machines.svelte.ts
store for remote machine state. Layout store extended with
remoteMachineId on Pane interface. agent-bridge.ts and pty-bridge.ts
route to remote commands when remoteMachineId is set. SettingsDialog
gains Remote Machines section. Sidebar auto-groups remote panes by
machine label.
2026-03-06 19:05:53 +01:00
Hibryda
0b39133d66 feat(v2): add RemoteManager for multi-machine WebSocket connections
New remote.rs module in src-tauri with WebSocket client connections to
bterminal-relay instances. Machine lifecycle: add/remove/connect/
disconnect. 12 new Tauri commands for remote operations. Heartbeat
ping every 15s. lib.rs updated with remote commands and AppState.
2026-03-06 19:05:47 +01:00
Hibryda
cf37b572cf feat(v2): add bterminal-relay WebSocket server binary
Standalone Rust binary for remote machine management. WebSocket server
with token auth (--port, --token, --insecure CLI flags via clap).
Routes RelayCommand to PtyManager/SidecarManager from bterminal-core,
forwards RelayEvent over WebSocket. Rate limiting on auth failures
(10 attempts, 5min lockout). Per-connection isolated managers.
2026-03-06 19:05:42 +01:00
Hibryda
f894c2862c refactor(v2): extract bterminal-core crate with EventSink trait
Create Cargo workspace at v2/ level with members: src-tauri,
bterminal-core, bterminal-relay. Extract PtyManager and SidecarManager
into shared bterminal-core crate with EventSink trait for abstracting
event emission. TauriEventSink wraps AppHandle. src-tauri pty.rs and
sidecar.rs become thin re-exports. Move Cargo.lock to workspace root.
Add v2/target/ to .gitignore.
2026-03-06 19:05:35 +01:00
Hibryda
250ea17d3e chore: update meta files for multi-machine architecture session 2026-03-06 18:46:03 +01:00
Hibryda
04a7a4bb94 docs: add multi-machine support architecture design
Full WebSocket architecture spec for remote agent/terminal management:
bterminal-relay binary, RemoteManager, NDJSON protocol, pre-shared
token + TLS auth, 4-phase implementation plan (A-D).
2026-03-06 18:45:56 +01:00
Hibryda
86fbe3e762 chore: update meta files for subagent cost and dispatcher tests session 2026-03-06 17:12:58 +01:00
Hibryda
fc429a5095 docs: update docs for subagent cost aggregation, dispatcher tests, Phase 7 complete 2026-03-06 17:12:52 +01:00
Hibryda
097b4b2ee7 test(v2): add 10 subagent routing tests for agent dispatcher
Tests cover: spawn on Agent/Task tool_call, skip non-subagent tools,
deduplicate panes for same toolUseId, reuse existing child sessions,
route child messages/init/cost by parentId, fallback titles and groups.
Total: 28 dispatcher tests, 114 vitest tests overall.
2026-03-06 17:12:43 +01:00
Hibryda
90efeea507 feat(v2): add recursive subagent cost aggregation in agent store and pane
getTotalCost() recursively aggregates costUsd, inputTokens, outputTokens
across parent and all child sessions. AgentPane done-bar displays total
cost in yellow when children are present and total exceeds parent cost.
2026-03-06 17:12:31 +01:00
Hibryda
b7f77d8f60 chore: update meta files for agent teams session work 2026-03-06 16:54:46 +01:00
Hibryda
a34687f844 docs: update docs for Phase 7 agent teams and subagent support 2026-03-06 16:54:35 +01:00
Hibryda
07fc52b958 feat(v2): add agent teams support with subagent pane spawning and routing
Detect subagent tool_call events (Agent/Task/dispatch_agent), auto-spawn
child agent panes with parent/child navigation. Messages with parentId
are routed to child panes; parent session keeps its own messages.

- agents.svelte.ts: parent/child hierarchy fields, findChildByToolUseId,
  getChildSessions, parent-aware createAgentSession/removeAgentSession
- agent-dispatcher.ts: SUBAGENT_TOOL_NAMES detection, toolUseToChildPane
  routing map, spawnSubagentPane with auto-grouping under parent title
- AgentPane.svelte: parent link bar (SUB badge), children bar (chips
  with status colors), clickable navigation between parent/child
- SessionList.svelte: subagent panes show arrow icon instead of asterisk
2026-03-06 16:54:27 +01:00
Hibryda
d021061b8a docs: update all docs for session groups, Deno sidecar, signing key, and tests
Update progress log, phases, task_plan decisions, CLAUDE.md files,
README, TODO, and CHANGELOG to reflect session groups, Deno-first
sidecar integration, auto-update signing key, and 104-test suite.
2026-03-06 15:42:44 +01:00
Hibryda
020dc20d4f test(v2): add integration tests for layout, agent-bridge, and dispatcher
Add 59 new vitest tests: layout.test.ts (30), agent-bridge.test.ts (11),
agent-dispatcher.test.ts (18). Fix unused import in sdk-messages.test.ts.
Add WebDriver E2E scaffold README. Total: 104 vitest + 29 cargo tests.
2026-03-06 15:42:34 +01:00