Files
oh-my-pi/packages/collab-web
can1357 5ff277349c refactor(coding-agent): consolidated tool surface onto xd:// devices and hub
- Added the `xd://` virtual device protocol (`internal-urls/xd-protocol.ts`, `tools/xdev.ts`): tools declaring `loadMode: "discoverable"` are unmounted from the request tools array and driven via `read xd://` (list/docs+schema) and `write xd://<tool>` (execute), gated by the `tools.xdev` setting (default on) and inlined into the system prompt.
- Merged the `irc`, `job`, and `launch` tools into a single `hub` tool (`tools/hub/`, `async/job-manager.ts`): messaging keeps `send`/`inbox`/`list`, job control maps to `wait`/`cancel`/`jobs`, process supervision keeps `start`/`logs`/`stop`/`restart`/`describe` with `ps`, and the unified `wait` races background jobs against peer messages; SDK `IrcTool`/`JobTool`/`LaunchTool` are replaced by `HubTool`.
- Removed the hidden `resolve` tool in favor of the `xd://resolve`/`xd://reject`/`xd://propose` resolution devices, auto-including `write` whenever a deferrable tool or plan mode is present.
- Removed the BM25 tool-discovery system: the `search_tool_bm25` tool, the `tool-discovery` module, the `tools.discoveryMode`/`mcp.discoveryMode`/`mcp.discoveryDefaultServers`/`tools.essentialOverride` settings, per-tool MCP selection, and the `mcp_tool_selection` message type.
- Unified tool presentation on `ToolLoadMode` (`essential`|`discoverable`), replacing the custom-tool `xdev?: boolean` opt-out; custom, extension, MCP, RPC host, image-generation, and TTS tools now default to `discoverable`, and added a `satisfies` predicate to `SoftToolRequirement`.
- Removed the standalone `ssh` command tool and `ssh/ssh-executor` (the `ssh://` read/write/search protocol stays), and made `--tools` address hidden built-ins.
- Updated collab-web to render `xd://` dispatches and `hub` op families, dropped the `search_tool_bm25`/`ssh`/`report-finding` renderers, refreshed tool docs and prompts, and migrated the affected tests and changelogs.
2026-07-15 15:16:29 +02:00
..

@oh-my-pi/collab-web

Web client for omp collab sessions. Paste a /collab link into the browser and you get the same live session guests see in the TUI: streaming transcript, tool-call cards, subagent panel with live transcripts, and a composer that prompts (or interrupts) the host agent.

Quick start

# dev server (Bun HTML dev server with HMR) — http://localhost:3000
bun run dev

# offline demo: local relay + scripted mock host; prints a ws://localhost link
bun run mock-host

Host a session from any omp instance (/collab, or /collab ws://localhost:7466 to use the mock relay), then paste the printed link into the connect screen. Deep links work too: http://localhost:3000/#<roomId>.<key> auto-connects on load.

Build & deploy

bun run build   # static site in dist/

dist/ is a fully static SPA — host it anywhere. JS/CSS bundles are content-hashed; favicons, manifest.webmanifest, robots.txt, sitemap.xml, and og-image.png come from public/ and are emitted at the site root under stable names (canonical URL: https://my.omp.sh/). Two runtime requirements:

  • Secure context: room keys are unwrapped with WebCrypto (crypto.subtle), which browsers expose only on https:// or localhost.
  • Relay reachability: the client connects straight to the relay over WebSocket (wss:// for anything that isn't localhost). The default relay is wss://my.omp.sh; bare <roomId>.<key> links resolve against it (legacy <roomId>#<key> and %23-mangled links still parse).

The room key never leaves the URL fragment — it is not sent to the relay or any server.

Architecture

  • src/lib/ — vendored wire codec (codec.ts AES-256-GCM, link.ts envelope + link grammar), socket.ts reconnecting relay socket, client.ts guest session store (GuestClient + immutable snapshots for useSyncExternalStore). Shared protocol shapes come from @oh-my-pi/pi-wire.
  • src/components/ — transcript/ (entries, markdown, tool cards), agents/ (panel + transcript drawer), shell/ (connect screen, header, composer, banners, toasts).
  • src/tool-render/ — per-tool React renderers shared with coding-agent HTML session exports: one view per built-in tool, common ToolView chrome, theme-adaptive tv- design tokens, and an <omp-tool-view> web-component wrapper. The ToolRenderHost seam lets hosts wire agent-id chips to a sub-session view (drawer here, overlay in exports).
  • scripts/ — local-relay.ts (content-blind relay on Bun.serve), mock-host.ts + fixture.ts (scripted host for offline dev), build-tool-views.ts (bundles src/tool-render/ + React into packages/coding-agent/src/export/html/tool-views.generated.js for self-contained exports).

The package is intentionally standalone — no dependency on @oh-my-pi/pi-coding-agent at runtime or type level. Wire-shape drift is prevented by consuming the same @oh-my-pi/pi-wire contracts as the host, with sealed-frame interop still covered by test/codec.test.ts.