export function shouldReground(state) {
    return state.compactionOccurred && !state.alreadyInjected;
}
export function buildRegroundingMessage(originalRequest) {
    const trimmed = originalRequest.trim();
    const pin = trimmed.length > 0
        ? `\n\nThe user's original request was:\n\n  ${trimmed}\n\n`
        : " The original request is in the earlier messages that remain. ";
    return {
        role: "user",
        content: "Re-ground. The conversation was just compacted, so earlier detail is now a summary and " +
            "easy to drift from." +
            pin +
            "Before continuing, re-anchor on two things: that original request, and the specific " +
            "objective you're working on right now. Verify your next step still serves the original " +
            "ask \u2014 not a reshaped or narrowed version of it. If the summary dropped a constraint, " +
            "file, or requirement you were tracking, recover it from the messages that remain before " +
            "acting. Then continue. Do not restate this note; just proceed correctly.",
    };
}
//# sourceMappingURL=regrounding.js.map