fr-cli 2.2.7__tar.gz → 2.2.9__tar.gz

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 (92) hide show
  1. fr_cli-2.2.9/PKG-INFO +372 -0
  2. fr_cli-2.2.9/README.md +300 -0
  3. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/WEAPON.MD +77 -0
  4. fr_cli-2.2.9/fr_cli/agent/a2a.py +567 -0
  5. fr_cli-2.2.9/fr_cli/agent/acp.py +195 -0
  6. fr_cli-2.2.9/fr_cli/agent/builtins/powerful_agent_template.py +916 -0
  7. fr_cli-2.2.9/fr_cli/agent/coding_helper.py +811 -0
  8. fr_cli-2.2.9/fr_cli/agent/hermes.py +321 -0
  9. fr_cli-2.2.9/fr_cli/agent/image_and_parallel.py +1020 -0
  10. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/master.py +9 -0
  11. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/master_prompt.py +3 -3
  12. fr_cli-2.2.9/fr_cli/agent/plugin_system.py +195 -0
  13. fr_cli-2.2.9/fr_cli/agent/shell_mode.py +181 -0
  14. fr_cli-2.2.9/fr_cli/agent/workflow_system.py +1058 -0
  15. fr_cli-2.2.9/fr_cli/core/llm.py +266 -0
  16. fr_cli-2.2.9/fr_cli/core/model_factory.py +173 -0
  17. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/lang/i18n.py +2 -2
  18. fr_cli-2.2.9/fr_cli/weapon/mcp.py +186 -0
  19. fr_cli-2.2.9/fr_cli.egg-info/PKG-INFO +372 -0
  20. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli.egg-info/SOURCES.txt +15 -1
  21. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli.egg-info/requires.txt +1 -0
  22. {fr_cli-2.2.7 → fr_cli-2.2.9}/pyproject.toml +2 -1
  23. fr_cli-2.2.9/tests/test_a2a_and_providers.py +421 -0
  24. fr_cli-2.2.9/tests/test_master_prompt_fix.py +193 -0
  25. fr_cli-2.2.9/tests/test_new_features.py +449 -0
  26. fr_cli-2.2.9/tests/test_new_providers.py +285 -0
  27. fr_cli-2.2.7/PKG-INFO +0 -228
  28. fr_cli-2.2.7/README.md +0 -157
  29. fr_cli-2.2.7/fr_cli/core/llm.py +0 -218
  30. fr_cli-2.2.7/fr_cli/weapon/mcp.py +0 -202
  31. fr_cli-2.2.7/fr_cli.egg-info/PKG-INFO +0 -228
  32. {fr_cli-2.2.7 → fr_cli-2.2.9}/LICENSE +0 -0
  33. {fr_cli-2.2.7 → fr_cli-2.2.9}/MANIFEST.in +0 -0
  34. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/README.md +0 -0
  35. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/__init__.py +0 -0
  36. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/addon/plugin.py +0 -0
  37. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/__init__.py +0 -0
  38. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/__init__.py +0 -0
  39. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/_utils.py +0 -0
  40. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/db.py +0 -0
  41. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/local.py +0 -0
  42. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/rag.py +0 -0
  43. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/rag_watcher_daemon.py +0 -0
  44. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/remote.py +0 -0
  45. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/builtins/spider.py +0 -0
  46. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/client.py +0 -0
  47. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/executor.py +0 -0
  48. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/generator.py +0 -0
  49. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/manager.py +0 -0
  50. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/remote.py +0 -0
  51. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/server.py +0 -0
  52. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/agent/workflow.py +0 -0
  53. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/breakthrough/update.py +0 -0
  54. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/command/__init__.py +0 -0
  55. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/command/executor.py +0 -0
  56. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/command/registry.py +0 -0
  57. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/command/security.py +0 -0
  58. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/conf/config.py +0 -0
  59. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/conf/wizard.py +0 -0
  60. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/chat.py +0 -0
  61. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/core.py +0 -0
  62. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/intent.py +0 -0
  63. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/recommender.py +0 -0
  64. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/stream.py +0 -0
  65. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/sysmon.py +0 -0
  66. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/core/thinking.py +0 -0
  67. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/gatekeeper/__init__.py +0 -0
  68. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/gatekeeper/daemon.py +0 -0
  69. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/gatekeeper/manager.py +0 -0
  70. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/main.py +0 -0
  71. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/memory/context.py +0 -0
  72. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/memory/history.py +0 -0
  73. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/memory/session.py +0 -0
  74. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/repl/__init__.py +0 -0
  75. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/repl/commands.py +0 -0
  76. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/security/security.py +0 -0
  77. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/ui/ui.py +0 -0
  78. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/cron.py +0 -0
  79. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/dataframe.py +0 -0
  80. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/disk.py +0 -0
  81. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/fs.py +0 -0
  82. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/launcher.py +0 -0
  83. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/loader.py +0 -0
  84. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/mail.py +0 -0
  85. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/vision.py +0 -0
  86. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli/weapon/web.py +0 -0
  87. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli.egg-info/dependency_links.txt +0 -0
  88. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli.egg-info/entry_points.txt +0 -0
  89. {fr_cli-2.2.7 → fr_cli-2.2.9}/fr_cli.egg-info/top_level.txt +0 -0
  90. {fr_cli-2.2.7 → fr_cli-2.2.9}/setup.cfg +0 -0
  91. {fr_cli-2.2.7 → fr_cli-2.2.9}/tests/test_integration_real.py +0 -0
  92. {fr_cli-2.2.7 → fr_cli-2.2.9}/tests/test_model_config.py +0 -0
fr_cli-2.2.9/PKG-INFO ADDED
@@ -0,0 +1,372 @@
1
+ Metadata-Version: 2.4
2
+ Name: fr-cli
3
+ Version: 2.2.9
4
+ Summary: 凡人打字机 - 支持多模型(Zhipu/DeepSeek/Kimi/Qwen/StepFun/MiniMax/Spark/Doubao/MiMo)的终极全能终端工具
5
+ Author: FANREN CLI Author
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yourname/fr-cli
8
+ Project-URL: Issues, https://github.com/yourname/fr-cli/issues
9
+ Keywords: zhipuai,deepseek,kimi,qwen,cli,ai,terminal,chatbot
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: zhipuai>=2.0.0
27
+ Requires-Dist: openai>=1.0.0
28
+ Requires-Dist: requests>=2.28.0
29
+ Requires-Dist: mcp>=1.6.0
30
+ Requires-Dist: pyyaml>=6.0.0
31
+ Provides-Extra: data
32
+ Requires-Dist: pandas>=1.5.0; extra == "data"
33
+ Requires-Dist: openpyxl>=3.0.0; extra == "data"
34
+ Provides-Extra: db
35
+ Requires-Dist: pymysql>=1.0.0; extra == "db"
36
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "db"
37
+ Requires-Dist: pyodbc>=4.0.0; extra == "db"
38
+ Requires-Dist: oracledb>=1.3.0; extra == "db"
39
+ Provides-Extra: rag
40
+ Requires-Dist: chromadb>=0.4.0; extra == "rag"
41
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "rag"
42
+ Provides-Extra: remote
43
+ Requires-Dist: paramiko>=3.0.0; extra == "remote"
44
+ Provides-Extra: spider
45
+ Requires-Dist: selenium>=4.10.0; extra == "spider"
46
+ Provides-Extra: cloud
47
+ Requires-Dist: bypy; extra == "cloud"
48
+ Requires-Dist: aligo; extra == "cloud"
49
+ Requires-Dist: msal; extra == "cloud"
50
+ Provides-Extra: monitor
51
+ Requires-Dist: watchdog>=3.0.0; extra == "monitor"
52
+ Provides-Extra: all
53
+ Requires-Dist: pandas>=1.5.0; extra == "all"
54
+ Requires-Dist: openpyxl>=3.0.0; extra == "all"
55
+ Requires-Dist: pymysql>=1.0.0; extra == "all"
56
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
57
+ Requires-Dist: pyodbc>=4.0.0; extra == "all"
58
+ Requires-Dist: oracledb>=1.3.0; extra == "all"
59
+ Requires-Dist: chromadb>=0.4.0; extra == "all"
60
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
61
+ Requires-Dist: paramiko>=3.0.0; extra == "all"
62
+ Requires-Dist: selenium>=4.10.0; extra == "all"
63
+ Requires-Dist: bypy; extra == "all"
64
+ Requires-Dist: aligo; extra == "all"
65
+ Requires-Dist: msal; extra == "all"
66
+ Requires-Dist: watchdog>=3.0.0; extra == "all"
67
+ Provides-Extra: dev
68
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
69
+ Requires-Dist: build; extra == "dev"
70
+ Requires-Dist: twine; extra == "dev"
71
+ Dynamic: license-file
72
+
73
+ # 凡人打字机 (fr-cli)
74
+
75
+ **支持 27+ 种 AI 模型(智谱/智谱Coding/DeepSeek/Kimi/Kimi K2/Kimi Code/StepFun/Step-3/MiniMax/M2.7/讯飞星火/豆包/MiMo/LongCat)的终极全能终端工具。**
76
+
77
+ **集成 Hermes Agent 核心功能:自我进化的 AI 助手。**
78
+
79
+ ## ✨ 功能特性
80
+
81
+ ### 🤖 多模型支持
82
+ 支持以下 AI 模型提供商:
83
+ - **智谱 AI**: GLM-4-Flash 等
84
+ - **智谱 Coding Plan**: GLM-4.7 等 (https://docs.bigmodel.cn/cn/coding-plan/quick-start)
85
+ - **DeepSeek**: DeepSeek-Chat 等
86
+ - **Kimi (Moonshot)**: moonshot-v1-8k 等
87
+ - **Kimi K2**: 代码优化版 kimi-k2-0905-preview
88
+ - **Kimi Code**: 代码平台 kimi-cache-test (Kimi 会员)
89
+ - **通义千问 (Qwen)**: qwen-turbo 等
90
+ - **阶跃星辰 (StepFun)**: step-1-8k, step-2-16k, step-3-auto 等
91
+ - **Step-Audio**: 实时语音交互
92
+ - **MiniMax**: MiniMax-Text-01 等
93
+ - **MiniMax M2.7**: Token Plan 订阅模型
94
+ - **讯飞星火 (Spark)**: generalv3.5 等
95
+ - **豆包 (Doubao)**: doubao-1-5-pro-32k 等
96
+ - **小米 MiMo**: mimo-v2-flash 等
97
+ - **LongCat (龙猫)**: LongCat-Flash-Chat 等 (https://longcat.chat/platform/docs/zh/)
98
+
99
+ ### 🧠 核心功能
100
+ - **MasterAgent 主控**:自我进化的 ReAct 主控 Agent,自动规划、调用工具、反思进化
101
+ - **Agent2Agent Protocol (A2A)**:Agent 互操作协议,支持 Agent 发现、注册、任务委托
102
+ - **思维模式**:direct / CoT / ToT / ReAct 四种推理模式切换
103
+ - **文件沙盒**:安全的虚拟文件系统,支持读写/目录操作
104
+ - **联网搜索**:内置 Web 搜索与网页内容提取(SSRF 防护)
105
+
106
+ ### 🎯 特色功能
107
+ - **视觉能力**:图片生成 (CogView) 与多模态识别 (GLM-4V)
108
+ - **邮件收发**:支持 IMAP/SMTP(防头注入)
109
+ - **定时任务**:后台定时执行命令(shlex 安全解析)
110
+ - **云盘集成**:百度/阿里/OneDrive 网盘
111
+ - **插件系统**:AI 生成代码自动保存为插件(子进程隔离)
112
+ - **会话记忆**:自动保留最近 5 轮对话摘要 + 按日期自动存档
113
+ - **Agent 分身系统**:AI 自动生成 Agent,支持工作流编排
114
+ - **Agent HTTP API**:将 Agent 发布为 REST API 供外部调用
115
+ - **本机应用启动**:一键调用浏览器、微信、Word、WPS 等本地程序
116
+ - **内置 Agent**:`@local` `@remote` `@spider` `@db` `@RAG`
117
+ - **数据卷轴**:Excel / CSV 读取与智能分析
118
+ - **数据库助手**:MySQL / PostgreSQL / SQL Server / Oracle 智能 SQL 生成
119
+ - **本地 RAG**:ChromaDB 向量库 + 自动文件监控与向量化
120
+ - **MCP 外部神通**:支持 Model Context Protocol
121
+ - **多源信息融合**:大模型 + 工具结果统一汇总
122
+ - **中英文切换**:完整国际化支持
123
+
124
+ ## 🚀 快速开始
125
+
126
+ ```bash
127
+ # 安装
128
+ pip install fr-cli
129
+
130
+ # 启动
131
+ fr-cli
132
+
133
+ # 或从源码运行
134
+ cd fr-cli
135
+ pip install -e .
136
+ python3 main.py
137
+ ```
138
+
139
+ 首次运行会引导输入当前道统的 API Key。
140
+
141
+ ## 📝 使用方法
142
+
143
+ ### 📋 常用命令
144
+
145
+ ```
146
+ /ls 列出当前目录文件
147
+ /cat <file> 查看文件内容
148
+ /cd <dir> 切换工作目录
149
+ /write <file> 写入文件(多行输入,Ctrl+D 结束)
150
+ /delete <file> 删除文件
151
+ /search <query> 联网搜索
152
+ /save <name> 保存会话
153
+ /load 加载历史会话
154
+ /export 导出会话为 Markdown
155
+
156
+ /model <模型名> 切换AI模型
157
+ /model <道统>:<模型名> 同时切换道统和模型
158
+ /key <key> 修改当前道统 API Key
159
+ /key <道统> <key> 为指定道统设置 Key
160
+ /providers 查看所有道统配置
161
+ /providers add <p> <k> [m] 添加/更新道统配置
162
+ /providers use <p> 切换到指定道统
163
+
164
+ /mode direct|cot|tot|react 切换思维模式
165
+ /master on|off|status MasterAgent 主控
166
+ /mcp_list 列出 MCP 服务器及工具
167
+ /mcp_add <名> <命令> [参数] 添加 MCP 服务器
168
+ /mcp_del <名> 删除 MCP 服务器
169
+
170
+ /help 查看帮助
171
+ /exit 退出
172
+ ```
173
+
174
+ ### 🤖 AI 模型切换示例
175
+
176
+ ```
177
+ # 使用 Kimi K2(代码优化版)
178
+ /model kimi-k2
179
+
180
+ # 使用 MiniMax M2.7(Token Plan)
181
+ /model minimax-m27
182
+
183
+ # 使用 Step-3(阶跃星辰)
184
+ /model step-3
185
+
186
+ # 使用 Kimi Code
187
+ /model kimi-code
188
+
189
+ # 配置新的 API Key
190
+ /providers add step-3 <your-api-key>
191
+ ```
192
+
193
+ ### 🔧 Agent 管理
194
+
195
+ ```
196
+ /agent_create coder "编写Python代码的助手" # 创建 Agent
197
+ /agent_list # 列出所有 Agent
198
+ /agent_show myagent # 查看 Agent 详情
199
+ /agent_edit myagent persona # 编辑 Agent 人设
200
+ /agent_run myagent "帮我写个排序算法" # 运行 Agent
201
+ /agent_delete oldagent # 删除 Agent
202
+ /agent_server start 8080 # 启动 HTTP API
203
+ ```
204
+
205
+ ### 🔗 MCP 外部神通
206
+
207
+ ```
208
+ /mcp_list # 列出已配置的 MCP 服务器
209
+ /mcp_add fs npx -y @modelcontextprotocol/server-filesystem /tmp
210
+ /mcp_del fs # 删除 MCP 服务器
211
+ /mcp_refresh # 刷新工具列表
212
+ ```
213
+
214
+ ### 📊 数据处理
215
+
216
+ ```
217
+ /read_excel report.xlsx # 读取 Excel
218
+ /read_csv data.csv # 读取 CSV
219
+ ```
220
+
221
+ ### 🧑‍💻 内置 Agent
222
+
223
+ ```
224
+ @local 查看当前目录最大的5个文件 # 本地系统操作
225
+ @spider https://example.com 2 # 智能爬虫
226
+ @db mydb 查询最近7天注册用户 # 数据库助手
227
+ @RAG 什么是向量数据库 # 本地知识库问答
228
+ ```
229
+
230
+ ### 🛡️ 安全命令
231
+
232
+ ```
233
+ /limit <n> 设置 Token 上限 (最小1000)
234
+ /dir <path> 添加允许访问的目录
235
+ /dirs 列出已挂载的工作目录
236
+ /rmdir <索引> 删除已挂载的目录
237
+ /security 查看安全设置
238
+ ```
239
+
240
+ ## � Hermes 核心功能
241
+
242
+ ### 📋 任务管理
243
+ ```
244
+ from fr_cli.agent.hermes import get_task_manager, get_analytics
245
+
246
+ # 创建任务
247
+ tm = get_task_manager()
248
+ task = tm.create_task("完成代码审查")
249
+
250
+ # 记录分析
251
+ an = get_analytics()
252
+ an.record_request("glm-4-flash", 1000, 0.01)
253
+ ```
254
+
255
+ ### 🎯 目标追踪
256
+ ```
257
+ from fr_cli.agent.hermes import GoalTracker
258
+
259
+ gt = GoalTracker()
260
+ gt.set_goal("完成项目", ["阶段1", "阶段2", "阶段3"])
261
+ gt.update_progress("已完成阶段1", 0.33)
262
+ ```
263
+
264
+ ### ⏰ 定时任务
265
+ ```
266
+ from fr_cli.agent.hermes import get_cron_scheduler
267
+
268
+ cron = get_cron_scheduler()
269
+ cron.add_job("daily-report", "0 9 * * *", "生成日报")
270
+ ```
271
+
272
+ ### 🔌 插件系统
273
+ ```
274
+ from fr_cli.agent.plugin_system import get_plugin_registry
275
+
276
+ registry = get_plugin_registry()
277
+ plugins = registry.list_all()
278
+ ```
279
+
280
+ ### 🐚 Shell 模式 (Ctrl-X 切换)
281
+ ```
282
+ Agent 模式: 输入消息与 AI 对话
283
+ Shell 模式: 直接执行 shell 命令
284
+
285
+ 按 Ctrl-X 切换模式
286
+ ```
287
+
288
+ ### 🔗 ACP (Agent Client Protocol)
289
+ ```bash
290
+ # 启动 ACP 服务
291
+ fr acp
292
+
293
+ # 配置到 Zed
294
+ # ~/.config/zed/settings.json
295
+ {
296
+ "agent_servers": {
297
+ "fr-cli": {
298
+ "command": "fr",
299
+ "args": ["acp"]
300
+ }
301
+ }
302
+ }
303
+ ```
304
+
305
+ ## �📦 支持的模型提供商(25+)
306
+
307
+ | 道统 | 默认模型 | API 地址 |
308
+ |------|---------|----------|
309
+ | zhipu | glm-4-flash | - |
310
+ | zhipu-coding | GLM-4.7 | open.bigmodel.cn/api/coding/paas/v4 |
311
+ | zhipu-anthropic | glm-4.6 | open.bigmodel.cn/api/anthropic |
312
+ | deepseek | deepseek-chat | api.deepseek.com |
313
+ | kimi | moonshot-v1-8k | api.moonshot.cn |
314
+ | kimi-k2 | kimi-k2-0905-preview | api.moonshot.cn |
315
+ | kimi-code | kimi-cache-test | api.kimi.com/coding/v1 |
316
+ | qwen | qwen-turbo | dashscope.aliyuncs.com |
317
+ | stepfun | step-1-8k | api.stepfun.com |
318
+ | step-1 | step-1-8k | api.stepfun.com |
319
+ | step-2 | step-2-16k | api.stepfun.com |
320
+ | step-3 | step-3-auto | api.stepfun.com |
321
+ | step-audio | step-audio-2 | api.stepfun.com |
322
+ | minimax | MiniMax-Text-01 | api.minimax.chat |
323
+ | minimax-m27 | MiniMax-M2.7 | api.minimax.chat |
324
+ | minimax-m27-fast | MiniMax-M2.7-HighSpeed | api.minimax.chat |
325
+ | minimax-token-plan | MiniMax-M2.7 | api.minimax.chat |
326
+ | spark | generalv3.5 | spark-api-open.xf-yun.com |
327
+ | doubao | doubao-1-5-pro-32k-250115 | ark.cn-beijing.volces.com |
328
+ | mimo | mimo-v2-flash | api.xiaomimimo.com |
329
+ | longcat | LongCat-Flash-Chat | api.longcat.chat/openai |
330
+ | longcat-anthropic | LongCat | api.longcat.chat/anthropic |
331
+
332
+ ## 🔧 开发
333
+
334
+ ```bash
335
+ # 克隆项目
336
+ git clone https://github.com/yourname/fr-cli.git
337
+ cd fr-cli
338
+
339
+ # 安装开发依赖
340
+ pip install -e ".[all]"
341
+
342
+ # 运行测试
343
+ python3 -m pytest tests/ -v
344
+
345
+ # 运行程序
346
+ python3 main.py
347
+ ```
348
+
349
+ ## 📂 项目结构
350
+
351
+ ```
352
+ fr_cli/
353
+ ├── main.py # 核心入口
354
+ ├── agent/ # Agent 系统
355
+ │ ├── a2a.py # Agent2Agent 协议
356
+ │ ├── master.py # MasterAgent 主控
357
+ │ └── ...
358
+ ├── core/ # 核心模块
359
+ │ └── llm.py # LLM 客户端(20+ 提供商)
360
+ ├── weapon/ # 武器库
361
+ ├── memory/ # 记忆系统
362
+ └── lang/ # 国际化
363
+ ```
364
+
365
+ ## 📚 文档
366
+
367
+ - [NEW_PROVIDERS_GUIDE.md](NEW_PROVIDERS_GUIDE.md) - 新增模型使用指南
368
+ - [A2A_AND_PROVIDERS_GUIDE.md](A2A_AND_PROVIDERS_GUIDE.md) - A2A 协议文档
369
+
370
+ ## 📄 License
371
+
372
+ MIT
fr_cli-2.2.9/README.md ADDED
@@ -0,0 +1,300 @@
1
+ # 凡人打字机 (fr-cli)
2
+
3
+ **支持 27+ 种 AI 模型(智谱/智谱Coding/DeepSeek/Kimi/Kimi K2/Kimi Code/StepFun/Step-3/MiniMax/M2.7/讯飞星火/豆包/MiMo/LongCat)的终极全能终端工具。**
4
+
5
+ **集成 Hermes Agent 核心功能:自我进化的 AI 助手。**
6
+
7
+ ## ✨ 功能特性
8
+
9
+ ### 🤖 多模型支持
10
+ 支持以下 AI 模型提供商:
11
+ - **智谱 AI**: GLM-4-Flash 等
12
+ - **智谱 Coding Plan**: GLM-4.7 等 (https://docs.bigmodel.cn/cn/coding-plan/quick-start)
13
+ - **DeepSeek**: DeepSeek-Chat 等
14
+ - **Kimi (Moonshot)**: moonshot-v1-8k 等
15
+ - **Kimi K2**: 代码优化版 kimi-k2-0905-preview
16
+ - **Kimi Code**: 代码平台 kimi-cache-test (Kimi 会员)
17
+ - **通义千问 (Qwen)**: qwen-turbo 等
18
+ - **阶跃星辰 (StepFun)**: step-1-8k, step-2-16k, step-3-auto 等
19
+ - **Step-Audio**: 实时语音交互
20
+ - **MiniMax**: MiniMax-Text-01 等
21
+ - **MiniMax M2.7**: Token Plan 订阅模型
22
+ - **讯飞星火 (Spark)**: generalv3.5 等
23
+ - **豆包 (Doubao)**: doubao-1-5-pro-32k 等
24
+ - **小米 MiMo**: mimo-v2-flash 等
25
+ - **LongCat (龙猫)**: LongCat-Flash-Chat 等 (https://longcat.chat/platform/docs/zh/)
26
+
27
+ ### 🧠 核心功能
28
+ - **MasterAgent 主控**:自我进化的 ReAct 主控 Agent,自动规划、调用工具、反思进化
29
+ - **Agent2Agent Protocol (A2A)**:Agent 互操作协议,支持 Agent 发现、注册、任务委托
30
+ - **思维模式**:direct / CoT / ToT / ReAct 四种推理模式切换
31
+ - **文件沙盒**:安全的虚拟文件系统,支持读写/目录操作
32
+ - **联网搜索**:内置 Web 搜索与网页内容提取(SSRF 防护)
33
+
34
+ ### 🎯 特色功能
35
+ - **视觉能力**:图片生成 (CogView) 与多模态识别 (GLM-4V)
36
+ - **邮件收发**:支持 IMAP/SMTP(防头注入)
37
+ - **定时任务**:后台定时执行命令(shlex 安全解析)
38
+ - **云盘集成**:百度/阿里/OneDrive 网盘
39
+ - **插件系统**:AI 生成代码自动保存为插件(子进程隔离)
40
+ - **会话记忆**:自动保留最近 5 轮对话摘要 + 按日期自动存档
41
+ - **Agent 分身系统**:AI 自动生成 Agent,支持工作流编排
42
+ - **Agent HTTP API**:将 Agent 发布为 REST API 供外部调用
43
+ - **本机应用启动**:一键调用浏览器、微信、Word、WPS 等本地程序
44
+ - **内置 Agent**:`@local` `@remote` `@spider` `@db` `@RAG`
45
+ - **数据卷轴**:Excel / CSV 读取与智能分析
46
+ - **数据库助手**:MySQL / PostgreSQL / SQL Server / Oracle 智能 SQL 生成
47
+ - **本地 RAG**:ChromaDB 向量库 + 自动文件监控与向量化
48
+ - **MCP 外部神通**:支持 Model Context Protocol
49
+ - **多源信息融合**:大模型 + 工具结果统一汇总
50
+ - **中英文切换**:完整国际化支持
51
+
52
+ ## 🚀 快速开始
53
+
54
+ ```bash
55
+ # 安装
56
+ pip install fr-cli
57
+
58
+ # 启动
59
+ fr-cli
60
+
61
+ # 或从源码运行
62
+ cd fr-cli
63
+ pip install -e .
64
+ python3 main.py
65
+ ```
66
+
67
+ 首次运行会引导输入当前道统的 API Key。
68
+
69
+ ## 📝 使用方法
70
+
71
+ ### 📋 常用命令
72
+
73
+ ```
74
+ /ls 列出当前目录文件
75
+ /cat <file> 查看文件内容
76
+ /cd <dir> 切换工作目录
77
+ /write <file> 写入文件(多行输入,Ctrl+D 结束)
78
+ /delete <file> 删除文件
79
+ /search <query> 联网搜索
80
+ /save <name> 保存会话
81
+ /load 加载历史会话
82
+ /export 导出会话为 Markdown
83
+
84
+ /model <模型名> 切换AI模型
85
+ /model <道统>:<模型名> 同时切换道统和模型
86
+ /key <key> 修改当前道统 API Key
87
+ /key <道统> <key> 为指定道统设置 Key
88
+ /providers 查看所有道统配置
89
+ /providers add <p> <k> [m] 添加/更新道统配置
90
+ /providers use <p> 切换到指定道统
91
+
92
+ /mode direct|cot|tot|react 切换思维模式
93
+ /master on|off|status MasterAgent 主控
94
+ /mcp_list 列出 MCP 服务器及工具
95
+ /mcp_add <名> <命令> [参数] 添加 MCP 服务器
96
+ /mcp_del <名> 删除 MCP 服务器
97
+
98
+ /help 查看帮助
99
+ /exit 退出
100
+ ```
101
+
102
+ ### 🤖 AI 模型切换示例
103
+
104
+ ```
105
+ # 使用 Kimi K2(代码优化版)
106
+ /model kimi-k2
107
+
108
+ # 使用 MiniMax M2.7(Token Plan)
109
+ /model minimax-m27
110
+
111
+ # 使用 Step-3(阶跃星辰)
112
+ /model step-3
113
+
114
+ # 使用 Kimi Code
115
+ /model kimi-code
116
+
117
+ # 配置新的 API Key
118
+ /providers add step-3 <your-api-key>
119
+ ```
120
+
121
+ ### 🔧 Agent 管理
122
+
123
+ ```
124
+ /agent_create coder "编写Python代码的助手" # 创建 Agent
125
+ /agent_list # 列出所有 Agent
126
+ /agent_show myagent # 查看 Agent 详情
127
+ /agent_edit myagent persona # 编辑 Agent 人设
128
+ /agent_run myagent "帮我写个排序算法" # 运行 Agent
129
+ /agent_delete oldagent # 删除 Agent
130
+ /agent_server start 8080 # 启动 HTTP API
131
+ ```
132
+
133
+ ### 🔗 MCP 外部神通
134
+
135
+ ```
136
+ /mcp_list # 列出已配置的 MCP 服务器
137
+ /mcp_add fs npx -y @modelcontextprotocol/server-filesystem /tmp
138
+ /mcp_del fs # 删除 MCP 服务器
139
+ /mcp_refresh # 刷新工具列表
140
+ ```
141
+
142
+ ### 📊 数据处理
143
+
144
+ ```
145
+ /read_excel report.xlsx # 读取 Excel
146
+ /read_csv data.csv # 读取 CSV
147
+ ```
148
+
149
+ ### 🧑‍💻 内置 Agent
150
+
151
+ ```
152
+ @local 查看当前目录最大的5个文件 # 本地系统操作
153
+ @spider https://example.com 2 # 智能爬虫
154
+ @db mydb 查询最近7天注册用户 # 数据库助手
155
+ @RAG 什么是向量数据库 # 本地知识库问答
156
+ ```
157
+
158
+ ### 🛡️ 安全命令
159
+
160
+ ```
161
+ /limit <n> 设置 Token 上限 (最小1000)
162
+ /dir <path> 添加允许访问的目录
163
+ /dirs 列出已挂载的工作目录
164
+ /rmdir <索引> 删除已挂载的目录
165
+ /security 查看安全设置
166
+ ```
167
+
168
+ ## � Hermes 核心功能
169
+
170
+ ### 📋 任务管理
171
+ ```
172
+ from fr_cli.agent.hermes import get_task_manager, get_analytics
173
+
174
+ # 创建任务
175
+ tm = get_task_manager()
176
+ task = tm.create_task("完成代码审查")
177
+
178
+ # 记录分析
179
+ an = get_analytics()
180
+ an.record_request("glm-4-flash", 1000, 0.01)
181
+ ```
182
+
183
+ ### 🎯 目标追踪
184
+ ```
185
+ from fr_cli.agent.hermes import GoalTracker
186
+
187
+ gt = GoalTracker()
188
+ gt.set_goal("完成项目", ["阶段1", "阶段2", "阶段3"])
189
+ gt.update_progress("已完成阶段1", 0.33)
190
+ ```
191
+
192
+ ### ⏰ 定时任务
193
+ ```
194
+ from fr_cli.agent.hermes import get_cron_scheduler
195
+
196
+ cron = get_cron_scheduler()
197
+ cron.add_job("daily-report", "0 9 * * *", "生成日报")
198
+ ```
199
+
200
+ ### 🔌 插件系统
201
+ ```
202
+ from fr_cli.agent.plugin_system import get_plugin_registry
203
+
204
+ registry = get_plugin_registry()
205
+ plugins = registry.list_all()
206
+ ```
207
+
208
+ ### 🐚 Shell 模式 (Ctrl-X 切换)
209
+ ```
210
+ Agent 模式: 输入消息与 AI 对话
211
+ Shell 模式: 直接执行 shell 命令
212
+
213
+ 按 Ctrl-X 切换模式
214
+ ```
215
+
216
+ ### 🔗 ACP (Agent Client Protocol)
217
+ ```bash
218
+ # 启动 ACP 服务
219
+ fr acp
220
+
221
+ # 配置到 Zed
222
+ # ~/.config/zed/settings.json
223
+ {
224
+ "agent_servers": {
225
+ "fr-cli": {
226
+ "command": "fr",
227
+ "args": ["acp"]
228
+ }
229
+ }
230
+ }
231
+ ```
232
+
233
+ ## �📦 支持的模型提供商(25+)
234
+
235
+ | 道统 | 默认模型 | API 地址 |
236
+ |------|---------|----------|
237
+ | zhipu | glm-4-flash | - |
238
+ | zhipu-coding | GLM-4.7 | open.bigmodel.cn/api/coding/paas/v4 |
239
+ | zhipu-anthropic | glm-4.6 | open.bigmodel.cn/api/anthropic |
240
+ | deepseek | deepseek-chat | api.deepseek.com |
241
+ | kimi | moonshot-v1-8k | api.moonshot.cn |
242
+ | kimi-k2 | kimi-k2-0905-preview | api.moonshot.cn |
243
+ | kimi-code | kimi-cache-test | api.kimi.com/coding/v1 |
244
+ | qwen | qwen-turbo | dashscope.aliyuncs.com |
245
+ | stepfun | step-1-8k | api.stepfun.com |
246
+ | step-1 | step-1-8k | api.stepfun.com |
247
+ | step-2 | step-2-16k | api.stepfun.com |
248
+ | step-3 | step-3-auto | api.stepfun.com |
249
+ | step-audio | step-audio-2 | api.stepfun.com |
250
+ | minimax | MiniMax-Text-01 | api.minimax.chat |
251
+ | minimax-m27 | MiniMax-M2.7 | api.minimax.chat |
252
+ | minimax-m27-fast | MiniMax-M2.7-HighSpeed | api.minimax.chat |
253
+ | minimax-token-plan | MiniMax-M2.7 | api.minimax.chat |
254
+ | spark | generalv3.5 | spark-api-open.xf-yun.com |
255
+ | doubao | doubao-1-5-pro-32k-250115 | ark.cn-beijing.volces.com |
256
+ | mimo | mimo-v2-flash | api.xiaomimimo.com |
257
+ | longcat | LongCat-Flash-Chat | api.longcat.chat/openai |
258
+ | longcat-anthropic | LongCat | api.longcat.chat/anthropic |
259
+
260
+ ## 🔧 开发
261
+
262
+ ```bash
263
+ # 克隆项目
264
+ git clone https://github.com/yourname/fr-cli.git
265
+ cd fr-cli
266
+
267
+ # 安装开发依赖
268
+ pip install -e ".[all]"
269
+
270
+ # 运行测试
271
+ python3 -m pytest tests/ -v
272
+
273
+ # 运行程序
274
+ python3 main.py
275
+ ```
276
+
277
+ ## 📂 项目结构
278
+
279
+ ```
280
+ fr_cli/
281
+ ├── main.py # 核心入口
282
+ ├── agent/ # Agent 系统
283
+ │ ├── a2a.py # Agent2Agent 协议
284
+ │ ├── master.py # MasterAgent 主控
285
+ │ └── ...
286
+ ├── core/ # 核心模块
287
+ │ └── llm.py # LLM 客户端(20+ 提供商)
288
+ ├── weapon/ # 武器库
289
+ ├── memory/ # 记忆系统
290
+ └── lang/ # 国际化
291
+ ```
292
+
293
+ ## 📚 文档
294
+
295
+ - [NEW_PROVIDERS_GUIDE.md](NEW_PROVIDERS_GUIDE.md) - 新增模型使用指南
296
+ - [A2A_AND_PROVIDERS_GUIDE.md](A2A_AND_PROVIDERS_GUIDE.md) - A2A 协议文档
297
+
298
+ ## 📄 License
299
+
300
+ MIT