/** * Provider-native message history adapters. * * Ported from PSYCHE src/llm/history_adapters.py. Each adapter knows how to * format assistant tool-call messages and tool-result messages in the native * shape expected by its provider SDK. * * @task T1394 (T1386-W8) * @epic T1386 */ import type { CompletionResult } from './backend.js'; /** Protocol for history adapters. */ export interface HistoryAdapter { formatAssistantToolMessage(result: CompletionResult): Record; formatToolResults(toolResults: Array<{ toolId: string; toolName: string; result: unknown; isError?: boolean; }>): Array>; } /** Anthropic-native tool message formatting. */ export declare class AnthropicHistoryAdapter implements HistoryAdapter { formatAssistantToolMessage(result: CompletionResult): Record; formatToolResults(toolResults: Array<{ toolId: string; toolName: string; result: unknown; isError?: boolean; }>): Array>; } /** Gemini-native tool message formatting. */ export declare class GeminiHistoryAdapter implements HistoryAdapter { formatAssistantToolMessage(result: CompletionResult): Record; formatToolResults(toolResults: Array<{ toolId: string; toolName: string; result: unknown; isError?: boolean; }>): Array>; } /** OpenAI-native tool message formatting. */ export declare class OpenAIHistoryAdapter implements HistoryAdapter { formatAssistantToolMessage(result: CompletionResult): Record; formatToolResults(toolResults: Array<{ toolId: string; toolName: string; result: unknown; isError?: boolean; }>): Array>; } /** * Provider-appropriate HistoryAdapter for assistant/tool message formatting. * * Relocated from `registry.ts` as part of D-ph4-01 factory retirement * (T9356/T9369). Lives here alongside the adapter classes it constructs. * * @param provider - Target transport identifier. * @returns A history adapter appropriate for the provider wire format. */ export declare function historyAdapterForProvider(provider: string): HistoryAdapter; //# sourceMappingURL=history-adapters.d.ts.map