@erdoai/ui 0.1.14 → 0.1.16
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/README.md +28 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +33 -17
- package/dist/index.d.ts +33 -17
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -66,6 +66,22 @@ interface ErdoProviderConfig {
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
dataFetcher?: DataFetcher;
|
|
69
|
+
/**
|
|
70
|
+
* Optional component for rendering content items.
|
|
71
|
+
* When provided, invocation components will use this to render nested content.
|
|
72
|
+
* This allows consumers to inject their own Content component with custom renderers.
|
|
73
|
+
*
|
|
74
|
+
* Example:
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <ErdoProvider config={{ baseUrl: '...', ContentComponent: MyContent }}>
|
|
77
|
+
* <InvocationEvents eventsByID={events} />
|
|
78
|
+
* </ErdoProvider>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
ContentComponent?: React__default.ComponentType<{
|
|
82
|
+
content: any;
|
|
83
|
+
className?: string;
|
|
84
|
+
}>;
|
|
69
85
|
}
|
|
70
86
|
interface ErdoProviderProps {
|
|
71
87
|
children: React__default.ReactNode;
|
|
@@ -439,7 +455,7 @@ interface MessageWithContents {
|
|
|
439
455
|
contentsByID: Record<string, MessageContent>;
|
|
440
456
|
contentIDToIdx: Record<string, number>;
|
|
441
457
|
}
|
|
442
|
-
interface Output {
|
|
458
|
+
interface Output$1 {
|
|
443
459
|
id: string;
|
|
444
460
|
invocation_id?: string;
|
|
445
461
|
path?: string;
|
|
@@ -474,7 +490,7 @@ interface OutputWithContents {
|
|
|
474
490
|
_type: 'output';
|
|
475
491
|
id: string;
|
|
476
492
|
step_id?: string;
|
|
477
|
-
output: Output;
|
|
493
|
+
output: Output$1;
|
|
478
494
|
state: MessageStreamingState;
|
|
479
495
|
contents: OutputContent[];
|
|
480
496
|
contentsByID: Record<string, OutputContent>;
|
|
@@ -532,7 +548,7 @@ interface Step {
|
|
|
532
548
|
Valid: boolean;
|
|
533
549
|
};
|
|
534
550
|
depends_on: string[];
|
|
535
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
551
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
536
552
|
currentStatus: Status | null;
|
|
537
553
|
}
|
|
538
554
|
interface ResultHandler {
|
|
@@ -547,7 +563,7 @@ interface ResultHandler {
|
|
|
547
563
|
updated_at: string;
|
|
548
564
|
output_content_type: string;
|
|
549
565
|
result_handler_order: number;
|
|
550
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
566
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
551
567
|
}
|
|
552
568
|
declare enum InvocationStatus {
|
|
553
569
|
Pending = "pending",
|
|
@@ -598,7 +614,7 @@ interface BotInvocationData {
|
|
|
598
614
|
interface BotInvocation {
|
|
599
615
|
_type: 'invocation';
|
|
600
616
|
bot_invocation: BotInvocationData;
|
|
601
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
617
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
602
618
|
currentStatus: Status | null;
|
|
603
619
|
current_status: Status | null;
|
|
604
620
|
step_invocations: any[];
|
|
@@ -607,7 +623,7 @@ interface BotInvocation {
|
|
|
607
623
|
outputs: any[];
|
|
608
624
|
statuses: any[];
|
|
609
625
|
}
|
|
610
|
-
interface InvocationEvent {
|
|
626
|
+
interface InvocationEvent$1 {
|
|
611
627
|
id?: string;
|
|
612
628
|
type?: EntityType;
|
|
613
629
|
created_at?: string;
|
|
@@ -621,8 +637,8 @@ interface InvocationEvent {
|
|
|
621
637
|
type Entity = MessageWithContents | MessageContent | BotInvocation | OutputWithContents | OutputContent | Step | ResultHandler | Status;
|
|
622
638
|
|
|
623
639
|
interface InvocationEventsProps {
|
|
624
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
625
|
-
/** Optional Content component
|
|
640
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
641
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
626
642
|
ContentComponent?: React__default.ComponentType<{
|
|
627
643
|
content: any;
|
|
628
644
|
className?: string;
|
|
@@ -633,9 +649,9 @@ interface InvocationEventsProps {
|
|
|
633
649
|
*/
|
|
634
650
|
declare function InvocationEvents({ eventsByID, ContentComponent }: InvocationEventsProps): react_jsx_runtime.JSX.Element;
|
|
635
651
|
|
|
636
|
-
interface
|
|
637
|
-
event: InvocationEvent;
|
|
638
|
-
/** Optional Content component
|
|
652
|
+
interface InvocationEventProps {
|
|
653
|
+
event: InvocationEvent$1;
|
|
654
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
639
655
|
ContentComponent?: React__default.ComponentType<{
|
|
640
656
|
content: any;
|
|
641
657
|
className?: string;
|
|
@@ -644,11 +660,11 @@ interface InvocationEventRendererProps {
|
|
|
644
660
|
/**
|
|
645
661
|
* Routes an invocation event to the appropriate renderer (Output or StepInvocation)
|
|
646
662
|
*/
|
|
647
|
-
declare function
|
|
663
|
+
declare function InvocationEvent({ event, ContentComponent }: InvocationEventProps): react_jsx_runtime.JSX.Element | null;
|
|
648
664
|
|
|
649
|
-
interface
|
|
665
|
+
interface OutputProps {
|
|
650
666
|
output: OutputWithContents;
|
|
651
|
-
/** Optional Content component
|
|
667
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
652
668
|
ContentComponent?: React__default.ComponentType<{
|
|
653
669
|
content: any;
|
|
654
670
|
className?: string;
|
|
@@ -657,7 +673,7 @@ interface OutputRendererProps {
|
|
|
657
673
|
/**
|
|
658
674
|
* Renders output contents from a step invocation
|
|
659
675
|
*/
|
|
660
|
-
declare function
|
|
676
|
+
declare function Output({ output, ContentComponent }: OutputProps): react_jsx_runtime.JSX.Element | null;
|
|
661
677
|
|
|
662
678
|
interface StepInvocationProps {
|
|
663
679
|
step: Step;
|
|
@@ -951,7 +967,7 @@ declare function CodeexecContent({ item, className }: CodeexecContentProps): rea
|
|
|
951
967
|
interface ToolGroupContentProps {
|
|
952
968
|
/** The tool group data */
|
|
953
969
|
toolGroup: ToolGroup;
|
|
954
|
-
/** Optional Content component
|
|
970
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
955
971
|
ContentComponent?: React__default.ComponentType<{
|
|
956
972
|
content: ContentItem;
|
|
957
973
|
className?: string;
|
|
@@ -1253,4 +1269,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
|
|
|
1253
1269
|
*/
|
|
1254
1270
|
declare function handleSSEEvent(eventType: string, event: SSEEventData, path: string[], threadID: string, activeMessagesByID: Record<string, MessageWithContents>, currentEntity?: Entity | null, parents?: Entity[], entityIds?: Record<string, string>): Entity | null;
|
|
1255
1271
|
|
|
1256
|
-
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, 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, DatasetTable, type DatasetTableProps, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart,
|
|
1272
|
+
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, 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, DatasetTable, type DatasetTableProps, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, 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, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseInvocationOptions, type UseInvocationReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, cn, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useInvocation, useMultipleDatasetContents };
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,22 @@ interface ErdoProviderConfig {
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
dataFetcher?: DataFetcher;
|
|
69
|
+
/**
|
|
70
|
+
* Optional component for rendering content items.
|
|
71
|
+
* When provided, invocation components will use this to render nested content.
|
|
72
|
+
* This allows consumers to inject their own Content component with custom renderers.
|
|
73
|
+
*
|
|
74
|
+
* Example:
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <ErdoProvider config={{ baseUrl: '...', ContentComponent: MyContent }}>
|
|
77
|
+
* <InvocationEvents eventsByID={events} />
|
|
78
|
+
* </ErdoProvider>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
ContentComponent?: React__default.ComponentType<{
|
|
82
|
+
content: any;
|
|
83
|
+
className?: string;
|
|
84
|
+
}>;
|
|
69
85
|
}
|
|
70
86
|
interface ErdoProviderProps {
|
|
71
87
|
children: React__default.ReactNode;
|
|
@@ -439,7 +455,7 @@ interface MessageWithContents {
|
|
|
439
455
|
contentsByID: Record<string, MessageContent>;
|
|
440
456
|
contentIDToIdx: Record<string, number>;
|
|
441
457
|
}
|
|
442
|
-
interface Output {
|
|
458
|
+
interface Output$1 {
|
|
443
459
|
id: string;
|
|
444
460
|
invocation_id?: string;
|
|
445
461
|
path?: string;
|
|
@@ -474,7 +490,7 @@ interface OutputWithContents {
|
|
|
474
490
|
_type: 'output';
|
|
475
491
|
id: string;
|
|
476
492
|
step_id?: string;
|
|
477
|
-
output: Output;
|
|
493
|
+
output: Output$1;
|
|
478
494
|
state: MessageStreamingState;
|
|
479
495
|
contents: OutputContent[];
|
|
480
496
|
contentsByID: Record<string, OutputContent>;
|
|
@@ -532,7 +548,7 @@ interface Step {
|
|
|
532
548
|
Valid: boolean;
|
|
533
549
|
};
|
|
534
550
|
depends_on: string[];
|
|
535
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
551
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
536
552
|
currentStatus: Status | null;
|
|
537
553
|
}
|
|
538
554
|
interface ResultHandler {
|
|
@@ -547,7 +563,7 @@ interface ResultHandler {
|
|
|
547
563
|
updated_at: string;
|
|
548
564
|
output_content_type: string;
|
|
549
565
|
result_handler_order: number;
|
|
550
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
566
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
551
567
|
}
|
|
552
568
|
declare enum InvocationStatus {
|
|
553
569
|
Pending = "pending",
|
|
@@ -598,7 +614,7 @@ interface BotInvocationData {
|
|
|
598
614
|
interface BotInvocation {
|
|
599
615
|
_type: 'invocation';
|
|
600
616
|
bot_invocation: BotInvocationData;
|
|
601
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
617
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
602
618
|
currentStatus: Status | null;
|
|
603
619
|
current_status: Status | null;
|
|
604
620
|
step_invocations: any[];
|
|
@@ -607,7 +623,7 @@ interface BotInvocation {
|
|
|
607
623
|
outputs: any[];
|
|
608
624
|
statuses: any[];
|
|
609
625
|
}
|
|
610
|
-
interface InvocationEvent {
|
|
626
|
+
interface InvocationEvent$1 {
|
|
611
627
|
id?: string;
|
|
612
628
|
type?: EntityType;
|
|
613
629
|
created_at?: string;
|
|
@@ -621,8 +637,8 @@ interface InvocationEvent {
|
|
|
621
637
|
type Entity = MessageWithContents | MessageContent | BotInvocation | OutputWithContents | OutputContent | Step | ResultHandler | Status;
|
|
622
638
|
|
|
623
639
|
interface InvocationEventsProps {
|
|
624
|
-
eventsByID: Record<string, InvocationEvent>;
|
|
625
|
-
/** Optional Content component
|
|
640
|
+
eventsByID: Record<string, InvocationEvent$1>;
|
|
641
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
626
642
|
ContentComponent?: React__default.ComponentType<{
|
|
627
643
|
content: any;
|
|
628
644
|
className?: string;
|
|
@@ -633,9 +649,9 @@ interface InvocationEventsProps {
|
|
|
633
649
|
*/
|
|
634
650
|
declare function InvocationEvents({ eventsByID, ContentComponent }: InvocationEventsProps): react_jsx_runtime.JSX.Element;
|
|
635
651
|
|
|
636
|
-
interface
|
|
637
|
-
event: InvocationEvent;
|
|
638
|
-
/** Optional Content component
|
|
652
|
+
interface InvocationEventProps {
|
|
653
|
+
event: InvocationEvent$1;
|
|
654
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
639
655
|
ContentComponent?: React__default.ComponentType<{
|
|
640
656
|
content: any;
|
|
641
657
|
className?: string;
|
|
@@ -644,11 +660,11 @@ interface InvocationEventRendererProps {
|
|
|
644
660
|
/**
|
|
645
661
|
* Routes an invocation event to the appropriate renderer (Output or StepInvocation)
|
|
646
662
|
*/
|
|
647
|
-
declare function
|
|
663
|
+
declare function InvocationEvent({ event, ContentComponent }: InvocationEventProps): react_jsx_runtime.JSX.Element | null;
|
|
648
664
|
|
|
649
|
-
interface
|
|
665
|
+
interface OutputProps {
|
|
650
666
|
output: OutputWithContents;
|
|
651
|
-
/** Optional Content component
|
|
667
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
652
668
|
ContentComponent?: React__default.ComponentType<{
|
|
653
669
|
content: any;
|
|
654
670
|
className?: string;
|
|
@@ -657,7 +673,7 @@ interface OutputRendererProps {
|
|
|
657
673
|
/**
|
|
658
674
|
* Renders output contents from a step invocation
|
|
659
675
|
*/
|
|
660
|
-
declare function
|
|
676
|
+
declare function Output({ output, ContentComponent }: OutputProps): react_jsx_runtime.JSX.Element | null;
|
|
661
677
|
|
|
662
678
|
interface StepInvocationProps {
|
|
663
679
|
step: Step;
|
|
@@ -951,7 +967,7 @@ declare function CodeexecContent({ item, className }: CodeexecContentProps): rea
|
|
|
951
967
|
interface ToolGroupContentProps {
|
|
952
968
|
/** The tool group data */
|
|
953
969
|
toolGroup: ToolGroup;
|
|
954
|
-
/** Optional Content component
|
|
970
|
+
/** Optional Content component override (defaults to provider's ContentComponent) */
|
|
955
971
|
ContentComponent?: React__default.ComponentType<{
|
|
956
972
|
content: ContentItem;
|
|
957
973
|
className?: string;
|
|
@@ -1253,4 +1269,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
|
|
|
1253
1269
|
*/
|
|
1254
1270
|
declare function handleSSEEvent(eventType: string, event: SSEEventData, path: string[], threadID: string, activeMessagesByID: Record<string, MessageWithContents>, currentEntity?: Entity | null, parents?: Entity[], entityIds?: Record<string, string>): Entity | null;
|
|
1255
1271
|
|
|
1256
|
-
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, 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, DatasetTable, type DatasetTableProps, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart,
|
|
1272
|
+
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, 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, DatasetTable, type DatasetTableProps, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, 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, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseInvocationOptions, type UseInvocationReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, cn, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useInvocation, useMultipleDatasetContents };
|