open-design/packages
Cursor Agent 0631f04a00
feat(plugins): @open-design/agui-adapter package + GET /api/runs/:id/agui
Plan J1 + J2 / spec §10.3.5 / Phase 4.

New workspace package: packages/agui-adapter/. Pure-TS
bidirectional bridge between OD's native PersistedAgentEvent /
GenUIEvent / PluginPipelineStageEvent union and the AG-UI canonical
event protocol (https://github.com/CopilotKit/CopilotKit).

  - src/types.ts        — AGUIEvent discriminated union (agent.message,
                          tool_call, state_update, ui.surface_requested,
                          ui.surface_responded, run.lifecycle).
  - src/encode.ts       — encodeOdEventForAgui(event, ctx): maps every
                          OD native event onto the canonical shape; drops
                          events the encoder can't translate so external
                          AG-UI clients always see a clean stream.
  - tests/encode.test.ts (9 cases) covers message_chunk, tool_call,
                          run_started, end → started/completed/failed/
                          cancelled, pipeline_stage_started/completed,
                          genui_surface_request/response/timeout,
                          genui_state_synced, and the unknown-event drop.

apps/daemon/src/server.ts mounts GET /api/runs/:id/agui:

  - 404 for unknown run ids.
  - Replays the run's recorded events through the encoder on subscribe
    (so a reconnecting client with Last-Event-ID picks up exactly the
    AG-UI events it missed).
  - Subscribes to future events via a thin adapter client wrapper that
    routes through the existing run.clients fan-out, so the encoder
    runs lazily on each broadcast (no double event buffering).

Daemon depends on @open-design/agui-adapter; the package builds clean
and ships pure ESM. v1 plugins consume CopilotKit / agent-protocol
clients without modification — the adapter ships independently from
daemon main, so upstream protocol revs do not couple to the daemon
release cadence (per spec §10.3.5 Phase 4 contract).

Tests: agui-adapter 9/9, daemon 1481 → 1482 (+1 case on agui-route).

Co-authored-by: Tom Huang <1043269994@qq.com>
2026-05-09 13:11:48 +00:00
..
agui-adapter feat(plugins): @open-design/agui-adapter package + GET /api/runs/:id/agui 2026-05-09 13:11:48 +00:00
contracts feat(genui): introduce GenUI surface management and event handling 2026-05-09 18:44:04 +08:00
platform add support for VP_HOME environment variable in agent resolution (#859) 2026-05-08 15:14:37 +08:00
plugin-runtime feat(plugins): introduce plugin system with installation and management capabilities 2026-05-09 18:24:44 +08:00
sidecar release: Open Design 0.5.0 (#820) 2026-05-08 00:41:01 +08:00
sidecar-proto feat(desktop): export artifacts directly to PDF (#532) 2026-05-08 23:42:12 +08:00
AGENTS.md fix(daemon, packaged): unbreak GUI-launched agent detection on minimal PATHs (#442) (#614) 2026-05-06 20:35:19 +08:00