export class ActionRegistrationError extends Error {
    code = 'action_registration_error';
    constructor(message) {
        super(message);
        this.name = 'ActionRegistrationError';
    }
}
export class ActionNotFoundError extends Error {
    code = 'action_not_found';
    action;
    constructor(action) {
        super(`No action registered for '${action}'`);
        this.name = 'ActionNotFoundError';
        this.action = action;
    }
}
export class ActionValidationError extends Error {
    code = 'action_validation_error';
    action;
    phase;
    issues;
    constructor(action, phase, issues) {
        super(formatValidationMessage(action, phase, issues));
        this.name = 'ActionValidationError';
        this.action = action;
        this.phase = phase;
        this.issues = issues;
    }
}
function formatValidationMessage(action, phase, issues) {
    const suffix = issues
        .slice(0, 3)
        .map((issue) => `${issue.path}: ${issue.message}`)
        .join('; ');
    return suffix
        ? `Action '${action}' ${phase} failed validation: ${suffix}`
        : `Action '${action}' ${phase} failed validation`;
}
//# sourceMappingURL=errors.js.map