jarvis-ai-assistant 0.1.208__py3-none-any.whl → 0.1.209__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.
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import hashlib
3
+ import json
3
4
  import os
4
5
  import signal
5
6
  import subprocess
@@ -9,35 +10,24 @@ import time
9
10
  from pathlib import Path
10
11
  from typing import Any, Callable, Dict, Optional
11
12
 
12
- import yaml
13
+ import yaml # type: ignore
13
14
 
14
15
  from jarvis import __version__
15
- from jarvis.jarvis_utils.config import (get_data_dir, get_max_big_content_size,
16
- set_global_env_data)
16
+ from jarvis.jarvis_utils.config import (
17
+ get_data_dir,
18
+ get_max_big_content_size,
19
+ set_global_env_data,
20
+ )
17
21
  from jarvis.jarvis_utils.embedding import get_context_token_count
18
- from jarvis.jarvis_utils.globals import (get_in_chat, get_interrupt,
19
- set_interrupt)
22
+ from jarvis.jarvis_utils.globals import get_in_chat, get_interrupt, set_interrupt
20
23
  from jarvis.jarvis_utils.input import get_single_line_input
21
24
  from jarvis.jarvis_utils.output import OutputType, PrettyOutput
22
25
 
23
26
  g_config_file = None
24
27
 
25
28
 
26
- def init_env(welcome_str: str, config_file: Optional[str] = None) -> None:
27
- """初始化环境变量从jarvis_data/env文件
28
- 功能:
29
- 1. 创建不存在的jarvis_data目录
30
- 2. 加载环境变量到os.environ
31
- 3. 处理文件读取异常
32
- 4. 检查git仓库状态并在落后时更新
33
- 5. 统计当前命令使用次数
34
- 6. 注册SIGINT信号处理函数
35
-
36
- 参数:
37
- welcome_str: 欢迎信息字符串
38
- config_file: 配置文件路径,默认为None(使用~/.jarvis/config.yaml)
39
- """
40
- # 保存原始信号处理函数
29
+ def _setup_signal_handler() -> None:
30
+ """设置SIGINT信号处理函数"""
41
31
  original_sigint = signal.getsignal(signal.SIGINT)
42
32
 
43
33
  def sigint_handler(signum, frame):
@@ -50,7 +40,16 @@ def init_env(welcome_str: str, config_file: Optional[str] = None) -> None:
50
40
  original_sigint(signum, frame)
51
41
 
52
42
  signal.signal(signal.SIGINT, sigint_handler)
53
- count_cmd_usage()
43
+
44
+
45
+ def _show_welcome_message(welcome_str: str) -> None:
46
+ """显示欢迎信息
47
+
48
+ 参数:
49
+ welcome_str: 欢迎信息字符串
50
+ """
51
+ if not welcome_str:
52
+ return
54
53
 
55
54
  jarvis_ascii_art = f"""
56
55
  ██╗ █████╗ ██████╗ ██╗ ██╗██╗███████╗
@@ -64,21 +63,16 @@ def init_env(welcome_str: str, config_file: Optional[str] = None) -> None:
64
63
  https://github.com/skyfireitdiy/Jarvis
65
64
  v{__version__}
66
65
  """
67
- if welcome_str:
68
- PrettyOutput.print_gradient_text(jarvis_ascii_art, (0, 120, 255), (0, 255, 200))
66
+ PrettyOutput.print_gradient_text(jarvis_ascii_art, (0, 120, 255), (0, 255, 200))
69
67
 
70
- global g_config_file
71
- g_config_file = config_file
72
68
 
73
- load_config()
74
-
75
- # 现在获取最终的数据目录(可能被配置文件修改)
69
+ def _extract_huggingface_models() -> None:
70
+ """解压HuggingFace模型"""
76
71
  data_dir = Path(get_data_dir())
77
72
  script_dir = Path(os.path.dirname(os.path.dirname(__file__)))
78
73
  hf_archive = script_dir / "jarvis_data" / "huggingface.tar.gz"
79
-
80
- # 检查并解压huggingface模型
81
74
  hf_dir = data_dir / "huggingface" / "hub"
75
+
82
76
  if not hf_dir.exists() and hf_archive.exists():
83
77
  try:
84
78
  PrettyOutput.print("正在解压HuggingFace模型...", OutputType.INFO)
@@ -88,13 +82,47 @@ def init_env(welcome_str: str, config_file: Optional[str] = None) -> None:
88
82
  except Exception as e:
89
83
  PrettyOutput.print(f"解压HuggingFace模型失败: {e}", OutputType.ERROR)
90
84
 
91
- # 检查是否是git仓库并更新
85
+
86
+ def _check_git_updates() -> bool:
87
+ """检查并更新git仓库
88
+
89
+ 返回:
90
+ bool: 是否需要重启进程
91
+ """
92
+ script_dir = Path(os.path.dirname(os.path.dirname(__file__)))
92
93
  from jarvis.jarvis_utils.git_utils import check_and_update_git_repo
93
94
 
94
- if check_and_update_git_repo(str(script_dir)):
95
- # 更新成功,用当前命令行参数启动新进程
95
+ return check_and_update_git_repo(str(script_dir))
96
+
97
+
98
+ def init_env(welcome_str: str, config_file: Optional[str] = None) -> None:
99
+ """初始化Jarvis环境
100
+
101
+ 参数:
102
+ welcome_str: 欢迎信息字符串
103
+ config_file: 配置文件路径,默认为None(使用~/.jarvis/config.yaml)
104
+ """
105
+ # 1. 设置信号处理
106
+ _setup_signal_handler()
107
+
108
+ # 2. 统计命令使用
109
+ count_cmd_usage()
110
+
111
+ # 3. 显示欢迎信息
112
+ if welcome_str:
113
+ _show_welcome_message(welcome_str)
114
+
115
+ # 4. 设置配置文件
116
+ global g_config_file
117
+ g_config_file = config_file
118
+ load_config()
119
+
120
+ # 5. 解压模型
121
+ _extract_huggingface_models()
122
+
123
+ # 6. 检查git更新
124
+ if _check_git_updates():
96
125
  os.execv(sys.executable, [sys.executable] + sys.argv)
97
- # 如果execv失败,退出当前进程
98
126
  sys.exit(0)
99
127
 
100
128
 
@@ -111,47 +139,142 @@ def load_config():
111
139
  old_config_file = config_file_path.parent / "env"
112
140
  if old_config_file.exists(): # 旧的配置文件存在
113
141
  _read_old_config_file(old_config_file)
142
+ else:
143
+ # 生成默认配置文件
144
+ schema_path = (
145
+ Path(__file__).parent.parent / "jarvis_data" / "config_schema.json"
146
+ )
147
+ if schema_path.exists():
148
+ try:
149
+ config_file_path.parent.mkdir(parents=True, exist_ok=True)
150
+ generate_default_config(str(schema_path), str(config_file_path))
151
+ PrettyOutput.print(
152
+ f"已生成默认配置文件: {config_file_path}", OutputType.INFO
153
+ )
154
+ except Exception as e:
155
+ PrettyOutput.print(f"生成默认配置文件失败: {e}", OutputType.ERROR)
114
156
  else:
115
- _read_config_file(config_file_path.parent, config_file_path)
157
+ _load_and_process_config(str(config_file_path.parent), str(config_file_path))
116
158
 
117
159
 
118
- def _read_config_file(jarvis_dir, config_file):
119
- """读取并解析YAML格式的配置文件
160
+ from typing import Tuple
120
161
 
121
- 功能:
122
- 1. 读取配置文件内容
123
- 2. 检查并添加schema声明(如果缺失)
124
- 3. 将配置数据保存到全局变量
125
- 4. 设置环境变量(如果配置中有ENV字段)
162
+
163
+ def _load_config_file(config_file: str) -> Tuple[str, dict]:
164
+ """读取并解析YAML格式的配置文件
126
165
 
127
166
  参数:
128
- jarvis_dir: Jarvis数据目录路径
129
167
  config_file: 配置文件路径
168
+
169
+ 返回:
170
+ Tuple[str, dict]: (文件原始内容, 解析后的配置字典)
130
171
  """
131
172
  with open(config_file, "r", encoding="utf-8") as f:
132
173
  content = f.read()
133
174
  config_data = yaml.safe_load(content) or {}
134
- if isinstance(config_data, dict):
135
- # 检查是否已有schema声明,没有则添加
136
- if "# yaml-language-server: $schema=" not in content:
137
- schema_path = Path(
138
- os.path.relpath(
139
- Path(__file__).parent.parent
140
- / "jarvis_data"
141
- / "config_schema.json",
142
- start=jarvis_dir,
143
- )
144
- )
145
- with open(config_file, "w", encoding="utf-8") as f:
146
- f.write(f"# yaml-language-server: $schema={schema_path}\n")
147
- f.write(content)
148
- # 保存到全局变量
149
- set_global_env_data(config_data)
150
- # 如果配置中有ENV键值对,则设置环境变量
151
- if "ENV" in config_data and isinstance(config_data["ENV"], dict):
152
- os.environ.update(
153
- {str(k): str(v) for k, v in config_data["ENV"].items() if v is not None}
175
+ return content, config_data
176
+
177
+
178
+ def _ensure_schema_declaration(
179
+ jarvis_dir: str, config_file: str, content: str, config_data: dict
180
+ ) -> None:
181
+ """确保配置文件包含schema声明
182
+
183
+ 参数:
184
+ jarvis_dir: Jarvis数据目录路径
185
+ config_file: 配置文件路径
186
+ content: 配置文件原始内容
187
+ config_data: 解析后的配置字典
188
+ """
189
+ if (
190
+ isinstance(config_data, dict)
191
+ and "# yaml-language-server: $schema=" not in content
192
+ ):
193
+ schema_path = Path(
194
+ os.path.relpath(
195
+ Path(__file__).parent.parent / "jarvis_data" / "config_schema.json",
196
+ start=jarvis_dir,
154
197
  )
198
+ )
199
+ with open(config_file, "w", encoding="utf-8") as f:
200
+ f.write(f"# yaml-language-server: $schema={schema_path}\n")
201
+ f.write(content)
202
+
203
+
204
+ def _process_env_variables(config_data: dict) -> None:
205
+ """处理配置中的环境变量
206
+
207
+ 参数:
208
+ config_data: 解析后的配置字典
209
+ """
210
+ if "ENV" in config_data and isinstance(config_data["ENV"], dict):
211
+ os.environ.update(
212
+ {str(k): str(v) for k, v in config_data["ENV"].items() if v is not None}
213
+ )
214
+
215
+
216
+ def _load_and_process_config(jarvis_dir: str, config_file: str) -> None:
217
+ """加载并处理配置文件
218
+
219
+ 功能:
220
+ 1. 读取配置文件
221
+ 2. 确保schema声明存在
222
+ 3. 保存配置到全局变量
223
+ 4. 处理环境变量
224
+
225
+ 参数:
226
+ jarvis_dir: Jarvis数据目录路径
227
+ config_file: 配置文件路径
228
+ """
229
+ content, config_data = _load_config_file(config_file)
230
+ _ensure_schema_declaration(jarvis_dir, config_file, content, config_data)
231
+ set_global_env_data(config_data)
232
+ _process_env_variables(config_data)
233
+
234
+
235
+ def generate_default_config(schema_path: str, output_path: str) -> None:
236
+ """从schema文件生成默认的YAML格式配置文件
237
+
238
+ 功能:
239
+ 1. 从schema文件读取配置结构
240
+ 2. 根据schema中的default值生成默认配置
241
+ 3. 自动添加schema声明
242
+ 4. 处理嵌套的schema结构
243
+ 5. 保留注释和格式
244
+
245
+ 参数:
246
+ schema_path: schema文件路径
247
+ output_path: 生成的配置文件路径
248
+ """
249
+ with open(schema_path, "r", encoding="utf-8") as f:
250
+ schema = json.load(f)
251
+
252
+ def _generate_from_schema(schema_dict: Dict[str, Any]) -> Dict[str, Any]:
253
+ config = {}
254
+ if "properties" in schema_dict:
255
+ for key, value in schema_dict["properties"].items():
256
+ if "default" in value:
257
+ config[key] = value["default"]
258
+ elif "properties" in value: # 处理嵌套对象
259
+ config[key] = _generate_from_schema(value)
260
+ elif value.get("type") == "array": # 处理列表类型
261
+ config[key] = []
262
+ return config
263
+
264
+ default_config = _generate_from_schema(schema)
265
+
266
+ # 添加schema声明
267
+ rel_schema_path = Path(
268
+ os.path.relpath(
269
+ Path(schema_path),
270
+ start=Path(output_path).parent,
271
+ )
272
+ )
273
+ content = f"# yaml-language-server: $schema={rel_schema_path}\n"
274
+ content += yaml.dump(default_config, allow_unicode=True, sort_keys=False)
275
+
276
+ with open(output_path, "w", encoding="utf-8") as f:
277
+ f.write(content)
155
278
 
156
279
 
157
280
  def _read_old_config_file(config_file):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.208
3
+ Version: 0.1.209
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
@@ -48,13 +48,13 @@ Requires-Dist: fuzzywuzzy==0.18.0
48
48
  Requires-Dist: fastapi==0.115.12
49
49
  Requires-Dist: uvicorn==0.33.0
50
50
  Requires-Dist: rich==14.0.0
51
- Requires-Dist: transformers==4.46.3
52
- Requires-Dist: torch==2.4.1
53
51
  Requires-Dist: python-Levenshtein==0.25.1
52
+ Requires-Dist: tiktoken==0.7.0
54
53
  Requires-Dist: pillow==10.2.0
55
54
  Requires-Dist: openai==1.78.1
56
55
  Requires-Dist: tabulate==0.9.0
57
56
  Requires-Dist: pyte==0.8.2
57
+ Requires-Dist: pyyaml>=6.0.2
58
58
  Provides-Extra: dev
59
59
  Requires-Dist: pytest; extra == "dev"
60
60
  Requires-Dist: black; extra == "dev"
@@ -105,7 +105,7 @@ pip3 install jarvis-ai-assistant
105
105
  | `jarvis` | - | 使用通用代理 |
106
106
  | `jarvis-code-agent` | `jca` | 使用代码代理 |
107
107
  | `jarvis-smart-shell` | `jss` | 使用智能shell功能 |
108
- | `jarvis-platform-manager` | - | 使用平台管理功能 |
108
+ | `jarvis-platform-manager` | `jpm` | 使用平台管理功能 |
109
109
  | `jarvis-code-review` | - | 使用代码审查功能 |
110
110
  | `jarvis-git-commit` | `jgc` | 使用自动化git commit功能 |
111
111
  | `jarvis-git-squash` | - | 使用git squash功能 |
@@ -481,7 +481,6 @@ JARVIS_THINKING_PLATFORM: yuanbao
481
481
  JARVIS_THINKING_MODEL: deep_seek
482
482
  ENV:
483
483
  YUANBAO_COOKIES: <元宝cookies>
484
- YUANBAO_AGENT_ID: <元宝AgentID>
485
484
  ```
486
485
 
487
486
  #### Kimi
@@ -520,23 +519,18 @@ OPENAI_API_BASE: https://api.openai.com/v1
520
519
  | `ENV` | {} | 环境变量配置 |
521
520
  | `JARVIS_MAX_TOKEN_COUNT` | 960000 | 上下文窗口的最大token数量 |
522
521
  | `JARVIS_MAX_INPUT_TOKEN_COUNT` | 32000 | 输入的最大token数量 |
523
- | `JARVIS_AUTO_COMPLETE` | false | 是否启用自动完成功能 |
524
- | `JARVIS_SHELL_NAME` | bash | 系统shell名称 |
525
522
  | `JARVIS_PLATFORM` | yuanbao | 默认AI平台 |
526
523
  | `JARVIS_MODEL` | deep_seek_v3 | 默认模型 |
527
524
  | `JARVIS_THINKING_PLATFORM` | JARVIS_PLATFORM | 推理任务使用的平台 |
528
525
  | `JARVIS_THINKING_MODEL` | JARVIS_MODEL | 推理任务使用的模型 |
529
526
  | `JARVIS_EXECUTE_TOOL_CONFIRM` | false | 执行工具前是否需要确认 |
530
527
  | `JARVIS_CONFIRM_BEFORE_APPLY_PATCH` | false | 应用补丁前是否需要确认 |
531
- | `JARVIS_MAX_TOOL_CALL_COUNT` | 20 | 最大连续工具调用次数 |
532
- | `JARVIS_AUTO_UPDATE` | true | 是否自动更新Jarvis |
533
528
  | `JARVIS_MAX_BIG_CONTENT_SIZE` | 160000 | 最大大内容大小 |
534
529
  | `JARVIS_PRETTY_OUTPUT` | false | 是否启用PrettyOutput |
535
530
  | `JARVIS_GIT_COMMIT_PROMPT` | "" | 自定义git提交信息生成提示模板 |
536
531
  | `JARVIS_PRINT_PROMPT` | false | 是否打印提示 |
537
532
  | `JARVIS_USE_METHODOLOGY` | true | 是否启用方法论功能 |
538
533
  | `JARVIS_USE_ANALYSIS` | true | 是否启用任务分析功能 |
539
- | `JARVIS_USE_HISTORY_COUNT` | 0 | 使用N次历史记录作为上下文记忆 |
540
534
  | `JARVIS_DATA_PATH` | ~/.jarvis | Jarvis数据存储目录路径 |
541
535
 
542
536
  ## 🛠️ 工具说明 <a id="tools"></a>
@@ -1,14 +1,14 @@
1
- jarvis/__init__.py,sha256=FAIfy2t0IBQkJtxQGhREIntdSAHe5tKP5LwkTg-8Pso,75
2
- jarvis/jarvis_agent/__init__.py,sha256=kHQt-QiJbU2FRjEwqxIfUyFkRXjQu0WSXCkpbLNr-Vg,33750
1
+ jarvis/__init__.py,sha256=yUlynCkPny2V_9ul8_tYp1Mbse_jgWi-BYgoIA0o6Vs,75
2
+ jarvis/jarvis_agent/__init__.py,sha256=QbI5vkourPJZ2OR63RBZAtFptTYrZz_si8bIkc9EB2o,31709
3
3
  jarvis/jarvis_agent/builtin_input_handler.py,sha256=1V7kV5Zhw2HE3Xgjs1R-43RZ2huq3Kg-32NCdNnyZmA,2216
4
- jarvis/jarvis_agent/edit_file_handler.py,sha256=PLjwg5_taSdsbb9eQ6U_M5kaFvLamhDIgMuEJtXca3o,16761
4
+ jarvis/jarvis_agent/edit_file_handler.py,sha256=bIciBghx5maDz09x0XNTxdNsyrBbTND95GupVdJIVVg,16762
5
5
  jarvis/jarvis_agent/jarvis.py,sha256=tTv9X1oSRDGRmNkM1F3RNN6ikFbc_PkRBIbZIffbA_8,5802
6
6
  jarvis/jarvis_agent/main.py,sha256=c6bQe-8LXvW2-NBn9Rn_yPYdrwnkJ8KQaSFY2cPvkxw,2775
7
7
  jarvis/jarvis_agent/output_handler.py,sha256=P7oWpXBGFfOsWq7cIhS_z9crkQ19ES7qU5pM92KKjAs,1172
8
8
  jarvis/jarvis_agent/shell_input_handler.py,sha256=zVaKNthIHJh1j4g8_-d3w5ahNH9aH-ZNRSOourQpHR4,1328
9
9
  jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- jarvis/jarvis_code_agent/code_agent.py,sha256=gcwsFCnX43bEQ0UYOSnmF5TvxPlzpIRb2UvY4N-iEW8,16105
11
- jarvis/jarvis_code_agent/lint.py,sha256=GnmnW-lXPHmLsiSWWxonSWw1JDqO7UCRFVT3QJOsc6Y,3993
10
+ jarvis/jarvis_code_agent/code_agent.py,sha256=u0R2TWdmpiHu7pjh65kKpIK4dgDEuZpBdZyrSkE32wg,17846
11
+ jarvis/jarvis_code_agent/lint.py,sha256=LZPsfyZPMo7Wm7LN4osZocuNJwZx1ojacO3MlF870x8,4009
12
12
  jarvis/jarvis_code_analysis/code_review.py,sha256=uCCbGd4Y1RjDzhZoVE8JdN2avlwOfqimSDIrcM-KMew,30456
13
13
  jarvis/jarvis_code_analysis/checklists/__init__.py,sha256=LIXAYa1sW3l7foP6kohLWnE98I_EQ0T7z5bYKHq6rJA,78
14
14
  jarvis/jarvis_code_analysis/checklists/c_cpp.py,sha256=9t62bMqs6qTkFSio4SKkj88qyb5ZubWrw3MxJBQ4X1A,1317
@@ -30,13 +30,12 @@ jarvis/jarvis_code_analysis/checklists/shell.py,sha256=aRFYhQQvTgbYd-uY5pc8UHIUA
30
30
  jarvis/jarvis_code_analysis/checklists/sql.py,sha256=vR0T6qC7b4dURjJVAd7kSVxyvZEQXPG1Jqc2sNTGp5c,2355
31
31
  jarvis/jarvis_code_analysis/checklists/swift.py,sha256=TPx4I6Gupvs6tSerRKmTSKEPQpOLEbH2Y7LXg1uBgxc,2566
32
32
  jarvis/jarvis_code_analysis/checklists/web.py,sha256=25gGD7pDadZQybNFvALYxWvK0VRjGQb1NVJQElwjyk0,3943
33
- jarvis/jarvis_data/config_schema.json,sha256=3lTOxxikuLNsy5wHgaYY3bBQHorTclWewHr4GXVtVBw,6534
34
- jarvis/jarvis_data/huggingface.tar.gz,sha256=dWKnc_tvyx-I_ZkXo91O0b38KxDmLW1ZbmJ3E6fCl_k,1120205
33
+ jarvis/jarvis_data/config_schema.json,sha256=BeaihTD2eYRZq65-tbmCIx7lBdS5U0V1FOQGIc6XCq0,5849
35
34
  jarvis/jarvis_git_details/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
35
  jarvis/jarvis_git_details/main.py,sha256=MjpUHB4ErR_SKPBx1TLLK_XLkH427RTtsyVn6EUd88Y,8907
37
36
  jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
37
  jarvis/jarvis_git_squash/main.py,sha256=lx0WVOiaydYgwzWBDG7C8wJxYJwSb1SIxyoD-rgzgvA,2274
39
- jarvis/jarvis_git_utils/git_commiter.py,sha256=HVGzCDY4r2yi_hoPQ15mPzr_ualfezl9EQCZ5xurzKs,12458
38
+ jarvis/jarvis_git_utils/git_commiter.py,sha256=erZ3wNJuaEgHlKTaYv0UKargG_Yl9OnssTIcErEAdtw,12472
40
39
  jarvis/jarvis_mcp/__init__.py,sha256=OPMtjD-uq9xAaKCRIDyKIosaFfBe1GBPu1az-mQ0rVM,2048
41
40
  jarvis/jarvis_mcp/sse_mcp_client.py,sha256=-3Qy1LyqgHswoc6YbadVRG3ias2op7lUp7Ne2-QUKBM,22474
42
41
  jarvis/jarvis_mcp/stdio_mcp_client.py,sha256=armvgyHAv-AxF5lqiK-TbVLzg3XgSCwmTdWmxBSTLRk,11248
@@ -47,22 +46,22 @@ jarvis/jarvis_multi_agent/main.py,sha256=h7VUSwoPrES0XTK8z5kt3XLX1mmcm8UEuFEHQOU
47
46
  jarvis/jarvis_platform/__init__.py,sha256=WLQHSiE87PPket2M50_hHzjdMIgPIBx2VF8JfB_NNRk,105
48
47
  jarvis/jarvis_platform/base.py,sha256=xN0DGYs03eS-wSQk4JgBOzFl0kvDAmqnssUU59EOXU8,7775
49
48
  jarvis/jarvis_platform/human.py,sha256=r8Vlltp_LirJZeZh1Mmi30iJr9tl1JaNFoqthSRHF6o,2826
50
- jarvis/jarvis_platform/kimi.py,sha256=OIsVZW-NjfOlwg3PWvn0wtQ3iySx-_nvzsw_FUIo_lg,12093
49
+ jarvis/jarvis_platform/kimi.py,sha256=W5MKkH6rxS5JeNY3VZY0EOT9ugeZJqr_eHO9wd9cEW4,12444
51
50
  jarvis/jarvis_platform/openai.py,sha256=uEjBikfFj7kp5wondLvOx4WdkmTX0aqF6kixxAufcHg,4806
52
51
  jarvis/jarvis_platform/registry.py,sha256=Sz4ADAaxuufpAQG0KSQZuL1yALzH-aF3FDapkNn5foE,8107
53
- jarvis/jarvis_platform/tongyi.py,sha256=7BcIXhoFI5qu_MBmx2XVPeohJy6_WG7d7rZ49wJV6M4,20060
54
- jarvis/jarvis_platform/yuanbao.py,sha256=RjQpmjLN6TRu9HtBKtuj7DDhu-_ekWJL3Aq0VN9TEfM,20723
52
+ jarvis/jarvis_platform/tongyi.py,sha256=0pKBVAxBAGXHFLRG7C7gSTU7RQuK6IyElOjrhjCxRM8,20238
53
+ jarvis/jarvis_platform/yuanbao.py,sha256=0RojrUwoQBLR9a_yOGmzY7pHqe032dMBQqdbMLpakvc,20688
55
54
  jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
55
  jarvis/jarvis_platform_manager/main.py,sha256=Jm1ijKGZrSYo1HrgJ1R4JQZwPwiOIfDFYSVJXKPklPU,15585
57
56
  jarvis/jarvis_platform_manager/service.py,sha256=rY1FmNl-tmbkkke_3SlH9h6ckyPIgmSwbaRorURp9Cc,14916
58
57
  jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
58
  jarvis/jarvis_smart_shell/main.py,sha256=DbhRSP1sZfSIaTltP1YWVDSQOTYEsbiOnfO9kSYwcNs,6959
60
59
  jarvis/jarvis_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
- jarvis/jarvis_tools/ask_user.py,sha256=w_l9WQK6uhyGGXqtyTsSyiHLNjNfIgzUvOAevjuay-0,2014
60
+ jarvis/jarvis_tools/ask_user.py,sha256=iz2PTGx66IRL8e4DOpj3XhEGHFWeKQl0ggEOl_zOwQ0,1972
62
61
  jarvis/jarvis_tools/base.py,sha256=tFVmK6ppsImW2BzHZmrNmMRiOJdW-4aZP6Me3VxdYcA,1194
63
62
  jarvis/jarvis_tools/edit_file.py,sha256=Hvqc5YyrwzlEbUT1CsarlKKaPj852970jszKjS5YMPE,11757
64
63
  jarvis/jarvis_tools/execute_script.py,sha256=gMarE5yCCSPU6Dp6HlcL2KT-2xCzR-1p-oQNlYOJK58,6157
65
- jarvis/jarvis_tools/file_analyzer.py,sha256=KLH27etE5VVCVrlseXb6mUaAUj6-jMJ1Iu69Co1fDHY,4121
64
+ jarvis/jarvis_tools/file_analyzer.py,sha256=aVe1jBSp0YmlypihxrGADJpYrU_7CxDETxGUNySuSlI,4044
66
65
  jarvis/jarvis_tools/generate_new_tool.py,sha256=2YAs8DC7fJnxOkjSmhmSAwqSpBlicVhYc06WZ8YVBls,7679
67
66
  jarvis/jarvis_tools/methodology.py,sha256=_K4GIDUodGEma3SvNRo7Qs5rliijgNespVLyAPN35JU,5233
68
67
  jarvis/jarvis_tools/read_code.py,sha256=EnI-R-5HyIQYhMD391nZWXHIuHHBF-OJIRE0QpLcPX4,6417
@@ -75,20 +74,20 @@ jarvis/jarvis_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
75
74
  jarvis/jarvis_tools/cli/main.py,sha256=Mg6TQDxMdzB1Ua1UrZ2EE-uQWsbaeojWaEGHJp2HimA,6375
76
75
  jarvis/jarvis_utils/__init__.py,sha256=67h0ldisGlh3oK4DAeNEL2Bl_VsI3tSmfclasyVlueM,850
77
76
  jarvis/jarvis_utils/builtin_replace_map.py,sha256=EI8JnHqr-ZpAhpwocTu48DhHUMHNd8tNUpDNYI47OLE,1717
78
- jarvis/jarvis_utils/config.py,sha256=2bM_RrzF4vlf73m4WBRZCzGVMmpbIBWnz-hmlMG4fBk,7733
79
- jarvis/jarvis_utils/embedding.py,sha256=suqKOgH4cq2HYj4xvNpqDPN9pyc3hTCl934xYonF6qk,3922
77
+ jarvis/jarvis_utils/config.py,sha256=MO2-1z_7f3KkSrv7heGK1650Zb0SjnljO2hzLE2jA5c,6598
78
+ jarvis/jarvis_utils/embedding.py,sha256=nOe_jvn8pr4env83D9gNCBcId8LaUsvQxa8awLP1_2Y,2437
80
79
  jarvis/jarvis_utils/file_processors.py,sha256=XiM248SHS7lLgQDCbORVFWqinbVDUawYxWDOsLXDxP8,3043
81
- jarvis/jarvis_utils/git_utils.py,sha256=Ic31xVava4hQUwTBY98V8EBS2YDlb5PZQ9oXDAwtDu8,18865
80
+ jarvis/jarvis_utils/git_utils.py,sha256=7cxvg1qATFwRVtgzivdvc31KfZ38n_nl9_z35iXUYQU,20891
82
81
  jarvis/jarvis_utils/globals.py,sha256=9NTMfCVd0jvtloOv14-KE6clhcVStFmyN9jWxLmQ5so,3369
82
+ jarvis/jarvis_utils/http.py,sha256=8N9MvoRhIFsRBIMf2lKzp2BStdAhSFoKFc6q4NwQDZw,2930
83
83
  jarvis/jarvis_utils/input.py,sha256=ehvHkIgwqnBOHkwOeRCBFRggqOgOZuUdGQXn2ATUFwU,8049
84
- jarvis/jarvis_utils/jarvis_history.py,sha256=Td6cmze9Oc5-Ewz0l9RKYeSg_-fbEu9ZhyEueHEMcLY,3664
85
84
  jarvis/jarvis_utils/methodology.py,sha256=-cvM6pwgJK7BXCYg2uVjIId_j3v5RUh2z2PBcK_2vj4,8155
86
85
  jarvis/jarvis_utils/output.py,sha256=PRCgudPOB8gMEP3u-g0FGD2c6tBgJhLXUMqNPglfjV8,10813
87
86
  jarvis/jarvis_utils/tag.py,sha256=f211opbbbTcSyzCDwuIK_oCnKhXPNK-RknYyGzY1yD0,431
88
- jarvis/jarvis_utils/utils.py,sha256=RYFQx7OkOu3fe_QhS-5jx7O06k_58X14S-9PFJgwOa4,12178
89
- jarvis_ai_assistant-0.1.208.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
90
- jarvis_ai_assistant-0.1.208.dist-info/METADATA,sha256=xHpmaO1wyHXDT-4FgRYguvnSJH2pFX1oRR3Ktmty3kU,19901
91
- jarvis_ai_assistant-0.1.208.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
92
- jarvis_ai_assistant-0.1.208.dist-info/entry_points.txt,sha256=PdnaijUoYpIBaqSxLOs1hoY6X3NlD0Kw8Mn2p5a2Qek,828
93
- jarvis_ai_assistant-0.1.208.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
94
- jarvis_ai_assistant-0.1.208.dist-info/RECORD,,
87
+ jarvis/jarvis_utils/utils.py,sha256=zgkdtpQ6kN86pzYi0iBBa3IUJp_GMrm31RKh5V_6Vzg,15306
88
+ jarvis_ai_assistant-0.1.209.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
89
+ jarvis_ai_assistant-0.1.209.dist-info/METADATA,sha256=ozb5hyQCDJzR9_SFioQqoT-G5oTpRcyw2dUF_Au_gU8,19535
90
+ jarvis_ai_assistant-0.1.209.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
+ jarvis_ai_assistant-0.1.209.dist-info/entry_points.txt,sha256=SF46ViTZcQVZEfbqzJDKKVc9TrN1x-P1mQ6wup7u2HY,875
92
+ jarvis_ai_assistant-0.1.209.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
93
+ jarvis_ai_assistant-0.1.209.dist-info/RECORD,,
@@ -13,4 +13,5 @@ jarvis-smart-shell = jarvis.jarvis_smart_shell.main:main
13
13
  jarvis-tool = jarvis.jarvis_tools.cli.main:main
14
14
  jca = jarvis.jarvis_code_agent.code_agent:main
15
15
  jgc = jarvis.jarvis_git_utils.git_commiter:main
16
+ jpm = jarvis.jarvis_platform_manager.main:main
16
17
  jss = jarvis.jarvis_smart_shell.main:main
Binary file
@@ -1,98 +0,0 @@
1
- import glob
2
- import os
3
- from datetime import datetime
4
- from typing import Dict, List, Optional, Union
5
-
6
- import yaml
7
-
8
-
9
- class JarvisHistory:
10
- def __init__(self):
11
- self.records: List[Dict[str, str]] = []
12
- self.current_file: Optional[str] = None
13
-
14
- def start_record(self, data_dir: str) -> None:
15
- """Start a new recording session with timestamped filename"""
16
- timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
17
- self.current_file = os.path.join(data_dir, f"history_{timestamp}.yaml")
18
- self.records = []
19
-
20
- def append_msg(self, role: str, msg: str) -> None:
21
- """Append a message to current recording session"""
22
- if not self.current_file:
23
- raise RuntimeError("Recording not started. Call start_record first.")
24
- self.records.append({"role": role, "message": msg})
25
-
26
- def save_history(self, filename: str) -> None:
27
- """Save recorded messages to YAML file"""
28
-
29
- # Skip saving if records is empty
30
- if not self.records:
31
- return
32
-
33
- # Ensure directory exists
34
- os.makedirs(os.path.dirname(filename), exist_ok=True)
35
-
36
- with open(filename, "w") as f:
37
- yaml.safe_dump({"conversation": self.records}, f, allow_unicode=True)
38
-
39
- def stop_record(self) -> None:
40
- """Stop recording session and save messages"""
41
- if not self.current_file:
42
- raise RuntimeError("No recording session to stop.")
43
-
44
- self.save_history(self.current_file)
45
- self.current_file = None
46
- self.records = []
47
-
48
- @staticmethod
49
- def export_history_to_markdown(
50
- input_dir: str, output_file: str, max_files: Optional[int] = None
51
- ) -> None:
52
- """
53
- Export all history files in the directory to a single markdown file
54
-
55
- Args:
56
- input_dir: Directory containing history YAML files
57
- output_file: Path to output markdown file
58
- max_files: Maximum number of history files to export (None for all)
59
- """
60
- # Find all history files in the directory
61
- history_files = glob.glob(os.path.join(input_dir, "history_*.yaml"))
62
-
63
- if not history_files:
64
- raise FileNotFoundError(f"No history files found in {input_dir}")
65
-
66
- # Sort files by modification time (newest first) and limit to max_files
67
- history_files.sort(key=os.path.getmtime, reverse=True)
68
- if max_files is not None:
69
- history_files = history_files[:max_files]
70
-
71
- # Ensure output directory exists
72
- os.makedirs(os.path.dirname(output_file), exist_ok=True)
73
-
74
- with open(output_file, "w", encoding="utf-8") as md_file:
75
- md_file.write("# Jarvis Conversation History\n\n")
76
-
77
- for history_file in sorted(history_files):
78
- # Read YAML file
79
- with open(history_file, "r", encoding="utf-8") as f:
80
- data = yaml.safe_load(f)
81
-
82
- if not data or "conversation" not in data:
83
- continue
84
-
85
- # Write file header with timestamp from filename
86
- timestamp = os.path.basename(history_file)[
87
- 8:-5
88
- ] # Extract timestamp from "history_YYYYMMDD_HHMMSS.yaml"
89
- md_file.write(
90
- f"## Conversation at {timestamp[:4]}-{timestamp[4:6]}-{timestamp[6:8]} "
91
- f"{timestamp[9:11]}:{timestamp[11:13]}:{timestamp[13:15]}\n\n"
92
- )
93
-
94
- # Write conversation messages
95
- for msg in data["conversation"]:
96
- md_file.write(f"**{msg['role']}**: {msg['message']}\n\n")
97
-
98
- md_file.write("\n---\n\n")