import { canonicalizeAgentMetadata, } from "../../services/agentService";
export function createAgentStartRequest(input) {
    const { agentId, message, sessionId, requestSettings, context, clientMessageId, attachments, } = input;
    const searchParams = typeof window !== "undefined"
        ? new URLSearchParams(window.location.search)
        : null;
    const deterministic = searchParams?.get("deterministic")?.toLowerCase() === "true";
    const seedParam = searchParams?.get("seed");
    const seed = seedParam != null ? Number(seedParam) : undefined;
    return {
        agentId,
        message,
        sessionId,
        profileId: requestSettings.profileId,
        profile: requestSettings.profileName,
        model: requestSettings.modelId,
        mode: requestSettings.mode,
        ...(deterministic ? { deterministic: true } : {}),
        ...(Number.isFinite(seed) ? { seed } : {}),
        context: canonicalizeAgentMetadata(context),
        clientMessageId,
        ...(attachments?.length ? { attachments } : {}),
    };
}
//# sourceMappingURL=agentStartRequest.js.map