fancygit 1.0.25__tar.gz → 1.0.26__tar.gz
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.
- {fancygit-1.0.25 → fancygit-1.0.26}/PKG-INFO +1 -1
- fancygit-1.0.26/VERSION +1 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.egg-info/PKG-INFO +1 -1
- {fancygit-1.0.25 → fancygit-1.0.26}/src/ai_engine.py +37 -11
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_ai_engine.py +2 -3
- fancygit-1.0.25/VERSION +0 -1
- {fancygit-1.0.25 → fancygit-1.0.26}/CD_GUIDE.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/COLOR_SYSTEM_GUIDE.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/EMAIL_SETUP_GUIDE.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/LICENSE +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/MANIFEST.in +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/PYPI_DESCRIPTION.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/README.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/TESTING_GUIDE.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/TESTING_SUMMARY.md +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/command-list.txt +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.egg-info/SOURCES.txt +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.egg-info/dependency_links.txt +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.egg-info/entry_points.txt +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.egg-info/requires.txt +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.egg-info/top_level.txt +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/fancygit.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/game_questions.json +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/images/Logo.png +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/images/Logo_with_name.png +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/images/dark_background_logo.png +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/images/light_background_logo.png +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/images/overview.png +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/quiz_server.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/setup.cfg +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/setup.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/__init__.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/colors.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/config_manager.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/fancygit_config_dc.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/git_error.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/git_error_parser.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/git_insights.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/git_runner.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/loading_animation.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/merge_conflict.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/mermaid_export.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/model_provider.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/output_colorizer.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/providers/__init__.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/providers/anthropic_model.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/providers/base_model.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/providers/ollama_model.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/providers/openai_model.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/quiz_html_generator.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/quiz_manager.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/repo_inspector.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/repo_state.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/src/utils.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/__init__.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/conftest.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_ai_integration.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_config_manager.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_conflict_parser_integration.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_fancygit_advanced.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_fancygit_commands.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_fancygit_integration.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_fancygit_workflows.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_git_error.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_git_error_parser.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_git_runner.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_model_provider.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_ollama_model.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_providers.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/tests/test_undo_redo.py +0 -0
- {fancygit-1.0.25 → fancygit-1.0.26}/welcome.py +0 -0
fancygit-1.0.26/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.26
|
|
@@ -3,6 +3,7 @@ from src.model_provider import ModelProvider
|
|
|
3
3
|
from src.providers.ollama_model import OllamaModel
|
|
4
4
|
from src.config_manager import ConfigManager
|
|
5
5
|
from typing import List, Dict, Optional
|
|
6
|
+
import re
|
|
6
7
|
import time
|
|
7
8
|
|
|
8
9
|
class AIEngine:
|
|
@@ -38,10 +39,25 @@ class AIEngine:
|
|
|
38
39
|
|
|
39
40
|
try:
|
|
40
41
|
response = self.analysis_provider._call_model(prompt)
|
|
41
|
-
return response if response else "Unable to get AI analysis."
|
|
42
|
+
return self._strip_markdown(response) if response else "Unable to get AI analysis."
|
|
42
43
|
except Exception as e:
|
|
43
44
|
return f"Failed to get AI analysis: {str(e)}"
|
|
44
45
|
|
|
46
|
+
def _strip_markdown(self, text: str) -> str:
|
|
47
|
+
"""Remove markdown formatting so output renders cleanly in a terminal."""
|
|
48
|
+
# Remove bold/italic: **text**, *text*, __text__, _text_
|
|
49
|
+
text = re.sub(r'\*{1,3}(.*?)\*{1,3}', r'\1', text)
|
|
50
|
+
text = re.sub(r'_{1,3}(.*?)_{1,3}', r'\1', text)
|
|
51
|
+
# Remove ATX headings: ## Heading → Heading
|
|
52
|
+
text = re.sub(r'^\s{0,3}#{1,6}\s+', '', text, flags=re.MULTILINE)
|
|
53
|
+
# Remove inline code: `code` → code
|
|
54
|
+
text = re.sub(r'`([^`]+)`', r'\1', text)
|
|
55
|
+
# Remove code fences
|
|
56
|
+
text = re.sub(r'```.*?```', '', text, flags=re.DOTALL)
|
|
57
|
+
# Collapse 3+ blank lines down to 2
|
|
58
|
+
text = re.sub(r'\n{3,}', '\n\n', text)
|
|
59
|
+
return text.strip()
|
|
60
|
+
|
|
45
61
|
def explain_command(self, command: str) -> Optional[str]:
|
|
46
62
|
"""
|
|
47
63
|
Explain a git command using the configured explanation provider.
|
|
@@ -76,24 +92,34 @@ class AIEngine:
|
|
|
76
92
|
|
|
77
93
|
def _build_analysis_prompt(self, messages: List[Dict]) -> str:
|
|
78
94
|
"""Build the analysis prompt for the AI model"""
|
|
79
|
-
prompt = """You are a Git expert assistant. Analyze the following Git error/warning messages
|
|
80
|
-
1. A clear summary of what went wrong
|
|
81
|
-
2. Step-by-step instructions on how to resolve the issue
|
|
82
|
-
3. Any preventive measures to avoid this in the future
|
|
95
|
+
prompt = """You are a Git expert assistant. Analyze the following Git error/warning messages.
|
|
83
96
|
|
|
84
|
-
|
|
97
|
+
IMPORTANT FORMATTING RULES — you MUST follow these exactly:
|
|
98
|
+
- Plain text only. No markdown. No asterisks, no hashes, no backticks, no bold, no headers.
|
|
99
|
+
- Use this exact structure with these exact labels on their own lines:
|
|
100
|
+
|
|
101
|
+
WHAT WENT WRONG:
|
|
102
|
+
[1-2 sentences explaining the root cause]
|
|
103
|
+
|
|
104
|
+
HOW TO FIX IT:
|
|
105
|
+
1. [first step]
|
|
106
|
+
2. [second step]
|
|
107
|
+
(add more steps only if truly needed)
|
|
108
|
+
|
|
109
|
+
TIP:
|
|
110
|
+
[one short preventive tip, or omit this section entirely if not useful]
|
|
111
|
+
|
|
112
|
+
Messages to analyze:
|
|
113
|
+
"""
|
|
85
114
|
|
|
86
|
-
Messages to analyze:
|
|
87
|
-
"""
|
|
88
|
-
|
|
89
115
|
for i, msg in enumerate(messages, 1):
|
|
90
116
|
severity = msg.get('severity', 'unknown').upper()
|
|
91
117
|
message_text = msg.get('message', str(msg))
|
|
92
118
|
error_type = msg.get('type', 'Unknown')
|
|
93
119
|
file_info = f" (file: {msg.get('file', 'N/A')})" if msg.get('file') else ""
|
|
94
|
-
|
|
120
|
+
|
|
95
121
|
prompt += f"\n{i}. [{severity}] {error_type}{file_info}\n {message_text}\n"
|
|
96
|
-
|
|
122
|
+
|
|
97
123
|
prompt += "\n\nAnalysis:"
|
|
98
124
|
return prompt
|
|
99
125
|
|
|
@@ -139,9 +139,8 @@ class TestAIEngine:
|
|
|
139
139
|
|
|
140
140
|
# Check prompt structure
|
|
141
141
|
assert "You are a Git expert assistant" in call_args
|
|
142
|
-
assert "
|
|
143
|
-
assert "
|
|
144
|
-
assert "3. Any preventive measures" in call_args
|
|
142
|
+
assert "WHAT WENT WRONG:" in call_args
|
|
143
|
+
assert "HOW TO FIX IT:" in call_args
|
|
145
144
|
assert "Messages to analyze:" in call_args
|
|
146
145
|
assert "Analysis:" in call_args
|
|
147
146
|
|
fancygit-1.0.25/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.25
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|