@xinghunm/ai-chat 1.2.0 → 1.2.2

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 CHANGED
@@ -297,6 +297,8 @@ interface ChatTransportStartStreamArgs {
297
297
  mode: ChatAgentMode;
298
298
  /** User message content that should be sent to the backend. */
299
299
  content: string;
300
+ /** Optional skills selected in the composer and sent alongside the user message. */
301
+ skills?: string[];
300
302
  /**
301
303
  * Optional image attachments selected in the composer and sent alongside the text.
302
304
  */
@@ -318,6 +320,8 @@ interface ChatTransportStartStreamArgs {
318
320
  interface ChatTransport {
319
321
  /** Loads the model list shown by the composer model selector. */
320
322
  getModels: () => Promise<ChatModelsResponse>;
323
+ /** Optional skill catalog loader used by the composer slash menu. */
324
+ getSkills?: () => Promise<ChatSkillsResponse>;
321
325
  /** Starts a single assistant response stream for the current user message. */
322
326
  startStream: (args: ChatTransportStartStreamArgs) => Promise<void>;
323
327
  /** Requests termination of the active backend stream for a session. */
@@ -364,6 +368,12 @@ interface ChatModel {
364
368
  interface ChatModelsResponse {
365
369
  data: ChatModel[];
366
370
  }
371
+ /**
372
+ * Response payload returned by the optional chat skills endpoint.
373
+ */
374
+ interface ChatSkillsResponse {
375
+ skills: string[];
376
+ }
367
377
  /**
368
378
  * Response payload returned after a terminate request has been processed.
369
379
  */
@@ -430,6 +440,20 @@ interface AiChatLabels {
430
440
  questionnaireMultiSelectHint?: string;
431
441
  questionnaireOtherOptionLabel?: string;
432
442
  questionnaireOtherPlaceholder?: string;
443
+ skillLoading?: string;
444
+ skillEmpty?: string;
445
+ removeSkillAriaLabel?: string;
446
+ }
447
+ /**
448
+ * State and actions exposed to custom new-chat trigger renderers.
449
+ */
450
+ interface NewChatTriggerRenderProps {
451
+ activeSessionId: string | null;
452
+ isStreaming: boolean;
453
+ isStopping: boolean;
454
+ createNewSession: () => void;
455
+ stopActiveSession: () => Promise<void>;
456
+ startNewChat: () => Promise<void>;
433
457
  }
434
458
  /**
435
459
  * Default English label values used when no labels are provided.
@@ -492,12 +516,16 @@ declare const AiChatProvider: (props: AiChatProviderProps) => _emotion_react_jsx
492
516
  type AiChatProps = Omit<AiChatProviderProps, 'children'> & {
493
517
  /** When true, renders the conversation list sidebar. Defaults to false. */
494
518
  showConversationList?: boolean;
519
+ /** When true, renders a lightweight new-chat button without the full conversation list. */
520
+ showNewChatButton?: boolean;
521
+ /** Optional renderer used to override the lightweight new-chat trigger UI. */
522
+ renderNewChatTrigger?: (props: NewChatTriggerRenderProps) => ReactNode;
495
523
  };
496
524
  /**
497
525
  * Top-level AI chat component. Wraps AiChatProvider and composes the full
498
526
  * chat UI: optional conversation sidebar + thread + composer.
499
527
  */
500
- declare const AiChat: ({ showConversationList, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
528
+ declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
501
529
 
502
530
  /**
503
531
  * Endpoint overrides for the built-in HTTP transport adapter.
@@ -505,6 +533,8 @@ declare const AiChat: ({ showConversationList, ...providerProps }: AiChatProps)
505
533
  interface DefaultChatTransportEndpoints {
506
534
  /** Relative path used to fetch the available model list. */
507
535
  models?: string;
536
+ /** Relative path used to fetch the available skills. */
537
+ skills?: string;
508
538
  /** Relative path used to start a streaming chat completion. */
509
539
  completions?: string;
510
540
  /** Relative path used to request stream termination. */
@@ -529,6 +559,7 @@ interface DefaultChatTransportRequestBodyBuilderArgs {
529
559
  model: string;
530
560
  mode: ChatAgentMode;
531
561
  content: string;
562
+ skills?: string[];
532
563
  attachments?: ChatImageAttachment[];
533
564
  }
534
565
  /**
@@ -540,6 +571,7 @@ type DefaultChatTransportRequestBodyBuilder = (args: DefaultChatTransportRequest
540
571
  * Optional model resolver used to override the default `/models` request.
541
572
  */
542
573
  type DefaultChatTransportModelsResolver = () => Promise<ChatModelsResponse>;
574
+ type DefaultChatTransportSkillsResolver = () => Promise<ChatSkillsResponse>;
543
575
  /**
544
576
  * Options for the built-in HTTP transport adapter.
545
577
  */
@@ -548,12 +580,16 @@ interface CreateDefaultChatTransportOptions {
548
580
  apiBaseUrl: string;
549
581
  /** Authorization header value forwarded to the backend. */
550
582
  authToken: string;
583
+ /** Optional extra headers appended to every request sent by the default transport. */
584
+ headers?: Record<string, string>;
551
585
  /** Optional tool execution policy translated into stream request headers. */
552
586
  toolExecutionPolicy?: ChatToolExecutionPolicy;
553
587
  /** Optional extra headers appended to each streaming chat completion request. */
554
588
  streamHeaders?: Record<string, string>;
555
589
  /** Optional resolver used to override the built-in model catalog request. */
556
590
  resolveModels?: DefaultChatTransportModelsResolver;
591
+ /** Optional resolver used to override the built-in skills catalog request. */
592
+ resolveSkills?: DefaultChatTransportSkillsResolver;
557
593
  /** Optional builder used to override the built-in chat completion request body. */
558
594
  buildRequestBody?: DefaultChatTransportRequestBodyBuilder;
559
595
  /** Optional transformer used to normalize custom stream packets. */
@@ -566,7 +602,7 @@ interface CreateDefaultChatTransportOptions {
566
602
  /**
567
603
  * Creates the built-in transport backed by the current HTTP chat API.
568
604
  */
569
- declare const createDefaultChatTransport: ({ apiBaseUrl, authToken, toolExecutionPolicy, streamHeaders, resolveModels, buildRequestBody, transformStreamPacket, endpoints, axiosInstance, }: CreateDefaultChatTransportOptions) => ChatTransport;
605
+ declare const createDefaultChatTransport: ({ apiBaseUrl, authToken, headers, toolExecutionPolicy, streamHeaders, resolveModels, resolveSkills, buildRequestBody, transformStreamPacket, endpoints, axiosInstance, }: CreateDefaultChatTransportOptions) => ChatTransport;
570
606
 
571
607
  declare const ChatThread: () => _emotion_react_jsx_runtime.JSX.Element;
572
608
 
@@ -579,10 +615,13 @@ interface ChatComposerViewProps {
579
615
  attachments: ChatImageAttachment[];
580
616
  attachmentNotice?: 'limit_reached' | null;
581
617
  attachmentLimitNotice: string;
618
+ selectedSkills: string[];
582
619
  selectedModel: string;
583
620
  selectedMode: ChatAgentMode;
584
621
  availableModels: ChatModel[];
622
+ availableSkills: string[];
585
623
  isModelsLoading: boolean;
624
+ isSkillsLoading: boolean;
586
625
  isModelsError: boolean;
587
626
  hasModels: boolean;
588
627
  /** Whether a streaming response is currently in progress. */
@@ -598,10 +637,15 @@ interface ChatComposerViewProps {
598
637
  };
599
638
  expandComposerAriaLabel: string;
600
639
  collapseComposerAriaLabel: string;
640
+ skillLoadingLabel: string;
641
+ skillEmptyLabel: string;
642
+ removeSkillAriaLabel: string;
601
643
  onValueChange: (value: string) => void;
602
644
  onPickImages: (files: FileList | File[]) => void;
603
645
  onPasteImages: (files: File[]) => void;
604
646
  onRemoveAttachment: (attachmentId: string) => void;
647
+ onAddSkill: (skill: string) => void;
648
+ onRemoveSkill: (skill: string) => void;
605
649
  onSelectedModelChange: (value: string) => void;
606
650
  onSelectedModeChange: (value: ChatAgentMode) => void;
607
651
  onReloadModels: () => void;
@@ -626,6 +670,7 @@ interface ChatState {
626
670
  }
627
671
  interface ChatActions {
628
672
  createSession: (session: ChatSession) => void;
673
+ startNewChat: () => void;
629
674
  setActiveSession: (sessionId: string | null) => void;
630
675
  replaceSessionId: (previousSessionId: string, nextSessionId: string) => void;
631
676
  setPreferredMode: (mode: ChatAgentMode) => void;
@@ -645,6 +690,14 @@ type ChatStore = ChatState & ChatActions;
645
690
  type ChatStoreInstance = ReturnType<typeof createChatStore>;
646
691
  declare const createChatStore: (initialState?: Partial<Pick<ChatState, "preferredMode">>) => zustand_vanilla.StoreApi<ChatStore>;
647
692
 
693
+ interface ChatSendRefOptions {
694
+ /** Explicit target session for programmatic sends triggered from a thread card. */
695
+ sessionId?: string;
696
+ /** Whether to consume the composer attachment draft. Defaults to true for composer sends. */
697
+ includeComposerAttachments?: boolean;
698
+ /** Whether to consume the composer skill draft. Defaults to true for composer sends. */
699
+ includeComposerSkills?: boolean;
700
+ }
648
701
  interface ChatContextValue {
649
702
  store: ChatStoreInstance;
650
703
  transport: ChatTransport;
@@ -656,9 +709,11 @@ interface ChatContextValue {
656
709
  authToken?: string;
657
710
  labels: Required<AiChatLabels>;
658
711
  /** Stable ref populated by ChatComposer on mount; allows ChatThread to trigger sends. */
659
- sendRef: MutableRefObject<(content: string) => Promise<void>>;
660
- /** Stable ref populated by ChatComposer on mount; allows ChatThread to replay the last request. */
661
- retryRef: MutableRefObject<() => Promise<void>>;
712
+ sendRef: MutableRefObject<(content: string, options?: ChatSendRefOptions) => Promise<void>>;
713
+ /** Stable ref populated by ChatComposer on mount; allows ChatThread to replay a session request. */
714
+ retryRef: MutableRefObject<(sessionId: string) => Promise<void>>;
715
+ /** Stable ref populated by ChatComposer on mount; allows external controls to stop streaming. */
716
+ stopRef: MutableRefObject<(sessionId: string) => Promise<void>>;
662
717
  /** Optional block renderer used to extend message rendering with custom block types. */
663
718
  renderMessageBlock?: ChatMessageBlockRenderer;
664
719
  /** Optional handler used to intercept questionnaire submissions before the default send flow. */
@@ -687,4 +742,4 @@ declare const useChatContext: () => ChatContextValue;
687
742
  */
688
743
  declare const useChatStore: <T>(selector: (state: ChatStore) => T) => T;
689
744
 
690
- export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type DefaultChatTransportModelsResolver, type DefaultChatTransportRequestBodyBuilder, type DefaultChatTransportRequestBodyBuilderArgs, type ExecutionConfirmationSubmission, type ExecutionProposal, type PlanQuestionOption, type PlanQuestionSubmissionDetail, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
745
+ export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type DefaultChatTransportModelsResolver, type DefaultChatTransportRequestBodyBuilder, type DefaultChatTransportRequestBodyBuilderArgs, type ExecutionConfirmationSubmission, type ExecutionProposal, type NewChatTriggerRenderProps, type PlanQuestionOption, type PlanQuestionSubmissionDetail, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
package/dist/index.d.ts CHANGED
@@ -297,6 +297,8 @@ interface ChatTransportStartStreamArgs {
297
297
  mode: ChatAgentMode;
298
298
  /** User message content that should be sent to the backend. */
299
299
  content: string;
300
+ /** Optional skills selected in the composer and sent alongside the user message. */
301
+ skills?: string[];
300
302
  /**
301
303
  * Optional image attachments selected in the composer and sent alongside the text.
302
304
  */
@@ -318,6 +320,8 @@ interface ChatTransportStartStreamArgs {
318
320
  interface ChatTransport {
319
321
  /** Loads the model list shown by the composer model selector. */
320
322
  getModels: () => Promise<ChatModelsResponse>;
323
+ /** Optional skill catalog loader used by the composer slash menu. */
324
+ getSkills?: () => Promise<ChatSkillsResponse>;
321
325
  /** Starts a single assistant response stream for the current user message. */
322
326
  startStream: (args: ChatTransportStartStreamArgs) => Promise<void>;
323
327
  /** Requests termination of the active backend stream for a session. */
@@ -364,6 +368,12 @@ interface ChatModel {
364
368
  interface ChatModelsResponse {
365
369
  data: ChatModel[];
366
370
  }
371
+ /**
372
+ * Response payload returned by the optional chat skills endpoint.
373
+ */
374
+ interface ChatSkillsResponse {
375
+ skills: string[];
376
+ }
367
377
  /**
368
378
  * Response payload returned after a terminate request has been processed.
369
379
  */
@@ -430,6 +440,20 @@ interface AiChatLabels {
430
440
  questionnaireMultiSelectHint?: string;
431
441
  questionnaireOtherOptionLabel?: string;
432
442
  questionnaireOtherPlaceholder?: string;
443
+ skillLoading?: string;
444
+ skillEmpty?: string;
445
+ removeSkillAriaLabel?: string;
446
+ }
447
+ /**
448
+ * State and actions exposed to custom new-chat trigger renderers.
449
+ */
450
+ interface NewChatTriggerRenderProps {
451
+ activeSessionId: string | null;
452
+ isStreaming: boolean;
453
+ isStopping: boolean;
454
+ createNewSession: () => void;
455
+ stopActiveSession: () => Promise<void>;
456
+ startNewChat: () => Promise<void>;
433
457
  }
434
458
  /**
435
459
  * Default English label values used when no labels are provided.
@@ -492,12 +516,16 @@ declare const AiChatProvider: (props: AiChatProviderProps) => _emotion_react_jsx
492
516
  type AiChatProps = Omit<AiChatProviderProps, 'children'> & {
493
517
  /** When true, renders the conversation list sidebar. Defaults to false. */
494
518
  showConversationList?: boolean;
519
+ /** When true, renders a lightweight new-chat button without the full conversation list. */
520
+ showNewChatButton?: boolean;
521
+ /** Optional renderer used to override the lightweight new-chat trigger UI. */
522
+ renderNewChatTrigger?: (props: NewChatTriggerRenderProps) => ReactNode;
495
523
  };
496
524
  /**
497
525
  * Top-level AI chat component. Wraps AiChatProvider and composes the full
498
526
  * chat UI: optional conversation sidebar + thread + composer.
499
527
  */
500
- declare const AiChat: ({ showConversationList, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
528
+ declare const AiChat: ({ showConversationList, showNewChatButton, renderNewChatTrigger, ...providerProps }: AiChatProps) => _emotion_react_jsx_runtime.JSX.Element;
501
529
 
502
530
  /**
503
531
  * Endpoint overrides for the built-in HTTP transport adapter.
@@ -505,6 +533,8 @@ declare const AiChat: ({ showConversationList, ...providerProps }: AiChatProps)
505
533
  interface DefaultChatTransportEndpoints {
506
534
  /** Relative path used to fetch the available model list. */
507
535
  models?: string;
536
+ /** Relative path used to fetch the available skills. */
537
+ skills?: string;
508
538
  /** Relative path used to start a streaming chat completion. */
509
539
  completions?: string;
510
540
  /** Relative path used to request stream termination. */
@@ -529,6 +559,7 @@ interface DefaultChatTransportRequestBodyBuilderArgs {
529
559
  model: string;
530
560
  mode: ChatAgentMode;
531
561
  content: string;
562
+ skills?: string[];
532
563
  attachments?: ChatImageAttachment[];
533
564
  }
534
565
  /**
@@ -540,6 +571,7 @@ type DefaultChatTransportRequestBodyBuilder = (args: DefaultChatTransportRequest
540
571
  * Optional model resolver used to override the default `/models` request.
541
572
  */
542
573
  type DefaultChatTransportModelsResolver = () => Promise<ChatModelsResponse>;
574
+ type DefaultChatTransportSkillsResolver = () => Promise<ChatSkillsResponse>;
543
575
  /**
544
576
  * Options for the built-in HTTP transport adapter.
545
577
  */
@@ -548,12 +580,16 @@ interface CreateDefaultChatTransportOptions {
548
580
  apiBaseUrl: string;
549
581
  /** Authorization header value forwarded to the backend. */
550
582
  authToken: string;
583
+ /** Optional extra headers appended to every request sent by the default transport. */
584
+ headers?: Record<string, string>;
551
585
  /** Optional tool execution policy translated into stream request headers. */
552
586
  toolExecutionPolicy?: ChatToolExecutionPolicy;
553
587
  /** Optional extra headers appended to each streaming chat completion request. */
554
588
  streamHeaders?: Record<string, string>;
555
589
  /** Optional resolver used to override the built-in model catalog request. */
556
590
  resolveModels?: DefaultChatTransportModelsResolver;
591
+ /** Optional resolver used to override the built-in skills catalog request. */
592
+ resolveSkills?: DefaultChatTransportSkillsResolver;
557
593
  /** Optional builder used to override the built-in chat completion request body. */
558
594
  buildRequestBody?: DefaultChatTransportRequestBodyBuilder;
559
595
  /** Optional transformer used to normalize custom stream packets. */
@@ -566,7 +602,7 @@ interface CreateDefaultChatTransportOptions {
566
602
  /**
567
603
  * Creates the built-in transport backed by the current HTTP chat API.
568
604
  */
569
- declare const createDefaultChatTransport: ({ apiBaseUrl, authToken, toolExecutionPolicy, streamHeaders, resolveModels, buildRequestBody, transformStreamPacket, endpoints, axiosInstance, }: CreateDefaultChatTransportOptions) => ChatTransport;
605
+ declare const createDefaultChatTransport: ({ apiBaseUrl, authToken, headers, toolExecutionPolicy, streamHeaders, resolveModels, resolveSkills, buildRequestBody, transformStreamPacket, endpoints, axiosInstance, }: CreateDefaultChatTransportOptions) => ChatTransport;
570
606
 
571
607
  declare const ChatThread: () => _emotion_react_jsx_runtime.JSX.Element;
572
608
 
@@ -579,10 +615,13 @@ interface ChatComposerViewProps {
579
615
  attachments: ChatImageAttachment[];
580
616
  attachmentNotice?: 'limit_reached' | null;
581
617
  attachmentLimitNotice: string;
618
+ selectedSkills: string[];
582
619
  selectedModel: string;
583
620
  selectedMode: ChatAgentMode;
584
621
  availableModels: ChatModel[];
622
+ availableSkills: string[];
585
623
  isModelsLoading: boolean;
624
+ isSkillsLoading: boolean;
586
625
  isModelsError: boolean;
587
626
  hasModels: boolean;
588
627
  /** Whether a streaming response is currently in progress. */
@@ -598,10 +637,15 @@ interface ChatComposerViewProps {
598
637
  };
599
638
  expandComposerAriaLabel: string;
600
639
  collapseComposerAriaLabel: string;
640
+ skillLoadingLabel: string;
641
+ skillEmptyLabel: string;
642
+ removeSkillAriaLabel: string;
601
643
  onValueChange: (value: string) => void;
602
644
  onPickImages: (files: FileList | File[]) => void;
603
645
  onPasteImages: (files: File[]) => void;
604
646
  onRemoveAttachment: (attachmentId: string) => void;
647
+ onAddSkill: (skill: string) => void;
648
+ onRemoveSkill: (skill: string) => void;
605
649
  onSelectedModelChange: (value: string) => void;
606
650
  onSelectedModeChange: (value: ChatAgentMode) => void;
607
651
  onReloadModels: () => void;
@@ -626,6 +670,7 @@ interface ChatState {
626
670
  }
627
671
  interface ChatActions {
628
672
  createSession: (session: ChatSession) => void;
673
+ startNewChat: () => void;
629
674
  setActiveSession: (sessionId: string | null) => void;
630
675
  replaceSessionId: (previousSessionId: string, nextSessionId: string) => void;
631
676
  setPreferredMode: (mode: ChatAgentMode) => void;
@@ -645,6 +690,14 @@ type ChatStore = ChatState & ChatActions;
645
690
  type ChatStoreInstance = ReturnType<typeof createChatStore>;
646
691
  declare const createChatStore: (initialState?: Partial<Pick<ChatState, "preferredMode">>) => zustand_vanilla.StoreApi<ChatStore>;
647
692
 
693
+ interface ChatSendRefOptions {
694
+ /** Explicit target session for programmatic sends triggered from a thread card. */
695
+ sessionId?: string;
696
+ /** Whether to consume the composer attachment draft. Defaults to true for composer sends. */
697
+ includeComposerAttachments?: boolean;
698
+ /** Whether to consume the composer skill draft. Defaults to true for composer sends. */
699
+ includeComposerSkills?: boolean;
700
+ }
648
701
  interface ChatContextValue {
649
702
  store: ChatStoreInstance;
650
703
  transport: ChatTransport;
@@ -656,9 +709,11 @@ interface ChatContextValue {
656
709
  authToken?: string;
657
710
  labels: Required<AiChatLabels>;
658
711
  /** Stable ref populated by ChatComposer on mount; allows ChatThread to trigger sends. */
659
- sendRef: MutableRefObject<(content: string) => Promise<void>>;
660
- /** Stable ref populated by ChatComposer on mount; allows ChatThread to replay the last request. */
661
- retryRef: MutableRefObject<() => Promise<void>>;
712
+ sendRef: MutableRefObject<(content: string, options?: ChatSendRefOptions) => Promise<void>>;
713
+ /** Stable ref populated by ChatComposer on mount; allows ChatThread to replay a session request. */
714
+ retryRef: MutableRefObject<(sessionId: string) => Promise<void>>;
715
+ /** Stable ref populated by ChatComposer on mount; allows external controls to stop streaming. */
716
+ stopRef: MutableRefObject<(sessionId: string) => Promise<void>>;
662
717
  /** Optional block renderer used to extend message rendering with custom block types. */
663
718
  renderMessageBlock?: ChatMessageBlockRenderer;
664
719
  /** Optional handler used to intercept questionnaire submissions before the default send flow. */
@@ -687,4 +742,4 @@ declare const useChatContext: () => ChatContextValue;
687
742
  */
688
743
  declare const useChatStore: <T>(selector: (state: ChatStore) => T) => T;
689
744
 
690
- export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type DefaultChatTransportModelsResolver, type DefaultChatTransportRequestBodyBuilder, type DefaultChatTransportRequestBodyBuilderArgs, type ExecutionConfirmationSubmission, type ExecutionProposal, type PlanQuestionOption, type PlanQuestionSubmissionDetail, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
745
+ export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type DefaultChatTransportModelsResolver, type DefaultChatTransportRequestBodyBuilder, type DefaultChatTransportRequestBodyBuilderArgs, type ExecutionConfirmationSubmission, type ExecutionProposal, type NewChatTriggerRenderProps, type PlanQuestionOption, type PlanQuestionSubmissionDetail, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };