@huyooo/ai-chat-frontend-vue 0.1.4 → 0.1.7
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/README.md +367 -0
- package/dist/adapter.d.ts +7 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/components/ChatPanel.vue.d.ts +120 -9
- package/dist/components/ChatPanel.vue.d.ts.map +1 -1
- package/dist/components/common/ConfirmDialog.vue.d.ts +30 -0
- package/dist/components/common/ConfirmDialog.vue.d.ts.map +1 -0
- package/dist/components/common/CopyButton.vue.d.ts +18 -0
- package/dist/components/common/CopyButton.vue.d.ts.map +1 -0
- package/dist/components/common/IndexingSettings.vue.d.ts +3 -0
- package/dist/components/common/IndexingSettings.vue.d.ts.map +1 -0
- package/dist/components/common/SettingsPanel.vue.d.ts +16 -0
- package/dist/components/common/SettingsPanel.vue.d.ts.map +1 -0
- package/dist/components/common/Toast.vue.d.ts +18 -0
- package/dist/components/common/Toast.vue.d.ts.map +1 -0
- package/dist/components/common/ToggleSwitch.vue.d.ts +10 -0
- package/dist/components/common/ToggleSwitch.vue.d.ts.map +1 -0
- package/dist/components/{chat/ui → header}/ChatHeader.vue.d.ts +5 -3
- package/dist/components/header/ChatHeader.vue.d.ts.map +1 -0
- package/dist/components/input/AtFilePicker.vue.d.ts +21 -0
- package/dist/components/input/AtFilePicker.vue.d.ts.map +1 -0
- package/dist/components/{ChatInput.vue.d.ts → input/ChatInput.vue.d.ts} +16 -14
- package/dist/components/input/ChatInput.vue.d.ts.map +1 -0
- package/dist/components/input/DropdownSelector.vue.d.ts +42 -0
- package/dist/components/input/DropdownSelector.vue.d.ts.map +1 -0
- package/dist/components/input/ImagePreviewModal.vue.d.ts +17 -0
- package/dist/components/input/ImagePreviewModal.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtBranchView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtBranchView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtBrowserView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtBrowserView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtChatsView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtChatsView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtDocsView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtDocsView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtFilesView.vue.d.ts +23 -0
- package/dist/components/input/at-views/AtFilesView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtTerminalsView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtTerminalsView.vue.d.ts.map +1 -0
- package/dist/components/message/MessageBubble.vue.d.ts +45 -0
- package/dist/components/message/MessageBubble.vue.d.ts.map +1 -0
- package/dist/components/message/PartsRenderer.vue.d.ts +15 -0
- package/dist/components/message/PartsRenderer.vue.d.ts.map +1 -0
- package/dist/components/message/WelcomeMessage.vue.d.ts +14 -0
- package/dist/components/message/WelcomeMessage.vue.d.ts.map +1 -0
- package/dist/components/message/blocks/CodeBlock.vue.d.ts +11 -0
- package/dist/components/message/blocks/CodeBlock.vue.d.ts.map +1 -0
- package/dist/components/{chat/SearchResultBlock.vue.d.ts → message/blocks/TextBlock.vue.d.ts} +3 -4
- package/dist/components/message/blocks/TextBlock.vue.d.ts.map +1 -0
- package/dist/components/message/blocks/index.d.ts +6 -0
- package/dist/components/message/blocks/index.d.ts.map +1 -0
- package/dist/components/message/parts/CollapsibleCard.vue.d.ts +45 -0
- package/dist/components/message/parts/CollapsibleCard.vue.d.ts.map +1 -0
- package/dist/components/{chat/ToolCallBlock.vue.d.ts → message/parts/ErrorPart.vue.d.ts} +4 -5
- package/dist/components/message/parts/ErrorPart.vue.d.ts.map +1 -0
- package/dist/components/{chat/ThinkingBlock.vue.d.ts → message/parts/ImagePart.vue.d.ts} +3 -3
- package/dist/components/message/parts/ImagePart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/SearchPart.vue.d.ts +12 -0
- package/dist/components/message/parts/SearchPart.vue.d.ts.map +1 -0
- package/dist/components/{chat/messages/ExecutionSteps.vue.d.ts → message/parts/TextPart.vue.d.ts} +2 -9
- package/dist/components/message/parts/TextPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/ThinkingPart.vue.d.ts +12 -0
- package/dist/components/message/parts/ThinkingPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/ToolCallPart.vue.d.ts +19 -0
- package/dist/components/message/parts/ToolCallPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/ToolResultPart.vue.d.ts +14 -0
- package/dist/components/message/parts/ToolResultPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/index.d.ts +12 -0
- package/dist/components/message/parts/index.d.ts.map +1 -0
- package/dist/components/message/tool-results/DefaultToolResult.vue.d.ts +4 -0
- package/dist/components/message/tool-results/DefaultToolResult.vue.d.ts.map +1 -0
- package/dist/components/message/tool-results/SearchResults.vue.d.ts +4 -0
- package/dist/components/message/tool-results/SearchResults.vue.d.ts.map +1 -0
- package/dist/components/message/tool-results/WeatherCard.vue.d.ts +4 -0
- package/dist/components/message/tool-results/WeatherCard.vue.d.ts.map +1 -0
- package/dist/components/message/tool-results/index.d.ts +7 -0
- package/dist/components/message/tool-results/index.d.ts.map +1 -0
- package/dist/components/message/welcome-types.d.ts +28 -0
- package/dist/components/message/welcome-types.d.ts.map +1 -0
- package/dist/composables/useChat.d.ts +99 -44
- package/dist/composables/useChat.d.ts.map +1 -1
- package/dist/composables/useImageUpload.d.ts +55 -0
- package/dist/composables/useImageUpload.d.ts.map +1 -0
- package/dist/index.d.ts +28 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55889 -1359
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +113 -53
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/fileIcon.d.ts +13 -0
- package/dist/utils/fileIcon.d.ts.map +1 -0
- package/package.json +12 -6
- package/src/adapter.ts +12 -70
- package/src/components/ChatPanel.vue +329 -110
- package/src/components/common/ConfirmDialog.vue +208 -0
- package/src/components/common/CopyButton.vue +71 -0
- package/src/components/common/IndexingSettings.vue +580 -0
- package/src/components/common/SettingsPanel.vue +293 -0
- package/src/components/common/Toast.vue +90 -0
- package/src/components/common/ToggleSwitch.vue +75 -0
- package/src/components/{chat/ui → header}/ChatHeader.vue +170 -93
- package/src/components/input/AtFilePicker.vue +657 -0
- package/src/components/input/ChatInput.vue +653 -0
- package/src/components/input/DropdownSelector.vue +322 -0
- package/src/components/input/ImagePreviewModal.vue +238 -0
- package/src/components/input/at-views/AtBranchView.vue +63 -0
- package/src/components/input/at-views/AtBrowserView.vue +63 -0
- package/src/components/input/at-views/AtChatsView.vue +63 -0
- package/src/components/input/at-views/AtDocsView.vue +63 -0
- package/src/components/input/at-views/AtFilesView.vue +255 -0
- package/src/components/input/at-views/AtTerminalsView.vue +63 -0
- package/src/components/message/ContentRenderer.vue +61 -0
- package/src/components/message/MessageBubble.vue +411 -0
- package/src/components/message/PartsRenderer.vue +101 -0
- package/src/components/message/ToolResultRenderer.vue +27 -0
- package/src/components/message/WelcomeMessage.vue +308 -0
- package/src/components/message/blocks/CodeBlock.vue +113 -0
- package/src/components/message/blocks/TextBlock.vue +21 -0
- package/src/components/message/blocks/index.ts +6 -0
- package/src/components/message/parts/CollapsibleCard.vue +135 -0
- package/src/components/message/parts/ErrorPart.vue +51 -0
- package/src/components/message/parts/ImagePart.vue +98 -0
- package/src/components/message/parts/SearchPart.vue +101 -0
- package/src/components/message/parts/TextPart.vue +28 -0
- package/src/components/message/parts/ThinkingPart.vue +54 -0
- package/src/components/message/parts/ToolCallPart.vue +460 -0
- package/src/components/message/parts/ToolResultPart.vue +78 -0
- package/src/components/message/parts/index.ts +13 -0
- package/src/components/message/tool-results/DefaultToolResult.vue +43 -0
- package/src/components/message/tool-results/SearchResults.vue +133 -0
- package/src/components/message/tool-results/WeatherCard.vue +139 -0
- package/src/components/message/tool-results/index.ts +7 -0
- package/src/components/message/welcome-types.ts +47 -0
- package/src/composables/useChat.ts +807 -155
- package/src/composables/useImageUpload.ts +228 -0
- package/src/index.ts +96 -49
- package/src/styles.css +47 -0
- package/src/types/index.ts +146 -98
- package/src/utils/fileIcon.ts +49 -0
- package/dist/components/ChatInput.vue.d.ts.map +0 -1
- package/dist/components/chat/SearchResultBlock.vue.d.ts.map +0 -1
- package/dist/components/chat/ThinkingBlock.vue.d.ts.map +0 -1
- package/dist/components/chat/ToolCallBlock.vue.d.ts.map +0 -1
- package/dist/components/chat/messages/ExecutionSteps.vue.d.ts.map +0 -1
- package/dist/components/chat/messages/MessageBubble.vue.d.ts +0 -28
- package/dist/components/chat/messages/MessageBubble.vue.d.ts.map +0 -1
- package/dist/components/chat/ui/ChatHeader.vue.d.ts.map +0 -1
- package/dist/components/chat/ui/WelcomeMessage.vue.d.ts +0 -7
- package/dist/components/chat/ui/WelcomeMessage.vue.d.ts.map +0 -1
- package/dist/preload/preload.d.ts +0 -6
- package/dist/preload/preload.d.ts.map +0 -1
- package/src/components/ChatInput.vue +0 -649
- package/src/components/chat/SearchResultBlock.vue +0 -155
- package/src/components/chat/ThinkingBlock.vue +0 -109
- package/src/components/chat/ToolCallBlock.vue +0 -213
- package/src/components/chat/messages/ExecutionSteps.vue +0 -281
- package/src/components/chat/messages/MessageBubble.vue +0 -272
- package/src/components/chat/ui/WelcomeMessage.vue +0 -135
- package/src/preload/preload.ts +0 -79
package/README.md
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
# @huyooo/ai-chat-frontend-vue
|
|
2
|
+
|
|
3
|
+
AI Chat 前端组件库 - Vue 版本。
|
|
4
|
+
|
|
5
|
+
> 📖 **深入了解**:查看 [技术架构文档](../../ARCHITECTURE.md) 了解流式渲染、Content Parts 架构、自定义 UI 注入等核心原理。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @huyooo/ai-chat-frontend-vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 快速开始
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<template>
|
|
17
|
+
<ChatPanel :adapter="adapter" />
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { ChatPanel } from '@huyooo/ai-chat-frontend-vue'
|
|
22
|
+
import '@huyooo/ai-chat-frontend-vue/style.css'
|
|
23
|
+
import { createElectronAdapter } from '@huyooo/ai-chat-bridge-electron/renderer'
|
|
24
|
+
|
|
25
|
+
const adapter = createElectronAdapter()
|
|
26
|
+
</script>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 组件
|
|
30
|
+
|
|
31
|
+
### ChatPanel
|
|
32
|
+
|
|
33
|
+
主聊天面板组件。
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<ChatPanel
|
|
37
|
+
:adapter="adapter"
|
|
38
|
+
:working-dir="'/path/to/dir'"
|
|
39
|
+
:default-model="'anthropic/claude-opus-4.5'"
|
|
40
|
+
:default-mode="'agent'"
|
|
41
|
+
:models="modelList"
|
|
42
|
+
:hide-header="false"
|
|
43
|
+
:welcome-config="welcomeConfig"
|
|
44
|
+
@close="handleClose"
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Props
|
|
49
|
+
|
|
50
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
51
|
+
|------|------|--------|------|
|
|
52
|
+
| `adapter` | `ChatAdapter` | 必填 | 通信适配器 |
|
|
53
|
+
| `workingDir` | `string` | - | 工作目录 |
|
|
54
|
+
| `defaultModel` | `string` | `'anthropic/claude-opus-4.5'` | 默认模型 |
|
|
55
|
+
| `defaultMode` | `ChatMode` | `'agent'` | 默认模式 |
|
|
56
|
+
| `models` | `ModelOption[]` | `[]` | 可用模型列表 |
|
|
57
|
+
| `hideHeader` | `boolean` | `false` | 是否隐藏标题栏 |
|
|
58
|
+
| `welcomeConfig` | `Partial<WelcomeConfig>` | - | 欢迎页配置 |
|
|
59
|
+
| `stepsExpandedType` | `'open' \| 'close' \| 'auto'` | `'auto'` | 执行步骤展开模式 |
|
|
60
|
+
| `toolRenderers` | `Record<string, Component>` | `{}` | 自定义工具结果渲染器 |
|
|
61
|
+
| `blockRenderers` | `Record<string, Component>` | `{}` | 自定义内容块渲染器 |
|
|
62
|
+
| `autoRunConfig` | `AutoRunConfig` | - | 自动运行配置 |
|
|
63
|
+
| `onClose` | `() => void` | - | 关闭回调 |
|
|
64
|
+
| `onToolComplete` | `(event: ToolCompleteEvent) => void` | - | 工具执行完成回调 |
|
|
65
|
+
|
|
66
|
+
#### stepsExpandedType 说明
|
|
67
|
+
|
|
68
|
+
控制工具执行步骤的默认展开/折叠行为:
|
|
69
|
+
|
|
70
|
+
| 值 | 说明 |
|
|
71
|
+
|---|------|
|
|
72
|
+
| `'open'` | 始终展开所有步骤 |
|
|
73
|
+
| `'close'` | 始终折叠所有步骤 |
|
|
74
|
+
| `'auto'` | 正在执行的步骤展开,执行完毕自动折叠 |
|
|
75
|
+
|
|
76
|
+
#### autoRunConfig 说明
|
|
77
|
+
|
|
78
|
+
自动运行配置用于控制 Agent 的工具执行行为:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
interface AutoRunConfig {
|
|
82
|
+
mode?: 'run-everything' | 'manual'; // 自动运行模式
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**配置项说明:**
|
|
87
|
+
|
|
88
|
+
- **mode**: 自动运行模式
|
|
89
|
+
- `'run-everything'`: 运行所有内容(自动执行)
|
|
90
|
+
- `'manual'`: 手动批准模式(每次执行前询问)
|
|
91
|
+
|
|
92
|
+
**使用示例:**
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<template>
|
|
96
|
+
<ChatPanel
|
|
97
|
+
:adapter="adapter"
|
|
98
|
+
:working-dir="workingDir"
|
|
99
|
+
:auto-run-config="{
|
|
100
|
+
mode: 'run-everything',
|
|
101
|
+
}"
|
|
102
|
+
/>
|
|
103
|
+
</template>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### WelcomeMessage
|
|
107
|
+
|
|
108
|
+
欢迎页组件,支持自定义配置。
|
|
109
|
+
|
|
110
|
+
```vue
|
|
111
|
+
<WelcomeMessage :config="welcomeConfig" @quick-action="handleQuickAction" />
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 欢迎页配置
|
|
115
|
+
|
|
116
|
+
可以通过 `welcomeConfig` 自定义欢迎页的标题、功能列表和快捷任务。
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import type { WelcomeConfig } from '@huyooo/ai-chat-frontend-vue'
|
|
120
|
+
|
|
121
|
+
const welcomeConfig: Partial<WelcomeConfig> = {
|
|
122
|
+
// 标题区域
|
|
123
|
+
title: '文件助手',
|
|
124
|
+
subtitle: '智能文件管理 · 代码分析',
|
|
125
|
+
icon: 'lucide:folder',
|
|
126
|
+
|
|
127
|
+
// 功能列表
|
|
128
|
+
features: [
|
|
129
|
+
{ name: '执行命令', icon: 'lucide:terminal' },
|
|
130
|
+
{ name: '文件分析', icon: 'lucide:file-search' },
|
|
131
|
+
{ name: '代码生成', icon: 'lucide:code' },
|
|
132
|
+
],
|
|
133
|
+
|
|
134
|
+
// 快捷任务
|
|
135
|
+
tasks: [
|
|
136
|
+
{
|
|
137
|
+
name: '列出文件',
|
|
138
|
+
desc: '查看目录内容',
|
|
139
|
+
prompt: '列出当前目录的文件',
|
|
140
|
+
icon: 'lucide:list',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: '代码分析',
|
|
144
|
+
desc: '分析代码结构',
|
|
145
|
+
prompt: '分析这个项目的代码结构',
|
|
146
|
+
icon: 'lucide:code',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 配置接口
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
interface WelcomeConfig {
|
|
156
|
+
/** 标题 */
|
|
157
|
+
title: string
|
|
158
|
+
/** 副标题 */
|
|
159
|
+
subtitle: string
|
|
160
|
+
/** 图标 (Iconify 格式) */
|
|
161
|
+
icon: string
|
|
162
|
+
/** 功能列表 */
|
|
163
|
+
features: WelcomeFeature[]
|
|
164
|
+
/** 快捷任务 */
|
|
165
|
+
tasks: WelcomeTask[]
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface WelcomeFeature {
|
|
169
|
+
name: string
|
|
170
|
+
icon: string
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface WelcomeTask {
|
|
174
|
+
name: string
|
|
175
|
+
desc: string
|
|
176
|
+
prompt: string
|
|
177
|
+
icon: string
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 默认配置
|
|
182
|
+
|
|
183
|
+
如果不传 `welcomeConfig`,将使用内置的默认配置。也可以只覆盖部分字段:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
// 只修改标题,其他使用默认
|
|
187
|
+
const welcomeConfig = {
|
|
188
|
+
title: '我的 AI 助手',
|
|
189
|
+
subtitle: '智能对话工具',
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
可以导入默认配置作为基础:
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
import { defaultWelcomeConfig } from '@huyooo/ai-chat-frontend-vue'
|
|
197
|
+
|
|
198
|
+
const welcomeConfig = {
|
|
199
|
+
...defaultWelcomeConfig,
|
|
200
|
+
title: '自定义标题',
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## 自定义工具结果渲染器
|
|
205
|
+
|
|
206
|
+
可以为特定工具注入自定义渲染组件,替代默认的 JSON 显示:
|
|
207
|
+
|
|
208
|
+
```vue
|
|
209
|
+
<template>
|
|
210
|
+
<ChatPanel
|
|
211
|
+
:adapter="adapter"
|
|
212
|
+
:tool-renderers="toolRenderers"
|
|
213
|
+
/>
|
|
214
|
+
</template>
|
|
215
|
+
|
|
216
|
+
<script setup lang="ts">
|
|
217
|
+
import { markRaw, type Component } from 'vue'
|
|
218
|
+
import { ChatPanel } from '@huyooo/ai-chat-frontend-vue'
|
|
219
|
+
import CustomWeatherCard from './components/CustomWeatherCard.vue'
|
|
220
|
+
|
|
221
|
+
// 工具名称 -> 渲染组件映射
|
|
222
|
+
const toolRenderers: Record<string, Component> = {
|
|
223
|
+
get_weather: markRaw(CustomWeatherCard),
|
|
224
|
+
// search_web: markRaw(CustomSearchResults),
|
|
225
|
+
}
|
|
226
|
+
</script>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### 创建自定义渲染组件
|
|
230
|
+
|
|
231
|
+
```vue
|
|
232
|
+
<!-- CustomWeatherCard.vue -->
|
|
233
|
+
<template>
|
|
234
|
+
<div class="weather-card">
|
|
235
|
+
<div class="city">{{ weather.city }}</div>
|
|
236
|
+
<div class="temp">{{ weather.temperature }}°C</div>
|
|
237
|
+
<div class="condition">{{ weather.condition }}</div>
|
|
238
|
+
<div class="details">
|
|
239
|
+
<span>湿度 {{ weather.humidity }}%</span>
|
|
240
|
+
<span>{{ weather.wind }}</span>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</template>
|
|
244
|
+
|
|
245
|
+
<script setup lang="ts">
|
|
246
|
+
import { computed } from 'vue'
|
|
247
|
+
import type { ToolRendererProps, WeatherData } from '@huyooo/ai-chat-shared'
|
|
248
|
+
|
|
249
|
+
const props = defineProps<ToolRendererProps>()
|
|
250
|
+
|
|
251
|
+
const weather = computed<WeatherData>(() => {
|
|
252
|
+
if (typeof props.toolResult === 'object' && props.toolResult !== null) {
|
|
253
|
+
return props.toolResult as WeatherData
|
|
254
|
+
}
|
|
255
|
+
return { city: '未知', temperature: 0, condition: '未知' }
|
|
256
|
+
})
|
|
257
|
+
</script>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### ToolRendererProps 接口
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
interface ToolRendererProps {
|
|
264
|
+
toolName: string // 工具名称
|
|
265
|
+
toolArgs: object // 工具调用参数
|
|
266
|
+
toolResult: unknown // 工具返回结果
|
|
267
|
+
status: 'running' | 'done' | 'error' // 执行状态
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### 内置数据类型
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
// 天气数据
|
|
275
|
+
interface WeatherData {
|
|
276
|
+
city: string
|
|
277
|
+
temperature: number
|
|
278
|
+
condition: string
|
|
279
|
+
humidity?: number
|
|
280
|
+
wind?: string
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// 搜索结果
|
|
284
|
+
interface SearchResultItem {
|
|
285
|
+
title: string
|
|
286
|
+
url: string
|
|
287
|
+
snippet: string
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## 自定义内容块渲染器
|
|
292
|
+
|
|
293
|
+
可以为特定内容类型注入自定义渲染组件:
|
|
294
|
+
|
|
295
|
+
```vue
|
|
296
|
+
<template>
|
|
297
|
+
<ChatPanel
|
|
298
|
+
:adapter="adapter"
|
|
299
|
+
:block-renderers="blockRenderers"
|
|
300
|
+
/>
|
|
301
|
+
</template>
|
|
302
|
+
|
|
303
|
+
<script setup lang="ts">
|
|
304
|
+
import { markRaw, type Component } from 'vue'
|
|
305
|
+
import CustomMathBlock from './components/CustomMathBlock.vue'
|
|
306
|
+
|
|
307
|
+
const blockRenderers: Record<string, Component> = {
|
|
308
|
+
math: markRaw(CustomMathBlock),
|
|
309
|
+
}
|
|
310
|
+
</script>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## useChat
|
|
314
|
+
|
|
315
|
+
Composable 函数,用于自定义 UI。
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
import { useChat } from '@huyooo/ai-chat-frontend-vue'
|
|
319
|
+
|
|
320
|
+
const {
|
|
321
|
+
messages,
|
|
322
|
+
isLoading,
|
|
323
|
+
sendMessage,
|
|
324
|
+
regenerateMessage,
|
|
325
|
+
abort,
|
|
326
|
+
clearHistory,
|
|
327
|
+
} = useChat({ adapter })
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## 导出
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
// 主组件
|
|
334
|
+
export { ChatPanel, WelcomeMessage, ChatInput, ChatHeader, MessageBubble }
|
|
335
|
+
|
|
336
|
+
// 内容渲染组件
|
|
337
|
+
export { ContentRenderer, TextBlock, CodeBlock }
|
|
338
|
+
|
|
339
|
+
// 工具结果渲染组件
|
|
340
|
+
export { ToolResultRenderer, DefaultToolResult, WeatherCard, SearchResults }
|
|
341
|
+
|
|
342
|
+
// Composable
|
|
343
|
+
export { useChat }
|
|
344
|
+
|
|
345
|
+
// 类型 (来自 @huyooo/ai-chat-shared)
|
|
346
|
+
export type {
|
|
347
|
+
WelcomeConfig,
|
|
348
|
+
WelcomeFeature,
|
|
349
|
+
WelcomeTask,
|
|
350
|
+
ToolRendererProps,
|
|
351
|
+
WeatherData,
|
|
352
|
+
SearchResultItem,
|
|
353
|
+
ContentBlock,
|
|
354
|
+
TextBlock,
|
|
355
|
+
CodeBlock
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// 工具函数 (来自 @huyooo/ai-chat-shared)
|
|
359
|
+
export { parseContent, highlightCode, getLanguageDisplayName }
|
|
360
|
+
|
|
361
|
+
// 默认配置
|
|
362
|
+
export { defaultWelcomeConfig }
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## License
|
|
366
|
+
|
|
367
|
+
MIT
|
package/dist/adapter.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ChatAdapter as ChatAdapterType, ChatMode, ThinkingMode } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
2
|
+
/**
|
|
3
|
+
* 重新导出 ChatAdapter 类型供内部组件使用
|
|
4
|
+
*/
|
|
2
5
|
export type ChatAdapter = ChatAdapterType;
|
|
3
6
|
/** 思考数据 */
|
|
4
7
|
export interface ThinkingData {
|
|
@@ -25,6 +28,7 @@ export interface SendMessageOptions {
|
|
|
25
28
|
mode: ChatMode;
|
|
26
29
|
model: string;
|
|
27
30
|
enableWebSearch: boolean;
|
|
31
|
+
/** 深度思考开关(每个 provider 内部使用最优参数) */
|
|
28
32
|
thinkingMode: ThinkingMode;
|
|
29
33
|
}
|
|
30
34
|
/** 创建会话选项 */
|
|
@@ -44,12 +48,8 @@ export interface SaveMessageOptions {
|
|
|
44
48
|
sessionId: string;
|
|
45
49
|
role: 'user' | 'assistant';
|
|
46
50
|
content: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
/** 执行步骤列表 JSON */
|
|
52
|
+
steps?: string;
|
|
53
|
+
operationIds?: string;
|
|
50
54
|
}
|
|
51
|
-
/**
|
|
52
|
-
* 创建空 Adapter(用于测试或无后端场景)
|
|
53
|
-
*/
|
|
54
|
-
export declare function createNullAdapter(): ChatAdapterType;
|
|
55
55
|
//# sourceMappingURL=adapter.d.ts.map
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,EACR,YAAY,EACb,MAAM,0CAA0C,CAAA;AAEjD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAA;AAEzC,WAAW;AACX,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,aAAa;AACb,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,aAAa;AACb,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,WAAW;AACX,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,aAAa;AACb,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,OAAO,CAAA;IACxB,mCAAmC;IACnC,YAAY,EAAE,YAAY,CAAA;CAC3B;AAED,aAAa;AACb,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,aAAa;AACb,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB;AAED,aAAa;AACb,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
|
@@ -1,38 +1,149 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
1
2
|
import { ChatAdapter } from '../adapter';
|
|
2
|
-
import {
|
|
3
|
+
import { ModelOption, ChatMode } from '../types';
|
|
4
|
+
import { ToolCompleteEvent } from '../composables/useChat';
|
|
5
|
+
import { WelcomeConfig } from './message/welcome-types';
|
|
3
6
|
interface Props {
|
|
4
7
|
/** Adapter 实例 */
|
|
5
|
-
adapter
|
|
6
|
-
/** 工作目录 */
|
|
7
|
-
workingDir?: string;
|
|
8
|
+
adapter: ChatAdapter;
|
|
8
9
|
/** 默认模型 */
|
|
9
10
|
defaultModel?: string;
|
|
10
11
|
/** 默认模式 */
|
|
11
12
|
defaultMode?: ChatMode;
|
|
12
13
|
/** 可用模型列表 */
|
|
13
|
-
models?:
|
|
14
|
+
models?: ModelOption[];
|
|
14
15
|
/** 隐藏标题栏 */
|
|
15
16
|
hideHeader?: boolean;
|
|
16
17
|
/** 关闭回调(有此属性时显示关闭按钮) */
|
|
17
18
|
onClose?: () => void;
|
|
18
19
|
/** 自定义类名 */
|
|
19
20
|
className?: string;
|
|
21
|
+
/** 欢迎页配置 */
|
|
22
|
+
welcomeConfig?: Partial<WelcomeConfig>;
|
|
23
|
+
/** 自定义工具结果渲染器 - 根据工具名称选择渲染组件 */
|
|
24
|
+
toolRenderers?: Record<string, Component>;
|
|
25
|
+
/**
|
|
26
|
+
* 执行步骤折叠模式
|
|
27
|
+
* - 'open': 始终展开
|
|
28
|
+
* - 'close': 始终折叠
|
|
29
|
+
* - 'auto': 执行时展开,完成后折叠
|
|
30
|
+
*/
|
|
31
|
+
stepsExpandedType?: 'open' | 'close' | 'auto';
|
|
20
32
|
}
|
|
21
|
-
declare const _default: import('vue').DefineComponent<Props, {
|
|
33
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
34
|
+
/** 设置输入框内容 */
|
|
35
|
+
setInputText: (text: string) => void;
|
|
36
|
+
/** 在光标位置插入文本(用于 @ 上下文) */
|
|
37
|
+
insertInputText: (text: string) => void;
|
|
38
|
+
/** 聚焦输入框 */
|
|
39
|
+
focusInput: () => void;
|
|
40
|
+
/** 发送消息 */
|
|
41
|
+
sendMessage: (text: string) => void;
|
|
42
|
+
/** 当前工作目录 */
|
|
43
|
+
setCwd: (dir: string) => void;
|
|
44
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
45
|
close: () => any;
|
|
46
|
+
"tool-complete": (event: ToolCompleteEvent) => any;
|
|
23
47
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
24
48
|
onClose?: (() => any) | undefined;
|
|
49
|
+
"onTool-complete"?: ((event: ToolCompleteEvent) => any) | undefined;
|
|
25
50
|
}>, {
|
|
26
|
-
adapter: ChatAdapter;
|
|
27
51
|
defaultModel: string;
|
|
28
52
|
defaultMode: ChatMode;
|
|
29
53
|
onClose: () => void;
|
|
30
|
-
models:
|
|
31
|
-
|
|
54
|
+
models: ModelOption[];
|
|
55
|
+
toolRenderers: Record<string, Component>;
|
|
56
|
+
stepsExpandedType: "open" | "close" | "auto";
|
|
32
57
|
hideHeader: boolean;
|
|
33
58
|
className: string;
|
|
59
|
+
welcomeConfig: Partial<WelcomeConfig>;
|
|
34
60
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
35
61
|
messagesRef: HTMLDivElement;
|
|
62
|
+
chatInputRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
63
|
+
variant?: "input" | "message";
|
|
64
|
+
value?: string;
|
|
65
|
+
isLoading?: boolean;
|
|
66
|
+
mode?: ChatMode;
|
|
67
|
+
model?: string;
|
|
68
|
+
models?: ModelOption[];
|
|
69
|
+
webSearchEnabled?: boolean;
|
|
70
|
+
thinkingEnabled?: boolean;
|
|
71
|
+
}> & Readonly<{
|
|
72
|
+
onCancel?: (() => any) | undefined;
|
|
73
|
+
onSend?: ((text: string, images?: import('..').ImageData[] | undefined) => any) | undefined;
|
|
74
|
+
"onAt-context"?: (() => any) | undefined;
|
|
75
|
+
"onUpdate:mode"?: ((mode: import('@huyooo/ai-chat-bridge-electron/renderer').ChatMode) => any) | undefined;
|
|
76
|
+
"onUpdate:model"?: ((model: string) => any) | undefined;
|
|
77
|
+
"onUpdate:webSearch"?: ((enabled: boolean) => any) | undefined;
|
|
78
|
+
"onUpdate:thinking"?: ((enabled: boolean) => any) | undefined;
|
|
79
|
+
}>, {
|
|
80
|
+
focus: () => void | undefined;
|
|
81
|
+
setText: (text: string) => void;
|
|
82
|
+
insertText: (text: string) => void;
|
|
83
|
+
clear: () => void;
|
|
84
|
+
addImages: (files: File[]) => void;
|
|
85
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
86
|
+
cancel: () => any;
|
|
87
|
+
send: (text: string, images?: import('..').ImageData[] | undefined) => any;
|
|
88
|
+
"at-context": () => any;
|
|
89
|
+
"update:mode": (mode: import('@huyooo/ai-chat-bridge-electron/renderer').ChatMode) => any;
|
|
90
|
+
"update:model": (model: string) => any;
|
|
91
|
+
"update:webSearch": (enabled: boolean) => any;
|
|
92
|
+
"update:thinking": (enabled: boolean) => any;
|
|
93
|
+
}, import('vue').PublicProps, {
|
|
94
|
+
isLoading: boolean;
|
|
95
|
+
model: string;
|
|
96
|
+
mode: ChatMode;
|
|
97
|
+
webSearchEnabled: boolean;
|
|
98
|
+
thinkingEnabled: boolean;
|
|
99
|
+
value: string;
|
|
100
|
+
variant: "input" | "message";
|
|
101
|
+
models: ModelOption[];
|
|
102
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
103
|
+
containerRef: HTMLDivElement;
|
|
104
|
+
inputRef: HTMLTextAreaElement;
|
|
105
|
+
imageInputRef: HTMLInputElement;
|
|
106
|
+
atSelectorRef: HTMLDivElement;
|
|
107
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
108
|
+
P: {};
|
|
109
|
+
B: {};
|
|
110
|
+
D: {};
|
|
111
|
+
C: {};
|
|
112
|
+
M: {};
|
|
113
|
+
Defaults: {};
|
|
114
|
+
}, Readonly<{
|
|
115
|
+
variant?: "input" | "message";
|
|
116
|
+
value?: string;
|
|
117
|
+
isLoading?: boolean;
|
|
118
|
+
mode?: ChatMode;
|
|
119
|
+
model?: string;
|
|
120
|
+
models?: ModelOption[];
|
|
121
|
+
webSearchEnabled?: boolean;
|
|
122
|
+
thinkingEnabled?: boolean;
|
|
123
|
+
}> & Readonly<{
|
|
124
|
+
onCancel?: (() => any) | undefined;
|
|
125
|
+
onSend?: ((text: string, images?: import('..').ImageData[] | undefined) => any) | undefined;
|
|
126
|
+
"onAt-context"?: (() => any) | undefined;
|
|
127
|
+
"onUpdate:mode"?: ((mode: import('@huyooo/ai-chat-bridge-electron/renderer').ChatMode) => any) | undefined;
|
|
128
|
+
"onUpdate:model"?: ((model: string) => any) | undefined;
|
|
129
|
+
"onUpdate:webSearch"?: ((enabled: boolean) => any) | undefined;
|
|
130
|
+
"onUpdate:thinking"?: ((enabled: boolean) => any) | undefined;
|
|
131
|
+
}>, {
|
|
132
|
+
focus: () => void | undefined;
|
|
133
|
+
setText: (text: string) => void;
|
|
134
|
+
insertText: (text: string) => void;
|
|
135
|
+
clear: () => void;
|
|
136
|
+
addImages: (files: File[]) => void;
|
|
137
|
+
}, {}, {}, {}, {
|
|
138
|
+
isLoading: boolean;
|
|
139
|
+
model: string;
|
|
140
|
+
mode: ChatMode;
|
|
141
|
+
webSearchEnabled: boolean;
|
|
142
|
+
thinkingEnabled: boolean;
|
|
143
|
+
value: string;
|
|
144
|
+
variant: "input" | "message";
|
|
145
|
+
models: ModelOption[];
|
|
146
|
+
}> | null;
|
|
36
147
|
}, HTMLDivElement>;
|
|
37
148
|
export default _default;
|
|
38
149
|
//# sourceMappingURL=ChatPanel.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.vue"],"names":[],"mappings":"AAsGA;AAkhBA,OAAO,EAA6D,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAWtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,UAAU,KAAK;IACb,iBAAiB;IACjB,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW;IACX,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,aAAa;IACb,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,YAAY;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY;IACZ,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACvC,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CAC/C;;IA0SC,cAAc;yBACO,MAAM;IAG3B,0BAA0B;4BACF,MAAM;IAG9B,YAAY;;IAIZ,WAAW;wBACS,MAAM;IAG1B,aAAa;;;;;;;;;kBAhVE,MAAM;iBAEP,QAAQ;aAMZ,MAAM,IAAI;YAJX,WAAW,EAAE;mBAUN,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;uBAOrB,MAAM,GAAG,OAAO,GAAG,MAAM;gBAfhC,OAAO;eAIR,MAAM;mBAEF,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqvBxC,wBAWG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** 是否显示 */
|
|
3
|
+
visible: boolean;
|
|
4
|
+
/** 标题 */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** 消息内容 */
|
|
7
|
+
message: string;
|
|
8
|
+
/** 类型:info | warning | danger */
|
|
9
|
+
type?: 'info' | 'warning' | 'danger';
|
|
10
|
+
/** 确认按钮文字 */
|
|
11
|
+
confirmText?: string;
|
|
12
|
+
/** 取消按钮文字 */
|
|
13
|
+
cancelText?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
cancel: () => any;
|
|
17
|
+
"update:visible": (value: boolean) => any;
|
|
18
|
+
confirm: () => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
20
|
+
onCancel?: (() => any) | undefined;
|
|
21
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
22
|
+
onConfirm?: (() => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
type: "info" | "warning" | "danger";
|
|
25
|
+
title: string;
|
|
26
|
+
confirmText: string;
|
|
27
|
+
cancelText: string;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
export default _default;
|
|
30
|
+
//# sourceMappingURL=ConfirmDialog.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/components/common/ConfirmDialog.vue"],"names":[],"mappings":"AA2BA;AAoNA,UAAU,KAAK;IACb,WAAW;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrC,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;;;;;;;;;UALQ,MAAM,GAAG,SAAS,GAAG,QAAQ;WAJ5B,MAAM;iBAMA,MAAM;gBAEP,MAAM;;AAoMrB,wBASG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 要复制的文本 */
|
|
3
|
+
text: string;
|
|
4
|
+
/** 按钮标题 */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** 图标大小 */
|
|
7
|
+
size?: number;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
copy: (text: string) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onCopy?: ((text: string) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
size: number;
|
|
15
|
+
title: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=CopyButton.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/common/CopyButton.vue"],"names":[],"mappings":"AAUA;AA4EA,KAAK,WAAW,GAAG;IACjB,aAAa;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;;;;;UADO,MAAM;WAFL,MAAM;;AA8FhB,wBASG"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=IndexingSettings.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndexingSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/components/common/IndexingSettings.vue"],"names":[],"mappings":"AA4FA;;AAwnCA,wBAKG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AutoRunConfig } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
2
|
+
type __VLS_PublicProps = {
|
|
3
|
+
'visible': boolean;
|
|
4
|
+
'config': AutoRunConfig;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:visible": (value: boolean) => any;
|
|
8
|
+
save: (config: AutoRunConfig) => any;
|
|
9
|
+
"update:config": (value: AutoRunConfig) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
12
|
+
onSave?: ((config: AutoRunConfig) => any) | undefined;
|
|
13
|
+
"onUpdate:config"?: ((value: AutoRunConfig) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=SettingsPanel.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsPanel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/common/SettingsPanel.vue"],"names":[],"mappings":"AA0DA;AAySA,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,0CAA0C,CAAA;AA+C1F,KAAK,iBAAiB,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,aAAa,CAAC;CACvB,CAAC;;;;;;;;;;AAsMF,wBAOG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
message: string;
|
|
3
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
duration?: number;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = {
|
|
7
|
+
'visible'?: boolean;
|
|
8
|
+
} & __VLS_Props;
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"update:visible": (value: boolean) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
type: "info" | "success" | "warning" | "error";
|
|
15
|
+
duration: number;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=Toast.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.vue.d.ts","sourceRoot":"","sources":["../../../src/components/common/Toast.vue"],"names":[],"mappings":"AA8FA,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AA4BJ,KAAK,iBAAiB,GAAG;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,WAAW,CAAC;;;;;;UAhCL,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO;cACpC,MAAM;;AAmHrB,wBASG"}
|