import { SYNCULAR_ERROR_DEFINITIONS } from '@syncular/core';
export const SYNCULAR_WORKER_PROTOCOL_VERSION = 2;
export function createSyncularWorkerErrorPayload(code, message, options = {}) {
    const definition = SYNCULAR_ERROR_DEFINITIONS[code];
    return {
        code,
        message: message ?? definition.message,
        category: definition.category,
        retryable: definition.retryable,
        recommendedAction: definition.recommendedAction,
        ...(options.name ? { name: options.name } : {}),
        ...(options.stack ? { stack: options.stack } : {}),
        ...(options.details !== undefined ? { details: options.details } : {}),
    };
}
//# sourceMappingURL=worker-protocol.js.map