jarvis-ai-assistant 0.1.134__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 +201 -79
- jarvis/jarvis_agent/builtin_input_handler.py +16 -6
- jarvis/jarvis_agent/file_input_handler.py +9 -9
- jarvis/jarvis_agent/jarvis.py +10 -10
- jarvis/jarvis_agent/main.py +12 -11
- jarvis/jarvis_agent/output_handler.py +3 -3
- jarvis/jarvis_agent/patch.py +86 -62
- jarvis/jarvis_agent/shell_input_handler.py +5 -3
- jarvis/jarvis_code_agent/code_agent.py +134 -99
- jarvis/jarvis_code_agent/file_select.py +24 -24
- jarvis/jarvis_dev/main.py +45 -51
- 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 -11
- jarvis/jarvis_lsp/cpp.py +14 -14
- jarvis/jarvis_lsp/go.py +13 -13
- jarvis/jarvis_lsp/python.py +8 -8
- jarvis/jarvis_lsp/registry.py +21 -21
- jarvis/jarvis_lsp/rust.py +15 -15
- jarvis/jarvis_methodology/main.py +101 -0
- jarvis/jarvis_multi_agent/__init__.py +11 -11
- jarvis/jarvis_multi_agent/main.py +6 -6
- 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 +27 -28
- jarvis/jarvis_platform/yuanbao.py +38 -42
- 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 +261 -277
- jarvis/jarvis_smart_shell/main.py +12 -12
- jarvis/jarvis_tools/ask_codebase.py +28 -28
- 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 +19 -19
- jarvis/jarvis_tools/create_code_agent.py +15 -15
- 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 +29 -29
- jarvis/jarvis_tools/file_operation.py +22 -20
- jarvis/jarvis_tools/find_caller.py +25 -25
- jarvis/jarvis_tools/find_methodolopy.py +65 -0
- jarvis/jarvis_tools/find_symbol.py +24 -24
- jarvis/jarvis_tools/function_analyzer.py +27 -27
- jarvis/jarvis_tools/git_commiter.py +9 -9
- jarvis/jarvis_tools/lsp_get_diagnostics.py +19 -19
- jarvis/jarvis_tools/methodology.py +23 -62
- jarvis/jarvis_tools/project_analyzer.py +29 -33
- jarvis/jarvis_tools/rag.py +15 -15
- jarvis/jarvis_tools/read_code.py +24 -22
- jarvis/jarvis_tools/read_webpage.py +31 -31
- jarvis/jarvis_tools/registry.py +72 -52
- jarvis/jarvis_tools/tool_generator.py +18 -18
- jarvis/jarvis_utils/config.py +23 -23
- 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 +140 -136
- jarvis/jarvis_utils/output.py +11 -11
- jarvis/jarvis_utils/utils.py +22 -70
- {jarvis_ai_assistant-0.1.134.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/METADATA +1 -1
- jarvis_ai_assistant-0.1.138.dist-info/RECORD +85 -0
- {jarvis_ai_assistant-0.1.134.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/entry_points.txt +2 -0
- jarvis/jarvis_tools/select_code_files.py +0 -62
- jarvis_ai_assistant-0.1.134.dist-info/RECORD +0 -82
- {jarvis_ai_assistant-0.1.134.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.134.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.134.dist-info → jarvis_ai_assistant-0.1.138.dist-info}/top_level.txt +0 -0
|
@@ -11,7 +11,7 @@ class FileProcessor:
|
|
|
11
11
|
def can_handle(file_path: str) -> bool:
|
|
12
12
|
"""Determine if the file can be processed"""
|
|
13
13
|
raise NotImplementedError
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
@staticmethod
|
|
16
16
|
def extract_text(file_path: str) -> str:
|
|
17
17
|
"""Extract file text content"""
|
|
@@ -21,7 +21,7 @@ class TextFileProcessor(FileProcessor):
|
|
|
21
21
|
"""Text file processor"""
|
|
22
22
|
ENCODINGS = ['utf-8', 'gbk', 'gb2312', 'latin1']
|
|
23
23
|
SAMPLE_SIZE = 8192 # Read the first 8KB to detect encoding
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
@staticmethod
|
|
26
26
|
def can_handle(file_path: str) -> bool:
|
|
27
27
|
"""Determine if the file is a text file by trying to decode it"""
|
|
@@ -29,16 +29,16 @@ class TextFileProcessor(FileProcessor):
|
|
|
29
29
|
# Read the first part of the file to detect encoding
|
|
30
30
|
with open(file_path, 'rb') as f:
|
|
31
31
|
sample = f.read(TextFileProcessor.SAMPLE_SIZE)
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
# Check if it contains null bytes (usually represents a binary file)
|
|
34
34
|
if b'\x00' in sample:
|
|
35
35
|
return False
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
# Check if it contains too many non-printable characters (usually represents a binary file)
|
|
38
38
|
non_printable = sum(1 for byte in sample if byte < 32 and byte not in (9, 10, 13)) # tab, newline, carriage return
|
|
39
39
|
if non_printable / len(sample) > 0.3: # If non-printable characters exceed 30%, it is considered a binary file
|
|
40
40
|
return False
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
# Try to decode with different encodings
|
|
43
43
|
for encoding in TextFileProcessor.ENCODINGS:
|
|
44
44
|
try:
|
|
@@ -46,12 +46,12 @@ class TextFileProcessor(FileProcessor):
|
|
|
46
46
|
return True
|
|
47
47
|
except UnicodeDecodeError:
|
|
48
48
|
continue
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
return False
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
except Exception:
|
|
53
53
|
return False
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
@staticmethod
|
|
56
56
|
def extract_text(file_path: str) -> str:
|
|
57
57
|
"""Extract text content, using the detected correct encoding"""
|
|
@@ -60,7 +60,7 @@ class TextFileProcessor(FileProcessor):
|
|
|
60
60
|
# First try to detect encoding
|
|
61
61
|
with open(file_path, 'rb') as f:
|
|
62
62
|
raw_data = f.read()
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
# Try different encodings
|
|
65
65
|
for encoding in TextFileProcessor.ENCODINGS:
|
|
66
66
|
try:
|
|
@@ -69,19 +69,19 @@ class TextFileProcessor(FileProcessor):
|
|
|
69
69
|
break
|
|
70
70
|
except UnicodeDecodeError:
|
|
71
71
|
continue
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
if not detected_encoding:
|
|
74
74
|
raise UnicodeDecodeError(f"Failed to decode file with supported encodings: {file_path}") # type: ignore
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
# Use the detected encoding to read the file
|
|
77
77
|
with open(file_path, 'r', encoding=detected_encoding, errors='ignore') as f:
|
|
78
78
|
content = f.read()
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
# Normalize Unicode characters
|
|
81
81
|
content = unicodedata.normalize('NFKC', content)
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
return content
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
except Exception as e:
|
|
86
86
|
raise Exception(f"Failed to read file: {str(e)}")
|
|
87
87
|
|
|
@@ -90,7 +90,7 @@ class PDFProcessor(FileProcessor):
|
|
|
90
90
|
@staticmethod
|
|
91
91
|
def can_handle(file_path: str) -> bool:
|
|
92
92
|
return Path(file_path).suffix.lower() == '.pdf'
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
@staticmethod
|
|
95
95
|
def extract_text(file_path: str) -> str:
|
|
96
96
|
text_parts = []
|
|
@@ -104,7 +104,7 @@ class DocxProcessor(FileProcessor):
|
|
|
104
104
|
@staticmethod
|
|
105
105
|
def can_handle(file_path: str) -> bool:
|
|
106
106
|
return Path(file_path).suffix.lower() == '.docx'
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
@staticmethod
|
|
109
109
|
def extract_text(file_path: str) -> str:
|
|
110
110
|
doc = DocxDocument(file_path)
|
|
@@ -115,7 +115,7 @@ class PPTProcessor(FileProcessor):
|
|
|
115
115
|
@staticmethod
|
|
116
116
|
def can_handle(file_path: str) -> bool:
|
|
117
117
|
return Path(file_path).suffix.lower() in ['.ppt', '.pptx']
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
@staticmethod
|
|
120
120
|
def extract_text(file_path: str) -> str:
|
|
121
121
|
prs = Presentation(file_path)
|
|
@@ -131,7 +131,7 @@ class ExcelProcessor(FileProcessor):
|
|
|
131
131
|
@staticmethod
|
|
132
132
|
def can_handle(file_path: str) -> bool:
|
|
133
133
|
return Path(file_path).suffix.lower() in ['.xls', '.xlsx']
|
|
134
|
-
|
|
134
|
+
|
|
135
135
|
@staticmethod
|
|
136
136
|
def extract_text(file_path: str) -> str:
|
|
137
137
|
df = pd.read_excel(file_path)
|