/** * `TaskEvent` — the canonical streaming primitive consumers iterate over. * * It's the subset of `Envelope` that surfaces from `client.tasks.start()` / * `tasks.continue()` / `tasks.resubscribe()` as `AsyncIterable`, * plus the SDK-internal `qar.client.*` lifecycle events surfaced on the * same iterator. The `kind` discriminator is identical to the * underlying envelope so consumers can `switch (event.kind)` without * translation. * * Excludes pure client-to-server kinds (`task.start`, `task.continue`, * `task.cancel`, `task.resubscribe`, `tool.response`) — those are produced by * SDK methods, not consumed from them. * * The synthetic `qar.client.*` arms are NOT QAR envelopes; they have no * `message_id` / `session_id` / `payload`. The namespace prefix prevents * collision with any current or future server-side discriminant. Consumers * who don't care about reconnect signal can ignore them — TypeScript narrows * them out of any `case 'task.delta':` branch automatically. */ import type { TaskDeltaEnvelope, TaskDoneEnvelope, ToolRequestEnvelope, StateUpdateEnvelope, AgentSpawnEnvelope, ToolActivityEnvelope, BulletinPostEnvelope, ArtifactAddEnvelope, FlowPauseEnvelope, FlowResumeEnvelope, ErrorEnvelope } from './envelopes.js'; import type { ClientEvent } from './clientEvents.js'; export type TaskEvent = TaskDeltaEnvelope | TaskDoneEnvelope | ToolRequestEnvelope | StateUpdateEnvelope | AgentSpawnEnvelope | ToolActivityEnvelope | BulletinPostEnvelope | ArtifactAddEnvelope | FlowPauseEnvelope | FlowResumeEnvelope | ErrorEnvelope | ClientEvent; export type TaskEventKind = TaskEvent['kind']; //# sourceMappingURL=taskEvents.d.ts.map