vlt 1.6.0 → 1.6.2

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 (89) hide show
  1. package/{access-AJ654YKY.js → access-LNHKSCBO.js} +5 -5
  2. package/{bugs-N73DVYHD.js → bugs-PSOZGCKG.js} +15 -14
  3. package/{build-VZ3EZKMM.js → build-GBIF54BN.js} +11 -11
  4. package/{cache-VROEWG2C.js → cache-XOYAGCIO.js} +10 -8
  5. package/cache-unzip-src-unzip.js +190 -3
  6. package/chunk-24DWRCPS.js +79 -0
  7. package/chunk-2CFNQ4QB.js +77 -0
  8. package/{chunk-LP3ORD3D.js → chunk-3RYVF2GG.js} +2 -2
  9. package/{chunk-LCLRP64K.js → chunk-3UDBYFAH.js} +104 -16
  10. package/{chunk-36UIE654.js → chunk-6BD4RCTR.js} +46 -16
  11. package/{chunk-Y5PA7DVK.js → chunk-6ETYWCJN.js} +197 -1
  12. package/{chunk-TQQO2F56.js → chunk-6ISFYONV.js} +3 -2
  13. package/{chunk-FXD3IV2S.js → chunk-AQJR7QDA.js} +1 -1
  14. package/{chunk-VLVMLSIF.js → chunk-BGOXKLQ6.js} +27 -27
  15. package/{chunk-KVWGMSPW.js → chunk-C75GDQFE.js} +18 -3
  16. package/{chunk-TWDSXQPN.js → chunk-FRX5IFFY.js} +4 -4
  17. package/{chunk-DBANBIL2.js → chunk-FZCPQWCJ.js} +1 -0
  18. package/{chunk-EMTGRCSE.js → chunk-GJMDZJPJ.js} +1 -1
  19. package/{chunk-GEQFMH5M.js → chunk-HHSPE2DS.js} +1 -1
  20. package/{chunk-YTDABXPD.js → chunk-JASG7RHB.js} +2 -2
  21. package/{chunk-JCNI6ZHH.js → chunk-JNPVOACH.js} +4 -4
  22. package/{chunk-ANW36H4T.js → chunk-JYYIWXJX.js} +1 -1
  23. package/{chunk-22LZBDEC.js → chunk-L65CG5LE.js} +1 -1
  24. package/{chunk-PDWPFR5T.js → chunk-LEMHGORE.js} +1 -1
  25. package/{chunk-JV5XR5JQ.js → chunk-MCQTGFJY.js} +1 -1
  26. package/{chunk-O6MQ7NN6.js → chunk-N4SU52H5.js} +1 -1
  27. package/{chunk-44AWMA4F.js → chunk-NB7QVWHU.js} +84 -16
  28. package/{chunk-N6HV7JWC.js → chunk-QFPAFVRR.js} +39 -67
  29. package/{chunk-DXED4ARV.js → chunk-QGLGNPCQ.js} +2 -2
  30. package/{chunk-PC2HOBAQ.js → chunk-QGUQZURY.js} +9 -4
  31. package/{chunk-RBQO54TG.js → chunk-TGPL6YRK.js} +2 -2
  32. package/{chunk-F5LZMLAQ.js → chunk-TQBSL35R.js} +19 -12
  33. package/{chunk-IXAMCWIT.js → chunk-XWA55GAN.js} +3 -3
  34. package/{chunk-GZVI75KX.js → chunk-XWVEIWTT.js} +1 -1
  35. package/{chunk-75HGJVNG.js → chunk-Y53EROVE.js} +5 -5
  36. package/{chunk-CYK6I4M6.js → chunk-Z63CXYQF.js} +1 -1
  37. package/{chunk-B6RIGNEO.js → chunk-ZESNN24A.js} +11 -1
  38. package/{ci-3BVMVQIT.js → ci-XSH7DZGD.js} +13 -13
  39. package/cli-package.json +1 -1
  40. package/{config-2KQV7N5A.js → config-6XFBWC3U.js} +8 -7
  41. package/{config-EKHBW6I5.js → config-C73FLGQV.js} +7 -6
  42. package/{create-QVHNOIV3.js → create-UNCQKKBS.js} +16 -15
  43. package/{deprecate-E254QBH6.js → deprecate-HCVFAVZD.js} +9 -8
  44. package/{dist-tag-SITRFD7O.js → dist-tag-WXLJRWFJ.js} +5 -5
  45. package/{docs-IDL2P7CA.js → docs-5EFY7ZHN.js} +15 -14
  46. package/{exec-7BK2W2WL.js → exec-EC5D5GE3.js} +16 -15
  47. package/{exec-cache-VY46L7DR.js → exec-cache-EMUFVFCJ.js} +14 -13
  48. package/{exec-local-D7R5T3DF.js → exec-local-L5H4M37T.js} +13 -13
  49. package/{help-RMRIEJQL.js → help-FUHVZ6UH.js} +1 -1
  50. package/{init-BGW4HJ6V.js → init-63M6W7N4.js} +11 -11
  51. package/{install-U5GATZ2N.js → install-IHQRULIE.js} +20 -19
  52. package/{list-3VG4M2XL.js → list-EDXNWJJR.js} +16 -16
  53. package/{login-PHQWI6S6.js → login-OD7E5AO5.js} +10 -9
  54. package/{logout-DJCOGRFF.js → logout-V2WJTQV2.js} +5 -5
  55. package/{outdated-JH3O6R3Y.js → outdated-7N7NGSSR.js} +15 -14
  56. package/{pack-U5W5YWHK.js → pack-TKJW7AEB.js} +12 -12
  57. package/package.json +1 -1
  58. package/{ping-EKX43AOW.js → ping-PVWRNSCX.js} +5 -5
  59. package/{pkg-SW5GMERT.js → pkg-PDP4XR5S.js} +13 -13
  60. package/{profile-UGDRDMQ6.js → profile-BP5EALWS.js} +5 -5
  61. package/{publish-HTWKK3NN.js → publish-HCICK5LY.js} +14 -14
  62. package/{query-YE3FUVGG.js → query-TZ3BPC4B.js} +16 -16
  63. package/registry-client-src-revalidate.js +304 -44
  64. package/{repo-WDOCU6SE.js → repo-BYOSXG5J.js} +15 -14
  65. package/{reporter-N5PAXB26.js → reporter-S6DDAHQL.js} +12 -11
  66. package/{run-IPARVIIQ.js → run-JAVVTY7B.js} +13 -13
  67. package/{run-exec-C4RTREEW.js → run-exec-GGENQDEW.js} +13 -13
  68. package/security-archive-src-update-expired.js +1 -1
  69. package/{setup-SYYUEHZL.js → setup-I6GLYILV.js} +13 -12
  70. package/{skills-UBBMSBDQ.js → skills-5V6HKMA7.js} +14 -13
  71. package/{skills-KA2VR5Q5.js → skills-QOFA6XMM.js} +6 -6
  72. package/{src-FUSTSM4J.js → src-74IKO7PC.js} +12 -8
  73. package/src-GY57R4DK.js +659 -0
  74. package/{src-QO5G2S4O.js → src-REZNPR2X.js} +5 -5
  75. package/tar-src-placement-worker.js +6426 -0
  76. package/{token-UQNABECH.js → token-JEAMCRK6.js} +5 -5
  77. package/{uninstall-FHBJ3OUV.js → uninstall-WA4FJFVA.js} +14 -14
  78. package/{unpublish-APJTEUBA.js → unpublish-SG3J524L.js} +5 -5
  79. package/{update-NWZTL4S7.js → update-Y3KY2DZD.js} +15 -14
  80. package/{version-EMKKTL77.js → version-QBEPMA7Q.js} +11 -11
  81. package/{view-BUUI33RV.js → view-FYRF3SLJ.js} +9 -8
  82. package/vlr.js +1 -1
  83. package/vlrx.js +1 -1
  84. package/vlt.js +1 -1
  85. package/vlx.js +1 -1
  86. package/vlxl.js +1 -1
  87. package/{whoami-F6BSXGQ2.js → whoami-XSQ6SOIC.js} +5 -5
  88. package/chunk-4E65BBTM.js +0 -77
  89. package/src-W2VQULRG.js +0 -285
@@ -1056,7 +1056,7 @@ var require_util = __commonJS({
1056
1056
  yield* this[kBody];
1057
1057
  }
1058
1058
  };
1059
- function noop() {
1059
+ function noop2() {
1060
1060
  }
1061
1061
  function wrapRequestBody(body) {
1062
1062
  if (isStream(body)) {
@@ -1722,7 +1722,7 @@ var require_util = __commonJS({
1722
1722
  }
1723
1723
  var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => {
1724
1724
  if (!opts.timeout) {
1725
- return noop;
1725
+ return noop2;
1726
1726
  }
1727
1727
  let s1 = null;
1728
1728
  let s2 = null;
@@ -1738,7 +1738,7 @@ var require_util = __commonJS({
1738
1738
  };
1739
1739
  } : (socketWeakRef, opts) => {
1740
1740
  if (!opts.timeout) {
1741
- return noop;
1741
+ return noop2;
1742
1742
  }
1743
1743
  let s1 = null;
1744
1744
  const fastTimer = timers.setFastTimeout(() => {
@@ -5026,7 +5026,7 @@ var require_util2 = __commonJS({
5026
5026
  var { redirectStatusSet, referrerPolicyTokens, badPortsSet } = require_constants3();
5027
5027
  var { getGlobalOrigin } = require_global();
5028
5028
  var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
5029
- var { performance: performance2 } = __require("node:perf_hooks");
5029
+ var { performance: performance3 } = __require("node:perf_hooks");
5030
5030
  var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
5031
5031
  var assert = __require("node:assert");
5032
5032
  var { isUint8Array } = __require("node:util/types");
@@ -5181,7 +5181,7 @@ var require_util2 = __commonJS({
5181
5181
  };
5182
5182
  }
5183
5183
  function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) {
5184
- return coarsenTime(performance2.now(), crossOriginIsolatedCapability);
5184
+ return coarsenTime(performance3.now(), crossOriginIsolatedCapability);
5185
5185
  }
5186
5186
  function createOpaqueTimingInfo(timingInfo) {
5187
5187
  return {
@@ -6319,12 +6319,12 @@ var require_body = __commonJS({
6319
6319
  var { runtimeFeatures } = require_runtime_features();
6320
6320
  var random = runtimeFeatures.has("crypto") ? __require("node:crypto").randomInt : (max) => Math.floor(Math.random() * max);
6321
6321
  var textEncoder = new TextEncoder();
6322
- function noop() {
6322
+ function noop2() {
6323
6323
  }
6324
6324
  var streamRegistry = new FinalizationRegistry((weakRef) => {
6325
6325
  const stream = weakRef.deref();
6326
6326
  if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
6327
- stream.cancel("Response object has been garbage collected").catch(noop);
6327
+ stream.cancel("Response object has been garbage collected").catch(noop2);
6328
6328
  }
6329
6329
  });
6330
6330
  function extractBody(object, keepalive = false) {
@@ -8641,7 +8641,7 @@ var require_client = __commonJS({
8641
8641
  var getDefaultNodeMaxHeaderSize = http && http.maxHeaderSize && Number.isInteger(http.maxHeaderSize) && http.maxHeaderSize > 0 ? () => http.maxHeaderSize : () => {
8642
8642
  throw new InvalidArgumentError("http module not available or http.maxHeaderSize invalid");
8643
8643
  };
8644
- var noop = () => {
8644
+ var noop2 = () => {
8645
8645
  };
8646
8646
  function getPipelining(client) {
8647
8647
  return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1;
@@ -8943,7 +8943,7 @@ var require_client = __commonJS({
8943
8943
  return;
8944
8944
  }
8945
8945
  if (client.destroyed) {
8946
- util.destroy(socket.on("error", noop), new ClientDestroyedError());
8946
+ util.destroy(socket.on("error", noop2), new ClientDestroyedError());
8947
8947
  client[kResume]();
8948
8948
  return;
8949
8949
  }
@@ -8951,7 +8951,7 @@ var require_client = __commonJS({
8951
8951
  try {
8952
8952
  client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
8953
8953
  } catch (err2) {
8954
- socket.destroy().on("error", noop);
8954
+ socket.destroy().on("error", noop2);
8955
8955
  handleConnectError(client, err2, { host, hostname, protocol, port });
8956
8956
  client[kResume]();
8957
8957
  return;
@@ -10571,7 +10571,7 @@ var require_proxy_agent = __commonJS({
10571
10571
  function defaultFactory(origin, opts) {
10572
10572
  return new Pool(origin, opts);
10573
10573
  }
10574
- var noop = () => {
10574
+ var noop2 = () => {
10575
10575
  };
10576
10576
  function defaultAgentFactory(origin, opts) {
10577
10577
  if (opts.connections === 1) {
@@ -10708,7 +10708,7 @@ var require_proxy_agent = __commonJS({
10708
10708
  };
10709
10709
  const { socket, statusCode } = await this[kClient].connect(connectParams);
10710
10710
  if (statusCode !== 200) {
10711
- socket.on("error", noop).destroy();
10711
+ socket.on("error", noop2).destroy();
10712
10712
  callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`));
10713
10713
  return;
10714
10714
  }
@@ -11348,7 +11348,7 @@ var require_readable = __commonJS({
11348
11348
  var kContentLength = /* @__PURE__ */ Symbol("kContentLength");
11349
11349
  var kUsed = /* @__PURE__ */ Symbol("kUsed");
11350
11350
  var kBytesRead = /* @__PURE__ */ Symbol("kBytesRead");
11351
- var noop = () => {
11351
+ var noop2 = () => {
11352
11352
  };
11353
11353
  var BodyReadable = class extends Readable {
11354
11354
  /**
@@ -11573,7 +11573,7 @@ var require_readable = __commonJS({
11573
11573
  } else {
11574
11574
  this.on("close", resolve11);
11575
11575
  }
11576
- this.on("error", noop).on("data", () => {
11576
+ this.on("error", noop2).on("data", () => {
11577
11577
  if (this[kBytesRead] > limit) {
11578
11578
  this.destroy();
11579
11579
  }
@@ -11742,7 +11742,7 @@ var require_api_request = __commonJS({
11742
11742
  var { Readable } = require_readable();
11743
11743
  var { InvalidArgumentError, RequestAbortedError } = require_errors();
11744
11744
  var util = require_util();
11745
- function noop() {
11745
+ function noop2() {
11746
11746
  }
11747
11747
  var RequestHandler = class extends AsyncResource {
11748
11748
  constructor(opts, callback) {
@@ -11769,7 +11769,7 @@ var require_api_request = __commonJS({
11769
11769
  super("UNDICI_REQUEST");
11770
11770
  } catch (err) {
11771
11771
  if (util.isStream(body)) {
11772
- util.destroy(body.on("error", noop), err);
11772
+ util.destroy(body.on("error", noop2), err);
11773
11773
  }
11774
11774
  throw err;
11775
11775
  }
@@ -11792,7 +11792,7 @@ var require_api_request = __commonJS({
11792
11792
  this.removeAbortListener = util.addAbortListener(signal, () => {
11793
11793
  this.reason = signal.reason ?? new RequestAbortedError();
11794
11794
  if (this.res) {
11795
- util.destroy(this.res.on("error", noop), this.reason);
11795
+ util.destroy(this.res.on("error", noop2), this.reason);
11796
11796
  } else if (this.abort) {
11797
11797
  this.abort(this.reason);
11798
11798
  }
@@ -11846,7 +11846,7 @@ var require_api_request = __commonJS({
11846
11846
  });
11847
11847
  } catch (err) {
11848
11848
  this.res = null;
11849
- util.destroy(res.on("error", noop), err);
11849
+ util.destroy(res.on("error", noop2), err);
11850
11850
  queueMicrotask(() => {
11851
11851
  throw err;
11852
11852
  });
@@ -11871,13 +11871,13 @@ var require_api_request = __commonJS({
11871
11871
  if (res) {
11872
11872
  this.res = null;
11873
11873
  queueMicrotask(() => {
11874
- util.destroy(res.on("error", noop), err);
11874
+ util.destroy(res.on("error", noop2), err);
11875
11875
  });
11876
11876
  }
11877
11877
  if (body) {
11878
11878
  this.body = null;
11879
11879
  if (util.isStream(body)) {
11880
- body.on("error", noop);
11880
+ body.on("error", noop2);
11881
11881
  util.destroy(body, err);
11882
11882
  }
11883
11883
  }
@@ -11973,7 +11973,7 @@ var require_api_stream = __commonJS({
11973
11973
  var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
11974
11974
  var util = require_util();
11975
11975
  var { addSignal, removeSignal } = require_abort_signal();
11976
- function noop() {
11976
+ function noop2() {
11977
11977
  }
11978
11978
  var StreamHandler = class extends AsyncResource {
11979
11979
  constructor(opts, factory, callback) {
@@ -12000,7 +12000,7 @@ var require_api_stream = __commonJS({
12000
12000
  super("UNDICI_STREAM");
12001
12001
  } catch (err) {
12002
12002
  if (util.isStream(body)) {
12003
- util.destroy(body.on("error", noop), err);
12003
+ util.destroy(body.on("error", noop2), err);
12004
12004
  }
12005
12005
  throw err;
12006
12006
  }
@@ -12142,7 +12142,7 @@ var require_api_pipeline = __commonJS({
12142
12142
  } = require_errors();
12143
12143
  var util = require_util();
12144
12144
  var { addSignal, removeSignal } = require_abort_signal();
12145
- function noop() {
12145
+ function noop2() {
12146
12146
  }
12147
12147
  var kResume = /* @__PURE__ */ Symbol("resume");
12148
12148
  var PipelineRequest = class extends Readable {
@@ -12202,7 +12202,7 @@ var require_api_pipeline = __commonJS({
12202
12202
  this.abort = null;
12203
12203
  this.context = null;
12204
12204
  this.onInfo = onInfo || null;
12205
- this.req = new PipelineRequest().on("error", noop);
12205
+ this.req = new PipelineRequest().on("error", noop2);
12206
12206
  this.ret = new Duplex({
12207
12207
  readableObjectMode: opts.objectMode,
12208
12208
  autoDestroy: true,
@@ -12273,7 +12273,7 @@ var require_api_pipeline = __commonJS({
12273
12273
  context
12274
12274
  });
12275
12275
  } catch (err) {
12276
- this.res.on("error", noop);
12276
+ this.res.on("error", noop2);
12277
12277
  throw err;
12278
12278
  }
12279
12279
  if (!body || typeof body.on !== "function") {
@@ -14543,7 +14543,7 @@ var require_redirect_handler = __commonJS({
14543
14543
  var EE = __require("node:events");
14544
14544
  var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
14545
14545
  var kBody = /* @__PURE__ */ Symbol("body");
14546
- var noop = () => {
14546
+ var noop2 = () => {
14547
14547
  };
14548
14548
  var BodyAsyncIterable = class {
14549
14549
  constructor(body) {
@@ -14606,14 +14606,14 @@ var require_redirect_handler = __commonJS({
14606
14606
  if ((statusCode === 301 || statusCode === 302) && this.opts.method === "POST") {
14607
14607
  this.opts.method = "GET";
14608
14608
  if (util.isStream(this.opts.body)) {
14609
- util.destroy(this.opts.body.on("error", noop));
14609
+ util.destroy(this.opts.body.on("error", noop2));
14610
14610
  }
14611
14611
  this.opts.body = null;
14612
14612
  }
14613
14613
  if (statusCode === 303 && this.opts.method !== "HEAD") {
14614
14614
  this.opts.method = "GET";
14615
14615
  if (util.isStream(this.opts.body)) {
14616
- util.destroy(this.opts.body.on("error", noop));
14616
+ util.destroy(this.opts.body.on("error", noop2));
14617
14617
  }
14618
14618
  this.opts.body = null;
14619
14619
  }
@@ -16344,7 +16344,7 @@ var require_cache_handler = __commonJS({
16344
16344
  isEtagUsable
16345
16345
  } = require_cache();
16346
16346
  var { parseHttpDate } = require_date();
16347
- function noop() {
16347
+ function noop2() {
16348
16348
  }
16349
16349
  var HEURISTICALLY_CACHEABLE_STATUS_CODES = [
16350
16350
  200,
@@ -16661,7 +16661,7 @@ var require_cache_handler = __commonJS({
16661
16661
  };
16662
16662
  function deleteCachedValue(store, cacheKey2) {
16663
16663
  try {
16664
- store.delete(cacheKey2)?.catch?.(noop);
16664
+ store.delete(cacheKey2)?.catch?.(noop2);
16665
16665
  } catch {
16666
16666
  }
16667
16667
  }
@@ -32153,6 +32153,195 @@ var handleBeforeExit = () => {
32153
32153
 
32154
32154
  // ../../src/output/src/index.ts
32155
32155
  import EventEmitter from "node:events";
32156
+
32157
+ // ../../src/output/src/trace.ts
32158
+ import { appendFileSync } from "node:fs";
32159
+ import { monitorEventLoopDelay, performance as performance2 } from "node:perf_hooks";
32160
+ import { threadId as ownThreadId } from "node:worker_threads";
32161
+ var sharedNow = () => performance2.timeOrigin + performance2.now();
32162
+ var defaultAppend = (file, data) => appendFileSync(file, data, { mode: 384 });
32163
+ var defaultWrite = (line) => process.stderr.write(line + "\n");
32164
+ var Tracer = class _Tracer {
32165
+ enabled;
32166
+ file;
32167
+ phases;
32168
+ #tid;
32169
+ #now;
32170
+ #append;
32171
+ #write;
32172
+ #flushLines;
32173
+ #flushMs;
32174
+ #buffer = [];
32175
+ #timer;
32176
+ #sampler;
32177
+ #marks = [];
32178
+ #start;
32179
+ #loop;
32180
+ #closed = false;
32181
+ constructor(options = {}) {
32182
+ this.file = options.file || void 0;
32183
+ this.phases = !!options.phases;
32184
+ this.enabled = !!this.file || this.phases;
32185
+ this.#tid = options.threadId ?? ownThreadId;
32186
+ this.#now = options.now ?? sharedNow;
32187
+ this.#append = options.append ?? defaultAppend;
32188
+ this.#write = options.write ?? defaultWrite;
32189
+ this.#flushLines = options.flushLines ?? 200;
32190
+ this.#flushMs = options.flushMs ?? 50;
32191
+ this.#start = this.#now();
32192
+ if (!this.enabled) return;
32193
+ const main2 = options.main ?? this.#tid === 0;
32194
+ if (main2) {
32195
+ this.#loop = monitorEventLoopDelay({ resolution: 20 });
32196
+ this.#loop.enable();
32197
+ const sampleMs = options.sampleMs ?? 20;
32198
+ if (this.file && sampleMs > 0) {
32199
+ this.#sampler = setInterval(() => this.sample(), sampleMs);
32200
+ this.#sampler.unref();
32201
+ }
32202
+ process.once("exit", () => this.close());
32203
+ }
32204
+ this.trace("open", { pid: process.pid });
32205
+ }
32206
+ /**
32207
+ * Build a tracer from the environment: `VLT_TRACE` names the file,
32208
+ * `VLT_PHASES` (any value but `0` or empty) asks for the summary.
32209
+ */
32210
+ static fromEnv(env = process.env, options = {}) {
32211
+ const phases = env.VLT_PHASES;
32212
+ return new _Tracer({
32213
+ ...options,
32214
+ file: env.VLT_TRACE,
32215
+ phases: !!phases && phases !== "0"
32216
+ });
32217
+ }
32218
+ /** Record one event. */
32219
+ trace(ev, fields) {
32220
+ if (!this.file || this.#closed) return;
32221
+ const event = { t: this.#now(), tid: this.#tid, ev };
32222
+ if (fields) {
32223
+ for (const [k4, v3] of Object.entries(fields)) {
32224
+ if (v3 !== void 0) event[k4] = v3;
32225
+ }
32226
+ }
32227
+ this.#buffer.push(JSON.stringify(event));
32228
+ if (this.#buffer.length >= this.#flushLines) this.flush();
32229
+ else if (!this.#timer) {
32230
+ this.#timer = setTimeout(() => this.flush(), this.#flushMs);
32231
+ this.#timer.unref();
32232
+ }
32233
+ }
32234
+ /**
32235
+ * Record a `<ev>:start` event now and return a function that records
32236
+ * `<ev>:end` with the elapsed `ms` (plus any fields it is given). The
32237
+ * same `fields` are stamped on both ends so the two can be paired.
32238
+ */
32239
+ span(ev, fields) {
32240
+ if (!this.file) return noop;
32241
+ const t0 = this.#now();
32242
+ this.trace(`${ev}:start`, fields);
32243
+ return (end) => this.trace(`${ev}:end`, {
32244
+ ...fields,
32245
+ ...end,
32246
+ ms: Math.round((this.#now() - t0) * 1e3) / 1e3
32247
+ });
32248
+ }
32249
+ /**
32250
+ * Mark the start of a phase. The summary reports the ms between each
32251
+ * mark and the next one, and the trace records a `phase` event.
32252
+ */
32253
+ mark(name, fields) {
32254
+ if (!this.enabled) return;
32255
+ this.#marks.push({ name, t: this.#now() });
32256
+ this.trace("phase", { ...fields, name });
32257
+ }
32258
+ /**
32259
+ * Record how busy a resource lane is: how many jobs it is running and
32260
+ * how many are waiting for a slot. The report derives idle time per
32261
+ * lane from these.
32262
+ */
32263
+ lane(name, busy, queued) {
32264
+ if (!this.file) return;
32265
+ this.trace("lane", { name, busy, queued });
32266
+ }
32267
+ /** Record a memory sample. */
32268
+ sample() {
32269
+ if (!this.file) return;
32270
+ const m2 = process.memoryUsage();
32271
+ this.trace("rss", {
32272
+ rss: m2.rss,
32273
+ heap: m2.heapUsed,
32274
+ ext: m2.external,
32275
+ ab: m2.arrayBuffers
32276
+ });
32277
+ }
32278
+ /** Write buffered lines to the file. */
32279
+ flush() {
32280
+ if (this.#timer) {
32281
+ clearTimeout(this.#timer);
32282
+ this.#timer = void 0;
32283
+ }
32284
+ if (!this.file || !this.#buffer.length) return;
32285
+ const data = this.#buffer.join("\n") + "\n";
32286
+ this.#buffer = [];
32287
+ try {
32288
+ this.#append(this.file, data);
32289
+ } catch {
32290
+ }
32291
+ }
32292
+ /**
32293
+ * The one-line phase summary, or undefined when phases are off. Each
32294
+ * phase is reported as the ms from its mark to the next mark (or to
32295
+ * now, for the last one).
32296
+ */
32297
+ summary() {
32298
+ if (!this.phases) return void 0;
32299
+ const now = this.#now();
32300
+ const parts = [];
32301
+ for (const [i2, m2] of this.#marks.entries()) {
32302
+ const next = this.#marks[i2 + 1]?.t ?? now;
32303
+ parts.push(`${m2.name}=${Math.round(next - m2.t)}`);
32304
+ }
32305
+ parts.push(`total=${Math.round(now - this.#start)}`);
32306
+ if (this.#loop) {
32307
+ const ms2 = (n7) => Math.round(n7 / 1e6);
32308
+ parts.push(
32309
+ `loop p50=${ms2(this.#loop.percentile(50))} p99=${ms2(this.#loop.percentile(99))} max=${ms2(this.#loop.max)}`
32310
+ );
32311
+ }
32312
+ const { maxRSS } = process.resourceUsage();
32313
+ parts.push(`maxrss=${Math.round(maxRSS / 1024)}MB`);
32314
+ return `PHASES ${parts.join(" ")}`;
32315
+ }
32316
+ /**
32317
+ * Stop sampling, flush, and print the summary. Runs at process exit
32318
+ * on the main thread; safe to call more than once.
32319
+ */
32320
+ close() {
32321
+ if (this.#closed) return;
32322
+ if (this.#sampler) clearInterval(this.#sampler);
32323
+ if (this.enabled) {
32324
+ if (this.#loop) {
32325
+ this.#loop.disable();
32326
+ this.trace("exit", {
32327
+ loopP50: Math.round(this.#loop.percentile(50) / 1e6),
32328
+ loopP99: Math.round(this.#loop.percentile(99) / 1e6),
32329
+ loopMax: Math.round(this.#loop.max / 1e6),
32330
+ maxrss: process.resourceUsage().maxRSS
32331
+ });
32332
+ }
32333
+ const line = this.summary();
32334
+ this.flush();
32335
+ if (line) this.#write(line);
32336
+ }
32337
+ this.#closed = true;
32338
+ }
32339
+ };
32340
+ var noop = () => {
32341
+ };
32342
+ var tracer = Tracer.fromEnv();
32343
+
32344
+ // ../../src/output/src/index.ts
32156
32345
  var OutputEmitter = class {
32157
32346
  emitter = new EventEmitter();
32158
32347
  emit(eventName, payload) {
@@ -32168,6 +32357,9 @@ var OutputEmitter = class {
32168
32357
  var emitter = new OutputEmitter();
32169
32358
  var logRequest = (url, state, details = {}) => {
32170
32359
  emitter.emit("request", { url, state, ...details });
32360
+ if (tracer.file) {
32361
+ tracer.trace("request", { ...details, url: String(url), state });
32362
+ }
32171
32363
  };
32172
32364
 
32173
32365
  // ../../src/promise-spawn/src/index.ts
@@ -32520,7 +32712,13 @@ var XDG = class {
32520
32712
  // ../../src/registry-client/src/index.ts
32521
32713
  var import_undici3 = __toESM(require_undici(), 1);
32522
32714
  import { randomUUID } from "node:crypto";
32523
- import { closeSync, openSync, readFileSync as readFileSync2, readSync } from "node:fs";
32715
+ import {
32716
+ closeSync,
32717
+ fstatSync,
32718
+ openSync,
32719
+ readFileSync as readFileSync2,
32720
+ readSync
32721
+ } from "node:fs";
32524
32722
  import { availableParallelism } from "node:os";
32525
32723
  import { dirname as dirname3, resolve as resolve10 } from "node:path";
32526
32724
  import { setMaxListeners } from "node:events";
@@ -32532,7 +32730,7 @@ import { createGunzip } from "node:zlib";
32532
32730
  var package_default = {
32533
32731
  name: "@vltpkg/user-agent",
32534
32732
  description: "The User-Agent string that vlt sends with every outbound request",
32535
- version: "1.6.0",
32733
+ version: "1.6.2",
32536
32734
  repository: {
32537
32735
  type: "git",
32538
32736
  url: "git+https://github.com/vltpkg/vltpkg.git",
@@ -34344,18 +34542,9 @@ var RegistryClient = class {
34344
34542
  cachedBody(url, options = {}) {
34345
34543
  const { integrity, method = "GET" } = options;
34346
34544
  try {
34347
- const key = cacheKey(
34348
- method,
34349
- typeof url === "string" ? new URL(url) : url
34350
- );
34351
- if (this.cache.peek(key)) return void 0;
34352
- const paths = /* @__PURE__ */ new Set();
34353
- try {
34354
- const i2 = this.cache.integrityPath(integrity);
34355
- if (i2) paths.add(i2);
34356
- } catch {
34357
- }
34358
- if (!integrity) paths.add(this.cache.path(key));
34545
+ const found = this.#cachedPaths(url, method, integrity);
34546
+ if (!found) return void 0;
34547
+ const { key, paths } = found;
34359
34548
  for (const path2 of paths) {
34360
34549
  let buf;
34361
34550
  try {
@@ -34379,6 +34568,77 @@ var RegistryClient = class {
34379
34568
  }
34380
34569
  return void 0;
34381
34570
  }
34571
+ /**
34572
+ * Find a valid cached non-JSON body on disk without reading it: only
34573
+ * the head is read, to check the entry. Bypasses the in-memory cache
34574
+ * LRU like {@link cachedBody}.
34575
+ *
34576
+ * The body's offset is not returned. `cache-unzip` can rewrite the
34577
+ * entry, and its head, before the body is read, so whoever reads the
34578
+ * body takes the head length from the same bytes (see `@vltpkg/tar`'s
34579
+ * `unpackCacheEntry`). A rewrite keeps the same tarball, un-gzipped.
34580
+ *
34581
+ * Does not log a cache hit. Returns undefined on anything unexpected;
34582
+ * callers fall back to {@link request}.
34583
+ */
34584
+ cachedTarball(url, options = {}) {
34585
+ const { integrity, method = "GET" } = options;
34586
+ try {
34587
+ const found = this.#cachedPaths(url, method, integrity);
34588
+ if (!found) return void 0;
34589
+ const { key, paths } = found;
34590
+ for (const path2 of paths) {
34591
+ let fd;
34592
+ try {
34593
+ fd = openSync(path2, "r");
34594
+ } catch {
34595
+ continue;
34596
+ }
34597
+ try {
34598
+ const size = Buffer.allocUnsafe(4);
34599
+ if (readSync(fd, size, 0, 4, 0) < 4) continue;
34600
+ const headSize = size.readUInt32BE(0);
34601
+ if (headSize < 7 || headSize > maxHeadSize) continue;
34602
+ const head = Buffer.allocUnsafe(headSize + 2);
34603
+ const read = readSync(fd, head, 0, headSize + 2, 0);
34604
+ if (read < headSize) continue;
34605
+ const entry = CacheEntry.decodeHead(head.subarray(0, read));
34606
+ if (entry.statusCode !== 200 || !entry.valid || entry.isJSON) {
34607
+ continue;
34608
+ }
34609
+ return {
34610
+ path: path2,
34611
+ key,
34612
+ bytes: fstatSync(fd).size - headSize,
34613
+ integrity: entry.integrity,
34614
+ gzip: CacheEntry.isGzipEntry(head.subarray(0, read))
34615
+ };
34616
+ } finally {
34617
+ closeSync(fd);
34618
+ }
34619
+ }
34620
+ } catch {
34621
+ }
34622
+ return void 0;
34623
+ }
34624
+ // The cache files that may hold a body for `url`, or undefined when
34625
+ // the in-memory cache should answer instead. Shared by cachedBody and
34626
+ // cachedTarball.
34627
+ #cachedPaths(url, method, integrity) {
34628
+ const key = cacheKey(
34629
+ method,
34630
+ typeof url === "string" ? new URL(url) : url
34631
+ );
34632
+ if (this.cache.peek(key)) return void 0;
34633
+ const paths = /* @__PURE__ */ new Set();
34634
+ try {
34635
+ const i2 = this.cache.integrityPath(integrity);
34636
+ if (i2) paths.add(i2);
34637
+ } catch {
34638
+ }
34639
+ if (!integrity) paths.add(this.cache.path(key));
34640
+ return { key, paths };
34641
+ }
34382
34642
  /**
34383
34643
  * Queue the cached tarball at `key` (a {@link CachedBody} key) for the
34384
34644
  * background child: exploded into the global store when that is on,
@@ -14,20 +14,20 @@ import {
14
14
  } from "./chunk-CLVRCGOZ.js";
15
15
  import {
16
16
  openUrl
17
- } from "./chunk-22LZBDEC.js";
17
+ } from "./chunk-L65CG5LE.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-JCNI6ZHH.js";
20
+ } from "./chunk-JNPVOACH.js";
21
21
  import {
22
22
  actual
23
- } from "./chunk-36UIE654.js";
23
+ } from "./chunk-6BD4RCTR.js";
24
24
  import {
25
25
  Query
26
- } from "./chunk-F5LZMLAQ.js";
26
+ } from "./chunk-TQBSL35R.js";
27
27
  import {
28
28
  SecurityArchive
29
- } from "./chunk-YTDABXPD.js";
30
- import "./chunk-KVWGMSPW.js";
29
+ } from "./chunk-JASG7RHB.js";
30
+ import "./chunk-C75GDQFE.js";
31
31
  import "./chunk-LGQVZTYR.js";
32
32
  import "./chunk-EYGOEAJM.js";
33
33
  import {
@@ -35,11 +35,11 @@ import {
35
35
  } from "./chunk-HT6FS4VB.js";
36
36
  import {
37
37
  PackageInfoClient
38
- } from "./chunk-LCLRP64K.js";
38
+ } from "./chunk-3UDBYFAH.js";
39
39
  import "./chunk-SRWDPPLX.js";
40
- import "./chunk-JV5XR5JQ.js";
41
- import "./chunk-EMTGRCSE.js";
42
- import "./chunk-TQQO2F56.js";
40
+ import "./chunk-MCQTGFJY.js";
41
+ import "./chunk-GJMDZJPJ.js";
42
+ import "./chunk-6ISFYONV.js";
43
43
  import "./chunk-4KCU2KZL.js";
44
44
  import "./chunk-WGDTG44V.js";
45
45
  import "./chunk-E74WGW5C.js";
@@ -53,13 +53,14 @@ import {
53
53
  } from "./chunk-6D3QAFNZ.js";
54
54
  import "./chunk-HTOTG4TS.js";
55
55
  import "./chunk-QNHBAGXQ.js";
56
- import "./chunk-GEQFMH5M.js";
56
+ import "./chunk-HHSPE2DS.js";
57
57
  import "./chunk-4GMNWW4C.js";
58
58
  import "./chunk-SUU2WETN.js";
59
- import "./chunk-B6RIGNEO.js";
59
+ import "./chunk-ZESNN24A.js";
60
60
  import "./chunk-XNLSTHDK.js";
61
- import "./chunk-PDWPFR5T.js";
62
- import "./chunk-Y5PA7DVK.js";
61
+ import "./chunk-24DWRCPS.js";
62
+ import "./chunk-LEMHGORE.js";
63
+ import "./chunk-6ETYWCJN.js";
63
64
  import "./chunk-BF5DRGRZ.js";
64
65
  import {
65
66
  error