import type { WireTurnStatus } from '../../contracts/session/turn-status.js'; import type { WireTurn, WireTurnConfig } from '../../contracts/session/turn.js'; import type { A2AMessageSendParams, A2ATask, A2ATaskState } from '../../types/a2a/index.js'; import type { Message } from '../../types/message/index.js'; import type { ExternalRef, Origin } from '../../types/session/turn.js'; export declare function isTerminalState(state: A2ATaskState): boolean; export declare function turnStatusToA2AState(status: WireTurnStatus): A2ATaskState; export interface MapTurnToA2ATaskOptions { /** * The context id the peer addressed this session by, echoed back verbatim. * Defaults to the turn's `session_id`. Pass the peer's own id when the * session was reached through it, so the peer sees the id it sent. */ readonly contextId?: string; } /** * One turn as an A2A task: `id` is the turn, `contextId` the session. * * The context is never the project. A host that serves `tasks/get` or * `tasks/list` reads the turns from `SessionIndex.listTurns` and hands each * one here with the session's messages. */ export declare function mapTurnToA2ATask(turn: WireTurn, messages?: readonly Message[], options?: MapTurnToA2ATaskOptions): A2ATask; /** * What an incoming `message/send` asks for: a new turn of one session. * * `contextId` is the peer's own name for the session, verbatim. It is any * string and is never read as a namzu id or a project id: the project comes * from the host's configuration. A host resolves it with * `resolveA2AContext` (an existing session, or a new one), and starts the turn * with `origin`, which is how the mapping reaches the session log and so * survives an index rebuild. */ export interface CreateTurnFromA2A { readonly agentId: string; readonly input: string; /** The peer's context id, when it sent one. Absent means a new session. */ readonly contextId?: string; /** The ref the index resolves `contextId` through: `a2a` / `context`. */ readonly externalRef?: ExternalRef; /** Recorded on the turn (and on the session when the turn creates it). */ readonly origin: Origin; readonly config: WireTurnConfig; } export declare function a2aMessageToCreateTurn(agentId: string, params: A2AMessageSendParams): CreateTurnFromA2A; //# sourceMappingURL=task.d.ts.map