Type alias GraphEvent

GraphEvent: {
    type: "run_start";
    runId: string;
    graphId: string;
} | {
    type: "node_start";
    nodeId: string;
    state: Partial<GraphState>;
} | {
    type: "node_end";
    nodeId: string;
    output: unknown;
    durationMs: number;
} | {
    type: "edge_transition";
    sourceId: string;
    targetId: string;
    edgeType: string;
} | {
    type: "text_delta";
    nodeId: string;
    content: string;
} | {
    type: "tool_call";
    nodeId: string;
    toolName: string;
    args: unknown;
} | {
    type: "tool_result";
    nodeId: string;
    toolName: string;
    result: unknown;
} | {
    type: "guardrail_result";
    nodeId: string;
    guardrailId: string;
    passed: boolean;
    action: string;
} | {
    type: "guardrail:hitl-override";
    nodeId: string;
    guardrailId: string;
    reason: string;
} | {
    type: "checkpoint_saved";
    checkpointId: string;
    nodeId: string;
} | {
    type: "interrupt";
    nodeId: string;
    reason: "human_approval" | "error" | "guardrail_violation";
} | {
    type: "memory_read";
    nodeId: string;
    traceCount: number;
} | {
    type: "memory_write";
    nodeId: string;
    traceType: string;
} | {
    type: "discovery_result";
    nodeId: string;
    toolsFound: string[];
} | {
    type: "run_end";
    runId: string;
    finalOutput: unknown;
    totalDurationMs: number;
} | {
    type: "node_timeout";
    nodeId: string;
    timeoutMs: number;
} | {
    type: "error";
    nodeId?: string;
    error: {
        message: string;
        code: string;
    };
} | {
    type: "voice_transcript";
    nodeId: string;
    text: string;
    isFinal: boolean;
    speaker?: string;
    confidence: number;
} | {
    type: "voice_audio";
    nodeId: string;
    direction: "inbound" | "outbound";
    format: string;
    durationMs: number;
} | {
    type: "voice_barge_in";
    nodeId: string;
    interruptedText: string;
    userSpeech: string;
} | {
    type: "voice_turn_complete";
    nodeId: string;
    transcript: string;
    turnIndex: number;
    endpointReason: string;
} | {
    type: "voice_session";
    nodeId: string;
    action: "started" | "ended";
    exitReason?: string;
} | {
    type: "mission:planning_start";
    goal: string;
} | {
    type: "mission:branch_generated";
    branchId: string;
    summary: string;
    scores?: MissionEvalScores;
} | {
    type: "mission:branch_selected";
    branchId: string;
    reason: string;
} | {
    type: "mission:refinement_applied";
    changes: string[];
} | {
    type: "mission:graph_compiled";
    nodeCount: number;
    edgeCount: number;
    estimatedCost: number;
} | {
    type: "mission:expansion_proposed";
    patch: MissionGraphPatch;
    trigger: MissionExpansionTrigger;
    reason?: string;
} | {
    type: "mission:expansion_approved";
    by: "auto" | "user";
} | {
    type: "mission:expansion_rejected";
    by: "user";
    reason: string;
} | {
    type: "mission:expansion_applied";
    nodesAdded: number;
    edgesAdded?: number;
} | {
    type: "mission:checkpoint_saved";
    checkpointId: string;
    nodeId: string;
} | {
    type: "mission:threshold_reached";
    threshold: string;
    value: number;
    cap: number;
} | {
    type: "mission:cost_update";
    totalSpent: number;
    costCap: number;
} | {
    type: "mission:complete";
    summary: string;
    totalCost: number;
    totalDurationMs: number;
    agentCount: number;
} | {
    type: "mission:agent_spawned";
    agentId: string;
    role: string;
    provider: string;
    model: string;
} | {
    type: "mission:tool_forged";
    toolId: string;
    name: string;
    mode: "compose" | "sandbox";
} | {
    type: "mission:approval_required";
    action: string;
    details?: unknown;
}

All runtime events emitted by the graph executor.

Every variant carries a type discriminant so consumers can narrow with a simple switch (event.type) or exhaustive-check library.

Type declaration

  • type: "run_start"
  • runId: string
  • graphId: string

Type declaration

  • type: "node_start"
  • nodeId: string
  • state: Partial<GraphState>

Type declaration

  • type: "node_end"
  • nodeId: string
  • output: unknown
  • durationMs: number

Type declaration

  • type: "edge_transition"
  • sourceId: string
  • targetId: string
  • edgeType: string

Type declaration

  • type: "text_delta"
  • nodeId: string
  • content: string

Type declaration

  • type: "tool_call"
  • nodeId: string
  • toolName: string
  • args: unknown

Type declaration

  • type: "tool_result"
  • nodeId: string
  • toolName: string
  • result: unknown

Type declaration

  • type: "guardrail_result"
  • nodeId: string
  • guardrailId: string
  • passed: boolean
  • action: string

Type declaration

  • type: "guardrail:hitl-override"
  • nodeId: string
  • guardrailId: string
  • reason: string

Type declaration

  • type: "checkpoint_saved"
  • checkpointId: string
  • nodeId: string

Type declaration

  • type: "interrupt"
  • nodeId: string
  • reason: "human_approval" | "error" | "guardrail_violation"

Type declaration

  • type: "memory_read"
  • nodeId: string
  • traceCount: number

Type declaration

  • type: "memory_write"
  • nodeId: string
  • traceType: string

Type declaration

  • type: "discovery_result"
  • nodeId: string
  • toolsFound: string[]

Type declaration

  • type: "run_end"
  • runId: string
  • finalOutput: unknown
  • totalDurationMs: number

Type declaration

  • type: "node_timeout"
  • nodeId: string
  • timeoutMs: number

Type declaration

  • type: "error"
  • Optional nodeId?: string
  • error: {
        message: string;
        code: string;
    }
    • message: string
    • code: string

Type declaration

  • type: "voice_transcript"
  • nodeId: string
  • text: string
  • isFinal: boolean
  • Optional speaker?: string
  • confidence: number

Type declaration

  • type: "voice_audio"
  • nodeId: string
  • direction: "inbound" | "outbound"
  • format: string
  • durationMs: number

Type declaration

  • type: "voice_barge_in"
  • nodeId: string
  • interruptedText: string
  • userSpeech: string

Type declaration

  • type: "voice_turn_complete"
  • nodeId: string
  • transcript: string
  • turnIndex: number
  • endpointReason: string

Type declaration

  • type: "voice_session"
  • nodeId: string
  • action: "started" | "ended"
  • Optional exitReason?: string

Type declaration

  • type: "mission:planning_start"
  • goal: string

Type declaration

  • type: "mission:branch_generated"
  • branchId: string
  • summary: string
  • Optional scores?: MissionEvalScores

Type declaration

  • type: "mission:branch_selected"
  • branchId: string
  • reason: string

Type declaration

  • type: "mission:refinement_applied"
  • changes: string[]

Type declaration

  • type: "mission:graph_compiled"
  • nodeCount: number
  • edgeCount: number
  • estimatedCost: number

Type declaration

Type declaration

  • type: "mission:expansion_approved"
  • by: "auto" | "user"

Type declaration

  • type: "mission:expansion_rejected"
  • by: "user"
  • reason: string

Type declaration

  • type: "mission:expansion_applied"
  • nodesAdded: number
  • Optional edgesAdded?: number

Type declaration

  • type: "mission:checkpoint_saved"
  • checkpointId: string
  • nodeId: string

Type declaration

  • type: "mission:threshold_reached"
  • threshold: string
  • value: number
  • cap: number

Type declaration

  • type: "mission:cost_update"
  • totalSpent: number
  • costCap: number

Type declaration

  • type: "mission:complete"
  • summary: string
  • totalCost: number
  • totalDurationMs: number
  • agentCount: number

Type declaration

  • type: "mission:agent_spawned"
  • agentId: string
  • role: string
  • provider: string
  • model: string

Type declaration

  • type: "mission:tool_forged"
  • toolId: string
  • name: string
  • mode: "compose" | "sandbox"

Type declaration

  • type: "mission:approval_required"
  • action: string
  • Optional details?: unknown