@personaai/react 0.18.1 → 0.19.0

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.cts CHANGED
@@ -292,6 +292,12 @@ type PersonaStreamingEvent = {
292
292
  resourceUri: string;
293
293
  mcpId: string;
294
294
  };
295
+ } | {
296
+ type: "CUSTOM";
297
+ name: "mcp_auth_required";
298
+ value: {
299
+ servers: PersonaMcpAuthRequiredServer[];
300
+ };
295
301
  } | {
296
302
  type: "CUSTOM";
297
303
  name: "workflow_node_started";
@@ -332,6 +338,15 @@ interface UseChatOptions {
332
338
  onThreadCreated?: (threadId: string) => void;
333
339
  /** Called when the backend auto-generates a thread title (3-4 word LLM summary of first user message). */
334
340
  onTitle?: (title: string) => void;
341
+ /**
342
+ * Called at the start of a run when the Agent has `authMode: 'user'` MCP
343
+ * connectors this end user hasn't connected — their tools are dropped from
344
+ * the toolset server-side, so the model simply can't use them. Use this to
345
+ * show a "Connect your account" affordance; `useMcpConnections` returns
346
+ * each server's `authorizeUrl` for the actual consent redirect. Not called
347
+ * when every user-mode connector is connected.
348
+ */
349
+ onMcpAuthRequired?: (servers: PersonaMcpAuthRequiredServer[]) => void;
335
350
  /**
336
351
  * Pass the object returned by `useVoice()` (sharing the same `threadId`) to have `useChat`
337
352
  * merge live voice turns into `messages` automatically — one bubble per utterance, deduped
@@ -1163,6 +1178,17 @@ interface PersonaMcpOAuthInput {
1163
1178
  clientSecret: string;
1164
1179
  scopes?: string[];
1165
1180
  }
1181
+ /**
1182
+ * One `authType: 'oauth', authMode: 'user'` MCP an Agent has attached whose
1183
+ * tools were dropped for this end user because they haven't connected (or
1184
+ * their grant was revoked/expired). Emitted as the `mcp_auth_required`
1185
+ * CUSTOM stream event at the start of every run; see `onMcpAuthRequired`.
1186
+ */
1187
+ interface PersonaMcpAuthRequiredServer {
1188
+ mcpId: string;
1189
+ name: string;
1190
+ description?: string;
1191
+ }
1166
1192
  interface CreatePersonaMcpInput {
1167
1193
  name: string;
1168
1194
  transport: PersonaMcpTransport;
@@ -1532,6 +1558,17 @@ declare function useConnection(autoCheck?: boolean): {
1532
1558
  checkHealth: () => Promise<PersonaHealthInfo | null>;
1533
1559
  };
1534
1560
 
1561
+ /**
1562
+ * Why a user-mode MCP isn't usable, in increasing specificity over the bare
1563
+ * `connected` boolean:
1564
+ * - `connected` — a usable token row exists (may still be refreshed soon).
1565
+ * - `expired` — a row exists but its access token is dead and there's no
1566
+ * refresh token to renew it; `authorizeUrl` is populated.
1567
+ * - `needs_auth` — the provider rejected the stored grant (revoked or
1568
+ * expired refresh token); reconnecting is the only fix.
1569
+ * - `not_connected` — this end user has never connected.
1570
+ */
1571
+ type PersonaMcpConnectionStatus = "connected" | "expired" | "needs_auth" | "not_connected";
1535
1572
  /**
1536
1573
  * One `authType: 'oauth', authMode: 'user'` MCP an Agent has attached, and
1537
1574
  * whether the current end user has connected it yet. `authorizeUrl` is only
@@ -1544,6 +1581,17 @@ interface PersonaMcpConnection {
1544
1581
  name: string;
1545
1582
  description: string;
1546
1583
  connected: boolean;
1584
+ /**
1585
+ * Finer-grained than `connected` — tells "never connected" apart from
1586
+ * "token expired" and "grant revoked", so the UI can say "Connect" vs.
1587
+ * "Reconnect". Absent against backends predating this field; treat
1588
+ * `undefined` as `connected ? "connected" : "not_connected"`.
1589
+ */
1590
+ status?: PersonaMcpConnectionStatus;
1591
+ /** When the stored access token expires (ISO string), if the provider returned one. */
1592
+ expiresAt?: string | null;
1593
+ /** The provider's rejection reason when `status` is `needs_auth` (never contains tokens). */
1594
+ lastError?: string | null;
1547
1595
  authorizeUrl: string | null;
1548
1596
  }
1549
1597
  interface UseMcpConnectionsOptions {
@@ -1845,6 +1893,6 @@ declare function supportsStreamingFetch(): boolean;
1845
1893
  */
1846
1894
  declare function openSSEStream(opts: OpenSSEOptions): Promise<SSEStream>;
1847
1895
 
1848
- declare const VERSION = "0.18.1";
1896
+ declare const VERSION = "0.19.0";
1849
1897
 
1850
- export { ARCHITECT_AGENT_ID, type CreatePersonaAgentInput, type CreatePersonaKnowledgeBaseInput, type CreatePersonaMcpInput, type CreatePersonaRcpSourceInput, type CreatePersonaSkillInput, type CreatePersonaWorkflowInput, type OpenSSEOptions, type PersonaAgent, type PersonaAgentCategory, type PersonaAgentMessageDelivery, type PersonaAgentSnapshot, type PersonaAgentSocialLinks, type PersonaAgentVisibility, type PersonaBulkDeleteResult, type PersonaClarificationQuestion, type PersonaDeleteDocumentResult, type PersonaFailureResponse, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaHttpFailureInfo, type PersonaInterrupt, type PersonaKnowledgeBase, type PersonaKnowledgeBaseUsage, type PersonaKnowledgeDocument, type PersonaKnowledgeSearchResult, type PersonaMcp, type PersonaMcpAuthMode, type PersonaMcpAuthType, type PersonaMcpConnection, type PersonaMcpOAuthConfig, type PersonaMcpOAuthInput, type PersonaMcpResourceSummary, type PersonaMcpResourceTemplate, type PersonaMcpTestConnectionResult, type PersonaMcpTool, type PersonaMcpTransport, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaMessageChannel, type PersonaMessageDelivery, type PersonaNodeOnErrorAction, type PersonaNodeRetryPolicy, type PersonaNodeRun, type PersonaNodeRunState, type PersonaNodeRunStatus, type PersonaPagination, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaRcpParamContextMapEntry, type PersonaRcpSource, type PersonaRcpSourceTestResult, type PersonaRcpSourceToolParamSummary, type PersonaRcpSourceToolSummary, type PersonaResourceUsage, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaSkill, type PersonaSkillFile, type PersonaSkillUsage, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaUploadDocumentsResult, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkflow, type PersonaWorkflowDraft, type PersonaWorkflowEdge, type PersonaWorkflowNode, type PersonaWorkflowNodeData, type PersonaWorkflowNodeType, type PersonaWorkflowOwnerType, type PersonaWorkflowRun, type PersonaWorkflowRunStatus, type PersonaWorkflowTrigger, type PersonaWorkflowTriggerType, type PersonaWorkflowUsage, type PersonaWorkflowVersion, type PersonaWorkflowVisibility, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendArchitectMessageOverride, type SendMessageOverride, type SendPersonaAgentMessageInput, type SendPersonaMessageInput, type UpdatePersonaAgentInput, type UpdatePersonaKnowledgeBaseInput, type UpdatePersonaMcpInput, type UpdatePersonaRcpSourceInput, type UpdatePersonaSkillInput, type UpdatePersonaWorkflowInput, type UploadKnowledgeDocumentInput, type UseAgentsOptions, type UseArchitectChatOptions, type UseChatOptions, type UseKnowledgeBasesOptions, type UseMcpAdminOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseMessagesResult, type UseRcpSourcesOptions, type UseSkillsOptions, type UseVoiceOptions, type UseVoiceResult, type UseWorkflowOptions, type UseWorkflowRunsOptions, type UseWorkflowStreamOptions, type UseWorkflowStreamResult, type UseWorkflowsOptions, VERSION, type WorkflowsPagination, openSSEStream, supportsStreamingFetch, useAgents, useArchitectChat, useChat, useConnection, useFiles, useKnowledgeBases, useMcp, useMcpAdmin, useMcpConnections, useMemory, useMessages, usePersonaContext, useRcpSources, useSkills, useThreads, useVoice, useWorkflow, useWorkflowRuns, useWorkflowStream, useWorkflows, useWorkspaceFiles };
1898
+ export { ARCHITECT_AGENT_ID, type CreatePersonaAgentInput, type CreatePersonaKnowledgeBaseInput, type CreatePersonaMcpInput, type CreatePersonaRcpSourceInput, type CreatePersonaSkillInput, type CreatePersonaWorkflowInput, type OpenSSEOptions, type PersonaAgent, type PersonaAgentCategory, type PersonaAgentMessageDelivery, type PersonaAgentSnapshot, type PersonaAgentSocialLinks, type PersonaAgentVisibility, type PersonaBulkDeleteResult, type PersonaClarificationQuestion, type PersonaDeleteDocumentResult, type PersonaFailureResponse, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaHttpFailureInfo, type PersonaInterrupt, type PersonaKnowledgeBase, type PersonaKnowledgeBaseUsage, type PersonaKnowledgeDocument, type PersonaKnowledgeSearchResult, type PersonaMcp, type PersonaMcpAuthMode, type PersonaMcpAuthRequiredServer, type PersonaMcpAuthType, type PersonaMcpConnection, type PersonaMcpConnectionStatus, type PersonaMcpOAuthConfig, type PersonaMcpOAuthInput, type PersonaMcpResourceSummary, type PersonaMcpResourceTemplate, type PersonaMcpTestConnectionResult, type PersonaMcpTool, type PersonaMcpTransport, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaMessageChannel, type PersonaMessageDelivery, type PersonaNodeOnErrorAction, type PersonaNodeRetryPolicy, type PersonaNodeRun, type PersonaNodeRunState, type PersonaNodeRunStatus, type PersonaPagination, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaRcpParamContextMapEntry, type PersonaRcpSource, type PersonaRcpSourceTestResult, type PersonaRcpSourceToolParamSummary, type PersonaRcpSourceToolSummary, type PersonaResourceUsage, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaSkill, type PersonaSkillFile, type PersonaSkillUsage, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaUploadDocumentsResult, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkflow, type PersonaWorkflowDraft, type PersonaWorkflowEdge, type PersonaWorkflowNode, type PersonaWorkflowNodeData, type PersonaWorkflowNodeType, type PersonaWorkflowOwnerType, type PersonaWorkflowRun, type PersonaWorkflowRunStatus, type PersonaWorkflowTrigger, type PersonaWorkflowTriggerType, type PersonaWorkflowUsage, type PersonaWorkflowVersion, type PersonaWorkflowVisibility, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendArchitectMessageOverride, type SendMessageOverride, type SendPersonaAgentMessageInput, type SendPersonaMessageInput, type UpdatePersonaAgentInput, type UpdatePersonaKnowledgeBaseInput, type UpdatePersonaMcpInput, type UpdatePersonaRcpSourceInput, type UpdatePersonaSkillInput, type UpdatePersonaWorkflowInput, type UploadKnowledgeDocumentInput, type UseAgentsOptions, type UseArchitectChatOptions, type UseChatOptions, type UseKnowledgeBasesOptions, type UseMcpAdminOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseMessagesResult, type UseRcpSourcesOptions, type UseSkillsOptions, type UseVoiceOptions, type UseVoiceResult, type UseWorkflowOptions, type UseWorkflowRunsOptions, type UseWorkflowStreamOptions, type UseWorkflowStreamResult, type UseWorkflowsOptions, VERSION, type WorkflowsPagination, openSSEStream, supportsStreamingFetch, useAgents, useArchitectChat, useChat, useConnection, useFiles, useKnowledgeBases, useMcp, useMcpAdmin, useMcpConnections, useMemory, useMessages, usePersonaContext, useRcpSources, useSkills, useThreads, useVoice, useWorkflow, useWorkflowRuns, useWorkflowStream, useWorkflows, useWorkspaceFiles };
package/dist/index.d.ts CHANGED
@@ -292,6 +292,12 @@ type PersonaStreamingEvent = {
292
292
  resourceUri: string;
293
293
  mcpId: string;
294
294
  };
295
+ } | {
296
+ type: "CUSTOM";
297
+ name: "mcp_auth_required";
298
+ value: {
299
+ servers: PersonaMcpAuthRequiredServer[];
300
+ };
295
301
  } | {
296
302
  type: "CUSTOM";
297
303
  name: "workflow_node_started";
@@ -332,6 +338,15 @@ interface UseChatOptions {
332
338
  onThreadCreated?: (threadId: string) => void;
333
339
  /** Called when the backend auto-generates a thread title (3-4 word LLM summary of first user message). */
334
340
  onTitle?: (title: string) => void;
341
+ /**
342
+ * Called at the start of a run when the Agent has `authMode: 'user'` MCP
343
+ * connectors this end user hasn't connected — their tools are dropped from
344
+ * the toolset server-side, so the model simply can't use them. Use this to
345
+ * show a "Connect your account" affordance; `useMcpConnections` returns
346
+ * each server's `authorizeUrl` for the actual consent redirect. Not called
347
+ * when every user-mode connector is connected.
348
+ */
349
+ onMcpAuthRequired?: (servers: PersonaMcpAuthRequiredServer[]) => void;
335
350
  /**
336
351
  * Pass the object returned by `useVoice()` (sharing the same `threadId`) to have `useChat`
337
352
  * merge live voice turns into `messages` automatically — one bubble per utterance, deduped
@@ -1163,6 +1178,17 @@ interface PersonaMcpOAuthInput {
1163
1178
  clientSecret: string;
1164
1179
  scopes?: string[];
1165
1180
  }
1181
+ /**
1182
+ * One `authType: 'oauth', authMode: 'user'` MCP an Agent has attached whose
1183
+ * tools were dropped for this end user because they haven't connected (or
1184
+ * their grant was revoked/expired). Emitted as the `mcp_auth_required`
1185
+ * CUSTOM stream event at the start of every run; see `onMcpAuthRequired`.
1186
+ */
1187
+ interface PersonaMcpAuthRequiredServer {
1188
+ mcpId: string;
1189
+ name: string;
1190
+ description?: string;
1191
+ }
1166
1192
  interface CreatePersonaMcpInput {
1167
1193
  name: string;
1168
1194
  transport: PersonaMcpTransport;
@@ -1532,6 +1558,17 @@ declare function useConnection(autoCheck?: boolean): {
1532
1558
  checkHealth: () => Promise<PersonaHealthInfo | null>;
1533
1559
  };
1534
1560
 
1561
+ /**
1562
+ * Why a user-mode MCP isn't usable, in increasing specificity over the bare
1563
+ * `connected` boolean:
1564
+ * - `connected` — a usable token row exists (may still be refreshed soon).
1565
+ * - `expired` — a row exists but its access token is dead and there's no
1566
+ * refresh token to renew it; `authorizeUrl` is populated.
1567
+ * - `needs_auth` — the provider rejected the stored grant (revoked or
1568
+ * expired refresh token); reconnecting is the only fix.
1569
+ * - `not_connected` — this end user has never connected.
1570
+ */
1571
+ type PersonaMcpConnectionStatus = "connected" | "expired" | "needs_auth" | "not_connected";
1535
1572
  /**
1536
1573
  * One `authType: 'oauth', authMode: 'user'` MCP an Agent has attached, and
1537
1574
  * whether the current end user has connected it yet. `authorizeUrl` is only
@@ -1544,6 +1581,17 @@ interface PersonaMcpConnection {
1544
1581
  name: string;
1545
1582
  description: string;
1546
1583
  connected: boolean;
1584
+ /**
1585
+ * Finer-grained than `connected` — tells "never connected" apart from
1586
+ * "token expired" and "grant revoked", so the UI can say "Connect" vs.
1587
+ * "Reconnect". Absent against backends predating this field; treat
1588
+ * `undefined` as `connected ? "connected" : "not_connected"`.
1589
+ */
1590
+ status?: PersonaMcpConnectionStatus;
1591
+ /** When the stored access token expires (ISO string), if the provider returned one. */
1592
+ expiresAt?: string | null;
1593
+ /** The provider's rejection reason when `status` is `needs_auth` (never contains tokens). */
1594
+ lastError?: string | null;
1547
1595
  authorizeUrl: string | null;
1548
1596
  }
1549
1597
  interface UseMcpConnectionsOptions {
@@ -1845,6 +1893,6 @@ declare function supportsStreamingFetch(): boolean;
1845
1893
  */
1846
1894
  declare function openSSEStream(opts: OpenSSEOptions): Promise<SSEStream>;
1847
1895
 
1848
- declare const VERSION = "0.18.1";
1896
+ declare const VERSION = "0.19.0";
1849
1897
 
1850
- export { ARCHITECT_AGENT_ID, type CreatePersonaAgentInput, type CreatePersonaKnowledgeBaseInput, type CreatePersonaMcpInput, type CreatePersonaRcpSourceInput, type CreatePersonaSkillInput, type CreatePersonaWorkflowInput, type OpenSSEOptions, type PersonaAgent, type PersonaAgentCategory, type PersonaAgentMessageDelivery, type PersonaAgentSnapshot, type PersonaAgentSocialLinks, type PersonaAgentVisibility, type PersonaBulkDeleteResult, type PersonaClarificationQuestion, type PersonaDeleteDocumentResult, type PersonaFailureResponse, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaHttpFailureInfo, type PersonaInterrupt, type PersonaKnowledgeBase, type PersonaKnowledgeBaseUsage, type PersonaKnowledgeDocument, type PersonaKnowledgeSearchResult, type PersonaMcp, type PersonaMcpAuthMode, type PersonaMcpAuthType, type PersonaMcpConnection, type PersonaMcpOAuthConfig, type PersonaMcpOAuthInput, type PersonaMcpResourceSummary, type PersonaMcpResourceTemplate, type PersonaMcpTestConnectionResult, type PersonaMcpTool, type PersonaMcpTransport, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaMessageChannel, type PersonaMessageDelivery, type PersonaNodeOnErrorAction, type PersonaNodeRetryPolicy, type PersonaNodeRun, type PersonaNodeRunState, type PersonaNodeRunStatus, type PersonaPagination, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaRcpParamContextMapEntry, type PersonaRcpSource, type PersonaRcpSourceTestResult, type PersonaRcpSourceToolParamSummary, type PersonaRcpSourceToolSummary, type PersonaResourceUsage, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaSkill, type PersonaSkillFile, type PersonaSkillUsage, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaUploadDocumentsResult, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkflow, type PersonaWorkflowDraft, type PersonaWorkflowEdge, type PersonaWorkflowNode, type PersonaWorkflowNodeData, type PersonaWorkflowNodeType, type PersonaWorkflowOwnerType, type PersonaWorkflowRun, type PersonaWorkflowRunStatus, type PersonaWorkflowTrigger, type PersonaWorkflowTriggerType, type PersonaWorkflowUsage, type PersonaWorkflowVersion, type PersonaWorkflowVisibility, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendArchitectMessageOverride, type SendMessageOverride, type SendPersonaAgentMessageInput, type SendPersonaMessageInput, type UpdatePersonaAgentInput, type UpdatePersonaKnowledgeBaseInput, type UpdatePersonaMcpInput, type UpdatePersonaRcpSourceInput, type UpdatePersonaSkillInput, type UpdatePersonaWorkflowInput, type UploadKnowledgeDocumentInput, type UseAgentsOptions, type UseArchitectChatOptions, type UseChatOptions, type UseKnowledgeBasesOptions, type UseMcpAdminOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseMessagesResult, type UseRcpSourcesOptions, type UseSkillsOptions, type UseVoiceOptions, type UseVoiceResult, type UseWorkflowOptions, type UseWorkflowRunsOptions, type UseWorkflowStreamOptions, type UseWorkflowStreamResult, type UseWorkflowsOptions, VERSION, type WorkflowsPagination, openSSEStream, supportsStreamingFetch, useAgents, useArchitectChat, useChat, useConnection, useFiles, useKnowledgeBases, useMcp, useMcpAdmin, useMcpConnections, useMemory, useMessages, usePersonaContext, useRcpSources, useSkills, useThreads, useVoice, useWorkflow, useWorkflowRuns, useWorkflowStream, useWorkflows, useWorkspaceFiles };
1898
+ export { ARCHITECT_AGENT_ID, type CreatePersonaAgentInput, type CreatePersonaKnowledgeBaseInput, type CreatePersonaMcpInput, type CreatePersonaRcpSourceInput, type CreatePersonaSkillInput, type CreatePersonaWorkflowInput, type OpenSSEOptions, type PersonaAgent, type PersonaAgentCategory, type PersonaAgentMessageDelivery, type PersonaAgentSnapshot, type PersonaAgentSocialLinks, type PersonaAgentVisibility, type PersonaBulkDeleteResult, type PersonaClarificationQuestion, type PersonaDeleteDocumentResult, type PersonaFailureResponse, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaHttpFailureInfo, type PersonaInterrupt, type PersonaKnowledgeBase, type PersonaKnowledgeBaseUsage, type PersonaKnowledgeDocument, type PersonaKnowledgeSearchResult, type PersonaMcp, type PersonaMcpAuthMode, type PersonaMcpAuthRequiredServer, type PersonaMcpAuthType, type PersonaMcpConnection, type PersonaMcpConnectionStatus, type PersonaMcpOAuthConfig, type PersonaMcpOAuthInput, type PersonaMcpResourceSummary, type PersonaMcpResourceTemplate, type PersonaMcpTestConnectionResult, type PersonaMcpTool, type PersonaMcpTransport, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaMessageChannel, type PersonaMessageDelivery, type PersonaNodeOnErrorAction, type PersonaNodeRetryPolicy, type PersonaNodeRun, type PersonaNodeRunState, type PersonaNodeRunStatus, type PersonaPagination, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaRcpParamContextMapEntry, type PersonaRcpSource, type PersonaRcpSourceTestResult, type PersonaRcpSourceToolParamSummary, type PersonaRcpSourceToolSummary, type PersonaResourceUsage, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaSkill, type PersonaSkillFile, type PersonaSkillUsage, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaUploadDocumentsResult, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkflow, type PersonaWorkflowDraft, type PersonaWorkflowEdge, type PersonaWorkflowNode, type PersonaWorkflowNodeData, type PersonaWorkflowNodeType, type PersonaWorkflowOwnerType, type PersonaWorkflowRun, type PersonaWorkflowRunStatus, type PersonaWorkflowTrigger, type PersonaWorkflowTriggerType, type PersonaWorkflowUsage, type PersonaWorkflowVersion, type PersonaWorkflowVisibility, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendArchitectMessageOverride, type SendMessageOverride, type SendPersonaAgentMessageInput, type SendPersonaMessageInput, type UpdatePersonaAgentInput, type UpdatePersonaKnowledgeBaseInput, type UpdatePersonaMcpInput, type UpdatePersonaRcpSourceInput, type UpdatePersonaSkillInput, type UpdatePersonaWorkflowInput, type UploadKnowledgeDocumentInput, type UseAgentsOptions, type UseArchitectChatOptions, type UseChatOptions, type UseKnowledgeBasesOptions, type UseMcpAdminOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseMessagesResult, type UseRcpSourcesOptions, type UseSkillsOptions, type UseVoiceOptions, type UseVoiceResult, type UseWorkflowOptions, type UseWorkflowRunsOptions, type UseWorkflowStreamOptions, type UseWorkflowStreamResult, type UseWorkflowsOptions, VERSION, type WorkflowsPagination, openSSEStream, supportsStreamingFetch, useAgents, useArchitectChat, useChat, useConnection, useFiles, useKnowledgeBases, useMcp, useMcpAdmin, useMcpConnections, useMemory, useMessages, usePersonaContext, useRcpSources, useSkills, useThreads, useVoice, useWorkflow, useWorkflowRuns, useWorkflowStream, useWorkflows, useWorkspaceFiles };
package/dist/index.js CHANGED
@@ -963,6 +963,13 @@ function useChat(options = {}) {
963
963
  patchAssistant({});
964
964
  }
965
965
  }
966
+ } else if (event.name === "mcp_auth_required") {
967
+ const val = event.value;
968
+ const servers = val?.servers ?? [];
969
+ if (servers.length > 0) {
970
+ chatLogger.info("mcp auth required", { mcpIds: servers.map((s) => s.mcpId) });
971
+ options.onMcpAuthRequired?.(servers);
972
+ }
966
973
  }
967
974
  } else if (event.type === "title") {
968
975
  const title = event.title;
@@ -2903,7 +2910,7 @@ function useMcpConnections(options = {}) {
2903
2910
  throw new Error(`Failed to disconnect MCP: ${res.statusText}`);
2904
2911
  setConnections(
2905
2912
  (prev) => prev.map(
2906
- (c) => c.mcpId === mcpId ? { ...c, connected: false, authorizeUrl: null } : c
2913
+ (c) => c.mcpId === mcpId ? { ...c, connected: false, status: "not_connected", authorizeUrl: null } : c
2907
2914
  )
2908
2915
  );
2909
2916
  void fetchConnections();
@@ -4402,7 +4409,7 @@ import {
4402
4409
  getLogLevel,
4403
4410
  isLevelEnabled
4404
4411
  } from "@personaai/logger";
4405
- var VERSION = "0.18.1";
4412
+ var VERSION = "0.19.0";
4406
4413
  export {
4407
4414
  ARCHITECT_AGENT_ID,
4408
4415
  PersonaProvider,