export const PI_NEW_SESSION_OPTION_THINKING_LEVEL = 'piThinkingLevel';
export const PI_THINKING_LEVEL_ENV = 'HAPPIER_PI_THINKING_LEVEL';
export const PI_THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh'];
const PI_THINKING_LEVELS_SET = new Set(PI_THINKING_LEVELS);
export function normalizePiThinkingLevel(value) {
    if (typeof value !== 'string')
        return null;
    const normalized = value.trim().toLowerCase();
    if (!normalized)
        return null; // empty means "use Pi default"
    return PI_THINKING_LEVELS_SET.has(normalized) ? normalized : null;
}
export function applyPiThinkingLevelEnv(environmentVariables, thinkingLevelRaw) {
    const thinkingLevel = normalizePiThinkingLevel(thinkingLevelRaw);
    if (!thinkingLevel)
        return environmentVariables;
    return {
        ...(environmentVariables ?? {}),
        [PI_THINKING_LEVEL_ENV]: thinkingLevel,
    };
}
export function resolvePiThinkingLevelFromEnv(env) {
    const raw = env[PI_THINKING_LEVEL_ENV];
    return normalizePiThinkingLevel(raw);
}
//# sourceMappingURL=thinking.js.map