/**
 * Canonical error classes for @connexum/ai-governance.
 *
 * UnboundDataError is the single authoritative implementation.
 * Every adapter-specific variant (AdkUnboundDataError, BedrockUnboundDataError, etc.)
 * re-exports or aliases this class so a `catch (e instanceof UnboundDataError)` at
 * the server boundary matches all adapter origins.
 *
 * Fix: C2 -- consolidate UnboundDataError (post-review remediation 2026-04-24)
 * @connexum/ai-governance
 */
// ---------------------------------------------------------------------------
// UnboundDataError -- canonical implementation
// ---------------------------------------------------------------------------
/**
 * Thrown when a record or action carries an empty packBinding.
 *
 * Pack-binding primacy (Thomas Directive, 2026-04-22):
 *   Every catalogued / stored record MUST carry a non-empty packBinding.
 *   Retention, approval, reviewer tier, sovereignty, report scoping ALL derive
 *   from the binding. Empty binding throws UnboundDataError. Un-binding before
 *   retention window elapses is refused.
 */
export class UnboundDataError extends Error {
    writeSite;
    tenantId;
    constructor(writeSite, tenantId) {
        super(`UnboundDataError: empty packBinding for write site "${writeSite}", ` +
            `tenant "${tenantId}". Every record must carry at least one compliance pack binding.`);
        this.name = 'UnboundDataError';
        this.writeSite = writeSite;
        this.tenantId = tenantId;
        // Maintain proper prototype chain for instanceof checks
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
// ---------------------------------------------------------------------------
// Adapter-specific subclasses
//
// These are distinct classes (not aliases) so that err.constructor.name returns
// the adapter-specific name in test assertions. Each subclass still passes an
// `instanceof UnboundDataError` check at the server boundary.
// ---------------------------------------------------------------------------
/** @extends UnboundDataError -- Google ADK adapter */
export class AdkUnboundDataError extends UnboundDataError {
    constructor(writeSite, tenantId) {
        super(writeSite, tenantId);
        this.name = 'AdkUnboundDataError';
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
/** @extends UnboundDataError -- Bedrock AgentCore adapter */
export class BedrockUnboundDataError extends UnboundDataError {
    constructor(writeSite, tenantId) {
        super(writeSite, tenantId);
        this.name = 'BedrockUnboundDataError';
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
/** @extends UnboundDataError -- Haystack adapter */
export class HaystackUnboundDataError extends UnboundDataError {
    constructor(writeSite, tenantId) {
        super(writeSite, tenantId);
        this.name = 'HaystackUnboundDataError';
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
/** @extends UnboundDataError -- LlamaIndex adapter */
export class LlamaIndexUnboundDataError extends UnboundDataError {
    constructor(writeSite, tenantId) {
        super(writeSite, tenantId);
        this.name = 'LlamaIndexUnboundDataError';
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
/** @extends UnboundDataError -- OpenClaw adapter */
export class OpenClawUnboundDataError extends UnboundDataError {
    constructor(writeSite, tenantId) {
        super(writeSite, tenantId);
        this.name = 'OpenClawUnboundDataError';
        Object.setPrototypeOf(this, new.target.prototype);
    }
}
//# sourceMappingURL=index.js.map