import { recordStage } from '../../../stages/utils.js';
import { stripPrivateFieldsWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js';
import { buildReqOutboundFormatPayloadWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.js';
export async function runReqOutboundStage2FormatBuild(options) {
    const payload = buildReqOutboundFormatPayloadWithNative({
        formatEnvelope: options.formatEnvelope,
        protocol: options.formatEnvelope.protocol
    });
    const stripped = stripPrivateFieldsWithNative(payload);
    recordStage(options.stageRecorder, 'chat_process.req.stage7.outbound.format_build', stripped);
    return stripped;
}
