import { I as IAgentService } from '../agent-CW9XbmG_.js';
import { V as VercelAIBackendOptions } from '../backends-BSrsBYFn.js';
import 'zod';
import '../errors-C-so0M4t.js';

/** @internal Vercel AI SDK tool result */
interface SDKToolDefinition {
    description: string;
    inputSchema: unknown;
    execute?: (input: unknown, options: unknown) => Promise<unknown>;
    needsApproval?: boolean | ((input: unknown, options: unknown) => Promise<boolean>);
}
/** @internal Vercel AI SDK v6 generateText result */
interface SDKGenerateTextResult {
    text: string;
    toolCalls: Array<{
        toolCallId: string;
        toolName: string;
        input: unknown;
    }>;
    toolResults: Array<{
        toolCallId: string;
        toolName: string;
        output: unknown;
    }>;
    steps: Array<{
        text: string;
        toolCalls: Array<{
            toolCallId: string;
            toolName: string;
            input: unknown;
        }>;
        toolResults: Array<{
            toolCallId: string;
            toolName: string;
            output: unknown;
        }>;
        usage: {
            inputTokens?: number;
            outputTokens?: number;
        };
        finishReason: string;
    }>;
    totalUsage: {
        inputTokens?: number;
        outputTokens?: number;
    };
    finishReason: string;
    response: {
        messages: unknown[];
    };
}
/** @internal Vercel AI SDK generateObject result */
interface SDKGenerateObjectResult {
    object: unknown;
    usage: {
        inputTokens?: number;
        outputTokens?: number;
    };
}
/** @internal Vercel AI SDK streamText result */
interface SDKStreamTextResult {
    fullStream: AsyncIterable<SDKStreamPart>;
    totalUsage: PromiseLike<{
        inputTokens?: number;
        outputTokens?: number;
    }>;
    text: PromiseLike<string>;
}
/** @internal Vercel AI SDK v6 stream part union */
type SDKStreamPart = {
    type: "text-delta";
    text: string;
} | {
    type: "tool-call";
    toolCallId: string;
    toolName: string;
    input: unknown;
} | {
    type: "tool-result";
    toolCallId: string;
    toolName: string;
    output: unknown;
} | {
    type: "tool-error";
    toolCallId: string;
    toolName: string;
    error: unknown;
} | {
    type: "reasoning-start";
} | {
    type: "reasoning-end";
} | {
    type: "reasoning-delta";
    text: string;
} | {
    type: "finish-step";
    usage: {
        inputTokens?: number;
        outputTokens?: number;
    };
    finishReason: string;
} | {
    type: "finish";
    finishReason: string;
    totalUsage: {
        inputTokens?: number;
        outputTokens?: number;
    };
} | {
    type: "error";
    error: unknown;
} | {
    type: string;
};
/** @internal Vercel AI SDK LanguageModel — opaque type from SDK */
type SDKLanguageModel = Record<string, unknown>;
/** @internal SDK module shape */
interface SDKModule {
    generateText: (options: Record<string, unknown>) => Promise<SDKGenerateTextResult>;
    streamText: (options: Record<string, unknown>) => SDKStreamTextResult;
    generateObject: (options: Record<string, unknown>) => Promise<SDKGenerateObjectResult>;
    tool: (options: Record<string, unknown>) => SDKToolDefinition;
    jsonSchema: (schema: unknown) => unknown;
    stepCountIs: (count: number) => unknown;
}
/** @internal OpenAI-compatible module shape */
interface SDKCompatModule {
    createOpenAICompatible: (options: Record<string, unknown>) => {
        chatModel: (modelId: string) => SDKLanguageModel;
        languageModel: (modelId: string) => SDKLanguageModel;
    };
}
/** @internal For testing: inject mock SDK module */
declare function _injectSDK(mock: SDKModule | null): void;
/** @internal For testing: inject mock compat module */
declare function _injectCompat(mock: SDKCompatModule | null): void;
/** @internal For testing: reset injected SDK */
declare function _resetSDK(): void;
/** Create Vercel AI SDK backend service. */
declare function createVercelAIService(options: VercelAIBackendOptions): IAgentService;

export { VercelAIBackendOptions, _injectCompat, _injectSDK, _resetSDK, createVercelAIService };
