@vltpkg/cli-js 1.3.3 → 1.3.5

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.
Files changed (76) hide show
  1. package/{access-KMBBQIIT.js → access-X2ZZH2BV.js} +4 -4
  2. package/{bugs-CABZX76X.js → bugs-SF56YATZ.js} +12 -12
  3. package/{build-WNHKYA4E.js → build-RRJ645SV.js} +6 -6
  4. package/{cache-KKT4GIYD.js → cache-NETXHYQU.js} +6 -6
  5. package/{chunk-SH24EMXO.js → chunk-2B5STVCP.js} +150 -40
  6. package/{chunk-GZWJAGBL.js → chunk-35OBZITS.js} +3 -3
  7. package/{chunk-ROCFQPP2.js → chunk-75F2WCA5.js} +2 -2
  8. package/{chunk-MOL2DUEQ.js → chunk-7DHDJ5XY.js} +368 -51
  9. package/{chunk-YU2W5UPG.js → chunk-ADDCQBGR.js} +1 -1
  10. package/{chunk-MC6CESRA.js → chunk-AFUXQ3P4.js} +1 -1
  11. package/{chunk-LY5FNWRY.js → chunk-B2CTWVQM.js} +3 -3
  12. package/{chunk-CU752KW7.js → chunk-BCANUHR3.js} +1 -1
  13. package/{chunk-GA4LA6B2.js → chunk-EGWLQVDZ.js} +4 -4
  14. package/chunk-EWZQGHYC.js +75 -0
  15. package/{chunk-HCMAX6Q5.js → chunk-GO5X2SSV.js} +3 -3
  16. package/{chunk-TJBBYDUN.js → chunk-I2DZC2J3.js} +4 -4
  17. package/{chunk-BUKZHMMK.js → chunk-INEKXXUQ.js} +1 -0
  18. package/{chunk-QBXGMTDE.js → chunk-LHB4CVEH.js} +1 -1
  19. package/{chunk-I6QGYSB4.js → chunk-LHIDMYN2.js} +1 -1
  20. package/chunk-OFHNSAQ5.js +2155 -0
  21. package/{chunk-ZBJRZXSU.js → chunk-PBHCZOUY.js} +3 -3
  22. package/{chunk-3IDIPSH7.js → chunk-QJHTK7ML.js} +1 -1
  23. package/{chunk-ZWKI5OSF.js → chunk-SRWDPPLX.js} +0 -1377
  24. package/{chunk-CSZTT7QN.js → chunk-TOKUDCSW.js} +2 -2
  25. package/{chunk-ENSGPOLR.js → chunk-XU5WNX4S.js} +3 -1
  26. package/{chunk-DCFLXO2M.js → chunk-XUGOPOLF.js} +1 -1
  27. package/{chunk-ZRRNOLEG.js → chunk-ZZFFMXI2.js} +214 -105
  28. package/{ci-BGVGC5RF.js → ci-YX56QIMV.js} +7 -7
  29. package/cli-package.json +1 -1
  30. package/{config-AWX2VEKL.js → config-HO7N7FPS.js} +5 -5
  31. package/{config-FIKZ4VWG.js → config-SHRCBOCI.js} +6 -6
  32. package/{create-CHTG7KO3.js → create-LO6BUYPU.js} +13 -13
  33. package/{deprecate-W7KQ62HF.js → deprecate-CUMWWMAF.js} +7 -7
  34. package/{dist-tag-66CC6HT7.js → dist-tag-DJJDBPTJ.js} +4 -4
  35. package/{docs-HW4U5TGD.js → docs-KDCDJRO5.js} +12 -12
  36. package/{exec-BVVNAGFI.js → exec-KF4ANRPM.js} +13 -13
  37. package/{exec-cache-L3ONPM5C.js → exec-cache-GBLLYU5O.js} +11 -11
  38. package/{exec-local-NR3RYQDQ.js → exec-local-VCP4KR6K.js} +10 -10
  39. package/{help-5YL6SUAN.js → help-MV53HEUI.js} +4 -4
  40. package/{init-RI2WVCGL.js → init-N3BM2FKC.js} +7 -7
  41. package/{install-OWAI4EOW.js → install-DDYIRJWL.js} +12 -12
  42. package/{list-4ZFX7ANG.js → list-VTCG6GBS.js} +12 -12
  43. package/{login-6TL3EE6Q.js → login-MCX6LCP5.js} +8 -8
  44. package/{logout-VQWHVHBE.js → logout-FPNGIQDZ.js} +4 -4
  45. package/{pack-Q5IRRAMU.js → pack-KCVLNNVZ.js} +9 -9
  46. package/package.json +1 -1
  47. package/{ping-2WV3V7GB.js → ping-MXTB7GFE.js} +4 -4
  48. package/{pkg-RXB6BRS5.js → pkg-QDEHGO34.js} +8 -8
  49. package/{profile-GNGWS5H2.js → profile-GQUM6NRG.js} +4 -4
  50. package/{publish-PI74W4GH.js → publish-UEL4KXDZ.js} +12 -12
  51. package/{query-NESDWXGE.js → query-MJTEJIZW.js} +12 -12
  52. package/{registry-MXAA4HVJ.js → registry-PY2L5ZWC.js} +2 -2
  53. package/registry-client-src-revalidate.js +150 -40
  54. package/{repo-PPBN3SKP.js → repo-XDMXV744.js} +12 -12
  55. package/{reporter-XBHCUW7W.js → reporter-K3D4AJBF.js} +6 -6
  56. package/{run-7GTWIFMV.js → run-MKEP7YKW.js} +10 -10
  57. package/{run-exec-VLSH5SOB.js → run-exec-Q7JNLVVV.js} +10 -10
  58. package/security-archive-src-update-expired.js +1 -1
  59. package/{setup-6O7RFGU2.js → setup-DYQY6DIX.js} +10 -10
  60. package/{src-EJSVFFXB.js → src-3MEJQYBG.js} +21 -7
  61. package/{src-6E7KCC7J.js → src-BZJHOEYT.js} +9 -9
  62. package/{src-U4MCZFJT.js → src-ODLA6WPY.js} +2 -2
  63. package/{token-NZ4HODXE.js → token-RUBMQURU.js} +4 -4
  64. package/{uninstall-KBZ6PJBG.js → uninstall-3NJXWOKS.js} +8 -8
  65. package/{unpublish-JBWSIBRX.js → unpublish-3ETADFWK.js} +4 -4
  66. package/{update-X4EC6MPP.js → update-L6ETRX6Q.js} +11 -11
  67. package/{version-QEHPAFAE.js → version-RHWAFXPK.js} +7 -7
  68. package/{view-WGGZTYAT.js → view-ABHAULFH.js} +7 -7
  69. package/vlr.js +1 -1
  70. package/vlrx.js +1 -1
  71. package/vlt.js +1 -1
  72. package/vlx.js +1 -1
  73. package/vlxl.js +1 -1
  74. package/{whoami-RYNXOULV.js → whoami-YDR7Q4VT.js} +4 -4
  75. package/chunk-7JK53T6G.js +0 -75
  76. package/chunk-KH3ERNCA.js +0 -783
@@ -11,7 +11,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  views
14
- } from "./chunk-HCMAX6Q5.js";
14
+ } from "./chunk-GO5X2SSV.js";
15
15
  import {
16
16
  del,
17
17
  get,
@@ -19,28 +19,28 @@ import {
19
19
  } from "./chunk-DBANBIL2.js";
20
20
  import {
21
21
  createHostContextsMap
22
- } from "./chunk-LY5FNWRY.js";
22
+ } from "./chunk-B2CTWVQM.js";
23
23
  import {
24
24
  GraphModifier,
25
25
  Query,
26
26
  VIRTUAL_ROOT_ID,
27
27
  actual,
28
28
  init
29
- } from "./chunk-ZRRNOLEG.js";
29
+ } from "./chunk-ZZFFMXI2.js";
30
30
  import {
31
31
  SecurityArchive
32
- } from "./chunk-DCFLXO2M.js";
32
+ } from "./chunk-XUGOPOLF.js";
33
33
  import {
34
34
  commandUsage
35
- } from "./chunk-I6QGYSB4.js";
35
+ } from "./chunk-LHIDMYN2.js";
36
36
  import {
37
37
  minimatch
38
- } from "./chunk-BUKZHMMK.js";
38
+ } from "./chunk-INEKXXUQ.js";
39
39
  import "./chunk-JIQBZ2UT.js";
40
40
  import "./chunk-64VFL4WI.js";
41
- import "./chunk-ENSGPOLR.js";
41
+ import "./chunk-XU5WNX4S.js";
42
42
  import "./chunk-HTOTG4TS.js";
43
- import "./chunk-YU2W5UPG.js";
43
+ import "./chunk-ADDCQBGR.js";
44
44
  import "./chunk-U7TEQCBN.js";
45
45
  import "./chunk-XNLSTHDK.js";
46
46
  import "./chunk-PDWPFR5T.js";
@@ -14,17 +14,17 @@ import {
14
14
  } from "./chunk-J4NHRZX6.js";
15
15
  import {
16
16
  commandUsage
17
- } from "./chunk-I6QGYSB4.js";
17
+ } from "./chunk-LHIDMYN2.js";
18
18
  import "./chunk-64VFL4WI.js";
19
- import "./chunk-ENSGPOLR.js";
19
+ import "./chunk-XU5WNX4S.js";
20
20
  import {
21
21
  RegistryClient
22
- } from "./chunk-SH24EMXO.js";
22
+ } from "./chunk-2B5STVCP.js";
23
23
  import "./chunk-APMYKJI2.js";
24
24
  import {
25
25
  assertOk
26
26
  } from "./chunk-PBBULTAG.js";
27
- import "./chunk-YU2W5UPG.js";
27
+ import "./chunk-ADDCQBGR.js";
28
28
  import "./chunk-U7TEQCBN.js";
29
29
  import "./chunk-XNLSTHDK.js";
30
30
  import "./chunk-PDWPFR5T.js";
@@ -11,20 +11,20 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  packTarball
14
- } from "./chunk-KH3ERNCA.js";
14
+ } from "./chunk-OFHNSAQ5.js";
15
15
  import {
16
16
  createHostContextsMap
17
- } from "./chunk-LY5FNWRY.js";
17
+ } from "./chunk-B2CTWVQM.js";
18
18
  import {
19
19
  prettyBytes
20
20
  } from "./chunk-XA47WS4N.js";
21
21
  import {
22
22
  stderr
23
- } from "./chunk-CSZTT7QN.js";
24
- import "./chunk-CU752KW7.js";
23
+ } from "./chunk-TOKUDCSW.js";
24
+ import "./chunk-BCANUHR3.js";
25
25
  import "./chunk-G2YT2GWF.js";
26
26
  import "./chunk-CRGWLUGC.js";
27
- import "./chunk-ZWKI5OSF.js";
27
+ import "./chunk-SRWDPPLX.js";
28
28
  import "./chunk-WGDTG44V.js";
29
29
  import {
30
30
  resolveRegistry
@@ -33,30 +33,30 @@ import {
33
33
  Query,
34
34
  actual,
35
35
  run
36
- } from "./chunk-ZRRNOLEG.js";
37
- import "./chunk-DCFLXO2M.js";
36
+ } from "./chunk-ZZFFMXI2.js";
37
+ import "./chunk-XUGOPOLF.js";
38
38
  import {
39
39
  commandUsage
40
- } from "./chunk-I6QGYSB4.js";
40
+ } from "./chunk-LHIDMYN2.js";
41
41
  import {
42
42
  minimatch
43
- } from "./chunk-BUKZHMMK.js";
43
+ } from "./chunk-INEKXXUQ.js";
44
44
  import "./chunk-4KCU2KZL.js";
45
45
  import "./chunk-JIQBZ2UT.js";
46
46
  import "./chunk-64VFL4WI.js";
47
- import "./chunk-ENSGPOLR.js";
47
+ import "./chunk-XU5WNX4S.js";
48
48
  import "./chunk-HTOTG4TS.js";
49
49
  import {
50
50
  RegistryClient,
51
51
  oidc,
52
52
  registryBase
53
- } from "./chunk-SH24EMXO.js";
53
+ } from "./chunk-2B5STVCP.js";
54
54
  import "./chunk-APMYKJI2.js";
55
55
  import {
56
56
  assertOk,
57
57
  requestError
58
58
  } from "./chunk-PBBULTAG.js";
59
- import "./chunk-YU2W5UPG.js";
59
+ import "./chunk-ADDCQBGR.js";
60
60
  import "./chunk-U7TEQCBN.js";
61
61
  import "./chunk-XNLSTHDK.js";
62
62
  import "./chunk-PDWPFR5T.js";
@@ -12,19 +12,19 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  MermaidImageView,
14
14
  createGetAuthHeader
15
- } from "./chunk-GA4LA6B2.js";
15
+ } from "./chunk-EGWLQVDZ.js";
16
16
  import {
17
17
  createDiffFilesProvider
18
18
  } from "./chunk-RIYFGX27.js";
19
- import "./chunk-MC6CESRA.js";
19
+ import "./chunk-AFUXQ3P4.js";
20
20
  import {
21
21
  assertVltInstalled,
22
22
  createHostContextsMap
23
- } from "./chunk-LY5FNWRY.js";
23
+ } from "./chunk-B2CTWVQM.js";
24
24
  import {
25
25
  stdout
26
- } from "./chunk-CSZTT7QN.js";
27
- import "./chunk-CU752KW7.js";
26
+ } from "./chunk-TOKUDCSW.js";
27
+ import "./chunk-BCANUHR3.js";
28
28
  import "./chunk-G2YT2GWF.js";
29
29
  import "./chunk-CRGWLUGC.js";
30
30
  import "./chunk-WGDTG44V.js";
@@ -37,23 +37,23 @@ import {
37
37
  humanReadableOutput,
38
38
  jsonOutput,
39
39
  mermaidOutput
40
- } from "./chunk-ZRRNOLEG.js";
40
+ } from "./chunk-ZZFFMXI2.js";
41
41
  import {
42
42
  SecurityArchive
43
- } from "./chunk-DCFLXO2M.js";
43
+ } from "./chunk-XUGOPOLF.js";
44
44
  import {
45
45
  commandUsage
46
- } from "./chunk-I6QGYSB4.js";
47
- import "./chunk-BUKZHMMK.js";
46
+ } from "./chunk-LHIDMYN2.js";
47
+ import "./chunk-INEKXXUQ.js";
48
48
  import "./chunk-4KCU2KZL.js";
49
49
  import "./chunk-JIQBZ2UT.js";
50
50
  import "./chunk-64VFL4WI.js";
51
- import "./chunk-ENSGPOLR.js";
51
+ import "./chunk-XU5WNX4S.js";
52
52
  import "./chunk-HTOTG4TS.js";
53
- import "./chunk-SH24EMXO.js";
53
+ import "./chunk-2B5STVCP.js";
54
54
  import "./chunk-APMYKJI2.js";
55
55
  import "./chunk-PBBULTAG.js";
56
- import "./chunk-YU2W5UPG.js";
56
+ import "./chunk-ADDCQBGR.js";
57
57
  import "./chunk-U7TEQCBN.js";
58
58
  import "./chunk-XNLSTHDK.js";
59
59
  import "./chunk-PDWPFR5T.js";
@@ -14,11 +14,11 @@ import {
14
14
  } from "./chunk-J4NHRZX6.js";
15
15
  import {
16
16
  commandUsage
17
- } from "./chunk-I6QGYSB4.js";
17
+ } from "./chunk-LHIDMYN2.js";
18
18
  import "./chunk-64VFL4WI.js";
19
19
  import {
20
20
  getCommand
21
- } from "./chunk-ENSGPOLR.js";
21
+ } from "./chunk-XU5WNX4S.js";
22
22
  import "./chunk-XNLSTHDK.js";
23
23
  import "./chunk-BP3PQ67D.js";
24
24
  import {
@@ -7852,7 +7852,7 @@ var require_client_h2 = __commonJS({
7852
7852
  "../../node_modules/.vlt/~npm~undici@7.29.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module3) {
7853
7853
  "use strict";
7854
7854
  var assert = __require("node:assert");
7855
- var { pipeline } = __require("node:stream");
7855
+ var { pipeline: pipeline2 } = __require("node:stream");
7856
7856
  var util = require_util();
7857
7857
  var {
7858
7858
  RequestContentLengthMismatchError,
@@ -8485,7 +8485,7 @@ var require_client_h2 = __commonJS({
8485
8485
  }
8486
8486
  function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
8487
8487
  assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
8488
- const pipe = pipeline(
8488
+ const pipe = pipeline2(
8489
8489
  body,
8490
8490
  h2stream,
8491
8491
  (err) => {
@@ -12312,7 +12312,7 @@ var require_api_pipeline = __commonJS({
12312
12312
  util.destroy(ret, err);
12313
12313
  }
12314
12314
  };
12315
- function pipeline(opts, handler) {
12315
+ function pipeline2(opts, handler) {
12316
12316
  try {
12317
12317
  const pipelineHandler = new PipelineHandler(opts, handler);
12318
12318
  this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
@@ -12321,7 +12321,7 @@ var require_api_pipeline = __commonJS({
12321
12321
  return new PassThrough().destroy(err);
12322
12322
  }
12323
12323
  }
12324
- module3.exports = pipeline;
12324
+ module3.exports = pipeline2;
12325
12325
  }
12326
12326
  });
12327
12327
 
@@ -17553,13 +17553,13 @@ var require_cache2 = __commonJS({
17553
17553
  var require_decompress = __commonJS({
17554
17554
  "../../node_modules/.vlt/~npm~undici@7.29.0/node_modules/undici/lib/interceptor/decompress.js"(exports, module3) {
17555
17555
  "use strict";
17556
- var { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = __require("node:zlib");
17557
- var { pipeline } = __require("node:stream");
17556
+ var { createInflate, createGunzip: createGunzip2, createBrotliDecompress, createZstdDecompress } = __require("node:zlib");
17557
+ var { pipeline: pipeline2 } = __require("node:stream");
17558
17558
  var DecoratorHandler = require_decorator_handler();
17559
17559
  var { runtimeFeatures } = require_runtime_features();
17560
17560
  var supportedEncodings = {
17561
- gzip: createGunzip,
17562
- "x-gzip": createGunzip,
17561
+ gzip: createGunzip2,
17562
+ "x-gzip": createGunzip2,
17563
17563
  br: createBrotliDecompress,
17564
17564
  deflate: createInflate,
17565
17565
  compress: createInflate,
@@ -17663,7 +17663,7 @@ var require_decompress = __commonJS({
17663
17663
  #setupMultipleDecompressors(controller) {
17664
17664
  const lastDecompressor = this.#decompressors[this.#decompressors.length - 1];
17665
17665
  this.#setupDecompressorEvents(lastDecompressor, controller);
17666
- pipeline(this.#decompressors, (err) => {
17666
+ pipeline2(this.#decompressors, (err) => {
17667
17667
  if (err) {
17668
17668
  super.onResponseError(controller, err);
17669
17669
  return;
@@ -20408,7 +20408,7 @@ var require_fetch = __commonJS({
20408
20408
  subresourceSet
20409
20409
  } = require_constants3();
20410
20410
  var EE = __require("node:events");
20411
- var { Readable, pipeline, finished, isErrored, isReadable } = __require("node:stream");
20411
+ var { Readable, pipeline: pipeline2, finished, isErrored, isReadable } = __require("node:stream");
20412
20412
  var { addAbortListener, bufferToLowerCasedHeaderName } = require_util();
20413
20413
  var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
20414
20414
  var { getGlobalDispatcher } = require_global2();
@@ -21399,7 +21399,7 @@ var require_fetch = __commonJS({
21399
21399
  status,
21400
21400
  statusText: statusText2,
21401
21401
  headersList,
21402
- body: decoders.length ? pipeline(this.body, ...decoders, (err) => {
21402
+ body: decoders.length ? pipeline2(this.body, ...decoders, (err) => {
21403
21403
  if (err) {
21404
21404
  this.onError(err);
21405
21405
  }
@@ -25100,7 +25100,7 @@ ${value}`;
25100
25100
  var require_eventsource = __commonJS({
25101
25101
  "../../node_modules/.vlt/~npm~undici@7.29.0/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module3) {
25102
25102
  "use strict";
25103
- var { pipeline } = __require("node:stream");
25103
+ var { pipeline: pipeline2 } = __require("node:stream");
25104
25104
  var { fetching } = require_fetch();
25105
25105
  var { makeRequest } = require_request2();
25106
25106
  var { webidl } = require_webidl();
@@ -25258,7 +25258,7 @@ var require_eventsource = __commonJS({
25258
25258
  ));
25259
25259
  }
25260
25260
  });
25261
- pipeline(
25261
+ pipeline2(
25262
25262
  response.body.stream,
25263
25263
  eventSourceStream,
25264
25264
  (error2) => {
@@ -32460,13 +32460,15 @@ import { randomUUID } from "node:crypto";
32460
32460
  import { closeSync, openSync, readFileSync as readFileSync2, readSync } from "node:fs";
32461
32461
  import { availableParallelism } from "node:os";
32462
32462
  import { dirname as dirname3, resolve as resolve10 } from "node:path";
32463
+ import { pipeline } from "node:stream";
32463
32464
  import { setTimeout as setTimeout3 } from "node:timers/promises";
32465
+ import { createGunzip } from "node:zlib";
32464
32466
 
32465
32467
  // ../../src/user-agent/package.json
32466
32468
  var package_default = {
32467
32469
  name: "@vltpkg/user-agent",
32468
32470
  description: "The User-Agent string that vlt sends with every outbound request",
32469
- version: "1.3.3",
32471
+ version: "1.3.5",
32470
32472
  repository: {
32471
32473
  type: "git",
32472
32474
  url: "git+https://github.com/vltpkg/vltpkg.git",
@@ -33021,7 +33023,9 @@ var CacheEntry = class _CacheEntry {
33021
33023
  * Note that this will *usually* not be true if the value is coming out of
33022
33024
  * the cache, because cache entries not exploded into the global store are
33023
33025
  * un-gzipped in place. It should _only_ be called for artifacts that come
33024
- * from an actual http response.
33026
+ * from an actual http response, whatever its encoding: an identity body
33027
+ * is hashed as it came, a gzipped one before anything un-gzips it in
33028
+ * memory.
33025
33029
  *
33026
33030
  * Returns true if anything was actually verified.
33027
33031
  */
@@ -33061,11 +33065,26 @@ var CacheEntry = class _CacheEntry {
33061
33065
  }
33062
33066
  return computed;
33063
33067
  }
33068
+ #hash(body = this._body) {
33069
+ const hash2 = createHash2("sha512");
33070
+ hash2.update(body);
33071
+ return `sha512-${hash2.digest("base64")}`;
33072
+ }
33073
+ /**
33074
+ * The hash of the body un-gzipped, or of the body itself if it is not
33075
+ * gzipped, without un-gzipping the entry. Bounded like {@link unzip},
33076
+ * and throws like it on a body that will not un-gzip.
33077
+ *
33078
+ * Never the hash to record for an artifact, which is the hash of its
33079
+ * bytes as served. It pins the same content, though, and is what a
33080
+ * body hashed after something un-gzipped it was pinned with.
33081
+ */
33082
+ unzippedIntegrity() {
33083
+ return this.#hash(this.isGzip ? this.#gunzip() : this._body);
33084
+ }
33064
33085
  get integrityActual() {
33065
33086
  if (this.#integrityActual) return this.#integrityActual;
33066
- const hash2 = createHash2("sha512");
33067
- hash2.update(this._body);
33068
- const i2 = `sha512-${hash2.digest("base64")}`;
33087
+ const i2 = this.#hash();
33069
33088
  this.integrityActual = i2;
33070
33089
  return i2;
33071
33090
  }
@@ -33153,13 +33172,40 @@ var CacheEntry = class _CacheEntry {
33153
33172
  const ct2 = this.getHeaderString("content-type");
33154
33173
  if (ct2) return this.#isJSON = /\bjson\b/.test(ct2);
33155
33174
  if (!this._body.length) return false;
33175
+ const wire = !this.#fromCache && !this.#integrityActual && this.isGzip ? this.#hash() : void 0;
33156
33176
  this.unzip();
33157
33177
  const buf = this._body;
33158
33178
  if (!buf.length) return false;
33159
33179
  this.#isJSON = buf[0] === 123;
33160
33180
  if (this.#isJSON) this.setHeader("content-type", "text/json");
33181
+ else if (wire) this.integrityActual = wire;
33161
33182
  return this.#isJSON;
33162
33183
  }
33184
+ /**
33185
+ * Label a 200 network body that is not json and came with no
33186
+ * content-type `application/octet-stream`, the way the json sniff
33187
+ * labels json `text/json`.
33188
+ *
33189
+ * The label says the hash the entry is stored under is the hash of
33190
+ * its bytes as served, checked or recorded by
33191
+ * `RegistryClient.request()`. So it is applied only where that is
33192
+ * known, right before such an entry is stored, and never by the
33193
+ * sniff: an entry with no content-type read back from the cache is
33194
+ * not known to be one.
33195
+ *
33196
+ * A decoded entry, an error body, an empty body, json, and a body
33197
+ * served with a content-type are left as they are. Not an error body
33198
+ * or an empty one: a content-type that is not json makes an entry
33199
+ * immutable (see {@link valid}), which neither was when served with
33200
+ * none, and no artifact is empty. The length is checked after the
33201
+ * sniff, which un-gzips a body with no content-type.
33202
+ */
33203
+ labelArtifact() {
33204
+ if (this.#fromCache || this.#statusCode !== 200 || this.isJSON || this.getHeaderString("content-type") || !this.#bodyLength) {
33205
+ return;
33206
+ }
33207
+ this.setHeader("content-type", "application/octet-stream");
33208
+ }
33163
33209
  #isGzip;
33164
33210
  get isGzip() {
33165
33211
  if (this.#isGzip !== void 0) return this.#isGzip;
@@ -33176,6 +33222,24 @@ var CacheEntry = class _CacheEntry {
33176
33222
  }
33177
33223
  return this.#isGzip;
33178
33224
  }
33225
+ // the body un-gzipped, for a body known to be gzipped
33226
+ #gunzip() {
33227
+ if (this._body.length === 0)
33228
+ throw error("Invalid buffer, cant unzip");
33229
+ const max = Math.min(
33230
+ maxUnpackedBytes,
33231
+ this._body.length * MAX_DECOMPRESSION_RATIO
33232
+ );
33233
+ try {
33234
+ return gunzipSync(this._body, { maxOutputLength: max });
33235
+ } catch (er) {
33236
+ throw er.code === "ERR_BUFFER_TOO_LARGE" ? error("cache entry exceeds maximum unpacked size", {
33237
+ found: this._body.length,
33238
+ max,
33239
+ cause: er
33240
+ }) : er;
33241
+ }
33242
+ }
33179
33243
  /**
33180
33244
  * Un-gzip encode the body.
33181
33245
  * Returns true if it was previously gzip (so something was done), otherwise
@@ -33183,22 +33247,7 @@ var CacheEntry = class _CacheEntry {
33183
33247
  */
33184
33248
  unzip() {
33185
33249
  if (this.isGzip) {
33186
- if (this._body.length === 0)
33187
- throw error("Invalid buffer, cant unzip");
33188
- const max = Math.min(
33189
- maxUnpackedBytes,
33190
- this._body.length * MAX_DECOMPRESSION_RATIO
33191
- );
33192
- let b;
33193
- try {
33194
- b = gunzipSync(this._body, { maxOutputLength: max });
33195
- } catch (er) {
33196
- throw er.code === "ERR_BUFFER_TOO_LARGE" ? error("cache entry exceeds maximum unpacked size", {
33197
- found: this._body.length,
33198
- max,
33199
- cause: er
33200
- }) : er;
33201
- }
33250
+ const b = this.#gunzip();
33202
33251
  this.setHeader("content-encoding", "identity");
33203
33252
  const u8 = new Uint8Array(b.buffer, b.byteOffset, b.byteLength);
33204
33253
  this.#body = u8;
@@ -34208,6 +34257,65 @@ var RegistryClient = class {
34208
34257
  integrity
34209
34258
  );
34210
34259
  }
34260
+ /**
34261
+ * Make a request and hand back the response body as it arrives, instead of
34262
+ * buffering it into a {@link CacheEntry}. For a body a caller acts on line
34263
+ * by line — the NDJSON the batch endpoints stream — waiting for the last
34264
+ * byte is the difference between using the first record now and using it
34265
+ * once the server has finished computing the last one.
34266
+ *
34267
+ * The body is gunzipped here when the registry compressed it, so a caller
34268
+ * always reads what the server serialized. Nothing is cached and nothing is
34269
+ * retried: a caller that loses the stream falls back to the requests it was
34270
+ * avoiding.
34271
+ */
34272
+ async requestStream(url, options = {}) {
34273
+ const u2 = typeof url === "string" ? new URL(url) : url;
34274
+ const o = {
34275
+ ...options,
34276
+ method: options.method ?? "GET",
34277
+ path: u2.pathname.replace(/\/+$/, "") + u2.search,
34278
+ origin: u2.origin,
34279
+ headers: addHeader(
34280
+ addHeader(
34281
+ addHeader(
34282
+ options.headers,
34283
+ "accept-encoding",
34284
+ "gzip;q=1.0, identity;q=0.5"
34285
+ ),
34286
+ "user-agent",
34287
+ userAgent
34288
+ ),
34289
+ "npm-session",
34290
+ this.#session
34291
+ )
34292
+ };
34293
+ o.headers = addHeader(
34294
+ o.headers,
34295
+ "authorization",
34296
+ await getTokenByURL(String(u2), this.identity)
34297
+ );
34298
+ logRequest(url, "start", { method: o.method });
34299
+ const requestStart = Date.now();
34300
+ const response = await this.agent.request(
34301
+ o
34302
+ );
34303
+ logRequest(url, "complete", {
34304
+ method: o.method,
34305
+ statusCode: response.statusCode,
34306
+ durationMs: Date.now() - requestStart
34307
+ });
34308
+ const encoding = response.headers["content-encoding"];
34309
+ const gzipped = typeof encoding === "string" && /\bgzip\b/.test(encoding);
34310
+ let body = response.body;
34311
+ if (gzipped) {
34312
+ const gunzip = createGunzip();
34313
+ pipeline(response.body, gunzip, () => {
34314
+ });
34315
+ body = gunzip;
34316
+ }
34317
+ return { statusCode: response.statusCode, body };
34318
+ }
34211
34319
  async request(url, options = {}) {
34212
34320
  const u2 = typeof url === "string" ? new URL(url) : url;
34213
34321
  const {
@@ -34221,10 +34329,10 @@ var RegistryClient = class {
34221
34329
  } = options;
34222
34330
  const { trustIntegrity, verifyDigest } = options;
34223
34331
  const m2 = isCacheableMethod(method) ? method : void 0;
34224
- const { useCache = !!m2 } = options;
34332
+ const { useCache = !!m2, readCache = true } = options;
34225
34333
  signal?.throwIfAborted();
34226
34334
  const key = cacheKey(method, u2);
34227
- const buffer = useCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
34335
+ const buffer = useCache && readCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
34228
34336
  const entry = buffer ? this.#decodeCached(buffer) : void 0;
34229
34337
  if (entry?.valid && forceRevalidate !== true) {
34230
34338
  if (forceRevalidate === "background" && m2) {
@@ -34319,16 +34427,17 @@ var RegistryClient = class {
34319
34427
  durationMs: Date.now() - requestStart
34320
34428
  }
34321
34429
  );
34322
- if (!trustIntegrity && !result.fromCache) {
34323
- result.deleteHeader("integrity");
34324
- if (result.statusCode === 200) result.checkIntegrity({ url });
34430
+ if (!trustIntegrity && !result.fromCache && result.statusCode === 200) {
34431
+ result.checkIntegrity({ url });
34325
34432
  }
34326
34433
  if (verifyDigest && !integrity && !result.fromCache && result.statusCode === 200) {
34327
34434
  result.checkDigest(verifyDigest === "required", { url });
34328
34435
  }
34329
34436
  const clobbersCachedEntry = forceRevalidate && !!entry && result.statusCode !== 200;
34330
34437
  if (useCache && !clobbersCachedEntry) {
34331
- const integrity2 = result.integrity ?? (result.statusCode === 200 && !result.isJSON ? result.integrityActual : void 0);
34438
+ const artifact = !result.fromCache && result.statusCode === 200 && !result.isJSON;
34439
+ const integrity2 = result.integrity ?? (artifact ? result.integrityActual : void 0);
34440
+ if (artifact) result.labelArtifact();
34332
34441
  const encoded = result.encode();
34333
34442
  const stored = Buffer.from(
34334
34443
  encoded.buffer,
@@ -34370,6 +34479,7 @@ var RegistryClient = class {
34370
34479
  contentLength
34371
34480
  }
34372
34481
  );
34482
+ if (!trustIntegrity) result.deleteHeader("integrity");
34373
34483
  if (isRedirect(result)) {
34374
34484
  response.body.resume();
34375
34485
  const [nextURL, nextOptions] = redirect(options, result, url);
@@ -14,41 +14,41 @@ import {
14
14
  } from "./chunk-CLVRCGOZ.js";
15
15
  import {
16
16
  openUrl
17
- } from "./chunk-MC6CESRA.js";
17
+ } from "./chunk-AFUXQ3P4.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-LY5FNWRY.js";
21
- import "./chunk-CSZTT7QN.js";
22
- import "./chunk-CU752KW7.js";
20
+ } from "./chunk-B2CTWVQM.js";
21
+ import "./chunk-TOKUDCSW.js";
22
+ import "./chunk-BCANUHR3.js";
23
23
  import "./chunk-G2YT2GWF.js";
24
24
  import "./chunk-CRGWLUGC.js";
25
25
  import {
26
26
  PackageInfoClient
27
- } from "./chunk-MOL2DUEQ.js";
28
- import "./chunk-ZWKI5OSF.js";
27
+ } from "./chunk-7DHDJ5XY.js";
28
+ import "./chunk-SRWDPPLX.js";
29
29
  import "./chunk-WGDTG44V.js";
30
30
  import "./chunk-J4NHRZX6.js";
31
31
  import {
32
32
  Query,
33
33
  actual
34
- } from "./chunk-ZRRNOLEG.js";
34
+ } from "./chunk-ZZFFMXI2.js";
35
35
  import {
36
36
  SecurityArchive
37
- } from "./chunk-DCFLXO2M.js";
37
+ } from "./chunk-XUGOPOLF.js";
38
38
  import {
39
39
  commandUsage
40
- } from "./chunk-I6QGYSB4.js";
41
- import "./chunk-BUKZHMMK.js";
40
+ } from "./chunk-LHIDMYN2.js";
41
+ import "./chunk-INEKXXUQ.js";
42
42
  import "./chunk-4KCU2KZL.js";
43
43
  import "./chunk-JIQBZ2UT.js";
44
44
  import {
45
45
  Spec
46
46
  } from "./chunk-64VFL4WI.js";
47
- import "./chunk-ENSGPOLR.js";
47
+ import "./chunk-XU5WNX4S.js";
48
48
  import "./chunk-HTOTG4TS.js";
49
49
  import "./chunk-APMYKJI2.js";
50
50
  import "./chunk-PBBULTAG.js";
51
- import "./chunk-YU2W5UPG.js";
51
+ import "./chunk-ADDCQBGR.js";
52
52
  import "./chunk-U7TEQCBN.js";
53
53
  import "./chunk-XNLSTHDK.js";
54
54
  import "./chunk-PDWPFR5T.js";
@@ -11,24 +11,24 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  persistedEntries
14
- } from "./chunk-ROCFQPP2.js";
14
+ } from "./chunk-75F2WCA5.js";
15
15
  import {
16
16
  require_emoji_regex
17
17
  } from "./chunk-VTEFO2FT.js";
18
- import "./chunk-GZWJAGBL.js";
19
- import "./chunk-MOL2DUEQ.js";
20
- import "./chunk-ZWKI5OSF.js";
18
+ import "./chunk-35OBZITS.js";
19
+ import "./chunk-7DHDJ5XY.js";
20
+ import "./chunk-SRWDPPLX.js";
21
21
  import {
22
22
  source_default
23
23
  } from "./chunk-WGDTG44V.js";
24
24
  import "./chunk-J4NHRZX6.js";
25
- import "./chunk-BUKZHMMK.js";
25
+ import "./chunk-INEKXXUQ.js";
26
26
  import {
27
27
  ViewClass
28
28
  } from "./chunk-4KCU2KZL.js";
29
29
  import "./chunk-JIQBZ2UT.js";
30
30
  import "./chunk-64VFL4WI.js";
31
- import "./chunk-ENSGPOLR.js";
31
+ import "./chunk-XU5WNX4S.js";
32
32
  import "./chunk-HTOTG4TS.js";
33
33
  import "./chunk-PBBULTAG.js";
34
34
  import {