vibedgames 0.8.0 → 0.9.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 (40) hide show
  1. package/README.md +14 -6
  2. package/dist/THIRD_PARTY_NOTICES.txt +58 -6
  3. package/dist/{chunk-FNYBZNW2.js → chunk-25BAMW5X.js} +3 -1
  4. package/dist/{chunk-SAANBZ25.js → chunk-2VUUMXAQ.js} +4 -4
  5. package/dist/{chunk-XK5RZQMX.js → chunk-355VG7EO.js} +14 -13
  6. package/dist/{chunk-I6O4HIDY.js → chunk-3HUWAJQH.js} +76 -61
  7. package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
  8. package/dist/chunk-56OY4TEP.js +20125 -0
  9. package/dist/{chunk-XDC7QGOF.js → chunk-6EWHKL7Z.js} +14 -6
  10. package/dist/{chunk-6FZPPUQH.js → chunk-7CXMMC5S.js} +1 -1
  11. package/dist/chunk-7QZSDU52.js +26 -0
  12. package/dist/{chunk-AZGENOOR.js → chunk-AXTLPJ2F.js} +5 -4
  13. package/dist/{chunk-IO6OM6WM.js → chunk-BMTHAVMS.js} +7 -33
  14. package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
  15. package/dist/chunk-FC233UKH.js +170 -0
  16. package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
  17. package/dist/{chunk-TYVYWBY6.js → chunk-H3IPLBXQ.js} +9 -8
  18. package/dist/{chunk-TMK6V5FV.js → chunk-HNRVSBRK.js} +7 -7
  19. package/dist/chunk-K2U7L4RU.js +183 -0
  20. package/dist/{chunk-PQDBCZRT.js → chunk-KZBZNTM4.js} +203 -153
  21. package/dist/{chunk-GUF6ADBF.js → chunk-LXS3NJYD.js} +8 -7
  22. package/dist/{chunk-W5XP4ZVU.js → chunk-LY2GQ32S.js} +11 -10
  23. package/dist/{chunk-K5SC6SXO.js → chunk-NDHXM4PL.js} +5 -5
  24. package/dist/{chunk-HASKWB6B.js → chunk-OD2MNYXD.js} +48 -22
  25. package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
  26. package/dist/{chunk-RYFO3ZPO.js → chunk-RXHTGX7C.js} +9 -2
  27. package/dist/chunk-ST5FC2W3.js +95 -0
  28. package/dist/chunk-TBQ5BU3Q.js +39 -0
  29. package/dist/{chunk-RIGKOLNN.js → chunk-UFR6G6BL.js} +40 -65
  30. package/dist/{chunk-CZPKN32Z.js → chunk-US6QZICZ.js} +10 -10
  31. package/dist/{chunk-Y552BNFZ.js → chunk-UXCWSWWX.js} +7 -7
  32. package/dist/chunk-UZM6OSW5.js +113 -0
  33. package/dist/{chunk-FL6IFBUF.js → chunk-WSRIF6K4.js} +4 -4
  34. package/dist/chunk-X75Y7LUW.js +126 -0
  35. package/dist/chunk-Z5TFZQ5U.js +2478 -0
  36. package/dist/{chunk-H4NBRFBY.js → chunk-ZCYWDKYP.js} +30 -5
  37. package/dist/index.js +30 -19
  38. package/package.json +6 -5
  39. package/dist/chunk-RNBUX5VF.js +0 -68
  40. package/dist/chunk-X4ZABSCN.js +0 -415
package/README.md CHANGED
@@ -29,7 +29,9 @@ vg login # authenticate via browser
29
29
  vg logout # clear credentials
30
30
  vg whoami # show current user
31
31
  vg deploy [dir] # deploy a game directory (reads vibedgames.json or --slug)
32
+ vg deployments [delete <slug> --yes] # list your games, or delete one
32
33
  vg fork <slug> [target] # fork a project's shipped source under a new slug
34
+ vg skills [name] # list the game-studio skills, or print one's SKILL.md
33
35
  vg credits # credit balance + recent usage
34
36
  vg factory [args…] # autonomous game agent (optional plugin, installs on first use)
35
37
  vg completions <bash|zsh|fish> # print shell completions
@@ -81,10 +83,13 @@ Run `vg init` in your project to install the full set of game-building skills
81
83
  ## How deploy works
82
84
 
83
85
  1. Picks the build output (`dist`/`build`/`out`) when the directory is a project root
84
- 2. Walks the directory, hashes files, validates `index.html` exists
85
- 3. Calls `deploy.create` API — gets presigned R2 upload URLs
86
- 4. Uploads files to R2 with bounded concurrency
87
- 5. Calls `deploy.finalize` — game goes live at `{slug}.vibedgames.com`
86
+ 2. Walks the directory, checks the caps and that `index.html` exists, and packs it into one
87
+ `.tgz` bundle
88
+ 3. Calls `deploy.upload` with `bundle: true` (and the `--source` archive) — stages a deployment
89
+ beside the live one and gets a signed `/api/upload` URL for the bundle
90
+ 4. PUTs the bundle there
91
+ 5. Calls `deploy.upload` again with `publish: true` — the server unpacks the bundle and the game
92
+ switches to the new deployment at `{slug}.vibedgames.com`; until then the old one keeps serving
88
93
 
89
94
  Passing `--source` also uploads a forkable source archive, which is what
90
95
  `vg fork <slug>` downloads. It is off by default: the archive is readable by
@@ -92,7 +97,10 @@ any logged-in user, so shipping it is a publish and should be a deliberate act.
92
97
 
93
98
  ## Auth
94
99
 
95
- Uses a device-code polling flow: CLI generates a 6-char code, opens the browser,
96
- polls until the user confirms. Token stored at `~/.config/vg/auth.json`.
100
+ `vg login` is OAuth device authorization (RFC 8628): the CLI prints a code,
101
+ opens `/device` in the browser, and polls until the person approves it there.
102
+ The access token and its refresh token are stored at `~/.config/vg/auth.json`
103
+ and refreshed as needed; `vg logout` revokes them, as does Disconnect under
104
+ Settings → Connected apps.
97
105
  `VG_TOKEN` overrides it (for CI and headless agents) and `VG_API_URL` points the
98
106
  CLI at a non-production API.
@@ -1,7 +1,7 @@
1
1
  The vg CLI bundles the packages below; each one's licence follows its name.
2
2
 
3
3
  ========================================================================
4
- @orpc/client@2.0.0-beta.42 (MIT)
4
+ @orpc/client@2.0.0-beta.45 (MIT)
5
5
  ========================================================================
6
6
 
7
7
  MIT License
@@ -27,7 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
27
  SOFTWARE.
28
28
 
29
29
  ========================================================================
30
- @orpc/shared@2.0.0-beta.42 (MIT)
30
+ @orpc/shared@2.0.0-beta.45 (MIT)
31
31
  ========================================================================
32
32
 
33
33
  MIT License
@@ -53,7 +53,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
53
  SOFTWARE.
54
54
 
55
55
  ========================================================================
56
- @standard-server/core@0.10.1 (MIT)
56
+ @standard-server/core@0.11.0 (MIT)
57
57
  ========================================================================
58
58
 
59
59
  MIT License
@@ -79,7 +79,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
79
79
  SOFTWARE.
80
80
 
81
81
  ========================================================================
82
- @standard-server/fetch@0.10.1 (MIT)
82
+ @standard-server/fetch@0.11.0 (MIT)
83
83
  ========================================================================
84
84
 
85
85
  MIT License
@@ -105,7 +105,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
105
105
  SOFTWARE.
106
106
 
107
107
  ========================================================================
108
- @standard-server/shared@0.10.1 (MIT)
108
+ @standard-server/shared@0.11.0 (MIT)
109
109
  ========================================================================
110
110
 
111
111
  MIT License
@@ -235,7 +235,33 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
235
235
  THE SOFTWARE.
236
236
 
237
237
  ========================================================================
238
- ignore@7.0.12 (MIT)
238
+ fflate@0.8.3 (MIT)
239
+ ========================================================================
240
+
241
+ MIT License
242
+
243
+ Copyright (c) 2026 Arjun Barrett
244
+
245
+ Permission is hereby granted, free of charge, to any person obtaining a copy
246
+ of this software and associated documentation files (the "Software"), to deal
247
+ in the Software without restriction, including without limitation the rights
248
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
249
+ copies of the Software, and to permit persons to whom the Software is
250
+ furnished to do so, subject to the following conditions:
251
+
252
+ The above copyright notice and this permission notice shall be included in all
253
+ copies or substantial portions of the Software.
254
+
255
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
256
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
257
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
258
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
259
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
260
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
261
+ SOFTWARE.
262
+
263
+ ========================================================================
264
+ ignore@7.0.14 (MIT)
239
265
  ========================================================================
240
266
 
241
267
  Licensed MIT; the package ships no licence file.
@@ -381,3 +407,29 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
381
407
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
382
408
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
383
409
  IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
410
+
411
+ ========================================================================
412
+ zod@4.6.7 (MIT)
413
+ ========================================================================
414
+
415
+ MIT License
416
+
417
+ Copyright (c) 2025 Colin McDonnell
418
+
419
+ Permission is hereby granted, free of charge, to any person obtaining a copy
420
+ of this software and associated documentation files (the "Software"), to deal
421
+ in the Software without restriction, including without limitation the rights
422
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
423
+ copies of the Software, and to permit persons to whom the Software is
424
+ furnished to do so, subject to the following conditions:
425
+
426
+ The above copyright notice and this permission notice shall be included in all
427
+ copies or substantial portions of the Software.
428
+
429
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
430
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
431
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
432
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
433
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
434
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
435
+ SOFTWARE.
@@ -7,7 +7,7 @@ var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  defineCommand
9
9
  } from "./chunk-MBXCVCC4.js";
10
- import "./chunk-CAKBGDCY.js";
10
+ import "./chunk-GKDUYJ7R.js";
11
11
 
12
12
  // src/commands/completions.ts
13
13
  var SUPPORTED = /* @__PURE__ */ new Set(["bash", "zsh", "fish"]);
@@ -18,11 +18,13 @@ var SUBCOMMANDS = [
18
18
  "login",
19
19
  "logout",
20
20
  "deploy",
21
+ "deployments",
21
22
  "playtest",
22
23
  "factory",
23
24
  "fork",
24
25
  "generate",
25
26
  "credits",
27
+ "skills",
26
28
  "config",
27
29
  "update",
28
30
  "completions",
@@ -6,10 +6,10 @@ var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  resolveSetting
9
- } from "./chunk-6FZPPUQH.js";
9
+ } from "./chunk-7CXMMC5S.js";
10
10
  import {
11
11
  getConfigDir
12
- } from "./chunk-RYFO3ZPO.js";
12
+ } from "./chunk-RXHTGX7C.js";
13
13
  import {
14
14
  isJsonNumber,
15
15
  isJsonObject,
@@ -68,10 +68,10 @@ var isNewerVersion = (latest, current) => {
68
68
  }
69
69
  return false;
70
70
  };
71
- var fetchLatestVersion = async () => {
71
+ var fetchLatestVersion = async (packageName) => {
72
72
  const registry = process.env.VG_REGISTRY_URL ?? "https://registry.npmjs.org";
73
73
  try {
74
- const res = await fetch(`${registry}/vibedgames/latest`, {
74
+ const res = await fetch(`${registry}/${packageName}/latest`, {
75
75
  signal: AbortSignal.timeout(5e3)
76
76
  });
77
77
  if (!res.ok) {
@@ -8,17 +8,22 @@ import {
8
8
  ensureAgentBrowser,
9
9
  projectSessionId,
10
10
  resolveGameUrl
11
- } from "./chunk-CZPKN32Z.js";
12
- import "./chunk-2QBYTIMH.js";
13
- import "./chunk-SAANBZ25.js";
14
- import "./chunk-6FZPPUQH.js";
15
- import "./chunk-ZI6PKVXG.js";
11
+ } from "./chunk-US6QZICZ.js";
12
+ import "./chunk-2VUUMXAQ.js";
13
+ import "./chunk-7CXMMC5S.js";
16
14
  import {
17
15
  authErrorCode,
18
16
  createClient
19
- } from "./chunk-PQDBCZRT.js";
17
+ } from "./chunk-KZBZNTM4.js";
18
+ import "./chunk-K2U7L4RU.js";
20
19
  import "./chunk-Z4Z24FWO.js";
21
20
  import "./chunk-PEUP4MZR.js";
21
+ import {
22
+ getBaseUrl,
23
+ getToken
24
+ } from "./chunk-RXHTGX7C.js";
25
+ import "./chunk-5535KDYI.js";
26
+ import "./chunk-ZI6PKVXG.js";
22
27
  import {
23
28
  outputArgs,
24
29
  writeStructured
@@ -27,20 +32,16 @@ import {
27
32
  assertKnownFlags
28
33
  } from "./chunk-RZ4DIJQW.js";
29
34
  import {
30
- getBaseUrl,
31
- getToken
32
- } from "./chunk-RYFO3ZPO.js";
35
+ consola
36
+ } from "./chunk-D2RF35HJ.js";
33
37
  import {
34
38
  isJsonObject,
35
39
  isJsonString
36
40
  } from "./chunk-J6PKNPI2.js";
37
- import {
38
- consola
39
- } from "./chunk-CU7UY5YJ.js";
40
41
  import {
41
42
  defineCommand
42
43
  } from "./chunk-MBXCVCC4.js";
43
- import "./chunk-CAKBGDCY.js";
44
+ import "./chunk-GKDUYJ7R.js";
44
45
 
45
46
  // src/lib/playtest/browser.ts
46
47
  import { spawnSync } from "node:child_process";
@@ -15,11 +15,11 @@ import {
15
15
  import {
16
16
  __commonJS,
17
17
  __toESM
18
- } from "./chunk-CAKBGDCY.js";
18
+ } from "./chunk-GKDUYJ7R.js";
19
19
 
20
- // ../../node_modules/.pnpm/ignore@7.0.12/node_modules/ignore/index.js
20
+ // ../../node_modules/.pnpm/ignore@7.0.14/node_modules/ignore/index.js
21
21
  var require_ignore = __commonJS({
22
- "../../node_modules/.pnpm/ignore@7.0.12/node_modules/ignore/index.js"(exports, module) {
22
+ "../../node_modules/.pnpm/ignore@7.0.14/node_modules/ignore/index.js"(exports, module) {
23
23
  function makeArray(subject) {
24
24
  return Array.isArray(subject) ? subject : [subject];
25
25
  }
@@ -30,6 +30,7 @@ var require_ignore = __commonJS({
30
30
  var REGEX_LITERAL_SPECIAL = /[.*+?()[\]{}^$|\\/]/;
31
31
  var BOM = "\uFEFF";
32
32
  var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
33
+ var REGEX_ANCHORED_GLOBSTAR = /^\/\*{2,}$/;
33
34
  var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
34
35
  var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
35
36
  var REGEX_SPLITALL_CRLF = /\r?\n/g;
@@ -47,10 +48,6 @@ var require_ignore = __commonJS({
47
48
  return value;
48
49
  };
49
50
  var RETURN_FALSE = () => false;
50
- var cleanRangeBackSlash = (slashes) => {
51
- const { length } = slashes;
52
- return slashes.slice(0, length - length % 2);
53
- };
54
51
  var POSIX_CLASSES = {
55
52
  alnum: "0-9A-Za-z",
56
53
  alpha: "A-Za-z",
@@ -121,11 +118,11 @@ var require_ignore = __commonJS({
121
118
  return null;
122
119
  }
123
120
  if (end > nameStart && pattern[end - 1] === ":") {
124
- const expanded = POSIX_CLASSES[pattern.slice(nameStart, end - 1)];
125
- if (expanded === UNDEFINED) {
121
+ const name = pattern.slice(nameStart, end - 1);
122
+ if (!Object.prototype.hasOwnProperty.call(POSIX_CLASSES, name)) {
126
123
  return null;
127
124
  }
128
- body += expanded;
125
+ body += POSIX_CLASSES[name];
129
126
  prev = EMPTY;
130
127
  index = end;
131
128
  } else {
@@ -154,6 +151,7 @@ var require_ignore = __commonJS({
154
151
  );
155
152
  var TRAILING_WILDCARD = "\uE000";
156
153
  var TRAILING_DOUBLESTAR = "\uE001";
154
+ var isReserved = (char) => char === PLACEHOLDER || char === TRAILING_WILDCARD || char === TRAILING_DOUBLESTAR;
157
155
  var extractBrackets = (pattern) => {
158
156
  const sources = [];
159
157
  const hold = (source) => `${PLACEHOLDER}${sources.push(source) - 1}${PLACEHOLDER}`;
@@ -166,16 +164,16 @@ var require_ignore = __commonJS({
166
164
  const escaped = pattern[index + 1];
167
165
  if (escaped === UNDEFINED || escaped === SLASH && index + 2 === length) {
168
166
  out += hold(NEVER_MATCH);
169
- } else if (escaped === "*" || escaped === "[" || escaped === SPACE || escaped === ESCAPE) {
167
+ } else if (escaped === "*" || escaped === "[" || escaped === SPACE) {
170
168
  out += pattern.slice(index, index + 2);
171
169
  } else {
172
170
  out += hold(
173
- REGEX_LITERAL_SPECIAL.test(escaped) ? ESCAPE + escaped : escaped
171
+ REGEX_LITERAL_SPECIAL.test(escaped) ? ESCAPE + escaped : isReserved(escaped) ? `[${escaped}]` : escaped
174
172
  );
175
173
  }
176
174
  index += 2;
177
- } else if (char === PLACEHOLDER) {
178
- out += hold(`[${PLACEHOLDER}]`);
175
+ } else if (isReserved(char)) {
176
+ out += hold(`[${char}]`);
179
177
  index++;
180
178
  } else if (char === "[") {
181
179
  const scanned = scanBracket(pattern, index);
@@ -214,6 +212,20 @@ var require_ignore = __commonJS({
214
212
  (_, run, space) => space ? run.slice(0, run.length - run.length % 2) + SPACE : run,
215
213
  ESCAPE + SPACE
216
214
  ],
215
+ // git's wildmatch() reads a run of two or more asterisks as one globstar
216
+ // whenever the run fills a path segment: it starts the pattern or follows
217
+ // a `/`, and it ends the pattern or comes before a `/`. A run of two is
218
+ // already `**`; a longer one is folded into `**` here, so the steps
219
+ // below only ever have to know `**`.
220
+ // `***/foo` -> `**/foo`, `a/***/b` -> `a/**/b`, `a/***` -> `a/**`
221
+ // git also takes a run beside a literal prefix (`a***/b`) or beside an
222
+ // escaped slash (`***\/b`) as a globstar, and this does not; the README
223
+ // lists both, under "A run of asterisks".
224
+ [
225
+ /(^|\/)\*{3,}(?=\/|$)/g,
226
+ (_, start) => `${start}**`,
227
+ "*"
228
+ ],
217
229
  // Escape metacharacters
218
230
  // which is written down by users but means special for regular expressions.
219
231
  // > There are 12 characters with special meanings:
@@ -310,19 +322,17 @@ var require_ignore = __commonJS({
310
322
  // trailing wildcard, held apart from a literal star
311
323
  [
312
324
  // The step above leaves a trailing `*` alone, so a single `\*` is all that
313
- // can be left at the end here. Whether it is a wildcard or a literal
314
- // turns on the backslashes the user put in front of it: the escaper has
315
- // since doubled every one, so what stands here is those `2N` doubled
316
- // backslashes and then the star's own escape. An even number of the
317
- // original `N` leaves the star unescaped -- a wildcard -- and an odd
318
- // number escapes it -- a literal. This runs while the two are still
319
- // distinct, before the unescape steps below collapse the literal onto
320
- // the very `\*` a wildcard leaves behind.
325
+ // can be left at the end here, and what stands in front of it says which
326
+ // kind it is. A wildcard arrives as the escaper wrote it, `\*` with
327
+ // nothing before it; a literal arrives as the user's own escape, which
328
+ // the escaper doubled, and then the star's own -- `\\` and then `\*`.
329
+ // There is no third case: every backslash still reaching the chain is
330
+ // one `\*`, `\[` or `\ ` carries itself, and each is followed by its
331
+ // own character, so a longer run can never form. This runs while the
332
+ // two are still distinct, before the unescape steps below collapse the
333
+ // literal onto the very `\*` a wildcard leaves behind.
321
334
  /(^|[^\\])((?:\\\\)*)\\\*$/,
322
- (match, p1, p2) => (
323
- // `p2` holds the doubled user backslashes; half of them is `N`.
324
- p2.length / 2 % 2 === 0 ? p1 + p2 + TRAILING_WILDCARD : match
325
- ),
335
+ (match, p1, p2) => p2 === EMPTY ? p1 + TRAILING_WILDCARD : match,
326
336
  "*"
327
337
  ],
328
338
  [
@@ -343,10 +353,11 @@ var require_ignore = __commonJS({
343
353
  // Every real bracket expression -- POSIX classes included -- has already
344
354
  // been held aside by `extractBrackets`, so the only `[` left in the
345
355
  // pattern is an escaped, literal one.
346
- // `\` is escaped by step 3
347
- /\\\[([^\]/]*?)(\\*)($|\])/g,
348
- // '\\[bar]' -> '\\\\[bar\\]'
349
- (match, range, endEscape, close) => `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`,
356
+ // A backslash could only stand at the end of the range if it quoted the
357
+ // `]`, and `\]` is held aside long before this.
358
+ /\\\[([^\]/]*?)($|\])/g,
359
+ // '\\[bar]' -> '\\\\[bar]'
360
+ (match, range, close) => `\\[${range}${close}`,
350
361
  "["
351
362
  ],
352
363
  // ending
@@ -476,6 +487,9 @@ var require_ignore = __commonJS({
476
487
  return out;
477
488
  };
478
489
  var makeRegexPrefix = (pattern) => {
490
+ if (REGEX_ANCHORED_GLOBSTAR.test(pattern)) {
491
+ pattern = "**";
492
+ }
479
493
  const { source, sources } = extractBrackets(pattern);
480
494
  const replaced = REPLACERS.reduce(
481
495
  // A pass whose matcher finds nothing hands back the very string it was
@@ -691,39 +705,33 @@ var require_ignore = __commonJS({
691
705
  }
692
706
  // Test one single path without recursively checking parent directories
693
707
  //
694
- // - checkUnignored `boolean` whether should check if the path is unignored,
695
- // setting `checkUnignored` to `false` could reduce additional
696
- // path matching.
697
- // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
698
- // @returns {TestResult} true if a file is ignored
699
- test(path2, checkUnignored, mode) {
700
- let ignored = false;
701
- let unignored = false;
702
- let matchedRule;
708
+ // - mode `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
709
+ // @returns {TestResult}
710
+ test(path2, mode) {
703
711
  const rules = this._rules;
704
712
  const { length } = rules;
705
713
  const shortcut = this._basenameCount * 2 >= length;
706
714
  const basename = shortcut ? basenameOf(path2) : path2;
707
- for (let index = 0; index < length; index++) {
715
+ for (let index = length - 1; index >= 0; index--) {
708
716
  const rule = rules[index];
709
- const { negative } = rule;
710
- const skip = unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored;
711
- if (!skip && rule[mode].test(
717
+ if (rule[mode].test(
712
718
  shortcut && rule._basenameOnly ? basename : path2
713
719
  )) {
714
- ignored = !negative;
715
- unignored = negative;
716
- matchedRule = negative ? UNDEFINED : rule;
720
+ const { negative } = rule;
721
+ const ret = {
722
+ ignored: !negative,
723
+ unignored: negative
724
+ };
725
+ if (!negative) {
726
+ ret.rule = rule;
727
+ }
728
+ return ret;
717
729
  }
718
730
  }
719
- const ret = {
720
- ignored,
721
- unignored
731
+ return {
732
+ ignored: false,
733
+ unignored: false
722
734
  };
723
- if (matchedRule) {
724
- ret.rule = matchedRule;
725
- }
726
- return ret;
727
735
  }
728
736
  };
729
737
  var throwError = (message, Ctor) => {
@@ -796,36 +804,36 @@ var require_ignore = __commonJS({
796
804
  return this.add(pattern);
797
805
  }
798
806
  // @returns {TestResult}
799
- _test(originalPath, cache, checkUnignored) {
807
+ _test(originalPath, cache) {
800
808
  const path2 = originalPath && checkPath.convert(originalPath);
801
809
  checkPath(
802
810
  path2,
803
811
  originalPath,
804
812
  this._strictPathCheck ? throwError : RETURN_FALSE
805
813
  );
806
- return this._t(path2, cache, checkUnignored);
814
+ return this._t(path2, cache);
807
815
  }
808
816
  checkIgnore(path2) {
809
817
  if (path2.charCodeAt(path2.length - 1) !== SLASH_CODE) {
810
818
  return this.test(path2);
811
819
  }
812
- const dir = this._t(path2, this._testCache, true);
820
+ const dir = this._t(path2, this._testCache);
813
821
  if (dir.ignored) {
814
822
  return dir;
815
823
  }
816
824
  const literal = this._rules.testLiteral(path2);
817
825
  return literal.ignored || literal.unignored ? literal : dir;
818
826
  }
819
- _t(path2, cache, checkUnignored) {
827
+ _t(path2, cache) {
820
828
  if (path2 in cache) {
821
829
  return cache[path2];
822
830
  }
823
831
  const parentPath = parentOf(path2);
824
- const parent = parentPath ? this._t(parentPath, cache, checkUnignored) : UNDEFINED;
825
- return cache[path2] = parent && parent.ignored ? parent : this._rules.test(path2, checkUnignored, MODE_IGNORE);
832
+ const parent = parentPath ? this._t(parentPath, cache) : UNDEFINED;
833
+ return cache[path2] = parent && parent.ignored ? parent : this._rules.test(path2, MODE_IGNORE);
826
834
  }
827
835
  ignores(path2) {
828
- return this._test(path2, this._ignoreCache, false).ignored;
836
+ return this._test(path2, this._ignoreCache).ignored;
829
837
  }
830
838
  createFilter() {
831
839
  return (path2) => !this.ignores(path2);
@@ -835,7 +843,7 @@ var require_ignore = __commonJS({
835
843
  }
836
844
  // @returns {TestResult}
837
845
  test(path2) {
838
- return this._test(path2, this._testCache, true);
846
+ return this._test(path2, this._testCache);
839
847
  }
840
848
  };
841
849
  var factory = (options) => new Ignore(options);
@@ -1052,6 +1060,12 @@ var packSource = async (root, tmpDir) => {
1052
1060
  sha256: createHash("sha256").update(buf).digest("hex")
1053
1061
  };
1054
1062
  };
1063
+ var packBuild = async (dir, files, tmpDir) => {
1064
+ mkdirSync(tmpDir, { recursive: true });
1065
+ const tarball = path.join(tmpDir, `vg-build-${process.pid}-${files.length}.tgz`);
1066
+ await Qn({ cwd: dir, file: tarball, gzip: true, portable: true }, files);
1067
+ return { bytes: statSync(tarball).size, path: tarball };
1068
+ };
1055
1069
  var extractSource = async (archivePath, destDir) => {
1056
1070
  mkdirSync(destDir, { recursive: true });
1057
1071
  await So({ cwd: destDir, file: archivePath });
@@ -1059,5 +1073,6 @@ var extractSource = async (archivePath, destDir) => {
1059
1073
 
1060
1074
  export {
1061
1075
  packSource,
1076
+ packBuild,
1062
1077
  extractSource
1063
1078
  };
@@ -7,7 +7,7 @@ var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  __commonJS,
9
9
  __require
10
- } from "./chunk-CAKBGDCY.js";
10
+ } from "./chunk-GKDUYJ7R.js";
11
11
 
12
12
  // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
13
13
  var require_windows = __commonJS({