jarvis-ai-assistant 0.1.124__py3-none-any.whl → 0.1.126__py3-none-any.whl

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 (70) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/jarvis_agent/__init__.py +134 -136
  3. jarvis/jarvis_code_agent/code_agent.py +198 -52
  4. jarvis/jarvis_code_agent/file_select.py +6 -19
  5. jarvis/jarvis_code_agent/patch.py +183 -312
  6. jarvis/jarvis_code_agent/shell_input_handler.py +22 -0
  7. jarvis/jarvis_codebase/main.py +89 -86
  8. jarvis/jarvis_dev/main.py +695 -715
  9. jarvis/jarvis_git_squash/__init__.py +0 -0
  10. jarvis/jarvis_git_squash/main.py +81 -0
  11. jarvis/jarvis_lsp/base.py +0 -12
  12. jarvis/jarvis_lsp/cpp.py +1 -10
  13. jarvis/jarvis_lsp/go.py +1 -10
  14. jarvis/jarvis_lsp/python.py +0 -28
  15. jarvis/jarvis_lsp/registry.py +2 -3
  16. jarvis/jarvis_lsp/rust.py +1 -10
  17. jarvis/jarvis_multi_agent/__init__.py +53 -53
  18. jarvis/jarvis_platform/ai8.py +2 -1
  19. jarvis/jarvis_platform/base.py +19 -24
  20. jarvis/jarvis_platform/kimi.py +2 -3
  21. jarvis/jarvis_platform/ollama.py +3 -1
  22. jarvis/jarvis_platform/openai.py +1 -1
  23. jarvis/jarvis_platform/oyi.py +2 -1
  24. jarvis/jarvis_platform/registry.py +2 -1
  25. jarvis/jarvis_platform_manager/main.py +4 -6
  26. jarvis/jarvis_platform_manager/openai_test.py +0 -1
  27. jarvis/jarvis_rag/main.py +5 -2
  28. jarvis/jarvis_smart_shell/main.py +9 -4
  29. jarvis/jarvis_tools/ask_codebase.py +18 -13
  30. jarvis/jarvis_tools/ask_user.py +5 -4
  31. jarvis/jarvis_tools/base.py +22 -8
  32. jarvis/jarvis_tools/chdir.py +8 -9
  33. jarvis/jarvis_tools/code_review.py +19 -20
  34. jarvis/jarvis_tools/create_code_agent.py +6 -6
  35. jarvis/jarvis_tools/create_sub_agent.py +9 -9
  36. jarvis/jarvis_tools/execute_shell.py +55 -20
  37. jarvis/jarvis_tools/execute_shell_script.py +7 -7
  38. jarvis/jarvis_tools/file_operation.py +39 -10
  39. jarvis/jarvis_tools/git_commiter.py +20 -17
  40. jarvis/jarvis_tools/lsp_find_definition.py +8 -8
  41. jarvis/jarvis_tools/lsp_find_references.py +1 -1
  42. jarvis/jarvis_tools/lsp_get_diagnostics.py +19 -11
  43. jarvis/jarvis_tools/lsp_get_document_symbols.py +1 -1
  44. jarvis/jarvis_tools/lsp_prepare_rename.py +8 -8
  45. jarvis/jarvis_tools/methodology.py +10 -7
  46. jarvis/jarvis_tools/rag.py +27 -20
  47. jarvis/jarvis_tools/read_webpage.py +4 -3
  48. jarvis/jarvis_tools/registry.py +143 -140
  49. jarvis/jarvis_tools/{search.py → search_web.py} +10 -7
  50. jarvis/jarvis_tools/select_code_files.py +4 -4
  51. jarvis/jarvis_tools/tool_generator.py +33 -34
  52. jarvis/jarvis_utils/__init__.py +19 -982
  53. jarvis/jarvis_utils/config.py +138 -0
  54. jarvis/jarvis_utils/embedding.py +201 -0
  55. jarvis/jarvis_utils/git_utils.py +120 -0
  56. jarvis/jarvis_utils/globals.py +82 -0
  57. jarvis/jarvis_utils/input.py +161 -0
  58. jarvis/jarvis_utils/methodology.py +128 -0
  59. jarvis/jarvis_utils/output.py +235 -0
  60. jarvis/jarvis_utils/utils.py +150 -0
  61. jarvis_ai_assistant-0.1.126.dist-info/METADATA +305 -0
  62. jarvis_ai_assistant-0.1.126.dist-info/RECORD +74 -0
  63. {jarvis_ai_assistant-0.1.124.dist-info → jarvis_ai_assistant-0.1.126.dist-info}/WHEEL +1 -1
  64. {jarvis_ai_assistant-0.1.124.dist-info → jarvis_ai_assistant-0.1.126.dist-info}/entry_points.txt +1 -0
  65. jarvis/jarvis_tools/lsp_validate_edit.py +0 -141
  66. jarvis/jarvis_tools/read_code.py +0 -191
  67. jarvis_ai_assistant-0.1.124.dist-info/METADATA +0 -460
  68. jarvis_ai_assistant-0.1.124.dist-info/RECORD +0 -65
  69. {jarvis_ai_assistant-0.1.124.dist-info → jarvis_ai_assistant-0.1.126.dist-info}/LICENSE +0 -0
  70. {jarvis_ai_assistant-0.1.124.dist-info → jarvis_ai_assistant-0.1.126.dist-info}/top_level.txt +0 -0
@@ -8,21 +8,21 @@ from jarvis.jarvis_platform.registry import PlatformRegistry
8
8
 
9
9
  class ToolGenerator:
10
10
  name = "tool_generator"
11
- description = "Generates new tools using LLM that integrate with the system"
11
+ description = "使用LLM自动生成与系统集成的新工具"
12
12
  parameters = {
13
13
  "type": "object",
14
14
  "properties": {
15
15
  "tool_name": {
16
16
  "type": "string",
17
- "description": "Name of the new tool"
17
+ "description": "新工具的名称"
18
18
  },
19
19
  "description": {
20
20
  "type": "string",
21
- "description": "Description of the tool's purpose"
21
+ "description": "工具用途描述"
22
22
  },
23
23
  "input_spec": {
24
24
  "type": "string",
25
- "description": "Specification of required inputs and functionality"
25
+ "description": "所需输入和功能的规范说明"
26
26
  }
27
27
  },
28
28
  "required": ["tool_name", "description", "input_spec"]
@@ -81,7 +81,7 @@ class ToolGenerator:
81
81
  }
82
82
 
83
83
  def _create_prompt(self, tool_name: str, description: str, input_spec: str) -> str:
84
- """Create the LLM prompt for tool generation"""
84
+ """创建用于工具生成的LLM提示"""
85
85
  example_code = '''
86
86
  <TOOL>
87
87
  from typing import Dict, Any
@@ -89,24 +89,24 @@ from jarvis.utils import OutputType, PrettyOutput
89
89
  from jarvis.jarvis_platform.registry import PlatformRegistry
90
90
 
91
91
  class CustomTool:
92
- name = "Tool name" # Tool name used when calling
93
- description = "Tool description" # Tool purpose
94
- parameters = { # Parameters JSON Schema
92
+ name = "工具名称" # 调用时使用的工具名称
93
+ description = "工具描述" # 工具用途
94
+ parameters = { # 参数JSON Schema
95
95
  "type": "object",
96
96
  "properties": {
97
97
  "param1": {
98
98
  "type": "string",
99
- "description": "Parameter description"
99
+ "description": "参数描述"
100
100
  }
101
101
  },
102
102
  "required": ["param1"]
103
103
  }
104
104
 
105
105
  def execute(self, args: Dict[str, Any]) -> Dict[str, Any]:
106
- """Execute the tool functionality
106
+ """执行工具功能
107
107
 
108
108
  Args:
109
- args: Parameters passed to the tool
109
+ args: 传递给工具的参数
110
110
 
111
111
  Returns:
112
112
  {
@@ -116,12 +116,12 @@ class CustomTool:
116
116
  }
117
117
  """
118
118
  try:
119
- # Implement the tool logic here
120
- # Use LLM
119
+ # 在此实现工具逻辑
120
+ # 使用LLM
121
121
  # model = PlatformRegistry.get_global_platform_registry().get_codegen_platform()
122
122
  # result = model.chat_until_success(prompt)
123
123
 
124
- result = "Tool result"
124
+ result = "工具执行结果"
125
125
  return {
126
126
  "success": True,
127
127
  "stdout": result,
@@ -136,29 +136,28 @@ class CustomTool:
136
136
  </TOOL>
137
137
  '''
138
138
 
139
-
140
- return f'''Create a Python tool class that integrates with the Jarvis system. Follow these requirements:
141
- 1. Class name: {tool_name.capitalize()}Tool
142
- 2. Description: {description}
143
- 3. Input specification: {input_spec}
144
- 4. Must include these class attributes:
145
- - name: str (tool identifier)
146
- - description: str (tool purpose)
147
- - parameters: dict (JSON schema for inputs)
148
- 5. Must implement execute(self, args: Dict) -> Dict method
149
- 6. The execute method MUST return a dictionary with these exact fields:
150
- - success: bool (indicating operation success)
151
- - stdout: str (primary output/result)
152
- - stderr: str (error message if any)
153
- 7. Must handle errors gracefully
154
- 8. Return ONLY the Python implementation code
155
- 9. The code should be complete and ready to use.
156
- 10. Output the code in the following format:
139
+ return f'''创建一个与Jarvis系统集成的Python工具类。请遵循以下要求:
140
+ 1. 类名: {tool_name.capitalize()}Tool
141
+ 2. 描述: {description}
142
+ 3. 输入规范: {input_spec}
143
+ 4. 必须包含以下类属性:
144
+ - name: str (工具标识符)
145
+ - description: str (工具用途)
146
+ - parameters: dict (输入的JSON schema)
147
+ 5. 必须实现 execute(self, args: Dict) -> Dict 方法
148
+ 6. execute方法必须返回包含以下字段的字典:
149
+ - success: bool (指示操作是否成功)
150
+ - stdout: str (主要输出/结果)
151
+ - stderr: str (错误信息,如果有)
152
+ 7. 必须优雅地处理错误
153
+ 8. 仅返回Python实现代码
154
+ 9. 代码应该是完整且可直接使用的
155
+ 10. 按照以下格式输出代码:
157
156
  <TOOL>
158
157
  {example_code}
159
158
  </TOOL>
160
159
 
161
- Example:
160
+ 示例:
162
161
  {example_code}
163
162
  '''
164
163
 
@@ -179,4 +178,4 @@ Example:
179
178
  return False
180
179
 
181
180
  # Check for required fields in return statement
182
- return all(field in code for field in required_fields)
181
+ return all(field in code for field in required_fields)