@iota-uz/sdk 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bichat/index.cjs +8543 -2321
- package/dist/bichat/index.cjs.map +1 -1
- package/dist/bichat/index.css +145 -37
- package/dist/bichat/index.css.map +1 -1
- package/dist/bichat/index.d.cts +1247 -232
- package/dist/bichat/index.d.ts +1247 -232
- package/dist/bichat/index.mjs +8502 -2327
- package/dist/bichat/index.mjs.map +1 -1
- package/dist/bichat/styles.css +165 -49
- package/dist/index-B73-BCi-.d.cts +84 -0
- package/dist/index-B73-BCi-.d.ts +84 -0
- package/dist/index.cjs +347 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -81
- package/dist/index.d.ts +76 -81
- package/dist/index.mjs +343 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -2
- package/tailwind/compiled.css +1 -1
- package/tailwind/iota.css +7 -0
package/dist/bichat/index.d.cts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { ReactNode, Component, ErrorInfo, HTMLAttributes, ReactElement, ImgHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
+
import react__default, { ReactNode, Component, ErrorInfo, FC, HTMLAttributes, ReactElement, ImgHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
|
|
4
|
+
import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, c as TenantContext$1, U as UserContext$1 } from '../index-B73-BCi-.cjs';
|
|
5
|
+
import { File as File$1 } from '@phosphor-icons/react';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Type definitions for BI-Chat UI components
|
|
7
9
|
*/
|
|
8
|
-
interface Session {
|
|
10
|
+
interface Session$1 {
|
|
9
11
|
id: string;
|
|
10
12
|
title: string;
|
|
11
13
|
status: 'active' | 'archived';
|
|
@@ -17,33 +19,36 @@ interface Session {
|
|
|
17
19
|
* A conversation turn groups a user message with its assistant response.
|
|
18
20
|
* This provides a cleaner mental model than flat message lists.
|
|
19
21
|
*/
|
|
20
|
-
interface ConversationTurn {
|
|
22
|
+
interface ConversationTurn$1 {
|
|
21
23
|
id: string;
|
|
22
24
|
sessionId: string;
|
|
23
|
-
userTurn: UserTurn;
|
|
24
|
-
assistantTurn?: AssistantTurn;
|
|
25
|
+
userTurn: UserTurn$1;
|
|
26
|
+
assistantTurn?: AssistantTurn$1;
|
|
25
27
|
createdAt: string;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Content of a user's message in a conversation turn
|
|
29
31
|
*/
|
|
30
|
-
interface UserTurn {
|
|
32
|
+
interface UserTurn$1 {
|
|
31
33
|
id: string;
|
|
32
34
|
content: string;
|
|
33
|
-
attachments: Attachment[];
|
|
35
|
+
attachments: Attachment$1[];
|
|
34
36
|
createdAt: string;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* Content of an assistant's response in a conversation turn
|
|
38
40
|
*/
|
|
39
|
-
interface AssistantTurn {
|
|
41
|
+
interface AssistantTurn$1 {
|
|
40
42
|
id: string;
|
|
43
|
+
role?: MessageRole;
|
|
41
44
|
content: string;
|
|
42
45
|
explanation?: string;
|
|
43
|
-
citations: Citation[];
|
|
46
|
+
citations: Citation$1[];
|
|
47
|
+
toolCalls?: ToolCall$1[];
|
|
44
48
|
chartData?: ChartData;
|
|
45
|
-
artifacts: Artifact[];
|
|
46
|
-
codeOutputs: CodeOutput[];
|
|
49
|
+
artifacts: Artifact$1[];
|
|
50
|
+
codeOutputs: CodeOutput$1[];
|
|
51
|
+
debug?: DebugTrace$1;
|
|
47
52
|
createdAt: string;
|
|
48
53
|
}
|
|
49
54
|
/**
|
|
@@ -58,15 +63,18 @@ declare enum MessageRole {
|
|
|
58
63
|
/**
|
|
59
64
|
* A tool/function call made by the assistant
|
|
60
65
|
*/
|
|
61
|
-
interface ToolCall {
|
|
66
|
+
interface ToolCall$1 {
|
|
62
67
|
id: string;
|
|
63
68
|
name: string;
|
|
64
69
|
arguments: string;
|
|
70
|
+
result?: string;
|
|
71
|
+
error?: string;
|
|
72
|
+
durationMs?: number;
|
|
65
73
|
}
|
|
66
74
|
/**
|
|
67
75
|
* Citation with position information for inline replacement
|
|
68
76
|
*/
|
|
69
|
-
interface Citation {
|
|
77
|
+
interface Citation$1 {
|
|
70
78
|
id: string;
|
|
71
79
|
/** Type of citation (e.g., "url_citation") */
|
|
72
80
|
type: string;
|
|
@@ -83,24 +91,23 @@ interface Citation {
|
|
|
83
91
|
/** Legacy: source name (for backward compatibility) */
|
|
84
92
|
source?: string;
|
|
85
93
|
}
|
|
86
|
-
interface Attachment {
|
|
87
|
-
id
|
|
94
|
+
interface Attachment$1 {
|
|
95
|
+
id?: string;
|
|
88
96
|
filename: string;
|
|
89
97
|
mimeType: string;
|
|
90
98
|
sizeBytes: number;
|
|
91
99
|
base64Data?: string;
|
|
100
|
+
url?: string;
|
|
101
|
+
preview?: string;
|
|
92
102
|
}
|
|
93
|
-
|
|
94
|
-
filename: string;
|
|
95
|
-
mimeType: string;
|
|
96
|
-
sizeBytes: number;
|
|
103
|
+
type ImageAttachment = Attachment$1 & {
|
|
97
104
|
base64Data: string;
|
|
98
105
|
preview: string;
|
|
99
|
-
}
|
|
106
|
+
};
|
|
100
107
|
/**
|
|
101
108
|
* Output from code interpreter tool
|
|
102
109
|
*/
|
|
103
|
-
interface CodeOutput {
|
|
110
|
+
interface CodeOutput$1 {
|
|
104
111
|
type: 'image' | 'text' | 'error';
|
|
105
112
|
content: string;
|
|
106
113
|
/** File metadata for downloadable outputs */
|
|
@@ -113,7 +120,7 @@ interface CodeOutput {
|
|
|
113
120
|
*/
|
|
114
121
|
interface QueuedMessage {
|
|
115
122
|
content: string;
|
|
116
|
-
attachments:
|
|
123
|
+
attachments: Attachment$1[];
|
|
117
124
|
}
|
|
118
125
|
/**
|
|
119
126
|
* Chart visualization data for ApexCharts
|
|
@@ -141,7 +148,7 @@ interface ChartSeries {
|
|
|
141
148
|
/** Numeric data values */
|
|
142
149
|
data: number[];
|
|
143
150
|
}
|
|
144
|
-
interface Artifact {
|
|
151
|
+
interface Artifact$1 {
|
|
145
152
|
type: 'excel' | 'pdf';
|
|
146
153
|
filename: string;
|
|
147
154
|
url: string;
|
|
@@ -149,7 +156,20 @@ interface Artifact {
|
|
|
149
156
|
rowCount?: number;
|
|
150
157
|
description?: string;
|
|
151
158
|
}
|
|
152
|
-
interface
|
|
159
|
+
interface SessionArtifact {
|
|
160
|
+
id: string;
|
|
161
|
+
sessionId: string;
|
|
162
|
+
messageId?: string;
|
|
163
|
+
type: string;
|
|
164
|
+
name: string;
|
|
165
|
+
description?: string;
|
|
166
|
+
mimeType?: string;
|
|
167
|
+
url?: string;
|
|
168
|
+
sizeBytes: number;
|
|
169
|
+
metadata?: Record<string, unknown>;
|
|
170
|
+
createdAt: string;
|
|
171
|
+
}
|
|
172
|
+
interface PendingQuestion$1 {
|
|
153
173
|
id: string;
|
|
154
174
|
turnId: string;
|
|
155
175
|
questions: Question[];
|
|
@@ -184,68 +204,238 @@ interface QuestionAnswers {
|
|
|
184
204
|
[questionId: string]: QuestionAnswerData;
|
|
185
205
|
}
|
|
186
206
|
interface StreamChunk {
|
|
187
|
-
type: 'chunk' | '
|
|
207
|
+
type: 'chunk' | 'content' | 'tool_start' | 'tool_end' | 'usage' | 'done' | 'error' | 'user_message' | 'interrupt';
|
|
188
208
|
content?: string;
|
|
189
209
|
error?: string;
|
|
190
210
|
sessionId?: string;
|
|
211
|
+
usage?: DebugUsage$1;
|
|
212
|
+
tool?: StreamToolPayload;
|
|
213
|
+
interrupt?: StreamInterruptPayload;
|
|
214
|
+
generationMs?: number;
|
|
215
|
+
timestamp?: number;
|
|
216
|
+
}
|
|
217
|
+
interface StreamInterruptPayload {
|
|
218
|
+
checkpointId: string;
|
|
219
|
+
agentName?: string;
|
|
220
|
+
questions: StreamInterruptQuestion[];
|
|
221
|
+
}
|
|
222
|
+
interface StreamInterruptQuestion {
|
|
223
|
+
id: string;
|
|
224
|
+
text: string;
|
|
225
|
+
type: string;
|
|
226
|
+
options: Array<{
|
|
227
|
+
id: string;
|
|
228
|
+
label: string;
|
|
229
|
+
}>;
|
|
230
|
+
}
|
|
231
|
+
interface DebugUsage$1 {
|
|
232
|
+
promptTokens: number;
|
|
233
|
+
completionTokens: number;
|
|
234
|
+
totalTokens: number;
|
|
235
|
+
cachedTokens?: number;
|
|
236
|
+
cost?: number;
|
|
237
|
+
}
|
|
238
|
+
interface StreamToolPayload {
|
|
239
|
+
callId?: string;
|
|
240
|
+
name: string;
|
|
241
|
+
arguments?: string;
|
|
242
|
+
result?: string;
|
|
243
|
+
error?: string;
|
|
244
|
+
durationMs?: number;
|
|
245
|
+
}
|
|
246
|
+
interface DebugTrace$1 {
|
|
247
|
+
generationMs?: number;
|
|
248
|
+
usage?: DebugUsage$1;
|
|
249
|
+
tools: StreamToolPayload[];
|
|
250
|
+
}
|
|
251
|
+
interface DebugLimits {
|
|
252
|
+
policyMaxTokens: number;
|
|
253
|
+
modelMaxTokens: number;
|
|
254
|
+
effectiveMaxTokens: number;
|
|
255
|
+
completionReserveTokens: number;
|
|
256
|
+
}
|
|
257
|
+
interface SessionDebugUsage {
|
|
258
|
+
promptTokens: number;
|
|
259
|
+
completionTokens: number;
|
|
260
|
+
totalTokens: number;
|
|
261
|
+
turnsWithUsage: number;
|
|
262
|
+
latestPromptTokens: number;
|
|
263
|
+
latestCompletionTokens: number;
|
|
264
|
+
latestTotalTokens: number;
|
|
265
|
+
}
|
|
266
|
+
interface SendMessageOptions {
|
|
267
|
+
debugMode?: boolean;
|
|
268
|
+
replaceFromMessageID?: string;
|
|
269
|
+
}
|
|
270
|
+
interface SessionListResult$1 {
|
|
271
|
+
sessions: Session$1[];
|
|
272
|
+
total: number;
|
|
273
|
+
hasMore: boolean;
|
|
274
|
+
}
|
|
275
|
+
interface SessionUser {
|
|
276
|
+
id: string;
|
|
277
|
+
firstName: string;
|
|
278
|
+
lastName: string;
|
|
279
|
+
initials: string;
|
|
280
|
+
}
|
|
281
|
+
interface SessionGroup {
|
|
282
|
+
name: string;
|
|
283
|
+
sessions: Session$1[];
|
|
191
284
|
}
|
|
192
285
|
interface ChatDataSource {
|
|
193
|
-
createSession(): Promise<Session>;
|
|
286
|
+
createSession(): Promise<Session$1>;
|
|
194
287
|
fetchSession(id: string): Promise<{
|
|
195
|
-
session: Session;
|
|
196
|
-
turns: ConversationTurn[];
|
|
197
|
-
pendingQuestion?: PendingQuestion | null;
|
|
288
|
+
session: Session$1;
|
|
289
|
+
turns: ConversationTurn$1[];
|
|
290
|
+
pendingQuestion?: PendingQuestion$1 | null;
|
|
198
291
|
} | null>;
|
|
199
|
-
|
|
292
|
+
fetchSessionArtifacts?(sessionId: string, options?: {
|
|
293
|
+
limit?: number;
|
|
294
|
+
offset?: number;
|
|
295
|
+
}): Promise<{
|
|
296
|
+
artifacts: SessionArtifact[];
|
|
297
|
+
hasMore?: boolean;
|
|
298
|
+
nextOffset?: number;
|
|
299
|
+
}>;
|
|
300
|
+
uploadSessionArtifacts?(sessionId: string, files: File[]): Promise<{
|
|
301
|
+
artifacts: SessionArtifact[];
|
|
302
|
+
}>;
|
|
303
|
+
renameSessionArtifact?(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
304
|
+
deleteSessionArtifact?(artifactId: string): Promise<void>;
|
|
305
|
+
sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
306
|
+
clearSessionHistory(sessionId: string): Promise<{
|
|
307
|
+
success: boolean;
|
|
308
|
+
deletedMessages: number;
|
|
309
|
+
deletedArtifacts: number;
|
|
310
|
+
}>;
|
|
311
|
+
compactSessionHistory(sessionId: string): Promise<{
|
|
312
|
+
success: boolean;
|
|
313
|
+
summary: string;
|
|
314
|
+
deletedMessages: number;
|
|
315
|
+
deletedArtifacts: number;
|
|
316
|
+
}>;
|
|
200
317
|
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{
|
|
201
318
|
success: boolean;
|
|
202
319
|
error?: string;
|
|
203
320
|
}>;
|
|
204
|
-
|
|
321
|
+
rejectPendingQuestion(sessionId: string): Promise<{
|
|
205
322
|
success: boolean;
|
|
206
323
|
error?: string;
|
|
207
324
|
}>;
|
|
208
325
|
navigateToSession?(sessionId: string): void;
|
|
326
|
+
listSessions(options?: {
|
|
327
|
+
limit?: number;
|
|
328
|
+
offset?: number;
|
|
329
|
+
includeArchived?: boolean;
|
|
330
|
+
}): Promise<SessionListResult$1>;
|
|
331
|
+
archiveSession(sessionId: string): Promise<Session$1>;
|
|
332
|
+
unarchiveSession(sessionId: string): Promise<Session$1>;
|
|
333
|
+
pinSession(sessionId: string): Promise<Session$1>;
|
|
334
|
+
unpinSession(sessionId: string): Promise<Session$1>;
|
|
335
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
336
|
+
renameSession(sessionId: string, title: string): Promise<Session$1>;
|
|
337
|
+
regenerateSessionTitle(sessionId: string): Promise<Session$1>;
|
|
338
|
+
listUsers?(): Promise<SessionUser[]>;
|
|
339
|
+
listAllSessions?(options?: {
|
|
340
|
+
limit?: number;
|
|
341
|
+
offset?: number;
|
|
342
|
+
includeArchived?: boolean;
|
|
343
|
+
userId?: string | null;
|
|
344
|
+
}): Promise<{
|
|
345
|
+
sessions: Array<Session$1 & {
|
|
346
|
+
owner: SessionUser;
|
|
347
|
+
}>;
|
|
348
|
+
total: number;
|
|
349
|
+
hasMore: boolean;
|
|
350
|
+
}>;
|
|
209
351
|
}
|
|
210
|
-
interface
|
|
211
|
-
|
|
212
|
-
turns: ConversationTurn[];
|
|
213
|
-
loading: boolean;
|
|
214
|
-
error: string | null;
|
|
352
|
+
interface ChatSessionStateValue {
|
|
353
|
+
session: Session$1 | null;
|
|
215
354
|
currentSessionId?: string;
|
|
216
|
-
pendingQuestion: PendingQuestion | null;
|
|
217
|
-
session: Session | null;
|
|
218
355
|
fetching: boolean;
|
|
356
|
+
error: string | null;
|
|
357
|
+
debugMode: boolean;
|
|
358
|
+
sessionDebugUsage: SessionDebugUsage;
|
|
359
|
+
debugLimits: DebugLimits | null;
|
|
360
|
+
setError: (error: string | null) => void;
|
|
361
|
+
}
|
|
362
|
+
interface ChatMessagingStateValue {
|
|
363
|
+
turns: ConversationTurn$1[];
|
|
219
364
|
streamingContent: string;
|
|
220
365
|
isStreaming: boolean;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
366
|
+
loading: boolean;
|
|
367
|
+
pendingQuestion: PendingQuestion$1 | null;
|
|
368
|
+
codeOutputs: CodeOutput$1[];
|
|
369
|
+
isCompacting: boolean;
|
|
370
|
+
compactionSummary: string | null;
|
|
371
|
+
/** Bumped when artifacts should be refetched (e.g. tool_end for artifact-producing tools). */
|
|
372
|
+
artifactsInvalidationTrigger: number;
|
|
373
|
+
sendMessage: (content: string, attachments?: Attachment$1[]) => Promise<void>;
|
|
227
374
|
handleRegenerate?: (turnId: string) => Promise<void>;
|
|
228
375
|
handleEdit?: (turnId: string, newContent: string) => Promise<void>;
|
|
229
376
|
handleCopy: (text: string) => Promise<void>;
|
|
230
377
|
handleSubmitQuestionAnswers: (answers: QuestionAnswers) => void;
|
|
231
|
-
|
|
232
|
-
|
|
378
|
+
handleRejectPendingQuestion: () => Promise<void>;
|
|
379
|
+
cancel: () => void;
|
|
380
|
+
setCodeOutputs: (outputs: CodeOutput$1[]) => void;
|
|
381
|
+
}
|
|
382
|
+
interface ChatInputStateValue {
|
|
383
|
+
message: string;
|
|
384
|
+
inputError: string | null;
|
|
385
|
+
messageQueue: QueuedMessage[];
|
|
386
|
+
setMessage: (message: string) => void;
|
|
387
|
+
setInputError: (error: string | null) => void;
|
|
388
|
+
handleSubmit: (e: React.FormEvent, attachments?: Attachment$1[]) => void;
|
|
233
389
|
handleUnqueue: () => {
|
|
234
390
|
content: string;
|
|
235
|
-
attachments:
|
|
391
|
+
attachments: Attachment$1[];
|
|
236
392
|
} | null;
|
|
237
|
-
|
|
238
|
-
|
|
393
|
+
}
|
|
394
|
+
interface ChatSessionContextValue extends ChatSessionStateValue, ChatMessagingStateValue, ChatInputStateValue {
|
|
395
|
+
handleRetry?: () => Promise<void>;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Per-session rate limiter
|
|
400
|
+
* Prevents excessive requests within a time window
|
|
401
|
+
*/
|
|
402
|
+
interface RateLimiterConfig {
|
|
403
|
+
maxRequests: number;
|
|
404
|
+
windowMs: number;
|
|
405
|
+
}
|
|
406
|
+
declare class RateLimiter {
|
|
407
|
+
private timestamps;
|
|
408
|
+
private maxRequests;
|
|
409
|
+
private windowMs;
|
|
410
|
+
constructor(config: RateLimiterConfig);
|
|
411
|
+
/**
|
|
412
|
+
* Check if a request can be made
|
|
413
|
+
* Updates internal state if request is allowed
|
|
414
|
+
*/
|
|
415
|
+
canMakeRequest(): boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Get milliseconds until next request is allowed
|
|
418
|
+
* Returns 0 if request can be made immediately
|
|
419
|
+
*/
|
|
420
|
+
getTimeUntilNextRequest(): number;
|
|
421
|
+
/**
|
|
422
|
+
* Reset the rate limiter state
|
|
423
|
+
*/
|
|
424
|
+
reset(): void;
|
|
239
425
|
}
|
|
240
426
|
|
|
241
427
|
interface ChatSessionProps {
|
|
242
428
|
dataSource: ChatDataSource;
|
|
243
429
|
sessionId?: string;
|
|
430
|
+
/** Optional rate limiter to throttle sendMessage */
|
|
431
|
+
rateLimiter?: RateLimiter;
|
|
432
|
+
/** Alias for isReadOnly (preferred) */
|
|
433
|
+
readOnly?: boolean;
|
|
244
434
|
isReadOnly?: boolean;
|
|
245
435
|
/** Custom render function for user turns */
|
|
246
|
-
renderUserTurn?: (turn: ConversationTurn) => ReactNode;
|
|
436
|
+
renderUserTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
247
437
|
/** Custom render function for assistant turns */
|
|
248
|
-
renderAssistantTurn?: (turn: ConversationTurn) => ReactNode;
|
|
438
|
+
renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
249
439
|
className?: string;
|
|
250
440
|
/** Custom content to display as header */
|
|
251
441
|
headerSlot?: ReactNode;
|
|
@@ -257,26 +447,60 @@ interface ChatSessionProps {
|
|
|
257
447
|
actionsSlot?: ReactNode;
|
|
258
448
|
/** Callback when user navigates back */
|
|
259
449
|
onBack?: () => void;
|
|
450
|
+
/** Custom verbs for the typing indicator (e.g. ['Thinking', 'Analyzing', ...]) */
|
|
451
|
+
thinkingVerbs?: string[];
|
|
452
|
+
/** Enables the built-in right-side artifacts panel for persisted session artifacts */
|
|
453
|
+
showArtifactsPanel?: boolean;
|
|
454
|
+
/** Initial expanded state for artifacts panel when no persisted preference exists */
|
|
455
|
+
artifactsPanelDefaultExpanded?: boolean;
|
|
456
|
+
/** localStorage key for artifacts panel expanded/collapsed state */
|
|
457
|
+
artifactsPanelStorageKey?: string;
|
|
260
458
|
}
|
|
261
459
|
declare function ChatSession(props: ChatSessionProps): react_jsx_runtime.JSX.Element;
|
|
262
460
|
|
|
461
|
+
interface SessionArtifactsPanelProps {
|
|
462
|
+
dataSource: ChatDataSource;
|
|
463
|
+
sessionId: string;
|
|
464
|
+
isStreaming: boolean;
|
|
465
|
+
allowDrop?: boolean;
|
|
466
|
+
className?: string;
|
|
467
|
+
}
|
|
468
|
+
declare function SessionArtifactsPanel({ dataSource, sessionId, isStreaming, allowDrop, className, }: SessionArtifactsPanelProps): react_jsx_runtime.JSX.Element;
|
|
469
|
+
|
|
470
|
+
interface SessionArtifactListProps {
|
|
471
|
+
artifacts: SessionArtifact[];
|
|
472
|
+
selectedArtifactId?: string;
|
|
473
|
+
onSelect: (artifact: SessionArtifact) => void;
|
|
474
|
+
}
|
|
475
|
+
declare function SessionArtifactList({ artifacts, selectedArtifactId, onSelect, }: SessionArtifactListProps): react_jsx_runtime.JSX.Element;
|
|
476
|
+
|
|
477
|
+
interface SessionArtifactPreviewProps {
|
|
478
|
+
artifact: SessionArtifact;
|
|
479
|
+
}
|
|
480
|
+
declare function SessionArtifactPreview({ artifact }: SessionArtifactPreviewProps): react_jsx_runtime.JSX.Element;
|
|
481
|
+
|
|
263
482
|
interface ChatHeaderProps {
|
|
264
|
-
session: Session | null;
|
|
483
|
+
session: Session$1 | null;
|
|
265
484
|
onBack?: () => void;
|
|
485
|
+
readOnly?: boolean;
|
|
266
486
|
/** Custom logo component to display */
|
|
267
487
|
logoSlot?: ReactNode;
|
|
268
488
|
/** Custom action buttons */
|
|
269
489
|
actionsSlot?: ReactNode;
|
|
270
490
|
}
|
|
271
|
-
declare function ChatHeader({ session, onBack, logoSlot, actionsSlot }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
491
|
+
declare function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
272
492
|
|
|
273
493
|
interface MessageListProps {
|
|
274
494
|
/** Custom render function for user turns */
|
|
275
|
-
renderUserTurn?: (turn: ConversationTurn) => ReactNode;
|
|
495
|
+
renderUserTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
276
496
|
/** Custom render function for assistant turns */
|
|
277
|
-
renderAssistantTurn?: (turn: ConversationTurn) => ReactNode;
|
|
497
|
+
renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
498
|
+
/** Custom verbs for the typing indicator (e.g. ['Thinking', 'Analyzing', ...]) */
|
|
499
|
+
thinkingVerbs?: string[];
|
|
500
|
+
/** When true, hides edit/regenerate actions */
|
|
501
|
+
readOnly?: boolean;
|
|
278
502
|
}
|
|
279
|
-
declare function MessageList({ renderUserTurn, renderAssistantTurn }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
503
|
+
declare function MessageList({ renderUserTurn, renderAssistantTurn, thinkingVerbs, readOnly }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
280
504
|
|
|
281
505
|
interface UserMessageAvatarSlotProps {
|
|
282
506
|
/** Default initials */
|
|
@@ -287,8 +511,8 @@ interface UserMessageContentSlotProps {
|
|
|
287
511
|
content: string;
|
|
288
512
|
}
|
|
289
513
|
interface UserMessageAttachmentsSlotProps {
|
|
290
|
-
/**
|
|
291
|
-
attachments:
|
|
514
|
+
/** Message attachments */
|
|
515
|
+
attachments: Attachment$1[];
|
|
292
516
|
/** Handler to open image viewer */
|
|
293
517
|
onView: (index: number) => void;
|
|
294
518
|
}
|
|
@@ -336,7 +560,7 @@ interface UserMessageClassNames {
|
|
|
336
560
|
}
|
|
337
561
|
interface UserMessageProps {
|
|
338
562
|
/** User turn data */
|
|
339
|
-
turn: UserTurn;
|
|
563
|
+
turn: UserTurn$1;
|
|
340
564
|
/** Turn ID for edit operations */
|
|
341
565
|
turnId?: string;
|
|
342
566
|
/** User initials for avatar */
|
|
@@ -355,12 +579,14 @@ interface UserMessageProps {
|
|
|
355
579
|
hideActions?: boolean;
|
|
356
580
|
/** Hide timestamp */
|
|
357
581
|
hideTimestamp?: boolean;
|
|
582
|
+
/** Whether edit action should be available */
|
|
583
|
+
allowEdit?: boolean;
|
|
358
584
|
}
|
|
359
|
-
declare function UserMessage({ turn, turnId, initials, slots, classNames: classNameOverrides, onCopy, onEdit, hideAvatar, hideActions, hideTimestamp, }: UserMessageProps): react_jsx_runtime.JSX.Element;
|
|
585
|
+
declare function UserMessage({ turn, turnId, initials, slots, classNames: classNameOverrides, onCopy, onEdit, hideAvatar, hideActions, hideTimestamp, allowEdit, }: UserMessageProps): react_jsx_runtime.JSX.Element;
|
|
360
586
|
|
|
361
587
|
interface UserTurnViewProps {
|
|
362
588
|
/** The conversation turn containing the user message */
|
|
363
|
-
turn: ConversationTurn;
|
|
589
|
+
turn: ConversationTurn$1;
|
|
364
590
|
/** Slot overrides for customization */
|
|
365
591
|
slots?: UserMessageSlots;
|
|
366
592
|
/** Class name overrides */
|
|
@@ -373,8 +599,10 @@ interface UserTurnViewProps {
|
|
|
373
599
|
hideActions?: boolean;
|
|
374
600
|
/** Hide timestamp */
|
|
375
601
|
hideTimestamp?: boolean;
|
|
602
|
+
/** Whether edit action should be available */
|
|
603
|
+
allowEdit?: boolean;
|
|
376
604
|
}
|
|
377
|
-
declare function UserTurnView({ turn, slots, classNames, initials, hideAvatar, hideActions, hideTimestamp, }: UserTurnViewProps): react_jsx_runtime.JSX.Element;
|
|
605
|
+
declare function UserTurnView({ turn, slots, classNames, initials, hideAvatar, hideActions, hideTimestamp, allowEdit, }: UserTurnViewProps): react_jsx_runtime.JSX.Element;
|
|
378
606
|
|
|
379
607
|
interface AssistantMessageAvatarSlotProps {
|
|
380
608
|
/** Default text */
|
|
@@ -384,13 +612,13 @@ interface AssistantMessageContentSlotProps {
|
|
|
384
612
|
/** Message content (markdown) */
|
|
385
613
|
content: string;
|
|
386
614
|
/** Citations */
|
|
387
|
-
citations?: Citation[];
|
|
615
|
+
citations?: Citation$1[];
|
|
388
616
|
/** Whether streaming is active */
|
|
389
617
|
isStreaming: boolean;
|
|
390
618
|
}
|
|
391
619
|
interface AssistantMessageSourcesSlotProps {
|
|
392
620
|
/** Citations to display */
|
|
393
|
-
citations: Citation[];
|
|
621
|
+
citations: Citation$1[];
|
|
394
622
|
}
|
|
395
623
|
interface AssistantMessageChartsSlotProps {
|
|
396
624
|
/** Chart data */
|
|
@@ -398,11 +626,11 @@ interface AssistantMessageChartsSlotProps {
|
|
|
398
626
|
}
|
|
399
627
|
interface AssistantMessageCodeOutputsSlotProps {
|
|
400
628
|
/** Code execution outputs */
|
|
401
|
-
outputs: CodeOutput[];
|
|
629
|
+
outputs: CodeOutput$1[];
|
|
402
630
|
}
|
|
403
631
|
interface AssistantMessageArtifactsSlotProps {
|
|
404
632
|
/** Downloadable artifacts */
|
|
405
|
-
artifacts: Artifact[];
|
|
633
|
+
artifacts: Artifact$1[];
|
|
406
634
|
}
|
|
407
635
|
interface AssistantMessageActionsSlotProps {
|
|
408
636
|
/** Copy content to clipboard */
|
|
@@ -470,13 +698,15 @@ interface AssistantMessageClassNames {
|
|
|
470
698
|
}
|
|
471
699
|
interface AssistantMessageProps {
|
|
472
700
|
/** Assistant turn data */
|
|
473
|
-
turn: AssistantTurn;
|
|
701
|
+
turn: AssistantTurn$1;
|
|
474
702
|
/** Turn ID for regenerate operations */
|
|
475
703
|
turnId?: string;
|
|
704
|
+
/** When true, this is the last turn (Regenerate button shown only on last assistant message) */
|
|
705
|
+
isLastTurn?: boolean;
|
|
476
706
|
/** Whether response is being streamed */
|
|
477
707
|
isStreaming?: boolean;
|
|
478
708
|
/** Pending question for HITL */
|
|
479
|
-
pendingQuestion?: PendingQuestion | null;
|
|
709
|
+
pendingQuestion?: PendingQuestion$1 | null;
|
|
480
710
|
/** Slot overrides */
|
|
481
711
|
slots?: AssistantMessageSlots;
|
|
482
712
|
/** Class name overrides */
|
|
@@ -495,12 +725,16 @@ interface AssistantMessageProps {
|
|
|
495
725
|
hideActions?: boolean;
|
|
496
726
|
/** Hide timestamp */
|
|
497
727
|
hideTimestamp?: boolean;
|
|
728
|
+
/** Show debug panel */
|
|
729
|
+
showDebug?: boolean;
|
|
498
730
|
}
|
|
499
|
-
declare function AssistantMessage({ turn, turnId, isStreaming, pendingQuestion, slots, classNames: classNameOverrides, onCopy, onRegenerate, onSendMessage, sendDisabled, hideAvatar, hideActions, hideTimestamp, }: AssistantMessageProps): react_jsx_runtime.JSX.Element;
|
|
731
|
+
declare function AssistantMessage({ turn, turnId, isLastTurn, isStreaming, pendingQuestion, slots, classNames: classNameOverrides, onCopy, onRegenerate, onSendMessage, sendDisabled, hideAvatar, hideActions, hideTimestamp, showDebug, }: AssistantMessageProps): react_jsx_runtime.JSX.Element;
|
|
500
732
|
|
|
501
733
|
interface AssistantTurnViewProps {
|
|
502
734
|
/** The conversation turn containing the assistant response */
|
|
503
|
-
turn: ConversationTurn;
|
|
735
|
+
turn: ConversationTurn$1;
|
|
736
|
+
/** When true, this is the last turn in the list (Regenerate button shown only on last assistant message) */
|
|
737
|
+
isLastTurn?: boolean;
|
|
504
738
|
/** Whether the response is currently being streamed */
|
|
505
739
|
isStreaming?: boolean;
|
|
506
740
|
/** Slot overrides for customization */
|
|
@@ -514,7 +748,7 @@ interface AssistantTurnViewProps {
|
|
|
514
748
|
/** Hide timestamp */
|
|
515
749
|
hideTimestamp?: boolean;
|
|
516
750
|
}
|
|
517
|
-
declare function AssistantTurnView({ turn, isStreaming, slots, classNames, hideAvatar, hideActions, hideTimestamp, }: AssistantTurnViewProps): react_jsx_runtime.JSX.Element | null;
|
|
751
|
+
declare function AssistantTurnView({ turn, isLastTurn, isStreaming, slots, classNames, hideAvatar, hideActions, hideTimestamp, }: AssistantTurnViewProps): react_jsx_runtime.JSX.Element | null;
|
|
518
752
|
|
|
519
753
|
interface TurnBubbleClassNames {
|
|
520
754
|
/** Root container */
|
|
@@ -526,11 +760,13 @@ interface TurnBubbleClassNames {
|
|
|
526
760
|
}
|
|
527
761
|
interface TurnBubbleProps {
|
|
528
762
|
/** The conversation turn containing user and optional assistant content */
|
|
529
|
-
turn: ConversationTurn;
|
|
763
|
+
turn: ConversationTurn$1;
|
|
764
|
+
/** When true, this turn is the last in the list (e.g. Regenerate shows only on last assistant message) */
|
|
765
|
+
isLastTurn?: boolean;
|
|
530
766
|
/** Custom render function for user turn (full control) */
|
|
531
|
-
renderUserTurn?: (turn: ConversationTurn) => ReactNode;
|
|
767
|
+
renderUserTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
532
768
|
/** Custom render function for assistant turn (full control) */
|
|
533
|
-
renderAssistantTurn?: (turn: ConversationTurn) => ReactNode;
|
|
769
|
+
renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
534
770
|
/** Props passed to UserTurnView (when not using custom renderer) */
|
|
535
771
|
userTurnProps?: Omit<UserTurnViewProps, 'turn'>;
|
|
536
772
|
/** Props passed to AssistantTurnView (when not using custom renderer) */
|
|
@@ -548,13 +784,13 @@ interface TurnBubbleProps {
|
|
|
548
784
|
/** Whether assistant response is streaming */
|
|
549
785
|
isStreaming?: boolean;
|
|
550
786
|
}
|
|
551
|
-
declare function TurnBubble({ turn, renderUserTurn, renderAssistantTurn, userTurnProps, assistantTurnProps, userMessageSlots, assistantMessageSlots, userMessageClassNames, assistantMessageClassNames, classNames, isStreaming, }: TurnBubbleProps): react_jsx_runtime.JSX.Element;
|
|
787
|
+
declare function TurnBubble({ turn, isLastTurn, renderUserTurn, renderAssistantTurn, userTurnProps, assistantTurnProps, userMessageSlots, assistantMessageSlots, userMessageClassNames, assistantMessageClassNames, classNames, isStreaming, }: TurnBubbleProps): react_jsx_runtime.JSX.Element;
|
|
552
788
|
|
|
553
789
|
interface MarkdownRendererProps {
|
|
554
790
|
/** Markdown content to render */
|
|
555
791
|
content: string;
|
|
556
792
|
/** Optional citations to process and display */
|
|
557
|
-
citations?: Citation[] | null;
|
|
793
|
+
citations?: Citation$1[] | null;
|
|
558
794
|
/** Optional function to send messages (enables table export) */
|
|
559
795
|
sendMessage?: (content: string) => void;
|
|
560
796
|
/** Whether message sending is disabled */
|
|
@@ -574,30 +810,21 @@ interface ChartCardProps {
|
|
|
574
810
|
}
|
|
575
811
|
/**
|
|
576
812
|
* ChartCard renders a single chart visualization with optional PNG export.
|
|
577
|
-
*
|
|
578
|
-
* Chart types:
|
|
579
|
-
* - line: Line chart with multiple series
|
|
580
|
-
* - bar: Bar chart with multiple series
|
|
581
|
-
* - area: Area chart with multiple series (filled)
|
|
582
|
-
* - pie: Pie chart (single series)
|
|
583
|
-
* - donut: Donut chart (single series)
|
|
584
|
-
*
|
|
585
|
-
* @param chartData - Chart specification from GraphQL API
|
|
586
813
|
*/
|
|
587
814
|
declare function ChartCard({ chartData }: ChartCardProps): react_jsx_runtime.JSX.Element;
|
|
588
815
|
|
|
589
816
|
interface SourcesPanelProps {
|
|
590
|
-
citations: Citation[];
|
|
817
|
+
citations: Citation$1[];
|
|
591
818
|
}
|
|
592
819
|
declare function SourcesPanel({ citations }: SourcesPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
593
820
|
|
|
594
821
|
interface DownloadCardProps {
|
|
595
|
-
artifact: Artifact;
|
|
822
|
+
artifact: Artifact$1;
|
|
596
823
|
}
|
|
597
824
|
declare function DownloadCard({ artifact }: DownloadCardProps): react_jsx_runtime.JSX.Element;
|
|
598
825
|
|
|
599
826
|
interface InlineQuestionFormProps {
|
|
600
|
-
pendingQuestion: PendingQuestion;
|
|
827
|
+
pendingQuestion: PendingQuestion$1;
|
|
601
828
|
}
|
|
602
829
|
declare function InlineQuestionForm({ pendingQuestion }: InlineQuestionFormProps): react_jsx_runtime.JSX.Element | null;
|
|
603
830
|
|
|
@@ -610,82 +837,51 @@ interface MessageInputProps {
|
|
|
610
837
|
loading: boolean;
|
|
611
838
|
fetching?: boolean;
|
|
612
839
|
disabled?: boolean;
|
|
840
|
+
commandError?: string | null;
|
|
841
|
+
debugMode?: boolean;
|
|
842
|
+
debugSessionUsage?: SessionDebugUsage;
|
|
843
|
+
debugLimits?: DebugLimits | null;
|
|
613
844
|
messageQueue?: QueuedMessage[];
|
|
845
|
+
onClearCommandError?: () => void;
|
|
614
846
|
onMessageChange: (value: string) => void;
|
|
615
|
-
onSubmit: (e: React.FormEvent, attachments:
|
|
847
|
+
onSubmit: (e: React.FormEvent, attachments: Attachment$1[]) => void;
|
|
616
848
|
onUnqueue?: () => {
|
|
617
849
|
content: string;
|
|
618
|
-
attachments:
|
|
850
|
+
attachments: Attachment$1[];
|
|
619
851
|
} | null;
|
|
620
852
|
placeholder?: string;
|
|
621
853
|
maxFiles?: number;
|
|
622
854
|
maxFileSize?: number;
|
|
623
855
|
containerClassName?: string;
|
|
856
|
+
formClassName?: string;
|
|
624
857
|
}
|
|
625
858
|
declare const MessageInput: react.ForwardRefExoticComponent<MessageInputProps & react.RefAttributes<MessageInputRef>>;
|
|
626
859
|
|
|
627
860
|
interface AttachmentGridProps {
|
|
628
|
-
|
|
629
|
-
attachments: ImageAttachment[];
|
|
630
|
-
/** Optional callback when remove button is clicked */
|
|
861
|
+
attachments: Attachment$1[];
|
|
631
862
|
onRemove?: (index: number) => void;
|
|
632
|
-
/** Optional callback when thumbnail is clicked for preview */
|
|
633
863
|
onView?: (index: number) => void;
|
|
634
|
-
/** Additional CSS class */
|
|
635
864
|
className?: string;
|
|
636
|
-
/** If true, disable all interactions */
|
|
637
865
|
readonly?: boolean;
|
|
638
|
-
/** Maximum number of attachments to display (default: all) */
|
|
639
866
|
maxDisplay?: number;
|
|
640
|
-
/** Maximum total capacity (for warning display, default: 10) */
|
|
641
867
|
maxCapacity?: number;
|
|
642
|
-
/** Empty state message */
|
|
643
868
|
emptyMessage?: string;
|
|
644
|
-
/** Show count label above grid */
|
|
645
869
|
showCount?: boolean;
|
|
870
|
+
/** Number of files currently being processed (shows shimmer placeholders) */
|
|
871
|
+
pendingCount?: number;
|
|
646
872
|
}
|
|
647
|
-
|
|
648
|
-
* Responsive grid component for displaying image attachments
|
|
649
|
-
*
|
|
650
|
-
* Layout:
|
|
651
|
-
* - Mobile: 2 columns (grid-cols-2)
|
|
652
|
-
* - Tablet: 3 columns (sm:grid-cols-3)
|
|
653
|
-
* - Desktop: 4 columns (md:grid-cols-4)
|
|
654
|
-
*/
|
|
655
|
-
declare function AttachmentGrid({ attachments, onRemove, onView, className, readonly, maxDisplay, maxCapacity, emptyMessage, showCount, }: AttachmentGridProps): react_jsx_runtime.JSX.Element | null;
|
|
873
|
+
declare function AttachmentGrid({ attachments, onRemove, onView, className, readonly, maxDisplay, maxCapacity, emptyMessage, showCount, pendingCount, }: AttachmentGridProps): react_jsx_runtime.JSX.Element | null;
|
|
656
874
|
declare const MemoizedAttachmentGrid: react__default.MemoExoticComponent<typeof AttachmentGrid>;
|
|
657
875
|
|
|
658
876
|
interface ImageModalProps {
|
|
659
|
-
/** Whether the modal is open */
|
|
660
877
|
isOpen: boolean;
|
|
661
|
-
/** Callback to close the modal */
|
|
662
878
|
onClose: () => void;
|
|
663
|
-
/** The current attachment to display */
|
|
664
879
|
attachment: ImageAttachment;
|
|
665
|
-
/** Optional: all attachments for navigation */
|
|
666
880
|
allAttachments?: ImageAttachment[];
|
|
667
|
-
/** Optional: current index for navigation state */
|
|
668
881
|
currentIndex?: number;
|
|
669
|
-
/** Optional: callback for navigation (prev/next) */
|
|
670
882
|
onNavigate?: (direction: 'prev' | 'next') => void;
|
|
671
883
|
}
|
|
672
|
-
|
|
673
|
-
* Full-screen image modal component for viewing attachments
|
|
674
|
-
*
|
|
675
|
-
* Features:
|
|
676
|
-
* - Full-screen overlay with dark backdrop (90% opacity)
|
|
677
|
-
* - Large image display centered on screen
|
|
678
|
-
* - Close button (X) in top-right corner
|
|
679
|
-
* - Image metadata: filename, file size, MIME type
|
|
680
|
-
* - Navigation arrows (left/right) for image carousel
|
|
681
|
-
* - Keyboard support: Escape to close, Arrow keys to navigate
|
|
682
|
-
* - Click backdrop to close
|
|
683
|
-
* - Focus trap within modal
|
|
684
|
-
* - Body scroll locked when open
|
|
685
|
-
* - Image loading state with spinner
|
|
686
|
-
* - Navigation disabled at boundaries (not circular)
|
|
687
|
-
*/
|
|
688
|
-
declare function ImageModal({ isOpen, onClose, attachment, allAttachments, currentIndex, onNavigate, }: ImageModalProps): react.ReactPortal | null;
|
|
884
|
+
declare function ImageModal({ isOpen, onClose, attachment, allAttachments, currentIndex, onNavigate, }: ImageModalProps): react_jsx_runtime.JSX.Element;
|
|
689
885
|
|
|
690
886
|
/**
|
|
691
887
|
* WelcomeContent Component
|
|
@@ -701,7 +897,7 @@ interface WelcomeContentProps {
|
|
|
701
897
|
declare function WelcomeContent({ onPromptSelect, title, description, disabled }: WelcomeContentProps): react_jsx_runtime.JSX.Element;
|
|
702
898
|
|
|
703
899
|
interface CodeOutputsPanelProps {
|
|
704
|
-
outputs: CodeOutput[];
|
|
900
|
+
outputs: CodeOutput$1[];
|
|
705
901
|
}
|
|
706
902
|
declare function CodeOutputsPanel({ outputs }: CodeOutputsPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
707
903
|
|
|
@@ -719,8 +915,17 @@ interface ScrollToBottomButtonProps {
|
|
|
719
915
|
show: boolean;
|
|
720
916
|
onClick: () => void;
|
|
721
917
|
unreadCount?: number;
|
|
918
|
+
disabled?: boolean;
|
|
919
|
+
/** When set, renders a pill-style button with this label (e.g. "New messages") */
|
|
920
|
+
label?: string;
|
|
921
|
+
}
|
|
922
|
+
declare function ScrollToBottomButton({ show, onClick, unreadCount, disabled, label, }: ScrollToBottomButtonProps): react_jsx_runtime.JSX.Element;
|
|
923
|
+
|
|
924
|
+
interface CompactionDoodleProps {
|
|
925
|
+
title: string;
|
|
926
|
+
subtitle: string;
|
|
722
927
|
}
|
|
723
|
-
declare function
|
|
928
|
+
declare function CompactionDoodle({ title, subtitle }: CompactionDoodleProps): react_jsx_runtime.JSX.Element;
|
|
724
929
|
|
|
725
930
|
interface EmptyStateProps {
|
|
726
931
|
/** Optional icon to display */
|
|
@@ -983,7 +1188,9 @@ declare function ToastContainer({ toasts, onDismiss, dismissLabel }: ToastContai
|
|
|
983
1188
|
|
|
984
1189
|
/**
|
|
985
1190
|
* ConfirmModal Component
|
|
986
|
-
*
|
|
1191
|
+
* Polished confirmation dialog with contextual icon, refined typography,
|
|
1192
|
+
* and smooth micro-interactions.
|
|
1193
|
+
* Uses @headlessui/react Dialog for accessible modal behavior.
|
|
987
1194
|
*/
|
|
988
1195
|
interface ConfirmModalProps {
|
|
989
1196
|
/** Whether the modal is open */
|
|
@@ -1003,7 +1210,7 @@ interface ConfirmModalProps {
|
|
|
1003
1210
|
/** Whether this is a danger/destructive action (red confirm button) */
|
|
1004
1211
|
isDanger?: boolean;
|
|
1005
1212
|
}
|
|
1006
|
-
declare function ConfirmModalBase({ isOpen, title, message, onConfirm, onCancel, confirmText, cancelText, isDanger, }: ConfirmModalProps): react_jsx_runtime.JSX.Element
|
|
1213
|
+
declare function ConfirmModalBase({ isOpen, title, message, onConfirm, onCancel, confirmText, cancelText, isDanger, }: ConfirmModalProps): react_jsx_runtime.JSX.Element;
|
|
1007
1214
|
declare const ConfirmModal: react.MemoExoticComponent<typeof ConfirmModalBase>;
|
|
1008
1215
|
|
|
1009
1216
|
/**
|
|
@@ -1073,24 +1280,291 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
1073
1280
|
|
|
1074
1281
|
/**
|
|
1075
1282
|
* TypingIndicator Component
|
|
1076
|
-
* Displays
|
|
1283
|
+
* Displays rotating verbs with shimmer animation to show AI is thinking/processing.
|
|
1284
|
+
* Verbs are configurable via props.
|
|
1077
1285
|
*/
|
|
1078
|
-
type TypingIndicatorVariant = 'dots' | 'text' | 'pulse';
|
|
1079
1286
|
interface TypingIndicatorProps {
|
|
1080
|
-
/**
|
|
1081
|
-
|
|
1082
|
-
/**
|
|
1083
|
-
messages?: string[];
|
|
1084
|
-
/** Message rotation interval in ms (for text variant, defaults to 3000) */
|
|
1287
|
+
/** Custom thinking verbs to rotate through */
|
|
1288
|
+
verbs?: string[];
|
|
1289
|
+
/** Verb rotation interval in ms (defaults to 3000) */
|
|
1085
1290
|
rotationInterval?: number;
|
|
1086
|
-
/** Size */
|
|
1087
|
-
size?: 'sm' | 'md' | 'lg';
|
|
1088
1291
|
/** Additional CSS classes */
|
|
1089
1292
|
className?: string;
|
|
1090
1293
|
}
|
|
1091
|
-
declare function TypingIndicator({
|
|
1294
|
+
declare function TypingIndicator({ verbs, rotationInterval, className, }: TypingIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
1092
1295
|
declare const MemoizedTypingIndicator: react.MemoExoticComponent<typeof TypingIndicator>;
|
|
1093
1296
|
|
|
1297
|
+
interface SidebarProps {
|
|
1298
|
+
dataSource: ChatDataSource;
|
|
1299
|
+
onSessionSelect: (sessionId: string) => void;
|
|
1300
|
+
onNewChat: () => void;
|
|
1301
|
+
onArchivedView?: () => void;
|
|
1302
|
+
activeSessionId?: string;
|
|
1303
|
+
creating?: boolean;
|
|
1304
|
+
showAllChatsTab?: boolean;
|
|
1305
|
+
isOpen?: boolean;
|
|
1306
|
+
onClose?: () => void;
|
|
1307
|
+
headerSlot?: react__default.ReactNode;
|
|
1308
|
+
footerSlot?: react__default.ReactNode;
|
|
1309
|
+
className?: string;
|
|
1310
|
+
}
|
|
1311
|
+
declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* SessionItem Component
|
|
1315
|
+
* Individual chat session item in the sidebar with actions menu
|
|
1316
|
+
* Router-agnostic: uses onSelect callback instead of Link
|
|
1317
|
+
*/
|
|
1318
|
+
|
|
1319
|
+
interface SessionItemProps {
|
|
1320
|
+
session: Session$1;
|
|
1321
|
+
isActive: boolean;
|
|
1322
|
+
mode?: 'active' | 'archived';
|
|
1323
|
+
onSelect: (sessionId: string) => void;
|
|
1324
|
+
onArchive?: () => void;
|
|
1325
|
+
onRestore?: () => void;
|
|
1326
|
+
onPin?: () => void;
|
|
1327
|
+
onRename?: (newTitle: string) => void;
|
|
1328
|
+
onRegenerateTitle?: () => void;
|
|
1329
|
+
onDelete?: () => void;
|
|
1330
|
+
testIdPrefix?: string;
|
|
1331
|
+
className?: string;
|
|
1332
|
+
}
|
|
1333
|
+
declare const SessionItem: react__default.NamedExoticComponent<SessionItemProps>;
|
|
1334
|
+
|
|
1335
|
+
interface ArchivedChatListProps {
|
|
1336
|
+
dataSource: ChatDataSource;
|
|
1337
|
+
onBack: () => void;
|
|
1338
|
+
onSessionSelect: (sessionId: string) => void;
|
|
1339
|
+
activeSessionId?: string;
|
|
1340
|
+
className?: string;
|
|
1341
|
+
toast?: UseToastReturn;
|
|
1342
|
+
}
|
|
1343
|
+
declare function ArchivedChatList({ dataSource, onBack, onSessionSelect, activeSessionId, className, toast: toastFromProps, }: ArchivedChatListProps): react_jsx_runtime.JSX.Element;
|
|
1344
|
+
|
|
1345
|
+
interface AllChatsListProps {
|
|
1346
|
+
dataSource: ChatDataSource;
|
|
1347
|
+
onSessionSelect: (sessionId: string) => void;
|
|
1348
|
+
activeSessionId?: string;
|
|
1349
|
+
}
|
|
1350
|
+
declare function AllChatsList({ dataSource, onSessionSelect, activeSessionId }: AllChatsListProps): react_jsx_runtime.JSX.Element;
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* TabBar Component
|
|
1354
|
+
* Horizontal tabs with animated indicator for switching between views
|
|
1355
|
+
* Generic: accepts any set of tabs via props
|
|
1356
|
+
*/
|
|
1357
|
+
interface TabBarProps {
|
|
1358
|
+
tabs: Array<{
|
|
1359
|
+
id: string;
|
|
1360
|
+
label: string;
|
|
1361
|
+
}>;
|
|
1362
|
+
activeTab: string;
|
|
1363
|
+
onTabChange: (tabId: string) => void;
|
|
1364
|
+
}
|
|
1365
|
+
declare function TabBar({ tabs, activeTab, onTabChange }: TabBarProps): react_jsx_runtime.JSX.Element | null;
|
|
1366
|
+
declare const MemoizedTabBar: react.MemoExoticComponent<typeof TabBar>;
|
|
1367
|
+
|
|
1368
|
+
interface UserFilterProps {
|
|
1369
|
+
users: SessionUser[];
|
|
1370
|
+
selectedUser: SessionUser | null;
|
|
1371
|
+
onUserChange: (user: SessionUser | null) => void;
|
|
1372
|
+
loading?: boolean;
|
|
1373
|
+
}
|
|
1374
|
+
declare function UserFilter({ users, selectedUser, onUserChange, loading }: UserFilterProps): react_jsx_runtime.JSX.Element;
|
|
1375
|
+
declare const MemoizedUserFilter: react.MemoExoticComponent<typeof UserFilter>;
|
|
1376
|
+
|
|
1377
|
+
interface DateGroupHeaderProps {
|
|
1378
|
+
groupName: string;
|
|
1379
|
+
count: number;
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* Sticky header for date-based session groups
|
|
1383
|
+
* Displays group name and session count
|
|
1384
|
+
*/
|
|
1385
|
+
declare function DateGroupHeader({ groupName, count }: DateGroupHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1386
|
+
|
|
1387
|
+
interface SessionSkeletonProps {
|
|
1388
|
+
count?: number;
|
|
1389
|
+
}
|
|
1390
|
+
declare function SessionSkeleton({ count }: SessionSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
1391
|
+
|
|
1392
|
+
interface SystemMessageProps {
|
|
1393
|
+
content: string;
|
|
1394
|
+
createdAt: string;
|
|
1395
|
+
onCopy?: (content: string) => Promise<void> | void;
|
|
1396
|
+
hideActions?: boolean;
|
|
1397
|
+
hideTimestamp?: boolean;
|
|
1398
|
+
}
|
|
1399
|
+
declare function SystemMessage({ content, createdAt, onCopy, hideActions, hideTimestamp, }: SystemMessageProps): react_jsx_runtime.JSX.Element;
|
|
1400
|
+
|
|
1401
|
+
interface DebugPanelProps {
|
|
1402
|
+
trace?: DebugTrace$1;
|
|
1403
|
+
}
|
|
1404
|
+
declare function DebugPanel({ trace }: DebugPanelProps): react_jsx_runtime.JSX.Element;
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Alert Component
|
|
1408
|
+
* Standardized error/success/warning/info messages with retry capability
|
|
1409
|
+
*/
|
|
1410
|
+
type AlertVariant = 'error' | 'success' | 'warning' | 'info';
|
|
1411
|
+
interface AlertProps {
|
|
1412
|
+
variant?: AlertVariant;
|
|
1413
|
+
message: string;
|
|
1414
|
+
title?: string;
|
|
1415
|
+
onDismiss?: () => void;
|
|
1416
|
+
onRetry?: () => void;
|
|
1417
|
+
show?: boolean;
|
|
1418
|
+
dismissible?: boolean;
|
|
1419
|
+
}
|
|
1420
|
+
declare function Alert({ variant, message, title, onDismiss, onRetry, show, dismissible, }: AlertProps): react_jsx_runtime.JSX.Element;
|
|
1421
|
+
declare const _default$1: react.MemoExoticComponent<typeof Alert>;
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* Archive Banner Component
|
|
1425
|
+
* Displays when a chat session is archived and provides a restore button
|
|
1426
|
+
*/
|
|
1427
|
+
interface ArchiveBannerProps {
|
|
1428
|
+
show?: boolean;
|
|
1429
|
+
onRestore?: () => Promise<void>;
|
|
1430
|
+
restoring?: boolean;
|
|
1431
|
+
onRestoreComplete?: () => void;
|
|
1432
|
+
}
|
|
1433
|
+
declare function ArchiveBanner({ show, onRestore, restoring, onRestoreComplete, }: ArchiveBannerProps): react_jsx_runtime.JSX.Element;
|
|
1434
|
+
declare const _default: react.MemoExoticComponent<typeof ArchiveBanner>;
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* RetryActionArea Component
|
|
1438
|
+
* Displays a retry action area inline where the assistant message would appear
|
|
1439
|
+
* (typically after an interrupted request or connection loss)
|
|
1440
|
+
*
|
|
1441
|
+
* Styled to match assistant message positioning (left-aligned) so users see
|
|
1442
|
+
* the retry button contextually in the conversation flow.
|
|
1443
|
+
*/
|
|
1444
|
+
interface RetryActionAreaProps {
|
|
1445
|
+
/** Callback when retry button is clicked */
|
|
1446
|
+
onRetry: () => void;
|
|
1447
|
+
}
|
|
1448
|
+
declare const RetryActionArea: react.NamedExoticComponent<RetryActionAreaProps>;
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* StreamError Component
|
|
1452
|
+
* Error recovery UI for streaming failures
|
|
1453
|
+
*/
|
|
1454
|
+
interface StreamErrorProps {
|
|
1455
|
+
/** Error message to display */
|
|
1456
|
+
error: string;
|
|
1457
|
+
/** Callback to retry the failed operation */
|
|
1458
|
+
onRetry?: () => void;
|
|
1459
|
+
/** Callback to regenerate the message */
|
|
1460
|
+
onRegenerate?: () => void;
|
|
1461
|
+
/** Whether to show compact mode (less padding) */
|
|
1462
|
+
compact?: boolean;
|
|
1463
|
+
}
|
|
1464
|
+
declare function StreamError({ error, onRetry, onRegenerate, compact, }: StreamErrorProps): react_jsx_runtime.JSX.Element;
|
|
1465
|
+
|
|
1466
|
+
interface ActionableMessage {
|
|
1467
|
+
id: string;
|
|
1468
|
+
role: MessageRole;
|
|
1469
|
+
content: string;
|
|
1470
|
+
}
|
|
1471
|
+
interface MessageActionsProps {
|
|
1472
|
+
message: ActionableMessage;
|
|
1473
|
+
onCopy: (text: string) => Promise<void>;
|
|
1474
|
+
onRegenerate?: (messageId: string) => Promise<void>;
|
|
1475
|
+
onEdit?: (message: ActionableMessage) => void;
|
|
1476
|
+
}
|
|
1477
|
+
declare function MessageActions({ message, onCopy, onRegenerate, onEdit, }: MessageActionsProps): react_jsx_runtime.JSX.Element;
|
|
1478
|
+
|
|
1479
|
+
interface AttachmentPreviewProps {
|
|
1480
|
+
/** The attachment to display */
|
|
1481
|
+
attachment: ImageAttachment;
|
|
1482
|
+
/** Optional callback when remove button is clicked */
|
|
1483
|
+
onRemove?: () => void;
|
|
1484
|
+
/** Optional callback when thumbnail is clicked (for enlargement) */
|
|
1485
|
+
onClick?: () => void;
|
|
1486
|
+
/** If true, hide remove button and disable click interactions */
|
|
1487
|
+
readonly?: boolean;
|
|
1488
|
+
}
|
|
1489
|
+
declare const AttachmentPreview: react.NamedExoticComponent<AttachmentPreviewProps>;
|
|
1490
|
+
|
|
1491
|
+
interface AttachmentUploadProps {
|
|
1492
|
+
/** Callback fired when files are successfully converted and validated */
|
|
1493
|
+
onAttachmentsSelected: (attachments: Attachment$1[]) => void;
|
|
1494
|
+
/** Maximum number of attachments allowed (default: 10) */
|
|
1495
|
+
maxAttachments?: number;
|
|
1496
|
+
/** Maximum file size in bytes (default: 20 MB) */
|
|
1497
|
+
maxSizeBytes?: number;
|
|
1498
|
+
/** Whether the component is disabled */
|
|
1499
|
+
disabled?: boolean;
|
|
1500
|
+
}
|
|
1501
|
+
declare const AttachmentUpload: react.NamedExoticComponent<AttachmentUploadProps>;
|
|
1502
|
+
|
|
1503
|
+
interface ScreenReaderAnnouncerProps {
|
|
1504
|
+
message: string;
|
|
1505
|
+
politeness?: 'polite' | 'assertive';
|
|
1506
|
+
clearAfter?: number;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Screen reader announcer component for live region updates
|
|
1510
|
+
* Uses ARIA live regions to announce dynamic content changes
|
|
1511
|
+
*
|
|
1512
|
+
* @param message - The message to announce
|
|
1513
|
+
* @param politeness - 'polite' (wait for pause) or 'assertive' (immediate)
|
|
1514
|
+
* @param clearAfter - Optional milliseconds to clear message after announcement
|
|
1515
|
+
*
|
|
1516
|
+
* @example
|
|
1517
|
+
* <ScreenReaderAnnouncer
|
|
1518
|
+
* message="New message received"
|
|
1519
|
+
* politeness="polite"
|
|
1520
|
+
* />
|
|
1521
|
+
*/
|
|
1522
|
+
declare function ScreenReaderAnnouncer({ message, politeness, clearAfter, }: ScreenReaderAnnouncerProps): react_jsx_runtime.JSX.Element;
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Skip to main content link for keyboard navigation
|
|
1526
|
+
* Hidden by default, visible on keyboard focus
|
|
1527
|
+
* Allows users to skip navigation and go directly to main content
|
|
1528
|
+
*/
|
|
1529
|
+
declare function SkipLink(): react_jsx_runtime.JSX.Element;
|
|
1530
|
+
|
|
1531
|
+
interface ContextMenuItem {
|
|
1532
|
+
id: string;
|
|
1533
|
+
label: string;
|
|
1534
|
+
icon?: ReactNode;
|
|
1535
|
+
onClick: () => void;
|
|
1536
|
+
variant?: 'default' | 'danger';
|
|
1537
|
+
disabled?: boolean;
|
|
1538
|
+
}
|
|
1539
|
+
interface TouchContextMenuProps {
|
|
1540
|
+
items: ContextMenuItem[];
|
|
1541
|
+
isOpen: boolean;
|
|
1542
|
+
onClose: () => void;
|
|
1543
|
+
anchorRect: DOMRect | null;
|
|
1544
|
+
}
|
|
1545
|
+
declare const TouchContextMenu: FC<TouchContextMenuProps>;
|
|
1546
|
+
|
|
1547
|
+
interface QuestionFormProps {
|
|
1548
|
+
pendingQuestion: PendingQuestion$1;
|
|
1549
|
+
sessionId: string;
|
|
1550
|
+
onSubmit: (answers: QuestionAnswers) => Promise<void>;
|
|
1551
|
+
onCancel: () => void;
|
|
1552
|
+
}
|
|
1553
|
+
declare function QuestionForm({ pendingQuestion, onSubmit, onCancel, }: QuestionFormProps): react_jsx_runtime.JSX.Element;
|
|
1554
|
+
|
|
1555
|
+
interface QuestionStepProps {
|
|
1556
|
+
question: Question;
|
|
1557
|
+
selectedAnswers: QuestionAnswers;
|
|
1558
|
+
onAnswer: (answerData: QuestionAnswerData) => void;
|
|
1559
|
+
}
|
|
1560
|
+
declare function QuestionStep({ question, selectedAnswers, onAnswer, }: QuestionStepProps): react_jsx_runtime.JSX.Element;
|
|
1561
|
+
|
|
1562
|
+
interface ConfirmationStepProps {
|
|
1563
|
+
questions: Question[];
|
|
1564
|
+
answers: QuestionAnswers;
|
|
1565
|
+
}
|
|
1566
|
+
declare function ConfirmationStep({ questions, answers, }: ConfirmationStepProps): react_jsx_runtime.JSX.Element;
|
|
1567
|
+
|
|
1094
1568
|
interface SlotProps extends HTMLAttributes<HTMLElement> {
|
|
1095
1569
|
children?: ReactNode;
|
|
1096
1570
|
}
|
|
@@ -1501,22 +1975,22 @@ interface FileValidationError {
|
|
|
1501
1975
|
interface UseAttachmentsOptions {
|
|
1502
1976
|
/** Maximum number of files (default: 10) */
|
|
1503
1977
|
maxFiles?: number;
|
|
1504
|
-
/** Maximum file size in bytes (default:
|
|
1978
|
+
/** Maximum file size in bytes (default: 20MB) */
|
|
1505
1979
|
maxFileSize?: number;
|
|
1506
|
-
/** Allowed MIME types (default:
|
|
1980
|
+
/** Allowed MIME types (default: attachment allowlist) */
|
|
1507
1981
|
allowedTypes?: string[];
|
|
1508
1982
|
/** Custom validation function */
|
|
1509
1983
|
validate?: (file: File) => string | null;
|
|
1510
1984
|
/** Callback when files are added */
|
|
1511
|
-
onAdd?: (files: Attachment[]) => void;
|
|
1985
|
+
onAdd?: (files: Attachment$1[]) => void;
|
|
1512
1986
|
/** Callback when a file is removed */
|
|
1513
|
-
onRemove?: (file: Attachment) => void;
|
|
1987
|
+
onRemove?: (file: Attachment$1) => void;
|
|
1514
1988
|
/** Callback when validation fails */
|
|
1515
1989
|
onError?: (errors: FileValidationError[]) => void;
|
|
1516
1990
|
}
|
|
1517
1991
|
interface UseAttachmentsReturn {
|
|
1518
1992
|
/** Current attachments */
|
|
1519
|
-
files: Attachment[];
|
|
1993
|
+
files: Attachment$1[];
|
|
1520
1994
|
/** Validation errors from last operation */
|
|
1521
1995
|
errors: FileValidationError[];
|
|
1522
1996
|
/** Whether files are being processed */
|
|
@@ -1528,13 +2002,13 @@ interface UseAttachmentsReturn {
|
|
|
1528
2002
|
/** Add files (validates and processes) */
|
|
1529
2003
|
add: (files: FileList | File[]) => Promise<void>;
|
|
1530
2004
|
/** Remove a specific file */
|
|
1531
|
-
remove: (fileOrId: Attachment | string) => void;
|
|
2005
|
+
remove: (fileOrId: Attachment$1 | string) => void;
|
|
1532
2006
|
/** Clear all files */
|
|
1533
2007
|
clear: () => void;
|
|
1534
2008
|
/** Clear errors */
|
|
1535
2009
|
clearErrors: () => void;
|
|
1536
2010
|
/** Set files directly (for controlled mode) */
|
|
1537
|
-
setFiles: (files: Attachment[]) => void;
|
|
2011
|
+
setFiles: (files: Attachment$1[]) => void;
|
|
1538
2012
|
}
|
|
1539
2013
|
/**
|
|
1540
2014
|
* Hook for managing file attachments
|
|
@@ -1617,16 +2091,88 @@ interface UseMarkdownCopyReturn {
|
|
|
1617
2091
|
declare function useMarkdownCopy(options?: UseMarkdownCopyOptions): UseMarkdownCopyReturn;
|
|
1618
2092
|
|
|
1619
2093
|
/**
|
|
1620
|
-
*
|
|
1621
|
-
*
|
|
1622
|
-
*
|
|
2094
|
+
* useScrollToBottom Hook
|
|
2095
|
+
* Manages scroll-to-bottom functionality with smart auto-scroll
|
|
2096
|
+
* Only scrolls if user is near the bottom (within threshold)
|
|
1623
2097
|
*/
|
|
2098
|
+
interface UseScrollToBottomReturn {
|
|
2099
|
+
/**
|
|
2100
|
+
* Ref to attach to the messages container
|
|
2101
|
+
*/
|
|
2102
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
2103
|
+
/**
|
|
2104
|
+
* Whether to show the scroll-to-bottom button
|
|
2105
|
+
*/
|
|
2106
|
+
showScrollButton: boolean;
|
|
2107
|
+
/**
|
|
2108
|
+
* Function to scroll to bottom
|
|
2109
|
+
*/
|
|
2110
|
+
scrollToBottom: () => void;
|
|
2111
|
+
}
|
|
1624
2112
|
/**
|
|
1625
|
-
*
|
|
2113
|
+
* Hook for managing scroll-to-bottom behavior
|
|
2114
|
+
* Automatically scrolls if user is near the bottom
|
|
2115
|
+
* Shows button only when scrolled up significantly
|
|
1626
2116
|
*/
|
|
1627
|
-
declare
|
|
1628
|
-
|
|
1629
|
-
|
|
2117
|
+
declare function useScrollToBottom(items: unknown[]): UseScrollToBottomReturn;
|
|
2118
|
+
|
|
2119
|
+
interface ShortcutConfig {
|
|
2120
|
+
key: string;
|
|
2121
|
+
ctrl?: boolean;
|
|
2122
|
+
shift?: boolean;
|
|
2123
|
+
alt?: boolean;
|
|
2124
|
+
meta?: boolean;
|
|
2125
|
+
callback: () => void;
|
|
2126
|
+
preventDefault?: boolean;
|
|
2127
|
+
description?: string;
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Hook for managing global keyboard shortcuts
|
|
2131
|
+
* Automatically handles modifier keys and input field exclusion
|
|
2132
|
+
*
|
|
2133
|
+
* @param shortcuts - Array of keyboard shortcut configurations
|
|
2134
|
+
*
|
|
2135
|
+
* @example
|
|
2136
|
+
* useKeyboardShortcuts([
|
|
2137
|
+
* { key: 'k', ctrl: true, callback: () => focusSearch(), description: 'Focus search' },
|
|
2138
|
+
* { key: '?', callback: () => setShowHelp(true), description: 'Show keyboard shortcuts' },
|
|
2139
|
+
* ])
|
|
2140
|
+
*/
|
|
2141
|
+
declare function useKeyboardShortcuts(shortcuts: ShortcutConfig[]): void;
|
|
2142
|
+
|
|
2143
|
+
interface LongPressOptions {
|
|
2144
|
+
delay?: number;
|
|
2145
|
+
onLongPress: (e: React.TouchEvent | React.MouseEvent) => void;
|
|
2146
|
+
onPressStart?: () => void;
|
|
2147
|
+
onPressCancel?: () => void;
|
|
2148
|
+
moveThreshold?: number;
|
|
2149
|
+
hapticFeedback?: boolean;
|
|
2150
|
+
}
|
|
2151
|
+
interface LongPressEventHandlers {
|
|
2152
|
+
onTouchStart: (e: React.TouchEvent) => void;
|
|
2153
|
+
onTouchEnd: (e: React.TouchEvent) => void;
|
|
2154
|
+
onTouchMove: (e: React.TouchEvent) => void;
|
|
2155
|
+
onMouseDown?: (e: React.MouseEvent) => void;
|
|
2156
|
+
onMouseUp?: (e: React.MouseEvent) => void;
|
|
2157
|
+
onMouseLeave?: (e: React.MouseEvent) => void;
|
|
2158
|
+
}
|
|
2159
|
+
interface LongPressResult {
|
|
2160
|
+
handlers: LongPressEventHandlers;
|
|
2161
|
+
isPressed: boolean;
|
|
2162
|
+
}
|
|
2163
|
+
declare function useLongPress(options: LongPressOptions): LongPressResult;
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* Framer Motion animation variants for BiChat UI
|
|
2167
|
+
* Subtle, professional animations for enterprise applications
|
|
2168
|
+
* Respects prefers-reduced-motion for accessibility
|
|
2169
|
+
*/
|
|
2170
|
+
/**
|
|
2171
|
+
* Fade in animation
|
|
2172
|
+
*/
|
|
2173
|
+
declare const fadeInVariants: {
|
|
2174
|
+
initial: {
|
|
2175
|
+
opacity: number;
|
|
1630
2176
|
};
|
|
1631
2177
|
animate: {
|
|
1632
2178
|
opacity: number;
|
|
@@ -1808,6 +2354,31 @@ declare const typingDotVariants: {
|
|
|
1808
2354
|
};
|
|
1809
2355
|
};
|
|
1810
2356
|
};
|
|
2357
|
+
/**
|
|
2358
|
+
* Verb transition for typing indicator
|
|
2359
|
+
* Smooth slide-up animation for rotating text
|
|
2360
|
+
*/
|
|
2361
|
+
declare const verbTransitionVariants: {
|
|
2362
|
+
initial: {
|
|
2363
|
+
y: number;
|
|
2364
|
+
opacity: number;
|
|
2365
|
+
};
|
|
2366
|
+
animate: {
|
|
2367
|
+
y: number;
|
|
2368
|
+
opacity: number;
|
|
2369
|
+
transition: {
|
|
2370
|
+
duration: number;
|
|
2371
|
+
ease: string;
|
|
2372
|
+
};
|
|
2373
|
+
};
|
|
2374
|
+
exit: {
|
|
2375
|
+
y: number;
|
|
2376
|
+
opacity: number;
|
|
2377
|
+
transition: {
|
|
2378
|
+
duration: number;
|
|
2379
|
+
};
|
|
2380
|
+
};
|
|
2381
|
+
};
|
|
1811
2382
|
/**
|
|
1812
2383
|
* Floating button (scroll to bottom, etc.)
|
|
1813
2384
|
*/
|
|
@@ -1877,35 +2448,62 @@ declare const toastVariants: {
|
|
|
1877
2448
|
};
|
|
1878
2449
|
};
|
|
1879
2450
|
};
|
|
1880
|
-
|
|
1881
2451
|
/**
|
|
1882
|
-
*
|
|
1883
|
-
* Prevents excessive requests within a time window
|
|
2452
|
+
* Session item with subtle slide-right on hover
|
|
1884
2453
|
*/
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
}
|
|
2454
|
+
declare const sessionItemVariants: {
|
|
2455
|
+
initial: {
|
|
2456
|
+
opacity: number;
|
|
2457
|
+
x: number;
|
|
2458
|
+
};
|
|
2459
|
+
animate: {
|
|
2460
|
+
opacity: number;
|
|
2461
|
+
x: number;
|
|
2462
|
+
transition: {
|
|
2463
|
+
duration: number;
|
|
2464
|
+
};
|
|
2465
|
+
};
|
|
2466
|
+
hover: {
|
|
2467
|
+
x: number;
|
|
2468
|
+
transition: {
|
|
2469
|
+
duration: number;
|
|
2470
|
+
};
|
|
2471
|
+
};
|
|
2472
|
+
exit: {
|
|
2473
|
+
opacity: number;
|
|
2474
|
+
x: number;
|
|
2475
|
+
transition: {
|
|
2476
|
+
duration: number;
|
|
2477
|
+
};
|
|
2478
|
+
};
|
|
2479
|
+
};
|
|
2480
|
+
/**
|
|
2481
|
+
* Error/alert message slide-in
|
|
2482
|
+
*/
|
|
2483
|
+
declare const errorMessageVariants: {
|
|
2484
|
+
initial: {
|
|
2485
|
+
opacity: number;
|
|
2486
|
+
y: number;
|
|
2487
|
+
height: number;
|
|
2488
|
+
};
|
|
2489
|
+
animate: {
|
|
2490
|
+
opacity: number;
|
|
2491
|
+
y: number;
|
|
2492
|
+
height: string;
|
|
2493
|
+
transition: {
|
|
2494
|
+
duration: number;
|
|
2495
|
+
ease: number[];
|
|
2496
|
+
};
|
|
2497
|
+
};
|
|
2498
|
+
exit: {
|
|
2499
|
+
opacity: number;
|
|
2500
|
+
y: number;
|
|
2501
|
+
height: number;
|
|
2502
|
+
transition: {
|
|
2503
|
+
duration: number;
|
|
2504
|
+
};
|
|
2505
|
+
};
|
|
2506
|
+
};
|
|
1909
2507
|
|
|
1910
2508
|
interface ChatSessionProviderProps {
|
|
1911
2509
|
dataSource: ChatDataSource;
|
|
@@ -1914,30 +2512,24 @@ interface ChatSessionProviderProps {
|
|
|
1914
2512
|
children: ReactNode;
|
|
1915
2513
|
}
|
|
1916
2514
|
declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, children }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
2515
|
+
declare function useChatSession(): ChatSessionStateValue;
|
|
2516
|
+
declare function useChatMessaging(): ChatMessagingStateValue;
|
|
2517
|
+
declare function useChatInput(): ChatInputStateValue;
|
|
1917
2518
|
declare function useChat(): ChatSessionContextValue;
|
|
1918
2519
|
|
|
1919
2520
|
/**
|
|
1920
|
-
*
|
|
2521
|
+
* BiChat context types layered on top of canonical applet-core context contracts.
|
|
1921
2522
|
*/
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
permissions: string[];
|
|
1928
|
-
}
|
|
1929
|
-
interface TenantContext {
|
|
1930
|
-
id: string;
|
|
1931
|
-
name: string;
|
|
1932
|
-
}
|
|
1933
|
-
interface LocaleContext {
|
|
1934
|
-
language: string;
|
|
1935
|
-
translations: Record<string, string>;
|
|
1936
|
-
}
|
|
1937
|
-
interface AppConfig {
|
|
1938
|
-
graphQLEndpoint: string;
|
|
2523
|
+
|
|
2524
|
+
type UserContext = UserContext$1;
|
|
2525
|
+
type TenantContext = TenantContext$1;
|
|
2526
|
+
type LocaleContext = LocaleContext$1;
|
|
2527
|
+
type AppConfig = AppConfig$1 & {
|
|
1939
2528
|
streamEndpoint: string;
|
|
1940
|
-
|
|
2529
|
+
basePath: string;
|
|
2530
|
+
assetsBasePath: string;
|
|
2531
|
+
rpcUIEndpoint: string;
|
|
2532
|
+
};
|
|
1941
2533
|
interface Extensions {
|
|
1942
2534
|
branding?: {
|
|
1943
2535
|
appName?: string;
|
|
@@ -1972,14 +2564,23 @@ interface Extensions {
|
|
|
1972
2564
|
codeInterpreter?: boolean;
|
|
1973
2565
|
multiAgent?: boolean;
|
|
1974
2566
|
};
|
|
2567
|
+
llm?: {
|
|
2568
|
+
provider?: string;
|
|
2569
|
+
apiKeyConfigured?: boolean;
|
|
2570
|
+
};
|
|
2571
|
+
debug?: {
|
|
2572
|
+
limits?: {
|
|
2573
|
+
policyMaxTokens: number;
|
|
2574
|
+
modelMaxTokens: number;
|
|
2575
|
+
effectiveMaxTokens: number;
|
|
2576
|
+
completionReserveTokens: number;
|
|
2577
|
+
};
|
|
2578
|
+
};
|
|
1975
2579
|
}
|
|
1976
|
-
|
|
1977
|
-
user: UserContext;
|
|
1978
|
-
tenant: TenantContext;
|
|
1979
|
-
locale: LocaleContext;
|
|
2580
|
+
type IotaContext = Omit<InitialContext, 'config' | 'extensions'> & {
|
|
1980
2581
|
config: AppConfig;
|
|
1981
2582
|
extensions?: Extensions;
|
|
1982
|
-
}
|
|
2583
|
+
};
|
|
1983
2584
|
declare global {
|
|
1984
2585
|
interface Window {
|
|
1985
2586
|
__BICHAT_CONTEXT__: IotaContext;
|
|
@@ -2014,7 +2615,7 @@ interface BiChatConfig {
|
|
|
2014
2615
|
translations: Record<string, string>;
|
|
2015
2616
|
};
|
|
2016
2617
|
endpoints: {
|
|
2017
|
-
|
|
2618
|
+
rpc: string;
|
|
2018
2619
|
stream: string;
|
|
2019
2620
|
};
|
|
2020
2621
|
csrfToken?: string;
|
|
@@ -2131,23 +2732,23 @@ declare function createHeadersWithCSRF(init?: HeadersInit): Headers;
|
|
|
2131
2732
|
|
|
2132
2733
|
/**
|
|
2133
2734
|
* Built-in HTTP data source with SSE streaming and AbortController
|
|
2134
|
-
* Implements ChatDataSource interface with real HTTP/
|
|
2735
|
+
* Implements ChatDataSource interface with real HTTP/RPC calls
|
|
2135
2736
|
*
|
|
2136
2737
|
* Uses turn-based architecture - fetches ConversationTurns instead of flat messages.
|
|
2137
2738
|
*/
|
|
2138
2739
|
|
|
2139
2740
|
interface HttpDataSourceConfig {
|
|
2140
2741
|
baseUrl: string;
|
|
2141
|
-
|
|
2742
|
+
rpcEndpoint: string;
|
|
2142
2743
|
streamEndpoint?: string;
|
|
2143
2744
|
csrfToken?: string | (() => string);
|
|
2144
2745
|
headers?: Record<string, string>;
|
|
2145
2746
|
timeout?: number;
|
|
2146
2747
|
}
|
|
2147
2748
|
interface SessionState {
|
|
2148
|
-
session: Session;
|
|
2149
|
-
turns: ConversationTurn[];
|
|
2150
|
-
pendingQuestion?: PendingQuestion | null;
|
|
2749
|
+
session: Session$1;
|
|
2750
|
+
turns: ConversationTurn$1[];
|
|
2751
|
+
pendingQuestion?: PendingQuestion$1 | null;
|
|
2151
2752
|
}
|
|
2152
2753
|
interface Result<T> {
|
|
2153
2754
|
success: boolean;
|
|
@@ -2157,6 +2758,7 @@ interface Result<T> {
|
|
|
2157
2758
|
declare class HttpDataSource implements ChatDataSource {
|
|
2158
2759
|
private config;
|
|
2159
2760
|
private abortController;
|
|
2761
|
+
private rpc;
|
|
2160
2762
|
constructor(config: HttpDataSourceConfig);
|
|
2161
2763
|
/**
|
|
2162
2764
|
* Get CSRF token from config
|
|
@@ -2166,57 +2768,380 @@ declare class HttpDataSource implements ChatDataSource {
|
|
|
2166
2768
|
* Create headers for HTTP requests
|
|
2167
2769
|
*/
|
|
2168
2770
|
private createHeaders;
|
|
2169
|
-
|
|
2170
|
-
* Execute GraphQL query
|
|
2171
|
-
*/
|
|
2172
|
-
private graphql;
|
|
2771
|
+
private callRPC;
|
|
2173
2772
|
/**
|
|
2174
2773
|
* Create a new chat session
|
|
2175
2774
|
*/
|
|
2176
|
-
createSession(): Promise<Session>;
|
|
2775
|
+
createSession(): Promise<Session$1>;
|
|
2177
2776
|
/**
|
|
2178
2777
|
* Fetch an existing session with turns (turn-based architecture)
|
|
2179
2778
|
*/
|
|
2180
2779
|
fetchSession(id: string): Promise<SessionState | null>;
|
|
2780
|
+
fetchSessionArtifacts(sessionId: string, options?: {
|
|
2781
|
+
limit?: number;
|
|
2782
|
+
offset?: number;
|
|
2783
|
+
}): Promise<{
|
|
2784
|
+
artifacts: SessionArtifact[];
|
|
2785
|
+
hasMore?: boolean;
|
|
2786
|
+
nextOffset?: number;
|
|
2787
|
+
}>;
|
|
2788
|
+
uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{
|
|
2789
|
+
artifacts: SessionArtifact[];
|
|
2790
|
+
}>;
|
|
2791
|
+
renameSessionArtifact(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
2792
|
+
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
2181
2793
|
/**
|
|
2182
2794
|
* Send a message and stream the response using SSE
|
|
2183
2795
|
*/
|
|
2184
|
-
sendMessage(sessionId: string, content: string, attachments?: Attachment[], signal?: AbortSignal): AsyncGenerator<StreamChunk>;
|
|
2796
|
+
sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
2185
2797
|
/**
|
|
2186
2798
|
* Cancel ongoing stream
|
|
2187
2799
|
*/
|
|
2188
2800
|
cancelStream(): void;
|
|
2801
|
+
/**
|
|
2802
|
+
* Clear session history in-place.
|
|
2803
|
+
*/
|
|
2804
|
+
clearSessionHistory(sessionId: string): Promise<{
|
|
2805
|
+
success: boolean;
|
|
2806
|
+
deletedMessages: number;
|
|
2807
|
+
deletedArtifacts: number;
|
|
2808
|
+
}>;
|
|
2809
|
+
/**
|
|
2810
|
+
* Compact session history into summarized turn.
|
|
2811
|
+
*/
|
|
2812
|
+
compactSessionHistory(sessionId: string): Promise<{
|
|
2813
|
+
success: boolean;
|
|
2814
|
+
summary: string;
|
|
2815
|
+
deletedMessages: number;
|
|
2816
|
+
deletedArtifacts: number;
|
|
2817
|
+
}>;
|
|
2189
2818
|
/**
|
|
2190
2819
|
* Submit answers to a pending question
|
|
2191
2820
|
*/
|
|
2192
2821
|
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<Result<void>>;
|
|
2193
2822
|
/**
|
|
2194
|
-
*
|
|
2823
|
+
* Reject a pending question
|
|
2195
2824
|
*/
|
|
2196
|
-
|
|
2825
|
+
rejectPendingQuestion(sessionId: string): Promise<Result<void>>;
|
|
2197
2826
|
/**
|
|
2198
2827
|
* Navigate to a session (optional, for SPA routing)
|
|
2199
2828
|
*/
|
|
2200
2829
|
navigateToSession?(sessionId: string): void;
|
|
2830
|
+
listSessions(options?: {
|
|
2831
|
+
limit?: number;
|
|
2832
|
+
offset?: number;
|
|
2833
|
+
includeArchived?: boolean;
|
|
2834
|
+
}): Promise<SessionListResult$1>;
|
|
2835
|
+
archiveSession(sessionId: string): Promise<Session$1>;
|
|
2836
|
+
unarchiveSession(sessionId: string): Promise<Session$1>;
|
|
2837
|
+
pinSession(sessionId: string): Promise<Session$1>;
|
|
2838
|
+
unpinSession(sessionId: string): Promise<Session$1>;
|
|
2839
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
2840
|
+
renameSession(sessionId: string, title: string): Promise<Session$1>;
|
|
2841
|
+
regenerateSessionTitle(sessionId: string): Promise<Session$1>;
|
|
2201
2842
|
}
|
|
2202
2843
|
/**
|
|
2203
2844
|
* Factory function to create HttpDataSource
|
|
2204
2845
|
*/
|
|
2205
2846
|
declare function createHttpDataSource(config: HttpDataSourceConfig): ChatDataSource;
|
|
2206
2847
|
|
|
2848
|
+
type BichatRPC = {
|
|
2849
|
+
"bichat.artifact.delete": {
|
|
2850
|
+
params: SessionIDParams;
|
|
2851
|
+
result: OkResult;
|
|
2852
|
+
};
|
|
2853
|
+
"bichat.artifact.update": {
|
|
2854
|
+
params: ArtifactUpdateParams;
|
|
2855
|
+
result: ArtifactResult;
|
|
2856
|
+
};
|
|
2857
|
+
"bichat.ping": {
|
|
2858
|
+
params: PingParams;
|
|
2859
|
+
result: PingResult;
|
|
2860
|
+
};
|
|
2861
|
+
"bichat.question.reject": {
|
|
2862
|
+
params: QuestionCancelParams;
|
|
2863
|
+
result: SessionGetResult;
|
|
2864
|
+
};
|
|
2865
|
+
"bichat.question.submit": {
|
|
2866
|
+
params: QuestionSubmitParams;
|
|
2867
|
+
result: SessionGetResult;
|
|
2868
|
+
};
|
|
2869
|
+
"bichat.session.archive": {
|
|
2870
|
+
params: SessionIDParams;
|
|
2871
|
+
result: SessionCreateResult;
|
|
2872
|
+
};
|
|
2873
|
+
"bichat.session.artifacts": {
|
|
2874
|
+
params: SessionArtifactsParams;
|
|
2875
|
+
result: SessionArtifactsResult;
|
|
2876
|
+
};
|
|
2877
|
+
"bichat.session.clear": {
|
|
2878
|
+
params: SessionIDParams;
|
|
2879
|
+
result: SessionClearResult;
|
|
2880
|
+
};
|
|
2881
|
+
"bichat.session.compact": {
|
|
2882
|
+
params: SessionIDParams;
|
|
2883
|
+
result: SessionCompactResult;
|
|
2884
|
+
};
|
|
2885
|
+
"bichat.session.create": {
|
|
2886
|
+
params: SessionCreateParams;
|
|
2887
|
+
result: SessionCreateResult;
|
|
2888
|
+
};
|
|
2889
|
+
"bichat.session.delete": {
|
|
2890
|
+
params: SessionIDParams;
|
|
2891
|
+
result: OkResult;
|
|
2892
|
+
};
|
|
2893
|
+
"bichat.session.get": {
|
|
2894
|
+
params: SessionGetParams;
|
|
2895
|
+
result: SessionGetResult;
|
|
2896
|
+
};
|
|
2897
|
+
"bichat.session.list": {
|
|
2898
|
+
params: SessionListParams;
|
|
2899
|
+
result: SessionListResult;
|
|
2900
|
+
};
|
|
2901
|
+
"bichat.session.pin": {
|
|
2902
|
+
params: SessionIDParams;
|
|
2903
|
+
result: SessionCreateResult;
|
|
2904
|
+
};
|
|
2905
|
+
"bichat.session.regenerateTitle": {
|
|
2906
|
+
params: SessionIDParams;
|
|
2907
|
+
result: SessionCreateResult;
|
|
2908
|
+
};
|
|
2909
|
+
"bichat.session.unarchive": {
|
|
2910
|
+
params: SessionIDParams;
|
|
2911
|
+
result: SessionCreateResult;
|
|
2912
|
+
};
|
|
2913
|
+
"bichat.session.unpin": {
|
|
2914
|
+
params: SessionIDParams;
|
|
2915
|
+
result: SessionCreateResult;
|
|
2916
|
+
};
|
|
2917
|
+
"bichat.session.updateTitle": {
|
|
2918
|
+
params: SessionUpdateTitleParams;
|
|
2919
|
+
result: SessionCreateResult;
|
|
2920
|
+
};
|
|
2921
|
+
"bichat.session.uploadArtifacts": {
|
|
2922
|
+
params: SessionUploadArtifactsParams;
|
|
2923
|
+
result: SessionUploadArtifactsResult;
|
|
2924
|
+
};
|
|
2925
|
+
};
|
|
2926
|
+
interface Artifact {
|
|
2927
|
+
id: string;
|
|
2928
|
+
sessionId: string;
|
|
2929
|
+
messageId?: string;
|
|
2930
|
+
type: string;
|
|
2931
|
+
name: string;
|
|
2932
|
+
description?: string;
|
|
2933
|
+
mimeType?: string;
|
|
2934
|
+
url?: string;
|
|
2935
|
+
sizeBytes: number;
|
|
2936
|
+
metadata?: Record<string, unknown>;
|
|
2937
|
+
createdAt: string;
|
|
2938
|
+
}
|
|
2939
|
+
interface ArtifactResult {
|
|
2940
|
+
artifact: Artifact;
|
|
2941
|
+
}
|
|
2942
|
+
interface ArtifactUpdateParams {
|
|
2943
|
+
id: string;
|
|
2944
|
+
name: string;
|
|
2945
|
+
description?: string;
|
|
2946
|
+
}
|
|
2947
|
+
interface AssistantTurn {
|
|
2948
|
+
id: string;
|
|
2949
|
+
role?: string;
|
|
2950
|
+
content: string;
|
|
2951
|
+
explanation?: string;
|
|
2952
|
+
citations: Citation[];
|
|
2953
|
+
toolCalls?: ToolCall[];
|
|
2954
|
+
debug?: DebugTrace | null;
|
|
2955
|
+
artifacts: unknown[];
|
|
2956
|
+
codeOutputs: CodeOutput[];
|
|
2957
|
+
createdAt: string;
|
|
2958
|
+
}
|
|
2959
|
+
interface Attachment {
|
|
2960
|
+
id: string;
|
|
2961
|
+
filename: string;
|
|
2962
|
+
mimeType: string;
|
|
2963
|
+
sizeBytes: number;
|
|
2964
|
+
base64Data?: string;
|
|
2965
|
+
url?: string;
|
|
2966
|
+
}
|
|
2967
|
+
interface Citation {
|
|
2968
|
+
id: string;
|
|
2969
|
+
type: string;
|
|
2970
|
+
title: string;
|
|
2971
|
+
url: string;
|
|
2972
|
+
startIndex: number;
|
|
2973
|
+
endIndex: number;
|
|
2974
|
+
excerpt?: string;
|
|
2975
|
+
source?: string;
|
|
2976
|
+
}
|
|
2977
|
+
interface CodeOutput {
|
|
2978
|
+
type: string;
|
|
2979
|
+
content: string;
|
|
2980
|
+
filename?: string;
|
|
2981
|
+
mimeType?: string;
|
|
2982
|
+
sizeBytes?: number;
|
|
2983
|
+
}
|
|
2984
|
+
interface ConversationTurn {
|
|
2985
|
+
id: string;
|
|
2986
|
+
sessionId: string;
|
|
2987
|
+
userTurn: UserTurn;
|
|
2988
|
+
assistantTurn?: AssistantTurn | null;
|
|
2989
|
+
createdAt: string;
|
|
2990
|
+
}
|
|
2991
|
+
interface DebugToolCall {
|
|
2992
|
+
callId?: string;
|
|
2993
|
+
name?: string;
|
|
2994
|
+
arguments?: string;
|
|
2995
|
+
result?: string;
|
|
2996
|
+
error?: string;
|
|
2997
|
+
durationMs?: number;
|
|
2998
|
+
}
|
|
2999
|
+
interface DebugTrace {
|
|
3000
|
+
usage?: DebugUsage | null;
|
|
3001
|
+
generationMs?: number;
|
|
3002
|
+
tools?: DebugToolCall[];
|
|
3003
|
+
}
|
|
3004
|
+
interface DebugUsage {
|
|
3005
|
+
promptTokens: number;
|
|
3006
|
+
completionTokens: number;
|
|
3007
|
+
totalTokens: number;
|
|
3008
|
+
cachedTokens: number;
|
|
3009
|
+
cost: number;
|
|
3010
|
+
}
|
|
3011
|
+
interface OkResult {
|
|
3012
|
+
ok: boolean;
|
|
3013
|
+
}
|
|
3014
|
+
interface PendingQuestion {
|
|
3015
|
+
checkpointId: string;
|
|
3016
|
+
agentName?: string;
|
|
3017
|
+
turnId: string;
|
|
3018
|
+
questions: PendingQuestionItem[];
|
|
3019
|
+
}
|
|
3020
|
+
interface PendingQuestionItem {
|
|
3021
|
+
id: string;
|
|
3022
|
+
text: string;
|
|
3023
|
+
type: string;
|
|
3024
|
+
options: PendingQuestionOption[];
|
|
3025
|
+
}
|
|
3026
|
+
interface PendingQuestionOption {
|
|
3027
|
+
id: string;
|
|
3028
|
+
label: string;
|
|
3029
|
+
}
|
|
3030
|
+
type PingParams = Record<string, never>;
|
|
3031
|
+
interface PingResult {
|
|
3032
|
+
ok: boolean;
|
|
3033
|
+
tenantId: string;
|
|
3034
|
+
}
|
|
3035
|
+
interface QuestionCancelParams {
|
|
3036
|
+
sessionId: string;
|
|
3037
|
+
}
|
|
3038
|
+
interface QuestionSubmitParams {
|
|
3039
|
+
sessionId: string;
|
|
3040
|
+
checkpointId: string;
|
|
3041
|
+
answers: Record<string, string>;
|
|
3042
|
+
}
|
|
3043
|
+
interface Session {
|
|
3044
|
+
id: string;
|
|
3045
|
+
title: string;
|
|
3046
|
+
status: string;
|
|
3047
|
+
pinned: boolean;
|
|
3048
|
+
createdAt: string;
|
|
3049
|
+
updatedAt: string;
|
|
3050
|
+
}
|
|
3051
|
+
interface SessionArtifactsParams {
|
|
3052
|
+
sessionId: string;
|
|
3053
|
+
limit: number;
|
|
3054
|
+
offset: number;
|
|
3055
|
+
}
|
|
3056
|
+
interface SessionArtifactsResult {
|
|
3057
|
+
artifacts: Artifact[];
|
|
3058
|
+
hasMore: boolean;
|
|
3059
|
+
nextOffset: number;
|
|
3060
|
+
}
|
|
3061
|
+
interface SessionClearResult {
|
|
3062
|
+
success: boolean;
|
|
3063
|
+
deletedMessages: number;
|
|
3064
|
+
deletedArtifacts: number;
|
|
3065
|
+
}
|
|
3066
|
+
interface SessionCompactResult {
|
|
3067
|
+
success: boolean;
|
|
3068
|
+
summary: string;
|
|
3069
|
+
deletedMessages: number;
|
|
3070
|
+
deletedArtifacts: number;
|
|
3071
|
+
}
|
|
3072
|
+
interface SessionCreateParams {
|
|
3073
|
+
title: string;
|
|
3074
|
+
}
|
|
3075
|
+
interface SessionCreateResult {
|
|
3076
|
+
session: Session;
|
|
3077
|
+
}
|
|
3078
|
+
interface SessionGetParams {
|
|
3079
|
+
id: string;
|
|
3080
|
+
}
|
|
3081
|
+
interface SessionGetResult {
|
|
3082
|
+
session: Session;
|
|
3083
|
+
turns: ConversationTurn[];
|
|
3084
|
+
pendingQuestion?: PendingQuestion | null;
|
|
3085
|
+
}
|
|
3086
|
+
interface SessionIDParams {
|
|
3087
|
+
id: string;
|
|
3088
|
+
}
|
|
3089
|
+
interface SessionListParams {
|
|
3090
|
+
limit: number;
|
|
3091
|
+
offset: number;
|
|
3092
|
+
includeArchived: boolean;
|
|
3093
|
+
}
|
|
3094
|
+
interface SessionListResult {
|
|
3095
|
+
sessions: Session[];
|
|
3096
|
+
total?: number;
|
|
3097
|
+
hasMore: boolean;
|
|
3098
|
+
}
|
|
3099
|
+
interface SessionUpdateTitleParams {
|
|
3100
|
+
id: string;
|
|
3101
|
+
title: string;
|
|
3102
|
+
}
|
|
3103
|
+
interface SessionUploadArtifactsParams {
|
|
3104
|
+
sessionId: string;
|
|
3105
|
+
attachments: Attachment[];
|
|
3106
|
+
}
|
|
3107
|
+
interface SessionUploadArtifactsResult {
|
|
3108
|
+
artifacts: Artifact[];
|
|
3109
|
+
}
|
|
3110
|
+
interface ToolCall {
|
|
3111
|
+
id: string;
|
|
3112
|
+
name: string;
|
|
3113
|
+
arguments: string;
|
|
3114
|
+
result?: string;
|
|
3115
|
+
error?: string;
|
|
3116
|
+
durationMs?: number;
|
|
3117
|
+
}
|
|
3118
|
+
interface UserTurn {
|
|
3119
|
+
id: string;
|
|
3120
|
+
content: string;
|
|
3121
|
+
attachments: Attachment[];
|
|
3122
|
+
createdAt: string;
|
|
3123
|
+
}
|
|
3124
|
+
|
|
2207
3125
|
/**
|
|
2208
3126
|
* File Utilities
|
|
2209
3127
|
* Validation, conversion, and formatting for file attachments
|
|
2210
3128
|
*/
|
|
3129
|
+
declare const ATTACHMENT_ACCEPT_ATTRIBUTE: string;
|
|
3130
|
+
declare function isImageMimeType(mimeType: string): boolean;
|
|
2211
3131
|
/**
|
|
2212
|
-
* Validates
|
|
3132
|
+
* Validates a file against size and type constraints
|
|
2213
3133
|
* @throws Error if validation fails
|
|
2214
3134
|
*/
|
|
2215
|
-
declare function
|
|
3135
|
+
declare function validateAttachmentFile(file: File$1, maxSizeBytes?: number): void;
|
|
3136
|
+
/**
|
|
3137
|
+
* Backward-compatible image validator used by older components/stories.
|
|
3138
|
+
*/
|
|
3139
|
+
declare function validateImageFile(file: File$1, maxSizeBytes?: number): void;
|
|
2216
3140
|
/**
|
|
2217
|
-
* Converts a file to base64 string (without data URL prefix)
|
|
3141
|
+
* Converts a file to base64 string (without data URL prefix).
|
|
3142
|
+
* Prefers FileReader data URLs, then falls back to buffer-based encoding.
|
|
2218
3143
|
*/
|
|
2219
|
-
declare function convertToBase64(file: File): Promise<string>;
|
|
3144
|
+
declare function convertToBase64(file: File$1): Promise<string>;
|
|
2220
3145
|
/**
|
|
2221
3146
|
* Creates a data URL from base64 string and MIME type
|
|
2222
3147
|
*/
|
|
@@ -2231,6 +3156,25 @@ declare function formatFileSize(bytes: number): string;
|
|
|
2231
3156
|
*/
|
|
2232
3157
|
declare function validateFileCount(currentCount: number, newCount: number, maxCount?: number): void;
|
|
2233
3158
|
|
|
3159
|
+
interface FileVisual {
|
|
3160
|
+
/** Phosphor icon component */
|
|
3161
|
+
icon: typeof File$1;
|
|
3162
|
+
/** Tailwind text-color classes for the icon (light + dark) */
|
|
3163
|
+
iconColor: string;
|
|
3164
|
+
/** Tailwind background classes for the icon container (light + dark) */
|
|
3165
|
+
bgColor: string;
|
|
3166
|
+
/** Short label (PDF, CSV, XLS, etc.) */
|
|
3167
|
+
label: string;
|
|
3168
|
+
}
|
|
3169
|
+
/**
|
|
3170
|
+
* Resolves visual metadata (icon, colors, label) for a file based on
|
|
3171
|
+
* its MIME type and/or filename. Single source of truth used by
|
|
3172
|
+
* AttachmentGrid, SessionArtifactList, DownloadCard, etc.
|
|
3173
|
+
*/
|
|
3174
|
+
declare function getFileVisual(mimeType?: string, filename?: string): FileVisual;
|
|
3175
|
+
/** Chart-specific visual (not mime-based, used for artifact type = 'chart') */
|
|
3176
|
+
declare const CHART_VISUAL: FileVisual;
|
|
3177
|
+
|
|
2234
3178
|
/**
|
|
2235
3179
|
* Citation Processing Utility
|
|
2236
3180
|
*
|
|
@@ -2247,7 +3191,7 @@ interface ProcessedContent {
|
|
|
2247
3191
|
/** Content with citation markers replaced by [1], [2], etc. */
|
|
2248
3192
|
content: string;
|
|
2249
3193
|
/** Citations array with their display indices */
|
|
2250
|
-
citations: Array<Citation & {
|
|
3194
|
+
citations: Array<Citation$1 & {
|
|
2251
3195
|
displayIndex: number;
|
|
2252
3196
|
}>;
|
|
2253
3197
|
}
|
|
@@ -2268,6 +3212,77 @@ interface ProcessedContent {
|
|
|
2268
3212
|
* // result.citations = [{ ..., displayIndex: 1 }]
|
|
2269
3213
|
* ```
|
|
2270
3214
|
*/
|
|
2271
|
-
declare function processCitations(content: string, citations: Citation[] | null | undefined): ProcessedContent;
|
|
3215
|
+
declare function processCitations(content: string, citations: Citation$1[] | null | undefined): ProcessedContent;
|
|
3216
|
+
|
|
3217
|
+
/**
|
|
3218
|
+
* Normalizes partially-streamed markdown so that react-markdown
|
|
3219
|
+
* can render it without layout artifacts (e.g. an unclosed code fence
|
|
3220
|
+
* turning the rest of the message into a code block).
|
|
3221
|
+
*
|
|
3222
|
+
* Called on every streaming content update — kept intentionally cheap (O(lines)).
|
|
3223
|
+
*/
|
|
3224
|
+
declare function normalizeStreamingMarkdown(text: string): string;
|
|
3225
|
+
|
|
3226
|
+
/**
|
|
3227
|
+
* SSE stream parser for consuming Server-Sent Events.
|
|
3228
|
+
*/
|
|
3229
|
+
interface SSEEvent {
|
|
3230
|
+
type: string;
|
|
3231
|
+
content?: string;
|
|
3232
|
+
error?: string;
|
|
3233
|
+
sessionId?: string;
|
|
3234
|
+
toolName?: string;
|
|
3235
|
+
toolCallId?: string;
|
|
3236
|
+
durationMs?: number;
|
|
3237
|
+
success?: boolean;
|
|
3238
|
+
[key: string]: unknown;
|
|
3239
|
+
}
|
|
3240
|
+
/**
|
|
3241
|
+
* Parses an SSE stream and yields parsed JSON events.
|
|
3242
|
+
*/
|
|
3243
|
+
declare function parseSSEStream(reader: ReadableStreamDefaultReader<Uint8Array>): AsyncGenerator<SSEEvent, void, unknown>;
|
|
3244
|
+
|
|
3245
|
+
/**
|
|
3246
|
+
* Groups chat sessions by date relative to today
|
|
3247
|
+
* Categories: Today, Yesterday, Last 7 Days, Last 30 Days, Older
|
|
3248
|
+
* Sessions within each group are sorted by updatedAt (most recent first)
|
|
3249
|
+
*/
|
|
3250
|
+
declare function groupSessionsByDate(sessions: Session$1[], t?: (key: string) => string): SessionGroup[];
|
|
3251
|
+
|
|
3252
|
+
/**
|
|
3253
|
+
* Date formatting utilities using date-fns
|
|
3254
|
+
*/
|
|
3255
|
+
/**
|
|
3256
|
+
* Format a date as relative time (e.g., "5m ago", "2h ago")
|
|
3257
|
+
* Falls back to HH:mm format for dates older than 24 hours
|
|
3258
|
+
*
|
|
3259
|
+
* Accepts an optional `t` function for i18n. Translation keys used:
|
|
3260
|
+
* - relativeTime.justNow
|
|
3261
|
+
* - relativeTime.minutesAgo (receives `{count}`)
|
|
3262
|
+
* - relativeTime.hoursAgo (receives `{count}`)
|
|
3263
|
+
* - relativeTime.daysAgo (receives `{count}`)
|
|
3264
|
+
*
|
|
3265
|
+
* If no `t` function is provided, falls back to English defaults.
|
|
3266
|
+
*/
|
|
3267
|
+
declare function formatRelativeTime(date: string | Date, t?: (key: string, params?: Record<string, string | number>) => string): string;
|
|
3268
|
+
|
|
3269
|
+
/**
|
|
3270
|
+
* Shared validation utilities for QuestionForm components
|
|
3271
|
+
*/
|
|
3272
|
+
|
|
3273
|
+
/**
|
|
3274
|
+
* Checks if a question has been answered.
|
|
3275
|
+
* A question is answered if it has at least one selected option OR custom text.
|
|
3276
|
+
*/
|
|
3277
|
+
declare function isQuestionAnswered(data: QuestionAnswerData | undefined): boolean;
|
|
3278
|
+
/**
|
|
3279
|
+
* Validates that all questions are answered and custom text is valid.
|
|
3280
|
+
* Returns null if valid, or an error message string if invalid.
|
|
3281
|
+
*
|
|
3282
|
+
* @param questions - Array of questions to validate
|
|
3283
|
+
* @param answers - Map of question IDs to answer data
|
|
3284
|
+
* @param t - Optional translation function for error messages
|
|
3285
|
+
*/
|
|
3286
|
+
declare function validateAnswers(questions: Question[], answers: QuestionAnswers, t?: (key: string, params?: Record<string, any>) => string): string | null;
|
|
2272
3287
|
|
|
2273
|
-
export { ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type AppConfig, type Artifact, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment, MemoizedAttachmentGrid as AttachmentGrid, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, type BiChatConfig, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, ChartCard, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput, CodeOutputsPanel, ConfigProvider, ConfirmModal, type ConfirmModalProps, type ConversationTurn, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type PendingQuestion, PermissionGuard, type PermissionGuardProps, type ProcessedContent, type Question, type QuestionAnswerData, type QuestionAnswers, type QuestionOption, type QueuedMessage, RateLimiter, type RateLimiterConfig, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamingCursor, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type
|
|
3288
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, type BiChatConfig, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type ProcessedContent, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, RateLimiter, type RateLimiterConfig, RetryActionArea, type SSEEvent, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, SessionSkeleton, type SessionUser, type ShortcutConfig, Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamError, StreamingCursor, SystemMessage, MemoizedTabBar as TabBar, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, formatRelativeTime, getCSRFToken, getFileVisual, getValidChildren, groupSessionsByDate, hasPermission as hasConfigPermission, hasPermission$1 as hasPermission, isImageMimeType, isQuestionAnswered, lightTheme, listItemVariants, messageContainerVariants, messageVariants, normalizeStreamingMarkdown, parseSSEStream, processCitations, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toastVariants, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChat, useChatInput, useChatMessaging, useChatSession, useConfig, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useRequiredConfig, useScrollToBottom, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAnswers, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|