import { normalizeVerificationOutput } from './verification-dag.js';
export class VerificationArtifactLock {
    cwd;
    locked = new Set();
    constructor(cwd = process.cwd()) {
        this.cwd = cwd;
    }
    canAcquire(outputs = []) {
        return outputs.every((output) => !this.locked.has(normalizeVerificationOutput(output, this.cwd)));
    }
    acquire(outputs = []) {
        if (!this.canAcquire(outputs))
            throw new Error('verification artifact output already locked');
        for (const output of outputs)
            this.locked.add(normalizeVerificationOutput(output, this.cwd));
    }
    release(outputs = []) {
        for (const output of outputs)
            this.locked.delete(normalizeVerificationOutput(output, this.cwd));
    }
}
//# sourceMappingURL=verification-artifact-lock.js.map