mitra-interactions-sdk 1.0.58-beta.5 → 1.0.58-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -540,6 +540,30 @@ interface GetAgentChatsOptions {
540
540
  /** Sobrescreve o projectId configurado globalmente. */
541
541
  projectId?: number;
542
542
  }
543
+ type ChatManageAction = 'list' | 'rename' | 'delete';
544
+ interface ManageAgentChatListOptions {
545
+ action: 'list';
546
+ /** Sobrescreve o projectId configurado globalmente. */
547
+ projectId?: number;
548
+ }
549
+ interface ManageAgentChatRenameOptions {
550
+ action: 'rename';
551
+ taskId: string;
552
+ name: string;
553
+ }
554
+ interface ManageAgentChatDeleteOptions {
555
+ action: 'delete';
556
+ taskId: string;
557
+ }
558
+ type ManageAgentChatOptions = ManageAgentChatListOptions | ManageAgentChatRenameOptions | ManageAgentChatDeleteOptions;
559
+ interface RenameAgentChatResult {
560
+ taskId: string;
561
+ name: string;
562
+ }
563
+ interface DeleteAgentChatResult {
564
+ taskId: string;
565
+ deleted: boolean;
566
+ }
543
567
  interface GetAgentTaskCreateOptions {
544
568
  /** Cria chat novo. taskId é preenchido depois do primeiro send(). */
545
569
  create: true;
@@ -657,7 +681,19 @@ type CredentialTarget = AgentSubscriptionTarget | AgentApiKeyTarget;
657
681
  * de baixo nível + abre popup + espera autorização):
658
682
  * connect
659
683
  */
660
- type CredentialAction = 'connect' | 'status' | 'remove' | 'list' | 'list_models' | 'validate' | 'save' | 'oauth_start' | 'oauth_exchange' | 'device_start' | 'device_poll' | 'device_cancel';
684
+ type CredentialAction = 'auth' | 'connect' | 'status' | 'remove' | 'list' | 'list_models' | 'list_providers' | 'validate' | 'save' | 'oauth_start' | 'oauth_exchange' | 'device_start' | 'device_poll' | 'device_cancel';
685
+ /** Forma de acesso a uma credencial. */
686
+ type CredentialAccessType = 'subscription' | 'api_key';
687
+ /** Método de conexão — diz ao app/agent qual UI montar. */
688
+ type AuthMethod = 'api_key' | 'paste_code' | 'device';
689
+ /** Metadados pra montar a UI de conexão (vem em cada provider de list_providers). */
690
+ interface AgentAuthMeta {
691
+ method: AuthMethod;
692
+ /** Só para method='api_key'. */
693
+ keyLabel?: string;
694
+ /** Só para method='api_key'. */
695
+ keyPlaceholder?: string;
696
+ }
661
697
  /** Um modelo selecionável (retornado por action='list_models'). */
662
698
  interface AgentModelOption {
663
699
  /** Passe direto em send({ modelId }) ou getAgentTaskMitra({ create, modelId }). */
@@ -669,13 +705,34 @@ interface AgentModelOption {
669
705
  interface AgentModelGroup {
670
706
  id: string;
671
707
  name: string;
672
- kind: 'subscription' | 'api_key';
708
+ type: CredentialAccessType;
673
709
  models: AgentModelOption[];
674
710
  }
675
711
  /** Retorno de manageAgentCredentialMitra({ action: 'list_models' }). */
676
712
  interface ListAgentModelsResult {
677
713
  providers: AgentModelGroup[];
678
714
  }
715
+ /** Um provedor suportado + status (retornado por action='list_providers'). */
716
+ interface AgentProviderListItem {
717
+ id: string;
718
+ name: string;
719
+ type: CredentialAccessType;
720
+ /** Passe direto em auth/connect/save/remove. */
721
+ target: string;
722
+ /** Como conectar: method (api_key|paste_code|device) + label/placeholder. */
723
+ auth: AgentAuthMeta;
724
+ connected: boolean;
725
+ /** Presente em subscription Claude conectada. */
726
+ account?: AgentSubscriptionAccount;
727
+ expiresAt?: number;
728
+ /** Presente em API key conectada. */
729
+ maskedKey?: string;
730
+ updatedAt?: string | Date;
731
+ }
732
+ /** Retorno de manageAgentCredentialMitra({ action: 'list_providers' }). */
733
+ interface ListAgentProvidersResult {
734
+ providers: AgentProviderListItem[];
735
+ }
679
736
  /**
680
737
  * Opções de baixo nível (RPC direto) de `manageAgentCredentialMitra`. Campos
681
738
  * extras (key, code, codeVerifier, redirectUri, pollId, accessToken,
@@ -684,8 +741,8 @@ interface ListAgentModelsResult {
684
741
  * NÃO use com action='connect' — para isso use ConnectAgentCredentialOptions.
685
742
  */
686
743
  interface ManageAgentCredentialOptions {
687
- action: Exclude<CredentialAction, 'connect'>;
688
- /** Obrigatório exceto para action='list'. */
744
+ action: Exclude<CredentialAction, 'connect' | 'auth'>;
745
+ /** Obrigatório exceto para action='list' / 'list_models'. */
689
746
  target?: CredentialTarget;
690
747
  /** Para `save` / `validate` de API key. */
691
748
  key?: string;
@@ -717,46 +774,54 @@ interface AgentSubscriptionAccount {
717
774
  * Orquestra o fluxo OAuth/device ponta-a-ponta no browser (abre popup, espera
718
775
  * autorização, troca por tokens server-side).
719
776
  */
777
+ /**
778
+ * Targets que conectam SEM redirect (paste código / device flow). O
779
+ * 'openai_oauth' fica de fora porque depende de redirect localhost:1455
780
+ * (client OAuth compartilhado da OpenAI) — inviável em domínio de cliente.
781
+ * OpenAI subscription conecta via 'codex' (device flow).
782
+ */
783
+ type ConnectableSubscriptionTarget = 'claude' | 'codex';
784
+ interface AuthAgentCredentialOptions {
785
+ action: 'auth';
786
+ target: ConnectableSubscriptionTarget;
787
+ }
788
+ /** Resultado de auth(claude): abra a authUrl, depois connect com o código. */
789
+ interface AuthClaudeResult {
790
+ target: 'claude';
791
+ /** URL pra abrir (a Anthropic mostra o código na própria tela). */
792
+ authUrl: string;
793
+ /** Passe de volta no connect junto com o código. */
794
+ state: string;
795
+ }
796
+ /** Resultado de auth(codex): mostre userCode/verificationUrl, depois connect com pollId. */
797
+ interface AuthCodexResult {
798
+ target: 'codex';
799
+ /** Código que o user digita no site da OpenAI. */
800
+ userCode: string | null;
801
+ /** URL que o user abre pra autorizar. */
802
+ verificationUrl: string | null;
803
+ /** Passe de volta no connect; a SDK faz o polling. */
804
+ pollId: string;
805
+ }
806
+ type AuthAgentCredentialResult = AuthClaudeResult | AuthCodexResult;
720
807
  interface ConnectAgentCredentialOptions {
721
808
  action: 'connect';
722
- target: AgentSubscriptionTarget;
723
- /**
724
- * Callback que retorna o código que o usuário copiou da página da Anthropic
725
- * após autorizar. **Obrigatório** para target='claude'.
726
- */
727
- onCodeNeeded?: (info: {
728
- authUrl: string;
729
- state: string;
730
- }) => Promise<string> | string;
731
- /**
732
- * URL no domínio do app publicado que captura o `?code=` da OAuth e faz
733
- * `window.opener.postMessage({ mitraOpenAICode: code }, '*')`.
734
- * **Obrigatório** para target='openai_oauth'.
735
- */
736
- redirectUri?: string;
737
- /** Timeout esperando o postMessage (default 5min). */
738
- messageTimeoutMs?: number;
739
- /**
740
- * Callback opcional que recebe o `userCode` e `verificationUrl` assim que
741
- * o device flow inicia (use pra exibir na UI além do popup automático).
742
- */
743
- onDeviceCode?: (info: {
744
- userCode: string | null;
745
- verificationUrl: string | null;
746
- }) => void;
809
+ target: ConnectableSubscriptionTarget;
810
+ /** Código que o user copiou da página da Anthropic. Obrigatório p/ claude. */
811
+ code?: string;
812
+ /** O `state` devolvido por auth(claude). Obrigatório p/ claude. */
813
+ state?: string;
814
+ /** O `pollId` devolvido por auth(codex). Obrigatório p/ codex. */
815
+ pollId?: string;
747
816
  /** Intervalo de poll do device flow (default 2000ms). */
748
817
  pollIntervalMs?: number;
749
818
  /** Timeout total do device flow (default 15min). */
750
819
  deviceTimeoutMs?: number;
751
- /** Nome da window do popup (default depende do target). */
752
- windowName?: string;
753
- /** `features` string passada para `window.open`. */
754
- windowFeatures?: string;
755
820
  }
756
821
  interface ConnectAgentSubscriptionResult {
757
- target: AgentSubscriptionTarget;
822
+ target: ConnectableSubscriptionTarget;
758
823
  success: boolean;
759
- /** Presente em claude / openai_oauth (epoch ms). */
824
+ /** Presente em claude (epoch ms). */
760
825
  expiresAt?: number;
761
826
  /** Presente apenas em claude. */
762
827
  account?: AgentSubscriptionAccount | null;
@@ -810,6 +875,7 @@ interface MitraInstance {
810
875
  resetPassword(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
811
876
  getAgentChats(options?: GetAgentChatsOptions): Promise<AgentChat[]>;
812
877
  getAgentTask(options: GetAgentTaskOptions): AgentTaskSession;
878
+ manageAgentChat(options: ManageAgentChatOptions): Promise<unknown>;
813
879
  manageAgentCredential(options: ManageAgentCredentialOptions | ConnectAgentCredentialOptions): Promise<unknown>;
814
880
  openChat(): void;
815
881
  closeChat(): void;
@@ -954,7 +1020,20 @@ declare function resetPasswordMitra(options: ResetPasswordOptions): Promise<Reco
954
1020
  */
955
1021
 
956
1022
  /**
957
- * Lista chats do user para um projeto.
1023
+ * Gerencia os chats do user (coleção) espelha `manageAgentCredentialMitra`.
1024
+ * Operações stateless: listar, renomear, deletar.
1025
+ *
1026
+ * @example
1027
+ * const chats = await manageAgentChatMitra({ action: 'list' });
1028
+ * await manageAgentChatMitra({ action: 'rename', taskId, name: 'Novo nome' });
1029
+ * await manageAgentChatMitra({ action: 'delete', taskId });
1030
+ */
1031
+ declare function manageAgentChatMitra(options: ManageAgentChatListOptions): Promise<AgentChat[]>;
1032
+ declare function manageAgentChatMitra(options: ManageAgentChatRenameOptions): Promise<RenameAgentChatResult>;
1033
+ declare function manageAgentChatMitra(options: ManageAgentChatDeleteOptions): Promise<DeleteAgentChatResult>;
1034
+ /**
1035
+ * Lista chats do user para um projeto. Alias fino de
1036
+ * manageAgentChatMitra({ action: 'list' }).
958
1037
  */
959
1038
  declare function getAgentChatsMitra(options?: GetAgentChatsOptions): Promise<AgentChat[]>;
960
1039
  /**
@@ -973,48 +1052,48 @@ declare function getAgentTaskMitra(options: GetAgentTaskOptions): AgentTaskSessi
973
1052
  * Função ÚNICA `manageAgentCredentialMitra` sobre /sdk-ws para todas as
974
1053
  * operações de credencial do agente:
975
1054
  * - API keys (8 providers: anthropic, openai, gemini, kimi, minimax, glm, qwen, openrouter)
976
- * - Subscriptions OAuth (Claude / OpenAI / Codex device flow)
1055
+ * - Subscriptions OAuth (Claude paste-código / OpenAI device flow via Codex)
977
1056
  *
978
1057
  * Actions de baixo nível (RPC direto contra o backend):
979
- * status | remove | list | validate | save
1058
+ * status | remove | list | list_models | validate | save
980
1059
  * oauth_start | oauth_exchange | device_start | device_poll | device_cancel
981
1060
  *
982
- * Action de alto nível (orquestra o fluxo ponta-a-ponta no browser):
983
- * connect abre popup, espera código/postMessage/poll, troca por tokens.
1061
+ * Actions de alto nível (orquestradas na SDK — o app controla UI/popup/timing):
1062
+ * auth inicia o fluxo e retorna o que a UI mostra (sem efeito colateral
1063
+ * de janela). claude → { authUrl, state }; codex → { userCode,
1064
+ * verificationUrl, pollId }.
1065
+ * connect — finaliza/salva. claude → passa { code, state }; codex → passa
1066
+ * { pollId } e a SDK faz o polling até autorizar.
1067
+ *
1068
+ * Fluxo típico (sem callbacks, sem redirect, sem callback page):
1069
+ * const { authUrl, state } = await manageAgentCredentialMitra({ action:'auth', target:'claude' });
1070
+ * // app abre authUrl + coleta o código do user
1071
+ * await manageAgentCredentialMitra({ action:'connect', target:'claude', code, state });
1072
+ *
1073
+ * const { userCode, verificationUrl, pollId } = await manageAgentCredentialMitra({ action:'auth', target:'codex' });
1074
+ * // app mostra "abra {verificationUrl}, digite {userCode}"
1075
+ * await manageAgentCredentialMitra({ action:'connect', target:'codex', pollId });
984
1076
  *
985
1077
  * SEGURANÇA: o token de subscription NUNCA volta cru pro cliente. É salvo
986
- * server-side (Firestore) e injetado no sandbox E2B direto de lá. O retorno
987
- * de `connect`/`oauth_exchange` traz só { connected, expiresAt, account }.
1078
+ * server-side (Firestore) e injetado no sandbox E2B direto de lá.
988
1079
  */
989
1080
 
990
1081
  /**
991
- * Conecta uma subscription ponta-a-ponta (abre popup, espera autorização,
992
- * troca por tokens). Retorno tipado: { target, success, expiresAt?, account? }.
993
- *
994
- * @example
995
- * // Claude — caller mostra modal pedindo o paste do código
996
- * await manageAgentCredentialMitra({
997
- * action: 'connect', target: 'claude',
998
- * onCodeNeeded: async () => prompt('Cole o código:') ?? ''
999
- * });
1000
- *
1001
- * @example
1002
- * // OpenAI — callback page no domínio do app faz postMessage
1003
- * await manageAgentCredentialMitra({
1004
- * action: 'connect', target: 'openai_oauth',
1005
- * redirectUri: window.location.origin + '/auth/openai-callback'
1006
- * });
1007
- *
1008
- * @example
1009
- * // Codex — device flow automático (abre verificação, polling)
1010
- * await manageAgentCredentialMitra({ action: 'connect', target: 'codex' });
1082
+ * Inicia um fluxo de subscription. Não abre janelas retorna os dados pra UI:
1083
+ * claude { authUrl, state } codex { userCode, verificationUrl, pollId }
1084
+ */
1085
+ declare function manageAgentCredentialMitra(options: AuthAgentCredentialOptions): Promise<AuthAgentCredentialResult>;
1086
+ /**
1087
+ * Finaliza/salva uma subscription:
1088
+ * claude → { code, state } codex → { pollId } (a SDK faz o polling)
1011
1089
  */
1012
1090
  declare function manageAgentCredentialMitra(options: ConnectAgentCredentialOptions): Promise<ConnectAgentSubscriptionResult>;
1013
1091
  /**
1014
- * RPC direto contra o backend. Retorno depende de (action, target) — veja docs.
1092
+ * RPC direto contra o backend. Retorno depende de (action, target).
1015
1093
  *
1016
1094
  * @example
1017
1095
  * await manageAgentCredentialMitra({ action: 'list' });
1096
+ * await manageAgentCredentialMitra({ action: 'list_models' });
1018
1097
  * await manageAgentCredentialMitra({ action: 'status', target: 'anthropic' });
1019
1098
  * await manageAgentCredentialMitra({ action: 'validate', target: 'openai', key: 'sk-...' });
1020
1099
  * await manageAgentCredentialMitra({ action: 'save', target: 'glm', key: '...' });
@@ -1177,4 +1256,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
1177
1256
  */
1178
1257
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
1179
1258
 
1180
- export { type AgentApiKeyTarget, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type CallIntegrationOptions, type CallIntegrationResponse, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAction, type CredentialTarget, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetAgentChatsOptions, type GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListAgentModelsResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendOptions, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentChatsMitra, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentCredentialMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
1259
+ export { type AgentApiKeyTarget, type AgentAuthMeta, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentProviderListItem, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type AuthAgentCredentialOptions, type AuthAgentCredentialResult, type AuthClaudeResult, type AuthCodexResult, type AuthMethod, type CallIntegrationOptions, type CallIntegrationResponse, type ChatManageAction, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type ConnectableSubscriptionTarget, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAccessType, type CredentialAction, type CredentialTarget, type DeleteAgentChatResult, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetAgentChatsOptions, type GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListAgentModelsResult, type ListAgentProvidersResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type ManageAgentChatDeleteOptions, type ManageAgentChatListOptions, type ManageAgentChatOptions, type ManageAgentChatRenameOptions, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type RenameAgentChatResult, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendOptions, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentChatsMitra, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentChatMitra, manageAgentCredentialMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
package/dist/index.d.ts CHANGED
@@ -540,6 +540,30 @@ interface GetAgentChatsOptions {
540
540
  /** Sobrescreve o projectId configurado globalmente. */
541
541
  projectId?: number;
542
542
  }
543
+ type ChatManageAction = 'list' | 'rename' | 'delete';
544
+ interface ManageAgentChatListOptions {
545
+ action: 'list';
546
+ /** Sobrescreve o projectId configurado globalmente. */
547
+ projectId?: number;
548
+ }
549
+ interface ManageAgentChatRenameOptions {
550
+ action: 'rename';
551
+ taskId: string;
552
+ name: string;
553
+ }
554
+ interface ManageAgentChatDeleteOptions {
555
+ action: 'delete';
556
+ taskId: string;
557
+ }
558
+ type ManageAgentChatOptions = ManageAgentChatListOptions | ManageAgentChatRenameOptions | ManageAgentChatDeleteOptions;
559
+ interface RenameAgentChatResult {
560
+ taskId: string;
561
+ name: string;
562
+ }
563
+ interface DeleteAgentChatResult {
564
+ taskId: string;
565
+ deleted: boolean;
566
+ }
543
567
  interface GetAgentTaskCreateOptions {
544
568
  /** Cria chat novo. taskId é preenchido depois do primeiro send(). */
545
569
  create: true;
@@ -657,7 +681,19 @@ type CredentialTarget = AgentSubscriptionTarget | AgentApiKeyTarget;
657
681
  * de baixo nível + abre popup + espera autorização):
658
682
  * connect
659
683
  */
660
- type CredentialAction = 'connect' | 'status' | 'remove' | 'list' | 'list_models' | 'validate' | 'save' | 'oauth_start' | 'oauth_exchange' | 'device_start' | 'device_poll' | 'device_cancel';
684
+ type CredentialAction = 'auth' | 'connect' | 'status' | 'remove' | 'list' | 'list_models' | 'list_providers' | 'validate' | 'save' | 'oauth_start' | 'oauth_exchange' | 'device_start' | 'device_poll' | 'device_cancel';
685
+ /** Forma de acesso a uma credencial. */
686
+ type CredentialAccessType = 'subscription' | 'api_key';
687
+ /** Método de conexão — diz ao app/agent qual UI montar. */
688
+ type AuthMethod = 'api_key' | 'paste_code' | 'device';
689
+ /** Metadados pra montar a UI de conexão (vem em cada provider de list_providers). */
690
+ interface AgentAuthMeta {
691
+ method: AuthMethod;
692
+ /** Só para method='api_key'. */
693
+ keyLabel?: string;
694
+ /** Só para method='api_key'. */
695
+ keyPlaceholder?: string;
696
+ }
661
697
  /** Um modelo selecionável (retornado por action='list_models'). */
662
698
  interface AgentModelOption {
663
699
  /** Passe direto em send({ modelId }) ou getAgentTaskMitra({ create, modelId }). */
@@ -669,13 +705,34 @@ interface AgentModelOption {
669
705
  interface AgentModelGroup {
670
706
  id: string;
671
707
  name: string;
672
- kind: 'subscription' | 'api_key';
708
+ type: CredentialAccessType;
673
709
  models: AgentModelOption[];
674
710
  }
675
711
  /** Retorno de manageAgentCredentialMitra({ action: 'list_models' }). */
676
712
  interface ListAgentModelsResult {
677
713
  providers: AgentModelGroup[];
678
714
  }
715
+ /** Um provedor suportado + status (retornado por action='list_providers'). */
716
+ interface AgentProviderListItem {
717
+ id: string;
718
+ name: string;
719
+ type: CredentialAccessType;
720
+ /** Passe direto em auth/connect/save/remove. */
721
+ target: string;
722
+ /** Como conectar: method (api_key|paste_code|device) + label/placeholder. */
723
+ auth: AgentAuthMeta;
724
+ connected: boolean;
725
+ /** Presente em subscription Claude conectada. */
726
+ account?: AgentSubscriptionAccount;
727
+ expiresAt?: number;
728
+ /** Presente em API key conectada. */
729
+ maskedKey?: string;
730
+ updatedAt?: string | Date;
731
+ }
732
+ /** Retorno de manageAgentCredentialMitra({ action: 'list_providers' }). */
733
+ interface ListAgentProvidersResult {
734
+ providers: AgentProviderListItem[];
735
+ }
679
736
  /**
680
737
  * Opções de baixo nível (RPC direto) de `manageAgentCredentialMitra`. Campos
681
738
  * extras (key, code, codeVerifier, redirectUri, pollId, accessToken,
@@ -684,8 +741,8 @@ interface ListAgentModelsResult {
684
741
  * NÃO use com action='connect' — para isso use ConnectAgentCredentialOptions.
685
742
  */
686
743
  interface ManageAgentCredentialOptions {
687
- action: Exclude<CredentialAction, 'connect'>;
688
- /** Obrigatório exceto para action='list'. */
744
+ action: Exclude<CredentialAction, 'connect' | 'auth'>;
745
+ /** Obrigatório exceto para action='list' / 'list_models'. */
689
746
  target?: CredentialTarget;
690
747
  /** Para `save` / `validate` de API key. */
691
748
  key?: string;
@@ -717,46 +774,54 @@ interface AgentSubscriptionAccount {
717
774
  * Orquestra o fluxo OAuth/device ponta-a-ponta no browser (abre popup, espera
718
775
  * autorização, troca por tokens server-side).
719
776
  */
777
+ /**
778
+ * Targets que conectam SEM redirect (paste código / device flow). O
779
+ * 'openai_oauth' fica de fora porque depende de redirect localhost:1455
780
+ * (client OAuth compartilhado da OpenAI) — inviável em domínio de cliente.
781
+ * OpenAI subscription conecta via 'codex' (device flow).
782
+ */
783
+ type ConnectableSubscriptionTarget = 'claude' | 'codex';
784
+ interface AuthAgentCredentialOptions {
785
+ action: 'auth';
786
+ target: ConnectableSubscriptionTarget;
787
+ }
788
+ /** Resultado de auth(claude): abra a authUrl, depois connect com o código. */
789
+ interface AuthClaudeResult {
790
+ target: 'claude';
791
+ /** URL pra abrir (a Anthropic mostra o código na própria tela). */
792
+ authUrl: string;
793
+ /** Passe de volta no connect junto com o código. */
794
+ state: string;
795
+ }
796
+ /** Resultado de auth(codex): mostre userCode/verificationUrl, depois connect com pollId. */
797
+ interface AuthCodexResult {
798
+ target: 'codex';
799
+ /** Código que o user digita no site da OpenAI. */
800
+ userCode: string | null;
801
+ /** URL que o user abre pra autorizar. */
802
+ verificationUrl: string | null;
803
+ /** Passe de volta no connect; a SDK faz o polling. */
804
+ pollId: string;
805
+ }
806
+ type AuthAgentCredentialResult = AuthClaudeResult | AuthCodexResult;
720
807
  interface ConnectAgentCredentialOptions {
721
808
  action: 'connect';
722
- target: AgentSubscriptionTarget;
723
- /**
724
- * Callback que retorna o código que o usuário copiou da página da Anthropic
725
- * após autorizar. **Obrigatório** para target='claude'.
726
- */
727
- onCodeNeeded?: (info: {
728
- authUrl: string;
729
- state: string;
730
- }) => Promise<string> | string;
731
- /**
732
- * URL no domínio do app publicado que captura o `?code=` da OAuth e faz
733
- * `window.opener.postMessage({ mitraOpenAICode: code }, '*')`.
734
- * **Obrigatório** para target='openai_oauth'.
735
- */
736
- redirectUri?: string;
737
- /** Timeout esperando o postMessage (default 5min). */
738
- messageTimeoutMs?: number;
739
- /**
740
- * Callback opcional que recebe o `userCode` e `verificationUrl` assim que
741
- * o device flow inicia (use pra exibir na UI além do popup automático).
742
- */
743
- onDeviceCode?: (info: {
744
- userCode: string | null;
745
- verificationUrl: string | null;
746
- }) => void;
809
+ target: ConnectableSubscriptionTarget;
810
+ /** Código que o user copiou da página da Anthropic. Obrigatório p/ claude. */
811
+ code?: string;
812
+ /** O `state` devolvido por auth(claude). Obrigatório p/ claude. */
813
+ state?: string;
814
+ /** O `pollId` devolvido por auth(codex). Obrigatório p/ codex. */
815
+ pollId?: string;
747
816
  /** Intervalo de poll do device flow (default 2000ms). */
748
817
  pollIntervalMs?: number;
749
818
  /** Timeout total do device flow (default 15min). */
750
819
  deviceTimeoutMs?: number;
751
- /** Nome da window do popup (default depende do target). */
752
- windowName?: string;
753
- /** `features` string passada para `window.open`. */
754
- windowFeatures?: string;
755
820
  }
756
821
  interface ConnectAgentSubscriptionResult {
757
- target: AgentSubscriptionTarget;
822
+ target: ConnectableSubscriptionTarget;
758
823
  success: boolean;
759
- /** Presente em claude / openai_oauth (epoch ms). */
824
+ /** Presente em claude (epoch ms). */
760
825
  expiresAt?: number;
761
826
  /** Presente apenas em claude. */
762
827
  account?: AgentSubscriptionAccount | null;
@@ -810,6 +875,7 @@ interface MitraInstance {
810
875
  resetPassword(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
811
876
  getAgentChats(options?: GetAgentChatsOptions): Promise<AgentChat[]>;
812
877
  getAgentTask(options: GetAgentTaskOptions): AgentTaskSession;
878
+ manageAgentChat(options: ManageAgentChatOptions): Promise<unknown>;
813
879
  manageAgentCredential(options: ManageAgentCredentialOptions | ConnectAgentCredentialOptions): Promise<unknown>;
814
880
  openChat(): void;
815
881
  closeChat(): void;
@@ -954,7 +1020,20 @@ declare function resetPasswordMitra(options: ResetPasswordOptions): Promise<Reco
954
1020
  */
955
1021
 
956
1022
  /**
957
- * Lista chats do user para um projeto.
1023
+ * Gerencia os chats do user (coleção) espelha `manageAgentCredentialMitra`.
1024
+ * Operações stateless: listar, renomear, deletar.
1025
+ *
1026
+ * @example
1027
+ * const chats = await manageAgentChatMitra({ action: 'list' });
1028
+ * await manageAgentChatMitra({ action: 'rename', taskId, name: 'Novo nome' });
1029
+ * await manageAgentChatMitra({ action: 'delete', taskId });
1030
+ */
1031
+ declare function manageAgentChatMitra(options: ManageAgentChatListOptions): Promise<AgentChat[]>;
1032
+ declare function manageAgentChatMitra(options: ManageAgentChatRenameOptions): Promise<RenameAgentChatResult>;
1033
+ declare function manageAgentChatMitra(options: ManageAgentChatDeleteOptions): Promise<DeleteAgentChatResult>;
1034
+ /**
1035
+ * Lista chats do user para um projeto. Alias fino de
1036
+ * manageAgentChatMitra({ action: 'list' }).
958
1037
  */
959
1038
  declare function getAgentChatsMitra(options?: GetAgentChatsOptions): Promise<AgentChat[]>;
960
1039
  /**
@@ -973,48 +1052,48 @@ declare function getAgentTaskMitra(options: GetAgentTaskOptions): AgentTaskSessi
973
1052
  * Função ÚNICA `manageAgentCredentialMitra` sobre /sdk-ws para todas as
974
1053
  * operações de credencial do agente:
975
1054
  * - API keys (8 providers: anthropic, openai, gemini, kimi, minimax, glm, qwen, openrouter)
976
- * - Subscriptions OAuth (Claude / OpenAI / Codex device flow)
1055
+ * - Subscriptions OAuth (Claude paste-código / OpenAI device flow via Codex)
977
1056
  *
978
1057
  * Actions de baixo nível (RPC direto contra o backend):
979
- * status | remove | list | validate | save
1058
+ * status | remove | list | list_models | validate | save
980
1059
  * oauth_start | oauth_exchange | device_start | device_poll | device_cancel
981
1060
  *
982
- * Action de alto nível (orquestra o fluxo ponta-a-ponta no browser):
983
- * connect abre popup, espera código/postMessage/poll, troca por tokens.
1061
+ * Actions de alto nível (orquestradas na SDK — o app controla UI/popup/timing):
1062
+ * auth inicia o fluxo e retorna o que a UI mostra (sem efeito colateral
1063
+ * de janela). claude → { authUrl, state }; codex → { userCode,
1064
+ * verificationUrl, pollId }.
1065
+ * connect — finaliza/salva. claude → passa { code, state }; codex → passa
1066
+ * { pollId } e a SDK faz o polling até autorizar.
1067
+ *
1068
+ * Fluxo típico (sem callbacks, sem redirect, sem callback page):
1069
+ * const { authUrl, state } = await manageAgentCredentialMitra({ action:'auth', target:'claude' });
1070
+ * // app abre authUrl + coleta o código do user
1071
+ * await manageAgentCredentialMitra({ action:'connect', target:'claude', code, state });
1072
+ *
1073
+ * const { userCode, verificationUrl, pollId } = await manageAgentCredentialMitra({ action:'auth', target:'codex' });
1074
+ * // app mostra "abra {verificationUrl}, digite {userCode}"
1075
+ * await manageAgentCredentialMitra({ action:'connect', target:'codex', pollId });
984
1076
  *
985
1077
  * SEGURANÇA: o token de subscription NUNCA volta cru pro cliente. É salvo
986
- * server-side (Firestore) e injetado no sandbox E2B direto de lá. O retorno
987
- * de `connect`/`oauth_exchange` traz só { connected, expiresAt, account }.
1078
+ * server-side (Firestore) e injetado no sandbox E2B direto de lá.
988
1079
  */
989
1080
 
990
1081
  /**
991
- * Conecta uma subscription ponta-a-ponta (abre popup, espera autorização,
992
- * troca por tokens). Retorno tipado: { target, success, expiresAt?, account? }.
993
- *
994
- * @example
995
- * // Claude — caller mostra modal pedindo o paste do código
996
- * await manageAgentCredentialMitra({
997
- * action: 'connect', target: 'claude',
998
- * onCodeNeeded: async () => prompt('Cole o código:') ?? ''
999
- * });
1000
- *
1001
- * @example
1002
- * // OpenAI — callback page no domínio do app faz postMessage
1003
- * await manageAgentCredentialMitra({
1004
- * action: 'connect', target: 'openai_oauth',
1005
- * redirectUri: window.location.origin + '/auth/openai-callback'
1006
- * });
1007
- *
1008
- * @example
1009
- * // Codex — device flow automático (abre verificação, polling)
1010
- * await manageAgentCredentialMitra({ action: 'connect', target: 'codex' });
1082
+ * Inicia um fluxo de subscription. Não abre janelas retorna os dados pra UI:
1083
+ * claude { authUrl, state } codex { userCode, verificationUrl, pollId }
1084
+ */
1085
+ declare function manageAgentCredentialMitra(options: AuthAgentCredentialOptions): Promise<AuthAgentCredentialResult>;
1086
+ /**
1087
+ * Finaliza/salva uma subscription:
1088
+ * claude → { code, state } codex → { pollId } (a SDK faz o polling)
1011
1089
  */
1012
1090
  declare function manageAgentCredentialMitra(options: ConnectAgentCredentialOptions): Promise<ConnectAgentSubscriptionResult>;
1013
1091
  /**
1014
- * RPC direto contra o backend. Retorno depende de (action, target) — veja docs.
1092
+ * RPC direto contra o backend. Retorno depende de (action, target).
1015
1093
  *
1016
1094
  * @example
1017
1095
  * await manageAgentCredentialMitra({ action: 'list' });
1096
+ * await manageAgentCredentialMitra({ action: 'list_models' });
1018
1097
  * await manageAgentCredentialMitra({ action: 'status', target: 'anthropic' });
1019
1098
  * await manageAgentCredentialMitra({ action: 'validate', target: 'openai', key: 'sk-...' });
1020
1099
  * await manageAgentCredentialMitra({ action: 'save', target: 'glm', key: '...' });
@@ -1177,4 +1256,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
1177
1256
  */
1178
1257
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
1179
1258
 
1180
- export { type AgentApiKeyTarget, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type CallIntegrationOptions, type CallIntegrationResponse, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAction, type CredentialTarget, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetAgentChatsOptions, type GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListAgentModelsResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendOptions, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentChatsMitra, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentCredentialMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
1259
+ export { type AgentApiKeyTarget, type AgentAuthMeta, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentProviderListItem, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type AuthAgentCredentialOptions, type AuthAgentCredentialResult, type AuthClaudeResult, type AuthCodexResult, type AuthMethod, type CallIntegrationOptions, type CallIntegrationResponse, type ChatManageAction, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type ConnectableSubscriptionTarget, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAccessType, type CredentialAction, type CredentialTarget, type DeleteAgentChatResult, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetAgentChatsOptions, type GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListAgentModelsResult, type ListAgentProvidersResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type ManageAgentChatDeleteOptions, type ManageAgentChatListOptions, type ManageAgentChatOptions, type ManageAgentChatRenameOptions, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type RenameAgentChatResult, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendOptions, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentChatsMitra, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentChatMitra, manageAgentCredentialMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };