Feat/desktop#13
Open
Fiooodooor wants to merge 2 commits into
Open
Conversation
Bundle the React app under dashboard/ (Vite → clawteam/board/static). Electron main process auto-spawns `clawteam board serve` on launch and tears it down on quit; renderer loads the board over HTTP so /api and SSE stay same-origin in both dev and prod. Profile wizard mirrors `clawteam profile wizard`: pick a client, then pick a compatible preset (`clawteam preset list`), then generate via `clawteam preset generate-profile`. An advanced editor still exposes raw AgentProfile fields for custom endpoints. Settings popover: runtime version + install/upgrade prompts + launch targets (Terminal, iTerm2, Ghostty, VS Code, Cursor) with real client icons. Backend changes: - board/server.py — SPA fallback + path-traversal protection. - board/collector.py — expose spawn registry as `sessions` per team. - board/runtime.py — PyPI version probe for in-app upgrade prompts. .gitignore — exclude Vite build output, Electron release artifacts, and AnyFS workspace snapshots. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a new desktop-focused dashboard experience (React/Vite + Electron) and expands ClawTeam’s runtime coordination by adding session capture/resume metadata and an optional Redis wakeup mechanism, along with watcher logic to proactively notify leaders of state changes.
Changes:
- Added a new React/Vite dashboard (built into
clawteam/board/static) and an Electron host app with IPC endpoints for runtime install/upgrade, profiles/presets, and session launching. - Implemented native-client session capture/resume plumbing across spawn backends plus new session locators (claude/codex/gemini/opencode/openclaw/nanobot).
- Added an optional Redis-based wakeup layer and a
team watchleader watcher, plus new/updated tests for these behaviors.
Reviewed changes
Copilot reviewed 37 out of 49 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_session_capture.py | New tests for session capture/locator behaviors and resume command building. |
| tests/test_leader_watcher.py | New tests for leader watcher injection/deduping and redis off mode. |
| tests/test_board.py | Extends board tests for sessions exposure, static path hardening, and runtime status. |
| scripts/run_board.mjs | Node script to run the board server from a local clawteam installation. |
| scripts/install_clawteam.sh | User-level installer for PyPI clawteam into ~/.clawteam/.venv. |
| scripts/clawteam_local_install | Local editable install helper for this repo checkout into ~/.clawteam/.venv. |
| pyproject.toml | Adds optional redis extra dependency. |
| package.json | Adds dashboard/electron dev scripts and Electron toolchain deps. |
| desktop/electron/preload.cjs | Exposes a constrained IPC bridge API to the renderer. |
| desktop/electron/main.mjs | Electron main process: board manager, runtime install/upgrade, profiles/presets, session openers. |
| dashboard/vite.config.mjs | Vite config for dashboard build output into clawteam/board/static. |
| dashboard/src/styles.css | Dashboard styling (new UI theme/layout). |
| dashboard/src/main.jsx | React entrypoint for the dashboard. |
| dashboard/src/App.jsx | Main dashboard UI: board, sessions, profiles/presets wizard, runtime settings popover. |
| dashboard/src/api.js | API wrapper for web vs desktop IPC-backed calls + SSE subscription. |
| dashboard/index.html | Vite dashboard HTML entry. |
| clawteam/team/redis_wakeup.py | New optional Redis wakeup module (auto/off/url) + publish/subscribe helpers. |
| clawteam/team/mailbox.py | Publishes best-effort wakeup events on inbox send/broadcast. |
| clawteam/team/leader_watcher.py | New leader watcher loop with polling/redis subscription and injection fallback to inbox. |
| clawteam/store/file.py | Publishes wakeup events on task create/update. |
| clawteam/spawn/wsh_backend.py | Adds session capture persistence integration to WSH spawning. |
| clawteam/spawn/tmux_backend.py | Adds session capture persistence integration to tmux spawning. |
| clawteam/spawn/subprocess_backend.py | Adds session capture persistence integration to subprocess spawning. |
| clawteam/spawn/session_locators/opencode.py | New OpenCode session locator. |
| clawteam/spawn/session_locators/openclaw.py | New OpenClaw session locator. |
| clawteam/spawn/session_locators/nanobot.py | New Nanobot session locator. |
| clawteam/spawn/session_locators/gemini.py | New Gemini session locator. |
| clawteam/spawn/session_locators/codex.py | New Codex session locator + discovery helper. |
| clawteam/spawn/session_locators/claude.py | New Claude Code session locator (supports generated/provided/resume). |
| clawteam/spawn/session_locators/base.py | Shared locator types/utilities (hints, timestamps, recent files). |
| clawteam/spawn/session_locators/init.py | Locator registry + lookup helpers. |
| clawteam/spawn/session_capture.py | Facade for prepare/persist session capture + resume command builder. |
| clawteam/cli/commands.py | Adds team watch, expands session save/show/list metadata, improves resume command logic. |
| clawteam/board/static/index.html | Replaces legacy static UI with Vite-built dashboard shell. |
| clawteam/board/server.py | Adds runtime status API, SPA static serving w/ traversal guard, and index fallback. |
| clawteam/board/runtime.py | New runtime status helper (installed/current/latest/upgrade available). |
| clawteam/board/collector.py | Adds spawn/session registry data into team payload. |
| .gitignore | Ignores Vite build assets dir + electron output dirs and local snapshots. |
Comment on lines
+7
to
+8
| <script type="module" crossorigin src="./assets/index-BfEdPshz.js"></script> | ||
| <link rel="stylesheet" crossorigin href="./assets/index-fc9g6V4N.css"> |
| except Exception as e: | ||
| self.send_error(500, str(e)) | ||
| elif self._static_exists(path.strip("/")): | ||
| self._serve_static(path.strip("/")) |
Comment on lines
215
to
221
| content = filepath.read_bytes() | ||
| content_type = mimetypes.guess_type(filepath.name)[0] or "application/octet-stream" | ||
| if filepath.suffix == ".js": | ||
| content_type = "text/javascript" | ||
| self.send_response(200) | ||
| self.send_header("Content-Type", f"{content_type}; charset=utf-8") | ||
| self.send_header("Content-Length", str(len(content))) |
| import os from "node:os"; | ||
| import path from "node:path"; | ||
|
|
||
| const REPO_ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname), ".."); |
Comment on lines
+177
to
+185
| completed = [t for t in tasks if t.status == TaskStatus.completed] | ||
| blocked = [t for t in tasks if t.status == TaskStatus.blocked] | ||
| in_progress = [t for t in tasks if t.status == TaskStatus.in_progress] | ||
| pending = [t for t in tasks if t.status == TaskStatus.pending] | ||
| return { | ||
| "total": len(tasks), | ||
| "completed": [_task_ref(t) for t in completed], | ||
| "blocked": [_task_ref(t) for t in blocked], | ||
| "inProgress": [_task_ref(t) for t in in_progress], |
| CurrentSessionHint, | ||
| PreparedSession, | ||
| SessionContext, | ||
| discover_codex_session, |
| import json | ||
| import shutil | ||
| import subprocess | ||
| from pathlib import Path |
Comment on lines
+214
to
+219
| webPreferences: { | ||
| preload: path.join(__dirname, "preload.cjs"), | ||
| contextIsolation: true, | ||
| nodeIntegration: false, | ||
| sandbox: false, | ||
| }, |
Comment on lines
+269
to
273
| prepared = self._adapter.prepare_command( | ||
| session_capture.command, | ||
| prompt=None, | ||
| cwd=cwd, | ||
| skip_permissions=skip_permissions, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change Type
Scope
NIC Porting Context (if applicable)
Gate Checklist (NIC porting PRs)
Linked Issue/PR
Root Cause / Regression History (if applicable)
Risk Register Impact
Regression Test Plan
For bug fixes, name the test(s) that would have caught this. For porting slices,
list the TDD tests that validate the change. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.