const PROVIDER_OPTIONS_ENV_SPEC_ENTRIES = [
    { path: 'provider_options', type: 'json' },
    { path: 'provider_options.codex.network_access', type: 'boolean' },
    { path: 'provider_options.codex.reasoning_effort', type: 'string' },
    { path: 'provider_options.opencode.network_access', type: 'boolean' },
    { path: 'provider_options.opencode.variant', type: 'string' },
    { path: 'provider_options.claude.effort', type: 'string' },
    { path: 'provider_options.claude.sandbox.allow_unsandboxed_commands', type: 'boolean' },
    { path: 'provider_options.claude.sandbox.excluded_commands', type: 'json' },
    { path: 'provider_options.claude_terminal.backend', type: 'string' },
    { path: 'provider_options.claude_terminal.timeout_ms', type: 'number' },
    { path: 'provider_options.claude_terminal.keep_session', type: 'boolean' },
    { path: 'provider_options.claude_terminal.transcript_poll_interval_ms', type: 'number' },
    { path: 'provider_options.copilot.effort', type: 'string' },
];
const PROVIDER_OPTIONS_TRACE_PATH_ENTRIES = [
    'provider_options',
    'provider_options.codex',
    'provider_options.codex.network_access',
    'provider_options.codex.reasoning_effort',
    'provider_options.opencode',
    'provider_options.opencode.network_access',
    'provider_options.opencode.variant',
    'provider_options.claude',
    'provider_options.claude.allowed_tools',
    'provider_options.claude.effort',
    'provider_options.claude.sandbox',
    'provider_options.claude.sandbox.allow_unsandboxed_commands',
    'provider_options.claude.sandbox.excluded_commands',
    'provider_options.claude_terminal',
    'provider_options.claude_terminal.backend',
    'provider_options.claude_terminal.timeout_ms',
    'provider_options.claude_terminal.keep_session',
    'provider_options.claude_terminal.transcript_poll_interval_ms',
    'provider_options.copilot',
    'provider_options.copilot.effort',
];
const PROVIDER_OPTIONS_INTERNAL_PATH_ENTRIES = [
    'codex.networkAccess',
    'codex.reasoningEffort',
    'opencode.networkAccess',
    'opencode.variant',
    'claude.allowedTools',
    'claude.effort',
    'claude.sandbox.allowUnsandboxedCommands',
    'claude.sandbox.excludedCommands',
    'claudeTerminal.backend',
    'claudeTerminal.timeoutMs',
    'claudeTerminal.keepSession',
    'claudeTerminal.transcriptPollIntervalMs',
    'copilot.effort',
];
export const PROVIDER_OPTIONS_ENV_SPECS = PROVIDER_OPTIONS_ENV_SPEC_ENTRIES;
export const PROVIDER_OPTIONS_TRACE_PATHS = PROVIDER_OPTIONS_TRACE_PATH_ENTRIES;
export const PROVIDER_OPTIONS_TRACKED_KEYS = [
    'provider_options',
    'provider_options.codex',
    'provider_options.opencode',
    'provider_options.claude',
    'provider_options.claude.sandbox',
    'provider_options.claude_terminal',
    'provider_options.copilot',
    ...PROVIDER_OPTIONS_ENV_SPEC_ENTRIES.map((spec) => spec.path).filter((path) => path !== 'provider_options'),
    'provider_options.claude.allowed_tools',
];
export function hasProviderOptionsPath(providerOptions, path) {
    if (!providerOptions) {
        return false;
    }
    if (path.length === 0) {
        return true;
    }
    let current = providerOptions;
    for (const segment of path.split('.')) {
        if (typeof current !== 'object' || current === null || !(segment in current)) {
            return false;
        }
        current = current[segment];
    }
    return current !== undefined;
}
export function getPresentProviderOptionPaths(providerOptions) {
    return PROVIDER_OPTIONS_INTERNAL_PATH_ENTRIES.filter((path) => hasProviderOptionsPath(providerOptions, path));
}
export function toProviderOptionsTracePath(path) {
    if (path.length === 0) {
        return 'provider_options';
    }
    const converted = path.split('.').map((segment) => {
        if (segment === 'networkAccess')
            return 'network_access';
        if (segment === 'allowedTools')
            return 'allowed_tools';
        if (segment === 'allowUnsandboxedCommands')
            return 'allow_unsandboxed_commands';
        if (segment === 'excludedCommands')
            return 'excluded_commands';
        return segment.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
    });
    return `provider_options.${converted.join('.')}`;
}
//# sourceMappingURL=providerOptionsContract.js.map