/**
 * Typed error classes for the governance layer.
 *
 * New errors are added here rather than inline in modules so they can be caught
 * by name across the codebase without circular imports.
 *
 * @connexum/ai-governance  feat/capability-licensing-pr-a-publish-validator
 */
/**
 * Thrown by buildCompanyPack() when a proposed rule references a capability
 * that belongs to a vertical pack the organisation has not licensed.
 *
 * Callers (e.g. the onboarding route) should map this to a 422 response with
 * the structured error body defined in the spec.
 */
export class UnlicensedCapabilityError extends Error {
    ruleId;
    capability;
    packId;
    packName;
    constructor(ctx) {
        super(`Capability '${ctx.capability}' requires the '${ctx.packName}' ` +
            `add-on (pack ID: ${ctx.packId}). Upgrade to publish this rule.`);
        this.name = 'UnlicensedCapabilityError';
        this.ruleId = ctx.ruleId;
        this.capability = ctx.capability;
        this.packId = ctx.packId;
        this.packName = ctx.packName;
        // Maintains correct instanceof chain in transpiled code.
        Object.setPrototypeOf(this, UnlicensedCapabilityError.prototype);
    }
}
//# sourceMappingURL=errors.js.map