Compare commits

...

10 commits

Author SHA1 Message Date
Hibryda
5d0d5c5f07 chore: rebase hib_changes onto dexter_changes and update migration TODOs 2026-03-13 02:40:42 +01:00
Hibryda
719496853e docs: add migration plan TODOs and update active tasks 2026-03-12 18:23:40 +01:00
Hibryda
92d8ee2c03 chore: add agent-orchestrator submodule for migration analysis 2026-03-12 18:23:40 +01:00
DexterFromLab
09463810c4 Fix terminal scroll behavior and Claude Code tab titles
Disable auto-scroll on output so users can read scrollback without being
jumped to bottom. Keep Claude Code tab names from config instead of
overwriting with generic VTE title.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:17 +01:00
DexterFromLab
5815943861 Update README with full feature coverage
Add Ctx Manager panel, setup wizard, import/export, session colors,
ctx CLI flags (--shared, append, export), and FTS/WAL details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:17 +01:00
DexterFromLab
31fed163d0 Add selective import/export for Ctx Manager with checkbox tree UI
Export dialog lets users pick specific projects, entries, summaries,
and shared context to save as JSON. Import dialog previews file
contents with checkboxes and supports overwrite/skip conflict mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:17 +01:00
DexterFromLab
a7077c7987 Add Ctx Manager panel as new sidebar tab for browsing and editing project contexts
Adds a StackSwitcher to the sidebar with Sessions and Ctx tabs. The Ctx panel
provides a tree view of all ctx projects/entries with a detail preview pane,
CRUD operations (add/edit/delete projects and entries), right-click context
menus, and auto-refresh on tab switch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:17 +01:00
DexterFromLab
f9ec78ce1e Remove shared context from ctx get output to avoid misleading project info
Shared entries (server, webhooks, workflow) were shown for every project,
causing Claude to misattribute them. Now ctx get shows only project-specific
data. Use --shared flag to include shared context when needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:17 +01:00
DexterFromLab
af670871ed Replace ctx auto-setup with step-by-step wizard
- Remove silent setup_ctx and "Edit ctx entries" button from ClaudeCodeDialog
- Add CtxSetupWizard: 3-step guided flow (project registration, first entry, confirm)
- Show ctx status label in session dialog (registered vs new project)
- Launch wizard automatically on save when project_dir is set and ctx not initialized
- Add ctx cleanup prompt when deleting a Claude session
- Extract helper functions: _detect_project_description, _is_ctx_project_registered

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:02:17 +01:00
Hibryda
6938e8c3a9 chore: add nested Claude session E2E TODO + trim completed list 2026-03-12 07:34:40 +01:00
6 changed files with 1699 additions and 97 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "agent-orchestrator"]
path = agent-orchestrator
url = git@github.com:DexterFromLab/agent-orchestrator.git

View file

@ -1,6 +1,6 @@
# BTerminal
Terminal with session panel (MobaXterm-style), built with GTK 3 + VTE. Catppuccin Mocha theme.
GTK 3 terminal with SSH & Claude Code session management, macros, and a cross-session context database. Catppuccin Mocha theme.
> **v2 complete, v3 all phases complete.** v2: Multi-session Claude agent dashboard using Tauri 2.x + Svelte 5. v3: Multi-project mission control dashboard (All Phases 1-10 complete + sidebar redesign) -- project groups with per-project Claude sessions, session continuity (persist/restore agent messages), team agents panel, terminal tabs, **VSCode-style left sidebar** (vertical icon rail + expandable drawer panel + always-visible workspace), command palette with group switching. Features: **project groups** (up to 5 projects per group, horizontal layout, adaptive viewport count), **per-project Claude sessions** with session continuity, **team agents panel** (compact subagent cards), **terminal tabs** (shell/SSH/agent per project), agent panes with structured output, tree visualization with subtree cost and session resume, **subagent/agent-teams support**, **multi-machine support** (bterminal-relay WebSocket server + RemoteManager), **Claude profile/account switching** (switcher-claude integration), **skill discovery and autocomplete** (type `/` in agent prompt), SSH session management, ctx context database viewer, SQLite session persistence with layout restore, live markdown file viewer with Shiki syntax highlighting, 17 themes in 3 groups (4 Catppuccin + 7 Editor + 6 Deep Dark: Tokyo Night, Gruvbox Dark, Ayu Dark, Poimandres, Vesper, Midnight), **global font controls** (separate UI font [sans-serif] + terminal font [monospace] with live preview), .deb + AppImage packaging, GitHub Actions CI, 138 vitest + 36 cargo tests. Branch `v2-mission-control`. See [docs/v3-task_plan.md](docs/v3-task_plan.md) for v3 architecture.
@ -8,14 +8,21 @@ Terminal with session panel (MobaXterm-style), built with GTK 3 + VTE. Catppucci
## Features
- **SSH sessions** — saved configs (host, port, user, key, folder, color), CRUD with side panel
- **Claude Code sessions** — saved Claude Code configs with sudo, resume, skip-permissions and initial prompt
- **SSH macros** — multi-step macros (text, key, delay) assigned to sessions, run from sidebar
- **Tabs** — multiple terminals in tabs, Ctrl+T new, Ctrl+Shift+W close, Ctrl+PageUp/Down switch
- **Sudo askpass** — Claude Code with sudo: password entered once, temporary askpass helper, auto-cleanup
- **Folder grouping** — SSH and Claude Code sessions can be grouped in folders on the sidebar
- **ctx — Context manager** — SQLite-based cross-session context database for Claude Code projects
- **Catppuccin Mocha** — full theme: terminal, sidebar, tabs, session colors
- **SSH sessions** — saved configs (host, port, user, key, folder, color), one-click connect from sidebar
- **Claude Code sessions** — saved configs with sudo askpass, resume, skip-permissions and initial prompt
- **SSH macros** — multi-step automation (text, key press, delay) bound to sessions, runnable from sidebar
- **Tabs** — multiple terminals in tabs with reordering, auto-close and shell respawn
- **Folder grouping** — organize both SSH and Claude Code sessions in collapsible sidebar folders
- **Session colors** — 10 Catppuccin accent colors for quick visual identification
- **Sudo askpass** — temporary helper for Claude Code sudo mode: password entered once, auto-cleanup on exit
- **Catppuccin Mocha** — full theme across terminal, sidebar, tabs, dialogs and scrollbars
### Context Manager
- **ctx CLI** — SQLite-based tool for persistent context across Claude Code sessions
- **Ctx Manager panel** — sidebar tab for browsing, editing and managing all project contexts
- **Ctx Setup Wizard** — step-by-step project setup with auto-detection from README and CLAUDE.md generation
- **Import / Export** — selective import and export of projects, entries, summaries and shared context via JSON with checkbox tree UI
## Installation
@ -30,7 +37,7 @@ The installer will:
2. Copy files to `~/.local/share/bterminal/`
3. Create symlinks: `bterminal` and `ctx` in `~/.local/bin/`
4. Initialize context database at `~/.claude-context/context.db`
5. Add desktop entry to application menu
5. Add desktop entry and icon to application menu
### v2 Installation (Tauri — build from source)
@ -60,23 +67,37 @@ bterminal
## Context Manager (ctx)
`ctx` is a SQLite-based tool for managing persistent context across Claude Code sessions.
`ctx` is a SQLite-based tool for managing persistent context across Claude Code sessions. It uses FTS5 full-text search and WAL journal mode.
```bash
ctx init myproject "Project description" /path/to/project
ctx get myproject # Load full context (shared + project)
ctx get myproject # Load project context
ctx get myproject --shared # Include shared context
ctx set myproject key "value" # Save a context entry
ctx shared set preferences "value" # Save shared context (available in all projects)
ctx append myproject key "more" # Append to existing entry
ctx shared set preferences "value" # Save shared context (all projects)
ctx summary myproject "What was done" # Save session summary
ctx search "query" # Full-text search across everything
ctx list # List all projects
ctx history myproject # Show session history
ctx export # Export all data as JSON
ctx delete myproject [key] # Delete project or entry
ctx --help # All commands
```
### Ctx Manager Panel
The sidebar **Ctx** tab provides a GUI for the context database:
- Browse all projects and their entries in a tree view
- View entry values and project details in the detail pane
- Add, edit and delete projects and entries
- **Export** — select specific projects, entries, summaries and shared context to save as JSON
- **Import** — load a JSON file, preview contents with checkboxes, optionally overwrite existing entries
### Integration with Claude Code
Add a `CLAUDE.md` to your project root:
Add a `CLAUDE.md` to your project root (the Ctx Setup Wizard can generate this automatically):
```markdown
On session start, load context:
@ -94,8 +115,8 @@ Config files in `~/.config/bterminal/`:
| File | Description |
|------|-------------|
| `sessions.json` | Saved SSH sessions + macros |
| `claude_sessions.json` | Saved Claude Code configs |
| `sessions.json` | SSH sessions and macros |
| `claude_sessions.json` | Claude Code session configs |
Context database: `~/.claude-context/context.db`

10
TODO.md
View file

@ -2,12 +2,18 @@
## Active
### Migration to agent-orchestrator
- [ ] **Review Dexter's 13 feature commits** -- hib_changes rebased onto dexter_changes (55ba8d0). Need to review: Aider provider, splash screen, provider/model unification, Tier 2 btmsg access, auto-wake on btmsg. Then push hib_changes and start working from agent-orchestrator repo.
- [ ] **CLAUDE.md Commit Zero** -- Update agent-orchestrator's CLAUDE.md to reflect rebrand + new features. Update docs/ accordingly.
- [ ] **Switch primary development to agent-orchestrator** -- After review + CLAUDE.md update, develop on hib_changes in agent-orchestrator. BTerminal repo stays for v1 production only.
### v3.1 Remaining
- [ ] **Multi-machine real-world testing** -- TLS added to relay. Needs real 2-machine test. Multi-machine UI not surfaced in v3, code exists in bridges/stores only.
- [ ] **Certificate pinning** -- TLS encryption done (v3.0). Pin cert hash in RemoteManager for v3.1.
- [ ] **Agent Teams real-world testing** -- Subagent delegation prompt fix done + env var injection. Needs real multi-agent session to verify Manager spawns child agents.
- [ ] **Plugin sandbox migration** -- `new Function()` has inherent escape vectors (prototype walking, arguments.callee.constructor). Consider Web Worker isolation for v3.2.
- [ ] **Soak test** -- Run 4-hour soak with 6+ agents across 3+ projects. Monitor memory, SQLite WAL size, xterm.js instances.
- [ ] **E2E agent tests hang in nested Claude sessions** -- B4/B5 phase-b tests timeout when run from within a Claude Code session (sidecar spawns Claude CLI which hangs in git repo context). Works in CI. Investigate process isolation or session nesting guard.
## Completed
@ -20,7 +26,3 @@
- [x] **Reviewer agent role** -- Tier 1 specialist with role='reviewer'. Reviewer workflow in agent-prompts.ts (8-step process). #review-queue/#review-log auto-channels. reviewQueueDepth in attention scoring (10pts/task, cap 50). 388 vitest + 76 cargo. | Done: 2026-03-12
- [x] **Auto-wake Manager** -- wake-scheduler.svelte.ts + wake-scorer.ts (24 tests). 3 strategies: persistent/on-demand/smart. 6 signals. Settings UI. 381 vitest + 72 cargo. | Done: 2026-03-12
- [x] **Dashboard metrics panel** -- MetricsPanel.svelte: live health + task board summary + SVG sparkline history. 25 tests. 357 vitest + 72 cargo. | Done: 2026-03-12
- [x] **Brand Dexter's new types (SOLID Phase 3b)** -- GroupId + AgentId branded types. Applied to ~40 sites. 332 vitest + 72 cargo. | Done: 2026-03-11
- [x] **Regression tests + sidecar env security** -- 49 new tests. Added ANTHROPIC_* to Rust env strip. 327 vitest + 72 cargo. | Done: 2026-03-11
- [x] **Integrate dexter_changes + fix 5 critical bugs** -- Fixed: btmsg.rs column index, btmsg-bridge camelCase, GroupAgentsPanel stopPropagation, ArchitectureTab PlantUML, TestingTab Tauri 2.x. | Done: 2026-03-11
- [x] **SOLID Phase 3 — Primitive obsession** -- Branded types SessionId/ProjectId. Applied to ~130 sites. 293 vitest + 49 cargo. | Done: 2026-03-11

1
agent-orchestrator Submodule

@ -0,0 +1 @@
Subproject commit 55ba8d0969b4c9e34e47fe621ea4812528441365

File diff suppressed because it is too large Load diff

27
ctx
View file

@ -103,19 +103,18 @@ def cmd_init(args):
def cmd_get(args):
"""Get full context for a project (shared + project-specific + recent summaries)."""
"""Get full context for a project (project-specific + recent summaries).
Use --shared flag to also include shared context."""
if len(args) < 1:
print("Usage: ctx get <project>")
print("Usage: ctx get <project> [--shared]")
sys.exit(1)
project = args[0]
show_shared = "--shared" in args
db = get_db()
# Session info
session = db.execute("SELECT * FROM sessions WHERE name = ?", (project,)).fetchone()
# Shared context
shared = db.execute("SELECT key, value FROM shared ORDER BY key").fetchall()
# Project context
contexts = db.execute(
"SELECT key, value FROM contexts WHERE project = ? ORDER BY key", (project,)
@ -137,11 +136,13 @@ def cmd_get(args):
print(f"PROJECT: {project} (not registered, use: ctx init)")
print("=" * 60)
if shared:
print("\n--- Shared Context ---")
for row in shared:
print(f"\n[{row['key']}]")
print(row["value"])
if show_shared:
shared = db.execute("SELECT key, value FROM shared ORDER BY key").fetchall()
if shared:
print("\n--- Shared Context ---")
for row in shared:
print(f"\n[{row['key']}]")
print(row["value"])
if contexts:
print(f"\n--- {project} Context ---")
@ -155,8 +156,8 @@ def cmd_get(args):
print(f"\n[{row['created_at']}]")
print(row["summary"])
if not shared and not contexts and not summaries:
print("\nNo context stored yet. Use 'ctx set' or 'ctx shared set' to add.")
if not contexts and not summaries:
print("\nNo context stored yet. Use 'ctx set' to add project context.")
db.close()
@ -444,7 +445,7 @@ def print_help():
print("ctx — Cross-session context manager for Claude Code\n")
print("Commands:")
print(" init <project> <desc> [dir] Register a new project")
print(" get <project> Load full context (shared + project)")
print(" get <project> [--shared] Load project context (optionally with shared)")
print(" set <project> <key> <value> Set project context entry")
print(" append <project> <key> <val> Append to existing entry")
print(" shared get|set|delete Manage shared context")