jarvis-ai-assistant 0.1.132__py3-none-any.whl → 0.1.138__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 (82) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/jarvis_agent/__init__.py +330 -347
  3. jarvis/jarvis_agent/builtin_input_handler.py +16 -6
  4. jarvis/jarvis_agent/file_input_handler.py +9 -9
  5. jarvis/jarvis_agent/jarvis.py +143 -0
  6. jarvis/jarvis_agent/main.py +12 -13
  7. jarvis/jarvis_agent/output_handler.py +3 -3
  8. jarvis/jarvis_agent/patch.py +92 -64
  9. jarvis/jarvis_agent/shell_input_handler.py +5 -3
  10. jarvis/jarvis_code_agent/code_agent.py +263 -177
  11. jarvis/jarvis_code_agent/file_select.py +24 -24
  12. jarvis/jarvis_dev/main.py +45 -59
  13. jarvis/jarvis_git_details/__init__.py +0 -0
  14. jarvis/jarvis_git_details/main.py +179 -0
  15. jarvis/jarvis_git_squash/main.py +7 -7
  16. jarvis/jarvis_lsp/base.py +11 -53
  17. jarvis/jarvis_lsp/cpp.py +13 -28
  18. jarvis/jarvis_lsp/go.py +13 -28
  19. jarvis/jarvis_lsp/python.py +8 -27
  20. jarvis/jarvis_lsp/registry.py +21 -83
  21. jarvis/jarvis_lsp/rust.py +15 -30
  22. jarvis/jarvis_methodology/main.py +101 -0
  23. jarvis/jarvis_multi_agent/__init__.py +10 -51
  24. jarvis/jarvis_multi_agent/main.py +43 -0
  25. jarvis/jarvis_platform/__init__.py +1 -1
  26. jarvis/jarvis_platform/ai8.py +67 -89
  27. jarvis/jarvis_platform/base.py +14 -13
  28. jarvis/jarvis_platform/kimi.py +25 -28
  29. jarvis/jarvis_platform/ollama.py +24 -26
  30. jarvis/jarvis_platform/openai.py +15 -19
  31. jarvis/jarvis_platform/oyi.py +48 -50
  32. jarvis/jarvis_platform/registry.py +29 -44
  33. jarvis/jarvis_platform/yuanbao.py +39 -43
  34. jarvis/jarvis_platform_manager/main.py +81 -81
  35. jarvis/jarvis_platform_manager/openai_test.py +21 -21
  36. jarvis/jarvis_rag/file_processors.py +18 -18
  37. jarvis/jarvis_rag/main.py +262 -278
  38. jarvis/jarvis_smart_shell/main.py +12 -12
  39. jarvis/jarvis_tools/ask_codebase.py +85 -78
  40. jarvis/jarvis_tools/ask_user.py +8 -8
  41. jarvis/jarvis_tools/base.py +4 -4
  42. jarvis/jarvis_tools/chdir.py +9 -9
  43. jarvis/jarvis_tools/code_review.py +40 -21
  44. jarvis/jarvis_tools/create_code_agent.py +15 -15
  45. jarvis/jarvis_tools/create_sub_agent.py +0 -1
  46. jarvis/jarvis_tools/execute_python_script.py +3 -3
  47. jarvis/jarvis_tools/execute_shell.py +11 -11
  48. jarvis/jarvis_tools/execute_shell_script.py +3 -3
  49. jarvis/jarvis_tools/file_analyzer.py +116 -105
  50. jarvis/jarvis_tools/file_operation.py +22 -20
  51. jarvis/jarvis_tools/find_caller.py +105 -40
  52. jarvis/jarvis_tools/find_methodolopy.py +65 -0
  53. jarvis/jarvis_tools/find_symbol.py +123 -39
  54. jarvis/jarvis_tools/function_analyzer.py +140 -57
  55. jarvis/jarvis_tools/git_commiter.py +10 -10
  56. jarvis/jarvis_tools/lsp_get_diagnostics.py +19 -19
  57. jarvis/jarvis_tools/methodology.py +22 -67
  58. jarvis/jarvis_tools/project_analyzer.py +137 -53
  59. jarvis/jarvis_tools/rag.py +15 -20
  60. jarvis/jarvis_tools/read_code.py +25 -23
  61. jarvis/jarvis_tools/read_webpage.py +31 -31
  62. jarvis/jarvis_tools/registry.py +72 -52
  63. jarvis/jarvis_tools/search_web.py +23 -353
  64. jarvis/jarvis_tools/tool_generator.py +19 -19
  65. jarvis/jarvis_utils/config.py +36 -96
  66. jarvis/jarvis_utils/embedding.py +83 -83
  67. jarvis/jarvis_utils/git_utils.py +20 -20
  68. jarvis/jarvis_utils/globals.py +18 -6
  69. jarvis/jarvis_utils/input.py +10 -9
  70. jarvis/jarvis_utils/methodology.py +141 -140
  71. jarvis/jarvis_utils/output.py +13 -13
  72. jarvis/jarvis_utils/utils.py +23 -71
  73. {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/METADATA +6 -15
  74. jarvis_ai_assistant-0.1.138.dist-info/RECORD +85 -0
  75. {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/entry_points.txt +4 -3
  76. jarvis/jarvis_tools/lsp_find_definition.py +0 -150
  77. jarvis/jarvis_tools/lsp_find_references.py +0 -127
  78. jarvis/jarvis_tools/select_code_files.py +0 -62
  79. jarvis_ai_assistant-0.1.132.dist-info/RECORD +0 -82
  80. {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/LICENSE +0 -0
  81. {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/WHEEL +0 -0
  82. {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/top_level.txt +0 -0
@@ -12,66 +12,35 @@ import os
12
12
  def get_max_token_count() -> int:
13
13
  """
14
14
  获取模型允许的最大token数量。
15
-
15
+
16
16
  返回:
17
17
  int: 模型能处理的最大token数量。
18
18
  """
19
- return int(os.getenv('JARVIS_MAX_TOKEN_COUNT', '131072')) # 默认128k
20
-
19
+ return int(os.getenv('JARVIS_MAX_TOKEN_COUNT', '64000')) # 默认64k
20
+
21
21
  def get_thread_count() -> int:
22
22
  """
23
23
  获取用于并行处理的线程数。
24
-
24
+
25
25
  返回:
26
26
  int: 线程数,默认为1
27
27
  """
28
- return int(os.getenv('JARVIS_THREAD_COUNT', '1'))
29
- def dont_use_local_model() -> bool:
30
- """
31
- 检查是否应避免使用本地模型。
32
-
33
- 返回:
34
- bool: 如果不使用本地模型则返回True,默认为False
35
- """
36
- return os.getenv('JARVIS_DONT_USE_LOCAL_MODEL', 'false') == 'true'
37
-
28
+ return int(os.getenv('JARVIS_THREAD_COUNT', '1'))
29
+
38
30
  def is_auto_complete() -> bool:
39
31
  """
40
32
  检查是否启用了自动补全功能。
41
-
33
+
42
34
  返回:
43
35
  bool: 如果启用了自动补全则返回True,默认为False
44
36
  """
45
37
  return os.getenv('JARVIS_AUTO_COMPLETE', 'false') == 'true'
46
-
47
- def is_use_methodology() -> bool:
48
- """
49
- 检查是否应使用方法论。
50
-
51
- 返回:
52
- bool: 如果使用方法论则返回True,默认为True
53
- """
54
- return os.getenv('JARVIS_USE_METHODOLOGY', 'true') == 'true'
55
- def is_record_methodology() -> bool:
56
- """
57
- 检查是否应记录方法论。
58
-
59
- 返回:
60
- bool: 如果记录方法论则返回True,默认为True
61
- """
62
- return os.getenv('JARVIS_RECORD_METHODOLOGY', 'true') == 'true'
63
- def is_need_summary() -> bool:
64
- """
65
- 检查是否需要生成摘要。
66
-
67
- 返回:
68
- bool: 如果需要摘要则返回True,默认为True
69
- """
70
- return os.getenv('JARVIS_NEED_SUMMARY', 'true') == 'true'
38
+
39
+
71
40
  def get_min_paragraph_length() -> int:
72
41
  """
73
42
  获取文本处理的最小段落长度。
74
-
43
+
75
44
  返回:
76
45
  int: 最小字符长度,默认为50
77
46
  """
@@ -79,7 +48,7 @@ def get_min_paragraph_length() -> int:
79
48
  def get_max_paragraph_length() -> int:
80
49
  """
81
50
  获取文本处理的最大段落长度。
82
-
51
+
83
52
  返回:
84
53
  int: 最大字符长度,默认为12800
85
54
  """
@@ -87,7 +56,7 @@ def get_max_paragraph_length() -> int:
87
56
  def get_shell_name() -> str:
88
57
  """
89
58
  获取系统shell名称。
90
-
59
+
91
60
  返回:
92
61
  str: Shell名称(例如bash, zsh),默认为bash
93
62
  """
@@ -95,71 +64,42 @@ def get_shell_name() -> str:
95
64
  def get_normal_platform_name() -> str:
96
65
  """
97
66
  获取正常操作的平台名称。
98
-
67
+
99
68
  返回:
100
- str: 平台名称,默认为'kimi'
69
+ str: 平台名称,默认为'yuanbao'
101
70
  """
102
- return os.getenv('JARVIS_PLATFORM', 'kimi')
71
+ return os.getenv('JARVIS_PLATFORM', 'yuanbao')
103
72
  def get_normal_model_name() -> str:
104
73
  """
105
74
  获取正常操作的模型名称。
106
-
107
- 返回:
108
- str: 模型名称,默认为'kimi'
109
- """
110
- return os.getenv('JARVIS_MODEL', 'kimi')
111
- def get_codegen_platform_name() -> str:
112
- """
113
- 获取代码生成的平台名称。
114
-
115
- 返回:
116
- str: 平台名称,默认为'kimi'
117
- """
118
- return os.getenv('JARVIS_CODEGEN_PLATFORM', os.getenv('JARVIS_PLATFORM', 'kimi'))
119
- def get_codegen_model_name() -> str:
120
- """
121
- 获取代码生成的模型名称。
122
-
75
+
123
76
  返回:
124
- str: 模型名称,默认为'kimi'
77
+ str: 模型名称,默认为'deep_seek'
125
78
  """
126
- return os.getenv('JARVIS_CODEGEN_MODEL', os.getenv('JARVIS_MODEL', 'kimi'))
79
+ return os.getenv('JARVIS_MODEL', 'deep_seek_v3')
80
+
81
+
127
82
  def get_thinking_platform_name() -> str:
128
83
  """
129
84
  获取思考操作的平台名称。
130
-
85
+
131
86
  返回:
132
- str: 平台名称,默认为'kimi'
87
+ str: 平台名称,默认为'yuanbao'
133
88
  """
134
- return os.getenv('JARVIS_THINKING_PLATFORM', os.getenv('JARVIS_PLATFORM', 'kimi'))
89
+ return os.getenv('JARVIS_THINKING_PLATFORM', os.getenv('JARVIS_PLATFORM', 'yuanbao'))
135
90
  def get_thinking_model_name() -> str:
136
91
  """
137
92
  获取思考操作的模型名称。
138
-
139
- 返回:
140
- str: 模型名称,默认为'kimi'
141
- """
142
- return os.getenv('JARVIS_THINKING_MODEL', os.getenv('JARVIS_MODEL', 'kimi'))
143
- def get_cheap_platform_name() -> str:
144
- """
145
- 获取低成本操作的平台名称。
146
-
147
- 返回:
148
- str: 平台名称,默认为'kimi'
149
- """
150
- return os.getenv('JARVIS_CHEAP_PLATFORM', os.getenv('JARVIS_PLATFORM', 'kimi'))
151
- def get_cheap_model_name() -> str:
152
- """
153
- 获取低成本操作的模型名称。
154
-
93
+
155
94
  返回:
156
- str: 模型名称,默认为'kimi'
95
+ str: 模型名称,默认为'deep_seek'
157
96
  """
158
- return os.getenv('JARVIS_CHEAP_MODEL', os.getenv('JARVIS_MODEL', 'kimi'))
97
+ return os.getenv('JARVIS_THINKING_MODEL', os.getenv('JARVIS_MODEL', 'deep_seek'))
98
+
159
99
  def is_execute_tool_confirm() -> bool:
160
100
  """
161
101
  检查工具执行是否需要确认。
162
-
102
+
163
103
  返回:
164
104
  bool: 如果需要确认则返回True,默认为False
165
105
  """
@@ -167,7 +107,7 @@ def is_execute_tool_confirm() -> bool:
167
107
  def is_confirm_before_apply_patch() -> bool:
168
108
  """
169
109
  检查应用补丁前是否需要确认。
170
-
110
+
171
111
  返回:
172
112
  bool: 如果需要确认则返回True,默认为False
173
113
  """
@@ -176,18 +116,18 @@ def is_confirm_before_apply_patch() -> bool:
176
116
  def get_rag_ignored_paths() -> list:
177
117
  """
178
118
  获取RAG索引时需要忽略的路径列表。
179
-
119
+
180
120
  首先尝试从.jarvis/rag_ignore.txt文件中读取,
181
121
  如果该文件不存在,则返回默认忽略列表。
182
-
122
+
183
123
  返回:
184
124
  list: 忽略路径的列表,默认包含常见忽略路径
185
125
  """
186
126
  # 默认忽略路径
187
127
  default_ignored = [
188
- '.git',
189
- '__pycache__',
190
- 'node_modules',
128
+ '.git',
129
+ '__pycache__',
130
+ 'node_modules',
191
131
  '.jarvis',
192
132
  '.jarvis-*',
193
133
  'target',
@@ -224,7 +164,7 @@ def get_rag_ignored_paths() -> list:
224
164
  '*.xz',
225
165
  '*.rar'
226
166
  ]
227
-
167
+
228
168
  # 尝试从配置文件中读取
229
169
  try:
230
170
  config_path = os.path.join('.jarvis', 'rag_ignore.txt')
@@ -234,5 +174,5 @@ def get_rag_ignored_paths() -> list:
234
174
  return custom_ignored
235
175
  except Exception:
236
176
  pass
237
-
177
+
238
178
  return default_ignored