Wave 2 prep: LedgerEvent.ref, demo bridge protocol, artifact stubs, sendText in ChatActionsContext

This commit is contained in:
Amos
2026-08-22 10:03:20 +03:00
parent 34dee919bb
commit 6a68fcfba1
6 changed files with 60 additions and 2 deletions
+21
View File
@@ -99,6 +99,9 @@ export interface LedgerEvent {
kind: LedgerEventKind;
chatId: string;
at: string;
/** Idempotency key: the quiz part's toolCallId or `taught:<treeNodeId>` —
* re-emission of the same chat must never double-record an event. */
ref?: string;
/** The learner's quiz note — diagnostic gold (vision §1 calibration). */
note?: string;
/** The quiz question text, when nodeId is null (later attribution input). */
@@ -206,6 +209,24 @@ export interface VisualResult {
notes?: string;
}
// ─── Demo iframe bridge (W6) ────────────────────────────────────────────────
// postMessage protocol between the sandboxed demo iframe and its parent card.
// The bridge script is auto-injected into every demo HTML by the demo-card
// renderer (never the model's job): ResizeObserver → DEMO_RESIZE with the
// document height; window.onerror → DEMO_ERROR with the message.
export interface DemoResizeMessage {
type: "demo-resize";
height: number;
}
export interface DemoErrorMessage {
type: "demo-error";
message: string;
}
export type DemoBridgeMessage = DemoResizeMessage | DemoErrorMessage;
// ─── Artifact renderer registry (client extension point) ────────────────────
/**