/**
 * Typed errors for the handoff state machine.
 *
 * See session-hierarchy.md §5.1 (illegal `active → locked` transition) and
 * §6.4 (concurrent CAS). Both classes carry structured `details` so consumers
 * can route without string parsing (Convention #5: deny-by-default, fail
 * fast).
 */
/**
 * Raised when a handoff's CAS write finds {@link Session.ownerVersion} has
 * advanced since the assignment was constructed — another actor committed
 * first (session-hierarchy.md §6.4 concurrent CAS). The caller re-reads and
 * decides whether to retry.
 */
export class HandoffVersionConflict extends Error {
    details;
    constructor(details) {
        super(`Handoff version conflict on ${details.sessionId}: expected ${details.expected}, actual ${details.actual}`);
        this.name = 'HandoffVersionConflict';
        this.details = details;
    }
}
/**
 * Raised when a handoff targets a session whose current Run is non-terminal.
 * Callers must wait for the active Run to terminalize (or cancel it) before
 * re-attempting the handoff (session-hierarchy.md §5.1).
 */
export class HandoffLockRejected extends Error {
    details;
    constructor(details) {
        super(`Handoff lock rejected on ${details.sessionId}: ${details.reason}`);
        this.name = 'HandoffLockRejected';
        this.details = details;
    }
}
//# sourceMappingURL=version.js.map