import type { ChatMessageToolCall, ResponsesOutputItemFunctionCall, ResponsesOutputItemFunctionCallStatusUnion } from '@openrouter/sdk/models'; import type { Step } from './schemas'; export type DevtoolsToolCallStatus = 'pending' | 'succeeded' | 'failed'; export type SdkToolCallStatus = ResponsesOutputItemFunctionCallStatusUnion; /** * Extended tool call type based on OpenRouter SDK types. * * This type wraps ResponsesOutputItemFunctionCall and adds devtools-specific * enrichment fields like input/output summaries and error details. * * @example * ```typescript * const toolCall: ExtendedToolCall = { * id: 'call_123', * name: 'get_weather', * arguments: '{"city":"SF"}', * input: { city: 'SF' }, * status: 'succeeded', * input_summary: null, * output: { temp: 72 }, * output_summary: null, * error: null, * }; * ``` */ export interface ExtendedToolCall { id: string; name: string; arguments: string; sdkStatus?: SdkToolCallStatus; status: DevtoolsToolCallStatus; input: unknown; input_summary: string | null; output: unknown | null; output_summary: string | null; error: { message: string; type: string | null; } | null; } /** * @deprecated Use ExtendedToolCall instead. Will be removed in v1.0.0 */ export type ToolCall = ExtendedToolCall; export type StepCategory = 'tool-call' | 'response' | 'error' | 'stream'; /** * Convert SDK status to devtools status. * Priority: error > SDK status > output presence */ export declare function sdkToDevtoolsStatus(sdkStatus: SdkToolCallStatus | undefined, hasOutput: boolean, hasError: boolean): DevtoolsToolCallStatus; /** * Convert devtools status to SDK status */ export declare function devtoolsToSdkStatus(status: DevtoolsToolCallStatus): SdkToolCallStatus; /** * Convert ResponsesOutputItemFunctionCall to ExtendedToolCall */ export declare function sdkFunctionCallToExtended(sdkCall: ResponsesOutputItemFunctionCall, output?: unknown, error?: { message: string; type: string | null; }): ExtendedToolCall; /** * Convert ChatMessageToolCall (OpenAI format) to ExtendedToolCall */ export declare function chatToolCallToExtended(chatCall: ChatMessageToolCall, output?: unknown, error?: { message: string; type: string | null; }): ExtendedToolCall; /** * Extract tool calls from response content */ export declare function extractToolCalls(content: unknown): ToolCall[]; /** * Categorize a step based on its content */ export declare function categorizeStep(step: Partial): StepCategory; //# sourceMappingURL=analysis.d.ts.map