export function detectContextPressure(input) {
    const artifactThresholdBytes = input.artifactThresholdBytes ?? 16 * 1024;
    const bytes = input.textBytes ?? 0;
    const tokenRatio = input.contextWindowTokens && input.estimatedTokens ? input.estimatedTokens / input.contextWindowTokens : 0;
    if (bytes >= artifactThresholdBytes * 4 || tokenRatio >= 0.9) {
        return {
            level: "critical",
            shouldArtifact: true,
            shouldSummarize: true,
            reason: "content is too large for safe prompt inclusion",
        };
    }
    if (bytes >= artifactThresholdBytes || tokenRatio >= 0.7) {
        return {
            level: "high",
            shouldArtifact: true,
            shouldSummarize: true,
            reason: "content should be artifacted and summarized",
        };
    }
    if (bytes >= artifactThresholdBytes / 2 || tokenRatio >= 0.5) {
        return {
            level: "medium",
            shouldArtifact: false,
            shouldSummarize: true,
            reason: "content is approaching context pressure",
        };
    }
    return {
        level: "low",
        shouldArtifact: false,
        shouldSummarize: false,
        reason: "content fits normal context handling",
    };
}
//# sourceMappingURL=context-pressure.js.map