import { i as normalizeFastMode } from "./string-coerce-mnp54Vah.js";
import "./agent-scope-CMwhTQTF.js";
import { r as resolveAgentConfig } from "./agent-scope-config-Di1rn1p5.js";
import { n as modelKey } from "./model-ref-shared-BsJ88G1i.js";
//#region src/agents/fast-mode.ts
/**
* Resolves fast-mode state from agent config and runtime defaults.
*/
function resolveConfiguredFastModeRaw(params) {
	const modelConfig = params.cfg?.agents?.defaults?.models?.[modelKey(params.provider, params.model)];
	return modelConfig?.params?.fastMode ?? modelConfig?.params?.fast_mode;
}
/** Resolve the effective fast-mode setting and its source. */
function resolveFastModeState(params) {
	const sessionOverride = normalizeFastMode(params.sessionEntry?.fastMode);
	if (sessionOverride !== void 0) return {
		enabled: sessionOverride,
		source: "session"
	};
	const agentDefault = params.agentId && params.cfg ? resolveAgentConfig(params.cfg, params.agentId)?.fastModeDefault : void 0;
	if (typeof agentDefault === "boolean") return {
		enabled: agentDefault,
		source: "agent"
	};
	const configured = normalizeFastMode(resolveConfiguredFastModeRaw(params));
	if (configured !== void 0) return {
		enabled: configured,
		source: "config"
	};
	return {
		enabled: false,
		source: "default"
	};
}
//#endregion
export { resolveFastModeState as t };
