import type { ContextContainer } from "#context/container.js"; import type { UnstampedMessageStreamEvent } from "#protocol/message.js"; import type { RouteContext } from "#public/definitions/channel.js"; export declare const LEGACY_REMOTE_AGENT_PROTOCOL_VERSION = 1; /** A session created by a protocol-1 caller. */ export interface LegacyRemoteAgentCaller { /** * The caller's background task; its questions and sign-ins are forwarded * only with one. Captured at create: a 0.66–0.68 caller's model-called * agents start in a task, and those callers never check it against later turns. */ readonly taskId?: string; } /** * Removes the `callback.taskId` a protocol-1 caller adds when it delegates * from a background task. Current callers don't send it. The task id is * returned so the session can name it back to the caller. The caller's * `activityObserver` needs no removal: eve ignores that field from any caller. */ export declare function splitLegacyTaskFields(input: Record): { readonly payload: Record; readonly taskId?: string; }; /** * Sends a question, approval, or sign-in to a protocol-1 caller in the * `task.*` callback it expects. Returns whether the event was forwarded and * must stay off this session's own channel. */ export declare function forwardLegacySessionInput(ctx: ContextContainer, caller: LegacyRemoteAgentCaller, event: UnstampedMessageStreamEvent): Promise; /** * Renames a `task.*` callback that a remote agent sends a protocol-1 caller to * the payload kind the caller's session reads. The callback URL resolves to the * caller's newest deployment, while the session waiting on it may still run on * an eve 0.66–0.68 build; both read the renamed kinds. The caller still * validates the result. */ export declare function renameLegacyTaskCallback(body: unknown): unknown; /** Route a protocol-1 caller posts its answers to a remote agent's question or approval. */ export declare const legacyTaskInputRoute: { readonly handler: typeof handleLegacyTaskInputRequest; readonly path: "/eve/v1/task-input/:token"; }; /** * Delivers a protocol-1 caller's answers. The token is the capability the * caller derived from this session's create-once continuation token, so it * authorizes the request on its own, as it did in protocol 1. */ declare function handleLegacyTaskInputRequest(request: Request, ctx: RouteContext): Promise; export {};