function buildRegistryKey(key) {
    return `${key.triggerSource}:${key.platform}:${key.jobType}`;
}
export class ProcessorRegistry {
    builders = new Map();
    register(key, builder) {
        this.builders.set(buildRegistryKey(key), builder);
    }
    resolve(pending) {
        const key = buildRegistryKey({
            triggerSource: pending.triggerSource,
            platform: pending.platform,
            jobType: pending.jobType,
        });
        const builder = this.builders.get(key);
        if (!builder) {
            const available = [...this.builders.keys()].join(', ') || '(none)';
            throw new Error(`No processor builder registered for key "${key}". Available keys: ${available}`);
        }
        return builder(pending.job);
    }
}
//# sourceMappingURL=processorRegistry.js.map