jarvis-ai-assistant 0.1.222__py3-none-any.whl → 0.7.0__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.
Files changed (162) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/jarvis_agent/__init__.py +1143 -245
  3. jarvis/jarvis_agent/agent_manager.py +97 -0
  4. jarvis/jarvis_agent/builtin_input_handler.py +12 -10
  5. jarvis/jarvis_agent/config_editor.py +57 -0
  6. jarvis/jarvis_agent/edit_file_handler.py +392 -99
  7. jarvis/jarvis_agent/event_bus.py +48 -0
  8. jarvis/jarvis_agent/events.py +157 -0
  9. jarvis/jarvis_agent/file_context_handler.py +79 -0
  10. jarvis/jarvis_agent/file_methodology_manager.py +117 -0
  11. jarvis/jarvis_agent/jarvis.py +1117 -147
  12. jarvis/jarvis_agent/main.py +78 -34
  13. jarvis/jarvis_agent/memory_manager.py +195 -0
  14. jarvis/jarvis_agent/methodology_share_manager.py +174 -0
  15. jarvis/jarvis_agent/prompt_manager.py +82 -0
  16. jarvis/jarvis_agent/prompts.py +46 -9
  17. jarvis/jarvis_agent/protocols.py +4 -1
  18. jarvis/jarvis_agent/rewrite_file_handler.py +141 -0
  19. jarvis/jarvis_agent/run_loop.py +146 -0
  20. jarvis/jarvis_agent/session_manager.py +9 -9
  21. jarvis/jarvis_agent/share_manager.py +228 -0
  22. jarvis/jarvis_agent/shell_input_handler.py +23 -3
  23. jarvis/jarvis_agent/stdio_redirect.py +295 -0
  24. jarvis/jarvis_agent/task_analyzer.py +212 -0
  25. jarvis/jarvis_agent/task_manager.py +154 -0
  26. jarvis/jarvis_agent/task_planner.py +496 -0
  27. jarvis/jarvis_agent/tool_executor.py +8 -4
  28. jarvis/jarvis_agent/tool_share_manager.py +139 -0
  29. jarvis/jarvis_agent/user_interaction.py +42 -0
  30. jarvis/jarvis_agent/utils.py +54 -0
  31. jarvis/jarvis_agent/web_bridge.py +189 -0
  32. jarvis/jarvis_agent/web_output_sink.py +53 -0
  33. jarvis/jarvis_agent/web_server.py +751 -0
  34. jarvis/jarvis_c2rust/__init__.py +26 -0
  35. jarvis/jarvis_c2rust/cli.py +613 -0
  36. jarvis/jarvis_c2rust/collector.py +258 -0
  37. jarvis/jarvis_c2rust/library_replacer.py +1122 -0
  38. jarvis/jarvis_c2rust/llm_module_agent.py +1300 -0
  39. jarvis/jarvis_c2rust/optimizer.py +960 -0
  40. jarvis/jarvis_c2rust/scanner.py +1681 -0
  41. jarvis/jarvis_c2rust/transpiler.py +2325 -0
  42. jarvis/jarvis_code_agent/build_validation_config.py +133 -0
  43. jarvis/jarvis_code_agent/code_agent.py +1605 -178
  44. jarvis/jarvis_code_agent/code_analyzer/__init__.py +62 -0
  45. jarvis/jarvis_code_agent/code_analyzer/base_language.py +74 -0
  46. jarvis/jarvis_code_agent/code_analyzer/build_validator/__init__.py +44 -0
  47. jarvis/jarvis_code_agent/code_analyzer/build_validator/base.py +102 -0
  48. jarvis/jarvis_code_agent/code_analyzer/build_validator/cmake.py +59 -0
  49. jarvis/jarvis_code_agent/code_analyzer/build_validator/detector.py +125 -0
  50. jarvis/jarvis_code_agent/code_analyzer/build_validator/fallback.py +69 -0
  51. jarvis/jarvis_code_agent/code_analyzer/build_validator/go.py +38 -0
  52. jarvis/jarvis_code_agent/code_analyzer/build_validator/java_gradle.py +44 -0
  53. jarvis/jarvis_code_agent/code_analyzer/build_validator/java_maven.py +38 -0
  54. jarvis/jarvis_code_agent/code_analyzer/build_validator/makefile.py +50 -0
  55. jarvis/jarvis_code_agent/code_analyzer/build_validator/nodejs.py +93 -0
  56. jarvis/jarvis_code_agent/code_analyzer/build_validator/python.py +129 -0
  57. jarvis/jarvis_code_agent/code_analyzer/build_validator/rust.py +54 -0
  58. jarvis/jarvis_code_agent/code_analyzer/build_validator/validator.py +154 -0
  59. jarvis/jarvis_code_agent/code_analyzer/build_validator.py +43 -0
  60. jarvis/jarvis_code_agent/code_analyzer/context_manager.py +363 -0
  61. jarvis/jarvis_code_agent/code_analyzer/context_recommender.py +18 -0
  62. jarvis/jarvis_code_agent/code_analyzer/dependency_analyzer.py +132 -0
  63. jarvis/jarvis_code_agent/code_analyzer/file_ignore.py +330 -0
  64. jarvis/jarvis_code_agent/code_analyzer/impact_analyzer.py +781 -0
  65. jarvis/jarvis_code_agent/code_analyzer/language_registry.py +185 -0
  66. jarvis/jarvis_code_agent/code_analyzer/language_support.py +89 -0
  67. jarvis/jarvis_code_agent/code_analyzer/languages/__init__.py +31 -0
  68. jarvis/jarvis_code_agent/code_analyzer/languages/c_cpp_language.py +231 -0
  69. jarvis/jarvis_code_agent/code_analyzer/languages/go_language.py +183 -0
  70. jarvis/jarvis_code_agent/code_analyzer/languages/python_language.py +219 -0
  71. jarvis/jarvis_code_agent/code_analyzer/languages/rust_language.py +209 -0
  72. jarvis/jarvis_code_agent/code_analyzer/llm_context_recommender.py +451 -0
  73. jarvis/jarvis_code_agent/code_analyzer/symbol_extractor.py +77 -0
  74. jarvis/jarvis_code_agent/code_analyzer/tree_sitter_extractor.py +48 -0
  75. jarvis/jarvis_code_agent/lint.py +275 -13
  76. jarvis/jarvis_code_agent/utils.py +142 -0
  77. jarvis/jarvis_code_analysis/checklists/loader.py +20 -6
  78. jarvis/jarvis_code_analysis/code_review.py +583 -548
  79. jarvis/jarvis_data/config_schema.json +339 -28
  80. jarvis/jarvis_git_squash/main.py +22 -13
  81. jarvis/jarvis_git_utils/git_commiter.py +171 -55
  82. jarvis/jarvis_mcp/sse_mcp_client.py +22 -15
  83. jarvis/jarvis_mcp/stdio_mcp_client.py +4 -4
  84. jarvis/jarvis_mcp/streamable_mcp_client.py +36 -16
  85. jarvis/jarvis_memory_organizer/memory_organizer.py +753 -0
  86. jarvis/jarvis_methodology/main.py +48 -63
  87. jarvis/jarvis_multi_agent/__init__.py +302 -43
  88. jarvis/jarvis_multi_agent/main.py +70 -24
  89. jarvis/jarvis_platform/ai8.py +40 -23
  90. jarvis/jarvis_platform/base.py +210 -49
  91. jarvis/jarvis_platform/human.py +11 -1
  92. jarvis/jarvis_platform/kimi.py +82 -76
  93. jarvis/jarvis_platform/openai.py +73 -1
  94. jarvis/jarvis_platform/registry.py +8 -15
  95. jarvis/jarvis_platform/tongyi.py +115 -101
  96. jarvis/jarvis_platform/yuanbao.py +89 -63
  97. jarvis/jarvis_platform_manager/main.py +194 -132
  98. jarvis/jarvis_platform_manager/service.py +122 -86
  99. jarvis/jarvis_rag/cli.py +156 -53
  100. jarvis/jarvis_rag/embedding_manager.py +155 -12
  101. jarvis/jarvis_rag/llm_interface.py +10 -13
  102. jarvis/jarvis_rag/query_rewriter.py +63 -12
  103. jarvis/jarvis_rag/rag_pipeline.py +222 -40
  104. jarvis/jarvis_rag/reranker.py +26 -3
  105. jarvis/jarvis_rag/retriever.py +270 -14
  106. jarvis/jarvis_sec/__init__.py +3605 -0
  107. jarvis/jarvis_sec/checkers/__init__.py +32 -0
  108. jarvis/jarvis_sec/checkers/c_checker.py +2680 -0
  109. jarvis/jarvis_sec/checkers/rust_checker.py +1108 -0
  110. jarvis/jarvis_sec/cli.py +116 -0
  111. jarvis/jarvis_sec/report.py +257 -0
  112. jarvis/jarvis_sec/status.py +264 -0
  113. jarvis/jarvis_sec/types.py +20 -0
  114. jarvis/jarvis_sec/workflow.py +219 -0
  115. jarvis/jarvis_smart_shell/main.py +405 -137
  116. jarvis/jarvis_stats/__init__.py +13 -0
  117. jarvis/jarvis_stats/cli.py +387 -0
  118. jarvis/jarvis_stats/stats.py +711 -0
  119. jarvis/jarvis_stats/storage.py +612 -0
  120. jarvis/jarvis_stats/visualizer.py +282 -0
  121. jarvis/jarvis_tools/ask_user.py +1 -0
  122. jarvis/jarvis_tools/base.py +18 -2
  123. jarvis/jarvis_tools/clear_memory.py +239 -0
  124. jarvis/jarvis_tools/cli/main.py +220 -144
  125. jarvis/jarvis_tools/execute_script.py +52 -12
  126. jarvis/jarvis_tools/file_analyzer.py +17 -12
  127. jarvis/jarvis_tools/generate_new_tool.py +46 -24
  128. jarvis/jarvis_tools/read_code.py +277 -18
  129. jarvis/jarvis_tools/read_symbols.py +141 -0
  130. jarvis/jarvis_tools/read_webpage.py +86 -13
  131. jarvis/jarvis_tools/registry.py +294 -90
  132. jarvis/jarvis_tools/retrieve_memory.py +227 -0
  133. jarvis/jarvis_tools/save_memory.py +194 -0
  134. jarvis/jarvis_tools/search_web.py +62 -28
  135. jarvis/jarvis_tools/sub_agent.py +205 -0
  136. jarvis/jarvis_tools/sub_code_agent.py +217 -0
  137. jarvis/jarvis_tools/virtual_tty.py +330 -62
  138. jarvis/jarvis_utils/builtin_replace_map.py +4 -5
  139. jarvis/jarvis_utils/clipboard.py +90 -0
  140. jarvis/jarvis_utils/config.py +607 -50
  141. jarvis/jarvis_utils/embedding.py +3 -0
  142. jarvis/jarvis_utils/fzf.py +57 -0
  143. jarvis/jarvis_utils/git_utils.py +251 -29
  144. jarvis/jarvis_utils/globals.py +174 -17
  145. jarvis/jarvis_utils/http.py +58 -79
  146. jarvis/jarvis_utils/input.py +899 -153
  147. jarvis/jarvis_utils/methodology.py +210 -83
  148. jarvis/jarvis_utils/output.py +220 -137
  149. jarvis/jarvis_utils/utils.py +1906 -135
  150. jarvis_ai_assistant-0.7.0.dist-info/METADATA +465 -0
  151. jarvis_ai_assistant-0.7.0.dist-info/RECORD +192 -0
  152. {jarvis_ai_assistant-0.1.222.dist-info → jarvis_ai_assistant-0.7.0.dist-info}/entry_points.txt +8 -2
  153. jarvis/jarvis_git_details/main.py +0 -265
  154. jarvis/jarvis_platform/oyi.py +0 -357
  155. jarvis/jarvis_tools/edit_file.py +0 -255
  156. jarvis/jarvis_tools/rewrite_file.py +0 -195
  157. jarvis_ai_assistant-0.1.222.dist-info/METADATA +0 -767
  158. jarvis_ai_assistant-0.1.222.dist-info/RECORD +0 -110
  159. /jarvis/{jarvis_git_details → jarvis_memory_organizer}/__init__.py +0 -0
  160. {jarvis_ai_assistant-0.1.222.dist-info → jarvis_ai_assistant-0.7.0.dist-info}/WHEEL +0 -0
  161. {jarvis_ai_assistant-0.1.222.dist-info → jarvis_ai_assistant-0.7.0.dist-info}/licenses/LICENSE +0 -0
  162. {jarvis_ai_assistant-0.1.222.dist-info → jarvis_ai_assistant-0.7.0.dist-info}/top_level.txt +0 -0
@@ -7,6 +7,7 @@
7
7
  "JARVIS_MCP": {
8
8
  "type": "array",
9
9
  "description": "MCP工具配置列表",
10
+ "default": [],
10
11
  "items": {
11
12
  "type": "object",
12
13
  "oneOf": [
@@ -111,14 +112,9 @@
111
112
  "description": "Git提交信息生成提示模板",
112
113
  "default": ""
113
114
  },
114
- "JARVIS_MAX_TOKEN_COUNT": {
115
- "type": "number",
116
- "description": "模型能处理的最大token数量",
117
- "default": 960000
118
- },
119
115
  "JARVIS_MAX_INPUT_TOKEN_COUNT": {
120
116
  "type": "number",
121
- "description": "模型能处理的最大输入token数量",
117
+ "description": "模型能处理的最大输入token数量。其他token限制基于此值计算:最大token数量=此值×100,最大大内容尺寸=此值×5",
122
118
  "default": 32000
123
119
  },
124
120
  "JARVIS_PLATFORM": {
@@ -131,40 +127,107 @@
131
127
  "description": "常规操作模型名称",
132
128
  "default": "deep_seek_v3"
133
129
  },
134
- "JARVIS_THINKING_PLATFORM": {
130
+ "JARVIS_WEB_SEARCH_PLATFORM": {
135
131
  "type": "string",
136
- "description": "思考操作平台名称",
137
- "default": "yuanbao"
132
+ "description": "Web搜索使用的平台名称",
133
+ "default": ""
134
+ },
135
+ "JARVIS_WEB_SEARCH_MODEL": {
136
+ "type": "string",
137
+ "description": "Web搜索使用的模型名称",
138
+ "default": ""
138
139
  },
139
- "JARVIS_THINKING_MODEL": {
140
+ "JARVIS_LLM_GROUP": {
140
141
  "type": "string",
141
- "description": "思考操作模型名称",
142
- "default": "deep_seek"
142
+ "description": "选择一个预定义的模型组",
143
+ "default": ""
144
+ },
145
+ "JARVIS_LLM_GROUPS": {
146
+ "type": "array",
147
+ "description": "预定义的模型配置组",
148
+ "default": [],
149
+ "items": {
150
+ "type": "object",
151
+ "additionalProperties": {
152
+ "type": "object",
153
+ "properties": {
154
+ "JARVIS_PLATFORM": {
155
+ "type": "string",
156
+ "default": "yuanbao"
157
+ },
158
+ "JARVIS_MODEL": {
159
+ "type": "string",
160
+ "default": "deep_seek_v3"
161
+ },
162
+ "JARVIS_MAX_INPUT_TOKEN_COUNT": {
163
+ "type": "number",
164
+ "default": 32000
165
+ },
166
+ "ENV": {
167
+ "type": "object",
168
+ "description": "该模型组特定的环境变量,会覆盖全局 ENV 配置",
169
+ "additionalProperties": {
170
+ "type": "string"
171
+ }
172
+ }
173
+ },
174
+ "required": [
175
+ "JARVIS_PLATFORM",
176
+ "JARVIS_MODEL"
177
+ ]
178
+ }
179
+ }
143
180
  },
144
181
  "JARVIS_EXECUTE_TOOL_CONFIRM": {
145
182
  "type": "boolean",
146
183
  "description": "执行工具前是否需要确认",
147
184
  "default": false
148
185
  },
186
+ "JARVIS_TOOL_FILTER_THRESHOLD": {
187
+ "type": "number",
188
+ "description": "AI工具筛选阈值:当可用工具数量超过此值时触发AI筛选",
189
+ "default": 30
190
+ },
191
+ "JARVIS_PLAN_ENABLED": {
192
+ "type": "boolean",
193
+ "description": "是否默认启用任务规划。当 Agent 初始化时 plan 参数未指定,将从此配置加载。默认 true。",
194
+ "default": true
195
+ },
196
+ "JARVIS_PLAN_MAX_DEPTH": {
197
+ "type": "number",
198
+ "description": "任务规划的最大层数。用于限制 plan 模式的递归拆分深度。仅在启用规划时生效(通过 CLI --plan/--no-plan 控制),默认 2。",
199
+ "default": 2
200
+ },
201
+ "JARVIS_SCRIPT_EXECUTION_TIMEOUT": {
202
+ "type": "number",
203
+ "description": "脚本执行的超时时间(秒),仅在非交互模式下生效。",
204
+ "default": 300
205
+ },
206
+ "JARVIS_AUTO_SUMMARY_ROUNDS": {
207
+ "type": "number",
208
+ "description": "基于对话轮次的自动总结阈值(达到该轮次后自动总结并清理历史)",
209
+ "default": 50
210
+ },
149
211
  "JARVIS_CONFIRM_BEFORE_APPLY_PATCH": {
150
212
  "type": "boolean",
151
213
  "description": "应用补丁前是否需要确认",
152
214
  "default": false
153
215
  },
216
+ "JARVIS_PATCH_FORMAT": {
217
+ "type": "string",
218
+ "enum": ["all", "search", "search_range"],
219
+ "description": "补丁格式处理模式:all 同时支持 SEARCH 与 SEARCH_START/SEARCH_END;search 仅允许精确片段匹配;search_range 仅允许范围匹配。",
220
+ "default": "all"
221
+ },
154
222
  "JARVIS_DATA_PATH": {
155
223
  "type": "string",
156
224
  "description": "Jarvis数据存储目录路径",
157
225
  "default": "~/.jarvis"
158
226
  },
159
- "JARVIS_MAX_BIG_CONTENT_SIZE": {
160
- "type": "number",
161
- "description": "最大大内容尺寸",
162
- "default": 160000
163
- },
164
227
  "JARVIS_PRETTY_OUTPUT": {
165
228
  "type": "boolean",
166
229
  "description": "是否启用美化输出",
167
- "default": false
230
+ "default": true
168
231
  },
169
232
  "JARVIS_USE_METHODOLOGY": {
170
233
  "type": "boolean",
@@ -176,34 +239,252 @@
176
239
  "description": "是否启用任务分析",
177
240
  "default": true
178
241
  },
242
+ "JARVIS_TOOL_LOAD_DIRS": {
243
+ "type": "array",
244
+ "description": "自定义工具加载目录",
245
+ "items": {
246
+ "type": "string"
247
+ },
248
+ "default": []
249
+ },
250
+ "JARVIS_METHODOLOGY_DIRS": {
251
+ "type": "array",
252
+ "description": "方法论加载目录",
253
+ "items": {
254
+ "type": "string"
255
+ },
256
+ "default": []
257
+ },
258
+ "JARVIS_AGENT_DEFINITION_DIRS": {
259
+ "type": "array",
260
+ "description": "agent 定义加载目录",
261
+ "items": {
262
+ "type": "string"
263
+ },
264
+ "default": []
265
+ },
266
+ "JARVIS_MULTI_AGENT_DIRS": {
267
+ "type": "array",
268
+ "description": "multi_agent 加载目录",
269
+ "items": {
270
+ "type": "string"
271
+ },
272
+ "default": []
273
+ },
274
+ "JARVIS_ROLES_DIRS": {
275
+ "type": "array",
276
+ "description": "roles 加载目录",
277
+ "items": {
278
+ "type": "string"
279
+ },
280
+ "default": []
281
+ },
282
+ "JARVIS_AFTER_TOOL_CALL_CB_DIRS": {
283
+ "type": "array",
284
+ "description": "工具调用后回调函数实现目录",
285
+ "items": {
286
+ "type": "string"
287
+ },
288
+ "default": []
289
+ },
290
+ "JARVIS_CENTRAL_METHODOLOGY_REPO": {
291
+ "type": "string",
292
+ "description": "中心方法论仓库路径或Git仓库地址。支持本地目录(含git子路径):若为本地目录将直接加入方法论加载路径;若为Git URL则会克隆到数据目录后加载。",
293
+ "default": ""
294
+ },
295
+ "JARVIS_CENTRAL_TOOL_REPO": {
296
+ "type": "string",
297
+ "description": "中心工具仓库路径或Git仓库地址。支持本地目录(含git子路径):若为本地目录将直接加载其中的工具;若为Git URL则会克隆到数据目录并加载。",
298
+ "default": ""
299
+ },
179
300
  "JARVIS_PRINT_PROMPT": {
180
301
  "type": "boolean",
181
302
  "description": "是否打印提示",
182
303
  "default": false
183
304
  },
305
+ "JARVIS_PRINT_ERROR_TRACEBACK": {
306
+ "type": "boolean",
307
+ "description": "是否在错误输出时打印回溯调用链",
308
+ "default": false
309
+ },
184
310
  "JARVIS_ENABLE_STATIC_ANALYSIS": {
185
311
  "type": "boolean",
186
312
  "description": "是否启用静态代码分析",
187
313
  "default": true
188
314
  },
315
+ "JARVIS_ENABLE_BUILD_VALIDATION": {
316
+ "type": "boolean",
317
+ "description": "是否启用构建验证。在代码编辑后自动验证代码能否成功编译/构建,确保编辑不会破坏项目构建。",
318
+ "default": true
319
+ },
320
+ "JARVIS_BUILD_VALIDATION_TIMEOUT": {
321
+ "type": "number",
322
+ "description": "构建验证的超时时间(秒)。当构建验证执行时间超过此值时,将终止验证并报告超时。",
323
+ "default": 30
324
+ },
325
+ "JARVIS_ENABLE_IMPACT_ANALYSIS": {
326
+ "type": "boolean",
327
+ "description": "是否启用编辑影响范围分析。分析代码编辑的影响范围,识别可能受影响的文件、函数、测试等,帮助评估编辑风险。",
328
+ "default": true
329
+ },
330
+ "JARVIS_FORCE_SAVE_MEMORY": {
331
+ "type": "boolean",
332
+ "description": "是否强制保存记忆",
333
+ "default": false
334
+ },
335
+ "JARVIS_ENABLE_GIT_JCA_SWITCH": {
336
+ "type": "boolean",
337
+ "description": "在初始化环境前检测Git仓库并提示可切换到代码开发模式(jca)",
338
+ "default": true
339
+ },
340
+ "JARVIS_ENABLE_STARTUP_CONFIG_SELECTOR": {
341
+ "type": "boolean",
342
+ "description": "在进入默认通用代理前,列出可用配置(agent/multi_agent/roles)供选择",
343
+ "default": true
344
+ },
345
+ "JARVIS_IMMEDIATE_ABORT": {
346
+ "type": "boolean",
347
+ "description": "是否启用立即中断:在对话迭代中检测到中断信号时立即返回",
348
+ "default": false
349
+ },
350
+ "JARVIS_SAVE_SESSION_HISTORY": {
351
+ "type": "boolean",
352
+ "description": "是否保存会话记录",
353
+ "default": false
354
+ },
355
+ "JARVIS_SKIP_PREDEFINED_TASKS": {
356
+ "type": "boolean",
357
+ "description": "是否跳过预定义任务加载(不读取 pre-command 列表)",
358
+ "default": false
359
+ },
360
+ "JARVIS_ADDON_PROMPT_THRESHOLD": {
361
+ "type": "number",
362
+ "description": "附加提示的触发阈值(字符数)。当消息长度超过此值时,会自动添加默认的附加提示",
363
+ "default": 1024
364
+ },
365
+ "JARVIS_ENABLE_INTENT_RECOGNITION": {
366
+ "type": "boolean",
367
+ "description": "是否启用意图识别功能。用于智能上下文推荐中的LLM意图提取和语义分析",
368
+ "default": true
369
+ },
370
+ "JARVIS_GIT_CHECK_MODE": {
371
+ "type": "string",
372
+ "enum": ["strict", "warn"],
373
+ "description": "Git 配置校验模式:strict 表示严格模式(默认),缺失配置时直接退出;warn 表示警告模式,仅提示并继续运行",
374
+ "default": "strict"
375
+ },
376
+ "JARVIS_TOOL_GROUP": {
377
+ "type": "string",
378
+ "description": "选择一个预定义的工具配置组",
379
+ "default": ""
380
+ },
381
+ "JARVIS_TOOL_GROUPS": {
382
+ "type": "array",
383
+ "description": "预定义的工具配置组",
384
+ "default": [],
385
+ "items": {
386
+ "type": "object",
387
+ "additionalProperties": {
388
+ "type": "object",
389
+ "properties": {
390
+ "use": {
391
+ "type": "array",
392
+ "description": "要使用的工具名称列表",
393
+ "items": {
394
+ "type": "string"
395
+ }
396
+ },
397
+ "dont_use": {
398
+ "type": "array",
399
+ "description": "不使用的工具名称列表",
400
+ "items": {
401
+ "type": "string"
402
+ }
403
+ }
404
+ }
405
+ }
406
+ }
407
+ },
408
+ "JARVIS_RAG_GROUP": {
409
+ "type": "string",
410
+ "description": "选择一个预定义的RAG配置组",
411
+ "default": ""
412
+ },
413
+ "JARVIS_RAG_GROUPS": {
414
+ "type": "array",
415
+ "description": "预定义的RAG配置组",
416
+ "default": [
417
+ {
418
+ "text": {
419
+ "embedding_model": "BAAI/bge-m3",
420
+ "rerank_model": "BAAI/bge-reranker-v2-m3",
421
+ "use_bm25": true,
422
+ "use_rerank": true
423
+ }
424
+ },
425
+ {
426
+ "code": {
427
+ "embedding_model": "Qodo/Qodo-Embed-1-1.5B",
428
+ "use_bm25": false,
429
+ "use_rerank": false
430
+ }
431
+ }
432
+ ],
433
+ "items": {
434
+ "type": "object",
435
+ "additionalProperties": {
436
+ "type": "object",
437
+ "properties": {
438
+ "embedding_model": {
439
+ "type": "string",
440
+ "default": "BAAI/bge-m3"
441
+ },
442
+ "rerank_model": {
443
+ "type": "string",
444
+ "default": "BAAI/bge-reranker-v2-m3"
445
+ },
446
+ "use_bm25": {
447
+ "type": "boolean",
448
+ "default": true
449
+ },
450
+ "use_rerank": {
451
+ "type": "boolean",
452
+ "default": true
453
+ }
454
+ }
455
+ }
456
+ }
457
+ },
189
458
  "JARVIS_RAG": {
190
459
  "type": "object",
191
- "description": "RAG框架的配置",
460
+ "description": "RAG框架的顶层配置。注意:此处的设置将覆盖任何由JARVIS_RAG_GROUP选择的组配置。",
192
461
  "properties": {
193
462
  "embedding_model": {
194
463
  "type": "string",
195
- "default": "BAAI/bge-base-zh-v1.5",
196
- "description": "用于RAG的嵌入模型的名称, 默认为 'BAAI/bge-base-zh-v1.5'"
464
+ "default": "BAAI/bge-m3",
465
+ "description": "用于RAG的嵌入模型的名称, 默认为 'BAAI/bge-m3'"
197
466
  },
198
467
  "rerank_model": {
199
468
  "type": "string",
200
- "default": "BAAI/bge-reranker-base",
201
- "description": "用于RAG的rerank模型的名称, 默认为 'BAAI/bge-reranker-base'"
469
+ "default": "BAAI/bge-reranker-v2-m3",
470
+ "description": "用于RAG的rerank模型的名称, 默认为 'BAAI/bge-reranker-v2-m3'"
471
+ },
472
+ "use_bm25": {
473
+ "type": "boolean",
474
+ "default": true,
475
+ "description": "是否在RAG中为检索使用BM25, 默认为 true"
476
+ },
477
+ "use_rerank": {
478
+ "type": "boolean",
479
+ "default": true,
480
+ "description": "是否在RAG中为检索使用rerank, 默认为 true"
202
481
  }
203
482
  },
204
483
  "default": {
205
- "embedding_model": "BAAI/bge-base-zh-v1.5",
206
- "rerank_model": "BAAI/bge-reranker-base"
484
+ "embedding_model": "BAAI/bge-m3",
485
+ "rerank_model": "BAAI/bge-reranker-v2-m3",
486
+ "use_bm25": true,
487
+ "use_rerank": true
207
488
  }
208
489
  },
209
490
  "JARVIS_REPLACE_MAP": {
@@ -228,8 +509,38 @@
228
509
  "required": [
229
510
  "template"
230
511
  ]
231
- }
512
+ },
513
+ "default": {}
514
+ },
515
+ "OPENAI_API_KEY": {
516
+ "type": "string",
517
+ "description": "OpenAI API Key"
518
+ },
519
+ "OPENAI_API_BASE": {
520
+ "type": "string",
521
+ "description": "OpenAI API Base URL"
522
+ },
523
+ "KIMI_API_KEY": {
524
+ "type": "string",
525
+ "description": "Kimi API Key"
526
+ },
527
+ "TONGYI_COOKIES": {
528
+ "type": "string",
529
+ "description": "Tongyi Cookies"
530
+ },
531
+ "YUANBAO_COOKIES": {
532
+ "type": "string",
533
+ "description": "Yuanbao Cookies"
534
+ },
535
+ "AI8_API_KEY": {
536
+ "type": "string",
537
+ "description": "AI8 API Key"
538
+ },
539
+ "SHELL": {
540
+ "type": "string",
541
+ "description": "系统Shell路径,用于获取当前使用的shell类型",
542
+ "default": "/bin/bash"
232
543
  }
233
544
  },
234
- "additionalProperties": false
235
- }
545
+ "additionalProperties": true
546
+ }
@@ -1,13 +1,16 @@
1
1
  # -*- coding: utf-8 -*-
2
- import argparse
3
2
  import subprocess
4
- import sys
5
3
  from typing import Dict
6
4
 
5
+ import typer
6
+
7
7
  from jarvis.jarvis_git_utils.git_commiter import GitCommitTool
8
8
  from jarvis.jarvis_utils.output import OutputType, PrettyOutput
9
9
  from jarvis.jarvis_utils.utils import init_env
10
10
  from jarvis.jarvis_utils.input import user_confirm
11
+ from jarvis.jarvis_utils.globals import get_agent, current_agent_name
12
+
13
+ app = typer.Typer(help="Git压缩工具")
11
14
 
12
15
 
13
16
  class GitSquashTool:
@@ -44,23 +47,29 @@ class GitSquashTool:
44
47
 
45
48
  # Use existing GitCommitTool for new commit
46
49
  commit_tool = GitCommitTool()
47
- commit_tool.execute({"lang": args.get("lang", "Chinese")})
50
+ agent = get_agent(current_agent_name)
51
+ exec_args = {"lang": args.get("lang", "Chinese")}
52
+ if agent:
53
+ exec_args["agent"] = agent
54
+ commit_tool.execute(exec_args)
48
55
  except Exception as e:
49
56
  PrettyOutput.print(f"压缩提交失败: {str(e)}", OutputType.WARNING)
50
57
 
51
58
 
52
- def main():
59
+ @app.command()
60
+ def cli(
61
+ commit_hash: str = typer.Argument(..., help="要压缩的基础提交哈希"),
62
+ lang: str = typer.Option("Chinese", "--lang", help="提交信息的语言"),
63
+ ):
53
64
  init_env("欢迎使用 Jarvis-GitSquash,您的Git压缩助手已准备就绪!")
54
- parser = argparse.ArgumentParser(description="Git squash tool")
55
- parser.add_argument("commit_hash", type=str, help="Base commit hash to squash from")
56
- parser.add_argument(
57
- "--lang", type=str, default="Chinese", help="Language for commit messages"
58
- )
59
- args = parser.parse_args()
60
-
61
65
  tool = GitSquashTool()
62
- tool.execute({"commit_hash": args.commit_hash, "lang": args.lang})
66
+ tool.execute({"commit_hash": commit_hash, "lang": lang})
67
+
68
+
69
+ def main():
70
+ """Application entry point"""
71
+ app()
63
72
 
64
73
 
65
74
  if __name__ == "__main__":
66
- sys.exit(main())
75
+ main()