feat(cua): release 0.38.0+artemis.1 with verified shell observation
Upgrade the pinned driver, validate menu and taskbar focus ownership, patch untitled Shell resolution, and remove duplicate scroll scaling. Publish package provenance, verification boundaries and matching marketplace checksum. Go tests, vet, build and byte-level package verification passed.
This commit is contained in:
1 parent
dccddaa7e8
commit
b780a60e8d
20 files changed
+759
-149
No files matched your search
@@ -12,28 +12,67 @@ from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SOURCE = ROOT / "plugins/cua-driver"
|
||||
UPSTREAM_VERSION = "0.36.0"
|
||||
COMMIT = "6d6c734c127025fb39ad5d585a10382808b39dc1"
|
||||
DIGEST = "f8c47024b626f4e0e70f8428d2998df39e4879110c5722a29d5fd03e367353ad"
|
||||
URL = "https://github.com/trycua/cua/releases/download/cua-driver-rs-v0.36.0/cua-driver-rs-0.36.0-windows-x86_64-binary.zip"
|
||||
UPSTREAM_VERSION = "0.38.0"
|
||||
COMMIT = "85e2b1318bd77ccf3cfa88ccdf875a4bb7eaed19"
|
||||
DIGEST = "5edaa74d0afa1b55a9668dbc4f32736507bd2bd4d75b18ca1dc8881bb12402b5"
|
||||
URL = "https://github.com/trycua/cua/releases/download/cua-driver-rs-v0.38.0/cua-driver-rs-0.38.0-windows-x86_64-binary.zip"
|
||||
PATCH = SOURCE / "patches/cua-driver-0.38.0-untitled-shell.patch"
|
||||
PATCHED_PATH = "libs/cua-driver/rust/crates/platform-windows/src/win32/windows.rs"
|
||||
|
||||
|
||||
def build_patched_runtime(source: Path, cargo: str) -> dict:
|
||||
source = source.resolve()
|
||||
head = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=source, text=True).strip()
|
||||
if head != COMMIT:
|
||||
raise ValueError("Patched Cua source must use the pinned upstream commit")
|
||||
changes = subprocess.check_output(["git", "diff", "--name-only", "HEAD"], cwd=source, text=True)
|
||||
if changes.splitlines() != [PATCHED_PATH]:
|
||||
raise ValueError("Cua source may contain only the reviewed untitled-shell patch")
|
||||
diff = subprocess.check_output(
|
||||
["git", "diff", "--binary", "HEAD", "--", PATCHED_PATH], cwd=source
|
||||
)
|
||||
if diff.replace(b"\r\n", b"\n") != PATCH.read_bytes().replace(b"\r\n", b"\n"):
|
||||
raise ValueError("Cua source does not match the packaged compatibility patch")
|
||||
project = source / "libs/cua-driver/rust"
|
||||
command = [
|
||||
cargo,
|
||||
"build",
|
||||
"--release",
|
||||
"--locked",
|
||||
"-p",
|
||||
"cua-driver",
|
||||
"-p",
|
||||
"cua-driver-uia",
|
||||
"-p",
|
||||
"cua-driver-sdk",
|
||||
]
|
||||
subprocess.run(command, cwd=project, check=True, timeout=1800)
|
||||
binaries = {
|
||||
name: project / "target/release" / name
|
||||
for name in ("cua-driver.exe", "cua-driver-uia.exe", "cua_driver_sdk.dll")
|
||||
}
|
||||
if not all(path.is_file() for path in binaries.values()):
|
||||
raise ValueError("Patched Cua runtime build is incomplete")
|
||||
return binaries
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(__doc__)
|
||||
parser.add_argument("upstream_zip", type=Path)
|
||||
parser.add_argument("--go", default="go")
|
||||
parser.add_argument("--cargo", default="cargo")
|
||||
parser.add_argument("--upstream-source", type=Path, required=True)
|
||||
parser.add_argument("--output", type=Path, default=ROOT / "artifacts")
|
||||
args = parser.parse_args()
|
||||
version = json.loads((SOURCE / "plugin.json").read_text("utf-8"))["version"]
|
||||
if version.split("+", 1)[0] != UPSTREAM_VERSION:
|
||||
raise ValueError("Plugin version must match the pinned Cua Driver version")
|
||||
match = re.search(
|
||||
r'const adapterVersion = "([^"]+)"', (SOURCE / "main.go").read_text("utf-8")
|
||||
)
|
||||
match = re.search(r'const adapterVersion = "([^"]+)"', (SOURCE / "main.go").read_text("utf-8"))
|
||||
if not match or match[1] != version:
|
||||
raise ValueError("Adapter MCP version must match plugin.json")
|
||||
if hashlib.sha256(args.upstream_zip.read_bytes()).hexdigest() != DIGEST:
|
||||
raise ValueError("Cua release archive hash mismatch")
|
||||
patched_runtime = build_patched_runtime(args.upstream_source, args.cargo)
|
||||
output = args.output.resolve()
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
adapter = output / "artemis-cua-adapter.exe"
|
||||
@@ -76,12 +115,14 @@ def main():
|
||||
"LICENSE.upstream",
|
||||
"RELEASE.md",
|
||||
"VERIFICATION.md",
|
||||
"BUILD.md",
|
||||
):
|
||||
dest.write(SOURCE / name, name)
|
||||
for source in sorted(SOURCE.glob("*.go")):
|
||||
dest.write(source, f"source/{source.name}")
|
||||
for name in ("go.mod", "tools.json"):
|
||||
dest.write(SOURCE / name, f"source/{name}")
|
||||
dest.write(PATCH, f"source/patches/{PATCH.name}")
|
||||
dest.write(adapter, "bin/artemis-cua-adapter.exe")
|
||||
for name in upstream.namelist():
|
||||
# Only the release's executable runtime; no global installer/hooks.
|
||||
@@ -91,7 +132,11 @@ def main():
|
||||
"cua-cursor-theme.exe",
|
||||
"cua_driver_sdk.dll",
|
||||
}:
|
||||
dest.writestr(f"bin/{Path(name).name}", upstream.read(name))
|
||||
basename = Path(name).name
|
||||
if basename not in patched_runtime:
|
||||
dest.writestr(f"bin/{basename}", upstream.read(name))
|
||||
for name, binary in patched_runtime.items():
|
||||
dest.write(binary, f"bin/{name}")
|
||||
dest.writestr(
|
||||
"provenance.json",
|
||||
json.dumps(
|
||||
@@ -99,10 +144,20 @@ def main():
|
||||
"source_commit": COMMIT,
|
||||
"upstream_version": UPSTREAM_VERSION,
|
||||
"plugin_version": version,
|
||||
"adapter_revision": 5,
|
||||
"adapter_revision": int(version.rsplit(".", 1)[1]),
|
||||
"prerelease": True,
|
||||
"upstream_release_channel": "stable",
|
||||
"url": URL,
|
||||
"sha256": DIGEST,
|
||||
"compatibility_patch": {
|
||||
"file": f"source/patches/{PATCH.name}",
|
||||
"sha256": hashlib.sha256(PATCH.read_bytes()).hexdigest(),
|
||||
"rebuilt_binaries": {
|
||||
name: hashlib.sha256(binary.read_bytes()).hexdigest()
|
||||
for name, binary in patched_runtime.items()
|
||||
},
|
||||
"cargo_locked": True,
|
||||
},
|
||||
},
|
||||
indent=2,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user