jarvis-ai-assistant 0.4.2__py3-none-any.whl → 0.5.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.
@@ -279,12 +279,12 @@
279
279
  },
280
280
  "JARVIS_CENTRAL_METHODOLOGY_REPO": {
281
281
  "type": "string",
282
- "description": "中心方法论Git仓库地址,该仓库会自动添加到方法论加载路径中",
282
+ "description": "中心方法论仓库路径或Git仓库地址。支持本地目录(含git子路径):若为本地目录将直接加入方法论加载路径;若为Git URL则会克隆到数据目录后加载。",
283
283
  "default": ""
284
284
  },
285
285
  "JARVIS_CENTRAL_TOOL_REPO": {
286
286
  "type": "string",
287
- "description": "中心工具库Git仓库地址,该仓库会自动克隆到数据目录并加载其中的工具",
287
+ "description": "中心工具仓库路径或Git仓库地址。支持本地目录(含git子路径):若为本地目录将直接加载其中的工具;若为Git URL则会克隆到数据目录并加载。",
288
288
  "default": ""
289
289
  },
290
290
  "JARVIS_PRINT_PROMPT": {
@@ -350,22 +350,28 @@ class ToolRegistry(OutputHandlerProtocol):
350
350
  # 如果配置了中心工具仓库,将其添加到加载路径
351
351
  central_repo = get_central_tool_repo()
352
352
  if central_repo:
353
- # 中心工具仓库存储在数据目录下的特定位置
354
- central_repo_path = os.path.join(get_data_dir(), "central_tool_repo")
355
- tool_dirs.append(central_repo_path)
353
+ # 支持本地目录路径或Git仓库URL
354
+ expanded = os.path.expanduser(os.path.expandvars(central_repo))
355
+ if os.path.isdir(expanded):
356
+ # 直接使用本地目录(支持Git仓库的子目录)
357
+ tool_dirs.append(expanded)
358
+ else:
359
+ # 中心工具仓库存储在数据目录下的特定位置
360
+ central_repo_path = os.path.join(get_data_dir(), "central_tool_repo")
361
+ tool_dirs.append(central_repo_path)
356
362
 
357
- # 确保中心工具仓库被克隆/更新
358
- if not os.path.exists(central_repo_path):
359
- try:
360
- import subprocess
363
+ # 确保中心工具仓库被克隆/更新
364
+ if not os.path.exists(central_repo_path):
365
+ try:
366
+ import subprocess
361
367
 
362
- subprocess.run(
363
- ["git", "clone", central_repo, central_repo_path], check=True
364
- )
365
- except Exception as e:
366
- PrettyOutput.print(
367
- f"克隆中心工具仓库失败: {str(e)}", OutputType.ERROR
368
- )
368
+ subprocess.run(
369
+ ["git", "clone", central_repo, central_repo_path], check=True
370
+ )
371
+ except Exception as e:
372
+ PrettyOutput.print(
373
+ f"克隆中心工具仓库失败: {str(e)}", OutputType.ERROR
374
+ )
369
375
 
370
376
  # --- 全局每日更新检查 ---
371
377
  daily_check_git_updates(tool_dirs, "tools")
@@ -54,25 +54,31 @@ def _load_all_methodologies() -> Dict[str, str]:
54
54
  # 如果配置了中心方法论仓库,将其添加到加载路径
55
55
  central_repo = get_central_methodology_repo()
56
56
  if central_repo:
57
- # 中心方法论仓库存储在数据目录下的特定位置
58
- central_repo_path = os.path.join(get_data_dir(), "central_methodology_repo")
59
- methodology_dirs.append(central_repo_path)
60
-
61
- # 确保中心方法论仓库被克隆/更新
62
- if not os.path.exists(central_repo_path):
63
- try:
64
- import subprocess
65
-
66
- PrettyOutput.print(
67
- f"正在克隆中心方法论仓库: {central_repo}", OutputType.INFO
68
- )
69
- subprocess.run(
70
- ["git", "clone", central_repo, central_repo_path], check=True
71
- )
72
- except Exception as e:
73
- PrettyOutput.print(
74
- f"克隆中心方法论仓库失败: {str(e)}", OutputType.ERROR
75
- )
57
+ # 支持本地目录路径或Git仓库URL
58
+ expanded = os.path.expanduser(os.path.expandvars(central_repo))
59
+ if os.path.isdir(expanded):
60
+ # 直接使用本地目录(支持Git仓库的子目录)
61
+ methodology_dirs.append(expanded)
62
+ else:
63
+ # 中心方法论仓库存储在数据目录下的特定位置
64
+ central_repo_path = os.path.join(get_data_dir(), "central_methodology_repo")
65
+ methodology_dirs.append(central_repo_path)
66
+
67
+ # 确保中心方法论仓库被克隆/更新
68
+ if not os.path.exists(central_repo_path):
69
+ try:
70
+ import subprocess
71
+
72
+ PrettyOutput.print(
73
+ f"正在克隆中心方法论仓库: {central_repo}", OutputType.INFO
74
+ )
75
+ subprocess.run(
76
+ ["git", "clone", central_repo, central_repo_path], check=True
77
+ )
78
+ except Exception as e:
79
+ PrettyOutput.print(
80
+ f"克隆中心方法论仓库失败: {str(e)}", OutputType.ERROR
81
+ )
76
82
 
77
83
  # --- 全局每日更新检查 ---
78
84
  daily_check_git_updates(methodology_dirs, "methodologies")
@@ -1212,6 +1212,37 @@ def _collect_optional_config_interactively(
1212
1212
  or changed
1213
1213
  )
1214
1214
 
1215
+ # 新增:会话与调试相关配置
1216
+ changed = (
1217
+ _ask_and_set(
1218
+ "JARVIS_SAVE_SESSION_HISTORY",
1219
+ "是否保存会话记录?",
1220
+ False,
1221
+ "bool",
1222
+ )
1223
+ or changed
1224
+ )
1225
+ changed = (
1226
+ _ask_and_set(
1227
+ "JARVIS_PRINT_ERROR_TRACEBACK",
1228
+ "是否在错误输出时打印回溯调用链?",
1229
+ False,
1230
+ "bool",
1231
+ )
1232
+ or changed
1233
+ )
1234
+
1235
+ # 其它可选开关
1236
+ changed = (
1237
+ _ask_and_set(
1238
+ "JARVIS_SKIP_PREDEFINED_TASKS",
1239
+ "是否跳过预定义任务加载(不读取 pre-command 列表)?",
1240
+ False,
1241
+ "bool",
1242
+ )
1243
+ or changed
1244
+ )
1245
+
1215
1246
  # 代码与工具操作安全提示
1216
1247
  changed = (
1217
1248
  _ask_and_set(
@@ -1258,6 +1289,23 @@ def _collect_optional_config_interactively(
1258
1289
  )
1259
1290
  or changed
1260
1291
  )
1292
+ # 新增:自动总结轮次与脚本超时
1293
+ changed = (
1294
+ _ask_and_set_int(
1295
+ "JARVIS_AUTO_SUMMARY_ROUNDS",
1296
+ "基于对话轮次的自动总结阈值(达到该轮次后自动总结并清理历史,默认20)",
1297
+ 20,
1298
+ )
1299
+ or changed
1300
+ )
1301
+ changed = (
1302
+ _ask_and_set_int(
1303
+ "JARVIS_SCRIPT_EXECUTION_TIMEOUT",
1304
+ "脚本执行超时时间(秒,默认300,仅非交互模式生效)",
1305
+ 300,
1306
+ )
1307
+ or changed
1308
+ )
1261
1309
 
1262
1310
  # 目录类配置(逗号分隔)
1263
1311
  changed = (
@@ -1295,6 +1343,14 @@ def _collect_optional_config_interactively(
1295
1343
  )
1296
1344
  or changed
1297
1345
  )
1346
+ # 新增:工具调用后回调实现目录
1347
+ changed = (
1348
+ _ask_and_set_list(
1349
+ "JARVIS_AFTER_TOOL_CALL_CB_DIRS",
1350
+ "指定工具调用后回调实现目录(逗号分隔,留空跳过):",
1351
+ )
1352
+ or changed
1353
+ )
1298
1354
 
1299
1355
  # Web 搜索配置(可选)
1300
1356
  changed = (
@@ -1439,7 +1495,7 @@ def _collect_optional_config_interactively(
1439
1495
  changed = (
1440
1496
  _ask_and_set(
1441
1497
  "JARVIS_CENTRAL_METHODOLOGY_REPO",
1442
- "请输入中心方法论仓库地址(可留空跳过):",
1498
+ "请输入中心方法论仓库路径或Git地址(可留空跳过):",
1443
1499
  "",
1444
1500
  "str",
1445
1501
  )
@@ -1448,7 +1504,7 @@ def _collect_optional_config_interactively(
1448
1504
  changed = (
1449
1505
  _ask_and_set(
1450
1506
  "JARVIS_CENTRAL_TOOL_REPO",
1451
- "请输入中心工具仓库地址(可留空跳过):",
1507
+ "请输入中心工具仓库路径或Git地址(可留空跳过):",
1452
1508
  "",
1453
1509
  "str",
1454
1510
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.4.2
3
+ Version: 0.5.0
4
4
  Summary: Jarvis: An AI assistant that uses tools to interact with the system
5
5
  Home-page: https://github.com/skyfireitdiy/Jarvis
6
6
  Author: skyfire
@@ -1,5 +1,5 @@
1
- jarvis/__init__.py,sha256=NIbT8I8sAw3cCWWXtArSe6_eWeB17Gf7WmiF9nyxdKs,73
2
- jarvis/jarvis_agent/__init__.py,sha256=OOoHubIIQ3A9xB7jHFRpJKDtAk0or8Y7TmUkdq00l4Q,51386
1
+ jarvis/__init__.py,sha256=oTkuIy1EsFy9C2D4yYth5JohcbEgLLtiPlfbyY7LvrM,73
2
+ jarvis/jarvis_agent/__init__.py,sha256=uq8p8ruYW5CjN8J8fncYAe7YrRORXjm183TSu_0ST2Y,51837
3
3
  jarvis/jarvis_agent/agent_manager.py,sha256=Q0S-mYTPt8Xd7RKGoLWoWU_RP_wEXFWxCjve8_t2f2A,3807
4
4
  jarvis/jarvis_agent/builtin_input_handler.py,sha256=wS-FqpT3pIXwHn1dfL3SpXonUKWgVThbQueUIeyRc2U,2917
5
5
  jarvis/jarvis_agent/config_editor.py,sha256=hlb9EYxKWcR_qdW2O89CgNDdciR9Isi743JU_1gD8j4,1927
@@ -20,7 +20,7 @@ jarvis/jarvis_agent/protocols.py,sha256=YFJaC9MHi7JfLzmvlyotJDjiCO4Z07XJXy1gKhVd
20
20
  jarvis/jarvis_agent/rewrite_file_handler.py,sha256=FVSrfrC115_cGvdPW9RIn3A-gQAhok7GyyBfnOFdpXs,5276
21
21
  jarvis/jarvis_agent/run_loop.py,sha256=iGfa28J2K6I07k6p66O3WJFSk9z4uOarqe6CLqALIsk,6167
22
22
  jarvis/jarvis_agent/session_manager.py,sha256=5wVcaZGwJ9cEKTQglSbqyxUDJ2fI5KxYN8C8L16UWLw,3024
23
- jarvis/jarvis_agent/share_manager.py,sha256=MF2RlomcgPxF8nVUk28DP6IRddZ_tot5l_YRvy0qXSQ,8726
23
+ jarvis/jarvis_agent/share_manager.py,sha256=Nl7zvy5PbcYAPXUgfnvatoUB0V4sIQOt61LyYkp5-2w,9127
24
24
  jarvis/jarvis_agent/shell_input_handler.py,sha256=wiAPjB-9uTkcLszbO5dlOUwIfaeR39RgRcZhahIGqoA,2018
25
25
  jarvis/jarvis_agent/stdio_redirect.py,sha256=xqF-sENitpefCT3TA9oRwATFqbDrU2dvqM-UiMZRhbE,9944
26
26
  jarvis/jarvis_agent/task_analyzer.py,sha256=JXc-63hnTD7oSX-nIfRcgxqCMhh4fM4QYVc7C1gp--M,7813
@@ -33,9 +33,9 @@ jarvis/jarvis_agent/web_bridge.py,sha256=h15PXuPWWfZynWt8bPW4BDeCpIVoIOlRXfO0je6
33
33
  jarvis/jarvis_agent/web_output_sink.py,sha256=sZ6WbLZnuCdT5dS9d8msHY_g-pnj-dvML-I6uJ7-sbc,1733
34
34
  jarvis/jarvis_agent/web_server.py,sha256=oZZy4nAOPhRWJn7K8VjBlho1F9AsvLEYiusKgipjO94,28204
35
35
  jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- jarvis/jarvis_code_agent/code_agent.py,sha256=UaYppteSUzwni-ZUDAKDrGTDijBrXU1Ia91OoLdfYLs,38072
36
+ jarvis/jarvis_code_agent/code_agent.py,sha256=JtUZ6maMxOic5g5THCoOpgv9hyYecJZL71QR7nE2KDM,42269
37
37
  jarvis/jarvis_code_agent/lint.py,sha256=_qLJB_bC3PuoHG-j4EGOnYzNGO26jHlKLbkysfyQW1c,3954
38
- jarvis/jarvis_code_analysis/code_review.py,sha256=A3LaxFAlIH5qCfMajIr02ExG6YiolIVpjl9blsLh4SY,34402
38
+ jarvis/jarvis_code_analysis/code_review.py,sha256=48r0UE4pmOUaRgBJIJrpPW307sKGo1rnTNkWdsqkOrY,29889
39
39
  jarvis/jarvis_code_analysis/checklists/__init__.py,sha256=LIXAYa1sW3l7foP6kohLWnE98I_EQ0T7z5bYKHq6rJA,78
40
40
  jarvis/jarvis_code_analysis/checklists/c_cpp.py,sha256=9t62bMqs6qTkFSio4SKkj88qyb5ZubWrw3MxJBQ4X1A,1317
41
41
  jarvis/jarvis_code_analysis/checklists/csharp.py,sha256=ShPXrl2_UPAnGaCHAG2wLl90COG3HK2XCSr1UK2dxN4,2420
@@ -56,7 +56,7 @@ jarvis/jarvis_code_analysis/checklists/shell.py,sha256=aRFYhQQvTgbYd-uY5pc8UHIUA
56
56
  jarvis/jarvis_code_analysis/checklists/sql.py,sha256=vR0T6qC7b4dURjJVAd7kSVxyvZEQXPG1Jqc2sNTGp5c,2355
57
57
  jarvis/jarvis_code_analysis/checklists/swift.py,sha256=TPx4I6Gupvs6tSerRKmTSKEPQpOLEbH2Y7LXg1uBgxc,2566
58
58
  jarvis/jarvis_code_analysis/checklists/web.py,sha256=25gGD7pDadZQybNFvALYxWvK0VRjGQb1NVJQElwjyk0,3943
59
- jarvis/jarvis_data/config_schema.json,sha256=VlPqakEXx7k2wm5Uv-ZlbKeIPbHNc98r1pHFtXEBBBY,14884
59
+ jarvis/jarvis_data/config_schema.json,sha256=1c8h8kDlcBqqiX2uHhajgT70F9o88QR1ee-zk2GJJ6w,15093
60
60
  jarvis/jarvis_data/tiktoken/9b5ad71b2ce5302211f9c61530b329a4922fc6a4,sha256=Ijkht27pm96ZW3_3OFE-7xAPtR0YyTWXoRO8_-hlsqc,1681126
61
61
  jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  jarvis/jarvis_git_squash/main.py,sha256=BRbsEQVXwseVFKliVqV8_JPh1om6QT6dLTHw0jQ7OE0,2474
@@ -108,7 +108,7 @@ jarvis/jarvis_tools/generate_new_tool.py,sha256=tJz0YtfDwyH9y00VEWw3Btqr9JCNhvtI
108
108
  jarvis/jarvis_tools/methodology.py,sha256=_K4GIDUodGEma3SvNRo7Qs5rliijgNespVLyAPN35JU,5233
109
109
  jarvis/jarvis_tools/read_code.py,sha256=F1RuO0c69t0h7CvrUGqrTyNcOCcUrFQPACc61O_YSso,6382
110
110
  jarvis/jarvis_tools/read_webpage.py,sha256=dfyXJ9vaX-ZRbua1P5ZlaU_SlSzKkeNw-1kI_3-gxFE,5433
111
- jarvis/jarvis_tools/registry.py,sha256=9gIhiyh7jAAnLeGBIDyUUHwOeDtgOx3UUWk6kRN1sJg,33670
111
+ jarvis/jarvis_tools/registry.py,sha256=KDDuaQC_Ej8nGKk2P5W7uMV22BQQx_lSf9dLrLZ6ocY,34033
112
112
  jarvis/jarvis_tools/retrieve_memory.py,sha256=hhhGSr7jebPHICY9oEKICyI8mfqsRtKjh58qZNZApKc,8624
113
113
  jarvis/jarvis_tools/save_memory.py,sha256=RQtNxcpU53FFv_EBjH0i0oyQ7jWubm-trD1BHuqaGjI,6985
114
114
  jarvis/jarvis_tools/search_web.py,sha256=Hi8WBxcRH02qjOF1qcJP2qSqs3kVOKGFAARfh548Ii4,6370
@@ -128,13 +128,13 @@ jarvis/jarvis_utils/git_utils.py,sha256=zxjdxbFb_X6aYo-w1fbMx3d2n1ScbmmaAYlE3wGa
128
128
  jarvis/jarvis_utils/globals.py,sha256=7Xvf9HY6jYJL4vSD1F1WCoxHkHCAyltJUYt4V9gGVU4,8865
129
129
  jarvis/jarvis_utils/http.py,sha256=eRhV3-GYuWmQ0ogq9di9WMlQkFcVb1zGCrySnOgT1x0,4392
130
130
  jarvis/jarvis_utils/input.py,sha256=4VXpUZoAocW1mldlZd4bmXI8a_CmcQj7IPLBNgNLGSI,40045
131
- jarvis/jarvis_utils/methodology.py,sha256=z_renvRGgHiC-XTQPuN6rvrJ_ffHlwxK_b1BU_jmNAQ,12800
131
+ jarvis/jarvis_utils/methodology.py,sha256=YuuKBjr58cu8QWcniU7QVlEM9Cem6wo4IYcq1iwSDMw,13158
132
132
  jarvis/jarvis_utils/output.py,sha256=y2fVcao_2ZowFl0IxUrJZCi8T6ZM0z-iPzpk8T8eLxc,13623
133
133
  jarvis/jarvis_utils/tag.py,sha256=f211opbbbTcSyzCDwuIK_oCnKhXPNK-RknYyGzY1yD0,431
134
- jarvis/jarvis_utils/utils.py,sha256=uMtfaStxDtp2i9AFIxwtPKgSxLwQxw8Z2rXsX-ZGlis,72728
135
- jarvis_ai_assistant-0.4.2.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
136
- jarvis_ai_assistant-0.4.2.dist-info/METADATA,sha256=etNq0w20riwTP8aha2pt_wXBdC6SZHhrjTVeV5K4K38,18751
137
- jarvis_ai_assistant-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
138
- jarvis_ai_assistant-0.4.2.dist-info/entry_points.txt,sha256=4GcWKFxRJD-QU14gw_3ZaW4KuEVxOcZK9i270rwPdjA,1395
139
- jarvis_ai_assistant-0.4.2.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
140
- jarvis_ai_assistant-0.4.2.dist-info/RECORD,,
134
+ jarvis/jarvis_utils/utils.py,sha256=uBWPwVmzM23HUDjnFdEOEsPF50cjJvC7lMvJqXHyjJ0,74276
135
+ jarvis_ai_assistant-0.5.0.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
136
+ jarvis_ai_assistant-0.5.0.dist-info/METADATA,sha256=Y1rxsB9YwcJmuEDvCayrnpUAVx87Nq-yVdjuBWo_g8U,18751
137
+ jarvis_ai_assistant-0.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
138
+ jarvis_ai_assistant-0.5.0.dist-info/entry_points.txt,sha256=4GcWKFxRJD-QU14gw_3ZaW4KuEVxOcZK9i270rwPdjA,1395
139
+ jarvis_ai_assistant-0.5.0.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
140
+ jarvis_ai_assistant-0.5.0.dist-info/RECORD,,