@williamthorsen/nmr 2.2.0 → 2.2.1

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.
@@ -1,4 +1,21 @@
1
1
  [
2
+ {
3
+ "version": "2.2.1",
4
+ "date": "2026-11-13",
5
+ "sections": [
6
+ {
7
+ "title": "🐛 Bug fixes",
8
+ "audience": "all",
9
+ "items": [
10
+ {
11
+ "description": "Fixes the issue that a delegated `nmr` run on a host whose Node comes from a version manager's shims ran on the Node chosen before the checkout, rather than the one pinned by the snapshot, on the first delegation from a clone and the first after a repo changed its pin. (#1337)",
12
+ "hash": "eb9f33c1b5cc919e00f7d33927899c48dbe7c3f7",
13
+ "entry": 1
14
+ }
15
+ ]
16
+ }
17
+ ]
18
+ },
2
19
  {
3
20
  "version": "2.2.0",
4
21
  "date": "2026-11-12",
@@ -1,6 +1,6 @@
1
1
  /** @noformat -- @generated. Do not edit. Compiled by rdy. */
2
2
  /* eslint-disable */
3
- export const __readyupVersion = "0.46.1";
3
+ export const __readyupVersion = "0.46.2";
4
4
  import { createRequire as __rdyCreateRequire } from 'node:module';
5
5
  const require = __rdyCreateRequire(import.meta.url);
6
6
 
@@ -7382,12 +7382,12 @@ import { isRecord, listTrackedFiles } from "readyup/check-utils";
7382
7382
  import { globSync } from "node:fs";
7383
7383
  import { basename, join, sep } from "node:path";
7384
7384
 
7385
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.errors@0.10.0/node_modules/@williamthorsen/toolbelt.errors/dist/esm/4-release/isError.js
7385
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.errors@0.10.1/node_modules/@williamthorsen/toolbelt.errors/dist/esm/4-release/isError.js
7386
7386
  function isError(error) {
7387
7387
  return error instanceof Error || Object.prototype.toString.call(error) === "[object Error]";
7388
7388
  }
7389
7389
 
7390
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.errors@0.10.0/node_modules/@williamthorsen/toolbelt.errors/dist/esm/4-release/describeError.js
7390
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.errors@0.10.1/node_modules/@williamthorsen/toolbelt.errors/dist/esm/4-release/describeError.js
7391
7391
  function describeError(error) {
7392
7392
  try {
7393
7393
  if (isError(error) && typeof error.message === "string" && error.message !== "") {
@@ -8161,11 +8161,11 @@ function formatMalformedScript(dir, key, value) {
8161
8161
  return `${rejection} A step list belongs in \`${CONFIG_RELATIVE_PATH}\` under \`${field}\`.`;
8162
8162
  }
8163
8163
 
8164
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/parseArgs.js
8164
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/parseArgs.js
8165
8165
  import path6 from "node:path";
8166
8166
  import process2 from "node:process";
8167
8167
 
8168
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/UsageError.js
8168
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/UsageError.js
8169
8169
  var UsageError = class extends Error {
8170
8170
  constructor(message, options) {
8171
8171
  super(message, options);
@@ -8173,7 +8173,7 @@ var UsageError = class extends Error {
8173
8173
  }
8174
8174
  };
8175
8175
 
8176
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/ParseError.js
8176
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/ParseError.js
8177
8177
  var ParseError = class extends UsageError {
8178
8178
  kind;
8179
8179
  token;
@@ -8185,12 +8185,12 @@ var ParseError = class extends UsageError {
8185
8185
  }
8186
8186
  };
8187
8187
 
8188
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/resolveLongName.js
8188
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/resolveLongName.js
8189
8189
  function resolveLongName(key, definition) {
8190
8190
  return definition.long ?? key.replaceAll(/[A-Z]/g, (capital) => `-${capital.toLowerCase()}`);
8191
8191
  }
8192
8192
 
8193
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/tokenizeArgs.js
8193
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/tokenizeArgs.js
8194
8194
  import { parseArgs as nodeParseArgs } from "node:util";
8195
8195
  function tokenizeArgs(argv, schema, extraBooleans = []) {
8196
8196
  const nodeOptions = {};
@@ -8220,7 +8220,7 @@ function findFlagEntry(flagsByName, token) {
8220
8220
  return entry.definition.short === token.rawName.slice(1) ? entry : void 0;
8221
8221
  }
8222
8222
 
8223
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/validateSpec.js
8223
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/validateSpec.js
8224
8224
  var CAMEL_CASE_KEY = /^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]+)*$/;
8225
8225
  function validateSpec(spec) {
8226
8226
  validateFlags(spec.flags ?? {});
@@ -8301,7 +8301,7 @@ function validateOperands(operands) {
8301
8301
  }
8302
8302
  }
8303
8303
 
8304
- // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.8.2/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/parseArgs.js
8304
+ // ../../node_modules/.pnpm/@williamthorsen+toolbelt.cli@0.9.0/node_modules/@williamthorsen/toolbelt.cli/dist/esm/3-candidate/parseArgs.js
8305
8305
  function parseArgs(argv, spec, options = {}) {
8306
8306
  validateSpec(spec);
8307
8307
  return parseValidatedArgs(argv, spec, options);
@@ -9662,7 +9662,7 @@ function hasSupportedStrictLintVersion() {
9662
9662
  });
9663
9663
  }
9664
9664
  function getMinVersion() {
9665
- const pickedFields = { "version": "2.2.0" };
9665
+ const pickedFields = { "version": "2.2.1" };
9666
9666
  if (typeof pickedFields["version"] !== "string") {
9667
9667
  throw new TypeError("nmr/package.json: 'version' must be a string");
9668
9668
  }
@@ -3,17 +3,17 @@
3
3
  "kits": [
4
4
  {
5
5
  "bundledDependencies": {
6
- "@williamthorsen/toolbelt.arrays": "6.5.0",
7
- "@williamthorsen/toolbelt.cli": "0.8.2",
8
- "@williamthorsen/toolbelt.datetime": "4.1.3",
9
- "@williamthorsen/toolbelt.errors": "0.10.0",
10
- "@williamthorsen/toolbelt.filesystem": "0.10.2",
11
- "@williamthorsen/toolbelt.guards": "4.2.2",
12
- "@williamthorsen/toolbelt.numbers": "8.0.0",
13
- "@williamthorsen/toolbelt.objects": "4.4.2",
14
- "@williamthorsen/toolbelt.packaging": "0.7.2",
6
+ "@williamthorsen/toolbelt.arrays": "6.5.1",
7
+ "@williamthorsen/toolbelt.cli": "0.9.0",
8
+ "@williamthorsen/toolbelt.datetime": "4.1.4",
9
+ "@williamthorsen/toolbelt.errors": "0.10.1",
10
+ "@williamthorsen/toolbelt.filesystem": "0.10.3",
11
+ "@williamthorsen/toolbelt.guards": "4.2.3",
12
+ "@williamthorsen/toolbelt.numbers": "8.0.1",
13
+ "@williamthorsen/toolbelt.objects": "4.4.3",
14
+ "@williamthorsen/toolbelt.packaging": "0.7.3",
15
15
  "@williamthorsen/toolbelt.sets": "3.1.1",
16
- "@williamthorsen/toolbelt.strings": "8.2.3",
16
+ "@williamthorsen/toolbelt.strings": "8.2.4",
17
17
  "@williamthorsen/toolbelt.terminal": "0.3.1",
18
18
  "ansi-regex": "6.6.0",
19
19
  "ansi-styles": "6.2.3, 7.0.0",
@@ -31,7 +31,7 @@
31
31
  "checklist": "nmr",
32
32
  "checks": [
33
33
  "@williamthorsen/nmr in devDependencies",
34
- "@williamthorsen/nmr >= 2.2.0",
34
+ "@williamthorsen/nmr >= 2.2.1",
35
35
  "pnpm-workspace.yaml exists",
36
36
  "catalogued dependencies use catalog:",
37
37
  "package.json has packageManager field",
@@ -235,7 +235,7 @@
235
235
  "path": "lib/workspace-build.ts"
236
236
  },
237
237
  {
238
- "hash": "7015d006",
238
+ "hash": "a00b2ec5",
239
239
  "kind": "inline",
240
240
  "path": "../package.json",
241
241
  "paths": [
@@ -360,10 +360,10 @@
360
360
  ],
361
361
  "name": "default",
362
362
  "path": "kits/default.js",
363
- "readyupVersion": "0.46.1",
363
+ "readyupVersion": "0.46.2",
364
364
  "source": "kits/default.ts",
365
365
  "sourceHash": "9fd61bf4",
366
- "targetHash": "177bd0ca"
366
+ "targetHash": "db59c5e7"
367
367
  }
368
368
  ]
369
369
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 2.2.1 — 2026-11-13
6
+
7
+ ### 🐛 Bug fixes
8
+
9
+ - Fixes the issue that a delegated `nmr` run on a host whose Node comes from a version manager's shims ran on the Node chosen before the checkout, rather than the one pinned by the snapshot, on the first delegation from a clone and the first after a repo changed its pin. (#1337)
10
+
5
11
  ## 2.2.0 — 2026-11-12
6
12
 
7
13
  ### 🎉 Features
package/README.md CHANGED
@@ -5,12 +5,11 @@
5
5
  Context-aware script runner for pnpm monorepos. Includes an `nmr` (node-monorepo run) binary that provides centralized, consistent script execution across workspace packages and the monorepo root.
6
6
 
7
7
  <!-- section:release-notes -->
8
- ## Release notes — v2.2.0 (2026-11-12)
8
+ ## Release notes — v2.2.1 (2026-11-13)
9
9
 
10
- ### 🎉 Features
10
+ ### 🐛 Bug fixes
11
11
 
12
- - Makes each `nmr` delegation remove, before it pushes, the host's other checkouts that have gone unused for longer than the new user-config key `delegate.removeCheckoutsAfterDays` allows (7 days by default, `false` to keep them), while keeping any checkout whose lock has a live holder. (#1317)
13
- - Adds to the failure message of a delegation step that fails with `No space left on device` whether the host's filesystem ran out of inodes or of space. (#1317)
12
+ - Fixes the issue that a delegated `nmr` run on a host whose Node comes from a version manager's shims ran on the Node chosen before the checkout, rather than the one pinned by the snapshot, on the first delegation from a clone and the first after a repo changed its pin. (#1337)
14
13
  <!-- /section:release-notes -->
15
14
 
16
15
  ## Installation
@@ -55,6 +55,10 @@ export type SessionRecord = {
55
55
  * out the snapshot, installs, runs nmr, and reports the passes that nmr wrote to the pass manifest. It is sent as
56
56
  * source, so it refers to nothing outside its own body.
57
57
  *
58
+ * Every process that the session starts runs on the login shell's `PATH`, which the session script passes as the
59
+ * argument after `params`: A version manager's `node` shim puts the `bin` directory of the Node that it chose before
60
+ * the checkout in front of the session's own `PATH`, and the snapshot may pin another.
61
+ *
58
62
  * The lock follows the machine lock's rules: A waiter reclaims it at once when the holder's pid is gone, and once the
59
63
  * holder has stopped refreshing it for a minute otherwise. When the session's stdin ends, which the local `ssh` causes
60
64
  * by exiting, the session stops its current phase's process group, releases the lock, and exits.
@@ -16,6 +16,8 @@ export function runHostSession(params) {
16
16
  const STOP_GRACE_MS = 5000;
17
17
  const NODE_MODULES_DIR = path.join(params.rootDir, 'node_modules');
18
18
  const BINS_RECORD_PATH = path.join(NODE_MODULES_DIR, '.nmr-delegate-bins');
19
+ const loginPath = process.argv[2] || process.env['PATH'];
20
+ const childEnv = { ...process.env, PATH: loginPath };
19
21
  const token = crypto.randomUUID();
20
22
  let isHolding = false;
21
23
  let activeChild;
@@ -30,7 +32,7 @@ export function runHostSession(params) {
30
32
  ['checkout', '--quiet', '--force', '--detach', params.sha],
31
33
  ['clean', '--force', '-d', '--quiet'],
32
34
  ]) {
33
- const result = await runPhase('git', args, '.', process.env);
35
+ const result = await runPhase('git', args, '.', childEnv);
34
36
  if (isStopping)
35
37
  return;
36
38
  if (result.exitCode !== 0) {
@@ -43,7 +45,7 @@ export function runHostSession(params) {
43
45
  removeWorkspaceState();
44
46
  }
45
47
  const install = await runPhase('pnpm', ['install', '--frozen-lockfile'], params.rootDir, {
46
- ...process.env,
48
+ ...childEnv,
47
49
  CI: 'true',
48
50
  });
49
51
  if (isStopping)
@@ -62,7 +64,7 @@ export function runHostSession(params) {
62
64
  const child = childProcess.spawn('pnpm', ['exec', 'nmr', '--no-delegate', ...params.nmrArgs], {
63
65
  cwd: params.runDir,
64
66
  detached: true,
65
- env: { ...process.env, ...params.remoteEnv, ...manifestEnv },
67
+ env: { ...childEnv, ...params.remoteEnv, ...manifestEnv },
66
68
  stdio: ['ignore', 'inherit', 'inherit'],
67
69
  });
68
70
  activeChild = child;
@@ -14,8 +14,8 @@ export interface SessionDemultiplexer {
14
14
  stream: Writable;
15
15
  }
16
16
  /**
17
- * Composes the script that runs the host session from the checkout. `checkoutDir` is a shell expression, so that it
18
- * can name the host's home directory.
17
+ * Composes the script that runs the host session from the checkout, passing it the shell's `PATH` for the processes
18
+ * that it starts. `checkoutDir` is a shell expression, so that it can name the host's home directory.
19
19
  */
20
20
  export declare function composeSessionScript(options: {
21
21
  checkoutDir: string;
@@ -5,7 +5,7 @@ import { runHostSession, } from "./remote-host-session.js";
5
5
  export function composeSessionScript(options) {
6
6
  const { checkoutDir, params } = options;
7
7
  const source = `(${runHostSession.toString()})(JSON.parse(process.argv[1]));`;
8
- return `cd ${checkoutDir} && exec node -e ${quoteForShell(source)} ${quoteForShell(JSON.stringify(params))}`;
8
+ return `cd ${checkoutDir} && exec node -e ${quoteForShell(source)} ${quoteForShell(JSON.stringify(params))} "$PATH"`;
9
9
  }
10
10
  export function createSessionDemultiplexer(options) {
11
11
  const { marker, onMalformedRecord, onRecord, stderr } = options;
package/docs/delegate.md CHANGED
@@ -162,5 +162,5 @@ Every other failure still exits 255: a delegation that `--delegate`, `--delegate
162
162
  ## Setting up the host
163
163
 
164
164
  - **SSH that does not prompt.** nmr runs the ssh command that `GIT_SSH_COMMAND` names, evaluated by `/bin/sh` as git evaluates it, or plain `ssh` when the variable is unset or empty, and adds `BatchMode=yes` and a connect timeout after the command's own options, so an option that the command sets itself takes precedence. Under `BatchMode=yes`, a key that needs a passphrase must be in the agent, and the host key must already be known. An unreachable host fails within 10 seconds.
165
- - **git, Node, and pnpm on the interactive login shell's `PATH`.** nmr reads `PATH` from the host's login shell started as an interactive one, which loads `~/.zshrc` or `~/.bashrc` as well as the login profile: That is where pnpm's installer and the common version managers put Node and pnpm. What the startup files print does not reach the output, but whatever else they do runs before each step. Node on the host must satisfy nmr's own `engines` range (`>=24.16.0`). When Node is not on that `PATH`, the check-out step fails, and when pnpm is not, the install step fails; each failure names `PATH`. The login shell must accept `-ilc`: bash and zsh do.
165
+ - **git, Node, and pnpm on the interactive login shell's `PATH`.** nmr reads `PATH` from the host's login shell started as an interactive one, which loads `~/.zshrc` or `~/.bashrc` as well as the login profile: That is where pnpm's installer and the common version managers put Node and pnpm. What the startup files print does not reach the output, but whatever else they do runs before each step. After it checks out the snapshot, nmr starts the install and the command on that `PATH`, so a version manager's shims select the Node and pnpm that the snapshot pins. Node on the host must satisfy nmr's own `engines` range (`>=24.16.0`). When Node is not on that `PATH`, the check-out step fails, and when pnpm is not, the install step fails; each failure names `PATH`. The login shell must accept `-ilc`: bash and zsh do.
166
166
  - **A sandboxed agent session needs network access to the host.** A sandbox that allows only HTTP egress refuses `ssh`. Under `when: 'agent'`, every check that the session runs then [runs here](#when-no-host-answers) after the connect timeout, and a requested delegation fails at `prepare`, until the session has that access. The Claude Code sandbox reaches a host only through the proxy that its `GIT_SSH_COMMAND` names, and it admits the host by the name that ssh connects to, which is the `HostName` that `~/.ssh/config` gives the alias (`ssh -G <host>` prints it), on port 22: For `imac2` with `HostName skypilot-imac2.local`, the sandbox must admit `skypilot-imac2.local:22`, not `imac2`. Nobody has confirmed whether the proxy resolves an mDNS name such as `skypilot-imac2.local`: When a delegation to such a host does not answer, and `ssh` reports `sandbox proxy: <name>:22: 502 Bad Gateway`, give the alias a `HostName` that is an IP address or a unicast DNS name, and have the sandbox admit that name's port 22.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamthorsen/nmr",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "private": false,
5
5
  "description": "Context-aware script runner for pnpm monorepos",
6
6
  "keywords": [
@@ -81,19 +81,19 @@
81
81
  ],
82
82
  "dependencies": {
83
83
  "@williamthorsen/nmr-core": "0.16.2",
84
- "@williamthorsen/toolbelt.errors": "0.10.0",
85
- "@williamthorsen/toolbelt.filesystem": "0.10.2",
86
- "glob": "14.0.4",
84
+ "@williamthorsen/toolbelt.errors": "0.10.1",
85
+ "@williamthorsen/toolbelt.filesystem": "0.10.3",
86
+ "glob": "14.0.5",
87
87
  "prettier": "3.10.0",
88
88
  "prettier-plugin-sh": "0.20.2",
89
89
  "taze": "21.3.0",
90
90
  "unconfig": "7.5.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@williamthorsen/toolbelt.testing": "0.8.2",
94
- "@williamthorsen/toolbelt.vitest": "0.13.4",
93
+ "@williamthorsen/toolbelt.testing": "0.8.3",
94
+ "@williamthorsen/toolbelt.vitest": "0.13.5",
95
95
  "esbuild": "0.28.2",
96
- "readyup": "0.46.1",
96
+ "readyup": "0.46.2",
97
97
  "tinyglobby": "0.2.17",
98
98
  "typescript": "6.0.3",
99
99
  "vite": "8.3.8",