tzero-mcp 12.2.2 → 12.3.3
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/README.md +6 -30
- package/bin/tzero-mcp.js +2 -2
- package/bin/tzero.js +11 -6
- package/package.json +1 -2
- package/src/addmcp.py +2 -2
- package/src/app.py +1 -1
- package/src/tzero/__init__.py +1 -1
- package/src/tzero/anti_rea/__init__.py +16 -2
- package/src/tzero/anti_rea/algebraic_mutator.py +65 -44
- package/src/tzero/anti_rea/anti_debugger.py +51 -18
- package/src/tzero/anti_rea/asar_shield.py +21 -0
- package/src/tzero/anti_rea/auditor.py +20 -0
- package/src/tzero/anti_rea/canary_beacon.py +33 -61
- package/src/tzero/anti_rea/cli.py +30 -4
- package/src/tzero/anti_rea/crypto_loader.py +132 -0
- package/src/tzero/anti_rea/engine.py +51 -20
- package/src/tzero/anti_rea/extractor_shield.py +60 -25
- package/src/tzero/anti_rea/tier_catalog.py +388 -0
- package/src/tzero/tzero_armor.py +3 -3
- package/src/tzero/tzero_benchmark.py +1 -1
- package/src/tzero/tzero_budget.py +1 -1
- package/src/tzero/tzero_ci.py +2 -2
- 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 +109 -87
- package/src/tzero/tzero_explain.py +1 -1
- 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/swarm.py +23 -2
- package/src/tzero/tzero_jarvis/workspace_orchestrator.py +1 -1
- package/src/tzero/tzero_jarvis/zero_key_router.py +10 -78
- package/src/tzero/tzero_lsp.py +1 -1
- package/src/tzero/tzero_mcp.py +28 -10
- package/src/tzero/tzero_mutation.py +6 -2
- package/src/tzero/tzero_promo.py +1 -1
- package/src/tzero/tzero_security.py +40 -11
- package/src/tzero/tzero_task_benchmark.py +2 -2
- package/src/tzero/tzero_traffic.py +1 -1
- package/src/tzero/tzero_tui.py +5 -5
- package/src/tzero/tzero_v3.py +418 -275
- package/src/tzero/tzero_welcome.py +1 -1
- package/bin/postinstall.js +0 -30
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.
|
|
496
|
+
"title": "T-Zero Developer Console & Context Architect v12.3.2",
|
|
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.2",
|
|
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
|
|
|
@@ -1094,23 +1094,7 @@ class LocalOllamaProvider(BaseProvider):
|
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
1096
|
|
|
1097
|
-
class FreePollinationsProvider(BaseProvider):
|
|
1098
|
-
def __init__(self):
|
|
1099
|
-
super().__init__(
|
|
1100
|
-
"Free AI Cloud (No Key Required)",
|
|
1101
|
-
"https://text.pollinations.ai/openai",
|
|
1102
|
-
["openai", "mistral", "qwen-coder", "deepseek"]
|
|
1103
|
-
)
|
|
1104
|
-
|
|
1105
|
-
def get_headers(self, api_key: str = "") -> Dict[str, str]:
|
|
1106
|
-
return {
|
|
1107
|
-
"Content-Type": "application/json",
|
|
1108
|
-
"User-Agent": f"TZeroAlgorithmV4/4.1 (Toprak Ahmet Aydogmus; {DEV_URL_GITHUB})"
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
1097
|
PROVIDERS: Dict[str, BaseProvider] = {
|
|
1113
|
-
"Free AI Cloud (No Key Required)": FreePollinationsProvider(),
|
|
1114
1098
|
"NVIDIA NIM": NvidiaProvider(),
|
|
1115
1099
|
"OpenAI": OpenAIProvider(),
|
|
1116
1100
|
"Google Gemini": GeminiProvider(),
|
|
@@ -2459,7 +2443,8 @@ class ContextExportManager:
|
|
|
2459
2443
|
"""Generates ARCHITECTURE.md with Mermaid diagrams and module specs.
|
|
2460
2444
|
|
|
2461
2445
|
Supports live 3rd-party AI synthesis (NVIDIA NIM, OpenAI, Gemini, Anthropic, OpenRouter,
|
|
2462
|
-
Local Ollama
|
|
2446
|
+
or Local Ollama) and falls back locally to the AST architecture engine on missing
|
|
2447
|
+
credentials or provider errors without silent cloud retries.
|
|
2463
2448
|
"""
|
|
2464
2449
|
if use_ai:
|
|
2465
2450
|
try:
|
|
@@ -2478,11 +2463,22 @@ class ContextExportManager:
|
|
|
2478
2463
|
if not active_model and active_prov:
|
|
2479
2464
|
active_model = prof.get("model") or active_prov.get_models()[0]
|
|
2480
2465
|
|
|
2481
|
-
if not
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2466
|
+
if not active_prov:
|
|
2467
|
+
if progress_cb:
|
|
2468
|
+
progress_cb(50, "No remote provider configured. Using Local AST Architecture Engine...")
|
|
2469
|
+
return ContextExportManager.generate_offline_architecture_blueprint(
|
|
2470
|
+
project_name, files, deps, snippets
|
|
2471
|
+
)
|
|
2472
|
+
|
|
2473
|
+
if not active_key and active_prov.name != "Local Ollama":
|
|
2474
|
+
if progress_cb:
|
|
2475
|
+
progress_cb(
|
|
2476
|
+
50,
|
|
2477
|
+
f"No API credential configured for {active_prov.name}. Using Local AST Architecture Engine...",
|
|
2478
|
+
)
|
|
2479
|
+
return ContextExportManager.generate_offline_architecture_blueprint(
|
|
2480
|
+
project_name, files, deps, snippets
|
|
2481
|
+
)
|
|
2486
2482
|
|
|
2487
2483
|
if progress_cb:
|
|
2488
2484
|
progress_cb(30, f"Synthesizing architecture with {active_prov.name} ({active_model})...")
|
|
@@ -3278,13 +3274,13 @@ class CanvasPillButton(tk.Canvas):
|
|
|
3278
3274
|
|
|
3279
3275
|
class KPICard(LuxuryCard):
|
|
3280
3276
|
"""Executive KPI card showing primary upward metric and secondary compression delta."""
|
|
3281
|
-
def __init__(self, parent, title="AST & Token
|
|
3277
|
+
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):
|
|
3282
3278
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3283
3279
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3284
3280
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
3285
3281
|
self.lbl_title = tk.Label(top, text=title, font=("Segoe UI", 9, "bold"), fg=PALETTE.get("text_muted", "#64748b"), bg=self.card_bg)
|
|
3286
3282
|
self.lbl_title.pack(side=tk.LEFT)
|
|
3287
|
-
self.pill_period = tk.Label(top, text="
|
|
3283
|
+
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)
|
|
3288
3284
|
self.pill_period.pack(side=tk.RIGHT)
|
|
3289
3285
|
|
|
3290
3286
|
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)
|
|
@@ -3336,7 +3332,7 @@ class ScrollableGlassPanel(tk.Frame):
|
|
|
3336
3332
|
|
|
3337
3333
|
class MiniCalendarCard(LuxuryCard):
|
|
3338
3334
|
"""Mini executive activity calendar card with active audit date rings."""
|
|
3339
|
-
def __init__(self, parent, month_title="
|
|
3335
|
+
def __init__(self, parent, month_title="Nov 2026", active_days=(14, 25, 28), **kwargs):
|
|
3340
3336
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3341
3337
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3342
3338
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
@@ -3347,7 +3343,7 @@ class MiniCalendarCard(LuxuryCard):
|
|
|
3347
3343
|
|
|
3348
3344
|
grid = tk.Frame(self.inner, bg=self.card_bg)
|
|
3349
3345
|
grid.pack(fill=tk.BOTH, expand=True)
|
|
3350
|
-
headers = ["
|
|
3346
|
+
headers = ["mo", "tu", "we", "th", "fr", "sa", "su"]
|
|
3351
3347
|
for col, h in enumerate(headers):
|
|
3352
3348
|
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)
|
|
3353
3349
|
active_set = set(active_days)
|
|
@@ -3365,7 +3361,7 @@ class MiniCalendarCard(LuxuryCard):
|
|
|
3365
3361
|
|
|
3366
3362
|
class CircularGaugeCard(LuxuryCard):
|
|
3367
3363
|
"""Circular donut gauge card with percentage arc and quick action pill button."""
|
|
3368
|
-
def __init__(self, parent, title="Optimization Score", subtitle="T-Zero context efficiency", percentage=75, action_text="⚡
|
|
3364
|
+
def __init__(self, parent, title="Optimization Score", subtitle="T-Zero context efficiency", percentage=75, action_text="⚡ QUICK OPTIMIZE", action_cmd=None, **kwargs):
|
|
3369
3365
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3370
3366
|
self.percentage = percentage
|
|
3371
3367
|
self.action_cmd = action_cmd
|
|
@@ -3401,7 +3397,7 @@ class CircularGaugeCard(LuxuryCard):
|
|
|
3401
3397
|
|
|
3402
3398
|
class WaveSplineChart(LuxuryCard):
|
|
3403
3399
|
"""Smooth dual-wave spline chart with pastel area gradient fills."""
|
|
3404
|
-
def __init__(self, parent, title="AST Token
|
|
3400
|
+
def __init__(self, parent, title="AST Token Frequency", **kwargs):
|
|
3405
3401
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3406
3402
|
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))
|
|
3407
3403
|
self.chart_canvas = tk.Canvas(self.inner, height=115, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3452,12 +3448,12 @@ class WaveSplineChart(LuxuryCard):
|
|
|
3452
3448
|
|
|
3453
3449
|
class WideSplineChartCard(LuxuryCard):
|
|
3454
3450
|
"""Wide executive Bézier spline chart showing AST vs Compressed token consumption trend."""
|
|
3455
|
-
def __init__(self, parent, title="Model Token
|
|
3451
|
+
def __init__(self, parent, title="Model Token Consumption Trend", **kwargs):
|
|
3456
3452
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3457
3453
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3458
3454
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
3459
3455
|
tk.Label(top, text=title, font=("Segoe UI", 10, "bold"), fg=PALETTE.get("text_main", "#1e293b"), bg=self.card_bg).pack(side=tk.LEFT)
|
|
3460
|
-
pill = tk.Label(top, text="
|
|
3456
|
+
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)
|
|
3461
3457
|
pill.pack(side=tk.RIGHT)
|
|
3462
3458
|
|
|
3463
3459
|
self.c = tk.Canvas(self.inner, height=140, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3483,8 +3479,8 @@ class WideSplineChartCard(LuxuryCard):
|
|
|
3483
3479
|
|
|
3484
3480
|
leg = tk.Frame(self.inner, bg=self.card_bg)
|
|
3485
3481
|
leg.pack(pady=(4, 0))
|
|
3486
|
-
tk.Label(leg, text="●
|
|
3487
|
-
tk.Label(leg, text="● T-Zero
|
|
3482
|
+
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)
|
|
3483
|
+
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)
|
|
3488
3484
|
|
|
3489
3485
|
def _draw(self, event=None):
|
|
3490
3486
|
w = max(20, self.c.winfo_width())
|
|
@@ -3517,7 +3513,7 @@ class WideSplineChartCard(LuxuryCard):
|
|
|
3517
3513
|
|
|
3518
3514
|
class MonthlyStackedBarCard(LuxuryCard):
|
|
3519
3515
|
"""Horizontal stacked bar chart for monthly token reduction stats."""
|
|
3520
|
-
def __init__(self, parent, title="
|
|
3516
|
+
def __init__(self, parent, title="Monthly Token Savings", **kwargs):
|
|
3521
3517
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3522
3518
|
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))
|
|
3523
3519
|
self.c = tk.Canvas(self.inner, height=110, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3544,7 +3540,7 @@ class MonthlyStackedBarCard(LuxuryCard):
|
|
|
3544
3540
|
def _draw(self, event=None):
|
|
3545
3541
|
w = max(20, self.c.winfo_width())
|
|
3546
3542
|
self.c.delete("all")
|
|
3547
|
-
months = ["
|
|
3543
|
+
months = ["OCT", "NOV", "DEC", "JAN"]
|
|
3548
3544
|
ratios = [0.75, 0.55, 0.85, 0.65]
|
|
3549
3545
|
bar_h = 10
|
|
3550
3546
|
spacing = 24
|
|
@@ -3560,7 +3556,7 @@ class MonthlyStackedBarCard(LuxuryCard):
|
|
|
3560
3556
|
|
|
3561
3557
|
class GroupedVerticalBarCard(LuxuryCard):
|
|
3562
3558
|
"""Grouped dual-color vertical bar chart for daily token and audit activity."""
|
|
3563
|
-
def __init__(self, parent, title="
|
|
3559
|
+
def __init__(self, parent, title="Daily Activity & Audits", **kwargs):
|
|
3564
3560
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3565
3561
|
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))
|
|
3566
3562
|
self.c = tk.Canvas(self.inner, height=110, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3588,7 +3584,7 @@ class GroupedVerticalBarCard(LuxuryCard):
|
|
|
3588
3584
|
w = max(20, self.c.winfo_width())
|
|
3589
3585
|
h = max(20, self.c.winfo_height())
|
|
3590
3586
|
self.c.delete("all")
|
|
3591
|
-
days = ["
|
|
3587
|
+
days = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
|
|
3592
3588
|
slot_w = w / len(days)
|
|
3593
3589
|
base_y = h - 16
|
|
3594
3590
|
heights = [(40, 20), (55, 32), (30, 48), (65, 42), (75, 55), (45, 25), (35, 18)]
|
|
@@ -3610,11 +3606,11 @@ class SecurityHubCard(LuxuryCard):
|
|
|
3610
3606
|
"""Siber Akademi security badge & quick audit / Anti-REA launcher card."""
|
|
3611
3607
|
def __init__(self, parent, action_cmd=None, armor_cmd=None, **kwargs):
|
|
3612
3608
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3613
|
-
tk.Label(self.inner, text="🛡 SİBER AKADEMİ
|
|
3614
|
-
tk.Label(self.inner, text="100% Zero-Leak +
|
|
3609
|
+
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)
|
|
3610
|
+
tk.Label(self.inner, text="100% Zero-Leak + 180-Tier Anti-REA Armor", font=("Segoe UI", 7), fg=PALETTE.get("accent_green", "#10b981"), bg=self.card_bg).pack(anchor=tk.W, pady=(1, 6))
|
|
3615
3611
|
btn_row = tk.Frame(self.inner, bg=self.card_bg)
|
|
3616
3612
|
btn_row.pack(fill=tk.X)
|
|
3617
|
-
self.btn = CanvasPillButton(btn_row, text="
|
|
3613
|
+
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"))
|
|
3618
3614
|
self.btn.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 3))
|
|
3619
3615
|
if armor_cmd is not None:
|
|
3620
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")
|
|
@@ -4159,19 +4155,19 @@ class NodeGraphCanvas(tk.Canvas):
|
|
|
4159
4155
|
hud_box_w = 460
|
|
4160
4156
|
self.create_rectangle(14, 12, 14 + hud_box_w, 56, fill=card_bg, outline="#1e293b", width=1)
|
|
4161
4157
|
scale_pct = int(self.scale_factor * 100)
|
|
4162
|
-
hud_title = f"⚡ T-ZERO AST TOPOLOGY GRAPH • {len(self.nodes)}
|
|
4158
|
+
hud_title = f"⚡ T-ZERO AST TOPOLOGY GRAPH • {len(self.nodes)} Nodes • {len(self.links)} Links • {scale_pct}% Scale"
|
|
4163
4159
|
self.create_text(26, 24, text=hud_title, anchor="w", fill=accent_cyan, font=("Segoe UI", 9, "bold"))
|
|
4164
|
-
self.create_text(26, 42, text="🖱️
|
|
4160
|
+
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))
|
|
4165
4161
|
|
|
4166
4162
|
# 6. Top-Right Floating Control Toolbar (Zoom +, Zoom -, Reset, Fit, Maximize)
|
|
4167
4163
|
self.hud_buttons = []
|
|
4168
4164
|
is_max = getattr(self, "is_fullscreen", False)
|
|
4169
4165
|
btn_defs = [
|
|
4170
|
-
("plus", "+", "
|
|
4171
|
-
("minus", "-", "
|
|
4172
|
-
("reset", "100%", "
|
|
4173
|
-
("fit", "⛶", "
|
|
4174
|
-
("max", "⤢" if not is_max else "⤡", "
|
|
4166
|
+
("plus", "+", "Zoom In", self.btn_zoom_in),
|
|
4167
|
+
("minus", "-", "Zoom Out", self.btn_zoom_out),
|
|
4168
|
+
("reset", "100%", "Reset Scale", self.btn_reset),
|
|
4169
|
+
("fit", "⛶", "Fit to Screen", self.btn_fit),
|
|
4170
|
+
("max", "⤢" if not is_max else "⤡", "Expand / Fullscreen", self.btn_toggle_fullscreen),
|
|
4175
4171
|
]
|
|
4176
4172
|
btn_w, btn_h, gap = 38, 30, 6
|
|
4177
4173
|
total_bar_w = len(btn_defs) * (btn_w + gap) - gap + 16
|
|
@@ -4197,9 +4193,9 @@ class NodeGraphCanvas(tk.Canvas):
|
|
|
4197
4193
|
node_deg = sum(1 for (s, e) in self.links if s == active_id or e == active_id)
|
|
4198
4194
|
info_h = 32
|
|
4199
4195
|
info_y = h - info_h - 14
|
|
4200
|
-
info_text = f"
|
|
4196
|
+
info_text = f"NODE: {active_node['label']} | TYPE: {active_node['type'].upper()} | LINKS: {node_deg}"
|
|
4201
4197
|
if "full_path" in active_node:
|
|
4202
|
-
info_text += f" |
|
|
4198
|
+
info_text += f" | PATH: {active_node['full_path']}"
|
|
4203
4199
|
info_w = min(w - 28, max(280, len(info_text) * 6.5 + 26))
|
|
4204
4200
|
self.create_rectangle(14, info_y, 14 + info_w, info_y + info_h, fill=card_bg, outline=accent_cyan, width=1)
|
|
4205
4201
|
self.create_text(24, info_y + info_h / 2, text=info_text, anchor="w", fill=text_main, font=("Segoe UI", 8, "bold"))
|
|
@@ -4439,7 +4435,7 @@ class AdvancedTokenDistributionChart(tk.Canvas):
|
|
|
4439
4435
|
self.delete("all")
|
|
4440
4436
|
w, h = max(280, self.winfo_width()), max(120, self.winfo_height())
|
|
4441
4437
|
if not self.stats:
|
|
4442
|
-
self.create_text(w / 2, h / 2, text="
|
|
4438
|
+
self.create_text(w / 2, h / 2, text="No scanned metrics available yet.", fill=PALETTE["text_muted"], font=("Segoe UI", 8))
|
|
4443
4439
|
return
|
|
4444
4440
|
|
|
4445
4441
|
colors = [PALETTE["accent_cyan"], PALETTE["accent_purple"], PALETTE["accent_green"], PALETTE.get("accent_coral", "#f59e0b"), "#10b981", "#3b82f6"]
|
|
@@ -4603,10 +4599,48 @@ class PygmentsHighlighter:
|
|
|
4603
4599
|
|
|
4604
4600
|
# --- 13. DYNAMIC UI DASHBOARD MAIN WINDOW ---
|
|
4605
4601
|
|
|
4602
|
+
SPONSOR_WEEKLY_INTERVAL_SECONDS = 7 * 24 * 60 * 60
|
|
4603
|
+
|
|
4604
|
+
|
|
4605
|
+
def decide_startup_popup(profile: Dict[str, Any], now_ts: Optional[float] = None) -> str:
|
|
4606
|
+
"""Determine which startup modal ('star', 'sponsor', or 'none') to display.
|
|
4607
|
+
|
|
4608
|
+
Rules:
|
|
4609
|
+
- Star prompt: only on the 1st launch and every 10th launch thereafter (1, 10, 20, ...),
|
|
4610
|
+
unless dismissed by the user.
|
|
4611
|
+
- Sponsor prompt: on every 5th launch (5, 15, 25, ...) OR once every 7 days of usage,
|
|
4612
|
+
unless dismissed by the user. Star takes priority on 1st and 10th launches so two
|
|
4613
|
+
modals never stack on the same startup.
|
|
4614
|
+
"""
|
|
4615
|
+
current_ts = float(time.time() if now_ts is None else now_ts)
|
|
4616
|
+
launch_count = int(profile.get("gui_launch_count", 0) or 0) + 1
|
|
4617
|
+
profile["gui_launch_count"] = launch_count
|
|
4618
|
+
|
|
4619
|
+
last_sponsor_ts = float(profile.get("last_sponsor_popup_ts", 0.0) or 0.0)
|
|
4620
|
+
if launch_count == 1 and last_sponsor_ts <= 0.0:
|
|
4621
|
+
profile["last_sponsor_popup_ts"] = current_ts
|
|
4622
|
+
last_sponsor_ts = current_ts
|
|
4623
|
+
|
|
4624
|
+
star_dismissed = bool(profile.get("star_popup_dismissed_v12", False))
|
|
4625
|
+
sponsor_dismissed = bool(profile.get("sponsor_popup_dismissed_v12", False))
|
|
4626
|
+
|
|
4627
|
+
is_star_turn = (launch_count == 1) or (launch_count > 1 and launch_count % 10 == 0)
|
|
4628
|
+
if is_star_turn and not star_dismissed:
|
|
4629
|
+
return "star"
|
|
4630
|
+
|
|
4631
|
+
weekly_due = last_sponsor_ts > 0.0 and (current_ts - last_sponsor_ts) >= SPONSOR_WEEKLY_INTERVAL_SECONDS
|
|
4632
|
+
is_sponsor_turn = (launch_count > 1 and launch_count % 5 == 0) or weekly_due
|
|
4633
|
+
if is_sponsor_turn and not sponsor_dismissed:
|
|
4634
|
+
profile["last_sponsor_popup_ts"] = current_ts
|
|
4635
|
+
return "sponsor"
|
|
4636
|
+
|
|
4637
|
+
return "none"
|
|
4638
|
+
|
|
4639
|
+
|
|
4606
4640
|
class AutoReadmeGUI:
|
|
4607
4641
|
def __init__(self, root: tk.Tk):
|
|
4608
4642
|
self.root = root
|
|
4609
|
-
self.lang =
|
|
4643
|
+
self.lang = "en"
|
|
4610
4644
|
|
|
4611
4645
|
# State parameters
|
|
4612
4646
|
self.scanned_files: List[str] = []
|
|
@@ -4681,7 +4715,56 @@ class AutoReadmeGUI:
|
|
|
4681
4715
|
self.setup_keyboard_shortcuts()
|
|
4682
4716
|
self.start_system_telemetry()
|
|
4683
4717
|
self.start_community_stats_refresh()
|
|
4684
|
-
|
|
4718
|
+
if "unittest" not in sys.modules:
|
|
4719
|
+
self.safe_after(1200, self.check_and_show_startup_popups)
|
|
4720
|
+
|
|
4721
|
+
def _attach_tooltip(self, widget, text: str):
|
|
4722
|
+
"""Attach a sleek floating English tooltip on mouse hover."""
|
|
4723
|
+
if not TK_AVAILABLE or widget is None:
|
|
4724
|
+
return
|
|
4725
|
+
tip_win = {"w": None}
|
|
4726
|
+
|
|
4727
|
+
def show_tip(_event=None):
|
|
4728
|
+
try:
|
|
4729
|
+
if tip_win["w"] or not widget.winfo_exists():
|
|
4730
|
+
return
|
|
4731
|
+
tw = tk.Toplevel(widget)
|
|
4732
|
+
tw.overrideredirect(True)
|
|
4733
|
+
tw.attributes("-topmost", True)
|
|
4734
|
+
x = widget.winfo_rootx() + widget.winfo_width() + 8
|
|
4735
|
+
y = widget.winfo_rooty() + max(0, (widget.winfo_height() - 24) // 2)
|
|
4736
|
+
tw.geometry(f"+{x}+{y}")
|
|
4737
|
+
lbl = tk.Label(
|
|
4738
|
+
tw,
|
|
4739
|
+
text=text,
|
|
4740
|
+
bg=PALETTE.get("card_bg", "#0f172a"),
|
|
4741
|
+
fg=PALETTE.get("text_main", "#f8fafc"),
|
|
4742
|
+
font=("Segoe UI", 8, "bold"),
|
|
4743
|
+
padx=9,
|
|
4744
|
+
pady=4,
|
|
4745
|
+
highlightthickness=1,
|
|
4746
|
+
highlightbackground=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
4747
|
+
)
|
|
4748
|
+
lbl.pack()
|
|
4749
|
+
tip_win["w"] = tw
|
|
4750
|
+
except Exception:
|
|
4751
|
+
pass
|
|
4752
|
+
|
|
4753
|
+
def hide_tip(_event=None):
|
|
4754
|
+
tw = tip_win.get("w")
|
|
4755
|
+
tip_win["w"] = None
|
|
4756
|
+
if tw is not None:
|
|
4757
|
+
try:
|
|
4758
|
+
tw.destroy()
|
|
4759
|
+
except Exception:
|
|
4760
|
+
pass
|
|
4761
|
+
|
|
4762
|
+
try:
|
|
4763
|
+
widget.bind("<Enter>", show_tip, add="+")
|
|
4764
|
+
widget.bind("<Leave>", hide_tip, add="+")
|
|
4765
|
+
widget.bind("<ButtonPress>", hide_tip, add="+")
|
|
4766
|
+
except Exception:
|
|
4767
|
+
pass
|
|
4685
4768
|
|
|
4686
4769
|
def safe_after(self, ms: int, func, *args):
|
|
4687
4770
|
"""Thread-safe and lifecycle-safe wrapper around root.after."""
|
|
@@ -4752,6 +4835,7 @@ class AutoReadmeGUI:
|
|
|
4752
4835
|
b.configure(bg=sidebar_bg)
|
|
4753
4836
|
btn.bind("<Enter>", on_enter)
|
|
4754
4837
|
btn.bind("<Leave>", on_leave)
|
|
4838
|
+
self._attach_tooltip(btn, get_text(key, self.lang))
|
|
4755
4839
|
|
|
4756
4840
|
self.tab_buttons.append(btn)
|
|
4757
4841
|
self.tab_containers.append(cont)
|
|
@@ -4761,16 +4845,17 @@ class AutoReadmeGUI:
|
|
|
4761
4845
|
spacer.pack(fill=tk.BOTH, expand=True)
|
|
4762
4846
|
|
|
4763
4847
|
# Bottom Utilities
|
|
4764
|
-
for icon_char, cmd_handler in [
|
|
4765
|
-
("💖", self.show_crypto_support_modal),
|
|
4766
|
-
("🎨", self.open_theme_selector),
|
|
4767
|
-
("🌐", self.toggle_language),
|
|
4768
|
-
("⌨", self.show_shortcuts_modal),
|
|
4769
|
-
("📋", self.toggle_console_drawer)
|
|
4848
|
+
for icon_char, tip_text, cmd_handler in [
|
|
4849
|
+
("💖", "Sponsor & Support T-Zero", self.show_crypto_support_modal),
|
|
4850
|
+
("🎨", "Theme Manager", self.open_theme_selector),
|
|
4851
|
+
("🌐", "Language: English (EN)", self.toggle_language),
|
|
4852
|
+
("⌨", "Keyboard Shortcuts", self.show_shortcuts_modal),
|
|
4853
|
+
("📋", "System Diagnostics Log", self.toggle_console_drawer),
|
|
4770
4854
|
]:
|
|
4771
4855
|
lbl = tk.Label(self.sidebar, text=icon_char, font=("Segoe UI Emoji", 12), fg=sidebar_muted, bg=sidebar_bg, cursor="hand2")
|
|
4772
4856
|
lbl.pack(pady=3)
|
|
4773
4857
|
lbl.bind("<Button-1>", lambda e, h=cmd_handler: h())
|
|
4858
|
+
self._attach_tooltip(lbl, tip_text)
|
|
4774
4859
|
|
|
4775
4860
|
tk.Label(self.sidebar, text="●", font=("Segoe UI", 8, "bold"), fg=PALETTE["success"], bg=sidebar_bg).pack(pady=(4, 10))
|
|
4776
4861
|
|
|
@@ -4852,17 +4937,31 @@ class AutoReadmeGUI:
|
|
|
4852
4937
|
|
|
4853
4938
|
self.web_console_btn = CanvasPillButton(
|
|
4854
4939
|
header_controls,
|
|
4855
|
-
text="🌐 WEB
|
|
4940
|
+
text="🌐 WEB CONSOLE",
|
|
4856
4941
|
command=self.open_web_console,
|
|
4857
4942
|
height=28,
|
|
4858
4943
|
radius=14,
|
|
4859
4944
|
bg_color=PALETTE["card_border"],
|
|
4860
4945
|
text_color=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
4861
4946
|
font=("Segoe UI", 7, "bold"),
|
|
4862
|
-
width=
|
|
4947
|
+
width=112
|
|
4863
4948
|
)
|
|
4864
4949
|
self.web_console_btn.pack(side=tk.LEFT, padx=3)
|
|
4865
4950
|
|
|
4951
|
+
self.sponsor_header_btn = CanvasPillButton(
|
|
4952
|
+
header_controls,
|
|
4953
|
+
text="💖 SPONSOR",
|
|
4954
|
+
command=lambda: self.show_crypto_support_modal(periodic=False),
|
|
4955
|
+
height=28,
|
|
4956
|
+
radius=14,
|
|
4957
|
+
bg_color="#3f1d2e" if PALETTE.get("bg_start") != "#edf2fb" else "#ffe4e6",
|
|
4958
|
+
hover_color="#fb7185",
|
|
4959
|
+
text_color="#fb7185" if PALETTE.get("bg_start") != "#edf2fb" else "#be123c",
|
|
4960
|
+
font=("Segoe UI", 7, "bold"),
|
|
4961
|
+
width=96
|
|
4962
|
+
)
|
|
4963
|
+
self.sponsor_header_btn.pack(side=tk.LEFT, padx=3)
|
|
4964
|
+
|
|
4866
4965
|
self.star_header_btn = CanvasPillButton(
|
|
4867
4966
|
header_controls,
|
|
4868
4967
|
text=f"★ STAR ({self.community_stats['stars']}★)",
|
|
@@ -4896,11 +4995,11 @@ class AutoReadmeGUI:
|
|
|
4896
4995
|
s_pill_bot = tk.Frame(self.status_bar, bg=PALETTE["card_bg"], highlightthickness=1, highlightbackground=PALETTE["card_border"])
|
|
4897
4996
|
s_pill_bot.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
4898
4997
|
|
|
4899
|
-
tk.Label(s_pill_bot, text="📋
|
|
4998
|
+
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)
|
|
4900
4999
|
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"])
|
|
4901
5000
|
self.status_bar_lbl.pack(side=tk.LEFT, pady=2)
|
|
4902
5001
|
|
|
4903
|
-
self.status_toggle_lbl = tk.Label(s_pill_bot, text="▲
|
|
5002
|
+
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")
|
|
4904
5003
|
self.status_toggle_lbl.pack(side=tk.RIGHT, padx=8, pady=2)
|
|
4905
5004
|
self.status_toggle_lbl.bind("<Button-1>", lambda e: self.toggle_console_drawer())
|
|
4906
5005
|
|
|
@@ -4911,7 +5010,7 @@ class AutoReadmeGUI:
|
|
|
4911
5010
|
c_top = tk.Frame(self.console_drawer, bg=PALETTE["card_bg"])
|
|
4912
5011
|
c_top.pack(fill=tk.X, padx=10, pady=4)
|
|
4913
5012
|
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)
|
|
4914
|
-
close_lbl = tk.Label(c_top, text="✕
|
|
5013
|
+
close_lbl = tk.Label(c_top, text="✕ Close", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_purple"], bg=PALETTE["card_bg"], cursor="hand2")
|
|
4915
5014
|
close_lbl.pack(side=tk.RIGHT)
|
|
4916
5015
|
close_lbl.bind("<Button-1>", lambda e: self.toggle_console_drawer())
|
|
4917
5016
|
|
|
@@ -4935,13 +5034,13 @@ class AutoReadmeGUI:
|
|
|
4935
5034
|
self.console_drawer.place_forget()
|
|
4936
5035
|
self.console_drawer_visible = False
|
|
4937
5036
|
if hasattr(self, "status_toggle_lbl"):
|
|
4938
|
-
self.status_toggle_lbl.config(text="▲
|
|
5037
|
+
self.status_toggle_lbl.config(text="▲ Show Console")
|
|
4939
5038
|
else:
|
|
4940
5039
|
self.console_drawer.place(x=82, rely=0.68, relwidth=1.0, width=-92, relheight=0.28)
|
|
4941
5040
|
self.console_drawer.lift()
|
|
4942
5041
|
self.console_drawer_visible = True
|
|
4943
5042
|
if hasattr(self, "status_toggle_lbl"):
|
|
4944
|
-
self.status_toggle_lbl.config(text="▼
|
|
5043
|
+
self.status_toggle_lbl.config(text="▼ Hide Console")
|
|
4945
5044
|
|
|
4946
5045
|
def log(self, text: str):
|
|
4947
5046
|
if not hasattr(self, "console_text") or self.console_text is None:
|
|
@@ -5000,7 +5099,7 @@ class AutoReadmeGUI:
|
|
|
5000
5099
|
except Exception:
|
|
5001
5100
|
pass
|
|
5002
5101
|
webbrowser.open(f"http://localhost:{DASHBOARD_PORT}")
|
|
5003
|
-
self.show_toast("T-Zero Web
|
|
5102
|
+
self.show_toast("T-Zero Web Console & Superdesign opened", "success")
|
|
5004
5103
|
except Exception:
|
|
5005
5104
|
webbrowser.open("http://localhost:8421")
|
|
5006
5105
|
|
|
@@ -5008,7 +5107,7 @@ class AutoReadmeGUI:
|
|
|
5008
5107
|
self.open_security_audit_dialog()
|
|
5009
5108
|
|
|
5010
5109
|
def run_quick_anti_rea_armor(self):
|
|
5011
|
-
"""Executes
|
|
5110
|
+
"""Executes 180-Tier Anti-REA Resistance audit & protection from GUI Security Hub."""
|
|
5012
5111
|
target = (self.dir_entry.get().strip() if hasattr(self, "dir_entry") else "") or os.getcwd()
|
|
5013
5112
|
try:
|
|
5014
5113
|
from tzero.tzero_armor import audit_path_rea_resistance
|
|
@@ -5017,9 +5116,9 @@ class AutoReadmeGUI:
|
|
|
5017
5116
|
rating = audit.get("rating", "UNKNOWN")
|
|
5018
5117
|
self.log(f"[ANTI-REA AUDIT] Target: {target} | Score: {score}/100 ({rating})")
|
|
5019
5118
|
messagebox.showinfo(
|
|
5020
|
-
"T-Zero
|
|
5119
|
+
"T-Zero 180-Tier Anti-REA Armor",
|
|
5021
5120
|
f"Target: {target}\nAI Resistance Score: {score}/100 ({rating})\n"
|
|
5022
|
-
f"Active
|
|
5121
|
+
f"Active Defense Matrix: 12 Domains x 15 Sub-Tiers (Crypto Capsule, Opaque CFF, PolyVM, Anti-Debug, Anti-VM, RDTSC).",
|
|
5023
5122
|
)
|
|
5024
5123
|
except Exception as exc:
|
|
5025
5124
|
self.log(f"[ANTI-REA ERROR] {exc}")
|
|
@@ -5114,16 +5213,16 @@ class AutoReadmeGUI:
|
|
|
5114
5213
|
# Audio and status feedback
|
|
5115
5214
|
if leaks_count > 0:
|
|
5116
5215
|
play_sfx("error")
|
|
5117
|
-
self.show_toast(f"🚨 T-001
|
|
5216
|
+
self.show_toast(f"🚨 T-001 ALERT: {leaks_count} leak(s) detected!", "error", 5000)
|
|
5118
5217
|
else:
|
|
5119
5218
|
play_sfx("success")
|
|
5120
|
-
self.show_toast(f"✅ %
|
|
5219
|
+
self.show_toast(f"✅ 100% Zero-Leak Security Clean! ({total_scanned_files} files scanned)", "success", 4000)
|
|
5121
5220
|
|
|
5122
5221
|
self.log(f"T-Zero Security Audit: {total_scanned_files} files scanned, {leaks_count} secrets, {arch_violations_count} arch violations, {smells_count} AST smells.")
|
|
5123
5222
|
|
|
5124
5223
|
# Open dedicated Luxury Report Window
|
|
5125
5224
|
dialog = tk.Toplevel(self.root)
|
|
5126
|
-
dialog.title("🛡️ T-Zero
|
|
5225
|
+
dialog.title("🛡️ T-Zero Security & AST Architecture Audit Report")
|
|
5127
5226
|
dialog.geometry("900x620")
|
|
5128
5227
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
5129
5228
|
dialog.transient(self.root)
|
|
@@ -5134,8 +5233,8 @@ class AutoReadmeGUI:
|
|
|
5134
5233
|
# Header Title
|
|
5135
5234
|
hdr = tk.Frame(main_frame, bg=PALETTE["bg_start"])
|
|
5136
5235
|
hdr.pack(fill=tk.X, pady=(0, 12))
|
|
5137
|
-
tk.Label(hdr, text="🛡️ T-ZERO
|
|
5138
|
-
sub_info = f"
|
|
5236
|
+
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)
|
|
5237
|
+
sub_info = f"Workspace: {target} • Scanned Files: {total_scanned_files} • Python Lines: ~{total_lines_count}"
|
|
5139
5238
|
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))
|
|
5140
5239
|
|
|
5141
5240
|
# 4 Metric Cards Row (T-001 to T-004)
|
|
@@ -5156,10 +5255,10 @@ class AutoReadmeGUI:
|
|
|
5156
5255
|
tk.Label(p, text=status_text, font=("Segoe UI", 10, "bold"), fg=color, bg=PALETTE["card_bg"]).pack(anchor=tk.W, pady=(2, 1))
|
|
5157
5256
|
tk.Label(p, text=sub, font=("Segoe UI", 7), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(anchor=tk.W)
|
|
5158
5257
|
|
|
5159
|
-
make_metric_card(cards_row, 0, "T-001 ZERO-LEAK", "✅ 100%
|
|
5160
|
-
make_metric_card(cards_row, 1, "T-002
|
|
5161
|
-
make_metric_card(cards_row, 2, "T-003 AST
|
|
5162
|
-
make_metric_card(cards_row, 3, "T-004
|
|
5258
|
+
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")
|
|
5259
|
+
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")
|
|
5260
|
+
make_metric_card(cards_row, 2, "T-003 AST CONTRACT", "✅ VERIFIED", True, f"{py_files_count} Module Signatures")
|
|
5261
|
+
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")
|
|
5163
5262
|
|
|
5164
5263
|
# Treeview Table for Issues
|
|
5165
5264
|
table_frame = GlassCard(main_frame)
|
|
@@ -5169,11 +5268,11 @@ class AutoReadmeGUI:
|
|
|
5169
5268
|
|
|
5170
5269
|
cols = ("Rule", "File", "Line", "Severity", "Message")
|
|
5171
5270
|
tree = ttk.Treeview(table_pad, columns=cols, show="headings", height=12)
|
|
5172
|
-
tree.heading("Rule", text="
|
|
5173
|
-
tree.heading("File", text="
|
|
5174
|
-
tree.heading("Line", text="
|
|
5175
|
-
tree.heading("Severity", text="
|
|
5176
|
-
tree.heading("Message", text="
|
|
5271
|
+
tree.heading("Rule", text="Rule")
|
|
5272
|
+
tree.heading("File", text="File Path")
|
|
5273
|
+
tree.heading("Line", text="Line")
|
|
5274
|
+
tree.heading("Severity", text="Severity")
|
|
5275
|
+
tree.heading("Message", text="Audit Finding & Recommendation")
|
|
5177
5276
|
|
|
5178
5277
|
tree.column("Rule", width=85, anchor=tk.CENTER)
|
|
5179
5278
|
tree.column("File", width=220)
|
|
@@ -5191,12 +5290,12 @@ class AutoReadmeGUI:
|
|
|
5191
5290
|
filtered = [i for i in audit_issues if (filter_rule is None or i["rule"] == filter_rule)]
|
|
5192
5291
|
if not filtered:
|
|
5193
5292
|
if filter_rule is None:
|
|
5194
|
-
tree.insert("", "end", values=("T-001", "
|
|
5195
|
-
tree.insert("", "end", values=("T-002", "
|
|
5196
|
-
tree.insert("", "end", values=("T-003", "
|
|
5197
|
-
tree.insert("", "end", values=("T-004", "
|
|
5293
|
+
tree.insert("", "end", values=("T-001", "ALL FILES", "-", "CLEAN", "✅ 100% Zero-Leak: No plaintext API keys, passwords, or credential leaks detected."))
|
|
5294
|
+
tree.insert("", "end", values=("T-002", "ALL MODULES", "-", "CLEAN", "✅ Architecture Boundaries: All modules comply with tzero.rules.json architectural layers."))
|
|
5295
|
+
tree.insert("", "end", values=("T-003", "ALL FUNCTIONS", "-", "CLEAN", "✅ AST Signatures: All function, class, and type contracts are valid."))
|
|
5296
|
+
tree.insert("", "end", values=("T-004", "CODEBASE", "-", "CLEAN", "✅ Code Quality: No 30+ line anomalies, excessive arguments, or global keywords found."))
|
|
5198
5297
|
else:
|
|
5199
|
-
tree.insert("", "end", values=(filter_rule, "
|
|
5298
|
+
tree.insert("", "end", values=(filter_rule, "ALL FILES", "-", "CLEAN", f"✅ No violations or warnings found for rule {filter_rule}."))
|
|
5200
5299
|
else:
|
|
5201
5300
|
for item in filtered:
|
|
5202
5301
|
tree.insert("", "end", values=(item["rule"], item["file"], item["line"], item["severity"], item["msg"]))
|
|
@@ -5210,7 +5309,7 @@ class AutoReadmeGUI:
|
|
|
5210
5309
|
filter_frame = tk.Frame(btm_bar, bg=PALETTE["bg_start"])
|
|
5211
5310
|
filter_frame.pack(side=tk.LEFT)
|
|
5212
5311
|
|
|
5213
|
-
tk.Button(filter_frame, text="
|
|
5312
|
+
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))
|
|
5214
5313
|
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)
|
|
5215
5314
|
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)
|
|
5216
5315
|
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)
|
|
@@ -5244,7 +5343,7 @@ class AutoReadmeGUI:
|
|
|
5244
5343
|
content = export_markdown_report()
|
|
5245
5344
|
self.root.clipboard_clear()
|
|
5246
5345
|
self.root.clipboard_append(content)
|
|
5247
|
-
self.show_toast("
|
|
5346
|
+
self.show_toast("Report copied to clipboard in Markdown format!", "success")
|
|
5248
5347
|
|
|
5249
5348
|
def save_report():
|
|
5250
5349
|
content = export_markdown_report()
|
|
@@ -5256,11 +5355,11 @@ class AutoReadmeGUI:
|
|
|
5256
5355
|
if out_file:
|
|
5257
5356
|
with open(out_file, "w", encoding="utf-8") as fp:
|
|
5258
5357
|
fp.write(content)
|
|
5259
|
-
self.show_toast("
|
|
5358
|
+
self.show_toast("Audit report saved successfully!", "success")
|
|
5260
5359
|
|
|
5261
|
-
tk.Button(action_frame, text="📋
|
|
5262
|
-
tk.Button(action_frame, text="💾
|
|
5263
|
-
tk.Button(action_frame, text="✕
|
|
5360
|
+
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)
|
|
5361
|
+
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)
|
|
5362
|
+
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))
|
|
5264
5363
|
|
|
5265
5364
|
def open_theme_selector(self):
|
|
5266
5365
|
play_sfx("click")
|
|
@@ -5471,7 +5570,7 @@ class AutoReadmeGUI:
|
|
|
5471
5570
|
self.log("⚡ T-Zero Quick Optimization: Pruned non-essential AST nodes. Context compression maximized.")
|
|
5472
5571
|
|
|
5473
5572
|
def toggle_language(self):
|
|
5474
|
-
self.lang = "
|
|
5573
|
+
self.lang = "en"
|
|
5475
5574
|
_config_mgr.get_profile()["language"] = self.lang
|
|
5476
5575
|
_config_mgr.save()
|
|
5477
5576
|
|
|
@@ -5503,7 +5602,8 @@ class AutoReadmeGUI:
|
|
|
5503
5602
|
if hasattr(self, "audit_btn") and self.audit_btn:
|
|
5504
5603
|
self.audit_btn.config(text=get_text("audit_btn", self.lang))
|
|
5505
5604
|
|
|
5506
|
-
self.
|
|
5605
|
+
self.show_toast("Interface language: English (EN)", "info")
|
|
5606
|
+
self.log("Interface language active: EN")
|
|
5507
5607
|
|
|
5508
5608
|
# --- TAB 1: EXECUTIVE 9-CARD OVERVIEW DASHBOARD ---
|
|
5509
5609
|
def setup_tab_setup(self):
|
|
@@ -5544,20 +5644,20 @@ class AutoReadmeGUI:
|
|
|
5544
5644
|
self.quick_card.grid(row=1, column=2, columnspan=2, sticky="nsew", padx=4, pady=4)
|
|
5545
5645
|
q_inner = self.quick_card.inner
|
|
5546
5646
|
|
|
5547
|
-
tk.Label(q_inner, text="⚡
|
|
5647
|
+
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))
|
|
5548
5648
|
|
|
5549
|
-
tk.Label(q_inner, text="AI
|
|
5649
|
+
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)
|
|
5550
5650
|
self.provider_var = tk.StringVar(value="NVIDIA NIM")
|
|
5551
5651
|
self.provider_combo = ttk.Combobox(q_inner, textvariable=self.provider_var, values=list(PROVIDERS.keys()), state="readonly")
|
|
5552
5652
|
self.provider_combo.pack(fill=tk.X, ipady=1, pady=(1, 4))
|
|
5553
5653
|
self.provider_combo.bind("<<ComboboxSelected>>", self.on_provider_select)
|
|
5554
5654
|
|
|
5555
|
-
tk.Label(q_inner, text="
|
|
5655
|
+
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)
|
|
5556
5656
|
self.model_var = tk.StringVar()
|
|
5557
5657
|
self.model_combo = ttk.Combobox(q_inner, textvariable=self.model_var, state="readonly")
|
|
5558
5658
|
self.model_combo.pack(fill=tk.X, ipady=1, pady=(1, 4))
|
|
5559
5659
|
|
|
5560
|
-
tk.Label(q_inner, text="
|
|
5660
|
+
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)
|
|
5561
5661
|
dir_frame = tk.Frame(q_inner, bg=self.quick_card.card_bg)
|
|
5562
5662
|
dir_frame.pack(fill=tk.X, pady=(1, 6))
|
|
5563
5663
|
|
|
@@ -5575,7 +5675,7 @@ class AutoReadmeGUI:
|
|
|
5575
5675
|
|
|
5576
5676
|
self.browse_btn = apply_modern_hover(tk.Button(
|
|
5577
5677
|
dir_frame,
|
|
5578
|
-
text="
|
|
5678
|
+
text="Browse...",
|
|
5579
5679
|
bg=PALETTE["card_border"],
|
|
5580
5680
|
fg=PALETTE["text_main"],
|
|
5581
5681
|
relief=tk.FLAT,
|
|
@@ -5630,7 +5730,7 @@ class AutoReadmeGUI:
|
|
|
5630
5730
|
pad_l = tk.Frame(left, bg=PALETTE["card_bg"], padx=16, pady=14)
|
|
5631
5731
|
pad_l.pack(fill=tk.BOTH, expand=True)
|
|
5632
5732
|
|
|
5633
|
-
tk.Label(pad_l, text="AI PROVIDER
|
|
5733
|
+
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))
|
|
5634
5734
|
|
|
5635
5735
|
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))
|
|
5636
5736
|
self.api_url_entry = apply_entry_focus_glow(tk.Entry(
|
|
@@ -5645,7 +5745,7 @@ class AutoReadmeGUI:
|
|
|
5645
5745
|
))
|
|
5646
5746
|
self.api_url_entry.pack(fill=tk.X, ipady=4, pady=(0, 8))
|
|
5647
5747
|
|
|
5648
|
-
tk.Label(pad_l, text="API
|
|
5748
|
+
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))
|
|
5649
5749
|
key_frame = tk.Frame(pad_l, bg=PALETTE["card_bg"])
|
|
5650
5750
|
key_frame.pack(fill=tk.X, pady=(0, 10))
|
|
5651
5751
|
|
|
@@ -5675,14 +5775,14 @@ class AutoReadmeGUI:
|
|
|
5675
5775
|
self.ping_btn.pack(side=tk.RIGHT, padx=(8, 0), ipady=3, ipadx=8)
|
|
5676
5776
|
|
|
5677
5777
|
# Custom prompt directives
|
|
5678
|
-
tk.Label(pad_l, text="📝
|
|
5778
|
+
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))
|
|
5679
5779
|
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)
|
|
5680
5780
|
self.extra_prompt_text.pack(fill=tk.BOTH, expand=True, pady=(0, 8))
|
|
5681
5781
|
|
|
5682
5782
|
# Bottom FX star speed
|
|
5683
5783
|
bottom_fx = tk.Frame(pad_l, bg=PALETTE["card_bg"])
|
|
5684
5784
|
bottom_fx.pack(fill=tk.X, pady=(2, 0))
|
|
5685
|
-
tk.Label(bottom_fx, text="🌌
|
|
5785
|
+
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))
|
|
5686
5786
|
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)
|
|
5687
5787
|
self.star_scale.set(1.0)
|
|
5688
5788
|
self.star_scale.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
@@ -5703,14 +5803,14 @@ class AutoReadmeGUI:
|
|
|
5703
5803
|
b_links = tk.Frame(brand, bg=PALETTE["bg_start"])
|
|
5704
5804
|
b_links.pack(fill=tk.X, padx=10, pady=(2, 6))
|
|
5705
5805
|
|
|
5706
|
-
lbl_sa = tk.Label(b_links, text=f"
|
|
5806
|
+
lbl_sa = tk.Label(b_links, text=f"Developer: {DEV_NAME}", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_main"], bg=PALETTE["bg_start"])
|
|
5707
5807
|
lbl_sa.pack(side=tk.LEFT, padx=(0, 10))
|
|
5708
5808
|
|
|
5709
5809
|
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")
|
|
5710
5810
|
lbl_web1.pack(side=tk.LEFT, padx=3)
|
|
5711
5811
|
lbl_web1.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_LINKEDIN))
|
|
5712
5812
|
|
|
5713
|
-
lbl_web2 = tk.Label(b_links, text="🌐
|
|
5813
|
+
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")
|
|
5714
5814
|
lbl_web2.pack(side=tk.LEFT, padx=3)
|
|
5715
5815
|
lbl_web2.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_BIO))
|
|
5716
5816
|
|
|
@@ -5718,7 +5818,7 @@ class AutoReadmeGUI:
|
|
|
5718
5818
|
lbl_web3.pack(side=tk.LEFT, padx=3)
|
|
5719
5819
|
lbl_web3.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_MAIN))
|
|
5720
5820
|
|
|
5721
|
-
lbl_web4 = tk.Label(b_links, text="🤗
|
|
5821
|
+
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")
|
|
5722
5822
|
lbl_web4.pack(side=tk.LEFT, padx=3)
|
|
5723
5823
|
lbl_web4.bind("<Button-1>", lambda e: webbrowser.open("https://huggingface.co/spaces/toprakke4/tzero-token-reducer"))
|
|
5724
5824
|
|
|
@@ -5729,7 +5829,7 @@ class AutoReadmeGUI:
|
|
|
5729
5829
|
|
|
5730
5830
|
p_head_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5731
5831
|
p_head_row.pack(fill=tk.X, pady=(0, 4))
|
|
5732
|
-
tk.Label(p_head_row, text="⚙️
|
|
5832
|
+
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)
|
|
5733
5833
|
|
|
5734
5834
|
p_select_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5735
5835
|
p_select_row.pack(fill=tk.X, pady=(0, 6))
|
|
@@ -5741,14 +5841,14 @@ class AutoReadmeGUI:
|
|
|
5741
5841
|
p_actions = tk.Frame(p_select_row, bg=PALETTE["card_bg"])
|
|
5742
5842
|
p_actions.pack(side=tk.RIGHT)
|
|
5743
5843
|
|
|
5744
|
-
self.use_profile_btn = apply_modern_hover(tk.Button(p_actions, text="⚡
|
|
5844
|
+
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")
|
|
5745
5845
|
self.use_profile_btn.pack(side=tk.TOP, fill=tk.X, pady=1)
|
|
5746
5846
|
|
|
5747
5847
|
p_mini = tk.Frame(p_actions, bg=PALETTE["card_bg"])
|
|
5748
5848
|
p_mini.pack(side=tk.BOTTOM, fill=tk.X)
|
|
5749
|
-
self.new_profile_btn = apply_modern_hover(tk.Button(p_mini, text="+
|
|
5849
|
+
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"))
|
|
5750
5850
|
self.new_profile_btn.pack(side=tk.LEFT, padx=1)
|
|
5751
|
-
self.del_profile_btn = apply_modern_hover(tk.Button(p_mini, text="🗑
|
|
5851
|
+
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")
|
|
5752
5852
|
self.del_profile_btn.pack(side=tk.LEFT, padx=1)
|
|
5753
5853
|
|
|
5754
5854
|
# 2x2 Management tools grid
|
|
@@ -5757,29 +5857,29 @@ class AutoReadmeGUI:
|
|
|
5757
5857
|
tools_grid.columnconfigure(0, weight=1)
|
|
5758
5858
|
tools_grid.columnconfigure(1, weight=1)
|
|
5759
5859
|
|
|
5760
|
-
self.keyring_btn = apply_modern_hover(tk.Button(tools_grid, text="🔑 API
|
|
5860
|
+
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"))
|
|
5761
5861
|
self.keyring_btn.grid(row=0, column=0, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5762
5862
|
|
|
5763
|
-
self.keyring_backup_btn = apply_modern_hover(tk.Button(tools_grid, text="🛡
|
|
5863
|
+
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"))
|
|
5764
5864
|
self.keyring_backup_btn.grid(row=0, column=1, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5765
5865
|
|
|
5766
|
-
self.global_config_btn = apply_modern_hover(tk.Button(tools_grid, text="⚙
|
|
5866
|
+
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"))
|
|
5767
5867
|
self.global_config_btn.grid(row=1, column=0, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5768
5868
|
|
|
5769
|
-
self.ignore_folders_btn = apply_modern_hover(tk.Button(tools_grid, text="📁
|
|
5869
|
+
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"))
|
|
5770
5870
|
self.ignore_folders_btn.grid(row=1, column=1, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5771
5871
|
|
|
5772
5872
|
# Import/Export + Presets row
|
|
5773
5873
|
io_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5774
5874
|
io_row.pack(fill=tk.X, pady=(2, 0))
|
|
5775
5875
|
|
|
5776
|
-
self.import_profile_btn = apply_modern_hover(tk.Button(io_row, text="📥
|
|
5876
|
+
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"))
|
|
5777
5877
|
self.import_profile_btn.pack(side=tk.LEFT, padx=2)
|
|
5778
5878
|
|
|
5779
|
-
self.export_profile_btn = apply_modern_hover(tk.Button(io_row, text="📤
|
|
5879
|
+
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"))
|
|
5780
5880
|
self.export_profile_btn.pack(side=tk.LEFT, padx=2)
|
|
5781
5881
|
|
|
5782
|
-
tk.Label(io_row, text="
|
|
5882
|
+
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))
|
|
5783
5883
|
self.preset_combo = ttk.Combobox(io_row, values=list(WorkspacePresetManager.PRESETS.keys()), state="readonly", width=14)
|
|
5784
5884
|
self.preset_combo.pack(side=tk.RIGHT, fill=tk.X, expand=True, padx=2)
|
|
5785
5885
|
self.preset_combo.bind("<<ComboboxSelected>>", self.apply_scan_preset)
|
|
@@ -6096,33 +6196,33 @@ class AutoReadmeGUI:
|
|
|
6096
6196
|
elif r_chat.status_code == 401:
|
|
6097
6197
|
self.safe_after(0, lambda: self.status_dot.set_status("red"))
|
|
6098
6198
|
warn_msg = (
|
|
6099
|
-
f"
|
|
6100
|
-
f"💡
|
|
6101
|
-
f"1.
|
|
6102
|
-
f"2. NVIDIA NIM
|
|
6103
|
-
f"3. https://build.nvidia.com
|
|
6104
|
-
f"⚡ T-Zero
|
|
6199
|
+
f"Remote API Key could not be verified (HTTP 401: Authorization Failed).\n\n"
|
|
6200
|
+
f"💡 Cause & Resolution:\n"
|
|
6201
|
+
f"1. Your API key may be invalid, incomplete, or expired.\n"
|
|
6202
|
+
f"2. NVIDIA NIM keys typically start with 'nvapi-'.\n"
|
|
6203
|
+
f"3. Generate a new active API key at https://build.nvidia.com and enter it in the Settings tab.\n\n"
|
|
6204
|
+
f"⚡ With the T-Zero Local Offline AST Engine, full context generation works 100% free even without an API key!"
|
|
6105
6205
|
)
|
|
6106
|
-
self.safe_after(0, lambda: messagebox.showwarning("
|
|
6206
|
+
self.safe_after(0, lambda: messagebox.showwarning("Authorization Error (401)", warn_msg))
|
|
6107
6207
|
elif r_chat.status_code == 403:
|
|
6108
6208
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6109
6209
|
warn_msg = (
|
|
6110
|
-
f"Model
|
|
6111
|
-
f"💡
|
|
6112
|
-
f"NVIDIA NIM 'Personal'
|
|
6113
|
-
f"1. https://build.nvidia.com
|
|
6114
|
-
f"2.
|
|
6210
|
+
f"Model list is reachable, but inference permission is missing (HTTP 403: Authorization failed).\n\n"
|
|
6211
|
+
f"💡 Cause & Resolution:\n"
|
|
6212
|
+
f"API keys created on NVIDIA NIM 'Personal' accounts may not have 'Public API Endpoints' enabled by default.\n\n"
|
|
6213
|
+
f"1. Create a new API key at https://build.nvidia.com with 'Public API Endpoints' permission enabled.\n"
|
|
6214
|
+
f"2. Or run T-Zero in Local Offline AST Mode to synthesize 100% complete context without any API key!"
|
|
6115
6215
|
)
|
|
6116
|
-
self.safe_after(0, lambda: messagebox.showwarning("
|
|
6216
|
+
self.safe_after(0, lambda: messagebox.showwarning("Partial Permission (403)", warn_msg))
|
|
6117
6217
|
elif r_chat.status_code == 410:
|
|
6118
6218
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6119
6219
|
self.safe_after(0, lambda: messagebox.showwarning(
|
|
6120
|
-
"Model
|
|
6121
|
-
f"'{target_model}'
|
|
6220
|
+
"Model End of Life (410)",
|
|
6221
|
+
f"Model '{target_model}' has reached End of Life. Please select 'deepseek-ai/deepseek-v4.1-flash' from the dropdown."
|
|
6122
6222
|
))
|
|
6123
6223
|
else:
|
|
6124
6224
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6125
|
-
self.safe_after(0, lambda: messagebox.showwarning("API
|
|
6225
|
+
self.safe_after(0, lambda: messagebox.showwarning("API Response", f"Remote API status: {r_chat.status_code}\n{r_chat.text[:200]}"))
|
|
6126
6226
|
except Exception:
|
|
6127
6227
|
self.safe_after(0, lambda: self.status_dot.set_status("green"))
|
|
6128
6228
|
self.safe_after(0, lambda: messagebox.showinfo("Success", get_text("ping_success", self.lang)))
|
|
@@ -6234,40 +6334,71 @@ class AutoReadmeGUI:
|
|
|
6234
6334
|
|
|
6235
6335
|
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))
|
|
6236
6336
|
|
|
6237
|
-
def show_crypto_support_modal(self):
|
|
6337
|
+
def show_crypto_support_modal(self, periodic: bool = False):
|
|
6238
6338
|
try:
|
|
6239
6339
|
from tzero.tzero_traffic import (
|
|
6240
|
-
CRYPTO_USDT_TRC20, CRYPTO_BTC, REPO_URL, BIO_URL, CURRENT_VERSION
|
|
6340
|
+
CRYPTO_EVM, CRYPTO_USDT_TRC20, CRYPTO_BTC, REPO_URL, BIO_URL, SPONSOR_HUB_URL, CURRENT_VERSION
|
|
6241
6341
|
)
|
|
6242
6342
|
except Exception:
|
|
6343
|
+
CRYPTO_EVM = "0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5"
|
|
6243
6344
|
CRYPTO_USDT_TRC20 = "TE7uKxZJ414u938gWf6bYh9QvRk2141517"
|
|
6244
6345
|
CRYPTO_BTC = "bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s"
|
|
6245
6346
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6246
6347
|
BIO_URL = "https://hopp.bio/siberegitim"
|
|
6348
|
+
SPONSOR_HUB_URL = "https://tzero-indol.vercel.app/#support"
|
|
6247
6349
|
from tzero import __version__ as CURRENT_VERSION
|
|
6248
6350
|
|
|
6351
|
+
stats = dict(getattr(self, "community_stats", {}) or {})
|
|
6352
|
+
stars = int(stats.get("stars", 111))
|
|
6353
|
+
dl_label = str(stats.get("downloads_label", "22,900+"))
|
|
6354
|
+
saved_label = str(stats.get("saved_tokens_label", "1,120,000+"))
|
|
6355
|
+
|
|
6249
6356
|
dialog = tk.Toplevel(self.root)
|
|
6250
|
-
|
|
6251
|
-
|
|
6357
|
+
if siber_akademi_icon:
|
|
6358
|
+
try:
|
|
6359
|
+
siber_akademi_icon.apply_window_icon(dialog)
|
|
6360
|
+
except Exception:
|
|
6361
|
+
pass
|
|
6362
|
+
dialog.title(
|
|
6363
|
+
f"💖 Sponsor T-Zero v{CURRENT_VERSION} — Keep It 100% Free"
|
|
6364
|
+
if periodic
|
|
6365
|
+
else f"T-Zero v{CURRENT_VERSION} — Support & Sponsor Hub"
|
|
6366
|
+
)
|
|
6367
|
+
dialog.geometry("560x575" if periodic else "560x540")
|
|
6252
6368
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
6253
6369
|
dialog.transient(self.root)
|
|
6254
6370
|
dialog.grab_set()
|
|
6255
6371
|
|
|
6256
|
-
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=
|
|
6372
|
+
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=18)
|
|
6257
6373
|
pad.pack(fill=tk.BOTH, expand=True)
|
|
6258
6374
|
|
|
6375
|
+
hdr_txt = (
|
|
6376
|
+
"💖 ENJOYING T-ZERO? BECOME A SPONSOR!"
|
|
6377
|
+
if periodic
|
|
6378
|
+
else f"🚀 T-ZERO v{CURRENT_VERSION} SPONSOR & SUPPORT HUB"
|
|
6379
|
+
)
|
|
6259
6380
|
tk.Label(
|
|
6260
6381
|
pad,
|
|
6261
|
-
text=
|
|
6382
|
+
text=hdr_txt,
|
|
6262
6383
|
font=("Segoe UI", 12, "bold"),
|
|
6263
6384
|
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6264
6385
|
bg=PALETTE["bg_start"]
|
|
6265
6386
|
).pack(anchor=tk.W, pady=(0, 6))
|
|
6266
6387
|
|
|
6388
|
+
stats_banner = tk.Frame(pad, bg=PALETTE["card_bg"], highlightthickness=1, highlightbackground=PALETTE["card_border"], padx=12, pady=7)
|
|
6389
|
+
stats_banner.pack(fill=tk.X, pady=(0, 10))
|
|
6390
|
+
tk.Label(
|
|
6391
|
+
stats_banner,
|
|
6392
|
+
text=f"🚀 {dl_label} Downloads | ⚡ {saved_label} Tokens Saved | ⭐ {stars} GitHub Stars",
|
|
6393
|
+
font=("Segoe UI", 8, "bold"),
|
|
6394
|
+
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6395
|
+
bg=PALETTE["card_bg"]
|
|
6396
|
+
).pack()
|
|
6397
|
+
|
|
6267
6398
|
msg = (
|
|
6268
|
-
"T-Zero
|
|
6269
|
-
"
|
|
6270
|
-
"
|
|
6399
|
+
"T-Zero is 100% FREE, local-first, and open-source (AGPL-3.0) with zero paid API lock-in.\n"
|
|
6400
|
+
"Your sponsorship directly funds continuous maintenance, multi-language AST engines,\n"
|
|
6401
|
+
"and independent developer work by Toprak Ahmet Aydoğmuş (Siber Akademi)."
|
|
6271
6402
|
)
|
|
6272
6403
|
tk.Label(
|
|
6273
6404
|
pad,
|
|
@@ -6276,39 +6407,76 @@ class AutoReadmeGUI:
|
|
|
6276
6407
|
fg=PALETTE["text_muted"],
|
|
6277
6408
|
bg=PALETTE["bg_start"],
|
|
6278
6409
|
justify=tk.LEFT
|
|
6279
|
-
).pack(anchor=tk.W, pady=(0,
|
|
6410
|
+
).pack(anchor=tk.W, pady=(0, 10))
|
|
6280
6411
|
|
|
6281
6412
|
def copy_addr(val, label):
|
|
6282
6413
|
try:
|
|
6283
6414
|
self.root.clipboard_clear()
|
|
6284
6415
|
self.root.clipboard_append(val)
|
|
6285
|
-
self.log(f"
|
|
6286
|
-
messagebox.showinfo("
|
|
6416
|
+
self.log(f"Copied to clipboard ({label}): {val}")
|
|
6417
|
+
messagebox.showinfo("Copied", f"{label} address copied to clipboard:\n{val}")
|
|
6287
6418
|
except Exception:
|
|
6288
6419
|
pass
|
|
6289
6420
|
|
|
6290
|
-
#
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
tk.Label(
|
|
6294
|
-
tk.Button(
|
|
6421
|
+
# EVM (ETH / Base / Polygon)
|
|
6422
|
+
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)
|
|
6423
|
+
e_box.pack(fill=tk.X, pady=3)
|
|
6424
|
+
tk.Label(e_box, text=CRYPTO_EVM, font=("Consolas", 8), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6425
|
+
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)
|
|
6426
|
+
|
|
6427
|
+
# USDT (TRC-20)
|
|
6428
|
+
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)
|
|
6429
|
+
u_box.pack(fill=tk.X, pady=3)
|
|
6430
|
+
tk.Label(u_box, text=CRYPTO_USDT_TRC20, font=("Consolas", 8), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6431
|
+
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)
|
|
6295
6432
|
|
|
6296
6433
|
# BTC
|
|
6297
|
-
b_box = tk.LabelFrame(pad, text="🪙 Bitcoin (BTC Network)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_yellow", "#fbbf24"), font=("Segoe UI",
|
|
6298
|
-
b_box.pack(fill=tk.X, pady=
|
|
6299
|
-
tk.Label(b_box, text=CRYPTO_BTC, font=("Consolas",
|
|
6300
|
-
tk.Button(b_box, text="
|
|
6434
|
+
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)
|
|
6435
|
+
b_box.pack(fill=tk.X, pady=3)
|
|
6436
|
+
tk.Label(b_box, text=CRYPTO_BTC, font=("Consolas", 8), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6437
|
+
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)
|
|
6301
6438
|
|
|
6302
6439
|
# Links Row
|
|
6303
6440
|
links_row = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6304
6441
|
links_row.pack(fill=tk.X, pady=(12, 6))
|
|
6305
6442
|
|
|
6306
6443
|
import webbrowser
|
|
6307
|
-
tk.Button(links_row, text="
|
|
6308
|
-
tk.Button(links_row, text="
|
|
6444
|
+
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))
|
|
6445
|
+
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)
|
|
6446
|
+
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)
|
|
6447
|
+
|
|
6448
|
+
# Footer buttons
|
|
6449
|
+
footer = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6450
|
+
footer.pack(fill=tk.X, pady=(12, 0))
|
|
6451
|
+
|
|
6452
|
+
if periodic:
|
|
6453
|
+
def on_dismiss_sponsor():
|
|
6454
|
+
try:
|
|
6455
|
+
profile = _config_mgr.get_profile()
|
|
6456
|
+
profile["sponsor_popup_dismissed_v12"] = True
|
|
6457
|
+
_config_mgr.save_profile(profile)
|
|
6458
|
+
except Exception:
|
|
6459
|
+
pass
|
|
6460
|
+
dialog.destroy()
|
|
6461
|
+
|
|
6462
|
+
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)
|
|
6463
|
+
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)
|
|
6464
|
+
else:
|
|
6465
|
+
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()
|
|
6466
|
+
|
|
6467
|
+
def check_and_show_startup_popups(self):
|
|
6468
|
+
"""Show Star popup on 1st & every 10th launch, and Sponsor popup every 5th launch or weekly."""
|
|
6469
|
+
try:
|
|
6470
|
+
profile = _config_mgr.get_profile()
|
|
6471
|
+
action = decide_startup_popup(profile)
|
|
6472
|
+
_config_mgr.save_profile(profile)
|
|
6473
|
+
except Exception:
|
|
6474
|
+
action = "none"
|
|
6309
6475
|
|
|
6310
|
-
|
|
6311
|
-
|
|
6476
|
+
if action == "star":
|
|
6477
|
+
self.check_and_show_star_welcome_popup()
|
|
6478
|
+
elif action == "sponsor":
|
|
6479
|
+
self.show_crypto_support_modal(periodic=True)
|
|
6312
6480
|
|
|
6313
6481
|
def open_star_action(self):
|
|
6314
6482
|
"""Opens GitHub repository directly and shows thank-you toast."""
|
|
@@ -6319,7 +6487,7 @@ class AutoReadmeGUI:
|
|
|
6319
6487
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6320
6488
|
try:
|
|
6321
6489
|
webbrowser.open(REPO_URL)
|
|
6322
|
-
self.show_toast("⭐ GitHub
|
|
6490
|
+
self.show_toast("⭐ GitHub repository opened! Thank you for starring!", "success")
|
|
6323
6491
|
except Exception:
|
|
6324
6492
|
pass
|
|
6325
6493
|
|
|
@@ -6363,7 +6531,7 @@ class AutoReadmeGUI:
|
|
|
6363
6531
|
siber_akademi_icon.apply_window_icon(dialog)
|
|
6364
6532
|
except Exception:
|
|
6365
6533
|
pass
|
|
6366
|
-
dialog_title = f"⭐ T-Zero v{CURRENT_VERSION} —
|
|
6534
|
+
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!"
|
|
6367
6535
|
dialog.title(dialog_title)
|
|
6368
6536
|
dialog.geometry("560x430")
|
|
6369
6537
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
@@ -6377,9 +6545,9 @@ class AutoReadmeGUI:
|
|
|
6377
6545
|
h_frame = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6378
6546
|
h_frame.pack(fill=tk.X, pady=(0, 10))
|
|
6379
6547
|
header_text = (
|
|
6380
|
-
"🚀
|
|
6548
|
+
"🚀 GITHUB OPENED IN YOUR BROWSER: PLEASE STAR THE REPO! ⭐"
|
|
6381
6549
|
if first_launch
|
|
6382
|
-
else f"⭐ {target_stars}
|
|
6550
|
+
else f"⭐ {target_stars} STARS GOAL: JOIN THE COMMUNITY!"
|
|
6383
6551
|
)
|
|
6384
6552
|
hdr_lbl = tk.Label(
|
|
6385
6553
|
h_frame,
|
|
@@ -6395,7 +6563,7 @@ class AutoReadmeGUI:
|
|
|
6395
6563
|
stats_frame.pack(fill=tk.X, pady=(0, 12))
|
|
6396
6564
|
stats_lbl = tk.Label(
|
|
6397
6565
|
stats_frame,
|
|
6398
|
-
text=f"🚀 {dl_label}
|
|
6566
|
+
text=f"🚀 {dl_label} Downloads (PyPI & npm) | ⚡ {saved_label} Tokens Saved\n⭐ Current Stars: {stars} / {target_stars} Goal (Progress: {pct_int}%)",
|
|
6399
6567
|
font=("Segoe UI", 9, "bold"),
|
|
6400
6568
|
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6401
6569
|
bg=PALETTE["card_bg"],
|
|
@@ -6414,19 +6582,19 @@ class AutoReadmeGUI:
|
|
|
6414
6582
|
def _build_star_msg(cur_s: int, tgt_s: int) -> str:
|
|
6415
6583
|
if first_launch:
|
|
6416
6584
|
return (
|
|
6417
|
-
"
|
|
6418
|
-
"
|
|
6419
|
-
"
|
|
6420
|
-
"
|
|
6421
|
-
f"
|
|
6422
|
-
"
|
|
6585
|
+
"Hello! I'm Toprak Ahmet Aydoğmuş (Siber Akademi).\n"
|
|
6586
|
+
"Our GitHub repository just opened in your browser because you launched T-Zero!\n\n"
|
|
6587
|
+
"To help keep this project independent and 100% FREE for everyone,\n"
|
|
6588
|
+
"please click the ★ STAR button in the top-right corner of the GitHub page\n"
|
|
6589
|
+
f"to support our work! ⭐ ({tgt_s} Stars Goal: {cur_s}/{tgt_s})\n\n"
|
|
6590
|
+
"Your star makes a huge difference in helping more developers discover T-Zero!"
|
|
6423
6591
|
)
|
|
6424
6592
|
return (
|
|
6425
|
-
"
|
|
6426
|
-
"T-Zero
|
|
6427
|
-
"
|
|
6428
|
-
"
|
|
6429
|
-
"
|
|
6593
|
+
"Hello! I'm Toprak Ahmet Aydoğmuş (Siber Akademi).\n"
|
|
6594
|
+
"I built T-Zero from scratch to eliminate token costs and context bloat\n"
|
|
6595
|
+
"in AI coding tools, and I provide it 100% FREE to everyone.\n\n"
|
|
6596
|
+
"To keep our project independent and help it reach more developers,\n"
|
|
6597
|
+
"a SINGLE STAR on our GitHub repository makes a massive difference!"
|
|
6430
6598
|
)
|
|
6431
6599
|
|
|
6432
6600
|
msg = _build_star_msg(stars, target_stars)
|
|
@@ -6460,11 +6628,11 @@ class AutoReadmeGUI:
|
|
|
6460
6628
|
except Exception:
|
|
6461
6629
|
pass
|
|
6462
6630
|
dialog.destroy()
|
|
6463
|
-
self.show_toast("⭐
|
|
6631
|
+
self.show_toast("⭐ You're awesome! Thank you so much for your star!", "success")
|
|
6464
6632
|
except Exception:
|
|
6465
6633
|
pass
|
|
6466
6634
|
|
|
6467
|
-
btn_txt = "⭐
|
|
6635
|
+
btn_txt = "⭐ STAR ON GITHUB REPO (OPENED)" if first_launch else "⭐ 1-CLICK STAR ON GITHUB"
|
|
6468
6636
|
star_btn = CanvasPillButton(
|
|
6469
6637
|
pad,
|
|
6470
6638
|
text=btn_txt,
|
|
@@ -6493,7 +6661,7 @@ class AutoReadmeGUI:
|
|
|
6493
6661
|
|
|
6494
6662
|
tk.Button(
|
|
6495
6663
|
b_row,
|
|
6496
|
-
text="
|
|
6664
|
+
text="Remind Me Later",
|
|
6497
6665
|
font=("Segoe UI", 8),
|
|
6498
6666
|
bg=PALETTE["bg_start"],
|
|
6499
6667
|
fg=PALETTE["text_muted"],
|
|
@@ -6504,7 +6672,7 @@ class AutoReadmeGUI:
|
|
|
6504
6672
|
|
|
6505
6673
|
tk.Button(
|
|
6506
6674
|
b_row,
|
|
6507
|
-
text="
|
|
6675
|
+
text="Don't Show Again",
|
|
6508
6676
|
font=("Segoe UI", 8),
|
|
6509
6677
|
bg=PALETTE["bg_start"],
|
|
6510
6678
|
fg=PALETTE["text_muted"],
|
|
@@ -7655,7 +7823,7 @@ class AutoReadmeGUI:
|
|
|
7655
7823
|
self.gen_progress["value"] = 100
|
|
7656
7824
|
self.gen_status_lbl.config(text="Dry run complete! 100% Free & Zero-Leak context generated.")
|
|
7657
7825
|
self.log("Offline AST context tree synthesized successfully.")
|
|
7658
|
-
self.show_toast("⚡
|
|
7826
|
+
self.show_toast("⚡ Local Offline AST Context (100% Free & Zero-Leak) compiled successfully!", "success")
|
|
7659
7827
|
|
|
7660
7828
|
def start_generation(self):
|
|
7661
7829
|
url = self.api_url_entry.get().strip()
|
|
@@ -7748,32 +7916,21 @@ Custom Requirements:
|
|
|
7748
7916
|
generator = ContextGenerator(self.cancel_event)
|
|
7749
7917
|
target_dir = self.dir_entry.get().strip() or os.getcwd()
|
|
7750
7918
|
|
|
7751
|
-
# If commercial provider has no key at all,
|
|
7752
|
-
if not key and p.name
|
|
7753
|
-
self.log(
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
free_headers = free_p.get_headers("")
|
|
7919
|
+
# If commercial provider has no key at all, stay strictly local via the AST engine (no cloud fallback)
|
|
7920
|
+
if not key and p.name != "Local Ollama":
|
|
7921
|
+
self.log(
|
|
7922
|
+
f"No external API key configured ({provider_name}). Running Local Offline AST Engine with zero outbound telemetry..."
|
|
7923
|
+
)
|
|
7757
7924
|
try:
|
|
7758
|
-
content = generator.generate_readme(
|
|
7759
|
-
free_url, "", free_headers, "openai", messages, update_prog, provider=free_p, timeout=12
|
|
7760
|
-
)
|
|
7761
|
-
self.log("Canlı AI mimari analizi Ücretsiz Siber AI Cloud ile başarıyla üretildi.")
|
|
7762
|
-
self.safe_after(0, lambda: self.on_gen_success(content))
|
|
7763
|
-
self.safe_after(0, lambda: self.show_toast(
|
|
7764
|
-
"⚡ API anahtarı gerekmeden Ücretsiz Siber AI Cloud ile canlı bağlam üretildi!",
|
|
7765
|
-
"info"
|
|
7766
|
-
))
|
|
7767
|
-
return
|
|
7768
|
-
except Exception as free_err:
|
|
7769
|
-
self.log(f"Ücretsiz Bulut yanıt vermedi ({free_err}). Yerel Çevrimdışı AST Motoru (%100 Ücretsiz & Sıfır Sızıntı) çalıştırılıyor...")
|
|
7770
7925
|
offline_content = generate_offline_context(target_dir, selected_files, self.file_snippets)
|
|
7771
7926
|
self.safe_after(0, lambda: self.on_gen_success(offline_content))
|
|
7772
7927
|
self.safe_after(0, lambda: self.show_toast(
|
|
7773
|
-
"⚡
|
|
7928
|
+
"⚡ Complete context compiled cleanly with Local Offline AST Engine (no API key needed)!",
|
|
7774
7929
|
"success"
|
|
7775
7930
|
))
|
|
7776
|
-
|
|
7931
|
+
except Exception as offline_err:
|
|
7932
|
+
self.safe_after(0, lambda msg=f"Offline Error: {offline_err}": self.on_gen_fail(msg))
|
|
7933
|
+
return
|
|
7777
7934
|
|
|
7778
7935
|
headers = p.get_headers(key)
|
|
7779
7936
|
try:
|
|
@@ -7787,39 +7944,22 @@ Custom Requirements:
|
|
|
7787
7944
|
else:
|
|
7788
7945
|
raw_err = str(e)
|
|
7789
7946
|
clean_err = re.sub(r'(Bearer\s+|key[:=]\s*)[A-Za-z0-9_\-\.]{8,}', r'\1[PROTECTED]', raw_err)
|
|
7790
|
-
self.log(f"
|
|
7791
|
-
self.log("
|
|
7792
|
-
try:
|
|
7793
|
-
free_p = FreePollinationsProvider()
|
|
7794
|
-
free_url = f"{free_p.get_base_url().rstrip('/')}/chat/completions"
|
|
7795
|
-
free_headers = free_p.get_headers("")
|
|
7796
|
-
content = generator.generate_readme(
|
|
7797
|
-
free_url, "", free_headers, "openai", messages, update_prog, provider=free_p, timeout=12
|
|
7798
|
-
)
|
|
7799
|
-
self.log("Canlı AI mimari analizi Ücretsiz Siber AI Cloud ile başarıyla tamamlandı.")
|
|
7800
|
-
self.safe_after(0, lambda: self.on_gen_success(content))
|
|
7801
|
-
self.safe_after(0, lambda: self.show_toast(
|
|
7802
|
-
"⚡ Harici API bağlantısı yerine Ücretsiz Siber AI Cloud ile canlı bağlam üretildi!",
|
|
7803
|
-
"info"
|
|
7804
|
-
))
|
|
7805
|
-
return
|
|
7806
|
-
except Exception as free_err:
|
|
7807
|
-
clean_free_err = re.sub(r'(Bearer\s+|key[:=]\s*)[A-Za-z0-9_\-\.]{8,}', r'\1[PROTECTED]', str(free_err))
|
|
7808
|
-
self.log(f"Ücretsiz Bulut yanıt vermedi ({clean_free_err}). Yerel Çevrimdışı AST Motoru devrede (%100 Free & Sıfır Sızıntı)...")
|
|
7947
|
+
self.log(f"Remote API response: {clean_err}")
|
|
7948
|
+
self.log("Activating Local Offline AST Engine without redirecting to any external cloud provider...")
|
|
7809
7949
|
|
|
7810
7950
|
try:
|
|
7811
7951
|
offline_content = generate_offline_context(target_dir, selected_files, self.file_snippets)
|
|
7812
7952
|
self.safe_after(0, lambda: self.on_gen_success(offline_content))
|
|
7813
7953
|
if "401" in raw_err:
|
|
7814
|
-
warn_reason = "
|
|
7954
|
+
warn_reason = "Remote API 401 authorization error (invalid or expired key)"
|
|
7815
7955
|
elif "403" in raw_err:
|
|
7816
|
-
warn_reason = "
|
|
7956
|
+
warn_reason = "Remote API 403 authorization error"
|
|
7817
7957
|
elif "500" in raw_err:
|
|
7818
|
-
warn_reason = "
|
|
7958
|
+
warn_reason = "Remote API server error (HTTP 500)"
|
|
7819
7959
|
else:
|
|
7820
|
-
warn_reason = "
|
|
7960
|
+
warn_reason = "Remote API connection issue"
|
|
7821
7961
|
self.safe_after(0, lambda: self.show_toast(
|
|
7822
|
-
f"⚡
|
|
7962
|
+
f"⚡ Synthesized complete context via T-Zero Local Offline AST Engine due to {warn_reason}!",
|
|
7823
7963
|
"info"
|
|
7824
7964
|
))
|
|
7825
7965
|
except Exception as offline_err:
|
|
@@ -7858,9 +7998,9 @@ Custom Requirements:
|
|
|
7858
7998
|
err_str = str(err)
|
|
7859
7999
|
detail = f"Failed: {err_str}"
|
|
7860
8000
|
if "403" in err_str or "Authorization failed" in err_str:
|
|
7861
|
-
detail += "\n\n💡
|
|
8001
|
+
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."
|
|
7862
8002
|
elif "410" in err_str or "end of life" in err_str:
|
|
7863
|
-
detail += "\n\n💡
|
|
8003
|
+
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."
|
|
7864
8004
|
messagebox.showerror("Error", detail)
|
|
7865
8005
|
|
|
7866
8006
|
def copy_clipboard(self):
|
|
@@ -7988,11 +8128,11 @@ Custom Requirements:
|
|
|
7988
8128
|
|
|
7989
8129
|
def _on_arch_export_done(self, out_path: str, use_ai: bool):
|
|
7990
8130
|
play_sfx("success")
|
|
7991
|
-
mode_str = "
|
|
7992
|
-
self.show_toast(f"ARCHITECTURE.md
|
|
8131
|
+
mode_str = "Live 3rd-Party AI Engine" if use_ai else "T-Zero Local Offline AST Engine"
|
|
8132
|
+
self.show_toast(f"ARCHITECTURE.md generated successfully! ({mode_str})", "success")
|
|
7993
8133
|
self.log(f"ARCHITECTURE.md exported ({mode_str}): {out_path}")
|
|
7994
8134
|
self.gen_progress["value"] = 100
|
|
7995
|
-
self.gen_status_lbl.config(text=f"ARCHITECTURE.md
|
|
8135
|
+
self.gen_status_lbl.config(text=f"ARCHITECTURE.md ready ({mode_str})")
|
|
7996
8136
|
|
|
7997
8137
|
def _on_arch_export_error(self, err_msg: str):
|
|
7998
8138
|
play_sfx("error")
|
|
@@ -8399,9 +8539,9 @@ Custom Requirements:
|
|
|
8399
8539
|
try:
|
|
8400
8540
|
if dlg and dlg.winfo_exists():
|
|
8401
8541
|
if not w.get("first_launch"):
|
|
8402
|
-
w["hdr_lbl"].config(text=f"⭐ {target_stars}
|
|
8542
|
+
w["hdr_lbl"].config(text=f"⭐ {target_stars} STARS GOAL: JOIN THE COMMUNITY!")
|
|
8403
8543
|
w["stats_lbl"].config(
|
|
8404
|
-
text=f"🚀 {dl_label}
|
|
8544
|
+
text=f"🚀 {dl_label} Downloads (PyPI & npm) | ⚡ {saved_label} Tokens Saved\n⭐ Current Stars: {stars} / {target_stars} Goal (Progress: {pct_int}%)"
|
|
8405
8545
|
)
|
|
8406
8546
|
w["bar_fill"].place_configure(relwidth=pct_ratio)
|
|
8407
8547
|
w["msg_lbl"].config(text=w["build_msg"](stars, target_stars))
|
|
@@ -9434,7 +9574,7 @@ def main():
|
|
|
9434
9574
|
extra_args = sys.argv[2:]
|
|
9435
9575
|
if any(flag in ("-h", "--help") for flag in extra_args):
|
|
9436
9576
|
print("Usage: tzero armor [TARGET_PATH] [--audit]")
|
|
9437
|
-
print(" Protect source files against AI reverse engineering (
|
|
9577
|
+
print(" Protect source files against AI reverse engineering (180-Tier TDQS-REA Armor).")
|
|
9438
9578
|
print(" --audit, -a Audit AI decompilation resistance without modifying files.")
|
|
9439
9579
|
sys.exit(0)
|
|
9440
9580
|
target_path = next((a for a in extra_args if not a.startswith("-")), ".")
|
|
@@ -9453,7 +9593,8 @@ def main():
|
|
|
9453
9593
|
if res.get("success"):
|
|
9454
9594
|
print(f"[OK] Applied Anti-REA Armor to: {target_path}")
|
|
9455
9595
|
if "score_after" in res:
|
|
9456
|
-
print(f" AI Resistance Score: {res.get('score_before')}/100 -> {res.get('score_after')}/100 [{res.get('rating')}]")
|
|
9596
|
+
print(f" AI Resistance Score: {res.get('score_before')}/100 -> {res.get('score_after')}/100 [{res.get('tier_rating', res.get('rating'))}]")
|
|
9597
|
+
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)")
|
|
9457
9598
|
elif "files_protected" in res:
|
|
9458
9599
|
print(f" Protected {res['files_protected']} files in directory.")
|
|
9459
9600
|
else:
|
|
@@ -9472,7 +9613,9 @@ def main():
|
|
|
9472
9613
|
print(" SHIELD AUDIT REPORT: AI REVERSE-ENGINEERING RESISTANCE (TDQS-REA)")
|
|
9473
9614
|
print("================================================================================")
|
|
9474
9615
|
print(f"Target: {target_path}")
|
|
9475
|
-
print(f"AI Score: {audit.get('score', 0)} / 100 [{audit.get('rating', 'UNVERIFIED')}]")
|
|
9616
|
+
print(f"AI Score: {audit.get('score', 0)} / 100 [{audit.get('tier_rating', audit.get('rating', 'UNVERIFIED'))}]")
|
|
9617
|
+
if "tiers_total" in audit:
|
|
9618
|
+
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)")
|
|
9476
9619
|
print(f"Score Basis: {audit.get('score_kind', 'static_textual_indicator')}")
|
|
9477
9620
|
print(f"Status: {audit.get('status', 'N/A')}")
|
|
9478
9621
|
if audit.get("defenses_active"):
|
|
@@ -9621,7 +9764,7 @@ def main():
|
|
|
9621
9764
|
default="o200k_base", help="BPE encoding for --symbol-context")
|
|
9622
9765
|
parser.add_argument("--cache-aligned", action="store_true", help="Order context for KV-cache prefix stability (immutable static prefix before dynamic query suffix)")
|
|
9623
9766
|
parser.add_argument("--commit-msg", action="store_true", help="Generate Conventional Commit message from local AST git diff ($0 local engine)")
|
|
9624
|
-
parser.add_argument("--changelog", nargs="?", const="v12.
|
|
9767
|
+
parser.add_argument("--changelog", nargs="?", const="v12.3.2", default=None, metavar="VERSION", help="Generate release CHANGELOG markdown from git history")
|
|
9625
9768
|
parser.add_argument("--ci", choices=["github", "gitlab", "pre-commit", "local", "all"], default=None, help="Install CI/CD workflow or run local verification suite")
|
|
9626
9769
|
parser.add_argument("--local-ci", action="store_true", help="Run comprehensive Local CI & Pre-Push verification battery ($0 quota burn)")
|
|
9627
9770
|
parser.add_argument("--quick-ci", action="store_true", help="Run fast Local CI smoke checks in seconds")
|
|
@@ -9685,7 +9828,7 @@ def main():
|
|
|
9685
9828
|
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")
|
|
9686
9829
|
parser.add_argument("--showcase", nargs="?", const="tzero_showcase.html", default=None, metavar="FILE", help="Generate interactive split-screen HTML5 comparison showcase slider")
|
|
9687
9830
|
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")
|
|
9688
|
-
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v12.
|
|
9831
|
+
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v12.3.2 Master Edition (engine v4.1.0)")
|
|
9689
9832
|
|
|
9690
9833
|
|
|
9691
9834
|
def print_master_tutorial():
|
|
@@ -9794,7 +9937,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9794
9937
|
def print_quickstart_guide():
|
|
9795
9938
|
print("""
|
|
9796
9939
|
================================================================================
|
|
9797
|
-
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.
|
|
9940
|
+
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.3.2 MASTER (engine v4.1.0)
|
|
9798
9941
|
================================================================================
|
|
9799
9942
|
🎯 %95'e Varan Token Tasarrufu & Otonom Yapay Zeka Mimari Bağlam Motoru
|
|
9800
9943
|
|
|
@@ -9972,7 +10115,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9972
10115
|
if os.name == "nt":
|
|
9973
10116
|
try:
|
|
9974
10117
|
import ctypes
|
|
9975
|
-
ctypes.windll.user32.MessageBoxW(0, f"T-Zero GUI
|
|
10118
|
+
ctypes.windll.user32.MessageBoxW(0, f"T-Zero GUI Launch Error:\n\n{e}", "T-Zero Critical Error", 0x10)
|
|
9976
10119
|
except Exception:
|
|
9977
10120
|
pass
|
|
9978
10121
|
print(f"[FATAL ERROR] Could not launch GUI: {e}")
|
|
@@ -10773,7 +10916,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10773
10916
|
if not os.path.exists(app_path):
|
|
10774
10917
|
app_path = os.path.join(os.getcwd(), "huggingface-space", "app.py")
|
|
10775
10918
|
print("\033[36m" + "=" * 80)
|
|
10776
|
-
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.
|
|
10919
|
+
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.3.2)")
|
|
10777
10920
|
print("=" * 80 + "\033[0m")
|
|
10778
10921
|
print("🌐 Official Live Space : https://huggingface.co/spaces/toprakke4/tzero-token-reducer")
|
|
10779
10922
|
print(f"📁 Local Application : {app_path}")
|