import { buildToolOutputSnapshot } from './tool-output-snapshot.js';
import { captureResponsesContextSnapshot as captureResponsesContextSnapshotModule } from './responses-context-snapshot.js';
import { runReqInboundStage3ContextCaptureOrchestration } from './context-capture-orchestration.js';
import { normalizeProviderProtocolTokenWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js';
export async function runReqInboundStage3ContextCapture(options) {
    return runReqInboundStage3ContextCaptureOrchestration(options);
}
export function runChatContextCapture(options) {
    return runReqInboundStage3ContextCapture({
        rawRequest: options.rawRequest,
        adapterContext: options.adapterContext,
        stageRecorder: options.stageRecorder,
        captureContext: captureChatContextSnapshot
    });
}
export function captureResponsesContextSnapshot(options) {
    return captureResponsesContextSnapshotModule(options);
}
function captureChatContextSnapshot(options) {
    const protocol = normalizeProviderProtocolTokenWithNative(options.adapterContext.providerProtocol);
    return buildToolOutputSnapshot(options.rawRequest, protocol);
}
