HarnessStreamPart
type HarnessStreamPart = | { id: string; type: "text-start";} | { delta: string; id: string; type: "text-delta";} | { id: string; type: "text-end";} | { id: string; reason: string; type: "text-cancel";} | { args: unknown; toolCallId?: string; toolName: string; type: "tool-call";} | { result: unknown; toolCallId?: string; toolName: string; type: "tool-result";} | { flow: string; type: "flow-enter";} | { flow: string; reason: string; type: "flow-end";} | { nodeName: string; type: "node-enter";} | { nodeName: string; type: "node-exit";} | { from: string; to: string; type: "flow-transition";} | { reason?: string; targetAgent: string; type: "handoff";} | { lastStep: number; reason: string; type: "interrupted";} | { type: "paused"; waitingFor: string;} | { outcome: ConversationOutcome; type: "conversation-outcome";} | { nodeId: string; options: ChoiceOption[]; prompt: string; type: "interactive";} | { type: "turn-end";} | { rationale: string; type: "pipeline-validation-block"; userFacingMessage?: string;} | { handlerOutcome?: "queued" | "connected" | "failed"; moderator: string; rationale: string; type: "safety-blocked"; userFacingMessage: string;} | { reason: string; type: "wake";} | { category?: EscalationReason; outcome: "queued" | "connected" | "failed"; reason: string; summary?: string; type: "escalation";} | { afterTokens: number; beforeTokens: number; summarizedCount: number; type: "context-compacted";} | { reason: string; type: "compaction-skipped";} | { compacted: boolean; strippedCount: number; type: "context-overflow-recovered";} | { error: string; type: "error";} | { data: unknown; name: string; type: "custom";} | { sessionId: string; type: "done";};Authoritative runtime stream union (runFlow / Runtime emit).
types/voice.ts defines a separate voice/realtime union that intentionally
does not include { type: 'interactive' }.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ id: string; type: "text-start";}Type Literal
Section titled “Type Literal”{ delta: string; id: string; type: "text-delta";}Type Literal
Section titled “Type Literal”{ id: string; type: "text-end";}Type Literal
Section titled “Type Literal”{ id: string; reason: string; type: "text-cancel";}Type Literal
Section titled “Type Literal”{ args: unknown; toolCallId?: string; toolName: string; type: "tool-call";}Type Literal
Section titled “Type Literal”{ result: unknown; toolCallId?: string; toolName: string; type: "tool-result";}Type Literal
Section titled “Type Literal”{ flow: string; type: "flow-enter";}Type Literal
Section titled “Type Literal”{ flow: string; reason: string; type: "flow-end";}Type Literal
Section titled “Type Literal”{ nodeName: string; type: "node-enter";}Type Literal
Section titled “Type Literal”{ nodeName: string; type: "node-exit";}Type Literal
Section titled “Type Literal”{ from: string; to: string; type: "flow-transition";}Type Literal
Section titled “Type Literal”{ reason?: string; targetAgent: string; type: "handoff";}Type Literal
Section titled “Type Literal”{ lastStep: number; reason: string; type: "interrupted";}Type Literal
Section titled “Type Literal”{ type: "paused"; waitingFor: string;}Type Literal
Section titled “Type Literal”{ outcome: ConversationOutcome; type: "conversation-outcome";}Type Literal
Section titled “Type Literal”{ nodeId: string; options: ChoiceOption[]; prompt: string; type: "interactive";}Type Literal
Section titled “Type Literal”{ type: "turn-end";}Type Literal
Section titled “Type Literal”{ rationale: string; type: "pipeline-validation-block"; userFacingMessage?: string;}Type Literal
Section titled “Type Literal”{ handlerOutcome?: "queued" | "connected" | "failed"; moderator: string; rationale: string; type: "safety-blocked"; userFacingMessage: string;}Type Literal
Section titled “Type Literal”{ reason: string; type: "wake";}reason
Section titled “reason”reason: string;type: "wake";An agent-initiated (scheduled wake) turn — there is no new user message.
Type Literal
Section titled “Type Literal”{ category?: EscalationReason; outcome: "queued" | "connected" | "failed"; reason: string; summary?: string; type: "escalation";}category?
Section titled “category?”optional category?: EscalationReason;outcome
Section titled “outcome”outcome: "queued" | "connected" | "failed";Result of the configured escalation handler.
reason
Section titled “reason”reason: string;summary?
Section titled “summary?”optional summary?: string;The LLM handoff brief included in the request, when generated.
type: "escalation";Type Literal
Section titled “Type Literal”{ afterTokens: number; beforeTokens: number; summarizedCount: number; type: "context-compacted";}afterTokens
Section titled “afterTokens”afterTokens: number;beforeTokens
Section titled “beforeTokens”beforeTokens: number;Estimated history tokens before/after compaction.
summarizedCount
Section titled “summarizedCount”summarizedCount: number;Number of older messages folded into the summary.
type: "context-compacted";Type Literal
Section titled “Type Literal”{ reason: string; type: "compaction-skipped";}Type Literal
Section titled “Type Literal”{ compacted: boolean; strippedCount: number; type: "context-overflow-recovered";}compacted
Section titled “compacted”compacted: boolean;Whether the forced post-recovery compaction actually compacted.
strippedCount
Section titled “strippedCount”strippedCount: number;Partial assistant/tool messages stripped from the failed turn.
type: "context-overflow-recovered";Type Literal
Section titled “Type Literal”{ error: string; type: "error";}Type Literal
Section titled “Type Literal”{ data: unknown; name: string; type: "custom";}Type Literal
Section titled “Type Literal”{ sessionId: string; type: "done";}