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
@@ -10,6 +10,197 @@ globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
 
13
+ // ../../src/output/src/trace.ts
14
+ import { appendFileSync } from "node:fs";
15
+ import { monitorEventLoopDelay, performance as performance2 } from "node:perf_hooks";
16
+ import { threadId as ownThreadId } from "node:worker_threads";
17
+ var sharedNow = () => performance2.timeOrigin + performance2.now();
18
+ var defaultAppend = (file, data) => appendFileSync(file, data, { mode: 384 });
19
+ var defaultWrite = (line) => process.stderr.write(line + "\n");
20
+ var Tracer = class _Tracer {
21
+ enabled;
22
+ file;
23
+ phases;
24
+ #tid;
25
+ #now;
26
+ #append;
27
+ #write;
28
+ #flushLines;
29
+ #flushMs;
30
+ #buffer = [];
31
+ #timer;
32
+ #sampler;
33
+ #marks = [];
34
+ #start;
35
+ #loop;
36
+ #closed = false;
37
+ constructor(options = {}) {
38
+ this.file = options.file || void 0;
39
+ this.phases = !!options.phases;
40
+ this.enabled = !!this.file || this.phases;
41
+ this.#tid = options.threadId ?? ownThreadId;
42
+ this.#now = options.now ?? sharedNow;
43
+ this.#append = options.append ?? defaultAppend;
44
+ this.#write = options.write ?? defaultWrite;
45
+ this.#flushLines = options.flushLines ?? 200;
46
+ this.#flushMs = options.flushMs ?? 50;
47
+ this.#start = this.#now();
48
+ if (!this.enabled) return;
49
+ const main = options.main ?? this.#tid === 0;
50
+ if (main) {
51
+ this.#loop = monitorEventLoopDelay({ resolution: 20 });
52
+ this.#loop.enable();
53
+ const sampleMs = options.sampleMs ?? 20;
54
+ if (this.file && sampleMs > 0) {
55
+ this.#sampler = setInterval(() => this.sample(), sampleMs);
56
+ this.#sampler.unref();
57
+ }
58
+ process.once("exit", () => this.close());
59
+ }
60
+ this.trace("open", { pid: process.pid });
61
+ }
62
+ /**
63
+ * Build a tracer from the environment: `VLT_TRACE` names the file,
64
+ * `VLT_PHASES` (any value but `0` or empty) asks for the summary.
65
+ */
66
+ static fromEnv(env = process.env, options = {}) {
67
+ const phases = env.VLT_PHASES;
68
+ return new _Tracer({
69
+ ...options,
70
+ file: env.VLT_TRACE,
71
+ phases: !!phases && phases !== "0"
72
+ });
73
+ }
74
+ /** Record one event. */
75
+ trace(ev, fields) {
76
+ if (!this.file || this.#closed) return;
77
+ const event = { t: this.#now(), tid: this.#tid, ev };
78
+ if (fields) {
79
+ for (const [k2, v2] of Object.entries(fields)) {
80
+ if (v2 !== void 0) event[k2] = v2;
81
+ }
82
+ }
83
+ this.#buffer.push(JSON.stringify(event));
84
+ if (this.#buffer.length >= this.#flushLines) this.flush();
85
+ else if (!this.#timer) {
86
+ this.#timer = setTimeout(() => this.flush(), this.#flushMs);
87
+ this.#timer.unref();
88
+ }
89
+ }
90
+ /**
91
+ * Record a `<ev>:start` event now and return a function that records
92
+ * `<ev>:end` with the elapsed `ms` (plus any fields it is given). The
93
+ * same `fields` are stamped on both ends so the two can be paired.
94
+ */
95
+ span(ev, fields) {
96
+ if (!this.file) return noop;
97
+ const t0 = this.#now();
98
+ this.trace(`${ev}:start`, fields);
99
+ return (end) => this.trace(`${ev}:end`, {
100
+ ...fields,
101
+ ...end,
102
+ ms: Math.round((this.#now() - t0) * 1e3) / 1e3
103
+ });
104
+ }
105
+ /**
106
+ * Mark the start of a phase. The summary reports the ms between each
107
+ * mark and the next one, and the trace records a `phase` event.
108
+ */
109
+ mark(name, fields) {
110
+ if (!this.enabled) return;
111
+ this.#marks.push({ name, t: this.#now() });
112
+ this.trace("phase", { ...fields, name });
113
+ }
114
+ /**
115
+ * Record how busy a resource lane is: how many jobs it is running and
116
+ * how many are waiting for a slot. The report derives idle time per
117
+ * lane from these.
118
+ */
119
+ lane(name, busy, queued) {
120
+ if (!this.file) return;
121
+ this.trace("lane", { name, busy, queued });
122
+ }
123
+ /** Record a memory sample. */
124
+ sample() {
125
+ if (!this.file) return;
126
+ const m = process.memoryUsage();
127
+ this.trace("rss", {
128
+ rss: m.rss,
129
+ heap: m.heapUsed,
130
+ ext: m.external,
131
+ ab: m.arrayBuffers
132
+ });
133
+ }
134
+ /** Write buffered lines to the file. */
135
+ flush() {
136
+ if (this.#timer) {
137
+ clearTimeout(this.#timer);
138
+ this.#timer = void 0;
139
+ }
140
+ if (!this.file || !this.#buffer.length) return;
141
+ const data = this.#buffer.join("\n") + "\n";
142
+ this.#buffer = [];
143
+ try {
144
+ this.#append(this.file, data);
145
+ } catch {
146
+ }
147
+ }
148
+ /**
149
+ * The one-line phase summary, or undefined when phases are off. Each
150
+ * phase is reported as the ms from its mark to the next mark (or to
151
+ * now, for the last one).
152
+ */
153
+ summary() {
154
+ if (!this.phases) return void 0;
155
+ const now = this.#now();
156
+ const parts = [];
157
+ for (const [i, m] of this.#marks.entries()) {
158
+ const next = this.#marks[i + 1]?.t ?? now;
159
+ parts.push(`${m.name}=${Math.round(next - m.t)}`);
160
+ }
161
+ parts.push(`total=${Math.round(now - this.#start)}`);
162
+ if (this.#loop) {
163
+ const ms2 = (n7) => Math.round(n7 / 1e6);
164
+ parts.push(
165
+ `loop p50=${ms2(this.#loop.percentile(50))} p99=${ms2(this.#loop.percentile(99))} max=${ms2(this.#loop.max)}`
166
+ );
167
+ }
168
+ const { maxRSS } = process.resourceUsage();
169
+ parts.push(`maxrss=${Math.round(maxRSS / 1024)}MB`);
170
+ return `PHASES ${parts.join(" ")}`;
171
+ }
172
+ /**
173
+ * Stop sampling, flush, and print the summary. Runs at process exit
174
+ * on the main thread; safe to call more than once.
175
+ */
176
+ close() {
177
+ if (this.#closed) return;
178
+ if (this.#sampler) clearInterval(this.#sampler);
179
+ if (this.enabled) {
180
+ if (this.#loop) {
181
+ this.#loop.disable();
182
+ this.trace("exit", {
183
+ loopP50: Math.round(this.#loop.percentile(50) / 1e6),
184
+ loopP99: Math.round(this.#loop.percentile(99) / 1e6),
185
+ loopMax: Math.round(this.#loop.max / 1e6),
186
+ maxrss: process.resourceUsage().maxRSS
187
+ });
188
+ }
189
+ const line = this.summary();
190
+ this.flush();
191
+ if (line) this.#write(line);
192
+ }
193
+ this.#closed = true;
194
+ }
195
+ };
196
+ var noop = () => {
197
+ };
198
+ var tracer = Tracer.fromEnv();
199
+ var trace = (ev, fields) => tracer.trace(ev, fields);
200
+ var span = (ev, fields) => tracer.span(ev, fields);
201
+ var mark = (name, fields) => tracer.mark(name, fields);
202
+ var lane = (name, busy, queued) => tracer.lane(name, busy, queued);
203
+
13
204
  // ../../node_modules/.vlt/~npm~glob@13.0.6/node_modules/glob/dist/esm/index.min.js
14
205
  import { fileURLToPath as Wi } from "node:url";
15
206
  import { posix as mi, win32 as re } from "node:path";
@@ -2997,5 +3188,10 @@ Ze.glob = Ze;
2997
3188
  export {
2998
3189
  ot,
2999
3190
  ts,
3000
- Ze
3191
+ Ze,
3192
+ tracer,
3193
+ trace,
3194
+ span,
3195
+ mark,
3196
+ lane
3001
3197
  };
@@ -22,11 +22,11 @@ import {
22
22
  } from "./chunk-HTOTG4TS.js";
23
23
  import {
24
24
  I
25
- } from "./chunk-B6RIGNEO.js";
25
+ } from "./chunk-ZESNN24A.js";
26
26
  import {
27
27
  ot,
28
28
  ts
29
- } from "./chunk-Y5PA7DVK.js";
29
+ } from "./chunk-6ETYWCJN.js";
30
30
  import {
31
31
  asManifest,
32
32
  longDependencyTypes,
@@ -115,6 +115,7 @@ var PackageJson = class {
115
115
  writeFileSync(filename, stringify(manifest, void 0, indent));
116
116
  this.#cache.set(dir, manifest);
117
117
  this.#pathCache.set(manifest, dir);
118
+ this.#errCache.delete(dir);
118
119
  } catch (err) {
119
120
  this.#cache.delete(dir);
120
121
  this.#pathCache.delete(manifest);
@@ -13,7 +13,7 @@ import {
13
13
  defaultRegistryKey,
14
14
  getTokenByURL,
15
15
  registryKeys
16
- } from "./chunk-44AWMA4F.js";
16
+ } from "./chunk-NB7QVWHU.js";
17
17
 
18
18
  // ../../src/cli-sdk/src/query-auth.ts
19
19
  var createGetAuthHeader = (conf) => {
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-SRWDPPLX.js";
16
16
  import {
17
17
  minimatch
18
- } from "./chunk-TQQO2F56.js";
18
+ } from "./chunk-6ISFYONV.js";
19
19
  import {
20
20
  Spec
21
21
  } from "./chunk-6D3QAFNZ.js";
@@ -1865,7 +1865,12 @@ var require_ignore = __commonJS({
1865
1865
  // ../../src/cli-sdk/src/pack-tarball.ts
1866
1866
  var ssri = __toESM(require_lib(), 1);
1867
1867
  import assert from "node:assert";
1868
- import { existsSync, readFileSync, statSync } from "node:fs";
1868
+ import {
1869
+ existsSync,
1870
+ readdirSync,
1871
+ readFileSync,
1872
+ statSync
1873
+ } from "node:fs";
1869
1874
  import { join } from "node:path";
1870
1875
  var import_ignore = __toESM(require_ignore(), 1);
1871
1876
  var replaceWorkspaceAndCatalogSpecs = (manifest_, config) => {
@@ -2004,7 +2009,16 @@ var buildPackFilter = (manifest, packDir) => {
2004
2009
  }
2005
2010
  }
2006
2011
  }
2007
- return (path) => {
2012
+ const files = (manifestWithFiles.files ?? []).map((pattern) => pattern.replace(/^\.?\//, "").replace(/\/+$/, "")).filter(Boolean);
2013
+ const isReadableDir = (dir) => {
2014
+ try {
2015
+ readdirSync(join(packDir, dir));
2016
+ return true;
2017
+ } catch {
2018
+ return false;
2019
+ }
2020
+ };
2021
+ return (path, entry) => {
2008
2022
  const normalizedPath = path.replace(/^\.\//, "");
2009
2023
  if (path === "." || normalizedPath === "") {
2010
2024
  return true;
@@ -2025,30 +2039,16 @@ var buildPackFilter = (manifest, packDir) => {
2025
2039
  if (hasEmptyFilesField) {
2026
2040
  return false;
2027
2041
  }
2028
- if (hasFilesField && manifestWithFiles.files) {
2029
- return manifestWithFiles.files.some((pattern) => {
2030
- if (pattern.endsWith("/")) {
2031
- const dirName = pattern.slice(0, -1);
2032
- const globPattern = pattern.replace(/\/$/, "/**");
2033
- const matchesDir = normalizedPath === dirName;
2034
- const matchesContents = minimatch(
2035
- normalizedPath,
2036
- globPattern,
2037
- { dot: true }
2038
- );
2039
- return matchesDir || matchesContents;
2040
- }
2041
- const directMatch = minimatch(normalizedPath, pattern, {
2042
- dot: true
2043
- });
2044
- const isParentDir = pattern.includes("/") && pattern.startsWith(normalizedPath + "/");
2045
- const isChildOfPattern = minimatch(
2046
- normalizedPath,
2047
- pattern + "/**",
2048
- { dot: true }
2049
- );
2050
- return directMatch || isParentDir || isChildOfPattern;
2051
- });
2042
+ if (hasFilesField) {
2043
+ const isDir = "isDirectory" in entry && entry.isDirectory();
2044
+ return files.some(
2045
+ (pattern) => minimatch(normalizedPath, pattern, { dot: true }) || minimatch(normalizedPath, `${pattern}/**`, { dot: true })
2046
+ ) || isDir && files.some(
2047
+ (pattern) => minimatch(normalizedPath, pattern, {
2048
+ dot: true,
2049
+ partial: true
2050
+ })
2051
+ ) && isReadableDir(normalizedPath);
2052
2052
  }
2053
2053
  if (ig?.ignores(normalizedPath)) {
2054
2054
  return false;
@@ -42,10 +42,13 @@ import {
42
42
  } from "./chunk-CAV7FKWQ.js";
43
43
  import {
44
44
  emitter
45
- } from "./chunk-B6RIGNEO.js";
45
+ } from "./chunk-ZESNN24A.js";
46
46
  import {
47
47
  XDG
48
48
  } from "./chunk-XNLSTHDK.js";
49
+ import {
50
+ mark
51
+ } from "./chunk-6ETYWCJN.js";
49
52
  import {
50
53
  isErrorWithCause,
51
54
  isObject
@@ -326,7 +329,15 @@ var getClient = () => {
326
329
  // Buffer up to 20 events and flush every 10 s — but we always
327
330
  // call shutdown at the end so this is just a safety net.
328
331
  flushAt: 20,
329
- flushInterval: 1e4
332
+ flushInterval: 1e4,
333
+ // one attempt, capped like flush(); failed sends resolve as 204
334
+ // so offline or erroring runs neither wait nor log
335
+ fetchRetryCount: 0,
336
+ requestTimeout: SHUTDOWN_TIMEOUT_MS,
337
+ fetch: async (url, init) => {
338
+ const res = await fetch(url, init).catch(() => void 0);
339
+ return res?.ok ? res : new Response(null, { status: 204 });
340
+ }
330
341
  });
331
342
  return _posthog;
332
343
  } catch {
@@ -693,7 +704,10 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
693
704
  );
694
705
  }
695
706
  if (conf.globalRoot) await sweepPendingRemove(conf.globalRoot);
696
- const output = await onDone(await command(conf));
707
+ const result = await command(conf);
708
+ mark("command:done");
709
+ const output = await onDone(result);
710
+ mark("view:done");
697
711
  stopRequestLog();
698
712
  const duration_ms = Date.now() - start;
699
713
  trackCommand(
@@ -721,6 +735,7 @@ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
721
735
  );
722
736
  }
723
737
  await flush();
738
+ mark("telemetry:flushed");
724
739
  } catch (err) {
725
740
  stopRequestLog();
726
741
  onError?.(err);
@@ -11,18 +11,18 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  install
14
- } from "./chunk-36UIE654.js";
14
+ } from "./chunk-6BD4RCTR.js";
15
15
  import {
16
16
  PackageInfoClient
17
- } from "./chunk-LCLRP64K.js";
17
+ } from "./chunk-3UDBYFAH.js";
18
18
  import {
19
19
  RollbackRemove,
20
20
  cmdShim,
21
21
  findCmdShimIfExists
22
- } from "./chunk-JV5XR5JQ.js";
22
+ } from "./chunk-MCQTGFJY.js";
23
23
  import {
24
24
  PathScurry
25
- } from "./chunk-TQQO2F56.js";
25
+ } from "./chunk-6ISFYONV.js";
26
26
  import {
27
27
  Spec
28
28
  } from "./chunk-6D3QAFNZ.js";
@@ -203,6 +203,7 @@ var del = (object, path) => {
203
203
  assertNotStringIndex(object, key);
204
204
  if (isLast(pathArray, index)) {
205
205
  if (Array.isArray(object)) {
206
+ if (typeof key !== "number") return false;
206
207
  object.splice(key, 1);
207
208
  } else {
208
209
  delete object[key];
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-SUU2WETN.js";
19
19
  import {
20
20
  I
21
- } from "./chunk-B6RIGNEO.js";
21
+ } from "./chunk-ZESNN24A.js";
22
22
  import {
23
23
  Range,
24
24
  Version,
@@ -14,7 +14,7 @@ var require = _vlt_createRequire(import.meta.filename);
14
14
  var package_default = {
15
15
  name: "@vltpkg/user-agent",
16
16
  description: "The User-Agent string that vlt sends with every outbound request",
17
- version: "1.6.0",
17
+ version: "1.6.2",
18
18
  repository: {
19
19
  type: "git",
20
20
  url: "git+https://github.com/vltpkg/vltpkg.git",
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-CAV7FKWQ.js";
17
17
  import {
18
18
  userAgent
19
- } from "./chunk-GEQFMH5M.js";
19
+ } from "./chunk-HHSPE2DS.js";
20
20
  import {
21
21
  I
22
- } from "./chunk-B6RIGNEO.js";
22
+ } from "./chunk-ZESNN24A.js";
23
23
  import {
24
24
  XDG
25
25
  } from "./chunk-XNLSTHDK.js";
@@ -12,13 +12,13 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  actual,
14
14
  createVirtualRoot
15
- } from "./chunk-36UIE654.js";
15
+ } from "./chunk-6BD4RCTR.js";
16
16
  import {
17
17
  callLimit
18
- } from "./chunk-F5LZMLAQ.js";
18
+ } from "./chunk-TQBSL35R.js";
19
19
  import {
20
20
  SecurityArchive
21
- } from "./chunk-YTDABXPD.js";
21
+ } from "./chunk-JASG7RHB.js";
22
22
  import {
23
23
  error
24
24
  } from "./chunk-WZWDS3W4.js";
@@ -142,7 +142,7 @@ var reloadConfig = async (folder) => {
142
142
  unload("project");
143
143
  } catch {
144
144
  }
145
- const { Config } = await import("./config-EKHBW6I5.js");
145
+ const { Config } = await import("./config-C73FLGQV.js");
146
146
  return Config.load(folder, process.argv, true, false);
147
147
  };
148
148
 
@@ -15,7 +15,7 @@ import {
15
15
  pairsToRecords,
16
16
  registrySelectionFields,
17
17
  registrySelectors
18
- } from "./chunk-LP3ORD3D.js";
18
+ } from "./chunk-3RYVF2GG.js";
19
19
  import {
20
20
  normalizeRegistryURL
21
21
  } from "./chunk-7M2VTFLP.js";
@@ -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
  stderr
14
- } from "./chunk-KVWGMSPW.js";
14
+ } from "./chunk-C75GDQFE.js";
15
15
  import {
16
16
  urlOpen
17
17
  } from "./chunk-QNHBAGXQ.js";
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  Ze,
14
14
  ts
15
- } from "./chunk-Y5PA7DVK.js";
15
+ } from "./chunk-6ETYWCJN.js";
16
16
 
17
17
  // ../../node_modules/.vlt/~npm~rimraf@6.1.3/node_modules/rimraf/dist/esm/opt-arg.js
18
18
  var typeOrUndef = (val, t) => typeof val === "undefined" || typeof val === t;
@@ -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
  rimraf
14
- } from "./chunk-PDWPFR5T.js";
14
+ } from "./chunk-LEMHGORE.js";
15
15
  import {
16
16
  error
17
17
  } from "./chunk-WZWDS3W4.js";
@@ -21,7 +21,7 @@ import {
21
21
  RollbackRemove,
22
22
  cmdShimIfExists,
23
23
  findCmdShimIfExists
24
- } from "./chunk-JV5XR5JQ.js";
24
+ } from "./chunk-MCQTGFJY.js";
25
25
  import {
26
26
  readGlobalState,
27
27
  updateGlobalState,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-QNHBAGXQ.js";
15
15
  import {
16
16
  userAgent
17
- } from "./chunk-GEQFMH5M.js";
17
+ } from "./chunk-HHSPE2DS.js";
18
18
  import {
19
19
  assertOk,
20
20
  registryErrorMessage,
@@ -25,13 +25,13 @@ import {
25
25
  import {
26
26
  I,
27
27
  logRequest
28
- } from "./chunk-B6RIGNEO.js";
28
+ } from "./chunk-ZESNN24A.js";
29
29
  import {
30
30
  XDG
31
31
  } from "./chunk-XNLSTHDK.js";
32
32
  import {
33
33
  rimraf
34
- } from "./chunk-PDWPFR5T.js";
34
+ } from "./chunk-LEMHGORE.js";
35
35
  import {
36
36
  asError,
37
37
  integrityHex,
@@ -26150,7 +26150,13 @@ var handleBeforeExit = () => {
26150
26150
  // ../../src/registry-client/src/index.ts
26151
26151
  var import_undici3 = __toESM(require_undici(), 1);
26152
26152
  import { randomUUID } from "node:crypto";
26153
- import { closeSync, openSync, readFileSync as readFileSync2, readSync } from "node:fs";
26153
+ import {
26154
+ closeSync,
26155
+ fstatSync,
26156
+ openSync,
26157
+ readFileSync as readFileSync2,
26158
+ readSync
26159
+ } from "node:fs";
26154
26160
  import { availableParallelism } from "node:os";
26155
26161
  import { dirname as dirname3, resolve as resolve4 } from "node:path";
26156
26162
  import { setMaxListeners } from "node:events";
@@ -27959,18 +27965,9 @@ var RegistryClient = class {
27959
27965
  cachedBody(url, options = {}) {
27960
27966
  const { integrity, method = "GET" } = options;
27961
27967
  try {
27962
- const key = cacheKey(
27963
- method,
27964
- typeof url === "string" ? new URL(url) : url
27965
- );
27966
- if (this.cache.peek(key)) return void 0;
27967
- const paths = /* @__PURE__ */ new Set();
27968
- try {
27969
- const i = this.cache.integrityPath(integrity);
27970
- if (i) paths.add(i);
27971
- } catch {
27972
- }
27973
- if (!integrity) paths.add(this.cache.path(key));
27968
+ const found = this.#cachedPaths(url, method, integrity);
27969
+ if (!found) return void 0;
27970
+ const { key, paths } = found;
27974
27971
  for (const path of paths) {
27975
27972
  let buf;
27976
27973
  try {
@@ -27994,6 +27991,77 @@ var RegistryClient = class {
27994
27991
  }
27995
27992
  return void 0;
27996
27993
  }
27994
+ /**
27995
+ * Find a valid cached non-JSON body on disk without reading it: only
27996
+ * the head is read, to check the entry. Bypasses the in-memory cache
27997
+ * LRU like {@link cachedBody}.
27998
+ *
27999
+ * The body's offset is not returned. `cache-unzip` can rewrite the
28000
+ * entry, and its head, before the body is read, so whoever reads the
28001
+ * body takes the head length from the same bytes (see `@vltpkg/tar`'s
28002
+ * `unpackCacheEntry`). A rewrite keeps the same tarball, un-gzipped.
28003
+ *
28004
+ * Does not log a cache hit. Returns undefined on anything unexpected;
28005
+ * callers fall back to {@link request}.
28006
+ */
28007
+ cachedTarball(url, options = {}) {
28008
+ const { integrity, method = "GET" } = options;
28009
+ try {
28010
+ const found = this.#cachedPaths(url, method, integrity);
28011
+ if (!found) return void 0;
28012
+ const { key, paths } = found;
28013
+ for (const path of paths) {
28014
+ let fd;
28015
+ try {
28016
+ fd = openSync(path, "r");
28017
+ } catch {
28018
+ continue;
28019
+ }
28020
+ try {
28021
+ const size = Buffer.allocUnsafe(4);
28022
+ if (readSync(fd, size, 0, 4, 0) < 4) continue;
28023
+ const headSize = size.readUInt32BE(0);
28024
+ if (headSize < 7 || headSize > maxHeadSize) continue;
28025
+ const head = Buffer.allocUnsafe(headSize + 2);
28026
+ const read = readSync(fd, head, 0, headSize + 2, 0);
28027
+ if (read < headSize) continue;
28028
+ const entry = CacheEntry.decodeHead(head.subarray(0, read));
28029
+ if (entry.statusCode !== 200 || !entry.valid || entry.isJSON) {
28030
+ continue;
28031
+ }
28032
+ return {
28033
+ path,
28034
+ key,
28035
+ bytes: fstatSync(fd).size - headSize,
28036
+ integrity: entry.integrity,
28037
+ gzip: CacheEntry.isGzipEntry(head.subarray(0, read))
28038
+ };
28039
+ } finally {
28040
+ closeSync(fd);
28041
+ }
28042
+ }
28043
+ } catch {
28044
+ }
28045
+ return void 0;
28046
+ }
28047
+ // The cache files that may hold a body for `url`, or undefined when
28048
+ // the in-memory cache should answer instead. Shared by cachedBody and
28049
+ // cachedTarball.
28050
+ #cachedPaths(url, method, integrity) {
28051
+ const key = cacheKey(
28052
+ method,
28053
+ typeof url === "string" ? new URL(url) : url
28054
+ );
28055
+ if (this.cache.peek(key)) return void 0;
28056
+ const paths = /* @__PURE__ */ new Set();
28057
+ try {
28058
+ const i = this.cache.integrityPath(integrity);
28059
+ if (i) paths.add(i);
28060
+ } catch {
28061
+ }
28062
+ if (!integrity) paths.add(this.cache.path(key));
28063
+ return { key, paths };
28064
+ }
27997
28065
  /**
27998
28066
  * Queue the cached tarball at `key` (a {@link CachedBody} key) for the
27999
28067
  * background child: exploded into the global store when that is on,