@fv-ui/ai-chat 0.11.0 → 0.12.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.ts CHANGED
@@ -15,12 +15,145 @@ interface CreateMarkdownOptions {
15
15
  mdPlugins?: MdPlugin[];
16
16
  }
17
17
 
18
+ /**
19
+ * zh-CN 语言包(默认语言)。
20
+ * 值与各组件历史硬编码文案逐字一致(全角标点、省略号均保持),保证零配置升级无任何视觉变化。
21
+ * 结构即 LocaleMessages 源型;en-US 以 satisfies 同构对齐。
22
+ */
23
+ declare const zhCN: {
24
+ common: {
25
+ copy: string;
26
+ delete: string;
27
+ confirm: string;
28
+ cancel: string;
29
+ retry: string;
30
+ close: string;
31
+ preview: string;
32
+ clear: string;
33
+ stop: string;
34
+ send: string;
35
+ download: string;
36
+ fullscreen: string;
37
+ collapse: string;
38
+ expand: string;
39
+ };
40
+ thinking: {
41
+ start: string;
42
+ thinking: string;
43
+ end: string;
44
+ error: string;
45
+ };
46
+ sender: {
47
+ clear: string;
48
+ stop: string;
49
+ send: string;
50
+ speech: string;
51
+ recordCancel: string;
52
+ recordConfirm: string;
53
+ micUnavailable: string;
54
+ };
55
+ editorSender: {
56
+ clear: string;
57
+ stop: string;
58
+ send: string;
59
+ inputPlaceholder: string;
60
+ selectTagTitle: string;
61
+ loading: string;
62
+ tagTip: string;
63
+ };
64
+ attachments: {
65
+ add: string;
66
+ retry: string;
67
+ };
68
+ filesCard: {
69
+ remove: string;
70
+ };
71
+ conversations: {
72
+ menuLabel: string;
73
+ rename: string;
74
+ delete: string;
75
+ renameTitle: string;
76
+ renamePrompt: string;
77
+ renamePlaceholder: string;
78
+ deleteTitle: string;
79
+ deleteConfirm: string;
80
+ };
81
+ scroll: {
82
+ toBottom: string;
83
+ };
84
+ aiChat: {
85
+ modelPlaceholder: string;
86
+ adapterMissing: string;
87
+ generateFailed: string;
88
+ exportUser: string;
89
+ exportAssistant: string;
90
+ };
91
+ aiMessage: {
92
+ copy: string;
93
+ regenerate: string;
94
+ prevBranch: string;
95
+ nextBranch: string;
96
+ defaultUserName: string;
97
+ defaultAssistantName: string;
98
+ querying: string;
99
+ queried: string;
100
+ generateFailed: string;
101
+ };
102
+ aiArtifacts: {
103
+ copy: string;
104
+ download: string;
105
+ fullscreen: string;
106
+ close: string;
107
+ };
108
+ chat: {
109
+ fileTag: string;
110
+ fileImageTag: string;
111
+ filesSystemPrompt: string;
112
+ toolDuration: string;
113
+ continuePrompt: string;
114
+ };
115
+ errors: {
116
+ requestFailed: string;
117
+ sessionIdMissing: string;
118
+ noBody: string;
119
+ generateFailed: string;
120
+ recordUnsupported: string;
121
+ speechError: string;
122
+ };
123
+ };
124
+
125
+ /**
126
+ * 语言包类型:以 zh-CN 为源型推导(单一事实来源,勿手写接口——新增 key 只改 zh-CN,en 编译期报缺)。
127
+ */
128
+ type LocaleMessages = typeof zhCN;
129
+
130
+ /** en-US 语言包(satisfies LocaleMessages:key 集合与 zh-CN 编译期对齐) */
131
+ declare const enUS: LocaleMessages;
132
+
133
+ /** 一层 Partial 即够(语言包结构固定两层:分组.文案) */
134
+ type DeepPartialLocale = {
135
+ [K in keyof LocaleMessages]?: Partial<LocaleMessages[K]>;
136
+ };
137
+ /** 组件 locale prop 形态:内置语言名字符串(整包切换)或部分文案对象(在基底上深合并) */
138
+ type LocaleInput = string | DeepPartialLocale;
139
+ /**
140
+ * 全局语言设置。
141
+ * 字符串选内置包(未知回落 zh-CN);对象视为**完整语言包**(消费方自建语言的主入口,
142
+ * 与组件 prop 的"部分覆盖"语义有意不同:全局是定基准,prop 是在基准上微调)。
143
+ */
144
+ declare function configureLocale(locale: 'zh-CN' | 'en-US' | LocaleMessages): void;
145
+
18
146
  type __VLS_Props$h = {
19
147
  content: string;
20
148
  mdPlugins?: CreateMarkdownOptions['mdPlugins'];
21
149
  highlight?: (str: string, lang: string) => string;
22
150
  /** 打字机模式下由父组件控制渲染策略,本组件保留透传占位 */
23
151
  isTyping?: boolean;
152
+ /** 代码块「预览」触发语言(fence 原始 lang 命中列表时,代码块右上角注入
153
+ * data-fv-code-trigger 按钮;点击行为由消费方事件委托实现,如 AiChat 打开 Artifacts 面板) */
154
+ codeTriggerLangs?: string[];
155
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
156
+ locale?: LocaleInput;
24
157
  };
25
158
  declare const __VLS_export$h: vue.DefineComponent<__VLS_Props$h, {
26
159
  getHtml: () => string;
@@ -41,6 +174,10 @@ type __VLS_Props$g = {
41
174
  interval?: number;
42
175
  suffix?: string;
43
176
  };
177
+ /** 代码块「预览」触发语言(isMarkdown 模式透传 Markdown;命中语言的代码块注入触发按钮) */
178
+ codeTriggerLangs?: string[];
179
+ /** 语言包,透传内嵌 Markdown 的代码块「预览」按钮文案 */
180
+ locale?: LocaleInput;
44
181
  };
45
182
  declare function interrupt$1(): void;
46
183
  declare function continueTy$1(): void;
@@ -182,6 +319,7 @@ declare const __VLS_base$e: vue.DefineComponent<__VLS_Props$f, {
182
319
  onWriting?: (() => any) | undefined;
183
320
  "onAvatar-error"?: ((event: Event) => any) | undefined;
184
321
  }>, {
322
+ loading: boolean;
185
323
  content: string;
186
324
  isMarkdown: boolean;
187
325
  isFog: boolean | {
@@ -191,7 +329,6 @@ declare const __VLS_base$e: vue.DefineComponent<__VLS_Props$f, {
191
329
  typing: boolean | TypingConfig;
192
330
  shape: "round" | "corner";
193
331
  placement: "start" | "end";
194
- loading: boolean;
195
332
  variant: "filled" | "borderless" | "outlined" | "shadow";
196
333
  avatar: string;
197
334
  avatarSize: number | "" | "default" | "small" | "large";
@@ -246,6 +383,8 @@ type __VLS_Props$e = {
246
383
  * - number[]:仅指定索引上抛(无效索引过滤并 console.warn)
247
384
  */
248
385
  triggerIndices?: 'only-last' | 'all' | number[];
386
+ /** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
387
+ locale?: LocaleInput;
249
388
  };
250
389
  declare function scrollToTop$1(): void;
251
390
  declare function scrollToBottom$1(): void;
@@ -291,6 +430,7 @@ declare const __VLS_base$d: vue.DefineComponent<__VLS_Props$e, {
291
430
  }, string, vue.PublicProps, Readonly<__VLS_Props$e> & Readonly<{
292
431
  onComplete?: ((instance: unknown, index: number) => any) | undefined;
293
432
  }>, {
433
+ locale: LocaleInput;
294
434
  list: BubbleListItemProps[];
295
435
  maxHeight: string;
296
436
  alwaysShowScrollbar: boolean;
@@ -359,6 +499,8 @@ type __VLS_Props$d = {
359
499
  allowSpeech?: boolean;
360
500
  /** 允许空内容提交(附件场景:只发文件不输文字时提交按钮保持可点) */
361
501
  allowEmptySubmit?: boolean;
502
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
503
+ locale?: LocaleInput;
362
504
  };
363
505
  declare function submit$1(): void;
364
506
  declare function cancel$1(): void;
@@ -401,27 +543,27 @@ declare const __VLS_base$c: vue.DefineComponent<__VLS_Props$d, {
401
543
  openHeader: typeof openHeader$2;
402
544
  closeHeader: typeof closeHeader$2;
403
545
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
546
+ cancel: () => any;
404
547
  submit: (value: string) => any;
405
548
  trigger: (keyword: string, visible: boolean) => any;
406
549
  "update:modelValue": (value: string) => any;
407
- cancel: () => any;
408
550
  change: (value: string) => any;
409
551
  "recording-change": (recording: boolean) => any;
410
552
  "paste-file": (file: File) => any;
411
553
  "update:triggerPopoverVisible": (value: boolean) => any;
412
554
  }, string, vue.PublicProps, Readonly<__VLS_Props$d> & Readonly<{
555
+ onCancel?: (() => any) | undefined;
413
556
  onSubmit?: ((value: string) => any) | undefined;
414
557
  onTrigger?: ((keyword: string, visible: boolean) => any) | undefined;
415
558
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
416
- onCancel?: (() => any) | undefined;
417
559
  onChange?: ((value: string) => any) | undefined;
418
560
  "onRecording-change"?: ((recording: boolean) => any) | undefined;
419
561
  "onPaste-file"?: ((file: File) => any) | undefined;
420
562
  "onUpdate:triggerPopoverVisible"?: ((value: boolean) => any) | undefined;
421
563
  }>, {
564
+ loading: boolean;
422
565
  shadow: boolean;
423
566
  round: boolean;
424
- loading: boolean;
425
567
  variant: "default" | "updown";
426
568
  disabled: boolean;
427
569
  modelValue: string;
@@ -480,6 +622,8 @@ type __VLS_Props$c = {
480
622
  customTrigger?: MentionCustomTrigger[];
481
623
  /** 异步候选:存在时防抖 300ms 拉取(后端负责过滤) */
482
624
  asyncMatchFun?: (search: string) => Promise<MentionUserInfo[]>;
625
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
626
+ locale?: LocaleInput;
483
627
  };
484
628
  declare function submit(): void;
485
629
  declare function cancel(): void;
@@ -509,26 +653,27 @@ declare const __VLS_base$b: vue.DefineComponent<__VLS_Props$c, {
509
653
  setUserTag: typeof setUserTag$1;
510
654
  setCustomTag: typeof setCustomTag$1;
511
655
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
656
+ cancel: () => any;
512
657
  submit: (value: string) => any;
513
658
  trigger: (keyword: string, visible: boolean) => any;
514
659
  "update:modelValue": (value: string) => any;
515
- cancel: () => any;
516
660
  change: (value: string) => any;
517
661
  "recording-change": (recording: boolean) => any;
518
662
  "paste-file": (file: File) => any;
519
663
  "update:triggerPopoverVisible": (value: boolean) => any;
520
664
  "show-at-dialog": (visible: boolean) => any;
521
665
  }, string, vue.PublicProps, Readonly<__VLS_Props$c> & Readonly<{
666
+ onCancel?: (() => any) | undefined;
522
667
  onSubmit?: ((value: string) => any) | undefined;
523
668
  onTrigger?: ((keyword: string, visible: boolean) => any) | undefined;
524
669
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
525
- onCancel?: (() => any) | undefined;
526
670
  onChange?: ((value: string) => any) | undefined;
527
671
  "onRecording-change"?: ((recording: boolean) => any) | undefined;
528
672
  "onPaste-file"?: ((file: File) => any) | undefined;
529
673
  "onUpdate:triggerPopoverVisible"?: ((value: boolean) => any) | undefined;
530
674
  "onShow-at-dialog"?: ((visible: boolean) => any) | undefined;
531
675
  }>, {
676
+ locale: LocaleInput;
532
677
  modelValue: string;
533
678
  userList: MentionUserInfo[];
534
679
  customTrigger: MentionCustomTrigger[];
@@ -659,6 +804,8 @@ type __VLS_Props$b = {
659
804
  asyncMatchFun?: (search: string) => Promise<EditorUser[]>;
660
805
  /** 自定义弹窗:true 时不弹内置选择弹窗,仅上抛 show-select-dialog 由外部接管 */
661
806
  customDialog?: boolean;
807
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
808
+ locale?: LocaleInput;
662
809
  };
663
810
  /**
664
811
  * 编辑器 API:state 为数据源,insert/update/delete/append 为对外操作面。
@@ -758,15 +905,15 @@ declare const __VLS_base$a: vue.DefineComponent<__VLS_Props$b, {
758
905
  opNode: typeof opNode;
759
906
  chatState: typeof chatState;
760
907
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
761
- submit: (payload: SubmitResult) => any;
762
908
  cancel: () => any;
909
+ submit: (payload: SubmitResult) => any;
763
910
  change: (payload: SubmitResult) => any;
764
911
  "show-at-dialog": (visible: boolean) => any;
765
912
  "show-select-dialog": (visible: boolean) => any;
766
913
  "show-tag-dialog": (visible: boolean) => any;
767
914
  }, string, vue.PublicProps, Readonly<__VLS_Props$b> & Readonly<{
768
- onSubmit?: ((payload: SubmitResult) => any) | undefined;
769
915
  onCancel?: (() => any) | undefined;
916
+ onSubmit?: ((payload: SubmitResult) => any) | undefined;
770
917
  onChange?: ((payload: SubmitResult) => any) | undefined;
771
918
  "onShow-at-dialog"?: ((visible: boolean) => any) | undefined;
772
919
  "onShow-select-dialog"?: ((visible: boolean) => any) | undefined;
@@ -818,6 +965,8 @@ type __VLS_Props$a = {
818
965
  color?: string;
819
966
  /** 背景色 */
820
967
  backgroundColor?: string;
968
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
969
+ locale?: LocaleInput;
821
970
  };
822
971
  /** 切换门控:start 起始态不可切换;thinking 中可展开查看思考流,end/error 后可自由收起展开 */
823
972
  declare function toggle(): void;
@@ -874,13 +1023,13 @@ interface ThoughtChainItem {
874
1023
  /** 追加到链项的修饰类(如 is-text 标记文案步,消费方可定制样式) */
875
1024
  class?: string;
876
1025
  /** 打字机:思考文案步流式期间逐字打出(正文同款;透传 FvTypewriter typing 配置)。
877
- * 标记移除(消息落定)后打完积压即回落静态渲染,恢复折叠测量 */
1026
+ * 新步追加/本步封口时剩余文字一次性冲刷出完;标记移除(消息落定)后回落静态,恢复折叠测量 */
878
1027
  typing?: boolean | {
879
1028
  step?: number;
880
1029
  interval?: number;
881
1030
  };
882
1031
  /** 思考段步已封口(text 步专用):tool 事件/正文 delta 到达时由数据层置位,
883
- * 该步后续不再增长;与打字完成态联合判定提前回落静态 */
1032
+ * 该步后续不再增长;仍在打字时剩余文字直接冲刷出完(一次性回落静态) */
884
1033
  closed?: boolean;
885
1034
  }
886
1035
  type __VLS_Props$9 = {
@@ -890,6 +1039,8 @@ type __VLS_Props$9 = {
890
1039
  direction?: 'vertical' | 'horizontal';
891
1040
  /** 长文案展开/收起开关(默认关闭:超长 title 原样全量展示;开启后超 3 行截断 + 行尾「展开」) */
892
1041
  collapsible?: boolean;
1042
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
1043
+ locale?: LocaleInput;
893
1044
  };
894
1045
  declare var __VLS_45$1: {
895
1046
  item: ThoughtChainItem;
@@ -1000,6 +1151,8 @@ type __VLS_Props$6 = {
1000
1151
  imageSize?: string;
1001
1152
  /** 删除回调:右上删除按钮点击时调用 */
1002
1153
  onDelete?: () => void;
1154
+ /** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
1155
+ locale?: LocaleInput;
1003
1156
  };
1004
1157
  declare var __VLS_1$3: {};
1005
1158
  type __VLS_Slots$5 = {} & {
@@ -1008,6 +1161,7 @@ type __VLS_Slots$5 = {} & {
1008
1161
  declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{}>, {
1009
1162
  url: string;
1010
1163
  name: string;
1164
+ locale: LocaleInput;
1011
1165
  size: number | string;
1012
1166
  status: "loading" | "success" | "error";
1013
1167
  fileType: "image" | "file";
@@ -1047,6 +1201,8 @@ type __VLS_Props$5 = {
1047
1201
  beforeUpload?: (file: File) => boolean | Promise<boolean>;
1048
1202
  /** 布局:inline(默认)按钮+列表+提示一行;triggerOnly 只渲染回形针按钮;listOnly 只渲染文件列表 */
1049
1203
  layout?: 'inline' | 'triggerOnly' | 'listOnly';
1204
+ /** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
1205
+ locale?: LocaleInput;
1050
1206
  };
1051
1207
  /** 重传:error 项重新置为 loading(具体上传由外部接线,这里只驱动状态流转) */
1052
1208
  declare function retry(item: AttachmentItem): void;
@@ -1078,6 +1234,7 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {
1078
1234
  onChange?: ((list: object[]) => any) | undefined;
1079
1235
  onExceed?: ((file: File) => any) | undefined;
1080
1236
  }>, {
1237
+ locale: LocaleInput;
1081
1238
  modelValue: object[];
1082
1239
  accept: string;
1083
1240
  tip: string;
@@ -1121,6 +1278,8 @@ type __VLS_Props$4 = {
1121
1278
  loading?: boolean;
1122
1279
  /** 是否还有更早分页(缺省 false 表示一次性全量,不触发 load-more) */
1123
1280
  hasMore?: boolean;
1281
+ /** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
1282
+ locale?: LocaleInput;
1124
1283
  };
1125
1284
  declare function handleMenuCommand(cmd: {
1126
1285
  item: ConversationItem;
@@ -1171,6 +1330,7 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {
1171
1330
  "onLoad-more"?: (() => any) | undefined;
1172
1331
  }>, {
1173
1332
  loading: boolean;
1333
+ locale: LocaleInput;
1174
1334
  items: ConversationItem[];
1175
1335
  active: string | number;
1176
1336
  showBuiltInMenuType: "hover" | "always";
@@ -1558,6 +1718,11 @@ type __VLS_Props$3 = {
1558
1718
  };
1559
1719
  /** 思考链长文案展开/收起开关(透传 AiMessage→ThoughtChain;默认关闭) */
1560
1720
  collapsible?: boolean;
1721
+ /** 代码块「预览」触发语言(透传 AiMessage→Markdown;命中语言的代码块右上角注入按钮,
1722
+ * 点击行为由消费方事件委托实现,如 AiChat 打开 Artifacts 面板) */
1723
+ codeTriggerLangs?: string[];
1724
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
1725
+ locale?: LocaleInput;
1561
1726
  };
1562
1727
  declare function scrollToBottom(smooth?: boolean): void;
1563
1728
  /** 回到顶部:与 scrollToBottom 同款 try/catch 回落(happy-dom 旧版 scrollTo(options) 可能缺实现) */
@@ -1571,7 +1736,7 @@ declare var __VLS_30$1: {
1571
1736
  };
1572
1737
  declare var __VLS_33$1: {};
1573
1738
  declare var __VLS_36$1: {
1574
- status: "done" | "error" | "thinking";
1739
+ status: "thinking" | "error" | "done";
1575
1740
  message: MessageNode;
1576
1741
  };
1577
1742
  declare var __VLS_39$1: {
@@ -1608,14 +1773,14 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
1608
1773
  scrollToBottom: typeof scrollToBottom;
1609
1774
  scrollToTop: typeof scrollToTop;
1610
1775
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
1611
- select: (item: AiMessagesSuggestion) => any;
1612
1776
  copy: (message: MessageNode) => any;
1613
1777
  regenerate: (message: MessageNode) => any;
1778
+ select: (item: AiMessagesSuggestion) => any;
1614
1779
  "branch-change": (dir: BranchDirection, message: MessageNode) => any;
1615
1780
  }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1616
- onSelect?: ((item: AiMessagesSuggestion) => any) | undefined;
1617
1781
  onCopy?: ((message: MessageNode) => any) | undefined;
1618
1782
  onRegenerate?: ((message: MessageNode) => any) | undefined;
1783
+ onSelect?: ((item: AiMessagesSuggestion) => any) | undefined;
1619
1784
  "onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
1620
1785
  }>, {
1621
1786
  name: string;
@@ -1655,9 +1820,22 @@ type __VLS_WithSlots$2<T, S> = T & {
1655
1820
  /** 建议项(空态 Prompts)——空接口再导出仅为语义命名,保留 */
1656
1821
  interface AiChatSuggestion extends AiMessagesSuggestion {
1657
1822
  }
1658
- /** 可选特性开关 */
1823
+ /** Artifacts 特性配置(features.artifacts 传对象时生效) */
1824
+ interface AiChatArtifactsOptions {
1825
+ /** 面板宽度(css 值,如 '520px' / '40%';默认 420px) */
1826
+ width?: string;
1827
+ /** 面板最小宽度(默认 360px) */
1828
+ minWidth?: string;
1829
+ /** 面板最大宽度(默认 60%,防窄屏挤占消息区) */
1830
+ maxWidth?: string;
1831
+ /** 检测到 artifact 自动打开面板(默认 true;关闭后仅经代码块「预览」按钮/ref.openArtifact 手动打开) */
1832
+ autoOpen?: boolean;
1833
+ /** 消息中 html/svg 代码块右上角显示「预览」按钮(默认 true;点击打开对应 artifact 面板) */
1834
+ codeBlockTrigger?: boolean;
1835
+ }
1836
+ /** 可选特性开关(artifacts 传 true 用默认配置,传对象自定义) */
1659
1837
  interface AiChatFeatures {
1660
- artifacts?: boolean;
1838
+ artifacts?: boolean | AiChatArtifactsOptions;
1661
1839
  tts?: boolean;
1662
1840
  queue?: boolean;
1663
1841
  continueGenerate?: boolean;
@@ -1731,6 +1909,8 @@ type __VLS_Props$2 = {
1731
1909
  attachmentLimit?: number;
1732
1910
  /** 主题:light/dark/auto(注入 html dark class) */
1733
1911
  theme?: 'light' | 'dark' | 'auto';
1912
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象;解析后向整框后代注入(后代仍可用自身 locale prop 覆盖) */
1913
+ locale?: LocaleInput;
1734
1914
  };
1735
1915
  /** 停止生成:生成在途时置位 stopped(空闲时无待收口轮次,不置位避免残留误吞下一轮),再中止在途请求 */
1736
1916
  declare function stop(): void;
@@ -1753,7 +1933,7 @@ declare var __VLS_27: {
1753
1933
  };
1754
1934
  declare var __VLS_30: {};
1755
1935
  declare var __VLS_33: {
1756
- status: "done" | "error" | "thinking";
1936
+ status: "thinking" | "error" | "done";
1757
1937
  message: MessageNode;
1758
1938
  };
1759
1939
  declare var __VLS_36: {
@@ -1799,10 +1979,10 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
1799
1979
  exportTxt: typeof exportTxt;
1800
1980
  openArtifact: typeof openArtifact;
1801
1981
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
1982
+ send: (text: string, files?: ChatFile[] | undefined) => any;
1802
1983
  error: (err: Error, message?: MessageNode | undefined) => any;
1803
1984
  "branch-change": (dir: BranchDirection, message: MessageNode) => any;
1804
1985
  "update:messages": (value: MessageNode[]) => any;
1805
- send: (text: string, files?: ChatFile[] | undefined) => any;
1806
1986
  "message-complete": (message: MessageNode) => any;
1807
1987
  "attachment-exceed": (file: File) => any;
1808
1988
  "tool-event": (ev: {
@@ -1810,10 +1990,10 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
1810
1990
  status: "start" | "done";
1811
1991
  }) => any;
1812
1992
  }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1993
+ onSend?: ((text: string, files?: ChatFile[] | undefined) => any) | undefined;
1813
1994
  onError?: ((err: Error, message?: MessageNode | undefined) => any) | undefined;
1814
1995
  "onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
1815
1996
  "onUpdate:messages"?: ((value: MessageNode[]) => any) | undefined;
1816
- onSend?: ((text: string, files?: ChatFile[] | undefined) => any) | undefined;
1817
1997
  "onMessage-complete"?: ((message: MessageNode) => any) | undefined;
1818
1998
  "onAttachment-exceed"?: ((file: File) => any) | undefined;
1819
1999
  "onTool-event"?: ((ev: {
@@ -1906,13 +2086,18 @@ type __VLS_Props$1 = {
1906
2086
  };
1907
2087
  /** 思考链长文案展开/收起开关(透传 ThoughtChain collapsible;默认关闭,超长 title 原样全量展示) */
1908
2088
  collapsible?: boolean;
2089
+ /** 代码块「预览」触发语言(透传 Markdown/Typewriter;命中语言的代码块右上角注入按钮,
2090
+ * 点击行为由消费方事件委托实现,如 AiChat 打开 Artifacts 面板) */
2091
+ codeTriggerLangs?: string[];
2092
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
2093
+ locale?: LocaleInput;
1909
2094
  };
1910
2095
  declare var __VLS_1: {
1911
2096
  message: MessageNode;
1912
2097
  };
1913
2098
  declare var __VLS_3: {};
1914
2099
  declare var __VLS_16: {
1915
- status: "done" | "error" | "thinking";
2100
+ status: "thinking" | "error" | "done";
1916
2101
  message: MessageNode;
1917
2102
  };
1918
2103
  declare var __VLS_18: {
@@ -1946,14 +2131,14 @@ type __VLS_Slots = {} & {
1946
2131
  declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
1947
2132
  message: vue.ComputedRef<MessageNode>;
1948
2133
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
1949
- typing: () => any;
1950
2134
  copy: (message: MessageNode) => any;
1951
2135
  regenerate: (message: MessageNode) => any;
2136
+ typing: () => any;
1952
2137
  "branch-change": (dir: BranchDirection, message: MessageNode) => any;
1953
2138
  }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1954
- onTyping?: (() => any) | undefined;
1955
2139
  onCopy?: ((message: MessageNode) => any) | undefined;
1956
2140
  onRegenerate?: ((message: MessageNode) => any) | undefined;
2141
+ onTyping?: (() => any) | undefined;
1957
2142
  "onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
1958
2143
  }>, {
1959
2144
  typing: boolean | {
@@ -1999,6 +2184,14 @@ type __VLS_Props = {
1999
2184
  artifacts: AiArtifactItem[];
2000
2185
  /** 当前展示的 artifact key;为空时面板隐藏 */
2001
2186
  activeKey?: string;
2187
+ /** 面板宽度(css width 值,如 '520px' / '40%';默认 420px,受 maxWidth 钳制) */
2188
+ width?: string;
2189
+ /** 面板最小宽度(css 值;默认 360px,窄容器下不小于该值) */
2190
+ minWidth?: string;
2191
+ /** 面板最大宽度(css 值;默认 60%,防窄屏挤占消息区) */
2192
+ maxWidth?: string;
2193
+ /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
2194
+ locale?: LocaleInput;
2002
2195
  };
2003
2196
  declare function open(key: string): void;
2004
2197
  declare function close(): void;
@@ -2006,16 +2199,19 @@ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {
2006
2199
  open: typeof open;
2007
2200
  close: typeof close;
2008
2201
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
2009
- change: (key: string) => any;
2010
2202
  close: () => any;
2203
+ change: (key: string) => any;
2011
2204
  navigate: (href: string) => any;
2012
2205
  }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
2013
- onChange?: ((key: string) => any) | undefined;
2014
2206
  onClose?: (() => any) | undefined;
2207
+ onChange?: ((key: string) => any) | undefined;
2015
2208
  onNavigate?: ((href: string) => any) | undefined;
2016
2209
  }>, {
2210
+ width: string;
2211
+ maxWidth: string;
2017
2212
  artifacts: AiArtifactItem[];
2018
2213
  activeKey: string;
2214
+ minWidth: string;
2019
2215
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2020
2216
  declare const _default: typeof __VLS_export;
2021
2217
 
@@ -2139,6 +2335,9 @@ interface UseChatOptions {
2139
2335
  }) => void;
2140
2336
  /** 工具名 → 步骤展示名(流式 toolSteps 的 title;缺省原样使用 toolName) */
2141
2337
  toolStepLabel?: (toolName: string) => string;
2338
+ /** 语言包工厂(惰性取用,与 toolStepLabel 同语义;附件 system prompt/工具用时/续写 prompt
2339
+ * 在产生时取值——语言切换只影响之后的请求,已落库数据不回溯);缺省读全局 */
2340
+ locale?: () => LocaleMessages;
2142
2341
  }
2143
2342
  /** 待发送队列项 */
2144
2343
  interface QueueItem {
@@ -2187,5 +2386,5 @@ declare function createMessageTree(initial?: {
2187
2386
 
2188
2387
  declare const version = "0.1.0";
2189
2388
 
2190
- export { _default as FvAiArtifacts, _default$2 as FvAiChat, _default$1 as FvAiMessage, _default$3 as FvAiMessages, _default$5 as FvAttachments, _default$f as FvBubble, _default$e as FvBubbleList, FvCommonAdapter, FvCommonError, _default$4 as FvConversations, _default$b as FvEditorSender, _default$6 as FvFilesCard, _default$h as FvMarkdown, _default$c as FvMentionSender, _default$7 as FvPrompts, _default$d as FvSender, _default$a as FvThinking, _default$9 as FvThoughtChain, _default$g as FvTypewriter, _default$8 as FvWelcome, OpenAIAdapter, XRequest, createLocalStorageAdapter, createMemoryAdapter, createMessageTree, createSSEParser, useChat, useMessages, useRecord, useSend, useXStream, version };
2191
- export type { AdapterChatMessage, AiArtifactItem, AiChatFeatures, AiChatSuggestion, AiMessageBranchInfo, AiMessagesSuggestion, BranchDirection, ChatAdapter, ChatAdapterHandlers, ChatAdapterRequest, ChatFile, FvCommonAdapterConfig, FvCommonMessage, FvCommonMessagePage, FvCommonSendBody, FvCommonSessionDetail, FvCommonSessionItem, FvCommonToolEvent, MessageNode, MessageNodeInput, MessageRole, MessageStatus, MessageTree, MessageUsage, OpenAIAdapterConfig, QueueItem, RawUsage, SSEEvent, SSEParser, SendOptions, StorageAdapter, ToolCallItem, ToolStepItem, UseChatOptions, UseChatReturn, UseMessagesReturn, UseRecordReturn, UseSendReturn, UseXStreamReturn };
2389
+ export { _default as FvAiArtifacts, _default$2 as FvAiChat, _default$1 as FvAiMessage, _default$3 as FvAiMessages, _default$5 as FvAttachments, _default$f as FvBubble, _default$e as FvBubbleList, FvCommonAdapter, FvCommonError, _default$4 as FvConversations, _default$b as FvEditorSender, _default$6 as FvFilesCard, _default$h as FvMarkdown, _default$c as FvMentionSender, _default$7 as FvPrompts, _default$d as FvSender, _default$a as FvThinking, _default$9 as FvThoughtChain, _default$g as FvTypewriter, _default$8 as FvWelcome, OpenAIAdapter, XRequest, configureLocale, createLocalStorageAdapter, createMemoryAdapter, createMessageTree, createSSEParser, enUS, useChat, useMessages, useRecord, useSend, useXStream, version, zhCN };
2390
+ export type { AdapterChatMessage, AiArtifactItem, AiChatArtifactsOptions, AiChatFeatures, AiChatSuggestion, AiMessageBranchInfo, AiMessagesSuggestion, BranchDirection, ChatAdapter, ChatAdapterHandlers, ChatAdapterRequest, ChatFile, DeepPartialLocale, FvCommonAdapterConfig, FvCommonMessage, FvCommonMessagePage, FvCommonSendBody, FvCommonSessionDetail, FvCommonSessionItem, FvCommonToolEvent, LocaleInput, LocaleMessages, MessageNode, MessageNodeInput, MessageRole, MessageStatus, MessageTree, MessageUsage, OpenAIAdapterConfig, QueueItem, RawUsage, SSEEvent, SSEParser, SendOptions, StorageAdapter, ToolCallItem, ToolStepItem, UseChatOptions, UseChatReturn, UseMessagesReturn, UseRecordReturn, UseSendReturn, UseXStreamReturn };