import type { AxiosResponse } from 'axios'; import type { TTracePage, TTracePageParams, TTraceAvailability, TTraceRecordParams, TTraceRecordDetail } from './types/traces'; import type { TInsightsAccessResponse, TInsightsParams, TInsightsResponse } from './types/insights'; import type { TFileConfig } from './file-config'; import type * as t from './types'; import * as permissions from './accessPermissions'; import * as mcp from './types/mcpServers'; import * as qt from './types/queuedTurns'; import * as sch from './types/schedules'; import * as a from './types/assistants'; import * as m from './types/mutations'; import * as ag from './types/agents'; import * as q from './types/queries'; import * as sk from './types/skills'; import * as f from './types/files'; import * as config from './config'; import * as s from './schemas'; import * as r from './roles'; export declare function getInsights(params?: TInsightsParams): Promise; export declare function getInsightsAccess(): Promise; export declare function getConversationTraceAvailability(conversationId: string): Promise; export declare function getConversationTraceRecords({ conversationId, cursor }: TTracePageParams, signal?: AbortSignal): Promise; export declare function getConversationTraceRecord({ conversationId, recordId, messageId, sourceId }: TTraceRecordParams, signal?: AbortSignal): Promise; export declare function getLangfuseConnection(): Promise; export declare function updateLangfuseConnection(payload: t.TUpdateLangfuseConnectionRequest): Promise; export declare function testLangfuseConnection(payload: t.TLangfuseConnectionTestRequest): Promise; export declare function getLangfuseSessionLink(conversationId: string): Promise; export declare function revokeUserKey(name: string): Promise; export declare function revokeAllUserKeys(): Promise; export declare function deleteUser(payload?: t.TDeleteUserRequest): Promise; export declare function getCodeEnvironments(): Promise; export declare function getCodeEnvironmentStatus(id: string): Promise; export declare function pairCodeEnvironment(payload: { name: string; controlPlaneId: string; }): Promise; export declare function deleteCodeEnvironment(id: string): Promise<{ environment: t.TCodeEnvironmentSummary; }>; export declare function updateCodeEnvironmentSettings({ id, settings, }: { id: string; settings: config.CodeEnvironmentUserSettings; }): Promise<{ environment: t.TCodeEnvironmentSummary; }>; export declare function getFavorites(): Promise; export declare function updateFavorites(favorites: q.TUserFavorite[]): Promise; /** Combined Pinned-section display order: favorite and pinned-chat entry keys interleaved. */ export declare function getPinnedOrder(): Promise; export declare function updatePinnedOrder(pinnedOrder: string[]): Promise; /** Tool favorites — starred marketplace items (builtins, tools, MCP servers, skills). */ export declare function getToolFavorites(): Promise; export declare function addToolFavorite(favorite: q.TToolFavorite): Promise; export declare function removeToolFavorite(favorite: q.TToolFavorite): Promise<{ ok: boolean; }>; /** Per-user skill active/inactive overrides. */ export declare function getSkillStates(): Promise; export declare function updateSkillStates(skillStates: sk.TSkillStatesResponse): Promise; export declare function getSharedMessages(shareId: string): Promise; export declare function getSharedStartupConfig(shareId: string): Promise; export declare const listSharedLinks: (params: q.SharedLinksListParams) => Promise; export declare function getSharedLink(conversationId: string): Promise; export declare function createSharedLink(conversationId: string, targetMessageId?: string, snapshotFiles?: boolean): Promise; export declare function updateSharedLink(shareId: string, targetMessageId?: string, snapshotFiles?: boolean): Promise; export declare function deleteSharedLink(shareId: string): Promise; export declare function updateUserKey(payload: t.TUpdateUserKeyRequest): Promise; export declare function getAgentApiKeys(): Promise; export declare function createAgentApiKey(payload: t.TAgentApiKeyCreateRequest): Promise; export declare function deleteAgentApiKey(id: string): Promise; export declare function getPresets(): Promise; export declare function createPreset(payload: s.TPreset): Promise; export declare function updatePreset(payload: s.TPreset): Promise; export declare function deletePreset(arg: s.TPreset | undefined): Promise; export declare function getSearchEnabled(): Promise; export declare function getUser(): Promise; export declare function updateUserPreferences(preferences: t.TUpdateUserPreferencesRequest): Promise; export declare function getUserBalance(): Promise; export declare const updateTokenCount: (text: string) => Promise; export declare const login: (payload: t.TLoginUser) => Promise; export declare const logout: () => Promise; export declare const register: (payload: t.TRegisterUser) => Promise; export declare const userKeyQuery: (name: string) => Promise; export declare const getLoginGoogle: () => Promise; export declare const requestPasswordReset: (payload: t.TRequestPasswordReset) => Promise; export declare const resetPassword: (payload: t.TResetPassword) => Promise; export declare const verifyEmail: (payload: t.TVerifyEmail) => Promise; export declare const resendVerificationEmail: (payload: t.TResendVerificationEmail) => Promise; export declare const getAvailablePlugins: () => Promise; export declare const updateUserPlugins: (payload: t.TUpdateUserPlugins) => Promise; export declare const reinitializeMCPServer: (serverName: string) => Promise; export declare const bindMCPOAuth: (serverName: string) => Promise<{ success: boolean; }>; export declare const bindActionOAuth: (actionId: string) => Promise<{ success: boolean; }>; export declare const getMCPConnectionStatus: () => Promise; export declare const getMCPServerConnectionStatus: (serverName: string) => Promise; export declare const getMCPAuthValues: (serverName: string) => Promise; export declare function cancelMCPOAuth(serverName: string): Promise; export declare function getMCPOAuthStatus(flowId: string): Promise; export type StartupConfigOptions = { context?: config.StartupConfigContext; }; export declare const getStartupConfig: (options?: StartupConfigOptions) => Promise; }>; export declare const getAIEndpoints: () => Promise; export declare const getTokenConfig: () => Promise; export declare const getModels: () => Promise; export declare const createAssistant: ({ version, ...data }: a.AssistantCreateParams) => Promise; export declare const getAssistantById: ({ endpoint, assistant_id, version, }: { endpoint: s.AssistantsEndpoint; assistant_id: string; version: number | string | number; }) => Promise; export declare const updateAssistant: ({ assistant_id, data, version, }: { assistant_id: string; data: a.AssistantUpdateParams; version: number | string; }) => Promise; export declare const deleteAssistant: ({ assistant_id, model, endpoint, version, }: m.DeleteAssistantBody & { version: number | string; }) => Promise; export declare const listAssistants: (params: a.AssistantListParams, version: number | string) => Promise; export declare function getAssistantDocs({ endpoint, version, }: { endpoint: s.AssistantsEndpoint | string; version: number | string; }): Promise; export declare const getAvailableTools: (_endpoint: s.AssistantsEndpoint | s.EModelEndpoint.agents, version?: number | string) => Promise; export declare const getMCPTools: () => Promise; export declare const getVerifyAgentToolAuth: (params: q.VerifyToolAuthParams) => Promise; export declare const callTool: ({ toolId, toolParams, }: { toolId: T; toolParams: m.ToolParams; }) => Promise; export declare const getToolCalls: (params: q.GetToolCallParams) => Promise; export declare const getFiles: () => Promise; /** * Poll the lifecycle of an inline file preview. Returns the smallest * shape needed to drive the UI: * - `status` always present (defaults to `'ready'` server-side for * legacy records that pre-date the field). * - `text` and `textFormat` only when `status === 'ready'` and text * was extracted (preserves the HTML-or-null security contract). * - `previewError` only when `status === 'failed'`. * * Called from `useFilePreview`; React Query's `refetchInterval` * polls while `status === 'pending'` and stops on terminal status. */ export declare const getFilePreview: (fileId: string) => Promise; /** Preview status for a snapshotted file served through a shared link. */ export declare const getSharedFilePreview: (shareId: string, fileId: string) => Promise; export declare const getAgentFiles: (agentId: string) => Promise; export declare const getFileConfig: () => Promise; export declare const uploadImage: (data: FormData, signal?: AbortSignal | null, sseEnabled?: boolean) => Promise; export declare const uploadFile: (data: FormData, signal?: AbortSignal | null, sseEnabled?: boolean) => Promise; /** * Marks uploaded files as used (owner-scoped TTL touch) so the upload-window * TTL cannot reap attachments held in a client-side queue during a long run. * Best-effort: callers fire-and-forget — send-time marking is the backstop. */ export declare const markFilesUsage: (body: f.TFilesUsageBody) => Promise; export declare const updateAction: (data: m.UpdateActionVariables) => Promise; export declare function getActions(): Promise; export declare const deleteAction: ({ assistant_id, action_id, model, version, endpoint, }: m.DeleteActionVariables & { version: number | string; }) => Promise; /** * Agents */ export declare const createAgent: ({ ...data }: a.AgentCreateParams) => Promise; export declare const getAgentById: ({ agent_id }: { agent_id: string; }) => Promise; export declare const getExpandedAgentById: ({ agent_id }: { agent_id: string; }) => Promise; export declare const getAgentVersions: ({ agent_id }: { agent_id: string; }) => Promise; export declare const updateAgent: ({ agent_id, data, }: { agent_id: string; data: a.AgentUpdateParams; }) => Promise; export declare const duplicateAgent: ({ agent_id, }: m.DuplicateAgentBody) => Promise<{ agent: a.Agent; actions: ag.Action[]; }>; export declare const deleteAgent: ({ agent_id }: m.DeleteAgentBody) => Promise; export declare const listAgents: (params: a.AgentListParams) => Promise; export declare const revertAgentVersion: ({ agent_id, version_index, }: { agent_id: string; version_index: number; }) => Promise; /** * Get agent categories with counts for marketplace tabs */ export declare const getAgentCategories: () => Promise; /** * Unified marketplace agents endpoint with query string controls */ export declare const getMarketplaceAgents: (params: { requiredPermission: number; category?: string; search?: string; limit?: number; cursor?: string; promoted?: 0 | 1; }) => Promise; export declare const getAvailableAgentTools: () => Promise; export declare const updateAgentAction: (data: m.UpdateAgentActionVariables) => Promise; export declare const deleteAgentAction: ({ agent_id, action_id, }: m.DeleteAgentActionVariables) => Promise; /** * MCP Servers */ /** * * Ensure and List loaded mcp server configs from the cache Enriched with effective permissions. */ export declare const getMCPServers: () => Promise; /** * Get a single MCP server by ID */ export declare const getMCPServer: (serverName: string) => Promise; /** * Create a new MCP server */ export declare const createMCPServer: (data: mcp.MCPServerCreateParams) => Promise; /** * Update an existing MCP server */ export declare const updateMCPServer: (serverName: string, data: mcp.MCPServerUpdateParams) => Promise; /** * Delete an MCP server */ export declare const deleteMCPServer: (serverName: string) => Promise<{ success: boolean; }>; /** * Imports a conversations file. * * @param data - The FormData containing the file to import. * @returns A Promise that resolves to the import start response. */ export declare const importConversationsFile: (data: FormData) => Promise; export declare const uploadAvatar: (data: FormData) => Promise; export declare const uploadAssistantAvatar: (data: m.AssistantAvatarVariables) => Promise; export declare const uploadAgentAvatar: (data: m.AgentAvatarVariables) => Promise; export declare const getFileDownload: (userId: string, file_id: string) => Promise; export declare const getFileDownloadURL: (userId: string, file_id: string) => Promise; /** Blob download for a snapshotted file served through a shared link. */ export declare const getSharedFileDownload: (shareId: string, file_id: string) => Promise; export declare const getCodeOutputDownload: (url: string) => Promise; export declare const deleteFiles: (payload: { files: f.BatchFile[]; agent_id?: string; assistant_id?: string; tool_resource?: a.EToolResources; }) => Promise; export declare const speechToText: (data: FormData) => Promise; export declare const textToSpeech: (data: FormData) => Promise; export declare const getVoices: () => Promise; export declare const getCustomConfigSpeech: () => Promise; export declare function duplicateConversation(payload: t.TDuplicateConvoRequest): Promise; export declare function forkConversation(payload: t.TForkConvoRequest): Promise; export declare function forkSharedConversation(shareId: string, targetMessageIndex?: number, shareRevision?: string): Promise; export declare function deleteConversation(payload: t.TDeleteConversationRequest): Promise; export declare function clearAllConversations(): Promise; export declare const listConversations: (params?: q.ConversationListParams) => Promise; export declare function getConversations(cursor: string): Promise; export declare function getConversationById(id: string): Promise; export declare function updateConversation(payload: t.TUpdateConversationRequest): Promise; export declare function archiveConversation(payload: t.TArchiveConversationRequest): Promise; export declare function archiveAllConversations(): Promise; export declare function listProjects(params?: q.ProjectListParams): Promise; export declare function createProject(payload: t.TCreateChatProjectRequest): Promise; export declare function getProjectById(projectId: string): Promise; export declare function updateProject(payload: t.TUpdateChatProjectRequest): Promise; export declare function deleteProject(projectId: string): Promise; export declare function assignConversationToProject(payload: t.TAssignConversationToProjectRequest): Promise; export declare function pinConversation(payload: t.TPinConversationRequest): Promise; export declare function genTitle(payload: m.TGenTitleRequest): Promise; export declare const listMessages: (params?: q.MessagesListParams) => Promise; export declare function updateMessage(payload: t.TUpdateMessageRequest): Promise; export declare function updateMessageContent(payload: t.TUpdateMessageContent): Promise; export declare const editArtifact: ({ messageId, ...params }: m.TEditArtifactRequest) => Promise; export declare const branchMessage: (payload: m.TBranchMessageRequest) => Promise; export declare function getMessagesByConvoId(conversationId: string): Promise; export declare function getMessageById(conversationId: string, messageId: string): Promise; export declare function getParentSubagents(parentConversationId: string): Promise; export declare function getSubagentThread(parentConversationId: string, threadId: string, taskId?: string, cursor?: string): Promise; export declare function controlSubagentTask(parentConversationId: string, threadId: string, body: t.SubagentControlRequest): Promise; export declare function getPrompt(id: string): Promise<{ prompt: t.TPrompt; }>; export declare function getPrompts(filter: t.TPromptsWithFilterRequest): Promise; export declare function getAllPromptGroups(): Promise; export declare function getPromptGroups(filter: t.TPromptGroupsWithFilterRequest): Promise; export declare function getPromptGroup(id: string): Promise; export declare function createPrompt(payload: t.TCreatePrompt): Promise; export declare function addPromptToGroup(groupId: string, payload: t.TCreatePrompt): Promise; export declare function updatePromptGroup(variables: t.TUpdatePromptGroupVariables): Promise; export declare function recordPromptGroupUsage(groupId: string): Promise<{ numberOfGenerations: number; }>; export declare function deletePrompt(payload: t.TDeletePromptVariables): Promise; export declare function makePromptProduction(id: string): Promise; export declare function updatePromptLabels(variables: t.TUpdatePromptLabelsRequest): Promise; export declare function deletePromptGroup(id: string): Promise; export declare function getCategories(): Promise; export declare function getRandomPrompts(variables: t.TGetRandomPromptsRequest): Promise; export declare function listSkills(params?: sk.TSkillListRequest): Promise; export declare function getSchedules(): Promise; export declare function enqueueAgentQueuedTurn(payload: qt.TEnqueueAgentQueuedTurnRequest): Promise; export declare function listAgentQueuedTurns(conversationId: string, clientRequestIds?: string[]): Promise; export declare function cancelAgentQueuedTurn(queuedTurnId: string): Promise; export declare function getSchedule(id: string): Promise; export declare function createSchedule(payload: sch.TCreateSchedule): Promise; export declare function updateSchedule(id: string, payload: sch.TUpdateSchedule): Promise; export declare function deleteSchedule(id: string): Promise<{ id: string; }>; export declare function runScheduleNow(id: string): Promise; export declare function getSkill(id: string): Promise; export declare function createSkill(payload: sk.TCreateSkill): Promise; export declare function updateSkill(variables: sk.TUpdateSkillVariables): Promise; export declare function deleteSkill(id: string): Promise; export declare function listSkillFiles(skillId: string): Promise; export declare function uploadSkillFile(skillId: string, formData: FormData): Promise; /** * Import a skill from a .md, .zip, or .skill file. The backend extracts the * archive, creates the skill from SKILL.md, and persists all additional files. * Single HTTP request — no client-side zip processing needed. */ export declare function importSkill(formData: FormData): Promise; export declare function getSkillFileContent(skillId: string, relativePath: string): Promise; export declare function deleteSkillFile(skillId: string, relativePath: string): Promise; export declare const getSkillTree: (_skillId: string) => Promise; export declare const createSkillNode: (skillId: string, data: FormData | t.TCreateSkillNodeRequest) => Promise; export declare const updateSkillNode: (variables: { skillId: string; nodeId: string; data: t.TUpdateSkillNodeRequest; }) => Promise; export declare const deleteSkillNode: (_variables: { skillId: string; nodeId: string; }) => Promise; export declare const getSkillNodeContent: (_variables: { skillId: string; nodeId: string; }) => Promise<{ content: string; mimeType: string; }>; export declare const updateSkillNodeContent: (variables: { skillId: string; nodeId: string; content: string; }) => Promise; export declare function getGitHubSkillSyncStatus(): Promise; export declare function runGitHubSkillSync(): Promise; export declare function setGitHubSkillSyncCredential(variables: { credentialKey: string; token: string; }): Promise; export declare function deleteGitHubSkillSyncCredential(credentialKey: string): Promise<{ credentialKey: string; deleted: boolean; }>; export declare function listRoles(): Promise; export declare function getRole(roleName: string): Promise; export declare function updatePromptPermissions(variables: m.UpdatePromptPermVars): Promise; export declare function updateAgentPermissions(variables: m.UpdateAgentPermVars): Promise; export declare function updateMemoryPermissions(variables: m.UpdateMemoryPermVars): Promise; export declare function updatePeoplePickerPermissions(variables: m.UpdatePeoplePickerPermVars): Promise; export declare function updateMCPServersPermissions(variables: m.UpdateMCPServersPermVars): Promise; export declare function updateRemoteAgentsPermissions(variables: m.UpdateRemoteAgentsPermVars): Promise; export declare function updateMarketplacePermissions(variables: m.UpdateMarketplacePermVars): Promise; export declare function updateSkillPermissions(variables: m.UpdateSkillPermVars): Promise; export declare function getConversationTags(): Promise; export declare function createConversationTag(payload: t.TConversationTagRequest): Promise; export declare function updateConversationTag(tag: string, payload: t.TConversationTagRequest): Promise; export declare function deleteConversationTag(tag: string): Promise; export declare function addTagToConversation(conversationId: string, payload: t.TTagConversationRequest): Promise; export declare function rebuildConversationTags(): Promise; export declare function healthCheck(): Promise; export declare function getUserTerms(): Promise; export declare function acceptTerms(): Promise; export declare function getBanner(): Promise; export declare function updateFeedback(conversationId: string, messageId: string, payload: t.TUpdateFeedbackRequest): Promise; export declare function enableTwoFactor(payload?: t.TEnable2FARequest): Promise; export declare function verifyTwoFactor(payload: t.TVerify2FARequest): Promise; export declare function confirmTwoFactor(payload: t.TVerify2FARequest): Promise; export declare function disableTwoFactor(payload?: t.TDisable2FARequest): Promise; export declare function regenerateBackupCodes(payload?: t.TRegenerateBackupCodesRequest): Promise; export declare function verifyTwoFactorTemp(payload: t.TVerify2FATempRequest): Promise; export declare const getMemories: () => Promise; export declare const deleteMemory: (key: string, agentId?: string) => Promise; export declare const deleteMemoryById: (id: string, agentId?: string) => Promise; export declare const updateMemory: (key: string, value: string, originalKey?: string, agentId?: string) => Promise; export declare const updateMemoryById: (id: string, value: string, key?: string, agentId?: string) => Promise; export declare const updateMemoryPreferences: (preferences: { memories: boolean; }) => Promise<{ updated: boolean; preferences: { memories: boolean; }; }>; export declare const createMemory: (data: { key: string; value: string; agentId?: string; }) => Promise<{ created: boolean; memory: q.TUserMemory; }>; export declare function searchPrincipals(params: q.PrincipalSearchParams): Promise; export declare function getAccessRoles(resourceType: permissions.ResourceType): Promise; export declare function getResourcePermissions(resourceType: permissions.ResourceType, resourceId: string): Promise; export declare function updateResourcePermissions(resourceType: permissions.ResourceType, resourceId: string, data: permissions.TUpdateResourcePermissionsRequest): Promise; export declare function getEffectivePermissions(resourceType: permissions.ResourceType, resourceId: string): Promise; export declare function getAllEffectivePermissions(resourceType: permissions.ResourceType): Promise; export declare function getGraphApiToken(params: q.GraphTokenParams): Promise; export declare function getDomainServerBaseUrl(): string; export interface ActiveJobsResponse { activeJobIds: string[]; } export declare const getActiveJobs: () => Promise;