@miiflow/assistant-ui 0.1.0
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/LICENSE +21 -0
- package/README.md +563 -0
- package/dist/WelcomeScreen-CsFaFNcu.d.mts +246 -0
- package/dist/WelcomeScreen-TrcbOYob.d.ts +246 -0
- package/dist/avatar-D5eHcfjf.d.mts +109 -0
- package/dist/avatar-DftdWqSs.d.ts +109 -0
- package/dist/branding-SzYU4ncD.d.mts +18 -0
- package/dist/branding-SzYU4ncD.d.ts +18 -0
- package/dist/chunk-3E2HG62U.mjs +2 -0
- package/dist/chunk-3E2HG62U.mjs.map +1 -0
- package/dist/chunk-3ERHTQXR.js +2 -0
- package/dist/chunk-3ERHTQXR.js.map +1 -0
- package/dist/chunk-3GQNGDXX.mjs +22 -0
- package/dist/chunk-3GQNGDXX.mjs.map +1 -0
- package/dist/chunk-3KB4JYSQ.js +2 -0
- package/dist/chunk-3KB4JYSQ.js.map +1 -0
- package/dist/chunk-BA3VCHRC.js +22 -0
- package/dist/chunk-BA3VCHRC.js.map +1 -0
- package/dist/chunk-CRNBTU42.mjs +2 -0
- package/dist/chunk-CRNBTU42.mjs.map +1 -0
- package/dist/chunk-KPGHBLGY.mjs +2 -0
- package/dist/chunk-KPGHBLGY.mjs.map +1 -0
- package/dist/chunk-LJQHWCUK.js +2 -0
- package/dist/chunk-LJQHWCUK.js.map +1 -0
- package/dist/chunk-MFCWFFJV.mjs +2 -0
- package/dist/chunk-MFCWFFJV.mjs.map +1 -0
- package/dist/chunk-NSTK5EUQ.js +2 -0
- package/dist/chunk-NSTK5EUQ.js.map +1 -0
- package/dist/chunk-OCKHJ4WO.js +2 -0
- package/dist/chunk-OCKHJ4WO.js.map +1 -0
- package/dist/chunk-RTT6LULU.mjs +2 -0
- package/dist/chunk-RTT6LULU.mjs.map +1 -0
- package/dist/client/index.d.mts +249 -0
- package/dist/client/index.d.ts +249 -0
- package/dist/client/index.js +9 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/index.mjs +9 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/context/index.d.mts +43 -0
- package/dist/context/index.d.ts +43 -0
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +109 -0
- package/dist/hooks/index.d.ts +109 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +157 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/message-B21_kqE2.d.ts +78 -0
- package/dist/message-ufYsvKXP.d.mts +78 -0
- package/dist/primitives/index.d.mts +86 -0
- package/dist/primitives/index.d.ts +86 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/index.mjs +2 -0
- package/dist/primitives/index.mjs.map +1 -0
- package/dist/streaming-CF63E6iS.d.mts +426 -0
- package/dist/streaming-CF63E6iS.d.ts +426 -0
- package/dist/styled/index.d.mts +477 -0
- package/dist/styled/index.d.ts +477 -0
- package/dist/styled/index.js +2 -0
- package/dist/styled/index.js.map +1 -0
- package/dist/styled/index.mjs +2 -0
- package/dist/styled/index.mjs.map +1 -0
- package/dist/styles-no-preflight.css +1 -0
- package/dist/styles.css +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export { A as Avatar, h as AvatarProps, C as ComposerContext, a as ComposerInput, i as ComposerInputProps, b as ComposerSubmit, j as ComposerSubmitProps, e as Message, M as MessageComposer, k as MessageComposerProps, c as MessageContent, l as MessageContentProps, d as MessageContext, m as MessageProps, f as MessageTimestamp, n as MessageTimestampProps, u as useComposer, g as useMessage } from '../avatar-DftdWqSs.js';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes } from 'react';
|
|
4
|
+
import { c as SuggestedAction } from '../message-B21_kqE2.js';
|
|
5
|
+
import '../streaming-CF63E6iS.js';
|
|
6
|
+
|
|
7
|
+
interface MessageListProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** Messages to render */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** Whether to auto-scroll to bottom on new messages */
|
|
11
|
+
autoScroll?: boolean;
|
|
12
|
+
/** Threshold from bottom to trigger auto-scroll (pixels) */
|
|
13
|
+
scrollThreshold?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Headless MessageList primitive.
|
|
17
|
+
* Provides a scrollable container with auto-scroll behavior.
|
|
18
|
+
*/
|
|
19
|
+
declare const MessageList: react.ForwardRefExoticComponent<MessageListProps & react.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
interface StreamingTextProps extends HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
/** The content to display */
|
|
23
|
+
content: string;
|
|
24
|
+
/** Whether the text is currently streaming */
|
|
25
|
+
isStreaming?: boolean;
|
|
26
|
+
/** Show a cursor indicator while streaming */
|
|
27
|
+
showCursor?: boolean;
|
|
28
|
+
/** Custom cursor element */
|
|
29
|
+
cursor?: ReactNode;
|
|
30
|
+
/** Children override (takes precedence over content) */
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Headless StreamingText primitive.
|
|
35
|
+
* Renders text with streaming indicator support.
|
|
36
|
+
*/
|
|
37
|
+
declare const StreamingText: react.ForwardRefExoticComponent<StreamingTextProps & react.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
|
|
39
|
+
interface SuggestedActionsContextValue {
|
|
40
|
+
actions: SuggestedAction[];
|
|
41
|
+
onSelect: (action: SuggestedAction) => void;
|
|
42
|
+
}
|
|
43
|
+
declare const SuggestedActionsContext: react.Context<SuggestedActionsContextValue | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Hook to access suggested actions context.
|
|
46
|
+
*/
|
|
47
|
+
declare function useSuggestedActions(): SuggestedActionsContextValue;
|
|
48
|
+
interface SuggestedActionsProps {
|
|
49
|
+
/** List of suggested actions */
|
|
50
|
+
actions: SuggestedAction[];
|
|
51
|
+
/** Callback when an action is selected */
|
|
52
|
+
onSelect: (action: SuggestedAction) => void;
|
|
53
|
+
/** Children to render */
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
/** Additional CSS classes */
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Headless SuggestedActions primitive.
|
|
60
|
+
* Provides context for rendering action buttons.
|
|
61
|
+
*/
|
|
62
|
+
declare const SuggestedActions: react.ForwardRefExoticComponent<SuggestedActionsProps & react.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
interface ActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
64
|
+
/** The action this button represents */
|
|
65
|
+
action: SuggestedAction;
|
|
66
|
+
/** Children to render inside button */
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Button for a suggested action.
|
|
71
|
+
*/
|
|
72
|
+
declare const ActionButton: react.ForwardRefExoticComponent<ActionButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
73
|
+
|
|
74
|
+
interface TypingIndicatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
75
|
+
/** Custom content to show while typing */
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
/** Number of dots to show */
|
|
78
|
+
dotCount?: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Headless TypingIndicator primitive.
|
|
82
|
+
* Shows animated dots or custom content.
|
|
83
|
+
*/
|
|
84
|
+
declare const TypingIndicator: react.ForwardRefExoticComponent<TypingIndicatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
85
|
+
|
|
86
|
+
export { ActionButton, type ActionButtonProps, MessageList, type MessageListProps, StreamingText, type StreamingTextProps, SuggestedActions, SuggestedActionsContext, type SuggestedActionsProps, TypingIndicator, type TypingIndicatorProps, useSuggestedActions };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunk3KB4JYSQ_js=require('../chunk-3KB4JYSQ.js');require('../chunk-LJQHWCUK.js');Object.defineProperty(exports,"ActionButton",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.q}});Object.defineProperty(exports,"Avatar",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.l}});Object.defineProperty(exports,"ComposerContext",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.g}});Object.defineProperty(exports,"ComposerInput",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.j}});Object.defineProperty(exports,"ComposerSubmit",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.k}});Object.defineProperty(exports,"Message",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.c}});Object.defineProperty(exports,"MessageComposer",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.i}});Object.defineProperty(exports,"MessageContent",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.d}});Object.defineProperty(exports,"MessageContext",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.a}});Object.defineProperty(exports,"MessageList",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.f}});Object.defineProperty(exports,"MessageTimestamp",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.e}});Object.defineProperty(exports,"StreamingText",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.m}});Object.defineProperty(exports,"SuggestedActions",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.p}});Object.defineProperty(exports,"SuggestedActionsContext",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.n}});Object.defineProperty(exports,"TypingIndicator",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.r}});Object.defineProperty(exports,"useComposer",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.h}});Object.defineProperty(exports,"useMessage",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.b}});Object.defineProperty(exports,"useSuggestedActions",{enumerable:true,get:function(){return chunk3KB4JYSQ_js.o}});//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{q as ActionButton,l as Avatar,g as ComposerContext,j as ComposerInput,k as ComposerSubmit,c as Message,i as MessageComposer,d as MessageContent,a as MessageContext,f as MessageList,e as MessageTimestamp,m as StreamingText,p as SuggestedActions,n as SuggestedActionsContext,r as TypingIndicator,h as useComposer,b as useMessage,o as useSuggestedActions}from'../chunk-MFCWFFJV.mjs';import'../chunk-KPGHBLGY.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for streaming message handling.
|
|
3
|
+
*/
|
|
4
|
+
interface StreamingState {
|
|
5
|
+
isStreaming: boolean;
|
|
6
|
+
streamingMessageId: string | null;
|
|
7
|
+
streamedContent: string;
|
|
8
|
+
}
|
|
9
|
+
interface StreamChunk {
|
|
10
|
+
type: "content" | "reasoning" | "tool_call" | "done" | "error";
|
|
11
|
+
content?: string;
|
|
12
|
+
messageId?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
interface StreamingOptions {
|
|
16
|
+
onChunk?: (chunk: StreamChunk) => void;
|
|
17
|
+
onComplete?: (finalContent: string) => void;
|
|
18
|
+
onError?: (error: Error) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extended chunk types for agentic streaming
|
|
22
|
+
*/
|
|
23
|
+
type ChunkType = "content" | "thinking" | "tool" | "observation" | "answer" | "planning" | "subtask" | "progress" | "wave_start" | "wave_complete" | "parallel_subtask_start" | "parallel_subtask_complete" | "multi_agent_planning" | "multi_agent_planning_complete" | "subagent_start" | "subagent_complete" | "subagent_failed" | "synthesis" | "clarification_needed" | "visualization" | "subagent" | "file_operation" | "terminal" | "search_results" | "web_operation" | "claude_text" | "claude_thinking";
|
|
24
|
+
/**
|
|
25
|
+
* Subtask data structure for Plan & Execute mode
|
|
26
|
+
*/
|
|
27
|
+
interface SubTaskData {
|
|
28
|
+
id: number;
|
|
29
|
+
description: string;
|
|
30
|
+
required_tools?: string[];
|
|
31
|
+
dependencies?: number[];
|
|
32
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
33
|
+
result?: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
execution_time?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Plan data structure for Plan & Execute mode
|
|
39
|
+
*/
|
|
40
|
+
interface PlanData {
|
|
41
|
+
subtasks: SubTaskData[];
|
|
42
|
+
goal: string;
|
|
43
|
+
reasoning: string;
|
|
44
|
+
total_subtasks: number;
|
|
45
|
+
completed_subtasks: number;
|
|
46
|
+
failed_subtasks: number;
|
|
47
|
+
progress_percentage: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Progress data for streaming updates
|
|
51
|
+
*/
|
|
52
|
+
interface ProgressData {
|
|
53
|
+
completed: number;
|
|
54
|
+
failed?: number;
|
|
55
|
+
total: number;
|
|
56
|
+
percentage: number;
|
|
57
|
+
waveNumber?: number;
|
|
58
|
+
}
|
|
59
|
+
interface WaveData {
|
|
60
|
+
waveNumber: number;
|
|
61
|
+
subtaskIds: number[];
|
|
62
|
+
parallelCount: number;
|
|
63
|
+
totalWaves: number;
|
|
64
|
+
startTime?: number;
|
|
65
|
+
executionTime?: number;
|
|
66
|
+
success?: boolean;
|
|
67
|
+
completedIds?: number[];
|
|
68
|
+
}
|
|
69
|
+
interface ParallelSubtaskData {
|
|
70
|
+
subtaskId: number;
|
|
71
|
+
waveNumber: number;
|
|
72
|
+
description?: string;
|
|
73
|
+
success?: boolean;
|
|
74
|
+
result?: string;
|
|
75
|
+
error?: string;
|
|
76
|
+
executionTime?: number;
|
|
77
|
+
}
|
|
78
|
+
interface SubagentInfo {
|
|
79
|
+
id?: string;
|
|
80
|
+
name: string;
|
|
81
|
+
role?: string;
|
|
82
|
+
task?: string;
|
|
83
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
84
|
+
result?: string;
|
|
85
|
+
error?: string;
|
|
86
|
+
executionTime?: number;
|
|
87
|
+
}
|
|
88
|
+
interface SearchResultItem {
|
|
89
|
+
filePath: string;
|
|
90
|
+
lineNumber?: number;
|
|
91
|
+
snippet?: string;
|
|
92
|
+
}
|
|
93
|
+
interface SubagentChunkData {
|
|
94
|
+
subagentId: string;
|
|
95
|
+
subagentType: string;
|
|
96
|
+
description: string;
|
|
97
|
+
prompt?: string;
|
|
98
|
+
status: "running" | "completed" | "failed";
|
|
99
|
+
result?: string;
|
|
100
|
+
durationMs?: number;
|
|
101
|
+
nestedChunks: StreamingChunk[];
|
|
102
|
+
}
|
|
103
|
+
interface FileOperationChunkData {
|
|
104
|
+
toolUseId: string;
|
|
105
|
+
operation: "read" | "write" | "edit";
|
|
106
|
+
filePath: string;
|
|
107
|
+
status: "pending" | "completed" | "error";
|
|
108
|
+
content?: string;
|
|
109
|
+
totalLines?: number;
|
|
110
|
+
language?: string;
|
|
111
|
+
oldString?: string;
|
|
112
|
+
newString?: string;
|
|
113
|
+
error?: string;
|
|
114
|
+
durationMs?: number;
|
|
115
|
+
}
|
|
116
|
+
interface TerminalChunkData {
|
|
117
|
+
toolUseId: string;
|
|
118
|
+
command: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
status: "running" | "completed" | "failed";
|
|
121
|
+
stdout?: string;
|
|
122
|
+
stderr?: string;
|
|
123
|
+
exitCode?: number;
|
|
124
|
+
durationMs?: number;
|
|
125
|
+
}
|
|
126
|
+
interface SearchResultsChunkData {
|
|
127
|
+
toolUseId: string;
|
|
128
|
+
tool: "glob" | "grep";
|
|
129
|
+
pattern: string;
|
|
130
|
+
path?: string;
|
|
131
|
+
status: "pending" | "completed" | "error";
|
|
132
|
+
results: SearchResultItem[];
|
|
133
|
+
totalCount: number;
|
|
134
|
+
error?: string;
|
|
135
|
+
durationMs?: number;
|
|
136
|
+
}
|
|
137
|
+
interface WebOperationChunkData {
|
|
138
|
+
toolUseId: string;
|
|
139
|
+
operation: "search" | "fetch";
|
|
140
|
+
query?: string;
|
|
141
|
+
url?: string;
|
|
142
|
+
status: "pending" | "completed" | "error";
|
|
143
|
+
results?: string;
|
|
144
|
+
content?: string;
|
|
145
|
+
error?: string;
|
|
146
|
+
durationMs?: number;
|
|
147
|
+
}
|
|
148
|
+
interface ClaudeToolChunkData {
|
|
149
|
+
toolUseId: string;
|
|
150
|
+
toolName: string;
|
|
151
|
+
toolDescription?: string;
|
|
152
|
+
toolInput?: Record<string, unknown>;
|
|
153
|
+
status: "pending" | "completed" | "error";
|
|
154
|
+
content?: string;
|
|
155
|
+
isError?: boolean;
|
|
156
|
+
durationMs?: number;
|
|
157
|
+
}
|
|
158
|
+
interface ClarificationData {
|
|
159
|
+
question: string;
|
|
160
|
+
options?: string[];
|
|
161
|
+
context?: string;
|
|
162
|
+
allowFreeText?: boolean;
|
|
163
|
+
subtaskId?: number;
|
|
164
|
+
subtaskDescription?: string;
|
|
165
|
+
subagentName?: string;
|
|
166
|
+
subagentRole?: string;
|
|
167
|
+
}
|
|
168
|
+
type VisualizationType = "chart" | "table" | "card" | "kpi" | "code_preview" | "form";
|
|
169
|
+
type ChartDataType = "line" | "bar" | "pie" | "area" | "scatter" | "composed";
|
|
170
|
+
interface ChartSeries {
|
|
171
|
+
name: string;
|
|
172
|
+
data: Array<{
|
|
173
|
+
x: string | number;
|
|
174
|
+
y: number;
|
|
175
|
+
} | {
|
|
176
|
+
name: string;
|
|
177
|
+
value: number;
|
|
178
|
+
}>;
|
|
179
|
+
color?: string;
|
|
180
|
+
}
|
|
181
|
+
interface ChartAxis {
|
|
182
|
+
label?: string;
|
|
183
|
+
type?: "category" | "number" | "time";
|
|
184
|
+
min?: number;
|
|
185
|
+
max?: number;
|
|
186
|
+
}
|
|
187
|
+
interface ChartVisualizationData {
|
|
188
|
+
chartType: ChartDataType;
|
|
189
|
+
series: ChartSeries[];
|
|
190
|
+
xAxis?: ChartAxis;
|
|
191
|
+
yAxis?: ChartAxis;
|
|
192
|
+
}
|
|
193
|
+
type TableColumnType = "string" | "number" | "currency" | "date" | "badge" | "link" | "boolean" | "progress";
|
|
194
|
+
interface TableColumn {
|
|
195
|
+
key: string;
|
|
196
|
+
label: string;
|
|
197
|
+
type?: TableColumnType;
|
|
198
|
+
align?: "left" | "center" | "right";
|
|
199
|
+
width?: string;
|
|
200
|
+
}
|
|
201
|
+
interface TableVisualizationData {
|
|
202
|
+
columns: TableColumn[];
|
|
203
|
+
rows: Record<string, unknown>[];
|
|
204
|
+
}
|
|
205
|
+
interface CardSection {
|
|
206
|
+
title?: string;
|
|
207
|
+
items?: Array<{
|
|
208
|
+
label: string;
|
|
209
|
+
value: string | number;
|
|
210
|
+
}>;
|
|
211
|
+
content?: string;
|
|
212
|
+
}
|
|
213
|
+
interface CardAction {
|
|
214
|
+
label: string;
|
|
215
|
+
action: string;
|
|
216
|
+
variant?: "primary" | "secondary" | "text";
|
|
217
|
+
}
|
|
218
|
+
interface CardVisualizationData {
|
|
219
|
+
subtitle?: string;
|
|
220
|
+
imageUrl?: string;
|
|
221
|
+
sections: CardSection[];
|
|
222
|
+
actions?: CardAction[];
|
|
223
|
+
}
|
|
224
|
+
interface KpiMetric {
|
|
225
|
+
label: string;
|
|
226
|
+
value: string | number;
|
|
227
|
+
unit?: string;
|
|
228
|
+
trend?: "up" | "down" | "neutral";
|
|
229
|
+
change?: string;
|
|
230
|
+
changeLabel?: string;
|
|
231
|
+
sparkline?: number[];
|
|
232
|
+
color?: string;
|
|
233
|
+
}
|
|
234
|
+
interface KpiVisualizationData {
|
|
235
|
+
metrics: KpiMetric[];
|
|
236
|
+
layout?: "row" | "grid";
|
|
237
|
+
}
|
|
238
|
+
interface CodePreviewVisualizationData {
|
|
239
|
+
code: string;
|
|
240
|
+
language: string;
|
|
241
|
+
lineNumbers?: boolean;
|
|
242
|
+
highlightLines?: number[];
|
|
243
|
+
startLine?: number;
|
|
244
|
+
}
|
|
245
|
+
type FormFieldType = "text" | "number" | "email" | "select" | "multiselect" | "checkbox" | "radio" | "textarea" | "date" | "datetime";
|
|
246
|
+
interface FormField {
|
|
247
|
+
name: string;
|
|
248
|
+
type: FormFieldType;
|
|
249
|
+
label: string;
|
|
250
|
+
required?: boolean;
|
|
251
|
+
placeholder?: string;
|
|
252
|
+
options?: Array<{
|
|
253
|
+
value: string;
|
|
254
|
+
label: string;
|
|
255
|
+
}>;
|
|
256
|
+
defaultValue?: unknown;
|
|
257
|
+
validation?: {
|
|
258
|
+
min?: number;
|
|
259
|
+
max?: number;
|
|
260
|
+
pattern?: string;
|
|
261
|
+
message?: string;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
interface FormVisualizationData {
|
|
265
|
+
fields: FormField[];
|
|
266
|
+
submitAction?: string;
|
|
267
|
+
}
|
|
268
|
+
interface VisualizationConfig {
|
|
269
|
+
height?: number;
|
|
270
|
+
width?: string;
|
|
271
|
+
colors?: string[];
|
|
272
|
+
legend?: boolean;
|
|
273
|
+
grid?: boolean;
|
|
274
|
+
tooltip?: boolean;
|
|
275
|
+
animate?: boolean;
|
|
276
|
+
stacked?: boolean;
|
|
277
|
+
sortable?: boolean;
|
|
278
|
+
paginated?: boolean;
|
|
279
|
+
pageSize?: number;
|
|
280
|
+
filterable?: boolean;
|
|
281
|
+
selectable?: boolean;
|
|
282
|
+
collapsible?: boolean;
|
|
283
|
+
initiallyCollapsed?: boolean;
|
|
284
|
+
submitButtonText?: string;
|
|
285
|
+
cancelButtonText?: string;
|
|
286
|
+
}
|
|
287
|
+
interface VisualizationData {
|
|
288
|
+
id: string;
|
|
289
|
+
/** Built-in type or any custom type registered via `registerVisualization()`. */
|
|
290
|
+
type: VisualizationType | (string & {});
|
|
291
|
+
title?: string;
|
|
292
|
+
description?: string;
|
|
293
|
+
data: ChartVisualizationData | TableVisualizationData | CardVisualizationData | KpiVisualizationData | CodePreviewVisualizationData | FormVisualizationData | Record<string, unknown>;
|
|
294
|
+
config?: VisualizationConfig;
|
|
295
|
+
}
|
|
296
|
+
interface VisualizationChunkData extends VisualizationData {
|
|
297
|
+
context?: {
|
|
298
|
+
orchestratorType?: string;
|
|
299
|
+
toolName?: string;
|
|
300
|
+
subtaskId?: number;
|
|
301
|
+
subagentName?: string;
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Extended streaming chunk with full agentic support
|
|
306
|
+
*/
|
|
307
|
+
interface StreamingChunk {
|
|
308
|
+
type: ChunkType;
|
|
309
|
+
content: string;
|
|
310
|
+
toolName?: string;
|
|
311
|
+
toolDescription?: string;
|
|
312
|
+
toolArgs?: Record<string, unknown>;
|
|
313
|
+
success?: boolean;
|
|
314
|
+
status?: "planned" | "executing" | "completed";
|
|
315
|
+
subtaskId?: number;
|
|
316
|
+
sequence?: number;
|
|
317
|
+
subtaskData?: SubTaskData;
|
|
318
|
+
planData?: PlanData;
|
|
319
|
+
progress?: ProgressData;
|
|
320
|
+
isReplan?: boolean;
|
|
321
|
+
waveData?: WaveData;
|
|
322
|
+
parallelSubtaskData?: ParallelSubtaskData;
|
|
323
|
+
waveNumber?: number;
|
|
324
|
+
isParallel?: boolean;
|
|
325
|
+
isMultiAgent?: boolean;
|
|
326
|
+
subagentInfo?: SubagentInfo;
|
|
327
|
+
subagentAllocations?: {
|
|
328
|
+
name: string;
|
|
329
|
+
focus: string;
|
|
330
|
+
query?: string;
|
|
331
|
+
}[];
|
|
332
|
+
replanAttempt?: number;
|
|
333
|
+
maxReplans?: number;
|
|
334
|
+
failureReason?: string;
|
|
335
|
+
isSynthesis?: boolean;
|
|
336
|
+
orchestrator?: "react" | "plan_execute" | "claude_agent_sdk";
|
|
337
|
+
parentSubtaskId?: number;
|
|
338
|
+
subagentData?: SubagentChunkData;
|
|
339
|
+
fileOperationData?: FileOperationChunkData;
|
|
340
|
+
terminalData?: TerminalChunkData;
|
|
341
|
+
searchResultsData?: SearchResultsChunkData;
|
|
342
|
+
webOperationData?: WebOperationChunkData;
|
|
343
|
+
claudeToolData?: ClaudeToolChunkData;
|
|
344
|
+
clarificationData?: ClarificationData;
|
|
345
|
+
visualizationData?: VisualizationChunkData;
|
|
346
|
+
toolUseId?: string;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Streaming message with chunks and metadata
|
|
350
|
+
*/
|
|
351
|
+
interface StreamingMessage {
|
|
352
|
+
id?: string;
|
|
353
|
+
textContent: string;
|
|
354
|
+
previousMessageId?: string;
|
|
355
|
+
chunks?: StreamingChunk[];
|
|
356
|
+
orchestratorType?: "react" | "plan_execute" | "claude_agent_sdk";
|
|
357
|
+
executionPlan?: PlanData;
|
|
358
|
+
isParallelExecution?: boolean;
|
|
359
|
+
waveData?: Record<number, WaveData>;
|
|
360
|
+
currentWaveNumber?: number;
|
|
361
|
+
suggestedActions?: FollowupAction[];
|
|
362
|
+
activeSubagents?: Map<string, SubagentChunkData>;
|
|
363
|
+
pendingClarification?: ClarificationData;
|
|
364
|
+
visualizations?: VisualizationChunkData[];
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Follow-up action suggested by AI
|
|
368
|
+
*/
|
|
369
|
+
interface FollowupAction {
|
|
370
|
+
label: string;
|
|
371
|
+
action: string;
|
|
372
|
+
type: "send_message" | "navigate" | "copy_text" | "compose_email" | "search_emails" | "open_modal" | "api_call";
|
|
373
|
+
context: Record<string, unknown>;
|
|
374
|
+
}
|
|
375
|
+
type EventStatus = "pending" | "running" | "completed" | "failed";
|
|
376
|
+
type EventType = "thinking" | "planning" | "tool" | "observation" | "subtask";
|
|
377
|
+
interface BaseEvent {
|
|
378
|
+
id: string;
|
|
379
|
+
type: EventType;
|
|
380
|
+
status: EventStatus;
|
|
381
|
+
timestamp?: number;
|
|
382
|
+
}
|
|
383
|
+
interface ThinkingEvent extends BaseEvent {
|
|
384
|
+
type: "thinking";
|
|
385
|
+
content: string;
|
|
386
|
+
}
|
|
387
|
+
interface PlanningEvent extends BaseEvent {
|
|
388
|
+
type: "planning";
|
|
389
|
+
content: string;
|
|
390
|
+
isComplete?: boolean;
|
|
391
|
+
}
|
|
392
|
+
interface ToolEvent extends BaseEvent {
|
|
393
|
+
type: "tool";
|
|
394
|
+
toolName: string;
|
|
395
|
+
toolDescription?: string;
|
|
396
|
+
input?: unknown;
|
|
397
|
+
}
|
|
398
|
+
interface ObservationEvent extends BaseEvent {
|
|
399
|
+
type: "observation";
|
|
400
|
+
toolName: string;
|
|
401
|
+
content: string;
|
|
402
|
+
success?: boolean;
|
|
403
|
+
}
|
|
404
|
+
interface SubtaskEvent extends BaseEvent {
|
|
405
|
+
type: "subtask";
|
|
406
|
+
title: string;
|
|
407
|
+
description?: string;
|
|
408
|
+
executionTime?: number;
|
|
409
|
+
result?: string;
|
|
410
|
+
error?: string;
|
|
411
|
+
children?: Event[];
|
|
412
|
+
}
|
|
413
|
+
type Event = ThinkingEvent | PlanningEvent | ToolEvent | ObservationEvent | SubtaskEvent;
|
|
414
|
+
type VisualizationActionEvent = {
|
|
415
|
+
type: "form_submit";
|
|
416
|
+
action: string;
|
|
417
|
+
data: Record<string, unknown>;
|
|
418
|
+
} | {
|
|
419
|
+
type: "form_cancel";
|
|
420
|
+
action: string;
|
|
421
|
+
} | {
|
|
422
|
+
type: "card_action";
|
|
423
|
+
action: string;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export type { VisualizationType as A, WebOperationChunkData as B, ClarificationData as C, Event as E, FormVisualizationData as F, KpiVisualizationData as K, ObservationEvent as O, PlanData as P, StreamingChunk as S, TableVisualizationData as T, VisualizationChunkData as V, WaveData as W, StreamChunk as a, StreamingOptions as b, StreamingState as c, VisualizationActionEvent as d, ChartVisualizationData as e, VisualizationConfig as f, CardVisualizationData as g, CodePreviewVisualizationData as h, EventStatus as i, ChunkType as j, ClaudeToolChunkData as k, EventType as l, FileOperationChunkData as m, FollowupAction as n, ParallelSubtaskData as o, PlanningEvent as p, ProgressData as q, SearchResultsChunkData as r, StreamingMessage as s, SubTaskData as t, SubagentChunkData as u, SubagentInfo as v, SubtaskEvent as w, TerminalChunkData as x, ThinkingEvent as y, ToolEvent as z };
|