tzero-mcp 12.2.1 → 12.3.2

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.
Files changed (55) hide show
  1. package/README.md +6 -30
  2. package/bin/tzero-mcp.js +2 -2
  3. package/bin/tzero.js +11 -6
  4. package/package.json +1 -2
  5. package/src/addmcp.py +10 -5
  6. package/src/app.py +3 -9
  7. package/src/tzero/__init__.py +1 -1
  8. package/src/tzero/anti_rea/__init__.py +16 -2
  9. package/src/tzero/anti_rea/algebraic_mutator.py +65 -44
  10. package/src/tzero/anti_rea/anti_debugger.py +51 -18
  11. package/src/tzero/anti_rea/asar_shield.py +24 -1
  12. package/src/tzero/anti_rea/auditor.py +62 -12
  13. package/src/tzero/anti_rea/canary_beacon.py +56 -76
  14. package/src/tzero/anti_rea/cli.py +37 -5
  15. package/src/tzero/anti_rea/confusables.py +62 -18
  16. package/src/tzero/anti_rea/crypto_loader.py +132 -0
  17. package/src/tzero/anti_rea/engine.py +129 -29
  18. package/src/tzero/anti_rea/extractor_shield.py +91 -13
  19. package/src/tzero/anti_rea/gui.py +1 -4
  20. package/src/tzero/anti_rea/integrity_guard.py +17 -5
  21. package/src/tzero/anti_rea/rdtsc_guard.py +21 -8
  22. package/src/tzero/anti_rea/string_vault.py +10 -7
  23. package/src/tzero/anti_rea/tier_catalog.py +388 -0
  24. package/src/tzero/siber_akademi.ico +0 -0
  25. package/src/tzero/siber_akademi_icon.py +14 -8
  26. package/src/tzero/tzero_armor.py +29 -7
  27. package/src/tzero/tzero_benchmark.py +4 -2
  28. package/src/tzero/tzero_budget.py +14 -5
  29. package/src/tzero/tzero_ci.py +2 -2
  30. package/src/tzero/tzero_contracts.py +7 -5
  31. package/src/tzero/tzero_dashboard.py +28 -9
  32. package/src/tzero/tzero_debt.py +19 -4
  33. package/src/tzero/tzero_deps.py +109 -87
  34. package/src/tzero/tzero_explain.py +1 -1
  35. package/src/tzero/tzero_features.py +43 -29
  36. package/src/tzero/tzero_federation.py +9 -2
  37. package/src/tzero/tzero_fixer/mcp_server.py +10 -0
  38. package/src/tzero/tzero_golden.py +37 -9
  39. package/src/tzero/tzero_growth.py +166 -8
  40. package/src/tzero/tzero_guard.py +147 -46
  41. package/src/tzero/tzero_jarvis/workspace_orchestrator.py +1 -1
  42. package/src/tzero/tzero_jarvis/zero_key_router.py +10 -78
  43. package/src/tzero/tzero_lsp.py +1 -1
  44. package/src/tzero/tzero_mcp.py +71 -23
  45. package/src/tzero/tzero_mutation.py +92 -15
  46. package/src/tzero/tzero_promo.py +1 -1
  47. package/src/tzero/tzero_proxy.py +105 -12
  48. package/src/tzero/tzero_scip.py +12 -6
  49. package/src/tzero/tzero_security.py +404 -60
  50. package/src/tzero/tzero_task_benchmark.py +2 -2
  51. package/src/tzero/tzero_traffic.py +35 -10
  52. package/src/tzero/tzero_tui.py +20 -11
  53. package/src/tzero/tzero_v3.py +304 -153
  54. package/src/tzero/tzero_welcome.py +12 -4
  55. package/bin/postinstall.js +0 -30
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- """Siber Akademi T-Zero — Traffic, Update & Crypto Support Engine (v12.0.0).
2
+ """Siber Akademi T-Zero — Traffic, Update & Crypto Support Engine (v12.2.1).
3
3
 
4
4
  Developer: Toprak Ahmet Aydoğmuş (Siber Akademi)
5
5
  License: AGPL-3.0-only
@@ -18,7 +18,7 @@ import webbrowser
18
18
  from pathlib import Path
19
19
  from typing import Any, Dict, List, Optional, Tuple
20
20
 
21
- CURRENT_VERSION = "12.2.1"
21
+ CURRENT_VERSION = "12.3.2"
22
22
  REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
23
23
  RELEASES_URL = f"{REPO_URL}/releases"
24
24
  PYPI_URL = "https://pypi.org/project/tzero-mcp/"
@@ -237,12 +237,13 @@ def run_live_roi_dashboard(workspace_dir: str = ".") -> Dict[str, Any]:
237
237
  for model, d_val in dollar_savings.items():
238
238
  dashboard += f"\n║ • {model:<20}: \033[1;32m${d_val:>7.4f} USD\033[1;32m ({d_val*100:>6.2f}¢) ║"
239
239
 
240
+ roi_stats = _resolve_community_stats()
240
241
  dashboard += f"""
241
242
  ╠══════════════════════════════════════════════════════════════════════════════╣
242
243
  ║ 💡 100 çağrılık bir Claude/Cursor sprintinde net tasarruf: \033[1;33m${dollar_savings.get('Claude 3.7 Sonnet', 0.0)*100:>6.2f} USD\033[1;32m ║
243
244
  ╠══════════════════════════════════════════════════════════════════════════════╣
244
245
  ║ ⭐ T-Zero projenizi hızlandırıp token kurtardıysa, 1 yıldız verin: ║
245
- ║ ► tzero star (Mevcut: 45 / 100 Hedef) ║
246
+ ║ ► tzero star (Mevcut: {roi_stats['stars']} / {roi_stats['target_stars']} Hedef) ║
246
247
  ╚══════════════════════════════════════════════════════════════════════════════╝\033[0m
247
248
  """
248
249
  print(dashboard)
@@ -314,15 +315,39 @@ def run_system_disk_doctor(clean: bool = False, workspace_dir: str = ".") -> Dic
314
315
  }
315
316
 
316
317
 
318
+ def _resolve_community_stats() -> Dict[str, Any]:
319
+ """Retrieve live (with fast cache/offline fallback) star and download stats."""
320
+ try:
321
+ from tzero.tzero_growth import get_live_community_stats
322
+ return get_live_community_stats(timeout=1.5)
323
+ except Exception:
324
+ try:
325
+ from tzero_growth import get_live_community_stats
326
+ return get_live_community_stats(timeout=1.5)
327
+ except Exception:
328
+ return {
329
+ "stars": 111,
330
+ "target_stars": 250,
331
+ "progress_pct": 44.4,
332
+ "downloads_label": "22,900+",
333
+ "saved_tokens_label": "1,120,000+",
334
+ }
335
+
336
+
317
337
  def open_github_star_page(open_browser: bool = True) -> Dict[str, Any]:
318
- """Displays 100-star milestone encouragement and opens GitHub repository in browser."""
338
+ """Displays live star milestone progress and opens GitHub repository in browser."""
339
+ stats = _resolve_community_stats()
340
+ stars = int(stats["stars"])
341
+ target_stars = int(stats["target_stars"])
342
+ dl_label = str(stats["downloads_label"])
343
+ saved_label = str(stats.get("saved_tokens_label", "1,120,000+"))
319
344
  banner = f"""
320
345
  \033[1;33m╔══════════════════════════════════════════════════════════════════════════════╗
321
- ║ ⭐ T-ZERO 100 YILDIZ HEDEFİ: TOPLULUĞA KATILIN! ║
346
+ ║ ⭐ T-ZERO {target_stars} YILDIZ HEDEFİ: TOPLULUĞA KATILIN! ║
322
347
  ╠══════════════════════════════════════════════════════════════════════════════╣
323
348
  ║ ║
324
- ║ 🎉 20,880+ İndirme & 1,120,000+ Kurtarılan Token! ║
325
- ║ ⭐ Mevcut Yıldız Sayısı: 45 / 100 Hedef (Topluluk Desteği) ║
349
+ ║ 🎉 {dl_label} İndirme & {saved_label} Kurtarılan Token! ║
350
+ ║ ⭐ Mevcut Yıldız Sayısı: {stars} / {target_stars} Hedef (Topluluk Desteği) ║
326
351
  ║ ║
327
352
  ║ T-Zero'nun bağımsız, reklamsız ve %100 BEDAVA kalabilmesi için ║
328
353
  ║ GitHub depomuza 1 yıldız (Star) vererek bize güç katın! ║
@@ -342,9 +367,9 @@ def open_github_star_page(open_browser: bool = True) -> Dict[str, Any]:
342
367
  pass
343
368
  return {
344
369
  "repo_url": REPO_URL,
345
- "current_stars": 45,
346
- "target_stars": 100,
347
- "downloads": "20,880+",
370
+ "current_stars": stars,
371
+ "target_stars": target_stars,
372
+ "downloads": dl_label,
348
373
  "opened_browser": opened,
349
374
  }
350
375
 
@@ -135,7 +135,7 @@ class TZeroTerminalCockpit:
135
135
  ("9", "Run AST Mutation Test Suite", "🧬 Run AST Mutation Test Suite (`tzero --mutate <file>`)"),
136
136
  ("10", "Code Health & Technical Debt Index", "🏥 Code Health & Technical Debt Index (`tzero --debt`)"),
137
137
  ("11", "Context Budget Optimizer & Certificate", "📜 Context Budget Optimizer & Certificate (`tzero --budget`)"),
138
- ("12", "Anti-REA 26-Tier Armor & Audit", "🛡️ Anti-REA 26-Tier Armor & Audit (`tzero --audit-rea`)"),
138
+ ("12", "Anti-REA 180-Tier Armor & Audit", "🛡️ Anti-REA 180-Tier Armor & Audit (`tzero --audit-rea`)"),
139
139
  ("13", "Offline Telemetry & ROI Tracker", "📊 Offline Telemetry & ROI Tracker (`tzero --telemetry`)"),
140
140
  ("0", "Exit TUI", "🚪 Exit TUI"),
141
141
  ]
@@ -180,8 +180,8 @@ class TZeroTerminalCockpit:
180
180
  box_bottom = f"{c.CYAN}╚{'═' * 78}╝{c.RESET}"
181
181
 
182
182
  lines.append(box_top)
183
- lines.append(cls._box_line(f" {c.BOLD}{c.BRIGHT_CYAN}⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & LIVE COCKPIT v12.2.1{c.RESET}"))
184
- lines.append(cls._box_line(f" {c.DIM}Zero-Leak AST Intelligence | 100% Offline | $0 Cloud Cost Guarantee{c.RESET}"))
183
+ lines.append(cls._box_line(f" {c.BOLD}{c.BRIGHT_CYAN}⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & LIVE COCKPIT v12.3.2{c.RESET}"))
184
+ lines.append(cls._box_line(f" {c.DIM}Local AST Analysis | Optional Network Services{c.RESET}"))
185
185
  lines.append(box_mid)
186
186
 
187
187
  # Workspace summary line
@@ -325,7 +325,7 @@ class TZeroTerminalCockpit:
325
325
  elif choice == "4":
326
326
  from tzero.tzero_commit import LocalSemanticCommitSynthesizer
327
327
  print(f"\n{cls.YELLOW}[Synthesizing Release CHANGELOG]...{cls.RESET}")
328
- entry = LocalSemanticCommitSynthesizer.generate_changelog_entry(version="v12.2.1", repo_dir=workspace_dir)
328
+ entry = LocalSemanticCommitSynthesizer.generate_changelog_entry(version="v12.3.2", repo_dir=workspace_dir)
329
329
  print(f"\n{cls.BRIGHT_CYAN}{entry}{cls.RESET}\n")
330
330
  input("Press Enter to return to cockpit...")
331
331
  elif choice == "5":
@@ -402,7 +402,7 @@ class TZeroTerminalCockpit:
402
402
  input("Press Enter to return to cockpit...")
403
403
  elif choice == "12":
404
404
  from tzero.tzero_armor import audit_path_rea_resistance, protect_path_with_armor
405
- print(f"\n{cls.YELLOW}[Auditing 26-Tier Anti-REA Resistance for {workspace_dir}]...{cls.RESET}")
405
+ print(f"\n{cls.YELLOW}[Auditing 180-Tier Anti-REA Resistance for {workspace_dir}]...{cls.RESET}")
406
406
  audit = audit_path_rea_resistance(workspace_dir)
407
407
  print(f"{cls.BRIGHT_CYAN}AI Resistance Score: {audit.get('score', 0)}/100 ({audit.get('rating', 'UNKNOWN')}){cls.RESET}")
408
408
  apply_ans = input("Apply Anti-REA armor to target file/dir now? [y/N]: ").strip().lower()
@@ -443,7 +443,7 @@ class TZeroTerminalCockpit:
443
443
  # Fallback for non-interactive / piped environments
444
444
  if not sys.stdin.isatty():
445
445
  try:
446
- choice = input(f"\n{cls.BOLD}Select an action [0-11] (or press Enter to refresh): {cls.RESET}").strip()
446
+ choice = input(f"\n{cls.BOLD}Select an action [0-13] (or press Enter to refresh): {cls.RESET}").strip()
447
447
  except (KeyboardInterrupt, EOFError):
448
448
  print(f"\n{cls.CYAN}Goodbye! T-Zero Context Engine active.{cls.RESET}")
449
449
  break
@@ -457,7 +457,7 @@ class TZeroTerminalCockpit:
457
457
  chosen = False
458
458
  choice = ""
459
459
  while not chosen:
460
- print(f"\r{cls.BOLD} Navigate [↑/↓/←/→, w/s, k/j] │ Select [Enter] │ Quick Jump [0-11] │ Exit [q/esc]: {cls.RESET}", end="", flush=True)
460
+ print(f"\r{cls.BOLD} Navigate [↑/↓/←/→, w/s, k/j] │ Select [Enter] │ Quick Jump [0-13] │ Exit [q/esc]: {cls.RESET}", end="", flush=True)
461
461
  key = cls._read_key()
462
462
  if not key:
463
463
  time.sleep(0.04)
@@ -510,12 +510,21 @@ class TZeroTerminalCockpit:
510
510
 
511
511
  def main():
512
512
  """CLI entrypoint for standalone cockpit execution."""
513
- target_dir = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith("-") else "."
514
- if "--snapshot" in sys.argv:
515
- metrics = TZeroTerminalCockpit.gather_workspace_metrics(target_dir)
513
+ import argparse
514
+
515
+ parser = argparse.ArgumentParser(
516
+ prog="tzero-tui",
517
+ description="T-Zero Interactive Terminal Cockpit (Zero-Leak, Context Engine & Telemetry)",
518
+ )
519
+ parser.add_argument("target_dir", nargs="?", default=".", help="Workspace directory to inspect (default: .)")
520
+ parser.add_argument("--snapshot", action="store_true", help="Print a non-interactive snapshot and exit")
521
+ args = parser.parse_args()
522
+
523
+ if args.snapshot:
524
+ metrics = TZeroTerminalCockpit.gather_workspace_metrics(args.target_dir)
516
525
  print(TZeroTerminalCockpit.render_cockpit(metrics))
517
526
  else:
518
- TZeroTerminalCockpit.run_interactive(target_dir)
527
+ TZeroTerminalCockpit.run_interactive(args.target_dir)
519
528
 
520
529
 
521
530
  if __name__ == "__main__":