xx-ai-cli 0.1.57 → 0.1.58
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 +153 -204
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +249 -4
- package/dist/commands/agent.js.map +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +2 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/tools.d.ts +2 -0
- package/dist/core/tools.d.ts.map +1 -1
- package/dist/core/tools.js +60 -35
- package/dist/core/tools.js.map +1 -1
- package/dist/index.js +4 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# 🤖 XX-AI-CLI
|
|
2
2
|
|
|
3
|
-
> 国内主流大模型命令行工具,支持 DeepSeek、通义千问、智谱GLM、豆包、Kimi
|
|
3
|
+
> 国内主流大模型命令行工具,支持 DeepSeek、通义千问、智谱GLM、豆包、Kimi、MiniMax、腾讯混元、百度文心等 8 大平台。
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/xx-ai-cli)
|
|
5
6
|
[](https://nodejs.org)
|
|
6
7
|
[](https://www.typescriptlang.org)
|
|
7
8
|
|
|
@@ -9,294 +10,238 @@
|
|
|
9
10
|
|
|
10
11
|
## ✨ 功能特性
|
|
11
12
|
|
|
12
|
-
- 🗨️ **交互式对话** -
|
|
13
|
+
- 🗨️ **交互式对话** - 多轮对话,支持历史上下文,自动持久化
|
|
14
|
+
- 🤖 **Agent 模式** - 自主执行任务,调用工具(文件读写、命令执行、联网搜索)
|
|
13
15
|
- ⚡ **单次提问** - 快速问答,流式输出
|
|
14
16
|
- 💻 **代码助手** - 生成、解释、优化、Review 代码
|
|
15
17
|
- 📄 **文件分析** - 读取本地文件让 AI 分析
|
|
16
18
|
- 🔧 **命令建议** - 自然语言转 Shell 命令
|
|
17
|
-
- 🔄 **多模型切换** -
|
|
18
|
-
- 🎯 **一键初始化** - `
|
|
19
|
+
- 🔄 **多模型切换** - 对话中随时切换,无需重启
|
|
20
|
+
- 🎯 **一键初始化** - `xx init` 交互式向导,新用户 1 分钟完成配置
|
|
19
21
|
- 📚 **历史会话** - 查看、恢复任意历史对话
|
|
20
22
|
- 🔗 **管道输入** - `cat file | xx "问题"` 无缝联动其他工具
|
|
21
23
|
|
|
22
|
-
## 📦 支持的模型
|
|
23
|
-
|
|
24
|
-
| 模型 | Provider | 获取 API Key |
|
|
25
|
-
| ------------- | ---------- | -------------------------------------------------------------------- |
|
|
26
|
-
| DeepSeek | `deepseek` | [platform.deepseek.com](https://platform.deepseek.com) |
|
|
27
|
-
| 通义千问 | `qwen` | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) |
|
|
28
|
-
| 智谱 GLM | `glm` | [open.bigmodel.cn](https://open.bigmodel.cn) |
|
|
29
|
-
| 豆包 | `doubao` | [console.volcengine.com](https://console.volcengine.com/ark) |
|
|
30
|
-
| 月之暗面 Kimi | `moonshot` | [platform.moonshot.cn](https://platform.moonshot.cn) |
|
|
31
|
-
|
|
32
24
|
---
|
|
33
25
|
|
|
34
|
-
##
|
|
35
|
-
|
|
36
|
-
我们深知 API Key 是你访问 AI 服务的凭证,安全性至关重要。以下是本工具对 Key 的完整处理机制,请放心使用。
|
|
37
|
-
|
|
38
|
-
### ✅ Key 绝不离开你的设备
|
|
39
|
-
|
|
40
|
-
- **本工具不设任何服务端**,没有后台、没有中转服务器,所有 AI 请求均由你的设备**直连**各模型官方 API(DeepSeek、阿里云、智谱等)
|
|
41
|
-
- Key **仅用于构造请求头** `Authorization: Bearer <key>`,直接发送给对应平台,全程不经过任何第三方
|
|
42
|
-
- 本工具代码**完全开源**,你可以自行审查 [`src/core/stream.ts`](src/core/stream.ts) 中的网络请求逻辑
|
|
43
|
-
|
|
44
|
-
### ✅ Key 的存储位置
|
|
45
|
-
|
|
46
|
-
当你使用 `xxcli model set-key` 或 `xxcli init` 保存 Key 时,Key **仅写入你本机的用户配置目录**:
|
|
26
|
+
## 📦 支持的模型
|
|
47
27
|
|
|
48
|
-
|
|
|
49
|
-
| ------------- |
|
|
50
|
-
|
|
|
51
|
-
|
|
|
28
|
+
| 模型 | Provider | 默认模型 | 获取 API Key |
|
|
29
|
+
| ------------- | ---------- | -------------- | -------------------------------------------------------------------- |
|
|
30
|
+
| DeepSeek | `deepseek` | deepseek-chat | [platform.deepseek.com](https://platform.deepseek.com) |
|
|
31
|
+
| 通义千问 | `qwen` | qwen-turbo | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) |
|
|
32
|
+
| 智谱 GLM | `glm` | glm-4-flash | [open.bigmodel.cn](https://open.bigmodel.cn) |
|
|
33
|
+
| 豆包 | `doubao` | doubao-pro-4k | [console.volcengine.com](https://console.volcengine.com/ark) |
|
|
34
|
+
| 月之暗面 Kimi | `moonshot` | moonshot-v1-8k | [platform.moonshot.cn](https://platform.moonshot.cn) |
|
|
35
|
+
| MiniMax 海螺 | `minimax` | abab6.5s-chat | [api.minimax.chat](https://api.minimax.chat) |
|
|
36
|
+
| 腾讯混元 | `hunyuan` | hunyuan-pro | [cloud.tencent.com](https://cloud.tencent.com/product/hunyuan) |
|
|
37
|
+
| 百度文心一言 | `ernie` | ernie-4.0-8k | [qianfan.baidu.com](https://qianfan.baidu.com) |
|
|
52
38
|
|
|
53
|
-
|
|
54
|
-
- 只有当前用户有读写权限
|
|
55
|
-
- 你可以随时运行 `xxcli config show` 查看配置文件的完整路径
|
|
39
|
+
---
|
|
56
40
|
|
|
57
|
-
|
|
41
|
+
## 🚀 快速开始
|
|
58
42
|
|
|
59
|
-
|
|
43
|
+
### 安装
|
|
60
44
|
|
|
61
|
-
```
|
|
62
|
-
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g xx-ai-cli
|
|
63
47
|
```
|
|
64
48
|
|
|
65
|
-
|
|
49
|
+
安装后提供两个命令:`xx`(短别名,推荐)和 `xxcli`(完整名)。
|
|
66
50
|
|
|
67
|
-
###
|
|
51
|
+
### 初始化
|
|
68
52
|
|
|
69
53
|
```bash
|
|
70
|
-
|
|
71
|
-
xxcli model set-key deepseek sk-xxxxxxxxxxxxxxxx
|
|
72
|
-
|
|
73
|
-
# 方式二:隐藏输入模式(输入不会显示和记录到 shell history,推荐)
|
|
74
|
-
xxcli model set-key deepseek
|
|
75
|
-
# 然后在提示符下输入 Key,输入内容不会回显
|
|
76
|
-
|
|
77
|
-
# 方式三:环境变量(Key 永不写入磁盘,最安全)
|
|
78
|
-
export DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxxxxx
|
|
79
|
-
xx chat # 自动读取环境变量,重启终端后自动失效
|
|
54
|
+
xx init
|
|
80
55
|
```
|
|
81
56
|
|
|
82
|
-
|
|
57
|
+
向导会引导你:选择模型 → 输入 API Key → 设置默认模型 → 开启流式输出,1 分钟完成配置。
|
|
83
58
|
|
|
84
|
-
|
|
85
|
-
| ------------- | ------------------ |
|
|
86
|
-
| DeepSeek | `DEEPSEEK_API_KEY` |
|
|
87
|
-
| 通义千问 | `QWEN_API_KEY` |
|
|
88
|
-
| 智谱 GLM | `GLM_API_KEY` |
|
|
89
|
-
| 豆包 | `DOUBAO_API_KEY` |
|
|
90
|
-
| 月之暗面 Kimi | `MOONSHOT_API_KEY` |
|
|
91
|
-
| MiniMax 海螺 | `MINIMAX_API_KEY` |
|
|
92
|
-
| 腾讯混元 | `HUNYUAN_API_KEY` |
|
|
93
|
-
| 百度文心一言 | `ERNIE_API_KEY` |
|
|
59
|
+
---
|
|
94
60
|
|
|
95
|
-
|
|
61
|
+
## 📖 使用示例
|
|
96
62
|
|
|
97
|
-
###
|
|
63
|
+
### 💬 交互式对话
|
|
98
64
|
|
|
99
|
-
|
|
65
|
+
```bash
|
|
66
|
+
xx chat
|
|
67
|
+
xx chat --model qwen
|
|
68
|
+
xx chat --system "你是一个 Python 专家"
|
|
69
|
+
```
|
|
100
70
|
|
|
101
|
-
|
|
71
|
+
**对话内置命令(输入 `/` 可查看全部):**
|
|
102
72
|
|
|
103
|
-
|
|
73
|
+
| 命令 | 说明 |
|
|
74
|
+
| ---------- | ---------------------- |
|
|
75
|
+
| `/clear` | 清空当前对话 |
|
|
76
|
+
| `/model` | 切换模型(无需退出) |
|
|
77
|
+
| `/history` | 查看最近 10 条历史会话 |
|
|
78
|
+
| `/exit` | 退出(会话自动保存) |
|
|
104
79
|
|
|
105
|
-
###
|
|
80
|
+
### 🤖 Agent 模式(自主执行任务)
|
|
106
81
|
|
|
107
82
|
```bash
|
|
108
|
-
|
|
83
|
+
xx agent "帮我查一下杭州今天的天气"
|
|
84
|
+
xx agent "读取 src/index.ts,找出潜在 Bug"
|
|
85
|
+
xx agent "帮我改一下 deepseek 的 API Key"
|
|
86
|
+
xx agent --model deepseek "分析当前项目结构"
|
|
109
87
|
```
|
|
110
88
|
|
|
111
|
-
|
|
89
|
+
**Agent 对话内置命令(输入 `/` 可查看全部):**
|
|
90
|
+
|
|
91
|
+
| 命令 | 说明 |
|
|
92
|
+
| -------------- | ------------------ |
|
|
93
|
+
| `/clear` | 清空当前对话 |
|
|
94
|
+
| `/tools` | 查看可用工具列表 |
|
|
95
|
+
| `/context` | 查看当前上下文内容 |
|
|
96
|
+
| `/tokens` | Token 消耗统计 |
|
|
97
|
+
| `/model` | 切换模型 |
|
|
98
|
+
| `/cache clear` | 清空工具缓存 |
|
|
99
|
+
| `/exit` | 退出 |
|
|
100
|
+
|
|
101
|
+
### ⚡ 单次提问
|
|
112
102
|
|
|
113
103
|
```bash
|
|
114
|
-
|
|
104
|
+
xx ask "什么是 CAP 定理"
|
|
105
|
+
xx ask "解释 React Hooks" --model glm
|
|
106
|
+
xx ask "写个斐波那契数列" --no-stream
|
|
115
107
|
```
|
|
116
108
|
|
|
117
|
-
###
|
|
109
|
+
### 💻 代码助手
|
|
118
110
|
|
|
119
111
|
```bash
|
|
120
|
-
|
|
121
|
-
|
|
112
|
+
# 生成代码
|
|
113
|
+
xx code gen "用 TypeScript 写一个单例模式"
|
|
122
114
|
|
|
123
|
-
|
|
115
|
+
# 解释代码
|
|
116
|
+
xx code explain ./src/index.ts
|
|
124
117
|
|
|
125
|
-
|
|
118
|
+
# 优化代码
|
|
119
|
+
xx code optimize ./src/utils.ts
|
|
126
120
|
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
# Code Review
|
|
122
|
+
xx code review ./src/api.ts
|
|
129
123
|
```
|
|
130
124
|
|
|
131
|
-
###
|
|
125
|
+
### 📄 文件分析
|
|
132
126
|
|
|
133
127
|
```bash
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
xx init
|
|
128
|
+
xx file ./package.json "这个项目依赖了哪些主要库?"
|
|
129
|
+
xx file ./src/index.ts "帮我找出潜在的 Bug"
|
|
137
130
|
```
|
|
138
131
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
配置完成后即可开始使用!
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
---
|
|
132
|
+
### 🔧 Shell 命令建议
|
|
146
133
|
|
|
147
|
-
|
|
134
|
+
```bash
|
|
135
|
+
xx cmd "找出所有大于 1MB 的文件"
|
|
136
|
+
xx cmd "查看端口 8080 被哪个进程占用"
|
|
137
|
+
xx cmd "统计当前目录下 ts 文件数量"
|
|
138
|
+
```
|
|
148
139
|
|
|
149
|
-
### 🔗
|
|
140
|
+
### 🔗 管道输入
|
|
150
141
|
|
|
151
142
|
```bash
|
|
152
|
-
# 分析错误日志
|
|
153
143
|
cat error.log | xx "帮我分析这个错误"
|
|
154
|
-
|
|
155
|
-
# 生成 Git commit message
|
|
156
144
|
git diff | xx "帮我写 commit message"
|
|
157
|
-
|
|
158
|
-
# Review 代码文件
|
|
159
145
|
cat src/utils.ts | xx "帮我 code review"
|
|
160
|
-
|
|
161
|
-
# 分析 JSON 配置
|
|
162
|
-
cat package.json | xx "这个项目用了哪些主要依赖"
|
|
163
|
-
|
|
164
|
-
# 无问题时自动分析内容
|
|
165
|
-
cat README.md | xx
|
|
166
146
|
```
|
|
167
147
|
|
|
168
148
|
### 📚 历史会话管理
|
|
169
149
|
|
|
170
150
|
```bash
|
|
171
|
-
# 列出最近 20 条历史会话
|
|
172
|
-
|
|
173
|
-
xx history
|
|
174
|
-
|
|
175
|
-
# 查看某条历史会话详情
|
|
176
|
-
xxcli history show <ID>
|
|
177
|
-
|
|
178
|
-
# 从历史会话继续对话
|
|
179
|
-
xxcli history resume <ID>
|
|
180
|
-
|
|
181
|
-
# 清空所有历史
|
|
182
|
-
xxcli history clear
|
|
183
|
-
|
|
184
|
-
# 对话中用 /history 快速查看最近 10 条
|
|
151
|
+
xx history list # 列出最近 20 条历史会话
|
|
152
|
+
xx history show <ID> # 查看某条历史详情
|
|
153
|
+
xx history resume <ID> # 从历史会话继续对话
|
|
154
|
+
xx history clear # 清空所有历史
|
|
185
155
|
```
|
|
186
156
|
|
|
187
157
|
---
|
|
188
158
|
|
|
189
|
-
## 🔧
|
|
190
|
-
|
|
191
|
-
### 设置 API Key
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
# DeepSeek(推荐,性价比高)
|
|
195
|
-
xxcli model set-key deepseek sk-xxxxxxxxxxxxxxxx
|
|
196
|
-
|
|
197
|
-
# 通义千问
|
|
198
|
-
xxcli model set-key qwen sk-xxxxxxxxxxxxxxxx
|
|
199
|
-
|
|
200
|
-
# 智谱 GLM
|
|
201
|
-
xxcli model set-key glm xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx
|
|
202
|
-
|
|
203
|
-
# 豆包
|
|
204
|
-
xxcli model set-key doubao xxxxxxxxxxxxxxxx
|
|
205
|
-
|
|
206
|
-
# Kimi
|
|
207
|
-
xxcli model set-key moonshot sk-xxxxxxxxxxxxxxxx
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### 切换默认模型
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
xxcli model use deepseek
|
|
214
|
-
xxcli model use qwen
|
|
215
|
-
xxcli model use glm
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### 查看配置
|
|
159
|
+
## 🔧 模型管理
|
|
219
160
|
|
|
220
161
|
```bash
|
|
221
|
-
|
|
222
|
-
|
|
162
|
+
# 查看所有模型状态
|
|
163
|
+
xx model list
|
|
164
|
+
|
|
165
|
+
# 设置 API Key
|
|
166
|
+
xx model set-key deepseek sk-xxxxxxxxxxxxxxxx
|
|
167
|
+
xx model set-key qwen sk-xxxxxxxxxxxxxxxx
|
|
168
|
+
xx model set-key glm xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx
|
|
169
|
+
xx model set-key doubao xxxxxxxxxxxxxxxx
|
|
170
|
+
xx model set-key moonshot sk-xxxxxxxxxxxxxxxx
|
|
171
|
+
xx model set-key minimax xxxxxxxxxxxxxxxx
|
|
172
|
+
xx model set-key hunyuan xxxxxxxxxxxxxxxx
|
|
173
|
+
xx model set-key ernie xxxxxxxxxxxxxxxx
|
|
174
|
+
|
|
175
|
+
# 切换默认模型
|
|
176
|
+
xx model use deepseek
|
|
177
|
+
xx model use qwen
|
|
178
|
+
|
|
179
|
+
# 检测连通性
|
|
180
|
+
xx model check deepseek
|
|
223
181
|
```
|
|
224
182
|
|
|
225
183
|
---
|
|
226
184
|
|
|
227
|
-
##
|
|
228
|
-
|
|
229
|
-
### 💬 交互式对话
|
|
185
|
+
## ⚙️ 高级配置
|
|
230
186
|
|
|
231
187
|
```bash
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
xxcli chat --system "你是一个 Python 专家"
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
**对话内置命令:**
|
|
188
|
+
# 查看当前配置
|
|
189
|
+
xx config show
|
|
238
190
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
| `/clear` | 清空当前对话 |
|
|
242
|
-
| `/model` | 查看当前模型 |
|
|
243
|
-
| `/history` | 快速查看最近 10 条历史会话 |
|
|
244
|
-
| `/exit` | 退出(会话自动保存) |
|
|
191
|
+
# 关闭流式输出
|
|
192
|
+
xx config set stream false
|
|
245
193
|
|
|
246
|
-
|
|
194
|
+
# 设置历史长度
|
|
195
|
+
xx config set historySize 30
|
|
247
196
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
xxcli ask "解释 React Hooks" --model glm
|
|
251
|
-
xxcli ask "写个斐波那契数列" --no-stream
|
|
197
|
+
# 显示 AI 思考过程(DeepSeek R1 / Qwen3 等推理模型)
|
|
198
|
+
xx agent --thinking "你的问题"
|
|
252
199
|
```
|
|
253
200
|
|
|
254
|
-
|
|
201
|
+
---
|
|
255
202
|
|
|
256
|
-
|
|
257
|
-
# 生成代码
|
|
258
|
-
xxcli code gen "用 TypeScript 写一个单例模式"
|
|
259
|
-
xxcli code gen "实现 LRU 缓存" --model deepseek
|
|
203
|
+
## � API Key 安全性说明
|
|
260
204
|
|
|
261
|
-
|
|
262
|
-
xxcli code explain ./src/index.ts
|
|
263
|
-
xxcli code explain "const fn = () => {}"
|
|
205
|
+
### Key 绝不离开你的设备
|
|
264
206
|
|
|
265
|
-
|
|
266
|
-
|
|
207
|
+
- **本工具不设任何服务端**,所有 AI 请求均由你的设备**直连**各模型官方 API
|
|
208
|
+
- Key **仅用于构造请求头** `Authorization: Bearer <key>`,全程不经过任何第三方
|
|
209
|
+
- 代码**完全开源**,可自行审查 [`src/core/stream.ts`](src/core/stream.ts)
|
|
267
210
|
|
|
268
|
-
|
|
269
|
-
xxcli code review ./src/api.ts
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### 📄 文件分析
|
|
211
|
+
### Key 的存储位置
|
|
273
212
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
```
|
|
213
|
+
| 系统 | 配置文件路径 |
|
|
214
|
+
| ------------- | ------------------------------ |
|
|
215
|
+
| macOS / Linux | `~/.config/ai-cli/config.json` |
|
|
216
|
+
| Windows | `%APPDATA%\ai-cli\config.json` |
|
|
279
217
|
|
|
280
|
-
###
|
|
218
|
+
### 三种方式存储 Key(安全性递增)
|
|
281
219
|
|
|
282
220
|
```bash
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
xxcli cmd "递归删除所有 node_modules 目录"
|
|
286
|
-
xxcli cmd "统计当前目录下 ts 文件数量"
|
|
287
|
-
```
|
|
221
|
+
# 方式一:命令行直接传入(会留在 shell history)
|
|
222
|
+
xx model set-key deepseek sk-xxxxxxxxxxxxxxxx
|
|
288
223
|
|
|
289
|
-
|
|
224
|
+
# 方式二:隐藏输入模式(推荐)
|
|
225
|
+
xx model set-key deepseek
|
|
226
|
+
# 在提示符下输入 Key,输入内容不会回显
|
|
290
227
|
|
|
291
|
-
|
|
228
|
+
# 方式三:环境变量(最安全,Key 永不写入磁盘)
|
|
229
|
+
export DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxxxxx
|
|
230
|
+
xx chat
|
|
231
|
+
```
|
|
292
232
|
|
|
293
|
-
|
|
294
|
-
# 关闭流式输出
|
|
295
|
-
xxcli config set stream false
|
|
233
|
+
**环境变量一览:**
|
|
296
234
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
235
|
+
| 模型 | 环境变量名 |
|
|
236
|
+
| ------------- | ------------------ |
|
|
237
|
+
| DeepSeek | `DEEPSEEK_API_KEY` |
|
|
238
|
+
| 通义千问 | `QWEN_API_KEY` |
|
|
239
|
+
| 智谱 GLM | `GLM_API_KEY` |
|
|
240
|
+
| 豆包 | `DOUBAO_API_KEY` |
|
|
241
|
+
| 月之暗面 Kimi | `MOONSHOT_API_KEY` |
|
|
242
|
+
| MiniMax 海螺 | `MINIMAX_API_KEY` |
|
|
243
|
+
| 腾讯混元 | `HUNYUAN_API_KEY` |
|
|
244
|
+
| 百度文心一言 | `ERNIE_API_KEY` |
|
|
300
245
|
|
|
301
246
|
---
|
|
302
247
|
|
|
@@ -305,15 +250,19 @@ xxcli config set historySize 30
|
|
|
305
250
|
```
|
|
306
251
|
src/
|
|
307
252
|
├── commands/ # CLI 命令实现
|
|
253
|
+
│ ├── agent.ts # Agent 自主任务模式
|
|
308
254
|
│ ├── chat.ts # 交互式对话
|
|
309
255
|
│ ├── ask.ts # 单次提问
|
|
310
256
|
│ ├── code.ts # 代码助手
|
|
311
257
|
│ ├── file.ts # 文件分析
|
|
312
258
|
│ ├── cmd.ts # 命令建议
|
|
313
|
-
│
|
|
259
|
+
│ ├── model.ts # 模型/配置管理
|
|
260
|
+
│ └── history.ts # 历史会话管理
|
|
314
261
|
├── core/
|
|
315
|
-
│ ├── config.ts #
|
|
316
|
-
│ ├──
|
|
262
|
+
│ ├── config.ts # 配置 & 模型定义
|
|
263
|
+
│ ├── tools.ts # Agent 工具集(文件/命令/搜索)
|
|
264
|
+
│ ├── search.ts # 联网搜索(必应 + wttr.in)
|
|
265
|
+
│ ├── session.ts # 会话/历史持久化
|
|
317
266
|
│ ├── stream.ts # 流式 API 调用
|
|
318
267
|
│ └── prompt.ts # Prompt 模板
|
|
319
268
|
├── ui/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6D,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6D,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAkBlH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA2TD,wBAAgB,gBAAgB,IAAI,IAAI,CAoBvC;AAGD,wBAAsB,YAAY,CAChC,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAgTf"}
|