Agent-facing UI widget catalog for DoNotDev.
The agent decides per-turn whether to respond with text, audio, a canvas, or
a combination. Canvas widgets are drawn exclusively from an allowlisted
catalog built on @donotdev/components. No free-form HTML, no eval,
no third-party URLs.
- Base schemas (valibot):
CanvasBlockSchema,CanvasEventSchema,CanvasLifetimeSchema,CanvasWidgetMetadataSchema. - Catalog registry:
registerWidget,getWidget,listWidgets,validateBlock,validateEvent. - CanvasHost React component — consumes
CanvasBlock[], emitsCanvasEvents.
Widgets themselves register into the catalog via side-effect imports from
src/common/widgets/index.ts. v1 ships the scaffold; widgets land in later
waves.
See /data/ws/gontrand/docs/superpowers/specs/2026-04-15-canvas-spec.md for
the full design contract (two contracts, lifecycle, update model, security
model).
bun add @donotdev/canvasimport { CanvasHost } from '@donotdev/canvas';
<CanvasHost blocks={blocks} onEvent={handleEvent} />;