jarvis-ai-assistant 0.1.165__tar.gz → 0.1.167__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 (109) hide show
  1. {jarvis_ai_assistant-0.1.165/src/jarvis_ai_assistant.egg-info → jarvis_ai_assistant-0.1.167}/PKG-INFO +45 -45
  2. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/README.md +44 -43
  3. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/pyproject.toml +1 -1
  4. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/setup.py +1 -1
  5. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/__init__.py +1 -1
  6. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/__init__.py +15 -3
  7. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/code_review.py +4 -4
  8. jarvis_ai_assistant-0.1.167/src/jarvis/jarvis_git_details/main.py +269 -0
  9. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/base.py +14 -2
  10. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/kimi.py +4 -0
  11. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/yuanbao.py +5 -0
  12. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_smart_shell/main.py +12 -2
  13. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/edit_file.py +2 -2
  14. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/find_methodology.py +5 -1
  15. jarvis_ai_assistant-0.1.167/src/jarvis/jarvis_tools/generate_new_tool.py +288 -0
  16. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/read_webpage.py +5 -0
  17. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/search_web.py +6 -1
  18. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/config.py +9 -0
  19. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/git_utils.py +40 -1
  20. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/methodology.py +11 -5
  21. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/utils.py +9 -1
  22. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167/src/jarvis_ai_assistant.egg-info}/PKG-INFO +45 -45
  23. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis_ai_assistant.egg-info/SOURCES.txt +1 -0
  24. jarvis_ai_assistant-0.1.165/src/jarvis/jarvis_git_details/main.py +0 -181
  25. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/LICENSE +0 -0
  26. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/MANIFEST.in +0 -0
  27. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/setup.cfg +0 -0
  28. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/builtin_input_handler.py +0 -0
  29. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/file_input_handler.py +0 -0
  30. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/jarvis.py +0 -0
  31. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/main.py +0 -0
  32. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/output_handler.py +0 -0
  33. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_agent/shell_input_handler.py +0 -0
  34. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_agent/__init__.py +0 -0
  35. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_agent/code_agent.py +0 -0
  36. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/__init__.py +0 -0
  37. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/c_cpp.py +0 -0
  38. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/csharp.py +0 -0
  39. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/data_format.py +0 -0
  40. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/devops.py +0 -0
  41. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/docs.py +0 -0
  42. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/go.py +0 -0
  43. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/infrastructure.py +0 -0
  44. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/java.py +0 -0
  45. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/javascript.py +0 -0
  46. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/kotlin.py +0 -0
  47. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/loader.py +0 -0
  48. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/php.py +0 -0
  49. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/python.py +0 -0
  50. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/ruby.py +0 -0
  51. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/rust.py +0 -0
  52. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/shell.py +0 -0
  53. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/sql.py +0 -0
  54. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/swift.py +0 -0
  55. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_code_analysis/checklists/web.py +0 -0
  56. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_data/huggingface.tar.gz +0 -0
  57. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_dev/main.py +0 -0
  58. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_git_details/__init__.py +0 -0
  59. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_git_squash/__init__.py +0 -0
  60. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_git_squash/main.py +0 -0
  61. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_git_utils/git_commiter.py +0 -0
  62. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_lsp/base.py +0 -0
  63. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_lsp/cpp.py +0 -0
  64. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_lsp/go.py +0 -0
  65. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_lsp/python.py +0 -0
  66. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_lsp/registry.py +0 -0
  67. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_lsp/rust.py +0 -0
  68. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_mcp/__init__.py +0 -0
  69. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_mcp/sse_mcp_client.py +0 -0
  70. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_mcp/stdio_mcp_client.py +0 -0
  71. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_methodology/main.py +0 -0
  72. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_multi_agent/__init__.py +0 -0
  73. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_multi_agent/main.py +0 -0
  74. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/__init__.py +0 -0
  75. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/human.py +0 -0
  76. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/openai.py +0 -0
  77. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform/registry.py +0 -0
  78. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform_manager/__init__.py +0 -0
  79. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_platform_manager/main.py +0 -0
  80. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_smart_shell/__init__.py +0 -0
  81. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/__init__.py +0 -0
  82. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/ask_codebase.py +0 -0
  83. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/ask_user.py +0 -0
  84. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/base.py +0 -0
  85. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/chdir.py +0 -0
  86. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/code_plan.py +0 -0
  87. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/create_code_agent.py +0 -0
  88. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/create_sub_agent.py +0 -0
  89. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/execute_script.py +0 -0
  90. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/file_analyzer.py +0 -0
  91. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/file_operation.py +0 -0
  92. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/lsp_get_diagnostics.py +0 -0
  93. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/methodology.py +0 -0
  94. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/read_code.py +0 -0
  95. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/registry.py +0 -0
  96. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/rewrite_file.py +0 -0
  97. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_tools/virtual_tty.py +0 -0
  98. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/__init__.py +0 -0
  99. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/builtin_replace_map.py +0 -0
  100. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/embedding.py +0 -0
  101. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/file_processors.py +0 -0
  102. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/globals.py +0 -0
  103. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/input.py +0 -0
  104. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/output.py +0 -0
  105. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis/jarvis_utils/tag.py +0 -0
  106. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
  107. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis_ai_assistant.egg-info/entry_points.txt +0 -0
  108. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
  109. {jarvis_ai_assistant-0.1.165 → jarvis_ai_assistant-0.1.167}/src/jarvis_ai_assistant.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.2
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.165
3
+ Version: 0.1.167
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
@@ -65,7 +65,6 @@ Requires-Dist: build; extra == "dev"
65
65
  Requires-Dist: twine; extra == "dev"
66
66
  Dynamic: author
67
67
  Dynamic: home-page
68
- Dynamic: license-file
69
68
  Dynamic: requires-python
70
69
 
71
70
  # 🤖 Jarvis AI 助手
@@ -106,11 +105,19 @@ Dynamic: requires-python
106
105
 
107
106
 
108
107
  ## 🚀 快速开始 <a id="quick-start"></a>
108
+ ### 系统要求
109
+ - 目前只能在Linux系统下使用(很多工具依赖Linux系统)
110
+ - Windows没有测试过,但Windows 10以上的用户可以在WSL上使用此工具
111
+
109
112
  ### 安装
110
113
  ```bash
114
+ # 从源码安装(推荐)
111
115
  git clone https://github.com/skyfireitdiy/Jarvis
112
116
  cd Jarvis
113
117
  pip3 install -e .
118
+
119
+ # 或者从PyPI安装(可能更新不及时)
120
+ pip3 install jarvis-ai-assistant
114
121
  ```
115
122
 
116
123
  ### 最小化配置
@@ -149,55 +156,43 @@ Kimi API Key获取方式:
149
156
 
150
157
  删除Bearer前缀,剩下的内容就是Kimi API Key。
151
158
 
152
- 以上配置编写到`~/.jarvis/env`文件中。
153
159
 
154
- ### 基本使用
160
+ #### OpenAI
155
161
  ```bash
156
- # 使用通用代理
157
- jarvis
158
-
159
- # 使用代码代理
160
- jarvis-code-agent
161
- # 或者 jca
162
-
163
- # 使用智能shell的功能
164
- jarvis-smart-shell --help
165
- # 或者 jss
166
-
167
- # 使用平台管理的功能
168
- jarvis-platform-manager --help
169
-
170
- # 使用代码审查的功能
171
- jarvis-code-review --help
172
-
173
- # 使用自动化git commit的功能
174
- jarvis-git-commit --help
175
- # 或者 jgc
162
+ JARVIS_PLATFORM=openai
163
+ JARVIS_MODEL=gpt-4o # 默认模型,可选gpt-4-turbo, gpt-3.5-turbo等
164
+ JARVIS_THINKING_PLATFORM=openai
165
+ JARVIS_THINKING_MODEL=gpt-4o
176
166
 
177
- # 使用dev功能(开发中)
178
- jarvis-dev --help
179
-
180
- # 使用git squash的功能
181
- jarvis-git-squash --help
182
-
183
- # 使用多代理的功能
184
- jarvis-multi-agent --help
185
-
186
- # 使用agent的功能
187
- jarvis-agent --help
167
+ OPENAI_API_KEY=<OpenAI API Key>
168
+ OPENAI_API_BASE=https://api.openai.com/v1 # 可选,默认为官方API地址
169
+ ```
188
170
 
189
- # 使用工具的功能
190
- jarvis-tool --help
171
+ 配置说明:
172
+ 1. `OPENAI_API_KEY`: 必填。
173
+ 2. `OPENAI_API_BASE`: 可选,用于自定义API端点
191
174
 
192
- # 使用代码库查询功能
193
- jarvis-ask-codebase --help
175
+ 以上配置编写到`~/.jarvis/env`文件中。
194
176
 
195
- # 使用git details的功能
196
- jarvis-git-details --help
177
+ 支持的模型可通过`jarvis-platform-manager --list-models`查看完整列表。
197
178
 
198
- # 使用方法论的功能
199
- jarvis-methodology --help
200
- ```
179
+ ### 基本使用
180
+ | 命令 | 快捷方式 | 功能描述 |
181
+ |------|----------|----------|
182
+ | `jarvis` | - | 使用通用代理 |
183
+ | `jarvis-code-agent` | `jca` | 使用代码代理 |
184
+ | `jarvis-smart-shell` | `jss` | 使用智能shell功能 |
185
+ | `jarvis-platform-manager` | - | 使用平台管理功能 |
186
+ | `jarvis-code-review` | - | 使用代码审查功能 |
187
+ | `jarvis-git-commit` | `jgc` | 使用自动化git commit功能 |
188
+ | `jarvis-dev` | - | 使用dev功能(开发中) |
189
+ | `jarvis-git-squash` | - | 使用git squash功能 |
190
+ | `jarvis-multi-agent` | - | 使用多代理功能 |
191
+ | `jarvis-agent` | - | 使用agent功能 |
192
+ | `jarvis-tool` | - | 使用工具功能 |
193
+ | `jarvis-ask-codebase` | `jac` | 使用代码库查询功能 |
194
+ | `jarvis-git-details` | - | 使用git details功能 |
195
+ | `jarvis-methodology` | - | 使用方法论功能 |
201
196
 
202
197
  ---
203
198
 
@@ -216,6 +211,9 @@ jarvis-methodology --help
216
211
  | `JARVIS_EXECUTE_TOOL_CONFIRM` | false | 执行工具前是否需要确认 |
217
212
  | `JARVIS_CONFIRM_BEFORE_APPLY_PATCH` | true | 应用补丁前是否需要确认 |
218
213
  | `JARVIS_MAX_TOOL_CALL_COUNT` | 20 | 最大连续工具调用次数 |
214
+ | `JARVIS_AUTO_UPDATE` | true | 是否自动更新Jarvis(仅在以git仓库方式安装时有效) |
215
+
216
+ 所有配置编写到`~/.jarvis/env`文件中即可生效。
219
217
 
220
218
 
221
219
  ---
@@ -412,3 +410,5 @@ class CustomPlatform(BasePlatform):
412
410
  <div align="center">
413
411
  由 Jarvis 团队用 ❤️ 制作
414
412
  </div>
413
+
414
+ ![Jarvis技术支持群](docs/images/wechat.png)
@@ -36,11 +36,19 @@
36
36
 
37
37
 
38
38
  ## 🚀 快速开始 <a id="quick-start"></a>
39
+ ### 系统要求
40
+ - 目前只能在Linux系统下使用(很多工具依赖Linux系统)
41
+ - Windows没有测试过,但Windows 10以上的用户可以在WSL上使用此工具
42
+
39
43
  ### 安装
40
44
  ```bash
45
+ # 从源码安装(推荐)
41
46
  git clone https://github.com/skyfireitdiy/Jarvis
42
47
  cd Jarvis
43
48
  pip3 install -e .
49
+
50
+ # 或者从PyPI安装(可能更新不及时)
51
+ pip3 install jarvis-ai-assistant
44
52
  ```
45
53
 
46
54
  ### 最小化配置
@@ -79,55 +87,43 @@ Kimi API Key获取方式:
79
87
 
80
88
  删除Bearer前缀,剩下的内容就是Kimi API Key。
81
89
 
82
- 以上配置编写到`~/.jarvis/env`文件中。
83
90
 
84
- ### 基本使用
91
+ #### OpenAI
85
92
  ```bash
86
- # 使用通用代理
87
- jarvis
88
-
89
- # 使用代码代理
90
- jarvis-code-agent
91
- # 或者 jca
92
-
93
- # 使用智能shell的功能
94
- jarvis-smart-shell --help
95
- # 或者 jss
96
-
97
- # 使用平台管理的功能
98
- jarvis-platform-manager --help
99
-
100
- # 使用代码审查的功能
101
- jarvis-code-review --help
102
-
103
- # 使用自动化git commit的功能
104
- jarvis-git-commit --help
105
- # 或者 jgc
106
-
107
- # 使用dev功能(开发中)
108
- jarvis-dev --help
93
+ JARVIS_PLATFORM=openai
94
+ JARVIS_MODEL=gpt-4o # 默认模型,可选gpt-4-turbo, gpt-3.5-turbo等
95
+ JARVIS_THINKING_PLATFORM=openai
96
+ JARVIS_THINKING_MODEL=gpt-4o
109
97
 
110
- # 使用git squash的功能
111
- jarvis-git-squash --help
112
-
113
- # 使用多代理的功能
114
- jarvis-multi-agent --help
115
-
116
- # 使用agent的功能
117
- jarvis-agent --help
98
+ OPENAI_API_KEY=<OpenAI API Key>
99
+ OPENAI_API_BASE=https://api.openai.com/v1 # 可选,默认为官方API地址
100
+ ```
118
101
 
119
- # 使用工具的功能
120
- jarvis-tool --help
102
+ 配置说明:
103
+ 1. `OPENAI_API_KEY`: 必填。
104
+ 2. `OPENAI_API_BASE`: 可选,用于自定义API端点
121
105
 
122
- # 使用代码库查询功能
123
- jarvis-ask-codebase --help
106
+ 以上配置编写到`~/.jarvis/env`文件中。
124
107
 
125
- # 使用git details的功能
126
- jarvis-git-details --help
108
+ 支持的模型可通过`jarvis-platform-manager --list-models`查看完整列表。
127
109
 
128
- # 使用方法论的功能
129
- jarvis-methodology --help
130
- ```
110
+ ### 基本使用
111
+ | 命令 | 快捷方式 | 功能描述 |
112
+ |------|----------|----------|
113
+ | `jarvis` | - | 使用通用代理 |
114
+ | `jarvis-code-agent` | `jca` | 使用代码代理 |
115
+ | `jarvis-smart-shell` | `jss` | 使用智能shell功能 |
116
+ | `jarvis-platform-manager` | - | 使用平台管理功能 |
117
+ | `jarvis-code-review` | - | 使用代码审查功能 |
118
+ | `jarvis-git-commit` | `jgc` | 使用自动化git commit功能 |
119
+ | `jarvis-dev` | - | 使用dev功能(开发中) |
120
+ | `jarvis-git-squash` | - | 使用git squash功能 |
121
+ | `jarvis-multi-agent` | - | 使用多代理功能 |
122
+ | `jarvis-agent` | - | 使用agent功能 |
123
+ | `jarvis-tool` | - | 使用工具功能 |
124
+ | `jarvis-ask-codebase` | `jac` | 使用代码库查询功能 |
125
+ | `jarvis-git-details` | - | 使用git details功能 |
126
+ | `jarvis-methodology` | - | 使用方法论功能 |
131
127
 
132
128
  ---
133
129
 
@@ -146,6 +142,9 @@ jarvis-methodology --help
146
142
  | `JARVIS_EXECUTE_TOOL_CONFIRM` | false | 执行工具前是否需要确认 |
147
143
  | `JARVIS_CONFIRM_BEFORE_APPLY_PATCH` | true | 应用补丁前是否需要确认 |
148
144
  | `JARVIS_MAX_TOOL_CALL_COUNT` | 20 | 最大连续工具调用次数 |
145
+ | `JARVIS_AUTO_UPDATE` | true | 是否自动更新Jarvis(仅在以git仓库方式安装时有效) |
146
+
147
+ 所有配置编写到`~/.jarvis/env`文件中即可生效。
149
148
 
150
149
 
151
150
  ---
@@ -341,4 +340,6 @@ class CustomPlatform(BasePlatform):
341
340
  ---
342
341
  <div align="center">
343
342
  由 Jarvis 团队用 ❤️ 制作
344
- </div>
343
+ </div>
344
+
345
+ ![Jarvis技术支持群](docs/images/wechat.png)
@@ -8,7 +8,7 @@ default = true
8
8
 
9
9
  [project]
10
10
  name = "jarvis-ai-assistant"
11
- version = "0.1.165"
11
+ version = "0.1.167"
12
12
  description = "Jarvis: An AI assistant that uses tools to interact with the system"
13
13
  readme = "README.md"
14
14
  authors = [{ name = "skyfire", email = "skyfireitdiy@hotmail.com" }]
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name="jarvis-ai-assistant",
6
- version="0.1.165",
6
+ version="0.1.167",
7
7
  author="skyfire",
8
8
  author_email="skyfireitdiy@hotmail.com",
9
9
  description="An AI assistant that uses various tools to interact with the system",
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Jarvis AI Assistant"""
3
3
 
4
- __version__ = "0.1.165"
4
+ __version__ = "0.1.167"
@@ -310,6 +310,17 @@ class Agent:
310
310
  """
311
311
  self.after_tool_call_cb = cb
312
312
 
313
+ def get_tool_registry(self) -> Optional[ToolRegistry]:
314
+ """获取工具注册器。
315
+
316
+ 返回:
317
+ ToolRegistry: 工具注册器实例
318
+ """
319
+ for handler in self.output_handler:
320
+ if isinstance(handler, ToolRegistry):
321
+ return handler
322
+ return None
323
+
313
324
  def make_default_addon_prompt(self, need_complete: bool) -> str:
314
325
  """生成附加提示。
315
326
 
@@ -321,7 +332,7 @@ class Agent:
321
332
  action_handlers = '\n'.join([f'- {handler.name()}' for handler in self.output_handler])
322
333
 
323
334
  # 任务完成提示
324
- complete_prompt = f"并输出{ot('!!!COMPLETE!!!')}" if need_complete and self.auto_complete else ""
335
+ complete_prompt = f"3. 输出{ot('!!!COMPLETE!!!')}" if need_complete and self.auto_complete else ""
325
336
 
326
337
  addon_prompt = f"""
327
338
  <addon>
@@ -342,9 +353,10 @@ class Agent:
342
353
  </actions>
343
354
 
344
355
  <completion>
345
- 如果任务已完成{complete_prompt},请:
356
+ 如果任务已完成,请:
346
357
  1. 说明完成原因
347
358
  2. 保持输出格式规范
359
+ {complete_prompt}
348
360
  </completion>
349
361
  </addon>
350
362
  """
@@ -658,7 +670,7 @@ arguments:
658
670
  msg = user_input
659
671
  for handler in self.input_handler:
660
672
  msg, _ = handler(msg, self)
661
- self.prompt = f"{user_input}\n\n以下是历史类似问题的执行经验,可参考:\n{load_methodology(msg)}"
673
+ self.prompt = f"{user_input}\n\n以下是历史类似问题的执行经验,可参考:\n{load_methodology(msg, self.get_tool_registry())}"
662
674
  self.first = False
663
675
 
664
676
  while True:
@@ -8,7 +8,6 @@ import tempfile
8
8
  from yaspin import yaspin
9
9
  from jarvis.jarvis_platform.registry import PlatformRegistry
10
10
  from jarvis.jarvis_tools.read_code import ReadCodeTool
11
- from jarvis.jarvis_tools.registry import ToolRegistry
12
11
  from jarvis.jarvis_agent import Agent
13
12
 
14
13
  from jarvis.jarvis_utils.output import OutputType, PrettyOutput
@@ -488,7 +487,7 @@ class CodeReviewTool:
488
487
 
489
488
  我将分析上传的代码差异文件,进行全面的代码审查。
490
489
  </code_review_guide>"""
491
-
490
+ from jarvis.jarvis_tools.registry import ToolRegistry
492
491
  tool_registry = ToolRegistry()
493
492
  tool_registry.dont_use_tools(["code_review"])
494
493
  agent = Agent(
@@ -554,8 +553,9 @@ class CodeReviewTool:
554
553
  如果检测到了特定编程语言,请参考语言特定的审查清单进行评估,并在报告中包含相关分析。
555
554
  </notes>
556
555
 
556
+ 输出格式:
557
557
  {ot("REPORT")}
558
- [在此处插入完整的审查报告]
558
+ [在此处插入完整MARKDOWN格式的审查报告]
559
559
  {ct("REPORT")}""",
560
560
  output_handler=[tool_registry],
561
561
  platform=PlatformRegistry().get_thinking_platform(),
@@ -654,7 +654,7 @@ def extract_code_report(result: str) -> str:
654
654
  sm = re.search(ot("REPORT")+r'\n(.*?)\n'+ct("REPORT"), result, re.DOTALL)
655
655
  if sm:
656
656
  return sm.group(1)
657
- return ""
657
+ return result
658
658
 
659
659
  def main():
660
660
  """CLI entry point"""
@@ -0,0 +1,269 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Git Commit分析工具模块
3
+
4
+ 该模块提供了一个GitCommitAnalyzer类,用于获取和分析指定Git commit的详细信息,
5
+ 包括提交信息、修改内容以及详细的功能、原因和逻辑分析。
6
+ """
7
+
8
+ import os
9
+ import re
10
+ import subprocess
11
+ from typing import Dict, Any
12
+
13
+ from jarvis.jarvis_agent import Agent
14
+ from jarvis.jarvis_platform.registry import PlatformRegistry
15
+ from jarvis.jarvis_tools.registry import ToolRegistry
16
+ from jarvis.jarvis_utils.output import OutputType, PrettyOutput
17
+ from jarvis.jarvis_utils.tag import ct, ot
18
+ from jarvis.jarvis_utils.utils import init_env
19
+
20
+
21
+ class GitCommitAnalyzer:
22
+ """Git Commit分析器
23
+
24
+ 该类用于获取和分析指定Git commit的详细信息,包括:
25
+ - 完整的提交信息
26
+ - 修改的文件列表和状态
27
+ - 修改的功能、原因和逻辑分析
28
+ """
29
+
30
+ def execute(self, args: Dict[str, Any]) -> Dict[str, Any]:
31
+ """执行commit分析
32
+
33
+ Args:
34
+ args: 包含commit_sha/commit_range和root_dir的参数字典
35
+ commit_sha: 单个commit的SHA
36
+ commit_range: 两个commit的SHA范围,格式为"commit1..commit2"
37
+ root_dir: 代码库根目录
38
+
39
+ Returns:
40
+ 包含分析结果的字典
41
+ """
42
+ try:
43
+ commit_sha = args.get("commit_sha")
44
+ commit_range = args.get("commit_range")
45
+ root_dir = args.get("root_dir", ".")
46
+
47
+ if commit_range:
48
+ return self.analyze_commit_range(commit_range, root_dir)
49
+ elif commit_sha:
50
+ return self.analyze_single_commit(commit_sha, root_dir)
51
+ else:
52
+ raise ValueError("Either commit_sha or commit_range must be provided")
53
+ except Exception as e:
54
+ return {
55
+ "success": False,
56
+ "stdout": {},
57
+ "stderr": f"Failed to analyze commit: {str(e)}"
58
+ }
59
+
60
+ def analyze_single_commit(self, commit_sha: str, root_dir: str) -> Dict[str, Any]:
61
+ """分析单个commit
62
+
63
+ Args:
64
+ commit_sha: commit的SHA
65
+ root_dir: 代码库根目录
66
+
67
+ Returns:
68
+ 包含分析结果的字典
69
+ """
70
+ original_dir = os.getcwd()
71
+ try:
72
+ os.chdir(root_dir)
73
+
74
+ # 获取commit详细信息
75
+ commit_info = subprocess.check_output(
76
+ f"git show {commit_sha} --pretty=fuller",
77
+ shell=True,
78
+ text=True
79
+ )
80
+
81
+ # 获取commit修改内容
82
+ diff_content = subprocess.check_output(
83
+ f"git show {commit_sha} --patch",
84
+ shell=True,
85
+ text=True
86
+ )
87
+
88
+ # 分析commit的功能、原因和逻辑
89
+ analysis_result = self._analyze_diff_content(diff_content)
90
+
91
+ return {
92
+ "success": True,
93
+ "stdout": {
94
+ "commit_info": commit_info,
95
+ "diff_content": diff_content,
96
+ "analysis_result": analysis_result
97
+ },
98
+ "stderr": ""
99
+ }
100
+ except subprocess.CalledProcessError as error:
101
+ return {
102
+ "success": False,
103
+ "stdout": {},
104
+ "stderr": f"Failed to analyze commit: {str(error)}"
105
+ }
106
+ finally:
107
+ os.chdir(original_dir)
108
+
109
+ def analyze_commit_range(self, commit_range: str, root_dir: str) -> Dict[str, Any]:
110
+ """分析两个commit之间的代码变更
111
+
112
+ Args:
113
+ commit_range: 两个commit的SHA范围,格式为"commit1..commit2"
114
+ root_dir: 代码库根目录
115
+
116
+ Returns:
117
+ 包含分析结果的字典
118
+ """
119
+ original_dir = os.getcwd()
120
+ try:
121
+ os.chdir(root_dir)
122
+
123
+ # 获取commit范围差异
124
+ diff_content = subprocess.check_output(
125
+ f"git diff {commit_range} --patch",
126
+ shell=True,
127
+ text=True
128
+ )
129
+
130
+ # 获取commit范围信息
131
+ commit_info = subprocess.check_output(
132
+ f"git log {commit_range} --pretty=fuller",
133
+ shell=True,
134
+ text=True
135
+ )
136
+
137
+ # 使用相同的分析方法处理差异内容
138
+ analysis_result = self._analyze_diff_content(diff_content)
139
+
140
+ return {
141
+ "success": True,
142
+ "stdout": {
143
+ "commit_info": commit_info,
144
+ "diff_content": diff_content,
145
+ "analysis_result": analysis_result
146
+ },
147
+ "stderr": ""
148
+ }
149
+ except subprocess.CalledProcessError as error:
150
+ return {
151
+ "success": False,
152
+ "stdout": {},
153
+ "stderr": f"Failed to analyze commit range: {str(error)}"
154
+ }
155
+ finally:
156
+ os.chdir(original_dir)
157
+
158
+ def _analyze_diff_content(self, diff_content: str) -> str:
159
+ """分析diff内容并生成报告
160
+
161
+ Args:
162
+ diff_content: git diff或git show的输出内容
163
+
164
+ Returns:
165
+ 分析结果字符串
166
+ """
167
+ system_prompt = """你是一位资深代码分析专家,拥有多年代码审查和重构经验。你需要对Git commit进行深入分析,包括:
168
+ 1. 修改的功能:明确说明本次commit实现或修改了哪些功能
169
+ 2. 修改的原因:分析为什么要进行这些修改(如修复bug、优化性能、添加新功能等)
170
+ 3. 修改的逻辑:详细说明代码修改的具体实现逻辑和思路
171
+ 4. 影响范围:评估本次修改可能影响的其他模块或功能
172
+ 5. 代码质量:分析代码风格、可读性和可维护性
173
+ 6. 测试覆盖:评估是否需要添加或修改测试用例
174
+ 7. 最佳实践:检查代码是否符合行业最佳实践和项目规范
175
+
176
+ 请确保分析内容:
177
+ - 准确反映commit的实际修改
178
+ - 提供足够的技术细节
179
+ - 保持结构清晰,便于理解
180
+ - 重点关注关键修改和潜在风险"""
181
+
182
+ tool_registry = ToolRegistry()
183
+ agent = Agent(
184
+ system_prompt=system_prompt,
185
+ name="Commit Analysis Agent",
186
+ summary_prompt=f"""请生成一份详细的commit分析报告,包含以下内容:
187
+ {ot("REPORT")}
188
+ # 功能分析
189
+ [说明本次commit实现或修改了哪些功能]
190
+
191
+ # 修改原因
192
+ [分析进行这些修改的原因,如修复bug、优化性能、添加新功能等]
193
+
194
+ # 实现逻辑
195
+ [详细说明代码修改的具体实现逻辑和思路]
196
+
197
+ # 影响范围
198
+ [评估本次修改可能影响的其他模块或功能]
199
+
200
+ # 代码质量
201
+ [分析代码风格、可读性和可维护性]
202
+
203
+ # 测试覆盖
204
+ [评估是否需要添加或修改测试用例]
205
+
206
+ # 最佳实践
207
+ [检查代码是否符合行业最佳实践和项目规范]
208
+ {ct("REPORT")}""",
209
+ output_handler=[tool_registry],
210
+ platform=PlatformRegistry().get_thinking_platform(),
211
+ auto_complete=True
212
+ )
213
+
214
+ return agent.run(diff_content)
215
+
216
+
217
+ def extract_analysis_report(result: str) -> str:
218
+ """从分析结果中提取报告内容
219
+
220
+ Args:
221
+ result: 包含REPORT标签的完整分析结果字符串
222
+
223
+ Returns:
224
+ 提取的报告内容,如果未找到REPORT标签则返回空字符串
225
+ """
226
+ search_match = re.search(ot("REPORT")+r'\n(.*?)\n'+ct("REPORT"), result, re.DOTALL)
227
+ if search_match:
228
+ return search_match.group(1)
229
+ return result
230
+
231
+
232
+ def main():
233
+ """主函数,用于命令行接口"""
234
+ import argparse
235
+
236
+ init_env()
237
+
238
+ parser = argparse.ArgumentParser(description='Git Commit Analyzer')
239
+ group = parser.add_mutually_exclusive_group(required=True)
240
+ group.add_argument('commit', nargs='?', help='Commit SHA to analyze')
241
+ group.add_argument('--range', type=str, help='Commit range to analyze (commit1..commit2)')
242
+ parser.add_argument('--root-dir', type=str, help='Root directory of the codebase', default=".")
243
+
244
+ args = parser.parse_args()
245
+
246
+ analyzer = GitCommitAnalyzer()
247
+ if args.range:
248
+ result = analyzer.execute({
249
+ "commit_range": args.range,
250
+ "root_dir": args.root_dir
251
+ })
252
+ else:
253
+ result = analyzer.execute({
254
+ "commit_sha": args.commit,
255
+ "root_dir": args.root_dir
256
+ })
257
+
258
+ if result["success"]:
259
+ PrettyOutput.section("Commit Information:", OutputType.SUCCESS)
260
+ PrettyOutput.print(result["stdout"]["commit_info"], OutputType.CODE)
261
+ PrettyOutput.section("Analysis Report:", OutputType.SUCCESS)
262
+ report = extract_analysis_report(result["stdout"]["analysis_result"])
263
+ PrettyOutput.print(report, OutputType.SUCCESS, lang="markdown")
264
+ else:
265
+ PrettyOutput.print(result["stderr"], OutputType.WARNING)
266
+
267
+
268
+ if __name__ == "__main__":
269
+ main()
@@ -40,13 +40,20 @@ class BasePlatform(ABC):
40
40
  raise NotImplementedError("upload_files is not implemented")
41
41
 
42
42
  def chat_big_content(self, content: str, prompt: str) -> str:
43
+ # 检查content大小不超过10MB
44
+ if len(content.encode('utf-8')) > 10 * 1024 * 1024:
45
+ return "Error: Content size exceeds 10MB limit"
46
+
43
47
  prefix_prompt = f"""
44
48
  我将分多次提供大量的上下文内容,在我明确告诉你内容已经全部提供完毕之前,每次仅需要输出“已收到”。
45
49
  """
46
50
  self.chat_until_success(prefix_prompt)
47
- split_content = split_text_into_chunks(content, get_max_input_token_count() - 1024)
51
+ split_content = split_text_into_chunks(content, get_max_input_token_count() - 1024, get_max_input_token_count() - 2048)
52
+ submit_count = 0
48
53
  for chunk in split_content:
49
- self.chat_until_success(f"<part_content>{chunk}</part_content>")
54
+ submit_count += 1
55
+ PrettyOutput.print(f"已提交{submit_count}次(总{len(split_content)}次)", OutputType.INFO)
56
+ self.chat_until_success(f"<part_content>{chunk}</part_content>请返回已收到")
50
57
  return self.chat_until_success(f"内容已经全部提供完毕\n\n{prompt}")
51
58
 
52
59
 
@@ -109,3 +116,8 @@ class BasePlatform(ABC):
109
116
  def set_web(self, web: bool):
110
117
  """Set web flag"""
111
118
  self.web = web
119
+
120
+ @abstractmethod
121
+ def support_web(self) -> bool:
122
+ """Check if platform supports web functionality"""
123
+ raise NotImplementedError("support_web is not implemented")
@@ -413,3 +413,7 @@ class KimiModel(BasePlatform):
413
413
  def name(self) -> str:
414
414
  """Model name"""
415
415
  return "kimi"
416
+
417
+ def support_web(self) -> bool:
418
+ """Kimi平台支持web功能"""
419
+ return True