@axiom-lattice/react-sdk 2.1.50 → 2.1.51

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
@@ -1999,4 +1999,92 @@ declare const useAxiomTheme: () => {
1999
1999
  };
2000
2000
  };
2001
2001
 
2002
- export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
2002
+ /**
2003
+ * 流式 HTML 渲染器配置
2004
+ */
2005
+ interface StreamingHTMLRendererProps {
2006
+ /** HTML 内容(可能是不完整的 HTML 片段) */
2007
+ html: string;
2008
+ /** 外层容器样式类 */
2009
+ className?: string;
2010
+ /** 流式传输是否完成(完成后触发脚本执行) */
2011
+ isComplete?: boolean;
2012
+ /** 错误回调函数 */
2013
+ onError?: (error: StreamingError) => void;
2014
+ /**
2015
+ * Widget 发送 prompt 的回调函数
2016
+ * 当用户点击带有 sendPrompt() 的元素时触发
2017
+ */
2018
+ onPrompt?: (text: string) => void;
2019
+ /**
2020
+ * @deprecated 不再使用,保留用于向后兼容
2021
+ */
2022
+ sanitizerConfig?: SanitizerConfig;
2023
+ /**
2024
+ * @deprecated 不再使用,保留用于向后兼容。使用 isComplete 触发脚本执行
2025
+ */
2026
+ executeScripts?: boolean;
2027
+ title?: string;
2028
+ loadingMessages?: string[];
2029
+ }
2030
+ /**
2031
+ * 流式渲染错误类型
2032
+ */
2033
+ type StreamingError = {
2034
+ type: 'IFRAME_LOAD_ERROR';
2035
+ message: string;
2036
+ } | {
2037
+ type: 'POSTMESSAGE_ERROR';
2038
+ message: string;
2039
+ } | {
2040
+ type: 'PARSE_ERROR';
2041
+ message: string;
2042
+ chunk: string;
2043
+ } | {
2044
+ type: 'RENDER_ERROR';
2045
+ message: string;
2046
+ } | {
2047
+ type: 'SCRIPT_ERROR';
2048
+ message: string;
2049
+ stack?: string;
2050
+ };
2051
+ /**
2052
+ * XSS 过滤器配置
2053
+ */
2054
+ interface SanitizerConfig {
2055
+ /** 允许的标签白名单 */
2056
+ allowedTags?: string[];
2057
+ /** 允许的属性白名单 */
2058
+ allowedAttributes?: string[];
2059
+ /** 禁止的标签 */
2060
+ forbiddenTags?: string[];
2061
+ /** 禁止的属性 */
2062
+ forbiddenAttributes?: string[];
2063
+ }
2064
+ /**
2065
+ * 标签平衡结果
2066
+ */
2067
+ interface BalanceResult {
2068
+ /** 可渲染的 HTML(已补全关闭标签) */
2069
+ renderableHTML: string;
2070
+ /** 当前未闭合的标签栈 */
2071
+ openTagStack: string[];
2072
+ /** 是否结构完整 */
2073
+ isComplete: boolean;
2074
+ }
2075
+
2076
+ /**
2077
+ * 流式 HTML 渲染器组件
2078
+ * 使用 iframe 架构安全地渲染可能不完整的 HTML 片段
2079
+ */
2080
+ declare const StreamingHTMLRenderer: React__default.FC<StreamingHTMLRendererProps>;
2081
+
2082
+ type IframeMessage = {
2083
+ type: 'stream-chunk';
2084
+ chunk: string;
2085
+ } | {
2086
+ type: 'execute-scripts';
2087
+ };
2088
+ declare function generateIframeSrcdoc(): string;
2089
+
2090
+ export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
package/dist/index.d.ts CHANGED
@@ -1999,4 +1999,92 @@ declare const useAxiomTheme: () => {
1999
1999
  };
2000
2000
  };
2001
2001
 
2002
- export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
2002
+ /**
2003
+ * 流式 HTML 渲染器配置
2004
+ */
2005
+ interface StreamingHTMLRendererProps {
2006
+ /** HTML 内容(可能是不完整的 HTML 片段) */
2007
+ html: string;
2008
+ /** 外层容器样式类 */
2009
+ className?: string;
2010
+ /** 流式传输是否完成(完成后触发脚本执行) */
2011
+ isComplete?: boolean;
2012
+ /** 错误回调函数 */
2013
+ onError?: (error: StreamingError) => void;
2014
+ /**
2015
+ * Widget 发送 prompt 的回调函数
2016
+ * 当用户点击带有 sendPrompt() 的元素时触发
2017
+ */
2018
+ onPrompt?: (text: string) => void;
2019
+ /**
2020
+ * @deprecated 不再使用,保留用于向后兼容
2021
+ */
2022
+ sanitizerConfig?: SanitizerConfig;
2023
+ /**
2024
+ * @deprecated 不再使用,保留用于向后兼容。使用 isComplete 触发脚本执行
2025
+ */
2026
+ executeScripts?: boolean;
2027
+ title?: string;
2028
+ loadingMessages?: string[];
2029
+ }
2030
+ /**
2031
+ * 流式渲染错误类型
2032
+ */
2033
+ type StreamingError = {
2034
+ type: 'IFRAME_LOAD_ERROR';
2035
+ message: string;
2036
+ } | {
2037
+ type: 'POSTMESSAGE_ERROR';
2038
+ message: string;
2039
+ } | {
2040
+ type: 'PARSE_ERROR';
2041
+ message: string;
2042
+ chunk: string;
2043
+ } | {
2044
+ type: 'RENDER_ERROR';
2045
+ message: string;
2046
+ } | {
2047
+ type: 'SCRIPT_ERROR';
2048
+ message: string;
2049
+ stack?: string;
2050
+ };
2051
+ /**
2052
+ * XSS 过滤器配置
2053
+ */
2054
+ interface SanitizerConfig {
2055
+ /** 允许的标签白名单 */
2056
+ allowedTags?: string[];
2057
+ /** 允许的属性白名单 */
2058
+ allowedAttributes?: string[];
2059
+ /** 禁止的标签 */
2060
+ forbiddenTags?: string[];
2061
+ /** 禁止的属性 */
2062
+ forbiddenAttributes?: string[];
2063
+ }
2064
+ /**
2065
+ * 标签平衡结果
2066
+ */
2067
+ interface BalanceResult {
2068
+ /** 可渲染的 HTML(已补全关闭标签) */
2069
+ renderableHTML: string;
2070
+ /** 当前未闭合的标签栈 */
2071
+ openTagStack: string[];
2072
+ /** 是否结构完整 */
2073
+ isComplete: boolean;
2074
+ }
2075
+
2076
+ /**
2077
+ * 流式 HTML 渲染器组件
2078
+ * 使用 iframe 架构安全地渲染可能不完整的 HTML 片段
2079
+ */
2080
+ declare const StreamingHTMLRenderer: React__default.FC<StreamingHTMLRendererProps>;
2081
+
2082
+ type IframeMessage = {
2083
+ type: 'stream-chunk';
2084
+ chunk: string;
2085
+ } | {
2086
+ type: 'execute-scripts';
2087
+ };
2088
+ declare function generateIframeSrcdoc(): string;
2089
+
2090
+ export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };