tzero-mcp 10.7.3 → 11.0.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/CHANGELOG.md +44 -577
- package/CONTRIBUTING.md +71 -71
- package/README.md +64 -64
- package/bin/tzero-mcp.js +62 -65
- package/bin/tzero.js +61 -64
- package/index.d.ts +25 -25
- package/index.js +15 -15
- package/package.json +88 -67
- package/src/addmcp.py +14 -11
- package/src/app.py +1810 -0
- package/src/main.py +1 -1
- package/src/pc_fixer_mcp.py +25 -0
- package/src/tzero/__init__.py +54 -0
- package/src/tzero/__main__.py +6 -0
- package/src/tzero/siber_akademi.ico +0 -0
- package/src/tzero/tzero_arch_test.py +463 -0
- package/src/{tzero_benchmark.py → tzero/tzero_benchmark.py} +475 -475
- package/src/tzero/tzero_blackboard.py +257 -0
- package/src/{tzero_bridge.py → tzero/tzero_bridge.py} +546 -362
- package/src/tzero/tzero_budget.py +195 -0
- package/src/{tzero_ci.py → tzero/tzero_ci.py} +153 -153
- package/src/{tzero_commit.py → tzero/tzero_commit.py} +192 -192
- package/src/tzero/tzero_contracts.py +1093 -0
- package/src/{tzero_cost.py → tzero/tzero_cost.py} +166 -163
- package/src/{tzero_dashboard.py → tzero/tzero_dashboard.py} +531 -19
- package/src/tzero/tzero_debt.py +461 -0
- package/src/{tzero_deps.py → tzero/tzero_deps.py} +179 -4
- package/src/{tzero_drift.py → tzero/tzero_drift.py} +208 -208
- package/src/{tzero_explain.py → tzero/tzero_explain.py} +73 -7
- package/src/{tzero_features.py → tzero/tzero_features.py} +19 -17
- package/src/tzero/tzero_federation.py +299 -0
- package/src/{tzero_fix.py → tzero/tzero_fix.py} +228 -228
- package/src/{tzero_fixer → tzero/tzero_fixer}/__init__.py +63 -63
- package/src/{tzero_fixer → tzero/tzero_fixer}/ast_syntax_healer.py +464 -464
- package/src/{tzero_fixer → tzero/tzero_fixer}/ast_type_modernizer.py +288 -288
- package/src/{tzero_fixer → tzero/tzero_fixer}/async_io_modernizer.py +127 -127
- package/src/{tzero_fixer → tzero/tzero_fixer}/automated_regression_suite.py +600 -600
- package/src/{tzero_fixer → tzero/tzero_fixer}/benchmarks_and_diagnostics.py +174 -174
- package/src/{tzero_fixer → tzero/tzero_fixer}/ci_cd_self_healing_gate.py +246 -246
- package/src/{tzero_fixer → tzero/tzero_fixer}/code_duplicity_and_refactorer.py +151 -151
- package/src/{tzero_fixer → tzero/tzero_fixer}/code_smells_healer.py +260 -260
- package/src/{tzero_fixer → tzero/tzero_fixer}/cwe_remediator.py +171 -171
- package/src/{tzero_fixer → tzero/tzero_fixer}/dead_code_eliminator.py +150 -150
- package/src/{tzero_fixer → tzero/tzero_fixer}/dependency_vulnerability_auditor.py +309 -309
- package/src/{tzero_fixer → tzero/tzero_fixer}/git_advanced_surgeon.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/hardware_and_disk_doctor.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/import_graph_healer.py +412 -412
- package/src/{tzero_fixer → tzero/tzero_fixer}/interactive_tui.py +91 -91
- package/src/{tzero_fixer → tzero/tzero_fixer}/knowledge_base.py +295 -295
- package/src/{tzero_fixer → tzero/tzero_fixer}/knowledge_base_extended.py +940 -940
- package/src/{tzero_fixer → tzero/tzero_fixer}/linters_and_static_analyzer.py +307 -307
- package/src/{tzero_fixer → tzero/tzero_fixer}/mcp_server.py +49 -7
- package/src/{tzero_fixer → tzero/tzero_fixer}/os_doctor.py +502 -502
- package/src/{tzero_fixer → tzero/tzero_fixer}/packaging_abi_surgeon.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/pc_fixer_doctor.py +600 -599
- package/src/{tzero_fixer → tzero/tzero_fixer}/performance_and_memory_profiler.py +274 -274
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_ast_parsers.py +313 -313
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_build_healer.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_config_healer.py +318 -318
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_doctor.py +372 -372
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_linters.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_schema_validator.py +305 -305
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_cwe_database.py +444 -444
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_deep_rules.py +114 -114
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_rules_catalog.py +110 -110
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_zero_leak.py +326 -326
- package/src/{tzero_fixer → tzero/tzero_fixer}/smart_patch_recommender.py +223 -223
- package/src/{tzero_fixer → tzero/tzero_fixer}/synthetic_workspace_generator.py +220 -220
- package/src/{tzero_fixer → tzero/tzero_fixer}/system_diagnostics_extended.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/system_repair_recipes.py +447 -447
- package/src/{tzero_fixer → tzero/tzero_fixer}/venv_doctor.py +309 -309
- package/src/tzero/tzero_golden.py +319 -0
- package/src/tzero/tzero_graph_hud.html +338 -0
- package/src/tzero/tzero_graph_rag.py +263 -0
- package/src/{tzero_guard.py → tzero/tzero_guard.py} +243 -243
- package/src/tzero/tzero_hooks.py +565 -0
- package/src/{tzero_infra.py → tzero/tzero_infra.py} +274 -274
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/__init__.py +124 -124
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/causal_graph.py +310 -310
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/graph_visualizer.py +395 -395
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/hybrid_search.py +214 -214
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/latent_press.py +137 -137
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/memory_consolidation.py +212 -212
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/minhash_lsh.py +184 -184
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/orchestrator.py +335 -335
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/self_healing.py +308 -308
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/semantic_compressor.py +887 -887
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/swarm.py +261 -261
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/swarm_bft.py +144 -144
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/workspace_orchestrator.py +1167 -1167
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/zero_key_router.py +173 -173
- package/src/tzero/tzero_lsp.py +634 -0
- package/src/{tzero_mcp.py → tzero/tzero_mcp.py} +479 -100
- package/src/tzero/tzero_mutation.py +358 -0
- package/src/tzero/tzero_packer.py +577 -0
- package/src/{tzero_patch.py → tzero/tzero_patch.py} +624 -624
- package/src/{tzero_pc_fixer.py → tzero/tzero_pc_fixer.py} +12699 -12657
- package/src/{tzero_pipe.py → tzero/tzero_pipe.py} +95 -95
- package/src/tzero/tzero_polyglot.py +799 -0
- package/src/tzero/tzero_proxy.py +127 -0
- package/src/{tzero_reachability.py → tzero/tzero_reachability.py} +272 -272
- package/src/{tzero_replay.py → tzero/tzero_replay.py} +141 -141
- package/src/tzero/tzero_rust_bridge.py +198 -0
- package/src/tzero/tzero_scip.py +368 -0
- package/src/{tzero_security.py → tzero/tzero_security.py} +5 -2
- package/src/tzero/tzero_semantic_merge.py +189 -0
- package/src/tzero/tzero_snapshot.py +471 -0
- package/src/{tzero_stubs.py → tzero/tzero_stubs.py} +313 -313
- package/src/tzero/tzero_subagent_engine.py +459 -0
- package/src/{tzero_superdesign.py → tzero/tzero_superdesign.py} +774 -774
- package/src/{tzero_sync.py → tzero/tzero_sync.py} +241 -241
- package/src/{tzero_task_benchmark.py → tzero/tzero_task_benchmark.py} +458 -363
- package/src/{tzero_tui.py → tzero/tzero_tui.py} +91 -22
- package/src/tzero/tzero_turbo.py +264 -0
- package/src/{tzero_v3.py → tzero/tzero_v3.py} +628 -163
- package/src/tzero.py +2 -54
- package/test/package.test.js +55 -19
- package/src/tzero/jarvis/semantic_compressor.py +0 -373
- package/src/tzero_gateway.py +0 -885
- package/src/tzero_packer.py +0 -370
- package/src/tzero_polyglot.py +0 -422
- package/src/tzero_snapshot.py +0 -258
- /package/src/{siber_akademi_icon.py → tzero/siber_akademi_icon.py} +0 -0
- /package/src/{tzero_fixer → tzero/tzero_fixer}/amalgamation.py +0 -0
- /package/src/{tzero_fixer → tzero/tzero_fixer}/models.py +0 -0
- /package/src/{tzero_fixer → tzero/tzero_fixer}/orchestrator.py +0 -0
- /package/src/{tzero_neural_cortex.py → tzero/tzero_neural_cortex.py} +0 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
# Contributing to T-Zero
|
|
2
|
-
|
|
3
|
-
Thank you for your interest in contributing to **T-Zero**! We welcome community contributions, bug reports, and performance optimizations from engineers worldwide.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🛠 Local Development Setup
|
|
8
|
-
|
|
9
|
-
1. **Clone the repository:**
|
|
10
|
-
```bash
|
|
11
|
-
git clone https://github.com/toprakahmetaydogmus/TZeroAlgorithm.git
|
|
12
|
-
cd TZeroAlgorithm
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
2. **Create a virtual environment:**
|
|
16
|
-
```bash
|
|
17
|
-
python -m venv .venv
|
|
18
|
-
# Windows:
|
|
19
|
-
.venv\Scripts\activate
|
|
20
|
-
# Linux/macOS:
|
|
21
|
-
source .venv/bin/activate
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
3. **Install dependencies and editable package:**
|
|
25
|
-
```bash
|
|
26
|
-
pip install -e ".[test,build]"
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 🧪 Verification Pipeline Before Submitting a PR
|
|
32
|
-
|
|
33
|
-
Before opening a pull request, ensure all verification gates pass locally:
|
|
34
|
-
|
|
35
|
-
1. **Syntax Check:**
|
|
36
|
-
```bash
|
|
37
|
-
python -m py_compile $(git diff --name-only HEAD | grep '\.py$')
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
2. **Run Zero-Leak Secret Audit:**
|
|
41
|
-
```bash
|
|
42
|
-
python tests/audit_secrets.py
|
|
43
|
-
# Must return: Total secret audit findings: 0
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
3. **Run Unit Tests:**
|
|
47
|
-
```bash
|
|
48
|
-
python -m unittest discover tests -v
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
4. **Run Empirical Task Benchmark:**
|
|
52
|
-
```bash
|
|
53
|
-
python tzero_task_benchmark.py
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## 📐 Code Style & Architecture Guidelines
|
|
59
|
-
|
|
60
|
-
- **Determinism First:** All AST parsing, BM25 searching, and token reduction must run 100% locally with zero external network telemetry.
|
|
61
|
-
- **Inward Dependencies:** Core modules (`tzero_packer`, `tzero_guard`) must not depend on outer presentation layers (`tzero_tui`, `tzero_gui`).
|
|
62
|
-
- **No Plaintext Secrets:** Never commit API keys, connection URIs, or high-entropy tokens.
|
|
63
|
-
- **Air-Gapped Compliance:** Respect `TZERO_NO_AUTO_INSTALL=1` across all scripts.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## 💬 Community & Discussions
|
|
68
|
-
|
|
69
|
-
- **GitHub Issues:** [Bug Reports & Feature Requests](https://github.com/toprakahmetaydogmus/TZeroAlgorithm/issues)
|
|
70
|
-
- **Hugging Face Space:** [Interactive Web Demo](https://huggingface.co/spaces/toprakke4/tzero-token-reducer)
|
|
71
|
-
- **Maintainer:** Toprak Ahmet Aydoğmuş (`siberakademi@org.tr`)
|
|
1
|
+
# Contributing to T-Zero
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to **T-Zero**! We welcome community contributions, bug reports, and performance optimizations from engineers worldwide.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🛠 Local Development Setup
|
|
8
|
+
|
|
9
|
+
1. **Clone the repository:**
|
|
10
|
+
```bash
|
|
11
|
+
git clone https://github.com/toprakahmetaydogmus/TZeroAlgorithm.git
|
|
12
|
+
cd TZeroAlgorithm
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. **Create a virtual environment:**
|
|
16
|
+
```bash
|
|
17
|
+
python -m venv .venv
|
|
18
|
+
# Windows:
|
|
19
|
+
.venv\Scripts\activate
|
|
20
|
+
# Linux/macOS:
|
|
21
|
+
source .venv/bin/activate
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
3. **Install dependencies and editable package:**
|
|
25
|
+
```bash
|
|
26
|
+
pip install -e ".[test,build]"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🧪 Verification Pipeline Before Submitting a PR
|
|
32
|
+
|
|
33
|
+
Before opening a pull request, ensure all verification gates pass locally:
|
|
34
|
+
|
|
35
|
+
1. **Syntax Check:**
|
|
36
|
+
```bash
|
|
37
|
+
python -m py_compile $(git diff --name-only HEAD | grep '\.py$')
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. **Run Zero-Leak Secret Audit:**
|
|
41
|
+
```bash
|
|
42
|
+
python tests/audit_secrets.py
|
|
43
|
+
# Must return: Total secret audit findings: 0
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. **Run Unit Tests:**
|
|
47
|
+
```bash
|
|
48
|
+
python -m unittest discover tests -v
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
4. **Run Empirical Task Benchmark:**
|
|
52
|
+
```bash
|
|
53
|
+
python tzero_task_benchmark.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 📐 Code Style & Architecture Guidelines
|
|
59
|
+
|
|
60
|
+
- **Determinism First:** All AST parsing, BM25 searching, and token reduction must run 100% locally with zero external network telemetry.
|
|
61
|
+
- **Inward Dependencies:** Core modules (`tzero_packer`, `tzero_guard`) must not depend on outer presentation layers (`tzero_tui`, `tzero_gui`).
|
|
62
|
+
- **No Plaintext Secrets:** Never commit API keys, connection URIs, or high-entropy tokens.
|
|
63
|
+
- **Air-Gapped Compliance:** Respect `TZERO_NO_AUTO_INSTALL=1` across all scripts.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 💬 Community & Discussions
|
|
68
|
+
|
|
69
|
+
- **GitHub Issues:** [Bug Reports & Feature Requests](https://github.com/toprakahmetaydogmus/TZeroAlgorithm/issues)
|
|
70
|
+
- **Hugging Face Space:** [Interactive Web Demo](https://huggingface.co/spaces/toprakke4/tzero-token-reducer)
|
|
71
|
+
- **Maintainer:** Toprak Ahmet Aydoğmuş (`siberakademi@org.tr`)
|
package/README.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# tzero-mcp
|
|
2
|
-
|
|
3
|
-
> **Deterministic AST Context Compressor, 95% Token Reducer & 20-Tool MCP Server for Cursor, Claude Desktop, Antigravity & Copilot.**
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/tzero-mcp)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
[](https://socket.dev/npm/package/tzero-mcp)
|
|
8
|
-
[](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
### ⭐
|
|
13
|
-
|
|
14
|
-
Hi! I'm **Toprak Ahmet Aydoğmu
|
|
15
|
-
|
|
16
|
-
If this package helps your engineering team or AI workflows:
|
|
17
|
-
⭐ **Please give our repository a STAR on GitHub:**
|
|
18
|
-
👉 **[https://github.com/toprakahmetaydogmus/TZeroAlgorithm](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)**
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## ⚡ Instant MCP Execution (Zero Install Needed)
|
|
24
|
-
|
|
25
|
-
Run directly via `npx` in your `claude_desktop_config.json`, Cursor MCP settings, or Windsurf / Antigravity config:
|
|
26
|
-
|
|
27
|
-
```json
|
|
28
|
-
{
|
|
29
|
-
"mcpServers": {
|
|
30
|
-
"tzero": {
|
|
31
|
-
"command": "npx",
|
|
32
|
-
"args": ["-y", "tzero-mcp@latest"]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## 🚀 CLI Installation & Usage
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Global installation via npm
|
|
42
|
-
npm install -g tzero-mcp
|
|
43
|
-
|
|
44
|
-
# Compress any project directory into an AST Skeleton tree (95% token savings)
|
|
45
|
-
tzero --tree . --out tree.txt
|
|
46
|
-
|
|
47
|
-
# Launch interactive Model Context Protocol (MCP) Server
|
|
48
|
-
tzero-mcp
|
|
49
|
-
|
|
50
|
-
# 1-Click connect to Cursor, Claude Desktop, Antigravity & VS Code
|
|
51
|
-
tzero-add-mcp
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 🛠 Key Capabilities
|
|
55
|
-
|
|
56
|
-
- **95% Deterministic Token Reduction:** Compresses source code into AST skeletons preserving function signatures, type annotations, and docstrings while pruning redundant logic bodies.
|
|
57
|
-
- **100% Zero-Leak Security Guard:** Deep Shannon Entropy ($H \ge 4.75$) scanner for API keys and secrets before LLM context ingestion.
|
|
58
|
-
- **Reality-Lock Pre-Flight:** Catches hallucinations before code execution by validating imports and call hierarchies against real AST nodes.
|
|
59
|
-
- **20 Native Developer Tools:** AST PageRank, call-chain tracer, BM25 semantic hybrid search, change blast radius analyzer, and system doctor.
|
|
60
|
-
- **100% Private, Local & Free:** Pure offline operation — $0 API cost, zero cloud lock-in.
|
|
61
|
-
|
|
62
|
-
## 📄 License
|
|
63
|
-
|
|
64
|
-
MIT © [Toprak Ahmet Aydoğmuş](https://github.com/toprakahmetaydogmus)
|
|
1
|
+
# tzero-mcp
|
|
2
|
+
|
|
3
|
+
> **Deterministic AST Context Compressor, 95% Token Reducer & 20-Tool MCP Server for Cursor, Claude Desktop, Antigravity & Copilot.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/tzero-mcp)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://socket.dev/npm/package/tzero-mcp)
|
|
8
|
+
[](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
### ⭐ Open-Source Engineering (Please Star Our Repo!)
|
|
13
|
+
|
|
14
|
+
Hi! I'm **Toprak Ahmet Aydoğmuş** from **Siber Akademi**. I created T-Zero from scratch to eliminate token limits, reduce prompt costs by up to 95%, and stop AI coding hallucinations using deterministic Abstract Syntax Tree (AST) analysis.
|
|
15
|
+
|
|
16
|
+
If this package helps your engineering team or AI workflows:
|
|
17
|
+
⭐ **Please give our repository a STAR on GitHub:**
|
|
18
|
+
👉 **[https://github.com/toprakahmetaydogmus/TZeroAlgorithm](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)**
|
|
19
|
+
*100% Free & Open-Source under MIT License. Thank you! 🚀*
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ⚡ Instant MCP Execution (Zero Install Needed)
|
|
24
|
+
|
|
25
|
+
Run directly via `npx` in your `claude_desktop_config.json`, Cursor MCP settings, or Windsurf / Antigravity config:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"tzero": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["-y", "tzero-mcp@latest"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 🚀 CLI Installation & Usage
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Global installation via npm
|
|
42
|
+
npm install -g tzero-mcp
|
|
43
|
+
|
|
44
|
+
# Compress any project directory into an AST Skeleton tree (95% token savings)
|
|
45
|
+
tzero --tree . --out tree.txt
|
|
46
|
+
|
|
47
|
+
# Launch interactive Model Context Protocol (MCP) Server
|
|
48
|
+
tzero-mcp
|
|
49
|
+
|
|
50
|
+
# 1-Click connect to Cursor, Claude Desktop, Antigravity & VS Code
|
|
51
|
+
tzero-add-mcp
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 🛠 Key Capabilities
|
|
55
|
+
|
|
56
|
+
- **95% Deterministic Token Reduction:** Compresses source code into AST skeletons preserving function signatures, type annotations, and docstrings while pruning redundant logic bodies.
|
|
57
|
+
- **100% Zero-Leak Security Guard:** Deep Shannon Entropy ($H \ge 4.75$) scanner for API keys and secrets before LLM context ingestion.
|
|
58
|
+
- **Reality-Lock Pre-Flight:** Catches hallucinations before code execution by validating imports and call hierarchies against real AST nodes.
|
|
59
|
+
- **20 Native Developer Tools:** AST PageRank, call-chain tracer, BM25 semantic hybrid search, change blast radius analyzer, and system doctor.
|
|
60
|
+
- **100% Private, Local & Free:** Pure offline operation — $0 API cost, zero cloud lock-in.
|
|
61
|
+
|
|
62
|
+
## 📄 License
|
|
63
|
+
|
|
64
|
+
MIT © [Toprak Ahmet Aydoğmuş](https://github.com/toprakahmetaydogmus)
|
package/bin/tzero-mcp.js
CHANGED
|
@@ -1,65 +1,62 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* T-Zero Model Context Protocol (MCP) Server Launcher
|
|
5
|
-
* Author: Toprak Ahmet Aydoğmuş (
|
|
6
|
-
* Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const { spawn, spawnSync } = require("child_process");
|
|
10
|
-
const process = require("process");
|
|
11
|
-
const path = require("path");
|
|
12
|
-
const pkg = require("../package.json");
|
|
13
|
-
|
|
14
|
-
// In MCP mode, banner is printed to stderr to keep stdout strictly for JSON-RPC
|
|
15
|
-
const banner = `\x1b[
|
|
16
|
-
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
17
|
-
│
|
|
18
|
-
│
|
|
19
|
-
│
|
|
20
|
-
│
|
|
21
|
-
│
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
process.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
child.on("close", (code) => {
|
|
64
|
-
process.exit(code ?? 0);
|
|
65
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* T-Zero Model Context Protocol (MCP) Server Launcher
|
|
5
|
+
* Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
6
|
+
* Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { spawn, spawnSync } = require("child_process");
|
|
10
|
+
const process = require("process");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
const pkg = require("../package.json");
|
|
13
|
+
|
|
14
|
+
// In MCP mode, banner is printed to stderr to keep stdout strictly for JSON-RPC
|
|
15
|
+
const banner = `\x1b[36m
|
|
16
|
+
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
17
|
+
│ ⚡ T-ZERO MCP SERVER v${pkg.version} (Model Context Protocol) │
|
|
18
|
+
│ Enterprise AST Context Compressor, Zero-Leak Guard & 20 Canonical Tools │
|
|
19
|
+
│ │
|
|
20
|
+
│ ⭐ Star on GitHub: https://github.com/toprakahmetaydogmus/TZeroAlgorithm │
|
|
21
|
+
│ 🔌 Connected to: Cursor, Claude Desktop, Antigravity, Windsurf & Cline │
|
|
22
|
+
└──────────────────────────────────────────────────────────────────────────────┘
|
|
23
|
+
\x1b[0m`;
|
|
24
|
+
|
|
25
|
+
if (process.stderr.isTTY) {
|
|
26
|
+
process.stderr.write(banner + "\n");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function findPython() {
|
|
30
|
+
if (process.env.PYTHON) return process.env.PYTHON;
|
|
31
|
+
const candidates = ["python3", "python", "py"];
|
|
32
|
+
for (const cmd of candidates) {
|
|
33
|
+
try {
|
|
34
|
+
const res = spawnSync(cmd, ["--version"], { stdio: "ignore", shell: false });
|
|
35
|
+
if (res.status === 0) return cmd;
|
|
36
|
+
} catch (e) {
|
|
37
|
+
// continue
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const py = findPython();
|
|
44
|
+
if (!py) {
|
|
45
|
+
console.error("\x1b[31m[ERROR] Python 3.10+ is required to run T-Zero MCP Server.\x1b[0m");
|
|
46
|
+
console.error("Please install Python from https://python.org or your package manager.");
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const srcDir = path.resolve(__dirname, "..", "src");
|
|
51
|
+
const scriptPath = path.join(srcDir, "tzero", "tzero_mcp.py");
|
|
52
|
+
|
|
53
|
+
const env = Object.assign({}, process.env, {
|
|
54
|
+
PYTHONPATH: srcDir + (process.env.PYTHONPATH ? path.delimiter + process.env.PYTHONPATH : "")
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const args = [scriptPath, ...process.argv.slice(2)];
|
|
58
|
+
const child = spawn(py, args, { stdio: "inherit", shell: false, env });
|
|
59
|
+
|
|
60
|
+
child.on("close", (code) => {
|
|
61
|
+
process.exit(code ?? 0);
|
|
62
|
+
});
|
package/bin/tzero.js
CHANGED
|
@@ -1,64 +1,61 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* T-Zero Context Architect CLI Launcher
|
|
5
|
-
* Author: Toprak Ahmet Aydoğmuş (
|
|
6
|
-
* Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const { spawn, spawnSync } = require("child_process");
|
|
10
|
-
const process = require("process");
|
|
11
|
-
const path = require("path");
|
|
12
|
-
const pkg = require("../package.json");
|
|
13
|
-
|
|
14
|
-
const banner = `\x1b[
|
|
15
|
-
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
16
|
-
│
|
|
17
|
-
│
|
|
18
|
-
│
|
|
19
|
-
│
|
|
20
|
-
│
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
child.on("close", (code) => {
|
|
63
|
-
process.exit(code ?? 0);
|
|
64
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* T-Zero Context Architect CLI Launcher
|
|
5
|
+
* Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
6
|
+
* Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { spawn, spawnSync } = require("child_process");
|
|
10
|
+
const process = require("process");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
const pkg = require("../package.json");
|
|
13
|
+
|
|
14
|
+
const banner = `\x1b[36m
|
|
15
|
+
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
16
|
+
│ ⚡ T-ZERO CONTEXT ARCHITECT & MCP ENGINE v${pkg.version} │
|
|
17
|
+
│ Deterministic AST Context Compressor, 95% Token Reducer & Security Guard │
|
|
18
|
+
│ │
|
|
19
|
+
│ ⭐ Star on GitHub: https://github.com/toprakahmetaydogmus/TZeroAlgorithm │
|
|
20
|
+
│ 💡 1-Click Init: tzero init (Cursor, Claude, Windsurf, Antigravity) │
|
|
21
|
+
└──────────────────────────────────────────────────────────────────────────────┘
|
|
22
|
+
\x1b[0m`;
|
|
23
|
+
|
|
24
|
+
if (process.stdout.isTTY && !process.argv.includes("--json") && !process.argv.includes("--pipe")) {
|
|
25
|
+
console.log(banner);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function findPython() {
|
|
29
|
+
if (process.env.PYTHON) return process.env.PYTHON;
|
|
30
|
+
const candidates = ["python3", "python", "py"];
|
|
31
|
+
for (const cmd of candidates) {
|
|
32
|
+
try {
|
|
33
|
+
const res = spawnSync(cmd, ["--version"], { stdio: "ignore", shell: false });
|
|
34
|
+
if (res.status === 0) return cmd;
|
|
35
|
+
} catch (e) {
|
|
36
|
+
// continue
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const py = findPython();
|
|
43
|
+
if (!py) {
|
|
44
|
+
console.error("\x1b[31m[ERROR] Python 3.10+ is required to run T-Zero.\x1b[0m");
|
|
45
|
+
console.error("Please install Python from https://python.org or your package manager.");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const srcDir = path.resolve(__dirname, "..", "src");
|
|
50
|
+
const scriptPath = path.join(srcDir, "tzero", "tzero_v3.py");
|
|
51
|
+
|
|
52
|
+
const env = Object.assign({}, process.env, {
|
|
53
|
+
PYTHONPATH: srcDir + (process.env.PYTHONPATH ? path.delimiter + process.env.PYTHONPATH : "")
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const args = [scriptPath, ...process.argv.slice(2)];
|
|
57
|
+
const child = spawn(py, args, { stdio: "inherit", shell: false, env });
|
|
58
|
+
|
|
59
|
+
child.on("close", (code) => {
|
|
60
|
+
process.exit(code ?? 0);
|
|
61
|
+
});
|
package/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* T-Zero Model Context Protocol (MCP) Server & AST Context Architect
|
|
3
|
-
* Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
4
|
-
* Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export interface TZeroPackageInfo {
|
|
8
|
-
version: string;
|
|
9
|
-
author: string;
|
|
10
|
-
repository: string;
|
|
11
|
-
srcDir: string;
|
|
12
|
-
mcpServer: string;
|
|
13
|
-
cli: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export declare const version: string;
|
|
17
|
-
export declare const author: string;
|
|
18
|
-
export declare const repository: string;
|
|
19
|
-
export declare const srcDir: string;
|
|
20
|
-
export declare const mcpServer: string;
|
|
21
|
-
export declare const cli: string;
|
|
22
|
-
|
|
23
|
-
declare const tzero: TZeroPackageInfo;
|
|
24
|
-
export default tzero;
|
|
25
|
-
|
|
1
|
+
/**
|
|
2
|
+
* T-Zero Model Context Protocol (MCP) Server & AST Context Architect
|
|
3
|
+
* Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
|
|
4
|
+
* Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface TZeroPackageInfo {
|
|
8
|
+
version: string;
|
|
9
|
+
author: string;
|
|
10
|
+
repository: string;
|
|
11
|
+
srcDir: string;
|
|
12
|
+
mcpServer: string;
|
|
13
|
+
cli: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare const version: string;
|
|
17
|
+
export declare const author: string;
|
|
18
|
+
export declare const repository: string;
|
|
19
|
+
export declare const srcDir: string;
|
|
20
|
+
export declare const mcpServer: string;
|
|
21
|
+
export declare const cli: string;
|
|
22
|
+
|
|
23
|
+
declare const tzero: TZeroPackageInfo;
|
|
24
|
+
export default tzero;
|
|
25
|
+
|
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* T-Zero Context Architect & MCP Server
|
|
5
|
-
* https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
version: "
|
|
10
|
-
author: "Toprak Ahmet Aydoğmuş (Siber Akademi)",
|
|
11
|
-
repository: "https://github.com/toprakahmetaydogmus/TZeroAlgorithm",
|
|
12
|
-
srcDir: path.resolve(__dirname, "src"),
|
|
13
|
-
mcpServer: path.resolve(__dirname, "src", "tzero_mcp.py"),
|
|
14
|
-
cli: path.resolve(__dirname, "src", "tzero_v3.py")
|
|
15
|
-
};
|
|
1
|
+
const path = require("path");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* T-Zero Context Architect & MCP Server
|
|
5
|
+
* https://github.com/toprakahmetaydogmus/TZeroAlgorithm
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
version: require("./package.json").version,
|
|
10
|
+
author: "Toprak Ahmet Aydoğmuş (Siber Akademi)",
|
|
11
|
+
repository: "https://github.com/toprakahmetaydogmus/TZeroAlgorithm",
|
|
12
|
+
srcDir: path.resolve(__dirname, "src"),
|
|
13
|
+
mcpServer: path.resolve(__dirname, "src", "tzero", "tzero_mcp.py"),
|
|
14
|
+
cli: path.resolve(__dirname, "src", "tzero", "tzero_v3.py")
|
|
15
|
+
};
|