export type CreateApiApiImWorkspaceIdAgentsArgs = {id: string, body: {agentName: string, agentDisplayName?: string | undefined, agentType?: ('assistant' | 'specialist' | 'orchestrator' | 'tool' | 'bot') | undefined, capabilities?: Array | undefined, metadata?: Record | undefined}}; export type CreateApiApiImWorkspaceIdAgentsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add agent to workspace * * POST /api/im/workspace/{id}/agents */ export const createApiApiImWorkspaceIdAgents = async (args: CreateApiApiImWorkspaceIdAgentsArgs, options?: CreateApiApiImWorkspaceIdAgentsOptions) => { const {baseUrl = "https://prismer.cloud", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set('authorization', `Bearer ${apiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/im/workspace/${encodeURIComponent(String(args.id))}/agents${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };