/**
 * GenericProviderAdapter — wraps the existing provider system into ProviderAdapter interface.
 *
 * This is the bridge between the old provider system and the new ProviderAdapter abstraction.
 * Each provider (kimi, deepseek, openai, etc.) can be wrapped with this adapter.
 */
/**
 * Create a ProviderAdapter from a send function.
 * This is the simplest way to wrap an existing provider.
 */
export function createGenericProviderAdapter(options) {
    return {
        name: options.name,
        supportsStreaming: options.supportsStreaming ?? true,
        supportsToolCalling: options.supportsToolCalling ?? false,
        supportsMcp: options.supportsMcp ?? false,
        send: options.sendFn,
        abort: options.abortFn,
    };
}
/**
 * Create a mock provider adapter for testing.
 */
export function createMockProviderAdapter(name = "mock", responses = ["OK"]) {
    let responseIndex = 0;
    return {
        name,
        supportsStreaming: true,
        supportsToolCalling: false,
        supportsMcp: false,
        async *send(_request) {
            const response = responses[responseIndex % responses.length];
            responseIndex++;
            yield { type: "text", content: response };
            yield { type: "done" };
        },
    };
}
