From 03377eec3c7ab43942b8acd20c517d9c4be11a73 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:36:35 +0800 Subject: [PATCH] docs: document terminal websocket endpoint Co-Authored-By: Claude --- README.md | 1 + web/README.md | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e80586..b7700da 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ All runtime logging uses slog; `fmt`, `log.Printf`, and the Gin default logger a | `POST` | `/api/workspaces/:id/process/stop` | Stop OpenCode process | | `POST` | `/api/workspaces/:id/process/restart` | Restart OpenCode process | | `GET` | `/api/workspaces/:id/process/status` | Get process running status and PID | +| `GET` | `/api/workspaces/:id/process/ws` | WebSocket: stream process stdout/stderr, send stdin (text frames, raw bytes) | ### Health diff --git a/web/README.md b/web/README.md index c2dd666..d0ba12f 100644 --- a/web/README.md +++ b/web/README.md @@ -4,14 +4,18 @@ Frontend IDE shell for the codespace Go backend. ## Scope -This package is a runnable **UI scaffold only**. It provides the workspace layout, a mock file explorer, a Monaco editor wrapper, and an xterm terminal wrapper. It does not yet connect to the Go API. +This package is the codespace web IDE. It connects to the Go backend: +the file explorer and editor call the file APIs, the toolbar drives the +process start/stop/restart endpoints, and the terminal streams the +running OpenCode process over the WebSocket endpoint +`/api/workspaces/:id/process/ws`. ## Commands | Command | Purpose | |---|---| | `pnpm install` | Install dependencies | -| `pnpm dev` | Start the Vite dev server | +| `pnpm dev` | Start the Vite dev server (proxies `/api` and `/healthz` to `http://localhost:8080`) | | `pnpm lint` | Run ESLint | | `pnpm build` | Type-check and build for production | @@ -21,7 +25,7 @@ This package is a runnable **UI scaffold only**. It provides the workspace layou - Tailwind CSS v4 - react-router v7 - Zustand for local UI state -- TanStack Query (provider only; no real API calls yet) +- TanStack Query for API state - `@monaco-editor/react` editor wrapper - `@xterm/xterm` + `@xterm/addon-fit` terminal wrapper - `react-resizable-panels` for layout splits @@ -29,8 +33,6 @@ This package is a runnable **UI scaffold only**. It provides the workspace layou ## Non-goals -- Backend API integration (reserved file only at `src/lib/api/client.ts`) - Authentication -- WebSocket terminal or process streaming - i18n - Tests (no test framework until business logic is added)