/** * Agent stream wire format — ADR 0039 P0. * Eve-aligned event vocabulary for Host NDJSON streams and Console consumers. */ /** Response / stream header for the active run handle (distinct from continuationToken). */ export declare const ZHIN_SESSION_ID_HEADER = "x-zhin-session-id"; export declare const AGENT_STREAM_MEDIA_TYPE = "application/x-ndjson; charset=utf-8"; /** Stable session API prefix (not Eve `/eve/v1`). */ export declare const ZHIN_AGENT_SESSION_API_PREFIX = "/zhin/v1"; export declare const AgentStreamEventType: { readonly SESSION_STARTED: "session.started"; readonly SESSION_WAITING: "session.waiting"; readonly SESSION_COMPLETED: "session.completed"; readonly SESSION_FAILED: "session.failed"; readonly TURN_STARTED: "turn.started"; readonly TURN_COMPLETED: "turn.completed"; readonly TURN_FAILED: "turn.failed"; readonly MESSAGE_RECEIVED: "message.received"; readonly MESSAGE_APPENDED: "message.appended"; readonly MESSAGE_COMPLETED: "message.completed"; readonly ACTIONS_REQUESTED: "actions.requested"; readonly ACTION_RESULT: "action.result"; readonly REASONING_APPENDED: "reasoning.appended"; readonly SUBAGENT_CALLED: "subagent.called"; readonly SUBAGENT_COMPLETED: "subagent.completed"; readonly INPUT_REQUESTED: "input.requested"; readonly INPUT_COMPLETED: "input.completed"; readonly AUTHORIZATION_REQUIRED: "authorization.required"; readonly AUTHORIZATION_COMPLETED: "authorization.completed"; readonly STEP_STARTED: "step.started"; readonly STEP_COMPLETED: "step.completed"; readonly STEP_INTERRUPTED: "step.interrupted"; }; export type AgentStreamEventTypeName = (typeof AgentStreamEventType)[keyof typeof AgentStreamEventType]; export type AgentStreamEvent = { type: AgentStreamEventTypeName | (string & {}); data?: Record; timestamp?: number; }; export type StartAgentSessionResponse = { ok: true; sessionId: string; continuationToken: string; }; export type ContinueAgentSessionBody = { continuationToken: string; message: string; }; export type ContinueAgentSessionResponse = { ok: true; sessionId: string; continuationToken: string; }; /** One NDJSON line (includes trailing newline). */ export declare function formatAgentStreamNdjsonLine(event: AgentStreamEvent): string; /** * Minimal reducer state for Console / SDK clients consuming NDJSON streams. */ export type AgentStreamPendingInput = { requestId: string; kind: string; toolName?: string; args?: Record; prompt?: string; }; export type AgentStreamPendingAuthorization = { requestId: string; connection: string; authUrl?: string; scope?: string; }; export type AgentStreamReduceState = { assistantText: string; lastEventType: string | null; waiting: boolean; failed: boolean; pendingInputs: AgentStreamPendingInput[]; pendingAuthorizations: AgentStreamPendingAuthorization[]; }; export declare function createAgentStreamReduceState(): AgentStreamReduceState; export declare function reduceAgentStreamEvent(state: AgentStreamReduceState, event: AgentStreamEvent): AgentStreamReduceState; //# sourceMappingURL=agent-stream.d.ts.map