@incremark/chat-vue 0.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LICENSE +22 -0
  2. package/dist/chunk-X3YI3YOK.js +3809 -0
  3. package/dist/chunk-X3YI3YOK.js.map +1 -0
  4. package/dist/components/base/action-button/action-button.vue.d.ts +28 -0
  5. package/dist/components/base/action-button/index.d.ts +5 -0
  6. package/dist/components/base/action-button/types/index.d.ts +9 -0
  7. package/dist/components/base/im-button/im-button.vue.d.ts +30 -0
  8. package/dist/components/base/im-button/index.d.ts +2 -0
  9. package/dist/components/base/im-button/types/index.d.ts +27 -0
  10. package/dist/components/base/im-dropdown/im-dropdown.vue.d.ts +24 -0
  11. package/dist/components/base/im-dropdown/index.d.ts +5 -0
  12. package/dist/components/base/im-dropdown/types/index.d.ts +27 -0
  13. package/dist/components/base/im-popover/im-popover.vue.d.ts +38 -0
  14. package/dist/components/base/im-popover/index.d.ts +2 -0
  15. package/dist/components/base/im-popover/types/index.d.ts +25 -0
  16. package/dist/components/base/im-tooltip/im-tooltip.vue.d.ts +20 -0
  17. package/dist/components/base/im-tooltip/index.d.ts +2 -0
  18. package/dist/components/base/im-tooltip/types/index.d.ts +12 -0
  19. package/dist/components/base/index.d.ts +8 -0
  20. package/dist/components/chain-of-thought/chain-of-thought-step.vue.d.ts +25 -0
  21. package/dist/components/chain-of-thought/chain-of-thought.vue.d.ts +32 -0
  22. package/dist/components/chain-of-thought/composables/index.d.ts +4 -0
  23. package/dist/components/chain-of-thought/composables/useChainOfThought.d.ts +7 -0
  24. package/dist/components/chain-of-thought/index.d.ts +6 -0
  25. package/dist/components/chain-of-thought/types/index.d.ts +76 -0
  26. package/dist/components/error-message/error-message.vue.d.ts +22 -0
  27. package/dist/components/error-message/index.d.ts +5 -0
  28. package/dist/components/error-message/types/index.d.ts +22 -0
  29. package/dist/components/file-preview/composables/index.d.ts +1 -0
  30. package/dist/components/file-preview/composables/useFileType.d.ts +40 -0
  31. package/dist/components/file-preview/file-preview.vue.d.ts +13 -0
  32. package/dist/components/file-preview/index.d.ts +5 -0
  33. package/dist/components/file-preview/types/index.d.ts +44 -0
  34. package/dist/components/index.d.ts +34 -0
  35. package/dist/components/message-actions/composables/index.d.ts +5 -0
  36. package/dist/components/message-actions/composables/useCopyAction.d.ts +20 -0
  37. package/dist/components/message-actions/index.d.ts +11 -0
  38. package/dist/components/message-actions/message-action-copy.vue.d.ts +7 -0
  39. package/dist/components/message-actions/message-action-feedback.vue.d.ts +14 -0
  40. package/dist/components/message-actions/message-action-more.vue.d.ts +10 -0
  41. package/dist/components/message-actions/message-action.vue.d.ts +21 -0
  42. package/dist/components/message-actions/message-actions.vue.d.ts +23 -0
  43. package/dist/components/message-actions/types/index.d.ts +107 -0
  44. package/dist/components/message-bubble/index.d.ts +2 -0
  45. package/dist/components/message-bubble/message-bubble.vue.d.ts +27 -0
  46. package/dist/components/message-bubble/types/index.d.ts +37 -0
  47. package/dist/components/message-renderer/index.d.ts +6 -0
  48. package/dist/components/message-renderer/part-renderer.vue.d.ts +19 -0
  49. package/dist/components/message-renderer/types/index.d.ts +37 -0
  50. package/dist/components/reasoning-message/index.d.ts +5 -0
  51. package/dist/components/reasoning-message/reasoning-message.vue.d.ts +8 -0
  52. package/dist/components/reasoning-message/types/index.d.ts +38 -0
  53. package/dist/components/sender/components/sender-action-button.vue.d.ts +24 -0
  54. package/dist/components/sender/components/sender-attachments.vue.d.ts +11 -0
  55. package/dist/components/sender/components/sender-file-button.vue.d.ts +11 -0
  56. package/dist/components/sender/components/sender-submit-button.vue.d.ts +21 -0
  57. package/dist/components/sender/composables/index.d.ts +2 -0
  58. package/dist/components/sender/composables/useSender.d.ts +31 -0
  59. package/dist/components/sender/index.d.ts +7 -0
  60. package/dist/components/sender/sender.vue.d.ts +66 -0
  61. package/dist/components/sender/types/index.d.ts +174 -0
  62. package/dist/components/sender-input/index.d.ts +1 -0
  63. package/dist/components/sender-input/sender-input.vue.d.ts +36 -0
  64. package/dist/components/sender-input/types/index.d.ts +24 -0
  65. package/dist/components/source-reference/index.d.ts +5 -0
  66. package/dist/components/source-reference/source-reference.vue.d.ts +20 -0
  67. package/dist/components/source-reference/types/index.d.ts +13 -0
  68. package/dist/components/suggestion/index.d.ts +6 -0
  69. package/dist/components/suggestion/suggestion-item.vue.d.ts +21 -0
  70. package/dist/components/suggestion/suggestion.vue.d.ts +22 -0
  71. package/dist/components/suggestion/types/index.d.ts +27 -0
  72. package/dist/components/svg-icon/index.d.ts +1 -0
  73. package/dist/components/svg-icon/svg-icon.vue.d.ts +13 -0
  74. package/dist/components/text-message/index.d.ts +5 -0
  75. package/dist/components/text-message/text-message.vue.d.ts +6 -0
  76. package/dist/components/text-message/types/index.d.ts +32 -0
  77. package/dist/components/tool-call/index.d.ts +5 -0
  78. package/dist/components/tool-call/tool-call.vue.d.ts +18 -0
  79. package/dist/components/tool-call/types/index.d.ts +81 -0
  80. package/dist/components/welcome/index.d.ts +5 -0
  81. package/dist/components/welcome/types/index.d.ts +19 -0
  82. package/dist/components/welcome/welcome.vue.d.ts +28 -0
  83. package/dist/components.js +3 -0
  84. package/dist/components.js.map +1 -0
  85. package/dist/composables/index.d.ts +2 -0
  86. package/dist/composables/useCollapsible.d.ts +4 -0
  87. package/dist/composables/useUIAdapter.d.ts +14 -0
  88. package/dist/index.d.ts +7 -0
  89. package/dist/index.js +30 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/provider/ChatProvider.vue.d.ts +14 -0
  92. package/dist/provider/index.d.ts +4 -0
  93. package/dist/types/adapter.d.ts +64 -0
  94. package/dist/types/index.d.ts +5 -0
  95. package/dist/types/message.d.ts +5 -0
  96. package/dist/types/parts.d.ts +5 -0
  97. package/package.json +83 -0
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Sender 组件类型定义
3
+ */
4
+ import type { Ref } from 'vue';
5
+ /**
6
+ * 提交类型
7
+ * - enter: 按 Enter 发送,Shift+Enter 换行
8
+ * - shiftEnter: 按 Shift+Enter 发送,Enter 换行
9
+ * - manual: 仅通过按钮发送
10
+ */
11
+ export type SenderSubmitType = 'enter' | 'shiftEnter' | 'manual';
12
+ /**
13
+ * 附件项
14
+ */
15
+ export interface SenderAttachment {
16
+ /** 唯一标识 */
17
+ id: string;
18
+ /** 文件名 */
19
+ name: string;
20
+ /** 文件大小(字节) */
21
+ size?: number;
22
+ /** MIME 类型 */
23
+ type?: string;
24
+ /** 预览 URL */
25
+ url?: string;
26
+ /** 原始文件对象 */
27
+ file?: File;
28
+ }
29
+ /**
30
+ * 提交的消息
31
+ */
32
+ export interface SenderMessage {
33
+ /** 消息内容 */
34
+ content: string;
35
+ /** 附件列表 */
36
+ attachments?: SenderAttachment[];
37
+ }
38
+ /**
39
+ * Sender 组件 Props
40
+ */
41
+ export interface SenderProps {
42
+ /** 输入框内容(v-model) */
43
+ modelValue?: string;
44
+ /** 附件列表(v-model:attachments) */
45
+ attachments?: SenderAttachment[];
46
+ /** 占位文本 */
47
+ placeholder?: string;
48
+ /** 是否禁用 */
49
+ disabled?: boolean;
50
+ /** 是否显示边框 */
51
+ bordered?: boolean;
52
+ /** 是否加载中(发送中) */
53
+ loading?: boolean;
54
+ /** 输入框最大高度 */
55
+ maxHeight?: string | number;
56
+ /** 提交方式 */
57
+ submitType?: SenderSubmitType;
58
+ /** 是否在发送后清空输入框 */
59
+ clearOnSubmit?: boolean;
60
+ /** 接受的文件类型,如 'image/*,.pdf' */
61
+ accept?: string;
62
+ /** 最大文件数量 */
63
+ maxFiles?: number;
64
+ /** 单文件最大大小(字节) */
65
+ maxSize?: number;
66
+ }
67
+ /**
68
+ * Sender 组件 Emits
69
+ * 注意:update:modelValue 由 defineModel 自动处理,无需手动定义
70
+ */
71
+ export interface SenderEmits {
72
+ /** 提交消息 */
73
+ (e: 'submit', message: SenderMessage): void;
74
+ /** 取消发送(loading 状态下点击按钮) */
75
+ (e: 'cancel'): void;
76
+ /** 文件校验失败 */
77
+ (e: 'fileError', error: {
78
+ type: 'type' | 'size' | 'count';
79
+ file?: File;
80
+ message: string;
81
+ }): void;
82
+ }
83
+ /**
84
+ * Sender 上下文(provide/inject)
85
+ */
86
+ export interface SenderContext {
87
+ /** 输入内容 */
88
+ value: Ref<string>;
89
+ /** 附件列表 */
90
+ attachments: Ref<SenderAttachment[]>;
91
+ /** 是否禁用 */
92
+ disabled: Ref<boolean>;
93
+ /** 是否加载中 */
94
+ loading: Ref<boolean>;
95
+ /** 是否可提交 */
96
+ canSubmit: Ref<boolean>;
97
+ /** 提交方法 */
98
+ submit: () => void;
99
+ /** 取消方法 */
100
+ cancel: () => void;
101
+ /** 添加文件 */
102
+ addFiles: (files: File[]) => void;
103
+ /** 移除附件 */
104
+ removeAttachment: (id: string) => void;
105
+ /** 文件配置 */
106
+ fileConfig: {
107
+ accept?: string;
108
+ maxFiles?: number;
109
+ maxSize?: number;
110
+ };
111
+ }
112
+ /**
113
+ * SenderInput Props
114
+ */
115
+ export interface SenderInputProps {
116
+ /** 输入框内容(v-model) */
117
+ modelValue?: string;
118
+ /** 占位文本 */
119
+ placeholder?: string;
120
+ /** 是否禁用 */
121
+ disabled?: boolean;
122
+ /** 是否显示边框 */
123
+ bordered?: boolean;
124
+ /** 输入框最大高度 */
125
+ maxHeight?: string | number;
126
+ /** 提交方式 */
127
+ submitType?: SenderSubmitType;
128
+ }
129
+ /**
130
+ * SenderInput Emits
131
+ */
132
+ export interface SenderInputEmits {
133
+ (e: 'update:modelValue', value: string): void;
134
+ (e: 'focus', event: FocusEvent): void;
135
+ (e: 'blur', event: FocusEvent): void;
136
+ (e: 'submit'): void;
137
+ (e: 'paste'): void;
138
+ (e: 'pasteFile', files: File[]): void;
139
+ }
140
+ /**
141
+ * SenderSubmitButton Props
142
+ */
143
+ export interface SenderSubmitButtonProps {
144
+ /** 是否禁用 */
145
+ disabled?: boolean;
146
+ /** 是否加载中 */
147
+ loading?: boolean;
148
+ }
149
+ /**
150
+ * SenderActionButton Props
151
+ */
152
+ export interface SenderActionButtonProps {
153
+ /** 是否禁用 */
154
+ disabled?: boolean;
155
+ /** 是否激活状态 */
156
+ active?: boolean;
157
+ /** 是否为正方形(仅图标时使用) */
158
+ square?: boolean;
159
+ /** 无障碍标签 */
160
+ ariaLabel?: string;
161
+ }
162
+ /**
163
+ * SenderInput 组件暴露的方法
164
+ */
165
+ export interface SenderInputRef {
166
+ /** 聚焦输入框 */
167
+ focus: () => void;
168
+ /** 失焦输入框 */
169
+ blur: () => void;
170
+ /** 清空输入内容 */
171
+ clear: () => void;
172
+ /** 插入文本 */
173
+ insert: (text: string) => void;
174
+ }
@@ -0,0 +1 @@
1
+ export { default as SenderInput } from './sender-input.vue';
@@ -0,0 +1,36 @@
1
+ import type { SenderInputProps } from './types';
2
+ type __VLS_Props = SenderInputProps;
3
+ type __VLS_ModelProps = {
4
+ 'modelValue'?: string;
5
+ };
6
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
8
+ focus: () => void;
9
+ blur: () => void;
10
+ clear: () => void;
11
+ insert: (text: string) => void;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: string) => any;
14
+ } & {
15
+ submit: () => any;
16
+ focus: (event: FocusEvent) => any;
17
+ blur: (event: FocusEvent) => any;
18
+ change: (value: string) => any;
19
+ paste: () => any;
20
+ pasteFile: (files: File[]) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ onSubmit?: (() => any) | undefined;
23
+ onFocus?: ((event: FocusEvent) => any) | undefined;
24
+ onBlur?: ((event: FocusEvent) => any) | undefined;
25
+ onChange?: ((value: string) => any) | undefined;
26
+ onPaste?: (() => any) | undefined;
27
+ onPasteFile?: ((files: File[]) => any) | undefined;
28
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
29
+ }>, {
30
+ disabled: boolean;
31
+ placeholder: string;
32
+ bordered: boolean;
33
+ submitType: import("./types").SenderSubmitType;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 提交类型
3
+ * - enter: 按 Enter 发送,Shift+Enter 换行
4
+ * - shiftEnter: 按 Shift+Enter 发送,Enter 换行
5
+ * - manual: 仅通过按钮发送
6
+ */
7
+ export type SenderSubmitType = 'enter' | 'shiftEnter' | 'manual';
8
+ export interface SenderInputProps {
9
+ placeholder?: string;
10
+ disabled?: boolean;
11
+ bordered?: boolean;
12
+ maxHeight?: string | number;
13
+ /** 提交方式 */
14
+ submitType?: SenderSubmitType;
15
+ }
16
+ export interface SenderInputEmits {
17
+ (e: 'focus', event: FocusEvent): void;
18
+ (e: 'blur', event: FocusEvent): void;
19
+ (e: 'change', value: string): void;
20
+ (e: 'paste'): void;
21
+ (e: 'pasteFile', files: File[]): void;
22
+ /** 提交事件(Enter 键触发) */
23
+ (e: 'submit'): void;
24
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * SourceReference 组件导出
3
+ */
4
+ export { default as SourceReference } from './source-reference.vue';
5
+ export type { SourceReferenceProps } from './types';
@@ -0,0 +1,20 @@
1
+ import type { SourceReferenceProps } from './types';
2
+ declare var __VLS_1: {}, __VLS_14: {}, __VLS_27: {};
3
+ type __VLS_Slots = {} & {
4
+ icon?: (props: typeof __VLS_1) => any;
5
+ } & {
6
+ icon?: (props: typeof __VLS_14) => any;
7
+ } & {
8
+ default?: (props: typeof __VLS_27) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<SourceReferenceProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SourceReferenceProps> & Readonly<{}>, {
11
+ openInNewTab: boolean;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * SourceReference 组件类型定义
3
+ */
4
+ import type { SourcePart } from '@incremark/chat-core';
5
+ /**
6
+ * SourceReference 组件 Props
7
+ */
8
+ export interface SourceReferenceProps {
9
+ /** 来源 Part 数据 */
10
+ part: SourcePart;
11
+ /** 是否在新窗口打开链接 */
12
+ openInNewTab?: boolean;
13
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Suggestion 组件导出
3
+ */
4
+ export { default as Suggestion } from './suggestion.vue';
5
+ export { default as SuggestionItem } from './suggestion-item.vue';
6
+ export * from './types';
@@ -0,0 +1,21 @@
1
+ import type { SuggestionItem } from './types';
2
+ type __VLS_Props = {
3
+ item: SuggestionItem;
4
+ };
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ icon?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ click: (item: SuggestionItem) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ onClick?: ((item: SuggestionItem) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,22 @@
1
+ import type { SuggestionProps, SuggestionItem } from './types';
2
+ declare var __VLS_10: {
3
+ item: SuggestionItem;
4
+ };
5
+ type __VLS_Slots = {} & {
6
+ icon?: (props: typeof __VLS_10) => any;
7
+ };
8
+ declare const __VLS_base: import("vue").DefineComponent<SuggestionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ select: (item: SuggestionItem) => any;
10
+ }, string, import("vue").PublicProps, Readonly<SuggestionProps> & Readonly<{
11
+ onSelect?: ((item: SuggestionItem) => any) | undefined;
12
+ }>, {
13
+ vertical: boolean;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Suggestion 组件类型定义
3
+ */
4
+ /**
5
+ * 单个建议项
6
+ */
7
+ export interface SuggestionItem {
8
+ /** 唯一标识 */
9
+ id?: string;
10
+ /** 建议文本 */
11
+ label: string;
12
+ /** 描述(可选) */
13
+ description?: string;
14
+ /** 图标(Iconify 图标名) */
15
+ icon?: string;
16
+ /** 是否禁用 */
17
+ disabled?: boolean;
18
+ }
19
+ /**
20
+ * Suggestion 组件 Props
21
+ */
22
+ export interface SuggestionProps {
23
+ /** 建议项列表 */
24
+ items: SuggestionItem[];
25
+ /** 是否垂直排列 */
26
+ vertical?: boolean;
27
+ }
@@ -0,0 +1 @@
1
+ export { default as SvgIcon } from './svg-icon.vue';
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * TextMessage 组件导出
3
+ */
4
+ export { default as TextMessage } from './text-message.vue';
5
+ export type { TextMessageProps } from './types';
@@ -0,0 +1,6 @@
1
+ import type { TextMessageProps } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<TextMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextMessageProps> & Readonly<{}>, {
3
+ streaming: boolean;
4
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * TextMessage 组件类型定义
3
+ */
4
+ import type { Component } from 'vue';
5
+ import type { TextPart } from '@incremark/chat-core';
6
+ import type { UseIncremarkOptions } from '@incremark/vue';
7
+ /**
8
+ * 代码块配置
9
+ */
10
+ export interface CodeBlockConfig {
11
+ /** 是否从一开始就接管渲染,而不是等到 completed 状态 */
12
+ takeOver?: boolean;
13
+ }
14
+ /**
15
+ * TextMessage 组件 Props
16
+ */
17
+ export interface TextMessageProps {
18
+ /** 文本 Part 数据 */
19
+ part: TextPart;
20
+ /** 是否正在流式渲染 */
21
+ streaming?: boolean;
22
+ /** Incremark 渲染选项 */
23
+ incremarkOptions?: UseIncremarkOptions;
24
+ /** 自定义容器组件映射 */
25
+ customContainers?: Record<string, Component>;
26
+ /** 自定义代码块组件映射 */
27
+ customCodeBlocks?: Record<string, Component>;
28
+ /** 代码块配置映射 */
29
+ codeBlockConfigs?: Record<string, CodeBlockConfig>;
30
+ /** 流式渲染中的 pending 文本的 CSS 类名 */
31
+ pendingClass?: string;
32
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * ToolCall 组件导出
3
+ */
4
+ export { default as ToolCall } from './tool-call.vue';
5
+ export type { ToolCallProps, ToolRendererProps, ToolRendererRegistry, OutputRendererProps, OutputRendererRegistry, StateLabels, StateCategories } from './types';
@@ -0,0 +1,18 @@
1
+ import type { ToolCallProps } from './types';
2
+ declare var __VLS_22: {};
3
+ type __VLS_Slots = {} & {
4
+ approval?: (props: typeof __VLS_22) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<ToolCallProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToolCallProps> & Readonly<{}>, {
7
+ defaultExpanded: boolean;
8
+ showArgs: boolean;
9
+ showOutput: boolean;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,81 @@
1
+ /**
2
+ * ToolCall 组件类型定义
3
+ */
4
+ import type { Component } from 'vue';
5
+ import type { ToolCallPart } from '@incremark/chat-core';
6
+ /**
7
+ * 状态标签映射 - key 为任意状态字符串
8
+ */
9
+ export type StateLabels = Record<string, string>;
10
+ /**
11
+ * 状态分类配置 - 用于判断状态属于哪个类别
12
+ */
13
+ export interface StateCategories {
14
+ /** 加载中状态列表 */
15
+ loading?: string[];
16
+ /** 完成状态列表 */
17
+ complete?: string[];
18
+ /** 错误状态列表 */
19
+ error?: string[];
20
+ /** 拒绝状态列表 */
21
+ denied?: string[];
22
+ /** 等待审批状态列表 */
23
+ approval?: string[];
24
+ }
25
+ /**
26
+ * 工具渲染器 Props
27
+ */
28
+ export interface ToolRendererProps {
29
+ /** 工具调用 ID */
30
+ toolCallId: string;
31
+ /** 工具名称 */
32
+ toolName: string;
33
+ /** 工具参数 */
34
+ args: Record<string, unknown>;
35
+ /** 工具调用状态 */
36
+ state: string;
37
+ /** 工具执行结果 */
38
+ output?: unknown;
39
+ /** 错误信息 */
40
+ error?: string;
41
+ }
42
+ /**
43
+ * 输出渲染器 Props
44
+ */
45
+ export interface OutputRendererProps {
46
+ /** 工具名称 */
47
+ toolName: string;
48
+ /** 工具执行结果 */
49
+ output: unknown;
50
+ }
51
+ /**
52
+ * 工具渲染器注册表
53
+ */
54
+ export type ToolRendererRegistry = Record<string, Component>;
55
+ /**
56
+ * 输出渲染器注册表
57
+ */
58
+ export type OutputRendererRegistry = Record<string, Component>;
59
+ /**
60
+ * ToolCall 组件 Props
61
+ */
62
+ export interface ToolCallProps {
63
+ /** 工具调用 Part 数据 */
64
+ part: ToolCallPart;
65
+ /** 工具渲染器注册表,key 为工具名称 */
66
+ tools?: ToolRendererRegistry;
67
+ /** 输出渲染器注册表,key 为工具名称 */
68
+ outputRenderers?: OutputRendererRegistry;
69
+ /** 默认渲染器(当工具未注册时使用) */
70
+ defaultRenderer?: Component;
71
+ /** 状态标签映射,用于自定义状态文本 */
72
+ stateLabels?: StateLabels;
73
+ /** 状态分类配置,用于判断状态属于哪个类别 */
74
+ stateCategories?: StateCategories;
75
+ /** 是否显示参数 */
76
+ showArgs?: boolean;
77
+ /** 是否显示结果 */
78
+ showOutput?: boolean;
79
+ /** 默认是否展开 */
80
+ defaultExpanded?: boolean;
81
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Welcome 组件导出
3
+ */
4
+ export { default as Welcome } from './welcome.vue';
5
+ export * from './types';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Welcome 组件类型定义
3
+ */
4
+ import type { SuggestionItem } from '../../suggestion/types';
5
+ /**
6
+ * Welcome 组件 Props
7
+ */
8
+ export interface WelcomeProps {
9
+ /** 标题 */
10
+ title?: string;
11
+ /** 副标题/描述 */
12
+ description?: string;
13
+ /** 图标(Iconify 图标名) */
14
+ icon?: string;
15
+ /** 建议项列表 */
16
+ suggestions?: SuggestionItem[];
17
+ /** 底部提示文字 */
18
+ hint?: string;
19
+ }
@@ -0,0 +1,28 @@
1
+ import type { SuggestionItem } from '../suggestion/types';
2
+ import type { WelcomeProps } from './types';
3
+ declare var __VLS_1: {}, __VLS_14: {
4
+ items: SuggestionItem[];
5
+ }, __VLS_23: {};
6
+ type __VLS_Slots = {} & {
7
+ icon?: (props: typeof __VLS_1) => any;
8
+ } & {
9
+ suggestions?: (props: typeof __VLS_14) => any;
10
+ } & {
11
+ hint?: (props: typeof __VLS_23) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<WelcomeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ select: (item: SuggestionItem) => any;
15
+ }, string, import("vue").PublicProps, Readonly<WelcomeProps> & Readonly<{
16
+ onSelect?: ((item: SuggestionItem) => any) | undefined;
17
+ }>, {
18
+ title: string;
19
+ icon: string;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,3 @@
1
+ export { chain_of_thought_default as ChainOfThought, chain_of_thought_step_default as ChainOfThoughtStep, error_message_default as ErrorMessage, file_preview_default as FilePreview, im_button_default as ImButton, im_tooltip_default as ImTooltip, message_action_default as MessageAction, message_action_copy_default as MessageActionCopy, message_action_feedback_default as MessageActionFeedback, message_actions_default as MessageActions, message_bubble_default as MessageBubble, part_renderer_default as PartRenderer, reasoning_message_default as ReasoningMessage, sender_default as Sender, sender_action_button_default as SenderActionButton, sender_input_default as SenderInput, sender_submit_button_default as SenderSubmitButton, source_reference_default as SourceReference, suggestion_default as Suggestion, suggestion_item_default as SuggestionItem, svg_icon_default as SvgIcon, text_message_default as TextMessage, tool_call_default as ToolCall, welcome_default as Welcome, useCopyAction, useSender } from './chunk-X3YI3YOK.js';
2
+ //# sourceMappingURL=components.js.map
3
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"components.js"}
@@ -0,0 +1,2 @@
1
+ export { useCollapsible } from './useCollapsible';
2
+ export { useUIAdapter, provideUIAdapter } from './useUIAdapter';
@@ -0,0 +1,4 @@
1
+ export declare function useCollapsible(defaultExpanded?: boolean): {
2
+ expanded: import("vue").Ref<boolean, boolean>;
3
+ toggle: () => void;
4
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * useUIAdapter - UI 适配器注入与获取
3
+ */
4
+ import type { UIAdapter } from '../types/adapter';
5
+ /**
6
+ * 提供 UI 适配器
7
+ * @param adapter 自定义适配器,会与默认适配器合并
8
+ */
9
+ export declare function provideUIAdapter(adapter?: Partial<UIAdapter>): void;
10
+ /**
11
+ * 获取 UI 适配器
12
+ * @returns UI 适配器对象
13
+ */
14
+ export declare function useUIAdapter(): UIAdapter;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * chat-vue 包入口
3
+ */
4
+ export * from './components';
5
+ export * from './composables';
6
+ export * from './provider';
7
+ export type { UIAdapter, ChatProviderProps } from './types/adapter';
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import { provideUIAdapter } from './chunk-X3YI3YOK.js';
2
+ export { chain_of_thought_default as ChainOfThought, chain_of_thought_step_default as ChainOfThoughtStep, error_message_default as ErrorMessage, file_preview_default as FilePreview, im_button_default as ImButton, im_tooltip_default as ImTooltip, message_action_default as MessageAction, message_action_copy_default as MessageActionCopy, message_action_feedback_default as MessageActionFeedback, message_actions_default as MessageActions, message_bubble_default as MessageBubble, part_renderer_default as PartRenderer, reasoning_message_default as ReasoningMessage, sender_default as Sender, sender_action_button_default as SenderActionButton, sender_input_default as SenderInput, sender_submit_button_default as SenderSubmitButton, source_reference_default as SourceReference, suggestion_default as Suggestion, suggestion_item_default as SuggestionItem, svg_icon_default as SvgIcon, text_message_default as TextMessage, tool_call_default as ToolCall, welcome_default as Welcome, provideUIAdapter, useCollapsible, useCopyAction, useSender, useUIAdapter } from './chunk-X3YI3YOK.js';
3
+ import { defineComponent, renderSlot } from 'vue';
4
+
5
+ var ChatProvider_default = /* @__PURE__ */ defineComponent({
6
+ __name: "ChatProvider",
7
+ props: {
8
+ adapter: { type: Object, required: false }
9
+ },
10
+ setup(__props, { expose: __expose }) {
11
+ __expose();
12
+ const props = __props;
13
+ provideUIAdapter(props.adapter);
14
+ const __returned__ = { props };
15
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
16
+ return __returned__;
17
+ }
18
+ });
19
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
20
+ return renderSlot(_ctx.$slots, "default");
21
+ }
22
+
23
+ // src/provider/ChatProvider.vue
24
+ ChatProvider_default.render = render;
25
+ ChatProvider_default.__file = "src/provider/ChatProvider.vue";
26
+ var ChatProvider_default2 = ChatProvider_default;
27
+
28
+ export { ChatProvider_default2 as ChatProvider };
29
+ //# sourceMappingURL=index.js.map
30
+ //# sourceMappingURL=index.js.map