jarvis-ai-assistant 0.7.0__py3-none-any.whl → 0.7.6__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 (159) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/jarvis_agent/__init__.py +243 -139
  3. jarvis/jarvis_agent/agent_manager.py +5 -10
  4. jarvis/jarvis_agent/builtin_input_handler.py +2 -6
  5. jarvis/jarvis_agent/config_editor.py +2 -7
  6. jarvis/jarvis_agent/event_bus.py +82 -12
  7. jarvis/jarvis_agent/file_context_handler.py +265 -15
  8. jarvis/jarvis_agent/file_methodology_manager.py +3 -4
  9. jarvis/jarvis_agent/jarvis.py +113 -98
  10. jarvis/jarvis_agent/language_extractors/__init__.py +57 -0
  11. jarvis/jarvis_agent/language_extractors/c_extractor.py +21 -0
  12. jarvis/jarvis_agent/language_extractors/cpp_extractor.py +21 -0
  13. jarvis/jarvis_agent/language_extractors/go_extractor.py +21 -0
  14. jarvis/jarvis_agent/language_extractors/java_extractor.py +84 -0
  15. jarvis/jarvis_agent/language_extractors/javascript_extractor.py +79 -0
  16. jarvis/jarvis_agent/language_extractors/python_extractor.py +21 -0
  17. jarvis/jarvis_agent/language_extractors/rust_extractor.py +21 -0
  18. jarvis/jarvis_agent/language_extractors/typescript_extractor.py +84 -0
  19. jarvis/jarvis_agent/language_support_info.py +486 -0
  20. jarvis/jarvis_agent/main.py +6 -12
  21. jarvis/jarvis_agent/memory_manager.py +7 -16
  22. jarvis/jarvis_agent/methodology_share_manager.py +10 -16
  23. jarvis/jarvis_agent/prompt_manager.py +1 -1
  24. jarvis/jarvis_agent/prompts.py +193 -171
  25. jarvis/jarvis_agent/protocols.py +8 -12
  26. jarvis/jarvis_agent/run_loop.py +77 -14
  27. jarvis/jarvis_agent/session_manager.py +2 -3
  28. jarvis/jarvis_agent/share_manager.py +12 -21
  29. jarvis/jarvis_agent/shell_input_handler.py +1 -2
  30. jarvis/jarvis_agent/task_analyzer.py +26 -4
  31. jarvis/jarvis_agent/task_manager.py +11 -27
  32. jarvis/jarvis_agent/tool_executor.py +2 -3
  33. jarvis/jarvis_agent/tool_share_manager.py +12 -24
  34. jarvis/jarvis_agent/web_server.py +55 -20
  35. jarvis/jarvis_c2rust/__init__.py +5 -5
  36. jarvis/jarvis_c2rust/cli.py +461 -499
  37. jarvis/jarvis_c2rust/collector.py +45 -53
  38. jarvis/jarvis_c2rust/constants.py +26 -0
  39. jarvis/jarvis_c2rust/library_replacer.py +264 -132
  40. jarvis/jarvis_c2rust/llm_module_agent.py +162 -190
  41. jarvis/jarvis_c2rust/loaders.py +207 -0
  42. jarvis/jarvis_c2rust/models.py +28 -0
  43. jarvis/jarvis_c2rust/optimizer.py +1592 -395
  44. jarvis/jarvis_c2rust/transpiler.py +1722 -1064
  45. jarvis/jarvis_c2rust/utils.py +385 -0
  46. jarvis/jarvis_code_agent/build_validation_config.py +2 -3
  47. jarvis/jarvis_code_agent/code_agent.py +394 -320
  48. jarvis/jarvis_code_agent/code_analyzer/__init__.py +3 -0
  49. jarvis/jarvis_code_agent/code_analyzer/build_validator/base.py +4 -0
  50. jarvis/jarvis_code_agent/code_analyzer/build_validator/cmake.py +17 -2
  51. jarvis/jarvis_code_agent/code_analyzer/build_validator/fallback.py +3 -0
  52. jarvis/jarvis_code_agent/code_analyzer/build_validator/go.py +36 -4
  53. jarvis/jarvis_code_agent/code_analyzer/build_validator/java_gradle.py +9 -0
  54. jarvis/jarvis_code_agent/code_analyzer/build_validator/java_maven.py +9 -0
  55. jarvis/jarvis_code_agent/code_analyzer/build_validator/makefile.py +12 -1
  56. jarvis/jarvis_code_agent/code_analyzer/build_validator/nodejs.py +22 -5
  57. jarvis/jarvis_code_agent/code_analyzer/build_validator/python.py +57 -32
  58. jarvis/jarvis_code_agent/code_analyzer/build_validator/rust.py +62 -6
  59. jarvis/jarvis_code_agent/code_analyzer/build_validator/validator.py +8 -9
  60. jarvis/jarvis_code_agent/code_analyzer/context_manager.py +290 -5
  61. jarvis/jarvis_code_agent/code_analyzer/language_support.py +21 -0
  62. jarvis/jarvis_code_agent/code_analyzer/languages/__init__.py +21 -3
  63. jarvis/jarvis_code_agent/code_analyzer/languages/c_cpp_language.py +72 -4
  64. jarvis/jarvis_code_agent/code_analyzer/languages/go_language.py +35 -3
  65. jarvis/jarvis_code_agent/code_analyzer/languages/java_language.py +212 -0
  66. jarvis/jarvis_code_agent/code_analyzer/languages/javascript_language.py +254 -0
  67. jarvis/jarvis_code_agent/code_analyzer/languages/python_language.py +52 -2
  68. jarvis/jarvis_code_agent/code_analyzer/languages/rust_language.py +73 -1
  69. jarvis/jarvis_code_agent/code_analyzer/languages/typescript_language.py +280 -0
  70. jarvis/jarvis_code_agent/code_analyzer/llm_context_recommender.py +306 -152
  71. jarvis/jarvis_code_agent/code_analyzer/structured_code.py +556 -0
  72. jarvis/jarvis_code_agent/code_analyzer/symbol_extractor.py +193 -18
  73. jarvis/jarvis_code_agent/code_analyzer/tree_sitter_extractor.py +18 -8
  74. jarvis/jarvis_code_agent/lint.py +258 -27
  75. jarvis/jarvis_code_agent/utils.py +0 -1
  76. jarvis/jarvis_code_analysis/code_review.py +19 -24
  77. jarvis/jarvis_data/config_schema.json +53 -26
  78. jarvis/jarvis_git_squash/main.py +4 -5
  79. jarvis/jarvis_git_utils/git_commiter.py +44 -49
  80. jarvis/jarvis_mcp/sse_mcp_client.py +20 -27
  81. jarvis/jarvis_mcp/stdio_mcp_client.py +11 -12
  82. jarvis/jarvis_mcp/streamable_mcp_client.py +15 -14
  83. jarvis/jarvis_memory_organizer/memory_organizer.py +55 -74
  84. jarvis/jarvis_methodology/main.py +32 -48
  85. jarvis/jarvis_multi_agent/__init__.py +79 -61
  86. jarvis/jarvis_multi_agent/main.py +3 -7
  87. jarvis/jarvis_platform/base.py +469 -199
  88. jarvis/jarvis_platform/human.py +7 -8
  89. jarvis/jarvis_platform/kimi.py +30 -36
  90. jarvis/jarvis_platform/openai.py +65 -27
  91. jarvis/jarvis_platform/registry.py +26 -10
  92. jarvis/jarvis_platform/tongyi.py +24 -25
  93. jarvis/jarvis_platform/yuanbao.py +31 -42
  94. jarvis/jarvis_platform_manager/main.py +66 -77
  95. jarvis/jarvis_platform_manager/service.py +8 -13
  96. jarvis/jarvis_rag/cli.py +49 -51
  97. jarvis/jarvis_rag/embedding_manager.py +13 -18
  98. jarvis/jarvis_rag/llm_interface.py +8 -9
  99. jarvis/jarvis_rag/query_rewriter.py +10 -21
  100. jarvis/jarvis_rag/rag_pipeline.py +24 -27
  101. jarvis/jarvis_rag/reranker.py +4 -5
  102. jarvis/jarvis_rag/retriever.py +28 -30
  103. jarvis/jarvis_sec/__init__.py +220 -3520
  104. jarvis/jarvis_sec/agents.py +143 -0
  105. jarvis/jarvis_sec/analysis.py +276 -0
  106. jarvis/jarvis_sec/cli.py +29 -6
  107. jarvis/jarvis_sec/clustering.py +1439 -0
  108. jarvis/jarvis_sec/file_manager.py +427 -0
  109. jarvis/jarvis_sec/parsers.py +73 -0
  110. jarvis/jarvis_sec/prompts.py +268 -0
  111. jarvis/jarvis_sec/report.py +83 -4
  112. jarvis/jarvis_sec/review.py +453 -0
  113. jarvis/jarvis_sec/utils.py +499 -0
  114. jarvis/jarvis_sec/verification.py +848 -0
  115. jarvis/jarvis_sec/workflow.py +7 -0
  116. jarvis/jarvis_smart_shell/main.py +38 -87
  117. jarvis/jarvis_stats/cli.py +1 -1
  118. jarvis/jarvis_stats/stats.py +7 -7
  119. jarvis/jarvis_stats/storage.py +15 -21
  120. jarvis/jarvis_tools/clear_memory.py +3 -20
  121. jarvis/jarvis_tools/cli/main.py +20 -23
  122. jarvis/jarvis_tools/edit_file.py +1066 -0
  123. jarvis/jarvis_tools/execute_script.py +42 -21
  124. jarvis/jarvis_tools/file_analyzer.py +6 -9
  125. jarvis/jarvis_tools/generate_new_tool.py +11 -20
  126. jarvis/jarvis_tools/lsp_client.py +1552 -0
  127. jarvis/jarvis_tools/methodology.py +2 -3
  128. jarvis/jarvis_tools/read_code.py +1525 -87
  129. jarvis/jarvis_tools/read_symbols.py +2 -3
  130. jarvis/jarvis_tools/read_webpage.py +7 -10
  131. jarvis/jarvis_tools/registry.py +370 -181
  132. jarvis/jarvis_tools/retrieve_memory.py +20 -19
  133. jarvis/jarvis_tools/rewrite_file.py +105 -0
  134. jarvis/jarvis_tools/save_memory.py +3 -15
  135. jarvis/jarvis_tools/search_web.py +3 -7
  136. jarvis/jarvis_tools/sub_agent.py +17 -6
  137. jarvis/jarvis_tools/sub_code_agent.py +14 -16
  138. jarvis/jarvis_tools/virtual_tty.py +54 -32
  139. jarvis/jarvis_utils/clipboard.py +7 -10
  140. jarvis/jarvis_utils/config.py +98 -63
  141. jarvis/jarvis_utils/embedding.py +5 -5
  142. jarvis/jarvis_utils/fzf.py +8 -8
  143. jarvis/jarvis_utils/git_utils.py +81 -67
  144. jarvis/jarvis_utils/input.py +24 -49
  145. jarvis/jarvis_utils/jsonnet_compat.py +465 -0
  146. jarvis/jarvis_utils/methodology.py +33 -35
  147. jarvis/jarvis_utils/utils.py +245 -202
  148. {jarvis_ai_assistant-0.7.0.dist-info → jarvis_ai_assistant-0.7.6.dist-info}/METADATA +205 -70
  149. jarvis_ai_assistant-0.7.6.dist-info/RECORD +218 -0
  150. jarvis/jarvis_agent/edit_file_handler.py +0 -584
  151. jarvis/jarvis_agent/rewrite_file_handler.py +0 -141
  152. jarvis/jarvis_agent/task_planner.py +0 -496
  153. jarvis/jarvis_platform/ai8.py +0 -332
  154. jarvis/jarvis_tools/ask_user.py +0 -54
  155. jarvis_ai_assistant-0.7.0.dist-info/RECORD +0 -192
  156. {jarvis_ai_assistant-0.7.0.dist-info → jarvis_ai_assistant-0.7.6.dist-info}/WHEEL +0 -0
  157. {jarvis_ai_assistant-0.7.0.dist-info → jarvis_ai_assistant-0.7.6.dist-info}/entry_points.txt +0 -0
  158. {jarvis_ai_assistant-0.7.0.dist-info → jarvis_ai_assistant-0.7.6.dist-info}/licenses/LICENSE +0 -0
  159. {jarvis_ai_assistant-0.7.0.dist-info → jarvis_ai_assistant-0.7.6.dist-info}/top_level.txt +0 -0
@@ -15,7 +15,6 @@ from jarvis.jarvis_utils.config import (
15
15
 
16
16
  from jarvis.jarvis_platform.registry import PlatformRegistry
17
17
  from jarvis.jarvis_utils.input import get_multiline_input, get_single_line_input
18
- from jarvis.jarvis_utils.output import OutputType, PrettyOutput
19
18
  from jarvis.jarvis_utils.utils import init_env
20
19
  from jarvis.jarvis_platform_manager.service import start_service
21
20
  from jarvis.jarvis_utils.fzf import fzf_select
@@ -33,7 +32,7 @@ def list_platforms(
33
32
  registry = PlatformRegistry.get_global_platform_registry()
34
33
  platform_names = [platform] if platform else registry.get_available_platforms()
35
34
 
36
- PrettyOutput.section("Supported platforms and models", OutputType.SUCCESS)
35
+ print("Supported platforms and models")
37
36
 
38
37
  for platform_name in platform_names:
39
38
  try:
@@ -46,7 +45,7 @@ def list_platforms(
46
45
  models = platform_instance.get_model_list()
47
46
 
48
47
  # Print platform name
49
- PrettyOutput.section(f"{platform_name}", OutputType.SUCCESS)
48
+ print(f"{platform_name}")
50
49
 
51
50
  output = ""
52
51
  # Print model list
@@ -56,12 +55,12 @@ def list_platforms(
56
55
  output += f" • {model_name} - {description}\n"
57
56
  else:
58
57
  output += f" • {model_name}\n"
59
- PrettyOutput.print(output, OutputType.SUCCESS, lang="markdown")
58
+ print(f"✅ {output}")
60
59
  else:
61
- PrettyOutput.print(" • 没有可用的模型信息", OutputType.WARNING)
60
+ print("⚠️ • 没有可用的模型信息")
62
61
 
63
62
  except Exception:
64
- PrettyOutput.print(f"创建 {platform_name} 平台失败", OutputType.WARNING)
63
+ print(f"⚠️ 创建 {platform_name} 平台失败")
65
64
 
66
65
 
67
66
  def chat_with_model(
@@ -84,7 +83,7 @@ def chat_with_model(
84
83
  platform.set_model_name(model_name)
85
84
 
86
85
  if not platform:
87
- PrettyOutput.print(f"创建平台 {platform_name} 失败", OutputType.WARNING)
86
+ print(f"⚠️ 创建平台 {platform_name} 失败")
88
87
  return
89
88
 
90
89
  try:
@@ -93,14 +92,11 @@ def chat_with_model(
93
92
  if system_prompt:
94
93
  platform.set_system_prompt(system_prompt)
95
94
  platform.set_suppress_output(False)
96
- PrettyOutput.print(
97
- f"连接到 {platform_name} 平台 {model_name} 模型", OutputType.SUCCESS
98
- )
99
- PrettyOutput.print(
100
- "可用命令: /bye - 退出, /clear - 清除会话, /upload - 上传文件, "
95
+ print(f"✅ 连接到 {platform_name} 平台 {model_name} 模型")
96
+ print(
97
+ "ℹ️ 可用命令: /bye - 退出, /clear - 清除会话, /upload - 上传文件, "
101
98
  "/shell - 执行命令, /save - 保存对话, /saveall - 保存所有对话, "
102
- "/save_session - 保存会话状态, /load_session - 加载会话状态",
103
- OutputType.INFO,
99
+ "/save_session - 保存会话状态, /load_session - 加载会话状态"
104
100
  )
105
101
 
106
102
  # Start conversation loop
@@ -110,12 +106,12 @@ def chat_with_model(
110
106
 
111
107
  # Check if input is cancelled
112
108
  if user_input.strip() == "/bye":
113
- PrettyOutput.print("再见!", OutputType.SUCCESS)
109
+ print("再见!")
114
110
  break
115
111
 
116
112
  # Check if input is empty
117
113
  if not user_input.strip():
118
- PrettyOutput.print("检测到空输入,退出聊天", OutputType.INFO)
114
+ print("ℹ️ 检测到空输入,退出聊天")
119
115
  break
120
116
 
121
117
  # Parse command and arguments
@@ -130,9 +126,9 @@ def chat_with_model(
130
126
  platform.reset() # type: ignore[no-untyped-call] # type: ignore[no-untyped-call] # type: ignore[no-untyped-call]
131
127
  platform.set_model_name(model_name) # Reinitialize session
132
128
  conversation_history = [] # 重置对话记录
133
- PrettyOutput.print("会话已清除", OutputType.SUCCESS)
129
+ print("会话已清除")
134
130
  except Exception as exc:
135
- PrettyOutput.print(f"清除会话失败: {str(exc)}", OutputType.ERROR)
131
+ print(f"清除会话失败: {str(exc)}")
136
132
  continue
137
133
 
138
134
  # Check if it is an upload command
@@ -140,9 +136,8 @@ def chat_with_model(
140
136
  try:
141
137
  file_path = args
142
138
  if not file_path:
143
- PrettyOutput.print(
144
- '请指定要上传的文件路径,例如: /upload /path/to/file 或 /upload "/path/with spaces/file"',
145
- OutputType.WARNING,
139
+ print(
140
+ '⚠️ 请指定要上传的文件路径,例如: /upload /path/to/file 或 /upload "/path/with spaces/file"'
146
141
  )
147
142
  continue
148
143
 
@@ -153,16 +148,16 @@ def chat_with_model(
153
148
  file_path = file_path[1:-1]
154
149
 
155
150
  if not platform.support_upload_files():
156
- PrettyOutput.print("平台不支持上传文件", OutputType.ERROR)
151
+ print("平台不支持上传文件")
157
152
  continue
158
153
 
159
- PrettyOutput.print(f"正在上传文件: {file_path}", OutputType.INFO)
154
+ print(f"ℹ️ 正在上传文件: {file_path}")
160
155
  if platform.upload_files([file_path]):
161
- PrettyOutput.print("文件上传成功", OutputType.SUCCESS)
156
+ print("文件上传成功")
162
157
  else:
163
- PrettyOutput.print("文件上传失败", OutputType.ERROR)
158
+ print("文件上传失败")
164
159
  except Exception as exc:
165
- PrettyOutput.print(f"上传文件失败: {str(exc)}", OutputType.ERROR)
160
+ print(f"上传文件失败: {str(exc)}")
166
161
  continue
167
162
 
168
163
  # Check if it is a save command
@@ -170,9 +165,8 @@ def chat_with_model(
170
165
  try:
171
166
  file_path = args
172
167
  if not file_path:
173
- PrettyOutput.print(
174
- "请指定保存文件名,例如: /save last_message.txt",
175
- OutputType.WARNING,
168
+ print(
169
+ "⚠️ 请指定保存文件名,例如: /save last_message.txt"
176
170
  )
177
171
  continue
178
172
 
@@ -187,13 +181,13 @@ def chat_with_model(
187
181
  with open(file_path, "w", encoding="utf-8") as file_obj:
188
182
  last_entry = conversation_history[-1]
189
183
  file_obj.write(f"{last_entry['content']}\n")
190
- PrettyOutput.print(
191
- f"最后一条消息内容已保存到 {file_path}", OutputType.SUCCESS
184
+ print(
185
+ f"最后一条消息内容已保存到 {file_path}"
192
186
  )
193
187
  else:
194
- PrettyOutput.print("没有可保存的消息", OutputType.WARNING)
188
+ print("⚠️ 没有可保存的消息")
195
189
  except Exception as exc:
196
- PrettyOutput.print(f"保存消息失败: {str(exc)}", OutputType.ERROR)
190
+ print(f"保存消息失败: {str(exc)}")
197
191
  continue
198
192
 
199
193
  # Check if it is a saveall command
@@ -201,9 +195,8 @@ def chat_with_model(
201
195
  try:
202
196
  file_path = args
203
197
  if not file_path:
204
- PrettyOutput.print(
205
- "请指定保存文件名,例如: /saveall all_conversations.txt",
206
- OutputType.WARNING,
198
+ print(
199
+ "⚠️ 请指定保存文件名,例如: /saveall all_conversations.txt"
207
200
  )
208
201
  continue
209
202
 
@@ -218,12 +211,12 @@ def chat_with_model(
218
211
  for entry in conversation_history:
219
212
  file_obj.write(f"{entry['role']}: {entry['content']}\n\n")
220
213
 
221
- PrettyOutput.print(
222
- f"所有对话已保存到 {file_path}", OutputType.SUCCESS
214
+ print(
215
+ f"所有对话已保存到 {file_path}"
223
216
  )
224
217
  except Exception as exc:
225
- PrettyOutput.print(
226
- f"保存所有对话失败: {str(exc)}", OutputType.ERROR
218
+ print(
219
+ f"保存所有对话失败: {str(exc)}"
227
220
  )
228
221
  continue
229
222
 
@@ -232,9 +225,8 @@ def chat_with_model(
232
225
  try:
233
226
  file_path = args
234
227
  if not file_path:
235
- PrettyOutput.print(
236
- "请指定保存会话的文件名,例如: /save_session session.json",
237
- OutputType.WARNING,
228
+ print(
229
+ "⚠️ 请指定保存会话的文件名,例如: /save_session session.json"
238
230
  )
239
231
  continue
240
232
 
@@ -245,13 +237,13 @@ def chat_with_model(
245
237
  file_path = file_path[1:-1]
246
238
 
247
239
  if platform.save(file_path):
248
- PrettyOutput.print(
249
- f"会话已保存到 {file_path}", OutputType.SUCCESS
240
+ print(
241
+ f"会话已保存到 {file_path}"
250
242
  )
251
243
  else:
252
- PrettyOutput.print("保存会话失败", OutputType.ERROR)
244
+ print("保存会话失败")
253
245
  except Exception as exc:
254
- PrettyOutput.print(f"保存会话失败: {str(exc)}", OutputType.ERROR)
246
+ print(f"保存会话失败: {str(exc)}")
255
247
  continue
256
248
 
257
249
  # Check if it is a load_session command
@@ -259,9 +251,8 @@ def chat_with_model(
259
251
  try:
260
252
  file_path = args
261
253
  if not file_path:
262
- PrettyOutput.print(
263
- "请指定加载会话的文件名,例如: /load_session session.json",
264
- OutputType.WARNING,
254
+ print(
255
+ "⚠️ 请指定加载会话的文件名,例如: /load_session session.json"
265
256
  )
266
257
  continue
267
258
 
@@ -273,13 +264,13 @@ def chat_with_model(
273
264
 
274
265
  if platform.restore(file_path):
275
266
  conversation_history = [] # Clear local history after loading
276
- PrettyOutput.print(
277
- f"会话已从 {file_path} 加载", OutputType.SUCCESS
267
+ print(
268
+ f"会话已从 {file_path} 加载"
278
269
  )
279
270
  else:
280
- PrettyOutput.print("加载会话失败", OutputType.ERROR)
271
+ print("加载会话失败")
281
272
  except Exception as exc:
282
- PrettyOutput.print(f"加载会话失败: {str(exc)}", OutputType.ERROR)
273
+ print(f"加载会话失败: {str(exc)}")
283
274
  continue
284
275
 
285
276
  # Check if it is a shell command
@@ -287,22 +278,21 @@ def chat_with_model(
287
278
  try:
288
279
  shell_command = args
289
280
  if not shell_command:
290
- PrettyOutput.print(
291
- "请指定要执行的shell命令,例如: /shell ls -l",
292
- OutputType.WARNING,
281
+ print(
282
+ "⚠️ 请指定要执行的shell命令,例如: /shell ls -l"
293
283
  )
294
284
  continue
295
285
 
296
- PrettyOutput.print(f"执行命令: {shell_command}", OutputType.INFO)
286
+ print(f"ℹ️ 执行命令: {shell_command}")
297
287
  return_code = os.system(shell_command)
298
288
  if return_code == 0:
299
- PrettyOutput.print("命令执行完成", OutputType.SUCCESS)
289
+ print("命令执行完成")
300
290
  else:
301
- PrettyOutput.print(
302
- f"命令执行失败(返回码: {return_code})", OutputType.ERROR
291
+ print(
292
+ f"命令执行失败(返回码: {return_code})"
303
293
  )
304
294
  except Exception as exc:
305
- PrettyOutput.print(f"执行命令失败: {str(exc)}", OutputType.ERROR)
295
+ print(f"执行命令失败: {str(exc)}")
306
296
  continue
307
297
 
308
298
  try:
@@ -312,19 +302,19 @@ def chat_with_model(
312
302
  # Send to model and get reply
313
303
  response = platform.chat_until_success(user_input)
314
304
  if not response:
315
- PrettyOutput.print("没有有效的回复", OutputType.WARNING)
305
+ print("⚠️ 没有有效的回复")
316
306
  else:
317
307
  conversation_history.append(
318
308
  {"role": "assistant", "content": response}
319
309
  ) # 记录模型回复
320
310
 
321
311
  except Exception as exc:
322
- PrettyOutput.print(f"聊天失败: {str(exc)}", OutputType.ERROR)
312
+ print(f"聊天失败: {str(exc)}")
323
313
 
324
314
  except typer.Exit:
325
315
  raise
326
316
  except Exception as exc:
327
- PrettyOutput.print(f"初始化会话失败: {str(exc)}", OutputType.ERROR)
317
+ print(f"初始化会话失败: {str(exc)}")
328
318
  sys.exit(1)
329
319
  finally:
330
320
  # Clean up resources
@@ -345,9 +335,8 @@ def validate_platform_model(platform: Optional[str], model: Optional[str]) -> bo
345
335
  bool: 如果平台和模型有效返回True,否则返回False。
346
336
  """
347
337
  if not platform or not model:
348
- PrettyOutput.print(
349
- "请指定平台和模型。使用 'jarvis info' 查看可用平台和模型。",
350
- OutputType.WARNING,
338
+ print(
339
+ "⚠️ 请指定平台和模型。使用 'jarvis info' 查看可用平台和模型。"
351
340
  )
352
341
  return False
353
342
  return True
@@ -404,7 +393,7 @@ def load_role_config(config_path: str) -> Dict[str, Any]:
404
393
  import yaml
405
394
 
406
395
  if not os.path.exists(config_path):
407
- PrettyOutput.print(f"角色配置文件 {config_path} 不存在", OutputType.ERROR)
396
+ print(f"角色配置文件 {config_path} 不存在")
408
397
  return {}
409
398
 
410
399
  with open(config_path, "r", encoding="utf-8", errors="ignore") as file_obj:
@@ -412,7 +401,7 @@ def load_role_config(config_path: str) -> Dict[str, Any]:
412
401
  config = yaml.safe_load(file_obj)
413
402
  return config if config else {}
414
403
  except yaml.YAMLError as exc:
415
- PrettyOutput.print(f"角色配置文件解析失败: {str(exc)}", OutputType.ERROR)
404
+ print(f"角色配置文件解析失败: {str(exc)}")
416
405
  return {}
417
406
 
418
407
 
@@ -439,18 +428,18 @@ def role_command(
439
428
  config_path = os.path.expanduser(config_file)
440
429
  config = load_role_config(config_path)
441
430
  if not config or "roles" not in config:
442
- PrettyOutput.print("无效的角色配置文件", OutputType.ERROR)
431
+ print("无效的角色配置文件")
443
432
  return
444
433
 
445
434
  # 显示可选角色列表
446
- PrettyOutput.section("可用角色", OutputType.SUCCESS)
435
+ print("可用角色")
447
436
  output_str = "\n".join(
448
437
  [
449
438
  f"{i}. {role['name']} - {role.get('description', '')}"
450
439
  for i, role in enumerate(config["roles"], 1)
451
440
  ]
452
441
  )
453
- PrettyOutput.print(output_str, OutputType.INFO)
442
+ print(f"ℹ️ {output_str}")
454
443
 
455
444
  # 让用户选择角色(优先 fzf,回退编号输入)
456
445
  selected_role = None # type: ignore[var-annotated]
@@ -471,13 +460,13 @@ def role_command(
471
460
  if selected_role is None:
472
461
  raw_choice = get_single_line_input("请选择角色(输入编号,直接回车退出): ")
473
462
  if not raw_choice.strip():
474
- PrettyOutput.print("已取消,退出程序", OutputType.INFO)
463
+ print("ℹ️ 已取消,退出程序")
475
464
  raise typer.Exit(code=0)
476
465
  try:
477
466
  choice = int(raw_choice)
478
467
  selected_role = config["roles"][choice - 1]
479
468
  except (ValueError, IndexError):
480
- PrettyOutput.print("无效的选择", OutputType.ERROR)
469
+ print("无效的选择")
481
470
  return
482
471
 
483
472
 
@@ -509,13 +498,13 @@ def role_command(
509
498
  system_prompt = selected_role.get("system_prompt", "")
510
499
 
511
500
  # 开始对话
512
- PrettyOutput.print(f"已选择角色: {selected_role['name']}", OutputType.SUCCESS)
501
+ print(f"已选择角色: {selected_role['name']}")
513
502
  chat_with_model(platform_name, model_name, system_prompt)
514
503
 
515
504
 
516
505
  def main() -> None:
517
506
  """Jarvis平台管理器的主入口点。"""
518
- init_env("欢迎使用 Jarvis-PlatformManager,您的平台管理助手已准备就绪!")
507
+ init_env()
519
508
  app()
520
509
 
521
510
 
@@ -20,7 +20,6 @@ from pydantic import BaseModel, Field
20
20
  from starlette.responses import JSONResponse, Response
21
21
 
22
22
  from jarvis.jarvis_platform.registry import PlatformRegistry
23
- from jarvis.jarvis_utils.output import OutputType, PrettyOutput
24
23
 
25
24
 
26
25
  class ChatMessage(BaseModel):
@@ -97,15 +96,12 @@ def start_service(
97
96
 
98
97
  registry = PlatformRegistry.get_global_platform_registry()
99
98
 
100
- PrettyOutput.print(
101
- f"Starting Jarvis API server on {host}:{port}", OutputType.SUCCESS
102
- )
103
- PrettyOutput.print("本服务提供与 OpenAI 兼容的 API", OutputType.INFO)
99
+ print(f"✅ Starting Jarvis API server on {host}:{port}")
100
+ print("ℹ️ 本服务提供与 OpenAI 兼容的 API")
104
101
 
105
102
  if default_platform and default_model:
106
- PrettyOutput.print(
107
- f"Default platform: {default_platform}, model: {default_model}",
108
- OutputType.INFO,
103
+ print(
104
+ f"ℹ️ Default platform: {default_platform}, model: {default_model}"
109
105
  )
110
106
 
111
107
  # Platform and model cache
@@ -151,7 +147,7 @@ def start_service(
151
147
  if response:
152
148
  f.write(f"\nResponse:\n{response}\n")
153
149
 
154
- PrettyOutput.print(f"会话已记录到 {log_file}", OutputType.INFO)
150
+ print(f"ℹ️ 会话已记录到 {log_file}")
155
151
 
156
152
  @app.get("/v1/models")
157
153
  async def list_models() -> Dict[str, Any]:
@@ -176,9 +172,8 @@ def start_service(
176
172
  }
177
173
  )
178
174
  except Exception as exc:
179
- PrettyOutput.print(
180
- f"Error getting models for {default_platform}: {str(exc)}",
181
- OutputType.ERROR,
175
+ print(
176
+ f"Error getting models for {default_platform}: {str(exc)}"
182
177
  )
183
178
 
184
179
  # Return model list
@@ -344,7 +339,7 @@ def start_service(
344
339
 
345
340
  if isinstance(item, dict) and "__error__" in item:
346
341
  error_msg = f"Error during streaming: {item['__error__']}"
347
- PrettyOutput.print(error_msg, OutputType.ERROR)
342
+ print(f"❌ {error_msg}")
348
343
 
349
344
  # Send error information in the stream
350
345
  error_chunk = {