yuez 721661177c feat(web): workspaces, connect and status pages plus the full chat experience
- workspaces list + new-workspace flow (add -> ensure -> navigate), server context bar
- connect: manual/pair-code redeem, QR scan with paste fallback, paired summary, disconnect
- status: info/health/resources/models/devices/connection cards with 3s visible-only polling
- chat: 3/2/1-column layout, session tree, virtualized stream, tool/thinking/todo/batch blocks,
  composer with queue chips and abort, subagents/todo/tasks panel, attention + diff review modals,
  history pagination merged with live entries
- canonical reducer reused via @protocol alias (no duplicated types)
- 63 vitest tests, typecheck + build green, zh/en parity at 411 keys
2026-10-21 13:32:34 +08:00

pi2d — pi2 web console daemon

The always-on web side of pi2.nvim. It is a router + supervisor, not an agent runtime:

browser ──HTTP/WS──▶ pi2d ──JSONL unix socket──▶ one nvim per workspace (pi2.nvim)
                                                   └── one pi --mode rpc per active session

Hard rules (see docs/protocol.md):

  1. pi2d never spawns pi, never reads session JSONL, never owns session state.
  2. A workspace maps to exactly one managed nvim instance.
  3. All mutations are commands relayed to the plugin; the plugin (inside nvim) is the single source of truth.
  4. The web client keeps a render cache only; a snapshot from the plugin replaces it wholesale.

Quick start

pnpm install
pnpm test
pnpm dev            # starts on 127.0.0.1:7676

The plugin starts the daemon lazily when it is not running; you normally do not start it by hand.

Layout

Path Purpose
src/protocol/ wire types, event/command vocabulary, error codes, canonical reducer
src/daemon/ HTTP/WS/SSE, auth, static assets, routing, event relay
src/instances/ discovery, lazy spawn, single-instance enforcement, crash handling
src/workspaces/ workspace registry, disk discovery, aliases/trust
src/cli/ pi2d (daemon) and pi2 (attach/status/doctor)
fixtures/ golden event streams + expected session state (shared with pi2.nvim tests)
docs/protocol.md the wire contract (browser ↔ daemon ↔ plugin)
S
Description
[mirror of github.com/zgs225/pi2d] pi2 web console daemon
Readme MIT
2.1 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 76.4%
JavaScript 15.2%
CSS 5.5%
Shell 2.8%