/**
 * API client for transcript upload
 *
 * Uploads session transcripts to the user's private registry.
 */
import { apiRequest } from "../api/base.js";
import { buildOrganizationRegistryUrl } from "../utils/url.js";
export const transcriptApi = {
    /**
     * Upload a transcript to the registry
     *
     * @param args - Upload request parameters
     *
     * @returns Upload response with transcript metadata
     */
    upload: async (args) => {
        const { sessionId, messages, title, projectName, orgId, skillsetName } = args;
        const body = {
            sessionId,
            messages,
        };
        if (title != null) {
            body.title = title;
        }
        if (projectName != null) {
            body.projectName = projectName;
        }
        if (skillsetName != null) {
            body.skillsetName = skillsetName;
        }
        // Build org-specific base URL if orgId is provided
        const baseUrl = orgId != null ? buildOrganizationRegistryUrl({ orgId }) : undefined;
        return apiRequest({
            path: "/transcripts",
            method: "POST",
            body,
            ...(baseUrl != null && { baseUrl }),
        });
    },
};
//# sourceMappingURL=transcript.js.map