@bli-cockpit/cli 0.2.271 → 0.2.273

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.
@@ -7,14 +7,24 @@ export const SELF_UPDATE_THROTTLE_MARKER = ".last-self-update-check";
7
7
  * Put the running node binary's directory on PATH for scheduled npm commands.
8
8
  * Schedulers use a bare PATH; npm's shim ships beside node on both host families.
9
9
  */
10
- export function envWithNodeRuntimeOnPath(env, nodeExecutable = process.execPath) {
11
- const nodeBinDir = path.dirname(nodeExecutable);
12
- const currentPath = env["PATH"] ?? "";
13
- if (currentPath.split(path.delimiter).includes(nodeBinDir))
10
+ export function envWithNodeRuntimeOnPath(env, nodeExecutable = process.execPath,
11
+ /** Which platform's rules the PATH follows. Omitted: this host's own. */
12
+ platform) {
13
+ const api = platform === undefined ? path : platform === "win32" ? path.win32 : path.posix;
14
+ // The running node's folder means nothing on a platform it is not from (an install
15
+ // simulated for another platform): leave that PATH exactly as the caller wrote it.
16
+ if (!api.isAbsolute(nodeExecutable))
17
+ return env;
18
+ const nodeBinDir = api.dirname(nodeExecutable);
19
+ // Windows spells the variable `Path`, and `{ ...process.env }` keeps that spelling: reading
20
+ // only `PATH` saw an empty PATH and left two spellings in the child's environment (BLI-23322).
21
+ const pathKey = api.sep === "\\" ? Object.keys(env).find((key) => key.toUpperCase() === "PATH") ?? "PATH" : "PATH";
22
+ const currentPath = env[pathKey] ?? "";
23
+ if (currentPath.split(api.delimiter).includes(nodeBinDir))
14
24
  return env;
15
25
  return {
16
26
  ...env,
17
- PATH: [nodeBinDir, currentPath].filter(Boolean).join(path.delimiter),
27
+ [pathKey]: [nodeBinDir, currentPath].filter(Boolean).join(api.delimiter),
18
28
  };
19
29
  }
20
30
  /**
@@ -84,7 +84,8 @@ export async function slimLineStream(lines, kind, occurrences, replace, sink) {
84
84
  const image = occurrences[next];
85
85
  if (image.replaceEnd > end)
86
86
  throw new TranscriptNotStreamable("images_changed_between_passes");
87
- if (replace(image))
87
+ // BLI-23347: a stand-in that carries its own replacement (a PDF) is always swapped.
88
+ if (image.replacement !== undefined || replace(image))
88
89
  chosen.push(image);
89
90
  }
90
91
  let line;
@@ -95,7 +96,7 @@ export async function slimLineStream(lines, kind, occurrences, replace, sink) {
95
96
  const pieces = [];
96
97
  let cursor = 0;
97
98
  for (const image of chosen) {
98
- const marker = formatImageMarker({ sha256: image.sha256, mediaType: image.mediaType, byteSize: image.byteSize });
99
+ const marker = image.replacement ?? formatImageMarker({ sha256: image.sha256, mediaType: image.mediaType, byteSize: image.byteSize });
99
100
  pieces.push(bytes.subarray(cursor, image.replaceStart - start), Buffer.from(marker, "utf8"));
100
101
  cursor = image.replaceEnd - start;
101
102
  replacedCount += 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.2.271",
3
+ "version": "0.2.273",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,9 +27,10 @@
27
27
  "test": "node dist/cli.js --help && node ../../scripts/assert-public-cli-routing.mjs && node ../../scripts/assert-public-cli-verb-help.mjs && node ../../scripts/assert-public-cli-surface-doors.mjs && node ../../scripts/assert-public-cli-runtime-files.mjs && node ../../scripts/assert-public-cli-exit-contract.mjs && node ../../scripts/assert-public-cli-no-fleet-posts.mjs && node ../../scripts/assert-public-cli-doctor-json.mjs && node ../../scripts/assert-public-package-pack.mjs --workspace=@bli-cockpit/cli"
28
28
  },
29
29
  "dependencies": {
30
- "@bli-cockpit/memory-mcp": "0.1.81",
31
- "@bli-cockpit/mcp": "0.1.165",
32
- "@bli-cockpit/telemetry-core": "0.1.88"
30
+ "@bli-cockpit/memory-mcp": "0.1.82",
31
+ "@bli-cockpit/mcp": "0.1.166",
32
+ "@bli-cockpit/telemetry-core": "0.1.89",
33
+ "unpdf": "1.8.1"
33
34
  },
34
35
  "repository": {
35
36
  "type": "git",