mirror of
https://github.com/garrytan/gstack.git
synced 2026-08-10 00:00:39 +02:00
docs: multi-workspace support in README
Document CONDUCTOR_PORT-based port derivation, per-workspace isolation, state file naming, and BROWSE_PORT fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
39db2453fc
commit
4db12fb1eb
@@ -186,13 +186,29 @@ Navigate once, then query many times — the browser persists between calls.
|
|||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
- **Compiled CLI binary** (Bun `--compile`, ~58MB) — ~1ms startup, reads `/tmp/browse-server.json` for server port + auth token
|
- **Compiled CLI binary** (Bun `--compile`, ~58MB) — ~1ms startup, reads state file for server port + auth token
|
||||||
- **Persistent Bun HTTP server** — launches headless Chromium via Playwright, listens on localhost:9400-9410
|
- **Persistent Bun HTTP server** — launches headless Chromium via Playwright on localhost
|
||||||
- **Bearer token auth** — random UUID per server session, stored in state file (chmod 600)
|
- **Bearer token auth** — random UUID per server session, stored in state file (chmod 600)
|
||||||
- **Console/network buffers** — all entries in memory, flushed to `/tmp/browse-*.log` every 1s
|
- **Console/network buffers** — all entries in memory, flushed to `/tmp/browse-*.log` every 1s
|
||||||
- **Auto-idle shutdown** — 30 minutes (configurable via `BROWSE_IDLE_TIMEOUT`)
|
- **Auto-idle shutdown** — 30 minutes (configurable via `BROWSE_IDLE_TIMEOUT`)
|
||||||
- **Crash handling** — Chromium crash kills server, CLI auto-restarts on next command
|
- **Crash handling** — Chromium crash kills server, CLI auto-restarts on next command
|
||||||
|
|
||||||
|
### Multi-workspace support
|
||||||
|
|
||||||
|
Each workspace gets its own isolated browser instance. If `CONDUCTOR_PORT` is set (e.g., by [Conductor](https://conductor.dev)), the browse port is derived deterministically:
|
||||||
|
|
||||||
|
```
|
||||||
|
browse_port = CONDUCTOR_PORT - 45600
|
||||||
|
```
|
||||||
|
|
||||||
|
| Workspace | CONDUCTOR_PORT | Browse port | State file |
|
||||||
|
|-----------|---------------|-------------|------------|
|
||||||
|
| Workspace A | 55040 | 9440 | `/tmp/browse-server-9440.json` |
|
||||||
|
| Workspace B | 55041 | 9441 | `/tmp/browse-server-9441.json` |
|
||||||
|
| No Conductor | — | 9400 (scan) | `/tmp/browse-server.json` |
|
||||||
|
|
||||||
|
Each instance has its own Chromium process, tabs, cookies, console/network logs. No cross-workspace interference. You can also set `BROWSE_PORT` directly if you're not using Conductor.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user