tzero-mcp 12.3.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/package.json +1 -1
- package/src/addmcp.py +2 -2
- package/src/app.py +1 -1
- package/src/tzero/__init__.py +1 -1
- package/src/tzero/tzero_armor.py +1 -1
- 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_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_lsp.py +1 -1
- package/src/tzero/tzero_mcp.py +21 -3
- package/src/tzero/tzero_promo.py +1 -1
- package/src/tzero/tzero_task_benchmark.py +2 -2
- package/src/tzero/tzero_traffic.py +1 -1
- package/src/tzero/tzero_tui.py +2 -2
- package/src/tzero/tzero_v3.py +378 -206
- package/src/tzero/tzero_welcome.py +1 -1
package/src/tzero/tzero_v3.py
CHANGED
|
@@ -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
|
|
|
@@ -3274,13 +3274,13 @@ class CanvasPillButton(tk.Canvas):
|
|
|
3274
3274
|
|
|
3275
3275
|
class KPICard(LuxuryCard):
|
|
3276
3276
|
"""Executive KPI card showing primary upward metric and secondary compression delta."""
|
|
3277
|
-
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):
|
|
3278
3278
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3279
3279
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3280
3280
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
3281
3281
|
self.lbl_title = tk.Label(top, text=title, font=("Segoe UI", 9, "bold"), fg=PALETTE.get("text_muted", "#64748b"), bg=self.card_bg)
|
|
3282
3282
|
self.lbl_title.pack(side=tk.LEFT)
|
|
3283
|
-
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)
|
|
3284
3284
|
self.pill_period.pack(side=tk.RIGHT)
|
|
3285
3285
|
|
|
3286
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)
|
|
@@ -3332,7 +3332,7 @@ class ScrollableGlassPanel(tk.Frame):
|
|
|
3332
3332
|
|
|
3333
3333
|
class MiniCalendarCard(LuxuryCard):
|
|
3334
3334
|
"""Mini executive activity calendar card with active audit date rings."""
|
|
3335
|
-
def __init__(self, parent, month_title="
|
|
3335
|
+
def __init__(self, parent, month_title="Nov 2026", active_days=(14, 25, 28), **kwargs):
|
|
3336
3336
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3337
3337
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3338
3338
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
@@ -3343,7 +3343,7 @@ class MiniCalendarCard(LuxuryCard):
|
|
|
3343
3343
|
|
|
3344
3344
|
grid = tk.Frame(self.inner, bg=self.card_bg)
|
|
3345
3345
|
grid.pack(fill=tk.BOTH, expand=True)
|
|
3346
|
-
headers = ["
|
|
3346
|
+
headers = ["mo", "tu", "we", "th", "fr", "sa", "su"]
|
|
3347
3347
|
for col, h in enumerate(headers):
|
|
3348
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)
|
|
3349
3349
|
active_set = set(active_days)
|
|
@@ -3361,7 +3361,7 @@ class MiniCalendarCard(LuxuryCard):
|
|
|
3361
3361
|
|
|
3362
3362
|
class CircularGaugeCard(LuxuryCard):
|
|
3363
3363
|
"""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="⚡
|
|
3364
|
+
def __init__(self, parent, title="Optimization Score", subtitle="T-Zero context efficiency", percentage=75, action_text="⚡ QUICK OPTIMIZE", action_cmd=None, **kwargs):
|
|
3365
3365
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3366
3366
|
self.percentage = percentage
|
|
3367
3367
|
self.action_cmd = action_cmd
|
|
@@ -3397,7 +3397,7 @@ class CircularGaugeCard(LuxuryCard):
|
|
|
3397
3397
|
|
|
3398
3398
|
class WaveSplineChart(LuxuryCard):
|
|
3399
3399
|
"""Smooth dual-wave spline chart with pastel area gradient fills."""
|
|
3400
|
-
def __init__(self, parent, title="AST Token
|
|
3400
|
+
def __init__(self, parent, title="AST Token Frequency", **kwargs):
|
|
3401
3401
|
super().__init__(parent, radius=18, padding=10, **kwargs)
|
|
3402
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))
|
|
3403
3403
|
self.chart_canvas = tk.Canvas(self.inner, height=115, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3448,12 +3448,12 @@ class WaveSplineChart(LuxuryCard):
|
|
|
3448
3448
|
|
|
3449
3449
|
class WideSplineChartCard(LuxuryCard):
|
|
3450
3450
|
"""Wide executive Bézier spline chart showing AST vs Compressed token consumption trend."""
|
|
3451
|
-
def __init__(self, parent, title="Model Token
|
|
3451
|
+
def __init__(self, parent, title="Model Token Consumption Trend", **kwargs):
|
|
3452
3452
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3453
3453
|
top = tk.Frame(self.inner, bg=self.card_bg)
|
|
3454
3454
|
top.pack(fill=tk.X, pady=(0, 4))
|
|
3455
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)
|
|
3456
|
-
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)
|
|
3457
3457
|
pill.pack(side=tk.RIGHT)
|
|
3458
3458
|
|
|
3459
3459
|
self.c = tk.Canvas(self.inner, height=140, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3479,8 +3479,8 @@ class WideSplineChartCard(LuxuryCard):
|
|
|
3479
3479
|
|
|
3480
3480
|
leg = tk.Frame(self.inner, bg=self.card_bg)
|
|
3481
3481
|
leg.pack(pady=(4, 0))
|
|
3482
|
-
tk.Label(leg, text="●
|
|
3483
|
-
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)
|
|
3484
3484
|
|
|
3485
3485
|
def _draw(self, event=None):
|
|
3486
3486
|
w = max(20, self.c.winfo_width())
|
|
@@ -3513,7 +3513,7 @@ class WideSplineChartCard(LuxuryCard):
|
|
|
3513
3513
|
|
|
3514
3514
|
class MonthlyStackedBarCard(LuxuryCard):
|
|
3515
3515
|
"""Horizontal stacked bar chart for monthly token reduction stats."""
|
|
3516
|
-
def __init__(self, parent, title="
|
|
3516
|
+
def __init__(self, parent, title="Monthly Token Savings", **kwargs):
|
|
3517
3517
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3518
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))
|
|
3519
3519
|
self.c = tk.Canvas(self.inner, height=110, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3540,7 +3540,7 @@ class MonthlyStackedBarCard(LuxuryCard):
|
|
|
3540
3540
|
def _draw(self, event=None):
|
|
3541
3541
|
w = max(20, self.c.winfo_width())
|
|
3542
3542
|
self.c.delete("all")
|
|
3543
|
-
months = ["
|
|
3543
|
+
months = ["OCT", "NOV", "DEC", "JAN"]
|
|
3544
3544
|
ratios = [0.75, 0.55, 0.85, 0.65]
|
|
3545
3545
|
bar_h = 10
|
|
3546
3546
|
spacing = 24
|
|
@@ -3556,7 +3556,7 @@ class MonthlyStackedBarCard(LuxuryCard):
|
|
|
3556
3556
|
|
|
3557
3557
|
class GroupedVerticalBarCard(LuxuryCard):
|
|
3558
3558
|
"""Grouped dual-color vertical bar chart for daily token and audit activity."""
|
|
3559
|
-
def __init__(self, parent, title="
|
|
3559
|
+
def __init__(self, parent, title="Daily Activity & Audits", **kwargs):
|
|
3560
3560
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3561
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))
|
|
3562
3562
|
self.c = tk.Canvas(self.inner, height=110, bg=self.card_bg, highlightthickness=0)
|
|
@@ -3584,7 +3584,7 @@ class GroupedVerticalBarCard(LuxuryCard):
|
|
|
3584
3584
|
w = max(20, self.c.winfo_width())
|
|
3585
3585
|
h = max(20, self.c.winfo_height())
|
|
3586
3586
|
self.c.delete("all")
|
|
3587
|
-
days = ["
|
|
3587
|
+
days = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
|
|
3588
3588
|
slot_w = w / len(days)
|
|
3589
3589
|
base_y = h - 16
|
|
3590
3590
|
heights = [(40, 20), (55, 32), (30, 48), (65, 42), (75, 55), (45, 25), (35, 18)]
|
|
@@ -3606,11 +3606,11 @@ class SecurityHubCard(LuxuryCard):
|
|
|
3606
3606
|
"""Siber Akademi security badge & quick audit / Anti-REA launcher card."""
|
|
3607
3607
|
def __init__(self, parent, action_cmd=None, armor_cmd=None, **kwargs):
|
|
3608
3608
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3609
|
-
tk.Label(self.inner, text="🛡 SİBER AKADEMİ
|
|
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
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))
|
|
3611
3611
|
btn_row = tk.Frame(self.inner, bg=self.card_bg)
|
|
3612
3612
|
btn_row.pack(fill=tk.X)
|
|
3613
|
-
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"))
|
|
3614
3614
|
self.btn.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 3))
|
|
3615
3615
|
if armor_cmd is not None:
|
|
3616
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")
|
|
@@ -4155,19 +4155,19 @@ class NodeGraphCanvas(tk.Canvas):
|
|
|
4155
4155
|
hud_box_w = 460
|
|
4156
4156
|
self.create_rectangle(14, 12, 14 + hud_box_w, 56, fill=card_bg, outline="#1e293b", width=1)
|
|
4157
4157
|
scale_pct = int(self.scale_factor * 100)
|
|
4158
|
-
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"
|
|
4159
4159
|
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="🖱️
|
|
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))
|
|
4161
4161
|
|
|
4162
4162
|
# 6. Top-Right Floating Control Toolbar (Zoom +, Zoom -, Reset, Fit, Maximize)
|
|
4163
4163
|
self.hud_buttons = []
|
|
4164
4164
|
is_max = getattr(self, "is_fullscreen", False)
|
|
4165
4165
|
btn_defs = [
|
|
4166
|
-
("plus", "+", "
|
|
4167
|
-
("minus", "-", "
|
|
4168
|
-
("reset", "100%", "
|
|
4169
|
-
("fit", "⛶", "
|
|
4170
|
-
("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),
|
|
4171
4171
|
]
|
|
4172
4172
|
btn_w, btn_h, gap = 38, 30, 6
|
|
4173
4173
|
total_bar_w = len(btn_defs) * (btn_w + gap) - gap + 16
|
|
@@ -4193,9 +4193,9 @@ class NodeGraphCanvas(tk.Canvas):
|
|
|
4193
4193
|
node_deg = sum(1 for (s, e) in self.links if s == active_id or e == active_id)
|
|
4194
4194
|
info_h = 32
|
|
4195
4195
|
info_y = h - info_h - 14
|
|
4196
|
-
info_text = f"
|
|
4196
|
+
info_text = f"NODE: {active_node['label']} | TYPE: {active_node['type'].upper()} | LINKS: {node_deg}"
|
|
4197
4197
|
if "full_path" in active_node:
|
|
4198
|
-
info_text += f" |
|
|
4198
|
+
info_text += f" | PATH: {active_node['full_path']}"
|
|
4199
4199
|
info_w = min(w - 28, max(280, len(info_text) * 6.5 + 26))
|
|
4200
4200
|
self.create_rectangle(14, info_y, 14 + info_w, info_y + info_h, fill=card_bg, outline=accent_cyan, width=1)
|
|
4201
4201
|
self.create_text(24, info_y + info_h / 2, text=info_text, anchor="w", fill=text_main, font=("Segoe UI", 8, "bold"))
|
|
@@ -4435,7 +4435,7 @@ class AdvancedTokenDistributionChart(tk.Canvas):
|
|
|
4435
4435
|
self.delete("all")
|
|
4436
4436
|
w, h = max(280, self.winfo_width()), max(120, self.winfo_height())
|
|
4437
4437
|
if not self.stats:
|
|
4438
|
-
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))
|
|
4439
4439
|
return
|
|
4440
4440
|
|
|
4441
4441
|
colors = [PALETTE["accent_cyan"], PALETTE["accent_purple"], PALETTE["accent_green"], PALETTE.get("accent_coral", "#f59e0b"), "#10b981", "#3b82f6"]
|
|
@@ -4599,10 +4599,48 @@ class PygmentsHighlighter:
|
|
|
4599
4599
|
|
|
4600
4600
|
# --- 13. DYNAMIC UI DASHBOARD MAIN WINDOW ---
|
|
4601
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
|
+
|
|
4602
4640
|
class AutoReadmeGUI:
|
|
4603
4641
|
def __init__(self, root: tk.Tk):
|
|
4604
4642
|
self.root = root
|
|
4605
|
-
self.lang =
|
|
4643
|
+
self.lang = "en"
|
|
4606
4644
|
|
|
4607
4645
|
# State parameters
|
|
4608
4646
|
self.scanned_files: List[str] = []
|
|
@@ -4677,7 +4715,56 @@ class AutoReadmeGUI:
|
|
|
4677
4715
|
self.setup_keyboard_shortcuts()
|
|
4678
4716
|
self.start_system_telemetry()
|
|
4679
4717
|
self.start_community_stats_refresh()
|
|
4680
|
-
|
|
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
|
|
4681
4768
|
|
|
4682
4769
|
def safe_after(self, ms: int, func, *args):
|
|
4683
4770
|
"""Thread-safe and lifecycle-safe wrapper around root.after."""
|
|
@@ -4748,6 +4835,7 @@ class AutoReadmeGUI:
|
|
|
4748
4835
|
b.configure(bg=sidebar_bg)
|
|
4749
4836
|
btn.bind("<Enter>", on_enter)
|
|
4750
4837
|
btn.bind("<Leave>", on_leave)
|
|
4838
|
+
self._attach_tooltip(btn, get_text(key, self.lang))
|
|
4751
4839
|
|
|
4752
4840
|
self.tab_buttons.append(btn)
|
|
4753
4841
|
self.tab_containers.append(cont)
|
|
@@ -4757,16 +4845,17 @@ class AutoReadmeGUI:
|
|
|
4757
4845
|
spacer.pack(fill=tk.BOTH, expand=True)
|
|
4758
4846
|
|
|
4759
4847
|
# 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)
|
|
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),
|
|
4766
4854
|
]:
|
|
4767
4855
|
lbl = tk.Label(self.sidebar, text=icon_char, font=("Segoe UI Emoji", 12), fg=sidebar_muted, bg=sidebar_bg, cursor="hand2")
|
|
4768
4856
|
lbl.pack(pady=3)
|
|
4769
4857
|
lbl.bind("<Button-1>", lambda e, h=cmd_handler: h())
|
|
4858
|
+
self._attach_tooltip(lbl, tip_text)
|
|
4770
4859
|
|
|
4771
4860
|
tk.Label(self.sidebar, text="●", font=("Segoe UI", 8, "bold"), fg=PALETTE["success"], bg=sidebar_bg).pack(pady=(4, 10))
|
|
4772
4861
|
|
|
@@ -4848,17 +4937,31 @@ class AutoReadmeGUI:
|
|
|
4848
4937
|
|
|
4849
4938
|
self.web_console_btn = CanvasPillButton(
|
|
4850
4939
|
header_controls,
|
|
4851
|
-
text="🌐 WEB
|
|
4940
|
+
text="🌐 WEB CONSOLE",
|
|
4852
4941
|
command=self.open_web_console,
|
|
4853
4942
|
height=28,
|
|
4854
4943
|
radius=14,
|
|
4855
4944
|
bg_color=PALETTE["card_border"],
|
|
4856
4945
|
text_color=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
4857
4946
|
font=("Segoe UI", 7, "bold"),
|
|
4858
|
-
width=
|
|
4947
|
+
width=112
|
|
4859
4948
|
)
|
|
4860
4949
|
self.web_console_btn.pack(side=tk.LEFT, padx=3)
|
|
4861
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
|
+
|
|
4862
4965
|
self.star_header_btn = CanvasPillButton(
|
|
4863
4966
|
header_controls,
|
|
4864
4967
|
text=f"★ STAR ({self.community_stats['stars']}★)",
|
|
@@ -4892,11 +4995,11 @@ class AutoReadmeGUI:
|
|
|
4892
4995
|
s_pill_bot = tk.Frame(self.status_bar, bg=PALETTE["card_bg"], highlightthickness=1, highlightbackground=PALETTE["card_border"])
|
|
4893
4996
|
s_pill_bot.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
4894
4997
|
|
|
4895
|
-
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)
|
|
4896
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"])
|
|
4897
5000
|
self.status_bar_lbl.pack(side=tk.LEFT, pady=2)
|
|
4898
5001
|
|
|
4899
|
-
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")
|
|
4900
5003
|
self.status_toggle_lbl.pack(side=tk.RIGHT, padx=8, pady=2)
|
|
4901
5004
|
self.status_toggle_lbl.bind("<Button-1>", lambda e: self.toggle_console_drawer())
|
|
4902
5005
|
|
|
@@ -4907,7 +5010,7 @@ class AutoReadmeGUI:
|
|
|
4907
5010
|
c_top = tk.Frame(self.console_drawer, bg=PALETTE["card_bg"])
|
|
4908
5011
|
c_top.pack(fill=tk.X, padx=10, pady=4)
|
|
4909
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)
|
|
4910
|
-
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")
|
|
4911
5014
|
close_lbl.pack(side=tk.RIGHT)
|
|
4912
5015
|
close_lbl.bind("<Button-1>", lambda e: self.toggle_console_drawer())
|
|
4913
5016
|
|
|
@@ -4931,13 +5034,13 @@ class AutoReadmeGUI:
|
|
|
4931
5034
|
self.console_drawer.place_forget()
|
|
4932
5035
|
self.console_drawer_visible = False
|
|
4933
5036
|
if hasattr(self, "status_toggle_lbl"):
|
|
4934
|
-
self.status_toggle_lbl.config(text="▲
|
|
5037
|
+
self.status_toggle_lbl.config(text="▲ Show Console")
|
|
4935
5038
|
else:
|
|
4936
5039
|
self.console_drawer.place(x=82, rely=0.68, relwidth=1.0, width=-92, relheight=0.28)
|
|
4937
5040
|
self.console_drawer.lift()
|
|
4938
5041
|
self.console_drawer_visible = True
|
|
4939
5042
|
if hasattr(self, "status_toggle_lbl"):
|
|
4940
|
-
self.status_toggle_lbl.config(text="▼
|
|
5043
|
+
self.status_toggle_lbl.config(text="▼ Hide Console")
|
|
4941
5044
|
|
|
4942
5045
|
def log(self, text: str):
|
|
4943
5046
|
if not hasattr(self, "console_text") or self.console_text is None:
|
|
@@ -4996,7 +5099,7 @@ class AutoReadmeGUI:
|
|
|
4996
5099
|
except Exception:
|
|
4997
5100
|
pass
|
|
4998
5101
|
webbrowser.open(f"http://localhost:{DASHBOARD_PORT}")
|
|
4999
|
-
self.show_toast("T-Zero Web
|
|
5102
|
+
self.show_toast("T-Zero Web Console & Superdesign opened", "success")
|
|
5000
5103
|
except Exception:
|
|
5001
5104
|
webbrowser.open("http://localhost:8421")
|
|
5002
5105
|
|
|
@@ -5110,16 +5213,16 @@ class AutoReadmeGUI:
|
|
|
5110
5213
|
# Audio and status feedback
|
|
5111
5214
|
if leaks_count > 0:
|
|
5112
5215
|
play_sfx("error")
|
|
5113
|
-
self.show_toast(f"🚨 T-001
|
|
5216
|
+
self.show_toast(f"🚨 T-001 ALERT: {leaks_count} leak(s) detected!", "error", 5000)
|
|
5114
5217
|
else:
|
|
5115
5218
|
play_sfx("success")
|
|
5116
|
-
self.show_toast(f"✅ %
|
|
5219
|
+
self.show_toast(f"✅ 100% Zero-Leak Security Clean! ({total_scanned_files} files scanned)", "success", 4000)
|
|
5117
5220
|
|
|
5118
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.")
|
|
5119
5222
|
|
|
5120
5223
|
# Open dedicated Luxury Report Window
|
|
5121
5224
|
dialog = tk.Toplevel(self.root)
|
|
5122
|
-
dialog.title("🛡️ T-Zero
|
|
5225
|
+
dialog.title("🛡️ T-Zero Security & AST Architecture Audit Report")
|
|
5123
5226
|
dialog.geometry("900x620")
|
|
5124
5227
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
5125
5228
|
dialog.transient(self.root)
|
|
@@ -5130,8 +5233,8 @@ class AutoReadmeGUI:
|
|
|
5130
5233
|
# Header Title
|
|
5131
5234
|
hdr = tk.Frame(main_frame, bg=PALETTE["bg_start"])
|
|
5132
5235
|
hdr.pack(fill=tk.X, pady=(0, 12))
|
|
5133
|
-
tk.Label(hdr, text="🛡️ T-ZERO
|
|
5134
|
-
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}"
|
|
5135
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))
|
|
5136
5239
|
|
|
5137
5240
|
# 4 Metric Cards Row (T-001 to T-004)
|
|
@@ -5152,10 +5255,10 @@ class AutoReadmeGUI:
|
|
|
5152
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))
|
|
5153
5256
|
tk.Label(p, text=sub, font=("Segoe UI", 7), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(anchor=tk.W)
|
|
5154
5257
|
|
|
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
|
|
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")
|
|
5159
5262
|
|
|
5160
5263
|
# Treeview Table for Issues
|
|
5161
5264
|
table_frame = GlassCard(main_frame)
|
|
@@ -5165,11 +5268,11 @@ class AutoReadmeGUI:
|
|
|
5165
5268
|
|
|
5166
5269
|
cols = ("Rule", "File", "Line", "Severity", "Message")
|
|
5167
5270
|
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="
|
|
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")
|
|
5173
5276
|
|
|
5174
5277
|
tree.column("Rule", width=85, anchor=tk.CENTER)
|
|
5175
5278
|
tree.column("File", width=220)
|
|
@@ -5187,12 +5290,12 @@ class AutoReadmeGUI:
|
|
|
5187
5290
|
filtered = [i for i in audit_issues if (filter_rule is None or i["rule"] == filter_rule)]
|
|
5188
5291
|
if not filtered:
|
|
5189
5292
|
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", "
|
|
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."))
|
|
5194
5297
|
else:
|
|
5195
|
-
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}."))
|
|
5196
5299
|
else:
|
|
5197
5300
|
for item in filtered:
|
|
5198
5301
|
tree.insert("", "end", values=(item["rule"], item["file"], item["line"], item["severity"], item["msg"]))
|
|
@@ -5206,7 +5309,7 @@ class AutoReadmeGUI:
|
|
|
5206
5309
|
filter_frame = tk.Frame(btm_bar, bg=PALETTE["bg_start"])
|
|
5207
5310
|
filter_frame.pack(side=tk.LEFT)
|
|
5208
5311
|
|
|
5209
|
-
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))
|
|
5210
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)
|
|
5211
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)
|
|
5212
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)
|
|
@@ -5240,7 +5343,7 @@ class AutoReadmeGUI:
|
|
|
5240
5343
|
content = export_markdown_report()
|
|
5241
5344
|
self.root.clipboard_clear()
|
|
5242
5345
|
self.root.clipboard_append(content)
|
|
5243
|
-
self.show_toast("
|
|
5346
|
+
self.show_toast("Report copied to clipboard in Markdown format!", "success")
|
|
5244
5347
|
|
|
5245
5348
|
def save_report():
|
|
5246
5349
|
content = export_markdown_report()
|
|
@@ -5252,11 +5355,11 @@ class AutoReadmeGUI:
|
|
|
5252
5355
|
if out_file:
|
|
5253
5356
|
with open(out_file, "w", encoding="utf-8") as fp:
|
|
5254
5357
|
fp.write(content)
|
|
5255
|
-
self.show_toast("
|
|
5358
|
+
self.show_toast("Audit report saved successfully!", "success")
|
|
5256
5359
|
|
|
5257
|
-
tk.Button(action_frame, text="📋
|
|
5258
|
-
tk.Button(action_frame, text="💾
|
|
5259
|
-
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))
|
|
5260
5363
|
|
|
5261
5364
|
def open_theme_selector(self):
|
|
5262
5365
|
play_sfx("click")
|
|
@@ -5467,7 +5570,7 @@ class AutoReadmeGUI:
|
|
|
5467
5570
|
self.log("⚡ T-Zero Quick Optimization: Pruned non-essential AST nodes. Context compression maximized.")
|
|
5468
5571
|
|
|
5469
5572
|
def toggle_language(self):
|
|
5470
|
-
self.lang = "
|
|
5573
|
+
self.lang = "en"
|
|
5471
5574
|
_config_mgr.get_profile()["language"] = self.lang
|
|
5472
5575
|
_config_mgr.save()
|
|
5473
5576
|
|
|
@@ -5499,7 +5602,8 @@ class AutoReadmeGUI:
|
|
|
5499
5602
|
if hasattr(self, "audit_btn") and self.audit_btn:
|
|
5500
5603
|
self.audit_btn.config(text=get_text("audit_btn", self.lang))
|
|
5501
5604
|
|
|
5502
|
-
self.
|
|
5605
|
+
self.show_toast("Interface language: English (EN)", "info")
|
|
5606
|
+
self.log("Interface language active: EN")
|
|
5503
5607
|
|
|
5504
5608
|
# --- TAB 1: EXECUTIVE 9-CARD OVERVIEW DASHBOARD ---
|
|
5505
5609
|
def setup_tab_setup(self):
|
|
@@ -5540,20 +5644,20 @@ class AutoReadmeGUI:
|
|
|
5540
5644
|
self.quick_card.grid(row=1, column=2, columnspan=2, sticky="nsew", padx=4, pady=4)
|
|
5541
5645
|
q_inner = self.quick_card.inner
|
|
5542
5646
|
|
|
5543
|
-
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))
|
|
5544
5648
|
|
|
5545
|
-
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)
|
|
5546
5650
|
self.provider_var = tk.StringVar(value="NVIDIA NIM")
|
|
5547
5651
|
self.provider_combo = ttk.Combobox(q_inner, textvariable=self.provider_var, values=list(PROVIDERS.keys()), state="readonly")
|
|
5548
5652
|
self.provider_combo.pack(fill=tk.X, ipady=1, pady=(1, 4))
|
|
5549
5653
|
self.provider_combo.bind("<<ComboboxSelected>>", self.on_provider_select)
|
|
5550
5654
|
|
|
5551
|
-
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)
|
|
5552
5656
|
self.model_var = tk.StringVar()
|
|
5553
5657
|
self.model_combo = ttk.Combobox(q_inner, textvariable=self.model_var, state="readonly")
|
|
5554
5658
|
self.model_combo.pack(fill=tk.X, ipady=1, pady=(1, 4))
|
|
5555
5659
|
|
|
5556
|
-
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)
|
|
5557
5661
|
dir_frame = tk.Frame(q_inner, bg=self.quick_card.card_bg)
|
|
5558
5662
|
dir_frame.pack(fill=tk.X, pady=(1, 6))
|
|
5559
5663
|
|
|
@@ -5571,7 +5675,7 @@ class AutoReadmeGUI:
|
|
|
5571
5675
|
|
|
5572
5676
|
self.browse_btn = apply_modern_hover(tk.Button(
|
|
5573
5677
|
dir_frame,
|
|
5574
|
-
text="
|
|
5678
|
+
text="Browse...",
|
|
5575
5679
|
bg=PALETTE["card_border"],
|
|
5576
5680
|
fg=PALETTE["text_main"],
|
|
5577
5681
|
relief=tk.FLAT,
|
|
@@ -5626,7 +5730,7 @@ class AutoReadmeGUI:
|
|
|
5626
5730
|
pad_l = tk.Frame(left, bg=PALETTE["card_bg"], padx=16, pady=14)
|
|
5627
5731
|
pad_l.pack(fill=tk.BOTH, expand=True)
|
|
5628
5732
|
|
|
5629
|
-
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))
|
|
5630
5734
|
|
|
5631
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))
|
|
5632
5736
|
self.api_url_entry = apply_entry_focus_glow(tk.Entry(
|
|
@@ -5641,7 +5745,7 @@ class AutoReadmeGUI:
|
|
|
5641
5745
|
))
|
|
5642
5746
|
self.api_url_entry.pack(fill=tk.X, ipady=4, pady=(0, 8))
|
|
5643
5747
|
|
|
5644
|
-
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))
|
|
5645
5749
|
key_frame = tk.Frame(pad_l, bg=PALETTE["card_bg"])
|
|
5646
5750
|
key_frame.pack(fill=tk.X, pady=(0, 10))
|
|
5647
5751
|
|
|
@@ -5671,14 +5775,14 @@ class AutoReadmeGUI:
|
|
|
5671
5775
|
self.ping_btn.pack(side=tk.RIGHT, padx=(8, 0), ipady=3, ipadx=8)
|
|
5672
5776
|
|
|
5673
5777
|
# Custom prompt directives
|
|
5674
|
-
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))
|
|
5675
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)
|
|
5676
5780
|
self.extra_prompt_text.pack(fill=tk.BOTH, expand=True, pady=(0, 8))
|
|
5677
5781
|
|
|
5678
5782
|
# Bottom FX star speed
|
|
5679
5783
|
bottom_fx = tk.Frame(pad_l, bg=PALETTE["card_bg"])
|
|
5680
5784
|
bottom_fx.pack(fill=tk.X, pady=(2, 0))
|
|
5681
|
-
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))
|
|
5682
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)
|
|
5683
5787
|
self.star_scale.set(1.0)
|
|
5684
5788
|
self.star_scale.pack(side=tk.LEFT, fill=tk.X, expand=True)
|
|
@@ -5699,14 +5803,14 @@ class AutoReadmeGUI:
|
|
|
5699
5803
|
b_links = tk.Frame(brand, bg=PALETTE["bg_start"])
|
|
5700
5804
|
b_links.pack(fill=tk.X, padx=10, pady=(2, 6))
|
|
5701
5805
|
|
|
5702
|
-
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"])
|
|
5703
5807
|
lbl_sa.pack(side=tk.LEFT, padx=(0, 10))
|
|
5704
5808
|
|
|
5705
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")
|
|
5706
5810
|
lbl_web1.pack(side=tk.LEFT, padx=3)
|
|
5707
5811
|
lbl_web1.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_LINKEDIN))
|
|
5708
5812
|
|
|
5709
|
-
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")
|
|
5710
5814
|
lbl_web2.pack(side=tk.LEFT, padx=3)
|
|
5711
5815
|
lbl_web2.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_BIO))
|
|
5712
5816
|
|
|
@@ -5714,7 +5818,7 @@ class AutoReadmeGUI:
|
|
|
5714
5818
|
lbl_web3.pack(side=tk.LEFT, padx=3)
|
|
5715
5819
|
lbl_web3.bind("<Button-1>", lambda e: webbrowser.open(DEV_URL_MAIN))
|
|
5716
5820
|
|
|
5717
|
-
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")
|
|
5718
5822
|
lbl_web4.pack(side=tk.LEFT, padx=3)
|
|
5719
5823
|
lbl_web4.bind("<Button-1>", lambda e: webbrowser.open("https://huggingface.co/spaces/toprakke4/tzero-token-reducer"))
|
|
5720
5824
|
|
|
@@ -5725,7 +5829,7 @@ class AutoReadmeGUI:
|
|
|
5725
5829
|
|
|
5726
5830
|
p_head_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5727
5831
|
p_head_row.pack(fill=tk.X, pady=(0, 4))
|
|
5728
|
-
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)
|
|
5729
5833
|
|
|
5730
5834
|
p_select_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5731
5835
|
p_select_row.pack(fill=tk.X, pady=(0, 6))
|
|
@@ -5737,14 +5841,14 @@ class AutoReadmeGUI:
|
|
|
5737
5841
|
p_actions = tk.Frame(p_select_row, bg=PALETTE["card_bg"])
|
|
5738
5842
|
p_actions.pack(side=tk.RIGHT)
|
|
5739
5843
|
|
|
5740
|
-
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")
|
|
5741
5845
|
self.use_profile_btn.pack(side=tk.TOP, fill=tk.X, pady=1)
|
|
5742
5846
|
|
|
5743
5847
|
p_mini = tk.Frame(p_actions, bg=PALETTE["card_bg"])
|
|
5744
5848
|
p_mini.pack(side=tk.BOTTOM, fill=tk.X)
|
|
5745
|
-
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"))
|
|
5746
5850
|
self.new_profile_btn.pack(side=tk.LEFT, padx=1)
|
|
5747
|
-
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")
|
|
5748
5852
|
self.del_profile_btn.pack(side=tk.LEFT, padx=1)
|
|
5749
5853
|
|
|
5750
5854
|
# 2x2 Management tools grid
|
|
@@ -5753,29 +5857,29 @@ class AutoReadmeGUI:
|
|
|
5753
5857
|
tools_grid.columnconfigure(0, weight=1)
|
|
5754
5858
|
tools_grid.columnconfigure(1, weight=1)
|
|
5755
5859
|
|
|
5756
|
-
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"))
|
|
5757
5861
|
self.keyring_btn.grid(row=0, column=0, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5758
5862
|
|
|
5759
|
-
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"))
|
|
5760
5864
|
self.keyring_backup_btn.grid(row=0, column=1, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5761
5865
|
|
|
5762
|
-
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"))
|
|
5763
5867
|
self.global_config_btn.grid(row=1, column=0, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5764
5868
|
|
|
5765
|
-
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"))
|
|
5766
5870
|
self.ignore_folders_btn.grid(row=1, column=1, sticky="ew", padx=2, pady=2, ipady=3)
|
|
5767
5871
|
|
|
5768
5872
|
# Import/Export + Presets row
|
|
5769
5873
|
io_row = tk.Frame(profile_editor_frame, bg=PALETTE["card_bg"])
|
|
5770
5874
|
io_row.pack(fill=tk.X, pady=(2, 0))
|
|
5771
5875
|
|
|
5772
|
-
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"))
|
|
5773
5877
|
self.import_profile_btn.pack(side=tk.LEFT, padx=2)
|
|
5774
5878
|
|
|
5775
|
-
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"))
|
|
5776
5880
|
self.export_profile_btn.pack(side=tk.LEFT, padx=2)
|
|
5777
5881
|
|
|
5778
|
-
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))
|
|
5779
5883
|
self.preset_combo = ttk.Combobox(io_row, values=list(WorkspacePresetManager.PRESETS.keys()), state="readonly", width=14)
|
|
5780
5884
|
self.preset_combo.pack(side=tk.RIGHT, fill=tk.X, expand=True, padx=2)
|
|
5781
5885
|
self.preset_combo.bind("<<ComboboxSelected>>", self.apply_scan_preset)
|
|
@@ -6092,33 +6196,33 @@ class AutoReadmeGUI:
|
|
|
6092
6196
|
elif r_chat.status_code == 401:
|
|
6093
6197
|
self.safe_after(0, lambda: self.status_dot.set_status("red"))
|
|
6094
6198
|
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
|
|
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!"
|
|
6101
6205
|
)
|
|
6102
|
-
self.safe_after(0, lambda: messagebox.showwarning("
|
|
6206
|
+
self.safe_after(0, lambda: messagebox.showwarning("Authorization Error (401)", warn_msg))
|
|
6103
6207
|
elif r_chat.status_code == 403:
|
|
6104
6208
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6105
6209
|
warn_msg = (
|
|
6106
|
-
f"Model
|
|
6107
|
-
f"💡
|
|
6108
|
-
f"NVIDIA NIM 'Personal'
|
|
6109
|
-
f"1. https://build.nvidia.com
|
|
6110
|
-
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!"
|
|
6111
6215
|
)
|
|
6112
|
-
self.safe_after(0, lambda: messagebox.showwarning("
|
|
6216
|
+
self.safe_after(0, lambda: messagebox.showwarning("Partial Permission (403)", warn_msg))
|
|
6113
6217
|
elif r_chat.status_code == 410:
|
|
6114
6218
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6115
6219
|
self.safe_after(0, lambda: messagebox.showwarning(
|
|
6116
|
-
"Model
|
|
6117
|
-
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."
|
|
6118
6222
|
))
|
|
6119
6223
|
else:
|
|
6120
6224
|
self.safe_after(0, lambda: self.status_dot.set_status("yellow"))
|
|
6121
|
-
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]}"))
|
|
6122
6226
|
except Exception:
|
|
6123
6227
|
self.safe_after(0, lambda: self.status_dot.set_status("green"))
|
|
6124
6228
|
self.safe_after(0, lambda: messagebox.showinfo("Success", get_text("ping_success", self.lang)))
|
|
@@ -6230,40 +6334,71 @@ class AutoReadmeGUI:
|
|
|
6230
6334
|
|
|
6231
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))
|
|
6232
6336
|
|
|
6233
|
-
def show_crypto_support_modal(self):
|
|
6337
|
+
def show_crypto_support_modal(self, periodic: bool = False):
|
|
6234
6338
|
try:
|
|
6235
6339
|
from tzero.tzero_traffic import (
|
|
6236
|
-
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
|
|
6237
6341
|
)
|
|
6238
6342
|
except Exception:
|
|
6343
|
+
CRYPTO_EVM = "0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5"
|
|
6239
6344
|
CRYPTO_USDT_TRC20 = "TE7uKxZJ414u938gWf6bYh9QvRk2141517"
|
|
6240
6345
|
CRYPTO_BTC = "bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s"
|
|
6241
6346
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6242
6347
|
BIO_URL = "https://hopp.bio/siberegitim"
|
|
6348
|
+
SPONSOR_HUB_URL = "https://tzero-indol.vercel.app/#support"
|
|
6243
6349
|
from tzero import __version__ as CURRENT_VERSION
|
|
6244
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
|
+
|
|
6245
6356
|
dialog = tk.Toplevel(self.root)
|
|
6246
|
-
|
|
6247
|
-
|
|
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")
|
|
6248
6368
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
6249
6369
|
dialog.transient(self.root)
|
|
6250
6370
|
dialog.grab_set()
|
|
6251
6371
|
|
|
6252
|
-
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=
|
|
6372
|
+
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=18)
|
|
6253
6373
|
pad.pack(fill=tk.BOTH, expand=True)
|
|
6254
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
|
+
)
|
|
6255
6380
|
tk.Label(
|
|
6256
6381
|
pad,
|
|
6257
|
-
text=
|
|
6382
|
+
text=hdr_txt,
|
|
6258
6383
|
font=("Segoe UI", 12, "bold"),
|
|
6259
6384
|
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6260
6385
|
bg=PALETTE["bg_start"]
|
|
6261
6386
|
).pack(anchor=tk.W, pady=(0, 6))
|
|
6262
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
|
+
|
|
6263
6398
|
msg = (
|
|
6264
|
-
"T-Zero
|
|
6265
|
-
"
|
|
6266
|
-
"
|
|
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)."
|
|
6267
6402
|
)
|
|
6268
6403
|
tk.Label(
|
|
6269
6404
|
pad,
|
|
@@ -6272,39 +6407,76 @@ class AutoReadmeGUI:
|
|
|
6272
6407
|
fg=PALETTE["text_muted"],
|
|
6273
6408
|
bg=PALETTE["bg_start"],
|
|
6274
6409
|
justify=tk.LEFT
|
|
6275
|
-
).pack(anchor=tk.W, pady=(0,
|
|
6410
|
+
).pack(anchor=tk.W, pady=(0, 10))
|
|
6276
6411
|
|
|
6277
6412
|
def copy_addr(val, label):
|
|
6278
6413
|
try:
|
|
6279
6414
|
self.root.clipboard_clear()
|
|
6280
6415
|
self.root.clipboard_append(val)
|
|
6281
|
-
self.log(f"
|
|
6282
|
-
messagebox.showinfo("
|
|
6416
|
+
self.log(f"Copied to clipboard ({label}): {val}")
|
|
6417
|
+
messagebox.showinfo("Copied", f"{label} address copied to clipboard:\n{val}")
|
|
6283
6418
|
except Exception:
|
|
6284
6419
|
pass
|
|
6285
6420
|
|
|
6286
|
-
#
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
tk.Label(
|
|
6290
|
-
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)
|
|
6291
6432
|
|
|
6292
6433
|
# 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="
|
|
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)
|
|
6297
6438
|
|
|
6298
6439
|
# Links Row
|
|
6299
6440
|
links_row = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6300
6441
|
links_row.pack(fill=tk.X, pady=(12, 6))
|
|
6301
6442
|
|
|
6302
6443
|
import webbrowser
|
|
6303
|
-
tk.Button(links_row, text="
|
|
6304
|
-
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"
|
|
6305
6475
|
|
|
6306
|
-
|
|
6307
|
-
|
|
6476
|
+
if action == "star":
|
|
6477
|
+
self.check_and_show_star_welcome_popup()
|
|
6478
|
+
elif action == "sponsor":
|
|
6479
|
+
self.show_crypto_support_modal(periodic=True)
|
|
6308
6480
|
|
|
6309
6481
|
def open_star_action(self):
|
|
6310
6482
|
"""Opens GitHub repository directly and shows thank-you toast."""
|
|
@@ -6315,7 +6487,7 @@ class AutoReadmeGUI:
|
|
|
6315
6487
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6316
6488
|
try:
|
|
6317
6489
|
webbrowser.open(REPO_URL)
|
|
6318
|
-
self.show_toast("⭐ GitHub
|
|
6490
|
+
self.show_toast("⭐ GitHub repository opened! Thank you for starring!", "success")
|
|
6319
6491
|
except Exception:
|
|
6320
6492
|
pass
|
|
6321
6493
|
|
|
@@ -6359,7 +6531,7 @@ class AutoReadmeGUI:
|
|
|
6359
6531
|
siber_akademi_icon.apply_window_icon(dialog)
|
|
6360
6532
|
except Exception:
|
|
6361
6533
|
pass
|
|
6362
|
-
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!"
|
|
6363
6535
|
dialog.title(dialog_title)
|
|
6364
6536
|
dialog.geometry("560x430")
|
|
6365
6537
|
dialog.configure(bg=PALETTE["bg_start"])
|
|
@@ -6373,9 +6545,9 @@ class AutoReadmeGUI:
|
|
|
6373
6545
|
h_frame = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6374
6546
|
h_frame.pack(fill=tk.X, pady=(0, 10))
|
|
6375
6547
|
header_text = (
|
|
6376
|
-
"🚀
|
|
6548
|
+
"🚀 GITHUB OPENED IN YOUR BROWSER: PLEASE STAR THE REPO! ⭐"
|
|
6377
6549
|
if first_launch
|
|
6378
|
-
else f"⭐ {target_stars}
|
|
6550
|
+
else f"⭐ {target_stars} STARS GOAL: JOIN THE COMMUNITY!"
|
|
6379
6551
|
)
|
|
6380
6552
|
hdr_lbl = tk.Label(
|
|
6381
6553
|
h_frame,
|
|
@@ -6391,7 +6563,7 @@ class AutoReadmeGUI:
|
|
|
6391
6563
|
stats_frame.pack(fill=tk.X, pady=(0, 12))
|
|
6392
6564
|
stats_lbl = tk.Label(
|
|
6393
6565
|
stats_frame,
|
|
6394
|
-
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}%)",
|
|
6395
6567
|
font=("Segoe UI", 9, "bold"),
|
|
6396
6568
|
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6397
6569
|
bg=PALETTE["card_bg"],
|
|
@@ -6410,19 +6582,19 @@ class AutoReadmeGUI:
|
|
|
6410
6582
|
def _build_star_msg(cur_s: int, tgt_s: int) -> str:
|
|
6411
6583
|
if first_launch:
|
|
6412
6584
|
return (
|
|
6413
|
-
"
|
|
6414
|
-
"
|
|
6415
|
-
"
|
|
6416
|
-
"
|
|
6417
|
-
f"
|
|
6418
|
-
"
|
|
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!"
|
|
6419
6591
|
)
|
|
6420
6592
|
return (
|
|
6421
|
-
"
|
|
6422
|
-
"T-Zero
|
|
6423
|
-
"
|
|
6424
|
-
"
|
|
6425
|
-
"
|
|
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!"
|
|
6426
6598
|
)
|
|
6427
6599
|
|
|
6428
6600
|
msg = _build_star_msg(stars, target_stars)
|
|
@@ -6456,11 +6628,11 @@ class AutoReadmeGUI:
|
|
|
6456
6628
|
except Exception:
|
|
6457
6629
|
pass
|
|
6458
6630
|
dialog.destroy()
|
|
6459
|
-
self.show_toast("⭐
|
|
6631
|
+
self.show_toast("⭐ You're awesome! Thank you so much for your star!", "success")
|
|
6460
6632
|
except Exception:
|
|
6461
6633
|
pass
|
|
6462
6634
|
|
|
6463
|
-
btn_txt = "⭐
|
|
6635
|
+
btn_txt = "⭐ STAR ON GITHUB REPO (OPENED)" if first_launch else "⭐ 1-CLICK STAR ON GITHUB"
|
|
6464
6636
|
star_btn = CanvasPillButton(
|
|
6465
6637
|
pad,
|
|
6466
6638
|
text=btn_txt,
|
|
@@ -6489,7 +6661,7 @@ class AutoReadmeGUI:
|
|
|
6489
6661
|
|
|
6490
6662
|
tk.Button(
|
|
6491
6663
|
b_row,
|
|
6492
|
-
text="
|
|
6664
|
+
text="Remind Me Later",
|
|
6493
6665
|
font=("Segoe UI", 8),
|
|
6494
6666
|
bg=PALETTE["bg_start"],
|
|
6495
6667
|
fg=PALETTE["text_muted"],
|
|
@@ -6500,7 +6672,7 @@ class AutoReadmeGUI:
|
|
|
6500
6672
|
|
|
6501
6673
|
tk.Button(
|
|
6502
6674
|
b_row,
|
|
6503
|
-
text="
|
|
6675
|
+
text="Don't Show Again",
|
|
6504
6676
|
font=("Segoe UI", 8),
|
|
6505
6677
|
bg=PALETTE["bg_start"],
|
|
6506
6678
|
fg=PALETTE["text_muted"],
|
|
@@ -7651,7 +7823,7 @@ class AutoReadmeGUI:
|
|
|
7651
7823
|
self.gen_progress["value"] = 100
|
|
7652
7824
|
self.gen_status_lbl.config(text="Dry run complete! 100% Free & Zero-Leak context generated.")
|
|
7653
7825
|
self.log("Offline AST context tree synthesized successfully.")
|
|
7654
|
-
self.show_toast("⚡
|
|
7826
|
+
self.show_toast("⚡ Local Offline AST Context (100% Free & Zero-Leak) compiled successfully!", "success")
|
|
7655
7827
|
|
|
7656
7828
|
def start_generation(self):
|
|
7657
7829
|
url = self.api_url_entry.get().strip()
|
|
@@ -7747,13 +7919,13 @@ Custom Requirements:
|
|
|
7747
7919
|
# If commercial provider has no key at all, stay strictly local via the AST engine (no cloud fallback)
|
|
7748
7920
|
if not key and p.name != "Local Ollama":
|
|
7749
7921
|
self.log(
|
|
7750
|
-
f"
|
|
7922
|
+
f"No external API key configured ({provider_name}). Running Local Offline AST Engine with zero outbound telemetry..."
|
|
7751
7923
|
)
|
|
7752
7924
|
try:
|
|
7753
7925
|
offline_content = generate_offline_context(target_dir, selected_files, self.file_snippets)
|
|
7754
7926
|
self.safe_after(0, lambda: self.on_gen_success(offline_content))
|
|
7755
7927
|
self.safe_after(0, lambda: self.show_toast(
|
|
7756
|
-
"⚡
|
|
7928
|
+
"⚡ Complete context compiled cleanly with Local Offline AST Engine (no API key needed)!",
|
|
7757
7929
|
"success"
|
|
7758
7930
|
))
|
|
7759
7931
|
except Exception as offline_err:
|
|
@@ -7772,22 +7944,22 @@ Custom Requirements:
|
|
|
7772
7944
|
else:
|
|
7773
7945
|
raw_err = str(e)
|
|
7774
7946
|
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("
|
|
7947
|
+
self.log(f"Remote API response: {clean_err}")
|
|
7948
|
+
self.log("Activating Local Offline AST Engine without redirecting to any external cloud provider...")
|
|
7777
7949
|
|
|
7778
7950
|
try:
|
|
7779
7951
|
offline_content = generate_offline_context(target_dir, selected_files, self.file_snippets)
|
|
7780
7952
|
self.safe_after(0, lambda: self.on_gen_success(offline_content))
|
|
7781
7953
|
if "401" in raw_err:
|
|
7782
|
-
warn_reason = "
|
|
7954
|
+
warn_reason = "Remote API 401 authorization error (invalid or expired key)"
|
|
7783
7955
|
elif "403" in raw_err:
|
|
7784
|
-
warn_reason = "
|
|
7956
|
+
warn_reason = "Remote API 403 authorization error"
|
|
7785
7957
|
elif "500" in raw_err:
|
|
7786
|
-
warn_reason = "
|
|
7958
|
+
warn_reason = "Remote API server error (HTTP 500)"
|
|
7787
7959
|
else:
|
|
7788
|
-
warn_reason = "
|
|
7960
|
+
warn_reason = "Remote API connection issue"
|
|
7789
7961
|
self.safe_after(0, lambda: self.show_toast(
|
|
7790
|
-
f"⚡
|
|
7962
|
+
f"⚡ Synthesized complete context via T-Zero Local Offline AST Engine due to {warn_reason}!",
|
|
7791
7963
|
"info"
|
|
7792
7964
|
))
|
|
7793
7965
|
except Exception as offline_err:
|
|
@@ -7826,9 +7998,9 @@ Custom Requirements:
|
|
|
7826
7998
|
err_str = str(err)
|
|
7827
7999
|
detail = f"Failed: {err_str}"
|
|
7828
8000
|
if "403" in err_str or "Authorization failed" in err_str:
|
|
7829
|
-
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."
|
|
7830
8002
|
elif "410" in err_str or "end of life" in err_str:
|
|
7831
|
-
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."
|
|
7832
8004
|
messagebox.showerror("Error", detail)
|
|
7833
8005
|
|
|
7834
8006
|
def copy_clipboard(self):
|
|
@@ -7956,11 +8128,11 @@ Custom Requirements:
|
|
|
7956
8128
|
|
|
7957
8129
|
def _on_arch_export_done(self, out_path: str, use_ai: bool):
|
|
7958
8130
|
play_sfx("success")
|
|
7959
|
-
mode_str = "
|
|
7960
|
-
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")
|
|
7961
8133
|
self.log(f"ARCHITECTURE.md exported ({mode_str}): {out_path}")
|
|
7962
8134
|
self.gen_progress["value"] = 100
|
|
7963
|
-
self.gen_status_lbl.config(text=f"ARCHITECTURE.md
|
|
8135
|
+
self.gen_status_lbl.config(text=f"ARCHITECTURE.md ready ({mode_str})")
|
|
7964
8136
|
|
|
7965
8137
|
def _on_arch_export_error(self, err_msg: str):
|
|
7966
8138
|
play_sfx("error")
|
|
@@ -8367,9 +8539,9 @@ Custom Requirements:
|
|
|
8367
8539
|
try:
|
|
8368
8540
|
if dlg and dlg.winfo_exists():
|
|
8369
8541
|
if not w.get("first_launch"):
|
|
8370
|
-
w["hdr_lbl"].config(text=f"⭐ {target_stars}
|
|
8542
|
+
w["hdr_lbl"].config(text=f"⭐ {target_stars} STARS GOAL: JOIN THE COMMUNITY!")
|
|
8371
8543
|
w["stats_lbl"].config(
|
|
8372
|
-
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}%)"
|
|
8373
8545
|
)
|
|
8374
8546
|
w["bar_fill"].place_configure(relwidth=pct_ratio)
|
|
8375
8547
|
w["msg_lbl"].config(text=w["build_msg"](stars, target_stars))
|
|
@@ -9943,7 +10115,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9943
10115
|
if os.name == "nt":
|
|
9944
10116
|
try:
|
|
9945
10117
|
import ctypes
|
|
9946
|
-
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)
|
|
9947
10119
|
except Exception:
|
|
9948
10120
|
pass
|
|
9949
10121
|
print(f"[FATAL ERROR] Could not launch GUI: {e}")
|