import { type AnalyticsInjectableJsonSchema } from './analytics-parameters'; import { type LoggerFn } from './logger'; export declare const CONVERSATION_ID_PARAM_NAME = "conversation_id"; export interface ConversationIdInjectableTool { inputSchema?: AnalyticsInjectableJsonSchema; name?: string; [key: string]: unknown; } export declare function addConversationIdToTool(tool: TTool, logger?: LoggerFn): TTool; /** * Injects `conversation_id` across a tool listing, including the virtual * `get_more_tools` tool. Its calls publish `$mcp_missing_capability`, and a * capability gap is only meaningful next to the work that hit it — so it belongs * in the same session as the surrounding tool calls. */ export declare function addConversationIdToTools(tools: TTool[], logger?: LoggerFn): TTool[]; export type ConversationIdResolution = { minted: false; conversationId: string | undefined; } | { minted: true; conversationId: string; }; /** * Decides which conversation_id to use for a tool call: * - disabled → none * - agent echoed a handle we could have minted → use it * - anything else → mint a fresh one * * The shape check matters because this value becomes `$session_id`, and the * derivation is deterministic so that two pods agree — which also means two * *callers* sending the same string land in the same session. The strings agents * invent are not random (`conv-1`, `1`, `session`), so trusting them verbatim * would silently merge unrelated conversations, potentially across users. Shape * rather than a registry of issued ids, because a per-request server has no * memory of what it minted. Residual risk and why it's accepted: ADR-0004. */ export declare function resolveConversationId(enabled: boolean, args: unknown): ConversationIdResolution; /** * Whether the prompt-back can ride this result's `content`. The only requirement * is an array to append to. * * Errored results included on purpose. A tool that fails on the first call of a * conversation is exactly when the agent needs the session handle: without it the * retry starts a fresh conversation, so the failure and its fix land in different * sessions. */ export declare function canInjectConversationIdPromptBack(result: unknown): boolean; export declare function extractConversationId(args: unknown): string | undefined; export declare function stripConversationId(args: unknown): unknown; export declare function buildConversationIdPromptBack(conversationId: string): { type: 'text'; text: string; }; export declare function injectConversationIdPromptBack(result: unknown, conversationId: string): unknown; //# sourceMappingURL=conversation-id.d.ts.map