import { runChatRequestToolFilters } from '../../shared/tool-filter-pipeline.js';
import { buildGovernedFilterPayloadWithNative } from '../../../router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.js';
export async function runGovernedChatRequestFilters(options) {
    const { request } = options;
    const shaped = buildGovernedFilterPayloadWithNative(request);
    const governedPayload = await runChatRequestToolFilters(shaped, {
        entryEndpoint: options.entryEndpoint,
        requestId: options.requestId,
        model: request.model,
        profile: options.providerProtocol,
        stream: options.inboundStreamIntent,
        toolFilterHints: options.metadataToolHints,
        rawPayload: options.rawRequestBody && typeof options.rawRequestBody === 'object'
            ? options.rawRequestBody
            : undefined
    });
    return governedPayload;
}
