import { resolveReasoningLevel, resolveThinkingLevel } from "./config-store.js";
import { normalizeThinkLevel } from "../agent/transcript/thinking-types.js";
//#region src/session/thinking-resolve.ts
const FALLBACK = "medium";
/**
* @param requestOverride - Raw value from HTTP/API (e.g. Web pill); wins over persisted session when valid.
*/
async function resolveEffectiveThinkingLevel(sessionConfigStore, sessionKey, requestOverride, agentDefault) {
	const fromRequest = normalizeThinkLevel(requestOverride ?? void 0);
	if (fromRequest !== void 0) return fromRequest;
	const fromSession = await resolveThinkingLevel(sessionConfigStore, sessionKey, agentDefault);
	if (fromSession !== void 0) return fromSession;
	return agentDefault ?? FALLBACK;
}
const REASONING_FALLBACK = "stream";
/**
* Session override > agent default (`agents.defaults.reasoningDefault`).
*/
async function resolveEffectiveReasoningLevel(sessionConfigStore, sessionKey, agentDefault) {
	const def = agentDefault ?? REASONING_FALLBACK;
	return await resolveReasoningLevel(sessionConfigStore, sessionKey, def) ?? def;
}
//#endregion
export { resolveEffectiveReasoningLevel, resolveEffectiveThinkingLevel };

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