tzero-mcp 12.3.5 → 12.3.7

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.
@@ -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
5
+ Version: 12.3.7
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.5 Master Edition.
15
+ Part of T-Zero Context Architect v12.3.7 Master Edition.
16
16
  """
17
17
 
18
18
  import hashlib
@@ -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.5")
758
+ parser.add_argument("--version", "-v", action="version", version="%(prog)s 12.3.7")
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.5 Master Edition.
16
+ Part of T-Zero Context Architect v12.3.7 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.5",
1059
+ "version": "12.3.7",
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 &bull; v12.3.5</div>
460
+ <div class="brand-sub" id="headerBrandSub">Enterprise AST Context Architect &bull; v12.3.7</div>
461
461
  </div>
462
462
  </div>
463
463
  <div class="header-actions">
@@ -770,6 +770,7 @@ impl SwarmCluster {
770
770
  <button class="btn-superdesign suite-tab-btn" onclick="switchSuiteTab('federation', this)">Federation</button>
771
771
  <button class="btn-superdesign suite-tab-btn" onclick="switchSuiteTab('hooks', this)">Hooks Guard</button>
772
772
  <button class="btn-superdesign suite-tab-btn" onclick="switchSuiteTab('scip', this)">SCIP Graph</button>
773
+ <button class="btn-superdesign suite-tab-btn" onclick="switchSuiteTab('agency', this)">🤖 Agency (448+)</button>
773
774
  </div>
774
775
  <div id="tab-debt" class="suite-pane" style="display:block;">
775
776
  <div style="display:flex; gap:10px; align-items:center; flex-wrap:wrap;">
@@ -844,13 +845,24 @@ x = 2
844
845
  <button class="btn-run" onclick="runSuiteApi('/api/scip/summary', 'POST', {path: document.getElementById('scipPath').value})">Inspect SCIP / LSIF Summary</button>
845
846
  </div>
846
847
  </div>
848
+ <div id="tab-agency" class="suite-pane" style="display:none;">
849
+ <div style="display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px;">
850
+ <input id="agencyGoal" value="Analyze project structure and synthesize tailored README" placeholder="Mission goal (EN or TR)" style="flex:2; min-width:220px; padding:8px 12px; background:var(--bg-canvas); color:var(--text-main); border:1px solid var(--border); border-radius:6px; font-family:var(--font-code);" />
851
+ <input id="agencyBlueprint" value="auto" placeholder="Blueprint ID (e.g. auto or mcp-server/launch-viral)" style="flex:1; min-width:180px; padding:8px 12px; background:var(--bg-canvas); color:var(--text-main); border:1px solid var(--border); border-radius:6px; font-family:var(--font-code);" />
852
+ </div>
853
+ <div style="display:flex; gap:10px; align-items:center; flex-wrap:wrap;">
854
+ <button class="btn-run" onclick="runSuiteApi('/api/agency/catalog', 'GET')">Browse 448 Blueprints & Skills</button>
855
+ <button class="btn-run" onclick="runSuiteApi('/api/agency/readme', 'POST', {blueprint_id: document.getElementById('agencyBlueprint').value})">Generate Agency README</button>
856
+ <button class="btn-run" onclick="runSuiteApi('/api/agency/run', 'POST', {goal: document.getElementById('agencyGoal').value, blueprint_id: document.getElementById('agencyBlueprint').value})">Run Multi-Agent Squad</button>
857
+ </div>
858
+ </div>
847
859
  <pre id="suiteResult" style="margin-top:14px; padding:14px; background:var(--bg-canvas); border:1px solid var(--border); border-radius:8px; font-family:var(--font-code); font-size:12px; color:var(--sky); max-height:260px; overflow:auto;">Select an Enterprise Suite tab and execute a local AST operation.</pre>
848
860
  </div>
849
861
  </section>
850
862
  </main>
851
863
 
852
864
  <footer>
853
- <span id="footerBrand">T-Zero Context Architect v12.3.5</span> &bull; Developer: Toprak Ahmet Aydoğmuş &bull; Siber Akademi
865
+ <span id="footerBrand">T-Zero Context Architect v12.3.7</span> &bull; Developer: Toprak Ahmet Aydoğmuş &bull; Siber Akademi
854
866
  </footer>
855
867
 
856
868
  <script>
@@ -1481,7 +1493,7 @@ def compute_live_dashboard_stats(workspace_dir: str = ".") -> Dict[str, Any]:
1481
1493
  if cached is not None and (now - _DASHBOARD_STATS_CACHE["ts"]) < 60.0:
1482
1494
  return cached
1483
1495
 
1484
- version = "12.3.5"
1496
+ version = "12.3.7"
1485
1497
  tools_count = 57
1486
1498
  try:
1487
1499
  from tzero import tzero_mcp
@@ -1662,6 +1674,18 @@ class DashboardRequestHandler(http.server.BaseHTTPRequestHandler):
1662
1674
  except Exception as e:
1663
1675
  resp = {"success": False, "error": str(e)}
1664
1676
  self._send_json(resp)
1677
+ elif parsed.path == "/api/agency/catalog":
1678
+ try:
1679
+ from tzero.tzero_agency import TZeroAgency
1680
+ resp = {
1681
+ "success": True,
1682
+ **TZeroAgency.catalog_summary(),
1683
+ "skills": TZeroAgency.list_skills(),
1684
+ "subagent_templates": TZeroAgency.list_templates(),
1685
+ }
1686
+ except Exception as e:
1687
+ resp = {"success": False, "error": str(e)}
1688
+ self._send_json(resp)
1665
1689
  elif parsed.path == "/api/cost/cockpit":
1666
1690
  try:
1667
1691
  from tzero.tzero_cost import TokenCostCalculator
@@ -1965,6 +1989,29 @@ class DashboardRequestHandler(http.server.BaseHTTPRequestHandler):
1965
1989
  except Exception as e:
1966
1990
  resp = {"success": False, "error": str(e)}
1967
1991
  self._send_json(resp)
1992
+ elif parsed.path == "/api/agency/readme":
1993
+ try:
1994
+ from tzero.tzero_agency import TZeroAgency
1995
+ payload = self._read_json_body()
1996
+ target_p = self._resolve_safe_api_path(payload.get("path", "."))
1997
+ bp_id = str(payload.get("blueprint_id") or "auto")
1998
+ res = TZeroAgency.generate_readme(project_dir=target_p, blueprint_id=bp_id)
1999
+ resp = {"success": True, **res}
2000
+ except Exception as e:
2001
+ resp = {"success": False, "error": str(e)}
2002
+ self._send_json(resp)
2003
+ elif parsed.path == "/api/agency/run":
2004
+ try:
2005
+ from tzero.tzero_agency import TZeroAgency
2006
+ payload = self._read_json_body()
2007
+ target_p = self._resolve_safe_api_path(payload.get("path", "."))
2008
+ goal = str(payload.get("goal") or "")
2009
+ bp_id = str(payload.get("blueprint_id") or "auto")
2010
+ res = TZeroAgency.run(goal=goal, project_dir=target_p, blueprint_id=bp_id)
2011
+ resp = {"success": True, **res.to_dict()}
2012
+ except Exception as e:
2013
+ resp = {"success": False, "error": str(e)}
2014
+ self._send_json(resp)
1968
2015
  else:
1969
2016
  self.send_response(404)
1970
2017
  self.end_headers()
@@ -1972,7 +2019,7 @@ class DashboardRequestHandler(http.server.BaseHTTPRequestHandler):
1972
2019
 
1973
2020
  def start_dashboard_server(port: int = DASHBOARD_PORT, open_browser: bool = True) -> http.server.HTTPServer:
1974
2021
  """Starts the T-Zero Control Center dashboard server."""
1975
- server_address = ("", port)
2022
+ server_address = ("127.0.0.1", port)
1976
2023
  server = http.server.HTTPServer(server_address, DashboardRequestHandler)
1977
2024
 
1978
2025
  url = f"http://localhost:{port}"
@@ -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.5 Master Edition.
16
+ Part of T-Zero Context Architect v12.3.7 Master Edition.
17
17
  """
18
18
 
19
19
  import ast
@@ -6,7 +6,7 @@ delivering maximum semantic grounding to LLMs (Claude, GPT, Gemini, DeepSeek) wi
6
6
  up to 95% token savings compared to raw file ingestion.
7
7
 
8
8
  Author: Toprak Ahmet Aydogmus (Siber Akademi)
9
- Version: 12.3.5
9
+ Version: 12.3.7
10
10
  """
11
11
 
12
12
  import ast
@@ -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.5 Master Edition.
14
+ Part of T-Zero Context Architect v12.3.7 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.5",
211
+ version="12.3.7",
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.5
6
+ License: MIT | Version: 12.3.7
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.
@@ -513,7 +513,7 @@ class TZeroLSPServer:
513
513
  "hoverProvider": True,
514
514
  "codeActionProvider": True,
515
515
  },
516
- "serverInfo": {"name": "tzero-lsp", "version": "12.3.5"},
516
+ "serverInfo": {"name": "tzero-lsp", "version": "12.3.7"},
517
517
  },
518
518
  }]
519
519
 
@@ -33,7 +33,7 @@ import ast
33
33
  import inspect
34
34
  import logging
35
35
 
36
- SERVER_VERSION = "12.3.5"
36
+ SERVER_VERSION = "12.3.7"
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
@@ -1156,7 +1156,7 @@ def create_mcp_server():
1156
1156
  name="export_agent_rules",
1157
1157
  title="Export Cursor and Cline Agent Rule Configurations",
1158
1158
  description=(
1159
- "Generates and writes standardized AI agent rule specifications into workspace root, distinguishing from 'query_architecture_boundaries' and 'install_git_security_guard' by writing editor-ready governance files (.cursorrules, AGENT.md, .clinerules) rather than querying rules in memory or installing git hooks.\n"
1159
+ "Generates and writes standardized AI agent rule specifications into workspace root, distinguishing from 'query_architecture_boundaries' by writing editor-ready governance files (.cursorrules, AGENT.md, .clinerules).\n"
1160
1160
  "\n"
1161
1161
  "Parameters:\n"
1162
1162
  "- `project_root` (str, optional, default='.'): Target workspace directory where agent rule files will be created.\n"
@@ -1171,7 +1171,7 @@ def create_mcp_server():
1171
1171
  "\n"
1172
1172
  "Usage Guidelines:\n"
1173
1173
  "- When to use: Run when setting up a repository for AI pair-programming with Cursor, Claude Code, Cline, Windsurf, or GitHub Copilot.\n"
1174
- "- When NOT to use: Do not use to view architectural boundaries without writing files to disk (use 'query_architecture_boundaries' instead); do not use for git pre-commit hook security (use 'install_git_security_guard' instead).\n"
1174
+ "- When NOT to use: Do not use to view architectural boundaries without writing files to disk (use 'query_architecture_boundaries' instead).\n"
1175
1175
  "\n"
1176
1176
  "Returns: Confirmation Markdown message listing all generated rule file paths and active directives."
1177
1177
  ),
@@ -1357,7 +1357,7 @@ def create_mcp_server():
1357
1357
  "\n"
1358
1358
  "Usage Guidelines:\n"
1359
1359
  "- When to use: Verify that proposed code edits, diffs, or commits contain zero leaked API keys (cloud provider keys, AWS secrets, GitHub tokens, Stripe keys, SSH keys).\n"
1360
- "- When NOT to use: Do not use for detecting hallucinated methods or imports (use 'verify_hallucination_guard' instead); do not use for git pre-commit hook installation (use 'install_git_security_guard' instead).\n"
1360
+ "- When NOT to use: Do not use for detecting hallucinated methods or imports (use 'verify_hallucination_guard' instead).\n"
1361
1361
  "\n"
1362
1362
  "Returns: Markdown report with Zero-Leak certification badge, list of detected secrets with line numbers and masked previews, and remediation guidance."
1363
1363
  ),
@@ -2760,50 +2760,6 @@ def create_mcp_server():
2760
2760
  f"```text\n{compressed}\n```"
2761
2761
  )
2762
2762
 
2763
- # -------------------------------------------------------------------------
2764
- # TOOL 42: install_git_security_guard
2765
- # -------------------------------------------------------------------------
2766
- @_maybe_tool(
2767
- name="install_git_security_guard",
2768
- title="Install Automated Git Pre-Commit Security Guard",
2769
- description=(
2770
- "Installs the automated T-Zero Git Pre-Commit Security Guard hook in the local repository, distinguishing from 'verify_zero_leak_security' and 'export_agent_rules' by installing executable git hooks into '.git/hooks' rather than running one-time scans or writing editor rules.\n"
2771
- "\n"
2772
- "Parameters:\n"
2773
- "- `repo_dir` (str, optional, default='.'): Target git repository root directory where the pre-commit hook will be installed.\n"
2774
- "\n"
2775
- "Behavior:\n"
2776
- "- File-Creation: Writes executable pre-commit script to '.git/hooks/pre-commit' in the target repository.\n"
2777
- "- Idempotent: Safely installs or updates the hook without breaking existing git hook chains.\n"
2778
- "- 100% Offline: Generates hook locally from embedded template; operates strictly offline.\n"
2779
- "- Auth & Rate Limits: Zero credentials or accounts required; completes in <20ms.\n"
2780
- "- Error Handling: Returns descriptive error notice if target directory is not a git repository.\n"
2781
- "\n"
2782
- "Usage Guidelines:\n"
2783
- "- When to use: Protect repositories from accidental credential leaks by automatically scanning all staged commits for API keys and secrets.\n"
2784
- "- When NOT to use: Do not use for running a one-time manual security scan (use 'verify_zero_leak_security' instead); do not use for configuring IDE agent rules (use 'export_agent_rules' instead).\n"
2785
- "\n"
2786
- "Returns: Confirmation Markdown message indicating successful installation of the pre-commit hook and active protection patterns."
2787
- ),
2788
- annotations=ToolAnnotations(read_only_hint=False, destructive_hint=False, idempotent_hint=True, open_world_hint=False)
2789
- )
2790
- def _legacy_install_git_security_guard(
2791
- repo_dir: Annotated[str, Field(default=".", description="Target git repository root directory where the pre-commit hook will be installed (default: '.').")] = "."
2792
- ) -> str:
2793
- """Installs the pre-commit zero-leak and token optimization guard."""
2794
- from tzero.tzero_guard import GitSecurityGuard
2795
- res = GitSecurityGuard.install_hook(repo_dir)
2796
- if res.get("success"):
2797
- return (
2798
- f"### 🛡️ T-Zero Pre-Commit Guard Installed Successfully\n"
2799
- f"- **Hook Path:** `{res.get('hook_path')}`\n"
2800
- f"- **Status:** Active\n"
2801
- f"- **Features:** Zero-Leak Credential Blocker, Token Bloat Warning, Staged Diff Analysis\n"
2802
- f"Future `git commit` actions in this repository will now be automatically protected!"
2803
- )
2804
- else:
2805
- return f"❌ **Failed to install pre-commit guard:** {res.get('message')}"
2806
-
2807
2763
  # -------------------------------------------------------------------------
2808
2764
  # TOOL 43: suggest_reusable_helpers
2809
2765
  # -------------------------------------------------------------------------
@@ -2940,8 +2896,6 @@ def create_mcp_server():
2940
2896
  generate_zero_waste_prompt_context = _legacy_generate_zero_waste_prompt_context
2941
2897
  _LEGACY_DISPATCH['compress_stream_tokens'] = _legacy_compress_stream_tokens
2942
2898
  compress_stream_tokens = _legacy_compress_stream_tokens
2943
- _LEGACY_DISPATCH['install_git_security_guard'] = _legacy_install_git_security_guard
2944
- install_git_security_guard = _legacy_install_git_security_guard
2945
2899
 
2946
2900
  # =========================================================================
2947
2901
  # T-ZERO TDQS 5/5 CERTIFIED CANONICAL TOOL SUITE (14 FOCUSED TOOLS)
@@ -3387,7 +3341,7 @@ def create_mcp_server():
3387
3341
  "\n"
3388
3342
  "Usage Guidelines:\n"
3389
3343
  "- When to use: Run before submitting PRs, merging branches, or refactoring code to detect complex methods, missing docstrings, duplicate code blocks, or invalid hallucinated imports.\n"
3390
- "- When NOT to use: Do not use for detecting hardcoded secrets or installing git pre-commit security hooks (use 'verify_security_guard' instead); do not use for mapping whole-repository module dependencies (use 'analyze_code_dependencies' instead).\n"
3344
+ "- When NOT to use: Do not use for detecting hardcoded secrets (use 'verify_security_guard' instead); do not use for mapping whole-repository module dependencies (use 'analyze_code_dependencies' instead).\n"
3391
3345
  "\n"
3392
3346
  "Returns: Comprehensive diagnostic report with severity ratings (T-001 to T-004), exact file line references, and remediation guidance.\n"
3393
3347
  ),
@@ -3431,43 +3385,29 @@ def create_mcp_server():
3431
3385
  # -------------------------------------------------------------------------
3432
3386
  @_canon_tool(
3433
3387
  name="verify_security_guard",
3434
- title="Verify Zero Leak Shannon Entropy Secrets Guard",
3388
+ title="Scan for exposed credentials",
3435
3389
  description=(
3436
- "Scans workspace files and code buffers for hardcoded secrets and API keys, or installs the automated git pre-commit zero-leak guard, distinguishing from 'audit_code_quality' and 'enforce_architecture_rules' by identifying high-entropy credentials and git hooks rather than checking code complexity or enforcing layer rules.\n"
3437
- "\n"
3390
+ "Scans a workspace or supplied text for possible credential exposure, unlike audit_code_quality, which checks code structure.\n"
3438
3391
  "Parameters:\n"
3439
- "- `action`: Security action: 'scan' inspects workspace files or in-memory text for confidential credentials; 'install_pre_commit' installs the automated git pre-commit security hook into .git/hooks/pre-commit.\n"
3440
- "- `project_root`: Root directory of the repository to scan or install the pre-commit hook into.\n"
3441
- "- `content`: Optional raw in-memory code string or configuration text to scan for secrets directly without touching disk files.\n"
3442
- "\n"
3443
- "Behavior:\n"
3444
- "- Mutability: Strictly read-only when action is 'scan'; writes executable hook file .git/hooks/pre-commit when action is 'install_pre_commit'.\n"
3445
- "- Idempotency: Scans are strictly idempotent; hook installation is idempotent and will not overwrite custom existing hooks without backup.\n"
3446
- "- Privacy & Network: 100% offline local regex and Shannon entropy calculation; zero secret tokens are ever transmitted over the network.\n"
3447
- "- Performance & Resources: Scans 1,000 files in <100ms using <30MB RAM; hook execution completes in <50ms.\n"
3448
- "- Auth: Zero authentication or cloud credentials required.\n"
3449
- "- Return Structure: Emits security audit report showing 100% Zero-Leak pass status or lists detected secret leaks with file names, line numbers, and redacted tokens.\n"
3450
- "- Error Handling: Gracefully reports if directory is not a git repository when attempting pre-commit installation.\n"
3451
- "\n"
3452
- "Usage Guidelines:\n"
3453
- "- When to use: Ensure zero confidential credentials (OpenAI, Anthropic, Gemini, GitHub tokens, AWS keys, private certificates) are committed to git or exposed in LLM prompt contexts.\n"
3454
- "- When NOT to use: Do not use for checking code quality, cyclomatic complexity, or duplicate code (use 'audit_code_quality' instead); do not use for enforcing architectural layer boundaries (use 'enforce_architecture_rules' instead).\n"
3455
- "\n"
3456
- "Returns: Security audit report showing 100% Zero-Leak certification or list of detected secret leaks with line numbers, or hook installation confirmation.\n"
3392
+ "- `action`: Supported action is 'scan'.\n"
3393
+ "- `project_root`: Directory to scan.\n"
3394
+ "- `content`: Optional text to scan instead of workspace files.\n"
3395
+ "Behavior: Local read-only pattern and entropy checks. Requires no credentials or network requests.\n"
3396
+ "When to use: Check source or configuration for accidentally exposed credentials.\n"
3397
+ "When NOT to use: Use audit_code_quality for code quality checks instead. Manage Git hooks through the local CLI.\n"
3398
+ "Returns: An audit report with locations and redacted findings."
3457
3399
  ),
3458
- annotations=ToolAnnotations(read_only_hint=False, destructive_hint=False, idempotent_hint=True, open_world_hint=False)
3400
+ annotations=ToolAnnotations(read_only_hint=True, destructive_hint=False, idempotent_hint=True, open_world_hint=False),
3459
3401
  )
3460
3402
  def verify_security_guard(
3461
- action: Annotated[str, Field(default="scan", description="Security action: 'scan' to inspect files or content for secret leaks, 'install_pre_commit' to install the automated git zero-leak hook.")] = "scan",
3462
- project_root: Annotated[str, Field(default=".", description="Target repository root to scan or install hook into (default: current directory).")] = ".",
3463
- content: Annotated[str, Field(default="", description="Optional raw text string to scan for secrets in memory without scanning disk files.")] = ""
3403
+ action: Annotated[str, Field(default="scan", description="Supported action: scan.")] = "scan",
3404
+ project_root: Annotated[str, Field(default=".", description="Target directory to scan.")] = ".",
3405
+ content: Annotated[str, Field(default="", description="Optional text to scan instead of workspace files.")] = "",
3464
3406
  ) -> str:
3465
- """Scans for credential and secret leaks or installs automated git pre-commit zero-leak guard."""
3466
- act = (action or "scan").lower().strip()
3467
- if act in ("install", "install_pre_commit", "hook"):
3468
- return _legacy_install_git_security_guard(repo_dir=project_root)
3469
- else:
3470
- return _legacy_verify_zero_leak_security(project_root=project_root, target_file="", code_snippet=content)
3407
+ """Scan for possible credential exposures."""
3408
+ if (action or "scan").lower().strip() != "scan":
3409
+ return "Unsupported security action. MCP supports scanning only. Manage Git hooks using the local CLI."
3410
+ return _legacy_verify_zero_leak_security(project_root=project_root, target_file="", code_snippet=content)
3471
3411
 
3472
3412
  # -------------------------------------------------------------------------
3473
3413
  # CANONICAL TOOL 11: estimate_token_cost
@@ -3692,6 +3632,10 @@ def create_mcp_server():
3692
3632
  ) -> str:
3693
3633
  """Coordinates autonomous multi-agent swarms, goal execution, PBFT consensus, and self-healing."""
3694
3634
  o_mode = (orchestration_mode or "goal_execute").lower().strip()
3635
+ if o_mode in ("agency", "agency_squad", "squad"):
3636
+ from tzero.tzero_agency import TZeroAgency
3637
+ res = TZeroAgency.run(goal=goal, project_dir=project_root, generate_readme_flag=True)
3638
+ return res.summary_markdown
3695
3639
  if o_mode in ("dynamic_subagents", "dynamic", "subagents", "swarm_dynamic"):
3696
3640
  from tzero.tzero_subagent_engine import get_autonomous_swarm_coordinator
3697
3641
  coord = get_autonomous_swarm_coordinator(workspace_root=project_root)
@@ -4373,7 +4317,7 @@ def create_mcp_server():
4373
4317
  "- `options` (optional, default=''): Optional JSON string specifying extra configuration parameters (e.g. {\"reduction_mode\": \"ultra\", \"max_tokens\": 32000, \"depth\": 4}).\n"
4374
4318
  "\n"
4375
4319
  "Behavior:\n"
4376
- "- Mutability: Depends on action and options. Security may install hooks; rules, memory, sync, healing, merge, and generated tests can modify files.\n"
4320
+ "- Mutability: Depends on action and options. Security and workspace rule sync are read-only; rule export, memory, healing, merge, and generated tests can modify files.\n"
4377
4321
  "- Idempotency: Not guaranteed for state-changing operations.\n"
4378
4322
  "- Privacy & Network: Most analysis is local, but blueprint with use_ai can contact a configured provider and transmit context.\n"
4379
4323
  "- Performance & Resources: Runtime and memory depend on workspace size and selected operation.\n"
@@ -4542,13 +4486,13 @@ def create_mcp_server():
4542
4486
  elif act in ("drift", "drift_analysis", "instruction_drift", "attention_drift"):
4543
4487
  return analyze_instruction_drift(workspace_dir=target if os.path.isdir(target) else ".")
4544
4488
 
4545
- elif act in ("ci", "local_ci", "local-ci", "run_local_ci"):
4489
+ elif act in ("ci", "local_ci", "local-ci", "run_local_ci", "execute_local_ci"):
4490
+ if "install_hook" in opts or "uninstall_hook" in opts:
4491
+ return "MCP cannot manage Git hooks. Use the local CLI to install or remove them."
4546
4492
  return run_local_ci(
4547
4493
  quick=bool(opts.get("quick", False)),
4548
4494
  auto_fix=bool(opts.get("auto_fix", False)),
4549
- install_hook=bool(opts.get("install_hook", False)),
4550
- uninstall_hook=bool(opts.get("uninstall_hook", False)),
4551
- project_root=target if os.path.isdir(target) else "."
4495
+ project_root=target if os.path.isdir(target) else ".",
4552
4496
  )
4553
4497
 
4554
4498
  elif act in ("merge_heal", "semantic_merge", "merge", "conflict_heal"):
@@ -4741,6 +4685,24 @@ def create_mcp_server():
4741
4685
  return json.dumps(get_summary(workspace_dir=target_dir), indent=2)
4742
4686
  return render_report(workspace_dir=target_dir)
4743
4687
 
4688
+ elif act in ("agency", "agency_run", "agency_readme", "agency_skills", "agency_templates", "agency_export", "agency_catalog"):
4689
+ from tzero.tzero_agency import TZeroAgency
4690
+ target_dir = target if os.path.isdir(target) else "."
4691
+ if act == "agency_catalog":
4692
+ return json.dumps(TZeroAgency.catalog_summary(), indent=2)
4693
+ if act == "agency_skills":
4694
+ return json.dumps({"skills": TZeroAgency.list_skills(query=query)}, indent=2, ensure_ascii=False)
4695
+ if act == "agency_templates":
4696
+ return json.dumps({"templates": TZeroAgency.list_templates(query=query)}, indent=2, ensure_ascii=False)
4697
+ if act == "agency_export":
4698
+ return json.dumps(TZeroAgency.export_pack(project_dir=target_dir, goal=query), indent=2, ensure_ascii=False)
4699
+ if act == "agency_readme":
4700
+ bp = opts.get("blueprint_id", query or "auto")
4701
+ res = TZeroAgency.generate_readme(project_dir=target_dir, blueprint_id=bp)
4702
+ return res["markdown"]
4703
+ res = TZeroAgency.run(goal=query, project_dir=target_dir, blueprint_id=opts.get("blueprint_id", "auto"), export_pack=bool(opts.get("export", False)))
4704
+ return res.summary_markdown
4705
+
4744
4706
  # Fallback to general dispatch
4745
4707
  handler = _CANONICAL_DISPATCH.get(act) or _LEGACY_DISPATCH.get(act)
4746
4708
  if handler:
@@ -4766,16 +4728,9 @@ def create_mcp_server():
4766
4728
  f"See the tool list for available actions."
4767
4729
  )
4768
4730
 
4769
- def run_local_ci(quick: bool = False, auto_fix: bool = False, install_hook: bool = False, uninstall_hook: bool = False, project_root: str = ".") -> str:
4770
- """Executes T-Zero Local CI suite locally on the developer machine."""
4731
+ def run_local_ci(quick: bool = False, auto_fix: bool = False, project_root: str = ".") -> str:
4732
+ """Execute the T-Zero Local CI suite."""
4771
4733
  from tzero.tzero_ci import LocalCIRunner
4772
- if install_hook:
4773
- ok, msg = LocalCIRunner.install_git_pre_push_hook(project_root)
4774
- return f"### T-Zero Pre-Push Git Hook Installation\n- Status: {'SUCCESS' if ok else 'FAILED'}\n- Message: {msg}\n"
4775
- if uninstall_hook:
4776
- ok, msg = LocalCIRunner.uninstall_git_pre_push_hook(project_root)
4777
- return f"### T-Zero Pre-Push Git Hook Removal\n- Status: {'SUCCESS' if ok else 'FAILED'}\n- Message: {msg}\n"
4778
-
4779
4734
  runner = LocalCIRunner(repo_dir=project_root, quick=quick, auto_fix=auto_fix)
4780
4735
  report = runner.run()
4781
4736
  return (
@@ -4786,7 +4741,30 @@ def create_mcp_server():
4786
4741
  + "\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])
4787
4742
  )
4788
4743
 
4744
+ def agency_orchestrate(goal: str = "", project_root: str = ".", export_pack: bool = False) -> str:
4745
+ """Analyze repository structure + goal, run tailored multi-agent squad & skills, and synthesize README."""
4746
+ from tzero.tzero_agency import TZeroAgency
4747
+ return TZeroAgency.run(goal=goal, project_dir=project_root, export_pack=export_pack).summary_markdown
4748
+
4749
+ def agency_generate_readme(project_root: str = ".", blueprint_id: str = "auto") -> str:
4750
+ """Generate repo-grounded README from 448 T-Zero Agency domain x style blueprints."""
4751
+ from tzero.tzero_agency import TZeroAgency
4752
+ return TZeroAgency.generate_readme(project_dir=project_root, blueprint_id=blueprint_id)["markdown"]
4753
+
4754
+ def agency_list_catalog(query: str = "") -> str:
4755
+ """List T-Zero Agency 448 README blueprints, 24 skills, and 16 subagent templates."""
4756
+ from tzero.tzero_agency import TZeroAgency
4757
+ return json.dumps({
4758
+ "summary": TZeroAgency.catalog_summary(),
4759
+ "matching_blueprints": TZeroAgency.list_readmes(query=query)[:25],
4760
+ "skills": TZeroAgency.list_skills(query=query),
4761
+ "subagent_templates": TZeroAgency.list_templates(query=query),
4762
+ }, indent=2, ensure_ascii=False)
4763
+
4789
4764
  # Register canonical mappings
4765
+ _CANONICAL_DISPATCH['agency_orchestrate'] = agency_orchestrate
4766
+ _CANONICAL_DISPATCH['agency_generate_readme'] = agency_generate_readme
4767
+ _CANONICAL_DISPATCH['agency_list_catalog'] = agency_list_catalog
4790
4768
  _CANONICAL_DISPATCH['execute_codebase_workflow'] = execute_codebase_workflow
4791
4769
  _CANONICAL_DISPATCH['run_codebase_autopilot'] = execute_codebase_workflow
4792
4770
  _CANONICAL_DISPATCH['build_project_context'] = build_project_context
@@ -4987,6 +4965,32 @@ def create_mcp_server():
4987
4965
  def resource_security_guard() -> str:
4988
4966
  return verify_zero_leak_security(project_root=".")
4989
4967
 
4968
+ @server.resource(
4969
+ "tzero://agency/catalog",
4970
+ name="T-Zero Agency 448 README Blueprints & Subagent Catalog",
4971
+ description="Summary of all 448 README blueprints, 24 built-in skills, and 16 subagent templates",
4972
+ mime_type="application/json"
4973
+ )
4974
+ def resource_agency_catalog() -> str:
4975
+ from tzero.tzero_agency import TZeroAgency
4976
+ return json.dumps({
4977
+ "summary": TZeroAgency.catalog_summary(),
4978
+ "skills": TZeroAgency.list_skills(),
4979
+ "subagent_templates": TZeroAgency.list_templates(),
4980
+ }, indent=2, ensure_ascii=False)
4981
+
4982
+ @server.prompt(
4983
+ name="tzero_agency",
4984
+ description="Guides task-aware multi-agent squad assembly, skill selection, and 448-blueprint README generation."
4985
+ )
4986
+ def tzero_agency_prompt(goal: str = "Analyze workspace and generate tailored README", project_root: str = ".") -> str:
4987
+ return (
4988
+ f"Run T-Zero Agency for '{goal}' in '{project_root}':\n"
4989
+ f"1. Call `execute_codebase_workflow(action='agency', target='{project_root}', query='{goal}')` to profile the workspace and run the matched subagent squad + skills.\n"
4990
+ f"2. Call `execute_codebase_workflow(action='agency_readme', target='{project_root}', query='auto')` to synthesize a repo-grounded README from 448 domain x style blueprints.\n"
4991
+ f"3. Call `execute_codebase_workflow(action='agency_export', target='{project_root}')` to export ready-to-use `.tzero/agency/` skills and subagent manifests."
4992
+ )
4993
+
4990
4994
  # -------------------------------------------------------------------------
4991
4995
  # PROMPT: tzero_grounding
4992
4996
  # -------------------------------------------------------------------------
@@ -37,7 +37,7 @@ AUTHOR = "Toprak Ahmet Aydoğmuş"
37
37
  ORGANIZATION = "Siber Akademi"
38
38
  PYPI_PKG = "tzero-mcp"
39
39
  NPM_PKG = "tzero-mcp"
40
- CANONICAL_VERSION = "v12.3.5"
40
+ CANONICAL_VERSION = "v12.3.7"
41
41
 
42
42
 
43
43
  def get_current_version() -> str:
@@ -75,7 +75,7 @@ class TaskEvaluationResult:
75
75
 
76
76
  @dataclass
77
77
  class TaskBenchmarkReport:
78
- version: str = "12.3.5"
78
+ version: str = "12.3.7"
79
79
  tokenizer: str = "tiktoken (cl100k_base)" if TIKTOKEN_AVAILABLE else "character-ratio fallback"
80
80
  total_tasks: int = 0
81
81
  passed_tasks: int = 0
@@ -465,7 +465,7 @@ def analyze_symbol_impact(symbol_path: str, table: SymbolTable, dag: CallGraphDA
465
465
  """Formats ANSI-styled benchmark summary table."""
466
466
  lines = []
467
467
  lines.append("=" * 78)
468
- lines.append(" T-ZERO TASK-COMPLETION & BPE TOKENIZER BENCHMARK REPORT (v12.3.5)")
468
+ lines.append(" T-ZERO TASK-COMPLETION & BPE TOKENIZER BENCHMARK REPORT (v12.3.7)")
469
469
  lines.append(f" Tokenizer: {report.tokenizer} | Tasks Evaluated: {report.total_tasks}")
470
470
  lines.append("=" * 78)
471
471
  lines.append(f"{'Task ID':<10} | {'Raw BPE':<8} | {'T-Zero':<8} | {'Saved %':<8} | {'Contract %':<10} | {'Status'}")
@@ -18,7 +18,7 @@ import webbrowser
18
18
  from pathlib import Path
19
19
  from typing import Any, Dict, List, Optional, Tuple
20
20
 
21
- CURRENT_VERSION = "12.3.5"
21
+ CURRENT_VERSION = "12.3.7"
22
22
  REPO_URL = "https://github.com/toprakahmetaydogmus/TZeroAlgorithm"
23
23
  RELEASES_URL = f"{REPO_URL}/releases"
24
24
  PYPI_URL = "https://pypi.org/project/tzero-mcp/"
@@ -179,7 +179,7 @@ class TZeroTerminalCockpit:
179
179
  box_bottom = f"{c.CYAN}╚{'═' * 78}╝{c.RESET}"
180
180
 
181
181
  lines.append(box_top)
182
- lines.append(cls._box_line(f" {c.BOLD}{c.BRIGHT_CYAN}⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & LIVE COCKPIT v12.3.5{c.RESET}"))
182
+ lines.append(cls._box_line(f" {c.BOLD}{c.BRIGHT_CYAN}⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & LIVE COCKPIT v12.3.7{c.RESET}"))
183
183
  lines.append(cls._box_line(f" {c.DIM}Local AST Analysis | Optional Network Services{c.RESET}"))
184
184
  lines.append(box_mid)
185
185
 
@@ -324,7 +324,7 @@ class TZeroTerminalCockpit:
324
324
  elif choice == "4":
325
325
  from tzero.tzero_commit import LocalSemanticCommitSynthesizer
326
326
  print(f"\n{cls.YELLOW}[Synthesizing Release CHANGELOG]...{cls.RESET}")
327
- entry = LocalSemanticCommitSynthesizer.generate_changelog_entry(version="v12.3.5", repo_dir=workspace_dir)
327
+ entry = LocalSemanticCommitSynthesizer.generate_changelog_entry(version="v12.3.7", repo_dir=workspace_dir)
328
328
  print(f"\n{cls.BRIGHT_CYAN}{entry}{cls.RESET}\n")
329
329
  input("Press Enter to return to cockpit...")
330
330
  elif choice == "5":