@rightkit/release 0.2.63 → 0.2.64

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.
@@ -10,10 +10,27 @@ const CRATES_IO_SOURCES = new Set([
10
10
  ]);
11
11
  const CACHE_V2_ENVIRONMENT = ["CARGO_HOME", "CARGO_TARGET_DIR", "RUSTC_WRAPPER", "SCCACHE_DIR", "SCCACHE_BASEDIRS", "RIGHT_RELEASE_CACHE_OWNER"];
12
12
 
13
- export function isolatedCargoMetadataEnv(cargoHome, env = process.env) {
13
+ export function managedCargoShimOnPath(env = process.env, platform = process.platform, exists = existsSync) {
14
+ const pathApi = platform === "win32" ? path.win32 : path.posix;
15
+ const delimiter = platform === "win32" ? ";" : ":";
16
+ const extensions = platform === "win32"
17
+ ? String(env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)
18
+ : [""];
19
+ for (const directory of String(env.PATH ?? "").split(delimiter).filter(Boolean)) {
20
+ for (const extension of extensions) {
21
+ const candidate = pathApi.join(directory, `cargo${extension.toLowerCase()}`);
22
+ if (!exists(candidate)) continue;
23
+ return /(?:^|\/)(?:\.rightkit-managed|rightkitmanagedagent)\/agent-bin\/cargo(?:\.[^/]*)?$/i
24
+ .test(candidate.replaceAll("\\", "/"));
25
+ }
26
+ }
27
+ return false;
28
+ }
29
+
30
+ export function isolatedCargoMetadataEnv(cargoHome, env = process.env, platform = process.platform, exists = existsSync) {
14
31
  const metadataEnv = { ...env };
15
32
  for (const name of CACHE_V2_ENVIRONMENT) delete metadataEnv[name];
16
- if (metadataEnv.RIGHTKIT_BUILD_BROKER_SOCKET) return metadataEnv;
33
+ if (metadataEnv.RIGHTKIT_BUILD_BROKER_SOCKET || managedCargoShimOnPath(metadataEnv, platform, exists)) return metadataEnv;
17
34
  return { ...metadataEnv, CARGO_HOME: cargoHome };
18
35
  }
19
36
 
package/deps.mjs CHANGED
File without changes
package/lsclean.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.63",
3
+ "version": "0.2.64",
4
4
  "description": "Portable Right Suite release CLI/SDK: native-host signed installers, updater artifacts, hardening, immutable GitHub Release upload, and add-on adoption.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -15,6 +15,11 @@
15
15
  "*.py"
16
16
  ],
17
17
  "sideEffects": false,
18
+ "scripts": {
19
+ "test": "node --test *.test.mjs",
20
+ "doctor:all": "node --test right-suite-contract.test.mjs",
21
+ "verify:standalone": "node standalone-clone-verify.mjs"
22
+ },
18
23
  "publishConfig": {
19
24
  "registry": "https://registry.npmjs.org/",
20
25
  "access": "public"
@@ -24,9 +29,5 @@
24
29
  "url": "git+https://github.com/bogusyogi/claude.git",
25
30
  "directory": "tools/rightkit/packages/release"
26
31
  },
27
- "scripts": {
28
- "test": "node --test *.test.mjs",
29
- "doctor:all": "node --test right-suite-contract.test.mjs",
30
- "verify:standalone": "node standalone-clone-verify.mjs"
31
- }
32
- }
32
+ "packageManager": "pnpm@11.18.0"
33
+ }
package/release.mjs CHANGED
File without changes
@@ -11,6 +11,7 @@ import {
11
11
  cargoArguments,
12
12
  cargoExecutable,
13
13
  isolatedCargoMetadataEnv,
14
+ managedCargoShimOnPath,
14
15
  validateRightKitCargoContract,
15
16
  } from "./cargo-contract.mjs";
16
17
  import { assertAsrAdapterPair } from "./asr-artifact-adoption.mjs";
@@ -467,12 +468,12 @@ test("RightKit exposes one current version manifest", () => {
467
468
  "@rightkit/legal": "0.3.0",
468
469
  "@rightkit/legal-ui": "0.1.1",
469
470
  "@rightkit/license": "0.1.6",
470
- "@rightkit/release": "0.2.63",
471
+ "@rightkit/release": "0.2.64",
471
472
  "@rightkit/qa": "0.2.0",
472
473
  });
473
474
  assert.deepEqual(versions.legacyNpm, {
474
475
  "@rightkit/legal-ui": ["0.1.0"],
475
- "@rightkit/release": ["0.2.22", "0.2.29", "0.2.30", "0.2.31", "0.2.41", "0.2.42", "0.2.43", "0.2.44", "0.2.45", "0.2.46", "0.2.49", "0.2.50", "0.2.51", "0.2.53", "0.2.54", "0.2.55", "0.2.56", "0.2.61", "0.2.62"],
476
+ "@rightkit/release": ["0.2.22", "0.2.29", "0.2.30", "0.2.31", "0.2.41", "0.2.42", "0.2.43", "0.2.44", "0.2.45", "0.2.46", "0.2.49", "0.2.50", "0.2.51", "0.2.53", "0.2.54", "0.2.55", "0.2.56", "0.2.61", "0.2.62", "0.2.63"],
476
477
  "@rightkit/qa": ["0.1.0"],
477
478
  });
478
479
  assert.ok(
@@ -518,6 +519,36 @@ test("Cargo metadata delegates controlled storage to managed RightKit", () => {
518
519
  });
519
520
  });
520
521
 
522
+ test("Cargo metadata recognizes managed Cargo from PATH without inherited broker environment", () => {
523
+ const macShim = "/Volumes/D/.rightkit-managed/agent-bin/cargo";
524
+ const macEnv = { PATH: `/usr/bin:${path.dirname(macShim)}`, CARGO_HOME: "" };
525
+ assert.equal(managedCargoShimOnPath(macEnv, "darwin", (candidate) => candidate === macShim), true);
526
+ assert.deepEqual(isolatedCargoMetadataEnv("/isolated/cargo", macEnv, "darwin", (candidate) => candidate === macShim), {
527
+ PATH: macEnv.PATH,
528
+ });
529
+
530
+ const windowsShim = "D:\\RightKitManagedAgent\\agent-bin\\cargo.cmd";
531
+ const windowsEnv = {
532
+ PATH: "C:\\Windows\\System32;D:\\RightKitManagedAgent\\agent-bin",
533
+ PATHEXT: ".EXE;.CMD",
534
+ };
535
+ assert.equal(managedCargoShimOnPath(windowsEnv, "win32", (candidate) => candidate.toLowerCase() === windowsShim.toLowerCase()), true);
536
+ assert.deepEqual(isolatedCargoMetadataEnv("D:\\isolated\\cargo", windowsEnv, "win32", (candidate) => candidate.toLowerCase() === windowsShim.toLowerCase()), windowsEnv);
537
+ });
538
+
539
+ test("Cargo metadata respects PATH precedence when unmanaged Cargo resolves first", () => {
540
+ const env = { PATH: "/usr/local/bin:/Volumes/D/.rightkit-managed/agent-bin" };
541
+ const existing = new Set([
542
+ "/usr/local/bin/cargo",
543
+ "/Volumes/D/.rightkit-managed/agent-bin/cargo",
544
+ ]);
545
+ assert.equal(managedCargoShimOnPath(env, "darwin", (candidate) => existing.has(candidate)), false);
546
+ assert.deepEqual(isolatedCargoMetadataEnv("/isolated/cargo", env, "darwin", (candidate) => existing.has(candidate)), {
547
+ PATH: env.PATH,
548
+ CARGO_HOME: "/isolated/cargo",
549
+ });
550
+ });
551
+
521
552
  test("license v2 public vector is identical at every portable consumer boundary", () => {
522
553
  const canonical = readFileSync(
523
554
  path.join(workspace, "tools/rightkit/crates/rightkit-license/test-vectors/license-v2.json"),
@@ -19,7 +19,7 @@
19
19
  "@rightkit/legal": "0.3.0",
20
20
  "@rightkit/legal-ui": "0.1.1",
21
21
  "@rightkit/license": "0.1.6",
22
- "@rightkit/release": "0.2.63",
22
+ "@rightkit/release": "0.2.64",
23
23
  "@rightkit/qa": "0.2.0"
24
24
  },
25
25
  "legacyNpm": {
@@ -45,7 +45,8 @@
45
45
  "0.2.55",
46
46
  "0.2.56",
47
47
  "0.2.61",
48
- "0.2.62"
48
+ "0.2.62",
49
+ "0.2.63"
49
50
  ],
50
51
  "@rightkit/qa": [
51
52
  "0.1.0"
package/upload-large.mjs CHANGED
File without changes