import { callKiro } from '../kiro/index.js';
import { resolveKiroApiKey, resolveKiroCliPath } from '../config/index.js';
import { createLogger } from '../../shared/utils/index.js';
const log = createLogger('kiro-provider');
function toKiroOptions(options, systemPrompt) {
    if (options.allowedTools && options.allowedTools.length > 0) {
        log.info('Kiro provider does not support allowedTools; ignoring');
    }
    if (options.mcpServers && Object.keys(options.mcpServers).length > 0) {
        log.info('Kiro provider does not support mcpServers; ignoring');
    }
    if (options.maxTurns !== undefined) {
        log.info('Kiro provider does not support maxTurns; ignoring');
    }
    if (options.outputSchema) {
        log.info('Kiro provider does not support outputSchema; ignoring');
    }
    if (options.model) {
        log.info('Kiro provider does not support model CLI flag; ignoring');
    }
    return {
        cwd: options.cwd,
        abortSignal: options.abortSignal,
        sessionId: options.sessionId,
        systemPrompt,
        permissionMode: options.permissionMode,
        onStream: options.onStream,
        kiroApiKey: options.kiroApiKey ?? resolveKiroApiKey(),
        kiroCliPath: resolveKiroCliPath(),
    };
}
export class KiroProvider {
    supportsStructuredOutput = false;
    setup(config) {
        const { name, systemPrompt } = config;
        return {
            call: async (prompt, options) => {
                return callKiro(name, prompt, toKiroOptions(options, systemPrompt));
            },
        };
    }
}
//# sourceMappingURL=kiro.js.map