import { SUMMARY_LENGTH_MAX_CHARACTERS } from "../prompts/index.js";
import { resolveTargetCharacters } from "../shared/summary-length.js";
export function resolveDesiredOutputTokens({ lengthArg, maxOutputTokensArg, }) {
    if (typeof maxOutputTokensArg === "number")
        return maxOutputTokensArg;
    const targetChars = resolveTargetCharacters(lengthArg, SUMMARY_LENGTH_MAX_CHARACTERS);
    if (!Number.isFinite(targetChars) ||
        targetChars <= 0 ||
        targetChars === Number.POSITIVE_INFINITY) {
        return null;
    }
    // Rough heuristic (chars → tokens). Used for auto selection + cost estimation.
    return Math.max(16, Math.ceil(targetChars / 4));
}
//# sourceMappingURL=output-policy.js.map