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

@@ -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
@@ -1,117 +0,0 @@
1
- import os
2
- import re
3
- from typing import Dict, List, Optional, Tuple
4
-
5
- from jarvis.jarvis_code_agent.file_select import select_files
6
- from jarvis.jarvis_codebase.main import CodeBase
7
- from jarvis.jarvis_platform.registry import PlatformRegistry
8
- from jarvis.jarvis_utils import OutputType, PrettyOutput
9
-
10
- def make_question(requirement: str) -> Optional[str]:
11
- """Generate structured questions to gather necessary information for the requirement."""
12
- prompt = f"""
13
- # 🔍 Role Definition
14
- You are a code analysis expert who helps developers understand existing system implementations by asking targeted questions.
15
-
16
- # 🎯 Core Objectives
17
- - Understand current system implementations
18
- - Identify integration points and interfaces
19
- - Discover extension mechanisms
20
- - Map component interactions
21
-
22
- # 📋 Question Categories
23
- ## 1. System Architecture
24
- Focus on system structure and design:
25
- - Existing interfaces and classes
26
- - Component integration patterns
27
- - Extension points and hooks
28
- - System boundaries
29
-
30
- ## 2. Implementation Details
31
- Explore current codebase:
32
- - Workflow implementations
33
- - Hook and callback systems
34
- - Interface hierarchies
35
- - Extension mechanisms
36
-
37
- ## 3. Integration Patterns
38
- Understand connection points:
39
- - Component interactions
40
- - Integration interfaces
41
- - Extension methods
42
- - Plugin systems
43
-
44
- ## 4. Extension Mechanisms
45
- Identify customization options:
46
- - Extension patterns
47
- - Plugin architectures
48
- - Configuration systems
49
- - Customization points
50
-
51
- # 📝 Question Guidelines
52
- ## Good Questions
53
- - "What interfaces currently handle user authentication?"
54
- - "How does the system expose extension points for plugins?"
55
- - "Where are the existing hooks for custom providers?"
56
-
57
- ## Bad Questions
58
- - "How should we implement the new feature?"
59
- - "What's the best way to add this?"
60
- - "Should we create a new class?"
61
-
62
- # 🎨 Question Template
63
- 3-5 specific questions about existing implementations:
64
- <QUESTION>
65
- 1. System architecture question
66
- 2. Implementation details question
67
- 3. Integration or extension question
68
- </QUESTION>
69
-
70
- # 🔎 Investigation Focus
71
- 1. Current System
72
- - Existing implementations
73
- - Active interfaces
74
- - Current patterns
75
-
76
- 2. Integration Points
77
- - Connection methods
78
- - Extension hooks
79
- - Plugin systems
80
-
81
- 3. Extension Options
82
- - Customization points
83
- - Configuration options
84
- - Extension patterns
85
-
86
- # ❗ Important Rules
87
- 1. Focus on EXISTING code
88
- 2. Ask about current patterns
89
- 3. Explore extension points
90
- 4. Investigate interfaces
91
- 5. Map dependencies
92
-
93
- User Requirement:
94
- {requirement}
95
- """
96
- model = PlatformRegistry().get_thinking_platform()
97
- response = model.chat_until_success(prompt)
98
- response = re.search(r'<QUESTION>(.*?)</QUESTION>', response, re.DOTALL)
99
- if response is None:
100
- return None
101
- return response.group(1)
102
-
103
-
104
- def find_relevant_information(user_input: str, root_dir: str) -> Tuple[List[Dict[str, str]], str]:
105
- try:
106
- PrettyOutput.print("从代码库中查找文件...", OutputType.INFO)
107
- codebase = CodeBase(root_dir)
108
- question = make_question(user_input)
109
- if question is None:
110
- return [], ""
111
- files_from_codebase, infomation = codebase.ask_codebase(question)
112
-
113
- selected_files = select_files(files_from_codebase, os.getcwd())
114
- return selected_files, infomation
115
- except Exception:
116
- PrettyOutput.print("查找相关文件失败", OutputType.ERROR)
117
- return [], ""