System design for technical readers. How the canvas, panels, and agents work together.
The CanvasEngine Service Provider Interface abstracts the rendering substrate. Today we ship with a tldraw-based implementation and a lightweight DOM app-shell engine.
CanvasEngine
├── tldrawAdapter (default)
│ └── shape registry + camera sync
└── DOMAppShell
└── panel host + event bridge
All panels are defined using a validated schema. The contract guarantees consistent behavior across static, schema-driven, agent-composed, and custom React panels.
interface PanelDefinition {
id: string;
tier: 'static' | 'schema' | 'agent' | 'custom';
schema?: JSONSchema;
component?: React.ComponentType;
permissions: Permission[];
}
The DataAdapter provides a unified boundary for query, mutate, and subscribe operations. Agents and the canvas interact with data exclusively through this interface.
DataAdapter ├── query(panelId, filter) ├── mutate(action, payload) └── subscribe(panelId, callback)
The primary entry point for embedding and hosting a canvas. Returns a fully initialized host instance with panel catalog and agent registry attached.
const host = createCanvasHost({
tenant: "acme",
canvasMode: "infinite",
primaryColor: "#2563EB"
});
host.mount(document.getElementById("canvas"));
The blackboard pattern enables agents to share context. WorkspaceDigest captures the current state while AgentRegistry tracks active agents and their capabilities.
WorkspaceDigest ├── panels: PanelInstance[] ├── agents: AgentRef[] └── mutations: PendingMutation[] AgentRegistry └── register(agent) → capabilities
Three supported modes give hosts full control over the spatial experience.
Multiple <agentable-canvas> embeds can participate in a single shared session. All instances communicate through the same WorkspaceDigest, enabling consistent state across different parts of a page or even across tabs.
No untrusted code ever executes in the trusted context. Agent-composed panels run inside a dedicated sandbox tier for code preview and execution.
Security Layers ├── Trusted context (host) ├── Sandbox tier (agent panels) │ └── isolated iframe + CSP └── HITL mutation gates