import type { ClientSessionContext } from "#client/session.js"; import type { StreamOptions } from "#client/types.js"; import type { AgentStartedStreamEvent, MessageStreamEvent } from "#protocol/message.js"; /** * A session an agent run opened, reached through the parent session whose * stream announced it with `agent.started`. Get one with * `session.agent(started)`. Every read uses the parent's host and * credentials: a local child's own route, or the parent-origin proxy for a * remote child, which the parent deployment authenticates to the remote agent * after checking that it recorded the child. */ export declare class ClientAgentSession { #private; /** The agent's name, as `agent.started` reports it. */ readonly name: string; /** The child session's id. */ readonly sessionId: string; /** The task whose run opened the session; absent when an `execute` call opened it. */ readonly taskId: string | undefined; /** @internal */ constructor(context: ClientSessionContext, started: AgentStartedStreamEvent); /** * Follows the child's durable event stream. Reading it never advances the * parent session's cursor. The child cursor starts at `0`; pass `startIndex` * to resume. Stop at a child turn boundary with `isCurrentTurnBoundaryEvent`. */ stream(options?: StreamOptions): AsyncIterable; }