Skip to content

Type Alias: TraceEvent

type TraceEvent =
| {
type: "plan_pending";
}
| {
trace: Trace;
type: "plan";
}
| {
rowCount: number;
rows: Record<string, unknown>[];
type: "rows";
}
| {
summary: string;
type: "summary";
}
| {
diff: AskDiff;
type: "confirm_required";
}
| {
db: SelectedDbEcho;
type: "selected_db";
}
| {
error: ApiErrorBody;
type: "error";
}
| {
status: "ok";
type: "done";
};

Defined in: packages/sdk/src/index.ts:164

One event from the askStream() trace channel; surfaces narrow on type to drive the live trace pane.

{
type: "plan_pending";
}

{
trace: Trace;
type: "plan";
}

SK-TRUST-002 — the plan event carries the full trace block so SSE consumers accumulate one record instead of stitching it.


{
rowCount: number;
rows: Record<string, unknown>[];
type: "rows";
}

{
summary: string;
type: "summary";
}

{
diff: AskDiff;
type: "confirm_required";
}

{
db: SelectedDbEcho;
type: "selected_db";
}

{
error: ApiErrorBody;
type: "error";
}

{
status: "ok";
type: "done";
}