@pactor-app/chat 0.1.0 → 1.1.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.cts CHANGED
@@ -655,6 +655,11 @@ declare function useChatAutoScroll({ messageCount, lastContentLength, isStreamin
655
655
  * 数据以接口注入:greeting / subtitle / suggestions 均为受控 props;
656
656
  * 点击建议经 `onSuggestionClick` 回调交还调用方(ChatView 接入时
657
657
  * 复用 Composer 的同一条发送路径)。
658
+ *
659
+ * chrome DSL 渲染层(spec: chat-chrome-dsl):元素层在页面运行时内
660
+ * 优先经 ChromeSlot 以宿主组件(Typography / Text / Button)DSL 组合
661
+ * 渲染,建议点击经 chat.sendSuggestion 内建动作接回同一发送路径;
662
+ * 无 renderer 环境或类型缺失时回退下方手写实现(EmptyStateFallback)。
658
663
  */
659
664
  type ChatSuggestion = string | {
660
665
  label: string;
@@ -738,6 +743,10 @@ interface ChatWorkspaceServices {
738
743
  /** Composer 工具栏左 / 右槽(ReactNode 闭包槽,纯 React 与 DSL 场景均可用) */
739
744
  toolbarStart?: ReactNode;
740
745
  toolbarEnd?: ReactNode;
746
+ /** Composer footer 槽(spec: chat-composer-slots;ReactNode 闭包槽) */
747
+ composerFooter?: ReactNode;
748
+ /** Composer 下方自定义内容槽(ReactNode 闭包槽;渲染在 Composer 之外正下方,未提供不渲染) */
749
+ composerBottom?: ReactNode;
741
750
  /** 工作区头部右侧扩展区(提供 title 或 headerExtra 时渲染头部) */
742
751
  headerExtra?: ReactNode;
743
752
  }
@@ -764,8 +773,20 @@ interface ChatWorkspaceProps {
764
773
  * 包裹工作区(侧栏 + 移动端抽屉)。仅页面运行时上下文内有效。
765
774
  */
766
775
  sidebar?: DslNode;
776
+ /** Composer 工具栏左端 DslNode 槽(与服务注入的 toolbarStart 先后渲染,服务槽在先) */
777
+ toolbarStart?: DslNode;
767
778
  /** Composer 工具栏右端 DslNode 槽(与服务注入的 toolbarEnd 先后渲染) */
768
779
  toolbarEnd?: DslNode;
780
+ /** Composer footer DslNode 槽(spec: chat-composer-slots;与服务注入的 composerFooter 先后渲染,服务槽在先) */
781
+ composerFooter?: DslNode;
782
+ /** Composer 下方自定义内容 DslNode 槽(与服务注入的 composerBottom 先后渲染,服务槽在先;未提供不渲染) */
783
+ composerBottom?: DslNode;
784
+ /**
785
+ * 隐藏 Composer 工具栏行(缺省 false):true 时工具栏行整体不渲染,
786
+ * toolbarStart / toolbarEnd 槽一并抑制(composerFooter 槽不受影响),
787
+ * Enter 发送保留
788
+ */
789
+ hideToolbar?: boolean;
769
790
  /**
770
791
  * 产出物面板受控 props(spec: chat-artifact-panel,决策 D2):
771
792
  * 任一提供即全受控;都未提供时由内部 / 注入的 ArtifactStore 驱动
@@ -874,7 +895,7 @@ interface ChatProps {
874
895
  conversationId?: string;
875
896
  /** 注入 dsl part 作用域 params */
876
897
  params?: Record<string, unknown>;
877
- /** 传 false 关闭 header;缺省渲染(header 槽整体替换 > title + headerExtra 内建 header) */
898
+ /** 传 false 关闭 header;缺省按内容自动渲染(header 槽整体替换 > title + headerExtra / headerActions / header 位模型 chip 内建 header,均无内容时 header 节点不渲染) */
878
899
  showHeader?: boolean;
879
900
  /** 左侧菜单数据;提供时以 AppShell 承载内建侧栏 */
880
901
  menu?: ChatMenuItem[];
@@ -882,6 +903,27 @@ interface ChatProps {
882
903
  activeMenuKey?: string;
883
904
  /** 侧栏槽:提供时替代内建菜单侧栏 */
884
905
  sidebar?: DslNode | ReactNode;
906
+ /**
907
+ * Composer 槽(spec: chat-composer-slots / Composer 槽配置):
908
+ * toolbarStart 工具栏左端 / toolbarEnd 工具栏右端(发送钮之前)/
909
+ * composerFooter footer 区域(工具栏下方、带分隔线);
910
+ * 与服务注入的同名槽并存时服务槽在先
911
+ */
912
+ toolbarStart?: DslNode | ReactNode;
913
+ toolbarEnd?: DslNode | ReactNode;
914
+ composerFooter?: DslNode | ReactNode;
915
+ /**
916
+ * Composer 下方自定义内容槽(DslNode | ReactNode):
917
+ * 渲染在 Composer 之外正下方(页面底部留白区内),
918
+ * 与服务注入的同名槽并存时服务槽在先;未提供不渲染
919
+ */
920
+ composerBottom?: DslNode | ReactNode;
921
+ /**
922
+ * 隐藏 Composer 工具栏行(缺省 false;DSL 可序列化标量):
923
+ * true 时工具栏行整体不渲染,toolbarStart / toolbarEnd 槽一并抑制
924
+ * (composerFooter 槽不受影响),Enter 发送保留
925
+ */
926
+ hideToolbar?: boolean;
885
927
  /** 内建 header 标题右侧槽 */
886
928
  headerExtra?: DslNode | ReactNode;
887
929
  /** header 槽:整体替换内建 header */
@@ -941,12 +983,16 @@ interface ChatProps {
941
983
  /** 菜单项点击回调(disabled 项不触发) */
942
984
  onMenuSelect?: (key: string, item: ChatMenuItem) => void;
943
985
  }
944
- /** 菜单图标名 → lucide 子集(白名单式,未知名渲染占位圆点,不抛错) */
945
- declare const MENU_ICONS: Record<string, ComponentType<{
946
- size?: number;
947
- strokeWidth?: number;
948
- }>>;
949
- /** 内建侧栏:menu 数据驱动的菜单(分组标题 + 图标 + badge + disabled);ChatShell 同款复用 */
986
+ /**
987
+ * 菜单图标名(spec: chat-icon-convergence):契约取值(plus / chat /
988
+ * history / settings / star / search / user / folder)直接作为 ui Icon
989
+ * 白名单名渲染,未知名由 ui Icon 渲染占位图标,不抛错。
990
+ * 白名单曾映射 lucide 子集(MENU_ICONS),收敛后删除。
991
+ */
992
+ /** 内建侧栏:menu 数据驱动的菜单(分组标题 + 图标 + badge + disabled);ChatShell 同款复用。
993
+ * chrome DSL 渲染层(spec: chat-on-ui-components):DSL 环境优先经宿主
994
+ * Menu 组件组合渲染(chat.menuSelect 接回同一传播与 drawer close),
995
+ * 无 renderer / 类型缺失时回退下方手写菜单 */
950
996
  declare function ChatSidebarMenu({ menu, activeMenuKey, onMenuSelect, }: {
951
997
  menu: ChatMenuItem[];
952
998
  activeMenuKey?: string;
@@ -960,7 +1006,7 @@ declare function ChatSidebarMenu({ menu, activeMenuKey, onMenuSelect, }: {
960
1006
  * 「未配置聊天服务」提示并 console.warn,不抛错。组合逻辑与
961
1007
  * createChatWorkspace 共用内部 ChatComposition(决策 D5)。
962
1008
  */
963
- declare function Chat({ title, greeting, subtitle, suggestions, conversationId, params, showHeader, menu, activeMenuKey, sidebar, headerExtra, header, headerActions, editableTitle, onExport, onThemeChange, onClear, onTitleChange, models, model, onModelChange, modelPlacement, contexts, onContextsChange, messageActions, onMessageAction, artifact, panelOpen, onPanelClose, inspector, onArtifact, onOpenArtifact, className, onSend, onMenuSelect, }: ChatProps): ReactNode;
1009
+ declare function Chat({ title, greeting, subtitle, suggestions, conversationId, params, showHeader, menu, activeMenuKey, sidebar, toolbarStart, toolbarEnd, composerFooter, composerBottom, hideToolbar, headerExtra, header, headerActions, editableTitle, onExport, onThemeChange, onClear, onTitleChange, models, model, onModelChange, modelPlacement, contexts, onContextsChange, messageActions, onMessageAction, artifact, panelOpen, onPanelClose, inspector, onArtifact, onOpenArtifact, className, onSend, onMenuSelect, }: ChatProps): ReactNode;
964
1010
  /** Chat 的 DSL 组件类型名 */
965
1011
  declare const CHAT_COMPONENT_TYPE = "Chat";
966
1012
  /**
@@ -1036,6 +1082,16 @@ interface ArtifactPanelProps {
1036
1082
  }
1037
1083
  declare function ArtifactPanel({ artifact, inspector, onClose, safeRegistry, user, className, }: ArtifactPanelProps): ReactNode;
1038
1084
 
1085
+ /**
1086
+ * 侧栏抽屉 context(spec: chat-app-shell):侧栏内容(如导航项)在导航后
1087
+ * 调用 `close()` 关闭移动端抽屉;不在 AppShell 内时返回 null,
1088
+ * 调用方以可选链安全调用(`drawer?.close()`),不抛错。
1089
+ * `collapsed` 为桌面折叠(icon rail)状态(决策 D3):侧栏内容可据此
1090
+ * 降级为纯图标展示(如菜单项以 title 兜底可访问名)。
1091
+ *
1092
+ * 实现为 ui Sidebar 的 context 转发(chat-on-ui-sidebar):AppShell
1093
+ * 内部渲染 ui Sidebar,hook 签名与语义保持不变,调用方零改动。
1094
+ */
1039
1095
  declare function useSidebarDrawer(): {
1040
1096
  close: () => void;
1041
1097
  collapsed: boolean;
@@ -1068,12 +1124,14 @@ interface AppShellProps {
1068
1124
  /**
1069
1125
  * AppShell(spec: chat-app-shell):聊天工作区应用外壳 = 侧栏插槽 + 主区。
1070
1126
  *
1071
- * 桌面(≥768px):侧栏与主区在 flex 行内同级排列;
1072
- * 移动端(<768px):侧栏退出文档流变为左侧覆盖抽屉(遮罩 + 顶栏菜单按钮)。
1073
- * 布局切换全部在 styles.css 媒体查询(`.pactor-chat-shell*`)中表达,
1074
- * JS 只拥有抽屉开合状态 `drawerOpen`。
1127
+ * 实现为 ui Sidebar 的薄封装(spec: chat-on-ui-sidebar):桌面(≥768px)
1128
+ * 侧栏与主区 flex 同行;移动端(<768px)侧栏变为覆盖抽屉(遮罩 +
1129
+ * 顶栏菜单按钮);折叠 / 抽屉 / inert 等交互全部由 ui Sidebar 承担,
1130
+ * chat 侧只挂 `pactor-chat-shell` 类做 `--sidebar*` → `--pactor-chat-*`
1131
+ * 令牌映射(皮肤唯一入口仍为 --pactor-chat-*,见 styles.css)与
1132
+ * 高度语义(h-full 填满父容器,嵌入契约)。
1075
1133
  */
1076
- declare function AppShell({ sidebar, brand, locationKey, sidebarFooter, collapsible, children, className }: AppShellProps): react.JSX.Element;
1134
+ declare function AppShell({ sidebar, brand, locationKey, sidebarFooter, collapsible, children, className, }: AppShellProps): react.JSX.Element;
1077
1135
 
1078
1136
  /**
1079
1137
  * 上下文数据源解析与候选列表(spec: chat-context-sources,设计决策 D1/D5):
@@ -1105,6 +1163,10 @@ type CallChatService = (name: string, params?: Record<string, unknown>) => Promi
1105
1163
  * 模型 chip(AnchoredPopover 列表,toolbarEnd 之前);contexts 配置
1106
1164
  * 且未注入调用方回调时启用内建 @ 提及 / + 菜单弹层,选中项追加为
1107
1165
  * 输入区上方的上下文 chips(受控:contextChips + onContextChipsChange)
1166
+ * - chrome DSL 渲染层(spec: chat-composer-on-chatinput):呈现层在
1167
+ * DSL 环境经宿主 ChatInput 组合渲染(非受控 + chat.composerSubmit
1168
+ * 桥接 + 冒泡同步 / 附件承接),无 renderer 或类型缺失时回退手写
1169
+ * 呈现(ComposerFallback),两条路径交互语义一致
1108
1170
  */
1109
1171
  interface ComposerProps {
1110
1172
  /** 发送回调;输入框在回调后清空 */
@@ -1126,6 +1188,15 @@ interface ComposerProps {
1126
1188
  /** 工具栏左 / 右渲染槽 */
1127
1189
  toolbarStart?: ReactNode;
1128
1190
  toolbarEnd?: ReactNode;
1191
+ /** footer 槽(spec: chat-composer-slots / Composer footer 槽):渲染在工具栏下方、以分隔线相隔;未提供不渲染 */
1192
+ composerFooter?: ReactNode;
1193
+ /**
1194
+ * 隐藏工具栏行(缺省 false):true 时工具栏行整体不渲染——
1195
+ * 内建 + 钮 / 附件钮 / 模型 chip / 发送钮与 toolbarStart / toolbarEnd
1196
+ * 槽一并抑制(footer 槽不受影响);Enter 发送保留,DSL 路径由
1197
+ * ChatInput 工具栏行零渲染承担
1198
+ */
1199
+ hideToolbar?: boolean;
1129
1200
  /** 词边界 `@` 输入触发:query 为 `@` 后文本,anchorRect 为弹层锚点 */
1130
1201
  onMentionTrigger?: (query: string, anchorRect: DOMRect) => void;
1131
1202
  /** "+" 按钮触发弹层入口 */
@@ -1152,7 +1223,7 @@ interface ComposerProps {
1152
1223
  /** service 引用解析出口(ChatServices.callService 透传) */
1153
1224
  callService?: CallChatService;
1154
1225
  }
1155
- declare function Composer({ onSend, streaming, onStop, placeholder, disabled, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, onMentionTrigger, onPlusMenu, models, model, onModelChange, contextSources, contextChips, onContextChipsChange, callService, }: ComposerProps): react.JSX.Element;
1226
+ declare function Composer({ onSend, streaming, onStop, placeholder, disabled, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, onMentionTrigger, onPlusMenu, models, model, onModelChange, contextSources, contextChips, onContextChipsChange, callService, composerFooter, hideToolbar, }: ComposerProps): react.JSX.Element;
1156
1227
 
1157
1228
  /**
1158
1229
  * ChatView(设计决策 D6):消息列表(useSyncExternalStore 订阅
@@ -1171,7 +1242,7 @@ declare function Composer({ onSend, streaming, onStop, placeholder, disabled, at
1171
1242
  * Composer 扩展 props(attachments / onAttachFiles / toolbar 槽 /
1172
1243
  * 提及与 "+" 触发等,见 ComposerProps)原样透传给内建 Composer。
1173
1244
  */
1174
- interface ChatViewProps extends Pick<ComposerProps, 'attachments' | 'onAttachmentsChange' | 'onAttachFiles' | 'onAttachmentClick' | 'toolbarStart' | 'toolbarEnd' | 'onMentionTrigger' | 'onPlusMenu'> {
1245
+ interface ChatViewProps extends Pick<ComposerProps, 'attachments' | 'onAttachmentsChange' | 'onAttachFiles' | 'onAttachmentClick' | 'toolbarStart' | 'toolbarEnd' | 'composerFooter' | 'hideToolbar' | 'onMentionTrigger' | 'onPlusMenu'> {
1175
1246
  store: ConversationStore;
1176
1247
  /** 注入后发送即驱动 turn;缺省时仅触发 onSend */
1177
1248
  transport?: ChatTransport;
@@ -1233,9 +1304,15 @@ interface ChatViewProps extends Pick<ComposerProps, 'attachments' | 'onAttachmen
1233
1304
  messageActions?: Array<BuiltinMessageAction | ChatMessageAction>;
1234
1305
  /** 全部消息动作(含内建)点击的并行通知(event 语义,不影响内建默认行为) */
1235
1306
  onMessageAction?: (actionId: string, message: ChatMessage) => void;
1307
+ /**
1308
+ * Composer 下方自定义内容槽(未提供不渲染):渲染在 Composer 之外、
1309
+ * 页面底部留白区内(空态 / 钉底两态一致),典型用途为免责声明、
1310
+ * 备案信息等弱提示行
1311
+ */
1312
+ composerBottom?: ReactNode;
1236
1313
  className?: string;
1237
1314
  }
1238
- declare function ChatView({ store, transport, onSend, safeRegistry, capabilities, permission, confirm, conversationId, user, params, greeting, subtitle, suggestions, className, onArtifact, onOpenArtifact, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, onMentionTrigger, onPlusMenu, models, model, onModelChange, modelPlacement, contexts, onContextsChange, callService, messageActions, onMessageAction, }: ChatViewProps): react.JSX.Element;
1315
+ declare function ChatView({ store, transport, onSend, safeRegistry, capabilities, permission, confirm, conversationId, user, params, greeting, subtitle, suggestions, className, onArtifact, onOpenArtifact, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, composerFooter, hideToolbar, onMentionTrigger, onPlusMenu, models, model, onModelChange, modelPlacement, contexts, onContextsChange, callService, messageActions, onMessageAction, composerBottom, }: ChatViewProps): react.JSX.Element;
1239
1316
 
1240
1317
  /**
1241
1318
  * ActivityTrace(spec: chat-activity-trace,设计决策 D1/D4):
@@ -1333,10 +1410,6 @@ interface MessageActionsProps {
1333
1410
  /** 全部动作(含内建)点击的并行通知 */
1334
1411
  onMessageAction?: (actionId: string, message: ChatMessage) => void;
1335
1412
  }
1336
- /** 动作图标名 → lucide 子集(白名单式,同菜单 MENU_ICONS 口径;未知名渲染占位图标,不抛错) */
1337
- declare const MESSAGE_ACTION_ICONS: Record<string, ComponentType<{
1338
- size?: number;
1339
- }>>;
1340
1413
  /** 收集消息的可复制文本(text / markdown part 按序拼接) */
1341
1414
  declare function collectMessageText(message: ChatMessage): string;
1342
1415
  declare function MessageActions({ message, actions, showRegenerate, onRegenerate, onEdit, onRetry, forceVisible, callService, onMessageAction, }: MessageActionsProps): react.JSX.Element | null;
@@ -1388,8 +1461,9 @@ declare function ChatLayout({ title, children }: ChatLayoutProps): react.JSX.Ele
1388
1461
  declare const CHAT_LAYOUT_TYPE = "chat";
1389
1462
  /**
1390
1463
  * 结构化 LayoutRegistry(兼容 @pactor-app/ui layout 层的 LayoutRegistry =
1391
- * Registry<LayoutComponent>):以结构化类型声明,避免对
1392
- * @pactor-app/ui 产生运行时依赖。
1464
+ * Registry<LayoutComponent>):结构化类型声明,调用方传入 ui layout 层
1465
+ * 的注册表即天然兼容(历史为零依赖约定而设;chat-icon-convergence 起
1466
+ * chat 正式依赖 ui kit,本结构化声明保留以收窄本文件的 API 面)。
1393
1467
  */
1394
1468
  interface ChatLayoutRegistry {
1395
1469
  has(name: string): boolean;
@@ -1398,4 +1472,4 @@ interface ChatLayoutRegistry {
1398
1472
  /** 注册 chat 布局(已注册时不覆盖,与 createLayoutRegistry 约定一致) */
1399
1473
  declare function registerChatLayout(layoutRegistry: ChatLayoutRegistry): void;
1400
1474
 
1401
- export { ActivityTrace, type ActivityTraceProps, AppShell, type AppShellProps, ArtifactPanel, type ArtifactPanelProps, type ArtifactPatch, ArtifactStore, type BuiltinMessageAction, CHAT_COMPONENT_TYPE, CHAT_DENIED_TYPE, CHAT_LAYOUT_TYPE, CHAT_SHELL_COMPONENT_TYPE, type CapabilityActionDeps, type CapabilityHandler, Chat, type ChatArtifact, type ChatAttachment, type ChatCapabilityRegistry, type ChatConfirm, type ChatConfirmRequest, type ChatContextItem, type ChatContextSource, ChatDenied, type ChatEvent, type ChatHeaderAction, type ChatInput, ChatLayout, type ChatLayoutProps, type ChatLayoutRegistry, type ChatMenuItem, type ChatMessage, type ChatMessageAction, type ChatModelOption, type ChatPart, type ChatPermissionChecker, type ChatProps, type ChatRole, type ChatRuntime, type ChatScope, type ChatServices, ChatServicesProvider, ChatShell, type ChatShellProps, ChatSidebarMenu, type ChatSuggestion, type ChatTransport, type ChatTurnResult, ChatView, type ChatViewProps, type ChatWorkspaceProps, type ChatWorkspaceServices, Composer, type ComposerProps, ConversationStore, type CreateChatRuntimeOptions, DEFAULT_CHAT_GREETING, EmptyState, type EmptyStateProps, MENU_ICONS, MESSAGE_ACTION_ICONS, type ManualChatDriver, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, type MessagePatch, type MessageStatus, type PartPatch, type PartRef, PartRenderer, type PartRendererProps, type PartStatus, type RunChatTurnOptions, type StreamingMode, type ToolCallStatus, type ToolTraceEntry, type UseChatAutoScrollOptions, type UseChatAutoScrollResult, type UseSmoothStreamTextOptions, applyChatEvent, buildChatScope, collectMessageText, createChatId, createChatRuntime, createChatWorkspace, createManualDriver, createSafeRegistry, detectStreamingMode, guardChatDsl, pairToolTraces, registerCapabilityAction, registerChatComponent, registerChatLayout, registerChatShellComponent, runChatTurn, runRegenerateTurn, useChatAutoScroll, useChatServices, useSidebarDrawer, useSmoothStreamText };
1475
+ export { ActivityTrace, type ActivityTraceProps, AppShell, type AppShellProps, ArtifactPanel, type ArtifactPanelProps, type ArtifactPatch, ArtifactStore, type BuiltinMessageAction, CHAT_COMPONENT_TYPE, CHAT_DENIED_TYPE, CHAT_LAYOUT_TYPE, CHAT_SHELL_COMPONENT_TYPE, type CapabilityActionDeps, type CapabilityHandler, Chat, type ChatArtifact, type ChatAttachment, type ChatCapabilityRegistry, type ChatConfirm, type ChatConfirmRequest, type ChatContextItem, type ChatContextSource, ChatDenied, type ChatEvent, type ChatHeaderAction, type ChatInput, ChatLayout, type ChatLayoutProps, type ChatLayoutRegistry, type ChatMenuItem, type ChatMessage, type ChatMessageAction, type ChatModelOption, type ChatPart, type ChatPermissionChecker, type ChatProps, type ChatRole, type ChatRuntime, type ChatScope, type ChatServices, ChatServicesProvider, ChatShell, type ChatShellProps, ChatSidebarMenu, type ChatSuggestion, type ChatTransport, type ChatTurnResult, ChatView, type ChatViewProps, type ChatWorkspaceProps, type ChatWorkspaceServices, Composer, type ComposerProps, ConversationStore, type CreateChatRuntimeOptions, DEFAULT_CHAT_GREETING, EmptyState, type EmptyStateProps, type ManualChatDriver, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, type MessagePatch, type MessageStatus, type PartPatch, type PartRef, PartRenderer, type PartRendererProps, type PartStatus, type RunChatTurnOptions, type StreamingMode, type ToolCallStatus, type ToolTraceEntry, type UseChatAutoScrollOptions, type UseChatAutoScrollResult, type UseSmoothStreamTextOptions, applyChatEvent, buildChatScope, collectMessageText, createChatId, createChatRuntime, createChatWorkspace, createManualDriver, createSafeRegistry, detectStreamingMode, guardChatDsl, pairToolTraces, registerCapabilityAction, registerChatComponent, registerChatLayout, registerChatShellComponent, runChatTurn, runRegenerateTurn, useChatAutoScroll, useChatServices, useSidebarDrawer, useSmoothStreamText };
package/dist/index.d.ts CHANGED
@@ -655,6 +655,11 @@ declare function useChatAutoScroll({ messageCount, lastContentLength, isStreamin
655
655
  * 数据以接口注入:greeting / subtitle / suggestions 均为受控 props;
656
656
  * 点击建议经 `onSuggestionClick` 回调交还调用方(ChatView 接入时
657
657
  * 复用 Composer 的同一条发送路径)。
658
+ *
659
+ * chrome DSL 渲染层(spec: chat-chrome-dsl):元素层在页面运行时内
660
+ * 优先经 ChromeSlot 以宿主组件(Typography / Text / Button)DSL 组合
661
+ * 渲染,建议点击经 chat.sendSuggestion 内建动作接回同一发送路径;
662
+ * 无 renderer 环境或类型缺失时回退下方手写实现(EmptyStateFallback)。
658
663
  */
659
664
  type ChatSuggestion = string | {
660
665
  label: string;
@@ -738,6 +743,10 @@ interface ChatWorkspaceServices {
738
743
  /** Composer 工具栏左 / 右槽(ReactNode 闭包槽,纯 React 与 DSL 场景均可用) */
739
744
  toolbarStart?: ReactNode;
740
745
  toolbarEnd?: ReactNode;
746
+ /** Composer footer 槽(spec: chat-composer-slots;ReactNode 闭包槽) */
747
+ composerFooter?: ReactNode;
748
+ /** Composer 下方自定义内容槽(ReactNode 闭包槽;渲染在 Composer 之外正下方,未提供不渲染) */
749
+ composerBottom?: ReactNode;
741
750
  /** 工作区头部右侧扩展区(提供 title 或 headerExtra 时渲染头部) */
742
751
  headerExtra?: ReactNode;
743
752
  }
@@ -764,8 +773,20 @@ interface ChatWorkspaceProps {
764
773
  * 包裹工作区(侧栏 + 移动端抽屉)。仅页面运行时上下文内有效。
765
774
  */
766
775
  sidebar?: DslNode;
776
+ /** Composer 工具栏左端 DslNode 槽(与服务注入的 toolbarStart 先后渲染,服务槽在先) */
777
+ toolbarStart?: DslNode;
767
778
  /** Composer 工具栏右端 DslNode 槽(与服务注入的 toolbarEnd 先后渲染) */
768
779
  toolbarEnd?: DslNode;
780
+ /** Composer footer DslNode 槽(spec: chat-composer-slots;与服务注入的 composerFooter 先后渲染,服务槽在先) */
781
+ composerFooter?: DslNode;
782
+ /** Composer 下方自定义内容 DslNode 槽(与服务注入的 composerBottom 先后渲染,服务槽在先;未提供不渲染) */
783
+ composerBottom?: DslNode;
784
+ /**
785
+ * 隐藏 Composer 工具栏行(缺省 false):true 时工具栏行整体不渲染,
786
+ * toolbarStart / toolbarEnd 槽一并抑制(composerFooter 槽不受影响),
787
+ * Enter 发送保留
788
+ */
789
+ hideToolbar?: boolean;
769
790
  /**
770
791
  * 产出物面板受控 props(spec: chat-artifact-panel,决策 D2):
771
792
  * 任一提供即全受控;都未提供时由内部 / 注入的 ArtifactStore 驱动
@@ -874,7 +895,7 @@ interface ChatProps {
874
895
  conversationId?: string;
875
896
  /** 注入 dsl part 作用域 params */
876
897
  params?: Record<string, unknown>;
877
- /** 传 false 关闭 header;缺省渲染(header 槽整体替换 > title + headerExtra 内建 header) */
898
+ /** 传 false 关闭 header;缺省按内容自动渲染(header 槽整体替换 > title + headerExtra / headerActions / header 位模型 chip 内建 header,均无内容时 header 节点不渲染) */
878
899
  showHeader?: boolean;
879
900
  /** 左侧菜单数据;提供时以 AppShell 承载内建侧栏 */
880
901
  menu?: ChatMenuItem[];
@@ -882,6 +903,27 @@ interface ChatProps {
882
903
  activeMenuKey?: string;
883
904
  /** 侧栏槽:提供时替代内建菜单侧栏 */
884
905
  sidebar?: DslNode | ReactNode;
906
+ /**
907
+ * Composer 槽(spec: chat-composer-slots / Composer 槽配置):
908
+ * toolbarStart 工具栏左端 / toolbarEnd 工具栏右端(发送钮之前)/
909
+ * composerFooter footer 区域(工具栏下方、带分隔线);
910
+ * 与服务注入的同名槽并存时服务槽在先
911
+ */
912
+ toolbarStart?: DslNode | ReactNode;
913
+ toolbarEnd?: DslNode | ReactNode;
914
+ composerFooter?: DslNode | ReactNode;
915
+ /**
916
+ * Composer 下方自定义内容槽(DslNode | ReactNode):
917
+ * 渲染在 Composer 之外正下方(页面底部留白区内),
918
+ * 与服务注入的同名槽并存时服务槽在先;未提供不渲染
919
+ */
920
+ composerBottom?: DslNode | ReactNode;
921
+ /**
922
+ * 隐藏 Composer 工具栏行(缺省 false;DSL 可序列化标量):
923
+ * true 时工具栏行整体不渲染,toolbarStart / toolbarEnd 槽一并抑制
924
+ * (composerFooter 槽不受影响),Enter 发送保留
925
+ */
926
+ hideToolbar?: boolean;
885
927
  /** 内建 header 标题右侧槽 */
886
928
  headerExtra?: DslNode | ReactNode;
887
929
  /** header 槽:整体替换内建 header */
@@ -941,12 +983,16 @@ interface ChatProps {
941
983
  /** 菜单项点击回调(disabled 项不触发) */
942
984
  onMenuSelect?: (key: string, item: ChatMenuItem) => void;
943
985
  }
944
- /** 菜单图标名 → lucide 子集(白名单式,未知名渲染占位圆点,不抛错) */
945
- declare const MENU_ICONS: Record<string, ComponentType<{
946
- size?: number;
947
- strokeWidth?: number;
948
- }>>;
949
- /** 内建侧栏:menu 数据驱动的菜单(分组标题 + 图标 + badge + disabled);ChatShell 同款复用 */
986
+ /**
987
+ * 菜单图标名(spec: chat-icon-convergence):契约取值(plus / chat /
988
+ * history / settings / star / search / user / folder)直接作为 ui Icon
989
+ * 白名单名渲染,未知名由 ui Icon 渲染占位图标,不抛错。
990
+ * 白名单曾映射 lucide 子集(MENU_ICONS),收敛后删除。
991
+ */
992
+ /** 内建侧栏:menu 数据驱动的菜单(分组标题 + 图标 + badge + disabled);ChatShell 同款复用。
993
+ * chrome DSL 渲染层(spec: chat-on-ui-components):DSL 环境优先经宿主
994
+ * Menu 组件组合渲染(chat.menuSelect 接回同一传播与 drawer close),
995
+ * 无 renderer / 类型缺失时回退下方手写菜单 */
950
996
  declare function ChatSidebarMenu({ menu, activeMenuKey, onMenuSelect, }: {
951
997
  menu: ChatMenuItem[];
952
998
  activeMenuKey?: string;
@@ -960,7 +1006,7 @@ declare function ChatSidebarMenu({ menu, activeMenuKey, onMenuSelect, }: {
960
1006
  * 「未配置聊天服务」提示并 console.warn,不抛错。组合逻辑与
961
1007
  * createChatWorkspace 共用内部 ChatComposition(决策 D5)。
962
1008
  */
963
- declare function Chat({ title, greeting, subtitle, suggestions, conversationId, params, showHeader, menu, activeMenuKey, sidebar, headerExtra, header, headerActions, editableTitle, onExport, onThemeChange, onClear, onTitleChange, models, model, onModelChange, modelPlacement, contexts, onContextsChange, messageActions, onMessageAction, artifact, panelOpen, onPanelClose, inspector, onArtifact, onOpenArtifact, className, onSend, onMenuSelect, }: ChatProps): ReactNode;
1009
+ declare function Chat({ title, greeting, subtitle, suggestions, conversationId, params, showHeader, menu, activeMenuKey, sidebar, toolbarStart, toolbarEnd, composerFooter, composerBottom, hideToolbar, headerExtra, header, headerActions, editableTitle, onExport, onThemeChange, onClear, onTitleChange, models, model, onModelChange, modelPlacement, contexts, onContextsChange, messageActions, onMessageAction, artifact, panelOpen, onPanelClose, inspector, onArtifact, onOpenArtifact, className, onSend, onMenuSelect, }: ChatProps): ReactNode;
964
1010
  /** Chat 的 DSL 组件类型名 */
965
1011
  declare const CHAT_COMPONENT_TYPE = "Chat";
966
1012
  /**
@@ -1036,6 +1082,16 @@ interface ArtifactPanelProps {
1036
1082
  }
1037
1083
  declare function ArtifactPanel({ artifact, inspector, onClose, safeRegistry, user, className, }: ArtifactPanelProps): ReactNode;
1038
1084
 
1085
+ /**
1086
+ * 侧栏抽屉 context(spec: chat-app-shell):侧栏内容(如导航项)在导航后
1087
+ * 调用 `close()` 关闭移动端抽屉;不在 AppShell 内时返回 null,
1088
+ * 调用方以可选链安全调用(`drawer?.close()`),不抛错。
1089
+ * `collapsed` 为桌面折叠(icon rail)状态(决策 D3):侧栏内容可据此
1090
+ * 降级为纯图标展示(如菜单项以 title 兜底可访问名)。
1091
+ *
1092
+ * 实现为 ui Sidebar 的 context 转发(chat-on-ui-sidebar):AppShell
1093
+ * 内部渲染 ui Sidebar,hook 签名与语义保持不变,调用方零改动。
1094
+ */
1039
1095
  declare function useSidebarDrawer(): {
1040
1096
  close: () => void;
1041
1097
  collapsed: boolean;
@@ -1068,12 +1124,14 @@ interface AppShellProps {
1068
1124
  /**
1069
1125
  * AppShell(spec: chat-app-shell):聊天工作区应用外壳 = 侧栏插槽 + 主区。
1070
1126
  *
1071
- * 桌面(≥768px):侧栏与主区在 flex 行内同级排列;
1072
- * 移动端(<768px):侧栏退出文档流变为左侧覆盖抽屉(遮罩 + 顶栏菜单按钮)。
1073
- * 布局切换全部在 styles.css 媒体查询(`.pactor-chat-shell*`)中表达,
1074
- * JS 只拥有抽屉开合状态 `drawerOpen`。
1127
+ * 实现为 ui Sidebar 的薄封装(spec: chat-on-ui-sidebar):桌面(≥768px)
1128
+ * 侧栏与主区 flex 同行;移动端(<768px)侧栏变为覆盖抽屉(遮罩 +
1129
+ * 顶栏菜单按钮);折叠 / 抽屉 / inert 等交互全部由 ui Sidebar 承担,
1130
+ * chat 侧只挂 `pactor-chat-shell` 类做 `--sidebar*` → `--pactor-chat-*`
1131
+ * 令牌映射(皮肤唯一入口仍为 --pactor-chat-*,见 styles.css)与
1132
+ * 高度语义(h-full 填满父容器,嵌入契约)。
1075
1133
  */
1076
- declare function AppShell({ sidebar, brand, locationKey, sidebarFooter, collapsible, children, className }: AppShellProps): react.JSX.Element;
1134
+ declare function AppShell({ sidebar, brand, locationKey, sidebarFooter, collapsible, children, className, }: AppShellProps): react.JSX.Element;
1077
1135
 
1078
1136
  /**
1079
1137
  * 上下文数据源解析与候选列表(spec: chat-context-sources,设计决策 D1/D5):
@@ -1105,6 +1163,10 @@ type CallChatService = (name: string, params?: Record<string, unknown>) => Promi
1105
1163
  * 模型 chip(AnchoredPopover 列表,toolbarEnd 之前);contexts 配置
1106
1164
  * 且未注入调用方回调时启用内建 @ 提及 / + 菜单弹层,选中项追加为
1107
1165
  * 输入区上方的上下文 chips(受控:contextChips + onContextChipsChange)
1166
+ * - chrome DSL 渲染层(spec: chat-composer-on-chatinput):呈现层在
1167
+ * DSL 环境经宿主 ChatInput 组合渲染(非受控 + chat.composerSubmit
1168
+ * 桥接 + 冒泡同步 / 附件承接),无 renderer 或类型缺失时回退手写
1169
+ * 呈现(ComposerFallback),两条路径交互语义一致
1108
1170
  */
1109
1171
  interface ComposerProps {
1110
1172
  /** 发送回调;输入框在回调后清空 */
@@ -1126,6 +1188,15 @@ interface ComposerProps {
1126
1188
  /** 工具栏左 / 右渲染槽 */
1127
1189
  toolbarStart?: ReactNode;
1128
1190
  toolbarEnd?: ReactNode;
1191
+ /** footer 槽(spec: chat-composer-slots / Composer footer 槽):渲染在工具栏下方、以分隔线相隔;未提供不渲染 */
1192
+ composerFooter?: ReactNode;
1193
+ /**
1194
+ * 隐藏工具栏行(缺省 false):true 时工具栏行整体不渲染——
1195
+ * 内建 + 钮 / 附件钮 / 模型 chip / 发送钮与 toolbarStart / toolbarEnd
1196
+ * 槽一并抑制(footer 槽不受影响);Enter 发送保留,DSL 路径由
1197
+ * ChatInput 工具栏行零渲染承担
1198
+ */
1199
+ hideToolbar?: boolean;
1129
1200
  /** 词边界 `@` 输入触发:query 为 `@` 后文本,anchorRect 为弹层锚点 */
1130
1201
  onMentionTrigger?: (query: string, anchorRect: DOMRect) => void;
1131
1202
  /** "+" 按钮触发弹层入口 */
@@ -1152,7 +1223,7 @@ interface ComposerProps {
1152
1223
  /** service 引用解析出口(ChatServices.callService 透传) */
1153
1224
  callService?: CallChatService;
1154
1225
  }
1155
- declare function Composer({ onSend, streaming, onStop, placeholder, disabled, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, onMentionTrigger, onPlusMenu, models, model, onModelChange, contextSources, contextChips, onContextChipsChange, callService, }: ComposerProps): react.JSX.Element;
1226
+ declare function Composer({ onSend, streaming, onStop, placeholder, disabled, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, onMentionTrigger, onPlusMenu, models, model, onModelChange, contextSources, contextChips, onContextChipsChange, callService, composerFooter, hideToolbar, }: ComposerProps): react.JSX.Element;
1156
1227
 
1157
1228
  /**
1158
1229
  * ChatView(设计决策 D6):消息列表(useSyncExternalStore 订阅
@@ -1171,7 +1242,7 @@ declare function Composer({ onSend, streaming, onStop, placeholder, disabled, at
1171
1242
  * Composer 扩展 props(attachments / onAttachFiles / toolbar 槽 /
1172
1243
  * 提及与 "+" 触发等,见 ComposerProps)原样透传给内建 Composer。
1173
1244
  */
1174
- interface ChatViewProps extends Pick<ComposerProps, 'attachments' | 'onAttachmentsChange' | 'onAttachFiles' | 'onAttachmentClick' | 'toolbarStart' | 'toolbarEnd' | 'onMentionTrigger' | 'onPlusMenu'> {
1245
+ interface ChatViewProps extends Pick<ComposerProps, 'attachments' | 'onAttachmentsChange' | 'onAttachFiles' | 'onAttachmentClick' | 'toolbarStart' | 'toolbarEnd' | 'composerFooter' | 'hideToolbar' | 'onMentionTrigger' | 'onPlusMenu'> {
1175
1246
  store: ConversationStore;
1176
1247
  /** 注入后发送即驱动 turn;缺省时仅触发 onSend */
1177
1248
  transport?: ChatTransport;
@@ -1233,9 +1304,15 @@ interface ChatViewProps extends Pick<ComposerProps, 'attachments' | 'onAttachmen
1233
1304
  messageActions?: Array<BuiltinMessageAction | ChatMessageAction>;
1234
1305
  /** 全部消息动作(含内建)点击的并行通知(event 语义,不影响内建默认行为) */
1235
1306
  onMessageAction?: (actionId: string, message: ChatMessage) => void;
1307
+ /**
1308
+ * Composer 下方自定义内容槽(未提供不渲染):渲染在 Composer 之外、
1309
+ * 页面底部留白区内(空态 / 钉底两态一致),典型用途为免责声明、
1310
+ * 备案信息等弱提示行
1311
+ */
1312
+ composerBottom?: ReactNode;
1236
1313
  className?: string;
1237
1314
  }
1238
- declare function ChatView({ store, transport, onSend, safeRegistry, capabilities, permission, confirm, conversationId, user, params, greeting, subtitle, suggestions, className, onArtifact, onOpenArtifact, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, onMentionTrigger, onPlusMenu, models, model, onModelChange, modelPlacement, contexts, onContextsChange, callService, messageActions, onMessageAction, }: ChatViewProps): react.JSX.Element;
1315
+ declare function ChatView({ store, transport, onSend, safeRegistry, capabilities, permission, confirm, conversationId, user, params, greeting, subtitle, suggestions, className, onArtifact, onOpenArtifact, attachments, onAttachmentsChange, onAttachFiles, onAttachmentClick, toolbarStart, toolbarEnd, composerFooter, hideToolbar, onMentionTrigger, onPlusMenu, models, model, onModelChange, modelPlacement, contexts, onContextsChange, callService, messageActions, onMessageAction, composerBottom, }: ChatViewProps): react.JSX.Element;
1239
1316
 
1240
1317
  /**
1241
1318
  * ActivityTrace(spec: chat-activity-trace,设计决策 D1/D4):
@@ -1333,10 +1410,6 @@ interface MessageActionsProps {
1333
1410
  /** 全部动作(含内建)点击的并行通知 */
1334
1411
  onMessageAction?: (actionId: string, message: ChatMessage) => void;
1335
1412
  }
1336
- /** 动作图标名 → lucide 子集(白名单式,同菜单 MENU_ICONS 口径;未知名渲染占位图标,不抛错) */
1337
- declare const MESSAGE_ACTION_ICONS: Record<string, ComponentType<{
1338
- size?: number;
1339
- }>>;
1340
1413
  /** 收集消息的可复制文本(text / markdown part 按序拼接) */
1341
1414
  declare function collectMessageText(message: ChatMessage): string;
1342
1415
  declare function MessageActions({ message, actions, showRegenerate, onRegenerate, onEdit, onRetry, forceVisible, callService, onMessageAction, }: MessageActionsProps): react.JSX.Element | null;
@@ -1388,8 +1461,9 @@ declare function ChatLayout({ title, children }: ChatLayoutProps): react.JSX.Ele
1388
1461
  declare const CHAT_LAYOUT_TYPE = "chat";
1389
1462
  /**
1390
1463
  * 结构化 LayoutRegistry(兼容 @pactor-app/ui layout 层的 LayoutRegistry =
1391
- * Registry<LayoutComponent>):以结构化类型声明,避免对
1392
- * @pactor-app/ui 产生运行时依赖。
1464
+ * Registry<LayoutComponent>):结构化类型声明,调用方传入 ui layout 层
1465
+ * 的注册表即天然兼容(历史为零依赖约定而设;chat-icon-convergence 起
1466
+ * chat 正式依赖 ui kit,本结构化声明保留以收窄本文件的 API 面)。
1393
1467
  */
1394
1468
  interface ChatLayoutRegistry {
1395
1469
  has(name: string): boolean;
@@ -1398,4 +1472,4 @@ interface ChatLayoutRegistry {
1398
1472
  /** 注册 chat 布局(已注册时不覆盖,与 createLayoutRegistry 约定一致) */
1399
1473
  declare function registerChatLayout(layoutRegistry: ChatLayoutRegistry): void;
1400
1474
 
1401
- export { ActivityTrace, type ActivityTraceProps, AppShell, type AppShellProps, ArtifactPanel, type ArtifactPanelProps, type ArtifactPatch, ArtifactStore, type BuiltinMessageAction, CHAT_COMPONENT_TYPE, CHAT_DENIED_TYPE, CHAT_LAYOUT_TYPE, CHAT_SHELL_COMPONENT_TYPE, type CapabilityActionDeps, type CapabilityHandler, Chat, type ChatArtifact, type ChatAttachment, type ChatCapabilityRegistry, type ChatConfirm, type ChatConfirmRequest, type ChatContextItem, type ChatContextSource, ChatDenied, type ChatEvent, type ChatHeaderAction, type ChatInput, ChatLayout, type ChatLayoutProps, type ChatLayoutRegistry, type ChatMenuItem, type ChatMessage, type ChatMessageAction, type ChatModelOption, type ChatPart, type ChatPermissionChecker, type ChatProps, type ChatRole, type ChatRuntime, type ChatScope, type ChatServices, ChatServicesProvider, ChatShell, type ChatShellProps, ChatSidebarMenu, type ChatSuggestion, type ChatTransport, type ChatTurnResult, ChatView, type ChatViewProps, type ChatWorkspaceProps, type ChatWorkspaceServices, Composer, type ComposerProps, ConversationStore, type CreateChatRuntimeOptions, DEFAULT_CHAT_GREETING, EmptyState, type EmptyStateProps, MENU_ICONS, MESSAGE_ACTION_ICONS, type ManualChatDriver, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, type MessagePatch, type MessageStatus, type PartPatch, type PartRef, PartRenderer, type PartRendererProps, type PartStatus, type RunChatTurnOptions, type StreamingMode, type ToolCallStatus, type ToolTraceEntry, type UseChatAutoScrollOptions, type UseChatAutoScrollResult, type UseSmoothStreamTextOptions, applyChatEvent, buildChatScope, collectMessageText, createChatId, createChatRuntime, createChatWorkspace, createManualDriver, createSafeRegistry, detectStreamingMode, guardChatDsl, pairToolTraces, registerCapabilityAction, registerChatComponent, registerChatLayout, registerChatShellComponent, runChatTurn, runRegenerateTurn, useChatAutoScroll, useChatServices, useSidebarDrawer, useSmoothStreamText };
1475
+ export { ActivityTrace, type ActivityTraceProps, AppShell, type AppShellProps, ArtifactPanel, type ArtifactPanelProps, type ArtifactPatch, ArtifactStore, type BuiltinMessageAction, CHAT_COMPONENT_TYPE, CHAT_DENIED_TYPE, CHAT_LAYOUT_TYPE, CHAT_SHELL_COMPONENT_TYPE, type CapabilityActionDeps, type CapabilityHandler, Chat, type ChatArtifact, type ChatAttachment, type ChatCapabilityRegistry, type ChatConfirm, type ChatConfirmRequest, type ChatContextItem, type ChatContextSource, ChatDenied, type ChatEvent, type ChatHeaderAction, type ChatInput, ChatLayout, type ChatLayoutProps, type ChatLayoutRegistry, type ChatMenuItem, type ChatMessage, type ChatMessageAction, type ChatModelOption, type ChatPart, type ChatPermissionChecker, type ChatProps, type ChatRole, type ChatRuntime, type ChatScope, type ChatServices, ChatServicesProvider, ChatShell, type ChatShellProps, ChatSidebarMenu, type ChatSuggestion, type ChatTransport, type ChatTurnResult, ChatView, type ChatViewProps, type ChatWorkspaceProps, type ChatWorkspaceServices, Composer, type ComposerProps, ConversationStore, type CreateChatRuntimeOptions, DEFAULT_CHAT_GREETING, EmptyState, type EmptyStateProps, type ManualChatDriver, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, type MessagePatch, type MessageStatus, type PartPatch, type PartRef, PartRenderer, type PartRendererProps, type PartStatus, type RunChatTurnOptions, type StreamingMode, type ToolCallStatus, type ToolTraceEntry, type UseChatAutoScrollOptions, type UseChatAutoScrollResult, type UseSmoothStreamTextOptions, applyChatEvent, buildChatScope, collectMessageText, createChatId, createChatRuntime, createChatWorkspace, createManualDriver, createSafeRegistry, detectStreamingMode, guardChatDsl, pairToolTraces, registerCapabilityAction, registerChatComponent, registerChatLayout, registerChatShellComponent, runChatTurn, runRegenerateTurn, useChatAutoScroll, useChatServices, useSidebarDrawer, useSmoothStreamText };