import type { AssistantTurnRuntimeBuilderDeps } from "./assistantTurnRuntimeInputBuilder"; export interface AssistantTurnRuntimeDepsSessionsLike { ensureSession: AssistantTurnRuntimeBuilderDeps["ensureSession"]; appendItem: AssistantTurnRuntimeBuilderDeps["appendItem"]; getSession: AssistantTurnRuntimeBuilderDeps["getSession"]; setInvestigationState: AssistantTurnRuntimeBuilderDeps["setInvestigationState"]; } export interface AssistantTurnRuntimeDepsSessionLoggerLike { persistSession: AssistantTurnRuntimeBuilderDeps["persistSession"]; } export interface AssistantTurnRuntimeDepsNormalizerLike { normalize: AssistantTurnRuntimeBuilderDeps["normalize"]; } export interface AssistantTurnRuntimeDepsDataLayerLike { executeRouteRuntime: AssistantTurnRuntimeBuilderDeps["executeRouteRuntime"]; } export interface AssistantTurnRuntimeDepsAddressQueryServiceLike { tryHandle: AssistantTurnRuntimeBuilderDeps["tryAddressQueryHandle"]; } type BuilderDepsProvidedByAdapter = Pick< AssistantTurnRuntimeBuilderDeps, | "ensureSession" | "appendItem" | "getSession" | "persistSession" | "setInvestigationState" | "normalize" | "executeRouteRuntime" | "tryAddressQueryHandle" | "chatClient" | "messageIdFactory" | "nowIso" | "defaultApiKey" | "logEvent" | "featureAssistantAddressQueryV1" | "featureAddressLlmPredecomposeV1" | "featureInvestigationStateV1" | "featureStateFollowupBindingV1" | "featureContractsV11" | "featureAnswerPolicyV11" | "featureProblemCentricAnswerV1" | "featureLifecycleAnswerV1" | "defaultModel" | "defaultBaseUrl" >; type BuilderDepsPassThrough = Omit; export interface BuildAssistantTurnRuntimeDepsInput { sessions: AssistantTurnRuntimeDepsSessionsLike; sessionLogger: AssistantTurnRuntimeDepsSessionLoggerLike; normalizerService: AssistantTurnRuntimeDepsNormalizerLike; dataLayer: AssistantTurnRuntimeDepsDataLayerLike; addressQueryService: AssistantTurnRuntimeDepsAddressQueryServiceLike; chatClient: AssistantTurnRuntimeBuilderDeps["chatClient"]; messageIdFactory: AssistantTurnRuntimeBuilderDeps["messageIdFactory"]; nowIso: AssistantTurnRuntimeBuilderDeps["nowIso"]; defaultApiKey: AssistantTurnRuntimeBuilderDeps["defaultApiKey"]; logEvent: AssistantTurnRuntimeBuilderDeps["logEvent"]; flags: { featureAssistantAddressQueryV1: boolean; featureAddressLlmPredecomposeV1: boolean; featureInvestigationStateV1: boolean; featureStateFollowupBindingV1: boolean; featureContractsV11: boolean; featureAnswerPolicyV11: boolean; featureProblemCentricAnswerV1: boolean; featureLifecycleAnswerV1: boolean; }; defaults: { defaultModel: string; defaultBaseUrl: string; }; helpers: BuilderDepsPassThrough; } export function buildAssistantTurnRuntimeDeps( input: BuildAssistantTurnRuntimeDepsInput ): AssistantTurnRuntimeBuilderDeps { return { ...input.helpers, ensureSession: (sessionId) => input.sessions.ensureSession(sessionId), appendItem: (sessionId, item) => input.sessions.appendItem(sessionId, item), getSession: (sessionId) => input.sessions.getSession(sessionId), persistSession: (session) => input.sessionLogger.persistSession(session), setInvestigationState: (sessionId, state) => input.sessions.setInvestigationState(sessionId, state), normalize: (payload) => input.normalizerService.normalize(payload), executeRouteRuntime: (route, fragmentText, options) => input.dataLayer.executeRouteRuntime(route, fragmentText, options), tryAddressQueryHandle: (messageUsed, options) => input.addressQueryService.tryHandle(messageUsed, options), chatClient: input.chatClient, messageIdFactory: input.messageIdFactory, nowIso: input.nowIso, defaultApiKey: input.defaultApiKey, logEvent: input.logEvent, featureAssistantAddressQueryV1: input.flags.featureAssistantAddressQueryV1, featureAddressLlmPredecomposeV1: input.flags.featureAddressLlmPredecomposeV1, featureInvestigationStateV1: input.flags.featureInvestigationStateV1, featureStateFollowupBindingV1: input.flags.featureStateFollowupBindingV1, featureContractsV11: input.flags.featureContractsV11, featureAnswerPolicyV11: input.flags.featureAnswerPolicyV11, featureProblemCentricAnswerV1: input.flags.featureProblemCentricAnswerV1, featureLifecycleAnswerV1: input.flags.featureLifecycleAnswerV1, defaultModel: input.defaults.defaultModel, defaultBaseUrl: input.defaults.defaultBaseUrl }; }