@iota-uz/sdk 0.4.20 → 0.4.22
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/README.md +20 -0
- package/dist/applet/core.cjs +8 -4
- package/dist/applet/core.cjs.map +1 -1
- package/dist/applet/core.mjs +8 -4
- package/dist/applet/core.mjs.map +1 -1
- package/dist/applet/devtools.cjs +24 -8
- package/dist/applet/devtools.cjs.map +1 -1
- package/dist/applet/devtools.mjs +24 -8
- package/dist/applet/devtools.mjs.map +1 -1
- package/dist/applet/host.cjs +47 -16
- package/dist/applet/host.cjs.map +1 -1
- package/dist/applet/host.mjs +47 -16
- package/dist/applet/host.mjs.map +1 -1
- package/dist/applet/vite.cjs +12 -4
- package/dist/applet/vite.cjs.map +1 -1
- package/dist/applet/vite.mjs +12 -4
- package/dist/applet/vite.mjs.map +1 -1
- package/dist/applet-runtime/index.cjs.map +1 -1
- package/dist/applet-runtime/index.mjs.map +1 -1
- package/dist/bichat/index.cjs +6971 -2646
- package/dist/bichat/index.cjs.map +1 -1
- package/dist/bichat/index.css +11 -1
- package/dist/bichat/index.css.map +1 -1
- package/dist/bichat/index.d.cts +453 -157
- package/dist/bichat/index.d.ts +453 -157
- package/dist/bichat/index.mjs +6969 -2652
- package/dist/bichat/index.mjs.map +1 -1
- package/dist/bichat/styles.css +17 -4
- package/dist/bichat/tailwind.cjs.map +1 -1
- package/dist/bichat/tailwind.mjs.map +1 -1
- package/dist/index.cjs +73 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +73 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -3
- package/tailwind/compiled.css +1 -1
- package/tailwind/create-config.cjs +50 -2
- package/tailwind/iota.css +6 -6
- package/tailwind/sdk-content.cjs +177 -0
- package/tailwind/sdk-theme.cjs +12 -0
package/dist/bichat/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import react__default, { ReactNode, Component, ErrorInfo, FC, HTMLAttributes, ReactElement, ImgHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
|
|
4
|
+
import { Icon, File as File$1 } from '@phosphor-icons/react';
|
|
4
5
|
import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, T as TenantContext$1, U as UserContext$1 } from '../index-Cs_xWkhC.js';
|
|
5
|
-
import { File as File$1 } from '@phosphor-icons/react';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Split data source interfaces for BiChat.
|
|
@@ -118,6 +118,11 @@ interface UserTurn$1 {
|
|
|
118
118
|
attachments: Attachment$1[];
|
|
119
119
|
createdAt: string;
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Assistant turn lifecycle used by renderers to distinguish completed output
|
|
123
|
+
* from HITL checkpoints that require user input.
|
|
124
|
+
*/
|
|
125
|
+
type AssistantTurnLifecycle = 'complete' | 'waiting_for_human_input';
|
|
121
126
|
/**
|
|
122
127
|
* Content of an assistant's response in a conversation turn
|
|
123
128
|
*/
|
|
@@ -128,10 +133,11 @@ interface AssistantTurn$1 {
|
|
|
128
133
|
explanation?: string;
|
|
129
134
|
citations: Citation$1[];
|
|
130
135
|
toolCalls?: ToolCall$1[];
|
|
131
|
-
|
|
136
|
+
charts?: ChartData[];
|
|
132
137
|
renderTables?: RenderTableData[];
|
|
133
138
|
artifacts: Artifact$1[];
|
|
134
139
|
codeOutputs: CodeOutput$1[];
|
|
140
|
+
lifecycle: AssistantTurnLifecycle;
|
|
135
141
|
debug?: DebugTrace$1;
|
|
136
142
|
createdAt: string;
|
|
137
143
|
}
|
|
@@ -222,6 +228,10 @@ interface ChartData {
|
|
|
222
228
|
colors?: string[];
|
|
223
229
|
/** Chart height in pixels */
|
|
224
230
|
height?: number;
|
|
231
|
+
/** Optional original Apex options (used by richer renderers) */
|
|
232
|
+
options?: Record<string, unknown>;
|
|
233
|
+
/** Optional logarithmic Y-axis hint */
|
|
234
|
+
logarithmic?: boolean;
|
|
225
235
|
}
|
|
226
236
|
/**
|
|
227
237
|
* A single data series in a chart
|
|
@@ -243,6 +253,7 @@ interface RenderTableData {
|
|
|
243
253
|
title?: string;
|
|
244
254
|
query: string;
|
|
245
255
|
columns: string[];
|
|
256
|
+
columnTypes?: string[];
|
|
246
257
|
headers: string[];
|
|
247
258
|
rows: unknown[][];
|
|
248
259
|
totalRows: number;
|
|
@@ -277,6 +288,7 @@ interface SessionArtifact {
|
|
|
277
288
|
interface PendingQuestion$1 {
|
|
278
289
|
id: string;
|
|
279
290
|
turnId: string;
|
|
291
|
+
agentName?: string;
|
|
280
292
|
questions: Question[];
|
|
281
293
|
status: 'PENDING' | 'ANSWERED' | 'CANCELLED';
|
|
282
294
|
}
|
|
@@ -308,9 +320,29 @@ interface QuestionAnswerData {
|
|
|
308
320
|
interface QuestionAnswers {
|
|
309
321
|
[questionId: string]: QuestionAnswerData;
|
|
310
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* A single step in the ephemeral activity trace shown during streaming.
|
|
325
|
+
* Steps represent thinking, tool calls, or sub-agent delegations.
|
|
326
|
+
*/
|
|
327
|
+
interface ActivityStep {
|
|
328
|
+
id: string;
|
|
329
|
+
type: 'thinking' | 'tool' | 'agent_delegation';
|
|
330
|
+
toolName: string;
|
|
331
|
+
/** Raw tool arguments JSON string (used for label interpolation, e.g., delegation agent name). */
|
|
332
|
+
arguments?: string;
|
|
333
|
+
agentName?: string;
|
|
334
|
+
status: 'active' | 'completed' | 'failed';
|
|
335
|
+
startedAt: number;
|
|
336
|
+
completedAt?: number;
|
|
337
|
+
durationMs?: number;
|
|
338
|
+
error?: string;
|
|
339
|
+
}
|
|
311
340
|
type StreamEvent = {
|
|
312
341
|
type: 'content';
|
|
313
342
|
content: string;
|
|
343
|
+
} | {
|
|
344
|
+
type: 'thinking';
|
|
345
|
+
content: string;
|
|
314
346
|
} | {
|
|
315
347
|
type: 'tool_start';
|
|
316
348
|
tool: StreamToolPayload;
|
|
@@ -335,12 +367,24 @@ type StreamEvent = {
|
|
|
335
367
|
type: 'error';
|
|
336
368
|
error: string;
|
|
337
369
|
};
|
|
370
|
+
/** Partial state when resuming a stream after refresh */
|
|
371
|
+
interface StreamSnapshotPayload {
|
|
372
|
+
partialContent?: string;
|
|
373
|
+
partialMetadata?: Record<string, unknown>;
|
|
374
|
+
}
|
|
375
|
+
/** Active stream status for a session (from GET /stream/status) */
|
|
376
|
+
interface StreamStatus {
|
|
377
|
+
active: boolean;
|
|
378
|
+
runId?: string;
|
|
379
|
+
snapshot?: StreamSnapshotPayload;
|
|
380
|
+
startedAt?: number;
|
|
381
|
+
}
|
|
338
382
|
/**
|
|
339
383
|
* @deprecated Use `StreamEvent` instead. `StreamChunk` is kept for backwards
|
|
340
384
|
* compatibility but the flat all-optional shape is unsound.
|
|
341
385
|
*/
|
|
342
386
|
interface StreamChunk {
|
|
343
|
-
type: 'chunk' | 'content' | 'tool_start' | 'tool_end' | 'usage' | 'done' | 'error' | 'user_message' | 'interrupt';
|
|
387
|
+
type: 'chunk' | 'content' | 'thinking' | 'tool_start' | 'tool_end' | 'usage' | 'done' | 'error' | 'user_message' | 'interrupt' | 'snapshot' | 'stream_started';
|
|
344
388
|
content?: string;
|
|
345
389
|
error?: string;
|
|
346
390
|
sessionId?: string;
|
|
@@ -349,6 +393,9 @@ interface StreamChunk {
|
|
|
349
393
|
interrupt?: StreamInterruptPayload;
|
|
350
394
|
generationMs?: number;
|
|
351
395
|
timestamp?: number;
|
|
396
|
+
snapshot?: StreamSnapshotPayload;
|
|
397
|
+
/** Set when type is 'stream_started'; client should store for refresh-safe resume */
|
|
398
|
+
runId?: string;
|
|
352
399
|
}
|
|
353
400
|
interface StreamInterruptPayload {
|
|
354
401
|
checkpointId: string;
|
|
@@ -378,11 +425,73 @@ interface StreamToolPayload {
|
|
|
378
425
|
result?: string;
|
|
379
426
|
error?: string;
|
|
380
427
|
durationMs?: number;
|
|
428
|
+
agentName?: string;
|
|
381
429
|
}
|
|
382
430
|
interface DebugTrace$1 {
|
|
431
|
+
schemaVersion?: string;
|
|
432
|
+
startedAt?: string;
|
|
433
|
+
completedAt?: string;
|
|
383
434
|
generationMs?: number;
|
|
384
435
|
usage?: DebugUsage$1;
|
|
385
436
|
tools: StreamToolPayload[];
|
|
437
|
+
attempts?: DebugGeneration[];
|
|
438
|
+
spans?: DebugSpan[];
|
|
439
|
+
events?: DebugEvent[];
|
|
440
|
+
traceId?: string;
|
|
441
|
+
traceUrl?: string;
|
|
442
|
+
sessionId?: string;
|
|
443
|
+
thinking?: string;
|
|
444
|
+
observationReason?: string;
|
|
445
|
+
}
|
|
446
|
+
interface DebugGeneration {
|
|
447
|
+
id?: string;
|
|
448
|
+
requestId?: string;
|
|
449
|
+
model?: string;
|
|
450
|
+
provider?: string;
|
|
451
|
+
finishReason?: string;
|
|
452
|
+
promptTokens?: number;
|
|
453
|
+
completionTokens?: number;
|
|
454
|
+
totalTokens?: number;
|
|
455
|
+
cachedTokens?: number;
|
|
456
|
+
cost?: number;
|
|
457
|
+
latencyMs?: number;
|
|
458
|
+
input?: string;
|
|
459
|
+
output?: string;
|
|
460
|
+
thinking?: string;
|
|
461
|
+
observationReason?: string;
|
|
462
|
+
startedAt?: string;
|
|
463
|
+
completedAt?: string;
|
|
464
|
+
toolCalls?: StreamToolPayload[];
|
|
465
|
+
}
|
|
466
|
+
interface DebugSpan {
|
|
467
|
+
id?: string;
|
|
468
|
+
parentId?: string;
|
|
469
|
+
generationId?: string;
|
|
470
|
+
name?: string;
|
|
471
|
+
type?: string;
|
|
472
|
+
status?: string;
|
|
473
|
+
level?: string;
|
|
474
|
+
callId?: string;
|
|
475
|
+
toolName?: string;
|
|
476
|
+
input?: string;
|
|
477
|
+
output?: string;
|
|
478
|
+
error?: string;
|
|
479
|
+
durationMs?: number;
|
|
480
|
+
startedAt?: string;
|
|
481
|
+
completedAt?: string;
|
|
482
|
+
attributes?: Record<string, unknown>;
|
|
483
|
+
}
|
|
484
|
+
interface DebugEvent {
|
|
485
|
+
id?: string;
|
|
486
|
+
name?: string;
|
|
487
|
+
type?: string;
|
|
488
|
+
level?: string;
|
|
489
|
+
message?: string;
|
|
490
|
+
reason?: string;
|
|
491
|
+
spanId?: string;
|
|
492
|
+
generationId?: string;
|
|
493
|
+
timestamp?: string;
|
|
494
|
+
attributes?: Record<string, unknown>;
|
|
386
495
|
}
|
|
387
496
|
interface DebugLimits {
|
|
388
497
|
policyMaxTokens: number;
|
|
@@ -469,6 +578,22 @@ interface ChatDataSource {
|
|
|
469
578
|
success: boolean;
|
|
470
579
|
error?: string;
|
|
471
580
|
}>;
|
|
581
|
+
/**
|
|
582
|
+
* Stops the active stream for the given session. No partial assistant message is persisted.
|
|
583
|
+
* Optional for backward compatibility with data sources that do not support stop.
|
|
584
|
+
*/
|
|
585
|
+
stopGeneration?(sessionId: string): Promise<void>;
|
|
586
|
+
/**
|
|
587
|
+
* Returns active stream status for the session (for refresh-safe resume).
|
|
588
|
+
* Optional; if absent, no resume/passive flow is used.
|
|
589
|
+
*/
|
|
590
|
+
getStreamStatus?(sessionId: string): Promise<StreamStatus | null>;
|
|
591
|
+
/**
|
|
592
|
+
* Resumes an active stream: delivers snapshot then new chunks. Use when getStreamStatus
|
|
593
|
+
* reported active and the client has the same-browser run marker.
|
|
594
|
+
* Optional; if absent, resume is not supported.
|
|
595
|
+
*/
|
|
596
|
+
resumeStream?(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
472
597
|
/**
|
|
473
598
|
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` instead.
|
|
474
599
|
* This method couples navigation to the data source, causing component
|
|
@@ -526,6 +651,12 @@ interface ChatMessagingStateValue {
|
|
|
526
651
|
compactionSummary: string | null;
|
|
527
652
|
/** Bumped when artifacts should be refetched (e.g. tool_end for artifact-producing tools). */
|
|
528
653
|
artifactsInvalidationTrigger: number;
|
|
654
|
+
/** Ephemeral reasoning/thinking content, cleared when final answer arrives. */
|
|
655
|
+
thinkingContent: string;
|
|
656
|
+
/** Ephemeral activity steps (tools, thinking, delegations), cleared on done. */
|
|
657
|
+
activeSteps: ActivityStep[];
|
|
658
|
+
showActivityTrace: boolean;
|
|
659
|
+
showTypingIndicator: boolean;
|
|
529
660
|
sendMessage: (content: string, attachments?: Attachment$1[]) => Promise<void>;
|
|
530
661
|
handleRegenerate?: (turnId: string) => Promise<void>;
|
|
531
662
|
handleEdit?: (turnId: string, newContent: string) => Promise<void>;
|
|
@@ -670,13 +801,9 @@ interface ChatHeaderProps {
|
|
|
670
801
|
declare function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
671
802
|
|
|
672
803
|
interface MessageListProps {
|
|
673
|
-
/** Custom render function for user turns */
|
|
674
804
|
renderUserTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
675
|
-
/** Custom render function for assistant turns */
|
|
676
805
|
renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
677
|
-
/** Custom verbs for the typing indicator (e.g. ['Thinking', 'Analyzing', ...]) */
|
|
678
806
|
thinkingVerbs?: string[];
|
|
679
|
-
/** When true, hides edit/regenerate actions */
|
|
680
807
|
readOnly?: boolean;
|
|
681
808
|
}
|
|
682
809
|
declare function MessageList({ renderUserTurn, renderAssistantTurn, thinkingVerbs, readOnly }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
@@ -800,8 +927,8 @@ interface AssistantMessageSourcesSlotProps {
|
|
|
800
927
|
citations: Citation$1[];
|
|
801
928
|
}
|
|
802
929
|
interface AssistantMessageChartsSlotProps {
|
|
803
|
-
/** Chart data */
|
|
804
|
-
|
|
930
|
+
/** Chart data array */
|
|
931
|
+
charts: ChartData[];
|
|
805
932
|
}
|
|
806
933
|
interface AssistantMessageCodeOutputsSlotProps {
|
|
807
934
|
/** Code execution outputs */
|
|
@@ -914,8 +1041,10 @@ interface AssistantMessageProps {
|
|
|
914
1041
|
hideTimestamp?: boolean;
|
|
915
1042
|
/** Show debug panel */
|
|
916
1043
|
showDebug?: boolean;
|
|
1044
|
+
/** Context/token limits for debug usage ratio */
|
|
1045
|
+
debugLimits?: DebugLimits | null;
|
|
917
1046
|
}
|
|
918
|
-
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;
|
|
1047
|
+
declare function AssistantMessage({ turn, turnId, isLastTurn, isStreaming, pendingQuestion, slots, classNames: classNameOverrides, onCopy, onRegenerate, onSendMessage, sendDisabled, hideAvatar, hideActions, hideTimestamp, showDebug, debugLimits, }: AssistantMessageProps): react_jsx_runtime.JSX.Element;
|
|
919
1048
|
|
|
920
1049
|
interface AssistantTurnViewProps {
|
|
921
1050
|
/** The conversation turn containing the assistant response */
|
|
@@ -994,13 +1123,20 @@ interface MarkdownRendererProps {
|
|
|
994
1123
|
declare function MarkdownRenderer({ content, citations, sendMessage, sendDisabled, copyLabel, copiedLabel, exportLabel, }: MarkdownRendererProps): react_jsx_runtime.JSX.Element;
|
|
995
1124
|
declare const MemoizedMarkdownRenderer: react.MemoExoticComponent<typeof MarkdownRenderer>;
|
|
996
1125
|
|
|
1126
|
+
/** External container control. When provided, the card runs in embedded mode. */
|
|
1127
|
+
interface ChartCardHost {
|
|
1128
|
+
isFullscreen: boolean;
|
|
1129
|
+
}
|
|
997
1130
|
interface ChartCardProps {
|
|
998
1131
|
chartData: ChartData;
|
|
1132
|
+
onExportError?: (error: string) => void;
|
|
1133
|
+
/** When provided, the card runs in embedded mode — strips outer chrome, fills container height in fullscreen. */
|
|
1134
|
+
host?: ChartCardHost;
|
|
999
1135
|
}
|
|
1000
1136
|
/**
|
|
1001
1137
|
* ChartCard renders a single chart visualization with optional PNG export.
|
|
1002
1138
|
*/
|
|
1003
|
-
declare function ChartCard({ chartData }: ChartCardProps): react_jsx_runtime.JSX.Element;
|
|
1139
|
+
declare function ChartCard({ chartData, onExportError, host }: ChartCardProps): react_jsx_runtime.JSX.Element;
|
|
1004
1140
|
|
|
1005
1141
|
interface SourcesPanelProps {
|
|
1006
1142
|
citations: Citation$1[];
|
|
@@ -1024,6 +1160,7 @@ interface MessageInputRef {
|
|
|
1024
1160
|
interface MessageInputProps {
|
|
1025
1161
|
message: string;
|
|
1026
1162
|
loading: boolean;
|
|
1163
|
+
isStreaming?: boolean;
|
|
1027
1164
|
fetching?: boolean;
|
|
1028
1165
|
disabled?: boolean;
|
|
1029
1166
|
commandError?: string | null;
|
|
@@ -1034,6 +1171,7 @@ interface MessageInputProps {
|
|
|
1034
1171
|
onClearCommandError?: () => void;
|
|
1035
1172
|
onMessageChange: (value: string) => void;
|
|
1036
1173
|
onSubmit: (e: React.FormEvent, attachments: Attachment$1[]) => void;
|
|
1174
|
+
onCancelStreaming?: () => void;
|
|
1037
1175
|
onUnqueue?: () => {
|
|
1038
1176
|
content: string;
|
|
1039
1177
|
attachments: Attachment$1[];
|
|
@@ -1074,18 +1212,19 @@ interface ImageModalProps {
|
|
|
1074
1212
|
}
|
|
1075
1213
|
declare function ImageModal({ isOpen, onClose, attachment, allAttachments, currentIndex, onNavigate, }: ImageModalProps): react_jsx_runtime.JSX.Element;
|
|
1076
1214
|
|
|
1077
|
-
/**
|
|
1078
|
-
* WelcomeContent Component
|
|
1079
|
-
* Landing page shown when starting a new chat session
|
|
1080
|
-
* Clean, professional design for enterprise BI applications
|
|
1081
|
-
*/
|
|
1082
1215
|
interface WelcomeContentProps {
|
|
1083
1216
|
onPromptSelect?: (prompt: string) => void;
|
|
1084
1217
|
title?: string;
|
|
1085
1218
|
description?: string;
|
|
1086
1219
|
disabled?: boolean;
|
|
1220
|
+
/** Custom prompts to replace the default i18n prompts. Icons cycle from defaults if not provided. */
|
|
1221
|
+
prompts?: Array<{
|
|
1222
|
+
category: string;
|
|
1223
|
+
text: string;
|
|
1224
|
+
icon?: Icon;
|
|
1225
|
+
}>;
|
|
1087
1226
|
}
|
|
1088
|
-
declare function WelcomeContent({ onPromptSelect, title, description, disabled }: WelcomeContentProps): react_jsx_runtime.JSX.Element;
|
|
1227
|
+
declare function WelcomeContent({ onPromptSelect, title, description, disabled, prompts: customPrompts, }: WelcomeContentProps): react_jsx_runtime.JSX.Element;
|
|
1089
1228
|
|
|
1090
1229
|
interface CodeOutputsPanelProps {
|
|
1091
1230
|
outputs: CodeOutput$1[];
|
|
@@ -1319,30 +1458,116 @@ interface TableWithExportProps {
|
|
|
1319
1458
|
}
|
|
1320
1459
|
declare const TableWithExport: react.NamedExoticComponent<TableWithExportProps>;
|
|
1321
1460
|
|
|
1461
|
+
type ColumnType = 'string' | 'number' | 'boolean' | 'date' | 'url' | 'null';
|
|
1462
|
+
interface FormattedCell {
|
|
1463
|
+
display: string;
|
|
1464
|
+
raw: unknown;
|
|
1465
|
+
type: ColumnType;
|
|
1466
|
+
isNull: boolean;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
interface ColumnMeta {
|
|
1470
|
+
index: number;
|
|
1471
|
+
name: string;
|
|
1472
|
+
header: string;
|
|
1473
|
+
type: ColumnType;
|
|
1474
|
+
width: number | null;
|
|
1475
|
+
visible: boolean;
|
|
1476
|
+
}
|
|
1477
|
+
interface SortState {
|
|
1478
|
+
columnIndex: number;
|
|
1479
|
+
direction: 'asc' | 'desc';
|
|
1480
|
+
}
|
|
1481
|
+
interface ColumnStats {
|
|
1482
|
+
sum: number;
|
|
1483
|
+
avg: number;
|
|
1484
|
+
min: number;
|
|
1485
|
+
max: number;
|
|
1486
|
+
count: number;
|
|
1487
|
+
nullCount: number;
|
|
1488
|
+
}
|
|
1489
|
+
interface DataTableOptions {
|
|
1490
|
+
defaultPageSize?: number;
|
|
1491
|
+
enableSearch?: boolean;
|
|
1492
|
+
enableSort?: boolean;
|
|
1493
|
+
enableResize?: boolean;
|
|
1494
|
+
enableColumnVisibility?: boolean;
|
|
1495
|
+
}
|
|
1496
|
+
interface UseDataTableReturn {
|
|
1497
|
+
columns: ColumnMeta[];
|
|
1498
|
+
visibleColumns: ColumnMeta[];
|
|
1499
|
+
page: number;
|
|
1500
|
+
pageSize: number;
|
|
1501
|
+
totalPages: number;
|
|
1502
|
+
totalFilteredRows: number;
|
|
1503
|
+
pageSizeOptions: number[];
|
|
1504
|
+
pageRows: unknown[][];
|
|
1505
|
+
setPage: (page: number) => void;
|
|
1506
|
+
setPageSize: (size: number) => void;
|
|
1507
|
+
sort: SortState | null;
|
|
1508
|
+
toggleSort: (columnIndex: number) => void;
|
|
1509
|
+
clearSort: () => void;
|
|
1510
|
+
searchQuery: string;
|
|
1511
|
+
setSearchQuery: (query: string) => void;
|
|
1512
|
+
columnStats: Map<number, ColumnStats>;
|
|
1513
|
+
toggleColumnVisibility: (columnIndex: number) => void;
|
|
1514
|
+
resetColumnVisibility: () => void;
|
|
1515
|
+
setColumnWidth: (columnIndex: number, width: number) => void;
|
|
1516
|
+
formatCell: (value: unknown, columnIndex: number) => FormattedCell;
|
|
1517
|
+
getCellAlignment: (columnIndex: number) => 'left' | 'right';
|
|
1518
|
+
getTableAsTSV: () => string;
|
|
1519
|
+
}
|
|
1520
|
+
declare function useDataTable(table: RenderTableData, options?: DataTableOptions): UseDataTableReturn;
|
|
1521
|
+
|
|
1522
|
+
/** External container control. When provided, the card runs in embedded mode. */
|
|
1523
|
+
interface TableCardHost {
|
|
1524
|
+
onToggleFullscreen: () => void;
|
|
1525
|
+
isFullscreen: boolean;
|
|
1526
|
+
}
|
|
1322
1527
|
interface InteractiveTableCardProps {
|
|
1323
1528
|
table: RenderTableData;
|
|
1324
1529
|
onSendMessage?: (content: string) => void;
|
|
1325
1530
|
sendDisabled?: boolean;
|
|
1531
|
+
options?: DataTableOptions;
|
|
1532
|
+
/** When provided, the card runs in embedded mode — strips outer chrome, hides header, delegates fullscreen to the host. */
|
|
1533
|
+
host?: TableCardHost;
|
|
1326
1534
|
}
|
|
1327
1535
|
declare const InteractiveTableCard: react.NamedExoticComponent<InteractiveTableCardProps>;
|
|
1328
1536
|
|
|
1537
|
+
interface TabbedTableGroupProps {
|
|
1538
|
+
tables: RenderTableData[];
|
|
1539
|
+
onSendMessage?: (content: string) => void;
|
|
1540
|
+
sendDisabled?: boolean;
|
|
1541
|
+
}
|
|
1542
|
+
declare const TabbedTableGroup: react.NamedExoticComponent<TabbedTableGroupProps>;
|
|
1543
|
+
|
|
1544
|
+
interface TabbedChartGroupProps {
|
|
1545
|
+
charts: ChartData[];
|
|
1546
|
+
}
|
|
1547
|
+
declare const TabbedChartGroup: react.NamedExoticComponent<TabbedChartGroupProps>;
|
|
1548
|
+
|
|
1329
1549
|
/**
|
|
1330
1550
|
* useToast Hook
|
|
1331
1551
|
* Manages toast notification state
|
|
1332
1552
|
*/
|
|
1333
1553
|
type ToastType = 'success' | 'error' | 'info' | 'warning';
|
|
1554
|
+
interface ToastAction {
|
|
1555
|
+
label: string;
|
|
1556
|
+
onClick: () => void;
|
|
1557
|
+
}
|
|
1334
1558
|
interface ToastItem {
|
|
1335
1559
|
id: string;
|
|
1336
1560
|
type: ToastType;
|
|
1337
1561
|
message: string;
|
|
1338
1562
|
duration?: number;
|
|
1563
|
+
action?: ToastAction;
|
|
1339
1564
|
}
|
|
1340
1565
|
interface UseToastReturn {
|
|
1341
1566
|
toasts: ToastItem[];
|
|
1342
|
-
success: (msg: string, duration?: number) => void;
|
|
1343
|
-
error: (msg: string, duration?: number) => void;
|
|
1344
|
-
info: (msg: string, duration?: number) => void;
|
|
1345
|
-
warning: (msg: string, duration?: number) => void;
|
|
1567
|
+
success: (msg: string, duration?: number, action?: ToastAction) => void;
|
|
1568
|
+
error: (msg: string, duration?: number, action?: ToastAction) => void;
|
|
1569
|
+
info: (msg: string, duration?: number, action?: ToastAction) => void;
|
|
1570
|
+
warning: (msg: string, duration?: number, action?: ToastAction) => void;
|
|
1346
1571
|
dismiss: (id: string) => void;
|
|
1347
1572
|
dismissAll: () => void;
|
|
1348
1573
|
}
|
|
@@ -1373,8 +1598,10 @@ interface ToastProps {
|
|
|
1373
1598
|
onDismiss: (id: string) => void;
|
|
1374
1599
|
/** Label for dismiss button (defaults to "Dismiss") */
|
|
1375
1600
|
dismissLabel?: string;
|
|
1601
|
+
/** Optional action button rendered in the toast */
|
|
1602
|
+
action?: ToastAction;
|
|
1376
1603
|
}
|
|
1377
|
-
declare function Toast({ id, type, message, duration, onDismiss, dismissLabel, }: ToastProps): react_jsx_runtime.JSX.Element;
|
|
1604
|
+
declare function Toast({ id, type, message, duration, onDismiss, dismissLabel, action, }: ToastProps): react_jsx_runtime.JSX.Element;
|
|
1378
1605
|
|
|
1379
1606
|
interface ToastContainerProps {
|
|
1380
1607
|
toasts: ToastItem[];
|
|
@@ -1454,6 +1681,12 @@ interface ErrorBoundaryProps {
|
|
|
1454
1681
|
fallback?: ReactNode | ((error: Error | null, reset: () => void) => ReactNode);
|
|
1455
1682
|
/** Callback when an error is caught */
|
|
1456
1683
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
1684
|
+
/** Pre-translated strings for the emergency fallback (hook-free). Cache these before errors occur. */
|
|
1685
|
+
emergencyStrings?: {
|
|
1686
|
+
title: string;
|
|
1687
|
+
fallback: string;
|
|
1688
|
+
retry: string;
|
|
1689
|
+
};
|
|
1457
1690
|
}
|
|
1458
1691
|
interface ErrorBoundaryState {
|
|
1459
1692
|
hasError: boolean;
|
|
@@ -1493,6 +1726,16 @@ interface TypingIndicatorProps {
|
|
|
1493
1726
|
declare function TypingIndicator({ verbs: verbsProp, rotationInterval, className, }: TypingIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
1494
1727
|
declare const MemoizedTypingIndicator: react.MemoExoticComponent<typeof TypingIndicator>;
|
|
1495
1728
|
|
|
1729
|
+
interface ActivityTraceProps {
|
|
1730
|
+
thinkingContent: string;
|
|
1731
|
+
activeSteps: ActivityStep[];
|
|
1732
|
+
/** Consumer tool label prefix (e.g. 'Ali.Tools') for custom tool translations. */
|
|
1733
|
+
toolLabelPrefix?: string;
|
|
1734
|
+
className?: string;
|
|
1735
|
+
}
|
|
1736
|
+
declare function ActivityTraceInner({ thinkingContent, activeSteps, toolLabelPrefix, className, }: ActivityTraceProps): react_jsx_runtime.JSX.Element | null;
|
|
1737
|
+
declare const ActivityTrace: react.MemoExoticComponent<typeof ActivityTraceInner>;
|
|
1738
|
+
|
|
1496
1739
|
interface SidebarProps {
|
|
1497
1740
|
dataSource: ChatDataSource;
|
|
1498
1741
|
onSessionSelect: (sessionId: string) => void;
|
|
@@ -1613,8 +1856,9 @@ declare function SystemMessage({ content, createdAt, onCopy, hideActions, hideTi
|
|
|
1613
1856
|
|
|
1614
1857
|
interface DebugPanelProps {
|
|
1615
1858
|
trace?: DebugTrace$1;
|
|
1859
|
+
debugLimits?: DebugLimits | null;
|
|
1616
1860
|
}
|
|
1617
|
-
declare function DebugPanel({ trace }: DebugPanelProps): react_jsx_runtime.JSX.Element;
|
|
1861
|
+
declare function DebugPanel({ trace, debugLimits }: DebugPanelProps): react_jsx_runtime.JSX.Element;
|
|
1618
1862
|
|
|
1619
1863
|
/**
|
|
1620
1864
|
* Alert Component
|
|
@@ -1956,7 +2200,8 @@ declare const ActionButton: {
|
|
|
1956
2200
|
|
|
1957
2201
|
/**
|
|
1958
2202
|
* useStreaming hook
|
|
1959
|
-
*
|
|
2203
|
+
* BiChat-specific streaming hook that composes on top of applet-core's useStreaming.
|
|
2204
|
+
* Adds content accumulation, error state, and chunk type dispatch.
|
|
1960
2205
|
*/
|
|
1961
2206
|
|
|
1962
2207
|
interface UseStreamingOptions {
|
|
@@ -2380,7 +2625,10 @@ declare function useLongPress(options: LongPressOptions): LongPressResult;
|
|
|
2380
2625
|
/**
|
|
2381
2626
|
* Framer Motion animation variants for BiChat UI
|
|
2382
2627
|
* Subtle, professional animations for enterprise applications
|
|
2383
|
-
*
|
|
2628
|
+
*
|
|
2629
|
+
* Reduced-motion handling: Framer Motion's built-in `<MotionConfig reducedMotion="user">`
|
|
2630
|
+
* or the `useReducedMotion()` hook handle OS-level accessibility preferences reactively.
|
|
2631
|
+
* Variant objects declare their intended durations; Framer suppresses them automatically.
|
|
2384
2632
|
*/
|
|
2385
2633
|
/**
|
|
2386
2634
|
* Fade in animation
|
|
@@ -2943,135 +3191,6 @@ declare function addCSRFHeader(headers: Headers): Headers;
|
|
|
2943
3191
|
*/
|
|
2944
3192
|
declare function createHeadersWithCSRF(init?: HeadersInit): Headers;
|
|
2945
3193
|
|
|
2946
|
-
/**
|
|
2947
|
-
* Built-in HTTP data source with SSE streaming and AbortController
|
|
2948
|
-
* Implements ChatDataSource interface with real HTTP/RPC calls
|
|
2949
|
-
*
|
|
2950
|
-
* Uses turn-based architecture - fetches ConversationTurns instead of flat messages.
|
|
2951
|
-
*/
|
|
2952
|
-
|
|
2953
|
-
interface HttpDataSourceConfig {
|
|
2954
|
-
baseUrl: string;
|
|
2955
|
-
rpcEndpoint: string;
|
|
2956
|
-
streamEndpoint?: string;
|
|
2957
|
-
uploadEndpoint?: string;
|
|
2958
|
-
csrfToken?: string | (() => string);
|
|
2959
|
-
headers?: Record<string, string>;
|
|
2960
|
-
timeout?: number;
|
|
2961
|
-
/**
|
|
2962
|
-
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` or
|
|
2963
|
-
* `ChatSession` instead. Coupling navigation to the data source causes
|
|
2964
|
-
* component remounts during active streams.
|
|
2965
|
-
*/
|
|
2966
|
-
navigateToSession?: (sessionId: string) => void;
|
|
2967
|
-
}
|
|
2968
|
-
interface SessionState {
|
|
2969
|
-
session: Session$1;
|
|
2970
|
-
turns: ConversationTurn$1[];
|
|
2971
|
-
pendingQuestion?: PendingQuestion$1 | null;
|
|
2972
|
-
}
|
|
2973
|
-
interface Result<T> {
|
|
2974
|
-
success: boolean;
|
|
2975
|
-
data?: T;
|
|
2976
|
-
error?: string;
|
|
2977
|
-
}
|
|
2978
|
-
declare class HttpDataSource implements ChatDataSource {
|
|
2979
|
-
private config;
|
|
2980
|
-
private abortController;
|
|
2981
|
-
private rpc;
|
|
2982
|
-
constructor(config: HttpDataSourceConfig);
|
|
2983
|
-
/**
|
|
2984
|
-
* Get CSRF token from config
|
|
2985
|
-
*/
|
|
2986
|
-
private getCSRFToken;
|
|
2987
|
-
/**
|
|
2988
|
-
* Create headers for HTTP requests
|
|
2989
|
-
*/
|
|
2990
|
-
private createHeaders;
|
|
2991
|
-
private createUploadHeaders;
|
|
2992
|
-
private logAttachmentLifecycle;
|
|
2993
|
-
private normalizeAttachmentFile;
|
|
2994
|
-
private uploadFile;
|
|
2995
|
-
private attachmentToFile;
|
|
2996
|
-
private assertUploadReferences;
|
|
2997
|
-
private ensureAttachmentUpload;
|
|
2998
|
-
private callRPC;
|
|
2999
|
-
/**
|
|
3000
|
-
* Create a new chat session
|
|
3001
|
-
*/
|
|
3002
|
-
createSession(): Promise<Session$1>;
|
|
3003
|
-
/**
|
|
3004
|
-
* Fetch an existing session with turns (turn-based architecture)
|
|
3005
|
-
*/
|
|
3006
|
-
fetchSession(id: string): Promise<SessionState | null>;
|
|
3007
|
-
fetchSessionArtifacts(sessionId: string, options?: {
|
|
3008
|
-
limit?: number;
|
|
3009
|
-
offset?: number;
|
|
3010
|
-
}): Promise<{
|
|
3011
|
-
artifacts: SessionArtifact[];
|
|
3012
|
-
hasMore?: boolean;
|
|
3013
|
-
nextOffset?: number;
|
|
3014
|
-
}>;
|
|
3015
|
-
uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{
|
|
3016
|
-
artifacts: SessionArtifact[];
|
|
3017
|
-
}>;
|
|
3018
|
-
renameSessionArtifact(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
3019
|
-
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
3020
|
-
/**
|
|
3021
|
-
* Send a message and stream the response using SSE
|
|
3022
|
-
*/
|
|
3023
|
-
sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
3024
|
-
/**
|
|
3025
|
-
* Cancel ongoing stream
|
|
3026
|
-
*/
|
|
3027
|
-
cancelStream(): void;
|
|
3028
|
-
/**
|
|
3029
|
-
* Clear session history in-place.
|
|
3030
|
-
*/
|
|
3031
|
-
clearSessionHistory(sessionId: string): Promise<{
|
|
3032
|
-
success: boolean;
|
|
3033
|
-
deletedMessages: number;
|
|
3034
|
-
deletedArtifacts: number;
|
|
3035
|
-
}>;
|
|
3036
|
-
/**
|
|
3037
|
-
* Compact session history into summarized turn.
|
|
3038
|
-
*/
|
|
3039
|
-
compactSessionHistory(sessionId: string): Promise<{
|
|
3040
|
-
success: boolean;
|
|
3041
|
-
summary: string;
|
|
3042
|
-
deletedMessages: number;
|
|
3043
|
-
deletedArtifacts: number;
|
|
3044
|
-
}>;
|
|
3045
|
-
/**
|
|
3046
|
-
* Submit answers to a pending question
|
|
3047
|
-
*/
|
|
3048
|
-
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<Result<void>>;
|
|
3049
|
-
/**
|
|
3050
|
-
* Reject a pending question
|
|
3051
|
-
*/
|
|
3052
|
-
rejectPendingQuestion(sessionId: string): Promise<Result<void>>;
|
|
3053
|
-
/**
|
|
3054
|
-
* Navigate to a session (optional, for SPA routing)
|
|
3055
|
-
*/
|
|
3056
|
-
navigateToSession?(sessionId: string): void;
|
|
3057
|
-
listSessions(options?: {
|
|
3058
|
-
limit?: number;
|
|
3059
|
-
offset?: number;
|
|
3060
|
-
includeArchived?: boolean;
|
|
3061
|
-
}): Promise<SessionListResult$1>;
|
|
3062
|
-
archiveSession(sessionId: string): Promise<Session$1>;
|
|
3063
|
-
unarchiveSession(sessionId: string): Promise<Session$1>;
|
|
3064
|
-
pinSession(sessionId: string): Promise<Session$1>;
|
|
3065
|
-
unpinSession(sessionId: string): Promise<Session$1>;
|
|
3066
|
-
deleteSession(sessionId: string): Promise<void>;
|
|
3067
|
-
renameSession(sessionId: string, title: string): Promise<Session$1>;
|
|
3068
|
-
regenerateSessionTitle(sessionId: string): Promise<Session$1>;
|
|
3069
|
-
}
|
|
3070
|
-
/**
|
|
3071
|
-
* Factory function to create HttpDataSource
|
|
3072
|
-
*/
|
|
3073
|
-
declare function createHttpDataSource(config: HttpDataSourceConfig): ChatDataSource;
|
|
3074
|
-
|
|
3075
3194
|
type BichatRPC = {
|
|
3076
3195
|
"bichat.artifact.delete": {
|
|
3077
3196
|
params: ArtifactIDParams;
|
|
@@ -3230,6 +3349,8 @@ interface DebugTrace {
|
|
|
3230
3349
|
usage?: DebugUsage | null;
|
|
3231
3350
|
generationMs?: number;
|
|
3232
3351
|
tools?: DebugToolCall[];
|
|
3352
|
+
traceId?: string;
|
|
3353
|
+
traceUrl?: string;
|
|
3233
3354
|
}
|
|
3234
3355
|
interface DebugUsage {
|
|
3235
3356
|
promptTokens: number;
|
|
@@ -3352,6 +3473,119 @@ interface UserTurn {
|
|
|
3352
3473
|
createdAt: string;
|
|
3353
3474
|
}
|
|
3354
3475
|
|
|
3476
|
+
/**
|
|
3477
|
+
* Session lifecycle management: create, list, get, delete, archive, pin, rename.
|
|
3478
|
+
*
|
|
3479
|
+
* @internal — Not part of the public API. Consumed by HttpDataSource.
|
|
3480
|
+
*/
|
|
3481
|
+
|
|
3482
|
+
interface SessionState {
|
|
3483
|
+
session: Session$1;
|
|
3484
|
+
turns: ConversationTurn$1[];
|
|
3485
|
+
pendingQuestion?: PendingQuestion$1 | null;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
/**
|
|
3489
|
+
* Built-in HTTP data source with SSE streaming and AbortController
|
|
3490
|
+
* Implements ChatDataSource interface with real HTTP/RPC calls
|
|
3491
|
+
*
|
|
3492
|
+
* Uses turn-based architecture - fetches ConversationTurns instead of flat messages.
|
|
3493
|
+
*
|
|
3494
|
+
* This file is a thin facade that delegates to focused internal modules:
|
|
3495
|
+
* - SessionManager.ts — session CRUD (create, list, get, delete, archive, pin)
|
|
3496
|
+
* - MessageTransport.ts — send messages, stream responses, HITL questions
|
|
3497
|
+
* - ArtifactManager.ts — artifact fetch, upload, rename, delete
|
|
3498
|
+
* - AttachmentUploader.ts — file decode, normalize, upload
|
|
3499
|
+
* - mappers.ts — RPC-to-domain type mapping and sanitization
|
|
3500
|
+
*/
|
|
3501
|
+
|
|
3502
|
+
interface HttpDataSourceConfig {
|
|
3503
|
+
baseUrl: string;
|
|
3504
|
+
rpcEndpoint: string;
|
|
3505
|
+
streamEndpoint?: string;
|
|
3506
|
+
uploadEndpoint?: string;
|
|
3507
|
+
csrfToken?: string | (() => string);
|
|
3508
|
+
headers?: Record<string, string>;
|
|
3509
|
+
timeout?: number;
|
|
3510
|
+
/**
|
|
3511
|
+
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` or
|
|
3512
|
+
* `ChatSession` instead. Coupling navigation to the data source causes
|
|
3513
|
+
* component remounts during active streams.
|
|
3514
|
+
*/
|
|
3515
|
+
navigateToSession?: (sessionId: string) => void;
|
|
3516
|
+
}
|
|
3517
|
+
declare class HttpDataSource implements ChatDataSource {
|
|
3518
|
+
private config;
|
|
3519
|
+
private abortController;
|
|
3520
|
+
private rpc;
|
|
3521
|
+
constructor(config: HttpDataSourceConfig);
|
|
3522
|
+
private getCSRFToken;
|
|
3523
|
+
private createHeaders;
|
|
3524
|
+
private createUploadHeaders;
|
|
3525
|
+
private callRPC;
|
|
3526
|
+
private boundCallRPC;
|
|
3527
|
+
private boundUploadFile;
|
|
3528
|
+
createSession(): Promise<Session$1>;
|
|
3529
|
+
fetchSession(id: string): Promise<SessionState | null>;
|
|
3530
|
+
listSessions(options?: {
|
|
3531
|
+
limit?: number;
|
|
3532
|
+
offset?: number;
|
|
3533
|
+
includeArchived?: boolean;
|
|
3534
|
+
}): Promise<SessionListResult$1>;
|
|
3535
|
+
archiveSession(sessionId: string): Promise<Session$1>;
|
|
3536
|
+
unarchiveSession(sessionId: string): Promise<Session$1>;
|
|
3537
|
+
pinSession(sessionId: string): Promise<Session$1>;
|
|
3538
|
+
unpinSession(sessionId: string): Promise<Session$1>;
|
|
3539
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
3540
|
+
renameSession(sessionId: string, title: string): Promise<Session$1>;
|
|
3541
|
+
regenerateSessionTitle(sessionId: string): Promise<Session$1>;
|
|
3542
|
+
clearSessionHistory(sessionId: string): Promise<{
|
|
3543
|
+
success: boolean;
|
|
3544
|
+
deletedMessages: number;
|
|
3545
|
+
deletedArtifacts: number;
|
|
3546
|
+
}>;
|
|
3547
|
+
compactSessionHistory(sessionId: string): Promise<{
|
|
3548
|
+
success: boolean;
|
|
3549
|
+
summary: string;
|
|
3550
|
+
deletedMessages: number;
|
|
3551
|
+
deletedArtifacts: number;
|
|
3552
|
+
}>;
|
|
3553
|
+
stopGeneration(sessionId: string): Promise<void>;
|
|
3554
|
+
getStreamStatus(sessionId: string): Promise<StreamStatus | null>;
|
|
3555
|
+
resumeStream(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
3556
|
+
sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
3557
|
+
cancelStream(): void;
|
|
3558
|
+
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{
|
|
3559
|
+
success: boolean;
|
|
3560
|
+
error?: string;
|
|
3561
|
+
}>;
|
|
3562
|
+
rejectPendingQuestion(sessionId: string): Promise<{
|
|
3563
|
+
success: boolean;
|
|
3564
|
+
error?: string;
|
|
3565
|
+
}>;
|
|
3566
|
+
fetchSessionArtifacts(sessionId: string, options?: {
|
|
3567
|
+
limit?: number;
|
|
3568
|
+
offset?: number;
|
|
3569
|
+
}): Promise<{
|
|
3570
|
+
artifacts: SessionArtifact[];
|
|
3571
|
+
hasMore?: boolean;
|
|
3572
|
+
nextOffset?: number;
|
|
3573
|
+
}>;
|
|
3574
|
+
uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{
|
|
3575
|
+
artifacts: SessionArtifact[];
|
|
3576
|
+
}>;
|
|
3577
|
+
renameSessionArtifact(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
3578
|
+
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
3579
|
+
/**
|
|
3580
|
+
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` instead.
|
|
3581
|
+
*/
|
|
3582
|
+
navigateToSession?(sessionId: string): void;
|
|
3583
|
+
}
|
|
3584
|
+
/**
|
|
3585
|
+
* Factory function to create HttpDataSource
|
|
3586
|
+
*/
|
|
3587
|
+
declare function createHttpDataSource(config: HttpDataSourceConfig): ChatDataSource;
|
|
3588
|
+
|
|
3355
3589
|
/**
|
|
3356
3590
|
* Internal types for the ChatMachine.
|
|
3357
3591
|
*
|
|
@@ -3381,7 +3615,7 @@ interface SessionSnapshot {
|
|
|
3381
3615
|
setError: (error: string | null) => void;
|
|
3382
3616
|
retryFetchSession: () => void;
|
|
3383
3617
|
}
|
|
3384
|
-
/**
|
|
3618
|
+
/** Superset of ChatMessagingStateValue used internally by the state machine; includes internal-only fields such as generationInProgress. */
|
|
3385
3619
|
interface MessagingSnapshot {
|
|
3386
3620
|
turns: ConversationTurn$1[];
|
|
3387
3621
|
streamingContent: string;
|
|
@@ -3394,6 +3628,11 @@ interface MessagingSnapshot {
|
|
|
3394
3628
|
isCompacting: boolean;
|
|
3395
3629
|
compactionSummary: string | null;
|
|
3396
3630
|
artifactsInvalidationTrigger: number;
|
|
3631
|
+
thinkingContent: string;
|
|
3632
|
+
activeSteps: ActivityStep[];
|
|
3633
|
+
generationInProgress: boolean;
|
|
3634
|
+
showActivityTrace: boolean;
|
|
3635
|
+
showTypingIndicator: boolean;
|
|
3397
3636
|
sendMessage: (content: string, attachments?: Attachment$1[]) => Promise<void>;
|
|
3398
3637
|
handleRegenerate?: (turnId: string) => Promise<void>;
|
|
3399
3638
|
handleEdit?: (turnId: string, newContent: string) => Promise<void>;
|
|
@@ -3454,6 +3693,8 @@ declare class ChatMachine {
|
|
|
3454
3693
|
private disposed;
|
|
3455
3694
|
/** Memoized sessionDebugUsage — avoids unnecessary session re-renders during streaming. */
|
|
3456
3695
|
private lastSessionDebugUsage;
|
|
3696
|
+
/** Interval handle for passive polling when another tab has an active stream. */
|
|
3697
|
+
private passivePollingId;
|
|
3457
3698
|
private sessionListeners;
|
|
3458
3699
|
private messagingListeners;
|
|
3459
3700
|
private inputListeners;
|
|
@@ -3515,9 +3756,22 @@ declare class ChatMachine {
|
|
|
3515
3756
|
private _updateInput;
|
|
3516
3757
|
private _notifyInput;
|
|
3517
3758
|
private _persistQueue;
|
|
3759
|
+
private _setDebugModeForSession;
|
|
3760
|
+
private _hydrateDebugModeForSession;
|
|
3518
3761
|
private _fetchSessionIfNeeded;
|
|
3519
|
-
/**
|
|
3762
|
+
/**
|
|
3763
|
+
* Sets turns from fetch, preserving pending user-only turns if server hasn't caught up.
|
|
3764
|
+
* Applies `turns` + optional `pendingQuestion` in a single messaging update to avoid
|
|
3765
|
+
* transient intermediate UI states between separate notifications.
|
|
3766
|
+
*/
|
|
3520
3767
|
private _setTurnsFromFetch;
|
|
3768
|
+
/**
|
|
3769
|
+
* After fetch: if backend has an active stream, either resume (same-browser) or poll (passive).
|
|
3770
|
+
*/
|
|
3771
|
+
private _checkStreamStatusAndResumeOrPoll;
|
|
3772
|
+
private _stopPassivePolling;
|
|
3773
|
+
private _startPassivePolling;
|
|
3774
|
+
private _runResumeStream;
|
|
3521
3775
|
private _setError;
|
|
3522
3776
|
private _retryFetchSession;
|
|
3523
3777
|
private _clearStreamError;
|
|
@@ -3527,6 +3781,13 @@ declare class ChatMachine {
|
|
|
3527
3781
|
private _setMessage;
|
|
3528
3782
|
private _setInputError;
|
|
3529
3783
|
private _executeSlashCommand;
|
|
3784
|
+
private _insertOptimisticTurn;
|
|
3785
|
+
private _resolveSendSession;
|
|
3786
|
+
private _syncSessionFromServer;
|
|
3787
|
+
private _runSendStream;
|
|
3788
|
+
private _ensureSessionSyncAfterStream;
|
|
3789
|
+
private _finalizeSuccessfulSend;
|
|
3790
|
+
private _handleSendError;
|
|
3530
3791
|
/**
|
|
3531
3792
|
* Public entry point (no options). Calls _sendMessageCore internally.
|
|
3532
3793
|
*/
|
|
@@ -3540,6 +3801,11 @@ declare class ChatMachine {
|
|
|
3540
3801
|
* session creation, optimistic turns, and auto-queue-drain.
|
|
3541
3802
|
*/
|
|
3542
3803
|
private _sendMessageCore;
|
|
3804
|
+
private _handleThinkingChunk;
|
|
3805
|
+
private _handleToolStart;
|
|
3806
|
+
private _handleToolEnd;
|
|
3807
|
+
/** Match a step to a tool_end event. Use callId when present; fall back to name + agentName. */
|
|
3808
|
+
private _matchStep;
|
|
3543
3809
|
private _retryLastMessage;
|
|
3544
3810
|
private _handleRegenerate;
|
|
3545
3811
|
private _handleEdit;
|
|
@@ -3588,6 +3854,36 @@ declare function parseBichatStream(reader: ReadableStreamDefaultReader<Uint8Arra
|
|
|
3588
3854
|
*/
|
|
3589
3855
|
declare function parseBichatStreamEvents(reader: ReadableStreamDefaultReader<Uint8Array>): AsyncGenerator<StreamEvent, void, unknown>;
|
|
3590
3856
|
|
|
3857
|
+
/**
|
|
3858
|
+
* Tool label resolution for the Activity Trace.
|
|
3859
|
+
*
|
|
3860
|
+
* Convention: `BiChat.Tools.{toolName}` for SDK-provided tools.
|
|
3861
|
+
* Upstream consumers can extend with their own prefix (e.g., `Ali.Tools.{customTool}`).
|
|
3862
|
+
*/
|
|
3863
|
+
type TranslateFn = (key: string, params?: Record<string, string | number | boolean>) => string;
|
|
3864
|
+
/**
|
|
3865
|
+
* Resolve a human-readable label for a tool invocation.
|
|
3866
|
+
*
|
|
3867
|
+
* Lookup order:
|
|
3868
|
+
* 1. Consumer prefix (if provided), e.g. `Ali.Tools.custom_tool`
|
|
3869
|
+
* 2. SDK default prefix `BiChat.Tools.{name}`
|
|
3870
|
+
* 3. Fallback: humanise the raw tool name
|
|
3871
|
+
*/
|
|
3872
|
+
declare function getToolLabel(t: TranslateFn, name: string, args?: string, prefix?: string): string;
|
|
3873
|
+
|
|
3874
|
+
/**
|
|
3875
|
+
* Utility functions for activity step processing.
|
|
3876
|
+
*/
|
|
3877
|
+
|
|
3878
|
+
/**
|
|
3879
|
+
* Group activity steps by agent — top-level steps (no agentName) and
|
|
3880
|
+
* agent groups (keyed by agentName).
|
|
3881
|
+
*/
|
|
3882
|
+
declare function groupSteps(steps: ActivityStep[]): {
|
|
3883
|
+
topLevel: ActivityStep[];
|
|
3884
|
+
agentGroups: [string, ActivityStep[]][];
|
|
3885
|
+
};
|
|
3886
|
+
|
|
3591
3887
|
/**
|
|
3592
3888
|
* File Utilities
|
|
3593
3889
|
* Validation, conversion, and formatting for file attachments
|
|
@@ -3666,4 +3962,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
|
|
|
3666
3962
|
*/
|
|
3667
3963
|
declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
|
|
3668
3964
|
|
|
3669
|
-
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, 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 AssistantMessageTablesSlotProps, 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, BiChatLayout, type BiChatLayoutProps, 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, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionProviderProps, 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, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, 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 SessionStore, type SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, 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 UseSidebarStateReturn, 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, getCSRFToken, getFileVisual, getValidChildren, groupSessionsByDate, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
3965
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, 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 AssistantMessageTablesSlotProps, 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, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, 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 SessionStore, type SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, 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 UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, 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, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|