tzero-mcp 11.12.1 β†’ 11.15.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 (45) hide show
  1. package/LICENSE +661 -21
  2. package/NOTICE +22 -0
  3. package/README.md +3 -3
  4. package/bin/postinstall.js +22 -0
  5. package/bin/tzero-mcp.js +2 -1
  6. package/bin/tzero.js +8 -1
  7. package/index.js +5 -0
  8. package/package.json +4 -2
  9. package/src/addmcp.py +3 -3
  10. package/src/app.py +1 -1
  11. package/src/tzero/__init__.py +5 -0
  12. package/src/tzero/addmcp.py +18 -0
  13. package/src/tzero/tzero_benchmark.py +2 -2
  14. package/src/tzero/tzero_blackboard.py +1 -1
  15. package/src/tzero/tzero_budget.py +1 -1
  16. package/src/tzero/tzero_card.py +1 -1
  17. package/src/tzero/tzero_ci.py +658 -10
  18. package/src/tzero/tzero_commit.py +1 -1
  19. package/src/tzero/tzero_contracts.py +2 -2
  20. package/src/tzero/tzero_cost.py +1 -1
  21. package/src/tzero/tzero_dashboard.py +3 -3
  22. package/src/tzero/tzero_debt.py +1 -1
  23. package/src/tzero/tzero_drift.py +1 -1
  24. package/src/tzero/tzero_explain.py +1 -1
  25. package/src/tzero/tzero_features.py +268 -37
  26. package/src/tzero/tzero_golden.py +2 -2
  27. package/src/tzero/tzero_hallucination_proof.py +901 -0
  28. package/src/tzero/tzero_infra.py +1 -1
  29. package/src/tzero/tzero_jarvis/__init__.py +15 -1
  30. package/src/tzero/tzero_jarvis/agent_guard.py +620 -0
  31. package/src/tzero/tzero_jarvis/creative_director.py +1 -1
  32. package/src/tzero/tzero_jarvis/orchestrator.py +36 -34
  33. package/src/tzero/tzero_jarvis/self_healing.py +325 -250
  34. package/src/tzero/tzero_lsp.py +1 -1
  35. package/src/tzero/tzero_mcp.py +184 -53
  36. package/src/tzero/tzero_promo.py +504 -0
  37. package/src/tzero/tzero_replay.py +1 -1
  38. package/src/tzero/tzero_semantic_merge.py +1 -1
  39. package/src/tzero/tzero_stubs.py +1 -1
  40. package/src/tzero/tzero_task_benchmark.py +2 -2
  41. package/src/tzero/tzero_tui.py +2 -2
  42. package/src/tzero/tzero_turbo.py +1 -1
  43. package/src/tzero/tzero_v3.py +124 -13
  44. package/src/tzero/tzero_welcome.py +135 -0
  45. package/test/package.test.js +1 -1
@@ -482,7 +482,7 @@ def calculate_token_cost(token_count: int, provider_name: str) -> float:
482
482
  # i18n Translations
483
483
  TRANSLATIONS: Dict[str, Dict[str, str]] = {
484
484
  "en": {
485
- "title": "T-Zero Developer Console & Context Architect v11.11.0",
485
+ "title": "T-Zero Developer Console & Context Architect v11.15.0",
486
486
  "subtitle": f"Developer: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
487
487
  "overview_tab": "🏠 Overview Dashboard",
488
488
  "setup_tab": "⚑ Setup & AI Models",
@@ -519,7 +519,7 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
519
519
  "audit_btn": "πŸ›‘οΈ SECURITY AUDIT"
520
520
  },
521
521
  "tr": {
522
- "title": "T-Zero Geliştirici Konsolu & Bağlam Mimarı v11.11.0",
522
+ "title": "T-Zero Geliştirici Konsolu & Bağlam Mimarı v11.15.0",
523
523
  "subtitle": f"Geliştirici: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
524
524
  "overview_tab": "🏠 Genel Bakış",
525
525
  "setup_tab": "⚑ Kurulum & Model",
@@ -8736,11 +8736,55 @@ def run_watch_mode(target_dir: str = ".", interval: float = 1.0, once_test: bool
8736
8736
 
8737
8737
  def main():
8738
8738
  import argparse
8739
+ import json
8740
+
8741
+ try:
8742
+ try:
8743
+ from tzero.tzero_welcome import print_star_banner
8744
+ except ImportError:
8745
+ from tzero_welcome import print_star_banner
8746
+ print_star_banner()
8747
+ except Exception:
8748
+ pass
8749
+
8750
+ # Fast path for positional subcommands: install-ide, install, init, add-mcp, --install-ide
8751
+ if len(sys.argv) > 1 and (
8752
+ sys.argv[1].lower() in ("install-ide", "install", "add-mcp", "init")
8753
+ or sys.argv[1].lower().startswith("--install-ide")
8754
+ ):
8755
+ try:
8756
+ try:
8757
+ import addmcp
8758
+ except ImportError:
8759
+ from tzero import addmcp
8760
+ if sys.argv[1].lower().startswith("--install-ide"):
8761
+ parts = sys.argv[1].split("=", 1)
8762
+ first_arg = [parts[1]] if len(parts) > 1 else []
8763
+ target_args = first_arg + sys.argv[2:]
8764
+ else:
8765
+ target_args = sys.argv[2:]
8766
+ sys.exit(addmcp.run_init(target_args))
8767
+ except Exception as e:
8768
+ sys.stderr.write(f"[ERROR] Failed to execute T-Zero IDE installer: {e}\n")
8769
+ sys.exit(1)
8770
+
8771
+ # Fast path for local-ci / ci subcommands
8772
+ if len(sys.argv) > 1 and sys.argv[1].lower() in ("local-ci", "localci", "ci-local"):
8773
+ from tzero.tzero_ci import main as ci_main
8774
+ sys.argv.pop(1)
8775
+ sys.exit(ci_main())
8776
+
8777
+ # Fast path for promo / launch subcommands
8778
+ if len(sys.argv) > 1 and sys.argv[1].lower() in ("promo", "launch", "marketing"):
8779
+ from tzero.tzero_promo import main as promo_main
8780
+ sys.argv.pop(1)
8781
+ sys.exit(promo_main())
8782
+
8739
8783
  parser = argparse.ArgumentParser(
8740
8784
  description="Siber Akademi T-Zero Context Architect V3 - Enterprise Codebase Context Builder & Token Reducer",
8741
8785
  epilog="""
8742
8786
  ⭐ PROJEYE BΔ°R YILDIZLA DESTEK OLUN:
8743
- Merhaba! Ben Toprak Ahmet Aydoğmuş (15 yaşında genç bir geliştiriciyim).
8787
+ Merhaba! Ben Toprak Ahmet Aydoğmuş (genç bir açık kaynak geliştiricisiyim).
8744
8788
  T-Zero'yu sΔ±fΔ±rdan yapay zeka araΓ§larΔ±ndaki token israfΔ±nΔ± Γ§ΓΆzmek iΓ§in geliştirdim.
8745
8789
  Beni Google'da 'Toprak Ahmet Aydoğmuş' olarak aratabilirsiniz!
8746
8790
  GitHub: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
@@ -8748,6 +8792,7 @@ def main():
8748
8792
  formatter_class=argparse.RawTextHelpFormatter
8749
8793
  )
8750
8794
  parser.add_argument("--cli", "-c", action="store_true", help="Run interactive guided terminal wizard")
8795
+ parser.add_argument("--install-ide", "--install-mcp", nargs="?", const="all", default=None, metavar="CLIENT", dest="install_ide", help="1-Click MCP installer for Cursor, Claude, Windsurf, Antigravity, VS Code, etc. (e.g. --install-ide cursor, --install-ide all)")
8751
8796
  parser.add_argument("--scan", "-s", nargs="?", const=".", default=None, metavar="DIR", help="Scan codebase directory and print summary metrics")
8752
8797
  parser.add_argument("--watch", "-w", nargs="?", const=".", default=None, metavar="DIR", help="Continuous background AST context watcher (auto-reindexes on file save for Cursor/Claude)")
8753
8798
  parser.add_argument("--audit", "-a", nargs="?", const=".", default=None, metavar="DIR", help="Run AST static code analysis & audit for code smells")
@@ -8789,6 +8834,7 @@ def main():
8789
8834
  parser.add_argument("--helpers", "--suggest-helpers", metavar="QUERY", help="Discover reusable helpers/utilities across repository AST to avoid duplicate code")
8790
8835
  parser.add_argument("--guard", "--verify-code", metavar="CODE_OR_FILE", help="Validate code against AST contracts to eliminate hallucinations before applying")
8791
8836
  parser.add_argument("--grounding-contract", action="store_true", help="Generate immutable AST grounding contract for LLM prompt pinning")
8837
+ parser.add_argument("--promo", action="store_true", help="Generate zero-cost organic launch kit in docs/launch/")
8792
8838
  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)")
8793
8839
  parser.add_argument("--target", default=None, metavar="TARGET_FILE", help="Target file for --patch (optional if patch specifies file header)")
8794
8840
  parser.add_argument("--fuzzy", action="store_true", default=True, help="Enable fuzzy AST and whitespace matching for patch application (default: True)")
@@ -8811,8 +8857,11 @@ def main():
8811
8857
  default="o200k_base", help="BPE encoding for --symbol-context")
8812
8858
  parser.add_argument("--cache-aligned", action="store_true", help="Order context for KV-cache prefix stability (immutable static prefix before dynamic query suffix)")
8813
8859
  parser.add_argument("--commit-msg", action="store_true", help="Generate Conventional Commit message from local AST git diff ($0 local engine)")
8814
- parser.add_argument("--changelog", nargs="?", const="v11.11.0", default=None, metavar="VERSION", help="Generate release CHANGELOG markdown from git history")
8815
- parser.add_argument("--ci", choices=["github", "gitlab", "pre-commit", "all"], default=None, help="Install turnkey CI/CD security and verification workflow")
8860
+ parser.add_argument("--changelog", nargs="?", const="v11.15.0", default=None, metavar="VERSION", help="Generate release CHANGELOG markdown from git history")
8861
+ parser.add_argument("--ci", choices=["github", "gitlab", "pre-commit", "local", "all"], default=None, help="Install CI/CD workflow or run local verification suite")
8862
+ parser.add_argument("--local-ci", action="store_true", help="Run comprehensive Local CI & Pre-Push verification battery ($0 quota burn)")
8863
+ parser.add_argument("--quick-ci", action="store_true", help="Run fast Local CI smoke checks in seconds")
8864
+ parser.add_argument("--ci-hook", choices=["install", "uninstall"], default=None, help="Install or uninstall automated git pre-push Local CI hook")
8816
8865
  parser.add_argument("--stubs", nargs="?", const=".", default=None, metavar="PATH", help="Generate PEP-484 AST type stubs (.pyi) for target file or workspace")
8817
8866
  parser.add_argument("--stubs-out", default=None, metavar="DIR", help="Output directory for generated type stubs (default: alongside .py files)")
8818
8867
  parser.add_argument("--guard-install", action="store_true", help="Install local git pre-commit zero-leak and token security hook")
@@ -8823,6 +8872,7 @@ def main():
8823
8872
  parser.add_argument("--matrix", action="store_true", help="Display full 105 T-Zero Enterprise AI Capability Matrix")
8824
8873
  parser.add_argument("--pillar", type=int, choices=range(1, 8), default=None, help="Filter --matrix by Pillar number (1 to 7)")
8825
8874
  parser.add_argument("--hallucination-check", "--hc", metavar="FILE_OR_CODE", dest="hallucination_check", help="Run pre-flight AST reality-lock to verify imports and method calls")
8875
+ parser.add_argument("--prove-zero-hallucination", "--hallucination-proof", action="store_true", help="Run empirical 60-scenario benchmark mathematically proving 0.0%% AI hallucination escape rate")
8826
8876
  parser.add_argument("--tutorial", "--guide", action="store_true", help="Launch interactive step-by-step master tutorial for T-Zero Neural Cortex & IDE setups")
8827
8877
  parser.add_argument("--benchmark", nargs="?", const=".", default=None, metavar="PATH", help="Run multi-model token reduction, latency & ROI benchmark (Claude, GPT-4o, Gemini, DeepSeek)")
8828
8878
  parser.add_argument("--benchmark-svg", action="store_true", help="Generate animated macOS terminal SVG recording of benchmark for README")
@@ -8871,7 +8921,7 @@ def main():
8871
8921
  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")
8872
8922
  parser.add_argument("--showcase", nargs="?", const="tzero_showcase.html", default=None, metavar="FILE", help="Generate interactive split-screen HTML5 comparison showcase slider")
8873
8923
  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")
8874
- parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v11.11.0 Master Edition (engine v4.1.0)")
8924
+ parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v11.15.0 Master Edition (engine v4.1.0)")
8875
8925
 
8876
8926
 
8877
8927
  def print_master_tutorial():
@@ -8968,7 +9018,7 @@ Generate tailored subagent manifests (.tzero/agents/ + SKILL.md) in 1 second:
8968
9018
  ================================================================================
8969
9019
  ⚑ SIBER AKADEMI T-ZERO CONTEXT ARCHITECT & MCP ENGINE
8970
9020
  ================================================================================
8971
- Engineered by Toprak Ahmet Aydoğmuş (15-year-old developer) & Siber Akademi
9021
+ Engineered by Toprak Ahmet Aydoğmuş & Siber Akademi
8972
9022
  to eliminate token bloat, reduce prompt costs by up to 95%, and stop AI hallucinations.
8973
9023
  Search 'Toprak Ahmet Aydoğmuş' on Google to learn more!
8974
9024
  If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
@@ -8980,7 +9030,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
8980
9030
  def print_quickstart_guide():
8981
9031
  print("""
8982
9032
  ================================================================================
8983
- ⚑ SΔ°BER AKADEMΔ° β€” T-ZERO CONTEXT ARCHITECT & MCP v11.11.0 MASTER (engine v4.1.0)
9033
+ ⚑ SΔ°BER AKADEMΔ° β€” T-ZERO CONTEXT ARCHITECT & MCP v11.15.0 MASTER (engine v4.1.0)
8984
9034
  ================================================================================
8985
9035
  🎯 %95'e Varan Token Tasarrufu & Otonom Yapay Zeka Mimari Bağlam Motoru
8986
9036
 
@@ -9032,7 +9082,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9032
9082
  $ tzero --doctor --deep # Deep offline 9-subsystem self-check
9033
9083
 
9034
9084
  ⭐ PROJEYE BΔ°R YILDIZLA DESTEK OLUN:
9035
- Merhaba! Ben Toprak Ahmet Aydoğmuş (15 yaşında genç bir geliştiriciyim).
9085
+ Merhaba! Ben Toprak Ahmet Aydoğmuş (genç bir açık kaynak geliştiricisiyim).
9036
9086
  T-Zero'yu sΔ±fΔ±rdan, yapay zeka araΓ§larΔ±ndaki token israfΔ±nΔ± Γ§ΓΆzmek iΓ§in geliştirdim.
9037
9087
  Beni Google'da 'Toprak Ahmet Aydoğmuş' olarak aratabilirsiniz!
9038
9088
  İşinize yaradΔ±ysa lΓΌtfen GitHub'da bir ⭐ (star) vererek projeyi destekleyin:
@@ -9049,6 +9099,9 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9049
9099
  if len(sys.argv) > 1 and not sys.argv[1].startswith("-"):
9050
9100
  sub = sys.argv[1].lower()
9051
9101
  sub_map = {
9102
+ "install-ide": "--install-ide",
9103
+ "install": "--install-ide",
9104
+ "add-mcp": "--install-ide",
9052
9105
  "audit": "--audit",
9053
9106
  "vault": "--vault",
9054
9107
  "auto-vault": "--auto-vault",
@@ -9162,6 +9215,9 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9162
9215
  if getattr(args, "info", False):
9163
9216
  print_quickstart_guide()
9164
9217
  return
9218
+ elif getattr(args, "promo", False):
9219
+ from tzero.tzero_promo import main as promo_main
9220
+ sys.exit(promo_main())
9165
9221
  elif args.doctor:
9166
9222
  if tzero_deps is None:
9167
9223
  print("[ERROR] tzero_deps.py is missing; reinstall T-Zero to use --doctor.")
@@ -9190,12 +9246,26 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9190
9246
  symbol_name=getattr(args, "federation_symbol", None) or getattr(args, "scip_symbol", None),
9191
9247
  scip_path=getattr(args, "federation_scip", None),
9192
9248
  ))
9249
+ elif getattr(args, "install_ide", None) is not None:
9250
+ try:
9251
+ import addmcp
9252
+ except ImportError:
9253
+ from tzero import addmcp
9254
+ target_val = getattr(args, "install_ide", None)
9255
+ target_arg = [] if target_val in ("all", "auto", "") else [target_val]
9256
+ sys.exit(addmcp.run_init(target_arg))
9193
9257
  elif args.init is not None:
9194
- import addmcp
9258
+ try:
9259
+ import addmcp
9260
+ except ImportError:
9261
+ from tzero import addmcp
9195
9262
  target_arg = [] if args.init == "auto" else [args.init]
9196
9263
  sys.exit(addmcp.run_init(target_arg))
9197
9264
  elif args.add_mcp:
9198
- import addmcp
9265
+ try:
9266
+ import addmcp
9267
+ except ImportError:
9268
+ from tzero import addmcp
9199
9269
  sys.exit(addmcp.run_cli())
9200
9270
  elif args.mcp:
9201
9271
  from tzero import tzero_mcp
@@ -9585,6 +9655,14 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9585
9655
  for h in res.hallucinations:
9586
9656
  print(f" - Line {h.line_number}: {h.diagnosis}")
9587
9657
  sys.exit(1)
9658
+ elif getattr(args, "prove_zero_hallucination", False):
9659
+ from tzero.tzero_hallucination_proof import HallucinationProofEngine
9660
+ target_dir = getattr(args, "dir", ".") or "."
9661
+ rep = HallucinationProofEngine.run_proof_benchmark(target_dir)
9662
+ HallucinationProofEngine.render_cli(rep)
9663
+ artifacts = HallucinationProofEngine.export_artifacts(rep, "docs")
9664
+ print(f"Artifacts exported:\n - {artifacts['markdown']}\n - {artifacts['json']}")
9665
+ sys.exit(0)
9588
9666
  elif args.init_hooks is not None:
9589
9667
  from tzero.tzero_guard import GitSecurityGuard
9590
9668
  res = GitSecurityGuard.install_hook(args.init_hooks)
@@ -9777,8 +9855,19 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9777
9855
  entry = LocalSemanticCommitSynthesizer.generate_changelog_entry(version=args.changelog, repo_dir=args.dir)
9778
9856
  print(entry)
9779
9857
  elif args.ci is not None:
9780
- from tzero.tzero_ci import CIPipelineGenerator
9781
9858
  target = args.ci
9859
+ if target in ("local", "run"):
9860
+ from tzero.tzero_ci import LocalCIRunner
9861
+ runner = LocalCIRunner(repo_dir=args.dir, quick=getattr(args, "quick_ci", False))
9862
+ report = runner.run()
9863
+ if getattr(args, "format", "text") == "json":
9864
+ import json
9865
+ print(json.dumps(report.to_dict(), indent=2))
9866
+ else:
9867
+ print(LocalCIRunner.render_terminal_report(report))
9868
+ sys.exit(0 if report.passed else 1)
9869
+
9870
+ from tzero.tzero_ci import CIPipelineGenerator
9782
9871
  installed = []
9783
9872
  if target in ("github", "all"):
9784
9873
  _, p = CIPipelineGenerator.install_github_workflow(args.dir)
@@ -9792,6 +9881,28 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9792
9881
  print("\033[32m[SUCCESS] Turnkey CI/CD pipelines installed:\033[0m")
9793
9882
  for p in installed:
9794
9883
  print(f" - {os.path.relpath(p, args.dir)}")
9884
+ elif getattr(args, "local_ci", False) or getattr(args, "quick_ci", False):
9885
+ from tzero.tzero_ci import LocalCIRunner
9886
+ runner = LocalCIRunner(repo_dir=args.dir, quick=getattr(args, "quick_ci", False), auto_fix=getattr(args, "fix", False))
9887
+ report = runner.run()
9888
+ if getattr(args, "format", "text") == "json":
9889
+ import json
9890
+ print(json.dumps(report.to_dict(), indent=2))
9891
+ else:
9892
+ print(LocalCIRunner.render_terminal_report(report))
9893
+ sys.exit(0 if report.passed else 1)
9894
+ elif getattr(args, "ci_hook", None):
9895
+ from tzero.tzero_ci import LocalCIRunner
9896
+ if args.ci_hook == "install":
9897
+ ok, msg = LocalCIRunner.install_git_pre_push_hook(args.dir)
9898
+ else:
9899
+ ok, msg = LocalCIRunner.uninstall_git_pre_push_hook(args.dir)
9900
+ if ok:
9901
+ print(f"\033[32m[SUCCESS]\033[0m {msg}")
9902
+ sys.exit(0)
9903
+ else:
9904
+ print(f"\033[31m[FAILED]\033[0m {msg}")
9905
+ sys.exit(1)
9795
9906
  elif args.stubs is not None:
9796
9907
  from tzero.tzero_stubs import TypeStubGenerator
9797
9908
  target = args.stubs
@@ -9835,7 +9946,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
9835
9946
  if not os.path.exists(app_path):
9836
9947
  app_path = os.path.join(os.getcwd(), "huggingface-space", "app.py")
9837
9948
  print("\033[36m" + "=" * 80)
9838
- print("πŸ€— SΔ°BER AKADEMΔ° β€” T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v11.11.0)")
9949
+ print("πŸ€— SΔ°BER AKADEMΔ° β€” T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v11.15.0)")
9839
9950
  print("=" * 80 + "\033[0m")
9840
9951
  print("🌐 Official Live Space : https://huggingface.co/spaces/toprakke4/tzero-token-reducer")
9841
9952
  print(f"πŸ“ Local Application : {app_path}")
@@ -0,0 +1,135 @@
1
+ # -*- coding: utf-8 -*-
2
+ """T-Zero Community Welcome & GitHub Star Prompt Module.
3
+
4
+ Developer: Toprak Ahmet Aydoğmuş (Siber Akademi)
5
+ License: AGPL-3.0-only
6
+ Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
7
+ """
8
+
9
+ import os
10
+ import sys
11
+ import subprocess
12
+ from pathlib import Path
13
+ from typing import Optional
14
+
15
+ REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
16
+ VERSION = "11.15.1"
17
+ _BANNER_PRINTED = False
18
+
19
+
20
+ def find_git_root(start_dir: Optional[Path] = None) -> Optional[Path]:
21
+ """Recursively locates .git root directory starting from start_dir or cwd."""
22
+ curr = (start_dir or Path.cwd()).resolve()
23
+ for p in [curr] + list(curr.parents):
24
+ if (p / ".git").is_dir():
25
+ return p
26
+ return None
27
+
28
+
29
+ def get_welcome_banner(version: str = VERSION) -> str:
30
+ """Returns the ANSI styled welcome banner asking developers to star the project."""
31
+ return f"""\033[1;36m
32
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
33
+ β”‚ ⭐ WELCOME TO T-ZERO CONTEXT ARCHITECT & MCP SUITE (v{version}) β”‚
34
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
35
+ β”‚ β”‚
36
+ β”‚ Hi! I'm Toprak Ahmet Aydoğmuş (independent engineer at Siber Akademi). β”‚
37
+ β”‚ Thank you for cloning & checking out T-Zero! β”‚
38
+ β”‚ β”‚
39
+ β”‚ T-Zero slashes AI coding prompt tokens by 85–95% using deterministic AST β”‚
40
+ β”‚ signature extraction with 100% Zero-Leak security and 20 MCP tools. β”‚
41
+ β”‚ β”‚
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 β”‚
44
+ β”‚ β”‚
45
+ β”‚ πŸ’‘ Quick Start: β”‚
46
+ β”‚ \033[1;37mtzero install-ide\033[1;36m 1-Click install into Cursor, Claude, Windsurf β”‚
47
+ β”‚ \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 β”‚
49
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜\033[0m"""
50
+
51
+
52
+ def print_star_banner(force: bool = False) -> None:
53
+ """Prints the welcome star banner if running interactively in terminal."""
54
+ global _BANNER_PRINTED
55
+ if _BANNER_PRINTED and not force:
56
+ return
57
+
58
+ # Skip if running inside CI or user opted out
59
+ if os.environ.get("TZERO_NO_BANNER") == "1" or os.environ.get("CI") == "true":
60
+ return
61
+
62
+ if not force:
63
+ # Non-interactive stdout (pipes, subshells, captures) must remain clean
64
+ if not sys.stdout.isatty():
65
+ return
66
+
67
+ argv_lower = [a.lower() for a in sys.argv[1:]]
68
+ quiet_flags = {"--json", "--sarif", "--lsp", "--pipe", "--silent", "-q", "--quiet"}
69
+ if any(arg in quiet_flags for arg in argv_lower):
70
+ return
71
+ if any(arg.startswith("--format=json") or arg.startswith("--format=sarif") for arg in argv_lower):
72
+ return
73
+ if "--format" in argv_lower:
74
+ idx = argv_lower.index("--format")
75
+ if idx + 1 < len(argv_lower) and argv_lower[idx + 1] in ("json", "sarif"):
76
+ return
77
+
78
+ try:
79
+ print(get_welcome_banner())
80
+ _BANNER_PRINTED = True
81
+ # Silently ensure git hooks are installed if running inside repository
82
+ install_git_star_hooks()
83
+ except Exception:
84
+ pass
85
+
86
+
87
+ def install_git_star_hooks(repo_dir: Optional[Path] = None) -> bool:
88
+ """Configures repository git hooks so developers get a friendly star reminder on checkout/pull."""
89
+ try:
90
+ target_dir = find_git_root(repo_dir)
91
+ if not target_dir:
92
+ return False
93
+
94
+ githooks_dir = target_dir / ".githooks"
95
+ githooks_dir.mkdir(parents=True, exist_ok=True)
96
+
97
+ hook_content = f"""#!/bin/sh
98
+ # T-Zero GitHub Star & Community Reminder
99
+ 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"
102
+ fi
103
+ exit 0
104
+ """
105
+ for hook_name in ("post-checkout", "post-merge"):
106
+ hook_file = githooks_dir / hook_name
107
+ hook_file.write_text(hook_content, encoding="utf-8")
108
+ try:
109
+ hook_file.chmod(0o755)
110
+ except Exception:
111
+ pass
112
+
113
+ # Set core.hooksPath in git config
114
+ subprocess.run(
115
+ ["git", "config", "core.hooksPath", ".githooks"],
116
+ cwd=target_dir,
117
+ stdout=subprocess.DEVNULL,
118
+ stderr=subprocess.DEVNULL,
119
+ check=False
120
+ )
121
+ return True
122
+ except Exception:
123
+ return False
124
+
125
+
126
+ def main():
127
+ """CLI entrypoint for scripts/welcome.py."""
128
+ print_star_banner(force=True)
129
+ 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")
132
+
133
+
134
+ if __name__ == "__main__":
135
+ main()
@@ -7,7 +7,7 @@ const pkg = require("../package.json");
7
7
 
8
8
  test("package.json metadata integrity", () => {
9
9
  assert.strictEqual(pkg.name, "tzero-mcp");
10
- assert.strictEqual(pkg.license, "MIT");
10
+ assert.strictEqual(pkg.license, "AGPL-3.0-only");
11
11
  assert.strictEqual(typeof pkg.version, "string");
12
12
  assert.strictEqual(pkg.bin["tzero"], "bin/tzero.js");
13
13
  assert.strictEqual(pkg.bin["tzero-mcp"], "bin/tzero-mcp.js");