import type { UIMessage, UIMessageChunk, UIMessageStreamWriter } from "ai"; export interface EveAgentSessionHandle { sessionId: string; /** Absolute count of NDJSON events consumed from the session stream. */ streamIndex: number; } export interface RunEveAgentTurnOptions { /** Base URL of the deployed eve agent. */ agentUrl: string; /** * Message used when a fresh session must replace an unusable handle, * carrying the prior conversation inlined. Defaults to `message`. */ fallbackMessage?: string; /** Injectable fetch for tests. Defaults to the global `fetch`. */ fetchImpl?: typeof fetch; /** Session handle from a previous turn, if any. */ handle?: EveAgentSessionHandle | null; /** Resolved headers for every request to the agent. */ headers?: HeadersInit; /** * Chunks written immediately after `start` — used for locally computed * `source-url` citations. */ initialChunks?: UIMessageChunk[]; /** The user message (with any docs context already inlined). */ message: string; /** Abort signal from the inbound request; triggers an eve cancel. */ signal?: AbortSignal; writer: UIMessageStreamWriter; } /** * Read the eve session handle persisted on the most recent assistant * message. The handle round-trips through the client: it is written to * message metadata by the `finish` chunk and sent back with the full * message history on the next request. */ export declare const getEveAgentSessionHandle: (messages: UIMessage[]) => EveAgentSessionHandle | null; /** * Resolve the eve agent URL from the route option and site config, and * reject ambiguous responder configuration. Pure so the fail-fast contract * stays unit-testable outside a bundler. */ export declare const resolveEveAgentUrl: ({ configUrl, hasProxy, optionUrl, }: { configUrl?: string; hasProxy: boolean; optionUrl?: string; }) => string | null; /** * Cap the text of the trailing user message. The chat client limits input * to 1000 characters, but the route is publicly reachable and must not * forward arbitrarily large payloads to the agent. */ export declare const capLastUserMessageText: (messages: UIMessage[], limit: number) => UIMessage[]; /** * Inline prior conversation turns into a single message for a fresh eve * session. Used when history exists but no (valid) session handle does — * for example after the client's daily history reset. */ export declare const buildEveAgentTranscript: (messages: UIMessage[], currentMessage: string) => string; /** * Extract http(s) URLs from a tool result so agent-side retrieval can * surface citations. Conservative by design: only string values under * keys named `url` (or `href`) are considered. */ export declare const extractSourceUrls: (value: unknown, limit?: number) => { title?: string; url: string; }[]; /** * Run a single Ask AI turn against a hosted eve agent, writing AI SDK UI * message chunks to the provided writer. */ export declare const runEveAgentTurn: ({ agentUrl, fallbackMessage, fetchImpl, handle, headers, initialChunks, message, signal, writer, }: RunEveAgentTurnOptions) => Promise; //# sourceMappingURL=eve-agent.d.ts.map