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.
- jarvis/__init__.py +1 -1
- jarvis/jarvis_agent/__init__.py +330 -347
- jarvis/jarvis_agent/builtin_input_handler.py +16 -6
- jarvis/jarvis_agent/file_input_handler.py +9 -9
- jarvis/jarvis_agent/jarvis.py +143 -0
- jarvis/jarvis_agent/main.py +12 -13
- jarvis/jarvis_agent/output_handler.py +3 -3
- jarvis/jarvis_agent/patch.py +92 -64
- jarvis/jarvis_agent/shell_input_handler.py +5 -3
- jarvis/jarvis_code_agent/code_agent.py +263 -177
- jarvis/jarvis_code_agent/file_select.py +24 -24
- jarvis/jarvis_dev/main.py +45 -59
- jarvis/jarvis_git_details/__init__.py +0 -0
- jarvis/jarvis_git_details/main.py +179 -0
- jarvis/jarvis_git_squash/main.py +7 -7
- jarvis/jarvis_lsp/base.py +11 -53
- jarvis/jarvis_lsp/cpp.py +13 -28
- jarvis/jarvis_lsp/go.py +13 -28
- jarvis/jarvis_lsp/python.py +8 -27
- jarvis/jarvis_lsp/registry.py +21 -83
- jarvis/jarvis_lsp/rust.py +15 -30
- jarvis/jarvis_methodology/main.py +101 -0
- jarvis/jarvis_multi_agent/__init__.py +10 -51
- jarvis/jarvis_multi_agent/main.py +43 -0
- jarvis/jarvis_platform/__init__.py +1 -1
- jarvis/jarvis_platform/ai8.py +67 -89
- jarvis/jarvis_platform/base.py +14 -13
- jarvis/jarvis_platform/kimi.py +25 -28
- jarvis/jarvis_platform/ollama.py +24 -26
- jarvis/jarvis_platform/openai.py +15 -19
- jarvis/jarvis_platform/oyi.py +48 -50
- jarvis/jarvis_platform/registry.py +29 -44
- jarvis/jarvis_platform/yuanbao.py +39 -43
- jarvis/jarvis_platform_manager/main.py +81 -81
- jarvis/jarvis_platform_manager/openai_test.py +21 -21
- jarvis/jarvis_rag/file_processors.py +18 -18
- jarvis/jarvis_rag/main.py +262 -278
- jarvis/jarvis_smart_shell/main.py +12 -12
- jarvis/jarvis_tools/ask_codebase.py +85 -78
- jarvis/jarvis_tools/ask_user.py +8 -8
- jarvis/jarvis_tools/base.py +4 -4
- jarvis/jarvis_tools/chdir.py +9 -9
- jarvis/jarvis_tools/code_review.py +40 -21
- jarvis/jarvis_tools/create_code_agent.py +15 -15
- jarvis/jarvis_tools/create_sub_agent.py +0 -1
- jarvis/jarvis_tools/execute_python_script.py +3 -3
- jarvis/jarvis_tools/execute_shell.py +11 -11
- jarvis/jarvis_tools/execute_shell_script.py +3 -3
- jarvis/jarvis_tools/file_analyzer.py +116 -105
- jarvis/jarvis_tools/file_operation.py +22 -20
- jarvis/jarvis_tools/find_caller.py +105 -40
- jarvis/jarvis_tools/find_methodolopy.py +65 -0
- jarvis/jarvis_tools/find_symbol.py +123 -39
- jarvis/jarvis_tools/function_analyzer.py +140 -57
- jarvis/jarvis_tools/git_commiter.py +10 -10
- jarvis/jarvis_tools/lsp_get_diagnostics.py +19 -19
- jarvis/jarvis_tools/methodology.py +22 -67
- jarvis/jarvis_tools/project_analyzer.py +137 -53
- jarvis/jarvis_tools/rag.py +15 -20
- jarvis/jarvis_tools/read_code.py +25 -23
- jarvis/jarvis_tools/read_webpage.py +31 -31
- jarvis/jarvis_tools/registry.py +72 -52
- jarvis/jarvis_tools/search_web.py +23 -353
- jarvis/jarvis_tools/tool_generator.py +19 -19
- jarvis/jarvis_utils/config.py +36 -96
- jarvis/jarvis_utils/embedding.py +83 -83
- jarvis/jarvis_utils/git_utils.py +20 -20
- jarvis/jarvis_utils/globals.py +18 -6
- jarvis/jarvis_utils/input.py +10 -9
- jarvis/jarvis_utils/methodology.py +141 -140
- jarvis/jarvis_utils/output.py +13 -13
- jarvis/jarvis_utils/utils.py +23 -71
- {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/METADATA +6 -15
- jarvis_ai_assistant-0.1.138.dist-info/RECORD +85 -0
- {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/entry_points.txt +4 -3
- jarvis/jarvis_tools/lsp_find_definition.py +0 -150
- jarvis/jarvis_tools/lsp_find_references.py +0 -127
- jarvis/jarvis_tools/select_code_files.py +0 -62
- jarvis_ai_assistant-0.1.132.dist-info/RECORD +0 -82
- {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.132.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/top_level.txt +0 -0
jarvis/jarvis_utils/globals.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
- 带有自定义主题的控制台配置
|
|
7
7
|
- 环境初始化
|
|
8
8
|
"""
|
|
9
|
-
from typing import Any, Set
|
|
9
|
+
from typing import Any, Set, Dict
|
|
10
10
|
import colorama
|
|
11
11
|
import os
|
|
12
12
|
from rich.console import Console
|
|
@@ -17,6 +17,7 @@ colorama.init()
|
|
|
17
17
|
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
|
18
18
|
# 全局代理管理
|
|
19
19
|
global_agents: Set[str] = set()
|
|
20
|
+
global_read_files: Dict[str, Set[str]] = {}
|
|
20
21
|
current_agent_name: str = ""
|
|
21
22
|
# 使用自定义主题配置rich控制台
|
|
22
23
|
custom_theme = Theme({
|
|
@@ -37,10 +38,10 @@ console = Console(theme=custom_theme)
|
|
|
37
38
|
def make_agent_name(agent_name: str) -> str:
|
|
38
39
|
"""
|
|
39
40
|
通过附加后缀生成唯一的代理名称(如果必要)。
|
|
40
|
-
|
|
41
|
+
|
|
41
42
|
参数:
|
|
42
43
|
agent_name: 基础代理名称
|
|
43
|
-
|
|
44
|
+
|
|
44
45
|
返回:
|
|
45
46
|
str: 唯一的代理名称
|
|
46
47
|
"""
|
|
@@ -53,7 +54,7 @@ def make_agent_name(agent_name: str) -> str:
|
|
|
53
54
|
def set_agent(agent_name: str, agent: Any) -> None:
|
|
54
55
|
"""
|
|
55
56
|
设置当前代理并将其添加到全局代理集合中。
|
|
56
|
-
|
|
57
|
+
|
|
57
58
|
参数:
|
|
58
59
|
agent_name: 代理名称
|
|
59
60
|
agent: 代理对象
|
|
@@ -64,7 +65,7 @@ def set_agent(agent_name: str, agent: Any) -> None:
|
|
|
64
65
|
def get_agent_list() -> str:
|
|
65
66
|
"""
|
|
66
67
|
获取表示当前代理状态的格式化字符串。
|
|
67
|
-
|
|
68
|
+
|
|
68
69
|
返回:
|
|
69
70
|
str: 包含代理数量和当前代理名称的格式化字符串
|
|
70
71
|
"""
|
|
@@ -72,7 +73,7 @@ def get_agent_list() -> str:
|
|
|
72
73
|
def delete_agent(agent_name: str) -> None:
|
|
73
74
|
"""
|
|
74
75
|
从全局代理集合中删除一个代理。
|
|
75
|
-
|
|
76
|
+
|
|
76
77
|
参数:
|
|
77
78
|
agent_name: 要删除的代理名称
|
|
78
79
|
"""
|
|
@@ -80,3 +81,14 @@ def delete_agent(agent_name: str) -> None:
|
|
|
80
81
|
global_agents.remove(agent_name)
|
|
81
82
|
global current_agent_name
|
|
82
83
|
current_agent_name = ""
|
|
84
|
+
|
|
85
|
+
def add_read_file_record(file_path: str):
|
|
86
|
+
if current_agent_name not in global_read_files:
|
|
87
|
+
global_read_files[current_agent_name] = set()
|
|
88
|
+
global_read_files[current_agent_name].add(file_path)
|
|
89
|
+
|
|
90
|
+
def has_read_file(file_path: str) -> bool:
|
|
91
|
+
return not os.path.exists(file_path) or (current_agent_name in global_read_files and file_path in global_read_files[current_agent_name])
|
|
92
|
+
|
|
93
|
+
def clear_read_file_record():
|
|
94
|
+
global_read_files.pop(current_agent_name, None)
|
jarvis/jarvis_utils/input.py
CHANGED
|
@@ -19,10 +19,10 @@ from jarvis.jarvis_utils.output import PrettyOutput, OutputType
|
|
|
19
19
|
def get_single_line_input(tip: str) -> str:
|
|
20
20
|
"""
|
|
21
21
|
获取支持历史记录的单行输入。
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
参数:
|
|
24
24
|
tip: 要显示的提示信息
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
返回:
|
|
27
27
|
str: 用户的输入
|
|
28
28
|
"""
|
|
@@ -34,7 +34,7 @@ def get_single_line_input(tip: str) -> str:
|
|
|
34
34
|
class FileCompleter(Completer):
|
|
35
35
|
"""
|
|
36
36
|
带有模糊匹配的文件路径自定义补全器。
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
属性:
|
|
39
39
|
path_completer: 基础路径补全器
|
|
40
40
|
max_suggestions: 显示的最大建议数量
|
|
@@ -48,11 +48,11 @@ class FileCompleter(Completer):
|
|
|
48
48
|
def get_completions(self, document: Document, complete_event) -> Completion: # type: ignore
|
|
49
49
|
"""
|
|
50
50
|
生成带有模糊匹配的文件路径补全建议。
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
参数:
|
|
53
53
|
document: 当前正在编辑的文档
|
|
54
54
|
complete_event: 补全事件
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
生成:
|
|
57
57
|
Completion: 建议的补全项
|
|
58
58
|
"""
|
|
@@ -81,6 +81,7 @@ class FileCompleter(Completer):
|
|
|
81
81
|
(ot("RAG"), '知识库检索'),
|
|
82
82
|
(ot("Summary"), '总结'),
|
|
83
83
|
(ot("Clear"), '清除历史'),
|
|
84
|
+
(ot("Methodology"), '查找相关方法论'),
|
|
84
85
|
]
|
|
85
86
|
for name, desc in default_suggestions:
|
|
86
87
|
yield Completion(
|
|
@@ -98,8 +99,8 @@ class FileCompleter(Completer):
|
|
|
98
99
|
all_files = []
|
|
99
100
|
try:
|
|
100
101
|
import subprocess
|
|
101
|
-
result = subprocess.run(['git', 'ls-files'],
|
|
102
|
-
stdout=subprocess.PIPE,
|
|
102
|
+
result = subprocess.run(['git', 'ls-files'],
|
|
103
|
+
stdout=subprocess.PIPE,
|
|
103
104
|
stderr=subprocess.PIPE,
|
|
104
105
|
text=True)
|
|
105
106
|
if result.returncode == 0:
|
|
@@ -129,10 +130,10 @@ class FileCompleter(Completer):
|
|
|
129
130
|
def get_multiline_input(tip: str) -> str:
|
|
130
131
|
"""
|
|
131
132
|
获取带有增强补全和确认功能的多行输入。
|
|
132
|
-
|
|
133
|
+
|
|
133
134
|
参数:
|
|
134
135
|
tip: 要显示的提示信息
|
|
135
|
-
|
|
136
|
+
|
|
136
137
|
返回:
|
|
137
138
|
str: 用户的输入,如果取消则返回空字符串
|
|
138
139
|
"""
|