/**
 * Generates a claude CLI command string with correct flags
 */
export function buildClaudeCommand(opts) {
    const parts = ['claude'];
    if (opts.nonInteractive === true) {
        parts.push('-p', `"${opts.prompt}"`);
    }
    else {
        parts.push(`"${opts.prompt}"`);
    }
    if (opts.outputFormat !== undefined && opts.outputFormat !== 'text') {
        parts.push('--output-format', opts.outputFormat);
    }
    if (opts.permissionMode !== undefined && opts.permissionMode !== 'default') {
        parts.push('--permission-mode', opts.permissionMode);
    }
    if (opts.allowedTools !== undefined && opts.allowedTools.length > 0) {
        parts.push('--allowedTools', opts.allowedTools.join(','));
    }
    return parts.join(' ');
}
/**
 * Generates a stream-json pipeline command: claude -p "..." --output-format stream-json | jq '...'
 */
export function generateStreamJsonPipeline(prompt, jqFilter) {
    const claudeCmd = buildClaudeCommand({
        prompt,
        outputFormat: 'stream-json',
        nonInteractive: true,
    });
    const filter = jqFilter ?? '.';
    return `${claudeCmd} | jq '${filter}'`;
}
/**
 * Returns the recommended permission mode for a given CI job type
 */
export function getJobPermissionMode(jobType) {
    switch (jobType) {
        case 'validate':
            return 'plan';
        case 'lint':
            return 'dontAsk';
        case 'migrate':
            return 'auto';
        case 'container':
            return 'bypassPermissions';
        case 'review':
            return 'acceptEdits';
    }
}
//# sourceMappingURL=output-formats.js.map