//#region src/agent/transcript/thinking-types.ts
/**
* Normalize a raw string to ThinkLevel.
* Handles various aliases and formats.
*/
function normalizeThinkLevel(raw) {
	if (!raw) return;
	const key = raw.trim().toLowerCase();
	const collapsed = key.replace(/[\s_-]+/g, "");
	if (collapsed === "adaptive" || collapsed === "auto") return "adaptive";
	if (collapsed === "xhigh" || collapsed === "extrahigh") return "xhigh";
	if ([
		"off",
		"disable",
		"disabled"
	].includes(key)) return "off";
	if ([
		"on",
		"enable",
		"enabled"
	].includes(key)) return "low";
	if (["min", "minimal"].includes(key)) return "minimal";
	if ([
		"low",
		"thinkhard",
		"think-hard",
		"think_hard"
	].includes(key)) return "low";
	if ([
		"mid",
		"med",
		"medium",
		"thinkharder",
		"think-harder",
		"harder"
	].includes(key)) return "medium";
	if ([
		"high",
		"ultra",
		"ultrathink",
		"think-hard",
		"thinkhardest",
		"highest",
		"max"
	].includes(key)) return "high";
	if (["think"].includes(key)) return "minimal";
}
/**
* Normalize a raw string to ReasoningLevel.
*/
function normalizeReasoningLevel(raw) {
	if (!raw) return;
	const key = raw.toLowerCase();
	if ([
		"off",
		"false",
		"no",
		"0",
		"hide",
		"hidden",
		"disable",
		"disabled"
	].includes(key)) return "off";
	if ([
		"on",
		"true",
		"yes",
		"1",
		"show",
		"visible",
		"enable",
		"enabled"
	].includes(key)) return "on";
	if ([
		"stream",
		"streaming",
		"draft",
		"live"
	].includes(key)) return "stream";
}
/**
* Normalize a raw string to VerboseLevel.
*/
function normalizeVerboseLevel(raw) {
	if (!raw) return;
	const key = raw.toLowerCase();
	if ([
		"off",
		"false",
		"no",
		"0"
	].includes(key)) return "off";
	if ([
		"full",
		"all",
		"everything"
	].includes(key)) return "full";
	if ([
		"on",
		"true",
		"yes",
		"1",
		"enable",
		"enabled"
	].includes(key)) return "on";
}
/**
* Normalize a raw string to ElevatedMode.
*/
function normalizeElevatedMode(raw) {
	if (!raw) return;
	const key = raw.toLowerCase();
	if ([
		"off",
		"false",
		"no",
		"0"
	].includes(key)) return "off";
	if ([
		"full",
		"auto",
		"auto-approve",
		"autoapprove"
	].includes(key)) return "full";
	if ([
		"ask",
		"prompt",
		"approval",
		"approve"
	].includes(key)) return "ask";
}
/**
* Get available thinking levels for a provider/model.
* Returns ['off', 'on'] for binary providers like z.ai.
*/
function listThinkingLevels(provider, model) {
	const normalizedProvider = provider?.trim().toLowerCase();
	if (normalizedProvider === "z.ai" || normalizedProvider === "zai") return ["off", "on"];
	const levels = [
		"off",
		"minimal",
		"low",
		"medium",
		"high"
	];
	const normalizedModel = model?.trim().toLowerCase();
	if (normalizedModel && [
		"gpt-5.4",
		"gpt-5.4-pro",
		"gpt-5.2"
	].some((m) => normalizedModel.includes(m))) levels.push("xhigh");
	levels.push("adaptive");
	return levels;
}
/**
* Format thinking levels as a comma-separated string for display.
*/
function formatThinkingLevels(provider, model) {
	return listThinkingLevels(provider, model).join(", ");
}
/**
* Convert ThinkLevel to a numeric value for comparison.
* Higher value = more thinking.
*/
function thinkLevelToNumber(level) {
	return {
		off: 0,
		minimal: 1,
		low: 2,
		medium: 3,
		high: 4,
		xhigh: 5,
		adaptive: 3
	}[level];
}
//#endregion
export { formatThinkingLevels, listThinkingLevels, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, thinkLevelToNumber };

//# sourceMappingURL=thinking-types.js.map