import type { AssistantAddressLaneLike } from "./assistantAddressLaneRuntimeAdapter"; import type { AssistantAddressCarryoverLike } from "./assistantAddressOrchestrationRuntimeAdapter"; import { buildAssistantAddressLaneAttemptQueryOptions, resolveAssistantAddressLaneAttemptFollowupContext } from "./assistantAddressLaneAttemptQueryOptionsBuilder"; export interface RunAssistantAddressLaneAttemptRuntimeInput { messageUsed: string; carryMeta: AssistantAddressCarryoverLike | null; analysisDateHint: string | null; activeOrganization: string | null; mergeFollowupContextWithOrganizationScope: ( followupContext: Record | null, organization: string | null ) => Record | null; runAddressQueryTryHandle: ( messageUsed: string, options: { followupContext?: Record; analysisDateHint?: string | null; } ) => Promise; } export async function runAssistantAddressLaneAttemptRuntime( input: RunAssistantAddressLaneAttemptRuntimeInput ): Promise { const followupContext = resolveAssistantAddressLaneAttemptFollowupContext(input.carryMeta); const scopedFollowupContext = input.mergeFollowupContextWithOrganizationScope( followupContext, input.activeOrganization ); return input.runAddressQueryTryHandle( input.messageUsed, buildAssistantAddressLaneAttemptQueryOptions({ analysisDateHint: input.analysisDateHint, scopedFollowupContext }) ); }