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