import { collectArtifactObligationFailures, compileArtifactObligations, hasCompletionGuardTool, } from "../artifact-obligations.js";
import { findLatestUserMessage } from "./tool-constraint.js";
export function compileReplayArtifactObligations(input) {
    if (!hasCompletionGuardTool(input.availableTools)) {
        return [];
    }
    return (input.payloadArtifactObligations ??
        compileArtifactObligations({
            artifactProducing: true,
            cwd: input.cwd,
            messages: input.messages,
            objective: input.objective ??
                findLatestUserMessage(input.messages) ??
                "Continue the current objective.",
        }));
}
export async function collectReplayArtifactObligationFailures(input) {
    return collectArtifactObligationFailures(input.artifactObligations, input.cwd, {
        evidenceRecords: await input.runtime.evidenceList({
            threadId: input.turn.threadId,
            turnId: input.turn.id,
        }),
    });
}
//# sourceMappingURL=provider-replay-deliverable-repair.js.map