vlt 1.6.1 → 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 (88) hide show
  1. package/{access-YSLEWR2C.js → access-LNHKSCBO.js} +5 -5
  2. package/{bugs-S6CRUEA2.js → bugs-PSOZGCKG.js} +15 -14
  3. package/{build-SG3KPX3W.js → build-GBIF54BN.js} +11 -11
  4. package/{cache-HA77ROM7.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-AEVT3CHK.js → chunk-3RYVF2GG.js} +2 -2
  9. package/{chunk-IHERL3TA.js → chunk-3UDBYFAH.js} +95 -8
  10. package/{chunk-ZJE3OTP3.js → chunk-6BD4RCTR.js} +40 -13
  11. package/{chunk-Y5PA7DVK.js → chunk-6ETYWCJN.js} +197 -1
  12. package/{chunk-KURQHX54.js → chunk-6ISFYONV.js} +2 -2
  13. package/{chunk-VGPLFOJO.js → chunk-AQJR7QDA.js} +1 -1
  14. package/{chunk-JZXNHIQE.js → chunk-BGOXKLQ6.js} +1 -1
  15. package/{chunk-MSWOR3FV.js → chunk-C75GDQFE.js} +9 -2
  16. package/{chunk-WMMKUVAT.js → chunk-FRX5IFFY.js} +4 -4
  17. package/{chunk-EMTGRCSE.js → chunk-GJMDZJPJ.js} +1 -1
  18. package/{chunk-M242QVJS.js → chunk-HHSPE2DS.js} +1 -1
  19. package/{chunk-AHLBPSGQ.js → chunk-JASG7RHB.js} +2 -2
  20. package/{chunk-W24SBFY5.js → chunk-JNPVOACH.js} +4 -4
  21. package/{chunk-OWL5G4K4.js → chunk-JYYIWXJX.js} +1 -1
  22. package/{chunk-5Q2HSLVV.js → chunk-L65CG5LE.js} +1 -1
  23. package/{chunk-PDWPFR5T.js → chunk-LEMHGORE.js} +1 -1
  24. package/{chunk-JV5XR5JQ.js → chunk-MCQTGFJY.js} +1 -1
  25. package/{chunk-O6MQ7NN6.js → chunk-N4SU52H5.js} +1 -1
  26. package/{chunk-Q2UEILN6.js → chunk-NB7QVWHU.js} +84 -16
  27. package/{chunk-N6HV7JWC.js → chunk-QFPAFVRR.js} +39 -67
  28. package/{chunk-DXED4ARV.js → chunk-QGLGNPCQ.js} +2 -2
  29. package/{chunk-3E3ISOYM.js → chunk-QGUQZURY.js} +2 -2
  30. package/{chunk-L3ZF7OYM.js → chunk-TGPL6YRK.js} +2 -2
  31. package/{chunk-C4RJ4NNS.js → chunk-TQBSL35R.js} +5 -5
  32. package/{chunk-6XVW7CWJ.js → chunk-XWA55GAN.js} +3 -3
  33. package/{chunk-BQMHDAYL.js → chunk-XWVEIWTT.js} +1 -1
  34. package/{chunk-4UAIPIAV.js → chunk-Y53EROVE.js} +5 -5
  35. package/{chunk-NO53Y3QO.js → chunk-Z63CXYQF.js} +1 -1
  36. package/{chunk-B6RIGNEO.js → chunk-ZESNN24A.js} +11 -1
  37. package/{ci-GVLL72SS.js → ci-XSH7DZGD.js} +13 -13
  38. package/cli-package.json +1 -1
  39. package/{config-KH6AEMHI.js → config-6XFBWC3U.js} +7 -6
  40. package/{config-TIPKOPYS.js → config-C73FLGQV.js} +7 -6
  41. package/{create-SKNEZEZY.js → create-UNCQKKBS.js} +16 -15
  42. package/{deprecate-RFRLJZVL.js → deprecate-HCVFAVZD.js} +9 -8
  43. package/{dist-tag-LVYOTJHJ.js → dist-tag-WXLJRWFJ.js} +5 -5
  44. package/{docs-INXRFEGY.js → docs-5EFY7ZHN.js} +15 -14
  45. package/{exec-5MA5XRPZ.js → exec-EC5D5GE3.js} +16 -15
  46. package/{exec-cache-7GS4KLWJ.js → exec-cache-EMUFVFCJ.js} +14 -13
  47. package/{exec-local-RE4KVTMN.js → exec-local-L5H4M37T.js} +13 -13
  48. package/{help-JHLP565L.js → help-FUHVZ6UH.js} +1 -1
  49. package/{init-4UFHO67B.js → init-63M6W7N4.js} +11 -11
  50. package/{install-Z33YVCDK.js → install-IHQRULIE.js} +20 -19
  51. package/{list-XAMKR6TL.js → list-EDXNWJJR.js} +16 -16
  52. package/{login-6NXUO5FF.js → login-OD7E5AO5.js} +10 -9
  53. package/{logout-6P7LWTAY.js → logout-V2WJTQV2.js} +5 -5
  54. package/{outdated-YNUSWZJD.js → outdated-7N7NGSSR.js} +15 -14
  55. package/{pack-LMQYH75V.js → pack-TKJW7AEB.js} +12 -12
  56. package/package.json +1 -1
  57. package/{ping-VLFZ3WCY.js → ping-PVWRNSCX.js} +5 -5
  58. package/{pkg-JMPBHKSW.js → pkg-PDP4XR5S.js} +12 -12
  59. package/{profile-PJJAA2YM.js → profile-BP5EALWS.js} +5 -5
  60. package/{publish-33RFJ2HJ.js → publish-HCICK5LY.js} +14 -14
  61. package/{query-LUUOK57K.js → query-TZ3BPC4B.js} +16 -16
  62. package/registry-client-src-revalidate.js +304 -44
  63. package/{repo-VLHLQP2S.js → repo-BYOSXG5J.js} +15 -14
  64. package/{reporter-SNSM2TDC.js → reporter-S6DDAHQL.js} +12 -11
  65. package/{run-USWK7R3N.js → run-JAVVTY7B.js} +13 -13
  66. package/{run-exec-PHE44AWW.js → run-exec-GGENQDEW.js} +13 -13
  67. package/security-archive-src-update-expired.js +1 -1
  68. package/{setup-JMY47ERY.js → setup-I6GLYILV.js} +13 -12
  69. package/{skills-YMMV6TMN.js → skills-5V6HKMA7.js} +14 -13
  70. package/{skills-7PYMTDER.js → skills-QOFA6XMM.js} +6 -6
  71. package/{src-2ZS4VHJP.js → src-74IKO7PC.js} +12 -8
  72. package/src-GY57R4DK.js +659 -0
  73. package/{src-A5ZJNOHN.js → src-REZNPR2X.js} +5 -5
  74. package/tar-src-placement-worker.js +6426 -0
  75. package/{token-YKHELNVQ.js → token-JEAMCRK6.js} +5 -5
  76. package/{uninstall-Q46HWR5S.js → uninstall-WA4FJFVA.js} +14 -14
  77. package/{unpublish-LBANPSJ5.js → unpublish-SG3J524L.js} +5 -5
  78. package/{update-B2EGLZHI.js → update-Y3KY2DZD.js} +15 -14
  79. package/{version-IEOBL3NN.js → version-QBEPMA7Q.js} +11 -11
  80. package/{view-JCA5VT6F.js → view-FYRF3SLJ.js} +8 -7
  81. package/vlr.js +1 -1
  82. package/vlrx.js +1 -1
  83. package/vlt.js +1 -1
  84. package/vlx.js +1 -1
  85. package/vlxl.js +1 -1
  86. package/{whoami-OWJUPO3X.js → whoami-XSQ6SOIC.js} +5 -5
  87. package/chunk-N3V6EK5I.js +0 -77
  88. package/src-W2VQULRG.js +0 -285
@@ -19,17 +19,17 @@ import "./chunk-EFHOWRKU.js";
19
19
  import "./chunk-6D3QAFNZ.js";
20
20
  import {
21
21
  RegistryClient
22
- } from "./chunk-Q2UEILN6.js";
22
+ } from "./chunk-NB7QVWHU.js";
23
23
  import "./chunk-QNHBAGXQ.js";
24
- import "./chunk-M242QVJS.js";
24
+ import "./chunk-HHSPE2DS.js";
25
25
  import {
26
26
  assertOk
27
27
  } from "./chunk-4GMNWW4C.js";
28
28
  import "./chunk-SUU2WETN.js";
29
- import "./chunk-B6RIGNEO.js";
29
+ import "./chunk-ZESNN24A.js";
30
30
  import "./chunk-XNLSTHDK.js";
31
- import "./chunk-PDWPFR5T.js";
32
- import "./chunk-Y5PA7DVK.js";
31
+ import "./chunk-LEMHGORE.js";
32
+ import "./chunk-6ETYWCJN.js";
33
33
  import "./chunk-BF5DRGRZ.js";
34
34
  import {
35
35
  error
@@ -14,20 +14,20 @@ import {
14
14
  } from "./chunk-CLVRCGOZ.js";
15
15
  import {
16
16
  openUrl
17
- } from "./chunk-5Q2HSLVV.js";
17
+ } from "./chunk-L65CG5LE.js";
18
18
  import {
19
19
  createHostContextsMap
20
- } from "./chunk-W24SBFY5.js";
20
+ } from "./chunk-JNPVOACH.js";
21
21
  import {
22
22
  actual
23
- } from "./chunk-ZJE3OTP3.js";
23
+ } from "./chunk-6BD4RCTR.js";
24
24
  import {
25
25
  Query
26
- } from "./chunk-C4RJ4NNS.js";
26
+ } from "./chunk-TQBSL35R.js";
27
27
  import {
28
28
  SecurityArchive
29
- } from "./chunk-AHLBPSGQ.js";
30
- import "./chunk-MSWOR3FV.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-IHERL3TA.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-KURQHX54.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-M242QVJS.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
@@ -12,9 +12,9 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  actual,
14
14
  build
15
- } from "./chunk-ZJE3OTP3.js";
16
- import "./chunk-C4RJ4NNS.js";
17
- import "./chunk-AHLBPSGQ.js";
15
+ } from "./chunk-6BD4RCTR.js";
16
+ import "./chunk-TQBSL35R.js";
17
+ import "./chunk-JASG7RHB.js";
18
18
  import {
19
19
  commandUsage
20
20
  } from "./chunk-HT6FS4VB.js";
@@ -22,11 +22,11 @@ import {
22
22
  globalBinsLines,
23
23
  linkGlobalBins,
24
24
  resolveGlobalBinDir
25
- } from "./chunk-O6MQ7NN6.js";
25
+ } from "./chunk-N4SU52H5.js";
26
26
  import "./chunk-BH5CVXNY.js";
27
- import "./chunk-JV5XR5JQ.js";
28
- import "./chunk-EMTGRCSE.js";
29
- import "./chunk-KURQHX54.js";
27
+ import "./chunk-MCQTGFJY.js";
28
+ import "./chunk-GJMDZJPJ.js";
29
+ import "./chunk-6ISFYONV.js";
30
30
  import "./chunk-GCTREKA4.js";
31
31
  import "./chunk-MCDLJZXT.js";
32
32
  import "./chunk-7M2VTFLP.js";
@@ -34,12 +34,12 @@ import "./chunk-EFHOWRKU.js";
34
34
  import "./chunk-CAV7FKWQ.js";
35
35
  import "./chunk-6D3QAFNZ.js";
36
36
  import "./chunk-HTOTG4TS.js";
37
- import "./chunk-M242QVJS.js";
37
+ import "./chunk-HHSPE2DS.js";
38
38
  import "./chunk-SUU2WETN.js";
39
- import "./chunk-B6RIGNEO.js";
39
+ import "./chunk-ZESNN24A.js";
40
40
  import "./chunk-XNLSTHDK.js";
41
- import "./chunk-PDWPFR5T.js";
42
- import "./chunk-Y5PA7DVK.js";
41
+ import "./chunk-LEMHGORE.js";
42
+ import "./chunk-6ETYWCJN.js";
43
43
  import {
44
44
  isErrorWithCause
45
45
  } from "./chunk-BF5DRGRZ.js";
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  stderr,
17
17
  stdout
18
- } from "./chunk-MSWOR3FV.js";
18
+ } from "./chunk-C75GDQFE.js";
19
19
  import "./chunk-LGQVZTYR.js";
20
20
  import "./chunk-EYGOEAJM.js";
21
21
  import {
@@ -36,17 +36,16 @@ import {
36
36
  } from "./chunk-6D3QAFNZ.js";
37
37
  import {
38
38
  CacheEntry
39
- } from "./chunk-Q2UEILN6.js";
39
+ } from "./chunk-NB7QVWHU.js";
40
40
  import "./chunk-QNHBAGXQ.js";
41
- import "./chunk-M242QVJS.js";
41
+ import "./chunk-HHSPE2DS.js";
42
42
  import {
43
43
  assertOk
44
44
  } from "./chunk-4GMNWW4C.js";
45
45
  import "./chunk-SUU2WETN.js";
46
- import "./chunk-B6RIGNEO.js";
46
+ import "./chunk-ZESNN24A.js";
47
47
  import "./chunk-XNLSTHDK.js";
48
48
  import {
49
- readStoreIndex,
50
49
  removeStoreEntry,
51
50
  storeEntryCopied,
52
51
  storeEntryLastCopied,
@@ -54,9 +53,12 @@ import {
54
53
  storeEntryNames,
55
54
  storeEntryTime,
56
55
  verifyStoreEntry
57
- } from "./chunk-N6HV7JWC.js";
58
- import "./chunk-PDWPFR5T.js";
59
- import "./chunk-Y5PA7DVK.js";
56
+ } from "./chunk-QFPAFVRR.js";
57
+ import {
58
+ readStoreIndex
59
+ } from "./chunk-24DWRCPS.js";
60
+ import "./chunk-LEMHGORE.js";
61
+ import "./chunk-6ETYWCJN.js";
60
62
  import {
61
63
  integrityHex
62
64
  } from "./chunk-BF5DRGRZ.js";
@@ -6964,6 +6964,193 @@ import {
6964
6964
  unzipSync as unzipSyncCB
6965
6965
  } from "node:zlib";
6966
6966
 
6967
+ // ../../src/output/src/trace.ts
6968
+ import { appendFileSync } from "node:fs";
6969
+ import { monitorEventLoopDelay, performance as performance2 } from "node:perf_hooks";
6970
+ import { threadId as ownThreadId } from "node:worker_threads";
6971
+ var sharedNow = () => performance2.timeOrigin + performance2.now();
6972
+ var defaultAppend = (file, data) => appendFileSync(file, data, { mode: 384 });
6973
+ var defaultWrite = (line) => process.stderr.write(line + "\n");
6974
+ var Tracer = class _Tracer {
6975
+ enabled;
6976
+ file;
6977
+ phases;
6978
+ #tid;
6979
+ #now;
6980
+ #append;
6981
+ #write;
6982
+ #flushLines;
6983
+ #flushMs;
6984
+ #buffer = [];
6985
+ #timer;
6986
+ #sampler;
6987
+ #marks = [];
6988
+ #start;
6989
+ #loop;
6990
+ #closed = false;
6991
+ constructor(options = {}) {
6992
+ this.file = options.file || void 0;
6993
+ this.phases = !!options.phases;
6994
+ this.enabled = !!this.file || this.phases;
6995
+ this.#tid = options.threadId ?? ownThreadId;
6996
+ this.#now = options.now ?? sharedNow;
6997
+ this.#append = options.append ?? defaultAppend;
6998
+ this.#write = options.write ?? defaultWrite;
6999
+ this.#flushLines = options.flushLines ?? 200;
7000
+ this.#flushMs = options.flushMs ?? 50;
7001
+ this.#start = this.#now();
7002
+ if (!this.enabled) return;
7003
+ const main2 = options.main ?? this.#tid === 0;
7004
+ if (main2) {
7005
+ this.#loop = monitorEventLoopDelay({ resolution: 20 });
7006
+ this.#loop.enable();
7007
+ const sampleMs = options.sampleMs ?? 20;
7008
+ if (this.file && sampleMs > 0) {
7009
+ this.#sampler = setInterval(() => this.sample(), sampleMs);
7010
+ this.#sampler.unref();
7011
+ }
7012
+ process.once("exit", () => this.close());
7013
+ }
7014
+ this.trace("open", { pid: process.pid });
7015
+ }
7016
+ /**
7017
+ * Build a tracer from the environment: `VLT_TRACE` names the file,
7018
+ * `VLT_PHASES` (any value but `0` or empty) asks for the summary.
7019
+ */
7020
+ static fromEnv(env = process.env, options = {}) {
7021
+ const phases = env.VLT_PHASES;
7022
+ return new _Tracer({
7023
+ ...options,
7024
+ file: env.VLT_TRACE,
7025
+ phases: !!phases && phases !== "0"
7026
+ });
7027
+ }
7028
+ /** Record one event. */
7029
+ trace(ev, fields) {
7030
+ if (!this.file || this.#closed) return;
7031
+ const event = { t: this.#now(), tid: this.#tid, ev };
7032
+ if (fields) {
7033
+ for (const [k3, v2] of Object.entries(fields)) {
7034
+ if (v2 !== void 0) event[k3] = v2;
7035
+ }
7036
+ }
7037
+ this.#buffer.push(JSON.stringify(event));
7038
+ if (this.#buffer.length >= this.#flushLines) this.flush();
7039
+ else if (!this.#timer) {
7040
+ this.#timer = setTimeout(() => this.flush(), this.#flushMs);
7041
+ this.#timer.unref();
7042
+ }
7043
+ }
7044
+ /**
7045
+ * Record a `<ev>:start` event now and return a function that records
7046
+ * `<ev>:end` with the elapsed `ms` (plus any fields it is given). The
7047
+ * same `fields` are stamped on both ends so the two can be paired.
7048
+ */
7049
+ span(ev, fields) {
7050
+ if (!this.file) return noop;
7051
+ const t0 = this.#now();
7052
+ this.trace(`${ev}:start`, fields);
7053
+ return (end) => this.trace(`${ev}:end`, {
7054
+ ...fields,
7055
+ ...end,
7056
+ ms: Math.round((this.#now() - t0) * 1e3) / 1e3
7057
+ });
7058
+ }
7059
+ /**
7060
+ * Mark the start of a phase. The summary reports the ms between each
7061
+ * mark and the next one, and the trace records a `phase` event.
7062
+ */
7063
+ mark(name2, fields) {
7064
+ if (!this.enabled) return;
7065
+ this.#marks.push({ name: name2, t: this.#now() });
7066
+ this.trace("phase", { ...fields, name: name2 });
7067
+ }
7068
+ /**
7069
+ * Record how busy a resource lane is: how many jobs it is running and
7070
+ * how many are waiting for a slot. The report derives idle time per
7071
+ * lane from these.
7072
+ */
7073
+ lane(name2, busy, queued) {
7074
+ if (!this.file) return;
7075
+ this.trace("lane", { name: name2, busy, queued });
7076
+ }
7077
+ /** Record a memory sample. */
7078
+ sample() {
7079
+ if (!this.file) return;
7080
+ const m = process.memoryUsage();
7081
+ this.trace("rss", {
7082
+ rss: m.rss,
7083
+ heap: m.heapUsed,
7084
+ ext: m.external,
7085
+ ab: m.arrayBuffers
7086
+ });
7087
+ }
7088
+ /** Write buffered lines to the file. */
7089
+ flush() {
7090
+ if (this.#timer) {
7091
+ clearTimeout(this.#timer);
7092
+ this.#timer = void 0;
7093
+ }
7094
+ if (!this.file || !this.#buffer.length) return;
7095
+ const data = this.#buffer.join("\n") + "\n";
7096
+ this.#buffer = [];
7097
+ try {
7098
+ this.#append(this.file, data);
7099
+ } catch {
7100
+ }
7101
+ }
7102
+ /**
7103
+ * The one-line phase summary, or undefined when phases are off. Each
7104
+ * phase is reported as the ms from its mark to the next mark (or to
7105
+ * now, for the last one).
7106
+ */
7107
+ summary() {
7108
+ if (!this.phases) return void 0;
7109
+ const now = this.#now();
7110
+ const parts = [];
7111
+ for (const [i, m] of this.#marks.entries()) {
7112
+ const next = this.#marks[i + 1]?.t ?? now;
7113
+ parts.push(`${m.name}=${Math.round(next - m.t)}`);
7114
+ }
7115
+ parts.push(`total=${Math.round(now - this.#start)}`);
7116
+ if (this.#loop) {
7117
+ const ms2 = (n7) => Math.round(n7 / 1e6);
7118
+ parts.push(
7119
+ `loop p50=${ms2(this.#loop.percentile(50))} p99=${ms2(this.#loop.percentile(99))} max=${ms2(this.#loop.max)}`
7120
+ );
7121
+ }
7122
+ const { maxRSS } = process.resourceUsage();
7123
+ parts.push(`maxrss=${Math.round(maxRSS / 1024)}MB`);
7124
+ return `PHASES ${parts.join(" ")}`;
7125
+ }
7126
+ /**
7127
+ * Stop sampling, flush, and print the summary. Runs at process exit
7128
+ * on the main thread; safe to call more than once.
7129
+ */
7130
+ close() {
7131
+ if (this.#closed) return;
7132
+ if (this.#sampler) clearInterval(this.#sampler);
7133
+ if (this.enabled) {
7134
+ if (this.#loop) {
7135
+ this.#loop.disable();
7136
+ this.trace("exit", {
7137
+ loopP50: Math.round(this.#loop.percentile(50) / 1e6),
7138
+ loopP99: Math.round(this.#loop.percentile(99) / 1e6),
7139
+ loopMax: Math.round(this.#loop.max / 1e6),
7140
+ maxrss: process.resourceUsage().maxRSS
7141
+ });
7142
+ }
7143
+ const line = this.summary();
7144
+ this.flush();
7145
+ if (line) this.#write(line);
7146
+ }
7147
+ this.#closed = true;
7148
+ }
7149
+ };
7150
+ var noop = () => {
7151
+ };
7152
+ var tracer = Tracer.fromEnv();
7153
+
6967
7154
  // ../../src/tar/src/find-tar-dir.ts
6968
7155
  var findTarDir = (path, tarDir) => {
6969
7156
  if (tarDir !== void 0) return tarDir;
@@ -7242,7 +7429,7 @@ import {
7242
7429
  writeFileSync as writeFileSync2
7243
7430
  } from "node:fs";
7244
7431
  import { join as join2 } from "node:path";
7245
- import { performance as performance2 } from "node:perf_hooks";
7432
+ import { performance as performance3 } from "node:perf_hooks";
7246
7433
  import { debuglog as debuglog3 } from "node:util";
7247
7434
  var debug3 = debuglog3("vlt");
7248
7435
  var linkers = /* @__PURE__ */ new Set(["auto", "hardlink", "clone", "copy"]);
@@ -7313,7 +7500,7 @@ var explodeEntry = (store, buf, format) => {
7313
7500
  };
7314
7501
  var explode = async (cache, store, keys, integrities) => {
7315
7502
  if (!storeEnabled()) return;
7316
- const start = performance2.now();
7503
+ const start = performance3.now();
7317
7504
  const s = {
7318
7505
  exploded: /* @__PURE__ */ new Set(),
7319
7506
  written: 0,
@@ -7355,7 +7542,7 @@ var explode = async (cache, store, keys, integrities) => {
7355
7542
  keys.length
7356
7543
  );
7357
7544
  await Promise.all(Array.from({ length: lanes }, lane));
7358
- s.ms = Math.round(performance2.now() - start);
7545
+ s.ms = Math.round(performance3.now() - start);
7359
7546
  debug3(
7360
7547
  "global store: explode written=%d skipped=%d ignored=%d failed=%d bytes=%d ms=%d",
7361
7548
  s.written,
@@ -0,0 +1,79 @@
1
+ var global = globalThis;
2
+ import {Buffer} from "node:buffer";
3
+ import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
+ globalThis.setTimeout = _vlt_setTimeout;
5
+ globalThis.clearTimeout = _vlt_clearTimeout;
6
+ globalThis.setImmediate = _vlt_setImmediate;
7
+ globalThis.clearImmediate = _vlt_clearImmediate;
8
+ globalThis.setInterval = _vlt_setInterval;
9
+ globalThis.clearInterval = _vlt_clearInterval;
10
+ import {createRequire as _vlt_createRequire} from "node:module";
11
+ var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ isManifest,
14
+ normalizeBinPaths
15
+ } from "./chunk-BF5DRGRZ.js";
16
+ import {
17
+ error
18
+ } from "./chunk-WZWDS3W4.js";
19
+
20
+ // ../../src/tar/src/store-index.ts
21
+ import { readFileSync } from "node:fs";
22
+ import { debuglog } from "node:util";
23
+ var debug = debuglog("vlt");
24
+ var storeIndexPath = (storeEntry) => storeEntry + ".json";
25
+ var isRecord = (x) => !!x && typeof x === "object" && !Array.isArray(x);
26
+ var isOptString = (x) => x === void 0 || typeof x === "string";
27
+ var unsafePath = /(?:^|\/)\.{0,2}(?:\/|$)|\\/;
28
+ var isRelPath = (p) => typeof p === "string" && !unsafePath.test(p);
29
+ var isIndexFile = (f) => Array.isArray(f) && f.length === 3 && isRelPath(f[0]) && typeof f[1] === "number" && (f[2] === 0 || f[2] === 1);
30
+ var isStoreIndex = (x) => isRecord(x) && x.v === 1 && typeof x.scripts === "boolean" && isOptString(x.name) && isOptString(x.version) && (x.bins === void 0 || isRecord(x.bins) && Object.values(x.bins).every((b) => typeof b === "string")) && Array.isArray(x.dirs) && x.dirs.every(isRelPath) && Array.isArray(x.files) && x.files.every(isIndexFile) && isOptString(x.manifest);
31
+ var readStoreIndex = (storeEntry) => {
32
+ let index;
33
+ try {
34
+ index = JSON.parse(
35
+ readFileSync(storeIndexPath(storeEntry), "utf8")
36
+ );
37
+ } catch (er) {
38
+ if (er.code !== "ENOENT") {
39
+ debug("global store: invalid index", storeEntry);
40
+ }
41
+ return void 0;
42
+ }
43
+ if (isStoreIndex(index)) return index;
44
+ debug("global store: invalid index", storeEntry);
45
+ return void 0;
46
+ };
47
+ var storeIndexManifest = (packageJson, bindingGyp) => {
48
+ let pkg;
49
+ try {
50
+ pkg = JSON.parse(
51
+ packageJson.toString("utf8").replace(/^\uFEFF/, "")
52
+ );
53
+ } catch (cause) {
54
+ throw error("invalid package.json in tarball", { cause });
55
+ }
56
+ if (!isRecord(pkg)) {
57
+ throw error("invalid package.json in tarball", { found: pkg });
58
+ }
59
+ const { name, version, scripts, bin } = pkg;
60
+ const s = isRecord(scripts) ? scripts : {};
61
+ const result = {
62
+ scripts: !!(s.install || s.preinstall || s.postinstall) || bindingGyp
63
+ };
64
+ const bins = normalizeBinPaths({
65
+ name: typeof name === "string" ? name : void 0,
66
+ bin
67
+ });
68
+ if (bins && Object.keys(bins).length) result.bins = bins;
69
+ if (typeof name === "string") result.name = name;
70
+ if (typeof version === "string") result.version = version;
71
+ if (isManifest(pkg)) result.manifest = JSON.stringify(pkg);
72
+ return result;
73
+ };
74
+
75
+ export {
76
+ storeIndexPath,
77
+ readStoreIndex,
78
+ storeIndexManifest
79
+ };
@@ -0,0 +1,77 @@
1
+ var global = globalThis;
2
+ import {Buffer} from "node:buffer";
3
+ import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
+ globalThis.setTimeout = _vlt_setTimeout;
5
+ globalThis.clearTimeout = _vlt_clearTimeout;
6
+ globalThis.setImmediate = _vlt_setImmediate;
7
+ globalThis.clearImmediate = _vlt_clearImmediate;
8
+ globalThis.setInterval = _vlt_setInterval;
9
+ globalThis.clearInterval = _vlt_clearInterval;
10
+ import {createRequire as _vlt_createRequire} from "node:module";
11
+ var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ error
14
+ } from "./chunk-WZWDS3W4.js";
15
+ import {
16
+ __glob
17
+ } from "./chunk-PZLD7RTK.js";
18
+
19
+ // import("./commands/**/*.ts") in ../../src/cli-sdk/src/load-command.ts
20
+ var globImport_commands_ts = __glob({
21
+ "./commands/access.ts": () => import("./access-LNHKSCBO.js"),
22
+ "./commands/bugs.ts": () => import("./bugs-PSOZGCKG.js"),
23
+ "./commands/build.ts": () => import("./build-GBIF54BN.js"),
24
+ "./commands/cache.ts": () => import("./cache-XOYAGCIO.js"),
25
+ "./commands/ci.ts": () => import("./ci-XSH7DZGD.js"),
26
+ "./commands/config.ts": () => import("./config-6XFBWC3U.js"),
27
+ "./commands/create.ts": () => import("./create-UNCQKKBS.js"),
28
+ "./commands/deprecate.ts": () => import("./deprecate-HCVFAVZD.js"),
29
+ "./commands/dist-tag.ts": () => import("./dist-tag-WXLJRWFJ.js"),
30
+ "./commands/docs.ts": () => import("./docs-5EFY7ZHN.js"),
31
+ "./commands/exec-cache.ts": () => import("./exec-cache-EMUFVFCJ.js"),
32
+ "./commands/exec-local.ts": () => import("./exec-local-L5H4M37T.js"),
33
+ "./commands/exec.ts": () => import("./exec-EC5D5GE3.js"),
34
+ "./commands/help.ts": () => import("./help-FUHVZ6UH.js"),
35
+ "./commands/init.ts": () => import("./init-63M6W7N4.js"),
36
+ "./commands/install.ts": () => import("./install-IHQRULIE.js"),
37
+ "./commands/install/reporter.ts": () => import("./reporter-S6DDAHQL.js"),
38
+ "./commands/list.ts": () => import("./list-EDXNWJJR.js"),
39
+ "./commands/login.ts": () => import("./login-OD7E5AO5.js"),
40
+ "./commands/logout.ts": () => import("./logout-V2WJTQV2.js"),
41
+ "./commands/outdated.ts": () => import("./outdated-7N7NGSSR.js"),
42
+ "./commands/pack.ts": () => import("./pack-TKJW7AEB.js"),
43
+ "./commands/ping.ts": () => import("./ping-PVWRNSCX.js"),
44
+ "./commands/pkg.ts": () => import("./pkg-PDP4XR5S.js"),
45
+ "./commands/profile.ts": () => import("./profile-BP5EALWS.js"),
46
+ "./commands/publish.ts": () => import("./publish-HCICK5LY.js"),
47
+ "./commands/query.ts": () => import("./query-TZ3BPC4B.js"),
48
+ "./commands/registry.ts": () => import("./registry-ZGGWVLBM.js"),
49
+ "./commands/repo.ts": () => import("./repo-BYOSXG5J.js"),
50
+ "./commands/run-exec.ts": () => import("./run-exec-GGENQDEW.js"),
51
+ "./commands/run.ts": () => import("./run-JAVVTY7B.js"),
52
+ "./commands/setup.ts": () => import("./setup-I6GLYILV.js"),
53
+ "./commands/skills.ts": () => import("./skills-5V6HKMA7.js"),
54
+ "./commands/token.ts": () => import("./token-JEAMCRK6.js"),
55
+ "./commands/uninstall.ts": () => import("./uninstall-WA4FJFVA.js"),
56
+ "./commands/unpublish.ts": () => import("./unpublish-SG3J524L.js"),
57
+ "./commands/update.ts": () => import("./update-Y3KY2DZD.js"),
58
+ "./commands/version.ts": () => import("./version-QBEPMA7Q.js"),
59
+ "./commands/view.ts": () => import("./view-FYRF3SLJ.js"),
60
+ "./commands/whoami.ts": () => import("./whoami-XSQ6SOIC.js")
61
+ });
62
+
63
+ // ../../src/cli-sdk/src/load-command.ts
64
+ var loadCommand = async (command) => {
65
+ try {
66
+ return await globImport_commands_ts(`./commands/${command}.ts`);
67
+ } catch (e) {
68
+ throw error("Could not load command", {
69
+ found: command,
70
+ cause: e
71
+ });
72
+ }
73
+ };
74
+
75
+ export {
76
+ loadCommand
77
+ };
@@ -11,13 +11,13 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  PackageInfoClient
14
- } from "./chunk-IHERL3TA.js";
14
+ } from "./chunk-3UDBYFAH.js";
15
15
  import {
16
16
  Monorepo,
17
17
  PackageJson,
18
18
  PathScurry,
19
19
  workspaceCache
20
- } from "./chunk-KURQHX54.js";
20
+ } from "./chunk-6ISFYONV.js";
21
21
  import {
22
22
  ensureGlobalProject,
23
23
  globalCommands