import { createUiRuntimeEvents } from './ui-events.js';
import { createCoreReadModels } from './ui-read-models-core.js';
import { createOperationsReadModels, } from './ui-read-models-operations.js';
function createOperatorClientReadModels(runtimeServices, options = {}) {
    const core = createCoreReadModels(runtimeServices);
    const operations = createOperationsReadModels(runtimeServices, options);
    return {
        controlPlane: operations.controlPlane,
        providers: core.providers,
        session: core.session,
        tasks: core.tasks,
    };
}
export function createOperatorClientServices(runtimeServices, options = {}) {
    return {
        events: createUiRuntimeEvents(runtimeServices.runtimeBus),
        shellPaths: runtimeServices.shellPaths,
        readModels: createOperatorClientReadModels(runtimeServices, options),
        sessionBroker: runtimeServices.sessionBroker,
        approvalBroker: runtimeServices.approvalBroker,
        providerRegistry: runtimeServices.providerRegistry,
        serviceRegistry: runtimeServices.serviceRegistry,
        subscriptionManager: runtimeServices.subscriptionManager,
        secretsManager: runtimeServices.secretsManager,
    };
}
export function createPeerClientDependencies(runtimeServices) {
    return {
        runtimeStore: runtimeServices.runtimeStore,
        distributedRuntime: runtimeServices.distributedRuntime,
        remoteRunnerRegistry: runtimeServices.remoteRunnerRegistry,
        remoteSupervisor: runtimeServices.remoteSupervisor,
    };
}
export function createDirectTransportServices(runtimeServices, options = {}) {
    return {
        operator: createOperatorClientServices(runtimeServices, options),
        peer: createPeerClientDependencies(runtimeServices),
    };
}
