@xinghunm/ai-chat 1.2.2 → 1.3.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/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +434 -118
- package/dist/index.mjs +434 -118
- 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;
|
|
@@ -520,12 +521,24 @@ type AiChatProps = Omit<AiChatProviderProps, 'children'> & {
|
|
|
520
521
|
showNewChatButton?: boolean;
|
|
521
522
|
/** Optional renderer used to override the lightweight new-chat trigger UI. */
|
|
522
523
|
renderNewChatTrigger?: (props: NewChatTriggerRenderProps) => ReactNode;
|
|
524
|
+
/**
|
|
525
|
+
* When true, only renders the composer before the first message is sent.
|
|
526
|
+
* Once a conversation starts, the full thread layout is shown automatically.
|
|
527
|
+
*/
|
|
528
|
+
showComposerOnlyBeforeFirstMessage?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Called whenever the "conversation started" state changes.
|
|
531
|
+
*
|
|
532
|
+
* A conversation is considered started after the active session has messages,
|
|
533
|
+
* a streaming message, or an error to render.
|
|
534
|
+
*/
|
|
535
|
+
onConversationStartedChange?: (started: boolean) => void;
|
|
523
536
|
};
|
|
524
537
|
/**
|
|
525
538
|
* Top-level AI chat component. Wraps AiChatProvider and composes the full
|
|
526
539
|
* chat UI: optional conversation sidebar + thread + composer.
|
|
527
540
|
*/
|
|
528
|
-
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
541
|
+
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, showComposerOnlyBeforeFirstMessage, onConversationStartedChange, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
529
542
|
|
|
530
543
|
/**
|
|
531
544
|
* Endpoint overrides for the built-in HTTP transport adapter.
|
|
@@ -649,6 +662,7 @@ interface ChatComposerViewProps {
|
|
|
649
662
|
onSelectedModelChange: (value: string) => void;
|
|
650
663
|
onSelectedModeChange: (value: ChatAgentMode) => void;
|
|
651
664
|
onReloadModels: () => void;
|
|
665
|
+
onOpenSkillPicker: () => void;
|
|
652
666
|
/** Called to abort the active streaming response. */
|
|
653
667
|
onStop: () => void | Promise<void>;
|
|
654
668
|
/** 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;
|
|
@@ -520,12 +521,24 @@ type AiChatProps = Omit<AiChatProviderProps, 'children'> & {
|
|
|
520
521
|
showNewChatButton?: boolean;
|
|
521
522
|
/** Optional renderer used to override the lightweight new-chat trigger UI. */
|
|
522
523
|
renderNewChatTrigger?: (props: NewChatTriggerRenderProps) => ReactNode;
|
|
524
|
+
/**
|
|
525
|
+
* When true, only renders the composer before the first message is sent.
|
|
526
|
+
* Once a conversation starts, the full thread layout is shown automatically.
|
|
527
|
+
*/
|
|
528
|
+
showComposerOnlyBeforeFirstMessage?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Called whenever the "conversation started" state changes.
|
|
531
|
+
*
|
|
532
|
+
* A conversation is considered started after the active session has messages,
|
|
533
|
+
* a streaming message, or an error to render.
|
|
534
|
+
*/
|
|
535
|
+
onConversationStartedChange?: (started: boolean) => void;
|
|
523
536
|
};
|
|
524
537
|
/**
|
|
525
538
|
* Top-level AI chat component. Wraps AiChatProvider and composes the full
|
|
526
539
|
* chat UI: optional conversation sidebar + thread + composer.
|
|
527
540
|
*/
|
|
528
|
-
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
541
|
+
declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, showComposerOnlyBeforeFirstMessage, onConversationStartedChange, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
529
542
|
|
|
530
543
|
/**
|
|
531
544
|
* Endpoint overrides for the built-in HTTP transport adapter.
|
|
@@ -649,6 +662,7 @@ interface ChatComposerViewProps {
|
|
|
649
662
|
onSelectedModelChange: (value: string) => void;
|
|
650
663
|
onSelectedModeChange: (value: ChatAgentMode) => void;
|
|
651
664
|
onReloadModels: () => void;
|
|
665
|
+
onOpenSkillPicker: () => void;
|
|
652
666
|
/** Called to abort the active streaming response. */
|
|
653
667
|
onStop: () => void | Promise<void>;
|
|
654
668
|
/** Called to send a new user message. */
|