@erdoai/ui 0.1.105 → 0.1.107

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
@@ -182,6 +182,48 @@ declare function useErdoConfig(): ErdoProviderConfig;
182
182
  */
183
183
  declare function useErdoConfigOptional(): ErdoProviderConfig | null;
184
184
 
185
+ interface DatasetMetricProps {
186
+ /** Metric label (e.g. "Total Revenue") */
187
+ label: string;
188
+ /** Dataset slug to query */
189
+ datasetSlug: string;
190
+ /** Invocation/thread ID for data fetching context */
191
+ invocationId: string;
192
+ /** SQL query that returns a single row with the metric value.
193
+ * e.g. "SELECT SUM(revenue) as total FROM data" */
194
+ sqlQuery: string;
195
+ /** Column key to read the value from (must match a column in the query result) */
196
+ valueKey: string;
197
+ /** Optional resource key for Excel files */
198
+ resourceKey?: string;
199
+ /** d3-format string for value display (e.g. ",.0f" for thousands, ".1%" for percent) */
200
+ format?: string;
201
+ /** Optional prefix (e.g. "$") */
202
+ prefix?: string;
203
+ /** Optional suffix (e.g. "%", " users") */
204
+ suffix?: string;
205
+ /** Optional subtitle/description shown below the value */
206
+ description?: string;
207
+ /** Class for the outer container */
208
+ className?: string;
209
+ }
210
+ /**
211
+ * A single KPI/metric card that fetches one value from a dataset.
212
+ * Handles loading, error, and empty states automatically.
213
+ *
214
+ * @example
215
+ * <DatasetMetric
216
+ * label="Total Revenue"
217
+ * datasetSlug="org.sales-data"
218
+ * invocationId="iframe"
219
+ * sqlQuery="SELECT SUM(CAST(revenue AS DOUBLE)) as total FROM data"
220
+ * valueKey="total"
221
+ * prefix="$"
222
+ * format=",.0f"
223
+ * />
224
+ */
225
+ declare function DatasetMetric({ label, datasetSlug, invocationId, sqlQuery, valueKey, resourceKey, format, prefix, suffix, description, className, }: DatasetMetricProps): react_jsx_runtime.JSX.Element;
226
+
185
227
  declare const THEMES: {
186
228
  readonly light: "";
187
229
  readonly dark: ".dark";
@@ -1606,15 +1648,13 @@ interface AgentStreamStore {
1606
1648
  pendingInvocationQueue: string[];
1607
1649
  /**
1608
1650
  * Push a raw SSE event into the store.
1609
- * Calls handleAgentEvent internally and re-slices affected invocations.
1651
+ * Handles invocation registration (from agent_invocation content) and root
1652
+ * mapping (from agent step_started) automatically, so callers don't need
1653
+ * separate registerInvocation/mapInvocationRoot calls.
1610
1654
  * @param event The raw SSE event
1611
1655
  * @param reconcile Optional post-processing (e.g., reconcileThinkingContentState)
1612
1656
  */
1613
1657
  pushEvent: (event: SSEEvent, reconcile?: (state: AgentStreamState) => AgentStreamState) => void;
1614
- /** Register an invocation_id (from agent_invocation event). Queues it for root mapping. */
1615
- registerInvocation: (invocationId: string) => void;
1616
- /** Map an invocation_id to its root step_id (from step_started with type: 'agent'). */
1617
- mapInvocationRoot: (invocationId: string, rootStepId: string) => void;
1618
1658
  /** Reset the store (new session). */
1619
1659
  reset: () => void;
1620
1660
  }
@@ -2057,4 +2097,4 @@ declare function useInvocationState(invocationId: string | undefined): AgentStre
2057
2097
  */
2058
2098
  declare function useAgentStreamGlobalState(): AgentStreamState;
2059
2099
 
2060
- 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, type DatasetFilter, 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 };
2100
+ 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, type DatasetFilter, DatasetMetric, type DatasetMetricProps, 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
@@ -182,6 +182,48 @@ declare function useErdoConfig(): ErdoProviderConfig;
182
182
  */
183
183
  declare function useErdoConfigOptional(): ErdoProviderConfig | null;
184
184
 
185
+ interface DatasetMetricProps {
186
+ /** Metric label (e.g. "Total Revenue") */
187
+ label: string;
188
+ /** Dataset slug to query */
189
+ datasetSlug: string;
190
+ /** Invocation/thread ID for data fetching context */
191
+ invocationId: string;
192
+ /** SQL query that returns a single row with the metric value.
193
+ * e.g. "SELECT SUM(revenue) as total FROM data" */
194
+ sqlQuery: string;
195
+ /** Column key to read the value from (must match a column in the query result) */
196
+ valueKey: string;
197
+ /** Optional resource key for Excel files */
198
+ resourceKey?: string;
199
+ /** d3-format string for value display (e.g. ",.0f" for thousands, ".1%" for percent) */
200
+ format?: string;
201
+ /** Optional prefix (e.g. "$") */
202
+ prefix?: string;
203
+ /** Optional suffix (e.g. "%", " users") */
204
+ suffix?: string;
205
+ /** Optional subtitle/description shown below the value */
206
+ description?: string;
207
+ /** Class for the outer container */
208
+ className?: string;
209
+ }
210
+ /**
211
+ * A single KPI/metric card that fetches one value from a dataset.
212
+ * Handles loading, error, and empty states automatically.
213
+ *
214
+ * @example
215
+ * <DatasetMetric
216
+ * label="Total Revenue"
217
+ * datasetSlug="org.sales-data"
218
+ * invocationId="iframe"
219
+ * sqlQuery="SELECT SUM(CAST(revenue AS DOUBLE)) as total FROM data"
220
+ * valueKey="total"
221
+ * prefix="$"
222
+ * format=",.0f"
223
+ * />
224
+ */
225
+ declare function DatasetMetric({ label, datasetSlug, invocationId, sqlQuery, valueKey, resourceKey, format, prefix, suffix, description, className, }: DatasetMetricProps): react_jsx_runtime.JSX.Element;
226
+
185
227
  declare const THEMES: {
186
228
  readonly light: "";
187
229
  readonly dark: ".dark";
@@ -1606,15 +1648,13 @@ interface AgentStreamStore {
1606
1648
  pendingInvocationQueue: string[];
1607
1649
  /**
1608
1650
  * Push a raw SSE event into the store.
1609
- * Calls handleAgentEvent internally and re-slices affected invocations.
1651
+ * Handles invocation registration (from agent_invocation content) and root
1652
+ * mapping (from agent step_started) automatically, so callers don't need
1653
+ * separate registerInvocation/mapInvocationRoot calls.
1610
1654
  * @param event The raw SSE event
1611
1655
  * @param reconcile Optional post-processing (e.g., reconcileThinkingContentState)
1612
1656
  */
1613
1657
  pushEvent: (event: SSEEvent, reconcile?: (state: AgentStreamState) => AgentStreamState) => void;
1614
- /** Register an invocation_id (from agent_invocation event). Queues it for root mapping. */
1615
- registerInvocation: (invocationId: string) => void;
1616
- /** Map an invocation_id to its root step_id (from step_started with type: 'agent'). */
1617
- mapInvocationRoot: (invocationId: string, rootStepId: string) => void;
1618
1658
  /** Reset the store (new session). */
1619
1659
  reset: () => void;
1620
1660
  }
@@ -2057,4 +2097,4 @@ declare function useInvocationState(invocationId: string | undefined): AgentStre
2057
2097
  */
2058
2098
  declare function useAgentStreamGlobalState(): AgentStreamState;
2059
2099
 
2060
- 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, type DatasetFilter, 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 };
2100
+ 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, type DatasetFilter, DatasetMetric, type DatasetMetricProps, 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 };