/**
 * CloudDeploymentProviderRegistry
 *
 * Resolves ICloudDeploymentProvider instances from the tsyringe container
 * using a per-provider string token. Mirrors the
 * AgentSessionRepositoryRegistry pattern already in container.ts.
 *
 * String-token format: `ICloudDeploymentProvider:${providerId}`.
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { injectable } from 'tsyringe';
import { container } from 'tsyringe';
import { CloudDeploymentProvider } from '../../../domain/generated/output.js';
export const CLOUD_DEPLOYMENT_PROVIDER_TOKEN = (provider) => `ICloudDeploymentProvider:${provider}`;
let CloudDeploymentProviderRegistry = class CloudDeploymentProviderRegistry {
    listAll() {
        return Object.values(CloudDeploymentProvider).map((id) => {
            const instance = this.tryGet(id);
            return {
                id,
                displayName: instance?.displayName ?? id,
                enabled: instance?.enabled ?? false,
            };
        });
    }
    get(id) {
        const instance = this.tryGet(id);
        if (!instance) {
            throw new Error(`No cloud deployment provider registered for id ${id}. Check container bindings.`);
        }
        return instance;
    }
    tryGet(id) {
        const token = CLOUD_DEPLOYMENT_PROVIDER_TOKEN(id);
        if (!container.isRegistered(token))
            return null;
        return container.resolve(token);
    }
};
CloudDeploymentProviderRegistry = __decorate([
    injectable()
], CloudDeploymentProviderRegistry);
export { CloudDeploymentProviderRegistry };
