@copilotz/chat-ui 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -32
- package/dist/components/chat/AgentSelectors.d.ts +50 -0
- package/dist/components/chat/AgentSelectors.d.ts.map +1 -0
- package/dist/components/chat/AgentSelectors.js +67 -0
- package/dist/components/chat/AgentSelectors.js.map +1 -0
- package/dist/components/chat/AssistantActivity.d.ts +11 -0
- package/dist/components/chat/AssistantActivity.d.ts.map +1 -0
- package/dist/components/chat/AssistantActivity.js +82 -0
- package/dist/components/chat/AssistantActivity.js.map +1 -0
- package/dist/components/chat/ChatHeader.d.ts +56 -0
- package/dist/components/chat/ChatHeader.d.ts.map +1 -0
- package/dist/components/chat/ChatHeader.js +71 -0
- package/dist/components/chat/ChatHeader.js.map +1 -0
- package/dist/components/chat/ChatInput.d.ts +25 -0
- package/dist/components/chat/ChatInput.d.ts.map +1 -0
- package/dist/components/chat/ChatInput.js +732 -0
- package/dist/components/chat/ChatInput.js.map +1 -0
- package/dist/components/chat/ChatUI.d.ts +4 -0
- package/dist/components/chat/ChatUI.d.ts.map +1 -0
- package/dist/components/chat/ChatUI.js +470 -0
- package/dist/components/chat/ChatUI.js.map +1 -0
- package/dist/components/chat/Message.d.ts +37 -0
- package/dist/components/chat/Message.d.ts.map +1 -0
- package/dist/components/chat/Message.js +262 -0
- package/dist/components/chat/Message.js.map +1 -0
- package/dist/components/chat/Sidebar.d.ts +52 -0
- package/dist/components/chat/Sidebar.d.ts.map +1 -0
- package/dist/components/chat/Sidebar.js +112 -0
- package/dist/components/chat/Sidebar.js.map +1 -0
- package/dist/components/chat/ThreadManager.d.ts +18 -0
- package/dist/components/chat/ThreadManager.d.ts.map +1 -0
- package/dist/components/chat/ThreadManager.js +108 -0
- package/dist/components/chat/ThreadManager.js.map +1 -0
- package/dist/components/chat/UserContext.d.ts +15 -0
- package/dist/components/chat/UserContext.d.ts.map +1 -0
- package/dist/components/chat/UserContext.js +39 -0
- package/dist/components/chat/UserContext.js.map +1 -0
- package/dist/components/chat/UserMenu.d.ts +38 -0
- package/dist/components/chat/UserMenu.d.ts.map +1 -0
- package/dist/components/chat/UserMenu.js +44 -0
- package/dist/components/chat/UserMenu.js.map +1 -0
- package/dist/components/chat/UserProfile.d.ts +51 -0
- package/dist/components/chat/UserProfile.d.ts.map +1 -0
- package/dist/components/chat/UserProfile.js +206 -0
- package/dist/components/chat/UserProfile.js.map +1 -0
- package/dist/components/chat/VoiceComposer.d.ts +29 -0
- package/dist/components/chat/VoiceComposer.d.ts.map +1 -0
- package/dist/components/chat/VoiceComposer.js +99 -0
- package/dist/components/chat/VoiceComposer.js.map +1 -0
- package/dist/components/ui/Spinner.d.ts +7 -0
- package/dist/components/ui/Spinner.d.ts.map +1 -0
- package/dist/components/ui/Spinner.js +14 -0
- package/dist/components/ui/Spinner.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +14 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +15 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +66 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +15 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +23 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +32 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +25 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +6 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +26 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +51 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +63 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +51 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +7 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +16 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +12 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +21 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +9 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +66 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +212 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +7 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +7 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +18 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/config/chatConfig.d.ts +4 -0
- package/dist/config/chatConfig.d.ts.map +1 -0
- package/dist/config/chatConfig.js +173 -0
- package/dist/config/chatConfig.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.cjs +1095 -1363
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -345
- package/dist/index.d.ts +36 -345
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1038 -1308
- package/dist/index.js.map +1 -1
- package/dist/lib/chatUtils.d.ts +18 -0
- package/dist/lib/chatUtils.d.ts.map +1 -0
- package/dist/lib/chatUtils.js +64 -0
- package/dist/lib/chatUtils.js.map +1 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +46 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/voiceCompose.d.ts +6 -0
- package/dist/lib/voiceCompose.d.ts.map +1 -0
- package/dist/lib/voiceCompose.js +344 -0
- package/dist/lib/voiceCompose.js.map +1 -0
- package/dist/styles.css +57 -108
- package/dist/types/chatTypes.d.ts +386 -0
- package/dist/types/chatTypes.d.ts.map +1 -0
- package/dist/types/chatTypes.js +2 -0
- package/dist/types/chatTypes.js.map +1 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
3
2
|
import { Options, Components } from 'react-markdown';
|
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { ClassValue } from 'clsx';
|
|
6
3
|
|
|
7
4
|
type MediaAttachment = {
|
|
8
5
|
kind: 'image';
|
|
@@ -68,6 +65,20 @@ interface ToolCall {
|
|
|
68
65
|
startTime?: number;
|
|
69
66
|
endTime?: number;
|
|
70
67
|
}
|
|
68
|
+
type ActivityDisplayMode = 'full' | 'summary' | 'hidden';
|
|
69
|
+
type AssistantActivitySummaryKind = 'thinking' | 'working' | 'using_tools' | 'preparing_answer';
|
|
70
|
+
interface AssistantActivitySummary {
|
|
71
|
+
kind: AssistantActivitySummaryKind;
|
|
72
|
+
toolName?: string;
|
|
73
|
+
toolCount?: number;
|
|
74
|
+
}
|
|
75
|
+
interface AssistantActivityState {
|
|
76
|
+
isActive: boolean;
|
|
77
|
+
isComplete?: boolean;
|
|
78
|
+
summary: AssistantActivitySummary;
|
|
79
|
+
reasoning?: string;
|
|
80
|
+
toolCalls?: ToolCall[];
|
|
81
|
+
}
|
|
71
82
|
interface ChatMessage {
|
|
72
83
|
id: string;
|
|
73
84
|
role: 'user' | 'assistant' | 'system';
|
|
@@ -79,12 +90,9 @@ interface ChatMessage {
|
|
|
79
90
|
isEdited?: boolean;
|
|
80
91
|
originalContent?: string;
|
|
81
92
|
editedAt?: number;
|
|
82
|
-
toolCalls?: ToolCall[];
|
|
83
93
|
metadata?: Record<string, any>;
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
/** Whether reasoning tokens are still being streamed */
|
|
87
|
-
isReasoningStreaming?: boolean;
|
|
94
|
+
/** Unified assistant activity state for live rendering and history hydration */
|
|
95
|
+
activity?: AssistantActivityState;
|
|
88
96
|
/** Agent/sender identity for multi-agent conversations */
|
|
89
97
|
senderName?: string;
|
|
90
98
|
/** Agent ID of the sender (for multi-agent conversations) */
|
|
@@ -181,10 +189,16 @@ interface ChatConfig {
|
|
|
181
189
|
cancel?: string;
|
|
182
190
|
create?: string;
|
|
183
191
|
footerLabel?: string;
|
|
184
|
-
toolUsed?: string;
|
|
185
192
|
daysAgo?: string;
|
|
186
193
|
inputHelpText?: string;
|
|
187
|
-
|
|
194
|
+
activityThinking?: string;
|
|
195
|
+
activityWorking?: string;
|
|
196
|
+
activityUsingTools?: string;
|
|
197
|
+
activityPreparingAnswer?: string;
|
|
198
|
+
activityToolRunning?: string;
|
|
199
|
+
activityMultipleTools?: string;
|
|
200
|
+
activityShowDetails?: string;
|
|
201
|
+
activityHideDetails?: string;
|
|
188
202
|
defaultThreadName?: string;
|
|
189
203
|
loadOlderMessages?: string;
|
|
190
204
|
loadingOlderMessages?: string;
|
|
@@ -198,7 +212,7 @@ interface ChatConfig {
|
|
|
198
212
|
enableMessageEditing?: boolean;
|
|
199
213
|
enableMessageCopy?: boolean;
|
|
200
214
|
enableRegeneration?: boolean;
|
|
201
|
-
|
|
215
|
+
activityDisplay?: ActivityDisplayMode;
|
|
202
216
|
maxAttachments?: number;
|
|
203
217
|
maxFileSize?: number;
|
|
204
218
|
};
|
|
@@ -371,269 +385,15 @@ interface ChatUserContext extends Record<string, unknown> {
|
|
|
371
385
|
};
|
|
372
386
|
}
|
|
373
387
|
|
|
374
|
-
declare const ChatUI:
|
|
375
|
-
|
|
376
|
-
interface ChatHeaderConfig {
|
|
377
|
-
branding?: {
|
|
378
|
-
logo?: ReactNode;
|
|
379
|
-
title?: string;
|
|
380
|
-
subtitle?: string;
|
|
381
|
-
};
|
|
382
|
-
agentSelector?: {
|
|
383
|
-
enabled?: boolean;
|
|
384
|
-
label?: string;
|
|
385
|
-
hideIfSingle?: boolean;
|
|
386
|
-
};
|
|
387
|
-
labels?: {
|
|
388
|
-
newThread?: string;
|
|
389
|
-
exportData?: string;
|
|
390
|
-
importData?: string;
|
|
391
|
-
clearAll?: string;
|
|
392
|
-
sidebarToggle?: string;
|
|
393
|
-
customComponentToggle?: string;
|
|
394
|
-
settings?: string;
|
|
395
|
-
toggleDarkMode?: string;
|
|
396
|
-
lightMode?: string;
|
|
397
|
-
darkMode?: string;
|
|
398
|
-
};
|
|
399
|
-
customComponent?: {
|
|
400
|
-
label?: string;
|
|
401
|
-
icon?: ReactNode;
|
|
402
|
-
onClick?: () => void;
|
|
403
|
-
};
|
|
404
|
-
/** Additional actions to render in the header (before the settings menu) */
|
|
405
|
-
headerActions?: ReactNode;
|
|
406
|
-
}
|
|
407
|
-
interface ChatHeaderProps {
|
|
408
|
-
config: ChatHeaderConfig;
|
|
409
|
-
currentThreadTitle?: string | null;
|
|
410
|
-
onSidebarToggle?: () => void;
|
|
411
|
-
onCustomComponentToggle?: () => void;
|
|
412
|
-
onNewThread?: () => void;
|
|
413
|
-
onExportData?: () => void;
|
|
414
|
-
onImportData?: (file: File) => void;
|
|
415
|
-
onClearAll?: () => void;
|
|
416
|
-
showCustomComponentButton?: boolean;
|
|
417
|
-
isMobile?: boolean;
|
|
418
|
-
showAgentSelector?: boolean;
|
|
419
|
-
isMultiAgentMode?: boolean;
|
|
420
|
-
agentOptions?: AgentOption[];
|
|
421
|
-
selectedAgentId?: string | null;
|
|
422
|
-
onSelectAgent?: (agentId: string) => void;
|
|
423
|
-
participantIds?: string[];
|
|
424
|
-
onParticipantsChange?: (ids: string[]) => void;
|
|
425
|
-
className?: string;
|
|
426
|
-
}
|
|
427
|
-
declare const ChatHeader: React__default.FC<ChatHeaderProps>;
|
|
428
|
-
|
|
429
|
-
interface ParticipantsSelectorProps {
|
|
430
|
-
/** All available agents */
|
|
431
|
-
agents: AgentOption[];
|
|
432
|
-
/** Currently selected participant IDs */
|
|
433
|
-
participantIds: string[];
|
|
434
|
-
/** Callback when participants change */
|
|
435
|
-
onParticipantsChange: (ids: string[]) => void;
|
|
436
|
-
/** Label for the selector */
|
|
437
|
-
label?: string;
|
|
438
|
-
/** Maximum participants to show in collapsed view */
|
|
439
|
-
maxVisible?: number;
|
|
440
|
-
/** Disabled state */
|
|
441
|
-
disabled?: boolean;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Multi-select dropdown for choosing which agents participate in the conversation.
|
|
445
|
-
*/
|
|
446
|
-
declare const ParticipantsSelector: React__default.FC<ParticipantsSelectorProps>;
|
|
447
|
-
interface TargetAgentSelectorProps {
|
|
448
|
-
/** Available agents (should be filtered to participants only) */
|
|
449
|
-
agents: AgentOption[];
|
|
450
|
-
/** Currently targeted agent ID */
|
|
451
|
-
targetAgentId: string | null;
|
|
452
|
-
/** Callback when target changes */
|
|
453
|
-
onTargetChange: (agentId: string | null) => void;
|
|
454
|
-
/** Label for the selector */
|
|
455
|
-
label?: string;
|
|
456
|
-
/** Placeholder when no target is selected */
|
|
457
|
-
placeholder?: string;
|
|
458
|
-
/** Disabled state */
|
|
459
|
-
disabled?: boolean;
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Single-select dropdown for choosing which agent to address with @mention.
|
|
463
|
-
*/
|
|
464
|
-
declare const TargetAgentSelector: React__default.FC<TargetAgentSelectorProps>;
|
|
465
|
-
interface AgentBadgeProps {
|
|
466
|
-
agent: AgentOption;
|
|
467
|
-
onRemove?: () => void;
|
|
468
|
-
showRemove?: boolean;
|
|
469
|
-
size?: 'sm' | 'md';
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Badge displaying an agent with optional remove button.
|
|
473
|
-
*/
|
|
474
|
-
declare const AgentBadge: React__default.FC<AgentBadgeProps>;
|
|
475
|
-
|
|
476
|
-
interface ChatInputProps {
|
|
477
|
-
value: string;
|
|
478
|
-
onChange: (value: string) => void;
|
|
479
|
-
onSubmit: (content: string, attachments: MediaAttachment[]) => void;
|
|
480
|
-
attachments: MediaAttachment[];
|
|
481
|
-
onAttachmentsChange: (attachments: MediaAttachment[]) => void;
|
|
482
|
-
placeholder?: string;
|
|
483
|
-
disabled?: boolean;
|
|
484
|
-
isGenerating?: boolean;
|
|
485
|
-
onStopGeneration?: () => void;
|
|
486
|
-
enableFileUpload?: boolean;
|
|
487
|
-
enableAudioRecording?: boolean;
|
|
488
|
-
maxAttachments?: number;
|
|
489
|
-
maxFileSize?: number;
|
|
490
|
-
acceptedFileTypes?: string[];
|
|
491
|
-
className?: string;
|
|
492
|
-
config?: ChatConfig;
|
|
493
|
-
mentionAgents?: AgentOption[];
|
|
494
|
-
onTargetAgentChange?: (agentId: string | null) => void;
|
|
495
|
-
}
|
|
496
|
-
declare const ChatInput: React__default.FC<ChatInputProps>;
|
|
388
|
+
declare const ChatUI: React.FC<ChatV2Props>;
|
|
497
389
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
assistantAvatar?: React__default.ReactNode;
|
|
504
|
-
assistantName?: string;
|
|
505
|
-
showTimestamp?: boolean;
|
|
506
|
-
showAvatar?: boolean;
|
|
507
|
-
enableCopy?: boolean;
|
|
508
|
-
enableEdit?: boolean;
|
|
509
|
-
enableRegenerate?: boolean;
|
|
510
|
-
enableToolCallsDisplay?: boolean;
|
|
511
|
-
compactMode?: boolean;
|
|
512
|
-
onAction?: (event: MessageActionEvent) => void;
|
|
513
|
-
className?: string;
|
|
514
|
-
toolUsedLabel?: string;
|
|
515
|
-
thinkingLabel?: string;
|
|
516
|
-
showMoreLabel?: string;
|
|
517
|
-
showLessLabel?: string;
|
|
518
|
-
collapseLongMessages?: boolean;
|
|
519
|
-
collapseLongMessagesForUserOnly?: boolean;
|
|
520
|
-
longMessagePreviewChars?: number;
|
|
521
|
-
longMessageChunkChars?: number;
|
|
522
|
-
renderUserMarkdown?: boolean;
|
|
523
|
-
markdown?: ChatMarkdownConfig;
|
|
524
|
-
isExpanded?: boolean;
|
|
525
|
-
onToggleExpanded?: (messageId: string) => void;
|
|
526
|
-
/** When true, hides the avatar and name (for grouped consecutive messages from same sender) */
|
|
527
|
-
isGrouped?: boolean;
|
|
528
|
-
/** Available agents for resolving multi-agent display (colors, avatars) */
|
|
529
|
-
agentOptions?: AgentOption[];
|
|
390
|
+
type ActivityLabels = ChatConfig['labels'];
|
|
391
|
+
interface AssistantActivityProps {
|
|
392
|
+
activity?: AssistantActivityState;
|
|
393
|
+
displayMode: ActivityDisplayMode;
|
|
394
|
+
labels?: ActivityLabels;
|
|
530
395
|
}
|
|
531
|
-
declare const
|
|
532
|
-
|
|
533
|
-
declare function Sidebar$1({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<"div"> & {
|
|
534
|
-
side?: "left" | "right";
|
|
535
|
-
variant?: "sidebar" | "floating" | "inset";
|
|
536
|
-
collapsible?: "offcanvas" | "icon" | "none";
|
|
537
|
-
}): react_jsx_runtime.JSX.Element;
|
|
538
|
-
|
|
539
|
-
interface UserMenuConfig {
|
|
540
|
-
labels?: {
|
|
541
|
-
profile?: string;
|
|
542
|
-
settings?: string;
|
|
543
|
-
theme?: string;
|
|
544
|
-
lightMode?: string;
|
|
545
|
-
darkMode?: string;
|
|
546
|
-
systemTheme?: string;
|
|
547
|
-
logout?: string;
|
|
548
|
-
guest?: string;
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
interface UserMenuUser {
|
|
552
|
-
id: string;
|
|
553
|
-
name?: string;
|
|
554
|
-
email?: string;
|
|
555
|
-
avatar?: string;
|
|
556
|
-
}
|
|
557
|
-
interface UserMenuCallbacks {
|
|
558
|
-
onViewProfile?: () => void;
|
|
559
|
-
onOpenSettings?: () => void;
|
|
560
|
-
onThemeChange?: (theme: 'light' | 'dark' | 'system') => void;
|
|
561
|
-
onLogout?: () => void;
|
|
562
|
-
}
|
|
563
|
-
interface UserMenuProps {
|
|
564
|
-
user?: UserMenuUser | null;
|
|
565
|
-
config?: UserMenuConfig;
|
|
566
|
-
callbacks?: UserMenuCallbacks;
|
|
567
|
-
currentTheme?: 'light' | 'dark' | 'system';
|
|
568
|
-
/** Show theme options in the menu */
|
|
569
|
-
showThemeOptions?: boolean;
|
|
570
|
-
/** Additional menu items to render */
|
|
571
|
-
additionalItems?: React__default.ReactNode;
|
|
572
|
-
}
|
|
573
|
-
declare const UserMenu: React__default.FC<UserMenuProps>;
|
|
574
|
-
|
|
575
|
-
interface SidebarConfig {
|
|
576
|
-
labels?: {
|
|
577
|
-
newChat?: string;
|
|
578
|
-
search?: string;
|
|
579
|
-
customComponentLabel?: string;
|
|
580
|
-
showArchived?: string;
|
|
581
|
-
hideArchived?: string;
|
|
582
|
-
noThreadsFound?: string;
|
|
583
|
-
noThreadsYet?: string;
|
|
584
|
-
deleteConfirmTitle?: string;
|
|
585
|
-
deleteConfirmDescription?: string;
|
|
586
|
-
renameThread?: string;
|
|
587
|
-
archiveThread?: string;
|
|
588
|
-
unarchiveThread?: string;
|
|
589
|
-
deleteThread?: string;
|
|
590
|
-
today?: string;
|
|
591
|
-
yesterday?: string;
|
|
592
|
-
createNewThread?: string;
|
|
593
|
-
threadNamePlaceholder?: string;
|
|
594
|
-
cancel?: string;
|
|
595
|
-
create?: string;
|
|
596
|
-
daysAgo?: string;
|
|
597
|
-
};
|
|
598
|
-
branding?: {
|
|
599
|
-
logo?: React__default.ReactNode;
|
|
600
|
-
title?: React__default.ReactNode;
|
|
601
|
-
subtitle?: React__default.ReactNode;
|
|
602
|
-
};
|
|
603
|
-
userMenu?: UserMenuConfig;
|
|
604
|
-
}
|
|
605
|
-
interface SidebarProps extends React__default.ComponentProps<typeof Sidebar$1> {
|
|
606
|
-
threads: ChatThread[];
|
|
607
|
-
currentThreadId?: string | null;
|
|
608
|
-
config: SidebarConfig;
|
|
609
|
-
onCreateThread?: (title?: string) => void;
|
|
610
|
-
onSelectThread?: (threadId: string) => void;
|
|
611
|
-
onRenameThread?: (threadId: string, newTitle: string) => void;
|
|
612
|
-
onDeleteThread?: (threadId: string) => void;
|
|
613
|
-
onArchiveThread?: (threadId: string) => void;
|
|
614
|
-
user?: UserMenuUser | null;
|
|
615
|
-
userMenuCallbacks?: UserMenuCallbacks;
|
|
616
|
-
currentTheme?: 'light' | 'dark' | 'system';
|
|
617
|
-
showThemeOptions?: boolean;
|
|
618
|
-
/** Additional items to render in the user menu */
|
|
619
|
-
userMenuAdditionalItems?: React__default.ReactNode;
|
|
620
|
-
}
|
|
621
|
-
declare const Sidebar: React__default.FC<SidebarProps>;
|
|
622
|
-
|
|
623
|
-
interface ThreadManagerProps {
|
|
624
|
-
threads: ChatThread[];
|
|
625
|
-
currentThreadId?: string | null;
|
|
626
|
-
config?: ChatConfig;
|
|
627
|
-
onCreateThread?: (title?: string) => void;
|
|
628
|
-
onSelectThread?: (threadId: string) => void;
|
|
629
|
-
onRenameThread?: (threadId: string, newTitle: string) => void;
|
|
630
|
-
onDeleteThread?: (threadId: string) => void;
|
|
631
|
-
onArchiveThread?: (threadId: string) => void;
|
|
632
|
-
isOpen?: boolean;
|
|
633
|
-
onClose?: () => void;
|
|
634
|
-
className?: string;
|
|
635
|
-
}
|
|
636
|
-
declare const ThreadManager: React__default.FC<ThreadManagerProps>;
|
|
396
|
+
declare const AssistantActivity: React.NamedExoticComponent<AssistantActivityProps>;
|
|
637
397
|
|
|
638
398
|
type Setter = (next: Partial<ChatUserContext> | ((prev: ChatUserContext) => Partial<ChatUserContext>)) => void;
|
|
639
399
|
interface ChatUserContextValue {
|
|
@@ -641,82 +401,13 @@ interface ChatUserContextValue {
|
|
|
641
401
|
setContext: Setter;
|
|
642
402
|
resetContext: () => void;
|
|
643
403
|
}
|
|
644
|
-
declare const ChatUserContextProvider:
|
|
645
|
-
children:
|
|
404
|
+
declare const ChatUserContextProvider: React.FC<{
|
|
405
|
+
children: React.ReactNode;
|
|
646
406
|
initial?: Partial<ChatUserContext>;
|
|
647
407
|
}>;
|
|
648
408
|
declare function useChatUserContext(): ChatUserContextValue;
|
|
649
409
|
|
|
650
|
-
interface UserProfileConfig {
|
|
651
|
-
labels?: {
|
|
652
|
-
title?: string;
|
|
653
|
-
basicInfo?: string;
|
|
654
|
-
customFields?: string;
|
|
655
|
-
memories?: string;
|
|
656
|
-
addMemory?: string;
|
|
657
|
-
noMemories?: string;
|
|
658
|
-
close?: string;
|
|
659
|
-
noCustomFields?: string;
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
interface UserProfileUser {
|
|
663
|
-
id: string;
|
|
664
|
-
name?: string;
|
|
665
|
-
email?: string;
|
|
666
|
-
avatar?: string;
|
|
667
|
-
}
|
|
668
|
-
interface CustomField {
|
|
669
|
-
key: string;
|
|
670
|
-
label: string;
|
|
671
|
-
value: string | number | boolean | null | undefined;
|
|
672
|
-
type?: 'text' | 'email' | 'phone' | 'url' | 'date' | 'number' | 'boolean';
|
|
673
|
-
icon?: React__default.ReactNode;
|
|
674
|
-
}
|
|
675
|
-
interface UserProfileProps {
|
|
676
|
-
isOpen: boolean;
|
|
677
|
-
onClose: () => void;
|
|
678
|
-
user?: UserProfileUser | null;
|
|
679
|
-
/** Custom fields from userContext.customFields */
|
|
680
|
-
customFields?: CustomField[] | Record<string, unknown>;
|
|
681
|
-
/** User memories */
|
|
682
|
-
memories?: MemoryItem[];
|
|
683
|
-
config?: UserProfileConfig;
|
|
684
|
-
/** Called when user wants to edit their profile */
|
|
685
|
-
onEditProfile?: () => void;
|
|
686
|
-
/** Called when user wants to logout */
|
|
687
|
-
onLogout?: () => void;
|
|
688
|
-
/** Called when user adds a memory */
|
|
689
|
-
onAddMemory?: (content: string, category?: MemoryItem['category']) => void;
|
|
690
|
-
/** Called when user updates a memory */
|
|
691
|
-
onUpdateMemory?: (memoryId: string, content: string) => void;
|
|
692
|
-
/** Called when user deletes a memory */
|
|
693
|
-
onDeleteMemory?: (memoryId: string) => void;
|
|
694
|
-
className?: string;
|
|
695
|
-
}
|
|
696
|
-
declare const UserProfile: React__default.FC<UserProfileProps>;
|
|
697
|
-
|
|
698
410
|
declare const defaultChatConfig: Required<ChatConfig>;
|
|
699
411
|
declare function mergeConfig(_baseConfig: ChatConfig, userConfig?: Partial<ChatConfig>): Required<ChatConfig>;
|
|
700
412
|
|
|
701
|
-
|
|
702
|
-
declare const formatDate: (timestamp: number, labels?: ChatConfig["labels"]) => string;
|
|
703
|
-
declare const createObjectUrlFromDataUrl: (dataUrl: string) => string | null;
|
|
704
|
-
|
|
705
|
-
declare const chatUtils: {
|
|
706
|
-
generateId: () => string;
|
|
707
|
-
generateMessageId: () => string;
|
|
708
|
-
generateThreadId: () => string;
|
|
709
|
-
createMessage: (role: "user" | "assistant" | "system", content: string, attachments?: MediaAttachment[]) => ChatMessage;
|
|
710
|
-
createThread: (title: string) => ChatThread;
|
|
711
|
-
generateThreadTitle: (firstMessage: string) => string;
|
|
712
|
-
};
|
|
713
|
-
/** Deterministic color for an agent based on its ID. */
|
|
714
|
-
declare function getAgentColor(agentId: string): string;
|
|
715
|
-
/** Up to 2-letter initials from an agent name. */
|
|
716
|
-
declare function getAgentInitials(name: string): string;
|
|
717
|
-
/** Assign colors to agents that don't have a custom color. Returns a new array. */
|
|
718
|
-
declare function assignAgentColors(agents: AgentOption[]): (AgentOption & {
|
|
719
|
-
color: string;
|
|
720
|
-
})[];
|
|
721
|
-
|
|
722
|
-
export { AgentBadge, type AgentOption, type AudioAttachment, type ChatCallbacks, type ChatConfig, ChatHeader, type ChatHeaderConfig, type ChatHeaderProps, ChatInput, type ChatMarkdownConfig, type ChatMessage, type ChatState, type ChatThread, ChatUI, type ChatUserContext, ChatUserContextProvider, type ChatV2Props, type CreateVoiceProvider, type CustomField, type FileUploadProgress, type MediaAttachment, type MemoryItem, Message, type MessageAction, type MessageActionEvent, ParticipantsSelector, Sidebar, type SidebarConfig, type SidebarProps, type StateCallback, type StreamingUpdate, TargetAgentSelector, ThreadManager, type ToolCall, type UserCustomField, UserMenu, type UserMenuCallbacks, type UserMenuConfig, type UserMenuProps, type UserMenuUser, UserProfile, type UserProfileConfig, type UserProfileProps, type UserProfileUser, type VoiceComposerState, type VoiceProvider, type VoiceProviderHandlers, type VoiceProviderOptions, type VoiceReviewMode, type VoiceSegment, type VoiceTranscript, type VoiceTranscriptMode, assignAgentColors, chatUtils, cn, createObjectUrlFromDataUrl, defaultChatConfig, formatDate, getAgentColor, getAgentInitials, mergeConfig, useChatUserContext };
|
|
413
|
+
export { type ActivityDisplayMode, type AgentOption, AssistantActivity, type AssistantActivityState, type AssistantActivitySummary, type AssistantActivitySummaryKind, type AudioAttachment, type ChatCallbacks, type ChatConfig, type ChatMarkdownConfig, type ChatMessage, type ChatState, type ChatThread, ChatUI, type ChatUserContext, ChatUserContextProvider, type ChatV2Props, type CreateVoiceProvider, type FileUploadProgress, type MediaAttachment, type MemoryItem, type MessageAction, type MessageActionEvent, type StateCallback, type StreamingUpdate, type ToolCall, type UserCustomField, type VoiceComposerState, type VoiceProvider, type VoiceProviderHandlers, type VoiceProviderOptions, type VoiceReviewMode, type VoiceSegment, type VoiceTranscript, type VoiceTranscriptMode, defaultChatConfig, mergeConfig, useChatUserContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|