@vltpkg/cli-js 1.5.0 → 1.6.0

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 (98) hide show
  1. package/{access-QPX4QXV4.js → access-AJ654YKY.js} +8 -8
  2. package/{bugs-TLOECXEM.js → bugs-N73DVYHD.js} +23 -19
  3. package/{build-IQOS3LKO.js → build-VZ3EZKMM.js} +49 -14
  4. package/{cache-O5IBYYSB.js → cache-VROEWG2C.js} +16 -13
  5. package/cache-unzip-src-unzip.js +23 -4
  6. package/{chunk-7UWRR6EE.js → chunk-22LZBDEC.js} +1 -1
  7. package/{chunk-4UH3KMTD.js → chunk-36UIE654.js} +252 -448
  8. package/{chunk-43EJ4Q42.js → chunk-3JIN46K5.js} +1 -1
  9. package/{chunk-35EG6T3J.js → chunk-44AWMA4F.js} +21 -9
  10. package/chunk-4E65BBTM.js +77 -0
  11. package/{chunk-5KW6AOTT.js → chunk-4GMNWW4C.js} +1 -1
  12. package/{chunk-LUVDMEW4.js → chunk-6D3QAFNZ.js} +1 -1
  13. package/{chunk-6W5XMVIZ.js → chunk-75HGJVNG.js} +7 -7
  14. package/{chunk-UZ6ICZE3.js → chunk-7M2VTFLP.js} +12 -1
  15. package/{chunk-XCSNI6AO.js → chunk-ANW36H4T.js} +4 -4
  16. package/{chunk-6LZM3I4Q.js → chunk-BF5DRGRZ.js} +25 -4
  17. package/chunk-BH5CVXNY.js +115 -0
  18. package/{chunk-F7NPYSI2.js → chunk-CAV7FKWQ.js} +2 -2
  19. package/{chunk-MYX4JCIJ.js → chunk-CYK6I4M6.js} +1 -1
  20. package/chunk-DXED4ARV.js +436 -0
  21. package/chunk-E74WGW5C.js +49 -0
  22. package/{chunk-CMLDLZZ3.js → chunk-EFHOWRKU.js} +56 -0
  23. package/{chunk-IFEZ6BFV.js → chunk-EMTGRCSE.js} +2 -2
  24. package/{chunk-4TSHLSRK.js → chunk-EYGOEAJM.js} +1 -1
  25. package/{chunk-2U4PVHP4.js → chunk-F5LZMLAQ.js} +123 -40
  26. package/{chunk-Z5D5KODU.js → chunk-FXD3IV2S.js} +4 -2
  27. package/chunk-GCTREKA4.js +115 -0
  28. package/{chunk-G3FZ2ZJK.js → chunk-GEQFMH5M.js} +1 -1
  29. package/{chunk-CS6AYPY5.js → chunk-GZVI75KX.js} +6 -13
  30. package/{chunk-CW56EJIL.js → chunk-HT6FS4VB.js} +1 -1
  31. package/{chunk-LH7J5BDU.js → chunk-IXAMCWIT.js} +3 -3
  32. package/{chunk-ARE7FKDG.js → chunk-JCNI6ZHH.js} +5 -5
  33. package/chunk-JV5XR5JQ.js +349 -0
  34. package/{chunk-IJUVVD7E.js → chunk-KD5ZK72K.js} +1 -1
  35. package/{chunk-WHWPAYZY.js → chunk-KVWGMSPW.js} +26 -6
  36. package/{chunk-VR7NRWAD.js → chunk-LCLRP64K.js} +8 -8
  37. package/{chunk-X6JKMIOU.js → chunk-LGQVZTYR.js} +4 -36
  38. package/{chunk-XCQCYB6G.js → chunk-LP3ORD3D.js} +142 -16
  39. package/chunk-MCDLJZXT.js +82 -0
  40. package/{chunk-ISAMD2FE.js → chunk-N6HV7JWC.js} +1 -1
  41. package/chunk-O6MQ7NN6.js +1155 -0
  42. package/{chunk-3S3W7QEM.js → chunk-PC2HOBAQ.js} +3 -3
  43. package/{chunk-GUP55DM6.js → chunk-RBQO54TG.js} +2 -2
  44. package/{chunk-C6ZVVEFV.js → chunk-TQQO2F56.js} +4 -3
  45. package/{chunk-XD5KUDXX.js → chunk-TWDSXQPN.js} +10 -8
  46. package/{chunk-T5EP7QEF.js → chunk-VLVMLSIF.js} +2 -2
  47. package/{chunk-SMXXFQPI.js → chunk-YTDABXPD.js} +3 -3
  48. package/{ci-ESVUMOZO.js → ci-3BVMVQIT.js} +21 -17
  49. package/cli-package.json +3 -1
  50. package/{config-ZVVLFKR7.js → config-2KQV7N5A.js} +12 -11
  51. package/{config-TMB2X6DW.js → config-EKHBW6I5.js} +10 -9
  52. package/{create-BLTNKSBQ.js → create-QVHNOIV3.js} +28 -24
  53. package/{deprecate-VA6PGHYL.js → deprecate-E254QBH6.js} +12 -12
  54. package/{dist-tag-OYJREFO2.js → dist-tag-SITRFD7O.js} +8 -8
  55. package/{docs-6OC3OQNM.js → docs-IDL2P7CA.js} +23 -19
  56. package/{exec-AZPGFVRY.js → exec-7BK2W2WL.js} +28 -24
  57. package/{exec-cache-D75UY2WI.js → exec-cache-VY46L7DR.js} +24 -20
  58. package/{exec-local-E2JKB4X4.js → exec-local-D7R5T3DF.js} +22 -18
  59. package/{help-UPW77X5N.js → help-RMRIEJQL.js} +5 -4
  60. package/{init-SNO6QL7C.js → init-BGW4HJ6V.js} +13 -12
  61. package/{install-TEJM2YVX.js → install-U5GATZ2N.js} +108 -52
  62. package/{list-NHCC2RNB.js → list-3VG4M2XL.js} +29 -22
  63. package/{login-XNZXCGFD.js → login-PHQWI6S6.js} +14 -13
  64. package/{logout-YCM7O36Q.js → logout-DJCOGRFF.js} +8 -8
  65. package/{outdated-4LA7N63W.js → outdated-JH3O6R3Y.js} +18 -17
  66. package/{pack-RC4CZSWF.js → pack-U5W5YWHK.js} +15 -14
  67. package/package.json +1 -1
  68. package/{ping-RLVAZGDL.js → ping-EKX43AOW.js} +8 -8
  69. package/{pkg-FED5C6TP.js → pkg-SW5GMERT.js} +15 -14
  70. package/{profile-DJZNLQPG.js → profile-UGDRDMQ6.js} +8 -8
  71. package/{publish-54AMVMTQ.js → publish-HTWKK3NN.js} +24 -20
  72. package/{query-ZQLMSJ7O.js → query-YE3FUVGG.js} +29 -22
  73. package/{registry-6HKQYSZX.js → registry-ZGGWVLBM.js} +5 -5
  74. package/registry-client-src-revalidate.js +41 -11
  75. package/{repo-ITA4BLZ4.js → repo-WDOCU6SE.js} +23 -19
  76. package/{reporter-UYVR2WMB.js → reporter-N5PAXB26.js} +61 -15
  77. package/{run-TP2HTJRN.js → run-IPARVIIQ.js} +22 -18
  78. package/{run-exec-UGCC53DV.js → run-exec-C4RTREEW.js} +22 -18
  79. package/security-archive-src-update-expired.js +24 -5
  80. package/{setup-XPAM5U3Z.js → setup-SYYUEHZL.js} +206 -27
  81. package/{skills-YD2TB2VD.js → skills-KA2VR5Q5.js} +41 -56
  82. package/{skills-LR6GXW3X.js → skills-UBBMSBDQ.js} +24 -21
  83. package/{src-34D4DOOH.js → src-FUSTSM4J.js} +25 -19
  84. package/{src-H6DFCAPH.js → src-QO5G2S4O.js} +6 -4
  85. package/{src-LHDC4NJO.js → src-W2VQULRG.js} +2 -2
  86. package/{token-OF63PFTQ.js → token-UQNABECH.js} +10 -9
  87. package/{uninstall-B54FQ5KQ.js → uninstall-FHBJ3OUV.js} +53 -17
  88. package/{unpublish-CSHIGMDQ.js → unpublish-APJTEUBA.js} +8 -8
  89. package/{update-HS4VJ5ZG.js → update-NWZTL4S7.js} +19 -17
  90. package/{version-L7S3DHUS.js → version-EMKKTL77.js} +14 -13
  91. package/{view-NWKKWFVA.js → view-BUUI33RV.js} +12 -12
  92. package/vlr.js +1 -1
  93. package/vlrx.js +1 -1
  94. package/vlt.js +1 -1
  95. package/vlx.js +1 -1
  96. package/vlxl.js +1 -1
  97. package/{whoami-65K35VGW.js → whoami-F6BSXGQ2.js} +8 -8
  98. package/chunk-T2VBCUF5.js +0 -77
@@ -14,12 +14,12 @@ import {
14
14
  SecurityArchive,
15
15
  pRetry,
16
16
  usesNpmRegistry
17
- } from "./chunk-SMXXFQPI.js";
17
+ } from "./chunk-YTDABXPD.js";
18
18
  import {
19
19
  Monorepo,
20
20
  PackageJson,
21
21
  minimatch
22
- } from "./chunk-C6ZVVEFV.js";
22
+ } from "./chunk-TQQO2F56.js";
23
23
  import {
24
24
  asDepID,
25
25
  baseDepID,
@@ -33,13 +33,13 @@ import {
33
33
  joinExtra,
34
34
  splitDepID,
35
35
  splitExtra
36
- } from "./chunk-F7NPYSI2.js";
36
+ } from "./chunk-CAV7FKWQ.js";
37
37
  import {
38
38
  Spec as Spec2
39
- } from "./chunk-LUVDMEW4.js";
39
+ } from "./chunk-6D3QAFNZ.js";
40
40
  import {
41
41
  userAgentHeaders
42
- } from "./chunk-G3FZ2ZJK.js";
42
+ } from "./chunk-GEQFMH5M.js";
43
43
  import {
44
44
  graphStep
45
45
  } from "./chunk-B6RIGNEO.js";
@@ -83,7 +83,7 @@ import {
83
83
  shortDependencyTypes,
84
84
  subset,
85
85
  tarballFormat
86
- } from "./chunk-6LZM3I4Q.js";
86
+ } from "./chunk-BF5DRGRZ.js";
87
87
  import {
88
88
  error,
89
89
  syntaxError,
@@ -5009,21 +5009,21 @@ var Graph = class {
5009
5009
  const rest = [];
5010
5010
  const importers = this.importers.values();
5011
5011
  let seenImporters = 0;
5012
- let sorted = true;
5012
+ let sorted2 = true;
5013
5013
  let prev;
5014
5014
  for (const node of this.nodes.values()) {
5015
5015
  if (this.importers.has(node)) {
5016
5016
  if (rest.length || importers.next().value !== node) {
5017
- sorted = false;
5017
+ sorted2 = false;
5018
5018
  }
5019
5019
  seenImporters++;
5020
5020
  continue;
5021
5021
  }
5022
- if (sorted && prev && cmp(prev, node) > 0) sorted = false;
5022
+ if (sorted2 && prev && cmp(prev, node) > 0) sorted2 = false;
5023
5023
  prev = node;
5024
5024
  rest.push(node);
5025
5025
  }
5026
- if (sorted && seenImporters === this.importers.size) return;
5026
+ if (sorted2 && seenImporters === this.importers.size) return;
5027
5027
  rest.sort(cmp);
5028
5028
  const nodes = /* @__PURE__ */ new Map();
5029
5029
  for (const node of this.importers) nodes.set(node.id, node);
@@ -5064,6 +5064,7 @@ var Graph = class {
5064
5064
  }
5065
5065
  return edge;
5066
5066
  }
5067
+ edge.to?.edgesIn.delete(edge);
5067
5068
  this.edges.delete(edge);
5068
5069
  }
5069
5070
  this.mutations++;
@@ -9805,7 +9806,7 @@ var Query = class {
9805
9806
  };
9806
9807
 
9807
9808
  // ../../src/graph/src/skills/lazy.ts
9808
- var load3 = () => import("./skills-YD2TB2VD.js");
9809
+ var load3 = () => import("./skills-KA2VR5Q5.js");
9809
9810
  var listSkills = async (o) => (await load3()).listSkills(o);
9810
9811
  var linkSkills = async (o) => (await load3()).linkSkills(o);
9811
9812
  var hasSkills = async (node) => isNode(node) && (await load3()).shipsSkills(node);
@@ -9889,15 +9890,79 @@ var assertQuery = async (selector, flag, partSelectors) => {
9889
9890
  }
9890
9891
  };
9891
9892
 
9893
+ // ../../src/graph/src/skills/gitignore.ts
9894
+ import { lstatSync as lstatSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
9895
+ import { join as join2 } from "node:path";
9896
+ var GITIGNORE_BEGIN = "# >>> vlt agent skills (links into node_modules)";
9897
+ var GITIGNORE_END = "# <<< vlt agent skills";
9898
+ var sorted = (names) => [...names].sort((a, b) => a.localeCompare(b, "en")).map((n) => `/${n}`);
9899
+ var findBlock = (lines) => {
9900
+ const begin = lines.findIndex((l) => l.trim() === GITIGNORE_BEGIN);
9901
+ const end = lines.findIndex(
9902
+ (l, i) => begin !== -1 && i > begin && l.trim() === GITIGNORE_END
9903
+ );
9904
+ return { begin, end };
9905
+ };
9906
+ var update = (file, { add, remove }) => {
9907
+ const st = lstatSync2(file, { throwIfNoEntry: false });
9908
+ if (st && !st.isFile()) return "refused";
9909
+ const text = st ? readFileSync3(file, "utf8") : "";
9910
+ const eol = text.includes("\r\n") ? "\r\n" : "\n";
9911
+ const lines = text.split(eol);
9912
+ const { begin, end } = findBlock(lines);
9913
+ let out;
9914
+ if (end === -1) {
9915
+ if (!add.length) return "ok";
9916
+ out = (text && !text.endsWith(eol) ? text + eol : text) + [GITIGNORE_BEGIN, ...sorted(add), GITIGNORE_END].join(eol) + eol;
9917
+ } else {
9918
+ const rm2 = new Set(sorted(remove));
9919
+ const block = lines.slice(begin + 1, end).filter((l) => !rm2.has(l.trim()));
9920
+ const have = new Set(block.map((l) => l.trim()));
9921
+ lines.splice(
9922
+ begin + 1,
9923
+ end - begin - 1,
9924
+ ...block,
9925
+ ...sorted(add).filter((l) => !have.has(l))
9926
+ );
9927
+ out = lines.join(eol);
9928
+ }
9929
+ if (out !== text) writeFileSync2(file, out);
9930
+ return "ok";
9931
+ };
9932
+ var editGitignore = (dir, edit) => {
9933
+ try {
9934
+ return update(join2(dir, ".gitignore"), edit);
9935
+ } catch {
9936
+ return "refused";
9937
+ }
9938
+ };
9939
+ var gitignoreNames = (dir) => {
9940
+ try {
9941
+ const file = join2(dir, ".gitignore");
9942
+ if (!lstatSync2(file, { throwIfNoEntry: false })?.isFile()) {
9943
+ return /* @__PURE__ */ new Set();
9944
+ }
9945
+ const lines = readFileSync3(file, "utf8").split(/\r?\n/);
9946
+ const { begin, end } = findBlock(lines);
9947
+ if (end === -1) return /* @__PURE__ */ new Set();
9948
+ return new Set(
9949
+ lines.slice(begin + 1, end).map((l) => l.trim()).filter((l) => l.startsWith("/")).map((l) => l.slice(1))
9950
+ );
9951
+ } catch {
9952
+ return /* @__PURE__ */ new Set();
9953
+ }
9954
+ };
9955
+
9892
9956
  // ../../src/graph/src/skills/mounts.ts
9893
9957
  import {
9894
- lstatSync as lstatSync2,
9958
+ existsSync as existsSync2,
9959
+ lstatSync as lstatSync3,
9895
9960
  readdirSync as readdirSync2,
9896
9961
  readlinkSync,
9897
9962
  realpathSync,
9898
9963
  unlinkSync
9899
9964
  } from "node:fs";
9900
- import { dirname as dirname3, join as join2, relative as relative2, resolve as resolve5, sep } from "node:path";
9965
+ import { dirname as dirname3, join as join3, relative as relative2, resolve as resolve5, sep } from "node:path";
9901
9966
 
9902
9967
  // ../../src/graph/src/reify/symlink-sync.ts
9903
9968
  import { mkdirSync as mkdirSync2, symlinkSync } from "node:fs";
@@ -9915,7 +9980,7 @@ var symlinkSyncMkdirp = (target, link2, type2) => {
9915
9980
  // ../../src/graph/src/skills/mounts.ts
9916
9981
  var lstat = (path2) => {
9917
9982
  try {
9918
- return lstatSync2(path2, { throwIfNoEntry: false });
9983
+ return lstatSync3(path2, { throwIfNoEntry: false });
9919
9984
  } catch {
9920
9985
  return void 0;
9921
9986
  }
@@ -9933,12 +9998,22 @@ var realOr = (p) => {
9933
9998
  };
9934
9999
  var samePath = (a, b) => norm(realOr(a)) === norm(realOr(b));
9935
10000
  var storeSeg = `${sep}node_modules${sep}.vlt${sep}`;
9936
- var mountTarget = (link2) => {
10001
+ var linkTarget = (link2) => {
9937
10002
  if (!lstat(link2)?.isSymbolicLink()) return void 0;
9938
10003
  let raw = readlinkSync(link2);
9939
10004
  if (raw.startsWith("\\\\?\\")) raw = raw.slice(4);
9940
- const target = resolve5(dirname3(link2), raw);
9941
- return norm(target).includes(storeSeg) ? target : void 0;
10005
+ return resolve5(dirname3(link2), raw);
10006
+ };
10007
+ var mountTarget = (link2) => {
10008
+ const target = linkTarget(link2);
10009
+ return target && norm(target).includes(storeSeg) ? target : void 0;
10010
+ };
10011
+ var workspaceOf = (target, workspaces) => {
10012
+ const t = norm(realOr(target));
10013
+ return workspaces.filter(({ path: path2 }) => {
10014
+ const p = norm(path2);
10015
+ return t === p || t.startsWith(p + sep);
10016
+ }).sort((a, b) => b.path.length - a.path.length)[0];
9942
10017
  };
9943
10018
  var ownerOf = (target) => {
9944
10019
  const parts = target.split(sep);
@@ -9962,7 +10037,10 @@ var packageKey = (id2) => {
9962
10037
  at > 0 ? spec2.slice(0, at) : spec2
9963
10038
  ]);
9964
10039
  };
9965
- var readMounts = (scan) => {
10040
+ var readMounts = (scan, {
10041
+ workspaces = [],
10042
+ made
10043
+ } = {}) => {
9966
10044
  const mounts = [];
9967
10045
  for (const dir of scan) {
9968
10046
  let entries;
@@ -9971,29 +10049,33 @@ var readMounts = (scan) => {
9971
10049
  } catch {
9972
10050
  continue;
9973
10051
  }
10052
+ const listed = gitignoreNames(dir.real);
9974
10053
  for (const name of entries) {
9975
- const link2 = join2(dir.real, name);
10054
+ const link2 = join3(dir.real, name);
10055
+ const mount = `${dir.dir}/${name}`;
10056
+ const m = { dir, name, mount, link: link2 };
9976
10057
  const target = mountTarget(link2);
9977
10058
  if (target) {
9978
- mounts.push({
9979
- dir,
9980
- name,
9981
- mount: `${dir.dir}/${name}`,
9982
- link: link2,
9983
- target,
9984
- owner: ownerOf(target)
9985
- });
10059
+ mounts.push({ ...m, target, owner: ownerOf(target) });
10060
+ continue;
9986
10061
  }
10062
+ const wsTarget = (listed.has(name) || made?.has(mount)) && linkTarget(link2);
10063
+ if (!wsTarget) continue;
10064
+ if (!existsSync2(wsTarget)) {
10065
+ mounts.push({ ...m, target: wsTarget });
10066
+ continue;
10067
+ }
10068
+ const ws = workspaceOf(wsTarget, workspaces);
10069
+ if (ws) mounts.push({ ...m, target: wsTarget, owner: ws.id });
9987
10070
  }
9988
10071
  }
9989
10072
  return mounts.sort((a, b) => a.mount.localeCompare(b.mount, "en"));
9990
10073
  };
9991
- var mountSkill = (skill2, dir) => {
9992
- const link2 = join2(dir.real, skill2.skill);
10074
+ var mountSkill = (skill2, dir, owned = false) => {
10075
+ const link2 = join3(dir.real, skill2.skill);
9993
10076
  if (lstat(link2)) {
9994
- const target = mountTarget(link2);
9995
- if (!target) return "conflict";
9996
- if (samePath(target, skill2.path)) return "unchanged";
10077
+ if (samePath(link2, skill2.path)) return "unchanged";
10078
+ if (!owned && !mountTarget(link2)) return "conflict";
9997
10079
  unlinkSync(link2);
9998
10080
  }
9999
10081
  if (process.platform === "win32") {
@@ -10009,13 +10091,13 @@ var unmountSkill = (m) => {
10009
10091
 
10010
10092
  // ../../src/graph/src/skills/dirs.ts
10011
10093
  import {
10012
- lstatSync as lstatSync3,
10094
+ lstatSync as lstatSync4,
10013
10095
  mkdirSync as mkdirSync3,
10014
10096
  readdirSync as readdirSync3,
10015
10097
  realpathSync as realpathSync2,
10016
10098
  statSync
10017
10099
  } from "node:fs";
10018
- import { isAbsolute, join as join3, relative as relative3, resolve as resolve6, sep as sep2 } from "node:path";
10100
+ import { isAbsolute, join as join4, relative as relative3, resolve as resolve6, sep as sep2 } from "node:path";
10019
10101
  var AGENTS_SKILLS = ".agents/skills";
10020
10102
  var CLAUDE_ENV = ["CLAUDECODE", "CLAUDE_CODE"];
10021
10103
  var AGENT_ROOTS = [
@@ -10147,18 +10229,18 @@ var walk2 = (realRoot, dir, create) => {
10147
10229
  let real = realRoot;
10148
10230
  try {
10149
10231
  for (const [i, part] of parts.entries()) {
10150
- const next = join3(real, part);
10151
- let st = lstatSync3(next, { throwIfNoEntry: false });
10232
+ const next = join4(real, part);
10233
+ let st = lstatSync4(next, { throwIfNoEntry: false });
10152
10234
  if (!st) {
10153
10235
  if (!create)
10154
- return { dir, real: join3(real, ...parts.slice(i)) };
10236
+ return { dir, real: join4(real, ...parts.slice(i)) };
10155
10237
  try {
10156
10238
  mkdirSync3(next);
10157
10239
  } catch (er) {
10158
10240
  if (er.code !== "EEXIST")
10159
10241
  throw er;
10160
10242
  }
10161
- st = lstatSync3(next);
10243
+ st = lstatSync4(next);
10162
10244
  }
10163
10245
  if (st.isSymbolicLink()) {
10164
10246
  let r;
@@ -10199,11 +10281,11 @@ var skillsDirs = ({
10199
10281
  } else {
10200
10282
  const found = /* @__PURE__ */ new Set();
10201
10283
  for (const [marker, d] of AGENT_ROOTS) {
10202
- if (isDir(join3(realRoot, marker))) found.add(d);
10284
+ if (isDir(join4(realRoot, marker))) found.add(d);
10203
10285
  }
10204
10286
  if (CLAUDE_ENV.some((k) => env2[k])) found.add(".claude/skills");
10205
10287
  for (const d of dots) {
10206
- if (isDir(join3(realRoot, d))) found.add(d);
10288
+ if (isDir(join4(realRoot, d))) found.add(d);
10207
10289
  }
10208
10290
  list = [
10209
10291
  AGENTS_SKILLS,
@@ -10282,6 +10364,7 @@ export {
10282
10364
  filterNodesByQueryParts,
10283
10365
  assertQuery,
10284
10366
  symlinkSyncMkdirp,
10367
+ editGitignore,
10285
10368
  lstat,
10286
10369
  norm,
10287
10370
  realOr,
@@ -10,14 +10,16 @@ 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
  import {
13
+ defaultRegistryKey,
13
14
  getTokenByURL,
14
15
  registryKeys
15
- } from "./chunk-35EG6T3J.js";
16
+ } from "./chunk-44AWMA4F.js";
16
17
 
17
18
  // ../../src/cli-sdk/src/query-auth.ts
18
19
  var createGetAuthHeader = (conf) => {
19
20
  const keys = registryKeys(conf.options);
20
- return async (url) => getTokenByURL(url, conf.options.identity, keys);
21
+ const def = defaultRegistryKey(conf.options);
22
+ return async (url) => getTokenByURL(url, conf.options.identity, keys, def);
21
23
  };
22
24
 
23
25
  export {
@@ -0,0 +1,115 @@
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
+ isInside,
14
+ samePath
15
+ } from "./chunk-MCDLJZXT.js";
16
+ import {
17
+ isDepID
18
+ } from "./chunk-CAV7FKWQ.js";
19
+ import {
20
+ isObject
21
+ } from "./chunk-BF5DRGRZ.js";
22
+
23
+ // ../../src/cli-sdk/src/global-state.ts
24
+ import { randomBytes } from "node:crypto";
25
+ import {
26
+ chmod,
27
+ readFile,
28
+ realpath,
29
+ rename,
30
+ rm,
31
+ writeFile
32
+ } from "node:fs/promises";
33
+ import { basename, dirname, isAbsolute, resolve } from "node:path";
34
+ var globalStateFile = (root) => resolve(root, "global-state.json");
35
+ var readGlobalState = async (root) => {
36
+ let data;
37
+ try {
38
+ data = JSON.parse(await readFile(globalStateFile(root), "utf8"));
39
+ } catch {
40
+ return {};
41
+ }
42
+ if (!isObject(data)) return {};
43
+ const state = { ...data };
44
+ const { binDirs, localBinNoticed } = state;
45
+ if (Array.isArray(binDirs)) {
46
+ state.binDirs = binDirs.filter(
47
+ (d) => typeof d === "string" && isAbsolute(d)
48
+ );
49
+ } else delete state.binDirs;
50
+ if (Array.isArray(state.pendingRemove)) {
51
+ state.pendingRemove = state.pendingRemove.filter(
52
+ (d) => typeof d === "string" && isAbsolute(d)
53
+ );
54
+ } else delete state.pendingRemove;
55
+ if (typeof localBinNoticed !== "boolean")
56
+ delete state.localBinNoticed;
57
+ if (state.pathSetup !== "declined") delete state.pathSetup;
58
+ return state;
59
+ };
60
+ var writeFileAtomic = async (file, data, mode) => {
61
+ const tmp = `${file}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;
62
+ try {
63
+ await writeFile(tmp, data, {
64
+ flag: "wx",
65
+ ...mode === void 0 ? {} : { mode }
66
+ });
67
+ if (mode !== void 0) await chmod(tmp, mode);
68
+ await rename(tmp, file);
69
+ } catch (er) {
70
+ await rm(tmp, { force: true });
71
+ throw er;
72
+ }
73
+ };
74
+ var writeJsonAtomic = (file, data) => writeFileAtomic(file, JSON.stringify(data, null, 2) + "\n");
75
+ var updateGlobalState = async (root, fn) => {
76
+ const state = fn(await readGlobalState(root));
77
+ await writeJsonAtomic(globalStateFile(root), state);
78
+ return state;
79
+ };
80
+ var sweepPendingRemove = async (root) => {
81
+ try {
82
+ const { pendingRemove = [] } = await readGlobalState(root);
83
+ if (!pendingRemove.length) return;
84
+ const store = resolve(await realpath(root), "node_modules/.vlt");
85
+ const script = process.argv[1];
86
+ const running = script && await realpath(script).catch(() => void 0);
87
+ const left = [];
88
+ for (const entry of pendingRemove) {
89
+ if (!samePath(dirname(entry), store) || !isDepID(basename(entry))) {
90
+ continue;
91
+ }
92
+ if (running && isInside(entry, running)) {
93
+ left.push(entry);
94
+ continue;
95
+ }
96
+ await rm(entry, { recursive: true, force: true }).catch(
97
+ () => left.push(entry)
98
+ );
99
+ }
100
+ if (left.length === pendingRemove.length) return;
101
+ await updateGlobalState(root, (s) => ({
102
+ ...s,
103
+ pendingRemove: left
104
+ }));
105
+ } catch {
106
+ }
107
+ };
108
+
109
+ export {
110
+ readGlobalState,
111
+ writeFileAtomic,
112
+ writeJsonAtomic,
113
+ updateGlobalState,
114
+ sweepPendingRemove
115
+ };
@@ -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.5.0",
17
+ version: "1.6.0",
18
18
  repository: {
19
19
  type: "git",
20
20
  url: "git+https://github.com/vltpkg/vltpkg.git",
@@ -12,17 +12,17 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  addKey,
14
14
  asDependency
15
- } from "./chunk-2U4PVHP4.js";
15
+ } from "./chunk-F5LZMLAQ.js";
16
16
  import {
17
- asUnknownSpecPrefix
18
- } from "./chunk-UZ6ICZE3.js";
17
+ parseSpecArg
18
+ } from "./chunk-7M2VTFLP.js";
19
19
  import {
20
20
  joinDepIDTuple,
21
21
  splitDepID
22
- } from "./chunk-F7NPYSI2.js";
22
+ } from "./chunk-CAV7FKWQ.js";
23
23
  import {
24
24
  Spec
25
- } from "./chunk-LUVDMEW4.js";
25
+ } from "./chunk-6D3QAFNZ.js";
26
26
 
27
27
  // ../../src/cli-sdk/src/parse-add-remove-args.ts
28
28
  import { isAbsolute, relative, resolve } from "node:path";
@@ -68,13 +68,6 @@ var rebaseFileSpec = (spec, importerPath, scurryCwd, specOptions, monorepo) => {
68
68
  if (rebasedPath === spec.file) return spec;
69
69
  return Spec.parseArgs(rebasedPath, specOptions);
70
70
  };
71
- var parseArg = (item, options) => {
72
- try {
73
- return Spec.parseArgs(item, options);
74
- } catch (er) {
75
- throw asUnknownSpecPrefix(er);
76
- }
77
- };
78
71
  var parseAddArgs = (config, scurry, monorepo) => {
79
72
  const add = new AddImportersDependenciesMapImpl();
80
73
  const items = config.positionals;
@@ -84,7 +77,7 @@ var parseAddArgs = (config, scurry, monorepo) => {
84
77
  const parsedItems = [];
85
78
  let hasFileSpecs = false;
86
79
  for (const item of items) {
87
- const spec = parseArg(item, specOptions);
80
+ const spec = parseSpecArg(item, specOptions);
88
81
  parsedItems.push({ spec, type });
89
82
  if (spec.type === "file") hasFileSpecs = true;
90
83
  add.modifiedDependencies = true;
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  commandAliases,
14
14
  jack
15
- } from "./chunk-CMLDLZZ3.js";
15
+ } from "./chunk-EFHOWRKU.js";
16
16
 
17
17
  // ../../src/cli-sdk/src/config/usage.ts
18
18
  var toArr = (v) => Array.isArray(v) ? v : [v];
@@ -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
  openUrl
14
- } from "./chunk-7UWRR6EE.js";
14
+ } from "./chunk-22LZBDEC.js";
15
15
  import {
16
16
  mermaidOutput
17
- } from "./chunk-4UH3KMTD.js";
17
+ } from "./chunk-36UIE654.js";
18
18
  import {
19
19
  stderr
20
- } from "./chunk-WHWPAYZY.js";
20
+ } from "./chunk-KVWGMSPW.js";
21
21
  import {
22
22
  ViewClass
23
23
  } from "./chunk-4KCU2KZL.js";
@@ -12,13 +12,13 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  actual,
14
14
  createVirtualRoot
15
- } from "./chunk-4UH3KMTD.js";
15
+ } from "./chunk-36UIE654.js";
16
16
  import {
17
17
  callLimit
18
- } from "./chunk-2U4PVHP4.js";
18
+ } from "./chunk-F5LZMLAQ.js";
19
19
  import {
20
20
  SecurityArchive
21
- } from "./chunk-SMXXFQPI.js";
21
+ } from "./chunk-YTDABXPD.js";
22
22
  import {
23
23
  error
24
24
  } from "./chunk-WZWDS3W4.js";
@@ -142,8 +142,8 @@ var reloadConfig = async (folder) => {
142
142
  unload("project");
143
143
  } catch {
144
144
  }
145
- const { Config } = await import("./config-TMB2X6DW.js");
146
- return Config.load(folder, process.argv, true);
145
+ const { Config } = await import("./config-EKHBW6I5.js");
146
+ return Config.load(folder, process.argv, true, false);
147
147
  };
148
148
 
149
149
  // ../../src/cli-sdk/src/query-host-contexts.ts