@apteva/apteva-kit 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.mts +35 -2
- package/dist/index.d.ts +35 -2
- package/dist/index.js +530 -125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1031 -626
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -25,6 +25,8 @@ interface Widget {
|
|
|
25
25
|
metadata?: Record<string, any>;
|
|
26
26
|
/** Whether the widget is still receiving streaming data */
|
|
27
27
|
isStreaming?: boolean;
|
|
28
|
+
/** When true, widget is rendered once in a persistent panel and survives across messages */
|
|
29
|
+
persistent?: boolean;
|
|
28
30
|
}
|
|
29
31
|
interface CardWidget extends Widget {
|
|
30
32
|
type: 'card';
|
|
@@ -63,7 +65,7 @@ interface FormWidget extends Widget {
|
|
|
63
65
|
}
|
|
64
66
|
interface FormField {
|
|
65
67
|
name: string;
|
|
66
|
-
type: 'text' | 'password' | 'number' | 'select' | 'checkbox' | 'textarea' | 'date';
|
|
68
|
+
type: 'text' | 'password' | 'number' | 'select' | 'checkbox' | 'textarea' | 'date' | 'file';
|
|
67
69
|
label: string;
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
required?: boolean;
|
|
@@ -72,6 +74,10 @@ interface FormField {
|
|
|
72
74
|
value: string;
|
|
73
75
|
}>;
|
|
74
76
|
defaultValue?: any;
|
|
77
|
+
/** For file fields: allow multiple files */
|
|
78
|
+
multiple?: boolean;
|
|
79
|
+
/** For file fields: accepted MIME types (e.g. "image/*,.pdf") */
|
|
80
|
+
accept?: string;
|
|
75
81
|
}
|
|
76
82
|
interface ListWidget extends Widget {
|
|
77
83
|
type: 'list';
|
|
@@ -176,6 +182,20 @@ interface TableWidget extends Widget {
|
|
|
176
182
|
striped?: boolean;
|
|
177
183
|
};
|
|
178
184
|
}
|
|
185
|
+
interface LiveViewWidget extends Widget {
|
|
186
|
+
type: 'live_view';
|
|
187
|
+
props: {
|
|
188
|
+
src: string;
|
|
189
|
+
title?: string;
|
|
190
|
+
height?: string;
|
|
191
|
+
aspectRatio?: '16/9' | '4/3' | '1/1';
|
|
192
|
+
allowFullscreen?: boolean;
|
|
193
|
+
sandbox?: string;
|
|
194
|
+
allow?: string;
|
|
195
|
+
refreshInterval?: number;
|
|
196
|
+
showToolbar?: boolean;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
179
199
|
|
|
180
200
|
interface Message {
|
|
181
201
|
id: string;
|
|
@@ -282,6 +302,7 @@ interface ChatProps {
|
|
|
282
302
|
onHeaderBack?: () => void;
|
|
283
303
|
enableFileUpload?: boolean;
|
|
284
304
|
enableMarkdown?: boolean;
|
|
305
|
+
toolCallStyle?: 'card' | 'inline';
|
|
285
306
|
enableWidgets?: boolean;
|
|
286
307
|
availableWidgets?: WidgetType[];
|
|
287
308
|
compactWidgetContext?: boolean;
|
|
@@ -481,6 +502,7 @@ interface InterfaceUpdate {
|
|
|
481
502
|
interface KpiWidget extends Widget {
|
|
482
503
|
type: 'kpi';
|
|
483
504
|
props: {
|
|
505
|
+
title?: string;
|
|
484
506
|
label: string;
|
|
485
507
|
value: string | number;
|
|
486
508
|
change?: string;
|
|
@@ -540,6 +562,11 @@ interface SpacerProps {
|
|
|
540
562
|
}
|
|
541
563
|
declare function Spacer({ widget }: SpacerProps): react_jsx_runtime.JSX.Element;
|
|
542
564
|
|
|
565
|
+
interface LiveViewProps {
|
|
566
|
+
widget: LiveViewWidget;
|
|
567
|
+
}
|
|
568
|
+
declare function LiveView({ widget }: LiveViewProps): react_jsx_runtime.JSX.Element;
|
|
569
|
+
|
|
543
570
|
declare function Threads({ threads, currentThreadId, onThreadSelect, onThreadDelete, onNewThread, variant, showSearch, showNewButton, groupBy, className, }: ThreadsProps): react_jsx_runtime.JSX.Element;
|
|
544
571
|
|
|
545
572
|
declare function AutoInterface({ agentId, threadId, initialPrompt, initialInterface, context, apiUrl, apiKey, onInterfaceChange, onAction, onThreadChange, onError, chatPosition, chatWidth, chatCollapsible, chatPlaceholder, chatWelcomeTitle, useMock, theme, className, }: AutoInterfaceProps): react_jsx_runtime.JSX.Element;
|
|
@@ -562,6 +589,12 @@ interface InterfaceSkeletonProps {
|
|
|
562
589
|
}
|
|
563
590
|
declare function InterfaceSkeleton({ className }: InterfaceSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
564
591
|
|
|
592
|
+
interface PersistentWidgetPanelProps {
|
|
593
|
+
widgets: Widget[];
|
|
594
|
+
onAction?: (action: ActionEvent) => void;
|
|
595
|
+
}
|
|
596
|
+
declare function PersistentWidgetPanel({ widgets, onAction }: PersistentWidgetPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
597
|
+
|
|
565
598
|
declare function getThemeScript(): string;
|
|
566
599
|
|
|
567
600
|
interface AptevaClientConfig {
|
|
@@ -769,4 +802,4 @@ interface ApiMessage {
|
|
|
769
802
|
*/
|
|
770
803
|
declare function convertApiMessages(apiMessages: ApiMessage[]): Message[];
|
|
771
804
|
|
|
772
|
-
export { type Action, type ActionEvent, type ApiContentBlock, type ApiMessage, AptevaClient, type AptevaClientConfig, type AptevaKitControl, AutoInterface, type AutoInterfaceProps, Button, type ButtonGroupWidget, type ButtonWidget, Card, type CardWidget, type ChartWidget, Chat, type ChatHandle, type ChatMessage, type ChatProps, type ChatRequest, type ChatResponse, type ColumnsLayoutProps, Command, type CommandProps, type CommandResult, type FlowStep, type FlowWidget, type FormField, type FormWidget, type GalleryWidget, type ImageWidget, type InterfaceNode, InterfaceRenderer, InterfaceSkeleton, type InterfaceSpec, type InterfaceUpdate, Kpi, type KpiWidget, LayoutRenderer, type LayoutType, List, type ListItem, type ListWidget, type MapWidget, type Message, type PageLayoutProps, Prompt, type PromptProps, type RowLayoutProps, type SendMessageParams, type SidebarLayoutProps, Spacer, type SpacerWidget, type StackLayoutProps, Stream, type StreamChunk, type StreamProps, type SuggestedPrompt, type TableColumn, type TableWidget, type TabsLayoutProps, TextBlock, type TextBlockWidget, type Thread, Threads, type ThreadsProps, type UseAptevaKitReturn, type Widget, Widgets, type WidgetsProps, applyUpdate, applyUpdates, aptevaClient, cn, containsInterface, convertApiMessages, findNode, generateCompactInterfaceContext, generateInterfaceContext, getThemeScript, mockMessages, mockThreads, mockWidgets, parseInterfaceFromText, parseUpdatesFromText, stripInterface, useInterfaceAI, useInterfaceState };
|
|
805
|
+
export { type Action, type ActionEvent, type ApiContentBlock, type ApiMessage, AptevaClient, type AptevaClientConfig, type AptevaKitControl, AutoInterface, type AutoInterfaceProps, Button, type ButtonGroupWidget, type ButtonWidget, Card, type CardWidget, type ChartWidget, Chat, type ChatHandle, type ChatMessage, type ChatProps, type ChatRequest, type ChatResponse, type ColumnsLayoutProps, Command, type CommandProps, type CommandResult, type FlowStep, type FlowWidget, type FormField, type FormWidget, type GalleryWidget, type ImageWidget, type InterfaceNode, InterfaceRenderer, InterfaceSkeleton, type InterfaceSpec, type InterfaceUpdate, Kpi, type KpiWidget, LayoutRenderer, type LayoutType, List, type ListItem, type ListWidget, LiveView, type LiveViewWidget, type MapWidget, type Message, type PageLayoutProps, PersistentWidgetPanel, Prompt, type PromptProps, type RowLayoutProps, type SendMessageParams, type SidebarLayoutProps, Spacer, type SpacerWidget, type StackLayoutProps, Stream, type StreamChunk, type StreamProps, type SuggestedPrompt, type TableColumn, type TableWidget, type TabsLayoutProps, TextBlock, type TextBlockWidget, type Thread, Threads, type ThreadsProps, type UseAptevaKitReturn, type Widget, Widgets, type WidgetsProps, applyUpdate, applyUpdates, aptevaClient, cn, containsInterface, convertApiMessages, findNode, generateCompactInterfaceContext, generateInterfaceContext, getThemeScript, mockMessages, mockThreads, mockWidgets, parseInterfaceFromText, parseUpdatesFromText, stripInterface, useInterfaceAI, useInterfaceState };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ interface Widget {
|
|
|
25
25
|
metadata?: Record<string, any>;
|
|
26
26
|
/** Whether the widget is still receiving streaming data */
|
|
27
27
|
isStreaming?: boolean;
|
|
28
|
+
/** When true, widget is rendered once in a persistent panel and survives across messages */
|
|
29
|
+
persistent?: boolean;
|
|
28
30
|
}
|
|
29
31
|
interface CardWidget extends Widget {
|
|
30
32
|
type: 'card';
|
|
@@ -63,7 +65,7 @@ interface FormWidget extends Widget {
|
|
|
63
65
|
}
|
|
64
66
|
interface FormField {
|
|
65
67
|
name: string;
|
|
66
|
-
type: 'text' | 'password' | 'number' | 'select' | 'checkbox' | 'textarea' | 'date';
|
|
68
|
+
type: 'text' | 'password' | 'number' | 'select' | 'checkbox' | 'textarea' | 'date' | 'file';
|
|
67
69
|
label: string;
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
required?: boolean;
|
|
@@ -72,6 +74,10 @@ interface FormField {
|
|
|
72
74
|
value: string;
|
|
73
75
|
}>;
|
|
74
76
|
defaultValue?: any;
|
|
77
|
+
/** For file fields: allow multiple files */
|
|
78
|
+
multiple?: boolean;
|
|
79
|
+
/** For file fields: accepted MIME types (e.g. "image/*,.pdf") */
|
|
80
|
+
accept?: string;
|
|
75
81
|
}
|
|
76
82
|
interface ListWidget extends Widget {
|
|
77
83
|
type: 'list';
|
|
@@ -176,6 +182,20 @@ interface TableWidget extends Widget {
|
|
|
176
182
|
striped?: boolean;
|
|
177
183
|
};
|
|
178
184
|
}
|
|
185
|
+
interface LiveViewWidget extends Widget {
|
|
186
|
+
type: 'live_view';
|
|
187
|
+
props: {
|
|
188
|
+
src: string;
|
|
189
|
+
title?: string;
|
|
190
|
+
height?: string;
|
|
191
|
+
aspectRatio?: '16/9' | '4/3' | '1/1';
|
|
192
|
+
allowFullscreen?: boolean;
|
|
193
|
+
sandbox?: string;
|
|
194
|
+
allow?: string;
|
|
195
|
+
refreshInterval?: number;
|
|
196
|
+
showToolbar?: boolean;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
179
199
|
|
|
180
200
|
interface Message {
|
|
181
201
|
id: string;
|
|
@@ -282,6 +302,7 @@ interface ChatProps {
|
|
|
282
302
|
onHeaderBack?: () => void;
|
|
283
303
|
enableFileUpload?: boolean;
|
|
284
304
|
enableMarkdown?: boolean;
|
|
305
|
+
toolCallStyle?: 'card' | 'inline';
|
|
285
306
|
enableWidgets?: boolean;
|
|
286
307
|
availableWidgets?: WidgetType[];
|
|
287
308
|
compactWidgetContext?: boolean;
|
|
@@ -481,6 +502,7 @@ interface InterfaceUpdate {
|
|
|
481
502
|
interface KpiWidget extends Widget {
|
|
482
503
|
type: 'kpi';
|
|
483
504
|
props: {
|
|
505
|
+
title?: string;
|
|
484
506
|
label: string;
|
|
485
507
|
value: string | number;
|
|
486
508
|
change?: string;
|
|
@@ -540,6 +562,11 @@ interface SpacerProps {
|
|
|
540
562
|
}
|
|
541
563
|
declare function Spacer({ widget }: SpacerProps): react_jsx_runtime.JSX.Element;
|
|
542
564
|
|
|
565
|
+
interface LiveViewProps {
|
|
566
|
+
widget: LiveViewWidget;
|
|
567
|
+
}
|
|
568
|
+
declare function LiveView({ widget }: LiveViewProps): react_jsx_runtime.JSX.Element;
|
|
569
|
+
|
|
543
570
|
declare function Threads({ threads, currentThreadId, onThreadSelect, onThreadDelete, onNewThread, variant, showSearch, showNewButton, groupBy, className, }: ThreadsProps): react_jsx_runtime.JSX.Element;
|
|
544
571
|
|
|
545
572
|
declare function AutoInterface({ agentId, threadId, initialPrompt, initialInterface, context, apiUrl, apiKey, onInterfaceChange, onAction, onThreadChange, onError, chatPosition, chatWidth, chatCollapsible, chatPlaceholder, chatWelcomeTitle, useMock, theme, className, }: AutoInterfaceProps): react_jsx_runtime.JSX.Element;
|
|
@@ -562,6 +589,12 @@ interface InterfaceSkeletonProps {
|
|
|
562
589
|
}
|
|
563
590
|
declare function InterfaceSkeleton({ className }: InterfaceSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
564
591
|
|
|
592
|
+
interface PersistentWidgetPanelProps {
|
|
593
|
+
widgets: Widget[];
|
|
594
|
+
onAction?: (action: ActionEvent) => void;
|
|
595
|
+
}
|
|
596
|
+
declare function PersistentWidgetPanel({ widgets, onAction }: PersistentWidgetPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
597
|
+
|
|
565
598
|
declare function getThemeScript(): string;
|
|
566
599
|
|
|
567
600
|
interface AptevaClientConfig {
|
|
@@ -769,4 +802,4 @@ interface ApiMessage {
|
|
|
769
802
|
*/
|
|
770
803
|
declare function convertApiMessages(apiMessages: ApiMessage[]): Message[];
|
|
771
804
|
|
|
772
|
-
export { type Action, type ActionEvent, type ApiContentBlock, type ApiMessage, AptevaClient, type AptevaClientConfig, type AptevaKitControl, AutoInterface, type AutoInterfaceProps, Button, type ButtonGroupWidget, type ButtonWidget, Card, type CardWidget, type ChartWidget, Chat, type ChatHandle, type ChatMessage, type ChatProps, type ChatRequest, type ChatResponse, type ColumnsLayoutProps, Command, type CommandProps, type CommandResult, type FlowStep, type FlowWidget, type FormField, type FormWidget, type GalleryWidget, type ImageWidget, type InterfaceNode, InterfaceRenderer, InterfaceSkeleton, type InterfaceSpec, type InterfaceUpdate, Kpi, type KpiWidget, LayoutRenderer, type LayoutType, List, type ListItem, type ListWidget, type MapWidget, type Message, type PageLayoutProps, Prompt, type PromptProps, type RowLayoutProps, type SendMessageParams, type SidebarLayoutProps, Spacer, type SpacerWidget, type StackLayoutProps, Stream, type StreamChunk, type StreamProps, type SuggestedPrompt, type TableColumn, type TableWidget, type TabsLayoutProps, TextBlock, type TextBlockWidget, type Thread, Threads, type ThreadsProps, type UseAptevaKitReturn, type Widget, Widgets, type WidgetsProps, applyUpdate, applyUpdates, aptevaClient, cn, containsInterface, convertApiMessages, findNode, generateCompactInterfaceContext, generateInterfaceContext, getThemeScript, mockMessages, mockThreads, mockWidgets, parseInterfaceFromText, parseUpdatesFromText, stripInterface, useInterfaceAI, useInterfaceState };
|
|
805
|
+
export { type Action, type ActionEvent, type ApiContentBlock, type ApiMessage, AptevaClient, type AptevaClientConfig, type AptevaKitControl, AutoInterface, type AutoInterfaceProps, Button, type ButtonGroupWidget, type ButtonWidget, Card, type CardWidget, type ChartWidget, Chat, type ChatHandle, type ChatMessage, type ChatProps, type ChatRequest, type ChatResponse, type ColumnsLayoutProps, Command, type CommandProps, type CommandResult, type FlowStep, type FlowWidget, type FormField, type FormWidget, type GalleryWidget, type ImageWidget, type InterfaceNode, InterfaceRenderer, InterfaceSkeleton, type InterfaceSpec, type InterfaceUpdate, Kpi, type KpiWidget, LayoutRenderer, type LayoutType, List, type ListItem, type ListWidget, LiveView, type LiveViewWidget, type MapWidget, type Message, type PageLayoutProps, PersistentWidgetPanel, Prompt, type PromptProps, type RowLayoutProps, type SendMessageParams, type SidebarLayoutProps, Spacer, type SpacerWidget, type StackLayoutProps, Stream, type StreamChunk, type StreamProps, type SuggestedPrompt, type TableColumn, type TableWidget, type TabsLayoutProps, TextBlock, type TextBlockWidget, type Thread, Threads, type ThreadsProps, type UseAptevaKitReturn, type Widget, Widgets, type WidgetsProps, applyUpdate, applyUpdates, aptevaClient, cn, containsInterface, convertApiMessages, findNode, generateCompactInterfaceContext, generateInterfaceContext, getThemeScript, mockMessages, mockThreads, mockWidgets, parseInterfaceFromText, parseUpdatesFromText, stripInterface, useInterfaceAI, useInterfaceState };
|