Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ build/
dist/
eggs/
.sisyphus/
node_modules/
out/
vscode-extension/.vscode-test/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
77 changes: 76 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,74 @@ http://localhost:8080/myproject/session

Open `http://localhost:8080/` in a browser to see a live table of all discovered backends with their status, domains, and links.

## Browser Dashboard

The browser dashboard is served from the control plane root (`/`) and uses
control-plane APIs directly.

### Quick start

```bash
go run . --port 8080 ~/my-projects
```

Then open:

```text
http://localhost:8080/
```

### Features

- Session list and actions (`ATTACH`, `STOP`, `START`, `DEL`)
- SSE-driven status updates from `/api/events`
- Terminal attach via `/ws/terminal/{session-id}`
- Terminal scrollback hydration via `/api/sessions/{id}/scrollback`
- Chat panel streaming via `/api/sessions/{id}/chat`

### Screenshot placeholder

Add dashboard screenshots under a docs assets folder when available, for example:

```text
docs/assets/browser-dashboard.png
docs/assets/browser-terminal.png
```

## VS Code Extension

The repository includes a VS Code extension under `vscode-extension/`.

### Install (development)

```bash
cd vscode-extension
npm install
npm run compile
```

Open this repository in VS Code and run **Extension Development Host**.

### Configure

- `opencode.controlPlaneUrl` (default: `http://localhost:8080`)
- `opencode.authToken` (optional bearer token)

### Features

- Session tree view with connection status
- Session create/attach/stop/restart/delete commands
- Agent chat webview bound to selected session
- Terminal profile backed by control-plane websocket bridge
- Diff integration (`apply preview`, `apply`, `reject`, `clear highlights`)

Troubleshooting note: terminal attach depends on runtime terminal bridge
prerequisites (session daemon terminal capability + control-plane attach path).
If prerequisites are unavailable in a given environment, terminal attach can fail
with `502`/`503` while session APIs remain functional.

For detailed extension usage, see `vscode-extension/README.md`.

## API

| Endpoint | Description |
Expand Down Expand Up @@ -476,12 +544,16 @@ Each probe is a single SSH round-trip. Unreachable hosts show as ○ offline and
├── oc-kill # Kill all opencode serve instances (standalone)
├── internal/
│ ├── config/config.go # Router configuration types, defaults, validation
│ ├── auth/ # Auth + CORS env configuration and middleware integration
│ ├── api/ # Session lifecycle API, SSE events, scrollback APIs
│ ├── launcher/launcher.go # Manages opencode serve child processes
│ ├── registry/registry.go # Thread-safe backend registry
│ ├── scanner/scanner.go # Parallel port scanner + OpenCode probing
│ ├── discovery/discovery.go # mDNS advertisement via zeroconf
│ ├── proxy/proxy.go # Reverse proxy, routing, dashboard
│ └── tui/ # Remote session TUI (ocr)
│ ├── session/ # Session manager, health checks, circuit breaker
│ └── terminal/ # Terminal websocket handler + bridge
│ └── tui/ # Remote session TUI (ocr)
│ ├── app.go # Top-level Bubble Tea model
│ ├── components/
│ │ ├── header.go # Search bar, refresh countdown, fleet stats
Expand All @@ -500,6 +572,9 @@ Each probe is a single SSH round-trip. Unreachable hosts show as ○ offline and
└── go.sum
```

For a full control-plane architecture guide (components, data flow, config,
security, failure modes), see `docs/architecture.md`.

## Autodispatch (OpenClaw + TickTick)

OpenCodeRouter is designed to be the service-discovery layer in a **programming task autodispatch pipeline**. An external orchestrator (e.g. OpenClaw) polls a task source (e.g. TickTick), resolves the target project via the router, and dispatches the task to the correct OpenCode instance.
Expand Down
Loading