@lichen-ai/chatkit-types 0.4.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 +201 -0
- package/NOTICE +1 -0
- package/README.md +9 -0
- package/dist/constants.cjs +47 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.ts +72 -0
- package/dist/constants.js +47 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.cjs +436 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2094 -0
- package/dist/index.js +436 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2094 @@
|
|
|
1
|
+
import { ToolCall } from '@langchain/core/messages/tool';
|
|
2
|
+
import type { Types } from '@a2ui/lit/0.8';
|
|
3
|
+
|
|
4
|
+
export declare type AccentColor = {
|
|
5
|
+
primary: string;
|
|
6
|
+
level: 0 | 1 | 2 | 3;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare type ActionConfig = {
|
|
10
|
+
type: string;
|
|
11
|
+
payload?: Record<string, unknown>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
declare type Alignment = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* strategies to host files before attaching them to messages.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Attachment associated with a user message. When passed to `sendUserMessage` or
|
|
21
|
+
* `setComposerValue`, it must already be uploaded by your server. We do not currently
|
|
22
|
+
* support attaching raw Files to a message.
|
|
23
|
+
*/
|
|
24
|
+
export declare type Attachment = {
|
|
25
|
+
type: 'file';
|
|
26
|
+
/** Server-generated identifier for the uploaded file. */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Original filename shown in the UI. */
|
|
29
|
+
name: string;
|
|
30
|
+
/** MIME type of the file. */
|
|
31
|
+
mime_type: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'image';
|
|
34
|
+
/** Server-generated identifier for the uploaded image. */
|
|
35
|
+
id: string;
|
|
36
|
+
/** URL used to render the image preview in the UI. */
|
|
37
|
+
preview_url: string;
|
|
38
|
+
/** Original filename shown in the UI. */
|
|
39
|
+
name: string;
|
|
40
|
+
/** MIME type of the image. */
|
|
41
|
+
mime_type: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export declare type Badge = {
|
|
45
|
+
type: 'Badge';
|
|
46
|
+
key?: string;
|
|
47
|
+
id?: string;
|
|
48
|
+
label: string;
|
|
49
|
+
color?: 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'discovery';
|
|
50
|
+
variant?: 'solid' | 'soft' | 'outline';
|
|
51
|
+
size?: 'sm' | 'md' | 'lg';
|
|
52
|
+
pill?: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare type BaseTextProps = {
|
|
56
|
+
value: string;
|
|
57
|
+
color?: string | ThemeColor;
|
|
58
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
59
|
+
textAlign?: TextAlign;
|
|
60
|
+
truncate?: boolean;
|
|
61
|
+
maxLines?: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export declare type BasicRoot = {
|
|
65
|
+
type: 'Basic';
|
|
66
|
+
key?: string;
|
|
67
|
+
id?: string;
|
|
68
|
+
children: (WidgetComponent | WidgetRoot)[];
|
|
69
|
+
theme?: 'light' | 'dark';
|
|
70
|
+
direction?: 'row' | 'col';
|
|
71
|
+
} & Pick<BoxBaseProps, 'gap' | 'padding' | 'align' | 'justify'>;
|
|
72
|
+
|
|
73
|
+
declare type BlockProps = {
|
|
74
|
+
height?: number | string;
|
|
75
|
+
width?: number | string;
|
|
76
|
+
size?: number | string;
|
|
77
|
+
minHeight?: number | string;
|
|
78
|
+
minWidth?: number | string;
|
|
79
|
+
minSize?: number | string;
|
|
80
|
+
maxHeight?: number | string;
|
|
81
|
+
maxWidth?: number | string;
|
|
82
|
+
maxSize?: number | string;
|
|
83
|
+
aspectRatio?: number | string;
|
|
84
|
+
radius?: RadiusValue;
|
|
85
|
+
margin?: number | string | Spacing;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
declare type Border = {
|
|
89
|
+
size: number;
|
|
90
|
+
color?: string | ThemeColor;
|
|
91
|
+
style?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset';
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
declare type Borders = {
|
|
95
|
+
top?: number | Border;
|
|
96
|
+
right?: number | Border;
|
|
97
|
+
bottom?: number | Border;
|
|
98
|
+
left?: number | Border;
|
|
99
|
+
x?: number | Border;
|
|
100
|
+
y?: number | Border;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export declare type Box = {
|
|
104
|
+
type: 'Box';
|
|
105
|
+
key?: string;
|
|
106
|
+
id?: string;
|
|
107
|
+
direction?: 'row' | 'col';
|
|
108
|
+
} & BoxBaseProps;
|
|
109
|
+
|
|
110
|
+
declare type BoxBaseProps = {
|
|
111
|
+
children?: WidgetComponent[];
|
|
112
|
+
align?: Alignment;
|
|
113
|
+
justify?: Justification;
|
|
114
|
+
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
115
|
+
flex?: number | string;
|
|
116
|
+
gap?: number | string;
|
|
117
|
+
padding?: number | string | Spacing;
|
|
118
|
+
border?: number | Border | Borders;
|
|
119
|
+
background?: string | ThemeColor;
|
|
120
|
+
} & BlockProps;
|
|
121
|
+
|
|
122
|
+
export declare type Button = {
|
|
123
|
+
type: 'Button';
|
|
124
|
+
key?: string;
|
|
125
|
+
id?: string;
|
|
126
|
+
submit?: boolean;
|
|
127
|
+
label?: string;
|
|
128
|
+
onClickAction?: ActionConfig;
|
|
129
|
+
iconStart?: WidgetIcon;
|
|
130
|
+
iconEnd?: WidgetIcon;
|
|
131
|
+
style?: 'primary' | 'secondary';
|
|
132
|
+
iconSize?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
133
|
+
color?: 'primary' | 'secondary' | 'info' | 'discovery' | 'success' | 'caution' | 'warning' | 'danger';
|
|
134
|
+
variant?: ControlVariant;
|
|
135
|
+
size?: ControlSize;
|
|
136
|
+
pill?: boolean;
|
|
137
|
+
uniform?: boolean;
|
|
138
|
+
block?: boolean;
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export declare type Caption = {
|
|
143
|
+
type: 'Caption';
|
|
144
|
+
key?: string;
|
|
145
|
+
id?: string;
|
|
146
|
+
size?: CaptionSize;
|
|
147
|
+
} & BaseTextProps;
|
|
148
|
+
|
|
149
|
+
declare type CaptionSize = 'sm' | 'md' | 'lg';
|
|
150
|
+
|
|
151
|
+
export declare type Card = {
|
|
152
|
+
type: 'Card';
|
|
153
|
+
key?: string;
|
|
154
|
+
id?: string;
|
|
155
|
+
asForm?: boolean;
|
|
156
|
+
children: WidgetComponent[];
|
|
157
|
+
background?: string | ThemeColor;
|
|
158
|
+
size?: 'sm' | 'md' | 'lg' | 'full';
|
|
159
|
+
padding?: number | string | Spacing;
|
|
160
|
+
status?: WidgetStatus;
|
|
161
|
+
collapsed?: boolean;
|
|
162
|
+
confirm?: CardAction;
|
|
163
|
+
cancel?: CardAction;
|
|
164
|
+
theme?: 'light' | 'dark';
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
declare type CardAction = {
|
|
168
|
+
label: string;
|
|
169
|
+
action: ActionConfig;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export declare const CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED: "follow_up_consumed";
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Encapsulate multi-agent message events
|
|
176
|
+
*/
|
|
177
|
+
export declare interface ChatEventEnvelope<T = unknown> {
|
|
178
|
+
type: ChatMessageTypeEnum;
|
|
179
|
+
event?: ChatMessageEventTypeEnum;
|
|
180
|
+
tags: string[];
|
|
181
|
+
data: T;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export declare type ChatKitClientSecretObject = {
|
|
185
|
+
secret: string;
|
|
186
|
+
organizationId?: string;
|
|
187
|
+
xpertId?: string;
|
|
188
|
+
assistantId?: string;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export declare type ChatKitClientSecretResult = string | ChatKitClientSecretObject;
|
|
192
|
+
|
|
193
|
+
export declare type ChatKitCodeReference = ChatKitReferenceBase & {
|
|
194
|
+
type: 'code';
|
|
195
|
+
path: string;
|
|
196
|
+
startLine: number;
|
|
197
|
+
endLine: number;
|
|
198
|
+
language?: string;
|
|
199
|
+
taskId?: string;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export declare type ChatKitCommandSource = {
|
|
203
|
+
type: 'slash_command';
|
|
204
|
+
name: string;
|
|
205
|
+
source: 'builtin' | 'host' | 'runtime';
|
|
206
|
+
executionType: ChatKitSlashCommandExecutionType;
|
|
207
|
+
kind?: ChatKitSlashCommandKind;
|
|
208
|
+
workflow?: ChatKitPromptWorkflow;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export declare interface ChatKitElementEventMap {
|
|
212
|
+
'chatkit.error': CustomEvent<{
|
|
213
|
+
error: Error;
|
|
214
|
+
}>;
|
|
215
|
+
'chatkit.response.start': CustomEvent<void>;
|
|
216
|
+
'chatkit.response.end': CustomEvent<void>;
|
|
217
|
+
'chatkit.thread.change': CustomEvent<{
|
|
218
|
+
threadId: string | null;
|
|
219
|
+
}>;
|
|
220
|
+
'chatkit.log': CustomEvent<{
|
|
221
|
+
name: string;
|
|
222
|
+
data?: Record<string, unknown>;
|
|
223
|
+
}>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* DOM events emitted by the `xpertai-chatkit` custom element.
|
|
228
|
+
*/
|
|
229
|
+
export declare type ChatKitEvents = {
|
|
230
|
+
/** Emitted when the ChatKit frame has loaded. */
|
|
231
|
+
'chatkit.ready': CustomEvent<void>;
|
|
232
|
+
/** Emitted when an error occurs. You should log these for monitoring and debugging. */
|
|
233
|
+
'chatkit.error': CustomEvent<{
|
|
234
|
+
error: Error;
|
|
235
|
+
}>;
|
|
236
|
+
/** Emitted when a fire-and-forget client effect is triggered. */
|
|
237
|
+
'chatkit.effect': CustomEvent<{
|
|
238
|
+
name: string;
|
|
239
|
+
data?: Record<string, unknown>;
|
|
240
|
+
}>;
|
|
241
|
+
/** Emitted when the assistant begins sending a response. */
|
|
242
|
+
'chatkit.response.start': CustomEvent<void>;
|
|
243
|
+
/** Emitted when the assistant finishes sending a response. */
|
|
244
|
+
'chatkit.response.end': CustomEvent<void>;
|
|
245
|
+
/** Emitted when the active thread changes. Use this along with `initialThread` to persist the current thread across page loads or sessions. */
|
|
246
|
+
'chatkit.thread.change': CustomEvent<{
|
|
247
|
+
threadId: string | null;
|
|
248
|
+
}>;
|
|
249
|
+
/** Emitted when ChatKit starts loading a thread (initial load or selected from history). */
|
|
250
|
+
'chatkit.thread.load.start': CustomEvent<{
|
|
251
|
+
threadId: string;
|
|
252
|
+
}>;
|
|
253
|
+
/** Emitted when ChatKit finished loading a thread. */
|
|
254
|
+
'chatkit.thread.load.end': CustomEvent<{
|
|
255
|
+
threadId: string;
|
|
256
|
+
}>;
|
|
257
|
+
/** Diagnostic events that can be used for logging/analytics. */
|
|
258
|
+
'chatkit.log': CustomEvent<{
|
|
259
|
+
name: string;
|
|
260
|
+
data?: Record<string, unknown>;
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export declare type ChatKitI18nText = LocalizedText;
|
|
265
|
+
|
|
266
|
+
export declare type ChatKitImageReference = ChatKitReferenceBase & {
|
|
267
|
+
type: 'image';
|
|
268
|
+
fileId?: string;
|
|
269
|
+
url?: string;
|
|
270
|
+
mimeType?: string;
|
|
271
|
+
name?: string;
|
|
272
|
+
size?: number;
|
|
273
|
+
width?: number;
|
|
274
|
+
height?: number;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export declare interface ChatkitMessage {
|
|
278
|
+
status?: string;
|
|
279
|
+
content: TMessageItems | string;
|
|
280
|
+
reasoning?: TMessageContentReasoning[];
|
|
281
|
+
type: 'user' | 'assistant' | 'system' | 'tool' | 'event';
|
|
282
|
+
id: string;
|
|
283
|
+
followUpMode?: FollowUpBehavior;
|
|
284
|
+
followUpStatus?: 'pending' | 'consumed' | 'canceled';
|
|
285
|
+
targetExecutionId?: string | null;
|
|
286
|
+
visibleAt?: string | Date | null;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export declare type ChatKitOptions = {
|
|
290
|
+
/**
|
|
291
|
+
* ChatKit iframe URL for web component integrations.
|
|
292
|
+
*/
|
|
293
|
+
frameUrl?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Controls how the ChatKit web component is presented.
|
|
296
|
+
* - `chat`: render the ChatKit iframe in the host layout.
|
|
297
|
+
* - `pet`: render only the pet launcher until the user clicks the pet.
|
|
298
|
+
*
|
|
299
|
+
* @default "chat"
|
|
300
|
+
*/
|
|
301
|
+
displayMode?: 'chat' | 'pet';
|
|
302
|
+
api: CustomApiConfig | HostedApiConfig;
|
|
303
|
+
/**
|
|
304
|
+
* Default request values that should be injected into every user message sent
|
|
305
|
+
* from this ChatKit instance.
|
|
306
|
+
*/
|
|
307
|
+
request?: ChatKitRequestOptions;
|
|
308
|
+
/**
|
|
309
|
+
* Locale override for ChatKit UI. If not provided, the browser's locale
|
|
310
|
+
* will be used. If the locale is not supported, will fall back to English.
|
|
311
|
+
*
|
|
312
|
+
* @default navigator.language
|
|
313
|
+
*/
|
|
314
|
+
locale?: SupportedLocale;
|
|
315
|
+
/**
|
|
316
|
+
* Visual appearance configuration options for ChatKit.
|
|
317
|
+
* * @default "light"
|
|
318
|
+
*/
|
|
319
|
+
theme?: ColorScheme | ChatKitTheme;
|
|
320
|
+
/**
|
|
321
|
+
* Optional animated pet companion rendered by the ChatKit web component over
|
|
322
|
+
* the host page viewport.
|
|
323
|
+
* Passing `true` enables the default built-in pet.
|
|
324
|
+
*
|
|
325
|
+
* @default false
|
|
326
|
+
*/
|
|
327
|
+
pet?: boolean | ChatKitPetOptions;
|
|
328
|
+
/**
|
|
329
|
+
* The ID of the thread to show when ChatKit is mounted or opened for the first time.
|
|
330
|
+
* Passing `null` will show the new thread view.
|
|
331
|
+
*
|
|
332
|
+
* @default null
|
|
333
|
+
*/
|
|
334
|
+
initialThread?: null | string;
|
|
335
|
+
/**
|
|
336
|
+
* A map of handlers for the client tools configured on your server. The keys
|
|
337
|
+
* are the names of the client tools, and the values are functions that
|
|
338
|
+
* will be called when the client tool is invoked. The object (or promise) returned
|
|
339
|
+
* from the function will be sent back to the server as the result of the client
|
|
340
|
+
* tool invocation.
|
|
341
|
+
*/
|
|
342
|
+
onClientTool?: ({ name, params, id, tool_call_id }: {
|
|
343
|
+
name: string;
|
|
344
|
+
params: Record<string, unknown>;
|
|
345
|
+
id?: string;
|
|
346
|
+
tool_call_id?: string;
|
|
347
|
+
}) => Promise<ClientToolMessageInput> | ClientToolMessageInput;
|
|
348
|
+
/**
|
|
349
|
+
* Whether to show the header in ChatKit. A configuration object can be
|
|
350
|
+
* provided to customize the header.
|
|
351
|
+
*/
|
|
352
|
+
header?: {
|
|
353
|
+
enabled?: boolean;
|
|
354
|
+
/**
|
|
355
|
+
* Configuration for header title display, which defaults to showing thread titles.
|
|
356
|
+
*/
|
|
357
|
+
title?: {
|
|
358
|
+
/**
|
|
359
|
+
* @default true
|
|
360
|
+
*/
|
|
361
|
+
enabled?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Static text to show in the header title area. When not provided, the
|
|
364
|
+
* title of the current thread will be shown instead.
|
|
365
|
+
*/
|
|
366
|
+
text?: string;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Configuration for an additional custom button on the left side of the header.
|
|
370
|
+
*/
|
|
371
|
+
leftAction?: {
|
|
372
|
+
icon: HeaderIcon;
|
|
373
|
+
onClick: () => void;
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Configuration for an additional custom button on the right side of the header.
|
|
377
|
+
*/
|
|
378
|
+
rightAction?: {
|
|
379
|
+
icon: HeaderIcon;
|
|
380
|
+
onClick: () => void;
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
history?: {
|
|
384
|
+
enabled?: boolean;
|
|
385
|
+
showDelete?: boolean;
|
|
386
|
+
showRename?: boolean;
|
|
387
|
+
};
|
|
388
|
+
startScreen?: {
|
|
389
|
+
/**
|
|
390
|
+
* The greeting text in the new thread view.
|
|
391
|
+
*
|
|
392
|
+
* @default "What can I help with today?"
|
|
393
|
+
*/
|
|
394
|
+
greeting?: string;
|
|
395
|
+
/**
|
|
396
|
+
* A list of starter prompts to show above the composer input when in the new thread view.
|
|
397
|
+
*/
|
|
398
|
+
prompts?: StartScreenPrompt[];
|
|
399
|
+
};
|
|
400
|
+
threadItemActions?: {
|
|
401
|
+
/**
|
|
402
|
+
* Whether or not to show the response feedback buttons (thumbs up / thumbs
|
|
403
|
+
* down) in the response view. When the user clicks on one of the buttons, the
|
|
404
|
+
* feedback will be sent to your server where you can handle it.
|
|
405
|
+
* @default false
|
|
406
|
+
*/
|
|
407
|
+
feedback?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* Whether or not to show the retry button in the response view.
|
|
410
|
+
* When the user retries a message, server events will be sent to handle
|
|
411
|
+
* removing thread items and begin generation.
|
|
412
|
+
* @default false
|
|
413
|
+
*/
|
|
414
|
+
retry?: boolean;
|
|
415
|
+
/**
|
|
416
|
+
* Whether or not to show the share button in the response view.
|
|
417
|
+
* When the user clicks on one of the buttons, the "message.share" event
|
|
418
|
+
* will be emitted with the shared content, item ids, and thread id.
|
|
419
|
+
* @default false
|
|
420
|
+
*/
|
|
421
|
+
share?: boolean;
|
|
422
|
+
};
|
|
423
|
+
composer?: {
|
|
424
|
+
/**
|
|
425
|
+
* The placeholder text to show in the composer input.
|
|
426
|
+
* @default "Message the AI"
|
|
427
|
+
*/
|
|
428
|
+
placeholder?: string;
|
|
429
|
+
attachments?: {
|
|
430
|
+
/**
|
|
431
|
+
* Whether file attachments are enabled in the composer.
|
|
432
|
+
*
|
|
433
|
+
* @default false
|
|
434
|
+
*/
|
|
435
|
+
enabled: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* The maximum size of an attachment in bytes.
|
|
438
|
+
*
|
|
439
|
+
* @default 100 * 1024 * 1024 (100MB)
|
|
440
|
+
*/
|
|
441
|
+
maxSize?: number;
|
|
442
|
+
/**
|
|
443
|
+
* The maximum number of attachments that can be sent in a single message.
|
|
444
|
+
*
|
|
445
|
+
* @default 10
|
|
446
|
+
*/
|
|
447
|
+
maxCount?: number;
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
* The MIME types and extensions that are accepted for file uploads,
|
|
451
|
+
* similar to [`showOpenFilePicker`]. When not specified, all MIME types
|
|
452
|
+
* and extensions are accepted.
|
|
453
|
+
*
|
|
454
|
+
* [`showOpenFilePicker`]:
|
|
455
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker#accept
|
|
456
|
+
*/
|
|
457
|
+
accept?: Record<string, string[]>;
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* When provided a list of tool options, the user will be able to select a tool
|
|
461
|
+
* from a menu in the composer.
|
|
462
|
+
*/
|
|
463
|
+
tools?: ToolOption[];
|
|
464
|
+
/** A list of models that users can choose from before sending a message. */
|
|
465
|
+
models?: ModelOption[];
|
|
466
|
+
/**
|
|
467
|
+
* Slash commands shown when users type `/` at the start of the composer.
|
|
468
|
+
* Command names should not include the leading slash.
|
|
469
|
+
*/
|
|
470
|
+
slashCommands?: ChatKitSlashCommand[];
|
|
471
|
+
};
|
|
472
|
+
/**
|
|
473
|
+
* Disclaimer text to display below the composer. Supports links with markdown formatting.
|
|
474
|
+
*/
|
|
475
|
+
disclaimer?: {
|
|
476
|
+
text: string;
|
|
477
|
+
highContrast?: boolean;
|
|
478
|
+
};
|
|
479
|
+
entities?: {
|
|
480
|
+
/**
|
|
481
|
+
* Returns a list of entities for the input query.
|
|
482
|
+
* Powers tag autocomplete within the composer.
|
|
483
|
+
*/
|
|
484
|
+
onTagSearch?: (query: string) => Promise<Entity[]>;
|
|
485
|
+
onClick?: (entity: Entity) => void;
|
|
486
|
+
onRequestPreview?: (entity: Entity) => Promise<{
|
|
487
|
+
preview: Widgets.BasicRoot | null;
|
|
488
|
+
}>;
|
|
489
|
+
};
|
|
490
|
+
widgets?: {
|
|
491
|
+
onAction?: (action: {
|
|
492
|
+
type: string;
|
|
493
|
+
payload?: Record<string, unknown>;
|
|
494
|
+
}, widgetItem: {
|
|
495
|
+
id: string;
|
|
496
|
+
widget: Widgets.Card | Widgets.ListView;
|
|
497
|
+
}) => Promise<void>;
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export declare type ChatKitPetAnimationMode = 'loop' | 'once';
|
|
502
|
+
|
|
503
|
+
export declare type ChatKitPetAnimationName = 'idle' | 'running-right' | 'running-left' | 'waving' | 'jumping' | 'failed' | 'waiting' | 'running' | 'review';
|
|
504
|
+
|
|
505
|
+
export declare type ChatKitPetBoundsPadding = {
|
|
506
|
+
top: number;
|
|
507
|
+
right: number;
|
|
508
|
+
bottom: number;
|
|
509
|
+
left: number;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
export declare type ChatKitPetCharacter = {
|
|
513
|
+
type: 'sprite-atlas';
|
|
514
|
+
src: string;
|
|
515
|
+
atlas?: ChatKitPetSpriteAtlas;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
export declare type ChatKitPetFrameAnimation = {
|
|
519
|
+
row?: number;
|
|
520
|
+
frames?: number;
|
|
521
|
+
frameDurations?: readonly number[];
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
export declare type ChatKitPetOptions = {
|
|
525
|
+
enabled?: boolean;
|
|
526
|
+
character?: ChatKitPetCharacter;
|
|
527
|
+
position?: ChatKitPetPositionOptions;
|
|
528
|
+
behavior?: 'auto' | 'manual';
|
|
529
|
+
ariaLabel?: string;
|
|
530
|
+
imageRendering?: 'auto' | 'pixelated' | 'crisp-edges';
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
export declare type ChatKitPetPin = 'top-left' | 'top' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
|
|
534
|
+
|
|
535
|
+
export declare type ChatKitPetPositionOptions = {
|
|
536
|
+
pin?: ChatKitPetPin | null;
|
|
537
|
+
draggable?: boolean;
|
|
538
|
+
scale?: number;
|
|
539
|
+
persist?: boolean;
|
|
540
|
+
boundsPadding?: number | Partial<ChatKitPetBoundsPadding>;
|
|
541
|
+
zIndex?: number;
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
export declare type ChatKitPetSpriteAtlas = {
|
|
545
|
+
columns?: number;
|
|
546
|
+
rows?: number;
|
|
547
|
+
cellWidth?: number;
|
|
548
|
+
cellHeight?: number;
|
|
549
|
+
animations?: Partial<Record<ChatKitPetAnimationName, ChatKitPetFrameAnimation>>;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
export declare type ChatKitPromptWorkflow = {
|
|
553
|
+
type: 'prompt_workflow';
|
|
554
|
+
name?: string;
|
|
555
|
+
label?: ChatKitI18nText;
|
|
556
|
+
description?: ChatKitI18nText;
|
|
557
|
+
tags?: string[];
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
export declare type ChatKitQuoteReference = ChatKitReferenceBase & {
|
|
561
|
+
type: 'quote';
|
|
562
|
+
messageId?: string;
|
|
563
|
+
source?: string;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
export declare type ChatKitReference = ChatKitCodeReference | ChatKitQuoteReference | ChatKitImageReference;
|
|
567
|
+
|
|
568
|
+
export declare type ChatKitReferenceBase = {
|
|
569
|
+
id?: string;
|
|
570
|
+
label?: string;
|
|
571
|
+
text: string;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export declare type ChatKitReferenceCompositionMode = 'compose' | 'preserve';
|
|
575
|
+
|
|
576
|
+
export declare type ChatKitRequestContext = {
|
|
577
|
+
/**
|
|
578
|
+
* Request-scoped runtime env overrides.
|
|
579
|
+
* ChatKit forwards this field to LangGraph as `context.env`.
|
|
580
|
+
*/
|
|
581
|
+
env?: Record<string, string>;
|
|
582
|
+
[key: string]: unknown;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
export declare type ChatKitRequestOptions<TState = Record<string, unknown>, TContext extends ChatKitRequestContext = ChatKitRequestContext, TConfig extends Record<string, unknown> = Record<string, unknown>> = {
|
|
586
|
+
/**
|
|
587
|
+
* Custom graph state merged into every submitted message request.
|
|
588
|
+
* The active user input is always written into `state.human.input`.
|
|
589
|
+
*/
|
|
590
|
+
state?: TState;
|
|
591
|
+
/**
|
|
592
|
+
* Additional stream context merged into every submitted message request.
|
|
593
|
+
*
|
|
594
|
+
* Request-scoped runtime env overrides should be placed in `context.env`.
|
|
595
|
+
* Extend `TContext` with any other request-scoped context fields you need.
|
|
596
|
+
*/
|
|
597
|
+
context?: TContext;
|
|
598
|
+
/**
|
|
599
|
+
* Additional LangGraph run config merged into every submitted message request.
|
|
600
|
+
*
|
|
601
|
+
* This is forwarded to the hosted `runs.stream` request as `config`.
|
|
602
|
+
* Use this for LangGraph runtime controls such as tags or configurable values,
|
|
603
|
+
* not request-scoped env overrides.
|
|
604
|
+
*/
|
|
605
|
+
config?: TConfig;
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
export declare type ChatKitSlashCommand = {
|
|
609
|
+
/**
|
|
610
|
+
* Command name without the leading slash.
|
|
611
|
+
* Valid names use lowercase letters, digits, hyphens, and underscores.
|
|
612
|
+
*/
|
|
613
|
+
name: string;
|
|
614
|
+
label?: ChatKitI18nText;
|
|
615
|
+
description?: ChatKitI18nText;
|
|
616
|
+
icon?: string | Record<string, unknown>;
|
|
617
|
+
category?: string;
|
|
618
|
+
aliases?: string[];
|
|
619
|
+
argsHint?: string;
|
|
620
|
+
availability?: ChatKitSlashCommandAvailability;
|
|
621
|
+
kind?: ChatKitSlashCommandKind;
|
|
622
|
+
workflow?: ChatKitPromptWorkflow;
|
|
623
|
+
action: ChatKitSlashCommandAction;
|
|
624
|
+
source?: Record<string, unknown>;
|
|
625
|
+
meta?: Record<string, unknown>;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
export declare type ChatKitSlashCommandAction = {
|
|
629
|
+
type: 'insert_text';
|
|
630
|
+
template: string;
|
|
631
|
+
runtimeCapabilities?: unknown;
|
|
632
|
+
} | {
|
|
633
|
+
type: 'insert_invocation';
|
|
634
|
+
template: string;
|
|
635
|
+
runtimeCapabilities?: unknown;
|
|
636
|
+
} | {
|
|
637
|
+
type: 'submit_prompt';
|
|
638
|
+
template: string;
|
|
639
|
+
runtimeCapabilities?: unknown;
|
|
640
|
+
} | {
|
|
641
|
+
type: 'client_action';
|
|
642
|
+
action: {
|
|
643
|
+
type: string;
|
|
644
|
+
payload?: Record<string, unknown>;
|
|
645
|
+
};
|
|
646
|
+
} | {
|
|
647
|
+
type: 'select_capability';
|
|
648
|
+
capability: ChatKitSlashCommandCapability;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
export declare type ChatKitSlashCommandAvailability = {
|
|
652
|
+
disabled?: boolean;
|
|
653
|
+
reason?: string;
|
|
654
|
+
[key: string]: unknown;
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
export declare type ChatKitSlashCommandCapability = {
|
|
658
|
+
type: 'skill';
|
|
659
|
+
id: string;
|
|
660
|
+
} | {
|
|
661
|
+
type: 'plugin';
|
|
662
|
+
id: string;
|
|
663
|
+
} | {
|
|
664
|
+
type: 'subAgent';
|
|
665
|
+
id: string;
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
export declare type ChatKitSlashCommandExecutionType = 'insert_text' | 'insert_invocation' | 'submit_prompt' | 'client_action' | 'select_capability';
|
|
669
|
+
|
|
670
|
+
export declare type ChatKitSlashCommandKind = 'command' | 'prompt_workflow';
|
|
671
|
+
|
|
672
|
+
export declare type ChatKitTheme = {
|
|
673
|
+
/**
|
|
674
|
+
* The color scheme to use for the ChatKit UI.
|
|
675
|
+
* @default "light"
|
|
676
|
+
*/
|
|
677
|
+
colorScheme?: ColorScheme;
|
|
678
|
+
/**
|
|
679
|
+
* Typography
|
|
680
|
+
*/
|
|
681
|
+
typography?: {
|
|
682
|
+
/**
|
|
683
|
+
* Base font size in pixels.
|
|
684
|
+
* @remarks Allowed range: 14-18
|
|
685
|
+
*/
|
|
686
|
+
baseSize?: 14 | 15 | 16 | 17 | 18;
|
|
687
|
+
fontSources?: FontObject[];
|
|
688
|
+
fontFamily?: string;
|
|
689
|
+
fontFamilyMono?: string;
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* Determines the overall roundness of the ChatKit UI
|
|
693
|
+
*/
|
|
694
|
+
radius?: 'pill' | 'round' | 'soft' | 'sharp';
|
|
695
|
+
/**
|
|
696
|
+
* Determines the overall spacing of the ChatKit UI
|
|
697
|
+
* @default "normal"
|
|
698
|
+
*/
|
|
699
|
+
density?: 'compact' | 'normal' | 'spacious';
|
|
700
|
+
/**
|
|
701
|
+
* Color customization options
|
|
702
|
+
*/
|
|
703
|
+
color?: {
|
|
704
|
+
grayscale?: GrayscaleOptions;
|
|
705
|
+
accent?: AccentColor;
|
|
706
|
+
surface?: SurfaceColors;
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* https://js.langchain.com/docs/how_to/streaming/#event-reference
|
|
712
|
+
*/
|
|
713
|
+
export declare enum ChatMessageEventTypeEnum {
|
|
714
|
+
ON_CONVERSATION_START = "on_conversation_start",
|
|
715
|
+
ON_CONVERSATION_END = "on_conversation_end",
|
|
716
|
+
ON_MESSAGE_START = "on_message_start",
|
|
717
|
+
ON_MESSAGE_END = "on_message_end",
|
|
718
|
+
ON_TOOL_START = "on_tool_start",
|
|
719
|
+
ON_TOOL_END = "on_tool_end",
|
|
720
|
+
ON_TOOL_ERROR = "on_tool_error",
|
|
721
|
+
/**
|
|
722
|
+
* Step message in tool call
|
|
723
|
+
*/
|
|
724
|
+
ON_TOOL_MESSAGE = "on_tool_message",
|
|
725
|
+
ON_AGENT_START = "on_agent_start",
|
|
726
|
+
ON_AGENT_END = "on_agent_end",
|
|
727
|
+
ON_RETRIEVER_START = "on_retriever_start",
|
|
728
|
+
ON_RETRIEVER_END = "on_retriever_end",
|
|
729
|
+
ON_RETRIEVER_ERROR = "on_retriever_error",
|
|
730
|
+
ON_INTERRUPT = "on_interrupt",
|
|
731
|
+
ON_ERROR = "on_error",
|
|
732
|
+
ON_CHAT_EVENT = "on_chat_event",
|
|
733
|
+
ON_CLIENT_EFFECT = "on_client_effect"
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Category of step message: determines the display components of computer use
|
|
738
|
+
*/
|
|
739
|
+
export declare enum ChatMessageStepCategory {
|
|
740
|
+
/**
|
|
741
|
+
* List of items: urls, files, etc.
|
|
742
|
+
*/
|
|
743
|
+
List = "list",
|
|
744
|
+
/**
|
|
745
|
+
* Websearch results
|
|
746
|
+
*/
|
|
747
|
+
WebSearch = "web_search",
|
|
748
|
+
/**
|
|
749
|
+
* Files list
|
|
750
|
+
*/
|
|
751
|
+
Files = "files",
|
|
752
|
+
/**
|
|
753
|
+
* View a file
|
|
754
|
+
*/
|
|
755
|
+
File = "file",
|
|
756
|
+
/**
|
|
757
|
+
* Program Execution
|
|
758
|
+
*/
|
|
759
|
+
Program = "program",
|
|
760
|
+
/**
|
|
761
|
+
* Iframe
|
|
762
|
+
*/
|
|
763
|
+
Iframe = "iframe",
|
|
764
|
+
Memory = "memory",
|
|
765
|
+
Tasks = "tasks",
|
|
766
|
+
/**
|
|
767
|
+
* Knowledges (knowledge base retriever results)
|
|
768
|
+
*/
|
|
769
|
+
Knowledges = "knowledges"
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
export declare enum ChatMessageTypeEnum {
|
|
773
|
+
MESSAGE = "message",
|
|
774
|
+
EVENT = "event"
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
export declare type Checkbox = {
|
|
778
|
+
type: 'Checkbox';
|
|
779
|
+
key?: string;
|
|
780
|
+
id?: string;
|
|
781
|
+
name: string;
|
|
782
|
+
label?: string;
|
|
783
|
+
defaultChecked?: boolean;
|
|
784
|
+
onChangeAction?: ActionConfig;
|
|
785
|
+
disabled?: boolean;
|
|
786
|
+
required?: boolean;
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
export declare function clampPetPosition(position: PetPosition, size: PetSize, viewport: PetViewport, padding: ChatKitPetBoundsPadding): PetPosition;
|
|
790
|
+
|
|
791
|
+
export declare type ClientToolInterrupt<TRequest extends ClientToolRequest = ClientToolRequest> = LangGraphInterrupt<TRequest>;
|
|
792
|
+
|
|
793
|
+
export declare type ClientToolInterruptPayload<TRequest extends ClientToolRequest = ClientToolRequest> = LangGraphInterruptPayload<TRequest>;
|
|
794
|
+
|
|
795
|
+
export declare type ClientToolInterruptTask<TRequest extends ClientToolRequest = ClientToolRequest> = LangGraphInterruptTask<TRequest>;
|
|
796
|
+
|
|
797
|
+
export declare interface ClientToolMessageInput {
|
|
798
|
+
content: unknown;
|
|
799
|
+
name?: string;
|
|
800
|
+
tool_call_id?: string;
|
|
801
|
+
status?: 'success' | 'error';
|
|
802
|
+
artifact?: unknown;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export declare interface ClientToolRequest {
|
|
806
|
+
clientToolCalls: ToolCall[];
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
export declare interface ClientToolResponse {
|
|
810
|
+
toolMessages: ClientToolMessageInput[];
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export declare interface ClientTools {
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export declare type Col = {
|
|
817
|
+
type: 'Col';
|
|
818
|
+
key?: string;
|
|
819
|
+
id?: string;
|
|
820
|
+
} & BoxBaseProps;
|
|
821
|
+
|
|
822
|
+
export declare type ColorScheme = 'light' | 'dark';
|
|
823
|
+
|
|
824
|
+
declare type ControlSize = '3xs' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
825
|
+
|
|
826
|
+
declare type ControlVariant = 'solid' | 'soft' | 'outline' | 'ghost';
|
|
827
|
+
|
|
828
|
+
declare type CustomApiConfig = {
|
|
829
|
+
/**
|
|
830
|
+
* The URL (relative or absolute) of the ChatKit API. The configured endpoint
|
|
831
|
+
* must conform to the specification defined in the ChatKit SDK documentation.
|
|
832
|
+
* The easiest way to get started is by using the ChatKit SDK which will help
|
|
833
|
+
* you define your integration in a declarative way.
|
|
834
|
+
*/
|
|
835
|
+
url: string;
|
|
836
|
+
/**
|
|
837
|
+
* Custom fetch function to use for API requests. This is useful for
|
|
838
|
+
* overriding the default fetch behavior, such as adding custom headers or
|
|
839
|
+
* setting credentials.
|
|
840
|
+
*/
|
|
841
|
+
fetch?: typeof fetch;
|
|
842
|
+
/**
|
|
843
|
+
* The domain key that will be used to verify the registered domain
|
|
844
|
+
* for the integration.
|
|
845
|
+
*/
|
|
846
|
+
domainKey: string;
|
|
847
|
+
/**
|
|
848
|
+
* How attachments will be uploaded to your server. Required when attachments are enabled.
|
|
849
|
+
*/
|
|
850
|
+
uploadStrategy?: FileUploadStrategy;
|
|
851
|
+
/**
|
|
852
|
+
* The base URL for the XpertAI platform hosted API. Used for accessing xpert agents
|
|
853
|
+
* and other platform features.
|
|
854
|
+
*/
|
|
855
|
+
apiUrl: string;
|
|
856
|
+
xpertId?: string;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
export declare type DatePicker = {
|
|
860
|
+
type: 'DatePicker';
|
|
861
|
+
key?: string;
|
|
862
|
+
id?: string;
|
|
863
|
+
name: string;
|
|
864
|
+
onChangeAction?: ActionConfig;
|
|
865
|
+
placeholder?: string;
|
|
866
|
+
defaultValue?: string;
|
|
867
|
+
min?: string;
|
|
868
|
+
max?: string;
|
|
869
|
+
variant?: ControlVariant;
|
|
870
|
+
size?: ControlSize;
|
|
871
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
872
|
+
align?: 'start' | 'center' | 'end';
|
|
873
|
+
pill?: boolean;
|
|
874
|
+
block?: boolean;
|
|
875
|
+
clearable?: boolean;
|
|
876
|
+
disabled?: boolean;
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
export declare const DEFAULT_PET_BOUNDS_PADDING: ChatKitPetBoundsPadding;
|
|
880
|
+
|
|
881
|
+
export declare const DEFAULT_PET_SIZE: {
|
|
882
|
+
width: 192;
|
|
883
|
+
height: 208;
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
export declare const DEFAULT_PET_SPRITESHEET_URL = "/pets/boba/spritesheet.webp";
|
|
887
|
+
|
|
888
|
+
export declare const DEFAULT_PET_STORAGE_KEY = "chatkit:pet:position:v1";
|
|
889
|
+
|
|
890
|
+
export declare type Divider = {
|
|
891
|
+
type: 'Divider';
|
|
892
|
+
key?: string;
|
|
893
|
+
id?: string;
|
|
894
|
+
color?: string | ThemeColor;
|
|
895
|
+
size?: number | string;
|
|
896
|
+
spacing?: number | string;
|
|
897
|
+
flush?: boolean;
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* A structured object representing a referenceable item such as a
|
|
902
|
+
* person, document, or internal business object.
|
|
903
|
+
*/
|
|
904
|
+
export declare type Entity = {
|
|
905
|
+
/**
|
|
906
|
+
* Human-readable name shown in tags, sources, previews, etc.
|
|
907
|
+
* e.g. "Harry Potter", "Claim #A-1023", "Q2 Planning Doc"
|
|
908
|
+
*/
|
|
909
|
+
title: string;
|
|
910
|
+
id: string;
|
|
911
|
+
/**
|
|
912
|
+
* Optional icon to show when rendering the entity.
|
|
913
|
+
*/
|
|
914
|
+
icon?: string;
|
|
915
|
+
/**
|
|
916
|
+
* Whether the entity is interactive can be clicked or previewed.
|
|
917
|
+
*/
|
|
918
|
+
interactive?: boolean;
|
|
919
|
+
/**
|
|
920
|
+
* Optional human-readable group name to group entities by.
|
|
921
|
+
* e.g. "People", "Documents"
|
|
922
|
+
*/
|
|
923
|
+
group?: string;
|
|
924
|
+
/**
|
|
925
|
+
* Optional metadata that will be proxied to the server if this entity is part of
|
|
926
|
+
* a submitted user message (e.g. in tags) or for client entity callbacks (e.g. for
|
|
927
|
+
* click or preview). This is not directly used in ChatKit.js and can contain
|
|
928
|
+
* arbitrary metadata.
|
|
929
|
+
*/
|
|
930
|
+
data?: Record<string, string>;
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
export declare type EventHandler<K extends keyof ChatKitEvents> = (event: ChatKitEvents[K]) => any;
|
|
934
|
+
|
|
935
|
+
export declare type FileUploadStrategy = {
|
|
936
|
+
type: 'two_phase';
|
|
937
|
+
} | {
|
|
938
|
+
type: 'direct';
|
|
939
|
+
uploadUrl: string;
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
export declare type FollowUpBehavior = 'queue' | 'steer';
|
|
943
|
+
|
|
944
|
+
export declare type FontObject = {
|
|
945
|
+
family: string;
|
|
946
|
+
src: string;
|
|
947
|
+
weight?: string | number;
|
|
948
|
+
style?: 'normal' | 'italic' | 'oblique';
|
|
949
|
+
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
950
|
+
unicodeRange?: string;
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
export declare type Form = {
|
|
954
|
+
type: 'Form';
|
|
955
|
+
key?: string;
|
|
956
|
+
id?: string;
|
|
957
|
+
onSubmitAction?: ActionConfig;
|
|
958
|
+
direction?: 'row' | 'col';
|
|
959
|
+
} & BoxBaseProps;
|
|
960
|
+
|
|
961
|
+
export declare function getPinnedPetPosition(pin: ChatKitPetPin, size: PetSize, viewport: PetViewport, padding: ChatKitPetBoundsPadding): PetPosition;
|
|
962
|
+
|
|
963
|
+
export declare type GrayscaleOptions = {
|
|
964
|
+
hue: number;
|
|
965
|
+
tint: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
966
|
+
shade?: -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4;
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
export declare type HeaderIcon = 'sidebar-left' | 'sidebar-right' | 'sidebar-open-left' | 'sidebar-open-right' | 'sidebar-open-left-alt' | 'sidebar-open-right-alt' | 'sidebar-floating-left' | 'sidebar-floating-right' | 'sidebar-floating-open-left' | 'sidebar-floating-open-right' | 'sidebar-collapse-left' | 'sidebar-collapse-right' | 'collapse-left' | 'collapse-right' | 'open-left' | 'open-right' | 'double-chevron-left' | 'double-chevron-right' | 'home' | 'home-alt' | 'back-small' | 'back-large' | 'expand-large' | 'collapse-large' | 'expand-small' | 'collapse-small' | 'star' | 'star-filled' | 'chat-temporary' | 'settings-cog' | 'grid' | 'dots-horizontal' | 'dots-vertical' | 'dots-horizontal-circle' | 'dots-vertical-circle' | 'menu' | 'menu-inverted' | 'hamburger' | 'compose' | 'light-mode' | 'dark-mode' | 'close';
|
|
970
|
+
|
|
971
|
+
export declare const HITL_DECISION_TYPES: readonly ["approve", "edit", "reject", "respond"];
|
|
972
|
+
|
|
973
|
+
export declare interface HITLAction {
|
|
974
|
+
name: string;
|
|
975
|
+
args: Record<string, unknown>;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
export declare interface HITLActionRequest extends HITLAction {
|
|
979
|
+
description?: string;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
export declare interface HITLApproveDecision {
|
|
983
|
+
type: 'approve';
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
export declare type HITLDecision = HITLApproveDecision | HITLEditDecision | HITLRejectDecision | HITLRespondDecision;
|
|
987
|
+
|
|
988
|
+
export declare type HITLDecisionType = (typeof HITL_DECISION_TYPES)[number];
|
|
989
|
+
|
|
990
|
+
export declare interface HITLEditDecision {
|
|
991
|
+
type: 'edit';
|
|
992
|
+
editedAction: HITLAction;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
export declare type HITLInterrupt<TRequest extends HITLRequest = HITLRequest> = LangGraphInterrupt<TRequest>;
|
|
996
|
+
|
|
997
|
+
export declare type HITLInterruptPayload<TRequest extends HITLRequest = HITLRequest> = LangGraphInterruptPayload<TRequest>;
|
|
998
|
+
|
|
999
|
+
export declare type HITLInterruptTask<TRequest extends HITLRequest = HITLRequest> = LangGraphInterruptTask<TRequest>;
|
|
1000
|
+
|
|
1001
|
+
export declare interface HITLRejectDecision {
|
|
1002
|
+
type: 'reject';
|
|
1003
|
+
message?: string;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
export declare interface HITLRequest {
|
|
1007
|
+
actionRequests: HITLActionRequest[];
|
|
1008
|
+
reviewConfigs: HITLReviewConfig[];
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
export declare interface HITLRespondDecision {
|
|
1012
|
+
type: 'respond';
|
|
1013
|
+
message: string;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
export declare interface HITLResponse {
|
|
1017
|
+
decisions: HITLDecision[];
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
export declare interface HITLReviewConfig {
|
|
1021
|
+
actionName: string;
|
|
1022
|
+
allowedDecisions: HITLDecisionType[];
|
|
1023
|
+
argsSchema?: Record<string, unknown>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
declare type HostedApiConfig = {
|
|
1027
|
+
/**
|
|
1028
|
+
* Function to get a client token or refresh if the current token is expired.
|
|
1029
|
+
* Returning an object also allows ChatKit to send the active organization id
|
|
1030
|
+
* as the `organization-id` header on hosted API requests.
|
|
1031
|
+
*/
|
|
1032
|
+
getClientSecret: (currentClientSecret: string | null) => Promise<ChatKitClientSecretResult>;
|
|
1033
|
+
/**
|
|
1034
|
+
* The base URL for the XpertAI platform hosted API. Used for accessing xpert agents
|
|
1035
|
+
* and other platform features.
|
|
1036
|
+
*/
|
|
1037
|
+
apiUrl: string;
|
|
1038
|
+
xpertId?: string;
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
export declare type I18nObject = {
|
|
1042
|
+
en_US?: string;
|
|
1043
|
+
en?: string;
|
|
1044
|
+
'en-US'?: string;
|
|
1045
|
+
zh_Hans?: string;
|
|
1046
|
+
zh_CN?: string;
|
|
1047
|
+
zh?: string;
|
|
1048
|
+
'zh-Hans'?: string;
|
|
1049
|
+
'zh-CN'?: string;
|
|
1050
|
+
[locale: string]: string | undefined;
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
export declare type Icon = {
|
|
1054
|
+
type: 'Icon';
|
|
1055
|
+
key?: string;
|
|
1056
|
+
id?: string;
|
|
1057
|
+
name: WidgetIcon;
|
|
1058
|
+
color?: string | ThemeColor;
|
|
1059
|
+
size?: IconSize;
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
export declare type IconName = 'agent' | 'analytics' | 'atom' | 'batch' | 'bolt' | 'book-open' | 'book-closed' | 'bug' | 'calendar' | 'chart' | 'circle-question' | 'compass' | 'cube' | 'globe' | 'keys' | 'lab' | 'images' | 'lifesaver' | 'lightbulb' | 'map-pin' | 'name' | 'notebook' | 'notebook-pencil' | 'page-blank' | 'profile' | 'profile-card' | 'search' | 'sparkle' | 'sparkle-double' | 'square-code' | 'square-image' | 'square-text' | 'suitcase' | 'write' | 'write-alt' | 'write-alt2';
|
|
1063
|
+
|
|
1064
|
+
declare type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
1065
|
+
|
|
1066
|
+
declare type Image_2 = {
|
|
1067
|
+
type: 'Image';
|
|
1068
|
+
key?: string;
|
|
1069
|
+
id?: string;
|
|
1070
|
+
src: string;
|
|
1071
|
+
alt?: string;
|
|
1072
|
+
frame?: boolean;
|
|
1073
|
+
fit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none';
|
|
1074
|
+
position?: 'top left' | 'top' | 'top right' | 'left' | 'center' | 'right' | 'bottom left' | 'bottom' | 'bottom right';
|
|
1075
|
+
flush?: boolean;
|
|
1076
|
+
} & BlockProps;
|
|
1077
|
+
export { Image_2 as Image }
|
|
1078
|
+
|
|
1079
|
+
export declare type ImageDetail = 'auto' | 'low' | 'high';
|
|
1080
|
+
|
|
1081
|
+
export declare type Input = {
|
|
1082
|
+
type: 'Input';
|
|
1083
|
+
key?: string;
|
|
1084
|
+
id?: string;
|
|
1085
|
+
name: string;
|
|
1086
|
+
inputType?: 'number' | 'email' | 'text' | 'password' | 'tel' | 'url';
|
|
1087
|
+
defaultValue?: string;
|
|
1088
|
+
required?: boolean;
|
|
1089
|
+
pattern?: string;
|
|
1090
|
+
placeholder?: string;
|
|
1091
|
+
allowAutofillExtensions?: boolean;
|
|
1092
|
+
autoSelect?: boolean;
|
|
1093
|
+
autoFocus?: boolean;
|
|
1094
|
+
disabled?: boolean;
|
|
1095
|
+
variant?: 'soft' | 'outline';
|
|
1096
|
+
size?: ControlSize;
|
|
1097
|
+
gutterSize?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1098
|
+
pill?: boolean;
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* When an interrupt occurs during task execution, the system generates an InterruptPayload.
|
|
1103
|
+
*
|
|
1104
|
+
* Ordinary tool-call interrupts use `toolCalls`; ChatKit client-tool middleware
|
|
1105
|
+
* uses `clientToolCalls` so the UI can route those calls to the client.
|
|
1106
|
+
* Human-in-the-loop interrupts use `actionRequests` and `reviewConfigs` so
|
|
1107
|
+
* ChatKit can collect reviewer decisions and resume with `{ decisions }`.
|
|
1108
|
+
```json
|
|
1109
|
+
{
|
|
1110
|
+
"type": "event",
|
|
1111
|
+
"event": "on_interrupt",
|
|
1112
|
+
"data": {
|
|
1113
|
+
"tasks": [
|
|
1114
|
+
{
|
|
1115
|
+
"id": "9c4d2ac5-8808-5b6f-855c-4d48aa3d77a7",
|
|
1116
|
+
"name": "Middleware_wPzR2bIXqE_after_model",
|
|
1117
|
+
"path": ["__pregel_pull", "Middleware_wPzR2bIXqE_after_model"],
|
|
1118
|
+
"interrupts": [
|
|
1119
|
+
{
|
|
1120
|
+
"id": "b42f7887d65e57ed11cf08b8927763db",
|
|
1121
|
+
"value": {
|
|
1122
|
+
"toolCalls": [
|
|
1123
|
+
{
|
|
1124
|
+
"name": "getUserStation",
|
|
1125
|
+
"args": {
|
|
1126
|
+
"input": "Query the site selected by the user"
|
|
1127
|
+
},
|
|
1128
|
+
"id": "call_00_swcaUjIaACXOHHaZyNmQB3Vm",
|
|
1129
|
+
"type": "tool_call"
|
|
1130
|
+
}
|
|
1131
|
+
]
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
]
|
|
1135
|
+
}
|
|
1136
|
+
]
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
```
|
|
1140
|
+
*/
|
|
1141
|
+
export declare interface InterruptPayload extends LangGraphInterruptPayload<InterruptRequest> {
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
export declare type InterruptRequest = ToolCallRequest | ClientToolRequest | HITLRequest;
|
|
1145
|
+
|
|
1146
|
+
export declare function isClientToolInterrupt(value: unknown): value is ClientToolInterrupt;
|
|
1147
|
+
|
|
1148
|
+
export declare function isClientToolInterruptPayload(value: unknown): value is ClientToolInterruptPayload;
|
|
1149
|
+
|
|
1150
|
+
export declare function isClientToolInterruptTask(value: unknown): value is ClientToolInterruptTask;
|
|
1151
|
+
|
|
1152
|
+
export declare function isClientToolRequest(value: unknown): value is ClientToolRequest;
|
|
1153
|
+
|
|
1154
|
+
export declare function isHITLDecisionType(value: unknown): value is HITLDecisionType;
|
|
1155
|
+
|
|
1156
|
+
export declare function isHITLInterrupt(value: unknown): value is HITLInterrupt;
|
|
1157
|
+
|
|
1158
|
+
export declare function isHITLInterruptPayload(value: unknown): value is HITLInterruptPayload;
|
|
1159
|
+
|
|
1160
|
+
export declare function isHITLInterruptTask(value: unknown): value is HITLInterruptTask;
|
|
1161
|
+
|
|
1162
|
+
export declare function isHITLRequest(value: unknown): value is HITLRequest;
|
|
1163
|
+
|
|
1164
|
+
export declare function isInterruptRequest(value: unknown): value is InterruptRequest;
|
|
1165
|
+
|
|
1166
|
+
export declare function isLangGraphInterrupt(value: unknown): value is LangGraphInterrupt;
|
|
1167
|
+
|
|
1168
|
+
export declare function isLangGraphInterruptPayload(value: unknown): value is LangGraphInterruptPayload;
|
|
1169
|
+
|
|
1170
|
+
export declare function isLangGraphInterruptTask(value: unknown): value is LangGraphInterruptTask;
|
|
1171
|
+
|
|
1172
|
+
export declare function isToolCallInterrupt(value: unknown): value is ToolCallInterrupt;
|
|
1173
|
+
|
|
1174
|
+
export declare function isToolCallInterruptPayload(value: unknown): value is ToolCallInterruptPayload;
|
|
1175
|
+
|
|
1176
|
+
export declare function isToolCallInterruptTask(value: unknown): value is ToolCallInterruptTask;
|
|
1177
|
+
|
|
1178
|
+
export declare function isToolCallRequest(value: unknown): value is ToolCallRequest;
|
|
1179
|
+
|
|
1180
|
+
declare type Justification = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' | 'stretch';
|
|
1181
|
+
|
|
1182
|
+
export declare type Label = {
|
|
1183
|
+
type: 'Label';
|
|
1184
|
+
key?: string;
|
|
1185
|
+
id?: string;
|
|
1186
|
+
value: string;
|
|
1187
|
+
fieldName: string;
|
|
1188
|
+
size?: TextSize;
|
|
1189
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
1190
|
+
textAlign?: TextAlign;
|
|
1191
|
+
color?: string | ThemeColor;
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
export declare interface LangGraphInterrupt<TValue = unknown> {
|
|
1195
|
+
id: string;
|
|
1196
|
+
value: TValue;
|
|
1197
|
+
when?: string;
|
|
1198
|
+
resumable?: boolean;
|
|
1199
|
+
ns?: string[];
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
export declare interface LangGraphInterruptPayload<TValue = unknown> {
|
|
1203
|
+
tasks: Array<LangGraphInterruptTask<TValue>>;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
export declare interface LangGraphInterruptTask<TValue = unknown> {
|
|
1207
|
+
id: string;
|
|
1208
|
+
name: string;
|
|
1209
|
+
path: Array<string | number>;
|
|
1210
|
+
interrupts: Array<LangGraphInterrupt<TValue>>;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
export declare type ListView = {
|
|
1214
|
+
type: 'ListView';
|
|
1215
|
+
key?: string;
|
|
1216
|
+
id?: string;
|
|
1217
|
+
children: ListViewItem[];
|
|
1218
|
+
limit?: number | 'auto';
|
|
1219
|
+
status?: WidgetStatus;
|
|
1220
|
+
theme?: 'light' | 'dark';
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
export declare type ListViewItem = {
|
|
1224
|
+
type: 'ListViewItem';
|
|
1225
|
+
key?: string;
|
|
1226
|
+
id?: string;
|
|
1227
|
+
children: WidgetComponent[];
|
|
1228
|
+
onClickAction?: ActionConfig;
|
|
1229
|
+
gap?: number | string;
|
|
1230
|
+
align?: Alignment;
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
export declare type LocalizedText = string | I18nObject;
|
|
1234
|
+
|
|
1235
|
+
export declare type Markdown = {
|
|
1236
|
+
type: 'Markdown';
|
|
1237
|
+
key?: string;
|
|
1238
|
+
id?: string;
|
|
1239
|
+
value: string;
|
|
1240
|
+
streaming?: boolean;
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
export declare function mergePetSpriteAtlas(override?: ChatKitPetSpriteAtlas): PetSpriteAtlasDefinition;
|
|
1244
|
+
|
|
1245
|
+
export declare type MessageContentImageUrl = {
|
|
1246
|
+
type: 'image_url';
|
|
1247
|
+
image_url: string | {
|
|
1248
|
+
url: string;
|
|
1249
|
+
detail?: ImageDetail;
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
|
|
1253
|
+
export declare type MessageContentText = {
|
|
1254
|
+
type: 'text';
|
|
1255
|
+
text: string;
|
|
1256
|
+
};
|
|
1257
|
+
|
|
1258
|
+
export declare type ModelOption = {
|
|
1259
|
+
/** Identifier used when submitting a message. */
|
|
1260
|
+
id: string;
|
|
1261
|
+
/** Label displayed in the model picker. */
|
|
1262
|
+
label: string;
|
|
1263
|
+
/** Optional helper text shown with the option. */
|
|
1264
|
+
description?: string;
|
|
1265
|
+
/** When true the option is visible but cannot be selected. */
|
|
1266
|
+
disabled?: boolean;
|
|
1267
|
+
/** Determines if the model should be the default selected option. */
|
|
1268
|
+
default?: boolean;
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
export declare function normalizeBoundsPadding(value?: number | Partial<ChatKitPetBoundsPadding>): ChatKitPetBoundsPadding;
|
|
1272
|
+
|
|
1273
|
+
export declare type NormalizedPetOptions = {
|
|
1274
|
+
character: ChatKitPetCharacter;
|
|
1275
|
+
position: Required<Pick<NonNullable<ChatKitPetOptions['position']>, 'draggable' | 'persist' | 'scale' | 'zIndex'>> & Pick<NonNullable<ChatKitPetOptions['position']>, 'pin' | 'boundsPadding'>;
|
|
1276
|
+
behavior: NonNullable<ChatKitPetOptions['behavior']>;
|
|
1277
|
+
ariaLabel: string;
|
|
1278
|
+
imageRendering: NonNullable<ChatKitPetOptions['imageRendering']>;
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
export declare function normalizeHITLRequest(value: unknown): HITLRequest | null;
|
|
1282
|
+
|
|
1283
|
+
export declare function normalizePetOptions(pet: ChatKitOptions['pet'] | null): NormalizedPetOptions | null;
|
|
1284
|
+
|
|
1285
|
+
export declare function normalizeRequestLanguage(locale?: string | null): string | undefined;
|
|
1286
|
+
|
|
1287
|
+
export declare const PET_ANIMATION_NAMES: readonly ["idle", "running-right", "running-left", "waving", "jumping", "failed", "waiting", "running", "review"];
|
|
1288
|
+
|
|
1289
|
+
export declare type PetFrameAnimationDefinition = {
|
|
1290
|
+
row: number;
|
|
1291
|
+
frames: number;
|
|
1292
|
+
frameDurations: readonly number[];
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
export declare type PetPosition = {
|
|
1296
|
+
x: number;
|
|
1297
|
+
y: number;
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
export declare type PetSize = {
|
|
1301
|
+
width: number;
|
|
1302
|
+
height: number;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
export declare const petSpriteAtlas: {
|
|
1306
|
+
readonly columns: 8;
|
|
1307
|
+
readonly rows: 9;
|
|
1308
|
+
readonly cellWidth: 192;
|
|
1309
|
+
readonly cellHeight: 208;
|
|
1310
|
+
readonly animations: {
|
|
1311
|
+
readonly idle: {
|
|
1312
|
+
readonly row: 0;
|
|
1313
|
+
readonly frames: 6;
|
|
1314
|
+
readonly frameDurations: readonly [280, 110, 110, 140, 140, 320];
|
|
1315
|
+
};
|
|
1316
|
+
readonly 'running-right': {
|
|
1317
|
+
readonly row: 1;
|
|
1318
|
+
readonly frames: 8;
|
|
1319
|
+
readonly frameDurations: readonly [120, 120, 120, 120, 120, 120, 120, 220];
|
|
1320
|
+
};
|
|
1321
|
+
readonly 'running-left': {
|
|
1322
|
+
readonly row: 2;
|
|
1323
|
+
readonly frames: 8;
|
|
1324
|
+
readonly frameDurations: readonly [120, 120, 120, 120, 120, 120, 120, 220];
|
|
1325
|
+
};
|
|
1326
|
+
readonly waving: {
|
|
1327
|
+
readonly row: 3;
|
|
1328
|
+
readonly frames: 4;
|
|
1329
|
+
readonly frameDurations: readonly [140, 140, 140, 280];
|
|
1330
|
+
};
|
|
1331
|
+
readonly jumping: {
|
|
1332
|
+
readonly row: 4;
|
|
1333
|
+
readonly frames: 5;
|
|
1334
|
+
readonly frameDurations: readonly [140, 140, 140, 140, 280];
|
|
1335
|
+
};
|
|
1336
|
+
readonly failed: {
|
|
1337
|
+
readonly row: 5;
|
|
1338
|
+
readonly frames: 8;
|
|
1339
|
+
readonly frameDurations: readonly [140, 140, 140, 140, 140, 140, 140, 240];
|
|
1340
|
+
};
|
|
1341
|
+
readonly waiting: {
|
|
1342
|
+
readonly row: 6;
|
|
1343
|
+
readonly frames: 6;
|
|
1344
|
+
readonly frameDurations: readonly [150, 150, 150, 150, 150, 260];
|
|
1345
|
+
};
|
|
1346
|
+
readonly running: {
|
|
1347
|
+
readonly row: 7;
|
|
1348
|
+
readonly frames: 6;
|
|
1349
|
+
readonly frameDurations: readonly [120, 120, 120, 120, 120, 220];
|
|
1350
|
+
};
|
|
1351
|
+
readonly review: {
|
|
1352
|
+
readonly row: 8;
|
|
1353
|
+
readonly frames: 6;
|
|
1354
|
+
readonly frameDurations: readonly [150, 150, 150, 150, 150, 280];
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
export declare type PetSpriteAtlasDefinition = {
|
|
1360
|
+
columns: number;
|
|
1361
|
+
rows: number;
|
|
1362
|
+
cellWidth: number;
|
|
1363
|
+
cellHeight: number;
|
|
1364
|
+
animations: Record<ChatKitPetAnimationName, PetFrameAnimationDefinition>;
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
export declare type PetViewport = {
|
|
1368
|
+
width: number;
|
|
1369
|
+
height: number;
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
export declare type RadioGroup = {
|
|
1373
|
+
type: 'RadioGroup';
|
|
1374
|
+
key?: string;
|
|
1375
|
+
id?: string;
|
|
1376
|
+
name: string;
|
|
1377
|
+
options?: {
|
|
1378
|
+
label: string;
|
|
1379
|
+
value: string;
|
|
1380
|
+
disabled?: boolean;
|
|
1381
|
+
}[];
|
|
1382
|
+
ariaLabel?: string;
|
|
1383
|
+
onChangeAction?: ActionConfig;
|
|
1384
|
+
defaultValue?: string;
|
|
1385
|
+
direction?: 'row' | 'col';
|
|
1386
|
+
disabled?: boolean;
|
|
1387
|
+
required?: boolean;
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
declare type RadiusValue = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'full' | '100%' | 'none';
|
|
1391
|
+
|
|
1392
|
+
export declare const REQUEST_USER_INPUT_RESULT_PURPOSE_IMPLEMENTATION_CONFIRMATION = "implementation_confirmation";
|
|
1393
|
+
|
|
1394
|
+
export declare const REQUEST_USER_INPUT_RESULT_PURPOSE_PLAN_CLARIFICATION = "plan_clarification";
|
|
1395
|
+
|
|
1396
|
+
export declare const REQUEST_USER_INPUT_RESULT_TYPE = "request_user_input_result";
|
|
1397
|
+
|
|
1398
|
+
export declare const REQUEST_USER_INPUT_TOOL_NAME = "request_user_input";
|
|
1399
|
+
|
|
1400
|
+
export declare interface RequestUserInputAnswer {
|
|
1401
|
+
id: string;
|
|
1402
|
+
question: string;
|
|
1403
|
+
value: string;
|
|
1404
|
+
type: RequestUserInputAnswerType;
|
|
1405
|
+
label?: string;
|
|
1406
|
+
description?: string;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
export declare type RequestUserInputAnswerType = 'option' | 'other';
|
|
1410
|
+
|
|
1411
|
+
export declare interface RequestUserInputOption {
|
|
1412
|
+
label: string;
|
|
1413
|
+
description: string;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
export declare interface RequestUserInputParams {
|
|
1417
|
+
questions: RequestUserInputQuestion[];
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
export declare interface RequestUserInputQuestion {
|
|
1421
|
+
id: string;
|
|
1422
|
+
header: string;
|
|
1423
|
+
question: string;
|
|
1424
|
+
options: RequestUserInputOption[];
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
export declare interface RequestUserInputResult {
|
|
1428
|
+
type: RequestUserInputResultType;
|
|
1429
|
+
purpose: RequestUserInputResultPurpose;
|
|
1430
|
+
answers: RequestUserInputAnswer[];
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
export declare type RequestUserInputResultPurpose = typeof REQUEST_USER_INPUT_RESULT_PURPOSE_PLAN_CLARIFICATION | typeof REQUEST_USER_INPUT_RESULT_PURPOSE_IMPLEMENTATION_CONFIRMATION;
|
|
1434
|
+
|
|
1435
|
+
export declare type RequestUserInputResultType = typeof REQUEST_USER_INPUT_RESULT_TYPE;
|
|
1436
|
+
|
|
1437
|
+
export declare type RequestUserInputToolArgs = RequestUserInputParams;
|
|
1438
|
+
|
|
1439
|
+
export declare type RequestUserInputToolCall = ToolCall & {
|
|
1440
|
+
name: RequestUserInputToolName;
|
|
1441
|
+
args: RequestUserInputToolArgs;
|
|
1442
|
+
id: string;
|
|
1443
|
+
type?: 'tool_call';
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
export declare type RequestUserInputToolName = typeof REQUEST_USER_INPUT_TOOL_NAME;
|
|
1447
|
+
|
|
1448
|
+
export declare type ResolvedPetCharacter = {
|
|
1449
|
+
kind: 'atlas';
|
|
1450
|
+
src: string;
|
|
1451
|
+
atlas: PetSpriteAtlasDefinition;
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
export declare function resolveLocalizedText(value: unknown, language?: string): string | null;
|
|
1455
|
+
|
|
1456
|
+
export declare function resolvePetCharacter(character: ChatKitPetCharacter): ResolvedPetCharacter | null;
|
|
1457
|
+
|
|
1458
|
+
export declare type Row = {
|
|
1459
|
+
type: 'Row';
|
|
1460
|
+
key?: string;
|
|
1461
|
+
id?: string;
|
|
1462
|
+
} & BoxBaseProps;
|
|
1463
|
+
|
|
1464
|
+
export declare type RuntimeCapabilitiesSelection = RuntimeCapabilitiesSelectionSet & {
|
|
1465
|
+
mode: 'allowlist';
|
|
1466
|
+
recommended?: RuntimeCapabilitiesSelectionSet;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
export declare type RuntimeCapabilitiesSelectionSet = {
|
|
1470
|
+
skills: {
|
|
1471
|
+
workspaceId?: string;
|
|
1472
|
+
ids: string[];
|
|
1473
|
+
};
|
|
1474
|
+
plugins: {
|
|
1475
|
+
nodeKeys: string[];
|
|
1476
|
+
};
|
|
1477
|
+
subAgents?: {
|
|
1478
|
+
nodeKeys: string[];
|
|
1479
|
+
};
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1482
|
+
export declare type Select = {
|
|
1483
|
+
type: 'Select';
|
|
1484
|
+
key?: string;
|
|
1485
|
+
id?: string;
|
|
1486
|
+
name: string;
|
|
1487
|
+
options: {
|
|
1488
|
+
value: string;
|
|
1489
|
+
label: string;
|
|
1490
|
+
}[];
|
|
1491
|
+
onChangeAction?: ActionConfig;
|
|
1492
|
+
placeholder?: string;
|
|
1493
|
+
defaultValue?: string;
|
|
1494
|
+
variant?: ControlVariant;
|
|
1495
|
+
size?: ControlSize;
|
|
1496
|
+
pill?: boolean;
|
|
1497
|
+
block?: boolean;
|
|
1498
|
+
clearable?: boolean;
|
|
1499
|
+
disabled?: boolean;
|
|
1500
|
+
};
|
|
1501
|
+
|
|
1502
|
+
export declare type SendUserMessageParams = {
|
|
1503
|
+
text?: string;
|
|
1504
|
+
content?: UserMessageContent[];
|
|
1505
|
+
state?: Record<string, unknown>;
|
|
1506
|
+
reply?: string;
|
|
1507
|
+
attachments?: Attachment[];
|
|
1508
|
+
newThread?: boolean;
|
|
1509
|
+
references?: ChatKitReference[];
|
|
1510
|
+
referenceComposition?: ChatKitReferenceCompositionMode;
|
|
1511
|
+
toolChoice?: ToolChoice;
|
|
1512
|
+
model?: string;
|
|
1513
|
+
planMode?: boolean;
|
|
1514
|
+
runtimeCapabilities?: RuntimeCapabilitiesSelection;
|
|
1515
|
+
trigger?: WorkflowTriggerParams;
|
|
1516
|
+
followUpMode?: 'default' | FollowUpBehavior;
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
export declare type Spacer = {
|
|
1520
|
+
type: 'Spacer';
|
|
1521
|
+
key?: string;
|
|
1522
|
+
id?: string;
|
|
1523
|
+
minSize?: number | string;
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
declare type Spacing = {
|
|
1527
|
+
top?: number | string;
|
|
1528
|
+
right?: number | string;
|
|
1529
|
+
bottom?: number | string;
|
|
1530
|
+
left?: number | string;
|
|
1531
|
+
x?: number | string;
|
|
1532
|
+
y?: number | string;
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
export declare type StartScreenPrompt = {
|
|
1536
|
+
label: string;
|
|
1537
|
+
prompt: string;
|
|
1538
|
+
icon?: IconName;
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1541
|
+
export declare const STATE_VARIABLE_HUMAN = "human";
|
|
1542
|
+
|
|
1543
|
+
/**
|
|
1544
|
+
* All locales that are accepted by ChatKit without falling back to English.
|
|
1545
|
+
* Includes language codes that are resolved by ChatKit to a translated locale.
|
|
1546
|
+
*/
|
|
1547
|
+
export declare type SupportedLocale = TranslatedLocale | 'bg' | 'bn' | 'bs' | 'ca' | 'cs' | 'da' | 'de' | 'el' | 'es' | 'et' | 'fi' | 'fr' | 'gu' | 'hi' | 'hr' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kn' | 'ko' | 'lv' | 'mk' | 'mr' | 'ms' | 'my' | 'nb' | 'nl' | 'pl' | 'pt' | 'ro' | 'ru' | 'sk' | 'sl' | 'so' | 'sq' | 'sr' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tr' | 'uk' | 'vi' | 'zh' | 'zh-Hans' | 'zh-CN' | 'zh-Hant' | 'en';
|
|
1548
|
+
|
|
1549
|
+
export declare type SurfaceColors = {
|
|
1550
|
+
background: string;
|
|
1551
|
+
foreground: string;
|
|
1552
|
+
};
|
|
1553
|
+
|
|
1554
|
+
/**
|
|
1555
|
+
* Data type for chat event message
|
|
1556
|
+
*/
|
|
1557
|
+
export declare type TChatEventMessage = {
|
|
1558
|
+
type?: string;
|
|
1559
|
+
title?: string;
|
|
1560
|
+
message?: string;
|
|
1561
|
+
status?: 'success' | 'fail' | 'running';
|
|
1562
|
+
created_date?: Date | string;
|
|
1563
|
+
end_date?: Date | string;
|
|
1564
|
+
error?: string;
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Step message type, in canvas and ai message.
|
|
1569
|
+
*/
|
|
1570
|
+
export declare type TChatMessageStep<T = any> = TMessageComponent<TMessageComponentStep<T>>;
|
|
1571
|
+
|
|
1572
|
+
export declare type TChatRequest = {
|
|
1573
|
+
/**
|
|
1574
|
+
* The human input, include parameters
|
|
1575
|
+
*/
|
|
1576
|
+
input: TChatRequestHuman;
|
|
1577
|
+
/**
|
|
1578
|
+
* Custom graph state
|
|
1579
|
+
*/
|
|
1580
|
+
state?: TXpertChatState;
|
|
1581
|
+
agentKey?: string;
|
|
1582
|
+
projectId?: string;
|
|
1583
|
+
conversationId?: string;
|
|
1584
|
+
environmentId?: string;
|
|
1585
|
+
id?: string;
|
|
1586
|
+
executionId?: string;
|
|
1587
|
+
confirm?: boolean;
|
|
1588
|
+
command?: TInterruptCommand;
|
|
1589
|
+
retry?: boolean;
|
|
1590
|
+
followUpMode?: FollowUpBehavior;
|
|
1591
|
+
/**
|
|
1592
|
+
* PRO: Sandbox Environment Id
|
|
1593
|
+
* PRO: @description Sandbox environment ID to force using the specified container.
|
|
1594
|
+
*/
|
|
1595
|
+
sandboxEnvironmentId?: string;
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* Human input message, include parameters and attachments
|
|
1600
|
+
*/
|
|
1601
|
+
export declare type TChatRequestHuman = {
|
|
1602
|
+
input?: string;
|
|
1603
|
+
files?: Partial<File>[];
|
|
1604
|
+
references?: ChatKitReference[];
|
|
1605
|
+
referenceComposition?: ChatKitReferenceCompositionMode;
|
|
1606
|
+
planMode?: boolean;
|
|
1607
|
+
runtimeCapabilities?: RuntimeCapabilitiesSelection;
|
|
1608
|
+
commandSource?: ChatKitCommandSource;
|
|
1609
|
+
[key: string]: unknown;
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Data type for client effect message
|
|
1614
|
+
*/
|
|
1615
|
+
export declare type TClientEeffectMessage = {
|
|
1616
|
+
name: string;
|
|
1617
|
+
args: Record<string, unknown>;
|
|
1618
|
+
tool_call_id?: string;
|
|
1619
|
+
agentKey?: string;
|
|
1620
|
+
created_date?: Date | string;
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
declare type TextAlign = 'start' | 'center' | 'end';
|
|
1624
|
+
|
|
1625
|
+
export declare type Textarea = {
|
|
1626
|
+
type: 'Textarea';
|
|
1627
|
+
key?: string;
|
|
1628
|
+
id?: string;
|
|
1629
|
+
name: string;
|
|
1630
|
+
defaultValue?: string;
|
|
1631
|
+
required?: boolean;
|
|
1632
|
+
pattern?: string;
|
|
1633
|
+
placeholder?: string;
|
|
1634
|
+
autoSelect?: boolean;
|
|
1635
|
+
autoFocus?: boolean;
|
|
1636
|
+
disabled?: boolean;
|
|
1637
|
+
variant?: 'soft' | 'outline';
|
|
1638
|
+
size?: ControlSize;
|
|
1639
|
+
gutterSize?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1640
|
+
rows?: number;
|
|
1641
|
+
autoResize?: boolean;
|
|
1642
|
+
maxRows?: number;
|
|
1643
|
+
allowAutofillExtensions?: boolean;
|
|
1644
|
+
};
|
|
1645
|
+
|
|
1646
|
+
export declare type TextComponent = {
|
|
1647
|
+
type: 'Text';
|
|
1648
|
+
key?: string;
|
|
1649
|
+
id?: string;
|
|
1650
|
+
value: string;
|
|
1651
|
+
streaming?: boolean;
|
|
1652
|
+
italic?: boolean;
|
|
1653
|
+
lineThrough?: boolean;
|
|
1654
|
+
width?: number | string;
|
|
1655
|
+
size?: TextSize;
|
|
1656
|
+
minLines?: number;
|
|
1657
|
+
editable?: false | {
|
|
1658
|
+
name: string;
|
|
1659
|
+
autoFocus?: boolean;
|
|
1660
|
+
autoSelect?: boolean;
|
|
1661
|
+
autoComplete?: string;
|
|
1662
|
+
allowAutofillExtensions?: boolean;
|
|
1663
|
+
pattern?: string;
|
|
1664
|
+
placeholder?: string;
|
|
1665
|
+
required?: boolean;
|
|
1666
|
+
};
|
|
1667
|
+
} & BaseTextProps;
|
|
1668
|
+
|
|
1669
|
+
declare type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1670
|
+
|
|
1671
|
+
export declare type TFollowUpConsumedEvent = TChatEventMessage & {
|
|
1672
|
+
type: typeof CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
|
|
1673
|
+
mode: 'queue' | 'steer';
|
|
1674
|
+
messageIds: string[];
|
|
1675
|
+
clientMessageIds?: string[];
|
|
1676
|
+
executionId?: string | null;
|
|
1677
|
+
visibleAt?: string | null;
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
declare type ThemeColor = {
|
|
1681
|
+
dark: string;
|
|
1682
|
+
light: string;
|
|
1683
|
+
};
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* Command to resume with streaming after human decision
|
|
1687
|
+
*/
|
|
1688
|
+
export declare type TInterruptCommand = {
|
|
1689
|
+
resume?: any;
|
|
1690
|
+
update?: any;
|
|
1691
|
+
toolCalls?: ToolCall[];
|
|
1692
|
+
agentKey?: string;
|
|
1693
|
+
};
|
|
1694
|
+
|
|
1695
|
+
export declare type Title = {
|
|
1696
|
+
type: 'Title';
|
|
1697
|
+
key?: string;
|
|
1698
|
+
id?: string;
|
|
1699
|
+
size?: TitleSize;
|
|
1700
|
+
} & BaseTextProps;
|
|
1701
|
+
|
|
1702
|
+
declare type TitleSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Defines the data type of the sub-message of `component` type in the message `content` {@link MessageContentComplex}
|
|
1706
|
+
*/
|
|
1707
|
+
export declare type TMessageComponent<T extends object = object> = T & {
|
|
1708
|
+
id?: string;
|
|
1709
|
+
category: 'Dashboard' | 'Computer' | 'Tool';
|
|
1710
|
+
type?: string;
|
|
1711
|
+
created_date?: Date | string;
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
export declare type TMessageComponentIframe = {
|
|
1715
|
+
type: 'iframe';
|
|
1716
|
+
title: string;
|
|
1717
|
+
url?: string;
|
|
1718
|
+
data?: {
|
|
1719
|
+
url?: string;
|
|
1720
|
+
};
|
|
1721
|
+
};
|
|
1722
|
+
|
|
1723
|
+
export declare type TMessageComponentStep<T = unknown> = {
|
|
1724
|
+
type: ChatMessageStepCategory;
|
|
1725
|
+
toolset: string;
|
|
1726
|
+
toolset_id: string;
|
|
1727
|
+
tool?: string;
|
|
1728
|
+
title: string;
|
|
1729
|
+
message: string;
|
|
1730
|
+
status: 'success' | 'fail' | 'running';
|
|
1731
|
+
created_date: Date | string;
|
|
1732
|
+
end_date: Date | string;
|
|
1733
|
+
error?: string;
|
|
1734
|
+
data?: T;
|
|
1735
|
+
input?: any;
|
|
1736
|
+
output?: unknown;
|
|
1737
|
+
artifact?: any;
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
export declare type TMessageComponentWidget = TMessageComponent<TMessageComponentWidgetData>;
|
|
1741
|
+
|
|
1742
|
+
export declare type TMessageComponentWidgetData = {
|
|
1743
|
+
type: 'Widget';
|
|
1744
|
+
mode?: string;
|
|
1745
|
+
widgets: TMessageComponentWidgetItem[];
|
|
1746
|
+
executionId?: string;
|
|
1747
|
+
};
|
|
1748
|
+
|
|
1749
|
+
export declare type TMessageComponentWidgetItem = {
|
|
1750
|
+
name: string;
|
|
1751
|
+
/**
|
|
1752
|
+
* Standard A2UI server-to-client messages. New widget messages should use
|
|
1753
|
+
* this flat protocol shape so the UI can build and isolate surfaces at render time.
|
|
1754
|
+
*/
|
|
1755
|
+
messages?: Types.ServerToClientMessage[];
|
|
1756
|
+
/**
|
|
1757
|
+
* @deprecated Legacy pre-resolved surface fallback. Prefer `messages`.
|
|
1758
|
+
*/
|
|
1759
|
+
config?: Types.Surface;
|
|
1760
|
+
values?: Record<string, unknown>;
|
|
1761
|
+
};
|
|
1762
|
+
|
|
1763
|
+
/**
|
|
1764
|
+
* Enhance {@link MessageContent} in Langchain.js
|
|
1765
|
+
*
|
|
1766
|
+
* @deprecated use {@link TMessageItems} instead
|
|
1767
|
+
*/
|
|
1768
|
+
export declare type TMessageContent = string | TMessageContentComplex[];
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* Enhance {@link MessageContentComplex} in Langchain.js
|
|
1772
|
+
*/
|
|
1773
|
+
export declare type TMessageContentComplex = (TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentMemory | (Record<string, unknown> & {
|
|
1774
|
+
type?: 'text' | 'image_url' | string;
|
|
1775
|
+
}) | (Record<string, unknown> & {
|
|
1776
|
+
type?: never;
|
|
1777
|
+
})) & {
|
|
1778
|
+
id?: string;
|
|
1779
|
+
xpertName?: string;
|
|
1780
|
+
agentKey?: string;
|
|
1781
|
+
executionId?: string;
|
|
1782
|
+
parentExecutionId?: string;
|
|
1783
|
+
runId?: string;
|
|
1784
|
+
created_date?: Date | string;
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1787
|
+
/**
|
|
1788
|
+
* Similar to {@link MessageContentText} | {@link MessageContentImageUrl}, which together form {@link MessageContentComplex}
|
|
1789
|
+
*/
|
|
1790
|
+
export declare type TMessageContentComponent<T extends object = object> = {
|
|
1791
|
+
id: string;
|
|
1792
|
+
type: 'component';
|
|
1793
|
+
data: TMessageComponent<T>;
|
|
1794
|
+
xpertName?: string;
|
|
1795
|
+
agentKey?: string;
|
|
1796
|
+
executionId?: string;
|
|
1797
|
+
parentExecutionId?: string;
|
|
1798
|
+
runId?: string;
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
export declare type TMessageContentMemory = {
|
|
1802
|
+
id?: string;
|
|
1803
|
+
agentKey?: string;
|
|
1804
|
+
type: 'memory';
|
|
1805
|
+
data: any[];
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
export declare type TMessageContentReasoning = {
|
|
1809
|
+
id?: string;
|
|
1810
|
+
xpertName?: string;
|
|
1811
|
+
agentKey?: string;
|
|
1812
|
+
executionId?: string;
|
|
1813
|
+
parentExecutionId?: string;
|
|
1814
|
+
runId?: string;
|
|
1815
|
+
type: 'reasoning';
|
|
1816
|
+
text: string;
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
export declare type TMessageContentText = {
|
|
1820
|
+
id?: string;
|
|
1821
|
+
xpertName?: string;
|
|
1822
|
+
agentKey?: string;
|
|
1823
|
+
executionId?: string;
|
|
1824
|
+
parentExecutionId?: string;
|
|
1825
|
+
runId?: string;
|
|
1826
|
+
type: 'text';
|
|
1827
|
+
text: string;
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
export declare type TMessageContentWidget = TMessageContentComponent<TMessageComponentWidgetData>;
|
|
1831
|
+
|
|
1832
|
+
export declare type TMessageItems = TMessageContentComplex[];
|
|
1833
|
+
|
|
1834
|
+
export declare type ToolCallInterrupt<TRequest extends ToolCallRequest = ToolCallRequest> = LangGraphInterrupt<TRequest>;
|
|
1835
|
+
|
|
1836
|
+
export declare type ToolCallInterruptPayload<TRequest extends ToolCallRequest = ToolCallRequest> = LangGraphInterruptPayload<TRequest>;
|
|
1837
|
+
|
|
1838
|
+
export declare type ToolCallInterruptTask<TRequest extends ToolCallRequest = ToolCallRequest> = LangGraphInterruptTask<TRequest>;
|
|
1839
|
+
|
|
1840
|
+
export declare interface ToolCallRequest {
|
|
1841
|
+
toolCalls: ToolCall[];
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
export declare type ToolChoice = unknown;
|
|
1845
|
+
|
|
1846
|
+
export declare type ToolOption = {
|
|
1847
|
+
id: string;
|
|
1848
|
+
/** Label displayed in the tool menu */
|
|
1849
|
+
label: string;
|
|
1850
|
+
/** Label displayed in the button when the tool is selected. */
|
|
1851
|
+
shortLabel?: string;
|
|
1852
|
+
/** Placeholder text to show in the composer input when the tool is selected. */
|
|
1853
|
+
placeholderOverride?: string;
|
|
1854
|
+
/**
|
|
1855
|
+
* Icon displayed next to the tool in the menu.
|
|
1856
|
+
*/
|
|
1857
|
+
icon: IconName;
|
|
1858
|
+
/**
|
|
1859
|
+
* Whether the tool is pinned to the composer outside of the tool menu.
|
|
1860
|
+
*
|
|
1861
|
+
* @default false
|
|
1862
|
+
*/
|
|
1863
|
+
pinned?: boolean;
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
export declare type Transition = {
|
|
1867
|
+
type: 'Transition';
|
|
1868
|
+
key?: string;
|
|
1869
|
+
id?: string;
|
|
1870
|
+
children: WidgetComponent;
|
|
1871
|
+
};
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* All locales for which there is an actual translation file.
|
|
1875
|
+
*/
|
|
1876
|
+
export declare type TranslatedLocale = 'am' | 'ar' | 'bg-BG' | 'bn-BD' | 'bs-BA' | 'ca-ES' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'es-419' | 'es-ES' | 'et-EE' | 'fi-FI' | 'fr-CA' | 'fr-FR' | 'gu-IN' | 'hi-IN' | 'hr-HR' | 'hu-HU' | 'hy-AM' | 'id-ID' | 'is-IS' | 'it-IT' | 'ja-JP' | 'ka-GE' | 'kk' | 'kn-IN' | 'ko-KR' | 'lt' | 'lv-LV' | 'mk-MK' | 'ml' | 'mn' | 'mr-IN' | 'ms-MY' | 'my-MM' | 'nb-NO' | 'nl-NL' | 'pa' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'so-SO' | 'sq-AL' | 'sr-RS' | 'sv-SE' | 'sw-TZ' | 'ta-IN' | 'te-IN' | 'th-TH' | 'tl' | 'tr-TR' | 'uk-UA' | 'ur' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW';
|
|
1877
|
+
|
|
1878
|
+
export declare type TThreadContextUsageEvent = {
|
|
1879
|
+
type: 'thread_context_usage';
|
|
1880
|
+
threadId: string;
|
|
1881
|
+
runId: string | null;
|
|
1882
|
+
agentKey: string;
|
|
1883
|
+
updatedAt: string;
|
|
1884
|
+
usage: TThreadContextUsageMetrics;
|
|
1885
|
+
};
|
|
1886
|
+
|
|
1887
|
+
export declare type TThreadContextUsageMetrics = {
|
|
1888
|
+
contextTokens: number;
|
|
1889
|
+
inputTokens: number;
|
|
1890
|
+
outputTokens: number;
|
|
1891
|
+
totalTokens: number;
|
|
1892
|
+
embedTokens?: number;
|
|
1893
|
+
totalPrice?: number;
|
|
1894
|
+
currency?: string | null;
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
export declare type TXpertChatInterruptPatch = Pick<TInterruptCommand, 'agentKey' | 'toolCalls' | 'update'>;
|
|
1898
|
+
|
|
1899
|
+
export declare type TXpertChatResumeDecision = {
|
|
1900
|
+
type: 'confirm' | 'reject';
|
|
1901
|
+
payload?: unknown;
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
export declare type TXpertChatResumeRequest = {
|
|
1905
|
+
action: 'resume';
|
|
1906
|
+
conversationId: string;
|
|
1907
|
+
target: TXpertChatTarget;
|
|
1908
|
+
decision: TXpertChatResumeDecision;
|
|
1909
|
+
patch?: TXpertChatInterruptPatch;
|
|
1910
|
+
state?: TXpertChatState;
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
export declare type TXpertChatState = {
|
|
1914
|
+
[STATE_VARIABLE_HUMAN]?: TChatRequestHuman;
|
|
1915
|
+
} & Record<string, unknown>;
|
|
1916
|
+
|
|
1917
|
+
export declare type TXpertChatTarget = {
|
|
1918
|
+
aiMessageId?: string;
|
|
1919
|
+
executionId?: string;
|
|
1920
|
+
};
|
|
1921
|
+
|
|
1922
|
+
export declare type UserMessageContent = unknown;
|
|
1923
|
+
|
|
1924
|
+
export declare type WidgetComponent = TextComponent | Title | Caption | Badge | Markdown | Box | Row | Col | Divider | Icon | Image_2 | Button | Checkbox | Spacer | Select | DatePicker | Form | Input | Label | RadioGroup | Textarea | Transition;
|
|
1925
|
+
|
|
1926
|
+
export declare type WidgetIcon = 'agent' | 'analytics' | 'atom' | 'batch' | 'bolt' | 'book-open' | 'book-closed' | 'book-clock' | 'bug' | 'calendar' | 'chart' | 'check' | 'check-circle' | 'check-circle-filled' | 'chevron-left' | 'chevron-right' | 'circle-question' | 'compass' | 'confetti' | 'cube' | 'desktop' | 'document' | 'dot' | 'dots-horizontal' | 'dots-vertical' | 'empty-circle' | 'external-link' | 'globe' | 'keys' | 'lab' | 'images' | 'info' | 'lifesaver' | 'lightbulb' | 'mail' | 'map-pin' | 'maps' | 'mobile' | 'name' | 'notebook' | 'notebook-pencil' | 'page-blank' | 'phone' | 'play' | 'plus' | 'profile' | 'profile-card' | 'reload' | 'star' | 'star-filled' | 'search' | 'sparkle' | 'sparkle-double' | 'square-code' | 'square-image' | 'square-text' | 'suitcase' | 'settings-slider' | 'user' | 'wreath' | 'write' | 'write-alt' | 'write-alt2';
|
|
1927
|
+
|
|
1928
|
+
export declare type WidgetRoot = Card | ListView | BasicRoot;
|
|
1929
|
+
|
|
1930
|
+
declare namespace Widgets {
|
|
1931
|
+
export {
|
|
1932
|
+
WidgetRoot,
|
|
1933
|
+
WidgetComponent,
|
|
1934
|
+
BasicRoot,
|
|
1935
|
+
Card,
|
|
1936
|
+
ListView,
|
|
1937
|
+
ListViewItem,
|
|
1938
|
+
Box,
|
|
1939
|
+
Row,
|
|
1940
|
+
Col,
|
|
1941
|
+
Form,
|
|
1942
|
+
Spacer,
|
|
1943
|
+
Divider,
|
|
1944
|
+
Transition,
|
|
1945
|
+
Title,
|
|
1946
|
+
Caption,
|
|
1947
|
+
TextComponent,
|
|
1948
|
+
Markdown,
|
|
1949
|
+
Badge,
|
|
1950
|
+
Icon,
|
|
1951
|
+
Image_2 as Image,
|
|
1952
|
+
Button,
|
|
1953
|
+
Input,
|
|
1954
|
+
Textarea,
|
|
1955
|
+
Select,
|
|
1956
|
+
DatePicker,
|
|
1957
|
+
Checkbox,
|
|
1958
|
+
RadioGroup,
|
|
1959
|
+
Label,
|
|
1960
|
+
WidgetIcon
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
declare type WidgetStatus = {
|
|
1965
|
+
text: string;
|
|
1966
|
+
favicon?: string;
|
|
1967
|
+
frame?: boolean;
|
|
1968
|
+
} | {
|
|
1969
|
+
text: string;
|
|
1970
|
+
icon?: WidgetIcon;
|
|
1971
|
+
};
|
|
1972
|
+
|
|
1973
|
+
export declare type WorkflowTriggerParams = {
|
|
1974
|
+
name?: string;
|
|
1975
|
+
params?: Record<string, unknown>;
|
|
1976
|
+
} | Record<string, unknown>;
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* A Web Component that serves as the entry point for a ChatKit integration.
|
|
1980
|
+
* * @noInheritDoc
|
|
1981
|
+
*/
|
|
1982
|
+
export declare interface XpertAIChatKit extends HTMLElement {
|
|
1983
|
+
/**
|
|
1984
|
+
* Applies configuration options to the ChatKit instance.
|
|
1985
|
+
*
|
|
1986
|
+
* **IMPORTANT**: New options are not merged with the existing options. You must provide a full set of options every time you call this method.
|
|
1987
|
+
*/
|
|
1988
|
+
setOptions(options: ChatKitOptions): void;
|
|
1989
|
+
/** Focuses the composer input field. */
|
|
1990
|
+
focusComposer(): Promise<void>;
|
|
1991
|
+
/** Changes the active thread. Pass `null` to switch to a new thread. */
|
|
1992
|
+
setThreadId(threadId: string | null): Promise<void>;
|
|
1993
|
+
/**
|
|
1994
|
+
* Sends a custom application-defined action to your backend.
|
|
1995
|
+
*/
|
|
1996
|
+
sendCustomAction(action: {
|
|
1997
|
+
type: string;
|
|
1998
|
+
payload?: Record<string, unknown>;
|
|
1999
|
+
},
|
|
2000
|
+
/**
|
|
2001
|
+
* The ID of the WidgetItem that the action is associated with. You may
|
|
2002
|
+
* need this if the action was triggered by a widget, gets handled
|
|
2003
|
+
* client-side, and then you want to send the action back to the server to
|
|
2004
|
+
* do additional handling.
|
|
2005
|
+
*
|
|
2006
|
+
* @example
|
|
2007
|
+
* ```ts
|
|
2008
|
+
* chatKit.options = {
|
|
2009
|
+
* // other options...
|
|
2010
|
+
* widgets: {
|
|
2011
|
+
* async onAction(action, widgetItem) {
|
|
2012
|
+
* await someClientSideHandling(action)
|
|
2013
|
+
* await chatkit.sendAction(action, widgetItem.id)
|
|
2014
|
+
* }
|
|
2015
|
+
* }
|
|
2016
|
+
* }
|
|
2017
|
+
* ```
|
|
2018
|
+
*/
|
|
2019
|
+
itemId?: string): Promise<void>;
|
|
2020
|
+
/** Sends a user message. */
|
|
2021
|
+
sendUserMessage(params: SendUserMessageParams): Promise<void>;
|
|
2022
|
+
/** Sets the composer's content without sending a message. */
|
|
2023
|
+
setComposerValue(params: {
|
|
2024
|
+
text?: string;
|
|
2025
|
+
reply?: string;
|
|
2026
|
+
attachments?: Attachment[];
|
|
2027
|
+
references?: ChatKitReference[];
|
|
2028
|
+
appendReferences?: boolean;
|
|
2029
|
+
selectedToolId?: string | null;
|
|
2030
|
+
selectedModelId?: string | null;
|
|
2031
|
+
}): Promise<void>;
|
|
2032
|
+
/**
|
|
2033
|
+
* Manually fetches updates from the server.
|
|
2034
|
+
*
|
|
2035
|
+
* Use this when you've manually updated the thread or thread items and need to sync them with the client.
|
|
2036
|
+
*/
|
|
2037
|
+
fetchUpdates(): Promise<void>;
|
|
2038
|
+
/**
|
|
2039
|
+
* Adds an event listener for the specified {@link ChatKitEvents} event.
|
|
2040
|
+
*
|
|
2041
|
+
* @example
|
|
2042
|
+
* ```ts
|
|
2043
|
+
* chatKit.addEventListener('chatkit.error', (event) => {
|
|
2044
|
+
* logToMyErrorLogger(event.detail.error);
|
|
2045
|
+
* });
|
|
2046
|
+
* ```
|
|
2047
|
+
*
|
|
2048
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener}
|
|
2049
|
+
*/
|
|
2050
|
+
addEventListener<K extends keyof ChatKitEvents>(
|
|
2051
|
+
/**
|
|
2052
|
+
* See {@link ChatKitEvents} for available events.
|
|
2053
|
+
*/
|
|
2054
|
+
type: K,
|
|
2055
|
+
/**
|
|
2056
|
+
* The event listener callback.
|
|
2057
|
+
*/
|
|
2058
|
+
listener: EventHandler<K>,
|
|
2059
|
+
/**
|
|
2060
|
+
* An object that specifies characteristics about the event listener.
|
|
2061
|
+
*
|
|
2062
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#options}
|
|
2063
|
+
*/
|
|
2064
|
+
options?: boolean | AddEventListenerOptions): void;
|
|
2065
|
+
/* Excluded from this release type: addEventListener */
|
|
2066
|
+
/**
|
|
2067
|
+
* Removes an event listener for the specified event.
|
|
2068
|
+
*
|
|
2069
|
+
* @example
|
|
2070
|
+
* ```ts
|
|
2071
|
+
* chatKit.removeEventListener('chatkit.error', myErrorListener);
|
|
2072
|
+
* ```
|
|
2073
|
+
*
|
|
2074
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener}
|
|
2075
|
+
*/
|
|
2076
|
+
removeEventListener<K extends keyof ChatKitEvents>(
|
|
2077
|
+
/**
|
|
2078
|
+
* See {@link ChatKitEvents} for available events.
|
|
2079
|
+
*/
|
|
2080
|
+
type: K,
|
|
2081
|
+
/**
|
|
2082
|
+
* The event listener callback to remove.
|
|
2083
|
+
*/
|
|
2084
|
+
listener: EventHandler<K>,
|
|
2085
|
+
/**
|
|
2086
|
+
* An object that specifies characteristics about the event listener.
|
|
2087
|
+
*
|
|
2088
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener#options}
|
|
2089
|
+
*/
|
|
2090
|
+
options?: boolean | EventListenerOptions): void;
|
|
2091
|
+
/* Excluded from this release type: removeEventListener */
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
export { }
|