jarvis-ai-assistant 0.1.124__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 (92) hide show
  1. jarvis_ai_assistant-0.1.126/PKG-INFO +305 -0
  2. jarvis_ai_assistant-0.1.126/README.md +233 -0
  3. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/pyproject.toml +2 -1
  4. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/setup.py +2 -1
  5. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/__init__.py +1 -1
  6. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_agent/__init__.py +134 -136
  7. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_code_agent/code_agent.py +295 -0
  8. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_code_agent/file_select.py +6 -19
  9. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_code_agent/patch.py +248 -0
  10. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_code_agent/shell_input_handler.py +22 -0
  11. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_codebase/main.py +89 -86
  12. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_dev/main.py +904 -0
  13. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_git_squash/main.py +81 -0
  14. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/base.py +0 -12
  15. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/cpp.py +1 -10
  16. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/go.py +1 -10
  17. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/python.py +0 -28
  18. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/registry.py +2 -3
  19. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_lsp/rust.py +1 -10
  20. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_multi_agent/__init__.py +53 -53
  21. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/ai8.py +2 -1
  22. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/base.py +19 -24
  23. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/kimi.py +2 -3
  24. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/ollama.py +3 -1
  25. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/openai.py +1 -1
  26. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/oyi.py +2 -1
  27. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/registry.py +2 -1
  28. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform_manager/main.py +4 -6
  29. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform_manager/openai_test.py +0 -1
  30. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_rag/main.py +5 -2
  31. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_smart_shell/main.py +9 -4
  32. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_tools/__init__.py +0 -0
  33. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/ask_codebase.py +18 -13
  34. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/ask_user.py +5 -4
  35. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_tools/base.py +37 -0
  36. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/chdir.py +8 -9
  37. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/code_review.py +19 -20
  38. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/create_code_agent.py +6 -6
  39. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/create_sub_agent.py +9 -9
  40. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_tools/execute_shell.py +113 -0
  41. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/execute_shell_script.py +7 -7
  42. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/file_operation.py +39 -10
  43. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/git_commiter.py +20 -17
  44. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_find_definition.py +8 -8
  45. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_find_references.py +1 -1
  46. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_get_diagnostics.py +19 -11
  47. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_get_document_symbols.py +1 -1
  48. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/lsp_prepare_rename.py +8 -8
  49. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/methodology.py +10 -7
  50. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/rag.py +27 -20
  51. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/read_webpage.py +4 -3
  52. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/registry.py +143 -140
  53. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_tools/search.py → jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_tools/search_web.py +10 -7
  54. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/select_code_files.py +4 -4
  55. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_tools/tool_generator.py +33 -34
  56. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/__init__.py +24 -0
  57. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/config.py +138 -0
  58. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/embedding.py +201 -0
  59. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/git_utils.py +120 -0
  60. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/globals.py +82 -0
  61. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/input.py +161 -0
  62. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/methodology.py +128 -0
  63. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/output.py +235 -0
  64. jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_utils/utils.py +150 -0
  65. jarvis_ai_assistant-0.1.126/src/jarvis_ai_assistant.egg-info/PKG-INFO +305 -0
  66. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/SOURCES.txt +12 -3
  67. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/entry_points.txt +1 -0
  68. jarvis_ai_assistant-0.1.124/PKG-INFO +0 -460
  69. jarvis_ai_assistant-0.1.124/README.md +0 -388
  70. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_code_agent/code_agent.py +0 -149
  71. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_code_agent/patch.py +0 -377
  72. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_dev/main.py +0 -924
  73. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_tools/base.py +0 -23
  74. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_tools/execute_shell.py +0 -78
  75. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_tools/lsp_validate_edit.py +0 -141
  76. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_tools/read_code.py +0 -191
  77. jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_utils/__init__.py +0 -987
  78. jarvis_ai_assistant-0.1.124/src/jarvis_ai_assistant.egg-info/PKG-INFO +0 -460
  79. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/LICENSE +0 -0
  80. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/MANIFEST.in +0 -0
  81. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/setup.cfg +0 -0
  82. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_agent/output_handler.py +0 -0
  83. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_code_agent/__init__.py +0 -0
  84. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_codebase/__init__.py +0 -0
  85. {jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_platform_manager → jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_git_squash}/__init__.py +0 -0
  86. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis/jarvis_platform/__init__.py +0 -0
  87. {jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_rag → jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_platform_manager}/__init__.py +0 -0
  88. {jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_smart_shell → jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_rag}/__init__.py +0 -0
  89. {jarvis_ai_assistant-0.1.124/src/jarvis/jarvis_tools → jarvis_ai_assistant-0.1.126/src/jarvis/jarvis_smart_shell}/__init__.py +0 -0
  90. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
  91. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
  92. {jarvis_ai_assistant-0.1.124 → jarvis_ai_assistant-0.1.126}/src/jarvis_ai_assistant.egg-info/top_level.txt +0 -0
@@ -0,0 +1,305 @@
1
+ Metadata-Version: 2.1
2
+ Name: jarvis-ai-assistant
3
+ Version: 0.1.126
4
+ Summary: Jarvis: An AI assistant that uses tools to interact with the system
5
+ Home-page: https://github.com/skyfireitdiy/Jarvis
6
+ Author: skyfire
7
+ Author-email: skyfire <skyfireitdiy@hotmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 skyfire
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Project-URL: Homepage, https://github.com/skyfireitdiy/Jarvis
30
+ Keywords: jarvis,ai,assistant,tools,automation
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: POSIX :: Linux
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.8
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Requires-Python: >=3.8
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: requests>=2.25.1
44
+ Requires-Dist: pyyaml>=5.1
45
+ Requires-Dist: colorama>=0.4.6
46
+ Requires-Dist: prompt_toolkit>=3.0.0
47
+ Requires-Dist: openai>=1.20.0
48
+ Requires-Dist: playwright>=1.41.1
49
+ Requires-Dist: numpy>=1.19.5
50
+ Requires-Dist: faiss-cpu>=1.8.0
51
+ Requires-Dist: sentence-transformers>=2.2.2
52
+ Requires-Dist: bs4>=0.0.1
53
+ Requires-Dist: PyMuPDF>=1.21.0
54
+ Requires-Dist: python-docx>=0.8.11
55
+ Requires-Dist: tiktoken>=0.3.0
56
+ Requires-Dist: tqdm>=4.65.0
57
+ Requires-Dist: docx>=0.2.4
58
+ Requires-Dist: yaspin>=2.5.0
59
+ Requires-Dist: rich>=13.3.1
60
+ Requires-Dist: pygments>=2.15.0
61
+ Requires-Dist: fuzzywuzzy>=0.18.0
62
+ Requires-Dist: python-Levenshtein>=0.25.0
63
+ Requires-Dist: jedi>=0.17.2
64
+ Requires-Dist: psutil>=7.0.0
65
+ Requires-Dist: fastapi>=0.115.4
66
+ Requires-Dist: uvicorn>=0.33.0
67
+ Provides-Extra: dev
68
+ Requires-Dist: pytest; extra == "dev"
69
+ Requires-Dist: black; extra == "dev"
70
+ Requires-Dist: isort; extra == "dev"
71
+ Requires-Dist: mypy; extra == "dev"
72
+
73
+ # 🤖 Jarvis AI 助手
74
+ <p align="center">
75
+ <img src="docs/images/jarvis-logo.png" alt="Jarvis Logo" width="200"/>
76
+ </p>
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
+
81
+ *您的智能开发和系统交互助手*
82
+
83
+ [快速开始](#quick-start) •
84
+ [配置说明](#configuration) •
85
+ [工具说明](#tools) •
86
+ [扩展开发](#extensions) •
87
+ [贡献指南](#contributing) •
88
+ [许可证](#license) •
89
+ </div>
90
+
91
+ ---
92
+
93
+ ## 🚀 快速开始 <a id="quick-start"></a>
94
+ ### 安装
95
+ ```bash
96
+ pip install jarvis-ai-assistant # 安装jarvis-ai-assistant
97
+ playwright install # 安装playwright
98
+ ```
99
+
100
+ ### 最小化配置
101
+ ```bash
102
+ JARVIS_PLATFORM=openai # 设置AI平台
103
+ JARVIS_MODEL=deepseek-chat # 设置AI模型
104
+ OPENAI_API_KEY=your_openai_api_key # 设置OpenAI API密钥
105
+ OPENAI_API_BASE=https://api.deepseek.com/v1 # 设置OpenAI API基础URL
106
+ ```
107
+
108
+ 以上配置编写到`~/.jarvis/env`文件中。
109
+
110
+ ### 基本使用
111
+ ```bash
112
+ # 使用通用代理
113
+ jarvis
114
+ # 使用代码代理
115
+ jarvis-code-agent
116
+ # 或者 jca
117
+ # 使用codebase的功能
118
+ jarvis-codebase --help
119
+ # 使用rag的功能
120
+ jarvis-rag --help
121
+ # 使用智能shell的功能
122
+ jarvis-smart-shell --help
123
+ # 或者 jss
124
+ # 使用平台管理的功能
125
+ jarvis-platform-manager --help
126
+ # 使用自动化git commit的功能
127
+ jarvis-git-commit --help
128
+ # 或者 jgc
129
+ # 使用代码审查的功能
130
+ jarvis-code-review --help
131
+ # 使用dev功能(开发中)
132
+ jarvis-dev --help
133
+ # 使用git squash的功能
134
+ jarvis-git-squash --help
135
+ ```
136
+
137
+ ---
138
+
139
+ ## ⚙️ 配置说明 <a id="configuration"></a>
140
+ ### 环境变量配置
141
+ | 分类 | 变量名称 | 默认值 | 说明 |
142
+ |------|----------|--------|------|
143
+ | 核心配置 | `JARVIS_MAX_TOKEN_COUNT` | 131072 | 上下文窗口的最大token数量 |
144
+ | 核心配置 | `JARVIS_THREAD_COUNT` | 1 | 并行处理的线程数量 |
145
+ | 核心配置 | `JARVIS_AUTO_COMPLETE` | false | 是否启用自动补全功能 |
146
+ | 核心配置 | `JARVIS_EXECUTE_TOOL_CONFIRM` | false | 执行工具前是否需要确认 |
147
+ | 核心配置 | `JARVIS_CONFIRM_BEFORE_APPLY_PATCH` | true | 应用补丁前是否需要确认 |
148
+ | 模型配置 | `JARVIS_DONT_USE_LOCAL_MODEL` | false | 是否禁用本地模型 |
149
+ | 模型配置 | `JARVIS_PLATFORM` | kimi | 默认AI平台 |
150
+ | 模型配置 | `JARVIS_MODEL` | kimi | 默认模型 |
151
+ | 模型配置 | `JARVIS_CODEGEN_PLATFORM` | JARVIS_PLATFORM | 代码生成任务使用的平台 |
152
+ | 模型配置 | `JARVIS_CODEGEN_MODEL` | JARVIS_MODEL | 代码生成任务使用的模型 |
153
+ | 模型配置 | `JARVIS_THINKING_PLATFORM` | JARVIS_PLATFORM | 思考任务使用的平台 |
154
+ | 模型配置 | `JARVIS_THINKING_MODEL` | JARVIS_MODEL | 思考任务使用的模型 |
155
+ | 模型配置 | `JARVIS_CHEAP_PLATFORM` | JARVIS_PLATFORM | 低成本任务使用的平台 |
156
+ | 模型配置 | `JARVIS_CHEAP_MODEL` | JARVIS_MODEL | 低成本任务使用的模型 |
157
+ | 方法论配置 | `JARVIS_USE_METHODOLOGY` | true | 是否启用方法论系统 |
158
+ | 方法论配置 | `JARVIS_RECORD_METHODOLOGY` | true | 是否记录方法论 |
159
+ | 方法论配置 | `JARVIS_NEED_SUMMARY` | true | 是否自动生成摘要 |
160
+ | 文本处理 | `JARVIS_MIN_PARAGRAPH_LENGTH` | 50 | 文本处理的最小段落长度 |
161
+ | 文本处理 | `JARVIS_MAX_PARAGRAPH_LENGTH` | 12800 | 文本处理的最大段落长度 |
162
+ ---
163
+ ## 🛠️ 工具说明 <a id="tools"></a>
164
+ ### 内置工具
165
+ | 工具名称 | 描述 |
166
+ |----------|------|
167
+ | read_code | 支持行号和范围的代码文件读取 |
168
+ | execute_shell | 执行系统命令并捕获输出 |
169
+ | execute_shell_script | 执行shell脚本文件 |
170
+ | ask_codebase | 智能代码库查询和分析 |
171
+ | ask_user | 交互式用户输入收集 |
172
+ | file_operation | 基础文件操作(读取/写入/存在性检查) |
173
+ | git_commiter | 自动化git提交处理 |
174
+ | code_review | 多维度的自动代码审查 |
175
+ | search_web | 使用bing进行网络搜索 |
176
+ | read_webpage | 读取网页内容 |
177
+ | chdir | 更改工作目录 |
178
+ | create_code_agent | 创建新的代码代理 |
179
+ | create_sub_agent | 创建子代理 |
180
+ | lsp_find_definition | 查找符号定义 |
181
+ | lsp_find_references | 查找符号引用 |
182
+ | lsp_get_diagnostics | 获取代码诊断信息 |
183
+ | lsp_get_document_symbols | 获取文档符号 |
184
+ | lsp_prepare_rename | 准备符号重命名 |
185
+ | lsp_validate_edit | 验证代码编辑 |
186
+ | rag | 文档检索和问答 |
187
+ | select_code_files | 选择代码文件 |
188
+ ### 工具位置
189
+ - 内置工具:`src/jarvis/tools/`
190
+ - 用户工具:`~/.jarvis/tools/`
191
+ ---
192
+ ## 🛠️ 扩展开发 <a id="extensions"></a>
193
+ ### 添加新工具
194
+ 在 `~/.jarvis/tools/》 中创建新的 Python 文件:
195
+ ```python
196
+ from typing import Dict, Any
197
+ from jarvis.utils import OutputType, PrettyOutput
198
+ class CustomTool:
199
+ name = "工具名称" # 调用时使用的工具名称
200
+ description = "工具描述" # 工具用途
201
+ parameters = { # 参数的 JSON Schema
202
+ "type": "object",
203
+ "properties": {
204
+ "param1": {
205
+ "type": "string",
206
+ "description": "参数描述"
207
+ }
208
+ },
209
+ "required": ["param1"]
210
+ }
211
+ def execute(self, args: Dict[str, Any]) -> Dict[str, Any]:
212
+ """执行工具功能
213
+
214
+ 参数:
215
+ args: 传递给工具的参数
216
+
217
+ 返回:
218
+ 包含执行结果的字典:
219
+ {
220
+ "success": bool,
221
+ "stdout": str, # 成功时的输出
222
+ "stderr": str, # 可选的错误详情
223
+ }
224
+ """
225
+ try:
226
+ # 在此实现工具逻辑
227
+ result = "工具执行结果"
228
+ return {
229
+ "success": True,
230
+ "stdout": result,
231
+ "stderr": ""
232
+ }
233
+ except Exception as e:
234
+ return {
235
+ "success": False,
236
+ "stdout": "",
237
+ "stderr": str(e)
238
+ }
239
+ ```
240
+
241
+
242
+ ### 添加新大模型平台
243
+ 在 `~/.jarvis/platforms/》 中创建新的 Python 文件:
244
+ ```python
245
+ from jarvis.jarvis_platform.base import BasePlatform
246
+ class CustomPlatform(BasePlatform):
247
+ def __init__(self):
248
+ # 初始化平台
249
+ pass
250
+
251
+ def __del__(self):
252
+ # 销毁平台
253
+ pass
254
+
255
+ def chat(self, message: str) -> str:
256
+ # 执行对话
257
+ pass
258
+
259
+ def upload_files(self, file_list: List[str]) -> List[Dict]:
260
+ # 上传文件
261
+ pass
262
+
263
+ def reset(self):
264
+ # 重置平台
265
+ pass
266
+
267
+ def delete_chat(self):
268
+ # 删除对话
269
+ pass
270
+
271
+ def set_model_name(self, model_name: str):
272
+ # 设置模型名称
273
+ pass
274
+
275
+ def set_system_message(self, message: str):
276
+ # 设置系统消息
277
+ pass
278
+
279
+ def get_model_list(self) -> List[Tuple[str, str]]:
280
+ # 获取模型列表
281
+ pass
282
+
283
+ def name(self) -> str:
284
+ # 获取平台名称
285
+ pass
286
+ ```
287
+
288
+
289
+ ## 🤝 贡献指南 <a id="contributing"></a>
290
+ 1. Fork 仓库
291
+ 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
292
+ 3. 提交更改 (`git commit -m '添加某个很棒的特性'`)
293
+ 4. 推送到分支 (`git push origin feature/AmazingFeature`)
294
+ 5. 开启 Pull Request
295
+
296
+ ---
297
+
298
+ ## 📄 许可证 <a id="license"></a>
299
+
300
+ 本项目采用 MIT 许可证 - 详见 [LICENSE](LICENSE) 文件。
301
+
302
+ ---
303
+ <div align="center">
304
+ 由 Jarvis 团队用 ❤️ 制作
305
+ </div>
@@ -0,0 +1,233 @@
1
+ # 🤖 Jarvis AI 助手
2
+ <p align="center">
3
+ <img src="docs/images/jarvis-logo.png" alt="Jarvis Logo" width="200"/>
4
+ </p>
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
+
9
+ *您的智能开发和系统交互助手*
10
+
11
+ [快速开始](#quick-start) •
12
+ [配置说明](#configuration) •
13
+ [工具说明](#tools) •
14
+ [扩展开发](#extensions) •
15
+ [贡献指南](#contributing) •
16
+ [许可证](#license) •
17
+ </div>
18
+
19
+ ---
20
+
21
+ ## 🚀 快速开始 <a id="quick-start"></a>
22
+ ### 安装
23
+ ```bash
24
+ pip install jarvis-ai-assistant # 安装jarvis-ai-assistant
25
+ playwright install # 安装playwright
26
+ ```
27
+
28
+ ### 最小化配置
29
+ ```bash
30
+ JARVIS_PLATFORM=openai # 设置AI平台
31
+ JARVIS_MODEL=deepseek-chat # 设置AI模型
32
+ OPENAI_API_KEY=your_openai_api_key # 设置OpenAI API密钥
33
+ OPENAI_API_BASE=https://api.deepseek.com/v1 # 设置OpenAI API基础URL
34
+ ```
35
+
36
+ 以上配置编写到`~/.jarvis/env`文件中。
37
+
38
+ ### 基本使用
39
+ ```bash
40
+ # 使用通用代理
41
+ jarvis
42
+ # 使用代码代理
43
+ jarvis-code-agent
44
+ # 或者 jca
45
+ # 使用codebase的功能
46
+ jarvis-codebase --help
47
+ # 使用rag的功能
48
+ jarvis-rag --help
49
+ # 使用智能shell的功能
50
+ jarvis-smart-shell --help
51
+ # 或者 jss
52
+ # 使用平台管理的功能
53
+ jarvis-platform-manager --help
54
+ # 使用自动化git commit的功能
55
+ jarvis-git-commit --help
56
+ # 或者 jgc
57
+ # 使用代码审查的功能
58
+ jarvis-code-review --help
59
+ # 使用dev功能(开发中)
60
+ jarvis-dev --help
61
+ # 使用git squash的功能
62
+ jarvis-git-squash --help
63
+ ```
64
+
65
+ ---
66
+
67
+ ## ⚙️ 配置说明 <a id="configuration"></a>
68
+ ### 环境变量配置
69
+ | 分类 | 变量名称 | 默认值 | 说明 |
70
+ |------|----------|--------|------|
71
+ | 核心配置 | `JARVIS_MAX_TOKEN_COUNT` | 131072 | 上下文窗口的最大token数量 |
72
+ | 核心配置 | `JARVIS_THREAD_COUNT` | 1 | 并行处理的线程数量 |
73
+ | 核心配置 | `JARVIS_AUTO_COMPLETE` | false | 是否启用自动补全功能 |
74
+ | 核心配置 | `JARVIS_EXECUTE_TOOL_CONFIRM` | false | 执行工具前是否需要确认 |
75
+ | 核心配置 | `JARVIS_CONFIRM_BEFORE_APPLY_PATCH` | true | 应用补丁前是否需要确认 |
76
+ | 模型配置 | `JARVIS_DONT_USE_LOCAL_MODEL` | false | 是否禁用本地模型 |
77
+ | 模型配置 | `JARVIS_PLATFORM` | kimi | 默认AI平台 |
78
+ | 模型配置 | `JARVIS_MODEL` | kimi | 默认模型 |
79
+ | 模型配置 | `JARVIS_CODEGEN_PLATFORM` | JARVIS_PLATFORM | 代码生成任务使用的平台 |
80
+ | 模型配置 | `JARVIS_CODEGEN_MODEL` | JARVIS_MODEL | 代码生成任务使用的模型 |
81
+ | 模型配置 | `JARVIS_THINKING_PLATFORM` | JARVIS_PLATFORM | 思考任务使用的平台 |
82
+ | 模型配置 | `JARVIS_THINKING_MODEL` | JARVIS_MODEL | 思考任务使用的模型 |
83
+ | 模型配置 | `JARVIS_CHEAP_PLATFORM` | JARVIS_PLATFORM | 低成本任务使用的平台 |
84
+ | 模型配置 | `JARVIS_CHEAP_MODEL` | JARVIS_MODEL | 低成本任务使用的模型 |
85
+ | 方法论配置 | `JARVIS_USE_METHODOLOGY` | true | 是否启用方法论系统 |
86
+ | 方法论配置 | `JARVIS_RECORD_METHODOLOGY` | true | 是否记录方法论 |
87
+ | 方法论配置 | `JARVIS_NEED_SUMMARY` | true | 是否自动生成摘要 |
88
+ | 文本处理 | `JARVIS_MIN_PARAGRAPH_LENGTH` | 50 | 文本处理的最小段落长度 |
89
+ | 文本处理 | `JARVIS_MAX_PARAGRAPH_LENGTH` | 12800 | 文本处理的最大段落长度 |
90
+ ---
91
+ ## 🛠️ 工具说明 <a id="tools"></a>
92
+ ### 内置工具
93
+ | 工具名称 | 描述 |
94
+ |----------|------|
95
+ | read_code | 支持行号和范围的代码文件读取 |
96
+ | execute_shell | 执行系统命令并捕获输出 |
97
+ | execute_shell_script | 执行shell脚本文件 |
98
+ | ask_codebase | 智能代码库查询和分析 |
99
+ | ask_user | 交互式用户输入收集 |
100
+ | file_operation | 基础文件操作(读取/写入/存在性检查) |
101
+ | git_commiter | 自动化git提交处理 |
102
+ | code_review | 多维度的自动代码审查 |
103
+ | search_web | 使用bing进行网络搜索 |
104
+ | read_webpage | 读取网页内容 |
105
+ | chdir | 更改工作目录 |
106
+ | create_code_agent | 创建新的代码代理 |
107
+ | create_sub_agent | 创建子代理 |
108
+ | lsp_find_definition | 查找符号定义 |
109
+ | lsp_find_references | 查找符号引用 |
110
+ | lsp_get_diagnostics | 获取代码诊断信息 |
111
+ | lsp_get_document_symbols | 获取文档符号 |
112
+ | lsp_prepare_rename | 准备符号重命名 |
113
+ | lsp_validate_edit | 验证代码编辑 |
114
+ | rag | 文档检索和问答 |
115
+ | select_code_files | 选择代码文件 |
116
+ ### 工具位置
117
+ - 内置工具:`src/jarvis/tools/`
118
+ - 用户工具:`~/.jarvis/tools/`
119
+ ---
120
+ ## 🛠️ 扩展开发 <a id="extensions"></a>
121
+ ### 添加新工具
122
+ 在 `~/.jarvis/tools/》 中创建新的 Python 文件:
123
+ ```python
124
+ from typing import Dict, Any
125
+ from jarvis.utils import OutputType, PrettyOutput
126
+ class CustomTool:
127
+ name = "工具名称" # 调用时使用的工具名称
128
+ description = "工具描述" # 工具用途
129
+ parameters = { # 参数的 JSON Schema
130
+ "type": "object",
131
+ "properties": {
132
+ "param1": {
133
+ "type": "string",
134
+ "description": "参数描述"
135
+ }
136
+ },
137
+ "required": ["param1"]
138
+ }
139
+ def execute(self, args: Dict[str, Any]) -> Dict[str, Any]:
140
+ """执行工具功能
141
+
142
+ 参数:
143
+ args: 传递给工具的参数
144
+
145
+ 返回:
146
+ 包含执行结果的字典:
147
+ {
148
+ "success": bool,
149
+ "stdout": str, # 成功时的输出
150
+ "stderr": str, # 可选的错误详情
151
+ }
152
+ """
153
+ try:
154
+ # 在此实现工具逻辑
155
+ result = "工具执行结果"
156
+ return {
157
+ "success": True,
158
+ "stdout": result,
159
+ "stderr": ""
160
+ }
161
+ except Exception as e:
162
+ return {
163
+ "success": False,
164
+ "stdout": "",
165
+ "stderr": str(e)
166
+ }
167
+ ```
168
+
169
+
170
+ ### 添加新大模型平台
171
+ 在 `~/.jarvis/platforms/》 中创建新的 Python 文件:
172
+ ```python
173
+ from jarvis.jarvis_platform.base import BasePlatform
174
+ class CustomPlatform(BasePlatform):
175
+ def __init__(self):
176
+ # 初始化平台
177
+ pass
178
+
179
+ def __del__(self):
180
+ # 销毁平台
181
+ pass
182
+
183
+ def chat(self, message: str) -> str:
184
+ # 执行对话
185
+ pass
186
+
187
+ def upload_files(self, file_list: List[str]) -> List[Dict]:
188
+ # 上传文件
189
+ pass
190
+
191
+ def reset(self):
192
+ # 重置平台
193
+ pass
194
+
195
+ def delete_chat(self):
196
+ # 删除对话
197
+ pass
198
+
199
+ def set_model_name(self, model_name: str):
200
+ # 设置模型名称
201
+ pass
202
+
203
+ def set_system_message(self, message: str):
204
+ # 设置系统消息
205
+ pass
206
+
207
+ def get_model_list(self) -> List[Tuple[str, str]]:
208
+ # 获取模型列表
209
+ pass
210
+
211
+ def name(self) -> str:
212
+ # 获取平台名称
213
+ pass
214
+ ```
215
+
216
+
217
+ ## 🤝 贡献指南 <a id="contributing"></a>
218
+ 1. Fork 仓库
219
+ 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
220
+ 3. 提交更改 (`git commit -m '添加某个很棒的特性'`)
221
+ 4. 推送到分支 (`git push origin feature/AmazingFeature`)
222
+ 5. 开启 Pull Request
223
+
224
+ ---
225
+
226
+ ## 📄 许可证 <a id="license"></a>
227
+
228
+ 本项目采用 MIT 许可证 - 详见 [LICENSE](LICENSE) 文件。
229
+
230
+ ---
231
+ <div align="center">
232
+ 由 Jarvis 团队用 ❤️ 制作
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.124"
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" }]
@@ -68,3 +68,4 @@ jarvis-git-commit = "jarvis.jarvis_tools.git_commiter:main"
68
68
  jarvis-code-review = "jarvis.jarvis_tools.code_review:main"
69
69
  jgc = "jarvis.jarvis_tools.git_commiter:main"
70
70
  jarvis-dev = "jarvis.jarvis_dev.main:main"
71
+ jarvis-git-squash = "jarvis.jarvis_git_squash.main:main"
@@ -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.124",
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",
@@ -52,6 +52,7 @@ setup(
52
52
  "jarvis-code-review=jarvis.jarvis_tools.code_review:main",
53
53
  "jgc=jarvis.jarvis_tools.git_commiter:main",
54
54
  "jarvis-dev=jarvis.jarvis_dev.main:main",
55
+ "jarvis-git-squash=jarvis.jarvis_git_squash.main:main",
55
56
  ],
56
57
  },
57
58
  python_requires=">=3.8",
@@ -1,3 +1,3 @@
1
1
  """Jarvis AI Assistant"""
2
2
 
3
- __version__ = "0.1.124"
3
+ __version__ = "0.1.126"