@iota-uz/sdk 0.4.23 → 0.4.24
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/applet/host.cjs +97 -10
- package/dist/applet/host.cjs.map +1 -1
- package/dist/applet/host.d.cts +9 -1
- package/dist/applet/host.d.ts +9 -1
- package/dist/applet/host.mjs +97 -10
- package/dist/applet/host.mjs.map +1 -1
- package/dist/bichat/index.cjs +1288 -330
- package/dist/bichat/index.cjs.map +1 -1
- package/dist/bichat/index.d.cts +1056 -784
- package/dist/bichat/index.d.ts +1056 -784
- package/dist/bichat/index.mjs +1287 -333
- package/dist/bichat/index.mjs.map +1 -1
- package/dist/index.cjs +97 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +97 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/tailwind/compiled.css +1 -1
package/dist/bichat/index.d.ts
CHANGED
|
@@ -72,19 +72,21 @@ interface ArtifactStore {
|
|
|
72
72
|
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
73
73
|
}
|
|
74
74
|
interface AdminStore {
|
|
75
|
-
listUsers(): Promise<SessionUser[]>;
|
|
75
|
+
listUsers(): Promise<SessionUser$1[]>;
|
|
76
76
|
listAllSessions(options?: {
|
|
77
77
|
limit?: number;
|
|
78
78
|
offset?: number;
|
|
79
79
|
includeArchived?: boolean;
|
|
80
80
|
userId?: string | null;
|
|
81
81
|
}): Promise<{
|
|
82
|
-
sessions:
|
|
83
|
-
owner: SessionUser;
|
|
84
|
-
}>;
|
|
82
|
+
sessions: Session$1[];
|
|
85
83
|
total: number;
|
|
86
84
|
hasMore: boolean;
|
|
87
85
|
}>;
|
|
86
|
+
listSessionMembers(sessionId: string): Promise<SessionMember$1[]>;
|
|
87
|
+
addSessionMember(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
88
|
+
updateSessionMemberRole(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
89
|
+
removeSessionMember(sessionId: string, userId: string): Promise<void>;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/**
|
|
@@ -97,6 +99,17 @@ interface Session$1 {
|
|
|
97
99
|
pinned: boolean;
|
|
98
100
|
createdAt: string;
|
|
99
101
|
updatedAt: string;
|
|
102
|
+
owner?: SessionUser$1;
|
|
103
|
+
isGroup?: boolean;
|
|
104
|
+
memberCount?: number;
|
|
105
|
+
access?: SessionAccess$1;
|
|
106
|
+
}
|
|
107
|
+
interface SessionAccess$1 {
|
|
108
|
+
role: 'owner' | 'editor' | 'viewer' | 'read_all' | 'none';
|
|
109
|
+
source: 'owner' | 'member' | 'permission' | 'none';
|
|
110
|
+
canRead: boolean;
|
|
111
|
+
canWrite: boolean;
|
|
112
|
+
canManageMembers: boolean;
|
|
100
113
|
}
|
|
101
114
|
/**
|
|
102
115
|
* A conversation turn groups a user message with its assistant response.
|
|
@@ -116,6 +129,7 @@ interface UserTurn$1 {
|
|
|
116
129
|
id: string;
|
|
117
130
|
content: string;
|
|
118
131
|
attachments: Attachment$1[];
|
|
132
|
+
author?: SessionUser$1;
|
|
119
133
|
createdAt: string;
|
|
120
134
|
}
|
|
121
135
|
/**
|
|
@@ -434,16 +448,16 @@ interface DebugTrace$1 {
|
|
|
434
448
|
generationMs?: number;
|
|
435
449
|
usage?: DebugUsage$1;
|
|
436
450
|
tools: StreamToolPayload[];
|
|
437
|
-
attempts?: DebugGeneration[];
|
|
438
|
-
spans?: DebugSpan[];
|
|
439
|
-
events?: DebugEvent[];
|
|
451
|
+
attempts?: DebugGeneration$1[];
|
|
452
|
+
spans?: DebugSpan$1[];
|
|
453
|
+
events?: DebugEvent$1[];
|
|
440
454
|
traceId?: string;
|
|
441
455
|
traceUrl?: string;
|
|
442
456
|
sessionId?: string;
|
|
443
457
|
thinking?: string;
|
|
444
458
|
observationReason?: string;
|
|
445
459
|
}
|
|
446
|
-
interface DebugGeneration {
|
|
460
|
+
interface DebugGeneration$1 {
|
|
447
461
|
id?: string;
|
|
448
462
|
requestId?: string;
|
|
449
463
|
model?: string;
|
|
@@ -463,7 +477,7 @@ interface DebugGeneration {
|
|
|
463
477
|
completedAt?: string;
|
|
464
478
|
toolCalls?: StreamToolPayload[];
|
|
465
479
|
}
|
|
466
|
-
interface DebugSpan {
|
|
480
|
+
interface DebugSpan$1 {
|
|
467
481
|
id?: string;
|
|
468
482
|
parentId?: string;
|
|
469
483
|
generationId?: string;
|
|
@@ -481,7 +495,7 @@ interface DebugSpan {
|
|
|
481
495
|
completedAt?: string;
|
|
482
496
|
attributes?: Record<string, unknown>;
|
|
483
497
|
}
|
|
484
|
-
interface DebugEvent {
|
|
498
|
+
interface DebugEvent$1 {
|
|
485
499
|
id?: string;
|
|
486
500
|
name?: string;
|
|
487
501
|
type?: string;
|
|
@@ -517,12 +531,18 @@ interface SessionListResult$1 {
|
|
|
517
531
|
total: number;
|
|
518
532
|
hasMore: boolean;
|
|
519
533
|
}
|
|
520
|
-
interface SessionUser {
|
|
534
|
+
interface SessionUser$1 {
|
|
521
535
|
id: string;
|
|
522
536
|
firstName: string;
|
|
523
537
|
lastName: string;
|
|
524
538
|
initials: string;
|
|
525
539
|
}
|
|
540
|
+
interface SessionMember$1 {
|
|
541
|
+
user: SessionUser$1;
|
|
542
|
+
role: 'owner' | 'editor' | 'viewer';
|
|
543
|
+
createdAt: string;
|
|
544
|
+
updatedAt: string;
|
|
545
|
+
}
|
|
526
546
|
interface SessionGroup {
|
|
527
547
|
name: string;
|
|
528
548
|
sessions: Session$1[];
|
|
@@ -617,19 +637,21 @@ interface ChatDataSource {
|
|
|
617
637
|
deleteSession(sessionId: string): Promise<void>;
|
|
618
638
|
renameSession(sessionId: string, title: string): Promise<Session$1>;
|
|
619
639
|
regenerateSessionTitle(sessionId: string): Promise<Session$1>;
|
|
620
|
-
listUsers?(): Promise<SessionUser[]>;
|
|
640
|
+
listUsers?(): Promise<SessionUser$1[]>;
|
|
621
641
|
listAllSessions?(options?: {
|
|
622
642
|
limit?: number;
|
|
623
643
|
offset?: number;
|
|
624
644
|
includeArchived?: boolean;
|
|
625
645
|
userId?: string | null;
|
|
626
646
|
}): Promise<{
|
|
627
|
-
sessions:
|
|
628
|
-
owner: SessionUser;
|
|
629
|
-
}>;
|
|
647
|
+
sessions: Session$1[];
|
|
630
648
|
total: number;
|
|
631
649
|
hasMore: boolean;
|
|
632
650
|
}>;
|
|
651
|
+
listSessionMembers?(sessionId: string): Promise<SessionMember$1[]>;
|
|
652
|
+
addSessionMember?(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
653
|
+
updateSessionMemberRole?(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
654
|
+
removeSessionMember?(sessionId: string, userId: string): Promise<void>;
|
|
633
655
|
}
|
|
634
656
|
interface ChatSessionStateValue {
|
|
635
657
|
session: Session$1 | null;
|
|
@@ -802,8 +824,16 @@ interface ChatHeaderProps {
|
|
|
802
824
|
logoSlot?: ReactNode;
|
|
803
825
|
/** Custom action buttons */
|
|
804
826
|
actionsSlot?: ReactNode;
|
|
827
|
+
/** Members to display in avatar stack for group chats */
|
|
828
|
+
members?: Array<{
|
|
829
|
+
firstName: string;
|
|
830
|
+
lastName: string;
|
|
831
|
+
initials?: string;
|
|
832
|
+
}>;
|
|
833
|
+
/** Callback when avatar stack is clicked (to open members modal) */
|
|
834
|
+
onMembersClick?: () => void;
|
|
805
835
|
}
|
|
806
|
-
declare function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
836
|
+
declare function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot, members, onMembersClick }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
807
837
|
|
|
808
838
|
interface MessageListProps {
|
|
809
839
|
renderUserTurn?: (turn: ConversationTurn$1) => ReactNode;
|
|
@@ -876,6 +906,8 @@ interface UserMessageProps {
|
|
|
876
906
|
turnId?: string;
|
|
877
907
|
/** User initials for avatar */
|
|
878
908
|
initials?: string;
|
|
909
|
+
/** Optional sender name for shared/group chats */
|
|
910
|
+
authorName?: string;
|
|
879
911
|
/** Slot overrides */
|
|
880
912
|
slots?: UserMessageSlots;
|
|
881
913
|
/** Class name overrides */
|
|
@@ -893,7 +925,7 @@ interface UserMessageProps {
|
|
|
893
925
|
/** Whether edit action should be available */
|
|
894
926
|
allowEdit?: boolean;
|
|
895
927
|
}
|
|
896
|
-
declare function UserMessage({ turn, turnId, initials, slots, classNames: classNameOverrides, onCopy, onEdit, hideAvatar, hideActions, hideTimestamp, allowEdit, }: UserMessageProps): react_jsx_runtime.JSX.Element;
|
|
928
|
+
declare function UserMessage({ turn, turnId, initials, authorName, slots, classNames: classNameOverrides, onCopy, onEdit, hideAvatar, hideActions, hideTimestamp, allowEdit, }: UserMessageProps): react_jsx_runtime.JSX.Element;
|
|
897
929
|
|
|
898
930
|
interface UserTurnViewProps {
|
|
899
931
|
/** The conversation turn containing the user message */
|
|
@@ -912,8 +944,10 @@ interface UserTurnViewProps {
|
|
|
912
944
|
hideTimestamp?: boolean;
|
|
913
945
|
/** Whether edit action should be available */
|
|
914
946
|
allowEdit?: boolean;
|
|
947
|
+
/** Show sender identity label above the message bubble */
|
|
948
|
+
showAuthorName?: boolean;
|
|
915
949
|
}
|
|
916
|
-
declare function UserTurnView({ turn, slots, classNames, initials, hideAvatar, hideActions, hideTimestamp, allowEdit, }: UserTurnViewProps): react_jsx_runtime.JSX.Element;
|
|
950
|
+
declare function UserTurnView({ turn, slots, classNames, initials, hideAvatar, hideActions, hideTimestamp, allowEdit, showAuthorName, }: UserTurnViewProps): react_jsx_runtime.JSX.Element;
|
|
917
951
|
|
|
918
952
|
interface AssistantMessageAvatarSlotProps {
|
|
919
953
|
/** Default text */
|
|
@@ -1655,13 +1689,45 @@ interface UserAvatarProps {
|
|
|
1655
1689
|
/** Override initials (defaults to first letters of first and last name) */
|
|
1656
1690
|
initials?: string;
|
|
1657
1691
|
/** Avatar size */
|
|
1658
|
-
size?: 'sm' | 'md' | 'lg';
|
|
1692
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
1659
1693
|
/** Additional CSS classes */
|
|
1660
1694
|
className?: string;
|
|
1661
1695
|
}
|
|
1662
1696
|
declare function UserAvatar({ firstName, lastName, initials: providedInitials, size, className, }: UserAvatarProps): react_jsx_runtime.JSX.Element;
|
|
1663
1697
|
declare const MemoizedUserAvatar: react.MemoExoticComponent<typeof UserAvatar>;
|
|
1664
1698
|
|
|
1699
|
+
/**
|
|
1700
|
+
* AvatarStack Component
|
|
1701
|
+
* Displays overlapping user avatars with an overflow "+N" indicator.
|
|
1702
|
+
* Used in ChatHeader and SessionItem for group chat visualization.
|
|
1703
|
+
*/
|
|
1704
|
+
interface AvatarStackProps {
|
|
1705
|
+
/** List of users to display */
|
|
1706
|
+
users: Array<{
|
|
1707
|
+
firstName: string;
|
|
1708
|
+
lastName: string;
|
|
1709
|
+
initials?: string;
|
|
1710
|
+
}>;
|
|
1711
|
+
/** Maximum avatars to show before "+N" (default: 3) */
|
|
1712
|
+
max?: number;
|
|
1713
|
+
/** Avatar size */
|
|
1714
|
+
size?: 'xs' | 'sm';
|
|
1715
|
+
/** Click handler — makes the stack interactive */
|
|
1716
|
+
onClick?: () => void;
|
|
1717
|
+
/** Additional CSS classes */
|
|
1718
|
+
className?: string;
|
|
1719
|
+
}
|
|
1720
|
+
declare function AvatarStackInner({ users, max, size, onClick, className, }: AvatarStackProps): react_jsx_runtime.JSX.Element;
|
|
1721
|
+
declare const AvatarStack: react.MemoExoticComponent<typeof AvatarStackInner>;
|
|
1722
|
+
|
|
1723
|
+
interface SessionMembersModalProps {
|
|
1724
|
+
isOpen: boolean;
|
|
1725
|
+
sessionId?: string;
|
|
1726
|
+
dataSource: ChatDataSource;
|
|
1727
|
+
onClose: () => void;
|
|
1728
|
+
}
|
|
1729
|
+
declare function SessionMembersModal({ isOpen, sessionId, dataSource, onClose }: SessionMembersModalProps): react_jsx_runtime.JSX.Element;
|
|
1730
|
+
|
|
1665
1731
|
interface PermissionGuardProps {
|
|
1666
1732
|
/** Permission names to check */
|
|
1667
1733
|
permissions: string[];
|
|
@@ -1797,9 +1863,9 @@ interface AllChatsListProps {
|
|
|
1797
1863
|
declare function AllChatsList({ dataSource, onSessionSelect, activeSessionId }: AllChatsListProps): react_jsx_runtime.JSX.Element;
|
|
1798
1864
|
|
|
1799
1865
|
interface UserFilterProps {
|
|
1800
|
-
users: SessionUser[];
|
|
1801
|
-
selectedUser: SessionUser | null;
|
|
1802
|
-
onUserChange: (user: SessionUser | null) => void;
|
|
1866
|
+
users: SessionUser$1[];
|
|
1867
|
+
selectedUser: SessionUser$1 | null;
|
|
1868
|
+
onUserChange: (user: SessionUser$1 | null) => void;
|
|
1803
1869
|
loading?: boolean;
|
|
1804
1870
|
}
|
|
1805
1871
|
declare function UserFilter({ users, selectedUser, onUserChange, loading }: UserFilterProps): react_jsx_runtime.JSX.Element;
|
|
@@ -2627,672 +2693,127 @@ interface LongPressResult {
|
|
|
2627
2693
|
}
|
|
2628
2694
|
declare function useLongPress(options: LongPressOptions): LongPressResult;
|
|
2629
2695
|
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
* Reduced-motion handling: Framer Motion's built-in `<MotionConfig reducedMotion="user">`
|
|
2635
|
-
* or the `useReducedMotion()` hook handle OS-level accessibility preferences reactively.
|
|
2636
|
-
* Variant objects declare their intended durations; Framer suppresses them automatically.
|
|
2637
|
-
*/
|
|
2638
|
-
/**
|
|
2639
|
-
* Fade in animation
|
|
2640
|
-
*/
|
|
2641
|
-
declare const fadeInVariants: {
|
|
2642
|
-
initial: {
|
|
2643
|
-
opacity: number;
|
|
2696
|
+
type BichatRPC = {
|
|
2697
|
+
"bichat.artifact.delete": {
|
|
2698
|
+
params: ArtifactIDParams;
|
|
2699
|
+
result: OkResult;
|
|
2644
2700
|
};
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
duration: number;
|
|
2649
|
-
};
|
|
2701
|
+
"bichat.artifact.update": {
|
|
2702
|
+
params: ArtifactUpdateParams;
|
|
2703
|
+
result: ArtifactResult;
|
|
2650
2704
|
};
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
duration: number;
|
|
2655
|
-
};
|
|
2705
|
+
"bichat.ping": {
|
|
2706
|
+
params: PingParams;
|
|
2707
|
+
result: PingResult;
|
|
2656
2708
|
};
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
*/
|
|
2661
|
-
declare const fadeInUpVariants: {
|
|
2662
|
-
initial: {
|
|
2663
|
-
opacity: number;
|
|
2664
|
-
y: number;
|
|
2709
|
+
"bichat.question.reject": {
|
|
2710
|
+
params: QuestionCancelParams;
|
|
2711
|
+
result: SessionGetResult;
|
|
2665
2712
|
};
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
transition: {
|
|
2670
|
-
duration: number;
|
|
2671
|
-
ease: number[];
|
|
2672
|
-
};
|
|
2713
|
+
"bichat.question.submit": {
|
|
2714
|
+
params: QuestionSubmitParams;
|
|
2715
|
+
result: SessionGetResult;
|
|
2673
2716
|
};
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
transition: {
|
|
2678
|
-
duration: number;
|
|
2679
|
-
};
|
|
2717
|
+
"bichat.session.archive": {
|
|
2718
|
+
params: SessionIDParams;
|
|
2719
|
+
result: SessionCreateResult;
|
|
2680
2720
|
};
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
*/
|
|
2685
|
-
declare const scaleFadeVariants: {
|
|
2686
|
-
initial: {
|
|
2687
|
-
opacity: number;
|
|
2688
|
-
scale: number;
|
|
2721
|
+
"bichat.session.artifacts": {
|
|
2722
|
+
params: SessionArtifactsParams;
|
|
2723
|
+
result: SessionArtifactsResult;
|
|
2689
2724
|
};
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
transition: {
|
|
2694
|
-
duration: number;
|
|
2695
|
-
};
|
|
2725
|
+
"bichat.session.clear": {
|
|
2726
|
+
params: SessionIDParams;
|
|
2727
|
+
result: SessionClearResult;
|
|
2696
2728
|
};
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
transition: {
|
|
2701
|
-
duration: number;
|
|
2702
|
-
};
|
|
2729
|
+
"bichat.session.compact": {
|
|
2730
|
+
params: SessionIDParams;
|
|
2731
|
+
result: SessionCompactResult;
|
|
2703
2732
|
};
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
*/
|
|
2708
|
-
declare const backdropVariants: {
|
|
2709
|
-
initial: {
|
|
2710
|
-
opacity: number;
|
|
2733
|
+
"bichat.session.create": {
|
|
2734
|
+
params: SessionCreateParams;
|
|
2735
|
+
result: SessionCreateResult;
|
|
2711
2736
|
};
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
duration: number;
|
|
2716
|
-
};
|
|
2737
|
+
"bichat.session.delete": {
|
|
2738
|
+
params: SessionIDParams;
|
|
2739
|
+
result: OkResult;
|
|
2717
2740
|
};
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
duration: number;
|
|
2722
|
-
};
|
|
2741
|
+
"bichat.session.get": {
|
|
2742
|
+
params: SessionGetParams;
|
|
2743
|
+
result: SessionGetResult;
|
|
2723
2744
|
};
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
*/
|
|
2728
|
-
declare const buttonVariants: {
|
|
2729
|
-
tap: {
|
|
2730
|
-
scale: number;
|
|
2745
|
+
"bichat.session.list": {
|
|
2746
|
+
params: SessionListParams;
|
|
2747
|
+
result: SessionListResult;
|
|
2731
2748
|
};
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
*/
|
|
2736
|
-
declare const staggerContainerVariants: {
|
|
2737
|
-
hidden: {
|
|
2738
|
-
opacity: number;
|
|
2749
|
+
"bichat.session.listAll": {
|
|
2750
|
+
params: SessionListAllParams;
|
|
2751
|
+
result: SessionListAllResult;
|
|
2739
2752
|
};
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
staggerChildren: number;
|
|
2744
|
-
delayChildren: number;
|
|
2745
|
-
};
|
|
2753
|
+
"bichat.session.members.add": {
|
|
2754
|
+
params: SessionMembersUpsertParams;
|
|
2755
|
+
result: OkResult;
|
|
2746
2756
|
};
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
*/
|
|
2751
|
-
declare const listItemVariants: {
|
|
2752
|
-
initial: {
|
|
2753
|
-
opacity: number;
|
|
2754
|
-
x: number;
|
|
2757
|
+
"bichat.session.members.list": {
|
|
2758
|
+
params: SessionMembersListParams;
|
|
2759
|
+
result: SessionMembersListResult;
|
|
2755
2760
|
};
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
transition: {
|
|
2760
|
-
duration: number;
|
|
2761
|
-
};
|
|
2761
|
+
"bichat.session.members.remove": {
|
|
2762
|
+
params: SessionMembersRemoveParams;
|
|
2763
|
+
result: OkResult;
|
|
2762
2764
|
};
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
transition: {
|
|
2767
|
-
duration: number;
|
|
2768
|
-
};
|
|
2765
|
+
"bichat.session.members.updateRole": {
|
|
2766
|
+
params: SessionMembersUpsertParams;
|
|
2767
|
+
result: OkResult;
|
|
2769
2768
|
};
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
*/
|
|
2774
|
-
declare const messageVariants: {
|
|
2775
|
-
initial: {
|
|
2776
|
-
opacity: number;
|
|
2777
|
-
y: number;
|
|
2769
|
+
"bichat.session.pin": {
|
|
2770
|
+
params: SessionIDParams;
|
|
2771
|
+
result: SessionCreateResult;
|
|
2778
2772
|
};
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
transition: {
|
|
2783
|
-
duration: number;
|
|
2784
|
-
ease: number[];
|
|
2785
|
-
};
|
|
2773
|
+
"bichat.session.regenerateTitle": {
|
|
2774
|
+
params: SessionIDParams;
|
|
2775
|
+
result: SessionCreateResult;
|
|
2786
2776
|
};
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
duration: number;
|
|
2791
|
-
};
|
|
2777
|
+
"bichat.session.unarchive": {
|
|
2778
|
+
params: SessionIDParams;
|
|
2779
|
+
result: SessionCreateResult;
|
|
2792
2780
|
};
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
*/
|
|
2797
|
-
declare const messageContainerVariants: {
|
|
2798
|
-
initial: {
|
|
2799
|
-
opacity: number;
|
|
2781
|
+
"bichat.session.unpin": {
|
|
2782
|
+
params: SessionIDParams;
|
|
2783
|
+
result: SessionCreateResult;
|
|
2800
2784
|
};
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
staggerChildren: number;
|
|
2805
|
-
delayChildren: number;
|
|
2806
|
-
};
|
|
2785
|
+
"bichat.session.updateTitle": {
|
|
2786
|
+
params: SessionUpdateTitleParams;
|
|
2787
|
+
result: SessionCreateResult;
|
|
2807
2788
|
};
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
*/
|
|
2812
|
-
declare const typingDotVariants: {
|
|
2813
|
-
initial: {
|
|
2814
|
-
opacity: number;
|
|
2789
|
+
"bichat.session.uploadArtifacts": {
|
|
2790
|
+
params: SessionUploadArtifactsParams;
|
|
2791
|
+
result: SessionUploadArtifactsResult;
|
|
2815
2792
|
};
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
duration: number;
|
|
2820
|
-
repeat: number;
|
|
2821
|
-
ease: string;
|
|
2822
|
-
};
|
|
2823
|
-
};
|
|
2824
|
-
};
|
|
2825
|
-
/**
|
|
2826
|
-
* Verb transition for typing indicator
|
|
2827
|
-
* Smooth slide-up animation for rotating text
|
|
2828
|
-
*/
|
|
2829
|
-
declare const verbTransitionVariants: {
|
|
2830
|
-
initial: {
|
|
2831
|
-
y: number;
|
|
2832
|
-
opacity: number;
|
|
2833
|
-
};
|
|
2834
|
-
animate: {
|
|
2835
|
-
y: number;
|
|
2836
|
-
opacity: number;
|
|
2837
|
-
transition: {
|
|
2838
|
-
duration: number;
|
|
2839
|
-
ease: string;
|
|
2840
|
-
};
|
|
2841
|
-
};
|
|
2842
|
-
exit: {
|
|
2843
|
-
y: number;
|
|
2844
|
-
opacity: number;
|
|
2845
|
-
transition: {
|
|
2846
|
-
duration: number;
|
|
2847
|
-
};
|
|
2848
|
-
};
|
|
2849
|
-
};
|
|
2850
|
-
/**
|
|
2851
|
-
* Floating button (scroll to bottom, etc.)
|
|
2852
|
-
*/
|
|
2853
|
-
declare const floatingButtonVariants: {
|
|
2854
|
-
initial: {
|
|
2855
|
-
opacity: number;
|
|
2856
|
-
scale: number;
|
|
2857
|
-
};
|
|
2858
|
-
animate: {
|
|
2859
|
-
opacity: number;
|
|
2860
|
-
scale: number;
|
|
2861
|
-
transition: {
|
|
2862
|
-
duration: number;
|
|
2863
|
-
};
|
|
2864
|
-
};
|
|
2865
|
-
exit: {
|
|
2866
|
-
opacity: number;
|
|
2867
|
-
scale: number;
|
|
2868
|
-
transition: {
|
|
2869
|
-
duration: number;
|
|
2870
|
-
};
|
|
2871
|
-
};
|
|
2872
|
-
};
|
|
2873
|
-
/**
|
|
2874
|
-
* Dropdown menu
|
|
2875
|
-
*/
|
|
2876
|
-
declare const dropdownVariants: {
|
|
2877
|
-
initial: {
|
|
2878
|
-
opacity: number;
|
|
2879
|
-
y: number;
|
|
2880
|
-
};
|
|
2881
|
-
animate: {
|
|
2882
|
-
opacity: number;
|
|
2883
|
-
y: number;
|
|
2884
|
-
transition: {
|
|
2885
|
-
duration: number;
|
|
2886
|
-
};
|
|
2887
|
-
};
|
|
2888
|
-
exit: {
|
|
2889
|
-
opacity: number;
|
|
2890
|
-
y: number;
|
|
2891
|
-
transition: {
|
|
2892
|
-
duration: number;
|
|
2893
|
-
};
|
|
2894
|
-
};
|
|
2895
|
-
};
|
|
2896
|
-
/**
|
|
2897
|
-
* Session item with subtle slide-right on hover
|
|
2898
|
-
*/
|
|
2899
|
-
declare const sessionItemVariants: {
|
|
2900
|
-
initial: {
|
|
2901
|
-
opacity: number;
|
|
2902
|
-
x: number;
|
|
2903
|
-
};
|
|
2904
|
-
animate: {
|
|
2905
|
-
opacity: number;
|
|
2906
|
-
x: number;
|
|
2907
|
-
transition: {
|
|
2908
|
-
duration: number;
|
|
2909
|
-
};
|
|
2910
|
-
};
|
|
2911
|
-
hover: {
|
|
2912
|
-
x: number;
|
|
2913
|
-
transition: {
|
|
2914
|
-
duration: number;
|
|
2915
|
-
};
|
|
2916
|
-
};
|
|
2917
|
-
exit: {
|
|
2918
|
-
opacity: number;
|
|
2919
|
-
x: number;
|
|
2920
|
-
transition: {
|
|
2921
|
-
duration: number;
|
|
2922
|
-
};
|
|
2923
|
-
};
|
|
2924
|
-
};
|
|
2925
|
-
/**
|
|
2926
|
-
* Error/alert message slide-in
|
|
2927
|
-
*/
|
|
2928
|
-
declare const errorMessageVariants: {
|
|
2929
|
-
initial: {
|
|
2930
|
-
opacity: number;
|
|
2931
|
-
y: number;
|
|
2932
|
-
height: number;
|
|
2933
|
-
};
|
|
2934
|
-
animate: {
|
|
2935
|
-
opacity: number;
|
|
2936
|
-
y: number;
|
|
2937
|
-
height: string;
|
|
2938
|
-
transition: {
|
|
2939
|
-
duration: number;
|
|
2940
|
-
ease: number[];
|
|
2941
|
-
};
|
|
2942
|
-
};
|
|
2943
|
-
exit: {
|
|
2944
|
-
opacity: number;
|
|
2945
|
-
y: number;
|
|
2946
|
-
height: number;
|
|
2947
|
-
transition: {
|
|
2948
|
-
duration: number;
|
|
2949
|
-
};
|
|
2793
|
+
"bichat.user.list": {
|
|
2794
|
+
params: PingParams;
|
|
2795
|
+
result: UserListResult;
|
|
2950
2796
|
};
|
|
2951
2797
|
};
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
*/
|
|
2966
|
-
rateLimitConfig?: RateLimiterConfig;
|
|
2967
|
-
/**
|
|
2968
|
-
* Called when the machine creates a new session (e.g. on first message in a
|
|
2969
|
-
* "new chat"). Use this to navigate your SPA router to the new session URL.
|
|
2970
|
-
*
|
|
2971
|
-
* Replaces the deprecated `dataSource.navigateToSession`.
|
|
2972
|
-
*/
|
|
2973
|
-
onSessionCreated?: (sessionId: string) => void;
|
|
2974
|
-
children: ReactNode;
|
|
2798
|
+
interface Artifact {
|
|
2799
|
+
id: string;
|
|
2800
|
+
sessionId: string;
|
|
2801
|
+
messageId?: string;
|
|
2802
|
+
uploadId?: number | null;
|
|
2803
|
+
type: string;
|
|
2804
|
+
name: string;
|
|
2805
|
+
description?: string;
|
|
2806
|
+
mimeType?: string;
|
|
2807
|
+
url?: string;
|
|
2808
|
+
sizeBytes: number;
|
|
2809
|
+
metadata?: Record<string, unknown>;
|
|
2810
|
+
createdAt: string;
|
|
2975
2811
|
}
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
declare function useChatMessaging(): ChatMessagingStateValue;
|
|
2979
|
-
/** Returns messaging context or null when outside ChatSessionProvider. */
|
|
2980
|
-
declare function useOptionalChatMessaging(): ChatMessagingStateValue | null;
|
|
2981
|
-
declare function useChatInput(): ChatInputStateValue;
|
|
2982
|
-
|
|
2983
|
-
/**
|
|
2984
|
-
* BiChat context types layered on top of canonical applet-core context contracts.
|
|
2985
|
-
*/
|
|
2986
|
-
|
|
2987
|
-
type UserContext = UserContext$1;
|
|
2988
|
-
type TenantContext = TenantContext$1;
|
|
2989
|
-
type LocaleContext = LocaleContext$1;
|
|
2990
|
-
type AppConfig = AppConfig$1 & {
|
|
2991
|
-
streamEndpoint: string;
|
|
2992
|
-
basePath: string;
|
|
2993
|
-
assetsBasePath: string;
|
|
2994
|
-
rpcUIEndpoint: string;
|
|
2995
|
-
};
|
|
2996
|
-
interface Extensions {
|
|
2997
|
-
branding?: {
|
|
2998
|
-
appName?: string;
|
|
2999
|
-
logoUrl?: string;
|
|
3000
|
-
theme?: {
|
|
3001
|
-
primary?: string;
|
|
3002
|
-
secondary?: string;
|
|
3003
|
-
accent?: string;
|
|
3004
|
-
};
|
|
3005
|
-
welcome?: {
|
|
3006
|
-
title?: string;
|
|
3007
|
-
description?: string;
|
|
3008
|
-
examplePrompts?: Array<{
|
|
3009
|
-
category: string;
|
|
3010
|
-
text: string;
|
|
3011
|
-
icon: string;
|
|
3012
|
-
}>;
|
|
3013
|
-
};
|
|
3014
|
-
colors?: {
|
|
3015
|
-
primary?: string;
|
|
3016
|
-
secondary?: string;
|
|
3017
|
-
accent?: string;
|
|
3018
|
-
};
|
|
3019
|
-
logo?: {
|
|
3020
|
-
src?: string;
|
|
3021
|
-
alt?: string;
|
|
3022
|
-
};
|
|
3023
|
-
};
|
|
3024
|
-
features?: {
|
|
3025
|
-
vision?: boolean;
|
|
3026
|
-
webSearch?: boolean;
|
|
3027
|
-
codeInterpreter?: boolean;
|
|
3028
|
-
multiAgent?: boolean;
|
|
3029
|
-
};
|
|
3030
|
-
llm?: {
|
|
3031
|
-
provider?: string;
|
|
3032
|
-
apiKeyConfigured?: boolean;
|
|
3033
|
-
};
|
|
3034
|
-
debug?: {
|
|
3035
|
-
limits?: {
|
|
3036
|
-
policyMaxTokens: number;
|
|
3037
|
-
modelMaxTokens: number;
|
|
3038
|
-
effectiveMaxTokens: number;
|
|
3039
|
-
completionReserveTokens: number;
|
|
3040
|
-
};
|
|
3041
|
-
};
|
|
2812
|
+
interface ArtifactIDParams {
|
|
2813
|
+
id: string;
|
|
3042
2814
|
}
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
extensions?: Extensions;
|
|
3046
|
-
};
|
|
3047
|
-
declare global {
|
|
3048
|
-
interface Window {
|
|
3049
|
-
__APPLET_CONTEXT__: IotaContext;
|
|
3050
|
-
__CSRF_TOKEN__: string;
|
|
3051
|
-
}
|
|
3052
|
-
}
|
|
3053
|
-
|
|
3054
|
-
interface IotaContextProviderProps {
|
|
3055
|
-
/**
|
|
3056
|
-
* Explicit context object. When provided, the window global is not read.
|
|
3057
|
-
* Useful for tests, Storybook, or apps that manage their own context.
|
|
3058
|
-
*/
|
|
3059
|
-
context?: IotaContext;
|
|
3060
|
-
children: ReactNode;
|
|
3061
|
-
}
|
|
3062
|
-
declare function IotaContextProvider({ context, children }: IotaContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
3063
|
-
declare function useIotaContext(): IotaContext;
|
|
3064
|
-
/**
|
|
3065
|
-
* Check if user has a specific permission
|
|
3066
|
-
*/
|
|
3067
|
-
declare function hasPermission(permission: string): boolean;
|
|
3068
|
-
|
|
3069
|
-
/** @deprecated Use `IotaContextProvider` with its `context` prop instead. */
|
|
3070
|
-
interface BiChatConfig {
|
|
3071
|
-
user: {
|
|
3072
|
-
id: string;
|
|
3073
|
-
email: string;
|
|
3074
|
-
firstName: string;
|
|
3075
|
-
lastName: string;
|
|
3076
|
-
permissions: string[];
|
|
3077
|
-
};
|
|
3078
|
-
tenant: {
|
|
3079
|
-
id: string;
|
|
3080
|
-
name: string;
|
|
3081
|
-
};
|
|
3082
|
-
locale: {
|
|
3083
|
-
language: string;
|
|
3084
|
-
translations: Record<string, string>;
|
|
3085
|
-
};
|
|
3086
|
-
endpoints: {
|
|
3087
|
-
rpc: string;
|
|
3088
|
-
stream: string;
|
|
3089
|
-
};
|
|
3090
|
-
csrfToken?: string;
|
|
3091
|
-
}
|
|
3092
|
-
interface ConfigProviderProps {
|
|
3093
|
-
config?: BiChatConfig;
|
|
3094
|
-
useGlobalConfig?: boolean;
|
|
3095
|
-
children: ReactNode;
|
|
3096
|
-
}
|
|
3097
|
-
/**
|
|
3098
|
-
* @deprecated Use `IotaContextProvider` with its `context` prop instead.
|
|
3099
|
-
*
|
|
3100
|
-
* ConfigProvider component — provides configuration to the BiChat library.
|
|
3101
|
-
*
|
|
3102
|
-
* @param config - Configuration object (preferred method)
|
|
3103
|
-
* @param useGlobalConfig - If true, falls back to window.__APPLET_CONTEXT__ when config is not provided
|
|
3104
|
-
* @param children - React children
|
|
3105
|
-
*/
|
|
3106
|
-
declare function ConfigProvider({ config, useGlobalConfig, children }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
3107
|
-
/**
|
|
3108
|
-
* Hook to access BiChat configuration
|
|
3109
|
-
* Returns null if no configuration is available
|
|
3110
|
-
*/
|
|
3111
|
-
declare function useConfig(): BiChatConfig | null;
|
|
3112
|
-
/**
|
|
3113
|
-
* Hook to access BiChat configuration (required)
|
|
3114
|
-
* Throws an error if configuration is not available
|
|
3115
|
-
*/
|
|
3116
|
-
declare function useRequiredConfig(): BiChatConfig;
|
|
3117
|
-
|
|
3118
|
-
/**
|
|
3119
|
-
* Theme system type definitions
|
|
3120
|
-
*/
|
|
3121
|
-
interface Theme {
|
|
3122
|
-
name: string;
|
|
3123
|
-
colors: ThemeColors;
|
|
3124
|
-
spacing: ThemeSpacing;
|
|
3125
|
-
borderRadius: ThemeBorderRadius;
|
|
3126
|
-
}
|
|
3127
|
-
interface ThemeColors {
|
|
3128
|
-
background: string;
|
|
3129
|
-
surface: string;
|
|
3130
|
-
primary: string;
|
|
3131
|
-
secondary: string;
|
|
3132
|
-
text: string;
|
|
3133
|
-
textMuted: string;
|
|
3134
|
-
border: string;
|
|
3135
|
-
error: string;
|
|
3136
|
-
success: string;
|
|
3137
|
-
warning: string;
|
|
3138
|
-
userBubble: string;
|
|
3139
|
-
assistantBubble: string;
|
|
3140
|
-
userText: string;
|
|
3141
|
-
assistantText: string;
|
|
3142
|
-
}
|
|
3143
|
-
interface ThemeSpacing {
|
|
3144
|
-
xs: string;
|
|
3145
|
-
sm: string;
|
|
3146
|
-
md: string;
|
|
3147
|
-
lg: string;
|
|
3148
|
-
xl: string;
|
|
3149
|
-
}
|
|
3150
|
-
interface ThemeBorderRadius {
|
|
3151
|
-
sm: string;
|
|
3152
|
-
md: string;
|
|
3153
|
-
lg: string;
|
|
3154
|
-
full: string;
|
|
3155
|
-
}
|
|
3156
|
-
|
|
3157
|
-
interface ThemeProviderProps {
|
|
3158
|
-
theme?: Theme | 'light' | 'dark' | 'system';
|
|
3159
|
-
children: ReactNode;
|
|
3160
|
-
}
|
|
3161
|
-
/**
|
|
3162
|
-
* Theme provider component
|
|
3163
|
-
* Wraps the application and provides theme context
|
|
3164
|
-
*/
|
|
3165
|
-
declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
3166
|
-
/**
|
|
3167
|
-
* Hook to access current theme
|
|
3168
|
-
*/
|
|
3169
|
-
declare function useTheme(): Theme;
|
|
3170
|
-
|
|
3171
|
-
/**
|
|
3172
|
-
* Predefined theme configurations
|
|
3173
|
-
*/
|
|
3174
|
-
|
|
3175
|
-
declare const lightTheme: Theme;
|
|
3176
|
-
declare const darkTheme: Theme;
|
|
3177
|
-
|
|
3178
|
-
/**
|
|
3179
|
-
* CSRF token management for API requests
|
|
3180
|
-
*/
|
|
3181
|
-
/**
|
|
3182
|
-
* Get CSRF token from window object
|
|
3183
|
-
* @returns CSRF token string
|
|
3184
|
-
*/
|
|
3185
|
-
declare function getCSRFToken(): string;
|
|
3186
|
-
/**
|
|
3187
|
-
* Add CSRF token to request headers
|
|
3188
|
-
* @param headers - Headers object to modify
|
|
3189
|
-
* @returns Modified headers object
|
|
3190
|
-
*/
|
|
3191
|
-
declare function addCSRFHeader(headers: Headers): Headers;
|
|
3192
|
-
/**
|
|
3193
|
-
* Create headers with CSRF token
|
|
3194
|
-
* @param init - Optional initial headers
|
|
3195
|
-
* @returns Headers object with CSRF token
|
|
3196
|
-
*/
|
|
3197
|
-
declare function createHeadersWithCSRF(init?: HeadersInit): Headers;
|
|
3198
|
-
|
|
3199
|
-
type BichatRPC = {
|
|
3200
|
-
"bichat.artifact.delete": {
|
|
3201
|
-
params: ArtifactIDParams;
|
|
3202
|
-
result: OkResult;
|
|
3203
|
-
};
|
|
3204
|
-
"bichat.artifact.update": {
|
|
3205
|
-
params: ArtifactUpdateParams;
|
|
3206
|
-
result: ArtifactResult;
|
|
3207
|
-
};
|
|
3208
|
-
"bichat.ping": {
|
|
3209
|
-
params: PingParams;
|
|
3210
|
-
result: PingResult;
|
|
3211
|
-
};
|
|
3212
|
-
"bichat.question.reject": {
|
|
3213
|
-
params: QuestionCancelParams;
|
|
3214
|
-
result: SessionGetResult;
|
|
3215
|
-
};
|
|
3216
|
-
"bichat.question.submit": {
|
|
3217
|
-
params: QuestionSubmitParams;
|
|
3218
|
-
result: SessionGetResult;
|
|
3219
|
-
};
|
|
3220
|
-
"bichat.session.archive": {
|
|
3221
|
-
params: SessionIDParams;
|
|
3222
|
-
result: SessionCreateResult;
|
|
3223
|
-
};
|
|
3224
|
-
"bichat.session.artifacts": {
|
|
3225
|
-
params: SessionArtifactsParams;
|
|
3226
|
-
result: SessionArtifactsResult;
|
|
3227
|
-
};
|
|
3228
|
-
"bichat.session.clear": {
|
|
3229
|
-
params: SessionIDParams;
|
|
3230
|
-
result: SessionClearResult;
|
|
3231
|
-
};
|
|
3232
|
-
"bichat.session.compact": {
|
|
3233
|
-
params: SessionIDParams;
|
|
3234
|
-
result: SessionCompactResult;
|
|
3235
|
-
};
|
|
3236
|
-
"bichat.session.create": {
|
|
3237
|
-
params: SessionCreateParams;
|
|
3238
|
-
result: SessionCreateResult;
|
|
3239
|
-
};
|
|
3240
|
-
"bichat.session.delete": {
|
|
3241
|
-
params: SessionIDParams;
|
|
3242
|
-
result: OkResult;
|
|
3243
|
-
};
|
|
3244
|
-
"bichat.session.get": {
|
|
3245
|
-
params: SessionGetParams;
|
|
3246
|
-
result: SessionGetResult;
|
|
3247
|
-
};
|
|
3248
|
-
"bichat.session.list": {
|
|
3249
|
-
params: SessionListParams;
|
|
3250
|
-
result: SessionListResult;
|
|
3251
|
-
};
|
|
3252
|
-
"bichat.session.pin": {
|
|
3253
|
-
params: SessionIDParams;
|
|
3254
|
-
result: SessionCreateResult;
|
|
3255
|
-
};
|
|
3256
|
-
"bichat.session.regenerateTitle": {
|
|
3257
|
-
params: SessionIDParams;
|
|
3258
|
-
result: SessionCreateResult;
|
|
3259
|
-
};
|
|
3260
|
-
"bichat.session.unarchive": {
|
|
3261
|
-
params: SessionIDParams;
|
|
3262
|
-
result: SessionCreateResult;
|
|
3263
|
-
};
|
|
3264
|
-
"bichat.session.unpin": {
|
|
3265
|
-
params: SessionIDParams;
|
|
3266
|
-
result: SessionCreateResult;
|
|
3267
|
-
};
|
|
3268
|
-
"bichat.session.updateTitle": {
|
|
3269
|
-
params: SessionUpdateTitleParams;
|
|
3270
|
-
result: SessionCreateResult;
|
|
3271
|
-
};
|
|
3272
|
-
"bichat.session.uploadArtifacts": {
|
|
3273
|
-
params: SessionUploadArtifactsParams;
|
|
3274
|
-
result: SessionUploadArtifactsResult;
|
|
3275
|
-
};
|
|
3276
|
-
};
|
|
3277
|
-
interface Artifact {
|
|
3278
|
-
id: string;
|
|
3279
|
-
sessionId: string;
|
|
3280
|
-
messageId?: string;
|
|
3281
|
-
uploadId?: number;
|
|
3282
|
-
type: string;
|
|
3283
|
-
name: string;
|
|
3284
|
-
description?: string;
|
|
3285
|
-
mimeType?: string;
|
|
3286
|
-
url?: string;
|
|
3287
|
-
sizeBytes: number;
|
|
3288
|
-
metadata?: Record<string, unknown>;
|
|
3289
|
-
createdAt: string;
|
|
3290
|
-
}
|
|
3291
|
-
interface ArtifactIDParams {
|
|
3292
|
-
id: string;
|
|
3293
|
-
}
|
|
3294
|
-
interface ArtifactResult {
|
|
3295
|
-
artifact: Artifact;
|
|
2815
|
+
interface ArtifactResult {
|
|
2816
|
+
artifact: Artifact;
|
|
3296
2817
|
}
|
|
3297
2818
|
interface ArtifactUpdateParams {
|
|
3298
2819
|
id: string;
|
|
@@ -3312,11 +2833,11 @@ interface AssistantTurn {
|
|
|
3312
2833
|
createdAt: string;
|
|
3313
2834
|
}
|
|
3314
2835
|
interface Attachment {
|
|
3315
|
-
id
|
|
3316
|
-
uploadId?: number;
|
|
3317
|
-
filename
|
|
3318
|
-
mimeType
|
|
3319
|
-
sizeBytes
|
|
2836
|
+
id: string;
|
|
2837
|
+
uploadId?: number | null;
|
|
2838
|
+
filename: string;
|
|
2839
|
+
mimeType: string;
|
|
2840
|
+
sizeBytes: number;
|
|
3320
2841
|
url?: string;
|
|
3321
2842
|
}
|
|
3322
2843
|
interface Citation {
|
|
@@ -3327,6 +2848,7 @@ interface Citation {
|
|
|
3327
2848
|
startIndex: number;
|
|
3328
2849
|
endIndex: number;
|
|
3329
2850
|
excerpt?: string;
|
|
2851
|
+
source?: string;
|
|
3330
2852
|
}
|
|
3331
2853
|
interface CodeOutput {
|
|
3332
2854
|
type: string;
|
|
@@ -3342,20 +2864,79 @@ interface ConversationTurn {
|
|
|
3342
2864
|
assistantTurn?: AssistantTurn | null;
|
|
3343
2865
|
createdAt: string;
|
|
3344
2866
|
}
|
|
3345
|
-
interface
|
|
3346
|
-
|
|
2867
|
+
interface DebugEvent {
|
|
2868
|
+
id?: string;
|
|
3347
2869
|
name?: string;
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
2870
|
+
type?: string;
|
|
2871
|
+
level?: string;
|
|
2872
|
+
message?: string;
|
|
2873
|
+
reason?: string;
|
|
2874
|
+
spanId?: string;
|
|
2875
|
+
generationId?: string;
|
|
2876
|
+
timestamp?: string;
|
|
2877
|
+
attributes?: Record<string, unknown>;
|
|
2878
|
+
}
|
|
2879
|
+
interface DebugGeneration {
|
|
2880
|
+
id?: string;
|
|
2881
|
+
requestId?: string;
|
|
2882
|
+
model?: string;
|
|
2883
|
+
provider?: string;
|
|
2884
|
+
finishReason?: string;
|
|
2885
|
+
promptTokens?: number;
|
|
2886
|
+
completionTokens?: number;
|
|
2887
|
+
totalTokens?: number;
|
|
2888
|
+
cachedTokens?: number;
|
|
2889
|
+
cost?: number;
|
|
2890
|
+
latencyMs?: number;
|
|
2891
|
+
input?: string;
|
|
2892
|
+
output?: string;
|
|
2893
|
+
thinking?: string;
|
|
2894
|
+
observationReason?: string;
|
|
2895
|
+
startedAt?: string;
|
|
2896
|
+
completedAt?: string;
|
|
2897
|
+
toolCalls?: DebugToolCall[];
|
|
2898
|
+
}
|
|
2899
|
+
interface DebugSpan {
|
|
2900
|
+
id?: string;
|
|
2901
|
+
parentId?: string;
|
|
2902
|
+
generationId?: string;
|
|
2903
|
+
name?: string;
|
|
2904
|
+
type?: string;
|
|
2905
|
+
status?: string;
|
|
2906
|
+
level?: string;
|
|
2907
|
+
callId?: string;
|
|
2908
|
+
toolName?: string;
|
|
2909
|
+
input?: string;
|
|
2910
|
+
output?: string;
|
|
2911
|
+
error?: string;
|
|
2912
|
+
durationMs?: number;
|
|
2913
|
+
startedAt?: string;
|
|
2914
|
+
completedAt?: string;
|
|
2915
|
+
attributes?: Record<string, unknown>;
|
|
2916
|
+
}
|
|
2917
|
+
interface DebugToolCall {
|
|
2918
|
+
callId?: string;
|
|
2919
|
+
name?: string;
|
|
2920
|
+
arguments?: string;
|
|
2921
|
+
result?: string;
|
|
2922
|
+
error?: string;
|
|
2923
|
+
durationMs?: number;
|
|
2924
|
+
}
|
|
2925
|
+
interface DebugTrace {
|
|
2926
|
+
schemaVersion?: string;
|
|
2927
|
+
startedAt?: string;
|
|
2928
|
+
completedAt?: string;
|
|
2929
|
+
usage?: DebugUsage | null;
|
|
3355
2930
|
generationMs?: number;
|
|
3356
2931
|
tools?: DebugToolCall[];
|
|
2932
|
+
attempts?: DebugGeneration[];
|
|
2933
|
+
spans?: DebugSpan[];
|
|
2934
|
+
events?: DebugEvent[];
|
|
3357
2935
|
traceId?: string;
|
|
3358
2936
|
traceUrl?: string;
|
|
2937
|
+
sessionId?: string;
|
|
2938
|
+
thinking?: string;
|
|
2939
|
+
observationReason?: string;
|
|
3359
2940
|
}
|
|
3360
2941
|
interface DebugUsage {
|
|
3361
2942
|
promptTokens: number;
|
|
@@ -3403,6 +2984,17 @@ interface Session {
|
|
|
3403
2984
|
pinned: boolean;
|
|
3404
2985
|
createdAt: string;
|
|
3405
2986
|
updatedAt: string;
|
|
2987
|
+
owner?: SessionUser | null;
|
|
2988
|
+
isGroup?: boolean;
|
|
2989
|
+
memberCount?: number;
|
|
2990
|
+
access?: SessionAccess | null;
|
|
2991
|
+
}
|
|
2992
|
+
interface SessionAccess {
|
|
2993
|
+
role: string;
|
|
2994
|
+
source: string;
|
|
2995
|
+
canRead: boolean;
|
|
2996
|
+
canWrite: boolean;
|
|
2997
|
+
canManageMembers: boolean;
|
|
3406
2998
|
}
|
|
3407
2999
|
interface SessionArtifactsParams {
|
|
3408
3000
|
sessionId: string;
|
|
@@ -3442,6 +3034,17 @@ interface SessionGetResult {
|
|
|
3442
3034
|
interface SessionIDParams {
|
|
3443
3035
|
id: string;
|
|
3444
3036
|
}
|
|
3037
|
+
interface SessionListAllParams {
|
|
3038
|
+
limit: number;
|
|
3039
|
+
offset: number;
|
|
3040
|
+
includeArchived: boolean;
|
|
3041
|
+
userId?: string | null;
|
|
3042
|
+
}
|
|
3043
|
+
interface SessionListAllResult {
|
|
3044
|
+
sessions: Session[];
|
|
3045
|
+
total?: number;
|
|
3046
|
+
hasMore: boolean;
|
|
3047
|
+
}
|
|
3445
3048
|
interface SessionListParams {
|
|
3446
3049
|
limit: number;
|
|
3447
3050
|
offset: number;
|
|
@@ -3452,6 +3055,27 @@ interface SessionListResult {
|
|
|
3452
3055
|
total?: number;
|
|
3453
3056
|
hasMore: boolean;
|
|
3454
3057
|
}
|
|
3058
|
+
interface SessionMember {
|
|
3059
|
+
user: SessionUser;
|
|
3060
|
+
role: string;
|
|
3061
|
+
createdAt: string;
|
|
3062
|
+
updatedAt: string;
|
|
3063
|
+
}
|
|
3064
|
+
interface SessionMembersListParams {
|
|
3065
|
+
sessionId: string;
|
|
3066
|
+
}
|
|
3067
|
+
interface SessionMembersListResult {
|
|
3068
|
+
members: SessionMember[];
|
|
3069
|
+
}
|
|
3070
|
+
interface SessionMembersRemoveParams {
|
|
3071
|
+
sessionId: string;
|
|
3072
|
+
userId: string;
|
|
3073
|
+
}
|
|
3074
|
+
interface SessionMembersUpsertParams {
|
|
3075
|
+
sessionId: string;
|
|
3076
|
+
userId: string;
|
|
3077
|
+
role: string;
|
|
3078
|
+
}
|
|
3455
3079
|
interface SessionUpdateTitleParams {
|
|
3456
3080
|
id: string;
|
|
3457
3081
|
title: string;
|
|
@@ -3463,6 +3087,12 @@ interface SessionUploadArtifactsParams {
|
|
|
3463
3087
|
interface SessionUploadArtifactsResult {
|
|
3464
3088
|
artifacts: Artifact[];
|
|
3465
3089
|
}
|
|
3090
|
+
interface SessionUser {
|
|
3091
|
+
id: string;
|
|
3092
|
+
firstName: string;
|
|
3093
|
+
lastName: string;
|
|
3094
|
+
initials: string;
|
|
3095
|
+
}
|
|
3466
3096
|
interface ToolCall {
|
|
3467
3097
|
id: string;
|
|
3468
3098
|
name: string;
|
|
@@ -3471,130 +3101,772 @@ interface ToolCall {
|
|
|
3471
3101
|
error?: string;
|
|
3472
3102
|
durationMs?: number;
|
|
3473
3103
|
}
|
|
3474
|
-
interface
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3104
|
+
interface UserListResult {
|
|
3105
|
+
users: SessionUser[];
|
|
3106
|
+
}
|
|
3107
|
+
interface UserTurn {
|
|
3108
|
+
id: string;
|
|
3109
|
+
content: string;
|
|
3110
|
+
attachments: Attachment[];
|
|
3111
|
+
author?: SessionUser | null;
|
|
3112
|
+
createdAt: string;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
/**
|
|
3116
|
+
* Session lifecycle management: create, list, get, delete, archive, pin, rename.
|
|
3117
|
+
*
|
|
3118
|
+
* @internal — Not part of the public API. Consumed by HttpDataSource.
|
|
3119
|
+
*/
|
|
3120
|
+
|
|
3121
|
+
interface SessionState {
|
|
3122
|
+
session: Session$1;
|
|
3123
|
+
turns: ConversationTurn$1[];
|
|
3124
|
+
pendingQuestion?: PendingQuestion$1 | null;
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
/**
|
|
3128
|
+
* Built-in HTTP data source with SSE streaming and AbortController
|
|
3129
|
+
* Implements ChatDataSource interface with real HTTP/RPC calls
|
|
3130
|
+
*
|
|
3131
|
+
* Uses turn-based architecture - fetches ConversationTurns instead of flat messages.
|
|
3132
|
+
*
|
|
3133
|
+
* This file is a thin facade that delegates to focused internal modules:
|
|
3134
|
+
* - SessionManager.ts — session CRUD (create, list, get, delete, archive, pin)
|
|
3135
|
+
* - MessageTransport.ts — send messages, stream responses, HITL questions
|
|
3136
|
+
* - ArtifactManager.ts — artifact fetch, upload, rename, delete
|
|
3137
|
+
* - AttachmentUploader.ts — file decode, normalize, upload
|
|
3138
|
+
* - mappers.ts — RPC-to-domain type mapping and sanitization
|
|
3139
|
+
*/
|
|
3140
|
+
|
|
3141
|
+
interface HttpDataSourceConfig {
|
|
3142
|
+
baseUrl: string;
|
|
3143
|
+
rpcEndpoint: string;
|
|
3144
|
+
streamEndpoint?: string;
|
|
3145
|
+
uploadEndpoint?: string;
|
|
3146
|
+
csrfToken?: string | (() => string);
|
|
3147
|
+
headers?: Record<string, string>;
|
|
3148
|
+
timeout?: number;
|
|
3149
|
+
/**
|
|
3150
|
+
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` or
|
|
3151
|
+
* `ChatSession` instead. Coupling navigation to the data source causes
|
|
3152
|
+
* component remounts during active streams.
|
|
3153
|
+
*/
|
|
3154
|
+
navigateToSession?: (sessionId: string) => void;
|
|
3155
|
+
}
|
|
3156
|
+
declare class HttpDataSource implements ChatDataSource {
|
|
3157
|
+
private config;
|
|
3158
|
+
private abortController;
|
|
3159
|
+
private rpc;
|
|
3160
|
+
constructor(config: HttpDataSourceConfig);
|
|
3161
|
+
private getCSRFToken;
|
|
3162
|
+
private createHeaders;
|
|
3163
|
+
private createUploadHeaders;
|
|
3164
|
+
private callRPC;
|
|
3165
|
+
private boundCallRPC;
|
|
3166
|
+
private boundUploadFile;
|
|
3167
|
+
createSession(): Promise<Session$1>;
|
|
3168
|
+
fetchSession(id: string): Promise<SessionState | null>;
|
|
3169
|
+
listSessions(options?: {
|
|
3170
|
+
limit?: number;
|
|
3171
|
+
offset?: number;
|
|
3172
|
+
includeArchived?: boolean;
|
|
3173
|
+
}): Promise<SessionListResult$1>;
|
|
3174
|
+
archiveSession(sessionId: string): Promise<Session$1>;
|
|
3175
|
+
unarchiveSession(sessionId: string): Promise<Session$1>;
|
|
3176
|
+
pinSession(sessionId: string): Promise<Session$1>;
|
|
3177
|
+
unpinSession(sessionId: string): Promise<Session$1>;
|
|
3178
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
3179
|
+
renameSession(sessionId: string, title: string): Promise<Session$1>;
|
|
3180
|
+
regenerateSessionTitle(sessionId: string): Promise<Session$1>;
|
|
3181
|
+
clearSessionHistory(sessionId: string): Promise<{
|
|
3182
|
+
success: boolean;
|
|
3183
|
+
deletedMessages: number;
|
|
3184
|
+
deletedArtifacts: number;
|
|
3185
|
+
}>;
|
|
3186
|
+
compactSessionHistory(sessionId: string): Promise<{
|
|
3187
|
+
success: boolean;
|
|
3188
|
+
summary: string;
|
|
3189
|
+
deletedMessages: number;
|
|
3190
|
+
deletedArtifacts: number;
|
|
3191
|
+
}>;
|
|
3192
|
+
listUsers(): Promise<SessionUser$1[]>;
|
|
3193
|
+
listAllSessions(options?: {
|
|
3194
|
+
limit?: number;
|
|
3195
|
+
offset?: number;
|
|
3196
|
+
includeArchived?: boolean;
|
|
3197
|
+
userId?: string | null;
|
|
3198
|
+
}): Promise<{
|
|
3199
|
+
sessions: Session$1[];
|
|
3200
|
+
total: number;
|
|
3201
|
+
hasMore: boolean;
|
|
3202
|
+
}>;
|
|
3203
|
+
listSessionMembers(sessionId: string): Promise<SessionMember$1[]>;
|
|
3204
|
+
addSessionMember(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
3205
|
+
updateSessionMemberRole(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise<void>;
|
|
3206
|
+
removeSessionMember(sessionId: string, userId: string): Promise<void>;
|
|
3207
|
+
stopGeneration(sessionId: string): Promise<void>;
|
|
3208
|
+
getStreamStatus(sessionId: string): Promise<StreamStatus | null>;
|
|
3209
|
+
resumeStream(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
3210
|
+
sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
3211
|
+
cancelStream(): void;
|
|
3212
|
+
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{
|
|
3213
|
+
success: boolean;
|
|
3214
|
+
error?: string;
|
|
3215
|
+
data?: {
|
|
3216
|
+
session: Session$1;
|
|
3217
|
+
turns: ConversationTurn$1[];
|
|
3218
|
+
pendingQuestion?: PendingQuestion$1 | null;
|
|
3219
|
+
};
|
|
3220
|
+
}>;
|
|
3221
|
+
rejectPendingQuestion(sessionId: string): Promise<{
|
|
3222
|
+
success: boolean;
|
|
3223
|
+
error?: string;
|
|
3224
|
+
}>;
|
|
3225
|
+
fetchSessionArtifacts(sessionId: string, options?: {
|
|
3226
|
+
limit?: number;
|
|
3227
|
+
offset?: number;
|
|
3228
|
+
}): Promise<{
|
|
3229
|
+
artifacts: SessionArtifact[];
|
|
3230
|
+
hasMore?: boolean;
|
|
3231
|
+
nextOffset?: number;
|
|
3232
|
+
}>;
|
|
3233
|
+
uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{
|
|
3234
|
+
artifacts: SessionArtifact[];
|
|
3235
|
+
}>;
|
|
3236
|
+
renameSessionArtifact(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
3237
|
+
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
3238
|
+
/**
|
|
3239
|
+
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` instead.
|
|
3240
|
+
*/
|
|
3241
|
+
navigateToSession?(sessionId: string): void;
|
|
3242
|
+
}
|
|
3243
|
+
/**
|
|
3244
|
+
* Factory function to create HttpDataSource
|
|
3245
|
+
*/
|
|
3246
|
+
declare function createHttpDataSource(config: HttpDataSourceConfig): ChatDataSource;
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* Builds HttpDataSourceConfig from window.__APPLET_CONTEXT__.
|
|
3250
|
+
* For use with createHttpDataSource when the app is embedded via the applet framework.
|
|
3251
|
+
*
|
|
3252
|
+
* Expects the host to inject context with:
|
|
3253
|
+
* - config.rpcUIEndpoint, config.streamEndpoint
|
|
3254
|
+
* - session.csrfToken (or window.__CSRF_TOKEN__)
|
|
3255
|
+
*/
|
|
3256
|
+
|
|
3257
|
+
/**
|
|
3258
|
+
* Returns HttpDataSourceConfig derived from window.__APPLET_CONTEXT__.
|
|
3259
|
+
* Use with createHttpDataSource() for RPC and SSE endpoints.
|
|
3260
|
+
*
|
|
3261
|
+
* @throws Error if window.__APPLET_CONTEXT__ is not available
|
|
3262
|
+
*/
|
|
3263
|
+
declare function useHttpDataSourceConfigFromApplet(options?: {
|
|
3264
|
+
timeout?: number;
|
|
3265
|
+
}): HttpDataSourceConfig;
|
|
3266
|
+
|
|
3267
|
+
/**
|
|
3268
|
+
* Router adapter for BiChat sidebar and archived list.
|
|
3269
|
+
* Consumes a navigate function and location (pathname) and returns
|
|
3270
|
+
* activeSessionId plus callbacks for use with SDK Sidebar and ArchivedChatList.
|
|
3271
|
+
*
|
|
3272
|
+
* Router-agnostic: pass useNavigate()/useLocation() from react-router-dom
|
|
3273
|
+
* or equivalent from your router.
|
|
3274
|
+
*/
|
|
3275
|
+
interface UseBichatRouterParams {
|
|
3276
|
+
/** Navigate to a path (e.g. from useNavigate()) */
|
|
3277
|
+
navigate: (path: string) => void;
|
|
3278
|
+
/** Current pathname (e.g. location.pathname from useLocation()) */
|
|
3279
|
+
pathname: string;
|
|
3280
|
+
/** Optional: close mobile sidebar after navigation (e.g. closeMobile from useSidebarState) */
|
|
3281
|
+
onNavigate?: () => void;
|
|
3282
|
+
}
|
|
3283
|
+
interface UseBichatRouterReturn {
|
|
3284
|
+
/** Session ID extracted from pathname (e.g. /session/:id -> id) */
|
|
3285
|
+
activeSessionId: string | undefined;
|
|
3286
|
+
/** Navigate to session or home when sessionId is empty */
|
|
3287
|
+
onSessionSelect: (sessionId: string) => void;
|
|
3288
|
+
/** Navigate to new chat (home) */
|
|
3289
|
+
onNewChat: () => void;
|
|
3290
|
+
/** Navigate to archived list */
|
|
3291
|
+
onArchivedView: () => void;
|
|
3292
|
+
/** Navigate back (e.g. to home) */
|
|
3293
|
+
onBack: () => void;
|
|
3294
|
+
}
|
|
3295
|
+
/**
|
|
3296
|
+
* Derives BiChat navigation callbacks and activeSessionId from router state.
|
|
3297
|
+
* Use with SDK Sidebar (onSessionSelect, onNewChat, onArchivedView, activeSessionId)
|
|
3298
|
+
* and ArchivedChatList (onBack, onSessionSelect).
|
|
3299
|
+
*/
|
|
3300
|
+
declare function useBichatRouter({ navigate, pathname, onNavigate, }: UseBichatRouterParams): UseBichatRouterReturn;
|
|
3301
|
+
|
|
3302
|
+
/**
|
|
3303
|
+
* Framer Motion animation variants for BiChat UI
|
|
3304
|
+
* Subtle, professional animations for enterprise applications
|
|
3305
|
+
*
|
|
3306
|
+
* Reduced-motion handling: Framer Motion's built-in `<MotionConfig reducedMotion="user">`
|
|
3307
|
+
* or the `useReducedMotion()` hook handle OS-level accessibility preferences reactively.
|
|
3308
|
+
* Variant objects declare their intended durations; Framer suppresses them automatically.
|
|
3309
|
+
*/
|
|
3310
|
+
/**
|
|
3311
|
+
* Fade in animation
|
|
3312
|
+
*/
|
|
3313
|
+
declare const fadeInVariants: {
|
|
3314
|
+
initial: {
|
|
3315
|
+
opacity: number;
|
|
3316
|
+
};
|
|
3317
|
+
animate: {
|
|
3318
|
+
opacity: number;
|
|
3319
|
+
transition: {
|
|
3320
|
+
duration: number;
|
|
3321
|
+
};
|
|
3322
|
+
};
|
|
3323
|
+
exit: {
|
|
3324
|
+
opacity: number;
|
|
3325
|
+
transition: {
|
|
3326
|
+
duration: number;
|
|
3327
|
+
};
|
|
3328
|
+
};
|
|
3329
|
+
};
|
|
3330
|
+
/**
|
|
3331
|
+
* Fade in with subtle slide up
|
|
3332
|
+
*/
|
|
3333
|
+
declare const fadeInUpVariants: {
|
|
3334
|
+
initial: {
|
|
3335
|
+
opacity: number;
|
|
3336
|
+
y: number;
|
|
3337
|
+
};
|
|
3338
|
+
animate: {
|
|
3339
|
+
opacity: number;
|
|
3340
|
+
y: number;
|
|
3341
|
+
transition: {
|
|
3342
|
+
duration: number;
|
|
3343
|
+
ease: number[];
|
|
3344
|
+
};
|
|
3345
|
+
};
|
|
3346
|
+
exit: {
|
|
3347
|
+
opacity: number;
|
|
3348
|
+
y: number;
|
|
3349
|
+
transition: {
|
|
3350
|
+
duration: number;
|
|
3351
|
+
};
|
|
3352
|
+
};
|
|
3353
|
+
};
|
|
3354
|
+
/**
|
|
3355
|
+
* Scale fade for modals and popups
|
|
3356
|
+
*/
|
|
3357
|
+
declare const scaleFadeVariants: {
|
|
3358
|
+
initial: {
|
|
3359
|
+
opacity: number;
|
|
3360
|
+
scale: number;
|
|
3361
|
+
};
|
|
3362
|
+
animate: {
|
|
3363
|
+
opacity: number;
|
|
3364
|
+
scale: number;
|
|
3365
|
+
transition: {
|
|
3366
|
+
duration: number;
|
|
3367
|
+
};
|
|
3368
|
+
};
|
|
3369
|
+
exit: {
|
|
3370
|
+
opacity: number;
|
|
3371
|
+
scale: number;
|
|
3372
|
+
transition: {
|
|
3373
|
+
duration: number;
|
|
3374
|
+
};
|
|
3375
|
+
};
|
|
3376
|
+
};
|
|
3377
|
+
/**
|
|
3378
|
+
* Modal backdrop
|
|
3379
|
+
*/
|
|
3380
|
+
declare const backdropVariants: {
|
|
3381
|
+
initial: {
|
|
3382
|
+
opacity: number;
|
|
3383
|
+
};
|
|
3384
|
+
animate: {
|
|
3385
|
+
opacity: number;
|
|
3386
|
+
transition: {
|
|
3387
|
+
duration: number;
|
|
3388
|
+
};
|
|
3389
|
+
};
|
|
3390
|
+
exit: {
|
|
3391
|
+
opacity: number;
|
|
3392
|
+
transition: {
|
|
3393
|
+
duration: number;
|
|
3394
|
+
};
|
|
3395
|
+
};
|
|
3396
|
+
};
|
|
3397
|
+
/**
|
|
3398
|
+
* Button press feedback
|
|
3399
|
+
*/
|
|
3400
|
+
declare const buttonVariants: {
|
|
3401
|
+
tap: {
|
|
3402
|
+
scale: number;
|
|
3403
|
+
};
|
|
3404
|
+
};
|
|
3405
|
+
/**
|
|
3406
|
+
* Stagger container for lists
|
|
3407
|
+
*/
|
|
3408
|
+
declare const staggerContainerVariants: {
|
|
3409
|
+
hidden: {
|
|
3410
|
+
opacity: number;
|
|
3411
|
+
};
|
|
3412
|
+
visible: {
|
|
3413
|
+
opacity: number;
|
|
3414
|
+
transition: {
|
|
3415
|
+
staggerChildren: number;
|
|
3416
|
+
delayChildren: number;
|
|
3417
|
+
};
|
|
3418
|
+
};
|
|
3419
|
+
};
|
|
3420
|
+
/**
|
|
3421
|
+
* List item animation
|
|
3422
|
+
*/
|
|
3423
|
+
declare const listItemVariants: {
|
|
3424
|
+
initial: {
|
|
3425
|
+
opacity: number;
|
|
3426
|
+
x: number;
|
|
3427
|
+
};
|
|
3428
|
+
animate: {
|
|
3429
|
+
opacity: number;
|
|
3430
|
+
x: number;
|
|
3431
|
+
transition: {
|
|
3432
|
+
duration: number;
|
|
3433
|
+
};
|
|
3434
|
+
};
|
|
3435
|
+
exit: {
|
|
3436
|
+
opacity: number;
|
|
3437
|
+
x: number;
|
|
3438
|
+
transition: {
|
|
3439
|
+
duration: number;
|
|
3440
|
+
};
|
|
3441
|
+
};
|
|
3442
|
+
};
|
|
3443
|
+
/**
|
|
3444
|
+
* Message entrance animation
|
|
3445
|
+
*/
|
|
3446
|
+
declare const messageVariants: {
|
|
3447
|
+
initial: {
|
|
3448
|
+
opacity: number;
|
|
3449
|
+
y: number;
|
|
3450
|
+
};
|
|
3451
|
+
animate: {
|
|
3452
|
+
opacity: number;
|
|
3453
|
+
y: number;
|
|
3454
|
+
transition: {
|
|
3455
|
+
duration: number;
|
|
3456
|
+
ease: number[];
|
|
3457
|
+
};
|
|
3458
|
+
};
|
|
3459
|
+
exit: {
|
|
3460
|
+
opacity: number;
|
|
3461
|
+
transition: {
|
|
3462
|
+
duration: number;
|
|
3463
|
+
};
|
|
3464
|
+
};
|
|
3465
|
+
};
|
|
3466
|
+
/**
|
|
3467
|
+
* Container for staggered messages
|
|
3468
|
+
*/
|
|
3469
|
+
declare const messageContainerVariants: {
|
|
3470
|
+
initial: {
|
|
3471
|
+
opacity: number;
|
|
3472
|
+
};
|
|
3473
|
+
animate: {
|
|
3474
|
+
opacity: number;
|
|
3475
|
+
transition: {
|
|
3476
|
+
staggerChildren: number;
|
|
3477
|
+
delayChildren: number;
|
|
3478
|
+
};
|
|
3479
|
+
};
|
|
3480
|
+
};
|
|
3481
|
+
/**
|
|
3482
|
+
* Typing indicator dots
|
|
3483
|
+
*/
|
|
3484
|
+
declare const typingDotVariants: {
|
|
3485
|
+
initial: {
|
|
3486
|
+
opacity: number;
|
|
3487
|
+
};
|
|
3488
|
+
animate: {
|
|
3489
|
+
opacity: number[];
|
|
3490
|
+
transition: {
|
|
3491
|
+
duration: number;
|
|
3492
|
+
repeat: number;
|
|
3493
|
+
ease: string;
|
|
3494
|
+
};
|
|
3495
|
+
};
|
|
3496
|
+
};
|
|
3497
|
+
/**
|
|
3498
|
+
* Verb transition for typing indicator
|
|
3499
|
+
* Smooth slide-up animation for rotating text
|
|
3500
|
+
*/
|
|
3501
|
+
declare const verbTransitionVariants: {
|
|
3502
|
+
initial: {
|
|
3503
|
+
y: number;
|
|
3504
|
+
opacity: number;
|
|
3505
|
+
};
|
|
3506
|
+
animate: {
|
|
3507
|
+
y: number;
|
|
3508
|
+
opacity: number;
|
|
3509
|
+
transition: {
|
|
3510
|
+
duration: number;
|
|
3511
|
+
ease: string;
|
|
3512
|
+
};
|
|
3513
|
+
};
|
|
3514
|
+
exit: {
|
|
3515
|
+
y: number;
|
|
3516
|
+
opacity: number;
|
|
3517
|
+
transition: {
|
|
3518
|
+
duration: number;
|
|
3519
|
+
};
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3522
|
+
/**
|
|
3523
|
+
* Floating button (scroll to bottom, etc.)
|
|
3524
|
+
*/
|
|
3525
|
+
declare const floatingButtonVariants: {
|
|
3526
|
+
initial: {
|
|
3527
|
+
opacity: number;
|
|
3528
|
+
scale: number;
|
|
3529
|
+
};
|
|
3530
|
+
animate: {
|
|
3531
|
+
opacity: number;
|
|
3532
|
+
scale: number;
|
|
3533
|
+
transition: {
|
|
3534
|
+
duration: number;
|
|
3535
|
+
};
|
|
3536
|
+
};
|
|
3537
|
+
exit: {
|
|
3538
|
+
opacity: number;
|
|
3539
|
+
scale: number;
|
|
3540
|
+
transition: {
|
|
3541
|
+
duration: number;
|
|
3542
|
+
};
|
|
3543
|
+
};
|
|
3544
|
+
};
|
|
3545
|
+
/**
|
|
3546
|
+
* Dropdown menu
|
|
3547
|
+
*/
|
|
3548
|
+
declare const dropdownVariants: {
|
|
3549
|
+
initial: {
|
|
3550
|
+
opacity: number;
|
|
3551
|
+
y: number;
|
|
3552
|
+
};
|
|
3553
|
+
animate: {
|
|
3554
|
+
opacity: number;
|
|
3555
|
+
y: number;
|
|
3556
|
+
transition: {
|
|
3557
|
+
duration: number;
|
|
3558
|
+
};
|
|
3559
|
+
};
|
|
3560
|
+
exit: {
|
|
3561
|
+
opacity: number;
|
|
3562
|
+
y: number;
|
|
3563
|
+
transition: {
|
|
3564
|
+
duration: number;
|
|
3565
|
+
};
|
|
3566
|
+
};
|
|
3567
|
+
};
|
|
3568
|
+
/**
|
|
3569
|
+
* Session item with subtle slide-right on hover
|
|
3570
|
+
*/
|
|
3571
|
+
declare const sessionItemVariants: {
|
|
3572
|
+
initial: {
|
|
3573
|
+
opacity: number;
|
|
3574
|
+
x: number;
|
|
3575
|
+
};
|
|
3576
|
+
animate: {
|
|
3577
|
+
opacity: number;
|
|
3578
|
+
x: number;
|
|
3579
|
+
transition: {
|
|
3580
|
+
duration: number;
|
|
3581
|
+
};
|
|
3582
|
+
};
|
|
3583
|
+
hover: {
|
|
3584
|
+
x: number;
|
|
3585
|
+
transition: {
|
|
3586
|
+
duration: number;
|
|
3587
|
+
};
|
|
3588
|
+
};
|
|
3589
|
+
exit: {
|
|
3590
|
+
opacity: number;
|
|
3591
|
+
x: number;
|
|
3592
|
+
transition: {
|
|
3593
|
+
duration: number;
|
|
3594
|
+
};
|
|
3595
|
+
};
|
|
3596
|
+
};
|
|
3597
|
+
/**
|
|
3598
|
+
* Error/alert message slide-in
|
|
3599
|
+
*/
|
|
3600
|
+
declare const errorMessageVariants: {
|
|
3601
|
+
initial: {
|
|
3602
|
+
opacity: number;
|
|
3603
|
+
y: number;
|
|
3604
|
+
height: number;
|
|
3605
|
+
};
|
|
3606
|
+
animate: {
|
|
3607
|
+
opacity: number;
|
|
3608
|
+
y: number;
|
|
3609
|
+
height: string;
|
|
3610
|
+
transition: {
|
|
3611
|
+
duration: number;
|
|
3612
|
+
ease: number[];
|
|
3613
|
+
};
|
|
3614
|
+
};
|
|
3615
|
+
exit: {
|
|
3616
|
+
opacity: number;
|
|
3617
|
+
y: number;
|
|
3618
|
+
height: number;
|
|
3619
|
+
transition: {
|
|
3620
|
+
duration: number;
|
|
3621
|
+
};
|
|
3622
|
+
};
|
|
3623
|
+
};
|
|
3624
|
+
|
|
3625
|
+
interface ChatSessionProviderProps {
|
|
3626
|
+
dataSource: ChatDataSource;
|
|
3627
|
+
sessionId?: string;
|
|
3628
|
+
/**
|
|
3629
|
+
* External rate limiter instance. Captured once at mount — changing this prop
|
|
3630
|
+
* after initial render has no effect. For most cases, use `rateLimitConfig`
|
|
3631
|
+
* instead and let the provider create the limiter internally.
|
|
3632
|
+
*/
|
|
3633
|
+
rateLimiter?: RateLimiter;
|
|
3634
|
+
/**
|
|
3635
|
+
* Configuration for the built-in rate limiter (ignored when `rateLimiter` is
|
|
3636
|
+
* provided). Captured once at mount — changing after initial render has no effect.
|
|
3637
|
+
*/
|
|
3638
|
+
rateLimitConfig?: RateLimiterConfig;
|
|
3639
|
+
/**
|
|
3640
|
+
* Called when the machine creates a new session (e.g. on first message in a
|
|
3641
|
+
* "new chat"). Use this to navigate your SPA router to the new session URL.
|
|
3642
|
+
*
|
|
3643
|
+
* Replaces the deprecated `dataSource.navigateToSession`.
|
|
3644
|
+
*/
|
|
3645
|
+
onSessionCreated?: (sessionId: string) => void;
|
|
3646
|
+
children: ReactNode;
|
|
3647
|
+
}
|
|
3648
|
+
declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, rateLimitConfig, onSessionCreated, children, }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
3649
|
+
declare function useChatSession(): ChatSessionStateValue;
|
|
3650
|
+
declare function useChatMessaging(): ChatMessagingStateValue;
|
|
3651
|
+
/** Returns messaging context or null when outside ChatSessionProvider. */
|
|
3652
|
+
declare function useOptionalChatMessaging(): ChatMessagingStateValue | null;
|
|
3653
|
+
declare function useChatInput(): ChatInputStateValue;
|
|
3654
|
+
|
|
3655
|
+
/**
|
|
3656
|
+
* BiChat context types layered on top of canonical applet-core context contracts.
|
|
3657
|
+
*/
|
|
3658
|
+
|
|
3659
|
+
type UserContext = UserContext$1;
|
|
3660
|
+
type TenantContext = TenantContext$1;
|
|
3661
|
+
type LocaleContext = LocaleContext$1;
|
|
3662
|
+
type AppConfig = AppConfig$1 & {
|
|
3663
|
+
streamEndpoint: string;
|
|
3664
|
+
basePath: string;
|
|
3665
|
+
assetsBasePath: string;
|
|
3666
|
+
rpcUIEndpoint: string;
|
|
3667
|
+
};
|
|
3668
|
+
interface Extensions {
|
|
3669
|
+
branding?: {
|
|
3670
|
+
appName?: string;
|
|
3671
|
+
logoUrl?: string;
|
|
3672
|
+
theme?: {
|
|
3673
|
+
primary?: string;
|
|
3674
|
+
secondary?: string;
|
|
3675
|
+
accent?: string;
|
|
3676
|
+
};
|
|
3677
|
+
welcome?: {
|
|
3678
|
+
title?: string;
|
|
3679
|
+
description?: string;
|
|
3680
|
+
examplePrompts?: Array<{
|
|
3681
|
+
category: string;
|
|
3682
|
+
text: string;
|
|
3683
|
+
icon: string;
|
|
3684
|
+
}>;
|
|
3685
|
+
};
|
|
3686
|
+
colors?: {
|
|
3687
|
+
primary?: string;
|
|
3688
|
+
secondary?: string;
|
|
3689
|
+
accent?: string;
|
|
3690
|
+
};
|
|
3691
|
+
logo?: {
|
|
3692
|
+
src?: string;
|
|
3693
|
+
alt?: string;
|
|
3694
|
+
};
|
|
3695
|
+
};
|
|
3696
|
+
features?: {
|
|
3697
|
+
vision?: boolean;
|
|
3698
|
+
webSearch?: boolean;
|
|
3699
|
+
codeInterpreter?: boolean;
|
|
3700
|
+
multiAgent?: boolean;
|
|
3701
|
+
};
|
|
3702
|
+
llm?: {
|
|
3703
|
+
provider?: string;
|
|
3704
|
+
apiKeyConfigured?: boolean;
|
|
3705
|
+
};
|
|
3706
|
+
debug?: {
|
|
3707
|
+
limits?: {
|
|
3708
|
+
policyMaxTokens: number;
|
|
3709
|
+
modelMaxTokens: number;
|
|
3710
|
+
effectiveMaxTokens: number;
|
|
3711
|
+
completionReserveTokens: number;
|
|
3712
|
+
};
|
|
3713
|
+
};
|
|
3714
|
+
}
|
|
3715
|
+
type IotaContext = Omit<InitialContext, 'config' | 'extensions'> & {
|
|
3716
|
+
config: AppConfig;
|
|
3717
|
+
extensions?: Extensions;
|
|
3718
|
+
};
|
|
3719
|
+
declare global {
|
|
3720
|
+
interface Window {
|
|
3721
|
+
__APPLET_CONTEXT__: IotaContext;
|
|
3722
|
+
__CSRF_TOKEN__: string;
|
|
3723
|
+
}
|
|
3479
3724
|
}
|
|
3480
3725
|
|
|
3726
|
+
interface IotaContextProviderProps {
|
|
3727
|
+
/**
|
|
3728
|
+
* Explicit context object. When provided, the window global is not read.
|
|
3729
|
+
* Useful for tests, Storybook, or apps that manage their own context.
|
|
3730
|
+
*/
|
|
3731
|
+
context?: IotaContext;
|
|
3732
|
+
children: ReactNode;
|
|
3733
|
+
}
|
|
3734
|
+
declare function IotaContextProvider({ context, children }: IotaContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
3735
|
+
declare function useIotaContext(): IotaContext;
|
|
3481
3736
|
/**
|
|
3482
|
-
*
|
|
3483
|
-
*
|
|
3484
|
-
* @internal — Not part of the public API. Consumed by HttpDataSource.
|
|
3737
|
+
* Check if user has a specific permission
|
|
3485
3738
|
*/
|
|
3739
|
+
declare function hasPermission(permission: string): boolean;
|
|
3486
3740
|
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3741
|
+
/** @deprecated Use `IotaContextProvider` with its `context` prop instead. */
|
|
3742
|
+
interface BiChatConfig {
|
|
3743
|
+
user: {
|
|
3744
|
+
id: string;
|
|
3745
|
+
email: string;
|
|
3746
|
+
firstName: string;
|
|
3747
|
+
lastName: string;
|
|
3748
|
+
permissions: string[];
|
|
3749
|
+
};
|
|
3750
|
+
tenant: {
|
|
3751
|
+
id: string;
|
|
3752
|
+
name: string;
|
|
3753
|
+
};
|
|
3754
|
+
locale: {
|
|
3755
|
+
language: string;
|
|
3756
|
+
translations: Record<string, string>;
|
|
3757
|
+
};
|
|
3758
|
+
endpoints: {
|
|
3759
|
+
rpc: string;
|
|
3760
|
+
stream: string;
|
|
3761
|
+
};
|
|
3762
|
+
csrfToken?: string;
|
|
3763
|
+
}
|
|
3764
|
+
interface ConfigProviderProps {
|
|
3765
|
+
config?: BiChatConfig;
|
|
3766
|
+
useGlobalConfig?: boolean;
|
|
3767
|
+
children: ReactNode;
|
|
3491
3768
|
}
|
|
3492
|
-
|
|
3493
3769
|
/**
|
|
3494
|
-
*
|
|
3495
|
-
* Implements ChatDataSource interface with real HTTP/RPC calls
|
|
3770
|
+
* @deprecated Use `IotaContextProvider` with its `context` prop instead.
|
|
3496
3771
|
*
|
|
3497
|
-
*
|
|
3772
|
+
* ConfigProvider component — provides configuration to the BiChat library.
|
|
3498
3773
|
*
|
|
3499
|
-
*
|
|
3500
|
-
*
|
|
3501
|
-
*
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3774
|
+
* @param config - Configuration object (preferred method)
|
|
3775
|
+
* @param useGlobalConfig - If true, falls back to window.__APPLET_CONTEXT__ when config is not provided
|
|
3776
|
+
* @param children - React children
|
|
3777
|
+
*/
|
|
3778
|
+
declare function ConfigProvider({ config, useGlobalConfig, children }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
3779
|
+
/**
|
|
3780
|
+
* Hook to access BiChat configuration
|
|
3781
|
+
* Returns null if no configuration is available
|
|
3782
|
+
*/
|
|
3783
|
+
declare function useConfig(): BiChatConfig | null;
|
|
3784
|
+
/**
|
|
3785
|
+
* Hook to access BiChat configuration (required)
|
|
3786
|
+
* Throws an error if configuration is not available
|
|
3505
3787
|
*/
|
|
3788
|
+
declare function useRequiredConfig(): BiChatConfig;
|
|
3506
3789
|
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
/**
|
|
3516
|
-
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` or
|
|
3517
|
-
* `ChatSession` instead. Coupling navigation to the data source causes
|
|
3518
|
-
* component remounts during active streams.
|
|
3519
|
-
*/
|
|
3520
|
-
navigateToSession?: (sessionId: string) => void;
|
|
3790
|
+
/**
|
|
3791
|
+
* Theme system type definitions
|
|
3792
|
+
*/
|
|
3793
|
+
interface Theme {
|
|
3794
|
+
name: string;
|
|
3795
|
+
colors: ThemeColors;
|
|
3796
|
+
spacing: ThemeSpacing;
|
|
3797
|
+
borderRadius: ThemeBorderRadius;
|
|
3521
3798
|
}
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
deletedMessages: number;
|
|
3556
|
-
deletedArtifacts: number;
|
|
3557
|
-
}>;
|
|
3558
|
-
stopGeneration(sessionId: string): Promise<void>;
|
|
3559
|
-
getStreamStatus(sessionId: string): Promise<StreamStatus | null>;
|
|
3560
|
-
resumeStream(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise<void>;
|
|
3561
|
-
sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator<StreamChunk>;
|
|
3562
|
-
cancelStream(): void;
|
|
3563
|
-
submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{
|
|
3564
|
-
success: boolean;
|
|
3565
|
-
error?: string;
|
|
3566
|
-
data?: {
|
|
3567
|
-
session: Session$1;
|
|
3568
|
-
turns: ConversationTurn$1[];
|
|
3569
|
-
pendingQuestion?: PendingQuestion$1 | null;
|
|
3570
|
-
};
|
|
3571
|
-
}>;
|
|
3572
|
-
rejectPendingQuestion(sessionId: string): Promise<{
|
|
3573
|
-
success: boolean;
|
|
3574
|
-
error?: string;
|
|
3575
|
-
}>;
|
|
3576
|
-
fetchSessionArtifacts(sessionId: string, options?: {
|
|
3577
|
-
limit?: number;
|
|
3578
|
-
offset?: number;
|
|
3579
|
-
}): Promise<{
|
|
3580
|
-
artifacts: SessionArtifact[];
|
|
3581
|
-
hasMore?: boolean;
|
|
3582
|
-
nextOffset?: number;
|
|
3583
|
-
}>;
|
|
3584
|
-
uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{
|
|
3585
|
-
artifacts: SessionArtifact[];
|
|
3586
|
-
}>;
|
|
3587
|
-
renameSessionArtifact(artifactId: string, name: string, description?: string): Promise<SessionArtifact>;
|
|
3588
|
-
deleteSessionArtifact(artifactId: string): Promise<void>;
|
|
3589
|
-
/**
|
|
3590
|
-
* @deprecated Pass `onSessionCreated` to `ChatSessionProvider` instead.
|
|
3591
|
-
*/
|
|
3592
|
-
navigateToSession?(sessionId: string): void;
|
|
3799
|
+
interface ThemeColors {
|
|
3800
|
+
background: string;
|
|
3801
|
+
surface: string;
|
|
3802
|
+
primary: string;
|
|
3803
|
+
secondary: string;
|
|
3804
|
+
text: string;
|
|
3805
|
+
textMuted: string;
|
|
3806
|
+
border: string;
|
|
3807
|
+
error: string;
|
|
3808
|
+
success: string;
|
|
3809
|
+
warning: string;
|
|
3810
|
+
userBubble: string;
|
|
3811
|
+
assistantBubble: string;
|
|
3812
|
+
userText: string;
|
|
3813
|
+
assistantText: string;
|
|
3814
|
+
}
|
|
3815
|
+
interface ThemeSpacing {
|
|
3816
|
+
xs: string;
|
|
3817
|
+
sm: string;
|
|
3818
|
+
md: string;
|
|
3819
|
+
lg: string;
|
|
3820
|
+
xl: string;
|
|
3821
|
+
}
|
|
3822
|
+
interface ThemeBorderRadius {
|
|
3823
|
+
sm: string;
|
|
3824
|
+
md: string;
|
|
3825
|
+
lg: string;
|
|
3826
|
+
full: string;
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
interface ThemeProviderProps {
|
|
3830
|
+
theme?: Theme | 'light' | 'dark' | 'system';
|
|
3831
|
+
children: ReactNode;
|
|
3593
3832
|
}
|
|
3594
3833
|
/**
|
|
3595
|
-
*
|
|
3834
|
+
* Theme provider component
|
|
3835
|
+
* Wraps the application and provides theme context
|
|
3596
3836
|
*/
|
|
3597
|
-
declare function
|
|
3837
|
+
declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
3838
|
+
/**
|
|
3839
|
+
* Hook to access current theme
|
|
3840
|
+
*/
|
|
3841
|
+
declare function useTheme(): Theme;
|
|
3842
|
+
|
|
3843
|
+
/**
|
|
3844
|
+
* Predefined theme configurations
|
|
3845
|
+
*/
|
|
3846
|
+
|
|
3847
|
+
declare const lightTheme: Theme;
|
|
3848
|
+
declare const darkTheme: Theme;
|
|
3849
|
+
|
|
3850
|
+
/**
|
|
3851
|
+
* CSRF token management for API requests
|
|
3852
|
+
*/
|
|
3853
|
+
/**
|
|
3854
|
+
* Get CSRF token from window object
|
|
3855
|
+
* @returns CSRF token string
|
|
3856
|
+
*/
|
|
3857
|
+
declare function getCSRFToken(): string;
|
|
3858
|
+
/**
|
|
3859
|
+
* Add CSRF token to request headers
|
|
3860
|
+
* @param headers - Headers object to modify
|
|
3861
|
+
* @returns Modified headers object
|
|
3862
|
+
*/
|
|
3863
|
+
declare function addCSRFHeader(headers: Headers): Headers;
|
|
3864
|
+
/**
|
|
3865
|
+
* Create headers with CSRF token
|
|
3866
|
+
* @param init - Optional initial headers
|
|
3867
|
+
* @returns Headers object with CSRF token
|
|
3868
|
+
*/
|
|
3869
|
+
declare function createHeadersWithCSRF(init?: HeadersInit): Headers;
|
|
3598
3870
|
|
|
3599
3871
|
/**
|
|
3600
3872
|
* Internal types for the ChatMachine.
|
|
@@ -3972,4 +4244,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
|
|
|
3972
4244
|
*/
|
|
3973
4245
|
declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
|
|
3974
4246
|
|
|
3975
|
-
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 };
|
|
4247
|
+
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, AvatarStack, type AvatarStackProps, 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 SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as 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 UseBichatRouterParams, type UseBichatRouterReturn, 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, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|