@rightkit/release 0.2.119 → 0.2.121

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.119",
3
+ "version": "0.2.121",
4
4
  "description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -45,9 +45,10 @@ export function checkPublicationGate({ kind, name, version, packagePath, evidenc
45
45
  if (!SHA.test(String(evidence.commit ?? ""))) missing.push("evidence commit is not a full 40-character SHA");
46
46
  else if (head && evidence.commit !== head) missing.push(`evidence commit ${evidence.commit} != current HEAD ${head}`);
47
47
  const runs = Array.isArray(evidence.runs) ? evidence.runs : [];
48
- // npm UI packages may ship on macOS evidence first when Adrian decides so; the decision must be
48
+ // npm packages and crates may ship on macOS evidence first when Adrian decides so; the decision must be
49
49
  // recorded in the evidence (hostPolicy "darwin-only" + a non-empty hostPolicyReason).
50
- const darwinOnly = kind === "npm" && evidence.hostPolicy === "darwin-only"
50
+ // Crates may ship Mac-first too (Adrian 2026-10-07): the Windows run follows; the reason is recorded.
51
+ const darwinOnly = (kind === "npm" || kind === "cargo") && evidence.hostPolicy === "darwin-only"
51
52
  && typeof evidence.hostPolicyReason === "string" && evidence.hostPolicyReason.trim() !== "";
52
53
  for (const host of darwinOnly ? ["darwin"] : requiredHosts(kind)) {
53
54
  const label = host === "darwin" ? "macOS" : "Windows";
@@ -81,7 +82,33 @@ export const NPM_KEYCHAIN_SERVICE = "npm-rightkit-publish";
81
82
  // Add `--publish --tarball <file>` to publish that exact gated tarball: its sha256 must equal the
82
83
  // evidence artifactSha256, the token is read from the macOS Keychain inside this process (never
83
84
  // printed or passed on a command line), and the registry shasum is verified after publication.
85
+ /** `right-release publish npm --check-auth`: prove the Keychain token authenticates (whoami +
86
+ * @rightkit package access) without publishing. Prints only the username and counts. */
87
+ export function checkNpmAuth(deps = {}) {
88
+ const run = deps.spawnSync ?? spawnSync;
89
+ const token = deps.readToken ? deps.readToken() : readKeychainToken(run);
90
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rk-npm-auth-"));
91
+ const userconfig = path.join(dir, "npmrc");
92
+ const redact = (text) => String(text ?? "").split(token).join("<redacted>");
93
+ try {
94
+ fs.writeFileSync(userconfig, "//registry.npmjs.org/:_authToken=${RIGHTKIT_NPM_TOKEN}\n", { mode: 0o600 });
95
+ const env = { ...process.env, RIGHTKIT_NPM_TOKEN: token };
96
+ const base = ["--registry", "https://registry.npmjs.org/", "--userconfig", userconfig];
97
+ const who = run("npm", ["whoami", ...base], { encoding: "utf8", env, windowsHide: true });
98
+ if (who.status !== 0) throw new Error(`npm whoami failed with the Keychain token:\n${redact(`${who.stdout ?? ""}${who.stderr ?? ""}`).trim()}`);
99
+ const access = run("npm", ["access", "list", "packages", "@rightkit", "--json", ...base], { encoding: "utf8", env, windowsHide: true });
100
+ let packages = {};
101
+ try { packages = JSON.parse(access.stdout || "{}"); } catch { packages = {}; }
102
+ const writable = Object.values(packages).filter((level) => level === "read-write").length;
103
+ process.stdout.write(`[right-release] npm token OK: ${String(who.stdout).trim()}, read-write on ${writable} @rightkit packages\n`);
104
+ return { user: String(who.stdout).trim(), writable };
105
+ } finally {
106
+ fs.rmSync(dir, { recursive: true, force: true });
107
+ }
108
+ }
109
+
84
110
  export function runNpmPreflight(argv, workspaceRoot = process.cwd(), deps = {}) {
111
+ if (argv.includes("--check-auth")) { checkNpmAuth(deps); return; }
85
112
  let pkg; let evidence; let tarball; const dryRun = argv.includes("--dry-run"); const publish = argv.includes("--publish");
86
113
  for (let i = 0; i < argv.length; i += 1) {
87
114
  if (argv[i] === "--package") pkg = argv[++i];
@@ -28,8 +28,8 @@
28
28
  "@rightkit/pdf-ui": "0.1.1",
29
29
  "@rightkit/platform-ui": "0.1.2",
30
30
  "@rightkit/qa": "0.2.1",
31
- "@rightkit/release": "0.2.119",
32
- "@rightkit/settings-ui": "0.2.3",
31
+ "@rightkit/release": "0.2.121",
32
+ "@rightkit/settings-ui": "0.2.5",
33
33
  "@rightkit/shell": "0.1.0",
34
34
  "@rightkit/tauri": "0.1.1",
35
35
  "@rightkit/theme": "0.2.0",
@@ -140,7 +140,9 @@
140
140
  "0.2.115",
141
141
  "0.2.116",
142
142
  "0.2.117",
143
- "0.2.118"
143
+ "0.2.118",
144
+ "0.2.119",
145
+ "0.2.120"
144
146
  ],
145
147
  "@rightkit/qa": [
146
148
  "0.1.0",
@@ -163,7 +165,9 @@
163
165
  "@rightkit/settings-ui": [
164
166
  "0.1.0",
165
167
  "0.2.0",
166
- "0.2.2"
168
+ "0.2.2",
169
+ "0.2.3",
170
+ "0.2.4"
167
171
  ],
168
172
  "@rightkit/onboarding": [
169
173
  "0.1.0",
@@ -208,14 +212,14 @@
208
212
  "rightkit-db": "0.2.1",
209
213
  "rightkit-framed-sidecar": "0.1.0",
210
214
  "rightkit-fs": "0.1.0",
211
- "rightkit-jobs": "0.2.0",
215
+ "rightkit-jobs": "0.2.1",
212
216
  "rightkit-logs": "0.2.0",
213
- "rightkit-media": "0.2.0",
214
- "rightkit-models": "0.1.0",
217
+ "rightkit-media": "0.2.2",
218
+ "rightkit-models": "0.2.0",
215
219
  "rightkit-pdf": "0.1.0",
216
220
  "rightkit-playback": "0.1.0",
217
221
  "rightkit-process": "0.2.1",
218
- "rightkit-qa": "0.1.0",
222
+ "rightkit-qa": "0.2.0",
219
223
  "rightkit-sandbox": "0.1.0",
220
224
  "rightkit-search": "0.1.0",
221
225
  "rightkit-service": "0.1.0",