@erdoai/ui 0.1.70 → 0.1.72

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
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default from 'react';
3
+ import React__default, { ReactNode } from 'react';
4
4
  import { ErdoClient, ContentItem, InvokeResult, LogEntry, ToolGroup, InvocationStatus as InvocationStatus$1, AgentStreamState, SSEEvent, Thread } from '@erdoai/types';
5
5
  export { ContentItem } from '@erdoai/types';
6
6
  import * as RechartsPrimitive from 'recharts';
7
+ import { StoreApi } from 'zustand';
7
8
  import { ClassValue } from 'clsx';
8
9
 
9
10
  /**
@@ -1032,7 +1033,8 @@ interface WebSearchContentProps {
1032
1033
  className?: string;
1033
1034
  }
1034
1035
  /**
1035
- * Renders web search results as a list of clickable cards.
1036
+ * Renders web search result links inside a subtle bordered card.
1037
+ * No header — ToolGroupContent provides the collapsible header.
1036
1038
  */
1037
1039
  declare function WebSearchContent({ item, className }: WebSearchContentProps): react_jsx_runtime.JSX.Element | null;
1038
1040
 
@@ -1041,7 +1043,8 @@ interface WebParseContentProps {
1041
1043
  className?: string;
1042
1044
  }
1043
1045
  /**
1044
- * Renders parsed web page content with title, description, and markdown body.
1046
+ * Renders parsed web page content inside a bordered card.
1047
+ * No header — ToolGroupContent provides the collapsible header.
1045
1048
  */
1046
1049
  declare function WebParseContent({ item, className }: WebParseContentProps): react_jsx_runtime.JSX.Element | null;
1047
1050
 
@@ -1494,6 +1497,42 @@ declare function useMultipleDatasetRequests(requests: DatasetFetchRequest[], inv
1494
1497
  */
1495
1498
  declare function useMultipleDatasetContents(datasetSlugs: string[], invocationId: string, sqlQueries?: Record<string, string>, resourceKeys?: Record<string, string>): UseDatasetContentsResult[];
1496
1499
 
1500
+ /**
1501
+ * Zustand store for agent streaming state.
1502
+ *
1503
+ * Holds the global AgentStreamState and per-invocation sliced states.
1504
+ * Components subscribe to individual invocation slices via useInvocationState(),
1505
+ * so only the affected component re-renders when an event arrives.
1506
+ *
1507
+ * The store calls handleAgentEvent internally — consumers just push raw SSE events.
1508
+ */
1509
+
1510
+ declare function sliceAgentStateToRoot(state: AgentStreamState, rootStepID: string): AgentStreamState;
1511
+ interface AgentStreamStore {
1512
+ /** The single merged state from all events */
1513
+ globalState: AgentStreamState;
1514
+ /** Per-invocation sliced states. Key: invocation_id */
1515
+ invocationStates: Record<string, AgentStreamState>;
1516
+ /** Maps invocation_id → root step_id */
1517
+ invocationRootSteps: Record<string, string>;
1518
+ /** Queue for invocations awaiting their root step_started */
1519
+ pendingInvocationQueue: string[];
1520
+ /**
1521
+ * Push a raw SSE event into the store.
1522
+ * Calls handleAgentEvent internally and re-slices affected invocations.
1523
+ * @param event The raw SSE event
1524
+ * @param reconcile Optional post-processing (e.g., reconcileThinkingContentState)
1525
+ */
1526
+ pushEvent: (event: SSEEvent, reconcile?: (state: AgentStreamState) => AgentStreamState) => void;
1527
+ /** Register an invocation_id (from agent_invocation event). Queues it for root mapping. */
1528
+ registerInvocation: (invocationId: string) => void;
1529
+ /** Map an invocation_id to its root step_id (from step_started with type: 'agent'). */
1530
+ mapInvocationRoot: (invocationId: string, rootStepId: string) => void;
1531
+ /** Reset the store (new session). */
1532
+ reset: () => void;
1533
+ }
1534
+ declare function createAgentStreamStore(): StoreApi<AgentStreamStore>;
1535
+
1497
1536
  interface UseThreadOptions {
1498
1537
  /** Initial thread ID to use (if resuming an existing thread) */
1499
1538
  threadId?: string;
@@ -1528,6 +1567,8 @@ interface UseThreadReturn {
1528
1567
  cancel: () => void;
1529
1568
  /** Function to create or set the thread */
1530
1569
  setThread: (thread: Thread) => void;
1570
+ /** The Zustand store — pass to AgentStreamStoreProvider for granular subscriptions */
1571
+ agentStreamStore: StoreApi<AgentStreamStore>;
1531
1572
  }
1532
1573
  /**
1533
1574
  * Hook for managing a thread and sending messages.
@@ -1586,23 +1627,23 @@ interface UseThreadReturn {
1586
1627
  *
1587
1628
  * @example
1588
1629
  * ```tsx
1589
- * import { useThread, Content } from '@erdoai/ui';
1630
+ * import { useThread, Content, AgentStreamStoreProvider } from '@erdoai/ui';
1590
1631
  *
1591
1632
  * function MyChat() {
1592
- * const { isStreaming, streamingContents, sendMessage } = useThread({
1633
+ * const { isStreaming, streamingContents, sendMessage, agentStreamStore } = useThread({
1593
1634
  * botKey: 'org.my-bot',
1594
1635
  * onFinish: (finalContents) => console.log('Message complete with', finalContents.length, 'items'),
1595
1636
  * });
1596
1637
  *
1597
1638
  * return (
1598
- * <div>
1639
+ * <AgentStreamStoreProvider store={agentStreamStore}>
1599
1640
  * {streamingContents.map((content, idx) => (
1600
1641
  * <Content key={content.id || idx} content={content} />
1601
1642
  * ))}
1602
1643
  * <button onClick={() => sendMessage('Hello')} disabled={isStreaming}>
1603
1644
  * Send
1604
1645
  * </button>
1605
- * </div>
1646
+ * </AgentStreamStoreProvider>
1606
1647
  * );
1607
1648
  * }
1608
1649
  * ```
@@ -1838,13 +1879,10 @@ declare function completeStreamingContent(state: AgentStreamState): AgentStreamS
1838
1879
  * - Non-empty text (from message content delta)
1839
1880
  * - Parsed JSON chunks (incremental JSON streaming)
1840
1881
  * - A final result (from message content result)
1882
+ * - A visible, non-hidden tool_call step (e.g. web search, URL parse)
1841
1883
  *
1842
- * Excludes tool_invocation / tool_result / agent_invocation content types
1843
- * which are structural, not user-visible assistant output.
1844
- *
1845
- * Does NOT count step tree rows (tool_call, agent steps) — those are structural
1846
- * indicators, not assistant content. This ensures typing stays visible until the
1847
- * first actual text/chart/output token arrives.
1884
+ * Excludes tool_invocation / agent_invocation content types which are structural.
1885
+ * Visible tool_result content (web_search, web_parse, etc.) IS renderable output.
1848
1886
  *
1849
1887
  * Use this to gate typing indicators: keep typing visible until this returns true.
1850
1888
  */
@@ -1858,4 +1896,26 @@ declare function hasRenderableAssistantOutput(state: AgentStreamState): boolean;
1858
1896
  */
1859
1897
  declare function agentStateToContents(state: AgentStreamState): ContentItem[];
1860
1898
 
1861
- export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartNode, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, type DatasetFetchRequest, DatasetTable, type DatasetTableProps, DownloadButtonNode, type DownloadButtonNodeContent, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoUI, type ErdoUIProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, FileDownloadsNode, type FileDownloadsNodeContent, type GeneratedFile, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Loader, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Memory, MemoryContent, type MemoryContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type NodeRendererProps, type NullString, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type RawApiContent, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, StepTreeContent, type StepTreeContentProps, SuggestionsNode, type SuggestionsNodeContent, TableContent, type TableContentProps, TableNode, type TableNodeContent, TextContent, type TextContentProps, TextMarkdownNode, type TextMarkdownNodeContent, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, UIGenerationNodes, type UIGenerationNodesProps, type UINode, type UseDatasetContentsResult, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, agentStateToContents, cn, completeStreamingContent, createInitialAgentState, extractContentItems, formatValue, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, nodeComponents, normalizeContent, normalizeContents, normalizeUIGenerationChunks, normalizeUINodes, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, unwrapNullString, unwrapNullStringOr, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useMultipleDatasetRequests, useThread };
1899
+ interface AgentStreamStoreProviderProps {
1900
+ store: StoreApi<AgentStreamStore>;
1901
+ children: ReactNode;
1902
+ }
1903
+ declare function AgentStreamStoreProvider({ store, children }: AgentStreamStoreProviderProps): react_jsx_runtime.JSX.Element;
1904
+ /**
1905
+ * Get the raw store API for imperative use (e.g., in event handlers).
1906
+ * Returns null if no provider is present (backward compat).
1907
+ */
1908
+ declare function useAgentStreamStoreOptional(): StoreApi<AgentStreamStore> | null;
1909
+ /**
1910
+ * Subscribe to a specific invocation's sliced agent state.
1911
+ * Only re-renders when that invocation's state reference changes.
1912
+ * Returns undefined if the invocation is not yet registered or no provider.
1913
+ */
1914
+ declare function useInvocationState(invocationId: string | undefined): AgentStreamState | undefined;
1915
+ /**
1916
+ * Subscribe to the full global agent state.
1917
+ * Re-renders on every event — use sparingly.
1918
+ */
1919
+ declare function useAgentStreamGlobalState(): AgentStreamState;
1920
+
1921
+ export { type AgentStreamStore, AgentStreamStoreProvider, type AgentStreamStoreProviderProps, BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartNode, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, type DatasetFetchRequest, DatasetTable, type DatasetTableProps, DownloadButtonNode, type DownloadButtonNodeContent, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoUI, type ErdoUIProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, FileDownloadsNode, type FileDownloadsNodeContent, type GeneratedFile, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Loader, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Memory, MemoryContent, type MemoryContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type NodeRendererProps, type NullString, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type RawApiContent, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, StepTreeContent, type StepTreeContentProps, SuggestionsNode, type SuggestionsNodeContent, TableContent, type TableContentProps, TableNode, type TableNodeContent, TextContent, type TextContentProps, TextMarkdownNode, type TextMarkdownNodeContent, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, UIGenerationNodes, type UIGenerationNodesProps, type UINode, type UseDatasetContentsResult, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, agentStateToContents, cn, completeStreamingContent, createAgentStreamStore, createInitialAgentState, extractContentItems, formatValue, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, nodeComponents, normalizeContent, normalizeContents, normalizeUIGenerationChunks, normalizeUINodes, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, sliceAgentStateToRoot, toSnakeCase, unwrapNullString, unwrapNullStringOr, useAgentStreamGlobalState, useAgentStreamStoreOptional, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useInvocationState, useMultipleDatasetContents, useMultipleDatasetRequests, useThread };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default from 'react';
3
+ import React__default, { ReactNode } from 'react';
4
4
  import { ErdoClient, ContentItem, InvokeResult, LogEntry, ToolGroup, InvocationStatus as InvocationStatus$1, AgentStreamState, SSEEvent, Thread } from '@erdoai/types';
5
5
  export { ContentItem } from '@erdoai/types';
6
6
  import * as RechartsPrimitive from 'recharts';
7
+ import { StoreApi } from 'zustand';
7
8
  import { ClassValue } from 'clsx';
8
9
 
9
10
  /**
@@ -1032,7 +1033,8 @@ interface WebSearchContentProps {
1032
1033
  className?: string;
1033
1034
  }
1034
1035
  /**
1035
- * Renders web search results as a list of clickable cards.
1036
+ * Renders web search result links inside a subtle bordered card.
1037
+ * No header — ToolGroupContent provides the collapsible header.
1036
1038
  */
1037
1039
  declare function WebSearchContent({ item, className }: WebSearchContentProps): react_jsx_runtime.JSX.Element | null;
1038
1040
 
@@ -1041,7 +1043,8 @@ interface WebParseContentProps {
1041
1043
  className?: string;
1042
1044
  }
1043
1045
  /**
1044
- * Renders parsed web page content with title, description, and markdown body.
1046
+ * Renders parsed web page content inside a bordered card.
1047
+ * No header — ToolGroupContent provides the collapsible header.
1045
1048
  */
1046
1049
  declare function WebParseContent({ item, className }: WebParseContentProps): react_jsx_runtime.JSX.Element | null;
1047
1050
 
@@ -1494,6 +1497,42 @@ declare function useMultipleDatasetRequests(requests: DatasetFetchRequest[], inv
1494
1497
  */
1495
1498
  declare function useMultipleDatasetContents(datasetSlugs: string[], invocationId: string, sqlQueries?: Record<string, string>, resourceKeys?: Record<string, string>): UseDatasetContentsResult[];
1496
1499
 
1500
+ /**
1501
+ * Zustand store for agent streaming state.
1502
+ *
1503
+ * Holds the global AgentStreamState and per-invocation sliced states.
1504
+ * Components subscribe to individual invocation slices via useInvocationState(),
1505
+ * so only the affected component re-renders when an event arrives.
1506
+ *
1507
+ * The store calls handleAgentEvent internally — consumers just push raw SSE events.
1508
+ */
1509
+
1510
+ declare function sliceAgentStateToRoot(state: AgentStreamState, rootStepID: string): AgentStreamState;
1511
+ interface AgentStreamStore {
1512
+ /** The single merged state from all events */
1513
+ globalState: AgentStreamState;
1514
+ /** Per-invocation sliced states. Key: invocation_id */
1515
+ invocationStates: Record<string, AgentStreamState>;
1516
+ /** Maps invocation_id → root step_id */
1517
+ invocationRootSteps: Record<string, string>;
1518
+ /** Queue for invocations awaiting their root step_started */
1519
+ pendingInvocationQueue: string[];
1520
+ /**
1521
+ * Push a raw SSE event into the store.
1522
+ * Calls handleAgentEvent internally and re-slices affected invocations.
1523
+ * @param event The raw SSE event
1524
+ * @param reconcile Optional post-processing (e.g., reconcileThinkingContentState)
1525
+ */
1526
+ pushEvent: (event: SSEEvent, reconcile?: (state: AgentStreamState) => AgentStreamState) => void;
1527
+ /** Register an invocation_id (from agent_invocation event). Queues it for root mapping. */
1528
+ registerInvocation: (invocationId: string) => void;
1529
+ /** Map an invocation_id to its root step_id (from step_started with type: 'agent'). */
1530
+ mapInvocationRoot: (invocationId: string, rootStepId: string) => void;
1531
+ /** Reset the store (new session). */
1532
+ reset: () => void;
1533
+ }
1534
+ declare function createAgentStreamStore(): StoreApi<AgentStreamStore>;
1535
+
1497
1536
  interface UseThreadOptions {
1498
1537
  /** Initial thread ID to use (if resuming an existing thread) */
1499
1538
  threadId?: string;
@@ -1528,6 +1567,8 @@ interface UseThreadReturn {
1528
1567
  cancel: () => void;
1529
1568
  /** Function to create or set the thread */
1530
1569
  setThread: (thread: Thread) => void;
1570
+ /** The Zustand store — pass to AgentStreamStoreProvider for granular subscriptions */
1571
+ agentStreamStore: StoreApi<AgentStreamStore>;
1531
1572
  }
1532
1573
  /**
1533
1574
  * Hook for managing a thread and sending messages.
@@ -1586,23 +1627,23 @@ interface UseThreadReturn {
1586
1627
  *
1587
1628
  * @example
1588
1629
  * ```tsx
1589
- * import { useThread, Content } from '@erdoai/ui';
1630
+ * import { useThread, Content, AgentStreamStoreProvider } from '@erdoai/ui';
1590
1631
  *
1591
1632
  * function MyChat() {
1592
- * const { isStreaming, streamingContents, sendMessage } = useThread({
1633
+ * const { isStreaming, streamingContents, sendMessage, agentStreamStore } = useThread({
1593
1634
  * botKey: 'org.my-bot',
1594
1635
  * onFinish: (finalContents) => console.log('Message complete with', finalContents.length, 'items'),
1595
1636
  * });
1596
1637
  *
1597
1638
  * return (
1598
- * <div>
1639
+ * <AgentStreamStoreProvider store={agentStreamStore}>
1599
1640
  * {streamingContents.map((content, idx) => (
1600
1641
  * <Content key={content.id || idx} content={content} />
1601
1642
  * ))}
1602
1643
  * <button onClick={() => sendMessage('Hello')} disabled={isStreaming}>
1603
1644
  * Send
1604
1645
  * </button>
1605
- * </div>
1646
+ * </AgentStreamStoreProvider>
1606
1647
  * );
1607
1648
  * }
1608
1649
  * ```
@@ -1838,13 +1879,10 @@ declare function completeStreamingContent(state: AgentStreamState): AgentStreamS
1838
1879
  * - Non-empty text (from message content delta)
1839
1880
  * - Parsed JSON chunks (incremental JSON streaming)
1840
1881
  * - A final result (from message content result)
1882
+ * - A visible, non-hidden tool_call step (e.g. web search, URL parse)
1841
1883
  *
1842
- * Excludes tool_invocation / tool_result / agent_invocation content types
1843
- * which are structural, not user-visible assistant output.
1844
- *
1845
- * Does NOT count step tree rows (tool_call, agent steps) — those are structural
1846
- * indicators, not assistant content. This ensures typing stays visible until the
1847
- * first actual text/chart/output token arrives.
1884
+ * Excludes tool_invocation / agent_invocation content types which are structural.
1885
+ * Visible tool_result content (web_search, web_parse, etc.) IS renderable output.
1848
1886
  *
1849
1887
  * Use this to gate typing indicators: keep typing visible until this returns true.
1850
1888
  */
@@ -1858,4 +1896,26 @@ declare function hasRenderableAssistantOutput(state: AgentStreamState): boolean;
1858
1896
  */
1859
1897
  declare function agentStateToContents(state: AgentStreamState): ContentItem[];
1860
1898
 
1861
- export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartNode, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, type DatasetFetchRequest, DatasetTable, type DatasetTableProps, DownloadButtonNode, type DownloadButtonNodeContent, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoUI, type ErdoUIProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, FileDownloadsNode, type FileDownloadsNodeContent, type GeneratedFile, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Loader, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Memory, MemoryContent, type MemoryContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type NodeRendererProps, type NullString, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type RawApiContent, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, StepTreeContent, type StepTreeContentProps, SuggestionsNode, type SuggestionsNodeContent, TableContent, type TableContentProps, TableNode, type TableNodeContent, TextContent, type TextContentProps, TextMarkdownNode, type TextMarkdownNodeContent, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, UIGenerationNodes, type UIGenerationNodesProps, type UINode, type UseDatasetContentsResult, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, agentStateToContents, cn, completeStreamingContent, createInitialAgentState, extractContentItems, formatValue, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, nodeComponents, normalizeContent, normalizeContents, normalizeUIGenerationChunks, normalizeUINodes, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, unwrapNullString, unwrapNullStringOr, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useMultipleDatasetContents, useMultipleDatasetRequests, useThread };
1899
+ interface AgentStreamStoreProviderProps {
1900
+ store: StoreApi<AgentStreamStore>;
1901
+ children: ReactNode;
1902
+ }
1903
+ declare function AgentStreamStoreProvider({ store, children }: AgentStreamStoreProviderProps): react_jsx_runtime.JSX.Element;
1904
+ /**
1905
+ * Get the raw store API for imperative use (e.g., in event handlers).
1906
+ * Returns null if no provider is present (backward compat).
1907
+ */
1908
+ declare function useAgentStreamStoreOptional(): StoreApi<AgentStreamStore> | null;
1909
+ /**
1910
+ * Subscribe to a specific invocation's sliced agent state.
1911
+ * Only re-renders when that invocation's state reference changes.
1912
+ * Returns undefined if the invocation is not yet registered or no provider.
1913
+ */
1914
+ declare function useInvocationState(invocationId: string | undefined): AgentStreamState | undefined;
1915
+ /**
1916
+ * Subscribe to the full global agent state.
1917
+ * Re-renders on every event — use sparingly.
1918
+ */
1919
+ declare function useAgentStreamGlobalState(): AgentStreamState;
1920
+
1921
+ export { type AgentStreamStore, AgentStreamStoreProvider, type AgentStreamStoreProviderProps, BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartNode, type ChartNodeContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, type DatasetDetails, DatasetDownload, type DatasetDownloadProps, type DatasetFetchRequest, DatasetTable, type DatasetTableProps, DownloadButtonNode, type DownloadButtonNodeContent, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoUI, type ErdoUIProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, FileDownloadsNode, type FileDownloadsNodeContent, type GeneratedFile, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Loader, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Memory, MemoryContent, type MemoryContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type NodeRendererProps, type NullString, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type RawApiContent, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, StepTreeContent, type StepTreeContentProps, SuggestionsNode, type SuggestionsNodeContent, TableContent, type TableContentProps, TableNode, type TableNodeContent, TextContent, type TextContentProps, TextMarkdownNode, type TextMarkdownNodeContent, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, UIGenerationNodes, type UIGenerationNodesProps, type UINode, type UseDatasetContentsResult, type UseThreadOptions, type UseThreadReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, WritingLoader, agentStateToContents, cn, completeStreamingContent, createAgentStreamStore, createInitialAgentState, extractContentItems, formatValue, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isJsonLike, isNullString, isParsingComplete, isParsingInProgress, isWhitespaceChar, nodeComponents, normalizeContent, normalizeContents, normalizeUIGenerationChunks, normalizeUINodes, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, sliceAgentStateToRoot, toSnakeCase, unwrapNullString, unwrapNullStringOr, useAgentStreamGlobalState, useAgentStreamStoreOptional, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useInvocationState, useMultipleDatasetContents, useMultipleDatasetRequests, useThread };