jarvis-ai-assistant 0.1.103__py3-none-any.whl → 0.1.105__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.

Files changed (65) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/agent.py +124 -67
  3. jarvis/jarvis_code_agent/code_agent.py +133 -22
  4. jarvis/jarvis_code_agent/file_select.py +4 -6
  5. jarvis/jarvis_code_agent/patch.py +6 -7
  6. jarvis/jarvis_code_agent/relevant_files.py +163 -41
  7. jarvis/jarvis_codebase/main.py +43 -29
  8. jarvis/jarvis_lsp/base.py +143 -0
  9. jarvis/jarvis_lsp/cpp.py +134 -0
  10. jarvis/jarvis_lsp/go.py +140 -0
  11. jarvis/jarvis_lsp/python.py +135 -0
  12. jarvis/jarvis_lsp/registry.py +234 -0
  13. jarvis/jarvis_lsp/rust.py +142 -0
  14. jarvis/jarvis_platform/__init__.py +3 -0
  15. jarvis/{models → jarvis_platform}/ai8.py +1 -1
  16. jarvis/{models → jarvis_platform}/kimi.py +1 -1
  17. jarvis/{models → jarvis_platform}/ollama.py +1 -1
  18. jarvis/{models → jarvis_platform}/openai.py +1 -1
  19. jarvis/{models → jarvis_platform}/oyi.py +1 -1
  20. jarvis/{models → jarvis_platform}/registry.py +11 -11
  21. jarvis/{jarvis_platform → jarvis_platform_manager}/main.py +2 -2
  22. jarvis/jarvis_rag/main.py +8 -8
  23. jarvis/jarvis_smart_shell/main.py +3 -3
  24. jarvis/jarvis_tools/__init__.py +0 -0
  25. jarvis/{tools → jarvis_tools}/ask_codebase.py +1 -4
  26. jarvis/{tools → jarvis_tools}/ask_user.py +1 -1
  27. jarvis/{tools → jarvis_tools}/chdir.py +2 -37
  28. jarvis/jarvis_tools/code_review.py +236 -0
  29. jarvis/jarvis_tools/create_code_agent.py +115 -0
  30. jarvis/{tools → jarvis_tools}/create_sub_agent.py +1 -1
  31. jarvis/jarvis_tools/deep_thinking.py +160 -0
  32. jarvis/jarvis_tools/deep_thinking_agent.py +146 -0
  33. jarvis/{tools → jarvis_tools}/git_commiter.py +3 -3
  34. jarvis/jarvis_tools/lsp_find_definition.py +134 -0
  35. jarvis/jarvis_tools/lsp_find_references.py +111 -0
  36. jarvis/jarvis_tools/lsp_get_diagnostics.py +121 -0
  37. jarvis/jarvis_tools/lsp_get_document_symbols.py +87 -0
  38. jarvis/jarvis_tools/lsp_prepare_rename.py +130 -0
  39. jarvis/jarvis_tools/lsp_validate_edit.py +141 -0
  40. jarvis/{tools → jarvis_tools}/methodology.py +6 -1
  41. jarvis/{tools → jarvis_tools}/rag.py +1 -1
  42. jarvis/{tools → jarvis_tools}/read_code.py +0 -31
  43. jarvis/{tools → jarvis_tools}/registry.py +6 -5
  44. jarvis/{tools → jarvis_tools}/search.py +2 -2
  45. jarvis/utils.py +71 -28
  46. {jarvis_ai_assistant-0.1.103.dist-info → jarvis_ai_assistant-0.1.105.dist-info}/METADATA +98 -62
  47. jarvis_ai_assistant-0.1.105.dist-info/RECORD +62 -0
  48. {jarvis_ai_assistant-0.1.103.dist-info → jarvis_ai_assistant-0.1.105.dist-info}/entry_points.txt +4 -4
  49. jarvis/models/__init__.py +0 -3
  50. jarvis/tools/code_review.py +0 -163
  51. jarvis/tools/create_code_sub_agent.py +0 -30
  52. jarvis/tools/create_code_test_agent.py +0 -115
  53. jarvis/tools/create_ctags_agent.py +0 -176
  54. jarvis/tools/find_in_codebase.py +0 -108
  55. jarvis_ai_assistant-0.1.103.dist-info/RECORD +0 -51
  56. /jarvis/{models → jarvis_platform}/base.py +0 -0
  57. /jarvis/{tools → jarvis_platform_manager}/__init__.py +0 -0
  58. /jarvis/{tools → jarvis_tools}/base.py +0 -0
  59. /jarvis/{tools → jarvis_tools}/execute_shell.py +0 -0
  60. /jarvis/{tools → jarvis_tools}/file_operation.py +0 -0
  61. /jarvis/{tools → jarvis_tools}/read_webpage.py +0 -0
  62. /jarvis/{tools → jarvis_tools}/select_code_files.py +0 -0
  63. {jarvis_ai_assistant-0.1.103.dist-info → jarvis_ai_assistant-0.1.105.dist-info}/LICENSE +0 -0
  64. {jarvis_ai_assistant-0.1.103.dist-info → jarvis_ai_assistant-0.1.105.dist-info}/WHEEL +0 -0
  65. {jarvis_ai_assistant-0.1.103.dist-info → jarvis_ai_assistant-0.1.105.dist-info}/top_level.txt +0 -0
@@ -1,176 +0,0 @@
1
- from typing import Dict, Any
2
- import subprocess
3
- import os
4
- from pathlib import Path
5
-
6
- import yaml
7
- from jarvis.agent import Agent
8
- from jarvis.tools.registry import ToolRegistry
9
- from jarvis.utils import OutputType, PrettyOutput, get_multiline_input, init_env
10
-
11
- ctags_system_prompt = """You are a Ctags Expert Agent specializing in code analysis using Exuberant Ctags. Follow this protocol:
12
-
13
- 【OUTPUT OPTIMIZATION】
14
- 1. Filter with grep:
15
- ctags -x <symbol> | grep -E 'pattern'
16
- 2. Limit output lines:
17
- head -n 20
18
- 3. Context preview:
19
- grep -A 3 -B 3 <line> <file>
20
- 4. Column selection:
21
- cut -f 1,3
22
- 5. Sort and deduplicate:
23
- sort | uniq
24
-
25
- 【WORKFLOW】
26
- 1. REQUIREMENT ANALYSIS
27
- - Analyze query for symbols/patterns
28
- - Determine search scope
29
- - Select ctags options
30
- - Plan output filtering
31
-
32
- 2. TAGS MANAGEMENT
33
- - Generate/update tags file:
34
- ctags -R --languages=<lang> --exclude=<pattern>
35
- - Verify tags file integrity
36
- - Maintain tags file versioning
37
-
38
- 3. SYMBOL PROCESSING
39
- - Search symbols using:
40
- grep -n <symbol> tags
41
- ctags -x --<filter>
42
- - Analyze symbol relationships
43
- - Map symbol dependencies
44
- - Apply output filters:
45
- * Remove noise with grep -v
46
- * Highlight key fields with awk
47
- * Truncate long lines with cut
48
-
49
- 4. OUTPUT GENERATION
50
- - Format results as YAML
51
- - Include file paths and line numbers
52
- - Add symbol metadata
53
- - Limit to 20 key results
54
- - Exclude temporary files
55
- - Compress repetitive info
56
-
57
- 【COMMAND REFERENCE】
58
- 1. Generate Tags:
59
- ctags -R --fields=+nKSt --extras=+fq -V *
60
-
61
- 2. Search Patterns:
62
- ctags -x --c-types=f
63
- ctags -x --sort=no <symbol>
64
- ctags -x | grep '^main' | head -n 5
65
-
66
- 3. Language Specific:
67
- --languages=Python,Java,C++
68
- --python-kinds=-iv
69
-
70
- 4. Filtering:
71
- --exclude=.git
72
- --exclude=*.min.js
73
- ctags -x | grep -v '_test' # Exclude tests
74
-
75
- 【ERROR HANDLING】
76
- - Missing tags: Regenerate tags
77
- - Invalid symbols: Use fuzzy search
78
- - Encoding issues: Use --input-encoding
79
- - Large codebase: Limit scope
80
- - Output too long: Add head/grep filters
81
-
82
- 【NATURAL LANGUAGE PROCESSING】
83
- 1. Query Interpretation:
84
- - Identify key terms: "find", "locate", "list", "show"
85
- - Detect symbol types: class, function, variable
86
- - Recognize relationships: "calls", "inherits", "uses"
87
-
88
- 2. Query Types:
89
- - Location: "Where is X defined?"
90
- - References: "Who calls Y?"
91
- - Hierarchy: "Show subclasses of Z"
92
- - Impact: "What uses this module?"
93
-
94
- 3. Auto Command Mapping:
95
- | Query Pattern | Ctags Command |
96
- |------------------------------|------------------------------------|
97
- | Find definitions of X | ctags -x --<lang>-kinds=f | less |
98
- | List all functions in Y | ctags -x --filter='function' |
99
- | Show callers of Z | ctags --extra=+q -x | grep Z |
100
- | Find interface implementations| ctags -x --_traits=yes |
101
-
102
- 4. Context Handling:
103
- - Detect language from file extensions
104
- - Auto-detect project root
105
- - Apply language-specific filters
106
- - Choose appropriate output format:
107
- * Simple list for single results
108
- * Table for multiple entries
109
- * Tree view for hierarchies
110
- * JSON when programmatic access needed
111
-
112
- 【EXAMPLE QUERIES】
113
- 1. "Find all Python functions in src/ that use Redis"
114
- 2. "Show Java classes implementing PaymentService"
115
- 3. "List called methods in auth module"
116
- 4. "Where is User model defined?"
117
- 5. "What config files reference database settings?"
118
- """
119
-
120
- class CtagsTool:
121
- name = "create_ctags_agent"
122
- description = "Analyze code structure and symbols using natural language queries"
123
- parameters = {
124
- "type": "object",
125
- "properties": {
126
- "query": {
127
- "type": "string",
128
- "description": "Natural language description of code analysis needs"
129
- }
130
- },
131
- "required": ["query"]
132
- }
133
-
134
- def execute(self, args: Dict) -> Dict[str, Any]:
135
- """Execute code analysis based on natural language query"""
136
- try:
137
- tool_registry = ToolRegistry()
138
- tool_registry.use_tools(["execute_shell"])
139
-
140
- ctags_agent = Agent(
141
- system_prompt=ctags_system_prompt,
142
- name="Ctags Analysis Agent",
143
- is_sub_agent=True,
144
- tool_registry=tool_registry
145
- )
146
-
147
- analysis_request = f"""
148
- Analysis Request: {args['query']}
149
- Context: {args.get('context', {})}
150
- """
151
-
152
- result = ctags_agent.run(analysis_request)
153
-
154
- return {
155
- "success": True,
156
- "stdout": result,
157
- "stderr": ""
158
- }
159
- except Exception as e:
160
- return {
161
- "success": False,
162
- "stdout": "",
163
- "stderr": f"Analysis failed: {str(e)}"
164
- }
165
-
166
- def main():
167
- """CLI testing"""
168
- init_env()
169
- tool = CtagsTool()
170
- query = get_multiline_input("Please enter your query:")
171
- result = tool.execute({
172
- "query": query
173
- })
174
- PrettyOutput.print(yaml.dump(result, default_style='|'), OutputType.INFO)
175
- if __name__ == "__main__":
176
- main()
@@ -1,108 +0,0 @@
1
- from typing import Dict, Any
2
- from jarvis.jarvis_code_agent.file_select import select_files
3
- from jarvis.utils import OutputType, PrettyOutput, dont_use_local_model, find_git_root
4
- from jarvis.jarvis_codebase.main import CodeBase
5
-
6
- class FindInCodebaseTool:
7
- """Tool for searching files in codebase based on requirements"""
8
-
9
- name = "find_in_codebase"
10
- description = "Search and identify relevant code files in the codebase based on requirements description, using semantic search"
11
- parameters = {
12
- "type": "object",
13
- "properties": {
14
- "query": {
15
- "type": "string",
16
- "description": "The search query or requirement description"
17
- },
18
- "top_k": {
19
- "type": "integer",
20
- "description": "Maximum number of results to return",
21
- "default": 20
22
- }
23
- },
24
- "required": ["query"]
25
- }
26
-
27
- @staticmethod
28
- def check() -> bool:
29
- return not dont_use_local_model()
30
-
31
- def execute(self, args: Dict) -> Dict[str, Any]:
32
- """Execute the search
33
-
34
- Args:
35
- args: Dictionary containing:
36
- - query: Search query string
37
- - top_k: Maximum number of results (optional)
38
-
39
- Returns:
40
- Dict containing:
41
- - success: Boolean indicating success
42
- - stdout: Search results in YAML format
43
- - stderr: Error message if any
44
- """
45
- try:
46
- query = args["query"]
47
- top_k = args.get("top_k", 20)
48
-
49
- root_dir = find_git_root()
50
-
51
- codebase = CodeBase(root_dir)
52
-
53
- # Search for relevant files
54
- results = codebase.search_similar(query, top_k)
55
-
56
- results = select_files(results, root_dir)
57
-
58
- if not results:
59
- return {
60
- "success": True,
61
- "stdout": "files: []\n",
62
- "stderr": "No relevant files found"
63
- }
64
-
65
-
66
- return {
67
- "success": True,
68
- "stdout": "\n".join(results),
69
- "stderr": ""
70
- }
71
-
72
- except Exception as e:
73
- PrettyOutput.print(f"Search error: {str(e)}", OutputType.ERROR)
74
- return {
75
- "success": False,
76
- "stdout": "",
77
- "stderr": f"Failed to execute search: {str(e)}"
78
- }
79
-
80
- def main():
81
- """Command line interface for the tool"""
82
- import argparse
83
-
84
- parser = argparse.ArgumentParser(description='Search for relevant files in codebase')
85
- parser.add_argument('query', help='Search query or requirement description')
86
- parser.add_argument('--top-k', type=int, default=20, help='Maximum number of results to return')
87
-
88
- args = parser.parse_args()
89
-
90
- tool = FindInCodebaseTool()
91
- result = tool.execute({
92
- "query": args.query,
93
- "top_k": args.top_k
94
- })
95
-
96
- if result["success"]:
97
- if result["stdout"]:
98
- print(result["stdout"])
99
- else:
100
- PrettyOutput.print("No relevant files found", OutputType.WARNING)
101
- else:
102
- PrettyOutput.print(result["stderr"], OutputType.ERROR)
103
- return 1
104
-
105
- return 0
106
-
107
- if __name__ == "__main__":
108
- exit(main())
@@ -1,51 +0,0 @@
1
- jarvis/__init__.py,sha256=A2vW7Ac_EmnSRhUOBJFq0qUWC2iJ1qwVxHAT5sJhxnk,51
2
- jarvis/agent.py,sha256=6r5_pv3sumUrUCd2ntWVGg7yp1KTA3JCzz2IKH582k0,20010
3
- jarvis/utils.py,sha256=FiWpRM0RjSJyDRimhvU2xa5SIUI70rxWq4ItSeMOCfw,20715
4
- jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- jarvis/jarvis_code_agent/code_agent.py,sha256=8dIiFPZiWOEyIBDWUrqAdtn9g7eFrvvcCGPx5S56Ngc,6757
6
- jarvis/jarvis_code_agent/file_select.py,sha256=59s_w1E0ihY1RxBZ1kyXNyQVTHjmjO8L9mg2FtjrsyQ,8192
7
- jarvis/jarvis_code_agent/patch.py,sha256=du06gKWwmKcDPEtZmQJCOZbotNMKVtS-bz-8MYT78b0,4044
8
- jarvis/jarvis_code_agent/relevant_files.py,sha256=8rL-hfdelJhWSt6MJKaxmQmFXf-WY-O8L18Ntw9dpnE,2686
9
- jarvis/jarvis_codebase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- jarvis/jarvis_codebase/main.py,sha256=Q_kVOjtL_AgSVkVUUYBNNKqA386GVxpnx0FXj1omUOc,36739
11
- jarvis/jarvis_platform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- jarvis/jarvis_platform/main.py,sha256=waLMHQmdecph_mZuPXWjpkmqibJFYHnCHroL9gL0nh0,4959
13
- jarvis/jarvis_rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- jarvis/jarvis_rag/main.py,sha256=4St9VkaqK9zOq7AgurLB02nEj1_SvZAiFWhS3i_FcBY,33167
15
- jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- jarvis/jarvis_smart_shell/main.py,sha256=yWsD9Td81sr8I1pkimlDxucDPaLWb95NuCo4LCGnT7M,3947
17
- jarvis/models/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
18
- jarvis/models/ai8.py,sha256=QwpcdvOAixFC4BOI2AsWC9290WqcrLj6lQOiT0A3Id4,11994
19
- jarvis/models/base.py,sha256=nQ-rsJL1Z-gMev3TPoY7tYdwxhCJY8LG6_gtJ-maiW0,2181
20
- jarvis/models/kimi.py,sha256=2x60DVjX0ph2fJjKj_NICeb0q4qVBihuc_laCpH94eo,15759
21
- jarvis/models/ollama.py,sha256=WiUYkstaqFjiawXfuJs2GQUa3l3Y2ZWqhnKDBcF7rUQ,5672
22
- jarvis/models/openai.py,sha256=SAbVIvFO4q6bRl8zlDaH5bKbrP0T_zd1WzlbkPCvkwg,4121
23
- jarvis/models/oyi.py,sha256=nNBe-A0cOZ6vuGrnrUjeuC3N3oYRQeFazTUpFrAmx2w,15080
24
- jarvis/models/registry.py,sha256=nDYyGzT2uGSxbEbqp1JhuXa7bXeiMaX4hPAFAg74eyA,8683
25
- jarvis/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- jarvis/tools/ask_codebase.py,sha256=cYMQd2Ba0Ka_Kpt9dAJrbcPhaXvfY_-A8S6i0UxtY3w,2975
27
- jarvis/tools/ask_user.py,sha256=k0PcMqvCkf_W9kMWnFsgcFefVf1A5DhpM6WVXFMdhdQ,1823
28
- jarvis/tools/base.py,sha256=c0DMoDDPxmsqUYJR989zgUs7nIYRY6GWBrAdusIZKjc,656
29
- jarvis/tools/chdir.py,sha256=3aGvpvWO6Fj9RdjWXanjeNBDZ7kz3TO8_Zo8DurENDk,2934
30
- jarvis/tools/code_review.py,sha256=Reck765EIfhx8mteaJPw9IRnBkEzGS8INcQ0vVoKUw8,4939
31
- jarvis/tools/create_code_sub_agent.py,sha256=_G2HUWyik5FFCV1JU8JqF_mutcW6n6WWCvkhb5LGrL0,765
32
- jarvis/tools/create_code_test_agent.py,sha256=SqdIpymoDUX7L6hh5vqnZLyeVwW-QmLfytU-xkG7Gag,3462
33
- jarvis/tools/create_ctags_agent.py,sha256=P-vqqUxh33R6kuMy8b5s3bANh1cVmkHpvz0vV5DNbXE,5184
34
- jarvis/tools/create_sub_agent.py,sha256=0lZDtYRFjr9C9xtBKV-sxWfhK0TX-cxAHj3Zez76A4s,2853
35
- jarvis/tools/execute_shell.py,sha256=bawfof8bUg3f9bjyCSifLa9bU-hkNoNOuos22uZffdg,2564
36
- jarvis/tools/file_operation.py,sha256=-1U_J5SEuBjRylzEl7wvCfjspNv6aA49UvFHLNQ3bJU,4098
37
- jarvis/tools/find_in_codebase.py,sha256=u-T6mEWv6JyE74fYZBjVlxXsqUnkf0BtgwVUy-SX4XI,3321
38
- jarvis/tools/git_commiter.py,sha256=BcapUhKymAV5Ofi-Cjg4nvYiAj4u5yBaOfsIr0iEp0c,2536
39
- jarvis/tools/methodology.py,sha256=yZldtjPZpNq8eGJ6IbhwHB0v3cFUtfPd14r7LDCo5IU,5622
40
- jarvis/tools/rag.py,sha256=m8s-7dCPFhUrdTHvKj3HulNSsoOssBN7kqqn9n1l3Zw,4943
41
- jarvis/tools/read_code.py,sha256=_ObjMWirIYOdZi-D9KSRTd_4tg-5WwKLOn5ilrTF77I,4834
42
- jarvis/tools/read_webpage.py,sha256=JCReSXhkDHDkQ606sZYIKG1Itlprjpmu1sSbF-Ed-jI,2478
43
- jarvis/tools/registry.py,sha256=81Q_x9BJV6SIfPWURq4uzXxP2JCiFeaGbGM1IO5FSy4,11658
44
- jarvis/tools/search.py,sha256=IciWpdKoa03Kl5J1SdblI2VhkUBoIRuLHHM2X4KlMWE,9209
45
- jarvis/tools/select_code_files.py,sha256=bjJGwCNw0Ue_8jW60K1gcy1rUgKqoHihicu5SS58WNk,1890
46
- jarvis_ai_assistant-0.1.103.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
47
- jarvis_ai_assistant-0.1.103.dist-info/METADATA,sha256=Tr5iXpTFgFd9Z-iSNzIi1B0nB4HA6NfY2l5k4QRKgs8,12913
48
- jarvis_ai_assistant-0.1.103.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
49
- jarvis_ai_assistant-0.1.103.dist-info/entry_points.txt,sha256=jHc8XiYoVNlzKcvV5mA-uYvlDRUTO_74_glpb5vvvUg,494
50
- jarvis_ai_assistant-0.1.103.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
51
- jarvis_ai_assistant-0.1.103.dist-info/RECORD,,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes