tzero-mcp 11.15.3 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +4 -4
- package/README.md +5 -5
- package/bin/postinstall.js +10 -2
- package/bin/tzero-mcp.js +1 -1
- package/bin/tzero.js +17 -0
- package/package.json +1 -1
- package/src/addmcp.py +34 -23
- package/src/app.py +1 -1
- package/src/main.py +6 -0
- package/src/tzero/__init__.py +10 -0
- package/src/tzero/anti_rea/__init__.py +70 -0
- package/src/tzero/anti_rea/algebraic_mutator.py +86 -0
- package/src/tzero/anti_rea/anti_agent_guard.py +96 -0
- package/src/tzero/anti_rea/anti_debugger.py +239 -0
- package/src/tzero/anti_rea/anti_vm.py +160 -0
- package/src/tzero/anti_rea/asar_shield.py +99 -0
- package/src/tzero/anti_rea/auditor.py +158 -0
- package/src/tzero/anti_rea/bpe_disrupter.py +48 -0
- package/src/tzero/anti_rea/bytecode_trap.py +85 -0
- package/src/tzero/anti_rea/canary_beacon.py +187 -0
- package/src/tzero/anti_rea/cli.py +102 -0
- package/src/tzero/anti_rea/confusables.py +86 -0
- package/src/tzero/anti_rea/engine.py +204 -0
- package/src/tzero/anti_rea/extractor_shield.py +102 -0
- package/src/tzero/anti_rea/flattener.py +136 -0
- package/src/tzero/anti_rea/gui.py +267 -0
- package/src/tzero/anti_rea/honeypot.py +58 -0
- package/src/tzero/anti_rea/integrity_guard.py +66 -0
- package/src/tzero/anti_rea/jailbreak_decoy.py +77 -0
- package/src/tzero/anti_rea/mcp_poison.py +41 -0
- package/src/tzero/anti_rea/native_bridge.py +169 -0
- package/src/tzero/anti_rea/rdtsc_guard.py +64 -0
- package/src/tzero/anti_rea/string_vault.py +94 -0
- package/src/tzero/anti_rea/sybil_network.py +53 -0
- package/src/tzero/anti_rea/timing_guard.py +46 -0
- package/src/tzero/anti_rea/token_bomb.py +65 -0
- package/src/tzero/anti_rea/traps.py +76 -0
- package/src/tzero/anti_rea/vm_obfuscator.py +182 -0
- package/src/tzero/siber_akademi.ico +0 -0
- package/src/tzero/siber_akademi_icon.py +1 -1
- package/src/tzero/tzero_armor.py +165 -0
- package/src/tzero/tzero_bridge.py +28 -15
- package/src/tzero/tzero_budget.py +10 -3
- package/src/tzero/tzero_card.py +7 -5
- package/src/tzero/tzero_ci.py +1 -0
- package/src/tzero/tzero_contracts.py +30 -11
- package/src/tzero/tzero_dashboard.py +34 -14
- package/src/tzero/tzero_debt.py +14 -5
- package/src/tzero/tzero_federation.py +11 -6
- package/src/tzero/tzero_fixer/security_zero_leak.py +21 -3
- package/src/tzero/tzero_golden.py +11 -6
- package/src/tzero/tzero_graph_hud.html +1 -1
- package/src/tzero/tzero_growth.py +10 -10
- package/src/tzero/tzero_jarvis/agent_guard.py +16 -10
- package/src/tzero/tzero_jarvis/workspace_orchestrator.py +34 -23
- package/src/tzero/tzero_lsp.py +1 -1
- package/src/tzero/tzero_mcp.py +89 -31
- package/src/tzero/tzero_mutation.py +44 -16
- package/src/tzero/tzero_neural_cortex.py +1 -1
- package/src/tzero/tzero_pc_fixer.py +21 -3
- package/src/tzero/tzero_promo.py +196 -36
- package/src/tzero/tzero_rust_bridge.py +1086 -42
- package/src/tzero/tzero_scip.py +15 -2
- package/src/tzero/tzero_semantic_merge.py +34 -10
- package/src/tzero/tzero_task_benchmark.py +2 -2
- package/src/tzero/tzero_telemetry.py +146 -0
- package/src/tzero/tzero_terminal.py +366 -0
- package/src/tzero/tzero_traffic.py +350 -0
- package/src/tzero/tzero_tui.py +342 -133
- package/src/tzero/tzero_v3.py +652 -29
- package/src/tzero/tzero_welcome.py +72 -12
package/src/tzero/tzero_v3.py
CHANGED
|
@@ -36,9 +36,20 @@ import random
|
|
|
36
36
|
import logging
|
|
37
37
|
import shutil
|
|
38
38
|
|
|
39
|
+
# Universal terminal initialization (Windows VT100, UTF-8, ANSI safe-filtering, SMP emoji sanitization)
|
|
40
|
+
try:
|
|
41
|
+
from tzero.tzero_terminal import init_terminal
|
|
42
|
+
init_terminal()
|
|
43
|
+
except ImportError:
|
|
44
|
+
try:
|
|
45
|
+
from tzero_terminal import init_terminal
|
|
46
|
+
init_terminal()
|
|
47
|
+
except Exception:
|
|
48
|
+
pass
|
|
49
|
+
|
|
39
50
|
# Safe UTF-8 reconfiguration & Windows console attachment for frozen executables
|
|
40
51
|
if sys.platform.startswith("win"):
|
|
41
|
-
if len(sys.argv) > 1:
|
|
52
|
+
if len(sys.argv) > 1 and getattr(sys, "frozen", False):
|
|
42
53
|
try:
|
|
43
54
|
import ctypes
|
|
44
55
|
if ctypes.windll.kernel32.AttachConsole(-1):
|
|
@@ -482,7 +493,7 @@ def calculate_token_cost(token_count: int, provider_name: str) -> float:
|
|
|
482
493
|
# i18n Translations
|
|
483
494
|
TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
484
495
|
"en": {
|
|
485
|
-
"title": "T-Zero Developer Console & Context Architect
|
|
496
|
+
"title": "T-Zero Developer Console & Context Architect v12.2.0",
|
|
486
497
|
"subtitle": f"Developer: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
|
|
487
498
|
"overview_tab": "🏠 Overview Dashboard",
|
|
488
499
|
"setup_tab": "⚡ Setup & AI Models",
|
|
@@ -519,7 +530,7 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
519
530
|
"audit_btn": "🛡️ SECURITY AUDIT"
|
|
520
531
|
},
|
|
521
532
|
"tr": {
|
|
522
|
-
"title": "T-Zero Geliştirici Konsolu & Bağlam Mimarı
|
|
533
|
+
"title": "T-Zero Geliştirici Konsolu & Bağlam Mimarı v12.2.0",
|
|
523
534
|
"subtitle": f"Geliştirici: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
|
|
524
535
|
"overview_tab": "🏠 Genel Bakış",
|
|
525
536
|
"setup_tab": "⚡ Kurulum & Model",
|
|
@@ -703,7 +714,9 @@ class ConfigManager:
|
|
|
703
714
|
],
|
|
704
715
|
"ignored_folders": [
|
|
705
716
|
".git", "node_modules", "__pycache__", "venv", ".venv", "dist", "build",
|
|
706
|
-
".next", ".nuxt", "out", "coverage", ".idea", ".vscode", "temp", "tmp"
|
|
717
|
+
".next", ".nuxt", "out", "coverage", ".idea", ".vscode", "temp", "tmp",
|
|
718
|
+
"installers", "packages", ".superpowers", "brag-output", "target", ".tzero",
|
|
719
|
+
"tzero_mcp.egg-info"
|
|
707
720
|
],
|
|
708
721
|
"thread_pool_size": 4,
|
|
709
722
|
"max_tokens_budget": 60000
|
|
@@ -3547,13 +3560,18 @@ HorizontalProgressBarGroup = MonthlyStackedBarCard
|
|
|
3547
3560
|
|
|
3548
3561
|
|
|
3549
3562
|
class SecurityHubCard(LuxuryCard):
|
|
3550
|
-
"""Siber Akademi security badge & quick audit launcher card."""
|
|
3551
|
-
def __init__(self, parent, action_cmd=None, **kwargs):
|
|
3563
|
+
"""Siber Akademi security badge & quick audit / Anti-REA launcher card."""
|
|
3564
|
+
def __init__(self, parent, action_cmd=None, armor_cmd=None, **kwargs):
|
|
3552
3565
|
super().__init__(parent, radius=18, padding=12, **kwargs)
|
|
3553
3566
|
tk.Label(self.inner, text="🛡 SİBER AKADEMİ GÜVENLİK", font=("Segoe UI", 9, "bold"), fg=PALETTE.get("accent_cyan", "#3843a0"), bg=self.card_bg).pack(anchor=tk.W)
|
|
3554
|
-
tk.Label(self.inner, text="100% Zero-Leak
|
|
3555
|
-
|
|
3556
|
-
|
|
3567
|
+
tk.Label(self.inner, text="100% Zero-Leak + 26-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))
|
|
3568
|
+
btn_row = tk.Frame(self.inner, bg=self.card_bg)
|
|
3569
|
+
btn_row.pack(fill=tk.X)
|
|
3570
|
+
self.btn = CanvasPillButton(btn_row, text="RAPORU İNCELE", 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"))
|
|
3571
|
+
self.btn.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 3))
|
|
3572
|
+
if armor_cmd is not None:
|
|
3573
|
+
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")
|
|
3574
|
+
self.armor_btn.pack(side=tk.RIGHT, fill=tk.X, expand=True, padx=(3, 0))
|
|
3557
3575
|
|
|
3558
3576
|
class GlowingStatusDot(tk.Canvas):
|
|
3559
3577
|
def __init__(self, parent, size: int = 16, **kwargs):
|
|
@@ -4601,6 +4619,7 @@ class AutoReadmeGUI:
|
|
|
4601
4619
|
self.load_saved_credentials()
|
|
4602
4620
|
self.setup_keyboard_shortcuts()
|
|
4603
4621
|
self.start_system_telemetry()
|
|
4622
|
+
self.safe_after(1200, self.check_and_show_star_welcome_popup)
|
|
4604
4623
|
|
|
4605
4624
|
def safe_after(self, ms: int, func, *args):
|
|
4606
4625
|
"""Thread-safe and lifecycle-safe wrapper around root.after."""
|
|
@@ -4682,6 +4701,7 @@ class AutoReadmeGUI:
|
|
|
4682
4701
|
|
|
4683
4702
|
# Bottom Utilities
|
|
4684
4703
|
for icon_char, cmd_handler in [
|
|
4704
|
+
("💖", self.show_crypto_support_modal),
|
|
4685
4705
|
("🎨", self.open_theme_selector),
|
|
4686
4706
|
("🌐", self.toggle_language),
|
|
4687
4707
|
("⌨", self.show_shortcuts_modal),
|
|
@@ -4782,6 +4802,19 @@ class AutoReadmeGUI:
|
|
|
4782
4802
|
)
|
|
4783
4803
|
self.web_console_btn.pack(side=tk.LEFT, padx=3)
|
|
4784
4804
|
|
|
4805
|
+
self.star_header_btn = CanvasPillButton(
|
|
4806
|
+
header_controls,
|
|
4807
|
+
text="★ STAR (45★)",
|
|
4808
|
+
command=self.open_star_action,
|
|
4809
|
+
height=28,
|
|
4810
|
+
radius=14,
|
|
4811
|
+
bg_color=PALETTE.get("warning", "#eab308"),
|
|
4812
|
+
text_color="#000000",
|
|
4813
|
+
font=("Segoe UI", 7, "bold"),
|
|
4814
|
+
width=100
|
|
4815
|
+
)
|
|
4816
|
+
self.star_header_btn.pack(side=tk.LEFT, padx=3)
|
|
4817
|
+
|
|
4785
4818
|
# 3. MAIN CONTENT FRAME
|
|
4786
4819
|
self.content = tk.Frame(self.bg_canvas, bg=PALETTE["bg_start"], bd=0)
|
|
4787
4820
|
self.content.place(x=82, y=62, relwidth=1.0, width=-92, relheight=1.0, height=-94)
|
|
@@ -4913,6 +4946,23 @@ class AutoReadmeGUI:
|
|
|
4913
4946
|
def run_quick_security_audit(self):
|
|
4914
4947
|
self.open_security_audit_dialog()
|
|
4915
4948
|
|
|
4949
|
+
def run_quick_anti_rea_armor(self):
|
|
4950
|
+
"""Executes 26-Tier Anti-REA Resistance audit & protection from GUI Security Hub."""
|
|
4951
|
+
target = (self.dir_entry.get().strip() if hasattr(self, "dir_entry") else "") or os.getcwd()
|
|
4952
|
+
try:
|
|
4953
|
+
from tzero.tzero_armor import audit_path_rea_resistance
|
|
4954
|
+
audit = audit_path_rea_resistance(target)
|
|
4955
|
+
score = audit.get("score", 0)
|
|
4956
|
+
rating = audit.get("rating", "UNKNOWN")
|
|
4957
|
+
self.log(f"[ANTI-REA AUDIT] Target: {target} | Score: {score}/100 ({rating})")
|
|
4958
|
+
messagebox.showinfo(
|
|
4959
|
+
"T-Zero 26-Tier Anti-REA Armor",
|
|
4960
|
+
f"Target: {target}\nAI Resistance Score: {score}/100 ({rating})\n"
|
|
4961
|
+
f"Active Tiers: Anti-VM (25), RDTSC Guard (26), Ring-3 Anti-Debug, Opaque CFF, PolyVM.",
|
|
4962
|
+
)
|
|
4963
|
+
except Exception as exc:
|
|
4964
|
+
self.log(f"[ANTI-REA ERROR] {exc}")
|
|
4965
|
+
|
|
4916
4966
|
def open_security_audit_dialog(self, target_dir: Optional[str] = None):
|
|
4917
4967
|
"""Runs a complete T-Zero 4-Tier Security & AST Architecture Audit (T-001 to T-004)
|
|
4918
4968
|
and displays an interactive luxury report dialog with filtering and export capabilities."""
|
|
@@ -5497,7 +5547,7 @@ class AutoReadmeGUI:
|
|
|
5497
5547
|
self.daily_card.grid(row=2, column=1, sticky="nsew", padx=4, pady=4)
|
|
5498
5548
|
|
|
5499
5549
|
# Card 9: Siber Akademi Security Hub Card
|
|
5500
|
-
self.security_card = SecurityHubCard(f, action_cmd=self.run_quick_security_audit)
|
|
5550
|
+
self.security_card = SecurityHubCard(f, action_cmd=self.run_quick_security_audit, armor_cmd=self.run_quick_anti_rea_armor)
|
|
5501
5551
|
self.security_card.grid(row=2, column=2, columnspan=2, sticky="nsew", padx=4, pady=4)
|
|
5502
5552
|
|
|
5503
5553
|
# --- TAB 7: SETTINGS & SECRETS MANAGEMENT ---
|
|
@@ -6124,6 +6174,258 @@ class AutoReadmeGUI:
|
|
|
6124
6174
|
|
|
6125
6175
|
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))
|
|
6126
6176
|
|
|
6177
|
+
def show_crypto_support_modal(self):
|
|
6178
|
+
try:
|
|
6179
|
+
from tzero.tzero_traffic import (
|
|
6180
|
+
CRYPTO_USDT_TRC20, CRYPTO_BTC, REPO_URL, BIO_URL, CURRENT_VERSION
|
|
6181
|
+
)
|
|
6182
|
+
except Exception:
|
|
6183
|
+
CRYPTO_USDT_TRC20 = "TE7uKxZJ414u938gWf6bYh9QvRk2141517"
|
|
6184
|
+
CRYPTO_BTC = "bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s"
|
|
6185
|
+
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6186
|
+
BIO_URL = "https://hopp.bio/siberegitim"
|
|
6187
|
+
CURRENT_VERSION = "12.0.0"
|
|
6188
|
+
|
|
6189
|
+
dialog = tk.Toplevel(self.root)
|
|
6190
|
+
dialog.title(f"T-Zero v{CURRENT_VERSION} — Destek & Sürüm Merkezi")
|
|
6191
|
+
dialog.geometry("540x480")
|
|
6192
|
+
dialog.configure(bg=PALETTE["bg_start"])
|
|
6193
|
+
dialog.transient(self.root)
|
|
6194
|
+
dialog.grab_set()
|
|
6195
|
+
|
|
6196
|
+
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=24, pady=20)
|
|
6197
|
+
pad.pack(fill=tk.BOTH, expand=True)
|
|
6198
|
+
|
|
6199
|
+
tk.Label(
|
|
6200
|
+
pad,
|
|
6201
|
+
text=f"🚀 T-ZERO v{CURRENT_VERSION} SÜRÜM & KRİPTO DESTEK",
|
|
6202
|
+
font=("Segoe UI", 12, "bold"),
|
|
6203
|
+
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6204
|
+
bg=PALETTE["bg_start"]
|
|
6205
|
+
).pack(anchor=tk.W, pady=(0, 6))
|
|
6206
|
+
|
|
6207
|
+
msg = (
|
|
6208
|
+
"T-Zero'nun kurumsal tekellere satılmadan, bağımsız kalması ve herkese\n"
|
|
6209
|
+
"%100 BEDAVA sunulabilmesi için geliştirici Toprak Ahmet Aydoğmuş'a\n"
|
|
6210
|
+
"kripto ile destek olabilirsiniz."
|
|
6211
|
+
)
|
|
6212
|
+
tk.Label(
|
|
6213
|
+
pad,
|
|
6214
|
+
text=msg,
|
|
6215
|
+
font=("Segoe UI", 9),
|
|
6216
|
+
fg=PALETTE["text_muted"],
|
|
6217
|
+
bg=PALETTE["bg_start"],
|
|
6218
|
+
justify=tk.LEFT
|
|
6219
|
+
).pack(anchor=tk.W, pady=(0, 14))
|
|
6220
|
+
|
|
6221
|
+
def copy_addr(val, label):
|
|
6222
|
+
try:
|
|
6223
|
+
self.root.clipboard_clear()
|
|
6224
|
+
self.root.clipboard_append(val)
|
|
6225
|
+
self.log(f"Panoya kopyalandı ({label}): {val}")
|
|
6226
|
+
messagebox.showinfo("Kopyalandı", f"{label} adresi başarıyla panoya kopyalandı:\n{val}")
|
|
6227
|
+
except Exception:
|
|
6228
|
+
pass
|
|
6229
|
+
|
|
6230
|
+
# USDT
|
|
6231
|
+
u_box = tk.LabelFrame(pad, text="🪙 USDT (TRC-20 Network)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_green", "#22c55e"), font=("Segoe UI", 9, "bold"), padx=10, pady=8)
|
|
6232
|
+
u_box.pack(fill=tk.X, pady=4)
|
|
6233
|
+
tk.Label(u_box, text=CRYPTO_USDT_TRC20, font=("Consolas", 9), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6234
|
+
tk.Button(u_box, text="Kopyala", 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)
|
|
6235
|
+
|
|
6236
|
+
# BTC
|
|
6237
|
+
b_box = tk.LabelFrame(pad, text="🪙 Bitcoin (BTC Network)", bg=PALETTE["bg_start"], fg=PALETTE.get("accent_yellow", "#fbbf24"), font=("Segoe UI", 9, "bold"), padx=10, pady=8)
|
|
6238
|
+
b_box.pack(fill=tk.X, pady=4)
|
|
6239
|
+
tk.Label(b_box, text=CRYPTO_BTC, font=("Consolas", 9), fg=PALETTE["text_main"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT)
|
|
6240
|
+
tk.Button(b_box, text="Kopyala", 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)
|
|
6241
|
+
|
|
6242
|
+
# Links Row
|
|
6243
|
+
links_row = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6244
|
+
links_row.pack(fill=tk.X, pady=(12, 6))
|
|
6245
|
+
|
|
6246
|
+
import webbrowser
|
|
6247
|
+
tk.Button(links_row, text="⭐ GitHub Repo & Star", font=("Segoe UI", 9, "bold"), bg=PALETTE.get("card_border", "#334155"), fg=PALETTE["text_main"], relief=tk.FLAT, cursor="hand2", command=lambda: webbrowser.open(REPO_URL)).pack(side=tk.LEFT, padx=(0, 6))
|
|
6248
|
+
tk.Button(links_row, text="🌐 Biyografi", 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=6)
|
|
6249
|
+
|
|
6250
|
+
# Close
|
|
6251
|
+
tk.Button(pad, text="Kapat", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=dialog.destroy).pack(pady=(12, 0))
|
|
6252
|
+
|
|
6253
|
+
def open_star_action(self):
|
|
6254
|
+
"""Opens GitHub repository directly and shows thank-you toast."""
|
|
6255
|
+
try:
|
|
6256
|
+
import webbrowser
|
|
6257
|
+
from tzero.tzero_traffic import REPO_URL
|
|
6258
|
+
except Exception:
|
|
6259
|
+
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6260
|
+
try:
|
|
6261
|
+
webbrowser.open(REPO_URL)
|
|
6262
|
+
self.show_toast("⭐ GitHub depomuz açıldı! Yıldızınız için teşekkür ederiz!", "success")
|
|
6263
|
+
except Exception:
|
|
6264
|
+
pass
|
|
6265
|
+
|
|
6266
|
+
def check_and_show_star_welcome_popup(self):
|
|
6267
|
+
"""Displays a high-impact, sleek GitHub Star goal popup on startup."""
|
|
6268
|
+
try:
|
|
6269
|
+
profile = _config_mgr.get_profile()
|
|
6270
|
+
if profile.get("star_popup_dismissed_v12", False):
|
|
6271
|
+
return
|
|
6272
|
+
except Exception:
|
|
6273
|
+
profile = {}
|
|
6274
|
+
|
|
6275
|
+
try:
|
|
6276
|
+
import webbrowser
|
|
6277
|
+
from tzero.tzero_traffic import REPO_URL, CURRENT_VERSION
|
|
6278
|
+
except Exception:
|
|
6279
|
+
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
6280
|
+
CURRENT_VERSION = "12.1.4"
|
|
6281
|
+
|
|
6282
|
+
# On first launch, automatically open the GitHub repo in browser and ask to star!
|
|
6283
|
+
first_launch = not profile.get("first_launch_repo_opened_v12", False)
|
|
6284
|
+
if first_launch:
|
|
6285
|
+
try:
|
|
6286
|
+
webbrowser.open(REPO_URL)
|
|
6287
|
+
profile["first_launch_repo_opened_v12"] = True
|
|
6288
|
+
_config_mgr.save_profile(profile)
|
|
6289
|
+
except Exception:
|
|
6290
|
+
pass
|
|
6291
|
+
|
|
6292
|
+
dialog = tk.Toplevel(self.root)
|
|
6293
|
+
dialog_title = f"⭐ T-Zero v{CURRENT_VERSION} — Lütfen Star Verin!" if first_launch else f"⭐ T-Zero v{CURRENT_VERSION} — 100 Yıldız Hedefi!"
|
|
6294
|
+
dialog.title(dialog_title)
|
|
6295
|
+
dialog.geometry("560x430")
|
|
6296
|
+
dialog.configure(bg=PALETTE["bg_start"])
|
|
6297
|
+
dialog.transient(self.root)
|
|
6298
|
+
dialog.resizable(False, False)
|
|
6299
|
+
|
|
6300
|
+
pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=26, pady=20)
|
|
6301
|
+
pad.pack(fill=tk.BOTH, expand=True)
|
|
6302
|
+
|
|
6303
|
+
# Header Badge
|
|
6304
|
+
h_frame = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6305
|
+
h_frame.pack(fill=tk.X, pady=(0, 10))
|
|
6306
|
+
header_text = (
|
|
6307
|
+
"🚀 TARAYICINIZDA GITHUB AÇILDI: LÜTFEN STAR VERİN! ⭐"
|
|
6308
|
+
if first_launch
|
|
6309
|
+
else "⭐ 100 YILDIZ HEDEFİ: TOPLULUĞA KATILIN!"
|
|
6310
|
+
)
|
|
6311
|
+
tk.Label(
|
|
6312
|
+
h_frame,
|
|
6313
|
+
text=header_text,
|
|
6314
|
+
font=("Segoe UI", 12, "bold"),
|
|
6315
|
+
fg=PALETTE.get("warning", "#fbbf24"),
|
|
6316
|
+
bg=PALETTE["bg_start"]
|
|
6317
|
+
).pack(side=tk.LEFT)
|
|
6318
|
+
|
|
6319
|
+
# Stats Badge
|
|
6320
|
+
stats_frame = tk.Frame(pad, bg=PALETTE["card_bg"], highlightthickness=1, highlightbackground=PALETTE["card_border"], padx=14, pady=10)
|
|
6321
|
+
stats_frame.pack(fill=tk.X, pady=(0, 12))
|
|
6322
|
+
tk.Label(
|
|
6323
|
+
stats_frame,
|
|
6324
|
+
text="🚀 20,880+ İndirme (PyPI & npm) | ⚡ 1,120,000+ Kurtarılan Token\n⭐ Mevcut Yıldız: 45 / 100 Hedef (İlerleme: %45)",
|
|
6325
|
+
font=("Segoe UI", 9, "bold"),
|
|
6326
|
+
fg=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
6327
|
+
bg=PALETTE["card_bg"],
|
|
6328
|
+
justify=tk.CENTER
|
|
6329
|
+
).pack()
|
|
6330
|
+
|
|
6331
|
+
# Visual Progress Bar
|
|
6332
|
+
bar_container = tk.Frame(pad, bg=PALETTE["card_border"], height=14)
|
|
6333
|
+
bar_container.pack(fill=tk.X, pady=(0, 14))
|
|
6334
|
+
bar_container.pack_propagate(False)
|
|
6335
|
+
bar_fill = tk.Frame(bar_container, bg=PALETTE.get("warning", "#fbbf24"), width=int(508 * 0.45), height=14)
|
|
6336
|
+
bar_fill.place(x=0, y=0, relheight=1.0, relwidth=0.45)
|
|
6337
|
+
|
|
6338
|
+
# Message
|
|
6339
|
+
if first_launch:
|
|
6340
|
+
msg = (
|
|
6341
|
+
"Merhaba! Ben Toprak Ahmet Aydoğmuş (Siber Akademi).\n"
|
|
6342
|
+
"T-Zero'yu başlattığınız için GitHub depomuz tarayıcınızda açıldı!\n\n"
|
|
6343
|
+
"Projemizin bağımsız kalabilmesi ve herkese %100 BEDAVA sunulabilmesi için\n"
|
|
6344
|
+
"lütfen açılan GitHub sayfasında sağ üstteki ★ STAR butonuna tıklayarak\n"
|
|
6345
|
+
"projemize destek olun! ⭐ (100 Yıldız Hedefi: 45/100)\n\n"
|
|
6346
|
+
"Yıldızınız projemizin büyümesi ve daha fazla geliştiriciye ulaşması için çok değerli!"
|
|
6347
|
+
)
|
|
6348
|
+
else:
|
|
6349
|
+
msg = (
|
|
6350
|
+
"Merhaba! Ben Toprak Ahmet Aydoğmuş (Siber Akademi).\n"
|
|
6351
|
+
"T-Zero'yu yapay zeka araçlarındaki token maliyetini ve context israfını\n"
|
|
6352
|
+
"önlemek için sıfırdan geliştirdim ve herkese %100 BEDAVA sunuyorum.\n\n"
|
|
6353
|
+
"Projemizin bağımsız kalabilmesi ve daha fazla geliştiriciye ulaşabilmesi için\n"
|
|
6354
|
+
"GitHub depomuza vereceğiniz TEK BİR YILDIZ çok büyük bir fark yaratıyor!"
|
|
6355
|
+
)
|
|
6356
|
+
tk.Label(
|
|
6357
|
+
pad,
|
|
6358
|
+
text=msg,
|
|
6359
|
+
font=("Segoe UI", 9),
|
|
6360
|
+
fg=PALETTE["text_main"],
|
|
6361
|
+
bg=PALETTE["bg_start"],
|
|
6362
|
+
justify=tk.LEFT
|
|
6363
|
+
).pack(anchor=tk.W, pady=(0, 16))
|
|
6364
|
+
|
|
6365
|
+
# Star Action Button (Big Golden Button)
|
|
6366
|
+
def on_star_click():
|
|
6367
|
+
try:
|
|
6368
|
+
webbrowser.open(REPO_URL)
|
|
6369
|
+
try:
|
|
6370
|
+
profile = _config_mgr.get_profile()
|
|
6371
|
+
profile["star_popup_dismissed_v12"] = True
|
|
6372
|
+
_config_mgr.save_profile(profile)
|
|
6373
|
+
except Exception:
|
|
6374
|
+
pass
|
|
6375
|
+
dialog.destroy()
|
|
6376
|
+
self.show_toast("⭐ Harikasınız! Yıldızınız için yürekten teşekkürler!", "success")
|
|
6377
|
+
except Exception:
|
|
6378
|
+
pass
|
|
6379
|
+
|
|
6380
|
+
btn_txt = "⭐ GITHUB DEPOSUNDA YILDIZ VER (AÇILDI)" if first_launch else "⭐ GITHUB'DA 1-TIKLA YILDIZ VER"
|
|
6381
|
+
star_btn = CanvasPillButton(
|
|
6382
|
+
pad,
|
|
6383
|
+
text=btn_txt,
|
|
6384
|
+
command=on_star_click,
|
|
6385
|
+
height=38,
|
|
6386
|
+
radius=19,
|
|
6387
|
+
bg_color=PALETTE.get("warning", "#eab308"),
|
|
6388
|
+
text_color="#000000",
|
|
6389
|
+
font=("Segoe UI", 10, "bold"),
|
|
6390
|
+
width=340
|
|
6391
|
+
)
|
|
6392
|
+
star_btn.pack(pady=(0, 8))
|
|
6393
|
+
|
|
6394
|
+
# Buttons row (Dismiss & Later)
|
|
6395
|
+
b_row = tk.Frame(pad, bg=PALETTE["bg_start"])
|
|
6396
|
+
b_row.pack(fill=tk.X, pady=(6, 0))
|
|
6397
|
+
|
|
6398
|
+
def on_dismiss():
|
|
6399
|
+
try:
|
|
6400
|
+
profile = _config_mgr.get_profile()
|
|
6401
|
+
profile["star_popup_dismissed_v12"] = True
|
|
6402
|
+
_config_mgr.save_profile(profile)
|
|
6403
|
+
except Exception:
|
|
6404
|
+
pass
|
|
6405
|
+
dialog.destroy()
|
|
6406
|
+
|
|
6407
|
+
tk.Button(
|
|
6408
|
+
b_row,
|
|
6409
|
+
text="Daha Sonra Hatırlat",
|
|
6410
|
+
font=("Segoe UI", 8),
|
|
6411
|
+
bg=PALETTE["bg_start"],
|
|
6412
|
+
fg=PALETTE["text_muted"],
|
|
6413
|
+
relief=tk.FLAT,
|
|
6414
|
+
cursor="hand2",
|
|
6415
|
+
command=dialog.destroy
|
|
6416
|
+
).pack(side=tk.LEFT)
|
|
6417
|
+
|
|
6418
|
+
tk.Button(
|
|
6419
|
+
b_row,
|
|
6420
|
+
text="Bir Daha Gösterme",
|
|
6421
|
+
font=("Segoe UI", 8),
|
|
6422
|
+
bg=PALETTE["bg_start"],
|
|
6423
|
+
fg=PALETTE["text_muted"],
|
|
6424
|
+
relief=tk.FLAT,
|
|
6425
|
+
cursor="hand2",
|
|
6426
|
+
command=on_dismiss
|
|
6427
|
+
).pack(side=tk.RIGHT)
|
|
6428
|
+
|
|
6127
6429
|
# --- TAB 2: SELECTOR & SPLIT VIEW EDITOR ---
|
|
6128
6430
|
def setup_tab_selector(self):
|
|
6129
6431
|
f = self.tab_frames[1]
|
|
@@ -8140,6 +8442,9 @@ def run_scan_cli(target_dir: str, output_format: str = "text"):
|
|
|
8140
8442
|
print(f"{f[:53]:<55} | {sz_str:<10} | {tok:<8}")
|
|
8141
8443
|
print("-" * 78)
|
|
8142
8444
|
print(f"Total: {len(files)} files | {total_size/1024:.1f} KB | ~{total_tokens:,} tokens\n")
|
|
8445
|
+
if sys.stdout.isatty() and os.environ.get("TZERO_NO_BANNER") != "1" and os.environ.get("CI") != "true":
|
|
8446
|
+
print("\033[1;33m★ Help T-Zero reach 100 stars on GitHub (Current: 45/100):\033[0m")
|
|
8447
|
+
print("\033[1;36m► Run 'tzero star' or visit: https://github.com/toprakahmetaydogmus/TZeroAlgorithm\033[0m\n")
|
|
8143
8448
|
|
|
8144
8449
|
|
|
8145
8450
|
def run_audit_cli(target_dir: str, output_format: str = "text"):
|
|
@@ -8760,6 +9065,130 @@ def run_watch_mode(target_dir: str = ".", interval: float = 1.0, once_test: bool
|
|
|
8760
9065
|
return True
|
|
8761
9066
|
|
|
8762
9067
|
|
|
9068
|
+
def print_viral_share_hub(open_browser: bool = False):
|
|
9069
|
+
"""Prints 1-click social share links for Twitter, Reddit, LinkedIn, Hacker News, WhatsApp, and GitHub."""
|
|
9070
|
+
import urllib.parse
|
|
9071
|
+
try:
|
|
9072
|
+
from tzero.tzero_terminal import init_terminal, sanitize_terminal_text
|
|
9073
|
+
init_terminal()
|
|
9074
|
+
except ImportError:
|
|
9075
|
+
try:
|
|
9076
|
+
from tzero_terminal import init_terminal, sanitize_terminal_text
|
|
9077
|
+
init_terminal()
|
|
9078
|
+
except Exception:
|
|
9079
|
+
def sanitize_terminal_text(t):
|
|
9080
|
+
return t
|
|
9081
|
+
|
|
9082
|
+
repo_url = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
9083
|
+
tweet_text = "T-Zero: Deterministic AST Context Compressor & MCP Server cutting AI prompt tokens by up to 95% with zero regressions. Built by Toprak Ahmet Aydoğmuş (Siber Akademi). 100% free & local!"
|
|
9084
|
+
tweet_url = f"https://twitter.com/intent/tweet?text={urllib.parse.quote(tweet_text)}&url={urllib.parse.quote(repo_url)}&hashtags=CursorAI,ClaudeAI,MCP,OpenSource"
|
|
9085
|
+
reddit_url = f"https://www.reddit.com/submit?url={urllib.parse.quote(repo_url)}&title={urllib.parse.quote('T-Zero — Deterministic AST Context Compressor & Canonical MCP Server (cuts tokens by 95%)')}"
|
|
9086
|
+
hn_url = f"https://news.ycombinator.com/submitlink?u={urllib.parse.quote(repo_url)}&t={urllib.parse.quote('Show HN: T-Zero – Deterministic AST Codebase Context Compressor & MCP Server')}"
|
|
9087
|
+
linkedin_url = f"https://www.linkedin.com/sharing/share-offsite/?url={urllib.parse.quote(repo_url)}"
|
|
9088
|
+
wa_url = f"https://api.whatsapp.com/send?text={urllib.parse.quote(f'Check out T-Zero: {repo_url}')}"
|
|
9089
|
+
|
|
9090
|
+
raw_hub = f"""
|
|
9091
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
9092
|
+
│ ★ T-ZERO 1-CLICK COMMUNITY SHARE & VIRAL LAUNCH HUB │
|
|
9093
|
+
│ Empowering Developers Worldwide • 100% Free & Open Source │
|
|
9094
|
+
└────────────────────────────────────────────────────────────────────────┘
|
|
9095
|
+
|
|
9096
|
+
[X] Twitter / X (1-Click Tweet):
|
|
9097
|
+
{tweet_url}
|
|
9098
|
+
|
|
9099
|
+
[Reddit] Reddit (r/LocalLLaMA, r/Cursor):
|
|
9100
|
+
{reddit_url}
|
|
9101
|
+
|
|
9102
|
+
[HN] Hacker News (Show HN):
|
|
9103
|
+
{hn_url}
|
|
9104
|
+
|
|
9105
|
+
[LinkedIn] LinkedIn:
|
|
9106
|
+
{linkedin_url}
|
|
9107
|
+
|
|
9108
|
+
[WhatsApp] WhatsApp:
|
|
9109
|
+
{wa_url}
|
|
9110
|
+
|
|
9111
|
+
★ Star on GitHub (Goal: 100 Stars):
|
|
9112
|
+
{repo_url}
|
|
9113
|
+
|
|
9114
|
+
════════════════════════════════════════════════════════════════════════
|
|
9115
|
+
✔ Every share and star supports independent open-source AI tooling!
|
|
9116
|
+
════════════════════════════════════════════════════════════════════════
|
|
9117
|
+
"""
|
|
9118
|
+
print(sanitize_terminal_text(raw_hub))
|
|
9119
|
+
if open_browser:
|
|
9120
|
+
try:
|
|
9121
|
+
import webbrowser
|
|
9122
|
+
print(sanitize_terminal_text("\n\033[36m► Opening 1-click share links in default browser...\033[0m"))
|
|
9123
|
+
webbrowser.open(tweet_url)
|
|
9124
|
+
webbrowser.open(reddit_url)
|
|
9125
|
+
except Exception:
|
|
9126
|
+
pass
|
|
9127
|
+
|
|
9128
|
+
|
|
9129
|
+
def print_sponsor_hub(open_browser: bool = False):
|
|
9130
|
+
"""Prints 1-click Web3 and crypto donation deep links, addresses, and opens sponsor page."""
|
|
9131
|
+
try:
|
|
9132
|
+
from tzero.tzero_terminal import init_terminal, sanitize_terminal_text
|
|
9133
|
+
init_terminal()
|
|
9134
|
+
except ImportError:
|
|
9135
|
+
try:
|
|
9136
|
+
from tzero_terminal import init_terminal, sanitize_terminal_text
|
|
9137
|
+
init_terminal()
|
|
9138
|
+
except Exception:
|
|
9139
|
+
def sanitize_terminal_text(t):
|
|
9140
|
+
return t
|
|
9141
|
+
|
|
9142
|
+
evm_addr = "0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5"
|
|
9143
|
+
btc_addr = "bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s"
|
|
9144
|
+
usdt_addr = "TE7uKxZJ414u938gWf6bYh9QvRk2141517"
|
|
9145
|
+
etherscan_link = f"https://etherscan.io/address/{evm_addr}"
|
|
9146
|
+
tronscan_link = f"https://tronscan.org/#/address/{usdt_addr}"
|
|
9147
|
+
mempool_link = f"https://mempool.space/address/{btc_addr}"
|
|
9148
|
+
github_sponsors = "https://github.com/sponsors/toprakahmetaydogmus"
|
|
9149
|
+
support_web = "https://tzero-indol.vercel.app/#support"
|
|
9150
|
+
|
|
9151
|
+
raw_hub = f"""
|
|
9152
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
9153
|
+
│ 💖 T-ZERO 1-CLICK WEB3 & CRYPTO DONATION HUB │
|
|
9154
|
+
│ Keeping T-Zero 100% Free, Offline & Zero-Leak Worldwide │
|
|
9155
|
+
└────────────────────────────────────────────────────────────────────────┘
|
|
9156
|
+
|
|
9157
|
+
[🔷 Ethereum / EVM] (ETH, ERC-20, Polygon, Arbitrum, BSC, Optimism):
|
|
9158
|
+
Address: {evm_addr}
|
|
9159
|
+
Web3 URI: ethereum:{evm_addr}
|
|
9160
|
+
Explorer: {etherscan_link}
|
|
9161
|
+
|
|
9162
|
+
[🟠 Bitcoin] (Native SegWit bech32):
|
|
9163
|
+
Address: {btc_addr}
|
|
9164
|
+
Bitcoin URI: bitcoin:{btc_addr}?label=T-Zero%20Sponsorship
|
|
9165
|
+
Explorer: {mempool_link}
|
|
9166
|
+
|
|
9167
|
+
[🟢 USDT] (TRC-20 Tron Network):
|
|
9168
|
+
Address: {usdt_addr}
|
|
9169
|
+
Tron URI: tron:{usdt_addr}
|
|
9170
|
+
Explorer: {tronscan_link}
|
|
9171
|
+
|
|
9172
|
+
[💖 GitHub Sponsors]:
|
|
9173
|
+
{github_sponsors}
|
|
9174
|
+
|
|
9175
|
+
[🌐 Interactive Web3 & QR Code Hub]:
|
|
9176
|
+
{support_web}
|
|
9177
|
+
|
|
9178
|
+
════════════════════════════════════════════════════════════════════════
|
|
9179
|
+
✔ 100% of contributions directly sustain local-first open-source tooling!
|
|
9180
|
+
════════════════════════════════════════════════════════════════════════
|
|
9181
|
+
"""
|
|
9182
|
+
print(sanitize_terminal_text(raw_hub))
|
|
9183
|
+
if open_browser:
|
|
9184
|
+
try:
|
|
9185
|
+
import webbrowser
|
|
9186
|
+
print(sanitize_terminal_text("\n\033[36m► Opening Web3 sponsor hub in default browser...\033[0m"))
|
|
9187
|
+
webbrowser.open(support_web)
|
|
9188
|
+
except Exception:
|
|
9189
|
+
pass
|
|
9190
|
+
|
|
9191
|
+
|
|
8763
9192
|
def main():
|
|
8764
9193
|
import argparse
|
|
8765
9194
|
import json
|
|
@@ -8800,11 +9229,134 @@ def main():
|
|
|
8800
9229
|
sys.argv.pop(1)
|
|
8801
9230
|
sys.exit(ci_main())
|
|
8802
9231
|
|
|
9232
|
+
# Fast path for share / viral subcommands
|
|
9233
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("share", "--share", "-share", "tweet", "social"):
|
|
9234
|
+
open_b = any(arg in ("--open", "-o", "open") for arg in sys.argv[2:])
|
|
9235
|
+
print_viral_share_hub(open_browser=open_b)
|
|
9236
|
+
sys.exit(0)
|
|
9237
|
+
|
|
9238
|
+
# Fast path for sponsor / donate subcommands
|
|
9239
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("sponsor", "donate", "funding", "--sponsor", "-sponsor"):
|
|
9240
|
+
open_b = any(arg in ("--open", "-o", "open") for arg in sys.argv[2:])
|
|
9241
|
+
print_sponsor_hub(open_browser=open_b)
|
|
9242
|
+
sys.exit(0)
|
|
9243
|
+
|
|
8803
9244
|
# Fast path for promo / launch subcommands
|
|
8804
|
-
if len(sys.argv) > 1 and sys.argv[1].lower() in ("promo", "launch", "marketing"):
|
|
9245
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("promo", "launch", "marketing", "--promo", "-promo"):
|
|
8805
9246
|
from tzero.tzero_promo import main as promo_main
|
|
8806
|
-
sys.argv.
|
|
8807
|
-
sys.
|
|
9247
|
+
promo_args = [a for a in sys.argv[1:] if a.lower() not in ("promo", "launch", "marketing", "--promo", "-promo")]
|
|
9248
|
+
if sys.argv[1].lower() == "launch" and not any(a.startswith("--open") or a.startswith("-o") or a.startswith("--channel") for a in promo_args):
|
|
9249
|
+
promo_args.append("--open")
|
|
9250
|
+
sys.exit(promo_main(promo_args))
|
|
9251
|
+
|
|
9252
|
+
# Fast path for universal AI agent rules export (tzero rules / tzero rules --all)
|
|
9253
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("rules", "--rules", "-rules"):
|
|
9254
|
+
from tzero.tzero_features import AgentRulesGenerator
|
|
9255
|
+
target = "."
|
|
9256
|
+
for arg in sys.argv[2:]:
|
|
9257
|
+
if not arg.startswith("-"):
|
|
9258
|
+
target = arg
|
|
9259
|
+
break
|
|
9260
|
+
created = AgentRulesGenerator.export_all(target)
|
|
9261
|
+
print(f"\n\033[32m[SUCCESS] Exported {len(created)} AI Agent rule files:")
|
|
9262
|
+
for p in created:
|
|
9263
|
+
print(f" - {os.path.relpath(p, target)}")
|
|
9264
|
+
sys.exit(0)
|
|
9265
|
+
|
|
9266
|
+
# Fast path for star / github star command
|
|
9267
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("star", "--star", "-star", "github-star"):
|
|
9268
|
+
from tzero.tzero_traffic import open_github_star_page
|
|
9269
|
+
open_github_star_page(open_browser=True)
|
|
9270
|
+
sys.exit(0)
|
|
9271
|
+
|
|
9272
|
+
# Fast path for update / version check
|
|
9273
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("update", "--update", "version", "--version-check"):
|
|
9274
|
+
from tzero.tzero_traffic import check_version_and_updates
|
|
9275
|
+
open_b = any(arg in ("--open", "-o", "open") for arg in sys.argv[2:])
|
|
9276
|
+
check_version_and_updates(open_browser=open_b)
|
|
9277
|
+
sys.exit(0)
|
|
9278
|
+
|
|
9279
|
+
# Fast path for support / donate
|
|
9280
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("support", "donate", "--support", "--donate"):
|
|
9281
|
+
from tzero.tzero_traffic import print_crypto_support_card
|
|
9282
|
+
print_crypto_support_card()
|
|
9283
|
+
sys.exit(0)
|
|
9284
|
+
|
|
9285
|
+
# Fast path for live ROI dashboard
|
|
9286
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("roi", "stats", "--roi", "--stats"):
|
|
9287
|
+
from tzero.tzero_traffic import run_live_roi_dashboard
|
|
9288
|
+
target_dir = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else "."
|
|
9289
|
+
run_live_roi_dashboard(workspace_dir=target_dir)
|
|
9290
|
+
sys.exit(0)
|
|
9291
|
+
|
|
9292
|
+
# Fast path for disk clean / doctor clean
|
|
9293
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("disk-clean", "clean"):
|
|
9294
|
+
from tzero.tzero_traffic import run_system_disk_doctor
|
|
9295
|
+
target_dir = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else "."
|
|
9296
|
+
run_system_disk_doctor(clean=True, workspace_dir=target_dir)
|
|
9297
|
+
sys.exit(0)
|
|
9298
|
+
|
|
9299
|
+
# Fast path for Anti-REA armor / protection
|
|
9300
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("armor", "anti-rea", "--armor", "--anti-rea"):
|
|
9301
|
+
from tzero.tzero_armor import protect_path_with_armor
|
|
9302
|
+
target_path = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else "."
|
|
9303
|
+
res = protect_path_with_armor(target_path)
|
|
9304
|
+
if res.get("success"):
|
|
9305
|
+
print(f"[OK] Applied Anti-REA Armor to: {target_path}")
|
|
9306
|
+
if "score_after" in res:
|
|
9307
|
+
print(f" AI Resistance Score: {res.get('score_before')}/100 -> {res.get('score_after')}/100 [{res.get('rating')}]")
|
|
9308
|
+
elif "files_protected" in res:
|
|
9309
|
+
print(f" Protected {res['files_protected']} files in directory.")
|
|
9310
|
+
else:
|
|
9311
|
+
print(f"[FAIL] Armor protection failed: {res.get('error', 'Unknown error')}", file=sys.stderr)
|
|
9312
|
+
sys.exit(0 if res.get("success") else 1)
|
|
9313
|
+
|
|
9314
|
+
# Fast path for Anti-REA audit
|
|
9315
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("audit-rea", "--audit-rea"):
|
|
9316
|
+
from tzero.tzero_armor import audit_path_rea_resistance
|
|
9317
|
+
target_path = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else "."
|
|
9318
|
+
audit = audit_path_rea_resistance(target_path)
|
|
9319
|
+
print("================================================================================")
|
|
9320
|
+
print(" SHIELD AUDIT REPORT: AI REVERSE-ENGINEERING RESISTANCE (TDQS-REA)")
|
|
9321
|
+
print("================================================================================")
|
|
9322
|
+
print(f"Target: {target_path}")
|
|
9323
|
+
print(f"AI Score: {audit.get('score', 0)} / 100 [{audit.get('rating', 'UNKNOWN')}]")
|
|
9324
|
+
print(f"Status: {audit.get('status', 'N/A')}")
|
|
9325
|
+
if audit.get("defenses_active"):
|
|
9326
|
+
print("\nActive Defenses:")
|
|
9327
|
+
for k, v in audit["defenses_active"].items():
|
|
9328
|
+
print(f" [{'✔' if v else ' '}] {k}")
|
|
9329
|
+
recs = audit.get("sample_findings") or audit.get("findings", [])
|
|
9330
|
+
if recs:
|
|
9331
|
+
print("\nRecommendations:")
|
|
9332
|
+
for f in recs:
|
|
9333
|
+
print(f" • {f}")
|
|
9334
|
+
print("================================================================================")
|
|
9335
|
+
sys.exit(0)
|
|
9336
|
+
|
|
9337
|
+
# Fast path for Anti-REA shield-exe
|
|
9338
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("shield-exe", "--shield-exe"):
|
|
9339
|
+
from tzero.tzero_armor import shield_executable
|
|
9340
|
+
target_path = sys.argv[2] if len(sys.argv) > 2 and not sys.argv[2].startswith("-") else ""
|
|
9341
|
+
if not target_path:
|
|
9342
|
+
print("Usage: tzero shield-exe <path_to_binary.exe>", file=sys.stderr)
|
|
9343
|
+
sys.exit(1)
|
|
9344
|
+
res = shield_executable(target_path)
|
|
9345
|
+
if res.get("shielded"):
|
|
9346
|
+
print(f"[OK] Shielded executable against pyinstxtractor: {res.get('output_path', target_path)}")
|
|
9347
|
+
print(f" Decoy archive traps injected: {res.get('decoy_traps_injected', 0)}")
|
|
9348
|
+
else:
|
|
9349
|
+
print(f"[INFO] {res.get('reason', 'Already shielded or not a PyInstaller binary.')}")
|
|
9350
|
+
sys.exit(0 if res.get("shielded") else 1)
|
|
9351
|
+
|
|
9352
|
+
# Fast path for Anti-REA radar / gui
|
|
9353
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("radar", "--radar", "anti-rea-gui"):
|
|
9354
|
+
try:
|
|
9355
|
+
from tzero.anti_rea.gui import main as gui_main
|
|
9356
|
+
gui_main()
|
|
9357
|
+
except Exception as e:
|
|
9358
|
+
print(f"Error launching Anti-REA GUI: {e}", file=sys.stderr)
|
|
9359
|
+
sys.exit(0)
|
|
8808
9360
|
|
|
8809
9361
|
parser = argparse.ArgumentParser(
|
|
8810
9362
|
description="Siber Akademi T-Zero Context Architect - Enterprise Codebase Context Builder & Token Reducer",
|
|
@@ -8814,6 +9366,12 @@ def main():
|
|
|
8814
9366
|
T-Zero'yu sıfırdan yapay zeka araçlarındaki token israfını çözmek için geliştirdim.
|
|
8815
9367
|
Beni Google'da 'Toprak Ahmet Aydoğmuş' olarak aratabilirsiniz!
|
|
8816
9368
|
GitHub: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
9369
|
+
|
|
9370
|
+
💖 WEB3 & KRİPTO BAĞIŞ:
|
|
9371
|
+
tzero sponsor / python tzero_v3.py sponsor
|
|
9372
|
+
Ethereum: 0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5
|
|
9373
|
+
Bitcoin: bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s
|
|
9374
|
+
USDT: TE7uKxZJ414u938gWf6bYh9QvRk2141517
|
|
8817
9375
|
""",
|
|
8818
9376
|
formatter_class=argparse.RawTextHelpFormatter
|
|
8819
9377
|
)
|
|
@@ -8862,9 +9420,20 @@ def main():
|
|
|
8862
9420
|
parser.add_argument("--guard", "--verify-code", metavar="CODE_OR_FILE", help="Validate code against AST contracts to eliminate hallucinations before applying")
|
|
8863
9421
|
parser.add_argument("--grounding-contract", action="store_true", help="Generate immutable AST grounding contract for LLM prompt pinning")
|
|
8864
9422
|
parser.add_argument("--promo", action="store_true", help="Generate zero-cost organic launch kit in docs/launch/")
|
|
9423
|
+
parser.add_argument("--share", action="store_true", help="Generate 1-click social sharing links for Twitter/X, Reddit, Hacker News, and LinkedIn")
|
|
9424
|
+
parser.add_argument("--star", action="store_true", help="1-Click open GitHub repo in browser to give a star towards the 100 stars goal")
|
|
9425
|
+
parser.add_argument("--update", action="store_true", help="Check PyPI and GitHub for latest version and update commands")
|
|
9426
|
+
parser.add_argument("--sponsor", action="store_true", help="Display 1-click Web3 and crypto donation hub (Ethereum, Bitcoin, Tron)")
|
|
9427
|
+
parser.add_argument("--open", action="store_true", help="Open Web3 sponsor hub or link in default browser")
|
|
9428
|
+
parser.add_argument("--donate", "--support", action="store_true", dest="support", help="Display developer crypto donation & community support card")
|
|
9429
|
+
parser.add_argument("--roi", "--stats", action="store_true", dest="roi", help="Display live token reduction & financial dollars saved mini dashboard")
|
|
9430
|
+
parser.add_argument("--clean", "--disk-clean", action="store_true", dest="clean", help="Safely clean workspace temporary caches and build artifacts")
|
|
8865
9431
|
parser.add_argument("--patch", "--apply-patch", dest="apply_patch", metavar="DIFF_FILE_OR_STR", help="Apply patch with AST-tolerant fuzzy matching (whitespace & line drift agnostic)")
|
|
8866
9432
|
parser.add_argument("--target", default=None, metavar="TARGET_FILE", help="Target file for --patch (optional if patch specifies file header)")
|
|
8867
9433
|
parser.add_argument("--fuzzy", action="store_true", default=True, help="Enable fuzzy AST and whitespace matching for patch application (default: True)")
|
|
9434
|
+
parser.add_argument("--armor", "--anti-rea", nargs="?", const=".", default=None, metavar="PATH", dest="armor", help="Apply military-grade Anti-REA armor against AI reverse engineering (morluto/rea)")
|
|
9435
|
+
parser.add_argument("--audit-rea", nargs="?", const=".", default=None, metavar="PATH", dest="audit_rea", help="Audit code or binary for resistance against AI reverse engineering (0-100)")
|
|
9436
|
+
parser.add_argument("--telemetry", action="store_true", help="Show offline SQLite token savings & ROI telemetry report")
|
|
8868
9437
|
parser.add_argument("--no-fuzzy", dest="fuzzy", action="store_false", help="Disable fuzzy matching and enforce exact line matches only")
|
|
8869
9438
|
parser.add_argument("--dry-run-patch", action="store_true", help="Validate patch applicability without modifying files on disk")
|
|
8870
9439
|
parser.add_argument("--reverse-patch", action="store_true", help="Un-apply / revert patch changes")
|
|
@@ -8884,7 +9453,7 @@ def main():
|
|
|
8884
9453
|
default="o200k_base", help="BPE encoding for --symbol-context")
|
|
8885
9454
|
parser.add_argument("--cache-aligned", action="store_true", help="Order context for KV-cache prefix stability (immutable static prefix before dynamic query suffix)")
|
|
8886
9455
|
parser.add_argument("--commit-msg", action="store_true", help="Generate Conventional Commit message from local AST git diff ($0 local engine)")
|
|
8887
|
-
parser.add_argument("--changelog", nargs="?", const="
|
|
9456
|
+
parser.add_argument("--changelog", nargs="?", const="v12.2.0", default=None, metavar="VERSION", help="Generate release CHANGELOG markdown from git history")
|
|
8888
9457
|
parser.add_argument("--ci", choices=["github", "gitlab", "pre-commit", "local", "all"], default=None, help="Install CI/CD workflow or run local verification suite")
|
|
8889
9458
|
parser.add_argument("--local-ci", action="store_true", help="Run comprehensive Local CI & Pre-Push verification battery ($0 quota burn)")
|
|
8890
9459
|
parser.add_argument("--quick-ci", action="store_true", help="Run fast Local CI smoke checks in seconds")
|
|
@@ -8948,7 +9517,7 @@ def main():
|
|
|
8948
9517
|
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")
|
|
8949
9518
|
parser.add_argument("--showcase", nargs="?", const="tzero_showcase.html", default=None, metavar="FILE", help="Generate interactive split-screen HTML5 comparison showcase slider")
|
|
8950
9519
|
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")
|
|
8951
|
-
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect
|
|
9520
|
+
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v12.2.0 Master Edition (engine v4.1.0)")
|
|
8952
9521
|
|
|
8953
9522
|
|
|
8954
9523
|
def print_master_tutorial():
|
|
@@ -9057,7 +9626,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9057
9626
|
def print_quickstart_guide():
|
|
9058
9627
|
print("""
|
|
9059
9628
|
================================================================================
|
|
9060
|
-
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP
|
|
9629
|
+
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.2.0 MASTER (engine v4.1.0)
|
|
9061
9630
|
================================================================================
|
|
9062
9631
|
🎯 %95'e Varan Token Tasarrufu & Otonom Yapay Zeka Mimari Bağlam Motoru
|
|
9063
9632
|
|
|
@@ -9129,6 +9698,9 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9129
9698
|
"install-ide": "--install-ide",
|
|
9130
9699
|
"install": "--install-ide",
|
|
9131
9700
|
"add-mcp": "--install-ide",
|
|
9701
|
+
"share": "--share",
|
|
9702
|
+
"tweet": "--share",
|
|
9703
|
+
"social": "--share",
|
|
9132
9704
|
"audit": "--audit",
|
|
9133
9705
|
"vault": "--vault",
|
|
9134
9706
|
"auto-vault": "--auto-vault",
|
|
@@ -9217,6 +9789,8 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9217
9789
|
"card": "--card",
|
|
9218
9790
|
"badge": "--card",
|
|
9219
9791
|
"showcase": "--showcase",
|
|
9792
|
+
"star": "--star",
|
|
9793
|
+
"telemetry": "--telemetry",
|
|
9220
9794
|
}
|
|
9221
9795
|
if sub in sub_map:
|
|
9222
9796
|
sys.argv[1] = sub_map[sub]
|
|
@@ -9239,12 +9813,65 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9239
9813
|
return
|
|
9240
9814
|
|
|
9241
9815
|
args = parser.parse_args()
|
|
9242
|
-
if getattr(args, "
|
|
9816
|
+
if getattr(args, "star", False):
|
|
9817
|
+
from tzero.tzero_traffic import open_github_star_page
|
|
9818
|
+
open_github_star_page(open_browser=True)
|
|
9819
|
+
return
|
|
9820
|
+
elif getattr(args, "update", False):
|
|
9821
|
+
from tzero.tzero_traffic import check_version_and_updates
|
|
9822
|
+
check_version_and_updates()
|
|
9823
|
+
return
|
|
9824
|
+
elif getattr(args, "sponsor", False):
|
|
9825
|
+
print_sponsor_hub(open_browser=getattr(args, "open", False))
|
|
9826
|
+
return
|
|
9827
|
+
elif getattr(args, "support", False):
|
|
9828
|
+
from tzero.tzero_traffic import print_crypto_support_card
|
|
9829
|
+
print_crypto_support_card()
|
|
9830
|
+
return
|
|
9831
|
+
elif getattr(args, "roi", False):
|
|
9832
|
+
from tzero.tzero_traffic import run_live_roi_dashboard
|
|
9833
|
+
run_live_roi_dashboard(workspace_dir=args.dir)
|
|
9834
|
+
return
|
|
9835
|
+
elif getattr(args, "clean", False):
|
|
9836
|
+
from tzero.tzero_traffic import run_system_disk_doctor
|
|
9837
|
+
run_system_disk_doctor(clean=True, workspace_dir=args.dir)
|
|
9838
|
+
return
|
|
9839
|
+
elif getattr(args, "armor", None):
|
|
9840
|
+
from tzero.tzero_armor import protect_path_with_armor
|
|
9841
|
+
res = protect_path_with_armor(args.armor)
|
|
9842
|
+
if res.get("success"):
|
|
9843
|
+
print(f"[OK] Applied Anti-REA Armor to: {args.armor}")
|
|
9844
|
+
if "score_after" in res:
|
|
9845
|
+
print(f" AI Resistance Score: {res.get('score_before')}/100 -> {res.get('score_after')}/100 [{res.get('rating')}]")
|
|
9846
|
+
elif "files_protected" in res:
|
|
9847
|
+
print(f" Protected {res['files_protected']} files in directory.")
|
|
9848
|
+
else:
|
|
9849
|
+
print(f"[FAIL] Armor protection failed: {res.get('error', 'Unknown error')}", file=sys.stderr)
|
|
9850
|
+
sys.exit(1)
|
|
9851
|
+
return
|
|
9852
|
+
elif getattr(args, "audit_rea", None):
|
|
9853
|
+
from tzero.tzero_armor import audit_path_rea_resistance
|
|
9854
|
+
audit = audit_path_rea_resistance(args.audit_rea)
|
|
9855
|
+
print(json.dumps(audit, indent=2))
|
|
9856
|
+
return
|
|
9857
|
+
elif getattr(args, "telemetry", False):
|
|
9858
|
+
from tzero.tzero_telemetry import get_summary, render_report
|
|
9859
|
+
ws_dir = getattr(args, "dir", ".") or "."
|
|
9860
|
+
if getattr(args, "format", "text") == "json":
|
|
9861
|
+
print(json.dumps(get_summary(workspace_dir=ws_dir), indent=2))
|
|
9862
|
+
else:
|
|
9863
|
+
print(render_report(workspace_dir=ws_dir))
|
|
9864
|
+
return
|
|
9865
|
+
elif getattr(args, "info", False):
|
|
9243
9866
|
print_quickstart_guide()
|
|
9244
9867
|
return
|
|
9245
9868
|
elif getattr(args, "promo", False):
|
|
9246
9869
|
from tzero.tzero_promo import main as promo_main
|
|
9247
|
-
sys.
|
|
9870
|
+
promo_args = [a for a in sys.argv[1:] if a.lower() not in ("--promo", "-promo")]
|
|
9871
|
+
sys.exit(promo_main(promo_args))
|
|
9872
|
+
elif getattr(args, "share", False):
|
|
9873
|
+
print_viral_share_hub()
|
|
9874
|
+
return
|
|
9248
9875
|
elif args.doctor:
|
|
9249
9876
|
if tzero_deps is None:
|
|
9250
9877
|
print("[ERROR] tzero_deps.py is missing; reinstall T-Zero to use --doctor.")
|
|
@@ -9422,8 +10049,8 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9422
10049
|
print(f" [LAYER VIOLATION] {v['file']}:{v['line']} (layer: {v['layer']}) imports forbidden '{v['imported']}' - {v['reason']}")
|
|
9423
10050
|
for c in report["circular_cycles"]:
|
|
9424
10051
|
print(f" [CIRCULAR IMPORT] Cycle detected: {c}")
|
|
9425
|
-
for
|
|
9426
|
-
print(f" [SECRET LEAK
|
|
10052
|
+
for idx, _ in enumerate(report["secret_leaks"], 1):
|
|
10053
|
+
print(f" [SECRET LEAK #{idx}] Hardcoded credential detected by audit rule.")
|
|
9427
10054
|
print()
|
|
9428
10055
|
sys.exit(1)
|
|
9429
10056
|
elif getattr(args, "mutate", None) is not None:
|
|
@@ -9973,7 +10600,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9973
10600
|
if not os.path.exists(app_path):
|
|
9974
10601
|
app_path = os.path.join(os.getcwd(), "huggingface-space", "app.py")
|
|
9975
10602
|
print("\033[36m" + "=" * 80)
|
|
9976
|
-
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (
|
|
10603
|
+
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.2.0)")
|
|
9977
10604
|
print("=" * 80 + "\033[0m")
|
|
9978
10605
|
print("🌐 Official Live Space : https://huggingface.co/spaces/toprakke4/tzero-token-reducer")
|
|
9979
10606
|
print(f"📁 Local Application : {app_path}")
|
|
@@ -10010,13 +10637,9 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10010
10637
|
if args.migrate:
|
|
10011
10638
|
with open(target, "w", encoding="utf-8") as f:
|
|
10012
10639
|
f.write(migrated_code)
|
|
10013
|
-
print(f"[AUTO-VAULT] Successfully migrated {count} secret(s)
|
|
10640
|
+
print(f"[AUTO-VAULT] Successfully migrated {count} secret(s) into .env and updated code.")
|
|
10014
10641
|
else:
|
|
10015
|
-
print(
|
|
10016
|
-
print("\n--- .env preview ---")
|
|
10017
|
-
print(env_file)
|
|
10018
|
-
print("\n--- Refactored Code Preview ---")
|
|
10019
|
-
print(migrated_code[:1000])
|
|
10642
|
+
print(f"[AUTO-VAULT DRY-RUN] Detected {count} hardcoded credential(s) ready for .env migration. Re-run with --migrate to apply.")
|
|
10020
10643
|
else:
|
|
10021
10644
|
findings = ZeroLeakEngine.scan_workspace(target)
|
|
10022
10645
|
violations = findings.get("violations", [])
|
|
@@ -10025,8 +10648,8 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10025
10648
|
print("[AUTO-VAULT] 100% Zero-Leak Verified. No hardcoded credentials found.")
|
|
10026
10649
|
else:
|
|
10027
10650
|
print(f"[AUTO-VAULT] Found {len(violations)} secret(s) across {findings.get('files_with_violations', 0)} file(s).")
|
|
10028
|
-
for
|
|
10029
|
-
print(f" - [
|
|
10651
|
+
for idx, _ in enumerate(violations, 1):
|
|
10652
|
+
print(f" - [FINDING #{idx}] Credential pattern detected (redacted).")
|
|
10030
10653
|
if args.migrate:
|
|
10031
10654
|
total_migrated = 0
|
|
10032
10655
|
violating_files = sorted({v.get("file", "") for v in violations if v.get("file")})
|