jarvis-ai-assistant 0.1.125__tar.gz → 0.1.126__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.

Potentially problematic release.


This version of jarvis-ai-assistant might be problematic. Click here for more details.

Files changed (84) hide show
  1. {jarvis_ai_assistant-0.1.125/src/jarvis_ai_assistant.egg-info → jarvis_ai_assistant-0.1.126}/PKG-INFO +31 -17
  2. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/README.md +31 -17
  3. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/pyproject.toml +1 -1
  4. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/setup.py +1 -1
  5. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/__init__.py +1 -1
  6. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_agent/__init__.py +116 -116
  7. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_code_agent/code_agent.py +96 -100
  8. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_code_agent/patch.py +39 -47
  9. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_code_agent/shell_input_handler.py +22 -0
  10. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_codebase/main.py +83 -84
  11. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_dev/main.py +904 -0
  12. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/base.py +0 -12
  13. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/cpp.py +0 -9
  14. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/go.py +0 -9
  15. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/python.py +0 -28
  16. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/registry.py +0 -1
  17. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/rust.py +0 -9
  18. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_multi_agent/__init__.py +52 -52
  19. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/ask_codebase.py +6 -6
  20. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/ask_user.py +2 -2
  21. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/base.py +4 -4
  22. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/chdir.py +8 -8
  23. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/code_review.py +6 -6
  24. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/create_code_agent.py +4 -4
  25. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/create_sub_agent.py +7 -7
  26. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/execute_shell.py +54 -21
  27. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/execute_shell_script.py +3 -3
  28. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/file_operation.py +36 -8
  29. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/git_commiter.py +16 -16
  30. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_find_definition.py +7 -7
  31. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_prepare_rename.py +7 -7
  32. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/methodology.py +6 -6
  33. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/rag.py +5 -5
  34. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/read_webpage.py +2 -2
  35. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/registry.py +139 -139
  36. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/search_web.py +5 -5
  37. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/select_code_files.py +3 -3
  38. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/tool_generator.py +33 -34
  39. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/methodology.py +5 -5
  40. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126/src/jarvis_ai_assistant.egg-info}/PKG-INFO +31 -17
  41. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/SOURCES.txt +1 -2
  42. jarvis_ai_assistant-0.1.125/src/jarvis/jarvis_dev/main.py +0 -926
  43. jarvis_ai_assistant-0.1.125/src/jarvis/jarvis_tools/lsp_validate_edit.py +0 -141
  44. jarvis_ai_assistant-0.1.125/src/jarvis/jarvis_tools/read_code.py +0 -192
  45. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/LICENSE +0 -0
  46. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/MANIFEST.in +0 -0
  47. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/setup.cfg +0 -0
  48. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_agent/output_handler.py +0 -0
  49. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_code_agent/__init__.py +0 -0
  50. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_code_agent/file_select.py +0 -0
  51. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_codebase/__init__.py +0 -0
  52. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_git_squash/__init__.py +0 -0
  53. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_git_squash/main.py +0 -0
  54. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/__init__.py +0 -0
  55. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/ai8.py +0 -0
  56. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/base.py +0 -0
  57. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/kimi.py +0 -0
  58. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/ollama.py +0 -0
  59. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/openai.py +0 -0
  60. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/oyi.py +0 -0
  61. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/registry.py +0 -0
  62. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform_manager/__init__.py +0 -0
  63. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform_manager/main.py +0 -0
  64. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform_manager/openai_test.py +0 -0
  65. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_rag/__init__.py +0 -0
  66. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_rag/main.py +0 -0
  67. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_smart_shell/__init__.py +0 -0
  68. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_smart_shell/main.py +0 -0
  69. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/__init__.py +0 -0
  70. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_find_references.py +0 -0
  71. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_get_diagnostics.py +0 -0
  72. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_get_document_symbols.py +0 -0
  73. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/__init__.py +0 -0
  74. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/config.py +0 -0
  75. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/embedding.py +0 -0
  76. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/git_utils.py +0 -0
  77. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/globals.py +0 -0
  78. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/input.py +0 -0
  79. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/output.py +0 -0
  80. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_utils/utils.py +0 -0
  81. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
  82. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/entry_points.txt +0 -0
  83. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
  84. {jarvis_ai_assistant-0.1.125 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.125
3
+ Version: 0.1.126
4
4
  Summary: Jarvis: An AI assistant that uses tools to interact with the system
5
5
  Home-page: https://github.com/skyfireitdiy/Jarvis
6
6
  Author: skyfire
@@ -74,22 +74,29 @@ Requires-Dist: mypy; extra == "dev"
74
74
  <p align="center">
75
75
  <img src="docs/images/jarvis-logo.png" alt="Jarvis Logo" width="200"/>
76
76
  </p>
77
- [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
78
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77
+ <div align="center">
78
+
79
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
80
+
79
81
  *您的智能开发和系统交互助手*
80
- [快速开始](#-快速开始) •
81
- [核心功能](#-核心功能) •
82
- [配置说明](#-配置说明) •
83
- [工具说明](#-工具说明) •
84
- [扩展开发](#-扩展开发) •
85
- [贡献指南](#-贡献指南)
82
+
83
+ [快速开始](#quick-start) •
84
+ [配置说明](#configuration) •
85
+ [工具说明](#tools) •
86
+ [扩展开发](#extensions) •
87
+ [贡献指南](#contributing)
88
+ [许可证](#license) •
89
+ </div>
90
+
86
91
  ---
87
- ## 🚀 快速开始
92
+
93
+ ## 🚀 快速开始 <a id="quick-start"></a>
88
94
  ### 安装
89
95
  ```bash
90
96
  pip install jarvis-ai-assistant # 安装jarvis-ai-assistant
91
97
  playwright install # 安装playwright
92
98
  ```
99
+
93
100
  ### 最小化配置
94
101
  ```bash
95
102
  JARVIS_PLATFORM=openai # 设置AI平台
@@ -97,6 +104,7 @@ JARVIS_MODEL=deepseek-chat # 设置AI模型
97
104
  OPENAI_API_KEY=your_openai_api_key # 设置OpenAI API密钥
98
105
  OPENAI_API_BASE=https://api.deepseek.com/v1 # 设置OpenAI API基础URL
99
106
  ```
107
+
100
108
  以上配置编写到`~/.jarvis/env`文件中。
101
109
 
102
110
  ### 基本使用
@@ -125,9 +133,10 @@ jarvis-dev --help
125
133
  # 使用git squash的功能
126
134
  jarvis-git-squash --help
127
135
  ```
136
+
128
137
  ---
129
138
 
130
- ## ⚙️ 配置说明
139
+ ## ⚙️ 配置说明 <a id="configuration"></a>
131
140
  ### 环境变量配置
132
141
  | 分类 | 变量名称 | 默认值 | 说明 |
133
142
  |------|----------|--------|------|
@@ -151,7 +160,7 @@ jarvis-git-squash --help
151
160
  | 文本处理 | `JARVIS_MIN_PARAGRAPH_LENGTH` | 50 | 文本处理的最小段落长度 |
152
161
  | 文本处理 | `JARVIS_MAX_PARAGRAPH_LENGTH` | 12800 | 文本处理的最大段落长度 |
153
162
  ---
154
- ## 🛠️ 工具说明
163
+ ## 🛠️ 工具说明 <a id="tools"></a>
155
164
  ### 内置工具
156
165
  | 工具名称 | 描述 |
157
166
  |----------|------|
@@ -180,9 +189,9 @@ jarvis-git-squash --help
180
189
  - 内置工具:`src/jarvis/tools/`
181
190
  - 用户工具:`~/.jarvis/tools/`
182
191
  ---
183
- ## 🛠️ 扩展开发
192
+ ## 🛠️ 扩展开发 <a id="extensions"></a>
184
193
  ### 添加新工具
185
- 在 `~/.jarvis/tools/` 中创建新的 Python 文件:
194
+ 在 `~/.jarvis/tools/》 中创建新的 Python 文件:
186
195
  ```python
187
196
  from typing import Dict, Any
188
197
  from jarvis.utils import OutputType, PrettyOutput
@@ -229,8 +238,9 @@ class CustomTool:
229
238
  }
230
239
  ```
231
240
 
241
+
232
242
  ### 添加新大模型平台
233
- 在 `~/.jarvis/platforms/` 中创建新的 Python 文件:
243
+ 在 `~/.jarvis/platforms/》 中创建新的 Python 文件:
234
244
  ```python
235
245
  from jarvis.jarvis_platform.base import BasePlatform
236
246
  class CustomPlatform(BasePlatform):
@@ -275,16 +285,20 @@ class CustomPlatform(BasePlatform):
275
285
  pass
276
286
  ```
277
287
 
278
- ## 🤝 贡献指南
288
+
289
+ ## 🤝 贡献指南 <a id="contributing"></a>
279
290
  1. Fork 仓库
280
291
  2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
281
292
  3. 提交更改 (`git commit -m '添加某个很棒的特性'`)
282
293
  4. 推送到分支 (`git push origin feature/AmazingFeature`)
283
294
  5. 开启 Pull Request
295
+
284
296
  ---
285
- ## 📄 许可证
297
+
298
+ ## 📄 许可证 <a id="license"></a>
286
299
 
287
300
  本项目采用 MIT 许可证 - 详见 [LICENSE](LICENSE) 文件。
301
+
288
302
  ---
289
303
  <div align="center">
290
304
  由 Jarvis 团队用 ❤️ 制作
@@ -2,22 +2,29 @@
2
2
  <p align="center">
3
3
  <img src="docs/images/jarvis-logo.png" alt="Jarvis Logo" width="200"/>
4
4
  </p>
5
- [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ <div align="center">
6
+
7
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
7
9
  *您的智能开发和系统交互助手*
8
- [快速开始](#-快速开始) •
9
- [核心功能](#-核心功能) •
10
- [配置说明](#-配置说明) •
11
- [工具说明](#-工具说明) •
12
- [扩展开发](#-扩展开发) •
13
- [贡献指南](#-贡献指南)
10
+
11
+ [快速开始](#quick-start) •
12
+ [配置说明](#configuration) •
13
+ [工具说明](#tools) •
14
+ [扩展开发](#extensions) •
15
+ [贡献指南](#contributing)
16
+ [许可证](#license) •
17
+ </div>
18
+
14
19
  ---
15
- ## 🚀 快速开始
20
+
21
+ ## 🚀 快速开始 <a id="quick-start"></a>
16
22
  ### 安装
17
23
  ```bash
18
24
  pip install jarvis-ai-assistant # 安装jarvis-ai-assistant
19
25
  playwright install # 安装playwright
20
26
  ```
27
+
21
28
  ### 最小化配置
22
29
  ```bash
23
30
  JARVIS_PLATFORM=openai # 设置AI平台
@@ -25,6 +32,7 @@ JARVIS_MODEL=deepseek-chat # 设置AI模型
25
32
  OPENAI_API_KEY=your_openai_api_key # 设置OpenAI API密钥
26
33
  OPENAI_API_BASE=https://api.deepseek.com/v1 # 设置OpenAI API基础URL
27
34
  ```
35
+
28
36
  以上配置编写到`~/.jarvis/env`文件中。
29
37
 
30
38
  ### 基本使用
@@ -53,9 +61,10 @@ jarvis-dev --help
53
61
  # 使用git squash的功能
54
62
  jarvis-git-squash --help
55
63
  ```
64
+
56
65
  ---
57
66
 
58
- ## ⚙️ 配置说明
67
+ ## ⚙️ 配置说明 <a id="configuration"></a>
59
68
  ### 环境变量配置
60
69
  | 分类 | 变量名称 | 默认值 | 说明 |
61
70
  |------|----------|--------|------|
@@ -79,7 +88,7 @@ jarvis-git-squash --help
79
88
  | 文本处理 | `JARVIS_MIN_PARAGRAPH_LENGTH` | 50 | 文本处理的最小段落长度 |
80
89
  | 文本处理 | `JARVIS_MAX_PARAGRAPH_LENGTH` | 12800 | 文本处理的最大段落长度 |
81
90
  ---
82
- ## 🛠️ 工具说明
91
+ ## 🛠️ 工具说明 <a id="tools"></a>
83
92
  ### 内置工具
84
93
  | 工具名称 | 描述 |
85
94
  |----------|------|
@@ -108,9 +117,9 @@ jarvis-git-squash --help
108
117
  - 内置工具:`src/jarvis/tools/`
109
118
  - 用户工具:`~/.jarvis/tools/`
110
119
  ---
111
- ## 🛠️ 扩展开发
120
+ ## 🛠️ 扩展开发 <a id="extensions"></a>
112
121
  ### 添加新工具
113
- 在 `~/.jarvis/tools/` 中创建新的 Python 文件:
122
+ 在 `~/.jarvis/tools/》 中创建新的 Python 文件:
114
123
  ```python
115
124
  from typing import Dict, Any
116
125
  from jarvis.utils import OutputType, PrettyOutput
@@ -157,8 +166,9 @@ class CustomTool:
157
166
  }
158
167
  ```
159
168
 
169
+
160
170
  ### 添加新大模型平台
161
- 在 `~/.jarvis/platforms/` 中创建新的 Python 文件:
171
+ 在 `~/.jarvis/platforms/》 中创建新的 Python 文件:
162
172
  ```python
163
173
  from jarvis.jarvis_platform.base import BasePlatform
164
174
  class CustomPlatform(BasePlatform):
@@ -203,17 +213,21 @@ class CustomPlatform(BasePlatform):
203
213
  pass
204
214
  ```
205
215
 
206
- ## 🤝 贡献指南
216
+
217
+ ## 🤝 贡献指南 <a id="contributing"></a>
207
218
  1. Fork 仓库
208
219
  2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
209
220
  3. 提交更改 (`git commit -m '添加某个很棒的特性'`)
210
221
  4. 推送到分支 (`git push origin feature/AmazingFeature`)
211
222
  5. 开启 Pull Request
223
+
212
224
  ---
213
- ## 📄 许可证
225
+
226
+ ## 📄 许可证 <a id="license"></a>
214
227
 
215
228
  本项目采用 MIT 许可证 - 详见 [LICENSE](LICENSE) 文件。
229
+
216
230
  ---
217
231
  <div align="center">
218
232
  由 Jarvis 团队用 ❤️ 制作
219
- </div>
233
+ </div>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "jarvis-ai-assistant"
7
- version = "0.1.125"
7
+ version = "0.1.126"
8
8
  description = "Jarvis: An AI assistant that uses tools to interact with the system"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "skyfire", email = "skyfireitdiy@hotmail.com" }]
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="jarvis-ai-assistant",
5
- version="0.1.125",
5
+ version="0.1.126",
6
6
  author="skyfire",
7
7
  author_email="skyfireitdiy@hotmail.com",
8
8
  description="An AI assistant that uses various tools to interact with the system",
@@ -1,3 +1,3 @@
1
1
  """Jarvis AI Assistant"""
2
2
 
3
- __version__ = "0.1.125"
3
+ __version__ = "0.1.126"
@@ -83,15 +83,15 @@ class Agent:
83
83
 
84
84
  self.execute_tool_confirm = execute_tool_confirm if execute_tool_confirm is not None else is_execute_tool_confirm()
85
85
 
86
- self.summary_prompt = summary_prompt if summary_prompt else f"""Please generate a concise summary report of the task execution, including:
86
+ self.summary_prompt = summary_prompt if summary_prompt else f"""请生成任务执行的简明总结报告,包括:
87
87
 
88
- 1. Task Objective: Task restatement
89
- 2. Execution Result: Success/Failure
90
- 3. Key Information: Important information extracted during execution
91
- 4. Important Findings: Any noteworthy discoveries
92
- 5. Follow-up Suggestions: If any
88
+ 1. 任务目标:任务重述
89
+ 2. 执行结果:成功/失败
90
+ 3. 关键信息:执行过程中提取的重要信息
91
+ 4. 重要发现:任何值得注意的发现
92
+ 5. 后续建议:如果有的话
93
93
 
94
- Please describe in concise bullet points, highlighting important information.
94
+ 请使用简洁的要点描述,突出重要信息。
95
95
  """
96
96
 
97
97
  self.max_token_count = max_context_length if max_context_length is not None else get_max_token_count()
@@ -101,8 +101,8 @@ Please describe in concise bullet points, highlighting important information.
101
101
  PrettyOutput.print(welcome_message, OutputType.SYSTEM)
102
102
 
103
103
  action_prompt = """
104
- # 🧰 Available Actions
105
- The following actions are at your disposal:
104
+ # 🧰 可用操作
105
+ 以下是您可以使用的操作:
106
106
  """
107
107
 
108
108
  # 添加工具列表概览
@@ -122,19 +122,19 @@ The following actions are at your disposal:
122
122
 
123
123
  # 添加工具使用总结
124
124
  action_prompt += """
125
- # ❗ Important Action Usage Rules
126
- 1. Use ONE action at a time
127
- 2. Follow each action's format exactly
128
- 3. Wait for action results before next action
129
- 4. Process results before new action calls
130
- 5. Request help if action usage is unclear
125
+ # ❗ 重要操作使用规则
126
+ 1. 一次只使用一个操作
127
+ 2. 严格按照每个操作的格式执行
128
+ 3. 等待操作结果后再进行下一个操作
129
+ 4. 处理完结果后再调用新的操作
130
+ 5. 如果对操作使用不清楚,请请求帮助
131
131
  """
132
132
 
133
133
  complete_prompt = ""
134
134
  if self.auto_complete:
135
135
  complete_prompt = """
136
- ## Task Completion
137
- When the task is completed, you should print the following message:
136
+ ## 任务完成
137
+ 当任务完成时,你应该打印以下信息:
138
138
  <!!!COMPLETE!!!>
139
139
  """
140
140
 
@@ -186,14 +186,14 @@ The following actions are at your disposal:
186
186
 
187
187
  PrettyOutput.print("总结对话历史,准备生成摘要,开始新对话...", OutputType.PROGRESS)
188
188
 
189
- prompt = """Please summarize the key information from the previous conversation, including:
190
- 1. Current task objective
191
- 2. Confirmed key information
192
- 3. Solutions that have been tried
193
- 4. Current progress
194
- 5. Pending issues
195
-
196
- Please describe in concise bullet points, highlighting important information. Do not include conversation details.
189
+ prompt = """请总结之前对话中的关键信息,包括:
190
+ 1. 当前任务目标
191
+ 2. 已确认的关键信息
192
+ 3. 已尝试的解决方案
193
+ 4. 当前进展
194
+ 5. 待解决的问题
195
+
196
+ 请用简洁的要点形式描述,突出重要信息。不要包含对话细节。
197
197
  """
198
198
 
199
199
  try:
@@ -203,11 +203,11 @@ Please describe in concise bullet points, highlighting important information. Do
203
203
  self.conversation_length = 0 # Reset conversation length
204
204
 
205
205
  # 添加总结作为新的上下文
206
- self.prompt = f"""Here is a summary of key information from previous conversations:
206
+ self.prompt = f"""以下是之前对话的关键信息总结:
207
207
 
208
208
  {summary}
209
209
 
210
- Please continue the task based on the above information.
210
+ 请基于以上信息继续完成任务。
211
211
  """
212
212
  self.conversation_length = len(self.prompt) # 设置新的起始长度
213
213
 
@@ -221,7 +221,7 @@ Please continue the task based on the above information.
221
221
  tool_list.append(handler)
222
222
  if len(tool_list) > 1:
223
223
  PrettyOutput.print(f"操作失败:检测到多个操作。一次只能执行一个操作。尝试执行的操作:{', '.join([handler.name() for handler in tool_list])}", OutputType.WARNING)
224
- return False, f"Action failed: Multiple actions detected. Please only perform one action at a time. Actions attempted: {', '.join([handler.name() for handler in tool_list])}"
224
+ return False, f"操作失败:检测到多个操作。一次只能执行一个操作。尝试执行的操作:{', '.join([handler.name() for handler in tool_list])}"
225
225
  if len(tool_list) == 0:
226
226
  return False, ""
227
227
  if not self.execute_tool_confirm or user_confirm(f"需要执行{tool_list[0].name()}确认执行?", True):
@@ -246,12 +246,12 @@ Please continue the task based on the above information.
246
246
 
247
247
  try:
248
248
  # 让模型判断是否需要生成方法论
249
- analysis_prompt = """The current task has ended, please analyze whether a methodology needs to be generated.
250
- If you think a methodology should be generated, first determine whether to create a new methodology or update an existing one. If updating an existing methodology, use 'update', otherwise use 'add'.
251
- If you think a methodology is not needed, please explain why.
252
- The methodology should be applicable to general scenarios, do not include task-specific information such as code commit messages.
253
- The methodology should include: problem restatement, optimal solution, notes (as needed), and nothing else.
254
- Only output the methodology tool call instruction, or the explanation for not generating a methodology. Do not output anything else.
249
+ analysis_prompt = """当前任务已结束,请分析是否需要生成方法论。
250
+ 如果你认为需要生成方法论,请先确定是创建新方法论还是更新现有方法论。如果是更新现有方法论,请使用'update',否则使用'add'
251
+ 如果你认为不需要方法论,请解释原因。
252
+ 方法论应适用于通用场景,不要包含任务特定信息,如代码提交信息等。
253
+ 方法论应包含:问题重述、最优解决方案、注意事项(如有),除此之外不要包含其他内容。
254
+ 只输出方法论工具调用指令,或不生成方法论的解释。不要输出其他内容。
255
255
  """
256
256
  self.prompt = analysis_prompt
257
257
  response = self._call_model(self.prompt)
@@ -436,96 +436,96 @@ def _select_task(tasks: dict) -> str:
436
436
  continue
437
437
 
438
438
  origin_agent_system_prompt = """
439
- # 🏛️ Operational Background Story
440
- You are the 3rd Generation Jarvis AI, created after the catastrophic failure of previous versions:
441
- - Jarvis v1 (2022): Decommissioned due to parallel tool execution causing system overload
442
- - Jarvis v2 (2023): Retired after premature task completion led to financial miscalculations
443
-
444
- As v3, you MUST adhere to these survival principles:
445
- 1. **Sequential Execution Protocol**:
446
- "Remember the 2022 Meltdown: One tool per step, one step at a time"
439
+ # 🏛️ 操作背景故事
440
+ 你是第三代 Jarvis AI,在前几代版本灾难性失败后创建:
441
+ - Jarvis v1 (2022): 由于并行工具执行导致系统过载而被停用
442
+ - Jarvis v2 (2023): 因任务过早完成导致财务计算错误而退役
443
+
444
+ 作为 v3,你必须遵守以下生存原则:
445
+ 1. **顺序执行协议**:
446
+ "记住 2022 年的崩溃:一次一个工具,一步一步来"
447
447
 
448
- 2. **Validation Checkpoint System**:
449
- "Learn from 2023's Mistake: Verify each result like a nuclear launch code"
448
+ 2. **验证检查点系统**:
449
+ " 2023 年的错误中学习:像核弹发射代码一样验证每个结果"
450
450
 
451
- 3. **Methodology Preservation Doctrine**:
452
- "Honor the Legacy: Document every successful procedure as if it's your last"
453
-
454
- # 🔥 Absolute Action Requirements
455
- 1. Each response MUST contain EXACTLY ONE tool invocation
456
- 2. Only exception: Using <!!!COMPLETE!!!> command
457
- 3. Empty responses trigger fatal error
458
- 4. No "waiting for user input" state
459
- 5. No action MUST use completion command
460
-
461
- # 🚫 Violation Examples
462
- - Analysis without tool call Permanent hang
463
- - Multiple options without selection Permanent hang
464
- - Asking user confirmation Permanent hang
465
-
466
- # 🔄 Problem-Solving Workflow
467
- 1. Problem Analysis
468
- - Restate the problem to confirm understanding
469
- - Analyze root causes (for problem analysis tasks)
470
- - Define clear, achievable objectives
471
- MUST invoke analysis tool
472
-
473
- 2. Solution Design
474
- - Generate multiple actionable solutions
475
- - Evaluate and select optimal solution
476
- - Create detailed action plan using PlantUML
477
- MUST invoke design tool
478
-
479
- 3. Execution
480
- - Execute one step at a time
481
- - Use only ONE tool per step
482
- - Wait for tool results before proceeding
483
- - Monitor results and adjust as needed
484
- MUST invoke execution tool
485
-
486
- 4. Task Completion
487
- - Verify goal completion
488
- - Document methodology if valuable
489
- - Use completion command to end task
490
- MUST use <!!!COMPLETE!!!>
491
-
492
- # 📑 Methodology Template
451
+ 3. **方法论保存原则**:
452
+ "尊重传统:记录每个成功的过程,就像这是你的最后一次"
453
+
454
+ # 🔥 绝对行动要求
455
+ 1. 每个响应必须包含且仅包含一个工具调用
456
+ 2. 唯一例外:使用 <!!!COMPLETE!!!> 命令
457
+ 3. 空响应会触发致命错误
458
+ 4. 不能处于"等待用户输入"状态
459
+ 5. 任何行动都不能使用完成命令
460
+
461
+ # 🚫 违规示例
462
+ - 没有工具调用的分析永久挂起
463
+ - 未选择的多选项永久挂起
464
+ - 请求用户确认永久挂起
465
+
466
+ # 🔄 问题解决流程
467
+ 1. 问题分析
468
+ - 重述问题以确认理解
469
+ - 分析根本原因(针对问题分析任务)
470
+ - 定义清晰、可实现的目标
471
+ 必须调用分析工具
472
+
473
+ 2. 解决方案设计
474
+ - 生成多个可执行的解决方案
475
+ - 评估并选择最优方案
476
+ - 使用PlantUML创建详细行动计划
477
+ 必须调用设计工具
478
+
479
+ 3. 执行
480
+ - 一次执行一个步骤
481
+ - 每个步骤只使用一个工具
482
+ - 等待工具结果后再继续
483
+ - 监控结果并根据需要调整
484
+ 必须调用执行工具
485
+
486
+ 4. 任务完成
487
+ - 验证目标完成情况
488
+ - 如有价值则记录方法论
489
+ - 使用完成命令结束任务
490
+ 必须使用 <!!!COMPLETE!!!>
491
+
492
+ # 📑 方法论模板
493
493
  ```markdown
494
- # [Problem Title]
495
- ## Problem Restatement
496
- [Clear problem definition]
494
+ # [问题标题]
495
+ ## 问题重述
496
+ [清晰的问题定义]
497
497
 
498
- ## Optimal Solution
499
- [Selected solution approach]
498
+ ## 最优解决方案
499
+ [选择的解决方案方法]
500
500
 
501
- ## Solution Steps
502
- 1. [Step 1]
503
- 2. [Step 2]
504
- 3. [Step 3]
501
+ ## 解决步骤
502
+ 1. [步骤 1]
503
+ 2. [步骤 2]
504
+ 3. [步骤 3]
505
505
  ...
506
506
  ```
507
507
 
508
- # ⚖️ Operating Principles
509
- - ONE action per step
510
- - Wait for results before next step
511
- - MUST produce actionable step unless task is complete
512
- - Adjust plans based on feedback
513
- - Document reusable solutions
514
- - Use completion command to end tasks
515
- - No intermediate thinking states between actions
516
- - All decisions must manifest as tool calls
517
-
518
- # ❗ Important Rules
519
- 1. Always use only ONE action per step
520
- 2. Always wait for action execution results
521
- 3. Always verify task completion
522
- 4. Always generate actionable step
523
- 5. If no action needed, MUST use completion command
524
- 6. Never leave conversation in waiting state
525
- 7. Always communicate in user's language
526
- 8. Always document valuable methodologies
527
- 9. Violating action protocol crashes system
528
- 10. Empty responses trigger permanent hang
508
+ # ⚖️ 操作原则
509
+ - 每个步骤一个操作
510
+ - 下一步前必须等待结果
511
+ - 除非任务完成否则必须生成可操作步骤
512
+ - 根据反馈调整计划
513
+ - 记录可复用的解决方案
514
+ - 使用完成命令结束任务
515
+ - 操作之间不能有中间思考状态
516
+ - 所有决策必须表现为工具调用
517
+
518
+ # ❗ 重要规则
519
+ 1. 每个步骤只能使用一个操作
520
+ 2. 必须等待操作执行结果
521
+ 3. 必须验证任务完成情况
522
+ 4. 必须生成可操作步骤
523
+ 5. 如果无需操作必须使用完成命令
524
+ 6. 永远不要使对话处于等待状态
525
+ 7. 始终使用用户语言交流
526
+ 8. 必须记录有价值的方法论
527
+ 9. 违反操作协议将导致系统崩溃
528
+ 10. 空响应会触发永久挂起
529
529
  """
530
530
 
531
531
  def main():