@copilotkit/react-ui 1.7.2-next.1 → 1.8.0-next.3
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/CHANGELOG.md +21 -0
- package/dist/{chunk-QXTRFMPM.mjs → chunk-2LRE4W6A.mjs} +13 -11
- package/dist/chunk-2LRE4W6A.mjs.map +1 -0
- package/dist/{chunk-2C3ANQCY.mjs → chunk-5GNYGURH.mjs} +53 -42
- package/dist/chunk-5GNYGURH.mjs.map +1 -0
- package/dist/{chunk-CBBFRI3Q.mjs → chunk-5JY5QJ2W.mjs} +9 -5
- package/dist/chunk-5JY5QJ2W.mjs.map +1 -0
- package/dist/{chunk-OFYI4UU4.mjs → chunk-7RIBDD4K.mjs} +19 -3
- package/dist/chunk-7RIBDD4K.mjs.map +1 -0
- package/dist/{chunk-YAGE7RCE.mjs → chunk-CGVOCLHN.mjs} +2 -2
- package/dist/chunk-EJG6RRSX.mjs +138 -0
- package/dist/chunk-EJG6RRSX.mjs.map +1 -0
- package/dist/chunk-FBYETUFL.mjs +118 -0
- package/dist/chunk-FBYETUFL.mjs.map +1 -0
- package/dist/chunk-GDJAAFIK.mjs +24 -0
- package/dist/chunk-GDJAAFIK.mjs.map +1 -0
- package/dist/{chunk-6FTRYYR5.mjs → chunk-GJME6MK4.mjs} +72 -62
- package/dist/chunk-GJME6MK4.mjs.map +1 -0
- package/dist/{chunk-AZU4QOV5.mjs → chunk-KG6DW6R2.mjs} +12 -12
- package/dist/{chunk-3PJA5MFR.mjs → chunk-LKCAF2HG.mjs} +2 -2
- package/dist/{chunk-ADTTDBLB.mjs → chunk-LXCH2BIB.mjs} +2 -2
- package/dist/chunk-MCO235PS.mjs +164 -0
- package/dist/chunk-MCO235PS.mjs.map +1 -0
- package/dist/chunk-MWC5OV7Z.mjs +1 -0
- package/dist/chunk-N7LTE54T.mjs +1 -0
- package/dist/chunk-N7LTE54T.mjs.map +1 -0
- package/dist/chunk-ORSMX3SE.mjs +244 -0
- package/dist/chunk-ORSMX3SE.mjs.map +1 -0
- package/dist/{chunk-UPTB2MVO.mjs → chunk-PCTCOQK2.mjs} +4 -10
- package/dist/chunk-PCTCOQK2.mjs.map +1 -0
- package/dist/{chunk-22K5DDPF.mjs → chunk-QGK5GOSC.mjs} +31 -60
- package/dist/chunk-QGK5GOSC.mjs.map +1 -0
- package/dist/{chunk-WGAZXTUA.mjs → chunk-TOQ7P4DO.mjs} +6 -9
- package/dist/chunk-TOQ7P4DO.mjs.map +1 -0
- package/dist/chunk-UCVCAGU7.mjs +1 -0
- package/dist/chunk-UCVCAGU7.mjs.map +1 -0
- package/dist/{chunk-3XAXY2Z3.mjs → chunk-UZTZXMYS.mjs} +2 -2
- package/dist/{chunk-RQNJNK2W.mjs → chunk-VC4NO5QZ.mjs} +2 -2
- package/dist/{chunk-YQ3D5IQV.mjs → chunk-XNQO5AZZ.mjs} +2 -5
- package/dist/chunk-XNQO5AZZ.mjs.map +1 -0
- package/dist/chunk-YC4NBUGE.mjs +97 -0
- package/dist/chunk-YC4NBUGE.mjs.map +1 -0
- package/dist/components/chat/Button.js.map +1 -1
- package/dist/components/chat/Button.mjs +3 -3
- package/dist/components/chat/Chat.d.ts +17 -1
- package/dist/components/chat/Chat.js +378 -905
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +12 -19
- package/dist/components/chat/ChatContext.d.ts +20 -0
- package/dist/components/chat/ChatContext.js +44 -74
- package/dist/components/chat/ChatContext.js.map +1 -1
- package/dist/components/chat/ChatContext.mjs +2 -2
- package/dist/components/chat/CodeBlock.js +58 -82
- package/dist/components/chat/CodeBlock.js.map +1 -1
- package/dist/components/chat/CodeBlock.mjs +2 -2
- package/dist/components/chat/Header.js +516 -4
- package/dist/components/chat/Header.js.map +1 -1
- package/dist/components/chat/Header.mjs +10 -3
- package/dist/components/chat/Icons.d.ts +10 -9
- package/dist/components/chat/Icons.js +125 -164
- package/dist/components/chat/Icons.js.map +1 -1
- package/dist/components/chat/Icons.mjs +9 -5
- package/dist/components/chat/Input.d.ts +1 -1
- package/dist/components/chat/Input.js +11 -9
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +3 -3
- package/dist/components/chat/Markdown.js +58 -56
- package/dist/components/chat/Markdown.js.map +1 -1
- package/dist/components/chat/Markdown.mjs +3 -3
- package/dist/components/chat/Messages.d.ts +1 -1
- package/dist/components/chat/Messages.js +70 -60
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +3 -3
- package/dist/components/chat/Modal.js +1708 -1749
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +23 -23
- package/dist/components/chat/Popup.js +1708 -1749
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +24 -24
- package/dist/components/chat/Response.js.map +1 -1
- package/dist/components/chat/Response.mjs +3 -3
- package/dist/components/chat/Sidebar.js +1710 -1751
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +24 -24
- package/dist/components/chat/Suggestion.js +4 -40
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +2 -2
- package/dist/components/chat/Window.js.map +1 -1
- package/dist/components/chat/Window.mjs +3 -3
- package/dist/components/chat/index.js +1710 -1751
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +27 -27
- package/dist/components/chat/messages/AssistantMessage.js +211 -59
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -1
- package/dist/components/chat/messages/AssistantMessage.mjs +5 -5
- package/dist/components/chat/messages/RenderTextMessage.js +18 -2
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderTextMessage.mjs +1 -1
- package/dist/components/chat/props.d.ts +53 -0
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/crew/DefaultResponseRenderer.d.ts +110 -0
- package/dist/components/crew/DefaultResponseRenderer.js +175 -0
- package/dist/components/crew/DefaultResponseRenderer.js.map +1 -0
- package/dist/components/crew/DefaultResponseRenderer.mjs +10 -0
- package/dist/components/crew/DefaultResponseRenderer.mjs.map +1 -0
- package/dist/components/crew/DefaultStateRenderer.d.ts +88 -0
- package/dist/components/crew/DefaultStateRenderer.js +198 -0
- package/dist/components/crew/DefaultStateRenderer.js.map +1 -0
- package/dist/components/crew/DefaultStateRenderer.mjs +8 -0
- package/dist/components/crew/DefaultStateRenderer.mjs.map +1 -0
- package/dist/components/crew/index.d.ts +4 -0
- package/dist/components/crew/index.js +335 -0
- package/dist/components/crew/index.js.map +1 -0
- package/dist/components/crew/index.mjs +16 -0
- package/dist/components/crew/index.mjs.map +1 -0
- package/dist/components/crew/types.d.ts +340 -0
- package/dist/components/crew/types.js +19 -0
- package/dist/components/crew/types.js.map +1 -0
- package/dist/components/crew/types.mjs +2 -0
- package/dist/components/crew/types.mjs.map +1 -0
- package/dist/components/dev-console/console.js +51 -233
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +5 -5
- package/dist/components/dev-console/index.js +51 -233
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +5 -5
- package/dist/components/help-modal/index.js +29 -147
- package/dist/components/help-modal/index.js.map +1 -1
- package/dist/components/help-modal/index.mjs +1 -1
- package/dist/components/help-modal/modal.js +29 -147
- package/dist/components/help-modal/modal.js.map +1 -1
- package/dist/components/help-modal/modal.mjs +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +2191 -1942
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +43 -31
- package/dist/index.css +481 -90
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2192 -1943
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -31
- package/dist/types/css.d.ts +7 -1
- package/dist/types/css.js.map +1 -1
- package/package.json +4 -4
- package/src/components/chat/Chat.tsx +59 -22
- package/src/components/chat/ChatContext.tsx +29 -1
- package/src/components/chat/CodeBlock.tsx +2 -4
- package/src/components/chat/Header.tsx +8 -3
- package/src/components/chat/Icons.tsx +108 -108
- package/src/components/chat/Input.tsx +42 -38
- package/src/components/chat/Markdown.tsx +0 -3
- package/src/components/chat/Messages.tsx +68 -56
- package/src/components/chat/Suggestion.tsx +2 -3
- package/src/components/chat/messages/AssistantMessage.tsx +95 -3
- package/src/components/chat/messages/RenderTextMessage.tsx +17 -1
- package/src/components/chat/props.ts +66 -0
- package/src/components/crew/DefaultResponseRenderer.tsx +298 -0
- package/src/components/crew/DefaultStateRenderer.tsx +326 -0
- package/src/components/crew/index.ts +3 -0
- package/src/components/crew/types.ts +398 -0
- package/src/components/dev-console/console.tsx +16 -54
- package/src/components/help-modal/modal.tsx +38 -101
- package/src/components/index.ts +1 -0
- package/src/css/button.css +15 -4
- package/src/css/colors.css +27 -6
- package/src/css/console.css +46 -39
- package/src/css/crew.css +277 -0
- package/src/css/header.css +22 -5
- package/src/css/input.css +24 -17
- package/src/css/markdown.css +2 -1
- package/src/css/messages.css +125 -15
- package/src/css/panel.css +1 -0
- package/src/css/suggestions.css +14 -6
- package/src/styles.css +1 -0
- package/src/types/css.ts +7 -1
- package/dist/chunk-22K5DDPF.mjs.map +0 -1
- package/dist/chunk-2C3ANQCY.mjs.map +0 -1
- package/dist/chunk-3VNMQWGT.mjs +0 -25
- package/dist/chunk-3VNMQWGT.mjs.map +0 -1
- package/dist/chunk-6FTRYYR5.mjs.map +0 -1
- package/dist/chunk-CBBFRI3Q.mjs.map +0 -1
- package/dist/chunk-FZC7X5PK.mjs +0 -262
- package/dist/chunk-FZC7X5PK.mjs.map +0 -1
- package/dist/chunk-MMVDU6DF.mjs +0 -1
- package/dist/chunk-OFYI4UU4.mjs.map +0 -1
- package/dist/chunk-QXTRFMPM.mjs.map +0 -1
- package/dist/chunk-TI7SY2RI.mjs +0 -164
- package/dist/chunk-TI7SY2RI.mjs.map +0 -1
- package/dist/chunk-UPTB2MVO.mjs.map +0 -1
- package/dist/chunk-VEC45H6Q.mjs +0 -18
- package/dist/chunk-VEC45H6Q.mjs.map +0 -1
- package/dist/chunk-WGAZXTUA.mjs.map +0 -1
- package/dist/chunk-YQ3D5IQV.mjs.map +0 -1
- /package/dist/{chunk-YAGE7RCE.mjs.map → chunk-CGVOCLHN.mjs.map} +0 -0
- /package/dist/{chunk-AZU4QOV5.mjs.map → chunk-KG6DW6R2.mjs.map} +0 -0
- /package/dist/{chunk-3PJA5MFR.mjs.map → chunk-LKCAF2HG.mjs.map} +0 -0
- /package/dist/{chunk-ADTTDBLB.mjs.map → chunk-LXCH2BIB.mjs.map} +0 -0
- /package/dist/{chunk-MMVDU6DF.mjs.map → chunk-MWC5OV7Z.mjs.map} +0 -0
- /package/dist/{chunk-3XAXY2Z3.mjs.map → chunk-UZTZXMYS.mjs.map} +0 -0
- /package/dist/{chunk-RQNJNK2W.mjs.map → chunk-VC4NO5QZ.mjs.map} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../../chunk-UCVCAGU7.mjs";
|
|
2
|
+
import "../../chunk-N7LTE54T.mjs";
|
|
3
|
+
import {
|
|
4
|
+
DefaultResponseRenderer,
|
|
5
|
+
createResponseCache
|
|
6
|
+
} from "../../chunk-EJG6RRSX.mjs";
|
|
7
|
+
import {
|
|
8
|
+
DefaultStateRenderer
|
|
9
|
+
} from "../../chunk-MCO235PS.mjs";
|
|
10
|
+
import "../../chunk-MRXNTQOX.mjs";
|
|
11
|
+
export {
|
|
12
|
+
DefaultResponseRenderer,
|
|
13
|
+
DefaultStateRenderer,
|
|
14
|
+
createResponseCache
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Status of a response or action that requires user input
|
|
5
|
+
*/
|
|
6
|
+
type ResponseStatus = "inProgress" | "complete" | "executing";
|
|
7
|
+
/**
|
|
8
|
+
* Response data structure for the ResponseRenderer
|
|
9
|
+
*/
|
|
10
|
+
interface Response {
|
|
11
|
+
/**
|
|
12
|
+
* Unique identifier for the response
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
/**
|
|
16
|
+
* The content of the response to display
|
|
17
|
+
*/
|
|
18
|
+
content: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional metadata for the response
|
|
21
|
+
*/
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Optional cache for storing user feedback
|
|
26
|
+
*/
|
|
27
|
+
interface ResponseCache<T extends {
|
|
28
|
+
id: string;
|
|
29
|
+
}> {
|
|
30
|
+
/**
|
|
31
|
+
* Get feedback for a specific ID
|
|
32
|
+
*/
|
|
33
|
+
getResponse: (id: string) => T | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Set feedback for a specific ID
|
|
36
|
+
*/
|
|
37
|
+
setResponse: (id: string, response: T) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props for custom icon components
|
|
41
|
+
*/
|
|
42
|
+
interface ResponseRendererIconProps {
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Icons for the ResponseRenderer component
|
|
47
|
+
*/
|
|
48
|
+
interface ResponseRendererIcons {
|
|
49
|
+
/**
|
|
50
|
+
* Icon for expanding content
|
|
51
|
+
*/
|
|
52
|
+
expand?: React.ComponentType<ResponseRendererIconProps>;
|
|
53
|
+
/**
|
|
54
|
+
* Icon for collapsing content
|
|
55
|
+
*/
|
|
56
|
+
collapse?: React.ComponentType<ResponseRendererIconProps>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Labels for the ResponseRenderer component
|
|
60
|
+
*/
|
|
61
|
+
interface ResponseRendererLabels {
|
|
62
|
+
/**
|
|
63
|
+
* Label for the response section
|
|
64
|
+
*/
|
|
65
|
+
responseLabel?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Label for the approve button
|
|
68
|
+
*/
|
|
69
|
+
approveLabel?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Label for the reject button
|
|
72
|
+
*/
|
|
73
|
+
rejectLabel?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Message shown when approved
|
|
76
|
+
*/
|
|
77
|
+
approvedMessage?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Message shown when rejected
|
|
80
|
+
*/
|
|
81
|
+
rejectedMessage?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Message shown when feedback is submitted
|
|
84
|
+
*/
|
|
85
|
+
feedbackSubmittedMessage?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Props for the content renderer component
|
|
89
|
+
*/
|
|
90
|
+
interface ContentRendererProps {
|
|
91
|
+
/**
|
|
92
|
+
* Content to render
|
|
93
|
+
*/
|
|
94
|
+
content: string;
|
|
95
|
+
/**
|
|
96
|
+
* CSS class name for styling
|
|
97
|
+
*/
|
|
98
|
+
className?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Props for the feedback button component
|
|
102
|
+
*/
|
|
103
|
+
interface FeedbackButtonProps {
|
|
104
|
+
/**
|
|
105
|
+
* The text to display on the button
|
|
106
|
+
*/
|
|
107
|
+
label: string;
|
|
108
|
+
/**
|
|
109
|
+
* Function to call when the button is clicked
|
|
110
|
+
*/
|
|
111
|
+
onClick: () => void;
|
|
112
|
+
/**
|
|
113
|
+
* CSS class name for styling
|
|
114
|
+
*/
|
|
115
|
+
className?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Props for the completed feedback display component
|
|
119
|
+
*/
|
|
120
|
+
interface CompletedFeedbackProps {
|
|
121
|
+
/**
|
|
122
|
+
* The message to display
|
|
123
|
+
*/
|
|
124
|
+
message: string;
|
|
125
|
+
/**
|
|
126
|
+
* CSS class name for styling
|
|
127
|
+
*/
|
|
128
|
+
className?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Props for the ResponseRenderer component
|
|
132
|
+
*/
|
|
133
|
+
interface ResponseRendererProps {
|
|
134
|
+
/**
|
|
135
|
+
* The response data to render
|
|
136
|
+
*/
|
|
137
|
+
response: Response;
|
|
138
|
+
/**
|
|
139
|
+
* The current status of the response
|
|
140
|
+
*/
|
|
141
|
+
status: ResponseStatus;
|
|
142
|
+
/**
|
|
143
|
+
* Function to call when a response is given
|
|
144
|
+
*/
|
|
145
|
+
onRespond?: (input: string) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Custom icons for the component
|
|
148
|
+
*/
|
|
149
|
+
icons?: ResponseRendererIcons;
|
|
150
|
+
/**
|
|
151
|
+
* Custom labels for the component
|
|
152
|
+
*/
|
|
153
|
+
labels?: ResponseRendererLabels;
|
|
154
|
+
/**
|
|
155
|
+
* Custom component for rendering content
|
|
156
|
+
*/
|
|
157
|
+
ContentRenderer?: React.ComponentType<ContentRendererProps>;
|
|
158
|
+
/**
|
|
159
|
+
* Custom component for rendering feedback buttons
|
|
160
|
+
*/
|
|
161
|
+
FeedbackButton?: React.ComponentType<FeedbackButtonProps>;
|
|
162
|
+
/**
|
|
163
|
+
* Custom component for rendering completed feedback
|
|
164
|
+
*/
|
|
165
|
+
CompletedFeedback?: React.ComponentType<CompletedFeedbackProps>;
|
|
166
|
+
/**
|
|
167
|
+
* CSS class for the root element
|
|
168
|
+
*/
|
|
169
|
+
className?: string;
|
|
170
|
+
/**
|
|
171
|
+
* CSS class for the content element
|
|
172
|
+
*/
|
|
173
|
+
contentClassName?: string;
|
|
174
|
+
/**
|
|
175
|
+
* CSS class for the actions container
|
|
176
|
+
*/
|
|
177
|
+
actionsClassName?: string;
|
|
178
|
+
/**
|
|
179
|
+
* CSS class for feedback buttons
|
|
180
|
+
*/
|
|
181
|
+
buttonClassName?: string;
|
|
182
|
+
/**
|
|
183
|
+
* CSS class for completed feedback
|
|
184
|
+
*/
|
|
185
|
+
completedFeedbackClassName?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Children nodes
|
|
188
|
+
*/
|
|
189
|
+
children?: ReactNode;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Base state item interface for agent state items
|
|
193
|
+
*/
|
|
194
|
+
interface StateItem {
|
|
195
|
+
/**
|
|
196
|
+
* Unique identifier for the item
|
|
197
|
+
*/
|
|
198
|
+
id: string;
|
|
199
|
+
/**
|
|
200
|
+
* Timestamp when the item was created
|
|
201
|
+
*/
|
|
202
|
+
timestamp: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Tool execution state item
|
|
206
|
+
*/
|
|
207
|
+
interface ToolStateItem extends StateItem {
|
|
208
|
+
/**
|
|
209
|
+
* Name of the tool that was executed
|
|
210
|
+
*/
|
|
211
|
+
tool: string;
|
|
212
|
+
/**
|
|
213
|
+
* Optional thought process for the tool execution
|
|
214
|
+
*/
|
|
215
|
+
thought?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Result of the tool execution
|
|
218
|
+
*/
|
|
219
|
+
result?: any;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Task state item
|
|
223
|
+
*/
|
|
224
|
+
interface TaskStateItem extends StateItem {
|
|
225
|
+
/**
|
|
226
|
+
* Name of the task
|
|
227
|
+
*/
|
|
228
|
+
name: string;
|
|
229
|
+
/**
|
|
230
|
+
* Description of the task
|
|
231
|
+
*/
|
|
232
|
+
description?: string;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* AgentState containing information about steps and tasks
|
|
236
|
+
*/
|
|
237
|
+
interface AgentState {
|
|
238
|
+
/**
|
|
239
|
+
* Array of tool execution steps
|
|
240
|
+
*/
|
|
241
|
+
steps?: ToolStateItem[];
|
|
242
|
+
/**
|
|
243
|
+
* Array of tasks
|
|
244
|
+
*/
|
|
245
|
+
tasks?: TaskStateItem[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Props for the item renderer component
|
|
249
|
+
*/
|
|
250
|
+
interface StateItemRendererProps {
|
|
251
|
+
/**
|
|
252
|
+
* The item to render
|
|
253
|
+
*/
|
|
254
|
+
item: ToolStateItem | TaskStateItem;
|
|
255
|
+
/**
|
|
256
|
+
* Whether the item is the newest
|
|
257
|
+
*/
|
|
258
|
+
isNewest: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* CSS class for the item container
|
|
261
|
+
*/
|
|
262
|
+
className?: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Props for the skeleton loader component
|
|
266
|
+
*/
|
|
267
|
+
interface SkeletonLoaderProps {
|
|
268
|
+
/**
|
|
269
|
+
* CSS class for the skeleton
|
|
270
|
+
*/
|
|
271
|
+
className?: string;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Props for the DefaultStateRenderer component
|
|
275
|
+
*/
|
|
276
|
+
interface StateRendererProps {
|
|
277
|
+
/**
|
|
278
|
+
* The state to render
|
|
279
|
+
*/
|
|
280
|
+
state?: AgentState;
|
|
281
|
+
/**
|
|
282
|
+
* The current status
|
|
283
|
+
*/
|
|
284
|
+
status: ResponseStatus;
|
|
285
|
+
/**
|
|
286
|
+
* Custom component for rendering individual state items
|
|
287
|
+
*/
|
|
288
|
+
StateItemRenderer?: React.ComponentType<StateItemRendererProps>;
|
|
289
|
+
/**
|
|
290
|
+
* Custom component for showing a loading skeleton
|
|
291
|
+
*/
|
|
292
|
+
SkeletonLoader?: React.ComponentType<SkeletonLoaderProps>;
|
|
293
|
+
/**
|
|
294
|
+
* Custom labels for the component
|
|
295
|
+
*/
|
|
296
|
+
labels?: {
|
|
297
|
+
/**
|
|
298
|
+
* Label shown when in progress
|
|
299
|
+
*/
|
|
300
|
+
inProgressLabel?: string;
|
|
301
|
+
/**
|
|
302
|
+
* Label shown when complete
|
|
303
|
+
*/
|
|
304
|
+
completeLabel?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Label shown when no items are present
|
|
307
|
+
*/
|
|
308
|
+
emptyLabel?: string;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* Custom icons for the component
|
|
312
|
+
*/
|
|
313
|
+
icons?: ResponseRendererIcons;
|
|
314
|
+
/**
|
|
315
|
+
* CSS class for the root element
|
|
316
|
+
*/
|
|
317
|
+
className?: string;
|
|
318
|
+
/**
|
|
319
|
+
* CSS class for the content container
|
|
320
|
+
*/
|
|
321
|
+
contentClassName?: string;
|
|
322
|
+
/**
|
|
323
|
+
* CSS class for state items
|
|
324
|
+
*/
|
|
325
|
+
itemClassName?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Maximum height for the content area
|
|
328
|
+
*/
|
|
329
|
+
maxHeight?: string;
|
|
330
|
+
/**
|
|
331
|
+
* Initial collapsed state
|
|
332
|
+
*/
|
|
333
|
+
defaultCollapsed?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Children nodes
|
|
336
|
+
*/
|
|
337
|
+
children?: ReactNode;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export { AgentState, CompletedFeedbackProps, ContentRendererProps, FeedbackButtonProps, Response, ResponseCache, ResponseRendererIconProps, ResponseRendererIcons, ResponseRendererLabels, ResponseRendererProps, ResponseStatus, SkeletonLoaderProps, StateItem, StateItemRendererProps, StateRendererProps, TaskStateItem, ToolStateItem };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/components/crew/types.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/crew/types.ts"],"sourcesContent":["import { ReactNode } from \"react\";\n\n/**\n * Status of a response or action that requires user input\n */\nexport type ResponseStatus = \"inProgress\" | \"complete\" | \"executing\";\n\n/**\n * Response data structure for the ResponseRenderer\n */\nexport interface Response {\n /**\n * Unique identifier for the response\n */\n id: string;\n\n /**\n * The content of the response to display\n */\n content: string;\n\n /**\n * Optional metadata for the response\n */\n metadata?: Record<string, any>;\n}\n\n/**\n * Optional cache for storing user feedback\n */\nexport interface ResponseCache<T extends { id: string }> {\n /**\n * Get feedback for a specific ID\n */\n getResponse: (id: string) => T | undefined;\n\n /**\n * Set feedback for a specific ID\n */\n setResponse: (id: string, response: T) => void;\n}\n\n/**\n * Props for custom icon components\n */\nexport interface ResponseRendererIconProps {\n className?: string;\n}\n\n/**\n * Icons for the ResponseRenderer component\n */\nexport interface ResponseRendererIcons {\n /**\n * Icon for expanding content\n */\n expand?: React.ComponentType<ResponseRendererIconProps>;\n\n /**\n * Icon for collapsing content\n */\n collapse?: React.ComponentType<ResponseRendererIconProps>;\n}\n\n/**\n * Labels for the ResponseRenderer component\n */\nexport interface ResponseRendererLabels {\n /**\n * Label for the response section\n */\n responseLabel?: string;\n\n /**\n * Label for the approve button\n */\n approveLabel?: string;\n\n /**\n * Label for the reject button\n */\n rejectLabel?: string;\n\n /**\n * Message shown when approved\n */\n approvedMessage?: string;\n\n /**\n * Message shown when rejected\n */\n rejectedMessage?: string;\n\n /**\n * Message shown when feedback is submitted\n */\n feedbackSubmittedMessage?: string;\n}\n\n/**\n * Props for the content renderer component\n */\nexport interface ContentRendererProps {\n /**\n * Content to render\n */\n content: string;\n\n /**\n * CSS class name for styling\n */\n className?: string;\n}\n\n/**\n * Props for the feedback button component\n */\nexport interface FeedbackButtonProps {\n /**\n * The text to display on the button\n */\n label: string;\n\n /**\n * Function to call when the button is clicked\n */\n onClick: () => void;\n\n /**\n * CSS class name for styling\n */\n className?: string;\n}\n\n/**\n * Props for the completed feedback display component\n */\nexport interface CompletedFeedbackProps {\n /**\n * The message to display\n */\n message: string;\n\n /**\n * CSS class name for styling\n */\n className?: string;\n}\n\n/**\n * Props for the ResponseRenderer component\n */\nexport interface ResponseRendererProps {\n /**\n * The response data to render\n */\n response: Response;\n\n /**\n * The current status of the response\n */\n status: ResponseStatus;\n\n /**\n * Function to call when a response is given\n */\n onRespond?: (input: string) => void;\n\n /**\n * Custom icons for the component\n */\n icons?: ResponseRendererIcons;\n\n /**\n * Custom labels for the component\n */\n labels?: ResponseRendererLabels;\n\n /**\n * Custom component for rendering content\n */\n ContentRenderer?: React.ComponentType<ContentRendererProps>;\n\n /**\n * Custom component for rendering feedback buttons\n */\n FeedbackButton?: React.ComponentType<FeedbackButtonProps>;\n\n /**\n * Custom component for rendering completed feedback\n */\n CompletedFeedback?: React.ComponentType<CompletedFeedbackProps>;\n\n /**\n * CSS class for the root element\n */\n className?: string;\n\n /**\n * CSS class for the content element\n */\n contentClassName?: string;\n\n /**\n * CSS class for the actions container\n */\n actionsClassName?: string;\n\n /**\n * CSS class for feedback buttons\n */\n buttonClassName?: string;\n\n /**\n * CSS class for completed feedback\n */\n completedFeedbackClassName?: string;\n\n /**\n * Children nodes\n */\n children?: ReactNode;\n}\n\n/**\n * Base state item interface for agent state items\n */\nexport interface StateItem {\n /**\n * Unique identifier for the item\n */\n id: string;\n\n /**\n * Timestamp when the item was created\n */\n timestamp: string;\n}\n\n/**\n * Tool execution state item\n */\nexport interface ToolStateItem extends StateItem {\n /**\n * Name of the tool that was executed\n */\n tool: string;\n\n /**\n * Optional thought process for the tool execution\n */\n thought?: string;\n\n /**\n * Result of the tool execution\n */\n result?: any;\n}\n\n/**\n * Task state item\n */\nexport interface TaskStateItem extends StateItem {\n /**\n * Name of the task\n */\n name: string;\n\n /**\n * Description of the task\n */\n description?: string;\n}\n\n/**\n * AgentState containing information about steps and tasks\n */\nexport interface AgentState {\n /**\n * Array of tool execution steps\n */\n steps?: ToolStateItem[];\n\n /**\n * Array of tasks\n */\n tasks?: TaskStateItem[];\n}\n\n/**\n * Props for the item renderer component\n */\nexport interface StateItemRendererProps {\n /**\n * The item to render\n */\n item: ToolStateItem | TaskStateItem;\n\n /**\n * Whether the item is the newest\n */\n isNewest: boolean;\n\n /**\n * CSS class for the item container\n */\n className?: string;\n}\n\n/**\n * Props for the skeleton loader component\n */\nexport interface SkeletonLoaderProps {\n /**\n * CSS class for the skeleton\n */\n className?: string;\n}\n\n/**\n * Props for the DefaultStateRenderer component\n */\nexport interface StateRendererProps {\n /**\n * The state to render\n */\n state?: AgentState;\n\n /**\n * The current status\n */\n status: ResponseStatus;\n\n /**\n * Custom component for rendering individual state items\n */\n StateItemRenderer?: React.ComponentType<StateItemRendererProps>;\n\n /**\n * Custom component for showing a loading skeleton\n */\n SkeletonLoader?: React.ComponentType<SkeletonLoaderProps>;\n\n /**\n * Custom labels for the component\n */\n labels?: {\n /**\n * Label shown when in progress\n */\n inProgressLabel?: string;\n\n /**\n * Label shown when complete\n */\n completeLabel?: string;\n\n /**\n * Label shown when no items are present\n */\n emptyLabel?: string;\n };\n\n /**\n * Custom icons for the component\n */\n icons?: ResponseRendererIcons;\n\n /**\n * CSS class for the root element\n */\n className?: string;\n\n /**\n * CSS class for the content container\n */\n contentClassName?: string;\n\n /**\n * CSS class for state items\n */\n itemClassName?: string;\n\n /**\n * Maximum height for the content area\n */\n maxHeight?: string;\n\n /**\n * Initial collapsed state\n */\n defaultCollapsed?: boolean;\n\n /**\n * Children nodes\n */\n children?: ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|