diff --git a/README.md b/README.md index bcfbdd3..928419a 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ codevhub skill office --platform macos --arch arm64 # macOS needs a chip: arm6 codevhub skill office --dir /media/usb/codev-office # download somewhere else ``` -Because macOS has one bundle per chip, `--platform macos` from a non-Mac also needs `--arch arm64` or `--arch x86_64` — nothing on a Linux or Windows host implies which Mac the bundle is for, and guessing costs a 1.7 GB download. On a Mac the chip is detected for you (including through Rosetta), and `--arch` is only needed to stage a bundle for the *other* chip. There is still a single macOS setup script: it resolves its own bundle from `uname -m`. +Because macOS has one bundle per chip, `--platform macos` from a non-Mac also needs `--arch arm64` or `--arch x86_64` — nothing on a Linux or Windows host implies which Mac the bundle is for. On a Mac the chip is detected for you (including through Rosetta), and `--arch` is only needed to stage a bundle for the *other* chip. There is still a single macOS setup script: it resolves its own bundle from `uname -m`. Both files land side by side, and the command prints the exact line to run from that folder (`bash codev-office--setup.sh`, or `powershell -ExecutionPolicy Bypass -File .\codev-office-windows-setup.ps1`). A bundle downloaded for another OS is never executed on this machine. diff --git a/package.json b/package.json index 8f1f4f2..1a8de4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codev-ai", - "version": "0.5.14", + "version": "0.5.15", "description": "CoDev — AI Coding Agent Hub. Install, configure, and manage multiple AI coding agents.", "keywords": [ "ai", diff --git a/src/lib/office.ts b/src/lib/office.ts index 6337ffe..484d5bb 100644 --- a/src/lib/office.ts +++ b/src/lib/office.ts @@ -65,8 +65,8 @@ export function detectPlatform( // process.arch is the architecture of the NODE BINARY, not of the machine: an // x64 node running under Rosetta on Apple Silicon reports "x64". Trusting it // there would fetch the Intel bundle onto an M-series Mac, and the cost is not -// just the wrong 1.7 GB — the setup script is native bash, sees `uname -m` = -// arm64, finds no bundle it can use and downloads another 1.7 GB. The +// just the wrong 1.6 GB — the setup script is native bash, sees `uname -m` = +// arm64, finds no bundle it can use and downloads another 1.6 GB. The // sysctl.proc_translated flag is the supported way to detect the translation. function isRosettaTranslated(): boolean { if (process.platform !== "darwin" || process.arch !== "x64") return false; @@ -236,8 +236,8 @@ export function officeUninstallScriptName(platform: OfficePlatform): string { const APPROX_BUNDLE_MB: Record = { ubuntu: 1200, windows: 1400, - "macos-arm64": 1700, - "macos-x86_64": 1700, + "macos-arm64": 1600, + "macos-x86_64": 1600, }; // Adaptive size for progress lines: the setup script is ~13 KB and rendered @@ -431,7 +431,7 @@ export async function runSkillOffice( // macOS publishes one bundle per chip, so a macOS download needs an arch. // The host's own arch may only stand in for it when the host IS the target: // on a Linux/Windows x64 box, detectArch() would confidently answer x86_64 - // for a `--platform macos` download and hand the user the wrong 1.7 GB. + // for a `--platform macos` download and hand the user the wrong 1.6 GB. // --arch always wins, including on a Mac staging a bundle for the other chip. const arch = parsed.arch ?? (crossPlatform ? null : detectArch()); const target = officeTarget(platform, arch); diff --git a/tests/lib/download.test.ts b/tests/lib/download.test.ts index 589df1b..cc504c8 100644 --- a/tests/lib/download.test.ts +++ b/tests/lib/download.test.ts @@ -386,7 +386,7 @@ describe("runSkillOffice", () => { // macOS publishes one bundle per chip. From another OS nothing implies // which, and the host's own x64 would be a confident wrong answer costing - // 1.7 GB — so this must fail loudly instead of picking a default. + // 1.6 GB — so this must fail loudly instead of picking a default. // Pinned to linux so the macOS bundle is always the cross-platform case, // whichever machine runs the suite. test("a macOS bundle from another OS refuses without --arch", async () => { diff --git a/tests/lib/office.test.ts b/tests/lib/office.test.ts index ec917c2..4fde395 100644 --- a/tests/lib/office.test.ts +++ b/tests/lib/office.test.ts @@ -36,7 +36,7 @@ describe("detectArch", () => { // An x64 node under Rosetta reports "x64" on an Apple Silicon Mac. Believing // it downloads the Intel bundle, which the native-bash setup script then - // refuses — and re-downloads the arm64 one. 3.4 GB to land 1.7. + // refuses — and re-downloads the arm64 one. 3.2 GB to land 1.6. test("Rosetta translation overrides the reported x64", () => { expect(detectArch("x64", true)).toBe("arm64"); }); @@ -54,7 +54,7 @@ describe("officeTarget", () => { expect(officeTarget("macos", "x86_64")).toBe("macos-x86_64"); }); - test("macOS without an arch has no target — never guess a 1.7 GB download", () => { + test("macOS without an arch has no target — never guess a 1.6 GB download", () => { expect(officeTarget("macos", null)).toBeNull(); }); });