IncludeCPP 3.3.11__py3-none-any.whl → 3.4.2__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.
- includecpp/__init__.py +4 -3
- includecpp/cli/commands.py +665 -62
- includecpp/core/ai_integration.py +69 -34
- includecpp/core/cppy_converter.py +570 -31
- includecpp/core/cssl/__init__.py +40 -0
- includecpp/core/cssl/cssl_builtins.py +1693 -0
- includecpp/core/cssl/cssl_events.py +621 -0
- includecpp/core/cssl/cssl_modules.py +2803 -0
- includecpp/core/cssl/cssl_parser.py +1493 -0
- includecpp/core/cssl/cssl_runtime.py +1549 -0
- includecpp/core/cssl/cssl_syntax.py +488 -0
- includecpp/core/cssl/cssl_types.py +390 -0
- includecpp/core/cssl_bridge.py +132 -0
- includecpp/core/error_formatter.py +50 -19
- includecpp/core/project_ui.py +3370 -0
- includecpp/core/settings_ui.py +127 -48
- includecpp/generator/parser.cpp +81 -0
- {includecpp-3.3.11.dist-info → includecpp-3.4.2.dist-info}/METADATA +160 -18
- includecpp-3.4.2.dist-info/RECORD +40 -0
- includecpp-3.3.11.dist-info/RECORD +0 -30
- {includecpp-3.3.11.dist-info → includecpp-3.4.2.dist-info}/WHEEL +0 -0
- {includecpp-3.3.11.dist-info → includecpp-3.4.2.dist-info}/entry_points.txt +0 -0
- {includecpp-3.3.11.dist-info → includecpp-3.4.2.dist-info}/licenses/LICENSE +0 -0
- {includecpp-3.3.11.dist-info → includecpp-3.4.2.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
|
+
import sys
|
|
3
4
|
import stat
|
|
4
5
|
import requests
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
from datetime import datetime
|
|
7
8
|
from typing import Optional, Dict, List, Tuple, Any
|
|
8
9
|
|
|
10
|
+
|
|
11
|
+
def _supports_unicode():
|
|
12
|
+
"""Check if terminal supports Unicode output."""
|
|
13
|
+
if sys.platform == 'win32':
|
|
14
|
+
try:
|
|
15
|
+
'✓✗❌'.encode(sys.stdout.encoding or 'utf-8')
|
|
16
|
+
return True
|
|
17
|
+
except (UnicodeEncodeError, LookupError, AttributeError):
|
|
18
|
+
return False
|
|
19
|
+
return True
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
_UNICODE_OK = _supports_unicode()
|
|
23
|
+
|
|
24
|
+
# Unicode symbols with ASCII fallbacks
|
|
25
|
+
SYM_CHECK = '✓' if _UNICODE_OK else '[OK]'
|
|
26
|
+
SYM_CROSS = '✗' if _UNICODE_OK else '[X]'
|
|
27
|
+
SYM_ERROR = '❌' if _UNICODE_OK else '[ERR]'
|
|
28
|
+
SYM_ARROW = '→' if _UNICODE_OK else '->'
|
|
29
|
+
SYM_BULLET = '•' if _UNICODE_OK else '*'
|
|
30
|
+
|
|
9
31
|
MODELS = {
|
|
10
32
|
'gpt-3.5-turbo': {'context': 16385, 'endpoint': 'gpt-3.5-turbo'},
|
|
11
33
|
'gpt-4-turbo': {'context': 128000, 'endpoint': 'gpt-4-turbo'},
|
|
@@ -1759,29 +1781,29 @@ class AIVerboseOutput:
|
|
|
1759
1781
|
'white': '\033[37m',
|
|
1760
1782
|
}
|
|
1761
1783
|
|
|
1762
|
-
# Status icons and messages
|
|
1784
|
+
# Status icons and messages - with ASCII fallbacks for Windows
|
|
1763
1785
|
PHASES = {
|
|
1764
|
-
'init': ('⚙', 'cyan', 'Initializing'),
|
|
1765
|
-
'context': ('📋', 'blue', 'Building context'),
|
|
1766
|
-
'thinking': ('🧠', 'magenta', 'Thinking'),
|
|
1767
|
-
'planning': ('📝', 'yellow', 'Planning'),
|
|
1768
|
-
'analyzing': ('🔍', 'cyan', 'Analyzing'),
|
|
1769
|
-
'generating': ('✨', 'green', 'Generating'),
|
|
1770
|
-
'writing': ('📄', 'blue', 'Writing'),
|
|
1771
|
-
'editing': ('✏️', 'yellow', 'Editing'),
|
|
1772
|
-
'reading': ('👁', 'cyan', 'Reading'),
|
|
1773
|
-
'searching': ('🔎', 'blue', 'Searching'),
|
|
1774
|
-
'executing': ('⚡', 'magenta', 'Executing'),
|
|
1775
|
-
'converting': ('🔄', 'cyan', 'Converting'),
|
|
1776
|
-
'optimizing': ('⚡', 'green', 'Optimizing'),
|
|
1777
|
-
'websearch': ('🌐', 'blue', 'Web searching'),
|
|
1778
|
-
'parsing': ('📊', 'cyan', 'Parsing response'),
|
|
1779
|
-
'applying': ('💾', 'green', 'Applying changes'),
|
|
1780
|
-
'complete': ('✅', 'green', 'Complete'),
|
|
1781
|
-
'error': ('❌', 'red', 'Error'),
|
|
1782
|
-
'warning': ('⚠️', 'yellow', 'Warning'),
|
|
1783
|
-
'waiting': ('⏳', 'dim', 'Waiting for API'),
|
|
1784
|
-
'tool': ('🔧', 'cyan', 'Running tool'),
|
|
1786
|
+
'init': ('*' if not _UNICODE_OK else '⚙', 'cyan', 'Initializing'),
|
|
1787
|
+
'context': ('*' if not _UNICODE_OK else '📋', 'blue', 'Building context'),
|
|
1788
|
+
'thinking': ('*' if not _UNICODE_OK else '🧠', 'magenta', 'Thinking'),
|
|
1789
|
+
'planning': ('*' if not _UNICODE_OK else '📝', 'yellow', 'Planning'),
|
|
1790
|
+
'analyzing': ('>' if not _UNICODE_OK else '🔍', 'cyan', 'Analyzing'),
|
|
1791
|
+
'generating': ('+' if not _UNICODE_OK else '✨', 'green', 'Generating'),
|
|
1792
|
+
'writing': ('>' if not _UNICODE_OK else '📄', 'blue', 'Writing'),
|
|
1793
|
+
'editing': ('>' if not _UNICODE_OK else '✏️', 'yellow', 'Editing'),
|
|
1794
|
+
'reading': ('>' if not _UNICODE_OK else '👁', 'cyan', 'Reading'),
|
|
1795
|
+
'searching': ('>' if not _UNICODE_OK else '🔎', 'blue', 'Searching'),
|
|
1796
|
+
'executing': ('!' if not _UNICODE_OK else '⚡', 'magenta', 'Executing'),
|
|
1797
|
+
'converting': ('~' if not _UNICODE_OK else '🔄', 'cyan', 'Converting'),
|
|
1798
|
+
'optimizing': ('!' if not _UNICODE_OK else '⚡', 'green', 'Optimizing'),
|
|
1799
|
+
'websearch': ('@' if not _UNICODE_OK else '🌐', 'blue', 'Web searching'),
|
|
1800
|
+
'parsing': ('>' if not _UNICODE_OK else '📊', 'cyan', 'Parsing response'),
|
|
1801
|
+
'applying': ('+' if not _UNICODE_OK else '💾', 'green', 'Applying changes'),
|
|
1802
|
+
'complete': ('[OK]' if not _UNICODE_OK else '✅', 'green', 'Complete'),
|
|
1803
|
+
'error': ('[ERR]' if not _UNICODE_OK else '❌', 'red', 'Error'),
|
|
1804
|
+
'warning': ('[!]' if not _UNICODE_OK else '⚠️', 'yellow', 'Warning'),
|
|
1805
|
+
'waiting': ('...' if not _UNICODE_OK else '⏳', 'dim', 'Waiting for API'),
|
|
1806
|
+
'tool': ('#' if not _UNICODE_OK else '🔧', 'cyan', 'Running tool'),
|
|
1785
1807
|
}
|
|
1786
1808
|
|
|
1787
1809
|
def __init__(self, enabled: bool = True, use_colors: bool = True):
|
|
@@ -1893,7 +1915,9 @@ class AIVerboseOutput:
|
|
|
1893
1915
|
pct = int((current / total) * 100) if total > 0 else 0
|
|
1894
1916
|
bar_width = 30
|
|
1895
1917
|
filled = int(bar_width * current / total) if total > 0 else 0
|
|
1896
|
-
|
|
1918
|
+
fill_char = '#' if not _UNICODE_OK else '█'
|
|
1919
|
+
empty_char = '-' if not _UNICODE_OK else '░'
|
|
1920
|
+
bar = fill_char * filled + empty_char * (bar_width - filled)
|
|
1897
1921
|
label_str = f" {label}" if label else ""
|
|
1898
1922
|
print(f"\r{indent} [{self._color(bar, 'cyan')}] {pct}%{label_str}", end='', flush=True)
|
|
1899
1923
|
if current >= total:
|
|
@@ -1917,10 +1941,10 @@ class AIVerboseOutput:
|
|
|
1917
1941
|
return
|
|
1918
1942
|
indent = self._get_indent()
|
|
1919
1943
|
if success:
|
|
1920
|
-
icon =
|
|
1944
|
+
icon = SYM_CHECK
|
|
1921
1945
|
color = 'green'
|
|
1922
1946
|
else:
|
|
1923
|
-
icon =
|
|
1947
|
+
icon = SYM_CROSS
|
|
1924
1948
|
color = 'red'
|
|
1925
1949
|
msg = message[:60] + "..." if message and len(message) > 60 else (message or "")
|
|
1926
1950
|
print(f"{indent} {self._color(icon, color)} {msg}")
|
|
@@ -2064,15 +2088,26 @@ class AIVerboseOutput:
|
|
|
2064
2088
|
if not self.enabled:
|
|
2065
2089
|
return
|
|
2066
2090
|
indent = self._get_indent()
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2091
|
+
if _UNICODE_OK:
|
|
2092
|
+
ops = {
|
|
2093
|
+
'read': ('👁', 'Reading'),
|
|
2094
|
+
'write': ('📝', 'Writing'),
|
|
2095
|
+
'edit': ('✏️', 'Editing'),
|
|
2096
|
+
'delete': ('🗑', 'Deleting'),
|
|
2097
|
+
'create': ('📁', 'Creating'),
|
|
2098
|
+
}
|
|
2099
|
+
default_icon = '📄'
|
|
2100
|
+
else:
|
|
2101
|
+
ops = {
|
|
2102
|
+
'read': ('>', 'Reading'),
|
|
2103
|
+
'write': ('>', 'Writing'),
|
|
2104
|
+
'edit': ('>', 'Editing'),
|
|
2105
|
+
'delete': ('x', 'Deleting'),
|
|
2106
|
+
'create': ('+', 'Creating'),
|
|
2107
|
+
}
|
|
2108
|
+
default_icon = '>'
|
|
2109
|
+
icon, label = ops.get(operation, (default_icon, operation))
|
|
2110
|
+
status = self._color(SYM_CHECK, 'green') if success else self._color(SYM_CROSS, 'red')
|
|
2076
2111
|
# Truncate path if too long
|
|
2077
2112
|
display_path = path if len(path) <= 40 else "..." + path[-37:]
|
|
2078
2113
|
print(f"{indent} {icon} {label}: {display_path} {status}")
|