cdx-code-booster 1.5.0__cp312-cp312-win_amd64.whl
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.
- cdx_code_booster/EULA.md +39 -0
- cdx_code_booster/__init__.py +48 -0
- cdx_code_booster/__main__.py +135 -0
- cdx_code_booster/booster_core.cp312-win_amd64.pyd +0 -0
- cdx_code_booster/booster_core.pyi +4 -0
- cdx_code_booster/installer.py +582 -0
- cdx_code_booster/mcp_server.py +239 -0
- cdx_code_booster/subscription_guard.cp312-win_amd64.pyd +0 -0
- cdx_code_booster/subscription_guard.pyi +4 -0
- cdx_code_booster-1.5.0.dist-info/METADATA +127 -0
- cdx_code_booster-1.5.0.dist-info/RECORD +14 -0
- cdx_code_booster-1.5.0.dist-info/WHEEL +5 -0
- cdx_code_booster-1.5.0.dist-info/entry_points.txt +3 -0
- cdx_code_booster-1.5.0.dist-info/top_level.txt +1 -0
cdx_code_booster/EULA.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Cantor Labs End-User License Agreement (EULA) — CDX Code Booster v1.5
|
|
2
|
+
|
|
3
|
+
**Effective Date:** November 28, 2026
|
|
4
|
+
**Licensor:** Cantor Labs (`https://cdxengine.com` | `support@cdxengine.com`)
|
|
5
|
+
**Software:** CDX Code Booster (`cdx-code-booster` v1.5.x — Native `.pyd` / `.so` Binaries, MCP Server, CLI & IDE Plugins)
|
|
6
|
+
|
|
7
|
+
By installing, importing, activating, or using **CDX Code Booster** (the "Software"), you ("Licensee" or "Customer") agree to be bound by this End-User License Agreement ("EULA") and the Cantor Labs Terms of Service (`https://cdxengine.com/terms_en.html`).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. License Grant & Subscription Tiers
|
|
12
|
+
Cantor Labs grants Licensee a revocable, non-exclusive, non-transferable, non-sublicensable license to install and execute the Software solely for internal software engineering workflows in accordance with Licensee's active entitlement tier:
|
|
13
|
+
- **30-Day Full Trial (`$0` / Zero-Key Instant Start):** Full access to AST smart code slicing, Intra/Cross-File CoT Anchors, polyglot error log slimming, and Auto-Compacting 5-IDE Shared Memory (`Claude Code`, `Cursor`, `VS Code`, `OpenAI Codex CLI`, `Google Antigravity`) for thirty (30) calendar days from initial local installation.
|
|
14
|
+
- **Post-Trial Safe Pass-Through (`$0`):** Automatic, zero-downtime fallback starting Day 31 that never crashes or halts active coding sessions, retaining safe preview reads and up to 25 local shared memory notes.
|
|
15
|
+
- **Pro (`$5 / month` for the first 3 billing months Launch Promo, then `$9 / month` standard rate; or `$59` for the first year, then `$79 / year`):** Single-developer license strictly limited to **at most two (2) personal machines (`1 + 1`: 1 desktop + 1 laptop) owned and operated solely by the same individual Licensee**, enforced via anonymous SHA-256 machine-slot binding (`--activate` / `--deactivate`). Sharing, pooling, or transferring a Pro license key or activated vault across multiple individuals or team members is strictly prohibited and automatically blocked upon exceeding the 2-device slot limit. Server-side multi-agent enterprise deployments require **CDX Agent Dock** (`https://cdxengine.com/dock_en.html`).
|
|
16
|
+
|
|
17
|
+
## 2. Introductory Promotional Billing, Renewal & Cancellation
|
|
18
|
+
1. **Automatic Renewal & Promotional Transition:** Online subscriptions renew automatically at the end of each monthly or annual billing cycle via authorized global payment processors / Merchants of Record (e.g., Polar.sh, Stripe) unless cancelled prior to the renewal date. Where Licensee subscribes under the Pro Launch Promotion (`$5/month` for the first 3 billing months or `$59` for the first annual term), billing automatically transitions to the standard rate (`$9/month` starting Month 4, or `$79/year` starting Year 2) unless cancelled before the applicable renewal date.
|
|
19
|
+
2. **Digital License Refund Policy:** Because performance commences immediately upon license key issuance or software activation, statutory withdrawal rights are waived upon first activation or usage in accordance with applicable digital commerce laws. Completely unused, unactivated licenses may be cancelled for a full refund within seven (7) calendar days of purchase.
|
|
20
|
+
|
|
21
|
+
## 3. Local-First Execution & Zero Source-Code Custody (ZDR)
|
|
22
|
+
1. **100% Customer Ownership:** Licensee retains 100% exclusive ownership of all source code, terminal logs, prompts, and project memory notes ("Customer Data").
|
|
23
|
+
2. **0-Byte External Code Exfiltration:** All AST parsing, call-graph resolution, log deduplication, and SQLite WAL memory consolidation execute 100% locally on Licensee's machine (`~/.cdx_code_booster/`). The Software transmits **zero bytes (`0.0%`)** of Customer Data to Cantor Labs servers and never uses Customer Data to train AI models. Offline Ed25519 license verification executes locally without external network calls.
|
|
24
|
+
|
|
25
|
+
## 4. Proprietary Trade Secrets, Anti-Reverse Engineering & DeWitt Clause
|
|
26
|
+
1. **Trade Secret Protection:** Compiled native binary cores (`.pyd`, `.so`, `.dll`) and internal pruning/anchoring algorithms constitute confidential trade secrets and exclusive intellectual property of Cantor Labs.
|
|
27
|
+
2. **Strict Prohibitions:** Licensee shall NOT (a) decompile, disassemble, reverse engineer, symbol-scrape, or use automated AI reverse-engineering agents against the Software; (b) bypass, spoof, tamper with, or reset local 30-day trial anchors, system clock checks, or Ed25519 cryptographic entitlement guards; (c) publish competitive benchmarks without prior written consent (DeWitt Clause); or (d) use the Software's outputs or schemas to train or build a competing token-optimization or MCP product.
|
|
28
|
+
|
|
29
|
+
## 5. Export Controls & High-Risk Prohibition
|
|
30
|
+
Licensee shall comply with U.S. EAR, U.S. OFAC, and Republic of Korea export control regulations and shall not use or distribute the Software in embargoed jurisdictions or in life-critical / fail-safe environments (nuclear, aviation, life-support medical, or weapons systems). Licensee remains solely responsible for reviewing and approving all code changes or commands executed by Licensee's AI coding agents.
|
|
31
|
+
|
|
32
|
+
## 6. Disclaimer of Warranties & Limitation of Liability
|
|
33
|
+
1. **AS-IS Provision & Performance Estimate Notice:** THE SOFTWARE IS PROVIDED STRICTLY "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED (INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT). Token and quota savings (~40%–50% full-session average; higher on individual large files/logs) are workload-dependent empirical estimates, not guaranteed legal warranties.
|
|
34
|
+
2. **Liability Super-Cap:** TO THE MAXIMUM EXTENT PERMITTED BY LAW, CANTOR LABS SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES. CANTOR LABS' TOTAL AGGREGATE LIABILITY ARISING OUT OF THIS EULA SHALL NOT EXCEED FIFTY PERCENT (50%) OF THE FEES ACTUALLY PAID BY LICENSEE FOR THE SOFTWARE IN THE SINGLE MONTH IMMEDIATELY PRECEDING THE CLAIM (OR USD `$0` FOR TRIAL / FREE TIERS).
|
|
35
|
+
|
|
36
|
+
## 7. Governing Law
|
|
37
|
+
For international licensees, this EULA is governed by the laws of the State of Delaware, USA (or Republic of Korea law where required for domestic Korean entities), excluding conflict-of-law rules, as further detailed in Section 14 of the Cantor Labs Terms of Service (`https://cdxengine.com/terms_en.html`).
|
|
38
|
+
|
|
39
|
+
Copyright (c) 2026 Cantor Labs. All rights reserved.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
CDX Code Booster 1.5 — Local AST Context Optimizer, Intra/Cross-File CoT Anchor & Auto-Compacting 5-IDE Shared Memory
|
|
4
|
+
Copyright (c) 2026 Cantor Labs. All rights reserved.
|
|
5
|
+
|
|
6
|
+
Compatible with:
|
|
7
|
+
- Anthropic Claude Code
|
|
8
|
+
- Cursor IDE
|
|
9
|
+
- VS Code (GitHub Copilot Agent Mode)
|
|
10
|
+
- OpenAI Codex CLI
|
|
11
|
+
- Google Antigravity
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from .booster_core import CDXCodeBoosterEngine
|
|
18
|
+
from .subscription_guard import (
|
|
19
|
+
CDXCodeBoosterSubscriptionGuard,
|
|
20
|
+
SUBSCRIPTION_PLANS,
|
|
21
|
+
TRIAL_DURATION_DAYS,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__version__ = "1.5.0"
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"__version__",
|
|
28
|
+
"TRIAL_DURATION_DAYS",
|
|
29
|
+
"CDXCodeBoosterEngine",
|
|
30
|
+
"CDXCodeBoosterSubscriptionGuard",
|
|
31
|
+
"SUBSCRIPTION_PLANS",
|
|
32
|
+
"CDXCodeBoosterMCPServer",
|
|
33
|
+
"generate_all_platform_bundles",
|
|
34
|
+
"install_workspace_configs",
|
|
35
|
+
"install_global_plugins",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __getattr__(name: str) -> Any:
|
|
40
|
+
if name == "CDXCodeBoosterMCPServer":
|
|
41
|
+
from .mcp_server import CDXCodeBoosterMCPServer
|
|
42
|
+
|
|
43
|
+
return CDXCodeBoosterMCPServer
|
|
44
|
+
if name in ("generate_all_platform_bundles", "install_workspace_configs", "install_global_plugins"):
|
|
45
|
+
from . import installer
|
|
46
|
+
|
|
47
|
+
return getattr(installer, name)
|
|
48
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
CDX Code Booster 1.5 — Ultra-Lean CLI Entrypoint
|
|
4
|
+
Copyright (c) 2026 Cantor Labs. All rights reserved.
|
|
5
|
+
|
|
6
|
+
Commands:
|
|
7
|
+
cdx-code-booster --install # One-click auto-install for Claude, Cursor, VS Code, Codex & Antigravity
|
|
8
|
+
cdx-code-booster --mcp # Run ultra-lean 3-tool stdio MCP server
|
|
9
|
+
cdx-code-booster --consolidate-memory # Deduplicate & compact 5-IDE shared memory vault
|
|
10
|
+
cdx-code-booster --export-bundles [DIR] # Export Claude / Cursor / VS Code / Codex / Antigravity bundles
|
|
11
|
+
cdx-code-booster --init-project [DIR] # Initialize project .mcp.json, .codex & .cursor configs
|
|
12
|
+
cdx-code-booster --activate <KEY> # Activate offline CDXCB1 subscription key
|
|
13
|
+
cdx-code-booster --stats # Print subscription & token savings JSON
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import json
|
|
19
|
+
import sys
|
|
20
|
+
from typing import List, Optional
|
|
21
|
+
|
|
22
|
+
from . import __version__
|
|
23
|
+
from .booster_core import CDXCodeBoosterEngine
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def main(argv: Optional[List[str]] = None) -> int:
|
|
27
|
+
parser = argparse.ArgumentParser(
|
|
28
|
+
prog="cdx-code-booster",
|
|
29
|
+
description="CDX Code Booster 1.5 — 30-Day Full Trial, AST Smart Reader + CoT Anchor, Log Slimmer & Auto-Compacting 5-IDE Memory",
|
|
30
|
+
)
|
|
31
|
+
parser.add_argument("--version", action="store_true", help="Print package version and exit.")
|
|
32
|
+
parser.add_argument("--install", action="store_true", help="One-click auto-install into Claude Code, Cursor, VS Code (Copilot), Codex CLI, and Antigravity.")
|
|
33
|
+
parser.add_argument("--install-all", action="store_true", help="Alias for --install (registers all 5 official coding environments).")
|
|
34
|
+
parser.add_argument(
|
|
35
|
+
"--targets",
|
|
36
|
+
nargs="+",
|
|
37
|
+
default=None,
|
|
38
|
+
help="Optional subset of IDE targets, space- or comma-separated: claude, cursor, vscode, codex, antigravity.",
|
|
39
|
+
)
|
|
40
|
+
parser.add_argument("--mcp", action="store_true", help="Start JSON-RPC 2.0 stdio MCP server.")
|
|
41
|
+
parser.add_argument("--consolidate-memory", action="store_true", help="Deduplicate topic revisions and quarantine obsolete notes in shared memory.")
|
|
42
|
+
parser.add_argument("--export-team-memory", nargs="?", const=".cdx/team_memory.json", default=None, help="Export portable memory JSON pack (Pro & Trial tiers).")
|
|
43
|
+
parser.add_argument("--import-team-memory", default=None, help="Import portable memory JSON pack into local vault (Pro & Trial tiers).")
|
|
44
|
+
parser.add_argument("--project", default=None, help="Optional project namespace for memory operations.")
|
|
45
|
+
parser.add_argument("--export-bundles", nargs="?", const="", default=None, help="Export Claude Code, Cursor, VS Code, Codex, and Antigravity bundles.")
|
|
46
|
+
parser.add_argument("--init-project", nargs="?", const=".", default=None, help="Write .mcp.json, .github/copilot-instructions.md, .codex & .cursor configs into a project folder.")
|
|
47
|
+
parser.add_argument("--activate", default=None, help="Activate a CDXCB1 Pro subscription key (max 2 personal devices: 1 desktop + 1 laptop).")
|
|
48
|
+
parser.add_argument("--deactivate", action="store_true", help="Deactivate and release this machine's device slot so you can move to another PC.")
|
|
49
|
+
parser.add_argument("--machine-id", action="store_true", help="Print this machine's anonymous SHA-256 device fingerprint (`cbm_...`).")
|
|
50
|
+
parser.add_argument("--stats", action="store_true", help="Print subscription & cumulative token savings JSON.")
|
|
51
|
+
parser.add_argument("--data-dir", default=None, help="Optional custom vault directory (persisted across IDEs when combined with --install; pass 'default' to reset).")
|
|
52
|
+
|
|
53
|
+
args = parser.parse_args(argv)
|
|
54
|
+
|
|
55
|
+
if args.version:
|
|
56
|
+
print(f"cdx-code-booster {__version__}")
|
|
57
|
+
return 0
|
|
58
|
+
|
|
59
|
+
if args.machine_id:
|
|
60
|
+
from .subscription_guard import get_machine_fingerprint
|
|
61
|
+
|
|
62
|
+
print(get_machine_fingerprint())
|
|
63
|
+
return 0
|
|
64
|
+
|
|
65
|
+
if args.deactivate:
|
|
66
|
+
eng = CDXCodeBoosterEngine(data_dir=args.data_dir)
|
|
67
|
+
print(json.dumps(eng.guard.deactivate_local_key(), ensure_ascii=False, indent=2))
|
|
68
|
+
return 0
|
|
69
|
+
|
|
70
|
+
if args.consolidate_memory:
|
|
71
|
+
eng = CDXCodeBoosterEngine(data_dir=args.data_dir)
|
|
72
|
+
print(json.dumps(eng.consolidate_memory(project=args.project), ensure_ascii=False, indent=2))
|
|
73
|
+
return 0
|
|
74
|
+
|
|
75
|
+
if args.export_team_memory is not None:
|
|
76
|
+
eng = CDXCodeBoosterEngine(data_dir=args.data_dir)
|
|
77
|
+
res = eng.export_team_memory(bundle_path=args.export_team_memory, project=args.project)
|
|
78
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
79
|
+
return 0 if res.get("status") == "TEAM_MEMORY_EXPORTED" else 1
|
|
80
|
+
|
|
81
|
+
if args.import_team_memory is not None:
|
|
82
|
+
eng = CDXCodeBoosterEngine(data_dir=args.data_dir)
|
|
83
|
+
res = eng.import_team_memory(bundle_path=args.import_team_memory, project=args.project)
|
|
84
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
85
|
+
return 0 if res.get("status") == "TEAM_MEMORY_IMPORTED" else 1
|
|
86
|
+
|
|
87
|
+
if args.install or args.install_all:
|
|
88
|
+
from .installer import install_global_plugins
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
res = install_global_plugins(targets=args.targets, data_dir=args.data_dir)
|
|
92
|
+
except ValueError as exc:
|
|
93
|
+
print(json.dumps({"status": "ERROR", "error": str(exc)}, ensure_ascii=False, indent=2))
|
|
94
|
+
return 2
|
|
95
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
96
|
+
return 0
|
|
97
|
+
|
|
98
|
+
if args.mcp:
|
|
99
|
+
from .mcp_server import CDXCodeBoosterMCPServer
|
|
100
|
+
|
|
101
|
+
CDXCodeBoosterMCPServer(data_dir=args.data_dir).serve_stdio()
|
|
102
|
+
return 0
|
|
103
|
+
|
|
104
|
+
if args.activate is not None:
|
|
105
|
+
eng = CDXCodeBoosterEngine(data_dir=args.data_dir)
|
|
106
|
+
res = eng.guard.activate_and_save_key(args.activate)
|
|
107
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
108
|
+
return 0 if res.get("verified") else 1
|
|
109
|
+
|
|
110
|
+
if args.export_bundles is not None:
|
|
111
|
+
from .installer import generate_all_platform_bundles
|
|
112
|
+
|
|
113
|
+
out_dir = args.export_bundles if args.export_bundles else None
|
|
114
|
+
res = generate_all_platform_bundles(output_dir=out_dir, data_dir=args.data_dir)
|
|
115
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
116
|
+
return 0
|
|
117
|
+
|
|
118
|
+
if args.init_project is not None:
|
|
119
|
+
from .installer import install_workspace_configs
|
|
120
|
+
|
|
121
|
+
try:
|
|
122
|
+
res = install_workspace_configs(project_dir=args.init_project, targets=args.targets, data_dir=args.data_dir)
|
|
123
|
+
except ValueError as exc:
|
|
124
|
+
print(json.dumps({"status": "ERROR", "error": str(exc)}, ensure_ascii=False, indent=2))
|
|
125
|
+
return 2
|
|
126
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
127
|
+
return 0
|
|
128
|
+
|
|
129
|
+
eng = CDXCodeBoosterEngine(data_dir=args.data_dir)
|
|
130
|
+
print(json.dumps(eng.get_saver_stats(), ensure_ascii=False, indent=2))
|
|
131
|
+
return 0
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
if __name__ == "__main__":
|
|
135
|
+
sys.exit(main())
|
|
Binary file
|
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
CDX Code Booster 1.5 — Zero-Hook, Zero-Bloat 5-IDE Bundle Generator & One-Click Installer
|
|
4
|
+
Copyright (c) 2026 Cantor Labs. All rights reserved.
|
|
5
|
+
|
|
6
|
+
Generates clean, hook-free plugin & MCP configurations and supports 1-command installation (`--install`) for:
|
|
7
|
+
1. Google Antigravity (`~/.gemini/config/plugins/cdx-code-booster/` — `plugin.json`, `mcp_config.json`,
|
|
8
|
+
`rules/AGENTS.md`, `skills/cdx-quota-saver/SKILL.md`, `assets/logo.svg`)
|
|
9
|
+
2. Anthropic Claude Code (`claude-code/.claude-plugin/plugin.json`, `.mcp.json`, `CLAUDE.md`)
|
|
10
|
+
3. OpenAI Codex CLI (`~/.codex/config.toml` `[mcp_servers.cdx_code_booster]`, `AGENTS.md`)
|
|
11
|
+
4. Cursor IDE (`~/.cursor/mcp.json`, `.cursor/rules/cdx-code-booster.mdc`)
|
|
12
|
+
5. VS Code (`~/.copilot/mcp-config.json`, `.mcp.json`, `.github/copilot-instructions.md`)
|
|
13
|
+
"""
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import os
|
|
18
|
+
import re
|
|
19
|
+
import shlex
|
|
20
|
+
import shutil
|
|
21
|
+
import sys
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from typing import Any, Dict, List, Optional
|
|
24
|
+
|
|
25
|
+
# 1-Variable Instant Rollback Switch
|
|
26
|
+
_cdx_cb_installer_bypass: bool = False
|
|
27
|
+
|
|
28
|
+
_LOGO_SVG = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
29
|
+
<rect x="14" y="14" width="100" height="100" rx="22" fill="#09090b" stroke="#10b981" stroke-width="4"/>
|
|
30
|
+
<path d="M70 28L40 68h22l-6 32 32-42H66l4-30z" fill="#10b981"/>
|
|
31
|
+
<circle cx="92" cy="36" r="6" fill="#3b82f6"/>
|
|
32
|
+
</svg>
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
_ZERO_FRICTION_AGENT_RULES_MD = """# CDX Code Booster — Zero-Friction Quota Saver, CoT Anchor & Cross-Agent Memory Rules
|
|
36
|
+
|
|
37
|
+
When `cdx-code-booster` MCP tools are available, follow these rules automatically without asking the user to run manual commands:
|
|
38
|
+
|
|
39
|
+
1. **Smart AST File Reading (`cdx_smart_file_read`)**:
|
|
40
|
+
- Before reading any unfamiliar source file larger than 120 lines in full, call `cdx_smart_file_read` with `file_path` (and optional `symbol` or `query`).
|
|
41
|
+
- Use the returned AST symbol map (`Lstart-Lend`) and targeted slices so you only read the exact lines you need, saving 65%-94% of context quota.
|
|
42
|
+
|
|
43
|
+
2. **Terminal & Test Log Slimming (`cdx_slim_log`)**:
|
|
44
|
+
- When inspecting verbose build, test, or traceback output longer than 60 lines, pass it through `cdx_slim_log` to deduplicate repetitive lines while preserving every causal error frame and `file:line` pointer.
|
|
45
|
+
|
|
46
|
+
3. **Auto-Compacting Cross-Agent Memory (`cdx_agent_memory`)**:
|
|
47
|
+
- When finishing a milestone or preparing a handoff between Claude Code, OpenAI Codex CLI, Cursor, and Google Antigravity, call `cdx_agent_memory` (`action="save"`) with a concise summary; if an approach was reverted or invalidated, pass `status="obsolete"` so future agents never repeat dead-ends.
|
|
48
|
+
- When starting work on an existing project, call `cdx_agent_memory` (`action="recall"`) to read the deduplicated Top-9 `consolidated_brief` (or `action="consolidate"` after long multi-session sprints).
|
|
49
|
+
|
|
50
|
+
4. **Deterministic CoT Anchor (`[CDX CoT Anchor]` Fast Path)**:
|
|
51
|
+
- When tool output starts with `[CDX CoT Anchor]`, use its pre-computed intra-file and cross-file `Calls` / `Callers` (`file:Lstart-Lend`) and `Project Origin` fault frames directly instead of running redundant `grep` searches or speculating about unread files and `site-packages`/`node_modules` internals.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
_CURSOR_RULE_MDC = (
|
|
55
|
+
"---\n"
|
|
56
|
+
'description: "Save 65%-94% coding quota with CDX AST smart reads, causal log slimming, and 5-IDE shared memory"\n'
|
|
57
|
+
'globs: ["**/*"]\n'
|
|
58
|
+
"alwaysApply: true\n"
|
|
59
|
+
"---\n\n"
|
|
60
|
+
+ _ZERO_FRICTION_AGENT_RULES_MD
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
_ANTIGRAVITY_SKILL_MD = """---
|
|
64
|
+
name: cdx-quota-saver
|
|
65
|
+
description: Save 65%-94% coding quota with AST smart file slicing and causal log slimming, and hand off persistent memory seamlessly across Antigravity, Claude Code, Codex CLI, and Cursor.
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
# CDX Code Booster Skill Guide
|
|
69
|
+
|
|
70
|
+
Use the `cdx-code-booster-mcp` tools whenever reading large codebases, analyzing build/test failure logs, or handing off work across multiple AI coding agents.
|
|
71
|
+
|
|
72
|
+
## Available Workflows
|
|
73
|
+
|
|
74
|
+
1. **AST Smart File Reading (`cdx_smart_file_read`)**:
|
|
75
|
+
- Extract the class/function symbol map or slice a target `symbol` / `query` from files >120 lines instead of loading raw files in full.
|
|
76
|
+
|
|
77
|
+
2. **Causal Log Slimming (`cdx_slim_log`)**:
|
|
78
|
+
- Pass long CI, compiler, or test output through `cdx_slim_log` to strip repetitive progress noise while keeping 100% of error frames and `file:line` pointers.
|
|
79
|
+
|
|
80
|
+
3. **Auto-Compacting Cross-Agent Memory (`cdx_agent_memory`)**:
|
|
81
|
+
- Save state: `cdx_agent_memory(action="save", mem_key=..., summary=..., details=..., status="active"|"verified"|"obsolete", source_agent="antigravity")`
|
|
82
|
+
- Resume state: `cdx_agent_memory(action="recall", query=..., project=...)`
|
|
83
|
+
- Compact vault: `cdx_agent_memory(action="consolidate", project=...)`
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _resolve_portable_python_cmd(python_cmd: Optional[str] = None) -> str:
|
|
88
|
+
if python_cmd:
|
|
89
|
+
return python_cmd
|
|
90
|
+
if shutil.which("python3") and not shutil.which("python"):
|
|
91
|
+
return "python3"
|
|
92
|
+
return "python"
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _quote_shell_exe(exe_path: str) -> str:
|
|
96
|
+
if " " in exe_path and not (exe_path.startswith('"') and exe_path.endswith('"')):
|
|
97
|
+
return f'"{exe_path}"'
|
|
98
|
+
return exe_path
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _build_mcp_args(data_dir: Optional[str] = None) -> List[str]:
|
|
102
|
+
base_args = ["-m", "cdx_code_booster", "--mcp"]
|
|
103
|
+
if data_dir and data_dir.strip().lower() != "default":
|
|
104
|
+
resolved = str(Path(data_dir).expanduser().resolve())
|
|
105
|
+
base_args.extend(["--data-dir", resolved])
|
|
106
|
+
return base_args
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def generate_all_platform_bundles(
|
|
110
|
+
output_dir: Optional[str] = None,
|
|
111
|
+
python_cmd: Optional[str] = None,
|
|
112
|
+
data_dir: Optional[str] = None,
|
|
113
|
+
) -> Dict[str, Any]:
|
|
114
|
+
if _cdx_cb_installer_bypass:
|
|
115
|
+
return {"status": "BYPASSED", "bundles": {}}
|
|
116
|
+
|
|
117
|
+
py_bin = _resolve_portable_python_cmd(python_cmd)
|
|
118
|
+
py_shell = _quote_shell_exe(py_bin)
|
|
119
|
+
mcp_args = _build_mcp_args(data_dir)
|
|
120
|
+
cli_tail = ""
|
|
121
|
+
sh_tail = ""
|
|
122
|
+
if len(mcp_args) > 3:
|
|
123
|
+
cli_tail = f" --data-dir {_quote_shell_exe(mcp_args[4])}"
|
|
124
|
+
sh_tail = f" --data-dir {shlex.quote(mcp_args[4])}"
|
|
125
|
+
base_out = Path(output_dir) if output_dir else (Path(__file__).resolve().parent / "bundles")
|
|
126
|
+
if base_out.exists():
|
|
127
|
+
shutil.rmtree(base_out)
|
|
128
|
+
base_out.mkdir(parents=True, exist_ok=True)
|
|
129
|
+
|
|
130
|
+
# 1. Google Antigravity Native Plugin Bundle (Zero hooks.json -> 0ms prompt overhead)
|
|
131
|
+
agy_root = base_out / "antigravity" / "cdx-code-booster"
|
|
132
|
+
(agy_root / "assets").mkdir(parents=True, exist_ok=True)
|
|
133
|
+
(agy_root / "rules").mkdir(parents=True, exist_ok=True)
|
|
134
|
+
(agy_root / "skills" / "cdx-quota-saver").mkdir(parents=True, exist_ok=True)
|
|
135
|
+
|
|
136
|
+
plugin_manifest = {
|
|
137
|
+
"name": "cdx-code-booster",
|
|
138
|
+
"displayName": "CDX Code Booster",
|
|
139
|
+
"version": "1.5.0",
|
|
140
|
+
"description": "30-Day Full Free Trial ($5/mo Launch Promo): Save ~40%-50% of overall coding quota (Internal Benchmark) with AST smart slicing, Intra/Cross-File CoT Anchors, causal log slimming & auto-compacting 5-IDE memory across Antigravity, Claude Code, Cursor, VS Code, and Codex.",
|
|
141
|
+
"logo": "assets/logo.svg",
|
|
142
|
+
"author": {
|
|
143
|
+
"name": "Cantor Labs",
|
|
144
|
+
"url": "https://cdxengine.com/booster_en.html",
|
|
145
|
+
},
|
|
146
|
+
"homepage": "https://cdxengine.com/booster_en.html",
|
|
147
|
+
"repository": "https://github.com/cantor-labs/cdx-code-booster",
|
|
148
|
+
"suggestedPrompts": [
|
|
149
|
+
"Recall the latest handoff notes from CDX Cross-Agent Memory",
|
|
150
|
+
"Save current task progress to CDX Memory for Claude Code / Codex / Cursor handoff",
|
|
151
|
+
"Use CDX smart file read to inspect the key classes in this repository",
|
|
152
|
+
],
|
|
153
|
+
}
|
|
154
|
+
(agy_root / "plugin.json").write_text(json.dumps(plugin_manifest, indent=2) + "\n", encoding="utf-8")
|
|
155
|
+
(agy_root / "assets" / "logo.svg").write_text(_LOGO_SVG, encoding="utf-8")
|
|
156
|
+
|
|
157
|
+
agy_mcp = {
|
|
158
|
+
"mcpServers": {
|
|
159
|
+
"cdx-code-booster-mcp": {
|
|
160
|
+
"command": py_bin,
|
|
161
|
+
"args": list(mcp_args),
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
(agy_root / "mcp_config.json").write_text(json.dumps(agy_mcp, indent=2) + "\n", encoding="utf-8")
|
|
166
|
+
(agy_root / "rules" / "AGENTS.md").write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
167
|
+
(agy_root / "skills" / "cdx-quota-saver" / "SKILL.md").write_text(_ANTIGRAVITY_SKILL_MD, encoding="utf-8")
|
|
168
|
+
|
|
169
|
+
# 2. Anthropic Claude Code Bundle (`.claude-plugin` + `.mcp.json` + `CLAUDE.md`)
|
|
170
|
+
claude_root = base_out / "claude-code"
|
|
171
|
+
(claude_root / ".claude-plugin").mkdir(parents=True, exist_ok=True)
|
|
172
|
+
(claude_root / "skills" / "cdx-quota-saver").mkdir(parents=True, exist_ok=True)
|
|
173
|
+
|
|
174
|
+
claude_plugin_manifest = {
|
|
175
|
+
"name": "cdx-code-booster",
|
|
176
|
+
"version": "1.5.0",
|
|
177
|
+
"description": "30-Day Full Trial ($5/mo Launch Promo): Save ~40%-50% of overall coding quota (Internal Benchmark) with AST smart reads, Intra/Cross-File CoT Anchors, log slimming & auto-compacting 5-IDE memory across Claude Code, Cursor, VS Code, Codex, and Antigravity.",
|
|
178
|
+
"author": {"name": "Cantor Labs", "url": "https://cdxengine.com/booster_en.html"},
|
|
179
|
+
"homepage": "https://cdxengine.com/booster_en.html",
|
|
180
|
+
}
|
|
181
|
+
(claude_root / ".claude-plugin" / "plugin.json").write_text(
|
|
182
|
+
json.dumps(claude_plugin_manifest, indent=2) + "\n", encoding="utf-8"
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
claude_mcp = {
|
|
186
|
+
"mcpServers": {
|
|
187
|
+
"cdx-code-booster": {
|
|
188
|
+
"command": py_bin,
|
|
189
|
+
"args": list(mcp_args),
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
(claude_root / ".mcp.json").write_text(json.dumps(claude_mcp, indent=2) + "\n", encoding="utf-8")
|
|
194
|
+
(claude_root / "skills" / "cdx-quota-saver" / "SKILL.md").write_text(_ANTIGRAVITY_SKILL_MD, encoding="utf-8")
|
|
195
|
+
(claude_root / "CLAUDE.md").write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
196
|
+
(claude_root / "install_claude_code.ps1").write_text(
|
|
197
|
+
f'claude mcp add --scope user cdx-code-booster -- {py_shell} -m cdx_code_booster --mcp{cli_tail}\n'
|
|
198
|
+
'Write-Host "[CDX Code Booster] Registered MCP server in Claude Code!"\n',
|
|
199
|
+
encoding="utf-8",
|
|
200
|
+
)
|
|
201
|
+
sh_claude = claude_root / "install_claude_code.sh"
|
|
202
|
+
sh_claude.write_text(
|
|
203
|
+
f"#!/usr/bin/env bash\nset -e\nclaude mcp add --scope user cdx-code-booster -- {shlex.quote(py_bin)} -m cdx_code_booster --mcp{sh_tail}\n"
|
|
204
|
+
'echo "[CDX Code Booster] Registered MCP server in Claude Code!"\n',
|
|
205
|
+
encoding="utf-8",
|
|
206
|
+
newline="\n",
|
|
207
|
+
)
|
|
208
|
+
if os.name != "nt":
|
|
209
|
+
try:
|
|
210
|
+
os.chmod(sh_claude, 0o755)
|
|
211
|
+
except OSError:
|
|
212
|
+
pass
|
|
213
|
+
|
|
214
|
+
# 3. OpenAI Codex CLI Bundle
|
|
215
|
+
codex_root = base_out / "codex"
|
|
216
|
+
codex_root.mkdir(parents=True, exist_ok=True)
|
|
217
|
+
escaped_py_toml = py_bin.replace("\\", "\\\\")
|
|
218
|
+
toml_args_json = json.dumps(mcp_args)
|
|
219
|
+
codex_toml = (
|
|
220
|
+
"# Append this block to ~/.codex/config.toml (or run `cdx-code-booster --install`)\n"
|
|
221
|
+
"[mcp_servers.cdx_code_booster]\n"
|
|
222
|
+
"enabled = true\n"
|
|
223
|
+
f'command = "{escaped_py_toml}"\n'
|
|
224
|
+
f"args = {toml_args_json}\n"
|
|
225
|
+
)
|
|
226
|
+
(codex_root / "codex_mcp_config.toml").write_text(codex_toml, encoding="utf-8")
|
|
227
|
+
(codex_root / "AGENTS.md").write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
228
|
+
(codex_root / "install_codex.ps1").write_text(
|
|
229
|
+
f'codex mcp add cdx-code-booster -- {py_shell} -m cdx_code_booster --mcp{cli_tail}\n'
|
|
230
|
+
'Write-Host "[CDX Code Booster] Registered MCP server in OpenAI Codex CLI!"\n',
|
|
231
|
+
encoding="utf-8",
|
|
232
|
+
)
|
|
233
|
+
sh_codex = codex_root / "install_codex.sh"
|
|
234
|
+
sh_codex.write_text(
|
|
235
|
+
f"#!/usr/bin/env bash\nset -e\ncodex mcp add cdx-code-booster -- {shlex.quote(py_bin)} -m cdx_code_booster --mcp{sh_tail}\n"
|
|
236
|
+
'echo "[CDX Code Booster] Registered MCP server in OpenAI Codex CLI!"\n',
|
|
237
|
+
encoding="utf-8",
|
|
238
|
+
newline="\n",
|
|
239
|
+
)
|
|
240
|
+
if os.name != "nt":
|
|
241
|
+
try:
|
|
242
|
+
os.chmod(sh_codex, 0o755)
|
|
243
|
+
except OSError:
|
|
244
|
+
pass
|
|
245
|
+
|
|
246
|
+
# 4. Cursor IDE Bundle (`.cursor/mcp.json` + `.cursor/rules/cdx-code-booster.mdc`)
|
|
247
|
+
cursor_root = base_out / "cursor" / ".cursor"
|
|
248
|
+
(cursor_root / "rules").mkdir(parents=True, exist_ok=True)
|
|
249
|
+
|
|
250
|
+
cursor_mcp = {
|
|
251
|
+
"mcpServers": {
|
|
252
|
+
"cdx-code-booster": {
|
|
253
|
+
"type": "stdio",
|
|
254
|
+
"command": py_bin,
|
|
255
|
+
"args": list(mcp_args),
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
(cursor_root / "mcp.json").write_text(json.dumps(cursor_mcp, indent=2) + "\n", encoding="utf-8")
|
|
260
|
+
(cursor_root / "rules" / "cdx-code-booster.mdc").write_text(_CURSOR_RULE_MDC, encoding="utf-8")
|
|
261
|
+
|
|
262
|
+
# 5. VS Code (GitHub Copilot Agent Mode) Bundle (`~/.copilot/mcp-config.json` + `.github/copilot-instructions.md`)
|
|
263
|
+
vscode_root = base_out / "vscode"
|
|
264
|
+
(vscode_root / ".github").mkdir(parents=True, exist_ok=True)
|
|
265
|
+
vscode_mcp = {
|
|
266
|
+
"mcpServers": {
|
|
267
|
+
"cdx-code-booster": {
|
|
268
|
+
"command": py_bin,
|
|
269
|
+
"args": list(mcp_args),
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
(vscode_root / "mcp-config.json").write_text(json.dumps(vscode_mcp, indent=2) + "\n", encoding="utf-8")
|
|
274
|
+
(vscode_root / ".mcp.json").write_text(json.dumps(vscode_mcp, indent=2) + "\n", encoding="utf-8")
|
|
275
|
+
(vscode_root / ".github" / "copilot-instructions.md").write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
276
|
+
|
|
277
|
+
return {
|
|
278
|
+
"status": "BUNDLES_EXPORTED",
|
|
279
|
+
"output_dir": str(base_out),
|
|
280
|
+
"bundles": {
|
|
281
|
+
"antigravity": str(agy_root),
|
|
282
|
+
"claude_code": str(claude_root),
|
|
283
|
+
"codex": str(codex_root),
|
|
284
|
+
"cursor": str(cursor_root.parent),
|
|
285
|
+
"vscode": str(vscode_root),
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
VALID_IDE_TARGETS = ("claude", "cursor", "vscode", "codex", "antigravity")
|
|
291
|
+
_IDE_TARGET_ALIASES: Dict[str, str] = {
|
|
292
|
+
"claude": "claude",
|
|
293
|
+
"claude-code": "claude",
|
|
294
|
+
"claudecode": "claude",
|
|
295
|
+
"cursor": "cursor",
|
|
296
|
+
"cursor-ide": "cursor",
|
|
297
|
+
"vscode": "vscode",
|
|
298
|
+
"vs-code": "vscode",
|
|
299
|
+
"copilot": "vscode",
|
|
300
|
+
"github-copilot": "vscode",
|
|
301
|
+
"codex": "codex",
|
|
302
|
+
"codex-cli": "codex",
|
|
303
|
+
"openai": "codex",
|
|
304
|
+
"openai-codex": "codex",
|
|
305
|
+
"antigravity": "antigravity",
|
|
306
|
+
"agy": "antigravity",
|
|
307
|
+
"google-antigravity": "antigravity",
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def _normalize_ide_targets(
|
|
312
|
+
targets: Optional[List[str]],
|
|
313
|
+
default_targets: List[str],
|
|
314
|
+
) -> List[str]:
|
|
315
|
+
if not targets:
|
|
316
|
+
return list(default_targets)
|
|
317
|
+
normalized: List[str] = []
|
|
318
|
+
unknown: List[str] = []
|
|
319
|
+
for raw_item in targets:
|
|
320
|
+
for part in str(raw_item).split(","):
|
|
321
|
+
tok = part.strip().lower()
|
|
322
|
+
if not tok:
|
|
323
|
+
continue
|
|
324
|
+
if tok == "all":
|
|
325
|
+
for d_t in VALID_IDE_TARGETS:
|
|
326
|
+
if d_t not in normalized:
|
|
327
|
+
normalized.append(d_t)
|
|
328
|
+
continue
|
|
329
|
+
mapped = _IDE_TARGET_ALIASES.get(tok)
|
|
330
|
+
if mapped is None:
|
|
331
|
+
unknown.append(part.strip())
|
|
332
|
+
elif mapped not in normalized:
|
|
333
|
+
normalized.append(mapped)
|
|
334
|
+
if unknown:
|
|
335
|
+
raise ValueError(
|
|
336
|
+
f"Unknown IDE target(s): {unknown}. Valid targets: {', '.join(VALID_IDE_TARGETS)} (space- or comma-separated)."
|
|
337
|
+
)
|
|
338
|
+
return normalized or list(default_targets)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
def install_workspace_configs(
|
|
342
|
+
project_dir: str,
|
|
343
|
+
targets: Optional[List[str]] = None,
|
|
344
|
+
python_cmd: Optional[str] = None,
|
|
345
|
+
data_dir: Optional[str] = None,
|
|
346
|
+
) -> Dict[str, Any]:
|
|
347
|
+
if _cdx_cb_installer_bypass:
|
|
348
|
+
return {"status": "BYPASSED", "written_files": []}
|
|
349
|
+
|
|
350
|
+
py_bin = python_cmd or sys.executable
|
|
351
|
+
escaped_py_toml = py_bin.replace("\\", "\\\\")
|
|
352
|
+
mcp_args = _build_mcp_args(data_dir)
|
|
353
|
+
toml_args_json = json.dumps(mcp_args)
|
|
354
|
+
proj = Path(project_dir).resolve()
|
|
355
|
+
proj.mkdir(parents=True, exist_ok=True)
|
|
356
|
+
selected = _normalize_ide_targets(targets, ["claude", "codex", "cursor", "vscode"])
|
|
357
|
+
written: List[str] = []
|
|
358
|
+
|
|
359
|
+
if "claude" in selected or "vscode" in selected:
|
|
360
|
+
mcp_file = proj / ".mcp.json"
|
|
361
|
+
existing: Dict[str, Any] = {}
|
|
362
|
+
if mcp_file.exists():
|
|
363
|
+
try:
|
|
364
|
+
existing = json.loads(mcp_file.read_text(encoding="utf-8"))
|
|
365
|
+
except Exception:
|
|
366
|
+
existing = {}
|
|
367
|
+
servers = existing.setdefault("mcpServers", {})
|
|
368
|
+
servers["cdx-code-booster"] = {
|
|
369
|
+
"command": py_bin,
|
|
370
|
+
"args": list(mcp_args),
|
|
371
|
+
}
|
|
372
|
+
mcp_file.write_text(json.dumps(existing, indent=2) + "\n", encoding="utf-8")
|
|
373
|
+
written.append(str(mcp_file))
|
|
374
|
+
|
|
375
|
+
if "claude" in selected:
|
|
376
|
+
claude_md = proj / "CLAUDE.md"
|
|
377
|
+
if claude_md.exists():
|
|
378
|
+
cur_cm = claude_md.read_text(encoding="utf-8")
|
|
379
|
+
if "cdx_smart_file_read" not in cur_cm:
|
|
380
|
+
sep = "\n\n" if not cur_cm.endswith("\n") else "\n"
|
|
381
|
+
claude_md.write_text(cur_cm + sep + _ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
382
|
+
else:
|
|
383
|
+
claude_md.write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
384
|
+
written.append(str(claude_md))
|
|
385
|
+
|
|
386
|
+
if "vscode" in selected:
|
|
387
|
+
gh_dir = proj / ".github"
|
|
388
|
+
gh_dir.mkdir(parents=True, exist_ok=True)
|
|
389
|
+
cop_inst = gh_dir / "copilot-instructions.md"
|
|
390
|
+
if cop_inst.exists():
|
|
391
|
+
cur_inst = cop_inst.read_text(encoding="utf-8")
|
|
392
|
+
if "cdx_smart_file_read" not in cur_inst:
|
|
393
|
+
sep = "\n\n" if not cur_inst.endswith("\n") else "\n"
|
|
394
|
+
cop_inst.write_text(cur_inst + sep + _ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
395
|
+
else:
|
|
396
|
+
cop_inst.write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
397
|
+
written.append(str(cop_inst))
|
|
398
|
+
|
|
399
|
+
if "codex" in selected:
|
|
400
|
+
codex_dir = proj / ".codex"
|
|
401
|
+
codex_dir.mkdir(parents=True, exist_ok=True)
|
|
402
|
+
snippet = codex_dir / "cdx_mcp_config.toml"
|
|
403
|
+
snippet.write_text(
|
|
404
|
+
"[mcp_servers.cdx_code_booster]\n"
|
|
405
|
+
"enabled = true\n"
|
|
406
|
+
f'command = "{escaped_py_toml}"\n'
|
|
407
|
+
f"args = {toml_args_json}\n",
|
|
408
|
+
encoding="utf-8",
|
|
409
|
+
)
|
|
410
|
+
written.append(str(snippet))
|
|
411
|
+
|
|
412
|
+
agents_md = proj / "AGENTS.md"
|
|
413
|
+
if agents_md.exists():
|
|
414
|
+
cur_ag = agents_md.read_text(encoding="utf-8")
|
|
415
|
+
if "cdx_smart_file_read" not in cur_ag:
|
|
416
|
+
sep = "\n\n" if not cur_ag.endswith("\n") else "\n"
|
|
417
|
+
agents_md.write_text(cur_ag + sep + _ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
418
|
+
else:
|
|
419
|
+
agents_md.write_text(_ZERO_FRICTION_AGENT_RULES_MD, encoding="utf-8")
|
|
420
|
+
written.append(str(agents_md))
|
|
421
|
+
|
|
422
|
+
if "cursor" in selected:
|
|
423
|
+
cur_dir = proj / ".cursor"
|
|
424
|
+
(cur_dir / "rules").mkdir(parents=True, exist_ok=True)
|
|
425
|
+
cur_mcp_file = cur_dir / "mcp.json"
|
|
426
|
+
cur_existing: Dict[str, Any] = {}
|
|
427
|
+
if cur_mcp_file.exists():
|
|
428
|
+
try:
|
|
429
|
+
cur_existing = json.loads(cur_mcp_file.read_text(encoding="utf-8"))
|
|
430
|
+
except Exception:
|
|
431
|
+
cur_existing = {}
|
|
432
|
+
c_servers = cur_existing.setdefault("mcpServers", {})
|
|
433
|
+
c_servers["cdx-code-booster"] = {
|
|
434
|
+
"type": "stdio",
|
|
435
|
+
"command": py_bin,
|
|
436
|
+
"args": list(mcp_args),
|
|
437
|
+
}
|
|
438
|
+
cur_mcp_file.write_text(json.dumps(cur_existing, indent=2) + "\n", encoding="utf-8")
|
|
439
|
+
written.append(str(cur_mcp_file))
|
|
440
|
+
|
|
441
|
+
mdc_file = cur_dir / "rules" / "cdx-code-booster.mdc"
|
|
442
|
+
mdc_file.write_text(_CURSOR_RULE_MDC, encoding="utf-8")
|
|
443
|
+
written.append(str(mdc_file))
|
|
444
|
+
|
|
445
|
+
return {"status": "INSTALLED_WORKSPACE", "project_dir": str(proj), "written_files": written}
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
def install_global_plugins(
|
|
449
|
+
home_dir: Optional[str] = None,
|
|
450
|
+
targets: Optional[List[str]] = None,
|
|
451
|
+
python_cmd: Optional[str] = None,
|
|
452
|
+
data_dir: Optional[str] = None,
|
|
453
|
+
) -> Dict[str, Any]:
|
|
454
|
+
if _cdx_cb_installer_bypass:
|
|
455
|
+
return {"status": "BYPASSED", "installed": {}}
|
|
456
|
+
|
|
457
|
+
user_home = Path(home_dir).resolve() if home_dir else Path.home()
|
|
458
|
+
py_bin = python_cmd or sys.executable
|
|
459
|
+
selected = _normalize_ide_targets(targets, ["antigravity", "codex", "cursor", "claude", "vscode"])
|
|
460
|
+
|
|
461
|
+
booster_home = user_home / ".cdx_code_booster"
|
|
462
|
+
booster_home.mkdir(parents=True, exist_ok=True)
|
|
463
|
+
loc_file = booster_home / "vault_location.json"
|
|
464
|
+
effective_data_dir: Optional[str] = None
|
|
465
|
+
if data_dir is not None:
|
|
466
|
+
if data_dir.strip().lower() == "default":
|
|
467
|
+
if loc_file.exists():
|
|
468
|
+
with os.scandir(booster_home):
|
|
469
|
+
pass
|
|
470
|
+
try:
|
|
471
|
+
loc_file.unlink()
|
|
472
|
+
except OSError:
|
|
473
|
+
pass
|
|
474
|
+
else:
|
|
475
|
+
effective_data_dir = str(Path(data_dir).expanduser().resolve())
|
|
476
|
+
Path(effective_data_dir).mkdir(parents=True, exist_ok=True)
|
|
477
|
+
loc_file.write_text(
|
|
478
|
+
json.dumps({"data_dir": effective_data_dir}, indent=2) + "\n",
|
|
479
|
+
encoding="utf-8",
|
|
480
|
+
)
|
|
481
|
+
elif loc_file.exists():
|
|
482
|
+
try:
|
|
483
|
+
saved_obj = json.loads(loc_file.read_text(encoding="utf-8"))
|
|
484
|
+
cand_dir = str(saved_obj.get("data_dir", "")).strip()
|
|
485
|
+
if cand_dir:
|
|
486
|
+
effective_data_dir = cand_dir
|
|
487
|
+
except Exception:
|
|
488
|
+
pass
|
|
489
|
+
|
|
490
|
+
mcp_args = _build_mcp_args(effective_data_dir)
|
|
491
|
+
toml_args_json = json.dumps(mcp_args)
|
|
492
|
+
staging = booster_home / "generated_bundles"
|
|
493
|
+
exported = generate_all_platform_bundles(
|
|
494
|
+
output_dir=str(staging),
|
|
495
|
+
python_cmd=py_bin,
|
|
496
|
+
data_dir=effective_data_dir,
|
|
497
|
+
)
|
|
498
|
+
installed: Dict[str, str] = {}
|
|
499
|
+
|
|
500
|
+
if "antigravity" in selected:
|
|
501
|
+
agy_dest = user_home / ".gemini" / "config" / "plugins" / "cdx-code-booster"
|
|
502
|
+
agy_dest.mkdir(parents=True, exist_ok=True)
|
|
503
|
+
# Remove obsolete hooks.json if present from an older version without rmdir'ing active CWD on Windows
|
|
504
|
+
old_hooks = agy_dest / "hooks.json"
|
|
505
|
+
if old_hooks.exists():
|
|
506
|
+
try:
|
|
507
|
+
old_hooks.unlink()
|
|
508
|
+
except OSError:
|
|
509
|
+
pass
|
|
510
|
+
shutil.copytree(exported["bundles"]["antigravity"], agy_dest, dirs_exist_ok=True)
|
|
511
|
+
installed["antigravity_plugin_dir"] = str(agy_dest)
|
|
512
|
+
|
|
513
|
+
if "codex" in selected:
|
|
514
|
+
codex_cfg = user_home / ".codex" / "config.toml"
|
|
515
|
+
codex_cfg.parent.mkdir(parents=True, exist_ok=True)
|
|
516
|
+
existing_toml = codex_cfg.read_text(encoding="utf-8") if codex_cfg.exists() else ""
|
|
517
|
+
escaped_py = py_bin.replace("\\", "\\\\")
|
|
518
|
+
new_sec = (
|
|
519
|
+
"[mcp_servers.cdx_code_booster]\n"
|
|
520
|
+
"enabled = true\n"
|
|
521
|
+
f'command = "{escaped_py}"\n'
|
|
522
|
+
f"args = {toml_args_json}\n"
|
|
523
|
+
)
|
|
524
|
+
if "[mcp_servers.cdx_code_booster]" in existing_toml:
|
|
525
|
+
updated_toml = re.sub(
|
|
526
|
+
r"\[mcp_servers\.cdx_code_booster\][^\[]*",
|
|
527
|
+
new_sec,
|
|
528
|
+
existing_toml,
|
|
529
|
+
count=1,
|
|
530
|
+
)
|
|
531
|
+
codex_cfg.write_text(updated_toml, encoding="utf-8")
|
|
532
|
+
else:
|
|
533
|
+
prefix = "\n" if existing_toml and not existing_toml.endswith("\n") else ""
|
|
534
|
+
codex_cfg.write_text(existing_toml + prefix + new_sec, encoding="utf-8")
|
|
535
|
+
installed["codex_config_toml"] = str(codex_cfg)
|
|
536
|
+
|
|
537
|
+
if "cursor" in selected:
|
|
538
|
+
cur_mcp = user_home / ".cursor" / "mcp.json"
|
|
539
|
+
cur_mcp.parent.mkdir(parents=True, exist_ok=True)
|
|
540
|
+
cur_data: Dict[str, Any] = {}
|
|
541
|
+
if cur_mcp.exists():
|
|
542
|
+
try:
|
|
543
|
+
cur_data = json.loads(cur_mcp.read_text(encoding="utf-8"))
|
|
544
|
+
except Exception:
|
|
545
|
+
cur_data = {}
|
|
546
|
+
cur_data.setdefault("mcpServers", {})["cdx-code-booster"] = {
|
|
547
|
+
"type": "stdio",
|
|
548
|
+
"command": py_bin,
|
|
549
|
+
"args": list(mcp_args),
|
|
550
|
+
}
|
|
551
|
+
cur_mcp.write_text(json.dumps(cur_data, indent=2) + "\n", encoding="utf-8")
|
|
552
|
+
installed["cursor_mcp_json"] = str(cur_mcp)
|
|
553
|
+
|
|
554
|
+
if "claude" in selected:
|
|
555
|
+
claude_dest = booster_home / "claude-code-plugin"
|
|
556
|
+
claude_dest.mkdir(parents=True, exist_ok=True)
|
|
557
|
+
shutil.copytree(exported["bundles"]["claude_code"], claude_dest, dirs_exist_ok=True)
|
|
558
|
+
installed["claude_plugin_dir"] = str(claude_dest)
|
|
559
|
+
|
|
560
|
+
if "vscode" in selected:
|
|
561
|
+
cop_cfg = user_home / ".copilot" / "mcp-config.json"
|
|
562
|
+
cop_cfg.parent.mkdir(parents=True, exist_ok=True)
|
|
563
|
+
cop_data: Dict[str, Any] = {}
|
|
564
|
+
if cop_cfg.exists():
|
|
565
|
+
try:
|
|
566
|
+
cop_data = json.loads(cop_cfg.read_text(encoding="utf-8"))
|
|
567
|
+
except Exception:
|
|
568
|
+
cop_data = {}
|
|
569
|
+
cop_data.setdefault("mcpServers", {})["cdx-code-booster"] = {
|
|
570
|
+
"command": py_bin,
|
|
571
|
+
"args": list(mcp_args),
|
|
572
|
+
}
|
|
573
|
+
cop_cfg.write_text(json.dumps(cop_data, indent=2) + "\n", encoding="utf-8")
|
|
574
|
+
installed["vscode_copilot_mcp_json"] = str(cop_cfg)
|
|
575
|
+
|
|
576
|
+
result_payload: Dict[str, Any] = {
|
|
577
|
+
"status": "INSTALLED_GLOBAL",
|
|
578
|
+
"python_executable": py_bin,
|
|
579
|
+
"data_dir": effective_data_dir or str(booster_home),
|
|
580
|
+
"installed": installed,
|
|
581
|
+
}
|
|
582
|
+
return result_payload
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
CDX Code Booster 1.5 — Ultra-Lean 3-Tool Stdio MCP Server (`cdx-code-booster-mcp`)
|
|
4
|
+
Copyright (c) 2026 Cantor Labs. All rights reserved.
|
|
5
|
+
|
|
6
|
+
Zero external dependencies, zero UI bloat, zero hook latency:
|
|
7
|
+
1. `cdx_smart_file_read` — AST Smart Code Reader (-65% to -94% tokens)
|
|
8
|
+
2. `cdx_slim_log` — Causal Error Log Slimmer (-70% to -92% tokens)
|
|
9
|
+
3. `cdx_agent_memory` — Auto-Compacting 5-IDE Shared Memory Bridge (`Claude Code`, `Cursor`, `VS Code`, `Codex`, `Antigravity`)
|
|
10
|
+
"""
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import json
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
from typing import Any, Dict, List, Optional
|
|
17
|
+
|
|
18
|
+
from .booster_core import CDXCodeBoosterEngine
|
|
19
|
+
|
|
20
|
+
# 1-Variable Instant Rollback Switch
|
|
21
|
+
_cdx_cb_mcp_bypass: bool = False
|
|
22
|
+
|
|
23
|
+
if hasattr(sys.stdout, "reconfigure"):
|
|
24
|
+
try:
|
|
25
|
+
sys.stdin.reconfigure(encoding="utf-8")
|
|
26
|
+
sys.stdout.reconfigure(encoding="utf-8")
|
|
27
|
+
sys.stderr.reconfigure(encoding="utf-8")
|
|
28
|
+
except Exception:
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
MCP_TOOLS_SCHEMA: List[Dict[str, Any]] = [
|
|
33
|
+
{
|
|
34
|
+
"name": "cdx_smart_file_read",
|
|
35
|
+
"description": (
|
|
36
|
+
"Quota-Saving AST Smart File Reader + Deterministic CoT Anchor: Prefer calling this BEFORE reading any source file >120 lines! "
|
|
37
|
+
"Returns the structural class/function symbol map, exact target symbol/query slices, and pre-computed intra-file Calls/Called-by coordinates, "
|
|
38
|
+
"saving 65%-94% of context quota and eliminating speculative call-chain reasoning."
|
|
39
|
+
),
|
|
40
|
+
"inputSchema": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"file_path": {"type": "string", "description": "Absolute or relative path to the code file."},
|
|
44
|
+
"symbol": {"type": "string", "description": "Optional function/class/method name to extract in full."},
|
|
45
|
+
"query": {"type": "string", "description": "Optional keyword query to slice matching code windows."},
|
|
46
|
+
"start_line": {"type": "integer", "description": "Optional explicit 1-based start line."},
|
|
47
|
+
"end_line": {"type": "integer", "description": "Optional explicit 1-based end line."},
|
|
48
|
+
},
|
|
49
|
+
"required": ["file_path"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "cdx_slim_log",
|
|
54
|
+
"description": (
|
|
55
|
+
"Compresses noisy terminal build, test, or traceback logs by 70%-92% while pinning your project's exact "
|
|
56
|
+
"fault file:line frames above external site-packages/node_modules library noise."
|
|
57
|
+
),
|
|
58
|
+
"inputSchema": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"properties": {
|
|
61
|
+
"raw_log": {"type": "string", "description": "Raw terminal or CI log text."},
|
|
62
|
+
"max_output_lines": {"type": "integer", "description": "Max output lines (default 55)."},
|
|
63
|
+
},
|
|
64
|
+
"required": ["raw_log"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "cdx_agent_memory",
|
|
69
|
+
"description": (
|
|
70
|
+
"Auto-Compacting 5-IDE Shared Memory Vault shared across Claude Code, Cursor, VS Code, OpenAI Codex, and Antigravity. "
|
|
71
|
+
"Automatically supersedes duplicate topic updates, quarantines reverted/obsolete approaches, and returns a compact Top-9 handoff brief."
|
|
72
|
+
),
|
|
73
|
+
"inputSchema": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"properties": {
|
|
76
|
+
"action": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"enum": ["save", "recall", "consolidate", "export_team", "import_team"],
|
|
79
|
+
"description": "`save` a note, `recall` active notes + compact brief, `consolidate` stale notes, or `export_team` / `import_team` portable JSON memory packs (Pro & Trial tiers).",
|
|
80
|
+
},
|
|
81
|
+
"mem_key": {"type": "string", "description": "Unique topic key (required for `save`)."},
|
|
82
|
+
"summary": {"type": "string", "description": "Concise handoff summary (required for `save`)."},
|
|
83
|
+
"details": {"type": "string", "description": "Detailed context, file paths, or next steps."},
|
|
84
|
+
"tags": {"type": "string", "description": "Optional tags (e.g. `verified`, `obsolete`, `reverted`)."},
|
|
85
|
+
"status": {"type": "string", "enum": ["active", "verified", "obsolete"], "description": "Note lifecycle status (`active`, `verified`, or `obsolete` to quarantine reverted dead-ends)."},
|
|
86
|
+
"project": {"type": "string", "description": "Project namespace (default: `default`; multi-project isolation enabled on Pro & Trial tiers)."},
|
|
87
|
+
"source_agent": {"type": "string", "description": "Agent name, e.g. `claude-code`, `codex`, `cursor`, `antigravity`."},
|
|
88
|
+
"query": {"type": "string", "description": "Search query for `recall`."},
|
|
89
|
+
"include_obsolete": {"type": "boolean", "description": "For `recall`: include quarantined `obsolete` dead-end notes alongside active notes (default `false`)."},
|
|
90
|
+
"prune_archived": {"type": "boolean", "description": "For `consolidate`: physically delete superseded/obsolete rows."},
|
|
91
|
+
"bundle_path": {"type": "string", "description": "For `export_team` / `import_team`: path to Git-committed JSON pack (default: `.cdx/team_memory.json`)."},
|
|
92
|
+
},
|
|
93
|
+
"required": ["action"],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class CDXCodeBoosterMCPServer:
|
|
100
|
+
"""Pure, ultra-lean JSON-RPC 2.0 stdio MCP server around `CDXCodeBoosterEngine`."""
|
|
101
|
+
|
|
102
|
+
def __init__(self, data_dir: Optional[str] = None, license_key: Optional[str] = None) -> None:
|
|
103
|
+
self.engine = CDXCodeBoosterEngine(
|
|
104
|
+
license_key=license_key,
|
|
105
|
+
data_dir=data_dir or os.environ.get("CDX_CODE_BOOSTER_DIR"),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
def handle_rpc(self, req: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
|
109
|
+
method = req.get("method", "")
|
|
110
|
+
req_id = req.get("id")
|
|
111
|
+
params = req.get("params") or {}
|
|
112
|
+
|
|
113
|
+
if req_id is None and method.startswith("notifications/"):
|
|
114
|
+
return None
|
|
115
|
+
|
|
116
|
+
if method == "initialize":
|
|
117
|
+
client_proto = str(params.get("protocolVersion", "2025-03-26"))
|
|
118
|
+
return {
|
|
119
|
+
"jsonrpc": "2.0",
|
|
120
|
+
"id": req_id,
|
|
121
|
+
"result": {
|
|
122
|
+
"protocolVersion": client_proto,
|
|
123
|
+
"capabilities": {"tools": {}},
|
|
124
|
+
"serverInfo": {"name": "cdx-code-booster-mcp", "version": "1.5.0"},
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if method == "ping":
|
|
129
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {}}
|
|
130
|
+
|
|
131
|
+
if method == "tools/list":
|
|
132
|
+
tools = [] if _cdx_cb_mcp_bypass else MCP_TOOLS_SCHEMA
|
|
133
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {"tools": tools}}
|
|
134
|
+
|
|
135
|
+
if method == "tools/call":
|
|
136
|
+
if _cdx_cb_mcp_bypass:
|
|
137
|
+
return self._tool_result(req_id, {"status": "BYPASSED"})
|
|
138
|
+
name = str(params.get("name", ""))
|
|
139
|
+
args = params.get("arguments") or {}
|
|
140
|
+
try:
|
|
141
|
+
out = self._dispatch_tool(name, args)
|
|
142
|
+
return self._tool_result(req_id, out)
|
|
143
|
+
except Exception as e:
|
|
144
|
+
return self._tool_result(req_id, {"status": "ERROR", "error": str(e)}, is_error=True)
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
"jsonrpc": "2.0",
|
|
148
|
+
"id": req_id,
|
|
149
|
+
"error": {"code": -32601, "message": f"Method not found: {method}"},
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
def _dispatch_tool(self, name: str, args: Dict[str, Any]) -> Dict[str, Any]:
|
|
153
|
+
if name == "cdx_smart_file_read":
|
|
154
|
+
res = self.engine.smart_read_code(
|
|
155
|
+
file_path=str(args.get("file_path", "")),
|
|
156
|
+
symbol=args.get("symbol"),
|
|
157
|
+
query=args.get("query"),
|
|
158
|
+
start_line=args.get("start_line"),
|
|
159
|
+
end_line=args.get("end_line"),
|
|
160
|
+
)
|
|
161
|
+
# Strip duplicate symbol-dict array over MCP wire (`content` already embeds CoT Anchor + Symbol Map)
|
|
162
|
+
if isinstance(res, dict) and "symbols" in res:
|
|
163
|
+
lean = {k: v for k, v in res.items() if k not in ("symbols", "cot_anchor")}
|
|
164
|
+
return lean
|
|
165
|
+
return res
|
|
166
|
+
if name == "cdx_slim_log":
|
|
167
|
+
res_log = self.engine.slim_terminal_log(
|
|
168
|
+
raw_log=str(args.get("raw_log", "")),
|
|
169
|
+
max_output_lines=int(args.get("max_output_lines", 55)),
|
|
170
|
+
)
|
|
171
|
+
if isinstance(res_log, dict) and "cot_anchor" in res_log:
|
|
172
|
+
return {k: v for k, v in res_log.items() if k != "cot_anchor"}
|
|
173
|
+
return res_log
|
|
174
|
+
if name == "cdx_agent_memory":
|
|
175
|
+
act = str(args.get("action", "recall")).lower()
|
|
176
|
+
if act == "save":
|
|
177
|
+
return self.engine.save_memory(
|
|
178
|
+
mem_key=str(args.get("mem_key", "handoff-latest")),
|
|
179
|
+
summary=str(args.get("summary", "")),
|
|
180
|
+
details=str(args.get("details", "")),
|
|
181
|
+
project=str(args.get("project", "default")),
|
|
182
|
+
source_agent=str(args.get("source_agent", "coding-agent")),
|
|
183
|
+
tags=str(args.get("tags", "")),
|
|
184
|
+
status=str(args.get("status", "active")),
|
|
185
|
+
)
|
|
186
|
+
if act == "consolidate":
|
|
187
|
+
return self.engine.consolidate_memory(
|
|
188
|
+
project=args.get("project"),
|
|
189
|
+
prune_archived=bool(args.get("prune_archived", False)),
|
|
190
|
+
)
|
|
191
|
+
if act == "export_team":
|
|
192
|
+
return self.engine.export_team_memory(
|
|
193
|
+
bundle_path=str(args.get("bundle_path", ".cdx/team_memory.json")),
|
|
194
|
+
project=args.get("project"),
|
|
195
|
+
)
|
|
196
|
+
if act == "import_team":
|
|
197
|
+
return self.engine.import_team_memory(
|
|
198
|
+
bundle_path=str(args.get("bundle_path", ".cdx/team_memory.json")),
|
|
199
|
+
project=args.get("project"),
|
|
200
|
+
)
|
|
201
|
+
return self.engine.recall_memory(
|
|
202
|
+
query=str(args.get("query", "")),
|
|
203
|
+
project=args.get("project"),
|
|
204
|
+
include_obsolete=bool(args.get("include_obsolete", False)),
|
|
205
|
+
)
|
|
206
|
+
raise ValueError(f"Unknown tool: {name}")
|
|
207
|
+
|
|
208
|
+
@staticmethod
|
|
209
|
+
def _tool_result(req_id: Any, payload: Dict[str, Any], is_error: bool = False) -> Dict[str, Any]:
|
|
210
|
+
return {
|
|
211
|
+
"jsonrpc": "2.0",
|
|
212
|
+
"id": req_id,
|
|
213
|
+
"result": {
|
|
214
|
+
"content": [{"type": "text", "text": json.dumps(payload, ensure_ascii=False, indent=2)}],
|
|
215
|
+
"isError": is_error,
|
|
216
|
+
},
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
def serve_stdio(self) -> None:
|
|
220
|
+
for line in sys.stdin:
|
|
221
|
+
s = line.strip()
|
|
222
|
+
if not s:
|
|
223
|
+
continue
|
|
224
|
+
try:
|
|
225
|
+
req = json.loads(s)
|
|
226
|
+
except Exception:
|
|
227
|
+
continue
|
|
228
|
+
resp = self.handle_rpc(req)
|
|
229
|
+
if resp is not None:
|
|
230
|
+
sys.stdout.write(json.dumps(resp, ensure_ascii=False) + "\n")
|
|
231
|
+
sys.stdout.flush()
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def run_mcp_stdio() -> None:
|
|
235
|
+
CDXCodeBoosterMCPServer().serve_stdio()
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
if __name__ == "__main__":
|
|
239
|
+
run_mcp_stdio()
|
|
Binary file
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cdx-code-booster
|
|
3
|
+
Version: 1.5.0
|
|
4
|
+
Summary: 30-Day Free Trial ($5/mo Launch Promo): Save ~40%-50% of overall AI coding quota (Internal Benchmark) with AST smart reads, Intra/Cross-File CoT Anchors, causal log slimming & auto-compacting 5-IDE memory across Claude Code, Cursor, VS Code, Codex & Antigravity
|
|
5
|
+
Author-email: Cantor Labs <support@cdxengine.com>
|
|
6
|
+
License: Commercial / 30-Day Zero-Key Full Trial (See EULA.md)
|
|
7
|
+
Project-URL: Homepage, https://cdxengine.com/booster_en.html
|
|
8
|
+
Project-URL: Documentation, https://cdxengine.com/booster_docs_en.html
|
|
9
|
+
Keywords: ai-coding,mcp,claude-code,cursor,vscode,copilot,codex,antigravity,token-saver,typescript,react
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
21
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: cryptography>=41.0.0
|
|
25
|
+
|
|
26
|
+
# CDX Code Booster (`cdx-code-booster` v1.5.0)
|
|
27
|
+
|
|
28
|
+
**Save ~40%–50% of Overall AI Coding Session Quota (Internal Benchmark), Cut Speculative CoT Loops Across Files, and Share Auto-Compacted Memory Across Anthropic Claude Code, Cursor, VS Code (GitHub Copilot), OpenAI Codex CLI, and Google Antigravity.**
|
|
29
|
+
|
|
30
|
+
> **Zero-Key 30-Day Full Free Trial + `$5/mo` Launch Promo:** AST smart file slicing, Intra & Cross-File CoT Anchors, causal log slimming, and Auto-Compacting 5-IDE Shared Memory are unlocked automatically for **30 days (`$0`, no credit card or signup required)** — followed by a **`$5/mo` 3-month launch promo** (then `$9/mo`, or `$59` first year / `$4.92/mo` equiv.) with zero prompt hooks, zero background indexers, and zero configuration bloat.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 3 Pure Core Tools (+ Intra/Cross-File CoT Anchor & Auto-Memory Consolidation)
|
|
35
|
+
|
|
36
|
+
1. **AST Smart Code Reader + Intra/Cross-File CoT Anchor (`cdx_smart_file_read` — 65% to 94% Input Reduction + Ranked Identifier Slicing)**
|
|
37
|
+
- Extracts structural AST class/function maps, relevance-ranked target slices, and a zero-index `[CDX CoT Anchor]` resolving **both intra-file `Calls` / `Called by` and cross-file imported symbol line coordinates + cross-file callers (`<10ms`)** so reasoning models jump straight to the right file and line without speculative `grep` loops.
|
|
38
|
+
2. **Causal Error Log Slimmer + Project Fault Pin (`cdx_slim_log` — 70% to 92% Log Reduction + Zero Library Wild-Goose Chases)**
|
|
39
|
+
- Strips repetitive CI/build progress noise while pinning **your project's exact `file:line` fault frames** above third-party `site-packages` / `node_modules` noise.
|
|
40
|
+
3. **Auto-Compacting 5-IDE Shared Memory Bridge (`cdx_agent_memory`)**
|
|
41
|
+
- Hit a 5-hour session cap in Claude Code? Switch immediately to Cursor, VS Code, OpenAI Codex CLI, or Google Antigravity and pick up from a clean, conflict-free Top-9 handoff brief — automatically superseding duplicate topic updates and quarantining reverted/obsolete dead-ends (`action="save" | "recall" | "consolidate"`).
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 10-Second One-Click Setup (macOS Apple Silicon & Intel · Linux x86_64 & ARM64 · Windows)
|
|
46
|
+
|
|
47
|
+
Pre-compiled native binary wheels (`.so` / `.pyd`, Python `3.10`–`3.13`, zero compiler or LSP daemon required):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install cdx-code-booster
|
|
51
|
+
|
|
52
|
+
# Auto-configures Claude Code, Cursor, VS Code (Copilot), OpenAI Codex CLI, and Google Antigravity:
|
|
53
|
+
cdx-code-booster --install
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
*Using macOS Homebrew or Ubuntu 24.04+ (PEP 668 externally managed Python)?* Install cleanly via `pipx` or `uv`:
|
|
57
|
+
```bash
|
|
58
|
+
uv tool install cdx-code-booster && cdx-code-booster --install
|
|
59
|
+
# or: pipx install cdx-code-booster && cdx-code-booster --install
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## How to Use: Automatic Rules & 3-Step Cross-Agent Memory Relay
|
|
65
|
+
|
|
66
|
+
Once `cdx-code-booster --install` completes, installed rules (`CLAUDE.md`, `.cursor/rules/cdx-code-booster.mdc`, `.github/copilot-instructions.md`, `AGENTS.md`) instruct your coding agents to call `cdx_smart_file_read` on files `>120` lines and `cdx_slim_log` on noisy build/test logs **automatically** during normal chat.
|
|
67
|
+
|
|
68
|
+
### 3-Step Memory Relay Across Claude Code, Cursor, VS Code, Codex CLI & Antigravity
|
|
69
|
+
1. **Checkpoint before switching out of Agent A (e.g., Claude Code):**
|
|
70
|
+
> *"Save our current auth refactor summary and remaining TODOs to CDX memory under project `checkout-api`."*
|
|
71
|
+
2. **Quarantine reverted dead-ends so the next agent never repeats them:**
|
|
72
|
+
> *"Save an `obsolete` note to CDX memory for `checkout-api`: `[reverted]` Redis lock caused timeout under load."*
|
|
73
|
+
3. **Resume in 1 sentence inside Agent B (e.g., Cursor, VS Code, Codex CLI, or Antigravity):**
|
|
74
|
+
> *"Recall CDX memory for project `checkout-api` and continue implementing the remaining TODOs."*
|
|
75
|
+
|
|
76
|
+
### CLI Quick Reference & Custom Vault Folder
|
|
77
|
+
```bash
|
|
78
|
+
# Install across all 5 IDEs (or pass space/comma-separated --targets claude,cursor,vscode,codex,antigravity):
|
|
79
|
+
cdx-code-booster --install
|
|
80
|
+
|
|
81
|
+
# Install with a custom storage directory (persisted automatically across all 5 IDEs):
|
|
82
|
+
cdx-code-booster --install --data-dir "D:/my_booster_vault"
|
|
83
|
+
|
|
84
|
+
# Write workspace .mcp.json / CLAUDE.md / AGENTS.md / .github / .cursor / .codex configs inside a repository:
|
|
85
|
+
cdx-code-booster --init-project .
|
|
86
|
+
|
|
87
|
+
# View trial/license status, active vault directory, device fingerprint & local token savings ledger:
|
|
88
|
+
cdx-code-booster --stats
|
|
89
|
+
cdx-code-booster --machine-id
|
|
90
|
+
|
|
91
|
+
# Deduplicate topic revisions & export/import portable SHA-256 verified memory packs:
|
|
92
|
+
cdx-code-booster --consolidate-memory --project checkout-api
|
|
93
|
+
cdx-code-booster --export-team-memory .cdx/team_memory.json --project checkout-api
|
|
94
|
+
cdx-code-booster --import-team-memory .cdx/team_memory.json --project checkout-api
|
|
95
|
+
|
|
96
|
+
# Activate Pro license key ONCE (1+1 Personal Limit: max 2 devices = 1 desktop + 1 laptop):
|
|
97
|
+
cdx-code-booster --activate CDXCB1.<payload>.<signature>
|
|
98
|
+
|
|
99
|
+
# Release this machine's device slot before moving to a replacement computer:
|
|
100
|
+
cdx-code-booster --deactivate
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Architecture, Security & Compatibility Specifications
|
|
106
|
+
|
|
107
|
+
- **One Activation Across All IDEs · 1+1 Personal Device Limit (1 Desktop + 1 Laptop):** Never asks for or touches your Anthropic, OpenAI, Cursor, GitHub, or Google credentials. Running `--activate` once writes a machine-sealed `license.key` shared across every connected IDE on your machine, strictly capped at **2 personal devices (1 desktop + 1 laptop)** per Pro license via anonymous SHA-256 machine-slot binding (`--deactivate` releases a slot when switching hardware).
|
|
108
|
+
- **100% Local Execution & Custom Storage (`--data-dir` / `CDX_CODE_BOOSTER_DIR`):** Zero source code or prompt telemetry ever leaves your machine. Use a local disk or encrypted SSD volume for custom `--data-dir` paths (avoid live cloud-sync folders like OneDrive/Dropbox/iCloud to prevent SQLite WAL file-lock conflicts; use `--export-team-memory` JSON packs for cross-machine sync).
|
|
109
|
+
- **Supported Languages:** Python (`ast`), TypeScript / JavaScript / React (`.ts`, `.tsx`, `.jsx` hooks, `memo(forwardRef)`, inner `useCallback`, `<Component />` JSX call graph), Go, Rust, C/C++, Java, plus universal text windowing and binary/minified bundle protection.
|
|
110
|
+
- **5 Official Auto-Configured IDEs + Universal Stdio MCP:** Auto-configures **Claude Code, Cursor, VS Code (GitHub Copilot), OpenAI Codex CLI, and Google Antigravity** in one command, and works with any standard MCP client (**Cline, Orca, Windsurf, Zed**) via `python -m cdx_code_booster --mcp`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Plans & Zero-Downtime Safe Pass-Through
|
|
115
|
+
|
|
116
|
+
| Plan | Price | Included Capabilities |
|
|
117
|
+
| :--- | :--- | :--- |
|
|
118
|
+
| **30-Day Full Trial** | **$0 (30 days)** | **Zero-key instant start** — AST smart reads, CoT Anchors, log slimming & 5-IDE shared memory relay isolated per project |
|
|
119
|
+
| **Post-Trial Free** | **$0 / mo** | **Zero-Downtime Safe Pass-Through** (never interrupts coding sessions) + up to 25 shared memory notes |
|
|
120
|
+
| **Pro (Individual)** | **`$5 / mo` first 3 mos** *(then `$9/mo`; or `$59` first yr, then `$79/yr`)* | **Single-Developer License (`1+1` Personal Limit: 1 desktop + 1 laptop)** — AST smart reads, CoT Anchors, log slimming & 5-IDE shared memory relay isolated per project *(Online self-serve checkout opening soon; full 30-day local trial starts immediately upon `pip install`)* |
|
|
121
|
+
|
|
122
|
+
Activate an offline Ed25519 subscription key anytime:
|
|
123
|
+
```bash
|
|
124
|
+
cdx-code-booster --activate CDXCB1.<payload>.<signature>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Support & Licensing: `support@cdxengine.com` · https://cdxengine.com/booster_en.html
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
cdx_code_booster/EULA.md,sha256=jpacyxtRyDllxIGVQLqkrfrNu3kA-NOIHtbkRZAOlqA,6365
|
|
2
|
+
cdx_code_booster/__init__.py,sha256=rZRwdraq7n7m8ACApny_myTmv1Rzporbs-iYLg8PTPw,1361
|
|
3
|
+
cdx_code_booster/__main__.py,sha256=7RVCJrj47PzNHhov2LQcpQWhKFzIqiDB-jTgi3fLhh8,6956
|
|
4
|
+
cdx_code_booster/booster_core.cp312-win_amd64.pyd,sha256=G52KySzlSpAWmUUpQx2Fd5SWKusXjCzQvmJcs3xiIp4,775168
|
|
5
|
+
cdx_code_booster/booster_core.pyi,sha256=O9hWn3Ta0Ci8fpWSuvTaNgKfkJBjqG8JVoebwBqAbc0,145
|
|
6
|
+
cdx_code_booster/installer.py,sha256=0CXsfKY0w-bipNKtc58QU0dd6L7riV1kcO0DJZKYsy0,25593
|
|
7
|
+
cdx_code_booster/mcp_server.py,sha256=V56tN66VKK-oiakepvBUoMyAGveq53DjOZKFHKFAaAY,11305
|
|
8
|
+
cdx_code_booster/subscription_guard.cp312-win_amd64.pyd,sha256=bIvCXaVTji9RW6QpPEFK0dbGjRyUP1-363RDnB9DUjU,211968
|
|
9
|
+
cdx_code_booster/subscription_guard.pyi,sha256=9emDSEZiweBHd-JPYEeldqFrsHeTrB_2wRwLY9-CG3Y,151
|
|
10
|
+
cdx_code_booster-1.5.0.dist-info/METADATA,sha256=yFF1ePUlUG9FdkidNL46WEwwV9QrZnVY87jHFZz_x6I,8986
|
|
11
|
+
cdx_code_booster-1.5.0.dist-info/WHEEL,sha256=smAfYAdc4xihz0sI8rUsw5fnCPd2yjYFBM0up6OiEDE,101
|
|
12
|
+
cdx_code_booster-1.5.0.dist-info/entry_points.txt,sha256=2I6nHZnkOCR88TKN9Ih5zRYjyJUuY8p-_vvjTMwtYAY,133
|
|
13
|
+
cdx_code_booster-1.5.0.dist-info/top_level.txt,sha256=TXp920ljoYitJStr4KZ3gWu4Z2E2hYt7EBiSecqDuw8,17
|
|
14
|
+
cdx_code_booster-1.5.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cdx_code_booster
|