@xinghunm/ai-chat 1.2.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +466 -124
- package/dist/index.mjs +466 -124
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -264,6 +264,7 @@ interface ChatMessage {
|
|
|
264
264
|
sessionId: string;
|
|
265
265
|
role: ChatRole;
|
|
266
266
|
content: string;
|
|
267
|
+
skills?: string[];
|
|
267
268
|
blocks?: ChatMessageBlock[];
|
|
268
269
|
attachments?: ChatImageAttachment[];
|
|
269
270
|
localOnly?: boolean;
|
|
@@ -440,6 +441,9 @@ interface AiChatLabels {
|
|
|
440
441
|
questionnaireMultiSelectHint?: string;
|
|
441
442
|
questionnaireOtherOptionLabel?: string;
|
|
442
443
|
questionnaireOtherPlaceholder?: string;
|
|
444
|
+
modelLoading?: string;
|
|
445
|
+
modelLoadFailed?: string;
|
|
446
|
+
modelUnavailable?: string;
|
|
443
447
|
skillLoading?: string;
|
|
444
448
|
skillEmpty?: string;
|
|
445
449
|
removeSkillAriaLabel?: string;
|
|
@@ -520,12 +524,24 @@ type AiChatProps = Omit<AiChatProviderProps, 'children'> & {
|
|
|
520
524
|
showNewChatButton?: boolean;
|
|
521
525
|
/** Optional renderer used to override the lightweight new-chat trigger UI. */
|
|
522
526
|
renderNewChatTrigger?: (props: NewChatTriggerRenderProps) => ReactNode;
|
|
527
|
+
/**
|
|
528
|
+
* When true, only renders the composer before the first message is sent.
|
|
529
|
+
* Once a conversation starts, the full thread layout is shown automatically.
|
|
530
|
+
*/
|
|
531
|
+
showComposerOnlyBeforeFirstMessage?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Called whenever the "conversation started" state changes.
|
|
534
|
+
*
|
|
535
|
+
* A conversation is considered started after the active session has messages,
|
|
536
|
+
* a streaming message, or an error to render.
|
|
537
|
+
*/
|
|
538
|
+
onConversationStartedChange?: (started: boolean) => void;
|
|
523
539
|
};
|
|
524
540
|
/**
|
|
525
541
|
* Top-level AI chat component. Wraps AiChatProvider and composes the full
|
|
526
542
|
* chat UI: optional conversation sidebar + thread + composer.
|
|
527
543
|
*/
|
|
528
|
-
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
544
|
+
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, showComposerOnlyBeforeFirstMessage, onConversationStartedChange, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
529
545
|
|
|
530
546
|
/**
|
|
531
547
|
* Endpoint overrides for the built-in HTTP transport adapter.
|
|
@@ -640,6 +656,9 @@ interface ChatComposerViewProps {
|
|
|
640
656
|
skillLoadingLabel: string;
|
|
641
657
|
skillEmptyLabel: string;
|
|
642
658
|
removeSkillAriaLabel: string;
|
|
659
|
+
modelLoadingLabel: string;
|
|
660
|
+
modelLoadFailedLabel: string;
|
|
661
|
+
modelUnavailableLabel: string;
|
|
643
662
|
onValueChange: (value: string) => void;
|
|
644
663
|
onPickImages: (files: FileList | File[]) => void;
|
|
645
664
|
onPasteImages: (files: File[]) => void;
|
|
@@ -649,6 +668,7 @@ interface ChatComposerViewProps {
|
|
|
649
668
|
onSelectedModelChange: (value: string) => void;
|
|
650
669
|
onSelectedModeChange: (value: ChatAgentMode) => void;
|
|
651
670
|
onReloadModels: () => void;
|
|
671
|
+
onOpenSkillPicker: () => void;
|
|
652
672
|
/** Called to abort the active streaming response. */
|
|
653
673
|
onStop: () => void | Promise<void>;
|
|
654
674
|
/** Called to send a new user message. */
|
package/dist/index.d.ts
CHANGED
|
@@ -264,6 +264,7 @@ interface ChatMessage {
|
|
|
264
264
|
sessionId: string;
|
|
265
265
|
role: ChatRole;
|
|
266
266
|
content: string;
|
|
267
|
+
skills?: string[];
|
|
267
268
|
blocks?: ChatMessageBlock[];
|
|
268
269
|
attachments?: ChatImageAttachment[];
|
|
269
270
|
localOnly?: boolean;
|
|
@@ -440,6 +441,9 @@ interface AiChatLabels {
|
|
|
440
441
|
questionnaireMultiSelectHint?: string;
|
|
441
442
|
questionnaireOtherOptionLabel?: string;
|
|
442
443
|
questionnaireOtherPlaceholder?: string;
|
|
444
|
+
modelLoading?: string;
|
|
445
|
+
modelLoadFailed?: string;
|
|
446
|
+
modelUnavailable?: string;
|
|
443
447
|
skillLoading?: string;
|
|
444
448
|
skillEmpty?: string;
|
|
445
449
|
removeSkillAriaLabel?: string;
|
|
@@ -520,12 +524,24 @@ type AiChatProps = Omit<AiChatProviderProps, 'children'> & {
|
|
|
520
524
|
showNewChatButton?: boolean;
|
|
521
525
|
/** Optional renderer used to override the lightweight new-chat trigger UI. */
|
|
522
526
|
renderNewChatTrigger?: (props: NewChatTriggerRenderProps) => ReactNode;
|
|
527
|
+
/**
|
|
528
|
+
* When true, only renders the composer before the first message is sent.
|
|
529
|
+
* Once a conversation starts, the full thread layout is shown automatically.
|
|
530
|
+
*/
|
|
531
|
+
showComposerOnlyBeforeFirstMessage?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Called whenever the "conversation started" state changes.
|
|
534
|
+
*
|
|
535
|
+
* A conversation is considered started after the active session has messages,
|
|
536
|
+
* a streaming message, or an error to render.
|
|
537
|
+
*/
|
|
538
|
+
onConversationStartedChange?: (started: boolean) => void;
|
|
523
539
|
};
|
|
524
540
|
/**
|
|
525
541
|
* Top-level AI chat component. Wraps AiChatProvider and composes the full
|
|
526
542
|
* chat UI: optional conversation sidebar + thread + composer.
|
|
527
543
|
*/
|
|
528
|
-
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
544
|
+
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, showComposerOnlyBeforeFirstMessage, onConversationStartedChange, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
529
545
|
|
|
530
546
|
/**
|
|
531
547
|
* Endpoint overrides for the built-in HTTP transport adapter.
|
|
@@ -640,6 +656,9 @@ interface ChatComposerViewProps {
|
|
|
640
656
|
skillLoadingLabel: string;
|
|
641
657
|
skillEmptyLabel: string;
|
|
642
658
|
removeSkillAriaLabel: string;
|
|
659
|
+
modelLoadingLabel: string;
|
|
660
|
+
modelLoadFailedLabel: string;
|
|
661
|
+
modelUnavailableLabel: string;
|
|
643
662
|
onValueChange: (value: string) => void;
|
|
644
663
|
onPickImages: (files: FileList | File[]) => void;
|
|
645
664
|
onPasteImages: (files: File[]) => void;
|
|
@@ -649,6 +668,7 @@ interface ChatComposerViewProps {
|
|
|
649
668
|
onSelectedModelChange: (value: string) => void;
|
|
650
669
|
onSelectedModeChange: (value: ChatAgentMode) => void;
|
|
651
670
|
onReloadModels: () => void;
|
|
671
|
+
onOpenSkillPicker: () => void;
|
|
652
672
|
/** Called to abort the active streaming response. */
|
|
653
673
|
onStop: () => void | Promise<void>;
|
|
654
674
|
/** Called to send a new user message. */
|