jarvis-ai-assistant 0.1.122__py3-none-any.whl → 0.1.123__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_code_agent/code_agent.py +34 -9
- jarvis/jarvis_code_agent/file_select.py +7 -6
- jarvis/jarvis_code_agent/patch.py +75 -21
- jarvis/jarvis_dev/main.py +924 -0
- jarvis/jarvis_platform/base.py +20 -25
- jarvis/jarvis_platform/openai.py +1 -1
- jarvis/jarvis_tools/read_code.py +1 -1
- jarvis/jarvis_utils/__init__.py +12 -5
- {jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/METADATA +6 -5
- {jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/RECORD +15 -14
- {jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/entry_points.txt +1 -0
- {jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/top_level.txt +0 -0
jarvis/jarvis_platform/base.py
CHANGED
|
@@ -32,34 +32,29 @@ class BasePlatform(ABC):
|
|
|
32
32
|
def _chat():
|
|
33
33
|
import time
|
|
34
34
|
start_time = time.time()
|
|
35
|
-
|
|
36
|
-
if self.suppress_output:
|
|
37
|
-
with yaspin(Spinners.dots, text="Thinking", color="yellow") as spinner:
|
|
38
|
-
response = self.chat(message)
|
|
39
|
-
spinner.ok("✓")
|
|
40
|
-
else:
|
|
41
|
-
response = self.chat(message)
|
|
35
|
+
response = self.chat(message)
|
|
42
36
|
|
|
43
37
|
# Calculate statistics
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
if not self.suppress_output:
|
|
39
|
+
end_time = time.time()
|
|
40
|
+
duration = end_time - start_time
|
|
41
|
+
char_count = len(response)
|
|
42
|
+
|
|
43
|
+
# Calculate token count and tokens per second
|
|
44
|
+
try:
|
|
45
|
+
from jarvis.jarvis_utils import get_context_token_count
|
|
46
|
+
token_count = get_context_token_count(response)
|
|
47
|
+
tokens_per_second = token_count / duration if duration > 0 else 0
|
|
48
|
+
except Exception as e:
|
|
49
|
+
PrettyOutput.print(f"Tokenization failed: {str(e)}", OutputType.WARNING)
|
|
50
|
+
token_count = 0
|
|
51
|
+
tokens_per_second = 0
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
# Print statistics
|
|
54
|
+
PrettyOutput.print(
|
|
55
|
+
f"对话完成 - 耗时: {duration:.2f}秒, 输出字符数: {char_count}, 输出Token数量: {token_count}, 每秒Token数量: {tokens_per_second:.2f}",
|
|
56
|
+
OutputType.INFO,
|
|
57
|
+
)
|
|
63
58
|
|
|
64
59
|
# Keep original think tag handling
|
|
65
60
|
response = re.sub(r'<<think>>.*?</</think>>', '', response, flags=re.DOTALL)
|
jarvis/jarvis_platform/openai.py
CHANGED
|
@@ -85,7 +85,7 @@ class OpenAIModel(BasePlatform):
|
|
|
85
85
|
full_response = ""
|
|
86
86
|
|
|
87
87
|
for chunk in response:
|
|
88
|
-
if chunk.choices[0].delta.content:
|
|
88
|
+
if chunk.choices and chunk.choices[0].delta.content:
|
|
89
89
|
text = chunk.choices[0].delta.content
|
|
90
90
|
if not self.suppress_output:
|
|
91
91
|
PrettyOutput.print_stream(text)
|
jarvis/jarvis_tools/read_code.py
CHANGED
|
@@ -119,7 +119,7 @@ class ReadCodeTool:
|
|
|
119
119
|
formatted_lines.append(f"{line_num:>5}:{line}")
|
|
120
120
|
|
|
121
121
|
content = "".join(formatted_lines)
|
|
122
|
-
output = f"
|
|
122
|
+
output = f"\n\nFile: {filepath}\nLines: [{start_line}, {end_line}]\n{content}"
|
|
123
123
|
return {
|
|
124
124
|
"success": True,
|
|
125
125
|
"stdout": output,
|
jarvis/jarvis_utils/__init__.py
CHANGED
|
@@ -412,7 +412,7 @@ class FileCompleter(Completer):
|
|
|
412
412
|
if file_path and score < 100:
|
|
413
413
|
display_text = f"{path} ({score}%)"
|
|
414
414
|
completion = Completion(
|
|
415
|
-
text=f"
|
|
415
|
+
text=f"'{path}'", # 添加单引号包裹路径
|
|
416
416
|
start_position=-replace_length,
|
|
417
417
|
display=display_text,
|
|
418
418
|
display_meta="File"
|
|
@@ -525,12 +525,19 @@ def find_git_root(dir="."):
|
|
|
525
525
|
return ret
|
|
526
526
|
|
|
527
527
|
def has_uncommitted_changes():
|
|
528
|
-
|
|
528
|
+
import subprocess
|
|
529
|
+
# Add all changes silently
|
|
530
|
+
subprocess.run(["git", "add", "."], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
531
|
+
|
|
529
532
|
# Check working directory changes
|
|
530
|
-
working_changes =
|
|
533
|
+
working_changes = subprocess.run(["git", "diff", "--exit-code"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode != 0
|
|
534
|
+
|
|
531
535
|
# Check staged changes
|
|
532
|
-
staged_changes =
|
|
533
|
-
|
|
536
|
+
staged_changes = subprocess.run(["git", "diff", "--cached", "--exit-code"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode != 0
|
|
537
|
+
|
|
538
|
+
# Reset changes silently
|
|
539
|
+
subprocess.run(["git", "reset"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
540
|
+
|
|
534
541
|
return working_changes or staged_changes
|
|
535
542
|
|
|
536
543
|
def load_embedding_model():
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: jarvis-ai-assistant
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.123
|
|
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
|
|
7
|
-
Author-email:
|
|
7
|
+
Author-email: skyfire <skyfireitdiy@hotmail.com>
|
|
8
8
|
License: MIT License
|
|
9
9
|
|
|
10
10
|
Copyright (c) 2025 skyfire
|
|
@@ -28,14 +28,15 @@ License: MIT License
|
|
|
28
28
|
SOFTWARE.
|
|
29
29
|
Project-URL: Homepage, https://github.com/skyfireitdiy/Jarvis
|
|
30
30
|
Keywords: jarvis,ai,assistant,tools,automation
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
31
33
|
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
-
Classifier:
|
|
34
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
33
35
|
Classifier: Programming Language :: Python :: 3
|
|
34
36
|
Classifier: Programming Language :: Python :: 3.8
|
|
35
37
|
Classifier: Programming Language :: Python :: 3.9
|
|
36
38
|
Classifier: Programming Language :: Python :: 3.10
|
|
37
39
|
Classifier: Programming Language :: Python :: 3.11
|
|
38
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
39
40
|
Requires-Python: >=3.8
|
|
40
41
|
Description-Content-Type: text/markdown
|
|
41
42
|
License-File: LICENSE
|
|
@@ -45,7 +46,7 @@ Requires-Dist: colorama>=0.4.6
|
|
|
45
46
|
Requires-Dist: prompt_toolkit>=3.0.0
|
|
46
47
|
Requires-Dist: openai>=1.20.0
|
|
47
48
|
Requires-Dist: playwright>=1.41.1
|
|
48
|
-
Requires-Dist: numpy
|
|
49
|
+
Requires-Dist: numpy==1.17.4
|
|
49
50
|
Requires-Dist: faiss-cpu>=1.8.0
|
|
50
51
|
Requires-Dist: sentence-transformers>=2.2.2
|
|
51
52
|
Requires-Dist: bs4>=0.0.1
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
jarvis/__init__.py,sha256=
|
|
1
|
+
jarvis/__init__.py,sha256=Fd_y2qXT9cBkdEeg_-h8CvQ5Za_ELGG_KVryk5O1WC0,51
|
|
2
2
|
jarvis/jarvis_agent/__init__.py,sha256=4nmQOpFbY68OpyM3sCUsQSHOQGBoTP8Xff8RyX08W4Y,22447
|
|
3
3
|
jarvis/jarvis_agent/output_handler.py,sha256=kJeFTjjSu0K_2p0wyhq2veSZuhRXoaFC_8wVaoBKX0w,401
|
|
4
4
|
jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
jarvis/jarvis_code_agent/code_agent.py,sha256=
|
|
6
|
-
jarvis/jarvis_code_agent/file_select.py,sha256=
|
|
7
|
-
jarvis/jarvis_code_agent/patch.py,sha256=
|
|
5
|
+
jarvis/jarvis_code_agent/code_agent.py,sha256=_D4oPX9isUvCJk4l-afquLimqjxLA6XBd_IxnQxfTGs,6954
|
|
6
|
+
jarvis/jarvis_code_agent/file_select.py,sha256=Q3ibitHZHMhqlNw9rmjaMgK3U5hb8RgW1MK-CPHqtJ8,11942
|
|
7
|
+
jarvis/jarvis_code_agent/patch.py,sha256=IospCezRB2R8IM6h3Nx0zyfFVbx-S0RryuwSgotSg84,10285
|
|
8
8
|
jarvis/jarvis_code_agent/relevant_files.py,sha256=Z9bHJ6qkRu8EhD06kS_e0raqrsUgRUwkYf5mgBfdKP8,3392
|
|
9
9
|
jarvis/jarvis_codebase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
jarvis/jarvis_codebase/main.py,sha256=qwB74U9YDgqvBSdvglQ62HmPkBT_Y5x5YF4J8LnzbQU,39778
|
|
11
|
+
jarvis/jarvis_dev/main.py,sha256=zNV7P0d9-jjZ5XAAq_o2FAYqcBfn_lai89mJgomL6fM,24270
|
|
11
12
|
jarvis/jarvis_lsp/base.py,sha256=_7pdbMKjdtYBW0DsRbjIodDHM3J7df-YgXHejN_WIrU,4490
|
|
12
13
|
jarvis/jarvis_lsp/cpp.py,sha256=sYQHEl0FoVC5Iw2pJvvGKpeNLD95XjNuTOINvdZLgME,4986
|
|
13
14
|
jarvis/jarvis_lsp/go.py,sha256=3soEuID2XV65zaxyR70RxNsvtm02l9PEZ46F_nsDdqY,5311
|
|
@@ -17,10 +18,10 @@ jarvis/jarvis_lsp/rust.py,sha256=ZvUoOZm9GWLl3kobfByBuTGrQ8aM2dLuNxS_NHr1aQQ,554
|
|
|
17
18
|
jarvis/jarvis_multi_agent/__init__.py,sha256=Z6QaRZrqUUa6r6Pe_KZi34Ymle5amQe1N-AINxiOi1c,6011
|
|
18
19
|
jarvis/jarvis_platform/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
|
|
19
20
|
jarvis/jarvis_platform/ai8.py,sha256=rVPcbf0EbXV3lUPEmd_aO6UzYT0AHo4w13iGhHGvbjo,11964
|
|
20
|
-
jarvis/jarvis_platform/base.py,sha256=
|
|
21
|
+
jarvis/jarvis_platform/base.py,sha256=qrgdJm-aZI3Tb4el6Is8u41cC5hfnJz-U2Vfj8zzlzE,3461
|
|
21
22
|
jarvis/jarvis_platform/kimi.py,sha256=dQM4RLSfDiJwNV25qNWPKqseEpPTo7fel3SI2Pot3l4,15701
|
|
22
23
|
jarvis/jarvis_platform/ollama.py,sha256=TsBEg8crPmBiLvMRDtXYVa2AIdeog36MmW2tn5j9x8U,5613
|
|
23
|
-
jarvis/jarvis_platform/openai.py,sha256=
|
|
24
|
+
jarvis/jarvis_platform/openai.py,sha256=Ofu-J4HmteyoPsxCHvCEDlY5J7-8t3qWr8QsCprw9-8,4463
|
|
24
25
|
jarvis/jarvis_platform/oyi.py,sha256=YueBOGVMR33eTcQPRdfDdQPlM2g5awnYzYqA6z0Y1cg,15016
|
|
25
26
|
jarvis/jarvis_platform/registry.py,sha256=h6gInSOMkUbvYqzNYwYliFLOyga5fS-WlODaw-YTICU,8514
|
|
26
27
|
jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -49,16 +50,16 @@ jarvis/jarvis_tools/lsp_prepare_rename.py,sha256=RxUyIef4awtp-jgupcD1LcPlno9P3mO
|
|
|
49
50
|
jarvis/jarvis_tools/lsp_validate_edit.py,sha256=M0iglK2QbnIEFv0RYK6o2iAYnv259jB6EU7To-rc51E,5247
|
|
50
51
|
jarvis/jarvis_tools/methodology.py,sha256=JvHV6rHhC6fbPuSqC6UHFaGEE39d4g7zFLodR72wM0g,5758
|
|
51
52
|
jarvis/jarvis_tools/rag.py,sha256=eY3GrzagaJIPQ8DmrqNUFFJnIF_GfUxqRjeSengEDss,4944
|
|
52
|
-
jarvis/jarvis_tools/read_code.py,sha256=
|
|
53
|
+
jarvis/jarvis_tools/read_code.py,sha256=e0iX9rpwUlSfrhnzgQPNvfqJ-ebxuJybrNaTgb3Hnyw,7290
|
|
53
54
|
jarvis/jarvis_tools/read_webpage.py,sha256=7QamwBi5s7lD-jTcjD0wsBvkmWPRC9-K-0JkGgeTpvs,3063
|
|
54
55
|
jarvis/jarvis_tools/registry.py,sha256=XefDvujSfqKX2uLA6tnoJFg5kyBNW0iNAAJZocfIz9w,14836
|
|
55
56
|
jarvis/jarvis_tools/search.py,sha256=NHrFpAqg6dtws_9wLJvIZimjeJ-kekETi0Bg0AWMG08,11437
|
|
56
57
|
jarvis/jarvis_tools/select_code_files.py,sha256=vbEdneWWtAN90OFASohtllTgZW400ZxQbrkgroPK1qc,1902
|
|
57
58
|
jarvis/jarvis_tools/tool_generator.py,sha256=jdniHyKcEyF9KyouudrCoZBH3czZmQXc3ns0_trZ3yU,6332
|
|
58
|
-
jarvis/jarvis_utils/__init__.py,sha256=
|
|
59
|
-
jarvis_ai_assistant-0.1.
|
|
60
|
-
jarvis_ai_assistant-0.1.
|
|
61
|
-
jarvis_ai_assistant-0.1.
|
|
62
|
-
jarvis_ai_assistant-0.1.
|
|
63
|
-
jarvis_ai_assistant-0.1.
|
|
64
|
-
jarvis_ai_assistant-0.1.
|
|
59
|
+
jarvis/jarvis_utils/__init__.py,sha256=LYZktMl-iCtGLUa8RXpmDzQVMT_0Pm00aXyFGMBu95o,32207
|
|
60
|
+
jarvis_ai_assistant-0.1.123.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
|
|
61
|
+
jarvis_ai_assistant-0.1.123.dist-info/METADATA,sha256=f9JvSSga3TWB7iIVfNpCitzs9R-h0CpHHuXrjKH88ZY,13746
|
|
62
|
+
jarvis_ai_assistant-0.1.123.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
63
|
+
jarvis_ai_assistant-0.1.123.dist-info/entry_points.txt,sha256=H9Y_q7BZGDsgJijaXHD9GbscllATyKYfg22otrpKEoE,619
|
|
64
|
+
jarvis_ai_assistant-0.1.123.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
|
65
|
+
jarvis_ai_assistant-0.1.123.dist-info/RECORD,,
|
{jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/entry_points.txt
RENAMED
|
@@ -3,6 +3,7 @@ jarvis = jarvis.jarvis_agent:main
|
|
|
3
3
|
jarvis-code-agent = jarvis.jarvis_code_agent.code_agent:main
|
|
4
4
|
jarvis-code-review = jarvis.jarvis_tools.code_review:main
|
|
5
5
|
jarvis-codebase = jarvis.jarvis_codebase.main:main
|
|
6
|
+
jarvis-dev = jarvis.jarvis_dev.main:main
|
|
6
7
|
jarvis-git-commit = jarvis.jarvis_tools.git_commiter:main
|
|
7
8
|
jarvis-platform-manager = jarvis.jarvis_platform_manager.main:main
|
|
8
9
|
jarvis-rag = jarvis.jarvis_rag.main:main
|
|
File without changes
|
|
File without changes
|
{jarvis_ai_assistant-0.1.122.dist-info → jarvis_ai_assistant-0.1.123.dist-info}/top_level.txt
RENAMED
|
File without changes
|