import { createUiRuntimeEvents } from './ui-events.js';
import { createUiReadModels } from './ui-read-models.js';
export function createUiRuntimeServices(runtimeServices, options = {}) {
    return {
        environment: {
            workingDirectory: runtimeServices.workingDirectory,
            homeDirectory: runtimeServices.homeDirectory,
            shellPaths: runtimeServices.shellPaths,
        },
        shell: {
            keybindingsManager: runtimeServices.keybindingsManager,
            panelManager: runtimeServices.panelManager,
            processManager: runtimeServices.processManager,
            profileManager: runtimeServices.profileManager,
            bookmarkManager: runtimeServices.bookmarkManager,
        },
        agents: {
            agentManager: runtimeServices.agentManager,
            agentMessageBus: runtimeServices.agentMessageBus,
            wrfcController: runtimeServices.wrfcController,
        },
        providers: {
            providerRegistry: runtimeServices.providerRegistry,
            favoritesStore: runtimeServices.favoritesStore,
            benchmarkStore: runtimeServices.benchmarkStore,
        },
        sessions: {
            sessionManager: runtimeServices.sessionManager,
            sessionBroker: runtimeServices.sessionBroker,
            sessionOrchestration: runtimeServices.sessionOrchestration,
            sessionMemoryStore: runtimeServices.sessionMemoryStore,
        },
        platform: {
            configManager: runtimeServices.configManager,
            localUserAuthManager: runtimeServices.localUserAuthManager,
            mcpRegistry: runtimeServices.mcpRegistry,
            serviceRegistry: runtimeServices.serviceRegistry,
            subscriptionManager: runtimeServices.subscriptionManager,
            secretsManager: runtimeServices.secretsManager,
            tokenAuditor: runtimeServices.tokenAuditor,
            replayEngine: runtimeServices.replayEngine,
            webhookNotifier: runtimeServices.webhookNotifier,
            policyRuntimeState: runtimeServices.policyRuntimeState,
        },
        planning: {
            planManager: runtimeServices.planManager,
            adaptivePlanner: runtimeServices.adaptivePlanner,
        },
        coordination: {
            approvalBroker: runtimeServices.approvalBroker,
        },
        runtime: {
            distributedRuntime: runtimeServices.distributedRuntime,
            remoteRunnerRegistry: runtimeServices.remoteRunnerRegistry,
            remoteSupervisor: runtimeServices.remoteSupervisor,
        },
        events: createUiRuntimeEvents(runtimeServices.runtimeBus),
        readModels: createUiReadModels(runtimeServices, options),
    };
}
