Skip to main content

Type Alias: AgencyStreamPart

AgencyStreamPart = { agent?: string; text: string; type: "text"; } | { agent?: string; args: unknown; toolName: string; type: "tool-call"; } | { agent?: string; result: unknown; toolName: string; type: "tool-result"; } | { agent?: string; error: Error; type: "error"; } | { agent: string; input: string; type: "agent-start"; } | { agent: string; durationMs: number; output: string; type: "agent-end"; } | { fromAgent: string; reason: string; toAgent: string; type: "agent-handoff"; } | { chosen: string; original: string; reason: string; type: "strategy-override"; } | { agentName: string; approved: boolean; instructions: string; type: "emergent-forge"; } | { action: string; agent: string; guardrailId: string; passed: boolean; type: "guardrail-result"; } | { request: ApprovalRequest; type: "approval-requested"; } | { approved: boolean; requestId: string; type: "approval-decided"; } | { action: string; agent: string; reason: string; type: "permission-denied"; }

Defined in: packages/agentos/src/api/types.ts:595

Discriminated union of all streaming events emitted by an agency() stream. A superset of the base StreamPart type — includes all text/tool events plus agency-level lifecycle events.