tzero-mcp 12.3.2 → 12.3.5
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.
- package/CONTRIBUTING.md +1 -1
- package/README.md +4 -0
- package/package.json +3 -4
- package/src/addmcp.py +2 -2
- package/src/app.py +1 -1
- package/src/main.py +4 -0
- package/src/tzero/__init__.py +1 -1
- package/src/tzero/desktop_updater.py +6 -0
- package/src/tzero/tzero_benchmark.py +1 -1
- package/src/tzero/tzero_budget.py +1 -1
- package/src/tzero/tzero_ci.py +1 -1
- package/src/tzero/tzero_contracts.py +2 -2
- package/src/tzero/tzero_dashboard.py +3 -3
- package/src/tzero/tzero_debt.py +85 -7
- package/src/tzero/tzero_deps.py +1 -0
- package/src/tzero/tzero_explain.py +1 -1
- package/src/tzero/tzero_features.py +31 -74
- package/src/tzero/tzero_golden.py +2 -2
- package/src/tzero/tzero_graph_hud.html +4 -4
- package/src/tzero/tzero_growth.py +1 -1
- package/src/tzero/tzero_jarvis/orchestrator.py +1 -1
- package/src/tzero/tzero_jarvis/swarm.py +23 -2
- package/src/tzero/tzero_jarvis/workspace_orchestrator.py +10 -21
- package/src/tzero/tzero_lsp.py +1 -1
- package/src/tzero/tzero_mcp.py +39 -122
- package/src/tzero/tzero_promo.py +1 -1
- package/src/tzero/tzero_security.py +3 -3
- package/src/tzero/tzero_sync.py +73 -148
- package/src/tzero/tzero_task_benchmark.py +2 -2
- package/src/tzero/tzero_traffic.py +1 -1
- package/src/tzero/tzero_tui.py +2 -13
- package/src/tzero/tzero_v3.py +433 -392
- package/src/tzero/tzero_welcome.py +1 -1
- package/src/tzero/anti_rea/__init__.py +0 -84
- package/src/tzero/anti_rea/algebraic_mutator.py +0 -107
- package/src/tzero/anti_rea/anti_agent_guard.py +0 -96
- package/src/tzero/anti_rea/anti_debugger.py +0 -272
- package/src/tzero/anti_rea/anti_vm.py +0 -160
- package/src/tzero/anti_rea/asar_shield.py +0 -122
- package/src/tzero/anti_rea/auditor.py +0 -208
- package/src/tzero/anti_rea/bpe_disrupter.py +0 -48
- package/src/tzero/anti_rea/bytecode_trap.py +0 -85
- package/src/tzero/anti_rea/canary_beacon.py +0 -167
- package/src/tzero/anti_rea/cli.py +0 -134
- package/src/tzero/anti_rea/confusables.py +0 -130
- package/src/tzero/anti_rea/crypto_loader.py +0 -132
- package/src/tzero/anti_rea/engine.py +0 -304
- package/src/tzero/anti_rea/extractor_shield.py +0 -180
- package/src/tzero/anti_rea/flattener.py +0 -136
- package/src/tzero/anti_rea/gui.py +0 -264
- package/src/tzero/anti_rea/honeypot.py +0 -58
- package/src/tzero/anti_rea/integrity_guard.py +0 -78
- package/src/tzero/anti_rea/jailbreak_decoy.py +0 -77
- package/src/tzero/anti_rea/mcp_poison.py +0 -41
- package/src/tzero/anti_rea/native_bridge.py +0 -169
- package/src/tzero/anti_rea/rdtsc_guard.py +0 -77
- package/src/tzero/anti_rea/string_vault.py +0 -97
- package/src/tzero/anti_rea/sybil_network.py +0 -53
- package/src/tzero/anti_rea/tier_catalog.py +0 -388
- package/src/tzero/anti_rea/timing_guard.py +0 -46
- package/src/tzero/anti_rea/token_bomb.py +0 -65
- package/src/tzero/anti_rea/traps.py +0 -76
- package/src/tzero/anti_rea/vm_obfuscator.py +0 -182
- package/src/tzero/tzero_armor.py +0 -187
package/src/tzero/tzero_v3.py
CHANGED
|
@@ -493,7 +493,7 @@ def calculate_token_cost(token_count: int, provider_name: str) -> float:
|
|
|
493
493
|
# i18n Translations
|
|
494
494
|
TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
495
495
|
"en": {
|
|
496
|
-
"title": "T-Zero Developer Console & Context Architect v12.3.
|
|
496
|
+
"title": "T-Zero Developer Console & Context Architect v12.3.5",
|
|
497
497
|
"subtitle": f"Developer: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
|
|
498
498
|
"overview_tab": "🏠 Overview Dashboard",
|
|
499
499
|
"setup_tab": "⚡ Setup & AI Models",
|
|
@@ -530,41 +530,41 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
530
530
|
"audit_btn": "🛡️ SECURITY AUDIT"
|
|
531
531
|
},
|
|
532
532
|
"tr": {
|
|
533
|
-
"title": "T-Zero
|
|
534
|
-
"subtitle": f"
|
|
535
|
-
"overview_tab": "🏠
|
|
536
|
-
"setup_tab": "⚡
|
|
537
|
-
"selector_tab": "📂
|
|
538
|
-
"changelog_tab": "🔀 Git & Diff
|
|
539
|
-
"generate_tab": "🚀
|
|
540
|
-
"template_tab": "🧪 Prompt
|
|
541
|
-
"graph_tab": "📊
|
|
542
|
-
"settings_tab": "⚙️
|
|
543
|
-
"provider": "
|
|
544
|
-
"api_url": "API URL
|
|
545
|
-
"api_key": "API
|
|
546
|
-
"model": "LLM MODEL
|
|
547
|
-
"target_dir": "
|
|
548
|
-
"reduction": "TOKEN
|
|
549
|
-
"scan_btn": "⚡
|
|
550
|
-
"generate_btn": "🚀
|
|
551
|
-
"cancel_btn": "🛑
|
|
552
|
-
"copy_btn": "📋
|
|
553
|
-
"save_btn": "💾 README.md
|
|
554
|
-
"agents_btn": "🤖 AGENTS.md
|
|
555
|
-
"arch_btn": "🏛️ ARCHITECTURE.md
|
|
556
|
-
"repomap_btn": "🗺️ REPO_MAP.txt
|
|
557
|
-
"html_btn": "🌐 HTML
|
|
558
|
-
"success_msg": "README
|
|
559
|
-
"error_msg": "
|
|
560
|
-
"ping_success": "
|
|
561
|
-
"smart_select": "🧠
|
|
562
|
-
"select_all": "
|
|
563
|
-
"deselect_all": "
|
|
564
|
-
"invert_select": "
|
|
565
|
-
"sfx_on": "🔊
|
|
566
|
-
"sfx_off": "🔇
|
|
567
|
-
"audit_btn": "🛡️
|
|
533
|
+
"title": "T-Zero Developer Console & Context Architect v12.3.5",
|
|
534
|
+
"subtitle": f"Developer: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
|
|
535
|
+
"overview_tab": "🏠 Overview Dashboard",
|
|
536
|
+
"setup_tab": "⚡ Setup & AI Models",
|
|
537
|
+
"selector_tab": "📂 Code Explorer",
|
|
538
|
+
"changelog_tab": "🔀 Git & Diff Analysis",
|
|
539
|
+
"generate_tab": "🚀 Context Generator",
|
|
540
|
+
"template_tab": "🧪 Prompt Studio",
|
|
541
|
+
"graph_tab": "📊 Live Metrics",
|
|
542
|
+
"settings_tab": "⚙️ Settings & Keys",
|
|
543
|
+
"provider": "SELECT AI PROVIDER:",
|
|
544
|
+
"api_url": "API BASE URL:",
|
|
545
|
+
"api_key": "API KEY:",
|
|
546
|
+
"model": "LLM MODEL:",
|
|
547
|
+
"target_dir": "TARGET PROJECT DIRECTORY:",
|
|
548
|
+
"reduction": "TOKEN REDUCTION LEVEL:",
|
|
549
|
+
"scan_btn": "⚡ SCAN CODEBASE (Ctrl+S)",
|
|
550
|
+
"generate_btn": "🚀 ARCHITECT CONTEXT README.md",
|
|
551
|
+
"cancel_btn": "🛑 CANCEL GENERATION",
|
|
552
|
+
"copy_btn": "📋 Copy to Clipboard",
|
|
553
|
+
"save_btn": "💾 Save README.md",
|
|
554
|
+
"agents_btn": "🤖 Export AGENTS.md",
|
|
555
|
+
"arch_btn": "🏛️ Export ARCHITECTURE.md",
|
|
556
|
+
"repomap_btn": "🗺️ Export REPO_MAP.txt",
|
|
557
|
+
"html_btn": "🌐 HTML Preview",
|
|
558
|
+
"success_msg": "README Saved successfully!",
|
|
559
|
+
"error_msg": "Operation failed: ",
|
|
560
|
+
"ping_success": "Ping Success! Connected to API catalog.",
|
|
561
|
+
"smart_select": "🧠 Smart Select",
|
|
562
|
+
"select_all": "Check All",
|
|
563
|
+
"deselect_all": "Uncheck All",
|
|
564
|
+
"invert_select": "Invert Selection",
|
|
565
|
+
"sfx_on": "🔊 SFX ON",
|
|
566
|
+
"sfx_off": "🔇 SFX OFF",
|
|
567
|
+
"audit_btn": "🛡️ SECURITY AUDIT"
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
|
|
@@ -1986,9 +1986,10 @@ class KeyringSecretsEditor:
|
|
|
1986
1986
|
|
|
1987
1987
|
|
|
1988
1988
|
class KeyringSecretsBackupManager:
|
|
1989
|
-
"""Backs up and restores credentials securely using
|
|
1989
|
+
"""Backs up and restores credentials securely using AES-GCM and reads older authenticated backups."""
|
|
1990
1990
|
|
|
1991
|
-
MAGIC_HEADER = b"
|
|
1991
|
+
MAGIC_HEADER = b"TZB3"
|
|
1992
|
+
LEGACY_AUTH_HEADER = b"TZB2"
|
|
1992
1993
|
PBKDF2_ROUNDS = 600_000
|
|
1993
1994
|
|
|
1994
1995
|
@classmethod
|
|
@@ -2011,7 +2012,10 @@ class KeyringSecretsBackupManager:
|
|
|
2011
2012
|
def backup_credentials(cls, filepath: str, cipher_key: str) -> bool:
|
|
2012
2013
|
try:
|
|
2013
2014
|
import hashlib
|
|
2014
|
-
import
|
|
2015
|
+
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
|
2016
|
+
|
|
2017
|
+
if not cipher_key:
|
|
2018
|
+
return False
|
|
2015
2019
|
creds = {}
|
|
2016
2020
|
for provider in PROVIDERS.keys():
|
|
2017
2021
|
secret = keyring.get_password(SERVICE_NAME, provider)
|
|
@@ -2020,12 +2024,10 @@ class KeyringSecretsBackupManager:
|
|
|
2020
2024
|
|
|
2021
2025
|
raw_data = json.dumps(creds).encode("utf-8")
|
|
2022
2026
|
salt = os.urandom(16)
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
payload = cls.MAGIC_HEADER + salt + tag + cipher_bytes
|
|
2027
|
+
nonce = os.urandom(12)
|
|
2028
|
+
header = cls.MAGIC_HEADER + salt + nonce
|
|
2029
|
+
key = hashlib.pbkdf2_hmac("sha256", cipher_key.encode("utf-8"), salt, cls.PBKDF2_ROUNDS)
|
|
2030
|
+
payload = header + AESGCM(key).encrypt(nonce, raw_data, header)
|
|
2029
2031
|
with open(filepath, "wb") as f:
|
|
2030
2032
|
f.write(payload)
|
|
2031
2033
|
return True
|
|
@@ -2062,7 +2064,7 @@ class KeyringSecretsBackupManager:
|
|
|
2062
2064
|
try:
|
|
2063
2065
|
with open(filepath, "rb") as f:
|
|
2064
2066
|
data = f.read()
|
|
2065
|
-
if not data or data.startswith(cls.MAGIC_HEADER):
|
|
2067
|
+
if not data or data.startswith((cls.MAGIC_HEADER, cls.LEGACY_AUTH_HEADER)):
|
|
2066
2068
|
return False
|
|
2067
2069
|
encrypted = bytearray(data)
|
|
2068
2070
|
key_bytes = cipher_key.encode("utf-8")
|
|
@@ -2074,7 +2076,7 @@ class KeyringSecretsBackupManager:
|
|
|
2074
2076
|
if not validated:
|
|
2075
2077
|
logger.error("Legacy backup rejected: invalid provider/credential schema")
|
|
2076
2078
|
return False
|
|
2077
|
-
logger.warning("Imported legacy unauthenticated backup; please re-export to
|
|
2079
|
+
logger.warning("Imported legacy unauthenticated backup; please re-export to authenticated AES-GCM TZB3 format.")
|
|
2078
2080
|
for provider, secret in validated.items():
|
|
2079
2081
|
keyring.set_password(SERVICE_NAME, provider, secret)
|
|
2080
2082
|
return True
|
|
@@ -2083,36 +2085,45 @@ class KeyringSecretsBackupManager:
|
|
|
2083
2085
|
return False
|
|
2084
2086
|
|
|
2085
2087
|
@classmethod
|
|
2086
|
-
def restore_credentials(cls, filepath: str, cipher_key: str, allow_legacy: bool =
|
|
2088
|
+
def restore_credentials(cls, filepath: str, cipher_key: str, allow_legacy: bool = False) -> bool:
|
|
2087
2089
|
try:
|
|
2088
2090
|
import hashlib
|
|
2089
2091
|
import hmac
|
|
2090
2092
|
with open(filepath, "rb") as f:
|
|
2091
2093
|
data = f.read()
|
|
2092
2094
|
|
|
2093
|
-
if data.startswith(cls.MAGIC_HEADER)
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2095
|
+
if data.startswith(cls.MAGIC_HEADER):
|
|
2096
|
+
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
|
2097
|
+
|
|
2098
|
+
if len(data) < 48:
|
|
2099
|
+
return False
|
|
2100
|
+
header = data[:32]
|
|
2101
|
+
salt, nonce = header[4:20], header[20:32]
|
|
2102
|
+
key = hashlib.pbkdf2_hmac("sha256", cipher_key.encode("utf-8"), salt, cls.PBKDF2_ROUNDS)
|
|
2103
|
+
raw_data = AESGCM(key).decrypt(nonce, data[32:], header)
|
|
2104
|
+
elif data.startswith(cls.LEGACY_AUTH_HEADER):
|
|
2105
|
+
if len(data) < 52:
|
|
2106
|
+
return False
|
|
2107
|
+
salt, tag, cipher_bytes = data[4:20], data[20:52], data[52:]
|
|
2097
2108
|
enc_key, mac_key = cls._derive_keys(cipher_key, salt)
|
|
2098
|
-
expected_tag = hmac.new(mac_key, cls.
|
|
2109
|
+
expected_tag = hmac.new(mac_key, cls.LEGACY_AUTH_HEADER + salt + cipher_bytes, hashlib.sha256).digest()
|
|
2099
2110
|
if not hmac.compare_digest(tag, expected_tag):
|
|
2100
2111
|
logger.error("Authentication failed: invalid passphrase or corrupted backup")
|
|
2101
2112
|
return False
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
validated = cls._validate_credential_map(json.loads(raw_data.decode("utf-8")))
|
|
2105
|
-
if not validated:
|
|
2106
|
-
logger.error("Backup payload failed schema validation")
|
|
2107
|
-
return False
|
|
2108
|
-
for provider, secret in validated.items():
|
|
2109
|
-
keyring.set_password(SERVICE_NAME, provider, secret)
|
|
2110
|
-
return True
|
|
2111
|
-
|
|
2112
|
-
if allow_legacy:
|
|
2113
|
+
raw_data = bytes(b ^ k for b, k in zip(cipher_bytes, cls._keystream(enc_key, len(cipher_bytes))))
|
|
2114
|
+
elif allow_legacy:
|
|
2113
2115
|
return cls.import_legacy_credentials(filepath, cipher_key)
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
+
else:
|
|
2117
|
+
logger.error("Rejected unauthenticated legacy backup (allow_legacy=False)")
|
|
2118
|
+
return False
|
|
2119
|
+
|
|
2120
|
+
validated = cls._validate_credential_map(json.loads(raw_data.decode("utf-8")))
|
|
2121
|
+
if not validated:
|
|
2122
|
+
logger.error("Backup payload failed schema validation")
|
|
2123
|
+
return False
|
|
2124
|
+
for provider, secret in validated.items():
|
|
2125
|
+
keyring.set_password(SERVICE_NAME, provider, secret)
|
|
2126
|
+
return True
|
|
2116
2127
|
except Exception as e:
|
|
2117
2128
|
logger.error(f"Restore keyring credentials failed: {e}")
|
|
2118
2129
|
return False
|
|
@@ -3274,13 +3285,13 @@ class CanvasPillButton(tk.Canvas):
|
|
|
3274
3285
|
|
|
3275
3286
|
class KPICard(LuxuryCard):
|
|
3276
3287
|
"""Executive KPI card showing primary upward metric and secondary compression delta."""
|
|
3277
|
-
def __init__(self, parent, title="AST & Token
|
|
3288
|
+
def __init__(self, parent, title="AST & Token Spend", primary_val="↑ 1,974", primary_sub="Processed AST Nodes & Directives", secondary_val="↓ 287", secondary_sub="Compressed Prompt Token Volume", **kwargs):
|
|
3278
3289
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3279
3290
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3280
3291
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
3281
3292
|
self.lbl_title = tk.Label(top, text=title, font=("Segoe UI", 9, "bold"), fg=PALETTE.get("text_muted", "#64748b"), bg=self.card_bg)
|
|
3282
3293
|
self.lbl_title.pack(side=tk.LEFT)
|
|
3283
|
-
self.pill_period = tk.Label(top, text="
|
|
3294
|
+
self.pill_period = tk.Label(top, text="Weekly ▾", font=("Segoe UI", 7, "bold"), fg=PALETTE.get("text_muted", "#64748b"), bg=PALETTE.get("card_hover", "#f1f5f9"), padx=6, pady=2)
|
|
3284
3295
|
self.pill_period.pack(side=tk.RIGHT)
|
|
3285
3296
|
|
|
3286
3297
|
self.lbl_prim = tk.Label(self.inner, text=primary_val, font=("Segoe UI", 21, "bold"), fg=PALETTE.get("accent_cyan", "#3843a0"), bg=self.card_bg)
|
|
@@ -3332,7 +3343,7 @@ class ScrollableGlassPanel(tk.Frame):
|
|
|
3332
3343
|
|
|
3333
3344
|
class MiniCalendarCard(LuxuryCard):
|
|
3334
3345
|
"""Mini executive activity calendar card with active audit date rings."""
|
|
3335
|
-
def __init__(self, parent, month_title="
|
|
3346
|
+
def __init__(self, parent, month_title="Nov 2026", active_days=(14, 25, 28), **kwargs):
|
|
3336
3347
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3337
3348
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3338
3349
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
@@ -3343,7 +3354,7 @@ class MiniCalendarCard(LuxuryCard):
|
|
|
3343
3354
|
|
|
3344
3355
|
grid = tk.Frame(self.inner, bg=self.card_bg)
|
|
3345
3356
|
grid.pack(fill=tk.BOTH, expand=True)
|
|
3346
|
-
headers = ["
|
|
3357
|
+
headers = ["mo", "tu", "we", "th", "fr", "sa", "su"]
|
|
3347
3358
|
for col, h in enumerate(headers):
|
|
3348
3359
|
tk.Label(grid, text=h, font=("Segoe UI", 7, "bold"), fg=PALETTE.get("text_muted", "#94a3b8"), bg=self.card_bg, width=3).grid(row=0, column=col, padx=2, pady=1)
|
|
3349
3360
|
active_set = set(active_days)
|
|
@@ -3361,7 +3372,7 @@ class MiniCalendarCard(LuxuryCard):
|
|
|
3361
3372
|
|
|
3362
3373
|
class CircularGaugeCard(LuxuryCard):
|
|
3363
3374
|
"""Circular donut gauge card with percentage arc and quick action pill button."""
|
|
3364
|
-
def __init__(self, parent, title="Optimization Score", subtitle="T-Zero context efficiency", percentage=75, action_text="⚡
|
|
3375
|
+
def __init__(self, parent, title="Optimization Score", subtitle="T-Zero context efficiency", percentage=75, action_text="⚡ QUICK OPTIMIZE", action_cmd=None, **kwargs):
|
|
3365
3376
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3366
3377
|
self.percentage = percentage
|
|
3367
3378
|
self.action_cmd = action_cmd
|
|
@@ -3397,7 +3408,7 @@ class CircularGaugeCard(LuxuryCard):
|
|
|
3397
3408
|
|
|
3398
3409
|
class WaveSplineChart(LuxuryCard):
|
|
3399
3410
|
"""Smooth dual-wave spline chart with pastel area gradient fills."""
|
|
3400
|
-
def __init__(self, parent, title="AST Token
|
|
3411
|
+
def __init__(self, parent, title="AST Token Frequency", **kwargs):
|
|
3401
3412
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3402
3413
|
tk.Label(self.inner, text=title, font=("Segoe UI", 9, "bold"), fg=PALETTE.get("text_muted", "#64748b"), bg=self.card_bg).pack(anchor=tk.W, pady=(0, 2))
|
|
3403
3414
|
self.chart_canvas = tk.Canvas(self.inner, height=115, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3448,12 +3459,12 @@ class WaveSplineChart(LuxuryCard):
|
|
|
3448
3459
|
|
|
3449
3460
|
class WideSplineChartCard(LuxuryCard):
|
|
3450
3461
|
"""Wide executive Bézier spline chart showing AST vs Compressed token consumption trend."""
|
|
3451
|
-
def __init__(self, parent, title="Model Token
|
|
3462
|
+
def __init__(self, parent, title="Model Token Consumption Trend", **kwargs):
|
|
3452
3463
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3453
3464
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3454
3465
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
3455
3466
|
tk.Label(top, text=title, font=("Segoe UI", 10, "bold"), fg=PALETTE.get("text_main", "#1e293b"), bg=self.card_bg).pack(side=tk.LEFT)
|
|
3456
|
-
pill = tk.Label(top, text="
|
|
3467
|
+
pill = tk.Label(top, text="All Time ▾", font=("Segoe UI", 7, "bold"), fg=PALETTE.get("text_muted", "#64748b"), bg=PALETTE.get("card_hover", "#f1f5f9"), padx=8, pady=2)
|
|
3457
3468
|
pill.pack(side=tk.RIGHT)
|
|
3458
3469
|
|
|
3459
3470
|
self.c = tk.Canvas(self.inner, height=140, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3479,8 +3490,8 @@ class WideSplineChartCard(LuxuryCard):
|
|
|
3479
3490
|
|
|
3480
3491
|
leg = tk.Frame(self.inner, bg=self.card_bg)
|
|
3481
3492
|
leg.pack(pady=(4, 0))
|
|
3482
|
-
tk.Label(leg, text="●
|
|
3483
|
-
tk.Label(leg, text="● T-Zero
|
|
3493
|
+
tk.Label(leg, text="● Original AST Tokens", font=("Segoe UI", 7, "bold"), fg=PALETTE.get("accent_purple", "#6366f1"), bg=self.card_bg).pack(side=tk.LEFT, padx=10)
|
|
3494
|
+
tk.Label(leg, text="● T-Zero Compressed Prompt", font=("Segoe UI", 7, "bold"), fg=PALETTE.get("accent_coral", "#f97316"), bg=self.card_bg).pack(side=tk.LEFT, padx=10)
|
|
3484
3495
|
|
|
3485
3496
|
def _draw(self, event=None):
|
|
3486
3497
|
w = max(20, self.c.winfo_width())
|
|
@@ -3513,7 +3524,7 @@ class WideSplineChartCard(LuxuryCard):
|
|
|
3513
3524
|
|
|
3514
3525
|
class MonthlyStackedBarCard(LuxuryCard):
|
|
3515
3526
|
"""Horizontal stacked bar chart for monthly token reduction stats."""
|
|
3516
|
-
def __init__(self, parent, title="
|
|
3527
|
+
def __init__(self, parent, title="Monthly Token Savings", **kwargs):
|
|
3517
3528
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3518
3529
|
tk.Label(self.inner, text=title, font=("Segoe UI", 9, "bold"), fg=PALETTE.get("text_main", "#1e293b"), bg=self.card_bg).pack(anchor=tk.W, pady=(0, 6))
|
|
3519
3530
|
self.c = tk.Canvas(self.inner, height=110, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3540,7 +3551,7 @@ class MonthlyStackedBarCard(LuxuryCard):
|
|
|
3540
3551
|
def _draw(self, event=None):
|
|
3541
3552
|
w = max(20, self.c.winfo_width())
|
|
3542
3553
|
self.c.delete("all")
|
|
3543
|
-
months = ["
|
|
3554
|
+
months = ["OCT", "NOV", "DEC", "JAN"]
|
|
3544
3555
|
ratios = [0.75, 0.55, 0.85, 0.65]
|
|
3545
3556
|
bar_h = 10
|
|
3546
3557
|
spacing = 24
|
|
@@ -3556,7 +3567,7 @@ class MonthlyStackedBarCard(LuxuryCard):
|
|
|
3556
3567
|
|
|
3557
3568
|
class GroupedVerticalBarCard(LuxuryCard):
|
|
3558
3569
|
"""Grouped dual-color vertical bar chart for daily token and audit activity."""
|
|
3559
|
-
def __init__(self, parent, title="
|
|
3570
|
+
def __init__(self, parent, title="Daily Activity & Audits", **kwargs):
|
|
3560
3571
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3561
3572
|
tk.Label(self.inner, text=title, font=("Segoe UI", 9, "bold"), fg=PALETTE.get("text_main", "#1e293b"), bg=self.card_bg).pack(anchor=tk.W, pady=(0, 6))
|
|
3562
3573
|
self.c = tk.Canvas(self.inner, height=110, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3584,7 +3595,7 @@ class GroupedVerticalBarCard(LuxuryCard):
|
|
|
3584
3595
|
w = max(20, self.c.winfo_width())
|
|
3585
3596
|
h = max(20, self.c.winfo_height())
|
|
3586
3597
|
self.c.delete("all")
|
|
3587
|
-
days = ["
|
|
3598
|
+
days = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
|
|
3588
3599
|
slot_w = w / len(days)
|
|
3589
3600
|
base_y = h - 16
|
|
3590
3601
|
heights = [(40, 20), (55, 32), (30, 48), (65, 42), (75, 55), (45, 25), (35, 18)]
|
|
@@ -3603,18 +3614,16 @@ HorizontalProgressBarGroup = MonthlyStackedBarCard
|
|
|
3603
3614
|
|
|
3604
3615
|
|
|
3605
3616
|
class SecurityHubCard(LuxuryCard):
|
|
3606
|
-
"""Siber Akademi security badge & quick audit
|
|
3607
|
-
def __init__(self, parent, action_cmd=None,
|
|
3617
|
+
"""Siber Akademi security badge & quick audit card."""
|
|
3618
|
+
def __init__(self, parent, action_cmd=None, **kwargs):
|
|
3608
3619
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3609
|
-
tk.Label(self.inner, text="🛡 SİBER AKADEMİ
|
|
3610
|
-
tk.Label(self.inner, text="
|
|
3620
|
+
tk.Label(self.inner, text="🛡 SİBER AKADEMİ SECURITY", font=("Segoe UI", 9, "bold"), fg=PALETTE.get("accent_cyan", "#3843a0"), bg=self.card_bg).pack(anchor=tk.W)
|
|
3621
|
+
tk.Label(self.inner, text="Local source and secret checks", font=("Segoe UI", 7), fg=PALETTE.get("accent_green", "#10b981"), bg=self.card_bg).pack(anchor=tk.W, pady=(1, 6))
|
|
3611
3622
|
btn_row = tk.Frame(self.inner, bg=self.card_bg)
|
|
3612
3623
|
btn_row.pack(fill=tk.X)
|
|
3613
|
-
self.btn = CanvasPillButton(btn_row, text="
|
|
3624
|
+
self.btn = CanvasPillButton(btn_row, text="VIEW REPORT", command=action_cmd, height=28, radius=14, font=("Segoe UI", 7, "bold"), bg_color=PALETTE.get("card_hover", "#e0e7ff"), text_color=PALETTE.get("accent_cyan", "#3843a0"))
|
|
3614
3625
|
self.btn.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 3))
|
|
3615
|
-
|
|
3616
|
-
self.armor_btn = CanvasPillButton(btn_row, text="🛡️ ANTI-REA", command=armor_cmd, height=28, radius=14, font=("Segoe UI", 7, "bold"), bg_color="#064e3b", text_color="#34d399")
|
|
3617
|
-
self.armor_btn.pack(side=tk.RIGHT, fill=tk.X, expand=True, padx=(3, 0))
|
|
3626
|
+
|
|
3618
3627
|
|
|
3619
3628
|
class GlowingStatusDot(tk.Canvas):
|
|
3620
3629
|
def __init__(self, parent, size: int = 16, **kwargs):
|
|
@@ -4155,19 +4164,19 @@ class NodeGraphCanvas(tk.Canvas):
|
|
|
4155
4164
|
hud_box_w = 460
|
|
4156
4165
|
self.create_rectangle(14, 12, 14 + hud_box_w, 56, fill=card_bg, outline="#1e293b", width=1)
|
|
4157
4166
|
scale_pct = int(self.scale_factor * 100)
|
|
4158
|
-
hud_title = f"⚡ T-ZERO AST TOPOLOGY GRAPH • {len(self.nodes)}
|
|
4167
|
+
hud_title = f"⚡ T-ZERO AST TOPOLOGY GRAPH • {len(self.nodes)} Nodes • {len(self.links)} Links • {scale_pct}% Scale"
|
|
4159
4168
|
self.create_text(26, 24, text=hud_title, anchor="w", fill=accent_cyan, font=("Segoe UI", 9, "bold"))
|
|
4160
|
-
self.create_text(26, 42, text="🖱️
|
|
4169
|
+
self.create_text(26, 42, text="🖱️ Left Drag: Move Node / Pan | Wheel: Zoom | Double-Click: Focus | Right Drag: Pan", anchor="w", fill=text_muted, font=("Segoe UI", 7))
|
|
4161
4170
|
|
|
4162
4171
|
# 6. Top-Right Floating Control Toolbar (Zoom +, Zoom -, Reset, Fit, Maximize)
|
|
4163
4172
|
self.hud_buttons = []
|
|
4164
4173
|
is_max = getattr(self, "is_fullscreen", False)
|
|
4165
4174
|
btn_defs = [
|
|
4166
|
-
("plus", "+", "
|
|
4167
|
-
("minus", "-", "
|
|
4168
|
-
("reset", "100%", "
|
|
4169
|
-
("fit", "⛶", "
|
|
4170
|
-
("max", "⤢" if not is_max else "⤡", "
|
|
4175
|
+
("plus", "+", "Zoom In", self.btn_zoom_in),
|
|
4176
|
+
("minus", "-", "Zoom Out", self.btn_zoom_out),
|
|
4177
|
+
("reset", "100%", "Reset Scale", self.btn_reset),
|
|
4178
|
+
("fit", "⛶", "Fit to Screen", self.btn_fit),
|
|
4179
|
+
("max", "⤢" if not is_max else "⤡", "Expand / Fullscreen", self.btn_toggle_fullscreen),
|
|
4171
4180
|
]
|
|
4172
4181
|
btn_w, btn_h, gap = 38, 30, 6
|
|
4173
4182
|
total_bar_w = len(btn_defs) * (btn_w + gap) - gap + 16
|
|
@@ -4193,9 +4202,9 @@ class NodeGraphCanvas(tk.Canvas):
|
|
|
4193
4202
|
node_deg = sum(1 for (s, e) in self.links if s == active_id or e == active_id)
|
|
4194
4203
|
info_h = 32
|
|
4195
4204
|
info_y = h - info_h - 14
|
|
4196
|
-
info_text = f"
|
|
4205
|
+
info_text = f"NODE: {active_node['label']} | TYPE: {active_node['type'].upper()} | LINKS: {node_deg}"
|
|
4197
4206
|
if "full_path" in active_node:
|
|
4198
|
-
info_text += f" |
|
|
4207
|
+
info_text += f" | PATH: {active_node['full_path']}"
|
|
4199
4208
|
info_w = min(w - 28, max(280, len(info_text) * 6.5 + 26))
|
|
4200
4209
|
self.create_rectangle(14, info_y, 14 + info_w, info_y + info_h, fill=card_bg, outline=accent_cyan, width=1)
|
|
4201
4210
|
self.create_text(24, info_y + info_h / 2, text=info_text, anchor="w", fill=text_main, font=("Segoe UI", 8, "bold"))
|
|
@@ -4435,7 +4444,7 @@ class AdvancedTokenDistributionChart(tk.Canvas):
|
|
|
4435
4444
|
self.delete("all")
|
|
4436
4445
|
w, h = max(280, self.winfo_width()), max(120, self.winfo_height())
|
|
4437
4446
|
if not self.stats:
|
|
4438
|
-
self.create_text(w / 2, h / 2, text="
|
|
4447
|
+
self.create_text(w / 2, h / 2, text="No scanned metrics available yet.", fill=PALETTE["text_muted"], font=("Segoe UI", 8))
|
|
4439
4448
|
return
|
|
4440
4449
|
|
|
4441
4450
|
colors = [PALETTE["accent_cyan"], PALETTE["accent_purple"], PALETTE["accent_green"], PALETTE.get("accent_coral", "#f59e0b"), "#10b981", "#3b82f6"]
|
|
@@ -4599,10 +4608,48 @@ class PygmentsHighlighter:
|
|
|
4599
4608
|
|
|
4600
4609
|
# --- 13. DYNAMIC UI DASHBOARD MAIN WINDOW ---
|
|
4601
4610
|
|
|
4611
|
+
SPONSOR_WEEKLY_INTERVAL_SECONDS = 7 * 24 * 60 * 60
|
|
4612
|
+
|
|
4613
|
+
|
|
4614
|
+
def decide_startup_popup(profile: Dict[str, Any], now_ts: Optional[float] = None) -> str:
|
|
4615
|
+
"""Determine which startup modal ('star', 'sponsor', or 'none') to display.
|
|
4616
|
+
|
|
4617
|
+
Rules:
|
|
4618
|
+
- Star prompt: only on the 1st launch and every 10th launch thereafter (1, 10, 20, ...),
|
|
4619
|
+
unless dismissed by the user.
|
|
4620
|
+
- Sponsor prompt: on every 5th launch (5, 15, 25, ...) OR once every 7 days of usage,
|
|
4621
|
+
unless dismissed by the user. Star takes priority on 1st and 10th launches so two
|
|
4622
|
+
modals never stack on the same startup.
|
|
4623
|
+
"""
|
|
4624
|
+
current_ts = float(time.time() if now_ts is None else now_ts)
|
|
4625
|
+
launch_count = int(profile.get("gui_launch_count", 0) or 0) + 1
|
|
4626
|
+
profile["gui_launch_count"] = launch_count
|
|
4627
|
+
|
|
4628
|
+
last_sponsor_ts = float(profile.get("last_sponsor_popup_ts", 0.0) or 0.0)
|
|
4629
|
+
if launch_count == 1 and last_sponsor_ts <= 0.0:
|
|
4630
|
+
profile["last_sponsor_popup_ts"] = current_ts
|
|
4631
|
+
last_sponsor_ts = current_ts
|
|
4632
|
+
|
|
4633
|
+
star_dismissed = bool(profile.get("star_popup_dismissed_v12", False))
|
|
4634
|
+
sponsor_dismissed = bool(profile.get("sponsor_popup_dismissed_v12", False))
|
|
4635
|
+
|
|
4636
|
+
is_star_turn = (launch_count == 1) or (launch_count > 1 and launch_count % 10 == 0)
|
|
4637
|
+
if is_star_turn and not star_dismissed:
|
|
4638
|
+
return "star"
|
|
4639
|
+
|
|
4640
|
+
weekly_due = last_sponsor_ts > 0.0 and (current_ts - last_sponsor_ts) >= SPONSOR_WEEKLY_INTERVAL_SECONDS
|
|
4641
|
+
is_sponsor_turn = (launch_count > 1 and launch_count % 5 == 0) or weekly_due
|
|
4642
|
+
if is_sponsor_turn and not sponsor_dismissed:
|
|
4643
|
+
profile["last_sponsor_popup_ts"] = current_ts
|
|
4644
|
+
return "sponsor"
|
|
4645
|
+
|
|
4646
|
+
return "none"
|
|
4647
|
+
|
|
4648
|
+
|
|
4602
4649
|
class AutoReadmeGUI:
|
|
4603
4650
|
def __init__(self, root: tk.Tk):
|
|
4604
4651
|
self.root = root
|
|
4605
|
-
self.lang =
|
|
4652
|
+
self.lang = "en"
|
|
4606
4653
|
|
|
4607
4654
|
# State parameters
|
|
4608
4655
|
self.scanned_files: List[str] = []
|
|
@@ -4677,7 +4724,56 @@ class AutoReadmeGUI:
|
|
|
4677
4724
|
self.setup_keyboard_shortcuts()
|
|
4678
4725
|
self.start_system_telemetry()
|
|
4679
4726
|
self.start_community_stats_refresh()
|
|
4680
|
-
|
|
4727
|
+
if "unittest" not in sys.modules:
|
|
4728
|
+
self.safe_after(1200, self.check_and_show_startup_popups)
|
|
4729
|
+
|
|
4730
|
+
def _attach_tooltip(self, widget, text: str):
|
|
4731
|
+
"""Attach a sleek floating English tooltip on mouse hover."""
|
|
4732
|
+
if not TK_AVAILABLE or widget is None:
|
|
4733
|
+
return
|
|
4734
|
+
tip_win = {"w": None}
|
|
4735
|
+
|
|
4736
|
+
def show_tip(_event=None):
|
|
4737
|
+
try:
|
|
4738
|
+
if tip_win["w"] or not widget.winfo_exists():
|
|
4739
|
+
return
|
|
4740
|
+
tw = tk.Toplevel(widget)
|
|
4741
|
+
tw.overrideredirect(True)
|
|
4742
|
+
tw.attributes("-topmost", True)
|
|
4743
|
+
x = widget.winfo_rootx() + widget.winfo_width() + 8
|
|
4744
|
+
y = widget.winfo_rooty() + max(0, (widget.winfo_height() - 24) // 2)
|
|
4745
|
+
tw.geometry(f"+{x}+{y}")
|
|
4746
|
+
lbl = tk.Label(
|
|
4747
|
+
tw,
|
|
4748
|
+
text=text,
|
|
4749
|
+
bg=PALETTE.get("card_bg", "#0f172a"),
|
|
4750
|
+
fg=PALETTE.get("text_main", "#f8fafc"),
|
|
4751
|
+
font=("Segoe UI", 8, "bold"),
|
|
4752
|
+
padx=9,
|
|
4753
|
+
pady=4,
|
|
4754
|
+
highlightthickness=1,
|
|
4755
|
+
highlightbackground=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
4756
|
+
)
|
|
4757
|
+
lbl.pack()
|
|
4758
|
+
tip_win["w"] = tw
|
|
4759
|
+
except Exception:
|
|
4760
|
+
pass
|
|
4761
|
+
|
|
4762
|
+
def hide_tip(_event=None):
|
|
4763
|
+
tw = tip_win.get("w")
|
|
4764
|
+
tip_win["w"] = None
|
|
4765
|
+
if tw is not None:
|
|
4766
|
+
try:
|
|
4767
|
+
tw.destroy()
|
|
4768
|
+
except Exception:
|
|
4769
|
+
pass
|
|
4770
|
+
|
|
4771
|
+
try:
|
|
4772
|
+
widget.bind("<Enter>", show_tip, add="+")
|
|
4773
|
+
widget.bind("<Leave>", hide_tip, add="+")
|
|
4774
|
+
widget.bind("<ButtonPress>", hide_tip, add="+")
|
|
4775
|
+
except Exception:
|
|
4776
|
+
pass
|
|
4681
4777
|
|
|
4682
4778
|
def safe_after(self, ms: int, func, *args):
|
|
4683
4779
|
"""Thread-safe and lifecycle-safe wrapper around root.after."""
|
|
@@ -4748,6 +4844,7 @@ class AutoReadmeGUI:
|
|
|
4748
4844
|
b.configure(bg=sidebar_bg)
|
|
4749
4845
|
btn.bind("<Enter>", on_enter)
|
|
4750
4846
|
btn.bind("<Leave>", on_leave)
|
|
4847
|
+
self._attach_tooltip(btn, get_text(key, self.lang))
|
|
4751
4848
|
|
|
4752
4849
|
self.tab_buttons.append(btn)
|
|
4753
4850
|
self.tab_containers.append(cont)
|
|
@@ -4757,16 +4854,17 @@ class AutoReadmeGUI:
|
|
|
4757
4854
|
spacer.pack(fill=tk.BOTH, expand=True)
|
|
4758
4855
|
|
|
4759
4856
|
# Bottom Utilities
|
|
4760
|
-
for icon_char, cmd_handler in [
|
|
4761
|
-
("💖", self.show_crypto_support_modal),
|
|
4762
|
-
("🎨", self.open_theme_selector),
|
|
4763
|
-
("🌐", self.toggle_language),
|
|
4764
|
-
("⌨", self.show_shortcuts_modal),
|
|
4765
|
-
("📋", self.toggle_console_drawer)
|
|
4857
|
+
for icon_char, tip_text, cmd_handler in [
|
|
4858
|
+
("💖", "Sponsor & Support T-Zero", self.show_crypto_support_modal),
|
|
4859
|
+
("🎨", "Theme Manager", self.open_theme_selector),
|
|
4860
|
+
("🌐", "Language: English (EN)", self.toggle_language),
|
|
4861
|
+
("⌨", "Keyboard Shortcuts", self.show_shortcuts_modal),
|
|
4862
|
+
("📋", "System Diagnostics Log", self.toggle_console_drawer),
|
|
4766
4863
|
]:
|
|
4767
4864
|
lbl = tk.Label(self.sidebar, text=icon_char, font=("Segoe UI Emoji", 12), fg=sidebar_muted, bg=sidebar_bg, cursor="hand2")
|
|
4768
4865
|
lbl.pack(pady=3)
|
|
4769
4866
|
lbl.bind("<Button-1>", lambda e, h=cmd_handler: h())
|
|
4867
|
+
self._attach_tooltip(lbl, tip_text)
|
|
4770
4868
|
|
|
4771
4869
|
tk.Label(self.sidebar, text="●", font=("Segoe UI", 8, "bold"), fg=PALETTE["success"], bg=sidebar_bg).pack(pady=(4, 10))
|
|
4772
4870
|
|
|
@@ -4848,17 +4946,31 @@ class AutoReadmeGUI:
|
|
|
4848
4946
|
|
|
4849
4947
|
self.web_console_btn = CanvasPillButton(
|
|
4850
4948
|
header_controls,
|
|
4851
|
-
text="🌐 WEB
|
|
4949
|
+
text="🌐 WEB CONSOLE",
|
|
4852
4950
|
command=self.open_web_console,
|
|
4853
4951
|
height=28,
|
|
4854
4952
|
radius=14,
|
|
4855
4953
|
bg_color=PALETTE["card_border"],
|
|
4856
4954
|
text_color=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
4857
4955
|
font=("Segoe UI", 7, "bold"),
|
|
4858
|
-
width=
|
|
4956
|
+
width=112
|
|
4859
4957
|
)
|
|
4860
4958
|
self.web_console_btn.pack(side=tk.LEFT, padx=3)
|
|
4861
4959
|
|
|
4960
|
+
self.sponsor_header_btn = CanvasPillButton(
|
|
4961
|
+
header_controls,
|
|
4962
|
+
text="💖 SPONSOR",
|
|
4963
|
+
command=lambda: self.show_crypto_support_modal(periodic=False),
|
|
4964
|
+
height=28,
|
|
4965
|
+
radius=14,
|
|
4966
|
+
bg_color="#3f1d2e" if PALETTE.get("bg_start") != "#edf2fb" else "#ffe4e6",
|
|
4967
|
+
hover_color="#fb7185",
|
|
4968
|
+
text_color="#fb7185" if PALETTE.get("bg_start") != "#edf2fb" else "#be123c",
|
|
4969
|
+
font=("Segoe UI", 7, "bold"),
|
|
4970
|
+
width=96
|
|
4971
|
+
)
|
|
4972
|
+
self.sponsor_header_btn.pack(side=tk.LEFT, padx=3)
|
|
4973
|
+
|
|
4862
4974
|
self.star_header_btn = CanvasPillButton(
|
|
4863
4975
|
header_controls,
|
|
4864
4976
|
text=f"★ STAR ({self.community_stats['stars']}★)",
|
|
@@ -4892,11 +5004,11 @@ class AutoReadmeGUI:
|
|
|
4892
5004
|
s_pill_bot = tk.Frame(self.status_bar, bg=PALETTE["card_bg"], highlightthickness=1, highlightbackground=PALETTE["card_border"])
|
|
4893
5005
|
s_pill_bot.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
4894
5006
|
|
|
4895
|
-
tk.Label(s_pill_bot, text="📋
|
|
5007
|
+
tk.Label(s_pill_bot, text="📋 SYSTEM LOG:", font=("Segoe UI", 7, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(side=tk.LEFT, padx=(8, 4), pady=2)
|
|
4896
5008
|
self.status_bar_lbl = tk.Label(s_pill_bot, text="[ONLINE] Siber Akademi T-Zero Context builder loaded.", font=("Consolas", 7), fg=PALETTE.get("accent_cyan", "#3843a0"), bg=PALETTE["card_bg"])
|
|
4897
5009
|
self.status_bar_lbl.pack(side=tk.LEFT, pady=2)
|
|
4898
5010
|
|
|
4899
|
-
self.status_toggle_lbl = tk.Label(s_pill_bot, text="▲
|
|
5011
|
+
self.status_toggle_lbl = tk.Label(s_pill_bot, text="▲ Show Console", font=("Segoe UI", 7, "bold"), fg=PALETTE.get("accent_purple", "#6366f1"), bg=PALETTE["card_bg"], cursor="hand2")
|
|
4900
5012
|
self.status_toggle_lbl.pack(side=tk.RIGHT, padx=8, pady=2)
|
|
4901
5013
|
self.status_toggle_lbl.bind("<Button-1>", lambda e: self.toggle_console_drawer())
|
|
4902
5014
|
|
|
@@ -4907,7 +5019,7 @@ class AutoReadmeGUI:
|
|
|
4907
5019
|
c_top = tk.Frame(self.console_drawer, bg=PALETTE["card_bg"])
|
|
4908
5020
|
c_top.pack(fill=tk.X, padx=10, pady=4)
|
|
4909
5021
|
tk.Label(c_top, text="DIAGNOSTICS & SYSTEM AUDITS LOG:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(side=tk.LEFT)
|
|
4910
|
-
close_lbl = tk.Label(c_top, text="✕
|
|
5022
|
+
close_lbl = tk.Label(c_top, text="✕ Close", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_purple"], bg=PALETTE["card_bg"], cursor="hand2")
|
|
4911
5023
|
close_lbl.pack(side=tk.RIGHT)
|
|
4912
5024
|
close_lbl.bind("<Button-1>", lambda e: self.toggle_console_drawer())
|
|
4913
5025
|
|
|
@@ -4931,13 +5043,13 @@ class AutoReadmeGUI:
|
|
|
4931
5043
|
self.console_drawer.place_forget()
|
|
4932
5044
|
self.console_drawer_visible = False
|
|
4933
5045
|
if hasattr(self, "status_toggle_lbl"):
|
|
4934
|
-
self.status_toggle_lbl.config(text="▲
|
|
5046
|
+
self.status_toggle_lbl.config(text="▲ Show Console")
|
|
4935
5047
|
else:
|
|
4936
5048
|
self.console_drawer.place(x=82, rely=0.68, relwidth=1.0, width=-92, relheight=0.28)
|
|
4937
5049
|
self.console_drawer.lift()
|
|
4938
5050
|
self.console_drawer_visible = True
|
|
4939
5051
|
if hasattr(self, "status_toggle_lbl"):
|
|
4940
|
-
self.status_toggle_lbl.config(text="▼
|
|
5052
|
+
self.status_toggle_lbl.config(text="▼ Hide Console")
|
|
4941
5053
|
|
|
4942
5054
|
def log(self, text: str):
|
|
4943
5055
|
if not hasattr(self, "console_text") or self.console_text is None:
|
|
@@ -4996,30 +5108,13 @@ class AutoReadmeGUI:
|
|
|
4996
5108
|
except Exception:
|
|
4997
5109
|
pass
|
|
4998
5110
|
webbrowser.open(f"http://localhost:{DASHBOARD_PORT}")
|
|
4999
|
-
self.show_toast("T-Zero Web
|
|
5111
|
+
self.show_toast("T-Zero Web Console & Superdesign opened", "success")
|
|
5000
5112
|
except Exception:
|
|
5001
5113
|
webbrowser.open("http://localhost:8421")
|
|
5002
5114
|
|
|
5003
5115
|
def run_quick_security_audit(self):
|
|
5004
5116
|
self.open_security_audit_dialog()
|
|
5005
5117
|
|
|
5006
|
-
def run_quick_anti_rea_armor(self):
|
|
5007
|
-
"""Executes 180-Tier Anti-REA Resistance audit & protection from GUI Security Hub."""
|
|
5008
|
-
target = (self.dir_entry.get().strip() if hasattr(self, "dir_entry") else "") or os.getcwd()
|
|
5009
|
-
try:
|
|
5010
|
-
from tzero.tzero_armor import audit_path_rea_resistance
|
|
5011
|
-
audit = audit_path_rea_resistance(target)
|
|
5012
|
-
score = audit.get("score", 0)
|
|
5013
|
-
rating = audit.get("rating", "UNKNOWN")
|
|
5014
|
-
self.log(f"[ANTI-REA AUDIT] Target: {target} | Score: {score}/100 ({rating})")
|
|
5015
|
-
messagebox.showinfo(
|
|
5016
|
-
"T-Zero 180-Tier Anti-REA Armor",
|
|
5017
|
-
f"Target: {target}\nAI Resistance Score: {score}/100 ({rating})\n"
|
|
5018
|
-
f"Active Defense Matrix: 12 Domains x 15 Sub-Tiers (Crypto Capsule, Opaque CFF, PolyVM, Anti-Debug, Anti-VM, RDTSC).",
|
|
5019
|
-
)
|
|
5020
|
-
except Exception as exc:
|
|
5021
|
-
self.log(f"[ANTI-REA ERROR] {exc}")
|
|
5022
|
-
|
|
5023
5118
|
def open_security_audit_dialog(self, target_dir: Optional[str] = None):
|
|
5024
5119
|
"""Runs a complete T-Zero 4-Tier Security & AST Architecture Audit (T-001 to T-004)
|
|
5025
5120
|
and displays an interactive luxury report dialog with filtering and export capabilities."""
|
|
@@ -5110,16 +5205,16 @@ class AutoReadmeGUI:
|
|
|
5110
5205
|
# Audio and status feedback
|
|
5111
5206
|
if leaks_count > 0:
|
|
5112
5207
|
play_sfx("error")
|
|
5113
|
-
self.show_toast(f"🚨 T-001
|
|
5208
|
+
self.show_toast(f"🚨 T-001 ALERT: {leaks_count} leak(s) detected!", "error", 5000)
|
|
5114
5209
|
else:
|
|
5115
5210
|
play_sfx("success")
|
|
5116
|
-
self.show_toast(f"✅ %
|
|
5211
|
+
self.show_toast(f"✅ 100% Zero-Leak Security Clean! ({total_scanned_files} files scanned)", "success", 4000)
|
|
5117
5212
|
|
|
5118
5213
|
self.log(f"T-Zero Security Audit: {total_scanned_files} files scanned, {leaks_count} secrets, {arch_violations_count} arch violations, {smells_count} AST smells.")
|
|
5119
5214
|
|
|
5120
5215
|
# Open dedicated Luxury Report Window
|
|
5121
5216
|
dialog = tk.Toplevel(self.root)
|
|
5122
|
-
dialog.title("🛡️ T-Zero
|
|
5217
|
+
dialog.title("🛡️ T-Zero Security & AST Architecture Audit Report")
|
|
5123
5218
|
dialog.geometry("900x620")
|
|
5124
5219
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
5125
5220
|
dialog.transient(self.root)
|
|
@@ -5130,8 +5225,8 @@ class AutoReadmeGUI:
|
|
|
5130
5225
|
# Header Title
|
|
5131
5226
|
hdr = tk.Frame(main_frame, bg=PALETTE["bg_start"])
|
|
5132
5227
|
hdr.pack(fill=tk.X, pady=(0, 12))
|
|
5133
|
-
tk.Label(hdr, text="🛡️ T-ZERO
|
|
5134
|
-
sub_info = f"
|
|
5228
|
+
tk.Label(hdr, text="🛡️ T-ZERO SECURITY & AST ARCHITECTURE AUDIT REPORT", font=("Segoe UI", 12, "bold"), fg=PALETTE["accent_cyan"], bg=PALETTE["bg_start"]).pack(anchor=tk.W)
|
|
5229
|
+
sub_info = f"Workspace: {target} • Scanned Files: {total_scanned_files} • Python Lines: ~{total_lines_count}"
|
|
5135
5230
|
tk.Label(hdr, text=sub_info, font=("Segoe UI", 8), fg=PALETTE["text_muted"], bg=PALETTE["bg_start"]).pack(anchor=tk.W, pady=(2, 0))
|
|
5136
5231
|
|
|
5137
5232
|
# 4 Metric Cards Row (T-001 to T-004)
|
|
@@ -5152,10 +5247,10 @@ class AutoReadmeGUI:
|
|
|
5152
5247
|
tk.Label(p, text=status_text, font=("Segoe UI", 10, "bold"), fg=color, bg=PALETTE["card_bg"]).pack(anchor=tk.W, pady=(2, 1))
|
|
5153
5248
|
tk.Label(p, text=sub, font=("Segoe UI", 7), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(anchor=tk.W)
|
|
5154
5249
|
|
|
5155
|
-
make_metric_card(cards_row, 0, "T-001 ZERO-LEAK", "✅ 100%
|
|
5156
|
-
make_metric_card(cards_row, 1, "T-002
|
|
5157
|
-
make_metric_card(cards_row, 2, "T-003 AST
|
|
5158
|
-
make_metric_card(cards_row, 3, "T-004
|
|
5250
|
+
make_metric_card(cards_row, 0, "T-001 ZERO-LEAK", "✅ 100% CLEAN" if leaks_count == 0 else f"🚨 {leaks_count} LEAK(S)", leaks_count == 0, "Zero Secret Exposure")
|
|
5251
|
+
make_metric_card(cards_row, 1, "T-002 ARCH BOUNDARY", "✅ 100% COMPLIANT" if arch_violations_count == 0 else f"❌ {arch_violations_count} VIOLATION(S)", arch_violations_count == 0, "Layer Isolation")
|
|
5252
|
+
make_metric_card(cards_row, 2, "T-003 AST CONTRACT", "✅ VERIFIED", True, f"{py_files_count} Module Signatures")
|
|
5253
|
+
make_metric_card(cards_row, 3, "T-004 CODE QUALITY", "✅ 100% CLEAN" if smells_count == 0 else f"⚠️ {smells_count} WARNING(S)", smells_count == 0, "Complexity Guard")
|
|
5159
5254
|
|
|
5160
5255
|
# Treeview Table for Issues
|
|
5161
5256
|
table_frame = GlassCard(main_frame)
|
|
@@ -5165,11 +5260,11 @@ class AutoReadmeGUI:
|
|
|
5165
5260
|
|
|
5166
5261
|
cols = ("Rule", "File", "Line", "Severity", "Message")
|
|
5167
5262
|
tree = ttk.Treeview(table_pad, columns=cols, show="headings", height=12)
|
|
5168
|
-
tree.heading("Rule", text="
|
|
5169
|
-
tree.heading("File", text="
|
|
5170
|
-
tree.heading("Line", text="
|
|
5171
|
-
tree.heading("Severity", text="
|
|
5172
|
-
tree.heading("Message", text="
|
|
5263
|
+
tree.heading("Rule", text="Rule")
|
|
5264
|
+
tree.heading("File", text="File Path")
|
|
5265
|
+
tree.heading("Line", text="Line")
|
|
5266
|
+
tree.heading("Severity", text="Severity")
|
|
5267
|
+
tree.heading("Message", text="Audit Finding & Recommendation")
|
|
5173
5268
|
|
|
5174
5269
|
tree.column("Rule", width=85, anchor=tk.CENTER)
|
|
5175
5270
|
tree.column("File", width=220)
|
|
@@ -5187,12 +5282,12 @@ class AutoReadmeGUI:
|
|
|
5187
5282
|
filtered = [i for i in audit_issues if (filter_rule is None or i["rule"] == filter_rule)]
|
|
5188
5283
|
if not filtered:
|
|
5189
5284
|
if filter_rule is None:
|
|
5190
|
-
tree.insert("", "end", values=("T-001", "
|
|
5191
|
-
tree.insert("", "end", values=("T-002", "
|
|
5192
|
-
tree.insert("", "end", values=("T-003", "
|
|
5193
|
-
tree.insert("", "end", values=("T-004", "
|
|
5285
|
+
tree.insert("", "end", values=("T-001", "ALL FILES", "-", "CLEAN", "✅ 100% Zero-Leak: No plaintext API keys, passwords, or credential leaks detected."))
|
|
5286
|
+
tree.insert("", "end", values=("T-002", "ALL MODULES", "-", "CLEAN", "✅ Architecture Boundaries: All modules comply with tzero.rules.json architectural layers."))
|
|
5287
|
+
tree.insert("", "end", values=("T-003", "ALL FUNCTIONS", "-", "CLEAN", "✅ AST Signatures: All function, class, and type contracts are valid."))
|
|
5288
|
+
tree.insert("", "end", values=("T-004", "CODEBASE", "-", "CLEAN", "✅ Code Quality: No 30+ line anomalies, excessive arguments, or global keywords found."))
|
|
5194
5289
|
else:
|
|
5195
|
-
tree.insert("", "end", values=(filter_rule, "
|
|
5290
|
+
tree.insert("", "end", values=(filter_rule, "ALL FILES", "-", "CLEAN", f"✅ No violations or warnings found for rule {filter_rule}."))
|
|
5196
5291
|
else:
|
|
5197
5292
|
for item in filtered:
|
|
5198
5293
|
tree.insert("", "end", values=(item["rule"], item["file"], item["line"], item["severity"], item["msg"]))
|
|
@@ -5206,7 +5301,7 @@ class AutoReadmeGUI:
|
|
|
5206
5301
|
filter_frame = tk.Frame(btm_bar, bg=PALETTE["bg_start"])
|
|
5207
5302
|
filter_frame.pack(side=tk.LEFT)
|
|
5208
5303
|
|
|
5209
|
-
tk.Button(filter_frame, text="
|
|
5304
|
+
tk.Button(filter_frame, text="All", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=lambda: populate_tree(None)).pack(side=tk.LEFT, padx=(0, 4))
|
|
5210
5305
|
tk.Button(filter_frame, text="🚨 T-001", bg=PALETTE["card_border"], fg=PALETTE["error"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=lambda: populate_tree("T-001")).pack(side=tk.LEFT, padx=4)
|
|
5211
5306
|
tk.Button(filter_frame, text="🏛️ T-002", bg=PALETTE["card_border"], fg=PALETTE["accent_purple"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=lambda: populate_tree("T-002")).pack(side=tk.LEFT, padx=4)
|
|
5212
5307
|
tk.Button(filter_frame, text="📑 T-003", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=lambda: populate_tree("T-003")).pack(side=tk.LEFT, padx=4)
|
|
@@ -5240,7 +5335,7 @@ class AutoReadmeGUI:
|
|
|
5240
5335
|
content = export_markdown_report()
|
|
5241
5336
|
self.root.clipboard_clear()
|
|
5242
5337
|
self.root.clipboard_append(content)
|
|
5243
|
-
self.show_toast("
|
|
5338
|
+
self.show_toast("Report copied to clipboard in Markdown format!", "success")
|
|
5244
5339
|
|
|
5245
5340
|
def save_report():
|
|
5246
5341
|
content = export_markdown_report()
|
|
@@ -5252,11 +5347,11 @@ class AutoReadmeGUI:
|
|
|
5252
5347
|
if out_file:
|
|
5253
5348
|
with open(out_file, "w", encoding="utf-8") as fp:
|
|
5254
5349
|
fp.write(content)
|
|
5255
|
-
self.show_toast("
|
|
5350
|
+
self.show_toast("Audit report saved successfully!", "success")
|
|
5256
5351
|
|
|
5257
|
-
tk.Button(action_frame, text="📋
|
|
5258
|
-
tk.Button(action_frame, text="💾
|
|
5259
|
-
tk.Button(action_frame, text="✕
|
|
5352
|
+
tk.Button(action_frame, text="📋 Copy (MD)", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=copy_report).pack(side=tk.LEFT, padx=4)
|
|
5353
|
+
tk.Button(action_frame, text="💾 Save", bg=PALETTE["card_border"], fg=PALETTE["accent_green"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=save_report).pack(side=tk.LEFT, padx=4)
|
|
5354
|
+
tk.Button(action_frame, text="✕ Close", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=dialog.destroy).pack(side=tk.LEFT, padx=(4, 0))
|
|
5260
5355
|
|
|
5261
5356
|
def open_theme_selector(self):
|
|
5262
5357
|
play_sfx("click")
|
|
@@ -5467,7 +5562,7 @@ class AutoReadmeGUI:
|
|
|
5467
5562
|
self.log("⚡ T-Zero Quick Optimization: Pruned non-essential AST nodes. Context compression maximized.")
|
|
5468
5563
|
|
|
5469
5564
|
def toggle_language(self):
|
|
5470
|
-
self.lang = "
|
|
5565
|
+
self.lang = "en"
|
|
5471
5566
|
_config_mgr.get_profile()["language"] = self.lang
|
|
5472
5567
|
_config_mgr.save()
|
|
5473
5568
|
|
|
@@ -5499,7 +5594,8 @@ class AutoReadmeGUI:
|
|
|
5499
5594
|
if hasattr(self, "audit_btn") and self.audit_btn:
|
|
5500
5595
|
self.audit_btn.config(text=get_text("audit_btn", self.lang))
|
|
5501
5596
|
|
|
5502
|
-
self.
|
|
5597
|
+
self.show_toast("Interface language: English (EN)", "info")
|
|
5598
|
+
self.log("Interface language active: EN")
|
|
5503
5599
|
|
|
5504
5600
|
# --- TAB 1: EXECUTIVE 9-CARD OVERVIEW DASHBOARD ---
|
|
5505
5601
|
def setup_tab_setup(self):
|
|
@@ -5540,20 +5636,20 @@ class AutoReadmeGUI:
|
|
|
5540
5636
|
self.quick_card.grid(row=1, column=2, columnspan=2, sticky="nsew", padx=4, pady=4)
|
|
5541
5637
|
q_inner = self.quick_card.inner
|
|
5542
5638
|
|
|
5543
|
-
tk.Label(q_inner, text="⚡
|
|
5639
|
+
tk.Label(q_inner, text="⚡ QUICK CONTROL & MODEL", font=("Segoe UI", 9, "bold"), fg=PALETTE["sidebar_bg"], bg=self.quick_card.card_bg).pack(anchor=tk.W, pady=(0, 4))
|
|
5544
5640
|
|
|
5545
|
-
tk.Label(q_inner, text="AI
|
|
5641
|
+
tk.Label(q_inner, text="AI Provider:", font=("Segoe UI", 7, "bold"), fg=PALETTE["text_muted"], bg=self.quick_card.card_bg).pack(anchor=tk.W)
|
|
5546
5642
|
self.provider_var = tk.StringVar(value="NVIDIA NIM")
|
|
5547
5643
|
self.provider_combo = ttk.Combobox(q_inner, textvariable=self.provider_var, values=list(PROVIDERS.keys()), state="readonly")
|
|
5548
5644
|
self.provider_combo.pack(fill=tk.X, ipady=1, pady=(1, 4))
|
|
5549
5645
|
self.provider_combo.bind("<<ComboboxSelected>>", self.on_provider_select)
|
|
5550
5646
|
|
|
5551
|
-
tk.Label(q_inner, text="
|
|
5647
|
+
tk.Label(q_inner, text="Target Model:", font=("Segoe UI", 7, "bold"), fg=PALETTE["text_muted"], bg=self.quick_card.card_bg).pack(anchor=tk.W)
|
|
5552
5648
|
self.model_var = tk.StringVar()
|
|
5553
5649
|
self.model_combo = ttk.Combobox(q_inner, textvariable=self.model_var, state="readonly")
|
|
5554
5650
|
self.model_combo.pack(fill=tk.X, ipady=1, pady=(1, 4))
|
|
5555
5651
|
|
|
5556
|
-
tk.Label(q_inner, text="
|
|
5652
|
+
tk.Label(q_inner, text="Target Workspace Directory:", font=("Segoe UI", 7, "bold"), fg=PALETTE["text_muted"], bg=self.quick_card.card_bg).pack(anchor=tk.W)
|
|
5557
5653
|
dir_frame = tk.Frame(q_inner, bg=self.quick_card.card_bg)
|
|
5558
5654
|
dir_frame.pack(fill=tk.X, pady=(1, 6))
|
|
5559
5655
|
|
|
@@ -5571,7 +5667,7 @@ class AutoReadmeGUI:
|
|
|
5571
5667
|
|
|
5572
5668
|
self.browse_btn = apply_modern_hover(tk.Button(
|
|
5573
5669
|
dir_frame,
|
|
5574
|
-
text="
|
|
5670
|
+
text="Browse...",
|
|
5575
5671
|
bg=PALETTE["card_border"],
|
|
5576
5672
|
fg=PALETTE["text_main"],
|
|
5577
5673
|
relief=tk.FLAT,
|
|
@@ -5604,7 +5700,7 @@ class AutoReadmeGUI:
|
|
|
5604
5700
|
self.daily_card.grid(row=2, column=1, sticky="nsew", padx=4, pady=4)
|
|
5605
5701
|
|
|
5606
5702
|
# Card 9: Siber Akademi Security Hub Card
|
|
5607
|
-
self.security_card = SecurityHubCard(f, action_cmd=self.run_quick_security_audit
|
|
5703
|
+
self.security_card = SecurityHubCard(f, action_cmd=self.run_quick_security_audit)
|
|
5608
5704
|
self.security_card.grid(row=2, column=2, columnspan=2, sticky="nsew", padx=4, pady=4)
|
|
5609
5705
|
|
|
5610
5706
|
# --- TAB 7: SETTINGS & SECRETS MANAGEMENT ---
|
|
@@ -5626,7 +5722,7 @@ class AutoReadmeGUI:
|
|
|
5626
5722
|
pad_l = tk.Frame(left, bg=PALETTE["card_bg"], padx=16, pady=14)
|
|
5627
5723
|
pad_l.pack(fill=tk.BOTH, expand=True)
|
|
5628
5724
|
|
|
5629
|
-
tk.Label(pad_l, text="AI PROVIDER
|
|
5725
|
+
tk.Label(pad_l, text="AI PROVIDER INTEGRATION & AUTH", font=("Segoe UI", 10, "bold"), fg=PALETTE["accent_cyan"], bg=PALETTE["card_bg"]).pack(anchor=tk.W, pady=(0, 6))
|
|
5630
5726
|
|
|
5631
5727
|
tk.Label(pad_l, text="API BASE URL:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(anchor=tk.W, pady=(4, 2))
|
|
5632
5728
|
self.api_url_entry = apply_entry_focus_glow(tk.Entry(
|
|
@@ -5641,7 +5737,7 @@ class AutoReadmeGUI:
|
|
|
5641
5737
|
))
|
|
5642
5738
|
self.api_url_entry.pack(fill=tk.X, ipady=4, pady=(0, 8))
|
|
5643
5739
|
|
|
5644
|
-
tk.Label(pad_l, text="API
|
|
5740
|
+
tk.Label(pad_l, text="API KEY (KEYRING PROTECTED):", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(anchor=tk.W, pady=(0, 2))
|
|
5645
5741
|
key_frame = tk.Frame(pad_l, bg=PALETTE["card_bg"])
|
|
5646
5742
|
key_frame.pack(fill=tk.X, pady=(0, 10))
|
|
5647
5743
|
|
|
@@ -5671,14 +5767,14 @@ class AutoReadmeGUI:
|
|
|
5671
5767
|
self.ping_btn.pack(side=tk.RIGHT, padx=(8, 0), ipady=3, ipadx=8)
|
|
5672
5768
|
|
|
5673
5769
|
# Custom prompt directives
|
|
5674
|
-
tk.Label(pad_l, text="📝
|
|
5770
|
+
tk.Label(pad_l, text="📝 CUSTOM SYSTEM & PROMPT DIRECTIVES:", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_purple"], bg=PALETTE["card_bg"]).pack(anchor=tk.W, pady=(6, 2))
|
|
5675
5771
|
self.extra_prompt_text = tk.Text(pad_l, bg=PALETTE["bg_start"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, font=("Segoe UI", 8), height=5, bd=0)
|
|
5676
5772
|
self.extra_prompt_text.pack(fill=tk.BOTH, expand=True, pady=(0, 8))
|
|
5677
5773
|
|
|
5678
5774
|
# Bottom FX star speed
|
|
5679
5775
|
bottom_fx = tk.Frame(pad_l, bg=PALETTE["card_bg"])
|
|
5680
5776
|
bottom_fx.pack(fill=tk.X, pady=(2, 0))
|
|
5681
|
-
tk.Label(bottom_fx, text="🌌
|
|
5777
|
+
tk.Label(bottom_fx, text="🌌 Particle Animation Speed:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(side=tk.LEFT, padx=(0, 6))
|
|
5682
5778
|
self.star_scale = tk.Scale(bottom_fx, from_=0.1, to=4.0, resolution=0.1, orient=tk.HORIZONTAL, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], troughcolor=PALETTE["bg_start"], highlightthickness=0, command=self.update_star_velocity, showvalue=False)
|
|
5683
5779
|
self.star_scale.set(1.0)
|
|
5684
5780
|
self.star_scale.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
@@ -5699,14 +5795,14 @@ class AutoReadmeGUI:
|
|
|
5699
5795
|
b_links = tk.Frame(brand, bg=PALETTE["bg_start"])
|
|
5700
5796
|
b_links.pack(fill=tk.X, padx=10, pady=(2, 6))
|
|
5701
5797
|
|
|
5702
|
-
lbl_sa = tk.Label(b_links, text=f"
|
|
5798
|
+
lbl_sa = tk.Label(b_links, text=f"Developer: {DEV_NAME}", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_main"], bg=PALETTE["bg_start"])
|
|
5703
5799
|
lbl_sa.pack(side=tk.LEFT, padx=(0, 10))
|
|
5704
5800
|
|
|
5705
5801
|
lbl_web1 = tk.Label(b_links, text="💼 LinkedIn", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_cyan"], bg=PALETTE["card_bg"], padx=6, pady=2, cursor="hand2")
|
|
5706
5802
|
lbl_web1.pack(side=tk.LEFT, padx=3)
|
|
5707
5803
|
lbl_web1.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_LINKEDIN))
|
|
5708
5804
|
|
|
5709
|
-
lbl_web2 = tk.Label(b_links, text="🌐
|
|
5805
|
+
lbl_web2 = tk.Label(b_links, text="🌐 Bio & Hub", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_purple"], bg=PALETTE["card_bg"], padx=6, pady=2, cursor="hand2")
|
|
5710
5806
|
lbl_web2.pack(side=tk.LEFT, padx=3)
|
|
5711
5807
|
lbl_web2.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_BIO))
|
|
5712
5808
|
|
|
@@ -5714,7 +5810,7 @@ class AutoReadmeGUI:
|
|
|
5714
5810
|
lbl_web3.pack(side=tk.LEFT, padx=3)
|
|
5715
5811
|
lbl_web3.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_MAIN))
|
|
5716
5812
|
|
|
5717
|
-
lbl_web4 = tk.Label(b_links, text="🤗
|
|
5813
|
+
lbl_web4 = tk.Label(b_links, text="🤗 Live Demo", font=("Segoe UI", 8, "bold"), fg=PALETTE.get("accent_coral", PALETTE["accent_cyan"]), bg=PALETTE["card_bg"], padx=6, pady=2, cursor="hand2")
|
|
5718
5814
|
lbl_web4.pack(side=tk.LEFT, padx=3)
|
|
5719
5815
|
lbl_web4.bind("<Button-1>", lambda e: webbrowser.open("https://huggingface.co/spaces/toprakke4/tzero-token-reducer"))
|
|
5720
5816
|
|
|
@@ -5725,7 +5821,7 @@ class AutoReadmeGUI:
|
|
|
5725
5821
|
|
|
5726
5822
|
p_head_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5727
5823
|
p_head_row.pack(fill=tk.X, pady=(0, 4))
|
|
5728
|
-
tk.Label(p_head_row, text="⚙️
|
|
5824
|
+
tk.Label(p_head_row, text="⚙️ PROFILE & SECURITY MANAGER", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_green"], bg=PALETTE["card_bg"]).pack(side=tk.LEFT)
|
|
5729
5825
|
|
|
5730
5826
|
p_select_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5731
5827
|
p_select_row.pack(fill=tk.X, pady=(0, 6))
|
|
@@ -5737,14 +5833,14 @@ class AutoReadmeGUI:
|
|
|
5737
5833
|
p_actions = tk.Frame(p_select_row, bg=PALETTE["card_bg"])
|
|
5738
5834
|
p_actions.pack(side=tk.RIGHT)
|
|
5739
5835
|
|
|
5740
|
-
self.use_profile_btn = apply_modern_hover(tk.Button(p_actions, text="⚡
|
|
5836
|
+
self.use_profile_btn = apply_modern_hover(tk.Button(p_actions, text="⚡ Activate", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.activate_selected_profile, cursor="hand2"), hover_bg=PALETTE["accent_cyan"], hover_fg="#000000")
|
|
5741
5837
|
self.use_profile_btn.pack(side=tk.TOP, fill=tk.X, pady=1)
|
|
5742
5838
|
|
|
5743
5839
|
p_mini = tk.Frame(p_actions, bg=PALETTE["card_bg"])
|
|
5744
5840
|
p_mini.pack(side=tk.BOTTOM, fill=tk.X)
|
|
5745
|
-
self.new_profile_btn = apply_modern_hover(tk.Button(p_mini, text="+
|
|
5841
|
+
self.new_profile_btn = apply_modern_hover(tk.Button(p_mini, text="+ New", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 7, "bold"), command=self.create_new_profile_modal, cursor="hand2"))
|
|
5746
5842
|
self.new_profile_btn.pack(side=tk.LEFT, padx=1)
|
|
5747
|
-
self.del_profile_btn = apply_modern_hover(tk.Button(p_mini, text="🗑
|
|
5843
|
+
self.del_profile_btn = apply_modern_hover(tk.Button(p_mini, text="🗑 Delete", bg=PALETTE["card_border"], fg=PALETTE["error"], relief=tk.FLAT, font=("Segoe UI", 7, "bold"), command=self.delete_selected_profile, cursor="hand2"), hover_bg=PALETTE["error"], hover_fg="#ffffff")
|
|
5748
5844
|
self.del_profile_btn.pack(side=tk.LEFT, padx=1)
|
|
5749
5845
|
|
|
5750
5846
|
# 2x2 Management tools grid
|
|
@@ -5753,29 +5849,29 @@ class AutoReadmeGUI:
|
|
|
5753
5849
|
tools_grid.columnconfigure(0, weight=1)
|
|
5754
5850
|
tools_grid.columnconfigure(1, weight=1)
|
|
5755
5851
|
|
|
5756
|
-
self.keyring_btn = apply_modern_hover(tk.Button(tools_grid, text="🔑 API
|
|
5852
|
+
self.keyring_btn = apply_modern_hover(tk.Button(tools_grid, text="🔑 API Keys (Keyring)", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.open_keyring_editor_dialog, cursor="hand2"))
|
|
5757
5853
|
self.keyring_btn.grid(row=0, column=0, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5758
5854
|
|
|
5759
|
-
self.keyring_backup_btn = apply_modern_hover(tk.Button(tools_grid, text="🛡
|
|
5855
|
+
self.keyring_backup_btn = apply_modern_hover(tk.Button(tools_grid, text="🛡 Credentials Backup", bg=PALETTE["card_border"], fg=PALETTE["accent_green"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.open_keyring_backup_dialog, cursor="hand2"))
|
|
5760
5856
|
self.keyring_backup_btn.grid(row=0, column=1, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5761
5857
|
|
|
5762
|
-
self.global_config_btn = apply_modern_hover(tk.Button(tools_grid, text="⚙
|
|
5858
|
+
self.global_config_btn = apply_modern_hover(tk.Button(tools_grid, text="⚙ Performance & Limits", bg=PALETTE["card_border"], fg=PALETTE["accent_purple"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.open_global_config_editor, cursor="hand2"))
|
|
5763
5859
|
self.global_config_btn.grid(row=1, column=0, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5764
5860
|
|
|
5765
|
-
self.ignore_folders_btn = apply_modern_hover(tk.Button(tools_grid, text="📁
|
|
5861
|
+
self.ignore_folders_btn = apply_modern_hover(tk.Button(tools_grid, text="📁 Ignored Folders", bg=PALETTE["card_border"], fg=PALETTE["text_muted"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.open_ignored_folders_dialog, cursor="hand2"))
|
|
5766
5862
|
self.ignore_folders_btn.grid(row=1, column=1, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5767
5863
|
|
|
5768
5864
|
# Import/Export + Presets row
|
|
5769
5865
|
io_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5770
5866
|
io_row.pack(fill=tk.X, pady=(2, 0))
|
|
5771
5867
|
|
|
5772
|
-
self.import_profile_btn = apply_modern_hover(tk.Button(io_row, text="📥
|
|
5868
|
+
self.import_profile_btn = apply_modern_hover(tk.Button(io_row, text="📥 Import", bg=PALETTE["card_border"], fg=PALETTE["text_muted"], relief=tk.FLAT, font=("Segoe UI", 8), command=self.import_profile_json, cursor="hand2"))
|
|
5773
5869
|
self.import_profile_btn.pack(side=tk.LEFT, padx=2)
|
|
5774
5870
|
|
|
5775
|
-
self.export_profile_btn = apply_modern_hover(tk.Button(io_row, text="📤
|
|
5871
|
+
self.export_profile_btn = apply_modern_hover(tk.Button(io_row, text="📤 Export", bg=PALETTE["card_border"], fg=PALETTE["text_muted"], relief=tk.FLAT, font=("Segoe UI", 8), command=self.export_profile_json, cursor="hand2"))
|
|
5776
5872
|
self.export_profile_btn.pack(side=tk.LEFT, padx=2)
|
|
5777
5873
|
|
|
5778
|
-
tk.Label(io_row, text="
|
|
5874
|
+
tk.Label(io_row, text="Preset:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(side=tk.LEFT, padx=(8, 2))
|
|
5779
5875
|
self.preset_combo = ttk.Combobox(io_row, values=list(WorkspacePresetManager.PRESETS.keys()), state="readonly", width=14)
|
|
5780
5876
|
self.preset_combo.pack(side=tk.RIGHT, fill=tk.X, expand=True, padx=2)
|
|
5781
5877
|
self.preset_combo.bind("<<ComboboxSelected>>", self.apply_scan_preset)
|
|
@@ -6092,33 +6188,33 @@ class AutoReadmeGUI:
|
|
|
6092
6188
|
elif r_chat.status_code == 401:
|
|
6093
6189
|
self.safe_after(0, lambda: self.status_dot.set_status("red"))
|
|
6094
6190
|
warn_msg = (
|
|
6095
|
-
f"
|
|
6096
|
-
f"💡
|
|
6097
|
-
f"1.
|
|
6098
|
-
f"2. NVIDIA NIM
|
|
6099
|
-
f"3. https://build.nvidia.com
|
|
6100
|
-
f"⚡ T-Zero
|
|
6191
|
+
f"Remote API Key could not be verified (HTTP 401: Authorization Failed).\n\n"
|
|
6192
|
+
f"💡 Cause & Resolution:\n"
|
|
6193
|
+
f"1. Your API key may be invalid, incomplete, or expired.\n"
|
|
6194
|
+
f"2. NVIDIA NIM keys typically start with 'nvapi-'.\n"
|
|
6195
|
+
f"3. Generate a new active API key at https://build.nvidia.com and enter it in the Settings tab.\n\n"
|
|
6196
|
+
f"⚡ With the T-Zero Local Offline AST Engine, full context generation works 100% free even without an API key!"
|
|
6101
6197
|
)
|
|
6102
|
-
self.safe_after(0, lambda: messagebox.showwarning("
|
|
6198
|
+
self.safe_after(0, lambda: messagebox.showwarning("Authorization Error (401)", warn_msg))
|
|
6103
6199
|
elif r_chat.status_code == 403:
|
|
6104
6200
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6105
6201
|
warn_msg = (
|
|
6106
|
-
f"Model
|
|
6107
|
-
f"💡
|
|
6108
|
-
f"NVIDIA NIM 'Personal'
|
|
6109
|
-
f"1. https://build.nvidia.com
|
|
6110
|
-
f"2.
|
|
6202
|
+
f"Model list is reachable, but inference permission is missing (HTTP 403: Authorization failed).\n\n"
|
|
6203
|
+
f"💡 Cause & Resolution:\n"
|
|
6204
|
+
f"API keys created on NVIDIA NIM 'Personal' accounts may not have 'Public API Endpoints' enabled by default.\n\n"
|
|
6205
|
+
f"1. Create a new API key at https://build.nvidia.com with 'Public API Endpoints' permission enabled.\n"
|
|
6206
|
+
f"2. Or run T-Zero in Local Offline AST Mode to synthesize 100% complete context without any API key!"
|
|
6111
6207
|
)
|
|
6112
|
-
self.safe_after(0, lambda: messagebox.showwarning("
|
|
6208
|
+
self.safe_after(0, lambda: messagebox.showwarning("Partial Permission (403)", warn_msg))
|
|
6113
6209
|
elif r_chat.status_code == 410:
|
|
6114
6210
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6115
6211
|
self.safe_after(0, lambda: messagebox.showwarning(
|
|
6116
|
-
"Model
|
|
6117
|
-
f"'{target_model}'
|
|
6212
|
+
"Model End of Life (410)",
|
|
6213
|
+
f"Model '{target_model}' has reached End of Life. Please select 'deepseek-ai/deepseek-v4.1-flash' from the dropdown."
|
|
6118
6214
|
))
|
|
6119
6215
|
else:
|
|
6120
6216
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6121
|
-
self.safe_after(0, lambda: messagebox.showwarning("API
|
|
6217
|
+
self.safe_after(0, lambda: messagebox.showwarning("API Response", f"Remote API status: {r_chat.status_code}\n{r_chat.text[:200]}"))
|
|
6122
6218
|
except Exception:
|
|
6123
6219
|
self.safe_after(0, lambda: self.status_dot.set_status("green"))
|
|
6124
6220
|
self.safe_after(0, lambda: messagebox.showinfo("Success", get_text("ping_success", self.lang)))
|
|
@@ -6230,40 +6326,71 @@ class AutoReadmeGUI:
|
|
|
6230
6326
|
|
|
6231
6327
|
tk.Button(pad, text="Close", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=dialog.destroy).pack(pady=(15, 0))
|
|
6232
6328
|
|
|
6233
|
-
def show_crypto_support_modal(self):
|
|
6329
|
+
def show_crypto_support_modal(self, periodic: bool = False):
|
|
6234
6330
|
try:
|
|
6235
6331
|
from tzero.tzero_traffic import (
|
|
6236
|
-
CRYPTO_USDT_TRC20, CRYPTO_BTC, REPO_URL, BIO_URL, CURRENT_VERSION
|
|
6332
|
+
CRYPTO_EVM, CRYPTO_USDT_TRC20, CRYPTO_BTC, REPO_URL, BIO_URL, SPONSOR_HUB_URL, CURRENT_VERSION
|
|
6237
6333
|
)
|
|
6238
6334
|
except Exception:
|
|
6335
|
+
CRYPTO_EVM = "0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5"
|
|
6239
6336
|
CRYPTO_USDT_TRC20 = "TE7uKxZJ414u938gWf6bYh9QvRk2141517"
|
|
6240
6337
|
CRYPTO_BTC = "bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s"
|
|
6241
6338
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6242
6339
|
BIO_URL = "https://hopp.bio/siberegitim"
|
|
6340
|
+
SPONSOR_HUB_URL = "https://tzero-indol.vercel.app/#support"
|
|
6243
6341
|
from tzero import __version__ as CURRENT_VERSION
|
|
6244
6342
|
|
|
6343
|
+
stats = dict(getattr(self, "community_stats", {}) or {})
|
|
6344
|
+
stars = int(stats.get("stars", 111))
|
|
6345
|
+
dl_label = str(stats.get("downloads_label", "22,900+"))
|
|
6346
|
+
saved_label = str(stats.get("saved_tokens_label", "1,120,000+"))
|
|
6347
|
+
|
|
6245
6348
|
dialog = tk.Toplevel(self.root)
|
|
6246
|
-
|
|
6247
|
-
|
|
6349
|
+
if siber_akademi_icon:
|
|
6350
|
+
try:
|
|
6351
|
+
siber_akademi_icon.apply_window_icon(dialog)
|
|
6352
|
+
except Exception:
|
|
6353
|
+
pass
|
|
6354
|
+
dialog.title(
|
|
6355
|
+
f"💖 Sponsor T-Zero v{CURRENT_VERSION} — Keep It 100% Free"
|
|
6356
|
+
if periodic
|
|
6357
|
+
else f"T-Zero v{CURRENT_VERSION} — Support & Sponsor Hub"
|
|
6358
|
+
)
|
|
6359
|
+
dialog.geometry("560x575" if periodic else "560x540")
|
|
6248
6360
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
6249
6361
|
dialog.transient(self.root)
|
|
6250
6362
|
dialog.grab_set()
|
|
6251
6363
|
|
|
6252
|
-
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=
|
|
6364
|
+
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=18)
|
|
6253
6365
|
pad.pack(fill=tk.BOTH, expand=True)
|
|
6254
6366
|
|
|
6367
|
+
hdr_txt = (
|
|
6368
|
+
"💖 ENJOYING T-ZERO? BECOME A SPONSOR!"
|
|
6369
|
+
if periodic
|
|
6370
|
+
else f"🚀 T-ZERO v{CURRENT_VERSION} SPONSOR & SUPPORT HUB"
|
|
6371
|
+
)
|
|
6255
6372
|
tk.Label(
|
|
6256
6373
|
pad,
|
|
6257
|
-
text=
|
|
6374
|
+
text=hdr_txt,
|
|
6258
6375
|
font=("Segoe UI", 12, "bold"),
|
|
6259
6376
|
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6260
6377
|
bg=PALETTE["bg_start"]
|
|
6261
6378
|
).pack(anchor=tk.W, pady=(0, 6))
|
|
6262
6379
|
|
|
6380
|
+
stats_banner = tk.Frame(pad, bg=PALETTE["card_bg"], highlightthickness=1, highlightbackground=PALETTE["card_border"], padx=12, pady=7)
|
|
6381
|
+
stats_banner.pack(fill=tk.X, pady=(0, 10))
|
|
6382
|
+
tk.Label(
|
|
6383
|
+
stats_banner,
|
|
6384
|
+
text=f"🚀 {dl_label} Downloads | ⚡ {saved_label} Tokens Saved | ⭐ {stars} GitHub Stars",
|
|
6385
|
+
font=("Segoe UI", 8, "bold"),
|
|
6386
|
+
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6387
|
+
bg=PALETTE["card_bg"]
|
|
6388
|
+
).pack()
|
|
6389
|
+
|
|
6263
6390
|
msg = (
|
|
6264
|
-
"T-Zero
|
|
6265
|
-
"
|
|
6266
|
-
"
|
|
6391
|
+
"T-Zero is 100% FREE, local-first, and open-source (AGPL-3.0) with zero paid API lock-in.\n"
|
|
6392
|
+
"Your sponsorship directly funds continuous maintenance, multi-language AST engines,\n"
|
|
6393
|
+
"and independent developer work by Toprak Ahmet Aydoğmuş (Siber Akademi)."
|
|
6267
6394
|
)
|
|
6268
6395
|
tk.Label(
|
|
6269
6396
|
pad,
|
|
@@ -6272,39 +6399,76 @@ class AutoReadmeGUI:
|
|
|
6272
6399
|
fg=PALETTE["text_muted"],
|
|
6273
6400
|
bg=PALETTE["bg_start"],
|
|
6274
6401
|
justify=tk.LEFT
|
|
6275
|
-
).pack(anchor=tk.W, pady=(0,
|
|
6402
|
+
).pack(anchor=tk.W, pady=(0, 10))
|
|
6276
6403
|
|
|
6277
6404
|
def copy_addr(val, label):
|
|
6278
6405
|
try:
|
|
6279
6406
|
self.root.clipboard_clear()
|
|
6280
6407
|
self.root.clipboard_append(val)
|
|
6281
|
-
self.log(f"
|
|
6282
|
-
messagebox.showinfo("
|
|
6408
|
+
self.log(f"Copied to clipboard ({label}): {val}")
|
|
6409
|
+
messagebox.showinfo("Copied", f"{label} address copied to clipboard:\n{val}")
|
|
6283
6410
|
except Exception:
|
|
6284
6411
|
pass
|
|
6285
6412
|
|
|
6286
|
-
#
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
tk.Label(
|
|
6290
|
-
tk.Button(
|
|
6413
|
+
# EVM (ETH / Base / Polygon)
|
|
6414
|
+
e_box = tk.LabelFrame(pad, text="💎 Ethereum / EVM (ETH, USDT, USDC — Mainnet/Base/Polygon)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_cyan", "#38bdf8"), font=("Segoe UI", 8, "bold"), padx=10, pady=6)
|
|
6415
|
+
e_box.pack(fill=tk.X, pady=3)
|
|
6416
|
+
tk.Label(e_box, text=CRYPTO_EVM, font=("Consolas", 8), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6417
|
+
tk.Button(e_box, text="Copy", font=("Segoe UI", 8, "bold"), bg=PALETTE.get("card_border", "#334155"), fg=PALETTE["text_main"], relief=tk.FLAT, cursor="hand2", command=lambda: copy_addr(CRYPTO_EVM, "EVM")).pack(side=tk.RIGHT)
|
|
6418
|
+
|
|
6419
|
+
# USDT (TRC-20)
|
|
6420
|
+
u_box = tk.LabelFrame(pad, text="🪙 USDT (TRC-20 Network)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_green", "#22c55e"), font=("Segoe UI", 8, "bold"), padx=10, pady=6)
|
|
6421
|
+
u_box.pack(fill=tk.X, pady=3)
|
|
6422
|
+
tk.Label(u_box, text=CRYPTO_USDT_TRC20, font=("Consolas", 8), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6423
|
+
tk.Button(u_box, text="Copy", font=("Segoe UI", 8, "bold"), bg=PALETTE.get("card_border", "#334155"), fg=PALETTE["text_main"], relief=tk.FLAT, cursor="hand2", command=lambda: copy_addr(CRYPTO_USDT_TRC20, "USDT")).pack(side=tk.RIGHT)
|
|
6291
6424
|
|
|
6292
6425
|
# BTC
|
|
6293
|
-
b_box = tk.LabelFrame(pad, text="🪙 Bitcoin (BTC Network)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_yellow", "#fbbf24"), font=("Segoe UI",
|
|
6294
|
-
b_box.pack(fill=tk.X, pady=
|
|
6295
|
-
tk.Label(b_box, text=CRYPTO_BTC, font=("Consolas",
|
|
6296
|
-
tk.Button(b_box, text="
|
|
6426
|
+
b_box = tk.LabelFrame(pad, text="🪙 Bitcoin (BTC Network)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_yellow", "#fbbf24"), font=("Segoe UI", 8, "bold"), padx=10, pady=6)
|
|
6427
|
+
b_box.pack(fill=tk.X, pady=3)
|
|
6428
|
+
tk.Label(b_box, text=CRYPTO_BTC, font=("Consolas", 8), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6429
|
+
tk.Button(b_box, text="Copy", font=("Segoe UI", 8, "bold"), bg=PALETTE.get("card_border", "#334155"), fg=PALETTE["text_main"], relief=tk.FLAT, cursor="hand2", command=lambda: copy_addr(CRYPTO_BTC, "BTC")).pack(side=tk.RIGHT)
|
|
6297
6430
|
|
|
6298
6431
|
# Links Row
|
|
6299
6432
|
links_row = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6300
6433
|
links_row.pack(fill=tk.X, pady=(12, 6))
|
|
6301
6434
|
|
|
6302
6435
|
import webbrowser
|
|
6303
|
-
tk.Button(links_row, text="
|
|
6304
|
-
tk.Button(links_row, text="
|
|
6436
|
+
tk.Button(links_row, text="💖 Sponsor Hub", font=("Segoe UI", 9, "bold"), bg=PALETTE.get("accent_cyan", "#38bdf8"), fg="#000000", relief=tk.FLAT, cursor="hand2", command=lambda: webbrowser.open(SPONSOR_HUB_URL)).pack(side=tk.LEFT, padx=(0, 6))
|
|
6437
|
+
tk.Button(links_row, text="⭐ GitHub Star", font=("Segoe UI", 9, "bold"), bg=PALETTE.get("warning", "#eab308"), fg="#000000", relief=tk.FLAT, cursor="hand2", command=lambda: webbrowser.open(REPO_URL)).pack(side=tk.LEFT, padx=4)
|
|
6438
|
+
tk.Button(links_row, text="🌐 Bio & Links", font=("Segoe UI", 9, "bold"), bg=PALETTE.get("card_border", "#334155"), fg=PALETTE["text_main"], relief=tk.FLAT, cursor="hand2", command=lambda: webbrowser.open(BIO_URL)).pack(side=tk.LEFT, padx=4)
|
|
6305
6439
|
|
|
6306
|
-
#
|
|
6307
|
-
tk.
|
|
6440
|
+
# Footer buttons
|
|
6441
|
+
footer = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6442
|
+
footer.pack(fill=tk.X, pady=(12, 0))
|
|
6443
|
+
|
|
6444
|
+
if periodic:
|
|
6445
|
+
def on_dismiss_sponsor():
|
|
6446
|
+
try:
|
|
6447
|
+
profile = _config_mgr.get_profile()
|
|
6448
|
+
profile["sponsor_popup_dismissed_v12"] = True
|
|
6449
|
+
_config_mgr.save_profile(profile)
|
|
6450
|
+
except Exception:
|
|
6451
|
+
pass
|
|
6452
|
+
dialog.destroy()
|
|
6453
|
+
|
|
6454
|
+
tk.Button(footer, text="Remind Me Later", bg=PALETTE["bg_start"], fg=PALETTE["text_muted"], relief=tk.FLAT, font=("Segoe UI", 8), cursor="hand2", command=dialog.destroy).pack(side=tk.LEFT)
|
|
6455
|
+
tk.Button(footer, text="Don't Show Again", bg=PALETTE["bg_start"], fg=PALETTE["text_muted"], relief=tk.FLAT, font=("Segoe UI", 8), cursor="hand2", command=on_dismiss_sponsor).pack(side=tk.RIGHT)
|
|
6456
|
+
else:
|
|
6457
|
+
tk.Button(footer, text="Close", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=dialog.destroy).pack()
|
|
6458
|
+
|
|
6459
|
+
def check_and_show_startup_popups(self):
|
|
6460
|
+
"""Show Star popup on 1st & every 10th launch, and Sponsor popup every 5th launch or weekly."""
|
|
6461
|
+
try:
|
|
6462
|
+
profile = _config_mgr.get_profile()
|
|
6463
|
+
action = decide_startup_popup(profile)
|
|
6464
|
+
_config_mgr.save_profile(profile)
|
|
6465
|
+
except Exception:
|
|
6466
|
+
action = "none"
|
|
6467
|
+
|
|
6468
|
+
if action == "star":
|
|
6469
|
+
self.check_and_show_star_welcome_popup()
|
|
6470
|
+
elif action == "sponsor":
|
|
6471
|
+
self.show_crypto_support_modal(periodic=True)
|
|
6308
6472
|
|
|
6309
6473
|
def open_star_action(self):
|
|
6310
6474
|
"""Opens GitHub repository directly and shows thank-you toast."""
|
|
@@ -6315,7 +6479,7 @@ class AutoReadmeGUI:
|
|
|
6315
6479
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6316
6480
|
try:
|
|
6317
6481
|
webbrowser.open(REPO_URL)
|
|
6318
|
-
self.show_toast("⭐ GitHub
|
|
6482
|
+
self.show_toast("⭐ GitHub repository opened! Thank you for starring!", "success")
|
|
6319
6483
|
except Exception:
|
|
6320
6484
|
pass
|
|
6321
6485
|
|
|
@@ -6359,7 +6523,7 @@ class AutoReadmeGUI:
|
|
|
6359
6523
|
siber_akademi_icon.apply_window_icon(dialog)
|
|
6360
6524
|
except Exception:
|
|
6361
6525
|
pass
|
|
6362
|
-
dialog_title = f"⭐ T-Zero v{CURRENT_VERSION} —
|
|
6526
|
+
dialog_title = f"⭐ T-Zero v{CURRENT_VERSION} — Please Give Us a Star!" if first_launch else f"⭐ T-Zero v{CURRENT_VERSION} — {target_stars} Stars Goal!"
|
|
6363
6527
|
dialog.title(dialog_title)
|
|
6364
6528
|
dialog.geometry("560x430")
|
|
6365
6529
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
@@ -6373,9 +6537,9 @@ class AutoReadmeGUI:
|
|
|
6373
6537
|
h_frame = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6374
6538
|
h_frame.pack(fill=tk.X, pady=(0, 10))
|
|
6375
6539
|
header_text = (
|
|
6376
|
-
"🚀
|
|
6540
|
+
"🚀 GITHUB OPENED IN YOUR BROWSER: PLEASE STAR THE REPO! ⭐"
|
|
6377
6541
|
if first_launch
|
|
6378
|
-
else f"⭐ {target_stars}
|
|
6542
|
+
else f"⭐ {target_stars} STARS GOAL: JOIN THE COMMUNITY!"
|
|
6379
6543
|
)
|
|
6380
6544
|
hdr_lbl = tk.Label(
|
|
6381
6545
|
h_frame,
|
|
@@ -6391,7 +6555,7 @@ class AutoReadmeGUI:
|
|
|
6391
6555
|
stats_frame.pack(fill=tk.X, pady=(0, 12))
|
|
6392
6556
|
stats_lbl = tk.Label(
|
|
6393
6557
|
stats_frame,
|
|
6394
|
-
text=f"🚀 {dl_label}
|
|
6558
|
+
text=f"🚀 {dl_label} Downloads (PyPI & npm) | ⚡ {saved_label} Tokens Saved\n⭐ Current Stars: {stars} / {target_stars} Goal (Progress: {pct_int}%)",
|
|
6395
6559
|
font=("Segoe UI", 9, "bold"),
|
|
6396
6560
|
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6397
6561
|
bg=PALETTE["card_bg"],
|
|
@@ -6410,19 +6574,19 @@ class AutoReadmeGUI:
|
|
|
6410
6574
|
def _build_star_msg(cur_s: int, tgt_s: int) -> str:
|
|
6411
6575
|
if first_launch:
|
|
6412
6576
|
return (
|
|
6413
|
-
"
|
|
6414
|
-
"
|
|
6415
|
-
"
|
|
6416
|
-
"
|
|
6417
|
-
f"
|
|
6418
|
-
"
|
|
6577
|
+
"Hello! I'm Toprak Ahmet Aydoğmuş (Siber Akademi).\n"
|
|
6578
|
+
"Our GitHub repository just opened in your browser because you launched T-Zero!\n\n"
|
|
6579
|
+
"To help keep this project independent and 100% FREE for everyone,\n"
|
|
6580
|
+
"please click the ★ STAR button in the top-right corner of the GitHub page\n"
|
|
6581
|
+
f"to support our work! ⭐ ({tgt_s} Stars Goal: {cur_s}/{tgt_s})\n\n"
|
|
6582
|
+
"Your star makes a huge difference in helping more developers discover T-Zero!"
|
|
6419
6583
|
)
|
|
6420
6584
|
return (
|
|
6421
|
-
"
|
|
6422
|
-
"T-Zero
|
|
6423
|
-
"
|
|
6424
|
-
"
|
|
6425
|
-
"
|
|
6585
|
+
"Hello! I'm Toprak Ahmet Aydoğmuş (Siber Akademi).\n"
|
|
6586
|
+
"I built T-Zero from scratch to eliminate token costs and context bloat\n"
|
|
6587
|
+
"in AI coding tools, and I provide it 100% FREE to everyone.\n\n"
|
|
6588
|
+
"To keep our project independent and help it reach more developers,\n"
|
|
6589
|
+
"a SINGLE STAR on our GitHub repository makes a massive difference!"
|
|
6426
6590
|
)
|
|
6427
6591
|
|
|
6428
6592
|
msg = _build_star_msg(stars, target_stars)
|
|
@@ -6456,11 +6620,11 @@ class AutoReadmeGUI:
|
|
|
6456
6620
|
except Exception:
|
|
6457
6621
|
pass
|
|
6458
6622
|
dialog.destroy()
|
|
6459
|
-
self.show_toast("⭐
|
|
6623
|
+
self.show_toast("⭐ You're awesome! Thank you so much for your star!", "success")
|
|
6460
6624
|
except Exception:
|
|
6461
6625
|
pass
|
|
6462
6626
|
|
|
6463
|
-
btn_txt = "⭐
|
|
6627
|
+
btn_txt = "⭐ STAR ON GITHUB REPO (OPENED)" if first_launch else "⭐ 1-CLICK STAR ON GITHUB"
|
|
6464
6628
|
star_btn = CanvasPillButton(
|
|
6465
6629
|
pad,
|
|
6466
6630
|
text=btn_txt,
|
|
@@ -6489,7 +6653,7 @@ class AutoReadmeGUI:
|
|
|
6489
6653
|
|
|
6490
6654
|
tk.Button(
|
|
6491
6655
|
b_row,
|
|
6492
|
-
text="
|
|
6656
|
+
text="Remind Me Later",
|
|
6493
6657
|
font=("Segoe UI", 8),
|
|
6494
6658
|
bg=PALETTE["bg_start"],
|
|
6495
6659
|
fg=PALETTE["text_muted"],
|
|
@@ -6500,7 +6664,7 @@ class AutoReadmeGUI:
|
|
|
6500
6664
|
|
|
6501
6665
|
tk.Button(
|
|
6502
6666
|
b_row,
|
|
6503
|
-
text="
|
|
6667
|
+
text="Don't Show Again",
|
|
6504
6668
|
font=("Segoe UI", 8),
|
|
6505
6669
|
bg=PALETTE["bg_start"],
|
|
6506
6670
|
fg=PALETTE["text_muted"],
|
|
@@ -7651,7 +7815,7 @@ class AutoReadmeGUI:
|
|
|
7651
7815
|
self.gen_progress["value"] = 100
|
|
7652
7816
|
self.gen_status_lbl.config(text="Dry run complete! 100% Free & Zero-Leak context generated.")
|
|
7653
7817
|
self.log("Offline AST context tree synthesized successfully.")
|
|
7654
|
-
self.show_toast("⚡
|
|
7818
|
+
self.show_toast("⚡ Local Offline AST Context (100% Free & Zero-Leak) compiled successfully!", "success")
|
|
7655
7819
|
|
|
7656
7820
|
def start_generation(self):
|
|
7657
7821
|
url = self.api_url_entry.get().strip()
|
|
@@ -7747,13 +7911,13 @@ Custom Requirements:
|
|
|
7747
7911
|
# If commercial provider has no key at all, stay strictly local via the AST engine (no cloud fallback)
|
|
7748
7912
|
if not key and p.name != "Local Ollama":
|
|
7749
7913
|
self.log(
|
|
7750
|
-
f"
|
|
7914
|
+
f"No external API key configured ({provider_name}). Running Local Offline AST Engine with zero outbound telemetry..."
|
|
7751
7915
|
)
|
|
7752
7916
|
try:
|
|
7753
7917
|
offline_content = generate_offline_context(target_dir, selected_files, self.file_snippets)
|
|
7754
7918
|
self.safe_after(0, lambda: self.on_gen_success(offline_content))
|
|
7755
7919
|
self.safe_after(0, lambda: self.show_toast(
|
|
7756
|
-
"⚡
|
|
7920
|
+
"⚡ Complete context compiled cleanly with Local Offline AST Engine (no API key needed)!",
|
|
7757
7921
|
"success"
|
|
7758
7922
|
))
|
|
7759
7923
|
except Exception as offline_err:
|
|
@@ -7772,22 +7936,22 @@ Custom Requirements:
|
|
|
7772
7936
|
else:
|
|
7773
7937
|
raw_err = str(e)
|
|
7774
7938
|
clean_err = re.sub(r'(Bearer\s+|key[:=]\s*)[A-Za-z0-9_\-\.]{8,}', r'\1[PROTECTED]', raw_err)
|
|
7775
|
-
self.log(f"
|
|
7776
|
-
self.log("
|
|
7939
|
+
self.log(f"Remote API response: {clean_err}")
|
|
7940
|
+
self.log("Activating Local Offline AST Engine without redirecting to any external cloud provider...")
|
|
7777
7941
|
|
|
7778
7942
|
try:
|
|
7779
7943
|
offline_content = generate_offline_context(target_dir, selected_files, self.file_snippets)
|
|
7780
7944
|
self.safe_after(0, lambda: self.on_gen_success(offline_content))
|
|
7781
7945
|
if "401" in raw_err:
|
|
7782
|
-
warn_reason = "
|
|
7946
|
+
warn_reason = "Remote API 401 authorization error (invalid or expired key)"
|
|
7783
7947
|
elif "403" in raw_err:
|
|
7784
|
-
warn_reason = "
|
|
7948
|
+
warn_reason = "Remote API 403 authorization error"
|
|
7785
7949
|
elif "500" in raw_err:
|
|
7786
|
-
warn_reason = "
|
|
7950
|
+
warn_reason = "Remote API server error (HTTP 500)"
|
|
7787
7951
|
else:
|
|
7788
|
-
warn_reason = "
|
|
7952
|
+
warn_reason = "Remote API connection issue"
|
|
7789
7953
|
self.safe_after(0, lambda: self.show_toast(
|
|
7790
|
-
f"⚡
|
|
7954
|
+
f"⚡ Synthesized complete context via T-Zero Local Offline AST Engine due to {warn_reason}!",
|
|
7791
7955
|
"info"
|
|
7792
7956
|
))
|
|
7793
7957
|
except Exception as offline_err:
|
|
@@ -7826,9 +7990,9 @@ Custom Requirements:
|
|
|
7826
7990
|
err_str = str(err)
|
|
7827
7991
|
detail = f"Failed: {err_str}"
|
|
7828
7992
|
if "403" in err_str or "Authorization failed" in err_str:
|
|
7829
|
-
detail += "\n\n💡
|
|
7993
|
+
detail += "\n\n💡 Tip: NVIDIA NIM API key authorization failed (403 Forbidden). Please generate a valid API key at https://build.nvidia.com and enter it under Settings > API Keys."
|
|
7830
7994
|
elif "410" in err_str or "end of life" in err_str:
|
|
7831
|
-
detail += "\n\n💡
|
|
7995
|
+
detail += "\n\n💡 Tip: This model has reached End of Life. Please select the latest 'deepseek-ai/deepseek-v4.1-flash' model from the dropdown."
|
|
7832
7996
|
messagebox.showerror("Error", detail)
|
|
7833
7997
|
|
|
7834
7998
|
def copy_clipboard(self):
|
|
@@ -7956,11 +8120,11 @@ Custom Requirements:
|
|
|
7956
8120
|
|
|
7957
8121
|
def _on_arch_export_done(self, out_path: str, use_ai: bool):
|
|
7958
8122
|
play_sfx("success")
|
|
7959
|
-
mode_str = "
|
|
7960
|
-
self.show_toast(f"ARCHITECTURE.md
|
|
8123
|
+
mode_str = "Live 3rd-Party AI Engine" if use_ai else "T-Zero Local Offline AST Engine"
|
|
8124
|
+
self.show_toast(f"ARCHITECTURE.md generated successfully! ({mode_str})", "success")
|
|
7961
8125
|
self.log(f"ARCHITECTURE.md exported ({mode_str}): {out_path}")
|
|
7962
8126
|
self.gen_progress["value"] = 100
|
|
7963
|
-
self.gen_status_lbl.config(text=f"ARCHITECTURE.md
|
|
8127
|
+
self.gen_status_lbl.config(text=f"ARCHITECTURE.md ready ({mode_str})")
|
|
7964
8128
|
|
|
7965
8129
|
def _on_arch_export_error(self, err_msg: str):
|
|
7966
8130
|
play_sfx("error")
|
|
@@ -8367,9 +8531,9 @@ Custom Requirements:
|
|
|
8367
8531
|
try:
|
|
8368
8532
|
if dlg and dlg.winfo_exists():
|
|
8369
8533
|
if not w.get("first_launch"):
|
|
8370
|
-
w["hdr_lbl"].config(text=f"⭐ {target_stars}
|
|
8534
|
+
w["hdr_lbl"].config(text=f"⭐ {target_stars} STARS GOAL: JOIN THE COMMUNITY!")
|
|
8371
8535
|
w["stats_lbl"].config(
|
|
8372
|
-
text=f"🚀 {dl_label}
|
|
8536
|
+
text=f"🚀 {dl_label} Downloads (PyPI & npm) | ⚡ {saved_label} Tokens Saved\n⭐ Current Stars: {stars} / {target_stars} Goal (Progress: {pct_int}%)"
|
|
8373
8537
|
)
|
|
8374
8538
|
w["bar_fill"].place_configure(relwidth=pct_ratio)
|
|
8375
8539
|
w["msg_lbl"].config(text=w["build_msg"](stars, target_stars))
|
|
@@ -9397,105 +9561,6 @@ def main():
|
|
|
9397
9561
|
run_system_disk_doctor(clean=True, workspace_dir=target_dir)
|
|
9398
9562
|
sys.exit(0)
|
|
9399
9563
|
|
|
9400
|
-
# Fast path for Anti-REA armor / protection
|
|
9401
|
-
if len(sys.argv) > 1 and sys.argv[1].lower() in ("armor", "anti-rea", "--armor", "--anti-rea"):
|
|
9402
|
-
extra_args = sys.argv[2:]
|
|
9403
|
-
if any(flag in ("-h", "--help") for flag in extra_args):
|
|
9404
|
-
print("Usage: tzero armor [TARGET_PATH] [--audit]")
|
|
9405
|
-
print(" Protect source files against AI reverse engineering (180-Tier TDQS-REA Armor).")
|
|
9406
|
-
print(" --audit, -a Audit AI decompilation resistance without modifying files.")
|
|
9407
|
-
sys.exit(0)
|
|
9408
|
-
target_path = next((a for a in extra_args if not a.startswith("-")), ".")
|
|
9409
|
-
out_path = None
|
|
9410
|
-
for idx_a, a in enumerate(extra_args):
|
|
9411
|
-
if a in ("-o", "--output", "--out") and idx_a + 1 < len(extra_args):
|
|
9412
|
-
out_path = extra_args[idx_a + 1]
|
|
9413
|
-
break
|
|
9414
|
-
if any(flag in ("--audit", "-a") for flag in extra_args):
|
|
9415
|
-
from tzero.tzero_armor import audit_path_rea_resistance
|
|
9416
|
-
audit = audit_path_rea_resistance(target_path)
|
|
9417
|
-
print(json.dumps(audit, indent=2))
|
|
9418
|
-
sys.exit(0 if "error" not in audit else 1)
|
|
9419
|
-
from tzero.tzero_armor import protect_path_with_armor
|
|
9420
|
-
res = protect_path_with_armor(target_path, output_path=out_path)
|
|
9421
|
-
if res.get("success"):
|
|
9422
|
-
print(f"[OK] Applied Anti-REA Armor to: {target_path}")
|
|
9423
|
-
if "score_after" in res:
|
|
9424
|
-
print(f" AI Resistance Score: {res.get('score_before')}/100 -> {res.get('score_after')}/100 [{res.get('tier_rating', res.get('rating'))}]")
|
|
9425
|
-
print(f" Verified Tiers Active: {res.get('tiers_active', 0)}/{res.get('tiers_total', 180)} ({res.get('domains_active', 0)}/{res.get('domains_total', 12)} domains)")
|
|
9426
|
-
elif "files_protected" in res:
|
|
9427
|
-
print(f" Protected {res['files_protected']} files in directory.")
|
|
9428
|
-
else:
|
|
9429
|
-
print(f"[FAIL] Armor protection failed: {res.get('error', 'Unknown error')}", file=sys.stderr)
|
|
9430
|
-
sys.exit(0 if res.get("success") else 1)
|
|
9431
|
-
|
|
9432
|
-
# Fast path for Anti-REA audit
|
|
9433
|
-
if len(sys.argv) > 1 and sys.argv[1].lower() in ("audit-rea", "--audit-rea"):
|
|
9434
|
-
from tzero.tzero_armor import audit_path_rea_resistance
|
|
9435
|
-
target_path = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else "."
|
|
9436
|
-
audit = audit_path_rea_resistance(target_path)
|
|
9437
|
-
if audit.get("error"):
|
|
9438
|
-
print(f"[ERROR] {audit['error']}", file=sys.stderr)
|
|
9439
|
-
sys.exit(1)
|
|
9440
|
-
print("================================================================================")
|
|
9441
|
-
print(" SHIELD AUDIT REPORT: AI REVERSE-ENGINEERING RESISTANCE (TDQS-REA)")
|
|
9442
|
-
print("================================================================================")
|
|
9443
|
-
print(f"Target: {target_path}")
|
|
9444
|
-
print(f"AI Score: {audit.get('score', 0)} / 100 [{audit.get('tier_rating', audit.get('rating', 'UNVERIFIED'))}]")
|
|
9445
|
-
if "tiers_total" in audit:
|
|
9446
|
-
print(f"Tier Matrix: {audit.get('tiers_active', 0)} / {audit.get('tiers_total', 180)} Tiers ({audit.get('domains_active', 0)}/{audit.get('domains_total', 12)} Domains)")
|
|
9447
|
-
print(f"Score Basis: {audit.get('score_kind', 'static_textual_indicator')}")
|
|
9448
|
-
print(f"Status: {audit.get('status', 'N/A')}")
|
|
9449
|
-
if audit.get("defenses_active"):
|
|
9450
|
-
print("\nActive Defenses:")
|
|
9451
|
-
for k, v in audit["defenses_active"].items():
|
|
9452
|
-
print(f" [{'✔' if v else ' '}] {k}")
|
|
9453
|
-
if audit.get("unverified_layers"):
|
|
9454
|
-
print(f"\nUnverified Layers (not measured statically): {', '.join(audit['unverified_layers'])}")
|
|
9455
|
-
recs = audit.get("sample_findings") or audit.get("findings", [])
|
|
9456
|
-
if recs:
|
|
9457
|
-
print("\nRecommendations:")
|
|
9458
|
-
for f in recs:
|
|
9459
|
-
print(f" • {f}")
|
|
9460
|
-
print("================================================================================")
|
|
9461
|
-
sys.exit(0)
|
|
9462
|
-
|
|
9463
|
-
# Fast path for Anti-REA shield-exe
|
|
9464
|
-
if len(sys.argv) > 1 and sys.argv[1].lower() in ("shield-exe", "--shield-exe"):
|
|
9465
|
-
from tzero.tzero_armor import shield_executable
|
|
9466
|
-
target_path = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else ""
|
|
9467
|
-
if not target_path:
|
|
9468
|
-
print("Usage: tzero shield-exe <path_to_binary.exe>", file=sys.stderr)
|
|
9469
|
-
sys.exit(1)
|
|
9470
|
-
res = shield_executable(target_path)
|
|
9471
|
-
if res.get("shielded"):
|
|
9472
|
-
print(f"[OK] Shielded executable against pyinstxtractor: {res.get('output_path', target_path)}")
|
|
9473
|
-
print(f" Decoy archive traps injected: {res.get('decoy_traps_injected', 0)}")
|
|
9474
|
-
else:
|
|
9475
|
-
print(f"[INFO] {res.get('reason', 'Already shielded or not a PyInstaller binary.')}")
|
|
9476
|
-
sys.exit(0 if res.get("shielded") else 1)
|
|
9477
|
-
|
|
9478
|
-
# Fast path for Anti-REA radar / gui
|
|
9479
|
-
if len(sys.argv) > 1 and sys.argv[1].lower() in ("radar", "--radar", "anti-rea-gui"):
|
|
9480
|
-
radar_args = sys.argv[2:]
|
|
9481
|
-
if any(a in ("-h", "--help") for a in radar_args):
|
|
9482
|
-
print("Usage: tzero radar [PATH | --audit PATH | --armor PATH]\n"
|
|
9483
|
-
"Launch Anti-REA Radar GUI or run headless Anti-REA audit/armor on a target path.")
|
|
9484
|
-
sys.exit(0)
|
|
9485
|
-
if radar_args:
|
|
9486
|
-
from tzero.tzero_armor import audit_path_rea_resistance, protect_path_with_armor
|
|
9487
|
-
mode_armor = "--armor" in radar_args
|
|
9488
|
-
target = next((a for a in radar_args if not a.startswith("-")), ".")
|
|
9489
|
-
res = protect_path_with_armor(target) if mode_armor else audit_path_rea_resistance(target)
|
|
9490
|
-
print(json.dumps(res, indent=2))
|
|
9491
|
-
sys.exit(0 if res.get("success", True) else 1)
|
|
9492
|
-
try:
|
|
9493
|
-
from tzero.anti_rea.gui import main as gui_main
|
|
9494
|
-
gui_main()
|
|
9495
|
-
except Exception as e:
|
|
9496
|
-
print(f"Error launching Anti-REA GUI: {e}", file=sys.stderr)
|
|
9497
|
-
sys.exit(0)
|
|
9498
|
-
|
|
9499
9564
|
parser = argparse.ArgumentParser(
|
|
9500
9565
|
description="Siber Akademi T-Zero Context Architect - Enterprise Codebase Context Builder & Token Reducer",
|
|
9501
9566
|
epilog="""
|
|
@@ -9551,7 +9616,8 @@ def main():
|
|
|
9551
9616
|
parser.add_argument("--deep", action="store_true", help="Run deep offline subsystem self-check with all 9 v11 subsystems (use with --doctor)")
|
|
9552
9617
|
parser.add_argument("--pipe", nargs="?", const="", default=None, metavar="FILENAME_HINT", help="Read code/diff/schema from stdin, compress tokens, and output to stdout")
|
|
9553
9618
|
parser.add_argument("--clip", "--copy", nargs="?", const="", default=None, metavar="FILE", help="Prune file AST signatures and copy directly to system clipboard")
|
|
9554
|
-
parser.add_argument("--sync", nargs="?", const=".", default=None, metavar="DIR", help="
|
|
9619
|
+
parser.add_argument("--sync", nargs="?", const=".", default=None, metavar="DIR", help="Preview workspace rules for Cursor, Claude Code and Windsurf")
|
|
9620
|
+
parser.add_argument("--apply-sync", action="store_true", help="With --sync, create missing rule files without replacing existing ones")
|
|
9555
9621
|
parser.add_argument("--cost", nargs="?", const=".", default=None, metavar="DIR", help="Calculate real-time token cost and ROI financial cockpit")
|
|
9556
9622
|
parser.add_argument("--drift", nargs="?", const=".", default=None, metavar="DIR", help="Analyze quantitative instruction adherence and architectural rule drift")
|
|
9557
9623
|
parser.add_argument("--init-hooks", nargs="?", const=".", default=None, metavar="REPO_DIR", dest="init_hooks", help="Install zero-leak & token security pre-commit hook into .git/hooks")
|
|
@@ -9570,8 +9636,6 @@ def main():
|
|
|
9570
9636
|
parser.add_argument("--patch", "--apply-patch", dest="apply_patch", metavar="DIFF_FILE_OR_STR", help="Apply patch with AST-tolerant fuzzy matching (whitespace & line drift agnostic)")
|
|
9571
9637
|
parser.add_argument("--target", default=None, metavar="TARGET_FILE", help="Target file for --patch (optional if patch specifies file header)")
|
|
9572
9638
|
parser.add_argument("--fuzzy", action="store_true", default=True, help="Enable fuzzy AST and whitespace matching for patch application (default: True)")
|
|
9573
|
-
parser.add_argument("--armor", "--anti-rea", nargs="?", const=".", default=None, metavar="PATH", dest="armor", help="Apply military-grade Anti-REA armor against AI reverse engineering (morluto/rea)")
|
|
9574
|
-
parser.add_argument("--audit-rea", nargs="?", const=".", default=None, metavar="PATH", dest="audit_rea", help="Audit code or binary for resistance against AI reverse engineering (0-100)")
|
|
9575
9639
|
parser.add_argument("--telemetry", nargs="?", const=".", default=None, metavar="DIR", help="Show offline SQLite token savings & ROI telemetry report")
|
|
9576
9640
|
parser.add_argument("--no-fuzzy", dest="fuzzy", action="store_false", help="Disable fuzzy matching and enforce exact line matches only")
|
|
9577
9641
|
parser.add_argument("--dry-run-patch", action="store_true", help="Validate patch applicability without modifying files on disk")
|
|
@@ -9592,7 +9656,7 @@ def main():
|
|
|
9592
9656
|
default="o200k_base", help="BPE encoding for --symbol-context")
|
|
9593
9657
|
parser.add_argument("--cache-aligned", action="store_true", help="Order context for KV-cache prefix stability (immutable static prefix before dynamic query suffix)")
|
|
9594
9658
|
parser.add_argument("--commit-msg", action="store_true", help="Generate Conventional Commit message from local AST git diff ($0 local engine)")
|
|
9595
|
-
parser.add_argument("--changelog", nargs="?", const="v12.3.
|
|
9659
|
+
parser.add_argument("--changelog", nargs="?", const="v12.3.5", default=None, metavar="VERSION", help="Generate release CHANGELOG markdown from git history")
|
|
9596
9660
|
parser.add_argument("--ci", choices=["github", "gitlab", "pre-commit", "local", "all"], default=None, help="Install CI/CD workflow or run local verification suite")
|
|
9597
9661
|
parser.add_argument("--local-ci", action="store_true", help="Run comprehensive Local CI & Pre-Push verification battery ($0 quota burn)")
|
|
9598
9662
|
parser.add_argument("--quick-ci", action="store_true", help="Run fast Local CI smoke checks in seconds")
|
|
@@ -9656,7 +9720,7 @@ def main():
|
|
|
9656
9720
|
parser.add_argument("--card", "--badge", nargs="?", const="assets/tzero_badge_card.svg", default=None, metavar="FILE", help="Generate viral dark-mode SVG banner card and GitHub README badges")
|
|
9657
9721
|
parser.add_argument("--showcase", nargs="?", const="tzero_showcase.html", default=None, metavar="FILE", help="Generate interactive split-screen HTML5 comparison showcase slider")
|
|
9658
9722
|
parser.add_argument("--marketing", "--growth", action="store_true", help="Launch $0-budget viral growth engine and export campaign materials for Reddit, HN, X, and Product Hunt")
|
|
9659
|
-
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v12.3.
|
|
9723
|
+
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v12.3.5 Master Edition (engine v4.1.0)")
|
|
9660
9724
|
|
|
9661
9725
|
|
|
9662
9726
|
def print_master_tutorial():
|
|
@@ -9765,7 +9829,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9765
9829
|
def print_quickstart_guide():
|
|
9766
9830
|
print("""
|
|
9767
9831
|
================================================================================
|
|
9768
|
-
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.3.
|
|
9832
|
+
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.3.5 MASTER (engine v4.1.0)
|
|
9769
9833
|
================================================================================
|
|
9770
9834
|
🎯 %95'e Varan Token Tasarrufu & Otonom Yapay Zeka Mimari Bağlam Motoru
|
|
9771
9835
|
|
|
@@ -9943,7 +10007,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9943
10007
|
if os.name == "nt":
|
|
9944
10008
|
try:
|
|
9945
10009
|
import ctypes
|
|
9946
|
-
ctypes.windll.user32.MessageBoxW(0, f"T-Zero GUI
|
|
10010
|
+
ctypes.windll.user32.MessageBoxW(0, f"T-Zero GUI Launch Error:\n\n{e}", "T-Zero Critical Error", 0x10)
|
|
9947
10011
|
except Exception:
|
|
9948
10012
|
pass
|
|
9949
10013
|
print(f"[FATAL ERROR] Could not launch GUI: {e}")
|
|
@@ -9975,29 +10039,6 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9975
10039
|
from tzero.tzero_traffic import run_system_disk_doctor
|
|
9976
10040
|
run_system_disk_doctor(clean=True, workspace_dir=args.dir)
|
|
9977
10041
|
return
|
|
9978
|
-
elif getattr(args, "armor", None):
|
|
9979
|
-
if getattr(args, "audit", None) is not None:
|
|
9980
|
-
from tzero.tzero_armor import audit_path_rea_resistance
|
|
9981
|
-
audit = audit_path_rea_resistance(args.armor)
|
|
9982
|
-
print(json.dumps(audit, indent=2))
|
|
9983
|
-
return
|
|
9984
|
-
from tzero.tzero_armor import protect_path_with_armor
|
|
9985
|
-
res = protect_path_with_armor(args.armor, output_path=getattr(args, "output", None))
|
|
9986
|
-
if res.get("success"):
|
|
9987
|
-
print(f"[OK] Applied Anti-REA Armor to: {args.armor}")
|
|
9988
|
-
if "score_after" in res:
|
|
9989
|
-
print(f" AI Resistance Score: {res.get('score_before')}/100 -> {res.get('score_after')}/100 [{res.get('rating')}]")
|
|
9990
|
-
elif "files_protected" in res:
|
|
9991
|
-
print(f" Protected {res['files_protected']} files in directory.")
|
|
9992
|
-
else:
|
|
9993
|
-
print(f"[FAIL] Armor protection failed: {res.get('error', 'Unknown error')}", file=sys.stderr)
|
|
9994
|
-
sys.exit(1)
|
|
9995
|
-
return
|
|
9996
|
-
elif getattr(args, "audit_rea", None):
|
|
9997
|
-
from tzero.tzero_armor import audit_path_rea_resistance
|
|
9998
|
-
audit = audit_path_rea_resistance(args.audit_rea)
|
|
9999
|
-
print(json.dumps(audit, indent=2))
|
|
10000
|
-
sys.exit(1 if audit.get("error") else 0)
|
|
10001
10042
|
elif getattr(args, "telemetry", None) is not None:
|
|
10002
10043
|
from tzero.tzero_telemetry import get_summary, render_report
|
|
10003
10044
|
ws_dir = args.telemetry if args.telemetry != "." else (getattr(args, "dir", ".") or ".")
|
|
@@ -10094,9 +10135,9 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10094
10135
|
elif args.sync is not None:
|
|
10095
10136
|
from tzero.tzero_sync import WorkspaceSyncManager
|
|
10096
10137
|
target = args.sync or args.dir
|
|
10097
|
-
res = WorkspaceSyncManager.sync(target)
|
|
10138
|
+
res = WorkspaceSyncManager.sync(target, apply=args.apply_sync)
|
|
10098
10139
|
WorkspaceSyncManager.render_cli(res)
|
|
10099
|
-
sys.exit(0)
|
|
10140
|
+
sys.exit(0 if res.success else 1)
|
|
10100
10141
|
elif args.cost is not None:
|
|
10101
10142
|
from tzero.tzero_cost import TokenCostCalculator
|
|
10102
10143
|
target = args.cost or args.dir
|
|
@@ -10744,7 +10785,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10744
10785
|
if not os.path.exists(app_path):
|
|
10745
10786
|
app_path = os.path.join(os.getcwd(), "huggingface-space", "app.py")
|
|
10746
10787
|
print("\033[36m" + "=" * 80)
|
|
10747
|
-
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.3.
|
|
10788
|
+
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.3.5)")
|
|
10748
10789
|
print("=" * 80 + "\033[0m")
|
|
10749
10790
|
print("🌐 Official Live Space : https://huggingface.co/spaces/toprakke4/tzero-token-reducer")
|
|
10750
10791
|
print(f"📁 Local Application : {app_path}")
|