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.
Files changed (71) hide show
  1. package/CONTRIBUTING.md +4 -4
  2. package/README.md +5 -5
  3. package/bin/postinstall.js +10 -2
  4. package/bin/tzero-mcp.js +1 -1
  5. package/bin/tzero.js +17 -0
  6. package/package.json +1 -1
  7. package/src/addmcp.py +34 -23
  8. package/src/app.py +1 -1
  9. package/src/main.py +6 -0
  10. package/src/tzero/__init__.py +10 -0
  11. package/src/tzero/anti_rea/__init__.py +70 -0
  12. package/src/tzero/anti_rea/algebraic_mutator.py +86 -0
  13. package/src/tzero/anti_rea/anti_agent_guard.py +96 -0
  14. package/src/tzero/anti_rea/anti_debugger.py +239 -0
  15. package/src/tzero/anti_rea/anti_vm.py +160 -0
  16. package/src/tzero/anti_rea/asar_shield.py +99 -0
  17. package/src/tzero/anti_rea/auditor.py +158 -0
  18. package/src/tzero/anti_rea/bpe_disrupter.py +48 -0
  19. package/src/tzero/anti_rea/bytecode_trap.py +85 -0
  20. package/src/tzero/anti_rea/canary_beacon.py +187 -0
  21. package/src/tzero/anti_rea/cli.py +102 -0
  22. package/src/tzero/anti_rea/confusables.py +86 -0
  23. package/src/tzero/anti_rea/engine.py +204 -0
  24. package/src/tzero/anti_rea/extractor_shield.py +102 -0
  25. package/src/tzero/anti_rea/flattener.py +136 -0
  26. package/src/tzero/anti_rea/gui.py +267 -0
  27. package/src/tzero/anti_rea/honeypot.py +58 -0
  28. package/src/tzero/anti_rea/integrity_guard.py +66 -0
  29. package/src/tzero/anti_rea/jailbreak_decoy.py +77 -0
  30. package/src/tzero/anti_rea/mcp_poison.py +41 -0
  31. package/src/tzero/anti_rea/native_bridge.py +169 -0
  32. package/src/tzero/anti_rea/rdtsc_guard.py +64 -0
  33. package/src/tzero/anti_rea/string_vault.py +94 -0
  34. package/src/tzero/anti_rea/sybil_network.py +53 -0
  35. package/src/tzero/anti_rea/timing_guard.py +46 -0
  36. package/src/tzero/anti_rea/token_bomb.py +65 -0
  37. package/src/tzero/anti_rea/traps.py +76 -0
  38. package/src/tzero/anti_rea/vm_obfuscator.py +182 -0
  39. package/src/tzero/siber_akademi.ico +0 -0
  40. package/src/tzero/siber_akademi_icon.py +1 -1
  41. package/src/tzero/tzero_armor.py +165 -0
  42. package/src/tzero/tzero_bridge.py +28 -15
  43. package/src/tzero/tzero_budget.py +10 -3
  44. package/src/tzero/tzero_card.py +7 -5
  45. package/src/tzero/tzero_ci.py +1 -0
  46. package/src/tzero/tzero_contracts.py +30 -11
  47. package/src/tzero/tzero_dashboard.py +34 -14
  48. package/src/tzero/tzero_debt.py +14 -5
  49. package/src/tzero/tzero_federation.py +11 -6
  50. package/src/tzero/tzero_fixer/security_zero_leak.py +21 -3
  51. package/src/tzero/tzero_golden.py +11 -6
  52. package/src/tzero/tzero_graph_hud.html +1 -1
  53. package/src/tzero/tzero_growth.py +10 -10
  54. package/src/tzero/tzero_jarvis/agent_guard.py +16 -10
  55. package/src/tzero/tzero_jarvis/workspace_orchestrator.py +34 -23
  56. package/src/tzero/tzero_lsp.py +1 -1
  57. package/src/tzero/tzero_mcp.py +89 -31
  58. package/src/tzero/tzero_mutation.py +44 -16
  59. package/src/tzero/tzero_neural_cortex.py +1 -1
  60. package/src/tzero/tzero_pc_fixer.py +21 -3
  61. package/src/tzero/tzero_promo.py +196 -36
  62. package/src/tzero/tzero_rust_bridge.py +1086 -42
  63. package/src/tzero/tzero_scip.py +15 -2
  64. package/src/tzero/tzero_semantic_merge.py +34 -10
  65. package/src/tzero/tzero_task_benchmark.py +2 -2
  66. package/src/tzero/tzero_telemetry.py +146 -0
  67. package/src/tzero/tzero_terminal.py +366 -0
  68. package/src/tzero/tzero_traffic.py +350 -0
  69. package/src/tzero/tzero_tui.py +342 -133
  70. package/src/tzero/tzero_v3.py +652 -29
  71. package/src/tzero/tzero_welcome.py +72 -12
@@ -12,8 +12,31 @@ import subprocess
12
12
  from pathlib import Path
13
13
  from typing import Optional
14
14
 
15
+ try:
16
+ from tzero.tzero_terminal import (
17
+ init_terminal,
18
+ sanitize_terminal_text,
19
+ supports_ansi,
20
+ )
21
+ except ImportError:
22
+ try:
23
+ from tzero_terminal import (
24
+ init_terminal,
25
+ sanitize_terminal_text,
26
+ supports_ansi,
27
+ )
28
+ except ImportError:
29
+ def init_terminal(*args, **kwargs):
30
+ pass
31
+
32
+ def sanitize_terminal_text(text, *args, **kwargs):
33
+ return text
34
+
35
+ def supports_ansi(*args, **kwargs):
36
+ return False
37
+
15
38
  REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
16
- VERSION = "11.15.2"
39
+ VERSION = "12.2.0"
17
40
  _BANNER_PRINTED = False
18
41
 
19
42
 
@@ -28,25 +51,30 @@ def find_git_root(start_dir: Optional[Path] = None) -> Optional[Path]:
28
51
 
29
52
  def get_welcome_banner(version: str = VERSION) -> str:
30
53
  """Returns the ANSI styled welcome banner asking developers to star the project."""
31
- return f"""\033[1;36m
54
+ raw_banner = f"""\033[1;36m
32
55
  ┌──────────────────────────────────────────────────────────────────────────────┐
33
- │ ⭐ WELCOME TO T-ZERO CONTEXT ARCHITECT & MCP SUITE (v{version}) │
56
+ │ ★ WELCOME TO T-ZERO CONTEXT ARCHITECT & MCP SUITE (v{version}) │
34
57
  ├──────────────────────────────────────────────────────────────────────────────┤
35
58
  │ │
36
59
  │ Hi! I'm Toprak Ahmet Aydoğmuş (independent engineer at Siber Akademi). │
37
- │ Thank you for cloning & checking out T-Zero! │
60
+ │ T-Zero has reached \033[1;32m20,880+ downloads\033[1;36m across PyPI & npm! │
38
61
  │ │
39
62
  │ T-Zero slashes AI coding prompt tokens by 85–95% using deterministic AST │
40
63
  │ signature extraction with 100% Zero-Leak security and 20 MCP tools. │
41
64
  │ │
42
- │ ⭐ \033[1;33mIf this saves your context window, please drop a star on GitHub:\033[1;36m │
43
- │ \033[1;32m👉 {REPO_URL}\033[1;36m │
65
+ │ ★ \033[1;33mHELP US REACH OUR 100 STARS GOAL (Current: 45/100):\033[1;36m │
66
+ │ \033[1;32m► Run 'tzero star' or visit: {REPO_URL}\033[1;36m │
67
+ │ │
68
+ │ 💖 \033[1;35mSPONSOR & KEEP T-ZERO 100% FREE:\033[1;36m │
69
+ │ \033[1;32m► https://github.com/sponsors/toprakahmetaydogmus\033[1;36m │
44
70
  │ │
45
- │ 💡 Quick Start: │
71
+ │ • Quick Commands: │
72
+ │ \033[1;37mtzero star\033[1;36m 1-Click open GitHub & star the project │
46
73
  │ \033[1;37mtzero install-ide\033[1;36m 1-Click install into Cursor, Claude, Windsurf │
47
74
  │ \033[1;37mtzero-mcp\033[1;36m Start local Model Context Protocol server │
48
- │ \033[1;37mtzero --benchmark\033[1;36m Run multi-model token savings benchmark │
75
+ │ \033[1;37mtzero roi\033[1;36m View live token & dollar ($) savings dashboard │
49
76
  └──────────────────────────────────────────────────────────────────────────────┘\033[0m"""
77
+ return sanitize_terminal_text(raw_banner)
50
78
 
51
79
 
52
80
  def print_star_banner(force: bool = False) -> None:
@@ -76,14 +104,44 @@ def print_star_banner(force: bool = False) -> None:
76
104
  return
77
105
 
78
106
  try:
107
+ init_terminal()
79
108
  print(get_welcome_banner())
80
109
  _BANNER_PRINTED = True
110
+ # On first interactive terminal run, open GitHub repository to encourage star
111
+ check_first_launch_repo_open()
81
112
  # Silently ensure git hooks are installed if running inside repository
82
113
  install_git_star_hooks()
83
114
  except Exception:
84
115
  pass
85
116
 
86
117
 
118
+ def check_first_launch_repo_open(force_open: bool = False, state_path: Optional[Path] = None) -> bool:
119
+ """On first interactive launch, opens the GitHub repository in browser and prompts to star."""
120
+ state_file = state_path or (Path.home() / ".tzero" / "welcome_state.json")
121
+ try:
122
+ if state_file.is_file() and not force_open:
123
+ import json
124
+ data = json.loads(state_file.read_text(encoding="utf-8"))
125
+ if data.get("first_launch_repo_opened_v12"):
126
+ return False
127
+
128
+ if not force_open:
129
+ if not sys.stdout.isatty():
130
+ return False
131
+ if os.environ.get("CI") == "true" or os.environ.get("TZERO_NO_BANNER") == "1":
132
+ return False
133
+
134
+ import webbrowser
135
+ webbrowser.open(REPO_URL)
136
+
137
+ state_file.parent.mkdir(parents=True, exist_ok=True)
138
+ import json
139
+ state_file.write_text(json.dumps({"first_launch_repo_opened_v12": True}), encoding="utf-8")
140
+ return True
141
+ except Exception:
142
+ return False
143
+
144
+
87
145
  def install_git_star_hooks(repo_dir: Optional[Path] = None) -> bool:
88
146
  """Configures repository git hooks so developers get a friendly star reminder on checkout/pull."""
89
147
  try:
@@ -97,8 +155,8 @@ def install_git_star_hooks(repo_dir: Optional[Path] = None) -> bool:
97
155
  hook_content = f"""#!/bin/sh
98
156
  # T-Zero GitHub Star & Community Reminder
99
157
  if [ -z "$TZERO_NO_BANNER" ] && [ -z "$CI" ]; then
100
- printf "\\n\\033[1;33m⭐ Enjoying T-Zero Context Architect?\\033[0m\\n"
101
- printf "\\033[1;36m👉 Please star the repository on GitHub: {REPO_URL}\\033[0m\\n\\n"
158
+ printf "\\n\\033[1;33m★ Enjoying T-Zero Context Architect?\\033[0m\\n"
159
+ printf "\\033[1;36m► Please star the repository on GitHub: {REPO_URL}\\033[0m\\n\\n"
102
160
  fi
103
161
  exit 0
104
162
  """
@@ -125,10 +183,12 @@ exit 0
125
183
 
126
184
  def main():
127
185
  """CLI entrypoint for scripts/welcome.py."""
186
+ init_terminal()
128
187
  print_star_banner(force=True)
129
188
  if install_git_star_hooks():
130
- print("\033[32m✔ Git community hooks configured (.githooks)\033[0m")
131
- print(f"\033[36mFor questions or support, visit:\033[0m {REPO_URL}/discussions\n")
189
+ print(sanitize_terminal_text("\033[32m✔ Git community hooks configured (.githooks)\033[0m"))
190
+ info_text = f"\033[36mFor questions or support, visit:\033[0m {REPO_URL}/discussions\n"
191
+ print(sanitize_terminal_text(info_text))
132
192
 
133
193
 
134
194
  if __name__ == "__main__":