polycracker-ecu 1.0.0__py3-none-any.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.

Potentially problematic release.


This version of polycracker-ecu might be problematic. Click here for more details.

@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
polycracker_ecu/cli.py ADDED
@@ -0,0 +1,175 @@
1
+ import argparse
2
+ import hashlib
3
+ import json
4
+ import platform
5
+ import shutil
6
+ import subprocess
7
+ import sys
8
+ import urllib.error
9
+ import urllib.request
10
+ import uuid
11
+ import zipfile
12
+ from pathlib import Path
13
+
14
+ from . import __version__
15
+
16
+ RELEASE_URL = (
17
+ "https://github.com/parrot-software-bc/polycracker-ecu/"
18
+ "releases/download/v1.0.0/polycracker-ecu-v1.0.0-win64.zip"
19
+ )
20
+ RELEASE_SHA256 = "C2806A5F8A2228D60095D76ACF97E9CA312D9A046A37413B92BB5818353AC325"
21
+ TRIAL_ENDPOINT = "https://portal.polycracker.dev/api/v1/trial-tune"
22
+ INSTALL_DIR = Path.home() / ".polycracker-ecu" / f"v{__version__}"
23
+ EXE_NAME = "Polycracker-ECU.exe"
24
+
25
+
26
+ def _sha256_file(path: Path) -> str:
27
+ h = hashlib.sha256()
28
+ with path.open("rb") as f:
29
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
30
+ h.update(chunk)
31
+ return h.hexdigest().upper()
32
+
33
+
34
+ def _machine_hash() -> str:
35
+ raw = "|".join([
36
+ platform.system(),
37
+ platform.machine(),
38
+ platform.node(),
39
+ str(uuid.getnode()),
40
+ ])
41
+ return hashlib.sha256(raw.encode("utf-8")).hexdigest().lower()
42
+
43
+
44
+ def cmd_tune(args: argparse.Namespace) -> int:
45
+ exe_path = INSTALL_DIR / EXE_NAME
46
+ if not exe_path.exists():
47
+ print("Polycracker ECU is not installed yet. Run: polycracker-ecu install", file=sys.stderr)
48
+ return 1
49
+
50
+ tune_dest = INSTALL_DIR / "tune.jwt"
51
+
52
+ if args.file:
53
+ src = Path(args.file).expanduser().resolve()
54
+ if not src.exists():
55
+ print(f"Tune file not found: {src}", file=sys.stderr)
56
+ return 1
57
+ shutil.copy2(src, tune_dest)
58
+ print(f"Flashed custom tune -> {tune_dest}")
59
+ return 0
60
+
61
+ payload = json.dumps({
62
+ "machine_hash": _machine_hash(),
63
+ "client_version": __version__,
64
+ }).encode("utf-8")
65
+
66
+ req = urllib.request.Request(
67
+ TRIAL_ENDPOINT,
68
+ data=payload,
69
+ headers={"Content-Type": "application/json", "User-Agent": f"polycracker-ecu/{__version__}"},
70
+ method="POST",
71
+ )
72
+
73
+ try:
74
+ with urllib.request.urlopen(req, timeout=20) as resp:
75
+ data = json.loads(resp.read().decode("utf-8"))
76
+ except urllib.error.HTTPError as e:
77
+ body = e.read().decode("utf-8", errors="replace")
78
+ if e.code == 409:
79
+ print("Free 30-day Stage 2 trial has expired for this machine.", file=sys.stderr)
80
+ print("Create a custom tune at: https://portal.polycracker.dev/dashboard/tuning-house", file=sys.stderr)
81
+ elif e.code == 429:
82
+ print("Trial rate limit reached for this network (max 3 machines per 30 days).", file=sys.stderr)
83
+ else:
84
+ print(f"Trial server returned HTTP {e.code}: {body}", file=sys.stderr)
85
+ return 1
86
+ except urllib.error.URLError as e:
87
+ print(f"Could not reach {TRIAL_ENDPOINT}: {e.reason}", file=sys.stderr)
88
+ return 1
89
+
90
+ tune_jwt = data.get("tune_jwt")
91
+ if not tune_jwt:
92
+ print(f"Unexpected response from trial server: {data}", file=sys.stderr)
93
+ return 1
94
+
95
+ tune_dest.write_text(tune_jwt, encoding="utf-8")
96
+ preset = data.get("preset_name", "Stage 2 - Track Spec")
97
+ expires = data.get("expires_at", "30 days")
98
+ print(f"Minted free trial tune: {preset}")
99
+ print(f"Expires: {expires}")
100
+ print(f"Saved to: {tune_dest}")
101
+ return 0
102
+
103
+
104
+ def cmd_install(args: argparse.Namespace) -> int:
105
+ if platform.system() != "Windows":
106
+ print("Polycracker ECU v1.0.0 binaries are currently Windows x64 only.", file=sys.stderr)
107
+ return 1
108
+
109
+ INSTALL_DIR.mkdir(parents=True, exist_ok=True)
110
+ zip_path = INSTALL_DIR / "polycracker-ecu-v1.0.0-win64.zip"
111
+
112
+ print(f"Downloading Polycracker ECU v{__version__}...")
113
+ try:
114
+ urllib.request.urlretrieve(RELEASE_URL, zip_path)
115
+ except Exception as e:
116
+ print(f"Download failed: {e}", file=sys.stderr)
117
+ return 1
118
+
119
+ actual_hash = _sha256_file(zip_path)
120
+ if actual_hash != RELEASE_SHA256:
121
+ zip_path.unlink(missing_ok=True)
122
+ print("SHA-256 verification failed!", file=sys.stderr)
123
+ print(f" Expected: {RELEASE_SHA256}", file=sys.stderr)
124
+ print(f" Actual: {actual_hash}", file=sys.stderr)
125
+ return 1
126
+
127
+ print("SHA-256 verified. Extracting...")
128
+ with zipfile.ZipFile(zip_path, "r") as zf:
129
+ zf.extractall(INSTALL_DIR)
130
+ zip_path.unlink(missing_ok=True)
131
+
132
+ print(f"Installed Polycracker ECU -> {INSTALL_DIR / EXE_NAME}")
133
+
134
+ if not args.no_trial:
135
+ print("Provisioning free 30-day Stage 2 Track Spec trial tune...")
136
+ return cmd_tune(argparse.Namespace(file=None))
137
+ return 0
138
+
139
+
140
+ def cmd_run(args: argparse.Namespace) -> int:
141
+ exe_path = INSTALL_DIR / EXE_NAME
142
+ if not exe_path.exists():
143
+ print("Polycracker ECU is not installed. Run: polycracker-ecu install", file=sys.stderr)
144
+ return 1
145
+
146
+ proc = subprocess.run([str(exe_path), *args.ecu_args], cwd=str(INSTALL_DIR))
147
+ return proc.returncode
148
+
149
+
150
+ def main() -> int:
151
+ parser = argparse.ArgumentParser(
152
+ prog="polycracker-ecu",
153
+ description="Local CLI wrapper and installer for Polycracker ECU.",
154
+ )
155
+ parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
156
+ sub = parser.add_subparsers(dest="command", required=True)
157
+
158
+ p_install = sub.add_parser("install", help="Download, verify, and install Polycracker ECU.")
159
+ p_install.add_argument("--no-trial", action="store_true", help="Skip automatic 30-day Stage 2 trial tune minting.")
160
+ p_install.set_defaults(func=cmd_install)
161
+
162
+ p_tune = sub.add_parser("tune", help="Mint a free 30-day Stage 2 trial tune or flash a custom tune.jwt.")
163
+ p_tune.add_argument("--file", help="Path to a custom tune.jwt downloaded from the Tuning House.")
164
+ p_tune.set_defaults(func=cmd_tune)
165
+
166
+ p_run = sub.add_parser("run", help="Start Polycracker-ECU.exe locally (forwards stdio and arguments).")
167
+ p_run.add_argument("ecu_args", nargs=argparse.REMAINDER, help="Arguments forwarded to Polycracker-ECU.exe.")
168
+ p_run.set_defaults(func=cmd_run)
169
+
170
+ args = parser.parse_args()
171
+ return args.func(args)
172
+
173
+
174
+ if __name__ == "__main__":
175
+ sys.exit(main())
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: polycracker-ecu
3
+ Version: 1.0.0
4
+ Summary: Local CLI wrapper and release installer for Polycracker ECU - deterministic Python AST token compression.
5
+ Author-email: Parrot Integrated Software Development <parrotsoftwarebc@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://ecu.polycracker.dev
8
+ Project-URL: Tuning House, https://portal.polycracker.dev/dashboard/tuning-house
9
+ Project-URL: Repository, https://github.com/parrot-software-bc/polycracker-ecu
10
+ Keywords: llm,mcp,ast,token-compression,polycracker
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Programming Language :: Python :: 3
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: license-file
19
+
20
+ # Polycracker ECU
21
+
22
+ Local CLI wrapper and release installer for **Polycracker ECU** - deterministic, surgical Python AST token compression on your workstation via local stdio MCP.
23
+
24
+ - **Local-first compression:** Runs on your machine with zero cloud code upload.
25
+ - **30-day Stage 2 Track Spec trial:** Provisioned automatically during polycracker-ecu install (or via polycracker-ecu tune).
26
+ - **Tuning House:** Customize 8 macro sliders and 36 micro-dials into offline Ed25519-signed une.jwt calibration maps in the [Tuning House](https://portal.polycracker.dev/dashboard/tuning-house), then apply them locally.
27
+
28
+ ## Quick Start (Windows x64)
29
+
30
+ 1. Install the open-source CLI wrapper:
31
+
32
+ pip install polycracker-ecu
33
+
34
+ 2. Download, verify, and extract Polycracker-ECU.exe + provision your 30-day Stage 2 trial tune:
35
+
36
+ polycracker-ecu install
37
+
38
+ 3. Start the local ECU / MCP server:
39
+
40
+ polycracker-ecu run
41
+
42
+ *(Testing from a local clone before PyPI release? Run pip install -e . in step 1.)*
43
+
44
+ ## Custom Tunes
45
+
46
+ The [Tuning House](https://portal.polycracker.dev/dashboard/tuning-house) lets you shape how aggressively Polycracker-ECU.exe compresses code using 8 macro sliders and 36 micro-dials, then exports a signed une.jwt calibration file you can download to your computer. Once you have a downloaded tune file, apply it with polycracker-ecu tune --file <path-to-tune.jwt> (for example, polycracker-ecu tune --file .\Downloads\tune.jwt) so your local installation uses that map instead of the default trial tune.
47
+
48
+ ## Reopen & Uninstall
49
+
50
+ Exiting from the system tray stops the active process without deleting your installation or une.jwt.
51
+
52
+ - **Reopen after closing the tray:**
53
+
54
+ polycracker-ecu run
55
+
56
+ - **Delete Polycracker-ECU.exe and its installed files** (close from the tray first):
57
+
58
+ Remove-Item "C:\Users\npare\.polycracker-ecu\v1.0.0" -Recurse -Force
59
+
60
+ - **Remove the Python CLI wrapper as well:**
61
+
62
+ pip uninstall polycracker-ecu
63
+
64
+ ## License
65
+
66
+ - **CLI wrapper (src/polycracker_ecu/):** MIT License.
67
+ - **Compiled binary & release assets (Polycracker-ECU.exe, EULA.txt, PRIVACY.txt):** Proprietary - Parrot Integrated Software Development.
@@ -0,0 +1,8 @@
1
+ polycracker_ecu/__init__.py,sha256=9V4QhfylazrEGQGRhO6teSzx-cdG8kVx73dlV9WrIuo,26
2
+ polycracker_ecu/cli.py,sha256=y9Wc-0r3xCVmUTxQwk_l2KwXHIvqLFETDFSvm7k-rnk,6114
3
+ polycracker_ecu-1.0.0.dist-info/licenses/LICENSE,sha256=VKsnDDRHp0y8UVl_2K98usZPsI2Ifgx0UCNtQy2q0rc,653
4
+ polycracker_ecu-1.0.0.dist-info/METADATA,sha256=Q5pbbqQ3MxTRezfRJkeRgyl_gRFScQ-J5fdr06UNJjc,3049
5
+ polycracker_ecu-1.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
6
+ polycracker_ecu-1.0.0.dist-info/entry_points.txt,sha256=Fv0V8B3Df6kV43tOKMbqiBcGJS5PzplawQ-1Gu9nC3A,61
7
+ polycracker_ecu-1.0.0.dist-info/top_level.txt,sha256=qHVVU6PYYRw9Jtb3TjajAiPykw0mJ8xiQfaA4I0r70M,16
8
+ polycracker_ecu-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ polycracker-ecu = polycracker_ecu.cli:main
@@ -0,0 +1,12 @@
1
+ Polycracker ECU - Split License Notice
2
+
3
+ 1. CLI Wrapper Source Code (this repository)
4
+ Copyright (c) 2026 Parrot Integrated Software Development
5
+ Licensed under the MIT License. You may use, copy, modify, merge, publish,
6
+ distribute, sublicense, and/or sell copies of the Python CLI wrapper code in
7
+ this repository, subject to retaining this copyright and permission notice.
8
+
9
+ 2. Compiled Polycracker ECU Binaries (GitHub Releases)
10
+ Polycracker-ECU.exe and its bundled runtime assets distributed via GitHub
11
+ Releases are proprietary software owned by Parrot Integrated Software
12
+ Development and are governed by the EULA.txt included in the release archive.
@@ -0,0 +1 @@
1
+ polycracker_ecu