import type { ToolPermission } from '../../../contexts/McpContext';
import type { McpClient } from 'react-mcp-hook/client';
export type OllamaChatMessageRole = 'system' | 'user' | 'assistant' | 'tool';
export interface OllamaChatMessage {
    role: OllamaChatMessageRole;
    content: string;
    name?: string;
    tool_call_id?: string;
    tool_calls?: OllamaToolCallPayload[];
}
export interface OllamaToolCallPayload {
    id: string;
    type: 'function';
    function: {
        name: string;
        arguments: unknown;
    };
}
export interface OllamaToolDefinition {
    name: string;
    description?: string;
    parameters?: Record<string, unknown>;
}
export interface OllamaStreamEvent {
    message?: {
        role?: string;
        content?: string;
        tool_calls?: OllamaToolCallLike[];
    };
    response?: string;
    tool_calls?: OllamaToolCallLike[];
    done?: boolean;
    error?: string | {
        message?: string;
        code?: string | number;
        [key: string]: unknown;
    };
    [key: string]: unknown;
}
export interface OllamaToolCallLike {
    id?: string;
    type?: string;
    name?: string;
    function?: {
        name?: string;
        arguments?: unknown;
    };
    arguments?: unknown;
}
export interface NormalizedToolCall {
    callId: string;
    toolName: string;
    arguments: string;
    parsedArguments?: unknown;
}
export type OllamaPreparedToolKind = 'mcp' | 'attachment';
interface BasePreparedOllamaTool {
    kind: OllamaPreparedToolKind;
    uniqueName: string;
    originalName: string;
    serverId: string;
    serverName?: string;
    permission: ToolPermission;
    description?: string;
    parameters?: unknown;
}
export interface PreparedMcpTool extends BasePreparedOllamaTool {
    kind: 'mcp';
    client: McpClient;
}
export interface PreparedAttachmentTool extends BasePreparedOllamaTool {
    kind: 'attachment';
    execute: (input: Record<string, unknown> | undefined) => Promise<Record<string, unknown>>;
}
export type PreparedOllamaTool = PreparedMcpTool | PreparedAttachmentTool;
export interface OllamaToolContext {
    definitions: OllamaToolDefinition[];
    toolsByName: Map<string, PreparedOllamaTool>;
    dispose: () => Promise<void>;
}
export type PendingToolCallStatus = 'pending' | 'approved' | 'rejected' | 'consumed';
export interface PendingToolCallRecord {
    callId: string;
    toolUniqueName: string;
    toolDisplayName: string;
    serverId: string;
    serverName?: string;
    arguments: string;
    status: PendingToolCallStatus;
    reason?: string;
}
export interface SerializedOllamaRunState {
    version: 1;
    conversation: OllamaChatMessage[];
    calls: PendingToolCallRecord[];
}
export {};
//# sourceMappingURL=types.d.ts.map