import WarpError from "../errors/WarpError.js";
import { CheckpointArtifact } from "./CheckpointArtifact.js";
/** Carries the full CRDT state for checkpoint recovery. */
export class StateArtifact extends CheckpointArtifact {
    state;
    constructor({ schemaVersion, state }) {
        super({ schemaVersion });
        if (state === null || state === undefined) {
            throw new WarpError('StateArtifact requires a state', 'E_INVALID_ARTIFACT');
        }
        this.state = state;
        Object.freeze(this);
    }
}
