jarvis-ai-assistant 0.1.174__py3-none-any.whl → 0.1.176__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 +25 -115
- jarvis/jarvis_agent/jarvis.py +4 -2
- jarvis/jarvis_code_agent/code_agent.py +2 -3
- jarvis/jarvis_dev/main.py +6 -6
- jarvis/jarvis_methodology/main.py +4 -4
- jarvis/jarvis_multi_agent/__init__.py +16 -22
- jarvis/jarvis_platform/base.py +47 -29
- jarvis/jarvis_platform/human.py +4 -3
- jarvis/jarvis_platform/kimi.py +9 -87
- jarvis/jarvis_platform/openai.py +8 -9
- jarvis/jarvis_platform/yuanbao.py +16 -22
- jarvis/jarvis_platform_manager/main.py +52 -1
- jarvis/jarvis_tools/ask_codebase.py +7 -1
- jarvis/jarvis_tools/registry.py +8 -8
- jarvis/jarvis_utils/config.py +10 -1
- jarvis/jarvis_utils/embedding.py +1 -10
- jarvis/jarvis_utils/methodology.py +37 -0
- jarvis/jarvis_utils/output.py +51 -62
- {jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/METADATA +3 -2
- {jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/RECORD +25 -26
- jarvis/jarvis_agent/file_input_handler.py +0 -108
- {jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/licenses/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/top_level.txt +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
jarvis/__init__.py,sha256=
|
|
2
|
-
jarvis/jarvis_agent/__init__.py,sha256=
|
|
1
|
+
jarvis/__init__.py,sha256=t4h_MblKCYi1ODQZesEYCj6v7ydz3wTPEIcWq22dQ3U,74
|
|
2
|
+
jarvis/jarvis_agent/__init__.py,sha256=ImVbBD4C5iq0z0DbtzIdBT2gzN7UcnWs9YeSgjoQxNE,29064
|
|
3
3
|
jarvis/jarvis_agent/builtin_input_handler.py,sha256=KhvlV_QdB3P-M0TCkWvdxidNie1jU7KoMOqTIXCpwwA,1529
|
|
4
|
-
jarvis/jarvis_agent/
|
|
5
|
-
jarvis/jarvis_agent/jarvis.py,sha256=IuM-A9KZd1jqOFszB2l-Ua1FE5uVGvvNia1SSgp7Jgg,5963
|
|
4
|
+
jarvis/jarvis_agent/jarvis.py,sha256=r1fcQtPCWOMKVC9SdzUdjutaz5C3STuL7C9CqDXDLwE,5920
|
|
6
5
|
jarvis/jarvis_agent/main.py,sha256=IAD59fEMWWSSAtHJhOQMPs_NMoKtcYjrxlTvhCHEVII,2626
|
|
7
6
|
jarvis/jarvis_agent/output_handler.py,sha256=7qori-RGrQmdiFepoEe3oPPKJIvRt90l_JDmvCoa4zA,1219
|
|
8
7
|
jarvis/jarvis_agent/shell_input_handler.py,sha256=pi3AtPKrkKc6K9e99S1djKXQ_XrxtP6FrSWebQmRT6E,1261
|
|
9
8
|
jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
jarvis/jarvis_code_agent/code_agent.py,sha256=
|
|
9
|
+
jarvis/jarvis_code_agent/code_agent.py,sha256=FZS8kR1ZU_k1La3A7eQctRH84LRwqpbwN_Q4jpMFByY,16994
|
|
11
10
|
jarvis/jarvis_code_analysis/code_review.py,sha256=68GCjxdg-n2hoMoCSGWpH_ZdQArc4G09E9Wwhypk4eY,30135
|
|
12
11
|
jarvis/jarvis_code_analysis/checklists/__init__.py,sha256=cKQ_FOGy5TQgM-YkRCqORo-mUOZaPAJ9VDmZoFX58us,78
|
|
13
12
|
jarvis/jarvis_code_analysis/checklists/c_cpp.py,sha256=SXPpYCNeCtU1PpKdKPiYDuOybfY9vaL0ejDn4imxDwA,1317
|
|
@@ -30,7 +29,7 @@ jarvis/jarvis_code_analysis/checklists/sql.py,sha256=ecKKT6wJAibn8R0NxGZDNlm4teY
|
|
|
30
29
|
jarvis/jarvis_code_analysis/checklists/swift.py,sha256=YcsYFxAitHqOtBZjG-RV9-KNM7X5lIcl6zlEI9XfmfM,2566
|
|
31
30
|
jarvis/jarvis_code_analysis/checklists/web.py,sha256=-Pnj1FQTsGVZUQK7-4ptDsGd7a22Cs0585jRAPT2SdQ,3943
|
|
32
31
|
jarvis/jarvis_data/huggingface.tar.gz,sha256=dWKnc_tvyx-I_ZkXo91O0b38KxDmLW1ZbmJ3E6fCl_k,1120205
|
|
33
|
-
jarvis/jarvis_dev/main.py,sha256=
|
|
32
|
+
jarvis/jarvis_dev/main.py,sha256=aqQ3SIek4jtGmkuzmt0FvZ27_9JtaE-dldqXQVH5fgg,42958
|
|
34
33
|
jarvis/jarvis_git_details/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
34
|
jarvis/jarvis_git_details/main.py,sha256=l4Ol96DFISq2ctAgzmfUuS4i6JdWh0JAu_isY3iuzVo,8919
|
|
36
35
|
jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -45,22 +44,22 @@ jarvis/jarvis_lsp/rust.py,sha256=Z2KmvTsIcn5SLM4iaLG4Mael1h6zlZQIiOopbDpurag,371
|
|
|
45
44
|
jarvis/jarvis_mcp/__init__.py,sha256=NF_vqRxaNyz8ColcpRh0bOkinV90YLAKHEN--jkP-B8,2114
|
|
46
45
|
jarvis/jarvis_mcp/sse_mcp_client.py,sha256=FOVzroTw-pifmnF0qdsoQ6KweDCQ0Gxs6d6jl4VopiQ,23483
|
|
47
46
|
jarvis/jarvis_mcp/stdio_mcp_client.py,sha256=KO0ewJuLBZLNqG4EGJcBOtn-8VJIipkq84ENvSwgQAo,11830
|
|
48
|
-
jarvis/jarvis_methodology/main.py,sha256=
|
|
49
|
-
jarvis/jarvis_multi_agent/__init__.py,sha256=
|
|
47
|
+
jarvis/jarvis_methodology/main.py,sha256=QJUMIb9o8JO-l207X5UIbazZKJYKG3F4iuUKtkm0dmg,11840
|
|
48
|
+
jarvis/jarvis_multi_agent/__init__.py,sha256=Xab5sFltJmX_9MoXqanmZs6FqKfUb2v_pG29Vk8ZXaw,4311
|
|
50
49
|
jarvis/jarvis_multi_agent/main.py,sha256=Z6N5VMjzaernnRjPkqgYRv09cIhWIFQ6a__AqHA8xrQ,1567
|
|
51
50
|
jarvis/jarvis_platform/__init__.py,sha256=0YnsUoM4JkIBOtImFdjfuDbrqQZT3dEaAwSJ62DrpCc,104
|
|
52
|
-
jarvis/jarvis_platform/base.py,sha256=
|
|
53
|
-
jarvis/jarvis_platform/human.py,sha256=
|
|
54
|
-
jarvis/jarvis_platform/kimi.py,sha256=
|
|
55
|
-
jarvis/jarvis_platform/openai.py,sha256=
|
|
51
|
+
jarvis/jarvis_platform/base.py,sha256=egcKQ8sUjANArAR48cbddmvsX7s_LexyVefztUAGBKY,6560
|
|
52
|
+
jarvis/jarvis_platform/human.py,sha256=1Jh9xigQaU78WVvsIMaVH0i6QRhaSA1oaErv9BdntF8,2565
|
|
53
|
+
jarvis/jarvis_platform/kimi.py,sha256=p18Ydb_0rgnK3-WZXKUtTBQTh7Da33O277PKWOMqBhA,13106
|
|
54
|
+
jarvis/jarvis_platform/openai.py,sha256=ln-OYxZkWaSY9oDoBPMmMh2TDGN40iTtUURLk8batvQ,4159
|
|
56
55
|
jarvis/jarvis_platform/registry.py,sha256=UjCdPT9WIRxU-F0uuPpKmKRRCcNNxjr-bRTEPgRSNx4,7740
|
|
57
|
-
jarvis/jarvis_platform/yuanbao.py,sha256=
|
|
56
|
+
jarvis/jarvis_platform/yuanbao.py,sha256=0ZXq1seY-gmDLMS2Vq8cu7wLerfoWePScRZIahmkU4s,21668
|
|
58
57
|
jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
|
-
jarvis/jarvis_platform_manager/main.py,sha256=
|
|
58
|
+
jarvis/jarvis_platform_manager/main.py,sha256=VD0hKhLb8SevdFSYDXLRj3xwjBR1DTcRVgyn_Vp55VE,25593
|
|
60
59
|
jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
60
|
jarvis/jarvis_smart_shell/main.py,sha256=uq5NCdNAdcHqvtG0zpajz85SigSKH1SSAcEpyHa_BOc,5180
|
|
62
61
|
jarvis/jarvis_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
-
jarvis/jarvis_tools/ask_codebase.py,sha256=
|
|
62
|
+
jarvis/jarvis_tools/ask_codebase.py,sha256=fD3E4oY1o3-rVuzdgZKMmK4p1GtaW8PyCFyCDJKsM4U,9976
|
|
64
63
|
jarvis/jarvis_tools/ask_user.py,sha256=cWSLG33b79IbIZEWsSNV5RHvGX6eo3nTM8TUhOMnGh8,2167
|
|
65
64
|
jarvis/jarvis_tools/base.py,sha256=SR4dmrgYj3lNmtVDhHtItPvptTqCfw5SGRhgPT3I6ss,1189
|
|
66
65
|
jarvis/jarvis_tools/chdir.py,sha256=wYVBqWF5kaUkKqH3cUAOKUsACzYsFtCCJJyd8UJsp4o,2706
|
|
@@ -77,7 +76,7 @@ jarvis/jarvis_tools/lsp_get_diagnostics.py,sha256=paz1CVZ2Y8nk0U74n1QiG01oDINiZq
|
|
|
77
76
|
jarvis/jarvis_tools/methodology.py,sha256=Md8W2et0xUiuTjUSRCdnlwEPYqah2dCAAkxW_95BXBY,5238
|
|
78
77
|
jarvis/jarvis_tools/read_code.py,sha256=pgztSBRh8RORFalqwzzsLHQogooFvDm1ePBL0E5O1C4,5961
|
|
79
78
|
jarvis/jarvis_tools/read_webpage.py,sha256=LLvAOvaQJodaeNJKQ6dU9MYEE227NMdHyLs7esluUQ4,2217
|
|
80
|
-
jarvis/jarvis_tools/registry.py,sha256=
|
|
79
|
+
jarvis/jarvis_tools/registry.py,sha256=eH-jTesZMAp4N8YNgs-eiRUwzksXB1mgMpWs-E8FrYY,22666
|
|
81
80
|
jarvis/jarvis_tools/rewrite_file.py,sha256=rEPPSNU7uF1iKfEW9npEpZJ2LSoQXjt2OC-_troBToE,7003
|
|
82
81
|
jarvis/jarvis_tools/search_web.py,sha256=-h1WYOqTcYC_8fdkm-4RfwKpbtLTVxOfRROul51NgO0,951
|
|
83
82
|
jarvis/jarvis_tools/virtual_tty.py,sha256=AKAaKY5KcPxifNQoXjzHaL4U6EUVA7irHLwVvz2wLVs,16396
|
|
@@ -85,19 +84,19 @@ jarvis/jarvis_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
85
84
|
jarvis/jarvis_tools/cli/main.py,sha256=lk1MKpL_--JQornbGZGREgjLIhSsB3OJU-GFUfo64IE,5312
|
|
86
85
|
jarvis/jarvis_utils/__init__.py,sha256=l-fsyQ-KzyqAhrJYur8eZAqsgaifGzSm24R2qtRGJ0g,849
|
|
87
86
|
jarvis/jarvis_utils/builtin_replace_map.py,sha256=A-cJ8deht2vDl2iKRhoZ7qECyJ6sboVH5Zx-L9vIBUs,4314
|
|
88
|
-
jarvis/jarvis_utils/config.py,sha256=
|
|
89
|
-
jarvis/jarvis_utils/embedding.py,sha256=
|
|
87
|
+
jarvis/jarvis_utils/config.py,sha256=EdTMfjGHn79CSz-JNZW86LVC31b5di-ig3lH06T50DU,4772
|
|
88
|
+
jarvis/jarvis_utils/embedding.py,sha256=s7ze8-talEED9VXZm1QK5tPdfyj6sXJLP031tDkXeI4,3831
|
|
90
89
|
jarvis/jarvis_utils/file_processors.py,sha256=tSZSMJ4qCJ_lXI0dyLgJ0j5qEh6CDXDSVI7vQiFmcuQ,2976
|
|
91
90
|
jarvis/jarvis_utils/git_utils.py,sha256=MxhUcQ_gFUFyBxBiorEJ1wUk9a2TerFdq3-Z11FB-AE,11324
|
|
92
91
|
jarvis/jarvis_utils/globals.py,sha256=Zs0chxA_giYiolYvawFFpcnTWgCUnn6GEusAh42jbz8,2275
|
|
93
92
|
jarvis/jarvis_utils/input.py,sha256=qGf2q-yWhgT-OX-j_WYi7aZ11jYmuFNiMz2_W1nUOiM,7432
|
|
94
|
-
jarvis/jarvis_utils/methodology.py,sha256=
|
|
95
|
-
jarvis/jarvis_utils/output.py,sha256=
|
|
93
|
+
jarvis/jarvis_utils/methodology.py,sha256=9dmtj6Ei2CRUdQP9TA_xToqZPYcm5_DQovwnRkEShsA,8626
|
|
94
|
+
jarvis/jarvis_utils/output.py,sha256=ervq4aQ4t2q3DskoWqATKYAfKhLtskyQwPhGtwFp_ck,8340
|
|
96
95
|
jarvis/jarvis_utils/tag.py,sha256=YJHmuedLb7_AiqvKQetHr4R1FxyzIh7HN0RRkWMmYbU,429
|
|
97
96
|
jarvis/jarvis_utils/utils.py,sha256=iIcefLa1kvALkmQ19BLWDplmxrcOjtxWAgBIxrs8ytg,4439
|
|
98
|
-
jarvis_ai_assistant-0.1.
|
|
99
|
-
jarvis_ai_assistant-0.1.
|
|
100
|
-
jarvis_ai_assistant-0.1.
|
|
101
|
-
jarvis_ai_assistant-0.1.
|
|
102
|
-
jarvis_ai_assistant-0.1.
|
|
103
|
-
jarvis_ai_assistant-0.1.
|
|
97
|
+
jarvis_ai_assistant-0.1.176.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
|
|
98
|
+
jarvis_ai_assistant-0.1.176.dist-info/METADATA,sha256=ku5RGDDI7kKDPucm9onv6KiUqx_VDzTHP0BV7xt74uY,14602
|
|
99
|
+
jarvis_ai_assistant-0.1.176.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
100
|
+
jarvis_ai_assistant-0.1.176.dist-info/entry_points.txt,sha256=rjj61tZ7ahLi1R-JkJmX-IzIPPHD8mnwDZap1CnMe2s,973
|
|
101
|
+
jarvis_ai_assistant-0.1.176.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
|
102
|
+
jarvis_ai_assistant-0.1.176.dist-info/RECORD,,
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import os
|
|
5
|
-
import re
|
|
6
|
-
from typing import Any, Tuple
|
|
7
|
-
|
|
8
|
-
from yaspin import yaspin
|
|
9
|
-
|
|
10
|
-
from jarvis.jarvis_tools.file_operation import FileOperationTool
|
|
11
|
-
from jarvis.jarvis_utils.output import OutputType, PrettyOutput
|
|
12
|
-
from jarvis.jarvis_utils.utils import is_context_overflow
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def file_input_handler(user_input: str, agent: Any) -> Tuple[str, bool]:
|
|
16
|
-
"""Process user input containing file references and read file contents.
|
|
17
|
-
|
|
18
|
-
Args:
|
|
19
|
-
user_input: Input string that may contain file references in format:
|
|
20
|
-
- 'file_path' (whole file)
|
|
21
|
-
- 'file_path:start_line,end_line' (line range)
|
|
22
|
-
- 'file_path:start_line:end_line' (alternative range format)
|
|
23
|
-
agent: Agent object for further processing (currently unused)
|
|
24
|
-
|
|
25
|
-
Returns:
|
|
26
|
-
Tuple[str, bool]:
|
|
27
|
-
- Processed prompt string with file contents prepended
|
|
28
|
-
- Boolean indicating if context overflow occurred
|
|
29
|
-
"""
|
|
30
|
-
prompt = user_input
|
|
31
|
-
files = []
|
|
32
|
-
|
|
33
|
-
file_refs = re.findall(r"'([^']+)'", user_input)
|
|
34
|
-
for ref in file_refs:
|
|
35
|
-
# Handle file:start,end or file:start:end format
|
|
36
|
-
if ':' in ref:
|
|
37
|
-
file_path, line_range = ref.split(':', 1)
|
|
38
|
-
# Initialize with default values
|
|
39
|
-
start_line = 1 # 1-based
|
|
40
|
-
end_line = -1
|
|
41
|
-
|
|
42
|
-
# Process line range if specified
|
|
43
|
-
if ',' in line_range or ':' in line_range:
|
|
44
|
-
try:
|
|
45
|
-
raw_start, raw_end = map(int, re.split(r'[,:]', line_range))
|
|
46
|
-
|
|
47
|
-
# Handle special values and Python-style negative indices
|
|
48
|
-
try:
|
|
49
|
-
with open(file_path, 'r', encoding='utf-8', errors="ignore") as f:
|
|
50
|
-
total_lines = len(f.readlines())
|
|
51
|
-
except FileNotFoundError:
|
|
52
|
-
PrettyOutput.print(f"文件不存在: {file_path}", OutputType.WARNING)
|
|
53
|
-
continue
|
|
54
|
-
# Process start line (0 means whole file, negative means from end)
|
|
55
|
-
if raw_start == 0: # 0表示整个文件
|
|
56
|
-
start_line = 1
|
|
57
|
-
end_line = total_lines
|
|
58
|
-
else:
|
|
59
|
-
start_line = raw_start if raw_start > 0 else total_lines + raw_start + 1
|
|
60
|
-
|
|
61
|
-
# Process end line
|
|
62
|
-
if raw_end == 0: # 0表示整个文件(如果start也是0)
|
|
63
|
-
end_line = total_lines
|
|
64
|
-
else:
|
|
65
|
-
end_line = raw_end if raw_end > 0 else total_lines + raw_end + 1
|
|
66
|
-
|
|
67
|
-
# Auto-correct ranges
|
|
68
|
-
start_line = max(1, min(start_line, total_lines))
|
|
69
|
-
end_line = max(start_line, min(end_line, total_lines))
|
|
70
|
-
|
|
71
|
-
# Final validation
|
|
72
|
-
if start_line < 1 or end_line > total_lines or start_line > end_line:
|
|
73
|
-
raise ValueError
|
|
74
|
-
|
|
75
|
-
except:
|
|
76
|
-
continue
|
|
77
|
-
|
|
78
|
-
# Add file if it exists
|
|
79
|
-
if os.path.isfile(file_path):
|
|
80
|
-
files.append({
|
|
81
|
-
"path": file_path,
|
|
82
|
-
"start_line": start_line,
|
|
83
|
-
"end_line": end_line
|
|
84
|
-
})
|
|
85
|
-
else:
|
|
86
|
-
# Handle simple file path
|
|
87
|
-
if os.path.isfile(ref):
|
|
88
|
-
files.append({
|
|
89
|
-
"path": ref,
|
|
90
|
-
"start_line": 1, # 1-based
|
|
91
|
-
"end_line": -1
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
# Read and process files if any were found
|
|
95
|
-
if files:
|
|
96
|
-
with yaspin(text="正在读取文件...", color="cyan") as spinner:
|
|
97
|
-
old_prompt = prompt
|
|
98
|
-
result = FileOperationTool().execute({"operation":"read","files": files})
|
|
99
|
-
if result["success"]:
|
|
100
|
-
spinner.text = "文件读取完成"
|
|
101
|
-
spinner.ok("✅")
|
|
102
|
-
# Prepend file contents to prompt and check for overflow
|
|
103
|
-
prompt = result["stdout"] + "\n" + prompt
|
|
104
|
-
if is_context_overflow(prompt):
|
|
105
|
-
return old_prompt, False
|
|
106
|
-
|
|
107
|
-
return prompt, False
|
|
108
|
-
|
|
File without changes
|
{jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{jarvis_ai_assistant-0.1.174.dist-info → jarvis_ai_assistant-0.1.176.dist-info}/top_level.txt
RENAMED
|
File without changes
|