tzero-mcp 12.3.3 → 12.3.5
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 +1 -1
- package/README.md +4 -0
- package/package.json +3 -4
- package/src/addmcp.py +2 -2
- package/src/app.py +1 -1
- package/src/main.py +4 -0
- package/src/tzero/__init__.py +1 -1
- package/src/tzero/desktop_updater.py +6 -0
- package/src/tzero/tzero_benchmark.py +1 -1
- package/src/tzero/tzero_budget.py +1 -1
- package/src/tzero/tzero_ci.py +1 -1
- package/src/tzero/tzero_contracts.py +2 -2
- package/src/tzero/tzero_dashboard.py +3 -3
- package/src/tzero/tzero_debt.py +1 -1
- package/src/tzero/tzero_deps.py +1 -0
- package/src/tzero/tzero_explain.py +1 -1
- package/src/tzero/tzero_features.py +31 -74
- package/src/tzero/tzero_golden.py +2 -2
- package/src/tzero/tzero_growth.py +1 -1
- package/src/tzero/tzero_jarvis/orchestrator.py +1 -1
- package/src/tzero/tzero_jarvis/workspace_orchestrator.py +10 -21
- package/src/tzero/tzero_lsp.py +1 -1
- package/src/tzero/tzero_mcp.py +19 -120
- package/src/tzero/tzero_promo.py +1 -1
- package/src/tzero/tzero_security.py +3 -3
- package/src/tzero/tzero_sync.py +73 -148
- package/src/tzero/tzero_task_benchmark.py +2 -2
- package/src/tzero/tzero_traffic.py +1 -1
- package/src/tzero/tzero_tui.py +2 -13
- package/src/tzero/tzero_v3.py +56 -187
- package/src/tzero/tzero_welcome.py +1 -1
- package/src/tzero/anti_rea/__init__.py +0 -84
- package/src/tzero/anti_rea/algebraic_mutator.py +0 -107
- package/src/tzero/anti_rea/anti_agent_guard.py +0 -96
- package/src/tzero/anti_rea/anti_debugger.py +0 -272
- package/src/tzero/anti_rea/anti_vm.py +0 -160
- package/src/tzero/anti_rea/asar_shield.py +0 -122
- package/src/tzero/anti_rea/auditor.py +0 -208
- package/src/tzero/anti_rea/bpe_disrupter.py +0 -48
- package/src/tzero/anti_rea/bytecode_trap.py +0 -85
- package/src/tzero/anti_rea/canary_beacon.py +0 -167
- package/src/tzero/anti_rea/cli.py +0 -134
- package/src/tzero/anti_rea/confusables.py +0 -130
- package/src/tzero/anti_rea/crypto_loader.py +0 -132
- package/src/tzero/anti_rea/engine.py +0 -304
- package/src/tzero/anti_rea/extractor_shield.py +0 -180
- package/src/tzero/anti_rea/flattener.py +0 -136
- package/src/tzero/anti_rea/gui.py +0 -264
- package/src/tzero/anti_rea/honeypot.py +0 -58
- package/src/tzero/anti_rea/integrity_guard.py +0 -78
- package/src/tzero/anti_rea/jailbreak_decoy.py +0 -77
- package/src/tzero/anti_rea/mcp_poison.py +0 -41
- package/src/tzero/anti_rea/native_bridge.py +0 -169
- package/src/tzero/anti_rea/rdtsc_guard.py +0 -77
- package/src/tzero/anti_rea/string_vault.py +0 -97
- package/src/tzero/anti_rea/sybil_network.py +0 -53
- package/src/tzero/anti_rea/tier_catalog.py +0 -388
- package/src/tzero/anti_rea/timing_guard.py +0 -46
- package/src/tzero/anti_rea/token_bomb.py +0 -65
- package/src/tzero/anti_rea/traps.py +0 -76
- package/src/tzero/anti_rea/vm_obfuscator.py +0 -182
- package/src/tzero/tzero_armor.py +0 -187
package/CONTRIBUTING.md
CHANGED
|
@@ -68,4 +68,4 @@ Before opening a pull request, ensure all verification gates pass locally:
|
|
|
68
68
|
|
|
69
69
|
- **GitHub Issues:** [Bug Reports & Feature Requests](https://github.com/toprakahmetaydogmus/TZeroAlgorithm/issues)
|
|
70
70
|
- **Hugging Face Space:** [Interactive Web Demo](https://huggingface.co/spaces/toprakke4/tzero-token-reducer)
|
|
71
|
-
- **Maintainer:** Toprak Ahmet Aydoğmuş (`
|
|
71
|
+
- **Maintainer:** Toprak Ahmet Aydoğmuş (`toprakahmetaydogmus0@gmail.com`)
|
package/README.md
CHANGED
|
@@ -38,3 +38,7 @@ This npm package uses a separate Python interpreter. It requires Python dependen
|
|
|
38
38
|
## License
|
|
39
39
|
|
|
40
40
|
AGPL-3.0-only © [Toprak Ahmet Aydoğmuş](https://github.com/toprakahmetaydogmus)
|
|
41
|
+
|
|
42
|
+
## Security notice
|
|
43
|
+
|
|
44
|
+
The npm advisory [GHSA-pm3r-rxg9-cj5j](https://github.com/advisories/GHSA-pm3r-rxg9-cj5j) covers version 12.3.0. Follow the advisory if you installed or ran that version. See the [security review](https://github.com/toprakahmetaydogmus/TZeroAlgorithm/blob/main/SECURITY-REVIEW.md) and [privacy documentation](https://github.com/toprakahmetaydogmus/TZeroAlgorithm/blob/main/PRIVACY.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tzero-mcp",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.5",
|
|
4
4
|
"description": "Deterministic AST Context Compressor, 95% Token Reducer & 20-Tool MCP Server for Cursor, Claude Desktop & Copilot",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -65,16 +65,15 @@
|
|
|
65
65
|
"antigravity",
|
|
66
66
|
"windsurf"
|
|
67
67
|
],
|
|
68
|
-
"author": "Toprak Ahmet Aydoğmuş (Siber Akademi) <
|
|
68
|
+
"author": "Toprak Ahmet Aydoğmuş (Siber Akademi) <toprakahmetaydogmus0@gmail.com> (https://github.com/toprakahmetaydogmus)",
|
|
69
69
|
"contributors": [
|
|
70
70
|
{
|
|
71
71
|
"name": "Toprak Ahmet Aydoğmuş",
|
|
72
|
-
"email": "
|
|
72
|
+
"email": "toprakahmetaydogmus0@gmail.com",
|
|
73
73
|
"url": "https://github.com/toprakahmetaydogmus"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"name": "Siber Akademi Core Team",
|
|
77
|
-
"email": "contact@siberakademi.org.tr",
|
|
78
77
|
"url": "https://github.com/toprakahmetaydogmus"
|
|
79
78
|
}
|
|
80
79
|
],
|
package/src/addmcp.py
CHANGED
|
@@ -22,7 +22,7 @@ from pathlib import Path
|
|
|
22
22
|
from typing import Callable, Dict, List, Optional, Tuple
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
APP_VERSION = "12.3.
|
|
25
|
+
APP_VERSION = "12.3.5"
|
|
26
26
|
SERVER_NAME = "tzero"
|
|
27
27
|
SERVER_FILENAME = "TZeroMCP.exe"
|
|
28
28
|
|
|
@@ -1131,7 +1131,7 @@ def run_init(argv: Optional[List[str]] = None) -> int:
|
|
|
1131
1131
|
# Print banner
|
|
1132
1132
|
print(sanitize_terminal_text("""
|
|
1133
1133
|
\033[1;36m================================================================================
|
|
1134
|
-
⚡ SİBER AKADEMİ — T-ZERO 1-CLICK MCP INITIALIZATION (v12.3.
|
|
1134
|
+
⚡ SİBER AKADEMİ — T-ZERO 1-CLICK MCP INITIALIZATION (v12.3.5)
|
|
1135
1135
|
================================================================================\033[0m
|
|
1136
1136
|
\033[32m★ Zero-Config AST Codebase Context & 100% Zero-Leak Security Guard\033[0m
|
|
1137
1137
|
"""))
|
package/src/app.py
CHANGED
|
@@ -42,7 +42,7 @@ import gradio as gr
|
|
|
42
42
|
# ==================================================================================================
|
|
43
43
|
# CONSTANTS, PALETTES & MULTI-MODEL PRICING TIERS
|
|
44
44
|
# ==================================================================================================
|
|
45
|
-
APP_VERSION = "12.3.
|
|
45
|
+
APP_VERSION = "12.3.5"
|
|
46
46
|
REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
|
|
47
47
|
VERCEL_URL = "https://tzero-indol.vercel.app"
|
|
48
48
|
SPACE_URL = "https://huggingface.co/spaces/toprakke4/tzero-token-reducer"
|
package/src/main.py
CHANGED
|
@@ -62,5 +62,9 @@ from tzero.tzero_v3 import main
|
|
|
62
62
|
|
|
63
63
|
if __name__ == "__main__":
|
|
64
64
|
multiprocessing.freeze_support()
|
|
65
|
+
if sys.platform == "win32" and getattr(sys, "frozen", False) and len(sys.argv) == 2 and sys.argv[1] == "--skip-startup-update":
|
|
66
|
+
sys.argv.pop()
|
|
67
|
+
main()
|
|
68
|
+
sys.exit(0)
|
|
65
69
|
main()
|
|
66
70
|
|
package/src/tzero/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""
|
|
3
3
|
Siber Akademi — T-Zero Autonomous Benchmark & Performance Optimization Engine.
|
|
4
4
|
Developer: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
5
|
-
Version: 12.3.
|
|
5
|
+
Version: 12.3.5
|
|
6
6
|
License: MIT
|
|
7
7
|
|
|
8
8
|
Performs quantitative multi-model benchmarks comparing raw codebase context
|
|
@@ -12,7 +12,7 @@ Capabilities:
|
|
|
12
12
|
- 100% Offline, $0 cost, zero cloud dependencies (Python standard library only).
|
|
13
13
|
|
|
14
14
|
Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
15
|
-
Part of T-Zero Context Architect v12.3.
|
|
15
|
+
Part of T-Zero Context Architect v12.3.5 Master Edition.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
import hashlib
|
package/src/tzero/tzero_ci.py
CHANGED
|
@@ -755,7 +755,7 @@ def main():
|
|
|
755
755
|
prog="tzero-ci",
|
|
756
756
|
description="Siber Akademi T-Zero Local CI Pipeline & Pre-Push Verification Shield"
|
|
757
757
|
)
|
|
758
|
-
parser.add_argument("--version", "-v", action="version", version="%(prog)s 12.3.
|
|
758
|
+
parser.add_argument("--version", "-v", action="version", version="%(prog)s 12.3.5")
|
|
759
759
|
parser.add_argument("--quick", "-q", action="store_true", help="Run fast verification battery (seconds)")
|
|
760
760
|
parser.add_argument("--all", "-a", action="store_true", help="Run full matrix verification battery")
|
|
761
761
|
parser.add_argument("--fix", action="store_true", help="Attempt auto-repair for auto-fixable gates (metadata sync)")
|
|
@@ -13,7 +13,7 @@ Capabilities:
|
|
|
13
13
|
- 100% Offline, $0 cost, zero external dependencies (pure Python standard library).
|
|
14
14
|
|
|
15
15
|
Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
16
|
-
Part of T-Zero Context Architect v12.3.
|
|
16
|
+
Part of T-Zero Context Architect v12.3.5 Master Edition.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
import ast
|
|
@@ -1056,7 +1056,7 @@ class ASTContractComparator:
|
|
|
1056
1056
|
"tool": {
|
|
1057
1057
|
"driver": {
|
|
1058
1058
|
"name": "T-Zero Contract Guardian",
|
|
1059
|
-
"version": "12.3.
|
|
1059
|
+
"version": "12.3.5",
|
|
1060
1060
|
"rules": rules_list
|
|
1061
1061
|
}
|
|
1062
1062
|
},
|
|
@@ -457,7 +457,7 @@ HTML_PAGE = """<!DOCTYPE html>
|
|
|
457
457
|
<div class="brand-logo">T0</div>
|
|
458
458
|
<div>
|
|
459
459
|
<div class="brand-title">T-Zero Developer Console</div>
|
|
460
|
-
<div class="brand-sub" id="headerBrandSub">Enterprise AST Context Architect • v12.3.
|
|
460
|
+
<div class="brand-sub" id="headerBrandSub">Enterprise AST Context Architect • v12.3.5</div>
|
|
461
461
|
</div>
|
|
462
462
|
</div>
|
|
463
463
|
<div class="header-actions">
|
|
@@ -850,7 +850,7 @@ x = 2
|
|
|
850
850
|
</main>
|
|
851
851
|
|
|
852
852
|
<footer>
|
|
853
|
-
<span id="footerBrand">T-Zero Context Architect v12.3.
|
|
853
|
+
<span id="footerBrand">T-Zero Context Architect v12.3.5</span> • Developer: Toprak Ahmet Aydoğmuş • Siber Akademi
|
|
854
854
|
</footer>
|
|
855
855
|
|
|
856
856
|
<script>
|
|
@@ -1481,7 +1481,7 @@ def compute_live_dashboard_stats(workspace_dir: str = ".") -> Dict[str, Any]:
|
|
|
1481
1481
|
if cached is not None and (now - _DASHBOARD_STATS_CACHE["ts"]) < 60.0:
|
|
1482
1482
|
return cached
|
|
1483
1483
|
|
|
1484
|
-
version = "12.3.
|
|
1484
|
+
version = "12.3.5"
|
|
1485
1485
|
tools_count = 57
|
|
1486
1486
|
try:
|
|
1487
1487
|
from tzero import tzero_mcp
|
package/src/tzero/tzero_debt.py
CHANGED
|
@@ -13,7 +13,7 @@ Capabilities:
|
|
|
13
13
|
- 100% Offline, $0 cost, zero cloud dependencies (Python standard library only).
|
|
14
14
|
|
|
15
15
|
Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
16
|
-
Part of T-Zero Context Architect v12.3.
|
|
16
|
+
Part of T-Zero Context Architect v12.3.5 Master Edition.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
import ast
|
package/src/tzero/tzero_deps.py
CHANGED
|
@@ -37,6 +37,7 @@ class Dependency(NamedTuple):
|
|
|
37
37
|
|
|
38
38
|
REQUIRED: List[Dependency] = [
|
|
39
39
|
Dependency("requests", "requests", "2.28.0", "AI provider HTTP calls"),
|
|
40
|
+
Dependency("cryptography", "cryptography", "44", "Authenticated credential backups"),
|
|
40
41
|
Dependency("keyring", "keyring", "23.13.1", "OS credential storage"),
|
|
41
42
|
Dependency("darkdetect", "darkdetect", "0.8.0", "OS theme detection"),
|
|
42
43
|
Dependency("pygments", "pygments", "2.14.0", "syntax highlighting"),
|
|
@@ -685,80 +685,37 @@ globs: **/*
|
|
|
685
685
|
"""
|
|
686
686
|
|
|
687
687
|
@classmethod
|
|
688
|
-
def export_all(cls, project_dir: str) -> List[str]:
|
|
689
|
-
"""
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
os.makedirs(gh_dir, exist_ok=True)
|
|
720
|
-
copilot_path = os.path.join(gh_dir, "copilot-instructions.md")
|
|
721
|
-
with open(copilot_path, "w", encoding="utf-8") as f:
|
|
722
|
-
f.write(cls.generate_copilot_instructions(p_name))
|
|
723
|
-
created.append(copilot_path)
|
|
724
|
-
|
|
725
|
-
# 6. .cursor/rules/*.mdc
|
|
726
|
-
c_rules_dir = os.path.join(project_dir, ".cursor", "rules")
|
|
727
|
-
os.makedirs(c_rules_dir, exist_ok=True)
|
|
728
|
-
for mdc_name, content in cls.generate_cursor_mdc_rules(p_name, project_dir=project_dir).items():
|
|
729
|
-
mdc_path = os.path.join(c_rules_dir, mdc_name)
|
|
730
|
-
with open(mdc_path, "w", encoding="utf-8") as f:
|
|
731
|
-
f.write(content)
|
|
732
|
-
created.append(mdc_path)
|
|
733
|
-
|
|
734
|
-
# 7. AGENT.md / AGENTS.md (Antigravity & Autonomous Orchestrator Directive)
|
|
735
|
-
from tzero.tzero_jarvis.workspace_orchestrator import WorkspaceProfiler, WorkspaceGovernanceSynthesizer
|
|
736
|
-
try:
|
|
737
|
-
prof = WorkspaceProfiler(project_dir).profile()
|
|
738
|
-
agent_md_content = WorkspaceGovernanceSynthesizer.generate_agent_md(prof)
|
|
739
|
-
|
|
740
|
-
agents_p = os.path.join(project_dir, "AGENTS.md")
|
|
741
|
-
with open(agents_p, "w", encoding="utf-8") as f:
|
|
742
|
-
f.write(agent_md_content)
|
|
743
|
-
created.append(agents_p)
|
|
744
|
-
|
|
745
|
-
agent_p = os.path.join(project_dir, "AGENT.md")
|
|
746
|
-
with open(agent_p, "w", encoding="utf-8") as f:
|
|
747
|
-
f.write(agent_md_content)
|
|
748
|
-
created.append(agent_p)
|
|
749
|
-
|
|
750
|
-
# 8. ARCHITECTURE.md (in docs/ if docs exists, else root)
|
|
751
|
-
docs_dir = os.path.join(project_dir, "docs")
|
|
752
|
-
target_arch_dir = docs_dir if os.path.isdir(docs_dir) else project_dir
|
|
753
|
-
arch_p = os.path.join(target_arch_dir, "ARCHITECTURE.md")
|
|
754
|
-
if not os.path.isfile(arch_p):
|
|
755
|
-
with open(arch_p, "w", encoding="utf-8") as f:
|
|
756
|
-
f.write(WorkspaceGovernanceSynthesizer.generate_architecture_md(prof))
|
|
757
|
-
created.append(arch_p)
|
|
758
|
-
except Exception:
|
|
759
|
-
pass
|
|
760
|
-
|
|
761
|
-
return created
|
|
688
|
+
def export_all(cls, project_dir: str, target: str = "all") -> List[str]:
|
|
689
|
+
"""Create missing agent-rule files in the selected editor formats."""
|
|
690
|
+
from tzero.tzero_sync import create_workspace_file
|
|
691
|
+
|
|
692
|
+
name = os.path.basename(os.path.abspath(project_dir)) or "Project"
|
|
693
|
+
selected = (target or "all").lower().strip()
|
|
694
|
+
entries = {}
|
|
695
|
+
if selected in ("all", "cursor", "cursorrules"):
|
|
696
|
+
entries[".cursorrules"] = cls.generate_cursorrules(name)
|
|
697
|
+
for path, content in cls.generate_cursor_mdc_rules(name, project_dir=project_dir).items():
|
|
698
|
+
entries[os.path.join(".cursor", "rules", path)] = content
|
|
699
|
+
if selected in ("all", "cline", "clinerules"):
|
|
700
|
+
entries[".clinerules"] = cls.generate_clinerules(name)
|
|
701
|
+
if selected in ("all", "windsurf", "windsurfrules"):
|
|
702
|
+
entries[".windsurfrules"] = cls.generate_windsurfrules(name)
|
|
703
|
+
if selected in ("all", "claude", "claudemd"):
|
|
704
|
+
entries["CLAUDE.md"] = cls.generate_claude_instructions(name)
|
|
705
|
+
if selected in ("all", "github", "copilot"):
|
|
706
|
+
entries[os.path.join(".github", "copilot-instructions.md")] = cls.generate_copilot_instructions(name)
|
|
707
|
+
if selected == "all":
|
|
708
|
+
from tzero.tzero_jarvis.workspace_orchestrator import WorkspaceGovernanceSynthesizer, WorkspaceProfiler
|
|
709
|
+
|
|
710
|
+
profile = WorkspaceProfiler(project_dir).profile()
|
|
711
|
+
entries["AGENTS.md"] = entries["AGENT.md"] = WorkspaceGovernanceSynthesizer.generate_agent_md(profile)
|
|
712
|
+
arch_path = os.path.join("docs", "ARCHITECTURE.md") if os.path.isdir(os.path.join(project_dir, "docs")) else "ARCHITECTURE.md"
|
|
713
|
+
entries[arch_path] = WorkspaceGovernanceSynthesizer.generate_architecture_md(profile)
|
|
714
|
+
return [
|
|
715
|
+
os.path.join(project_dir, path)
|
|
716
|
+
for path, content in entries.items()
|
|
717
|
+
if create_workspace_file(project_dir, path, content)
|
|
718
|
+
]
|
|
762
719
|
|
|
763
720
|
|
|
764
721
|
# =============================================================================
|
|
@@ -11,7 +11,7 @@ Capabilities:
|
|
|
11
11
|
- 100% Offline, $0 cost, zero cloud dependencies (Python standard library only).
|
|
12
12
|
|
|
13
13
|
Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
14
|
-
Part of T-Zero Context Architect v12.3.
|
|
14
|
+
Part of T-Zero Context Architect v12.3.5 Master Edition.
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import ast
|
|
@@ -208,7 +208,7 @@ class ASTGoldenRegressionEngine:
|
|
|
208
208
|
|
|
209
209
|
return GoldenBaseline(
|
|
210
210
|
workspace_root=abs_root,
|
|
211
|
-
version="12.3.
|
|
211
|
+
version="12.3.5",
|
|
212
212
|
created_at=time.time(),
|
|
213
213
|
symbols=all_sigs,
|
|
214
214
|
total_symbols=len(all_sigs),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
T-ZERO $0.00 BUDGET VIRAL MARKETING & COMMUNITY GROWTH ENGINE
|
|
4
4
|
-------------------------------------------------------------
|
|
5
5
|
Developer: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
6
|
-
License: MIT | Version: 12.3.
|
|
6
|
+
License: MIT | Version: 12.3.5
|
|
7
7
|
|
|
8
8
|
Strictly $0.00 budget: Zero paid ads, zero paid APIs, zero cloud tokens.
|
|
9
9
|
Pure organic developer-to-developer growth engine engineered to drive 100+ GitHub stars.
|
|
@@ -238,7 +238,7 @@ class JarvisOrchestrator:
|
|
|
238
238
|
rules = self.workspace_orchestrator.synthesize_rules(profile)
|
|
239
239
|
applied = []
|
|
240
240
|
if auto_apply:
|
|
241
|
-
applied = self.workspace_orchestrator.apply_governance_rules(rules
|
|
241
|
+
applied = self.workspace_orchestrator.apply_governance_rules(rules)
|
|
242
242
|
return {
|
|
243
243
|
"project_name": profile.project_name,
|
|
244
244
|
"generated_rules": list(rules.keys()),
|
|
@@ -847,28 +847,17 @@ class WorkspaceOrchestrator:
|
|
|
847
847
|
prof = profile or self.profile_workspace()
|
|
848
848
|
return WorkspaceGovernanceSynthesizer.synthesize_all(prof)
|
|
849
849
|
|
|
850
|
-
def apply_governance_rules(self, rules: Optional[Dict[str, str]] = None
|
|
851
|
-
"""
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
"""
|
|
850
|
+
def apply_governance_rules(self, rules: Optional[Dict[str, str]] = None) -> List[str]:
|
|
851
|
+
"""Write generated governance files only when their paths are unoccupied."""
|
|
852
|
+
from tzero.tzero_sync import create_workspace_file
|
|
853
|
+
|
|
855
854
|
if rules is None:
|
|
856
855
|
rules = self.synthesize_rules()
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
# Mevcut dosya varsa ve overwrite false ise atla
|
|
864
|
-
if os.path.isfile(abs_path) and not overwrite:
|
|
865
|
-
continue
|
|
866
|
-
|
|
867
|
-
with open(abs_path, "w", encoding="utf-8") as fp:
|
|
868
|
-
fp.write(content)
|
|
869
|
-
written_files.append(rel_path.replace("\\", "/"))
|
|
870
|
-
|
|
871
|
-
return written_files
|
|
856
|
+
return [
|
|
857
|
+
path.replace("\\", "/")
|
|
858
|
+
for path, content in rules.items()
|
|
859
|
+
if create_workspace_file(self.workspace_root, path, content)
|
|
860
|
+
]
|
|
872
861
|
|
|
873
862
|
def run_swarm_audit(self, profile: Optional[WorkspaceProfile] = None) -> Dict[str, Any]:
|
|
874
863
|
"""
|
|
@@ -922,7 +911,7 @@ class WorkspaceOrchestrator:
|
|
|
922
911
|
rules = self.synthesize_rules(profile)
|
|
923
912
|
applied_files: List[str] = []
|
|
924
913
|
if auto_apply_rules:
|
|
925
|
-
applied_files = self.apply_governance_rules(rules
|
|
914
|
+
applied_files = self.apply_governance_rules(rules)
|
|
926
915
|
|
|
927
916
|
# 2. PBFT Sürü Denetimi
|
|
928
917
|
swarm_result: Optional[Dict[str, Any]] = None
|
package/src/tzero/tzero_lsp.py
CHANGED
package/src/tzero/tzero_mcp.py
CHANGED
|
@@ -33,7 +33,7 @@ import ast
|
|
|
33
33
|
import inspect
|
|
34
34
|
import logging
|
|
35
35
|
|
|
36
|
-
SERVER_VERSION = "12.3.
|
|
36
|
+
SERVER_VERSION = "12.3.5"
|
|
37
37
|
|
|
38
38
|
# Version checks must not initialize the MCP SDK or dependency bootstrap. Besides
|
|
39
39
|
# being needlessly expensive, that path may wait on package discovery/network
|
|
@@ -1163,8 +1163,8 @@ def create_mcp_server():
|
|
|
1163
1163
|
"- `target` (str, optional, default='all'): Target editor format: 'cursor', 'cline', 'windsurf', 'claude', 'copilot', or 'all'.\n"
|
|
1164
1164
|
"\n"
|
|
1165
1165
|
"Behavior:\n"
|
|
1166
|
-
"- Mutating: Creates
|
|
1167
|
-
"- Idempotent:
|
|
1166
|
+
"- Mutating: Creates missing configuration files in the target workspace directory.\n"
|
|
1167
|
+
"- Idempotent: Leaves existing files untouched.\n"
|
|
1168
1168
|
"- 100% Offline: Generates rule files locally using built-in templates with zero network requests.\n"
|
|
1169
1169
|
"- Auth & Rate Limits: Zero authentication or cloud credentials required; completes in <50ms.\n"
|
|
1170
1170
|
"- Error Handling: Defaults to standard T-Zero engineering templates if workspace configuration is empty.\n"
|
|
@@ -1183,45 +1183,7 @@ def create_mcp_server():
|
|
|
1183
1183
|
) -> str:
|
|
1184
1184
|
"""Exports AI coding agent rules into workspace."""
|
|
1185
1185
|
from tzero.tzero_features import AgentRulesGenerator
|
|
1186
|
-
|
|
1187
|
-
t = (target or "all").lower().strip()
|
|
1188
|
-
created = []
|
|
1189
|
-
if t in ("cursor", "cursorrules"):
|
|
1190
|
-
cr_path = os.path.join(project_root, ".cursorrules")
|
|
1191
|
-
with open(cr_path, "w", encoding="utf-8") as f:
|
|
1192
|
-
f.write(AgentRulesGenerator.generate_cursorrules(p_name))
|
|
1193
|
-
created.append(cr_path)
|
|
1194
|
-
c_rules_dir = os.path.join(project_root, ".cursor", "rules")
|
|
1195
|
-
os.makedirs(c_rules_dir, exist_ok=True)
|
|
1196
|
-
for mdc_name, content in AgentRulesGenerator.generate_cursor_mdc_rules(p_name, project_dir=project_root).items():
|
|
1197
|
-
mdc_path = os.path.join(c_rules_dir, mdc_name)
|
|
1198
|
-
with open(mdc_path, "w", encoding="utf-8") as f:
|
|
1199
|
-
f.write(content)
|
|
1200
|
-
created.append(mdc_path)
|
|
1201
|
-
elif t in ("cline", "clinerules"):
|
|
1202
|
-
cl_path = os.path.join(project_root, ".clinerules")
|
|
1203
|
-
with open(cl_path, "w", encoding="utf-8") as f:
|
|
1204
|
-
f.write(AgentRulesGenerator.generate_clinerules(p_name))
|
|
1205
|
-
created.append(cl_path)
|
|
1206
|
-
elif t in ("windsurf", "windsurfrules"):
|
|
1207
|
-
ws_path = os.path.join(project_root, ".windsurfrules")
|
|
1208
|
-
with open(ws_path, "w", encoding="utf-8") as f:
|
|
1209
|
-
f.write(AgentRulesGenerator.generate_windsurfrules(p_name))
|
|
1210
|
-
created.append(ws_path)
|
|
1211
|
-
elif t in ("claude", "claudemd"):
|
|
1212
|
-
claude_path = os.path.join(project_root, "CLAUDE.md")
|
|
1213
|
-
with open(claude_path, "w", encoding="utf-8") as f:
|
|
1214
|
-
f.write(AgentRulesGenerator.generate_claude_instructions(p_name))
|
|
1215
|
-
created.append(claude_path)
|
|
1216
|
-
elif t in ("copilot", "github"):
|
|
1217
|
-
gh_dir = os.path.join(project_root, ".github")
|
|
1218
|
-
os.makedirs(gh_dir, exist_ok=True)
|
|
1219
|
-
copilot_path = os.path.join(gh_dir, "copilot-instructions.md")
|
|
1220
|
-
with open(copilot_path, "w", encoding="utf-8") as f:
|
|
1221
|
-
f.write(AgentRulesGenerator.generate_copilot_instructions(p_name))
|
|
1222
|
-
created.append(copilot_path)
|
|
1223
|
-
else:
|
|
1224
|
-
created = AgentRulesGenerator.export_all(project_root)
|
|
1186
|
+
created = AgentRulesGenerator.export_all(project_root, target)
|
|
1225
1187
|
rel_paths = [os.path.relpath(p, project_root) for p in created]
|
|
1226
1188
|
return "✅ Generated AI Agent rule files:\n" + "\n".join(f"- `{p}`" for p in rel_paths)
|
|
1227
1189
|
|
|
@@ -3545,7 +3507,7 @@ def create_mcp_server():
|
|
|
3545
3507
|
) -> str:
|
|
3546
3508
|
"""Calculates token counts, commercial provider pricing estimates, and developer ROI savings."""
|
|
3547
3509
|
if export_agent_rules:
|
|
3548
|
-
return _legacy_export_agent_rules(
|
|
3510
|
+
return _legacy_export_agent_rules(target=export_agent_rules, project_root=project_root)
|
|
3549
3511
|
return _legacy_estimate_token_cost(text=text, project_root=project_root, reduction_mode="ultra")
|
|
3550
3512
|
|
|
3551
3513
|
# -------------------------------------------------------------------------
|
|
@@ -3949,42 +3911,33 @@ def create_mcp_server():
|
|
|
3949
3911
|
|
|
3950
3912
|
@_maybe_tool(
|
|
3951
3913
|
name="sync_workspace_rules",
|
|
3952
|
-
title="
|
|
3914
|
+
title="Preview Multi-Agent Rule Synchronization",
|
|
3953
3915
|
description=(
|
|
3954
|
-
"
|
|
3955
|
-
"\n"
|
|
3956
|
-
"
|
|
3957
|
-
"
|
|
3958
|
-
"
|
|
3959
|
-
"
|
|
3960
|
-
"
|
|
3961
|
-
"-
|
|
3962
|
-
"-
|
|
3963
|
-
"
|
|
3964
|
-
"- Error Handling: Skips unparseable modules gracefully while indexing valid symbols.\n"
|
|
3965
|
-
"\n"
|
|
3966
|
-
"Usage Guidelines:\n"
|
|
3967
|
-
"- When to use: Use when syncing fresh codebase AST symbols into Cursor, Claude Code, Windsurf, and Git hooks.\n"
|
|
3968
|
-
"- When NOT to use: Do not use if you only want to generate static rules without installing Git hooks (use 'export_agent_rules' instead).\n"
|
|
3969
|
-
"\n"
|
|
3970
|
-
"Returns: Formatted Markdown summary of synchronized files and indexed AST symbols."
|
|
3916
|
+
"Previews workspace rule generation, distinguishing from 'export_agent_rules', which can create missing rule files.\n"
|
|
3917
|
+
"\nParameters:\n"
|
|
3918
|
+
"- `workspace_dir` (str, optional, default='.'): Workspace directory to scan.\n"
|
|
3919
|
+
"\nBehavior:\n"
|
|
3920
|
+
"- Read-only: Scans local Python symbols, writes no rule files, and installs no Git hooks.\n"
|
|
3921
|
+
"- Auth & Rate Limits: Uses no network or external credentials.\n"
|
|
3922
|
+
"\nUsage Guidelines:\n"
|
|
3923
|
+
"- When to use: Check which rule files a workspace sync could create.\n"
|
|
3924
|
+
"- When NOT to use: To create missing files, use the CLI with --apply-sync.\n"
|
|
3925
|
+
"\nReturns: Markdown with candidate files and AST symbol counts."
|
|
3971
3926
|
),
|
|
3972
|
-
annotations=ToolAnnotations(read_only_hint=
|
|
3927
|
+
annotations=ToolAnnotations(read_only_hint=True, destructive_hint=False, idempotent_hint=True, open_world_hint=False)
|
|
3973
3928
|
)
|
|
3974
3929
|
def sync_workspace_rules(
|
|
3975
3930
|
workspace_dir: Annotated[str, Field(default=".", description="Target repository root directory (default: current directory).")] = "."
|
|
3976
3931
|
) -> str:
|
|
3977
|
-
"""
|
|
3932
|
+
"""Preview workspace rule generation."""
|
|
3978
3933
|
from tzero.tzero_sync import WorkspaceSyncManager
|
|
3979
3934
|
res = WorkspaceSyncManager.sync(workspace_dir)
|
|
3980
|
-
files_str = "\n".join(f"- `{f}`" for f in res.synced_files)
|
|
3981
3935
|
return (
|
|
3982
3936
|
f"# ⚡ T-Zero Autonomous Rules Synchronization\n\n"
|
|
3983
3937
|
f"- **Workspace:** `{res.workspace_dir}`\n"
|
|
3984
3938
|
f"- **Modules Scanned:** {res.modules_scanned}\n"
|
|
3985
3939
|
f"- **AST Symbols Indexed:** {res.symbols_indexed}\n"
|
|
3986
3940
|
f"- **Zero-Leak Security:** {res.zero_leak_status}\n\n"
|
|
3987
|
-
f"### Synchronized Directives:\n{files_str}\n\n"
|
|
3988
3941
|
f"**Status:** {res.summary_message}"
|
|
3989
3942
|
)
|
|
3990
3943
|
|
|
@@ -4810,7 +4763,7 @@ def create_mcp_server():
|
|
|
4810
4763
|
f"Supported actions: 'auto', 'context', 'audit', 'security', 'blueprint', 'dependencies', "
|
|
4811
4764
|
f"'impact', 'search', 'prune', 'rules', 'enforce', 'cost', 'memory', 'swarm', 'heal', 'design', "
|
|
4812
4765
|
f"'patch', 'pagerank', 'dead_code', 'duplicity', 'call_chain', 'sync', 'roi', 'drift', 'telemetry', 'ci', 'local_ci', "
|
|
4813
|
-
f"
|
|
4766
|
+
f"See the tool list for available actions."
|
|
4814
4767
|
)
|
|
4815
4768
|
|
|
4816
4769
|
def run_local_ci(quick: bool = False, auto_fix: bool = False, install_hook: bool = False, uninstall_hook: bool = False, project_root: str = ".") -> str:
|
|
@@ -4833,63 +4786,9 @@ def create_mcp_server():
|
|
|
4833
4786
|
+ "\n".join([f"- [{'PASS' if s.passed else 'FAIL'}] **{s.name}** ({s.duration:.2f}s): {s.output or s.error}" for s in report.steps])
|
|
4834
4787
|
)
|
|
4835
4788
|
|
|
4836
|
-
def armor_against_ai_reverse_engineering(target: str = ".", output_path: str = "") -> str:
|
|
4837
|
-
"""Applies military-grade Anti-REA code and binary protection against AI reverse-engineering agents."""
|
|
4838
|
-
from tzero.tzero_armor import protect_path_with_armor
|
|
4839
|
-
res = protect_path_with_armor(target, output_path=output_path or None)
|
|
4840
|
-
if not res.get("success"):
|
|
4841
|
-
return f"❌ Anti-REA protection failed: {res.get('error', 'Unknown error')}"
|
|
4842
|
-
|
|
4843
|
-
if "score_after" in res:
|
|
4844
|
-
return (
|
|
4845
|
-
f"### 🛡️ T-Zero Anti-REA Military Armor Report\n"
|
|
4846
|
-
f"- **Target File:** `{res['output_file']}`\n"
|
|
4847
|
-
f"- **AI Resistance Score:** `{res['score_before']}/100` ➔ `{res['score_after']}/100`\n"
|
|
4848
|
-
f"- **Rating:** `{res['rating']}`\n"
|
|
4849
|
-
f"- **Status:** `ACTIVE` (Protected against morluto/rea, Ghidra MCP, pyinstxtractor)\n"
|
|
4850
|
-
)
|
|
4851
|
-
elif "files_protected" in res:
|
|
4852
|
-
return (
|
|
4853
|
-
f"### 🛡️ T-Zero Anti-REA Codebase Armor Report\n"
|
|
4854
|
-
f"- **Directory:** `{res['directory']}`\n"
|
|
4855
|
-
f"- **Files Protected:** `{res['files_protected']}`\n"
|
|
4856
|
-
f"- **Status:** `ACTIVE` (All Python modules hardened with Anti-REA defense matrix)\n"
|
|
4857
|
-
)
|
|
4858
|
-
return json.dumps(res, indent=2)
|
|
4859
|
-
|
|
4860
|
-
def audit_ai_decompilation_resistance(target: str = ".") -> str:
|
|
4861
|
-
"""Audits target code or binary for resistance against AI reverse engineering (0-100 score)."""
|
|
4862
|
-
from tzero.tzero_armor import audit_path_rea_resistance
|
|
4863
|
-
audit = audit_path_rea_resistance(target)
|
|
4864
|
-
if not audit.get("success", True):
|
|
4865
|
-
return f"❌ Audit failed: {audit.get('error', 'Unknown error')}"
|
|
4866
|
-
|
|
4867
|
-
report = [
|
|
4868
|
-
f"### 🛡️ AI Reverse-Engineering Resistance Audit (TDQS-REA)",
|
|
4869
|
-
f"- **Target:** `{target}`",
|
|
4870
|
-
f"- **Resistance Score:** `{audit.get('score', 0)} / 100` (`{audit.get('rating', 'UNKNOWN')}`)",
|
|
4871
|
-
f"- **Status:** `{audit.get('status', 'N/A')}`\n",
|
|
4872
|
-
f"#### Active Defenses:",
|
|
4873
|
-
]
|
|
4874
|
-
for k, v in audit.get("defenses_active", {}).items():
|
|
4875
|
-
report.append(f"- [{'✔' if v else ' '}] **{k}**")
|
|
4876
|
-
|
|
4877
|
-
recs = audit.get("sample_findings") or audit.get("findings", [])
|
|
4878
|
-
if recs:
|
|
4879
|
-
report.append("\n#### Hardening Recommendations:")
|
|
4880
|
-
for r in recs:
|
|
4881
|
-
report.append(f"- ⚠️ {r}")
|
|
4882
|
-
|
|
4883
|
-
return "\n".join(report)
|
|
4884
|
-
|
|
4885
4789
|
# Register canonical mappings
|
|
4886
4790
|
_CANONICAL_DISPATCH['execute_codebase_workflow'] = execute_codebase_workflow
|
|
4887
4791
|
_CANONICAL_DISPATCH['run_codebase_autopilot'] = execute_codebase_workflow
|
|
4888
|
-
_CANONICAL_DISPATCH['armor_against_ai_reverse_engineering'] = armor_against_ai_reverse_engineering
|
|
4889
|
-
_CANONICAL_DISPATCH['armor'] = armor_against_ai_reverse_engineering
|
|
4890
|
-
_CANONICAL_DISPATCH['anti_rea'] = armor_against_ai_reverse_engineering
|
|
4891
|
-
_CANONICAL_DISPATCH['audit_ai_decompilation_resistance'] = audit_ai_decompilation_resistance
|
|
4892
|
-
_CANONICAL_DISPATCH['audit_rea'] = audit_ai_decompilation_resistance
|
|
4893
4792
|
_CANONICAL_DISPATCH['build_project_context'] = build_project_context
|
|
4894
4793
|
_CANONICAL_DISPATCH['prune_code_snippet'] = prune_code_snippet
|
|
4895
4794
|
_CANONICAL_DISPATCH['manage_architecture_rules'] = manage_architecture_rules
|