@vltpkg/cli-js 1.4.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 (105) hide show
  1. package/{access-422UGEWN.js → access-AJ654YKY.js} +13 -12
  2. package/{bugs-RED7Y33Q.js → bugs-N73DVYHD.js} +32 -25
  3. package/{build-IHMPBWRO.js → build-VZ3EZKMM.js} +65 -21
  4. package/{cache-FJP2RZJX.js → cache-VROEWG2C.js} +20 -17
  5. package/cache-unzip-src-unzip.js +58 -15
  6. package/{chunk-TPRK6IDA.js → chunk-22LZBDEC.js} +2 -2
  7. package/chunk-36UIE654.js +6248 -0
  8. package/{chunk-UGCKF5ZE.js → chunk-3JIN46K5.js} +1 -1
  9. package/{chunk-OAJ3PO3Z.js → chunk-44AWMA4F.js} +25 -13
  10. package/chunk-4E65BBTM.js +77 -0
  11. package/{chunk-SR2VOY5J.js → chunk-4GMNWW4C.js} +1 -1
  12. package/{chunk-5IJTPZXP.js → chunk-6D3QAFNZ.js} +1 -1
  13. package/{chunk-X4FVR4R5.js → chunk-75HGJVNG.js} +12 -10
  14. package/{chunk-THSYN5EK.js → chunk-7M2VTFLP.js} +12 -1
  15. package/{chunk-2AMOC4DN.js → chunk-ANW36H4T.js} +4 -4
  16. package/chunk-B6RIGNEO.js +626 -0
  17. package/{chunk-FLH4YC6W.js → chunk-BF5DRGRZ.js} +60 -15
  18. package/chunk-BH5CVXNY.js +115 -0
  19. package/{chunk-PLG3OYCX.js → chunk-CAV7FKWQ.js} +3 -2
  20. package/{chunk-C23TDXRG.js → chunk-CYK6I4M6.js} +1 -1
  21. package/chunk-DXED4ARV.js +436 -0
  22. package/chunk-E74WGW5C.js +49 -0
  23. package/{chunk-WF6KLKRN.js → chunk-EFHOWRKU.js} +103 -1
  24. package/chunk-EMTGRCSE.js +1111 -0
  25. package/{chunk-5Y4SYLJ2.js → chunk-EYGOEAJM.js} +1 -1
  26. package/{chunk-OVPHE4O7.js → chunk-F5LZMLAQ.js} +5335 -10902
  27. package/{chunk-HZXJ423P.js → chunk-FXD3IV2S.js} +4 -2
  28. package/chunk-GCTREKA4.js +115 -0
  29. package/{chunk-ZJMJ7MCT.js → chunk-GEQFMH5M.js} +1 -1
  30. package/{chunk-ISE4IRHF.js → chunk-GZVI75KX.js} +7 -14
  31. package/chunk-HOF7LEIC.js +24 -0
  32. package/{chunk-LHPEBLOU.js → chunk-HT6FS4VB.js} +1 -1
  33. package/{chunk-PHJJPY5G.js → chunk-IXAMCWIT.js} +5 -5
  34. package/{chunk-ASLX43R3.js → chunk-JCNI6ZHH.js} +7 -5
  35. package/chunk-JV5XR5JQ.js +349 -0
  36. package/{chunk-7T3XAYP4.js → chunk-KD5ZK72K.js} +1 -1
  37. package/{chunk-FZUYGJZU.js → chunk-KVWGMSPW.js} +137 -19
  38. package/{chunk-TO23PR7J.js → chunk-LCLRP64K.js} +14 -12
  39. package/{chunk-QCSUWACA.js → chunk-LGQVZTYR.js} +8 -36
  40. package/{chunk-5RHABCYI.js → chunk-LP3ORD3D.js} +143 -17
  41. package/chunk-MCDLJZXT.js +82 -0
  42. package/{chunk-DNRR3XMG.js → chunk-N6HV7JWC.js} +1 -1
  43. package/chunk-O6MQ7NN6.js +1155 -0
  44. package/{chunk-GIIAODRI.js → chunk-PC2HOBAQ.js} +7 -5
  45. package/{chunk-APMYKJI2.js → chunk-QNHBAGXQ.js} +1 -1
  46. package/chunk-RBQO54TG.js +59 -0
  47. package/chunk-SUU2WETN.js +268 -0
  48. package/{chunk-I7UMHYZX.js → chunk-TQQO2F56.js} +113 -1187
  49. package/{chunk-4UCADW6S.js → chunk-TWDSXQPN.js} +9 -7
  50. package/{chunk-MKWPTN3C.js → chunk-VLVMLSIF.js} +2 -2
  51. package/chunk-W4T5CGCO.js +52 -0
  52. package/{chunk-5TNXLRW2.js → chunk-YTDABXPD.js} +50 -12
  53. package/{ci-YSKNNO5M.js → ci-3BVMVQIT.js} +35 -13
  54. package/cli-package.json +3 -1
  55. package/{config-HO7GY3QT.js → config-2KQV7N5A.js} +16 -13
  56. package/{config-CSPCDMR3.js → config-EKHBW6I5.js} +12 -9
  57. package/{create-2TJT3AHJ.js → create-QVHNOIV3.js} +35 -29
  58. package/{deprecate-7FRJI2RL.js → deprecate-E254QBH6.js} +17 -15
  59. package/{dist-tag-WCFF5OEG.js → dist-tag-SITRFD7O.js} +13 -12
  60. package/{docs-JMBPTU23.js → docs-IDL2P7CA.js} +32 -25
  61. package/{exec-FBOUKZZ2.js → exec-7BK2W2WL.js} +35 -29
  62. package/{exec-cache-X3ZWM5S3.js → exec-cache-VY46L7DR.js} +27 -21
  63. package/{exec-local-Y3KQC22N.js → exec-local-D7R5T3DF.js} +26 -20
  64. package/{help-PUKVH5X7.js → help-RMRIEJQL.js} +6 -5
  65. package/{init-GOKAQXXZ.js → init-BGW4HJ6V.js} +15 -11
  66. package/{install-XFN4UFOC.js → install-U5GATZ2N.js} +144 -49
  67. package/{list-43JFFG5D.js → list-3VG4M2XL.js} +41 -28
  68. package/{login-RSTZKNKN.js → login-PHQWI6S6.js} +19 -16
  69. package/{logout-4576FFXZ.js → logout-DJCOGRFF.js} +13 -12
  70. package/{outdated-ACQ5A2Y7.js → outdated-JH3O6R3Y.js} +27 -22
  71. package/{pack-QQVJ3G25.js → pack-U5W5YWHK.js} +23 -18
  72. package/package.json +1 -1
  73. package/{ping-QCDQQRO5.js → ping-EKX43AOW.js} +13 -12
  74. package/{pkg-CSOJV7UC.js → pkg-SW5GMERT.js} +19 -14
  75. package/{profile-VL4HPW3N.js → profile-UGDRDMQ6.js} +13 -12
  76. package/{publish-2YBO6ZXE.js → publish-HTWKK3NN.js} +60 -45
  77. package/{query-IHHFMJRT.js → query-YE3FUVGG.js} +43 -30
  78. package/{registry-W7BRZZZ2.js → registry-ZGGWVLBM.js} +7 -7
  79. package/registry-client-src-revalidate.js +76 -22
  80. package/{repo-L3BXAAWS.js → repo-WDOCU6SE.js} +32 -25
  81. package/{reporter-5NYOHBO7.js → reporter-N5PAXB26.js} +121 -17
  82. package/{run-AMUUVLTI.js → run-IPARVIIQ.js} +26 -20
  83. package/{run-exec-5W3XWQZA.js → run-exec-C4RTREEW.js} +26 -20
  84. package/security-archive-src-update-expired.js +66 -21
  85. package/{setup-TFM4GJF7.js → setup-SYYUEHZL.js} +212 -32
  86. package/skills-KA2VR5Q5.js +480 -0
  87. package/skills-UBBMSBDQ.js +416 -0
  88. package/{src-4CYCUWZL.js → src-FUSTSM4J.js} +33 -22
  89. package/{src-I3GMULFP.js → src-QO5G2S4O.js} +11 -8
  90. package/{src-LUTN2ODD.js → src-W2VQULRG.js} +2 -2
  91. package/{token-OANOBE3G.js → token-UQNABECH.js} +15 -13
  92. package/{uninstall-YXTQ4AIZ.js → uninstall-FHBJ3OUV.js} +59 -18
  93. package/{unpublish-SZXYMYIU.js → unpublish-APJTEUBA.js} +31 -16
  94. package/{update-FHLMWGIM.js → update-NWZTL4S7.js} +52 -25
  95. package/{version-ZWFCTU5V.js → version-EMKKTL77.js} +20 -14
  96. package/{view-NFNJXMLV.js → view-BUUI33RV.js} +17 -15
  97. package/vlr.js +1 -1
  98. package/vlrx.js +1 -1
  99. package/vlt.js +1 -1
  100. package/vlx.js +1 -1
  101. package/vlxl.js +1 -1
  102. package/{whoami-O7GOSGCI.js → whoami-F6BSXGQ2.js} +13 -12
  103. package/chunk-G2YT2GWF.js +0 -120
  104. package/chunk-T6FBP4OU.js +0 -76
  105. package/chunk-U7TEQCBN.js +0 -880
@@ -0,0 +1,416 @@
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
+ mermaidOutput
14
+ } from "./chunk-36UIE654.js";
15
+ import {
16
+ assertQuery,
17
+ linkSkills,
18
+ listSkills
19
+ } from "./chunk-F5LZMLAQ.js";
20
+ import "./chunk-YTDABXPD.js";
21
+ import {
22
+ styleTextStdout
23
+ } from "./chunk-KVWGMSPW.js";
24
+ import "./chunk-LGQVZTYR.js";
25
+ import "./chunk-EYGOEAJM.js";
26
+ import {
27
+ commandUsage
28
+ } from "./chunk-HT6FS4VB.js";
29
+ import {
30
+ configLabel,
31
+ savedLine,
32
+ storedAllowSkills,
33
+ unmatchedLines,
34
+ unscannedLines
35
+ } from "./chunk-W4T5CGCO.js";
36
+ import {
37
+ configWriteTarget
38
+ } from "./chunk-LP3ORD3D.js";
39
+ import "./chunk-LCLRP64K.js";
40
+ import "./chunk-SRWDPPLX.js";
41
+ import "./chunk-JV5XR5JQ.js";
42
+ import "./chunk-EMTGRCSE.js";
43
+ import "./chunk-TQQO2F56.js";
44
+ import "./chunk-4KCU2KZL.js";
45
+ import "./chunk-WGDTG44V.js";
46
+ import "./chunk-E74WGW5C.js";
47
+ import "./chunk-GCTREKA4.js";
48
+ import "./chunk-MCDLJZXT.js";
49
+ import "./chunk-7M2VTFLP.js";
50
+ import "./chunk-EFHOWRKU.js";
51
+ import "./chunk-CAV7FKWQ.js";
52
+ import "./chunk-6D3QAFNZ.js";
53
+ import "./chunk-HTOTG4TS.js";
54
+ import "./chunk-GEQFMH5M.js";
55
+ import "./chunk-4GMNWW4C.js";
56
+ import "./chunk-SUU2WETN.js";
57
+ import "./chunk-B6RIGNEO.js";
58
+ import "./chunk-XNLSTHDK.js";
59
+ import "./chunk-6IF3RJND.js";
60
+ import "./chunk-PDWPFR5T.js";
61
+ import "./chunk-Y5PA7DVK.js";
62
+ import {
63
+ asError
64
+ } from "./chunk-BF5DRGRZ.js";
65
+ import {
66
+ error
67
+ } from "./chunk-WZWDS3W4.js";
68
+ import "./chunk-PZLD7RTK.js";
69
+
70
+ // ../../src/cli-sdk/src/commands/skills.ts
71
+ import { styleText } from "node:util";
72
+
73
+ // ../../src/cli-sdk/src/skills-prompt.ts
74
+ import { createInterface } from "node:readline/promises";
75
+ var interactive = () => process.stdin.isTTY;
76
+ var open = (s) => {
77
+ const rl = createInterface({
78
+ input: s.input ?? process.stdin,
79
+ output: s.output ?? process.stdout,
80
+ // prefill and line editing
81
+ terminal: true
82
+ });
83
+ rl.on("SIGINT", () => rl.close());
84
+ let done = false;
85
+ const closed = new Promise(
86
+ (r) => rl.once("close", () => {
87
+ done = true;
88
+ r(void 0);
89
+ })
90
+ );
91
+ const ask = async (query, prefill) => {
92
+ if (done) return void 0;
93
+ const q = rl.question(query).catch(() => void 0);
94
+ if (prefill) rl.write(prefill);
95
+ return Promise.race([q, closed]);
96
+ };
97
+ return { rl, ask };
98
+ };
99
+ var confirm = async (question, s = {}) => {
100
+ const { rl, ask } = open(s);
101
+ try {
102
+ const a = await ask(question);
103
+ return a === void 0 ? void 0 : /^y(es)?$/i.test(a.trim());
104
+ } finally {
105
+ rl.close();
106
+ }
107
+ };
108
+ var editQuery = async ({
109
+ current,
110
+ prefill,
111
+ check,
112
+ ...s
113
+ }) => {
114
+ const output = s.output ?? process.stdout;
115
+ if (current !== void 0) {
116
+ output.write(
117
+ "\n\u26A0\uFE0F The new allow-skills replaces the current one. Make sure it still\nselects every skill you want: skills it no longer selects are unlinked.\n\n" + styleTextStdout(
118
+ "yellow",
119
+ `Current allow-skills: ${current}`
120
+ ) + "\n"
121
+ );
122
+ }
123
+ const prompt = styleTextStdout("cyan", "New allow-skills: ");
124
+ const { rl, ask } = open(s);
125
+ try {
126
+ let fill = prefill;
127
+ for (; ; ) {
128
+ const a = (await ask(prompt, fill))?.trim();
129
+ if (!a) return void 0;
130
+ try {
131
+ await check(a);
132
+ return a;
133
+ } catch (e) {
134
+ output.write(`${asError(e).message}
135
+ `);
136
+ fill = a;
137
+ }
138
+ }
139
+ } finally {
140
+ rl.close();
141
+ }
142
+ };
143
+
144
+ // ../../src/cli-sdk/src/commands/skills.ts
145
+ var needsRegistry = true;
146
+ var usage = () => commandUsage({
147
+ command: "skills",
148
+ usage: ["", "list [<query>]", "link [<query>]"],
149
+ description: `Manage the agent skills shipped by installed packages.
150
+
151
+ A skill is a folder with a \`SKILL.md\` file
152
+ (https://agentskills.io/specification). Packages ship them as a
153
+ root \`SKILL.md\`, or at \`<name>/SKILL.md\` in \`skills/\`,
154
+ \`dist/skills/\` or \`.agents/skills/\`: the first skill of a name
155
+ wins.
156
+
157
+ Skills are linked into the project's agent skill dirs:
158
+ \`.agents/skills\`, plus \`<folder>/skills\` for each agent folder
159
+ at the project root (e.g. \`.claude/\`), or the \`skills-dir\`
160
+ config. When packages ship skills with the same name, one is
161
+ linked and the others are reported. Only links made by vlt are
162
+ ever replaced or removed; anything else in the way is skipped.
163
+
164
+ Use --target or a query after the subcommand to select packages
165
+ using DSS query syntax. End a selector with
166
+ \`:skill(<name>, \u2026)\` to pick single skills, e.g.
167
+ \`#skills:skill(find-skills)\`. Use
168
+ \`vlt install --allow-skills=<query>\` to link skills on install.`,
169
+ subcommands: {
170
+ list: {
171
+ usage: "[<query>]",
172
+ description: `List the skills of installed packages. The default.
173
+ Selects all packages (\`*\`) by default. Applies
174
+ \`:skill()\`: preview a query before \`link\` saves
175
+ it.`
176
+ },
177
+ link: {
178
+ usage: "[<query>]",
179
+ description: `Set, save and apply \`allow-skills\`: link what the
180
+ query selects and remove vlt links to other skills.
181
+ With no query: the stored one, or
182
+ \`:not(:malware)\`. Asks before replacing or editing
183
+ a stored query (-y skips). Saves to the project
184
+ vlt.json, or the user one with --config=user.`
185
+ }
186
+ },
187
+ options: {
188
+ target: {
189
+ value: "<query>",
190
+ description: "Query selector to filter packages using DSS syntax."
191
+ },
192
+ yes: {
193
+ description: "Skip the prompts: replace or keep the stored allow-skills without asking."
194
+ },
195
+ config: {
196
+ value: "user|project",
197
+ description: "vlt.json to save allow-skills to (default: project)."
198
+ },
199
+ view: {
200
+ value: "[human | json | mermaid]",
201
+ description: "Output format. mermaid: list only."
202
+ }
203
+ }
204
+ });
205
+ var plural = (n, s) => `${n} ${s}${n === 1 ? "" : "s"}`;
206
+ var lines = (header, items) => [header, ...items.map((i) => ` ${i}`)].join("\n");
207
+ var notes = (r) => [
208
+ ...r.skipped ? [`\u26A0\uFE0F Skipped ${r.skipped.join(", ")}`] : [],
209
+ ...r.gitignore ? [`\u26A0\uFE0F Could not update ${r.gitignore.join(", ")}`] : [],
210
+ ...unscannedLines(r)
211
+ ];
212
+ var pkgLabel = (s) => {
213
+ const pkg = s.version ? `${s.name}@${s.version}` : s.name;
214
+ return s.alias ? `${s.alias} (${pkg})` : pkg;
215
+ };
216
+ var linkedSuffix = (s, dirs) => dirs.length && dirs.every((d) => s.linked.includes(d)) ? " (linked)" : s.linked.length ? ` (linked in ${s.linked.join(", ")})` : "";
217
+ var row = (s, dirs) => `${s.skill} (${pkgLabel(s)})${linkedSuffix(s, dirs)}`;
218
+ var listNotes = (r) => [
219
+ ...!r.dirs.length && !r.skipped ? ["No agent skill dirs: skills-dir is empty"] : [],
220
+ ...notes(r)
221
+ ];
222
+ var humanList = (r, { colors } = {}) => {
223
+ const style = (format) => (s) => colors ? styleText(format, s, { validateStream: false }) : s;
224
+ const yellow = style("yellow");
225
+ const rows = r.skills.map((s) => {
226
+ const x = row(s, r.dirs);
227
+ return s.linked.length ? yellow(x) : x;
228
+ });
229
+ const last = rows.length - 1;
230
+ return [
231
+ ...rows.length ? [
232
+ style("reset")(
233
+ [
234
+ r.project,
235
+ ...rows.map(
236
+ (x, i) => `${i === last ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500"} ${x}`
237
+ )
238
+ ].join("\n")
239
+ )
240
+ ] : ["No agent skills found in installed packages."],
241
+ ...listNotes(r)
242
+ ].join("\n");
243
+ };
244
+ var mermaidList = (r) => {
245
+ const children = /* @__PURE__ */ new Map();
246
+ for (const s of r.skills) {
247
+ const list = children.get(s.id) ?? [];
248
+ list.push({
249
+ edge: pkgLabel(s),
250
+ label: `${s.skill}${linkedSuffix(s, r.dirs)}`
251
+ });
252
+ children.set(s.id, list);
253
+ }
254
+ const { graph } = r;
255
+ return [
256
+ mermaidOutput({
257
+ edges: [],
258
+ importers: /* @__PURE__ */ new Set([graph.mainImporter]),
259
+ nodes: [...graph.nodes.values()].filter(
260
+ (n) => n === graph.mainImporter || children.has(n.id)
261
+ ),
262
+ children
263
+ }),
264
+ ...listNotes(r).map((n) => `%% ${n}`)
265
+ ].join("\n");
266
+ };
267
+ var jsonSkill = ({
268
+ skill,
269
+ name,
270
+ alias,
271
+ version,
272
+ id,
273
+ description,
274
+ ...rest
275
+ }) => ({
276
+ name: skill,
277
+ description,
278
+ "dependency-name": alias ?? name,
279
+ "package-id": id,
280
+ ...rest
281
+ });
282
+ var count = (rows) => new Set(rows.map((r) => `${r.id}\0${r.skill}`)).size;
283
+ var humanLink = (r) => {
284
+ const out = [];
285
+ if (r.linked.length) {
286
+ out.push(
287
+ lines(
288
+ `\u{1F517} Linked ${plural(count(r.linked), "agent skill")}:`,
289
+ r.linked.map((s) => s.mount)
290
+ )
291
+ );
292
+ } else if (r.unchanged.length) {
293
+ out.push(
294
+ `${plural(count(r.unchanged), "agent skill")} already linked.`
295
+ );
296
+ }
297
+ if (r.removed.length) {
298
+ out.push(
299
+ lines(
300
+ `\u{1F9F9} Removed ${plural(r.removed.length, "skill link")}:`,
301
+ r.removed
302
+ )
303
+ );
304
+ }
305
+ if (r.conflicts.length) {
306
+ out.push(
307
+ lines(
308
+ `\u26A0\uFE0F Skipped ${plural(r.conflicts.length, "skill")}, path in use or taken by another package:`,
309
+ r.conflicts
310
+ )
311
+ );
312
+ }
313
+ out.push(...notes(r));
314
+ return out.join("\n") || "No agent skills found to link.";
315
+ };
316
+ var human = (r, o) => r.action === "list" ? humanList(r, o) : r.action === "unchanged" ? "No changes made." : [
317
+ humanLink(r),
318
+ ...unmatchedLines(r.unmatched),
319
+ ...r.saved ? [savedLine(r.query, r.saved)] : []
320
+ ].join("\n");
321
+ var views = {
322
+ human,
323
+ json: (r) => {
324
+ if (r.action !== "list") return r;
325
+ const { project, graph, ...rest } = r;
326
+ return { ...rest, skills: rest.skills.map(jsonSkill) };
327
+ },
328
+ mermaid: (r) => r.action === "list" ? mermaidList(r) : human(r)
329
+ };
330
+ var defaultQuery = ":not(:malware)";
331
+ var where = (which) => which === "user" ? "in the user vlt.json" : "for this project (vlt.json)";
332
+ var pickQuery = async (conf, given) => {
333
+ const check = (q) => assertQuery(q, "allow-skills", ["skill"]);
334
+ const stored = storedAllowSkills(conf);
335
+ const yes = !!conf.get("yes");
336
+ const tty = interactive();
337
+ if (given) {
338
+ await check(given);
339
+ if (!stored || stored.query === given || yes) return given;
340
+ if (!tty) {
341
+ throw error(
342
+ `allow-skills is already set (${configLabel(stored.which)}): "${stored.query}"; pass -y to replace it`,
343
+ { code: "EUSAGE", found: given, wanted: stored.query }
344
+ );
345
+ }
346
+ if (!await confirm(
347
+ `allow-skills is already set ${where(stored.which)}: "${stored.query}". Replace it? [y/N] `
348
+ )) {
349
+ return void 0;
350
+ }
351
+ return editQuery({ current: stored.query, prefill: given, check });
352
+ }
353
+ if (stored) {
354
+ if (yes || !tty) return stored.query;
355
+ const edit = await confirm(
356
+ `allow-skills is set ${where(stored.which)}: "${stored.query}". Edit it? [y/N] `
357
+ );
358
+ if (edit === void 0) return void 0;
359
+ return edit ? editQuery({
360
+ current: stored.query,
361
+ prefill: stored.query,
362
+ check
363
+ }) : stored.query;
364
+ }
365
+ if (yes || !tty) return defaultQuery;
366
+ return editQuery({ prefill: defaultQuery, check });
367
+ };
368
+ var command = async (conf) => {
369
+ const [sub = "list", query] = conf.positionals;
370
+ const target = conf.get("target") || query;
371
+ const opts = {
372
+ ...conf.options,
373
+ projectRoot: conf.projectRoot,
374
+ skillsDirs: conf.get("skills-dir")
375
+ };
376
+ switch (sub) {
377
+ case "list":
378
+ case "ls":
379
+ return {
380
+ action: "list",
381
+ ...await listSkills({ ...opts, target })
382
+ };
383
+ case "link": {
384
+ const query2 = await pickQuery(conf, target);
385
+ if (query2 === void 0) return { action: "unchanged" };
386
+ const res = await linkSkills({
387
+ ...opts,
388
+ target: query2,
389
+ apply: true
390
+ });
391
+ let saved;
392
+ if (storedAllowSkills(conf)?.query !== query2) {
393
+ saved = configWriteTarget(conf, "project");
394
+ await conf.addConfigToFile(saved, { "allow-skills": query2 });
395
+ }
396
+ return {
397
+ action: "link",
398
+ query: query2,
399
+ ...saved && { saved },
400
+ ...res
401
+ };
402
+ }
403
+ default:
404
+ throw error("Unknown skills subcommand", {
405
+ code: "EUSAGE",
406
+ found: sub,
407
+ validOptions: ["list", "ls", "link"]
408
+ });
409
+ }
410
+ };
411
+ export {
412
+ command,
413
+ needsRegistry,
414
+ usage,
415
+ views
416
+ };
@@ -11,44 +11,52 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  loadCommand
14
- } from "./chunk-T6FBP4OU.js";
14
+ } from "./chunk-4E65BBTM.js";
15
15
  import {
16
16
  flushAndExit,
17
17
  indent,
18
18
  outputCommand,
19
19
  stderr,
20
20
  stdout
21
- } from "./chunk-FZUYGJZU.js";
22
- import {
23
- loadPackageJson
24
- } from "./chunk-QCSUWACA.js";
25
- import "./chunk-G2YT2GWF.js";
21
+ } from "./chunk-KVWGMSPW.js";
22
+ import "./chunk-LGQVZTYR.js";
26
23
  import {
27
24
  asRootError,
28
25
  findRootError
29
- } from "./chunk-5Y4SYLJ2.js";
26
+ } from "./chunk-EYGOEAJM.js";
30
27
  import {
31
28
  Config
32
- } from "./chunk-5RHABCYI.js";
33
- import "./chunk-TO23PR7J.js";
29
+ } from "./chunk-LP3ORD3D.js";
30
+ import "./chunk-LCLRP64K.js";
34
31
  import "./chunk-SRWDPPLX.js";
35
- import "./chunk-WGDTG44V.js";
36
- import "./chunk-THSYN5EK.js";
37
- import "./chunk-I7UMHYZX.js";
32
+ import "./chunk-EMTGRCSE.js";
33
+ import {
34
+ setVltJsonOnly
35
+ } from "./chunk-TQQO2F56.js";
38
36
  import "./chunk-4KCU2KZL.js";
39
- import "./chunk-PLG3OYCX.js";
40
- import "./chunk-5IJTPZXP.js";
37
+ import "./chunk-WGDTG44V.js";
38
+ import {
39
+ loadPackageJson
40
+ } from "./chunk-E74WGW5C.js";
41
+ import "./chunk-GCTREKA4.js";
42
+ import "./chunk-MCDLJZXT.js";
43
+ import "./chunk-7M2VTFLP.js";
41
44
  import {
42
45
  getSortedCliOptions,
43
46
  getSortedKeys
44
- } from "./chunk-WF6KLKRN.js";
47
+ } from "./chunk-EFHOWRKU.js";
48
+ import "./chunk-CAV7FKWQ.js";
49
+ import "./chunk-6D3QAFNZ.js";
45
50
  import "./chunk-HTOTG4TS.js";
46
- import "./chunk-SR2VOY5J.js";
47
- import "./chunk-U7TEQCBN.js";
51
+ import "./chunk-4GMNWW4C.js";
52
+ import "./chunk-SUU2WETN.js";
53
+ import "./chunk-B6RIGNEO.js";
48
54
  import "./chunk-XNLSTHDK.js";
49
55
  import "./chunk-6IF3RJND.js";
50
56
  import "./chunk-Y5PA7DVK.js";
51
- import "./chunk-FLH4YC6W.js";
57
+ import {
58
+ isError
59
+ } from "./chunk-BF5DRGRZ.js";
52
60
  import "./chunk-WZWDS3W4.js";
53
61
  import "./chunk-PZLD7RTK.js";
54
62
 
@@ -64,7 +72,7 @@ var loadVlt = async (cwd, argv) => {
64
72
  } catch (e) {
65
73
  const code = findRootError(e, { code: "ECONFIG" }) ? "ECONFIG" : "JACKSPEAK";
66
74
  const err = asRootError(e, { code });
67
- const { found, path, wanted, name } = err.cause;
75
+ const { found, path, wanted, name, cause } = err.cause;
68
76
  const isConfigFile = typeof path === "string";
69
77
  const msg = isConfigFile ? `Problem in Config File ${path}` : code === "ECONFIG" ? "Config Error" : "Invalid Option Flag";
70
78
  const validOptions = wanted || code === "ECONFIG" ? void 0 : isConfigFile ? getSortedKeys() : getSortedCliOptions();
@@ -79,6 +87,7 @@ var loadVlt = async (cwd, argv) => {
79
87
  );
80
88
  }
81
89
  if (wanted) stderr(indent(`Wanted: ${format(wanted)}`));
90
+ if (isError(cause)) stderr(indent(`Cause: ${cause.message}`));
82
91
  if (validOptions) {
83
92
  stderr(indent("Valid Options:"));
84
93
  stderr(indent(validOptions.join("\n"), 4));
@@ -100,8 +109,9 @@ var run = async () => {
100
109
  if (vlt.get("version")) {
101
110
  return stdout(version);
102
111
  }
112
+ setVltJsonOnly(vlt.command === "ci");
103
113
  const { monorepo } = vlt.options;
104
- if (vlt.get("workspace") === void 0) {
114
+ if (vlt.get("workspace") === void 0 && !vlt.globalRoot) {
105
115
  const ws = monorepo?.get(cwd);
106
116
  if (ws) {
107
117
  vlt.values.workspace = [ws.path];
@@ -109,8 +119,9 @@ var run = async () => {
109
119
  }
110
120
  }
111
121
  if (vlt.command !== "init" && (vlt.get("workspace") || vlt.get("workspace-group")) && ![...monorepo?.values() ?? []].length) {
122
+ const where = vlt.command === "ci" ? "the vlt.json config (vlt ci ignores package.json and pnpm-workspace.yaml)" : 'the vlt.json config, the "workspaces" field of the root package.json, or the "packages" list of pnpm-workspace.yaml';
112
123
  stderr(
113
- `Error: No matching workspaces found. Make sure the vlt.json config, the "workspaces" field of the root package.json, or the "packages" list of pnpm-workspace.yaml contains the correct workspaces.`
124
+ `Error: No matching workspaces found. Make sure ${where} contains the correct workspaces.`
114
125
  );
115
126
  if (vlt.get("workspace")) {
116
127
  stderr(indent(`Workspace: ${format(vlt.get("workspace"))}`));
@@ -125,7 +136,7 @@ var run = async () => {
125
136
  return flushAndExit(process.exitCode || 1);
126
137
  }
127
138
  if (vlt.command === "registry") {
128
- const { dispatchRegistry } = await import("./registry-W7BRZZZ2.js");
139
+ const { dispatchRegistry } = await import("./registry-ZGGWVLBM.js");
129
140
  await dispatchRegistry(vlt);
130
141
  }
131
142
  const command = await loadCommand(vlt.command);
@@ -14,6 +14,7 @@ import {
14
14
  RegistryClient,
15
15
  cacheKey,
16
16
  clearRuntimeTokens,
17
+ defaultRegistryKey,
17
18
  deleteToken,
18
19
  getKC,
19
20
  getToken,
@@ -28,22 +29,23 @@ import {
28
29
  runtimeTokens,
29
30
  setRuntimeToken,
30
31
  setToken
31
- } from "./chunk-OAJ3PO3Z.js";
32
- import "./chunk-APMYKJI2.js";
32
+ } from "./chunk-44AWMA4F.js";
33
+ import "./chunk-QNHBAGXQ.js";
34
+ import {
35
+ userAgent
36
+ } from "./chunk-GEQFMH5M.js";
33
37
  import {
34
38
  assertOk,
35
39
  registryErrorMessage,
36
40
  requestError,
37
41
  storeRoot
38
- } from "./chunk-SR2VOY5J.js";
39
- import {
40
- userAgent
41
- } from "./chunk-ZJMJ7MCT.js";
42
- import "./chunk-U7TEQCBN.js";
42
+ } from "./chunk-4GMNWW4C.js";
43
+ import "./chunk-SUU2WETN.js";
44
+ import "./chunk-B6RIGNEO.js";
43
45
  import "./chunk-XNLSTHDK.js";
44
46
  import "./chunk-PDWPFR5T.js";
45
47
  import "./chunk-Y5PA7DVK.js";
46
- import "./chunk-FLH4YC6W.js";
48
+ import "./chunk-BF5DRGRZ.js";
47
49
  import "./chunk-WZWDS3W4.js";
48
50
  import "./chunk-PZLD7RTK.js";
49
51
  export {
@@ -52,6 +54,7 @@ export {
52
54
  assertOk,
53
55
  cacheKey,
54
56
  clearRuntimeTokens,
57
+ defaultRegistryKey,
55
58
  deleteToken,
56
59
  getKC,
57
60
  getToken,
@@ -28,7 +28,7 @@ import {
28
28
  unpackSync,
29
29
  unpackToStoreSync,
30
30
  verifyStoreEntry
31
- } from "./chunk-DNRR3XMG.js";
31
+ } from "./chunk-N6HV7JWC.js";
32
32
  import {
33
33
  cloneAvailable,
34
34
  cloneDir
@@ -37,7 +37,7 @@ import {
37
37
  rimrafSync
38
38
  } from "./chunk-PDWPFR5T.js";
39
39
  import "./chunk-Y5PA7DVK.js";
40
- import "./chunk-FLH4YC6W.js";
40
+ import "./chunk-BF5DRGRZ.js";
41
41
  import "./chunk-WZWDS3W4.js";
42
42
  import "./chunk-PZLD7RTK.js";
43
43
 
@@ -9,14 +9,14 @@ globalThis.setInterval = _vlt_setInterval;
9
9
  globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
- import {
13
- requireRegistry
14
- } from "./chunk-THSYN5EK.js";
15
12
  import {
16
13
  commandUsage
17
- } from "./chunk-LHPEBLOU.js";
18
- import "./chunk-5IJTPZXP.js";
19
- import "./chunk-WF6KLKRN.js";
14
+ } from "./chunk-HT6FS4VB.js";
15
+ import {
16
+ requireRegistry
17
+ } from "./chunk-7M2VTFLP.js";
18
+ import "./chunk-EFHOWRKU.js";
19
+ import "./chunk-6D3QAFNZ.js";
20
20
  import {
21
21
  RegistryClient,
22
22
  deleteToken,
@@ -25,15 +25,16 @@ import {
25
25
  normalizeRegistryKey,
26
26
  registryBase,
27
27
  setToken
28
- } from "./chunk-OAJ3PO3Z.js";
29
- import "./chunk-APMYKJI2.js";
30
- import "./chunk-SR2VOY5J.js";
31
- import "./chunk-ZJMJ7MCT.js";
32
- import "./chunk-U7TEQCBN.js";
28
+ } from "./chunk-44AWMA4F.js";
29
+ import "./chunk-QNHBAGXQ.js";
30
+ import "./chunk-GEQFMH5M.js";
31
+ import "./chunk-4GMNWW4C.js";
32
+ import "./chunk-SUU2WETN.js";
33
+ import "./chunk-B6RIGNEO.js";
33
34
  import "./chunk-XNLSTHDK.js";
34
35
  import "./chunk-PDWPFR5T.js";
35
36
  import "./chunk-Y5PA7DVK.js";
36
- import "./chunk-FLH4YC6W.js";
37
+ import "./chunk-BF5DRGRZ.js";
37
38
  import {
38
39
  error
39
40
  } from "./chunk-WZWDS3W4.js";
@@ -168,7 +169,8 @@ var views = {
168
169
  var listTokens = async (rc, registry, identity, alias) => {
169
170
  const localTok = await getToken(
170
171
  normalizeRegistryKey(registry),
171
- identity
172
+ identity,
173
+ rc.defaultRegistryKey
172
174
  );
173
175
  if (!localTok) {
174
176
  return { registry, alias, tokens: [] };