This repository has been archived on 2026-07-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
codespace/web
tao.chen ec54ea4473 feat(web): AcpPanel streaming over WebSocket
Replace the synchronous useAcpPrompt mutation with a streaming WS
hook. The agent's reply now arrives chunk-by-chunk and the same
agent bubble grows in real time.

- web/src/lib/api/acp.ts:
  - Add AcpStreamEvent / AcpStreamStatus types.
  - Add useAcpStream(workspaceId) hook: per-prompt WS lifecycle
    (idle -> connecting -> open -> closed / error), open(content)
    / close() / onEvent(cb) API. Reuses the reconnection / 1000-1001
    / pinger pattern from useProcessWebSocket.
  - Keep useAcpPrompt and useAcpCancel exported for back-compat.
- web/src/components/acp/AcpPanel.tsx:
  - Switch to useAcpStream. handleSend pushes an optimistic user
    message, opens the stream, sets an inflight agent bubble with
    empty text.
  - chunk events append to inflight.text; complete clears inflight;
    error clears inflight and shows a local error toast.
  - renderMessages = coalesced + localUserMessage + inflight.
  - Local user message is auto-cleared when the next history poll
    surfaces the same text (avoids duplicate render).
  - Auto-scroll effect depends on inflight.text so it fires as
    chunks stream.
  - Cancel button closes the WS (server's read loop triggers
    session/cancel).
  - Remove the standalone ThinkingIndicator; the in-flight bubble
    serves as the streaming affordance.

Conversation: 7B62CB8E-ACC8-4333-BC64-B927C8FDC397
2026-07-06 17:17:47 +08:00
..
2026-07-02 16:57:37 +08:00
2026-07-02 16:48:19 +08:00
2026-07-02 16:48:19 +08:00
2026-07-02 16:48:19 +08:00
2026-07-02 16:48:19 +08:00
2026-07-02 16:48:19 +08:00

codespace-web

Frontend IDE shell for the codespace Go backend.

Scope

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 (proxies /api and /healthz to http://localhost:8080)
pnpm lint Run ESLint
pnpm build Type-check and build for production

Stack

  • Vite + React 19 + TypeScript
  • Tailwind CSS v4
  • react-router v7
  • Zustand for local UI state
  • TanStack Query for API state
  • @monaco-editor/react editor wrapper
  • @xterm/xterm + @xterm/addon-fit terminal wrapper
  • react-resizable-panels for layout splits
  • lucide-react for icons

Non-goals

  • Authentication
  • i18n
  • Tests (no test framework until business logic is added)