@erdoai/ui 0.1.83 → 0.1.84

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
@@ -1340,11 +1340,6 @@ interface ErdoToolResultProps {
1340
1340
  part: ErdoToolPart;
1341
1341
  /** Optional className for styling */
1342
1342
  className?: string;
1343
- /**
1344
- * Invocation ID for data fetching (charts/tables).
1345
- * If not provided, charts and tables will show a warning instead of data.
1346
- */
1347
- invocationId?: string;
1348
1343
  /** Callback when a suggestion is clicked */
1349
1344
  onSuggestionClick?: (suggestion: string) => void;
1350
1345
  }
@@ -1355,8 +1350,9 @@ interface ErdoToolResultProps {
1355
1350
  * rich UI rendering. It handles:
1356
1351
  *
1357
1352
  * - **Loading states**: Shows a spinner while the tool is executing
1358
- * - **UI tools** (ask_data_question, query_data): Renders charts, tables,
1359
- * and markdown via `UIGenerationNodes`
1353
+ * - **UI tools** (render_chart, render_table): Renders charts and tables
1354
+ * via `UIGenerationNodes`, using `toolCallId` as invocationId for data fetching
1355
+ * - **Markdown tools** (ask_data_question): Renders text answer as markdown
1360
1356
  * - **Data tools** (list_datasets, get_schema, etc.): Renders JSON output
1361
1357
  * - **Errors**: Displays error messages
1362
1358
  *
@@ -1381,7 +1377,7 @@ interface ErdoToolResultProps {
1381
1377
  * }
1382
1378
  * ```
1383
1379
  */
1384
- declare function ErdoToolResult({ part, className, invocationId, onSuggestionClick, }: ErdoToolResultProps): react_jsx_runtime.JSX.Element | null;
1380
+ declare function ErdoToolResult({ part, className, onSuggestionClick, }: ErdoToolResultProps): react_jsx_runtime.JSX.Element | null;
1385
1381
 
1386
1382
  /** Node structure from UI generation content */
1387
1383
  interface UINode {
@@ -1908,13 +1904,16 @@ declare function isErdoTool(part: {
1908
1904
  type: string;
1909
1905
  toolName?: string;
1910
1906
  }): boolean;
1911
- /** Names of Erdo tools that return structured UI output (charts, tables, text). */
1912
- declare const ERDO_UI_TOOLS: Set<string>;
1907
+ /** How each Erdo tool's result should be rendered. */
1908
+ type ErdoToolRenderType = 'ui' | 'markdown' | 'data';
1913
1909
  /**
1914
- * Check if an Erdo tool returns structured UI output (charts, tables, markdown).
1915
- * Non-UI tools (list_datasets, get_schema, etc.) return plain JSON data.
1910
+ * Get the render type for an Erdo tool.
1911
+ *
1912
+ * - `'ui'`: Structured chart/table output rendered via UIGenerationNodes
1913
+ * - `'markdown'`: Text answer rendered as markdown
1914
+ * - `'data'`: Raw JSON output
1916
1915
  */
1917
- declare function isErdoUITool(toolName: string): boolean;
1916
+ declare function getErdoToolRenderType(toolName: string): ErdoToolRenderType;
1918
1917
 
1919
1918
  /**
1920
1919
  * SSE Event Handler
@@ -2047,4 +2046,4 @@ declare function useInvocationState(invocationId: string | undefined): AgentStre
2047
2046
  */
2048
2047
  declare function useAgentStreamGlobalState(): AgentStreamState;
2049
2048
 
2050
- 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, ERDO_UI_TOOLS, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoToolResult, type ErdoToolResultProps, 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, getErdoToolName, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isErdoTool, isErdoUITool, 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 };
2049
+ 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, type ErdoToolRenderType, ErdoToolResult, type ErdoToolResultProps, 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, getErdoToolName, getErdoToolRenderType, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isErdoTool, 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
@@ -1340,11 +1340,6 @@ interface ErdoToolResultProps {
1340
1340
  part: ErdoToolPart;
1341
1341
  /** Optional className for styling */
1342
1342
  className?: string;
1343
- /**
1344
- * Invocation ID for data fetching (charts/tables).
1345
- * If not provided, charts and tables will show a warning instead of data.
1346
- */
1347
- invocationId?: string;
1348
1343
  /** Callback when a suggestion is clicked */
1349
1344
  onSuggestionClick?: (suggestion: string) => void;
1350
1345
  }
@@ -1355,8 +1350,9 @@ interface ErdoToolResultProps {
1355
1350
  * rich UI rendering. It handles:
1356
1351
  *
1357
1352
  * - **Loading states**: Shows a spinner while the tool is executing
1358
- * - **UI tools** (ask_data_question, query_data): Renders charts, tables,
1359
- * and markdown via `UIGenerationNodes`
1353
+ * - **UI tools** (render_chart, render_table): Renders charts and tables
1354
+ * via `UIGenerationNodes`, using `toolCallId` as invocationId for data fetching
1355
+ * - **Markdown tools** (ask_data_question): Renders text answer as markdown
1360
1356
  * - **Data tools** (list_datasets, get_schema, etc.): Renders JSON output
1361
1357
  * - **Errors**: Displays error messages
1362
1358
  *
@@ -1381,7 +1377,7 @@ interface ErdoToolResultProps {
1381
1377
  * }
1382
1378
  * ```
1383
1379
  */
1384
- declare function ErdoToolResult({ part, className, invocationId, onSuggestionClick, }: ErdoToolResultProps): react_jsx_runtime.JSX.Element | null;
1380
+ declare function ErdoToolResult({ part, className, onSuggestionClick, }: ErdoToolResultProps): react_jsx_runtime.JSX.Element | null;
1385
1381
 
1386
1382
  /** Node structure from UI generation content */
1387
1383
  interface UINode {
@@ -1908,13 +1904,16 @@ declare function isErdoTool(part: {
1908
1904
  type: string;
1909
1905
  toolName?: string;
1910
1906
  }): boolean;
1911
- /** Names of Erdo tools that return structured UI output (charts, tables, text). */
1912
- declare const ERDO_UI_TOOLS: Set<string>;
1907
+ /** How each Erdo tool's result should be rendered. */
1908
+ type ErdoToolRenderType = 'ui' | 'markdown' | 'data';
1913
1909
  /**
1914
- * Check if an Erdo tool returns structured UI output (charts, tables, markdown).
1915
- * Non-UI tools (list_datasets, get_schema, etc.) return plain JSON data.
1910
+ * Get the render type for an Erdo tool.
1911
+ *
1912
+ * - `'ui'`: Structured chart/table output rendered via UIGenerationNodes
1913
+ * - `'markdown'`: Text answer rendered as markdown
1914
+ * - `'data'`: Raw JSON output
1916
1915
  */
1917
- declare function isErdoUITool(toolName: string): boolean;
1916
+ declare function getErdoToolRenderType(toolName: string): ErdoToolRenderType;
1918
1917
 
1919
1918
  /**
1920
1919
  * SSE Event Handler
@@ -2047,4 +2046,4 @@ declare function useInvocationState(invocationId: string | undefined): AgentStre
2047
2046
  */
2048
2047
  declare function useAgentStreamGlobalState(): AgentStreamState;
2049
2048
 
2050
- 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, ERDO_UI_TOOLS, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErdoToolResult, type ErdoToolResultProps, 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, getErdoToolName, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isErdoTool, isErdoUITool, 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 };
2049
+ 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, type ErdoToolRenderType, ErdoToolResult, type ErdoToolResultProps, 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, getErdoToolName, getErdoToolRenderType, handleAgentEvent, handleIncrementalMixedJsonParsing, handleSSEEvent, hasRenderableAssistantOutput, isErdoTool, 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 };