@arcote.tech/arc-cli 0.4.6 → 0.4.8

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.
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ var __export = (target, all) => {
29
29
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
30
  var __require = import.meta.require;
31
31
 
32
- // node_modules/commander/lib/error.js
32
+ // ../../node_modules/commander/lib/error.js
33
33
  var require_error = __commonJS((exports) => {
34
34
  class CommanderError extends Error {
35
35
  constructor(exitCode, code, message) {
@@ -53,7 +53,7 @@ var require_error = __commonJS((exports) => {
53
53
  exports.InvalidArgumentError = InvalidArgumentError;
54
54
  });
55
55
 
56
- // node_modules/commander/lib/argument.js
56
+ // ../../node_modules/commander/lib/argument.js
57
57
  var require_argument = __commonJS((exports) => {
58
58
  var { InvalidArgumentError } = require_error();
59
59
 
@@ -132,7 +132,7 @@ var require_argument = __commonJS((exports) => {
132
132
  exports.humanReadableArgName = humanReadableArgName;
133
133
  });
134
134
 
135
- // node_modules/commander/lib/help.js
135
+ // ../../node_modules/commander/lib/help.js
136
136
  var require_help = __commonJS((exports) => {
137
137
  var { humanReadableArgName } = require_argument();
138
138
 
@@ -379,7 +379,7 @@ var require_help = __commonJS((exports) => {
379
379
  exports.Help = Help;
380
380
  });
381
381
 
382
- // node_modules/commander/lib/option.js
382
+ // ../../node_modules/commander/lib/option.js
383
383
  var require_option = __commonJS((exports) => {
384
384
  var { InvalidArgumentError } = require_error();
385
385
 
@@ -531,7 +531,7 @@ var require_option = __commonJS((exports) => {
531
531
  exports.DualOptions = DualOptions;
532
532
  });
533
533
 
534
- // node_modules/commander/lib/suggestSimilar.js
534
+ // ../../node_modules/commander/lib/suggestSimilar.js
535
535
  var require_suggestSimilar = __commonJS((exports) => {
536
536
  var maxDistance = 3;
537
537
  function editDistance(a, b) {
@@ -604,7 +604,7 @@ var require_suggestSimilar = __commonJS((exports) => {
604
604
  exports.suggestSimilar = suggestSimilar;
605
605
  });
606
606
 
607
- // node_modules/commander/lib/command.js
607
+ // ../../node_modules/commander/lib/command.js
608
608
  var require_command = __commonJS((exports) => {
609
609
  var EventEmitter = __require("node:events").EventEmitter;
610
610
  var childProcess = __require("node:child_process");
@@ -1787,7 +1787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1787
1787
  exports.Command = Command;
1788
1788
  });
1789
1789
 
1790
- // node_modules/commander/index.js
1790
+ // ../../node_modules/commander/index.js
1791
1791
  var require_commander = __commonJS((exports, module) => {
1792
1792
  var { Argument } = require_argument();
1793
1793
  var { Command } = require_command();
@@ -4153,12 +4153,11 @@ var require_brace_expansion = __commonJS((exports, module) => {
4153
4153
  }
4154
4154
  });
4155
4155
 
4156
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/constants.js
4156
+ // ../../node_modules/picomatch/lib/constants.js
4157
4157
  var require_constants = __commonJS((exports, module) => {
4158
4158
  var path4 = __require("node:path");
4159
4159
  var WIN_SLASH = "\\\\/";
4160
4160
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
4161
- var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
4162
4161
  var DOT_LITERAL = "\\.";
4163
4162
  var PLUS_LITERAL = "\\+";
4164
4163
  var QMARK_LITERAL = "\\?";
@@ -4206,7 +4205,6 @@ var require_constants = __commonJS((exports, module) => {
4206
4205
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
4207
4206
  };
4208
4207
  var POSIX_REGEX_SOURCE = {
4209
- __proto__: null,
4210
4208
  alnum: "a-zA-Z0-9",
4211
4209
  alpha: "a-zA-Z",
4212
4210
  ascii: "\\x00-\\x7F",
@@ -4223,7 +4221,6 @@ var require_constants = __commonJS((exports, module) => {
4223
4221
  xdigit: "A-Fa-f0-9"
4224
4222
  };
4225
4223
  module.exports = {
4226
- DEFAULT_MAX_EXTGLOB_RECURSION,
4227
4224
  MAX_LENGTH: 1024 * 64,
4228
4225
  POSIX_REGEX_SOURCE,
4229
4226
  REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
@@ -4233,7 +4230,6 @@ var require_constants = __commonJS((exports, module) => {
4233
4230
  REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
4234
4231
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
4235
4232
  REPLACEMENTS: {
4236
- __proto__: null,
4237
4233
  "***": "*",
4238
4234
  "**/**": "**",
4239
4235
  "**/**/**": "**"
@@ -4297,7 +4293,7 @@ var require_constants = __commonJS((exports, module) => {
4297
4293
  };
4298
4294
  });
4299
4295
 
4300
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/utils.js
4296
+ // ../../node_modules/picomatch/lib/utils.js
4301
4297
  var require_utils = __commonJS((exports) => {
4302
4298
  var path4 = __require("node:path");
4303
4299
  var win322 = process.platform === "win32";
@@ -4357,7 +4353,7 @@ var require_utils = __commonJS((exports) => {
4357
4353
  };
4358
4354
  });
4359
4355
 
4360
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/scan.js
4356
+ // ../../node_modules/picomatch/lib/scan.js
4361
4357
  var require_scan = __commonJS((exports, module) => {
4362
4358
  var utils = require_utils();
4363
4359
  var {
@@ -4672,7 +4668,7 @@ var require_scan = __commonJS((exports, module) => {
4672
4668
  module.exports = scan;
4673
4669
  });
4674
4670
 
4675
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/parse.js
4671
+ // ../../node_modules/picomatch/lib/parse.js
4676
4672
  var require_parse = __commonJS((exports, module) => {
4677
4673
  var constants = require_constants();
4678
4674
  var utils = require_utils();
@@ -4699,213 +4695,6 @@ var require_parse = __commonJS((exports, module) => {
4699
4695
  var syntaxError = (type, char) => {
4700
4696
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
4701
4697
  };
4702
- var splitTopLevel = (input) => {
4703
- const parts = [];
4704
- let bracket = 0;
4705
- let paren = 0;
4706
- let quote = 0;
4707
- let value = "";
4708
- let escaped = false;
4709
- for (const ch of input) {
4710
- if (escaped === true) {
4711
- value += ch;
4712
- escaped = false;
4713
- continue;
4714
- }
4715
- if (ch === "\\") {
4716
- value += ch;
4717
- escaped = true;
4718
- continue;
4719
- }
4720
- if (ch === '"') {
4721
- quote = quote === 1 ? 0 : 1;
4722
- value += ch;
4723
- continue;
4724
- }
4725
- if (quote === 0) {
4726
- if (ch === "[") {
4727
- bracket++;
4728
- } else if (ch === "]" && bracket > 0) {
4729
- bracket--;
4730
- } else if (bracket === 0) {
4731
- if (ch === "(") {
4732
- paren++;
4733
- } else if (ch === ")" && paren > 0) {
4734
- paren--;
4735
- } else if (ch === "|" && paren === 0) {
4736
- parts.push(value);
4737
- value = "";
4738
- continue;
4739
- }
4740
- }
4741
- }
4742
- value += ch;
4743
- }
4744
- parts.push(value);
4745
- return parts;
4746
- };
4747
- var isPlainBranch = (branch) => {
4748
- let escaped = false;
4749
- for (const ch of branch) {
4750
- if (escaped === true) {
4751
- escaped = false;
4752
- continue;
4753
- }
4754
- if (ch === "\\") {
4755
- escaped = true;
4756
- continue;
4757
- }
4758
- if (/[?*+@!()[\]{}]/.test(ch)) {
4759
- return false;
4760
- }
4761
- }
4762
- return true;
4763
- };
4764
- var normalizeSimpleBranch = (branch) => {
4765
- let value = branch.trim();
4766
- let changed = true;
4767
- while (changed === true) {
4768
- changed = false;
4769
- if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
4770
- value = value.slice(2, -1);
4771
- changed = true;
4772
- }
4773
- }
4774
- if (!isPlainBranch(value)) {
4775
- return;
4776
- }
4777
- return value.replace(/\\(.)/g, "$1");
4778
- };
4779
- var hasRepeatedCharPrefixOverlap = (branches) => {
4780
- const values = branches.map(normalizeSimpleBranch).filter(Boolean);
4781
- for (let i = 0;i < values.length; i++) {
4782
- for (let j = i + 1;j < values.length; j++) {
4783
- const a = values[i];
4784
- const b = values[j];
4785
- const char = a[0];
4786
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
4787
- continue;
4788
- }
4789
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
4790
- return true;
4791
- }
4792
- }
4793
- }
4794
- return false;
4795
- };
4796
- var parseRepeatedExtglob = (pattern, requireEnd = true) => {
4797
- if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
4798
- return;
4799
- }
4800
- let bracket = 0;
4801
- let paren = 0;
4802
- let quote = 0;
4803
- let escaped = false;
4804
- for (let i = 1;i < pattern.length; i++) {
4805
- const ch = pattern[i];
4806
- if (escaped === true) {
4807
- escaped = false;
4808
- continue;
4809
- }
4810
- if (ch === "\\") {
4811
- escaped = true;
4812
- continue;
4813
- }
4814
- if (ch === '"') {
4815
- quote = quote === 1 ? 0 : 1;
4816
- continue;
4817
- }
4818
- if (quote === 1) {
4819
- continue;
4820
- }
4821
- if (ch === "[") {
4822
- bracket++;
4823
- continue;
4824
- }
4825
- if (ch === "]" && bracket > 0) {
4826
- bracket--;
4827
- continue;
4828
- }
4829
- if (bracket > 0) {
4830
- continue;
4831
- }
4832
- if (ch === "(") {
4833
- paren++;
4834
- continue;
4835
- }
4836
- if (ch === ")") {
4837
- paren--;
4838
- if (paren === 0) {
4839
- if (requireEnd === true && i !== pattern.length - 1) {
4840
- return;
4841
- }
4842
- return {
4843
- type: pattern[0],
4844
- body: pattern.slice(2, i),
4845
- end: i
4846
- };
4847
- }
4848
- }
4849
- }
4850
- };
4851
- var getStarExtglobSequenceOutput = (pattern) => {
4852
- let index = 0;
4853
- const chars = [];
4854
- while (index < pattern.length) {
4855
- const match2 = parseRepeatedExtglob(pattern.slice(index), false);
4856
- if (!match2 || match2.type !== "*") {
4857
- return;
4858
- }
4859
- const branches = splitTopLevel(match2.body).map((branch2) => branch2.trim());
4860
- if (branches.length !== 1) {
4861
- return;
4862
- }
4863
- const branch = normalizeSimpleBranch(branches[0]);
4864
- if (!branch || branch.length !== 1) {
4865
- return;
4866
- }
4867
- chars.push(branch);
4868
- index += match2.end + 1;
4869
- }
4870
- if (chars.length < 1) {
4871
- return;
4872
- }
4873
- const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
4874
- return `${source}*`;
4875
- };
4876
- var repeatedExtglobRecursion = (pattern) => {
4877
- let depth = 0;
4878
- let value = pattern.trim();
4879
- let match2 = parseRepeatedExtglob(value);
4880
- while (match2) {
4881
- depth++;
4882
- value = match2.body.trim();
4883
- match2 = parseRepeatedExtglob(value);
4884
- }
4885
- return depth;
4886
- };
4887
- var analyzeRepeatedExtglob = (body, options) => {
4888
- if (options.maxExtglobRecursion === false) {
4889
- return { risky: false };
4890
- }
4891
- const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
4892
- const branches = splitTopLevel(body).map((branch) => branch.trim());
4893
- if (branches.length > 1) {
4894
- if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
4895
- return { risky: true };
4896
- }
4897
- }
4898
- for (const branch of branches) {
4899
- const safeOutput = getStarExtglobSequenceOutput(branch);
4900
- if (safeOutput) {
4901
- return { risky: true, safeOutput };
4902
- }
4903
- if (repeatedExtglobRecursion(branch) > max) {
4904
- return { risky: true };
4905
- }
4906
- }
4907
- return { risky: false };
4908
- };
4909
4698
  var parse = (input, options) => {
4910
4699
  if (typeof input !== "string") {
4911
4700
  throw new TypeError("Expected a string");
@@ -5038,8 +4827,6 @@ var require_parse = __commonJS((exports, module) => {
5038
4827
  token.prev = prev;
5039
4828
  token.parens = state.parens;
5040
4829
  token.output = state.output;
5041
- token.startIndex = state.index;
5042
- token.tokensIndex = tokens.length;
5043
4830
  const output = (opts.capture ? "(" : "") + token.open;
5044
4831
  increment("parens");
5045
4832
  push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
@@ -5047,26 +4834,6 @@ var require_parse = __commonJS((exports, module) => {
5047
4834
  extglobs.push(token);
5048
4835
  };
5049
4836
  const extglobClose = (token) => {
5050
- const literal = input.slice(token.startIndex, state.index + 1);
5051
- const body = input.slice(token.startIndex + 2, state.index);
5052
- const analysis = analyzeRepeatedExtglob(body, opts);
5053
- if ((token.type === "plus" || token.type === "star") && analysis.risky) {
5054
- const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
5055
- const open = tokens[token.tokensIndex];
5056
- open.type = "text";
5057
- open.value = literal;
5058
- open.output = safeOutput || utils.escapeRegex(literal);
5059
- for (let i = token.tokensIndex + 1;i < tokens.length; i++) {
5060
- tokens[i].value = "";
5061
- tokens[i].output = "";
5062
- delete tokens[i].suffix;
5063
- }
5064
- state.output = token.output + open.output;
5065
- state.backtrack = true;
5066
- push({ type: "paren", extglob: true, value, output: "" });
5067
- decrement("parens");
5068
- return;
5069
- }
5070
4837
  let output = token.close + (opts.capture ? ")" : "");
5071
4838
  let rest;
5072
4839
  if (token.type === "negate") {
@@ -5679,7 +5446,7 @@ var require_parse = __commonJS((exports, module) => {
5679
5446
  module.exports = parse;
5680
5447
  });
5681
5448
 
5682
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/picomatch.js
5449
+ // ../../node_modules/picomatch/lib/picomatch.js
5683
5450
  var require_picomatch = __commonJS((exports, module) => {
5684
5451
  var path4 = __require("node:path");
5685
5452
  var scan = require_scan();
@@ -5820,7 +5587,7 @@ var require_picomatch = __commonJS((exports, module) => {
5820
5587
  module.exports = picomatch;
5821
5588
  });
5822
5589
 
5823
- // node_modules/chokidar/node_modules/readdirp/index.js
5590
+ // ../../node_modules/readdirp/index.js
5824
5591
  var require_readdirp = __commonJS((exports, module) => {
5825
5592
  var fs2 = __require("node:fs");
5826
5593
  var { Readable } = __require("node:stream");
@@ -5942,1547 +5709,113 @@ var require_readdirp = __commonJS((exports, module) => {
5942
5709
  }
5943
5710
  } else {
5944
5711
  const parent = this.parents.pop();
5945
- if (!parent) {
5946
- this.push(null);
5947
- break;
5948
- }
5949
- this.parent = await parent;
5950
- if (this.destroyed)
5951
- return;
5952
- }
5953
- }
5954
- } catch (error) {
5955
- this.destroy(error);
5956
- } finally {
5957
- this.reading = false;
5958
- }
5959
- }
5960
- async _exploreDir(path4, depth) {
5961
- let files;
5962
- try {
5963
- files = await readdir2(path4, this._rdOptions);
5964
- } catch (error) {
5965
- this._onError(error);
5966
- }
5967
- return { files, depth, path: path4 };
5968
- }
5969
- async _formatEntry(dirent, path4) {
5970
- let entry;
5971
- try {
5972
- const basename2 = this._isDirent ? dirent.name : dirent;
5973
- const fullPath = sysPath.resolve(sysPath.join(path4, basename2));
5974
- entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename: basename2 };
5975
- entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
5976
- } catch (err) {
5977
- this._onError(err);
5978
- }
5979
- return entry;
5980
- }
5981
- _onError(err) {
5982
- if (isNormalFlowError(err) && !this.destroyed) {
5983
- this.emit("warn", err);
5984
- } else {
5985
- this.destroy(err);
5986
- }
5987
- }
5988
- async _getEntryType(entry) {
5989
- const stats = entry && entry[this._statsProp];
5990
- if (!stats) {
5991
- return;
5992
- }
5993
- if (stats.isFile()) {
5994
- return "file";
5995
- }
5996
- if (stats.isDirectory()) {
5997
- return "directory";
5998
- }
5999
- if (stats && stats.isSymbolicLink()) {
6000
- const full = entry.fullPath;
6001
- try {
6002
- const entryRealPath = await realpath2(full);
6003
- const entryRealPathStats = await lstat2(entryRealPath);
6004
- if (entryRealPathStats.isFile()) {
6005
- return "file";
6006
- }
6007
- if (entryRealPathStats.isDirectory()) {
6008
- const len = entryRealPath.length;
6009
- if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
6010
- const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
6011
- recursiveError.code = RECURSIVE_ERROR_CODE;
6012
- return this._onError(recursiveError);
6013
- }
6014
- return "directory";
6015
- }
6016
- } catch (error) {
6017
- this._onError(error);
6018
- }
6019
- }
6020
- }
6021
- _includeAsFile(entry) {
6022
- const stats = entry && entry[this._statsProp];
6023
- return stats && this._wantsEverything && !stats.isDirectory();
6024
- }
6025
- }
6026
- var readdirp = (root, options = {}) => {
6027
- let type = options.entryType || options.type;
6028
- if (type === "both")
6029
- type = FILE_DIR_TYPE;
6030
- if (type)
6031
- options.type = type;
6032
- if (!root) {
6033
- throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
6034
- } else if (typeof root !== "string") {
6035
- throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
6036
- } else if (type && !ALL_TYPES.includes(type)) {
6037
- throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
6038
- }
6039
- options.root = root;
6040
- return new ReaddirpStream(options);
6041
- };
6042
- var readdirpPromise = (root, options = {}) => {
6043
- return new Promise((resolve, reject) => {
6044
- const files = [];
6045
- readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
6046
- });
6047
- };
6048
- readdirp.promise = readdirpPromise;
6049
- readdirp.ReaddirpStream = ReaddirpStream;
6050
- readdirp.default = readdirp;
6051
- module.exports = readdirp;
6052
- });
6053
-
6054
- // ../../node_modules/picomatch/lib/constants.js
6055
- var require_constants2 = __commonJS((exports, module) => {
6056
- var path4 = __require("node:path");
6057
- var WIN_SLASH = "\\\\/";
6058
- var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
6059
- var DOT_LITERAL = "\\.";
6060
- var PLUS_LITERAL = "\\+";
6061
- var QMARK_LITERAL = "\\?";
6062
- var SLASH_LITERAL = "\\/";
6063
- var ONE_CHAR = "(?=.)";
6064
- var QMARK = "[^/]";
6065
- var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
6066
- var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
6067
- var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
6068
- var NO_DOT = `(?!${DOT_LITERAL})`;
6069
- var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
6070
- var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
6071
- var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
6072
- var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
6073
- var STAR = `${QMARK}*?`;
6074
- var POSIX_CHARS = {
6075
- DOT_LITERAL,
6076
- PLUS_LITERAL,
6077
- QMARK_LITERAL,
6078
- SLASH_LITERAL,
6079
- ONE_CHAR,
6080
- QMARK,
6081
- END_ANCHOR,
6082
- DOTS_SLASH,
6083
- NO_DOT,
6084
- NO_DOTS,
6085
- NO_DOT_SLASH,
6086
- NO_DOTS_SLASH,
6087
- QMARK_NO_DOT,
6088
- STAR,
6089
- START_ANCHOR
6090
- };
6091
- var WINDOWS_CHARS = {
6092
- ...POSIX_CHARS,
6093
- SLASH_LITERAL: `[${WIN_SLASH}]`,
6094
- QMARK: WIN_NO_SLASH,
6095
- STAR: `${WIN_NO_SLASH}*?`,
6096
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
6097
- NO_DOT: `(?!${DOT_LITERAL})`,
6098
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6099
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
6100
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6101
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
6102
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
6103
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
6104
- };
6105
- var POSIX_REGEX_SOURCE = {
6106
- alnum: "a-zA-Z0-9",
6107
- alpha: "a-zA-Z",
6108
- ascii: "\\x00-\\x7F",
6109
- blank: " \\t",
6110
- cntrl: "\\x00-\\x1F\\x7F",
6111
- digit: "0-9",
6112
- graph: "\\x21-\\x7E",
6113
- lower: "a-z",
6114
- print: "\\x20-\\x7E ",
6115
- punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
6116
- space: " \\t\\r\\n\\v\\f",
6117
- upper: "A-Z",
6118
- word: "A-Za-z0-9_",
6119
- xdigit: "A-Fa-f0-9"
6120
- };
6121
- module.exports = {
6122
- MAX_LENGTH: 1024 * 64,
6123
- POSIX_REGEX_SOURCE,
6124
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
6125
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
6126
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
6127
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
6128
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
6129
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
6130
- REPLACEMENTS: {
6131
- "***": "*",
6132
- "**/**": "**",
6133
- "**/**/**": "**"
6134
- },
6135
- CHAR_0: 48,
6136
- CHAR_9: 57,
6137
- CHAR_UPPERCASE_A: 65,
6138
- CHAR_LOWERCASE_A: 97,
6139
- CHAR_UPPERCASE_Z: 90,
6140
- CHAR_LOWERCASE_Z: 122,
6141
- CHAR_LEFT_PARENTHESES: 40,
6142
- CHAR_RIGHT_PARENTHESES: 41,
6143
- CHAR_ASTERISK: 42,
6144
- CHAR_AMPERSAND: 38,
6145
- CHAR_AT: 64,
6146
- CHAR_BACKWARD_SLASH: 92,
6147
- CHAR_CARRIAGE_RETURN: 13,
6148
- CHAR_CIRCUMFLEX_ACCENT: 94,
6149
- CHAR_COLON: 58,
6150
- CHAR_COMMA: 44,
6151
- CHAR_DOT: 46,
6152
- CHAR_DOUBLE_QUOTE: 34,
6153
- CHAR_EQUAL: 61,
6154
- CHAR_EXCLAMATION_MARK: 33,
6155
- CHAR_FORM_FEED: 12,
6156
- CHAR_FORWARD_SLASH: 47,
6157
- CHAR_GRAVE_ACCENT: 96,
6158
- CHAR_HASH: 35,
6159
- CHAR_HYPHEN_MINUS: 45,
6160
- CHAR_LEFT_ANGLE_BRACKET: 60,
6161
- CHAR_LEFT_CURLY_BRACE: 123,
6162
- CHAR_LEFT_SQUARE_BRACKET: 91,
6163
- CHAR_LINE_FEED: 10,
6164
- CHAR_NO_BREAK_SPACE: 160,
6165
- CHAR_PERCENT: 37,
6166
- CHAR_PLUS: 43,
6167
- CHAR_QUESTION_MARK: 63,
6168
- CHAR_RIGHT_ANGLE_BRACKET: 62,
6169
- CHAR_RIGHT_CURLY_BRACE: 125,
6170
- CHAR_RIGHT_SQUARE_BRACKET: 93,
6171
- CHAR_SEMICOLON: 59,
6172
- CHAR_SINGLE_QUOTE: 39,
6173
- CHAR_SPACE: 32,
6174
- CHAR_TAB: 9,
6175
- CHAR_UNDERSCORE: 95,
6176
- CHAR_VERTICAL_LINE: 124,
6177
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
6178
- SEP: path4.sep,
6179
- extglobChars(chars) {
6180
- return {
6181
- "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
6182
- "?": { type: "qmark", open: "(?:", close: ")?" },
6183
- "+": { type: "plus", open: "(?:", close: ")+" },
6184
- "*": { type: "star", open: "(?:", close: ")*" },
6185
- "@": { type: "at", open: "(?:", close: ")" }
6186
- };
6187
- },
6188
- globChars(win322) {
6189
- return win322 === true ? WINDOWS_CHARS : POSIX_CHARS;
6190
- }
6191
- };
6192
- });
6193
-
6194
- // ../../node_modules/picomatch/lib/utils.js
6195
- var require_utils2 = __commonJS((exports) => {
6196
- var path4 = __require("node:path");
6197
- var win322 = process.platform === "win32";
6198
- var {
6199
- REGEX_BACKSLASH,
6200
- REGEX_REMOVE_BACKSLASH,
6201
- REGEX_SPECIAL_CHARS,
6202
- REGEX_SPECIAL_CHARS_GLOBAL
6203
- } = require_constants2();
6204
- exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
6205
- exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
6206
- exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
6207
- exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
6208
- exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
6209
- exports.removeBackslashes = (str) => {
6210
- return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => {
6211
- return match2 === "\\" ? "" : match2;
6212
- });
6213
- };
6214
- exports.supportsLookbehinds = () => {
6215
- const segs = process.version.slice(1).split(".").map(Number);
6216
- if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
6217
- return true;
6218
- }
6219
- return false;
6220
- };
6221
- exports.isWindows = (options) => {
6222
- if (options && typeof options.windows === "boolean") {
6223
- return options.windows;
6224
- }
6225
- return win322 === true || path4.sep === "\\";
6226
- };
6227
- exports.escapeLast = (input, char, lastIdx) => {
6228
- const idx = input.lastIndexOf(char, lastIdx);
6229
- if (idx === -1)
6230
- return input;
6231
- if (input[idx - 1] === "\\")
6232
- return exports.escapeLast(input, char, idx - 1);
6233
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
6234
- };
6235
- exports.removePrefix = (input, state = {}) => {
6236
- let output = input;
6237
- if (output.startsWith("./")) {
6238
- output = output.slice(2);
6239
- state.prefix = "./";
6240
- }
6241
- return output;
6242
- };
6243
- exports.wrapOutput = (input, state = {}, options = {}) => {
6244
- const prepend = options.contains ? "" : "^";
6245
- const append = options.contains ? "" : "$";
6246
- let output = `${prepend}(?:${input})${append}`;
6247
- if (state.negated === true) {
6248
- output = `(?:^(?!${output}).*$)`;
6249
- }
6250
- return output;
6251
- };
6252
- });
6253
-
6254
- // ../../node_modules/picomatch/lib/scan.js
6255
- var require_scan2 = __commonJS((exports, module) => {
6256
- var utils = require_utils2();
6257
- var {
6258
- CHAR_ASTERISK,
6259
- CHAR_AT,
6260
- CHAR_BACKWARD_SLASH,
6261
- CHAR_COMMA,
6262
- CHAR_DOT,
6263
- CHAR_EXCLAMATION_MARK,
6264
- CHAR_FORWARD_SLASH,
6265
- CHAR_LEFT_CURLY_BRACE,
6266
- CHAR_LEFT_PARENTHESES,
6267
- CHAR_LEFT_SQUARE_BRACKET,
6268
- CHAR_PLUS,
6269
- CHAR_QUESTION_MARK,
6270
- CHAR_RIGHT_CURLY_BRACE,
6271
- CHAR_RIGHT_PARENTHESES,
6272
- CHAR_RIGHT_SQUARE_BRACKET
6273
- } = require_constants2();
6274
- var isPathSeparator = (code) => {
6275
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
6276
- };
6277
- var depth = (token) => {
6278
- if (token.isPrefix !== true) {
6279
- token.depth = token.isGlobstar ? Infinity : 1;
6280
- }
6281
- };
6282
- var scan = (input, options) => {
6283
- const opts = options || {};
6284
- const length = input.length - 1;
6285
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
6286
- const slashes = [];
6287
- const tokens = [];
6288
- const parts = [];
6289
- let str = input;
6290
- let index = -1;
6291
- let start = 0;
6292
- let lastIndex = 0;
6293
- let isBrace = false;
6294
- let isBracket = false;
6295
- let isGlob = false;
6296
- let isExtglob = false;
6297
- let isGlobstar = false;
6298
- let braceEscaped = false;
6299
- let backslashes = false;
6300
- let negated = false;
6301
- let negatedExtglob = false;
6302
- let finished = false;
6303
- let braces = 0;
6304
- let prev;
6305
- let code;
6306
- let token = { value: "", depth: 0, isGlob: false };
6307
- const eos = () => index >= length;
6308
- const peek = () => str.charCodeAt(index + 1);
6309
- const advance = () => {
6310
- prev = code;
6311
- return str.charCodeAt(++index);
6312
- };
6313
- while (index < length) {
6314
- code = advance();
6315
- let next;
6316
- if (code === CHAR_BACKWARD_SLASH) {
6317
- backslashes = token.backslashes = true;
6318
- code = advance();
6319
- if (code === CHAR_LEFT_CURLY_BRACE) {
6320
- braceEscaped = true;
6321
- }
6322
- continue;
6323
- }
6324
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
6325
- braces++;
6326
- while (eos() !== true && (code = advance())) {
6327
- if (code === CHAR_BACKWARD_SLASH) {
6328
- backslashes = token.backslashes = true;
6329
- advance();
6330
- continue;
6331
- }
6332
- if (code === CHAR_LEFT_CURLY_BRACE) {
6333
- braces++;
6334
- continue;
6335
- }
6336
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
6337
- isBrace = token.isBrace = true;
6338
- isGlob = token.isGlob = true;
6339
- finished = true;
6340
- if (scanToEnd === true) {
6341
- continue;
6342
- }
6343
- break;
6344
- }
6345
- if (braceEscaped !== true && code === CHAR_COMMA) {
6346
- isBrace = token.isBrace = true;
6347
- isGlob = token.isGlob = true;
6348
- finished = true;
6349
- if (scanToEnd === true) {
6350
- continue;
6351
- }
6352
- break;
6353
- }
6354
- if (code === CHAR_RIGHT_CURLY_BRACE) {
6355
- braces--;
6356
- if (braces === 0) {
6357
- braceEscaped = false;
6358
- isBrace = token.isBrace = true;
6359
- finished = true;
6360
- break;
6361
- }
6362
- }
6363
- }
6364
- if (scanToEnd === true) {
6365
- continue;
6366
- }
6367
- break;
6368
- }
6369
- if (code === CHAR_FORWARD_SLASH) {
6370
- slashes.push(index);
6371
- tokens.push(token);
6372
- token = { value: "", depth: 0, isGlob: false };
6373
- if (finished === true)
6374
- continue;
6375
- if (prev === CHAR_DOT && index === start + 1) {
6376
- start += 2;
6377
- continue;
6378
- }
6379
- lastIndex = index + 1;
6380
- continue;
6381
- }
6382
- if (opts.noext !== true) {
6383
- const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
6384
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
6385
- isGlob = token.isGlob = true;
6386
- isExtglob = token.isExtglob = true;
6387
- finished = true;
6388
- if (code === CHAR_EXCLAMATION_MARK && index === start) {
6389
- negatedExtglob = true;
6390
- }
6391
- if (scanToEnd === true) {
6392
- while (eos() !== true && (code = advance())) {
6393
- if (code === CHAR_BACKWARD_SLASH) {
6394
- backslashes = token.backslashes = true;
6395
- code = advance();
6396
- continue;
6397
- }
6398
- if (code === CHAR_RIGHT_PARENTHESES) {
6399
- isGlob = token.isGlob = true;
6400
- finished = true;
6401
- break;
6402
- }
6403
- }
6404
- continue;
6405
- }
6406
- break;
6407
- }
6408
- }
6409
- if (code === CHAR_ASTERISK) {
6410
- if (prev === CHAR_ASTERISK)
6411
- isGlobstar = token.isGlobstar = true;
6412
- isGlob = token.isGlob = true;
6413
- finished = true;
6414
- if (scanToEnd === true) {
6415
- continue;
6416
- }
6417
- break;
6418
- }
6419
- if (code === CHAR_QUESTION_MARK) {
6420
- isGlob = token.isGlob = true;
6421
- finished = true;
6422
- if (scanToEnd === true) {
6423
- continue;
6424
- }
6425
- break;
6426
- }
6427
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
6428
- while (eos() !== true && (next = advance())) {
6429
- if (next === CHAR_BACKWARD_SLASH) {
6430
- backslashes = token.backslashes = true;
6431
- advance();
6432
- continue;
6433
- }
6434
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
6435
- isBracket = token.isBracket = true;
6436
- isGlob = token.isGlob = true;
6437
- finished = true;
6438
- break;
6439
- }
6440
- }
6441
- if (scanToEnd === true) {
6442
- continue;
6443
- }
6444
- break;
6445
- }
6446
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
6447
- negated = token.negated = true;
6448
- start++;
6449
- continue;
6450
- }
6451
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
6452
- isGlob = token.isGlob = true;
6453
- if (scanToEnd === true) {
6454
- while (eos() !== true && (code = advance())) {
6455
- if (code === CHAR_LEFT_PARENTHESES) {
6456
- backslashes = token.backslashes = true;
6457
- code = advance();
6458
- continue;
6459
- }
6460
- if (code === CHAR_RIGHT_PARENTHESES) {
6461
- finished = true;
6462
- break;
6463
- }
6464
- }
6465
- continue;
6466
- }
6467
- break;
6468
- }
6469
- if (isGlob === true) {
6470
- finished = true;
6471
- if (scanToEnd === true) {
6472
- continue;
6473
- }
6474
- break;
6475
- }
6476
- }
6477
- if (opts.noext === true) {
6478
- isExtglob = false;
6479
- isGlob = false;
6480
- }
6481
- let base2 = str;
6482
- let prefix = "";
6483
- let glob2 = "";
6484
- if (start > 0) {
6485
- prefix = str.slice(0, start);
6486
- str = str.slice(start);
6487
- lastIndex -= start;
6488
- }
6489
- if (base2 && isGlob === true && lastIndex > 0) {
6490
- base2 = str.slice(0, lastIndex);
6491
- glob2 = str.slice(lastIndex);
6492
- } else if (isGlob === true) {
6493
- base2 = "";
6494
- glob2 = str;
6495
- } else {
6496
- base2 = str;
6497
- }
6498
- if (base2 && base2 !== "" && base2 !== "/" && base2 !== str) {
6499
- if (isPathSeparator(base2.charCodeAt(base2.length - 1))) {
6500
- base2 = base2.slice(0, -1);
6501
- }
6502
- }
6503
- if (opts.unescape === true) {
6504
- if (glob2)
6505
- glob2 = utils.removeBackslashes(glob2);
6506
- if (base2 && backslashes === true) {
6507
- base2 = utils.removeBackslashes(base2);
6508
- }
6509
- }
6510
- const state = {
6511
- prefix,
6512
- input,
6513
- start,
6514
- base: base2,
6515
- glob: glob2,
6516
- isBrace,
6517
- isBracket,
6518
- isGlob,
6519
- isExtglob,
6520
- isGlobstar,
6521
- negated,
6522
- negatedExtglob
6523
- };
6524
- if (opts.tokens === true) {
6525
- state.maxDepth = 0;
6526
- if (!isPathSeparator(code)) {
6527
- tokens.push(token);
6528
- }
6529
- state.tokens = tokens;
6530
- }
6531
- if (opts.parts === true || opts.tokens === true) {
6532
- let prevIndex;
6533
- for (let idx = 0;idx < slashes.length; idx++) {
6534
- const n = prevIndex ? prevIndex + 1 : start;
6535
- const i = slashes[idx];
6536
- const value = input.slice(n, i);
6537
- if (opts.tokens) {
6538
- if (idx === 0 && start !== 0) {
6539
- tokens[idx].isPrefix = true;
6540
- tokens[idx].value = prefix;
6541
- } else {
6542
- tokens[idx].value = value;
6543
- }
6544
- depth(tokens[idx]);
6545
- state.maxDepth += tokens[idx].depth;
6546
- }
6547
- if (idx !== 0 || value !== "") {
6548
- parts.push(value);
6549
- }
6550
- prevIndex = i;
6551
- }
6552
- if (prevIndex && prevIndex + 1 < input.length) {
6553
- const value = input.slice(prevIndex + 1);
6554
- parts.push(value);
6555
- if (opts.tokens) {
6556
- tokens[tokens.length - 1].value = value;
6557
- depth(tokens[tokens.length - 1]);
6558
- state.maxDepth += tokens[tokens.length - 1].depth;
6559
- }
6560
- }
6561
- state.slashes = slashes;
6562
- state.parts = parts;
6563
- }
6564
- return state;
6565
- };
6566
- module.exports = scan;
6567
- });
6568
-
6569
- // ../../node_modules/picomatch/lib/parse.js
6570
- var require_parse2 = __commonJS((exports, module) => {
6571
- var constants = require_constants2();
6572
- var utils = require_utils2();
6573
- var {
6574
- MAX_LENGTH,
6575
- POSIX_REGEX_SOURCE,
6576
- REGEX_NON_SPECIAL_CHARS,
6577
- REGEX_SPECIAL_CHARS_BACKREF,
6578
- REPLACEMENTS
6579
- } = constants;
6580
- var expandRange = (args, options) => {
6581
- if (typeof options.expandRange === "function") {
6582
- return options.expandRange(...args, options);
6583
- }
6584
- args.sort();
6585
- const value = `[${args.join("-")}]`;
6586
- try {
6587
- new RegExp(value);
6588
- } catch (ex) {
6589
- return args.map((v) => utils.escapeRegex(v)).join("..");
6590
- }
6591
- return value;
6592
- };
6593
- var syntaxError = (type, char) => {
6594
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
6595
- };
6596
- var parse = (input, options) => {
6597
- if (typeof input !== "string") {
6598
- throw new TypeError("Expected a string");
6599
- }
6600
- input = REPLACEMENTS[input] || input;
6601
- const opts = { ...options };
6602
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
6603
- let len = input.length;
6604
- if (len > max) {
6605
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
6606
- }
6607
- const bos = { type: "bos", value: "", output: opts.prepend || "" };
6608
- const tokens = [bos];
6609
- const capture = opts.capture ? "" : "?:";
6610
- const win322 = utils.isWindows(options);
6611
- const PLATFORM_CHARS = constants.globChars(win322);
6612
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
6613
- const {
6614
- DOT_LITERAL,
6615
- PLUS_LITERAL,
6616
- SLASH_LITERAL,
6617
- ONE_CHAR,
6618
- DOTS_SLASH,
6619
- NO_DOT,
6620
- NO_DOT_SLASH,
6621
- NO_DOTS_SLASH,
6622
- QMARK,
6623
- QMARK_NO_DOT,
6624
- STAR,
6625
- START_ANCHOR
6626
- } = PLATFORM_CHARS;
6627
- const globstar = (opts2) => {
6628
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
6629
- };
6630
- const nodot = opts.dot ? "" : NO_DOT;
6631
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
6632
- let star3 = opts.bash === true ? globstar(opts) : STAR;
6633
- if (opts.capture) {
6634
- star3 = `(${star3})`;
6635
- }
6636
- if (typeof opts.noext === "boolean") {
6637
- opts.noextglob = opts.noext;
6638
- }
6639
- const state = {
6640
- input,
6641
- index: -1,
6642
- start: 0,
6643
- dot: opts.dot === true,
6644
- consumed: "",
6645
- output: "",
6646
- prefix: "",
6647
- backtrack: false,
6648
- negated: false,
6649
- brackets: 0,
6650
- braces: 0,
6651
- parens: 0,
6652
- quotes: 0,
6653
- globstar: false,
6654
- tokens
6655
- };
6656
- input = utils.removePrefix(input, state);
6657
- len = input.length;
6658
- const extglobs = [];
6659
- const braces = [];
6660
- const stack = [];
6661
- let prev = bos;
6662
- let value;
6663
- const eos = () => state.index === len - 1;
6664
- const peek = state.peek = (n = 1) => input[state.index + n];
6665
- const advance = state.advance = () => input[++state.index] || "";
6666
- const remaining = () => input.slice(state.index + 1);
6667
- const consume = (value2 = "", num = 0) => {
6668
- state.consumed += value2;
6669
- state.index += num;
6670
- };
6671
- const append = (token) => {
6672
- state.output += token.output != null ? token.output : token.value;
6673
- consume(token.value);
6674
- };
6675
- const negate = () => {
6676
- let count = 1;
6677
- while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
6678
- advance();
6679
- state.start++;
6680
- count++;
6681
- }
6682
- if (count % 2 === 0) {
6683
- return false;
6684
- }
6685
- state.negated = true;
6686
- state.start++;
6687
- return true;
6688
- };
6689
- const increment = (type) => {
6690
- state[type]++;
6691
- stack.push(type);
6692
- };
6693
- const decrement = (type) => {
6694
- state[type]--;
6695
- stack.pop();
6696
- };
6697
- const push = (tok) => {
6698
- if (prev.type === "globstar") {
6699
- const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
6700
- const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
6701
- if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
6702
- state.output = state.output.slice(0, -prev.output.length);
6703
- prev.type = "star";
6704
- prev.value = "*";
6705
- prev.output = star3;
6706
- state.output += prev.output;
6707
- }
6708
- }
6709
- if (extglobs.length && tok.type !== "paren") {
6710
- extglobs[extglobs.length - 1].inner += tok.value;
6711
- }
6712
- if (tok.value || tok.output)
6713
- append(tok);
6714
- if (prev && prev.type === "text" && tok.type === "text") {
6715
- prev.value += tok.value;
6716
- prev.output = (prev.output || "") + tok.value;
6717
- return;
6718
- }
6719
- tok.prev = prev;
6720
- tokens.push(tok);
6721
- prev = tok;
6722
- };
6723
- const extglobOpen = (type, value2) => {
6724
- const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
6725
- token.prev = prev;
6726
- token.parens = state.parens;
6727
- token.output = state.output;
6728
- const output = (opts.capture ? "(" : "") + token.open;
6729
- increment("parens");
6730
- push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
6731
- push({ type: "paren", extglob: true, value: advance(), output });
6732
- extglobs.push(token);
6733
- };
6734
- const extglobClose = (token) => {
6735
- let output = token.close + (opts.capture ? ")" : "");
6736
- let rest;
6737
- if (token.type === "negate") {
6738
- let extglobStar = star3;
6739
- if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
6740
- extglobStar = globstar(opts);
6741
- }
6742
- if (extglobStar !== star3 || eos() || /^\)+$/.test(remaining())) {
6743
- output = token.close = `)$))${extglobStar}`;
6744
- }
6745
- if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
6746
- const expression = parse(rest, { ...options, fastpaths: false }).output;
6747
- output = token.close = `)${expression})${extglobStar})`;
6748
- }
6749
- if (token.prev.type === "bos") {
6750
- state.negatedExtglob = true;
6751
- }
6752
- }
6753
- push({ type: "paren", extglob: true, value, output });
6754
- decrement("parens");
6755
- };
6756
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
6757
- let backslashes = false;
6758
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
6759
- if (first === "\\") {
6760
- backslashes = true;
6761
- return m;
6762
- }
6763
- if (first === "?") {
6764
- if (esc) {
6765
- return esc + first + (rest ? QMARK.repeat(rest.length) : "");
6766
- }
6767
- if (index === 0) {
6768
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
6769
- }
6770
- return QMARK.repeat(chars.length);
6771
- }
6772
- if (first === ".") {
6773
- return DOT_LITERAL.repeat(chars.length);
6774
- }
6775
- if (first === "*") {
6776
- if (esc) {
6777
- return esc + first + (rest ? star3 : "");
6778
- }
6779
- return star3;
6780
- }
6781
- return esc ? m : `\\${m}`;
6782
- });
6783
- if (backslashes === true) {
6784
- if (opts.unescape === true) {
6785
- output = output.replace(/\\/g, "");
6786
- } else {
6787
- output = output.replace(/\\+/g, (m) => {
6788
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
6789
- });
6790
- }
6791
- }
6792
- if (output === input && opts.contains === true) {
6793
- state.output = input;
6794
- return state;
6795
- }
6796
- state.output = utils.wrapOutput(output, state, options);
6797
- return state;
6798
- }
6799
- while (!eos()) {
6800
- value = advance();
6801
- if (value === "\x00") {
6802
- continue;
6803
- }
6804
- if (value === "\\") {
6805
- const next = peek();
6806
- if (next === "/" && opts.bash !== true) {
6807
- continue;
6808
- }
6809
- if (next === "." || next === ";") {
6810
- continue;
6811
- }
6812
- if (!next) {
6813
- value += "\\";
6814
- push({ type: "text", value });
6815
- continue;
6816
- }
6817
- const match2 = /^\\+/.exec(remaining());
6818
- let slashes = 0;
6819
- if (match2 && match2[0].length > 2) {
6820
- slashes = match2[0].length;
6821
- state.index += slashes;
6822
- if (slashes % 2 !== 0) {
6823
- value += "\\";
6824
- }
6825
- }
6826
- if (opts.unescape === true) {
6827
- value = advance();
6828
- } else {
6829
- value += advance();
6830
- }
6831
- if (state.brackets === 0) {
6832
- push({ type: "text", value });
6833
- continue;
6834
- }
6835
- }
6836
- if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
6837
- if (opts.posix !== false && value === ":") {
6838
- const inner = prev.value.slice(1);
6839
- if (inner.includes("[")) {
6840
- prev.posix = true;
6841
- if (inner.includes(":")) {
6842
- const idx = prev.value.lastIndexOf("[");
6843
- const pre = prev.value.slice(0, idx);
6844
- const rest2 = prev.value.slice(idx + 2);
6845
- const posix2 = POSIX_REGEX_SOURCE[rest2];
6846
- if (posix2) {
6847
- prev.value = pre + posix2;
6848
- state.backtrack = true;
6849
- advance();
6850
- if (!bos.output && tokens.indexOf(prev) === 1) {
6851
- bos.output = ONE_CHAR;
6852
- }
6853
- continue;
6854
- }
6855
- }
6856
- }
6857
- }
6858
- if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
6859
- value = `\\${value}`;
6860
- }
6861
- if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
6862
- value = `\\${value}`;
6863
- }
6864
- if (opts.posix === true && value === "!" && prev.value === "[") {
6865
- value = "^";
6866
- }
6867
- prev.value += value;
6868
- append({ value });
6869
- continue;
6870
- }
6871
- if (state.quotes === 1 && value !== '"') {
6872
- value = utils.escapeRegex(value);
6873
- prev.value += value;
6874
- append({ value });
6875
- continue;
6876
- }
6877
- if (value === '"') {
6878
- state.quotes = state.quotes === 1 ? 0 : 1;
6879
- if (opts.keepQuotes === true) {
6880
- push({ type: "text", value });
6881
- }
6882
- continue;
6883
- }
6884
- if (value === "(") {
6885
- increment("parens");
6886
- push({ type: "paren", value });
6887
- continue;
6888
- }
6889
- if (value === ")") {
6890
- if (state.parens === 0 && opts.strictBrackets === true) {
6891
- throw new SyntaxError(syntaxError("opening", "("));
6892
- }
6893
- const extglob = extglobs[extglobs.length - 1];
6894
- if (extglob && state.parens === extglob.parens + 1) {
6895
- extglobClose(extglobs.pop());
6896
- continue;
6897
- }
6898
- push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
6899
- decrement("parens");
6900
- continue;
6901
- }
6902
- if (value === "[") {
6903
- if (opts.nobracket === true || !remaining().includes("]")) {
6904
- if (opts.nobracket !== true && opts.strictBrackets === true) {
6905
- throw new SyntaxError(syntaxError("closing", "]"));
6906
- }
6907
- value = `\\${value}`;
6908
- } else {
6909
- increment("brackets");
6910
- }
6911
- push({ type: "bracket", value });
6912
- continue;
6913
- }
6914
- if (value === "]") {
6915
- if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
6916
- push({ type: "text", value, output: `\\${value}` });
6917
- continue;
6918
- }
6919
- if (state.brackets === 0) {
6920
- if (opts.strictBrackets === true) {
6921
- throw new SyntaxError(syntaxError("opening", "["));
6922
- }
6923
- push({ type: "text", value, output: `\\${value}` });
6924
- continue;
6925
- }
6926
- decrement("brackets");
6927
- const prevValue = prev.value.slice(1);
6928
- if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
6929
- value = `/${value}`;
6930
- }
6931
- prev.value += value;
6932
- append({ value });
6933
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
6934
- continue;
6935
- }
6936
- const escaped = utils.escapeRegex(prev.value);
6937
- state.output = state.output.slice(0, -prev.value.length);
6938
- if (opts.literalBrackets === true) {
6939
- state.output += escaped;
6940
- prev.value = escaped;
6941
- continue;
6942
- }
6943
- prev.value = `(${capture}${escaped}|${prev.value})`;
6944
- state.output += prev.value;
6945
- continue;
6946
- }
6947
- if (value === "{" && opts.nobrace !== true) {
6948
- increment("braces");
6949
- const open = {
6950
- type: "brace",
6951
- value,
6952
- output: "(",
6953
- outputIndex: state.output.length,
6954
- tokensIndex: state.tokens.length
6955
- };
6956
- braces.push(open);
6957
- push(open);
6958
- continue;
6959
- }
6960
- if (value === "}") {
6961
- const brace = braces[braces.length - 1];
6962
- if (opts.nobrace === true || !brace) {
6963
- push({ type: "text", value, output: value });
6964
- continue;
6965
- }
6966
- let output = ")";
6967
- if (brace.dots === true) {
6968
- const arr = tokens.slice();
6969
- const range = [];
6970
- for (let i = arr.length - 1;i >= 0; i--) {
6971
- tokens.pop();
6972
- if (arr[i].type === "brace") {
6973
- break;
6974
- }
6975
- if (arr[i].type !== "dots") {
6976
- range.unshift(arr[i].value);
6977
- }
6978
- }
6979
- output = expandRange(range, opts);
6980
- state.backtrack = true;
6981
- }
6982
- if (brace.comma !== true && brace.dots !== true) {
6983
- const out = state.output.slice(0, brace.outputIndex);
6984
- const toks = state.tokens.slice(brace.tokensIndex);
6985
- brace.value = brace.output = "\\{";
6986
- value = output = "\\}";
6987
- state.output = out;
6988
- for (const t of toks) {
6989
- state.output += t.output || t.value;
6990
- }
6991
- }
6992
- push({ type: "brace", value, output });
6993
- decrement("braces");
6994
- braces.pop();
6995
- continue;
6996
- }
6997
- if (value === "|") {
6998
- if (extglobs.length > 0) {
6999
- extglobs[extglobs.length - 1].conditions++;
7000
- }
7001
- push({ type: "text", value });
7002
- continue;
7003
- }
7004
- if (value === ",") {
7005
- let output = value;
7006
- const brace = braces[braces.length - 1];
7007
- if (brace && stack[stack.length - 1] === "braces") {
7008
- brace.comma = true;
7009
- output = "|";
7010
- }
7011
- push({ type: "comma", value, output });
7012
- continue;
7013
- }
7014
- if (value === "/") {
7015
- if (prev.type === "dot" && state.index === state.start + 1) {
7016
- state.start = state.index + 1;
7017
- state.consumed = "";
7018
- state.output = "";
7019
- tokens.pop();
7020
- prev = bos;
7021
- continue;
7022
- }
7023
- push({ type: "slash", value, output: SLASH_LITERAL });
7024
- continue;
7025
- }
7026
- if (value === ".") {
7027
- if (state.braces > 0 && prev.type === "dot") {
7028
- if (prev.value === ".")
7029
- prev.output = DOT_LITERAL;
7030
- const brace = braces[braces.length - 1];
7031
- prev.type = "dots";
7032
- prev.output += value;
7033
- prev.value += value;
7034
- brace.dots = true;
7035
- continue;
7036
- }
7037
- if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
7038
- push({ type: "text", value, output: DOT_LITERAL });
7039
- continue;
7040
- }
7041
- push({ type: "dot", value, output: DOT_LITERAL });
7042
- continue;
7043
- }
7044
- if (value === "?") {
7045
- const isGroup = prev && prev.value === "(";
7046
- if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7047
- extglobOpen("qmark", value);
7048
- continue;
7049
- }
7050
- if (prev && prev.type === "paren") {
7051
- const next = peek();
7052
- let output = value;
7053
- if (next === "<" && !utils.supportsLookbehinds()) {
7054
- throw new Error("Node.js v10 or higher is required for regex lookbehinds");
7055
- }
7056
- if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
7057
- output = `\\${value}`;
7058
- }
7059
- push({ type: "text", value, output });
7060
- continue;
7061
- }
7062
- if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
7063
- push({ type: "qmark", value, output: QMARK_NO_DOT });
7064
- continue;
7065
- }
7066
- push({ type: "qmark", value, output: QMARK });
7067
- continue;
7068
- }
7069
- if (value === "!") {
7070
- if (opts.noextglob !== true && peek() === "(") {
7071
- if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
7072
- extglobOpen("negate", value);
7073
- continue;
7074
- }
7075
- }
7076
- if (opts.nonegate !== true && state.index === 0) {
7077
- negate();
7078
- continue;
7079
- }
7080
- }
7081
- if (value === "+") {
7082
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7083
- extglobOpen("plus", value);
7084
- continue;
7085
- }
7086
- if (prev && prev.value === "(" || opts.regex === false) {
7087
- push({ type: "plus", value, output: PLUS_LITERAL });
7088
- continue;
7089
- }
7090
- if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
7091
- push({ type: "plus", value });
7092
- continue;
7093
- }
7094
- push({ type: "plus", value: PLUS_LITERAL });
7095
- continue;
7096
- }
7097
- if (value === "@") {
7098
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7099
- push({ type: "at", extglob: true, value, output: "" });
7100
- continue;
7101
- }
7102
- push({ type: "text", value });
7103
- continue;
7104
- }
7105
- if (value !== "*") {
7106
- if (value === "$" || value === "^") {
7107
- value = `\\${value}`;
7108
- }
7109
- const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining());
7110
- if (match2) {
7111
- value += match2[0];
7112
- state.index += match2[0].length;
7113
- }
7114
- push({ type: "text", value });
7115
- continue;
7116
- }
7117
- if (prev && (prev.type === "globstar" || prev.star === true)) {
7118
- prev.type = "star";
7119
- prev.star = true;
7120
- prev.value += value;
7121
- prev.output = star3;
7122
- state.backtrack = true;
7123
- state.globstar = true;
7124
- consume(value);
7125
- continue;
7126
- }
7127
- let rest = remaining();
7128
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
7129
- extglobOpen("star", value);
7130
- continue;
7131
- }
7132
- if (prev.type === "star") {
7133
- if (opts.noglobstar === true) {
7134
- consume(value);
7135
- continue;
7136
- }
7137
- const prior = prev.prev;
7138
- const before = prior.prev;
7139
- const isStart = prior.type === "slash" || prior.type === "bos";
7140
- const afterStar = before && (before.type === "star" || before.type === "globstar");
7141
- if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
7142
- push({ type: "star", value, output: "" });
7143
- continue;
7144
- }
7145
- const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
7146
- const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
7147
- if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
7148
- push({ type: "star", value, output: "" });
7149
- continue;
7150
- }
7151
- while (rest.slice(0, 3) === "/**") {
7152
- const after = input[state.index + 4];
7153
- if (after && after !== "/") {
7154
- break;
7155
- }
7156
- rest = rest.slice(3);
7157
- consume("/**", 3);
7158
- }
7159
- if (prior.type === "bos" && eos()) {
7160
- prev.type = "globstar";
7161
- prev.value += value;
7162
- prev.output = globstar(opts);
7163
- state.output = prev.output;
7164
- state.globstar = true;
7165
- consume(value);
7166
- continue;
7167
- }
7168
- if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
7169
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
7170
- prior.output = `(?:${prior.output}`;
7171
- prev.type = "globstar";
7172
- prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
7173
- prev.value += value;
7174
- state.globstar = true;
7175
- state.output += prior.output + prev.output;
7176
- consume(value);
7177
- continue;
7178
- }
7179
- if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
7180
- const end = rest[1] !== undefined ? "|$" : "";
7181
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
7182
- prior.output = `(?:${prior.output}`;
7183
- prev.type = "globstar";
7184
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
7185
- prev.value += value;
7186
- state.output += prior.output + prev.output;
7187
- state.globstar = true;
7188
- consume(value + advance());
7189
- push({ type: "slash", value: "/", output: "" });
7190
- continue;
7191
- }
7192
- if (prior.type === "bos" && rest[0] === "/") {
7193
- prev.type = "globstar";
7194
- prev.value += value;
7195
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
7196
- state.output = prev.output;
7197
- state.globstar = true;
7198
- consume(value + advance());
7199
- push({ type: "slash", value: "/", output: "" });
7200
- continue;
7201
- }
7202
- state.output = state.output.slice(0, -prev.output.length);
7203
- prev.type = "globstar";
7204
- prev.output = globstar(opts);
7205
- prev.value += value;
7206
- state.output += prev.output;
7207
- state.globstar = true;
7208
- consume(value);
7209
- continue;
7210
- }
7211
- const token = { type: "star", value, output: star3 };
7212
- if (opts.bash === true) {
7213
- token.output = ".*?";
7214
- if (prev.type === "bos" || prev.type === "slash") {
7215
- token.output = nodot + token.output;
7216
- }
7217
- push(token);
7218
- continue;
7219
- }
7220
- if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
7221
- token.output = value;
7222
- push(token);
7223
- continue;
7224
- }
7225
- if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
7226
- if (prev.type === "dot") {
7227
- state.output += NO_DOT_SLASH;
7228
- prev.output += NO_DOT_SLASH;
7229
- } else if (opts.dot === true) {
7230
- state.output += NO_DOTS_SLASH;
7231
- prev.output += NO_DOTS_SLASH;
7232
- } else {
7233
- state.output += nodot;
7234
- prev.output += nodot;
7235
- }
7236
- if (peek() !== "*") {
7237
- state.output += ONE_CHAR;
7238
- prev.output += ONE_CHAR;
7239
- }
7240
- }
7241
- push(token);
7242
- }
7243
- while (state.brackets > 0) {
7244
- if (opts.strictBrackets === true)
7245
- throw new SyntaxError(syntaxError("closing", "]"));
7246
- state.output = utils.escapeLast(state.output, "[");
7247
- decrement("brackets");
7248
- }
7249
- while (state.parens > 0) {
7250
- if (opts.strictBrackets === true)
7251
- throw new SyntaxError(syntaxError("closing", ")"));
7252
- state.output = utils.escapeLast(state.output, "(");
7253
- decrement("parens");
7254
- }
7255
- while (state.braces > 0) {
7256
- if (opts.strictBrackets === true)
7257
- throw new SyntaxError(syntaxError("closing", "}"));
7258
- state.output = utils.escapeLast(state.output, "{");
7259
- decrement("braces");
7260
- }
7261
- if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
7262
- push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
7263
- }
7264
- if (state.backtrack === true) {
7265
- state.output = "";
7266
- for (const token of state.tokens) {
7267
- state.output += token.output != null ? token.output : token.value;
7268
- if (token.suffix) {
7269
- state.output += token.suffix;
7270
- }
7271
- }
7272
- }
7273
- return state;
7274
- };
7275
- parse.fastpaths = (input, options) => {
7276
- const opts = { ...options };
7277
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
7278
- const len = input.length;
7279
- if (len > max) {
7280
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
7281
- }
7282
- input = REPLACEMENTS[input] || input;
7283
- const win322 = utils.isWindows(options);
7284
- const {
7285
- DOT_LITERAL,
7286
- SLASH_LITERAL,
7287
- ONE_CHAR,
7288
- DOTS_SLASH,
7289
- NO_DOT,
7290
- NO_DOTS,
7291
- NO_DOTS_SLASH,
7292
- STAR,
7293
- START_ANCHOR
7294
- } = constants.globChars(win322);
7295
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
7296
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
7297
- const capture = opts.capture ? "" : "?:";
7298
- const state = { negated: false, prefix: "" };
7299
- let star3 = opts.bash === true ? ".*?" : STAR;
7300
- if (opts.capture) {
7301
- star3 = `(${star3})`;
7302
- }
7303
- const globstar = (opts2) => {
7304
- if (opts2.noglobstar === true)
7305
- return star3;
7306
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
7307
- };
7308
- const create = (str) => {
7309
- switch (str) {
7310
- case "*":
7311
- return `${nodot}${ONE_CHAR}${star3}`;
7312
- case ".*":
7313
- return `${DOT_LITERAL}${ONE_CHAR}${star3}`;
7314
- case "*.*":
7315
- return `${nodot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
7316
- case "*/*":
7317
- return `${nodot}${star3}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star3}`;
7318
- case "**":
7319
- return nodot + globstar(opts);
7320
- case "**/*":
7321
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star3}`;
7322
- case "**/*.*":
7323
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
7324
- case "**/.*":
7325
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star3}`;
7326
- default: {
7327
- const match2 = /^(.*?)\.(\w+)$/.exec(str);
7328
- if (!match2)
7329
- return;
7330
- const source2 = create(match2[1]);
7331
- if (!source2)
7332
- return;
7333
- return source2 + DOT_LITERAL + match2[2];
5712
+ if (!parent) {
5713
+ this.push(null);
5714
+ break;
5715
+ }
5716
+ this.parent = await parent;
5717
+ if (this.destroyed)
5718
+ return;
5719
+ }
7334
5720
  }
5721
+ } catch (error) {
5722
+ this.destroy(error);
5723
+ } finally {
5724
+ this.reading = false;
7335
5725
  }
7336
- };
7337
- const output = utils.removePrefix(input, state);
7338
- let source = create(output);
7339
- if (source && opts.strictSlashes !== true) {
7340
- source += `${SLASH_LITERAL}?`;
7341
- }
7342
- return source;
7343
- };
7344
- module.exports = parse;
7345
- });
7346
-
7347
- // ../../node_modules/picomatch/lib/picomatch.js
7348
- var require_picomatch2 = __commonJS((exports, module) => {
7349
- var path4 = __require("node:path");
7350
- var scan = require_scan2();
7351
- var parse = require_parse2();
7352
- var utils = require_utils2();
7353
- var constants = require_constants2();
7354
- var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
7355
- var picomatch = (glob2, options, returnState = false) => {
7356
- if (Array.isArray(glob2)) {
7357
- const fns = glob2.map((input) => picomatch(input, options, returnState));
7358
- const arrayMatcher = (str) => {
7359
- for (const isMatch of fns) {
7360
- const state2 = isMatch(str);
7361
- if (state2)
7362
- return state2;
7363
- }
7364
- return false;
7365
- };
7366
- return arrayMatcher;
7367
5726
  }
7368
- const isState = isObject(glob2) && glob2.tokens && glob2.input;
7369
- if (glob2 === "" || typeof glob2 !== "string" && !isState) {
7370
- throw new TypeError("Expected pattern to be a non-empty string");
5727
+ async _exploreDir(path4, depth) {
5728
+ let files;
5729
+ try {
5730
+ files = await readdir2(path4, this._rdOptions);
5731
+ } catch (error) {
5732
+ this._onError(error);
5733
+ }
5734
+ return { files, depth, path: path4 };
7371
5735
  }
7372
- const opts = options || {};
7373
- const posix2 = utils.isWindows(options);
7374
- const regex2 = isState ? picomatch.compileRe(glob2, options) : picomatch.makeRe(glob2, options, false, true);
7375
- const state = regex2.state;
7376
- delete regex2.state;
7377
- let isIgnored = () => false;
7378
- if (opts.ignore) {
7379
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
7380
- isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
5736
+ async _formatEntry(dirent, path4) {
5737
+ let entry;
5738
+ try {
5739
+ const basename2 = this._isDirent ? dirent.name : dirent;
5740
+ const fullPath = sysPath.resolve(sysPath.join(path4, basename2));
5741
+ entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename: basename2 };
5742
+ entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
5743
+ } catch (err) {
5744
+ this._onError(err);
5745
+ }
5746
+ return entry;
7381
5747
  }
7382
- const matcher = (input, returnObject = false) => {
7383
- const { isMatch, match: match2, output } = picomatch.test(input, regex2, options, { glob: glob2, posix: posix2 });
7384
- const result = { glob: glob2, state, regex: regex2, posix: posix2, input, output, match: match2, isMatch };
7385
- if (typeof opts.onResult === "function") {
7386
- opts.onResult(result);
5748
+ _onError(err) {
5749
+ if (isNormalFlowError(err) && !this.destroyed) {
5750
+ this.emit("warn", err);
5751
+ } else {
5752
+ this.destroy(err);
7387
5753
  }
7388
- if (isMatch === false) {
7389
- result.isMatch = false;
7390
- return returnObject ? result : false;
5754
+ }
5755
+ async _getEntryType(entry) {
5756
+ const stats = entry && entry[this._statsProp];
5757
+ if (!stats) {
5758
+ return;
7391
5759
  }
7392
- if (isIgnored(input)) {
7393
- if (typeof opts.onIgnore === "function") {
7394
- opts.onIgnore(result);
7395
- }
7396
- result.isMatch = false;
7397
- return returnObject ? result : false;
5760
+ if (stats.isFile()) {
5761
+ return "file";
7398
5762
  }
7399
- if (typeof opts.onMatch === "function") {
7400
- opts.onMatch(result);
5763
+ if (stats.isDirectory()) {
5764
+ return "directory";
7401
5765
  }
7402
- return returnObject ? result : true;
7403
- };
7404
- if (returnState) {
7405
- matcher.state = state;
7406
- }
7407
- return matcher;
7408
- };
7409
- picomatch.test = (input, regex2, options, { glob: glob2, posix: posix2 } = {}) => {
7410
- if (typeof input !== "string") {
7411
- throw new TypeError("Expected input to be a string");
7412
- }
7413
- if (input === "") {
7414
- return { isMatch: false, output: "" };
7415
- }
7416
- const opts = options || {};
7417
- const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
7418
- let match2 = input === glob2;
7419
- let output = match2 && format2 ? format2(input) : input;
7420
- if (match2 === false) {
7421
- output = format2 ? format2(input) : input;
7422
- match2 = output === glob2;
7423
- }
7424
- if (match2 === false || opts.capture === true) {
7425
- if (opts.matchBase === true || opts.basename === true) {
7426
- match2 = picomatch.matchBase(input, regex2, options, posix2);
7427
- } else {
7428
- match2 = regex2.exec(output);
5766
+ if (stats && stats.isSymbolicLink()) {
5767
+ const full = entry.fullPath;
5768
+ try {
5769
+ const entryRealPath = await realpath2(full);
5770
+ const entryRealPathStats = await lstat2(entryRealPath);
5771
+ if (entryRealPathStats.isFile()) {
5772
+ return "file";
5773
+ }
5774
+ if (entryRealPathStats.isDirectory()) {
5775
+ const len = entryRealPath.length;
5776
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
5777
+ const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
5778
+ recursiveError.code = RECURSIVE_ERROR_CODE;
5779
+ return this._onError(recursiveError);
5780
+ }
5781
+ return "directory";
5782
+ }
5783
+ } catch (error) {
5784
+ this._onError(error);
5785
+ }
7429
5786
  }
7430
5787
  }
7431
- return { isMatch: Boolean(match2), match: match2, output };
7432
- };
7433
- picomatch.matchBase = (input, glob2, options, posix2 = utils.isWindows(options)) => {
7434
- const regex2 = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
7435
- return regex2.test(path4.basename(input));
7436
- };
7437
- picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
7438
- picomatch.parse = (pattern, options) => {
7439
- if (Array.isArray(pattern))
7440
- return pattern.map((p) => picomatch.parse(p, options));
7441
- return parse(pattern, { ...options, fastpaths: false });
7442
- };
7443
- picomatch.scan = (input, options) => scan(input, options);
7444
- picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
7445
- if (returnOutput === true) {
7446
- return state.output;
7447
- }
7448
- const opts = options || {};
7449
- const prepend = opts.contains ? "" : "^";
7450
- const append = opts.contains ? "" : "$";
7451
- let source = `${prepend}(?:${state.output})${append}`;
7452
- if (state && state.negated === true) {
7453
- source = `^(?!${source}).*$`;
7454
- }
7455
- const regex2 = picomatch.toRegex(source, options);
7456
- if (returnState === true) {
7457
- regex2.state = state;
7458
- }
7459
- return regex2;
7460
- };
7461
- picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
7462
- if (!input || typeof input !== "string") {
7463
- throw new TypeError("Expected a non-empty string");
7464
- }
7465
- let parsed = { negated: false, fastpaths: true };
7466
- if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
7467
- parsed.output = parse.fastpaths(input, options);
5788
+ _includeAsFile(entry) {
5789
+ const stats = entry && entry[this._statsProp];
5790
+ return stats && this._wantsEverything && !stats.isDirectory();
7468
5791
  }
7469
- if (!parsed.output) {
7470
- parsed = parse(input, options);
5792
+ }
5793
+ var readdirp = (root, options = {}) => {
5794
+ let type = options.entryType || options.type;
5795
+ if (type === "both")
5796
+ type = FILE_DIR_TYPE;
5797
+ if (type)
5798
+ options.type = type;
5799
+ if (!root) {
5800
+ throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
5801
+ } else if (typeof root !== "string") {
5802
+ throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
5803
+ } else if (type && !ALL_TYPES.includes(type)) {
5804
+ throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
7471
5805
  }
7472
- return picomatch.compileRe(parsed, options, returnOutput, returnState);
5806
+ options.root = root;
5807
+ return new ReaddirpStream(options);
7473
5808
  };
7474
- picomatch.toRegex = (source, options) => {
7475
- try {
7476
- const opts = options || {};
7477
- return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
7478
- } catch (err) {
7479
- if (options && options.debug === true)
7480
- throw err;
7481
- return /$^/;
7482
- }
5809
+ var readdirpPromise = (root, options = {}) => {
5810
+ return new Promise((resolve, reject) => {
5811
+ const files = [];
5812
+ readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
5813
+ });
7483
5814
  };
7484
- picomatch.constants = constants;
7485
- module.exports = picomatch;
5815
+ readdirp.promise = readdirpPromise;
5816
+ readdirp.ReaddirpStream = ReaddirpStream;
5817
+ readdirp.default = readdirp;
5818
+ module.exports = readdirp;
7486
5819
  });
7487
5820
 
7488
5821
  // ../../node_modules/normalize-path/index.js
@@ -7521,7 +5854,7 @@ var require_normalize_path = __commonJS((exports, module) => {
7521
5854
  // ../../node_modules/anymatch/index.js
7522
5855
  var require_anymatch = __commonJS((exports, module) => {
7523
5856
  Object.defineProperty(exports, "__esModule", { value: true });
7524
- var picomatch = require_picomatch2();
5857
+ var picomatch = require_picomatch();
7525
5858
  var normalizePath = require_normalize_path();
7526
5859
  var BANG = "!";
7527
5860
  var DEFAULT_OPTIONS = { returnIndex: false };
@@ -7739,7 +6072,7 @@ var require_is_glob = __commonJS((exports, module) => {
7739
6072
  };
7740
6073
  });
7741
6074
 
7742
- // node_modules/chokidar/node_modules/glob-parent/index.js
6075
+ // ../../node_modules/glob-parent/index.js
7743
6076
  var require_glob_parent = __commonJS((exports, module) => {
7744
6077
  var isGlob = require_is_glob();
7745
6078
  var pathPosixDirname = __require("node:path").posix.dirname;
@@ -7766,7 +6099,7 @@ var require_glob_parent = __commonJS((exports, module) => {
7766
6099
  });
7767
6100
 
7768
6101
  // ../../node_modules/braces/lib/utils.js
7769
- var require_utils3 = __commonJS((exports) => {
6102
+ var require_utils2 = __commonJS((exports) => {
7770
6103
  exports.isInteger = (num) => {
7771
6104
  if (typeof num === "number") {
7772
6105
  return Number.isInteger(num);
@@ -7854,7 +6187,7 @@ var require_utils3 = __commonJS((exports) => {
7854
6187
 
7855
6188
  // ../../node_modules/braces/lib/stringify.js
7856
6189
  var require_stringify = __commonJS((exports, module) => {
7857
- var utils = require_utils3();
6190
+ var utils = require_utils2();
7858
6191
  module.exports = (ast, options = {}) => {
7859
6192
  const stringify = (node, parent = {}) => {
7860
6193
  const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
@@ -8326,7 +6659,7 @@ var require_fill_range = __commonJS((exports, module) => {
8326
6659
  // ../../node_modules/braces/lib/compile.js
8327
6660
  var require_compile = __commonJS((exports, module) => {
8328
6661
  var fill = require_fill_range();
8329
- var utils = require_utils3();
6662
+ var utils = require_utils2();
8330
6663
  var compile = (ast, options = {}) => {
8331
6664
  const walk = (node, parent = {}) => {
8332
6665
  const invalidBlock = utils.isInvalidBrace(parent);
@@ -8376,7 +6709,7 @@ var require_compile = __commonJS((exports, module) => {
8376
6709
  var require_expand = __commonJS((exports, module) => {
8377
6710
  var fill = require_fill_range();
8378
6711
  var stringify = require_stringify();
8379
- var utils = require_utils3();
6712
+ var utils = require_utils2();
8380
6713
  var append = (queue = "", stash = "", enclose = false) => {
8381
6714
  const result = [];
8382
6715
  queue = [].concat(queue);
@@ -8467,7 +6800,7 @@ var require_expand = __commonJS((exports, module) => {
8467
6800
  });
8468
6801
 
8469
6802
  // ../../node_modules/braces/lib/constants.js
8470
- var require_constants3 = __commonJS((exports, module) => {
6803
+ var require_constants2 = __commonJS((exports, module) => {
8471
6804
  module.exports = {
8472
6805
  MAX_LENGTH: 1e4,
8473
6806
  CHAR_0: "0",
@@ -8519,7 +6852,7 @@ var require_constants3 = __commonJS((exports, module) => {
8519
6852
  });
8520
6853
 
8521
6854
  // ../../node_modules/braces/lib/parse.js
8522
- var require_parse3 = __commonJS((exports, module) => {
6855
+ var require_parse2 = __commonJS((exports, module) => {
8523
6856
  var stringify = require_stringify();
8524
6857
  var {
8525
6858
  MAX_LENGTH,
@@ -8537,7 +6870,7 @@ var require_parse3 = __commonJS((exports, module) => {
8537
6870
  CHAR_SINGLE_QUOTE,
8538
6871
  CHAR_NO_BREAK_SPACE,
8539
6872
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
8540
- } = require_constants3();
6873
+ } = require_constants2();
8541
6874
  var parse = (input, options = {}) => {
8542
6875
  if (typeof input !== "string") {
8543
6876
  throw new TypeError("Expected a string");
@@ -8750,7 +7083,7 @@ var require_braces = __commonJS((exports, module) => {
8750
7083
  var stringify = require_stringify();
8751
7084
  var compile = require_compile();
8752
7085
  var expand2 = require_expand();
8753
- var parse = require_parse3();
7086
+ var parse = require_parse2();
8754
7087
  var braces = (input, options = {}) => {
8755
7088
  let output = [];
8756
7089
  if (Array.isArray(input)) {
@@ -9080,8 +7413,8 @@ var require_is_binary_path = __commonJS((exports, module) => {
9080
7413
  module.exports = (filePath) => extensions.has(path4.extname(filePath).slice(1).toLowerCase());
9081
7414
  });
9082
7415
 
9083
- // node_modules/chokidar/lib/constants.js
9084
- var require_constants4 = __commonJS((exports) => {
7416
+ // ../../node_modules/chokidar/lib/constants.js
7417
+ var require_constants3 = __commonJS((exports) => {
9085
7418
  var { sep: sep2 } = __require("node:path");
9086
7419
  var { platform: platform3 } = process;
9087
7420
  var os2 = __require("node:os");
@@ -9140,7 +7473,7 @@ var require_constants4 = __commonJS((exports) => {
9140
7473
  exports.isIBMi = os2.type() === "OS400";
9141
7474
  });
9142
7475
 
9143
- // node_modules/chokidar/lib/nodefs-handler.js
7476
+ // ../../node_modules/chokidar/lib/nodefs-handler.js
9144
7477
  var require_nodefs_handler = __commonJS((exports, module) => {
9145
7478
  var fs2 = __require("node:fs");
9146
7479
  var sysPath = __require("node:path");
@@ -9163,7 +7496,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
9163
7496
  STR_END,
9164
7497
  BRACE_START,
9165
7498
  STAR
9166
- } = require_constants4();
7499
+ } = require_constants3();
9167
7500
  var THROTTLE_MODE_WATCH = "watch";
9168
7501
  var open = promisify(fs2.open);
9169
7502
  var stat = promisify(fs2.stat);
@@ -9670,7 +8003,7 @@ var require_fsevents2 = __commonJS((exports) => {
9670
8003
  exports.constants = events;
9671
8004
  });
9672
8005
 
9673
- // node_modules/chokidar/lib/fsevents-handler.js
8006
+ // ../../node_modules/chokidar/lib/fsevents-handler.js
9674
8007
  var require_fsevents_handler = __commonJS((exports, module) => {
9675
8008
  var fs2 = __require("node:fs");
9676
8009
  var sysPath = __require("node:path");
@@ -9715,7 +8048,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
9715
8048
  FUNCTION_TYPE,
9716
8049
  EMPTY_FN,
9717
8050
  IDENTITY_FN
9718
- } = require_constants4();
8051
+ } = require_constants3();
9719
8052
  var Depth = (value) => isNaN(value) ? {} : { depth: value };
9720
8053
  var stat = promisify(fs2.stat);
9721
8054
  var lstat2 = promisify(fs2.lstat);
@@ -10040,7 +8373,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
10040
8373
  module.exports.canUse = canUse;
10041
8374
  });
10042
8375
 
10043
- // node_modules/chokidar/index.js
8376
+ // ../../node_modules/chokidar/index.js
10044
8377
  var require_chokidar = __commonJS((exports) => {
10045
8378
  var { EventEmitter: EventEmitter3 } = __require("node:events");
10046
8379
  var fs2 = __require("node:fs");
@@ -10087,7 +8420,7 @@ var require_chokidar = __commonJS((exports) => {
10087
8420
  isWindows: isWindows4,
10088
8421
  isMacos,
10089
8422
  isIBMi
10090
- } = require_constants4();
8423
+ } = require_constants3();
10091
8424
  var stat = promisify(fs2.stat);
10092
8425
  var readdir2 = promisify(fs2.readdir);
10093
8426
  var arrify = (value = []) => Array.isArray(value) ? value : [value];
@@ -11020,7 +9353,7 @@ var require_buffer_equal_constant_time = __commonJS((exports, module) => {
11020
9353
  // ../../node_modules/jwa/index.js
11021
9354
  var require_jwa = __commonJS((exports, module) => {
11022
9355
  var Buffer2 = require_safe_buffer().Buffer;
11023
- var crypto = __require("node:crypto");
9356
+ var crypto2 = __require("node:crypto");
11024
9357
  var formatEcdsa = require_ecdsa_sig_formatter();
11025
9358
  var util = __require("node:util");
11026
9359
  var MSG_INVALID_ALGORITHM = `"%s" is not a valid algorithm.
@@ -11029,7 +9362,7 @@ var require_jwa = __commonJS((exports, module) => {
11029
9362
  var MSG_INVALID_SECRET = "secret must be a string or buffer";
11030
9363
  var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer";
11031
9364
  var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object";
11032
- var supportsKeyObjects = typeof crypto.createPublicKey === "function";
9365
+ var supportsKeyObjects = typeof crypto2.createPublicKey === "function";
11033
9366
  if (supportsKeyObjects) {
11034
9367
  MSG_INVALID_VERIFIER_KEY += " or a KeyObject";
11035
9368
  MSG_INVALID_SECRET += "or a KeyObject";
@@ -11119,17 +9452,17 @@ var require_jwa = __commonJS((exports, module) => {
11119
9452
  return function sign(thing, secret) {
11120
9453
  checkIsSecretKey(secret);
11121
9454
  thing = normalizeInput(thing);
11122
- var hmac = crypto.createHmac("sha" + bits, secret);
9455
+ var hmac = crypto2.createHmac("sha" + bits, secret);
11123
9456
  var sig = (hmac.update(thing), hmac.digest("base64"));
11124
9457
  return fromBase64(sig);
11125
9458
  };
11126
9459
  }
11127
9460
  var bufferEqual;
11128
- var timingSafeEqual = "timingSafeEqual" in crypto ? function timingSafeEqual(a, b) {
9461
+ var timingSafeEqual = "timingSafeEqual" in crypto2 ? function timingSafeEqual(a, b) {
11129
9462
  if (a.byteLength !== b.byteLength) {
11130
9463
  return false;
11131
9464
  }
11132
- return crypto.timingSafeEqual(a, b);
9465
+ return crypto2.timingSafeEqual(a, b);
11133
9466
  } : function timingSafeEqual(a, b) {
11134
9467
  if (!bufferEqual) {
11135
9468
  bufferEqual = require_buffer_equal_constant_time();
@@ -11146,7 +9479,7 @@ var require_jwa = __commonJS((exports, module) => {
11146
9479
  return function sign(thing, privateKey) {
11147
9480
  checkIsPrivateKey(privateKey);
11148
9481
  thing = normalizeInput(thing);
11149
- var signer = crypto.createSign("RSA-SHA" + bits);
9482
+ var signer = crypto2.createSign("RSA-SHA" + bits);
11150
9483
  var sig = (signer.update(thing), signer.sign(privateKey, "base64"));
11151
9484
  return fromBase64(sig);
11152
9485
  };
@@ -11156,7 +9489,7 @@ var require_jwa = __commonJS((exports, module) => {
11156
9489
  checkIsPublicKey(publicKey);
11157
9490
  thing = normalizeInput(thing);
11158
9491
  signature = toBase64(signature);
11159
- var verifier = crypto.createVerify("RSA-SHA" + bits);
9492
+ var verifier = crypto2.createVerify("RSA-SHA" + bits);
11160
9493
  verifier.update(thing);
11161
9494
  return verifier.verify(publicKey, signature, "base64");
11162
9495
  };
@@ -11165,11 +9498,11 @@ var require_jwa = __commonJS((exports, module) => {
11165
9498
  return function sign(thing, privateKey) {
11166
9499
  checkIsPrivateKey(privateKey);
11167
9500
  thing = normalizeInput(thing);
11168
- var signer = crypto.createSign("RSA-SHA" + bits);
9501
+ var signer = crypto2.createSign("RSA-SHA" + bits);
11169
9502
  var sig = (signer.update(thing), signer.sign({
11170
9503
  key: privateKey,
11171
- padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
11172
- saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST
9504
+ padding: crypto2.constants.RSA_PKCS1_PSS_PADDING,
9505
+ saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST
11173
9506
  }, "base64"));
11174
9507
  return fromBase64(sig);
11175
9508
  };
@@ -11179,12 +9512,12 @@ var require_jwa = __commonJS((exports, module) => {
11179
9512
  checkIsPublicKey(publicKey);
11180
9513
  thing = normalizeInput(thing);
11181
9514
  signature = toBase64(signature);
11182
- var verifier = crypto.createVerify("RSA-SHA" + bits);
9515
+ var verifier = crypto2.createVerify("RSA-SHA" + bits);
11183
9516
  verifier.update(thing);
11184
9517
  return verifier.verify({
11185
9518
  key: publicKey,
11186
- padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
11187
- saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST
9519
+ padding: crypto2.constants.RSA_PKCS1_PSS_PADDING,
9520
+ saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST
11188
9521
  }, signature, "base64");
11189
9522
  };
11190
9523
  }
@@ -11672,7 +10005,7 @@ var require_timespan = __commonJS((exports, module) => {
11672
10005
  });
11673
10006
 
11674
10007
  // ../../node_modules/semver/internal/constants.js
11675
- var require_constants5 = __commonJS((exports, module) => {
10008
+ var require_constants4 = __commonJS((exports, module) => {
11676
10009
  var SEMVER_SPEC_VERSION = "2.0.0";
11677
10010
  var MAX_LENGTH = 256;
11678
10011
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
@@ -11711,7 +10044,7 @@ var require_re = __commonJS((exports, module) => {
11711
10044
  MAX_SAFE_COMPONENT_LENGTH,
11712
10045
  MAX_SAFE_BUILD_LENGTH,
11713
10046
  MAX_LENGTH
11714
- } = require_constants5();
10047
+ } = require_constants4();
11715
10048
  var debug = require_debug();
11716
10049
  exports = module.exports = {};
11717
10050
  var re = exports.re = [];
@@ -11831,7 +10164,7 @@ var require_identifiers = __commonJS((exports, module) => {
11831
10164
  // ../../node_modules/semver/classes/semver.js
11832
10165
  var require_semver = __commonJS((exports, module) => {
11833
10166
  var debug = require_debug();
11834
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants5();
10167
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants4();
11835
10168
  var { safeRe: re, t } = require_re();
11836
10169
  var parseOptions = require_parse_options();
11837
10170
  var { compareIdentifiers } = require_identifiers();
@@ -12098,7 +10431,7 @@ var require_semver = __commonJS((exports, module) => {
12098
10431
  });
12099
10432
 
12100
10433
  // ../../node_modules/semver/functions/parse.js
12101
- var require_parse4 = __commonJS((exports, module) => {
10434
+ var require_parse3 = __commonJS((exports, module) => {
12102
10435
  var SemVer = require_semver();
12103
10436
  var parse = (version, options, throwErrors = false) => {
12104
10437
  if (version instanceof SemVer) {
@@ -12118,7 +10451,7 @@ var require_parse4 = __commonJS((exports, module) => {
12118
10451
 
12119
10452
  // ../../node_modules/semver/functions/valid.js
12120
10453
  var require_valid = __commonJS((exports, module) => {
12121
- var parse = require_parse4();
10454
+ var parse = require_parse3();
12122
10455
  var valid = (version, options) => {
12123
10456
  const v = parse(version, options);
12124
10457
  return v ? v.version : null;
@@ -12128,7 +10461,7 @@ var require_valid = __commonJS((exports, module) => {
12128
10461
 
12129
10462
  // ../../node_modules/semver/functions/clean.js
12130
10463
  var require_clean = __commonJS((exports, module) => {
12131
- var parse = require_parse4();
10464
+ var parse = require_parse3();
12132
10465
  var clean = (version, options) => {
12133
10466
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
12134
10467
  return s ? s.version : null;
@@ -12156,7 +10489,7 @@ var require_inc = __commonJS((exports, module) => {
12156
10489
 
12157
10490
  // ../../node_modules/semver/functions/diff.js
12158
10491
  var require_diff = __commonJS((exports, module) => {
12159
- var parse = require_parse4();
10492
+ var parse = require_parse3();
12160
10493
  var diff = (version1, version2) => {
12161
10494
  const v1 = parse(version1, null, true);
12162
10495
  const v2 = parse(version2, null, true);
@@ -12218,7 +10551,7 @@ var require_patch = __commonJS((exports, module) => {
12218
10551
 
12219
10552
  // ../../node_modules/semver/functions/prerelease.js
12220
10553
  var require_prerelease = __commonJS((exports, module) => {
12221
- var parse = require_parse4();
10554
+ var parse = require_parse3();
12222
10555
  var prerelease = (version, options) => {
12223
10556
  const parsed = parse(version, options);
12224
10557
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
@@ -12364,7 +10697,7 @@ var require_cmp = __commonJS((exports, module) => {
12364
10697
  // ../../node_modules/semver/functions/coerce.js
12365
10698
  var require_coerce = __commonJS((exports, module) => {
12366
10699
  var SemVer = require_semver();
12367
- var parse = require_parse4();
10700
+ var parse = require_parse3();
12368
10701
  var { safeRe: re, t } = require_re();
12369
10702
  var coerce = (version, options) => {
12370
10703
  if (version instanceof SemVer) {
@@ -12594,7 +10927,7 @@ var require_range = __commonJS((exports, module) => {
12594
10927
  tildeTrimReplace,
12595
10928
  caretTrimReplace
12596
10929
  } = require_re();
12597
- var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants5();
10930
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants4();
12598
10931
  var isNullSet = (c) => c.value === "<0.0.0-0";
12599
10932
  var isAny = (c) => c.value === "";
12600
10933
  var isSatisfiable = (comparators, options) => {
@@ -13365,10 +11698,10 @@ var require_subset = __commonJS((exports, module) => {
13365
11698
  // ../../node_modules/semver/index.js
13366
11699
  var require_semver2 = __commonJS((exports, module) => {
13367
11700
  var internalRe = require_re();
13368
- var constants = require_constants5();
11701
+ var constants = require_constants4();
13369
11702
  var SemVer = require_semver();
13370
11703
  var identifiers = require_identifiers();
13371
- var parse = require_parse4();
11704
+ var parse = require_parse3();
13372
11705
  var valid = require_valid();
13373
11706
  var clean = require_clean();
13374
11707
  var inc = require_inc();
@@ -14411,8 +12744,8 @@ function isBaseMapInstance(obj) {
14411
12744
  return Object.getPrototypeOf(obj) === Map.prototype;
14412
12745
  }
14413
12746
  function latest(proxyDraft) {
14414
- var _a2;
14415
- return (_a2 = proxyDraft.copy) !== null && _a2 !== undefined ? _a2 : proxyDraft.original;
12747
+ var _a;
12748
+ return (_a = proxyDraft.copy) !== null && _a !== undefined ? _a : proxyDraft.original;
14416
12749
  }
14417
12750
  function isDraft(target) {
14418
12751
  return !!getProxyDraft(target);
@@ -14423,9 +12756,9 @@ function getProxyDraft(value) {
14423
12756
  return value === null || value === undefined ? undefined : value[PROXY_DRAFT];
14424
12757
  }
14425
12758
  function getValue(value) {
14426
- var _a2;
12759
+ var _a;
14427
12760
  const proxyDraft = getProxyDraft(value);
14428
- return proxyDraft ? (_a2 = proxyDraft.copy) !== null && _a2 !== undefined ? _a2 : proxyDraft.original : value;
12761
+ return proxyDraft ? (_a = proxyDraft.copy) !== null && _a !== undefined ? _a : proxyDraft.original : value;
14429
12762
  }
14430
12763
  function isDraftable(value, options) {
14431
12764
  if (!value || typeof value !== "object")
@@ -14622,8 +12955,8 @@ function cloneIfNeeded(target) {
14622
12955
  return isDraft(target) ? deepClone(target) : target;
14623
12956
  }
14624
12957
  function markChanged(proxyDraft) {
14625
- var _a2;
14626
- proxyDraft.assignedMap = (_a2 = proxyDraft.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
12958
+ var _a;
12959
+ proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== undefined ? _a : new Map;
14627
12960
  if (!proxyDraft.operated) {
14628
12961
  proxyDraft.operated = true;
14629
12962
  if (proxyDraft.parent) {
@@ -14726,11 +13059,11 @@ function handleValue(target, handledSet, options) {
14726
13059
  const setMap = isSet ? new Map : undefined;
14727
13060
  handledSet.add(target);
14728
13061
  forEach(target, (key, value) => {
14729
- var _a2;
13062
+ var _a;
14730
13063
  if (isDraft(value)) {
14731
13064
  const proxyDraft = getProxyDraft(value);
14732
13065
  ensureShallowCopy(proxyDraft);
14733
- const updatedValue = ((_a2 = proxyDraft.assignedMap) === null || _a2 === undefined ? undefined : _a2.size) || proxyDraft.operated ? proxyDraft.copy : proxyDraft.original;
13066
+ const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === undefined ? undefined : _a.size) || proxyDraft.operated ? proxyDraft.copy : proxyDraft.original;
14734
13067
  set(isSet ? setMap : target, key, updatedValue);
14735
13068
  } else {
14736
13069
  handleValue(value, handledSet, options);
@@ -14778,7 +13111,7 @@ function markFinalization(target, key, value, generatePatches) {
14778
13111
  proxyDraft.callbacks = [];
14779
13112
  }
14780
13113
  proxyDraft.callbacks.push((patches, inversePatches) => {
14781
- var _a2;
13114
+ var _a;
14782
13115
  const copy = target.type === 3 ? target.setMap : target.copy;
14783
13116
  if (isEqual(get(copy, key), value)) {
14784
13117
  let updatedValue = proxyDraft.original;
@@ -14788,7 +13121,7 @@ function markFinalization(target, key, value, generatePatches) {
14788
13121
  finalizeSetValue(target);
14789
13122
  finalizePatches(target, generatePatches, patches, inversePatches);
14790
13123
  if (target.options.enableAutoFreeze) {
14791
- target.options.updatedValues = (_a2 = target.options.updatedValues) !== null && _a2 !== undefined ? _a2 : new WeakMap;
13124
+ target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !== undefined ? _a : new WeakMap;
14792
13125
  target.options.updatedValues.set(updatedValue, proxyDraft.original);
14793
13126
  }
14794
13127
  set(copy, key, updatedValue);
@@ -14949,7 +13282,7 @@ function createDraft(createDraftOptions) {
14949
13282
  if (parentDraft) {
14950
13283
  const target = parentDraft;
14951
13284
  target.finalities.draft.push((patches, inversePatches) => {
14952
- var _a2, _b;
13285
+ var _a, _b;
14953
13286
  const oldProxyDraft = getProxyDraft(proxy);
14954
13287
  let copy = target.type === 3 ? target.setMap : target.copy;
14955
13288
  const draft = get(copy, key);
@@ -14962,7 +13295,7 @@ function createDraft(createDraftOptions) {
14962
13295
  finalizeSetValue(proxyDraft2);
14963
13296
  finalizePatches(proxyDraft2, generatePatches, patches, inversePatches);
14964
13297
  if (target.options.enableAutoFreeze) {
14965
- target.options.updatedValues = (_a2 = target.options.updatedValues) !== null && _a2 !== undefined ? _a2 : new WeakMap;
13298
+ target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !== undefined ? _a : new WeakMap;
14966
13299
  target.options.updatedValues.set(updatedValue, proxyDraft2.original);
14967
13300
  }
14968
13301
  set(copy, key, updatedValue);
@@ -14981,9 +13314,9 @@ function createDraft(createDraftOptions) {
14981
13314
  return proxy;
14982
13315
  }
14983
13316
  function finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {
14984
- var _a2;
13317
+ var _a;
14985
13318
  const proxyDraft = getProxyDraft(result);
14986
- const original = (_a2 = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a2 !== undefined ? _a2 : result;
13319
+ const original = (_a = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a !== undefined ? _a : result;
14987
13320
  const hasReturnedValue = !!returnedValue.length;
14988
13321
  if (proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.operated) {
14989
13322
  while (proxyDraft.finalities.draft.length > 0) {
@@ -15004,7 +13337,7 @@ function finalizeDraft(result, returnedValue, patches, inversePatches, enableAut
15004
13337
  ];
15005
13338
  }
15006
13339
  function draftify(baseState, options) {
15007
- var _a2;
13340
+ var _a;
15008
13341
  const finalities = {
15009
13342
  draft: [],
15010
13343
  revoke: [],
@@ -15017,7 +13350,7 @@ function draftify(baseState, options) {
15017
13350
  patches = [];
15018
13351
  inversePatches = [];
15019
13352
  }
15020
- const isMutable = ((_a2 = options.mark) === null || _a2 === undefined ? undefined : _a2.call(options, baseState, dataTypes)) === dataTypes.mutable || !isDraftable(baseState, options);
13353
+ const isMutable = ((_a = options.mark) === null || _a === undefined ? undefined : _a.call(options, baseState, dataTypes)) === dataTypes.mutable || !isDraftable(baseState, options);
15021
13354
  const draft = isMutable ? baseState : createDraft({
15022
13355
  original: baseState,
15023
13356
  parentDraft: null,
@@ -15061,7 +13394,7 @@ function handleReturnValue(options) {
15061
13394
  }
15062
13395
  }
15063
13396
  function getCurrent(target) {
15064
- var _a2;
13397
+ var _a;
15065
13398
  const proxyDraft = getProxyDraft(target);
15066
13399
  if (!isDraftable(target, proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.options))
15067
13400
  return target;
@@ -15093,7 +13426,7 @@ function getCurrent(target) {
15093
13426
  }
15094
13427
  });
15095
13428
  if (type === 3) {
15096
- const value = (_a2 = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a2 !== undefined ? _a2 : currentValue;
13429
+ const value = (_a = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a !== undefined ? _a : currentValue;
15097
13430
  return !isBaseSetInstance(value) ? new (Object.getPrototypeOf(value)).constructor(currentValue) : new Set(currentValue);
15098
13431
  }
15099
13432
  return currentValue;
@@ -15196,14 +13529,23 @@ function apply(state, patches, applyOptions) {
15196
13529
  function hasLocalStorage() {
15197
13530
  return typeof localStorage !== "undefined";
15198
13531
  }
13532
+ function notifyTokenChange(scope) {
13533
+ if (typeof window !== "undefined") {
13534
+ queueMicrotask(() => {
13535
+ window.dispatchEvent(new CustomEvent("arc:token-change", { detail: { scope } }));
13536
+ });
13537
+ }
13538
+ }
15199
13539
 
15200
13540
  class AuthAdapter {
15201
13541
  scopes = new Map;
15202
13542
  setToken(token, scope = "default") {
15203
13543
  if (!token) {
15204
13544
  this.scopes.delete(scope);
15205
- if (hasLocalStorage())
13545
+ if (hasLocalStorage()) {
15206
13546
  localStorage.removeItem(TOKEN_PREFIX + scope);
13547
+ notifyTokenChange(scope);
13548
+ }
15207
13549
  return;
15208
13550
  }
15209
13551
  try {
@@ -15224,8 +13566,10 @@ class AuthAdapter {
15224
13566
  exp: payload.exp
15225
13567
  }
15226
13568
  });
15227
- if (hasLocalStorage())
13569
+ if (hasLocalStorage()) {
15228
13570
  localStorage.setItem(TOKEN_PREFIX + scope, token);
13571
+ notifyTokenChange(scope);
13572
+ }
15229
13573
  } catch {
15230
13574
  this.scopes.delete(scope);
15231
13575
  if (hasLocalStorage())
@@ -16007,15 +14351,15 @@ function typeValidatorBuilder(typeName, comparatorStrategy) {
16007
14351
  function string() {
16008
14352
  return new ArcString;
16009
14353
  }
16010
- function id(name, generateFn) {
16011
- return new ArcId(name, generateFn);
16012
- }
16013
14354
 
16014
14355
  class ArcFragmentBase {
16015
14356
  is(type) {
16016
14357
  return this.types.includes(type);
16017
14358
  }
16018
14359
  }
14360
+ function id(name, generateFn) {
14361
+ return new ArcId(name, generateFn);
14362
+ }
16019
14363
 
16020
14364
  class AggregateBase {
16021
14365
  value;
@@ -17491,14 +15835,14 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17491
15835
  throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);
17492
15836
  }
17493
15837
  }, mapHandler, mapHandlerKeys, getNextIterator = (target, iterator, { isValuesIterator }) => () => {
17494
- var _a2, _b;
15838
+ var _a, _b;
17495
15839
  const result = iterator.next();
17496
15840
  if (result.done)
17497
15841
  return result;
17498
15842
  const key = result.value;
17499
15843
  let value = target.setMap.get(key);
17500
15844
  const currentDraft = getProxyDraft(value);
17501
- const mutable = ((_b = (_a2 = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a2, value, dataTypes)) === dataTypes.mutable;
15845
+ const mutable = ((_b = (_a = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a, value, dataTypes)) === dataTypes.mutable;
17502
15846
  if (target.options.strict) {
17503
15847
  checkReadable(key, target.options, mutable);
17504
15848
  }
@@ -17524,7 +15868,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17524
15868
  throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);
17525
15869
  }
17526
15870
  return function create(arg0, arg1, arg2) {
17527
- var _a2, _b, _c;
15871
+ var _a, _b, _c;
17528
15872
  if (typeof arg0 === "function" && typeof arg1 !== "function") {
17529
15873
  return function(base22, ...args) {
17530
15874
  return create(base22, (draft2) => arg0.call(this, draft2, ...args), arg1);
@@ -17553,7 +15897,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17553
15897
  }
17554
15898
  return;
17555
15899
  } : options.mark;
17556
- const enablePatches = (_a2 = options.enablePatches) !== null && _a2 !== undefined ? _a2 : false;
15900
+ const enablePatches = (_a = options.enablePatches) !== null && _a !== undefined ? _a : false;
17557
15901
  const strict = (_b = options.strict) !== null && _b !== undefined ? _b : false;
17558
15902
  const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== undefined ? _c : false;
17559
15903
  const _options = {
@@ -17624,7 +15968,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17624
15968
  }
17625
15969
  return returnValue(result);
17626
15970
  };
17627
- }, create, constructorString, TOKEN_PREFIX = "arc:token:", eventWireInstanceCounter = 0, EVENT_TABLES, arrayValidator, ArcArray, objectValidator, ArcObject, ArcPrimitive, ArcBoolean, stringValidator, ArcString, ArcId, numberValidator, ArcNumber, ArcContextElement, ArcEvent, ForkedStoreState, ForkedDataStorage, MasterStoreState, MasterDataStorage2, dateValidator, SQLiteReadWriteTransaction, createSQLiteAdapterFactory = (db) => {
15971
+ }, create, constructorString, TOKEN_PREFIX = "arc:token:", eventWireInstanceCounter = 0, EVENT_TABLES, arrayValidator, ArcArray, objectValidator, ArcObject, ArcPrimitive, stringValidator, ArcString, ArcContextElement, ArcBoolean, ArcId, numberValidator, ArcNumber, ArcEvent, ForkedStoreState, ForkedDataStorage, MasterStoreState, MasterDataStorage2, dateValidator, SQLiteReadWriteTransaction, createSQLiteAdapterFactory = (db) => {
17628
15972
  return async (context) => {
17629
15973
  const adapter = new SQLiteAdapter(db, context);
17630
15974
  await adapter.initialize();
@@ -17705,10 +16049,10 @@ var init_dist = __esm(() => {
17705
16049
  });
17706
16050
  },
17707
16051
  get(key) {
17708
- var _a2, _b;
16052
+ var _a, _b;
17709
16053
  const target = getProxyDraft(this);
17710
16054
  const value = latest(target).get(key);
17711
- const mutable = ((_b = (_a2 = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a2, value, dataTypes)) === dataTypes.mutable;
16055
+ const mutable = ((_b = (_a = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a, value, dataTypes)) === dataTypes.mutable;
17712
16056
  if (target.options.strict) {
17713
16057
  checkReadable(value, target.options, mutable);
17714
16058
  }
@@ -17891,8 +16235,8 @@ var init_dist = __esm(() => {
17891
16235
  setHandlerKeys = Reflect.ownKeys(setHandler);
17892
16236
  proxyHandler = {
17893
16237
  get(target, key, receiver) {
17894
- var _a2, _b;
17895
- const copy = (_a2 = target.copy) === null || _a2 === undefined ? undefined : _a2[key];
16238
+ var _a, _b;
16239
+ const copy = (_a = target.copy) === null || _a === undefined ? undefined : _a[key];
17896
16240
  if (copy && target.finalities.draftsCache.has(copy)) {
17897
16241
  return copy;
17898
16242
  }
@@ -17958,7 +16302,7 @@ var init_dist = __esm(() => {
17958
16302
  return value;
17959
16303
  },
17960
16304
  set(target, key, value) {
17961
- var _a2;
16305
+ var _a;
17962
16306
  if (target.type === 3 || target.type === 2) {
17963
16307
  throw new Error(`Map/Set draft does not support any property assignment.`);
17964
16308
  }
@@ -17975,7 +16319,7 @@ var init_dist = __esm(() => {
17975
16319
  const currentProxyDraft = getProxyDraft(current);
17976
16320
  if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {
17977
16321
  target.copy[key] = value;
17978
- target.assignedMap = (_a2 = target.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
16322
+ target.assignedMap = (_a = target.assignedMap) !== null && _a !== undefined ? _a : new Map;
17979
16323
  target.assignedMap.set(key, false);
17980
16324
  return true;
17981
16325
  }
@@ -18020,7 +16364,7 @@ var init_dist = __esm(() => {
18020
16364
  throw new Error(`Cannot call 'defineProperty()' on drafts`);
18021
16365
  },
18022
16366
  deleteProperty(target, key) {
18023
- var _a2;
16367
+ var _a;
18024
16368
  if (target.type === 1) {
18025
16369
  return proxyHandler.set.call(this, target, key, undefined, target.proxy);
18026
16370
  }
@@ -18029,7 +16373,7 @@ var init_dist = __esm(() => {
18029
16373
  markChanged(target);
18030
16374
  target.assignedMap.set(key, false);
18031
16375
  } else {
18032
- target.assignedMap = (_a2 = target.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
16376
+ target.assignedMap = (_a = target.assignedMap) !== null && _a !== undefined ? _a : new Map;
18033
16377
  target.assignedMap.delete(key);
18034
16378
  }
18035
16379
  if (target.copy)
@@ -18315,37 +16659,6 @@ var init_dist = __esm(() => {
18315
16659
  return value;
18316
16660
  }
18317
16661
  };
18318
- ArcBoolean = class ArcBoolean extends ArcPrimitive {
18319
- hasToBeTrue() {
18320
- return this.validation("hasToBeTrue", (value) => {
18321
- if (!value)
18322
- return {
18323
- current: value
18324
- };
18325
- });
18326
- }
18327
- validation(name, validator) {
18328
- const instance = this.pipeValidation(name, validator);
18329
- return instance;
18330
- }
18331
- toJsonSchema() {
18332
- const schema = { type: "boolean" };
18333
- if (this._description) {
18334
- schema.description = this._description;
18335
- }
18336
- return schema;
18337
- }
18338
- getColumnData() {
18339
- const storeData = this.getStoreData();
18340
- return {
18341
- type: "boolean",
18342
- storeData: {
18343
- ...storeData,
18344
- isNullable: false
18345
- }
18346
- };
18347
- }
18348
- };
18349
16662
  stringValidator = typeValidatorBuilder("string");
18350
16663
  ArcString = class ArcString extends ArcPrimitive {
18351
16664
  constructor() {
@@ -18493,6 +16806,52 @@ var init_dist = __esm(() => {
18493
16806
  };
18494
16807
  }
18495
16808
  };
16809
+ ArcContextElement = class ArcContextElement extends ArcFragmentBase {
16810
+ name;
16811
+ types = ["context-element"];
16812
+ get id() {
16813
+ return this.name;
16814
+ }
16815
+ constructor(name) {
16816
+ super();
16817
+ this.name = name;
16818
+ }
16819
+ _seeds;
16820
+ getSeeds() {
16821
+ return this._seeds;
16822
+ }
16823
+ };
16824
+ ArcBoolean = class ArcBoolean extends ArcPrimitive {
16825
+ hasToBeTrue() {
16826
+ return this.validation("hasToBeTrue", (value) => {
16827
+ if (!value)
16828
+ return {
16829
+ current: value
16830
+ };
16831
+ });
16832
+ }
16833
+ validation(name, validator) {
16834
+ const instance = this.pipeValidation(name, validator);
16835
+ return instance;
16836
+ }
16837
+ toJsonSchema() {
16838
+ const schema = { type: "boolean" };
16839
+ if (this._description) {
16840
+ schema.description = this._description;
16841
+ }
16842
+ return schema;
16843
+ }
16844
+ getColumnData() {
16845
+ const storeData = this.getStoreData();
16846
+ return {
16847
+ type: "boolean",
16848
+ storeData: {
16849
+ ...storeData,
16850
+ isNullable: false
16851
+ }
16852
+ };
16853
+ }
16854
+ };
18496
16855
  ArcId = class ArcId extends ArcBranded {
18497
16856
  generateFn;
18498
16857
  constructor(name, generateFn) {
@@ -18558,17 +16917,6 @@ var init_dist = __esm(() => {
18558
16917
  };
18559
16918
  }
18560
16919
  };
18561
- ArcContextElement = class ArcContextElement extends ArcFragmentBase {
18562
- name;
18563
- types = ["context-element"];
18564
- get id() {
18565
- return this.name;
18566
- }
18567
- constructor(name) {
18568
- super();
18569
- this.name = name;
18570
- }
18571
- };
18572
16920
  ArcEvent = class ArcEvent extends ArcContextElement {
18573
16921
  data;
18574
16922
  eventId = id("event");
@@ -19148,7 +17496,7 @@ var init_dist = __esm(() => {
19148
17496
  };
19149
17497
  });
19150
17498
 
19151
- // node_modules/commander/esm.mjs
17499
+ // ../../node_modules/commander/esm.mjs
19152
17500
  var import__ = __toESM(require_commander(), 1);
19153
17501
  var {
19154
17502
  program,
@@ -21422,35 +19770,8 @@ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
21422
19770
  };
21423
19771
 
21424
19772
  // node_modules/glob/node_modules/minimatch/dist/esm/ast.js
21425
- var _a;
21426
19773
  var types = new Set(["!", "?", "+", "*", "@"]);
21427
19774
  var isExtglobType = (c) => types.has(c);
21428
- var isExtglobAST = (c) => isExtglobType(c.type);
21429
- var adoptionMap = new Map([
21430
- ["!", ["@"]],
21431
- ["?", ["?", "@"]],
21432
- ["@", ["@"]],
21433
- ["*", ["*", "+", "?", "@"]],
21434
- ["+", ["+", "@"]]
21435
- ]);
21436
- var adoptionWithSpaceMap = new Map([
21437
- ["!", ["?"]],
21438
- ["@", ["?"]],
21439
- ["+", ["?", "*"]]
21440
- ]);
21441
- var adoptionAnyMap = new Map([
21442
- ["!", ["?", "@"]],
21443
- ["?", ["?", "@"]],
21444
- ["@", ["?", "@"]],
21445
- ["*", ["*", "+", "?", "@"]],
21446
- ["+", ["+", "@", "?", "*"]]
21447
- ]);
21448
- var usurpMap = new Map([
21449
- ["!", new Map([["!", "@"]])],
21450
- ["?", new Map([["*", "*"], ["+", "*"]])],
21451
- ["@", new Map([["!", "!"], ["?", "?"], ["@", "@"], ["*", "*"], ["+", "+"]])],
21452
- ["+", new Map([["?", "*"], ["*", "*"]])]
21453
- ]);
21454
19775
  var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
21455
19776
  var startNoDot = "(?!\\.)";
21456
19777
  var addPatternStart = new Set(["[", "."]);
@@ -21538,7 +19859,7 @@ class AST {
21538
19859
  for (const p of parts) {
21539
19860
  if (p === "")
21540
19861
  continue;
21541
- if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
19862
+ if (typeof p !== "string" && !(p instanceof AST && p.#parent === this)) {
21542
19863
  throw new Error("invalid part: " + p);
21543
19864
  }
21544
19865
  this.#parts.push(p);
@@ -21563,7 +19884,7 @@ class AST {
21563
19884
  const p = this.#parent;
21564
19885
  for (let i = 0;i < this.#parentIndex; i++) {
21565
19886
  const pp = p.#parts[i];
21566
- if (!(pp instanceof _a && pp.type === "!")) {
19887
+ if (!(pp instanceof AST && pp.type === "!")) {
21567
19888
  return false;
21568
19889
  }
21569
19890
  }
@@ -21588,14 +19909,13 @@ class AST {
21588
19909
  this.push(part.clone(this));
21589
19910
  }
21590
19911
  clone(parent) {
21591
- const c = new _a(this.type, parent);
19912
+ const c = new AST(this.type, parent);
21592
19913
  for (const p of this.#parts) {
21593
19914
  c.copyIn(p);
21594
19915
  }
21595
19916
  return c;
21596
19917
  }
21597
- static #parseAST(str, ast, pos, opt, extDepth) {
21598
- const maxDepth = opt.maxExtglobRecursion ?? 2;
19918
+ static #parseAST(str, ast, pos, opt) {
21599
19919
  let escaping = false;
21600
19920
  let inBrace = false;
21601
19921
  let braceStart = -1;
@@ -21627,12 +19947,11 @@ class AST {
21627
19947
  acc2 += c;
21628
19948
  continue;
21629
19949
  }
21630
- const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
21631
- if (doRecurse) {
19950
+ if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
21632
19951
  ast.push(acc2);
21633
19952
  acc2 = "";
21634
- const ext = new _a(c, ast);
21635
- i2 = _a.#parseAST(str, ext, i2, opt, extDepth + 1);
19953
+ const ext = new AST(c, ast);
19954
+ i2 = AST.#parseAST(str, ext, i2, opt);
21636
19955
  ast.push(ext);
21637
19956
  continue;
21638
19957
  }
@@ -21642,7 +19961,7 @@ class AST {
21642
19961
  return i2;
21643
19962
  }
21644
19963
  let i = pos + 1;
21645
- let part = new _a(null, ast);
19964
+ let part = new AST(null, ast);
21646
19965
  const parts = [];
21647
19966
  let acc = "";
21648
19967
  while (i < str.length) {
@@ -21669,21 +19988,19 @@ class AST {
21669
19988
  acc += c;
21670
19989
  continue;
21671
19990
  }
21672
- const doRecurse = isExtglobType(c) && str.charAt(i) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
21673
- if (doRecurse) {
21674
- const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
19991
+ if (isExtglobType(c) && str.charAt(i) === "(") {
21675
19992
  part.push(acc);
21676
19993
  acc = "";
21677
- const ext = new _a(c, part);
19994
+ const ext = new AST(c, part);
21678
19995
  part.push(ext);
21679
- i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
19996
+ i = AST.#parseAST(str, ext, i, opt);
21680
19997
  continue;
21681
19998
  }
21682
19999
  if (c === "|") {
21683
20000
  part.push(acc);
21684
20001
  acc = "";
21685
20002
  parts.push(part);
21686
- part = new _a(null, ast);
20003
+ part = new AST(null, ast);
21687
20004
  continue;
21688
20005
  }
21689
20006
  if (c === ")") {
@@ -21702,101 +20019,9 @@ class AST {
21702
20019
  ast.#parts = [str.substring(pos - 1)];
21703
20020
  return i;
21704
20021
  }
21705
- #canAdoptWithSpace(child) {
21706
- return this.#canAdopt(child, adoptionWithSpaceMap);
21707
- }
21708
- #canAdopt(child, map = adoptionMap) {
21709
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
21710
- return false;
21711
- }
21712
- const gc = child.#parts[0];
21713
- if (!gc || typeof gc !== "object" || gc.type === null) {
21714
- return false;
21715
- }
21716
- return this.#canAdoptType(gc.type, map);
21717
- }
21718
- #canAdoptType(c, map = adoptionAnyMap) {
21719
- return !!map.get(this.type)?.includes(c);
21720
- }
21721
- #adoptWithSpace(child, index) {
21722
- const gc = child.#parts[0];
21723
- const blank = new _a(null, gc, this.options);
21724
- blank.#parts.push("");
21725
- gc.push(blank);
21726
- this.#adopt(child, index);
21727
- }
21728
- #adopt(child, index) {
21729
- const gc = child.#parts[0];
21730
- this.#parts.splice(index, 1, ...gc.#parts);
21731
- for (const p of gc.#parts) {
21732
- if (typeof p === "object")
21733
- p.#parent = this;
21734
- }
21735
- this.#toString = undefined;
21736
- }
21737
- #canUsurpType(c) {
21738
- const m = usurpMap.get(this.type);
21739
- return !!m?.has(c);
21740
- }
21741
- #canUsurp(child) {
21742
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
21743
- return false;
21744
- }
21745
- const gc = child.#parts[0];
21746
- if (!gc || typeof gc !== "object" || gc.type === null) {
21747
- return false;
21748
- }
21749
- return this.#canUsurpType(gc.type);
21750
- }
21751
- #usurp(child) {
21752
- const m = usurpMap.get(this.type);
21753
- const gc = child.#parts[0];
21754
- const nt = m?.get(gc.type);
21755
- if (!nt)
21756
- return false;
21757
- this.#parts = gc.#parts;
21758
- for (const p of this.#parts) {
21759
- if (typeof p === "object")
21760
- p.#parent = this;
21761
- }
21762
- this.type = nt;
21763
- this.#toString = undefined;
21764
- this.#emptyExt = false;
21765
- }
21766
- #flatten() {
21767
- if (!isExtglobAST(this)) {
21768
- for (const p of this.#parts) {
21769
- if (typeof p === "object")
21770
- p.#flatten();
21771
- }
21772
- } else {
21773
- let iterations = 0;
21774
- let done = false;
21775
- do {
21776
- done = true;
21777
- for (let i = 0;i < this.#parts.length; i++) {
21778
- const c = this.#parts[i];
21779
- if (typeof c === "object") {
21780
- c.#flatten();
21781
- if (this.#canAdopt(c)) {
21782
- done = false;
21783
- this.#adopt(c, i);
21784
- } else if (this.#canAdoptWithSpace(c)) {
21785
- done = false;
21786
- this.#adoptWithSpace(c, i);
21787
- } else if (this.#canUsurp(c)) {
21788
- done = false;
21789
- this.#usurp(c);
21790
- }
21791
- }
21792
- }
21793
- } while (!done && ++iterations < 10);
21794
- }
21795
- this.#toString = undefined;
21796
- }
21797
20022
  static fromGlob(pattern, options = {}) {
21798
- const ast = new _a(null, undefined, options);
21799
- _a.#parseAST(pattern, ast, 0, options, 0);
20023
+ const ast = new AST(null, undefined, options);
20024
+ AST.#parseAST(pattern, ast, 0, options);
21800
20025
  return ast;
21801
20026
  }
21802
20027
  toMMPattern() {
@@ -21819,14 +20044,12 @@ class AST {
21819
20044
  }
21820
20045
  toRegExpSource(allowDot) {
21821
20046
  const dot = allowDot ?? !!this.#options.dot;
21822
- if (this.#root === this) {
21823
- this.#flatten();
20047
+ if (this.#root === this)
21824
20048
  this.#fillNegs();
21825
- }
21826
- if (!isExtglobAST(this)) {
20049
+ if (!this.type) {
21827
20050
  const noEmpty = this.isStart() && this.isEnd();
21828
20051
  const src = this.#parts.map((p) => {
21829
- const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
20052
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
21830
20053
  this.#hasMagic = this.#hasMagic || hasMagic;
21831
20054
  this.#uflag = this.#uflag || uflag;
21832
20055
  return re;
@@ -21860,10 +20083,9 @@ class AST {
21860
20083
  let body = this.#partsToRegExp(dot);
21861
20084
  if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
21862
20085
  const s = this.toString();
21863
- const me = this;
21864
- me.#parts = [s];
21865
- me.type = null;
21866
- me.#hasMagic = undefined;
20086
+ this.#parts = [s];
20087
+ this.type = null;
20088
+ this.#hasMagic = undefined;
21867
20089
  return [s, unescape(this.toString()), false, false];
21868
20090
  }
21869
20091
  let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
@@ -21901,13 +20123,11 @@ class AST {
21901
20123
  let escaping = false;
21902
20124
  let re = "";
21903
20125
  let uflag = false;
21904
- let inStar = false;
21905
20126
  for (let i = 0;i < glob.length; i++) {
21906
20127
  const c = glob.charAt(i);
21907
20128
  if (escaping) {
21908
20129
  escaping = false;
21909
20130
  re += (reSpecials.has(c) ? "\\" : "") + c;
21910
- inStar = false;
21911
20131
  continue;
21912
20132
  }
21913
20133
  if (c === "\\") {
@@ -21925,19 +20145,16 @@ class AST {
21925
20145
  uflag = uflag || needUflag;
21926
20146
  i += consumed - 1;
21927
20147
  hasMagic = hasMagic || magic;
21928
- inStar = false;
21929
20148
  continue;
21930
20149
  }
21931
20150
  }
21932
20151
  if (c === "*") {
21933
- if (inStar)
21934
- continue;
21935
- inStar = true;
21936
- re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
20152
+ if (noEmpty && glob === "*")
20153
+ re += starNoEmpty;
20154
+ else
20155
+ re += star;
21937
20156
  hasMagic = true;
21938
20157
  continue;
21939
- } else {
21940
- inStar = false;
21941
20158
  }
21942
20159
  if (c === "?") {
21943
20160
  re += qmark;
@@ -21949,7 +20166,6 @@ class AST {
21949
20166
  return [re, unescape(glob), !!hasMagic, uflag];
21950
20167
  }
21951
20168
  }
21952
- _a = AST;
21953
20169
 
21954
20170
  // node_modules/glob/node_modules/minimatch/dist/esm/escape.js
21955
20171
  var escape = (s, { windowsPathsNoEscape = false } = {}) => {
@@ -22104,13 +20320,11 @@ class Minimatch {
22104
20320
  isWindows;
22105
20321
  platform;
22106
20322
  windowsNoMagicRoot;
22107
- maxGlobstarRecursion;
22108
20323
  regexp;
22109
20324
  constructor(pattern, options = {}) {
22110
20325
  assertValidPattern(pattern);
22111
20326
  options = options || {};
22112
20327
  this.options = options;
22113
- this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
22114
20328
  this.pattern = pattern;
22115
20329
  this.platform = options.platform || defaultPlatform;
22116
20330
  this.isWindows = this.platform === "win32";
@@ -22405,8 +20619,7 @@ class Minimatch {
22405
20619
  this.negate = negate;
22406
20620
  }
22407
20621
  matchOne(file, pattern, partial = false) {
22408
- let fileStartIndex = 0;
22409
- let patternStartIndex = 0;
20622
+ const options = this.options;
22410
20623
  if (this.isWindows) {
22411
20624
  const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
22412
20625
  const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
@@ -22415,14 +20628,14 @@ class Minimatch {
22415
20628
  const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
22416
20629
  const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
22417
20630
  if (typeof fdi === "number" && typeof pdi === "number") {
22418
- const [fd, pd] = [
22419
- file[fdi],
22420
- pattern[pdi]
22421
- ];
20631
+ const [fd, pd] = [file[fdi], pattern[pdi]];
22422
20632
  if (fd.toLowerCase() === pd.toLowerCase()) {
22423
20633
  pattern[pdi] = fd;
22424
- patternStartIndex = pdi;
22425
- fileStartIndex = fdi;
20634
+ if (pdi > fdi) {
20635
+ pattern = pattern.slice(pdi);
20636
+ } else if (fdi > pdi) {
20637
+ file = file.slice(fdi);
20638
+ }
22426
20639
  }
22427
20640
  }
22428
20641
  }
@@ -22430,118 +20643,53 @@ class Minimatch {
22430
20643
  if (optimizationLevel >= 2) {
22431
20644
  file = this.levelTwoFileOptimize(file);
22432
20645
  }
22433
- if (pattern.includes(GLOBSTAR)) {
22434
- return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
22435
- }
22436
- return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
22437
- }
22438
- #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
22439
- const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
22440
- const lastgs = pattern.lastIndexOf(GLOBSTAR);
22441
- const [head, body, tail] = partial ? [
22442
- pattern.slice(patternIndex, firstgs),
22443
- pattern.slice(firstgs + 1),
22444
- []
22445
- ] : [
22446
- pattern.slice(patternIndex, firstgs),
22447
- pattern.slice(firstgs + 1, lastgs),
22448
- pattern.slice(lastgs + 1)
22449
- ];
22450
- if (head.length) {
22451
- const fileHead = file.slice(fileIndex, fileIndex + head.length);
22452
- if (!this.#matchOne(fileHead, head, partial, 0, 0))
22453
- return false;
22454
- fileIndex += head.length;
22455
- }
22456
- let fileTailMatch = 0;
22457
- if (tail.length) {
22458
- if (tail.length + fileIndex > file.length)
20646
+ this.debug("matchOne", this, { file, pattern });
20647
+ this.debug("matchOne", file.length, pattern.length);
20648
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
20649
+ this.debug("matchOne loop");
20650
+ var p = pattern[pi];
20651
+ var f = file[fi];
20652
+ this.debug(pattern, p, f);
20653
+ if (p === false) {
22459
20654
  return false;
22460
- let tailStart = file.length - tail.length;
22461
- if (this.#matchOne(file, tail, partial, tailStart, 0)) {
22462
- fileTailMatch = tail.length;
22463
- } else {
22464
- if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
22465
- return false;
22466
- }
22467
- tailStart--;
22468
- if (!this.#matchOne(file, tail, partial, tailStart, 0))
22469
- return false;
22470
- fileTailMatch = tail.length + 1;
22471
20655
  }
22472
- }
22473
- if (!body.length) {
22474
- let sawSome = !!fileTailMatch;
22475
- for (let i2 = fileIndex;i2 < file.length - fileTailMatch; i2++) {
22476
- const f = String(file[i2]);
22477
- sawSome = true;
22478
- if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
22479
- return false;
20656
+ if (p === GLOBSTAR) {
20657
+ this.debug("GLOBSTAR", [pattern, p, f]);
20658
+ var fr = fi;
20659
+ var pr = pi + 1;
20660
+ if (pr === pl) {
20661
+ this.debug("** at the end");
20662
+ for (;fi < fl; fi++) {
20663
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
20664
+ return false;
20665
+ }
20666
+ return true;
22480
20667
  }
22481
- }
22482
- return partial || sawSome;
22483
- }
22484
- const bodySegments = [[[], 0]];
22485
- let currentBody = bodySegments[0];
22486
- let nonGsParts = 0;
22487
- const nonGsPartsSums = [0];
22488
- for (const b of body) {
22489
- if (b === GLOBSTAR) {
22490
- nonGsPartsSums.push(nonGsParts);
22491
- currentBody = [[], 0];
22492
- bodySegments.push(currentBody);
22493
- } else {
22494
- currentBody[0].push(b);
22495
- nonGsParts++;
22496
- }
22497
- }
22498
- let i = bodySegments.length - 1;
22499
- const fileLength = file.length - fileTailMatch;
22500
- for (const b of bodySegments) {
22501
- b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
22502
- }
22503
- return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
22504
- }
22505
- #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
22506
- const bs = bodySegments[bodyIndex];
22507
- if (!bs) {
22508
- for (let i = fileIndex;i < file.length; i++) {
22509
- sawTail = true;
22510
- const f = file[i];
22511
- if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
22512
- return false;
20668
+ while (fr < fl) {
20669
+ var swallowee = file[fr];
20670
+ this.debug(`
20671
+ globstar while`, file, fr, pattern, pr, swallowee);
20672
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
20673
+ this.debug("globstar found match!", fr, fl, swallowee);
20674
+ return true;
20675
+ } else {
20676
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
20677
+ this.debug("dot detected!", file, fr, pattern, pr);
20678
+ break;
20679
+ }
20680
+ this.debug("globstar swallow a segment, and continue");
20681
+ fr++;
20682
+ }
20683
+ }
20684
+ if (partial) {
20685
+ this.debug(`
20686
+ >>> no match, partial?`, file, fr, pattern, pr);
20687
+ if (fr === fl) {
20688
+ return true;
20689
+ }
22513
20690
  }
22514
- }
22515
- return sawTail;
22516
- }
22517
- const [body, after] = bs;
22518
- while (fileIndex <= after) {
22519
- const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
22520
- if (m && globStarDepth < this.maxGlobstarRecursion) {
22521
- const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
22522
- if (sub !== false)
22523
- return sub;
22524
- }
22525
- const f = file[fileIndex];
22526
- if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
22527
20691
  return false;
22528
20692
  }
22529
- fileIndex++;
22530
- }
22531
- return partial || null;
22532
- }
22533
- #matchOne(file, pattern, partial, fileIndex, patternIndex) {
22534
- let fi;
22535
- let pi;
22536
- let pl;
22537
- let fl;
22538
- for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
22539
- this.debug("matchOne loop");
22540
- let p = pattern[pi];
22541
- let f = file[fi];
22542
- this.debug(pattern, p, f);
22543
- if (p === false || p === GLOBSTAR)
22544
- return false;
22545
20693
  let hit;
22546
20694
  if (typeof p === "string") {
22547
20695
  hit = f === p;
@@ -27408,6 +25556,7 @@ function parsePo(content) {
27408
25556
  let msgid = "";
27409
25557
  let msgstr = "";
27410
25558
  let obsolete = false;
25559
+ let inManual = false;
27411
25560
  const flush = () => {
27412
25561
  if (msgid) {
27413
25562
  entries.push({
@@ -27415,7 +25564,8 @@ function parsePo(content) {
27415
25564
  msgstr,
27416
25565
  locations,
27417
25566
  hash: hash || hashMsgid(msgid),
27418
- obsolete
25567
+ obsolete,
25568
+ ...inManual ? { manual: true } : {}
27419
25569
  });
27420
25570
  }
27421
25571
  locations = [];
@@ -27426,6 +25576,16 @@ function parsePo(content) {
27426
25576
  };
27427
25577
  for (const line of lines) {
27428
25578
  const trimmed = line.trim();
25579
+ if (trimmed === "# manual") {
25580
+ inManual = true;
25581
+ continue;
25582
+ }
25583
+ if (trimmed === "# end manual") {
25584
+ if (msgid)
25585
+ flush();
25586
+ inManual = false;
25587
+ continue;
25588
+ }
27429
25589
  if (trimmed === "" || trimmed.startsWith("#,")) {
27430
25590
  if (msgid)
27431
25591
  flush();
@@ -27468,8 +25628,19 @@ function parsePo(content) {
27468
25628
  }
27469
25629
  function writePo(entries) {
27470
25630
  const lines = [];
27471
- const active = entries.filter((e) => !e.obsolete);
25631
+ const manual = entries.filter((e) => e.manual);
25632
+ const active = entries.filter((e) => !e.obsolete && !e.manual);
27472
25633
  const obsolete = entries.filter((e) => e.obsolete);
25634
+ if (manual.length > 0) {
25635
+ lines.push("# manual");
25636
+ for (const entry of manual) {
25637
+ lines.push(`msgid ${quoteString(entry.msgid)}`);
25638
+ lines.push(`msgstr ${quoteString(entry.msgstr)}`);
25639
+ lines.push("");
25640
+ }
25641
+ lines.push("# end manual");
25642
+ lines.push("");
25643
+ }
27473
25644
  for (const entry of active) {
27474
25645
  for (const loc of entry.locations) {
27475
25646
  lines.push(`#: ${loc}`);
@@ -27496,10 +25667,14 @@ function mergeCatalog(existing, extracted) {
27496
25667
  for (const entry of existing) {
27497
25668
  existingMap.set(entry.msgid, entry);
27498
25669
  }
25670
+ const manualEntries = existing.filter((e) => e.manual);
25671
+ const manualIds = new Set(manualEntries.map((e) => e.msgid));
27499
25672
  const result = [];
27500
25673
  const seen = new Set;
27501
25674
  for (const [msgid, locations] of extracted) {
27502
25675
  seen.add(msgid);
25676
+ if (manualIds.has(msgid))
25677
+ continue;
27503
25678
  const prev = existingMap.get(msgid);
27504
25679
  result.push({
27505
25680
  msgid,
@@ -27510,7 +25685,7 @@ function mergeCatalog(existing, extracted) {
27510
25685
  });
27511
25686
  }
27512
25687
  for (const entry of existing) {
27513
- if (!seen.has(entry.msgid) && !entry.obsolete && entry.msgstr) {
25688
+ if (!seen.has(entry.msgid) && !entry.obsolete && !entry.manual && entry.msgstr) {
27514
25689
  result.push({
27515
25690
  ...entry,
27516
25691
  obsolete: true,
@@ -27518,7 +25693,8 @@ function mergeCatalog(existing, extracted) {
27518
25693
  });
27519
25694
  }
27520
25695
  }
27521
- return result;
25696
+ result.sort((a, b) => a.msgid.localeCompare(b.msgid));
25697
+ return [...manualEntries, ...result];
27522
25698
  }
27523
25699
  function extractQuoted(s) {
27524
25700
  const trimmed = s.trim();
@@ -27545,7 +25721,11 @@ function compileCatalog(poPath) {
27545
25721
  result[entry.msgid] = entry.msgstr;
27546
25722
  }
27547
25723
  }
27548
- return result;
25724
+ const sorted = {};
25725
+ for (const key of Object.keys(result).sort()) {
25726
+ sorted[key] = result[key];
25727
+ }
25728
+ return sorted;
27549
25729
  }
27550
25730
  function compileAllCatalogs(localesDir, outDir) {
27551
25731
  mkdirSync3(outDir, { recursive: true });
@@ -27751,8 +25931,11 @@ async function buildPackages(rootDir, outDir, packages) {
27751
25931
  const tmpDir = join6(outDir, "_entries");
27752
25932
  mkdirSync5(tmpDir, { recursive: true });
27753
25933
  const entrypoints = [];
25934
+ const fileToName = new Map;
27754
25935
  for (const pkg of packages) {
27755
25936
  const safeName = pkg.path.split("/").pop();
25937
+ const moduleName = pkg.name.includes("/") ? pkg.name.split("/").pop() : pkg.name;
25938
+ fileToName.set(safeName, moduleName);
27756
25939
  const wrapperFile = join6(tmpDir, `${safeName}.ts`);
27757
25940
  writeFileSync5(wrapperFile, `export * from "${pkg.name}";
27758
25941
  `);
@@ -27792,9 +25975,13 @@ async function buildPackages(rootDir, outDir, packages) {
27792
25975
  await finalizeTranslations(rootDir, join6(outDir, ".."), i18nCollector);
27793
25976
  const { rmSync } = await import("node:fs");
27794
25977
  rmSync(tmpDir, { recursive: true, force: true });
27795
- const moduleFiles = result.outputs.filter((o) => o.kind === "entry-point").map((o) => o.path.split("/").pop());
25978
+ const moduleEntries = result.outputs.filter((o) => o.kind === "entry-point").map((o) => {
25979
+ const file = o.path.split("/").pop();
25980
+ const safeName = file.replace(/\.js$/, "");
25981
+ return { file, name: fileToName.get(safeName) ?? safeName };
25982
+ });
27796
25983
  const manifest = {
27797
- modules: moduleFiles,
25984
+ modules: moduleEntries,
27798
25985
  buildTime: new Date().toISOString()
27799
25986
  };
27800
25987
  writeFileSync5(join6(outDir, "manifest.json"), JSON.stringify(manifest, null, 2));
@@ -27945,11 +26132,28 @@ async function buildAll(ws) {
27945
26132
  }
27946
26133
  }
27947
26134
  log2("Building shell...");
27948
- await buildShell(ws.shellDir);
26135
+ await buildShell(ws.shellDir, ws.packages);
27949
26136
  ok("Shell built");
27950
26137
  return manifest;
27951
26138
  }
27952
- async function buildShell(outDir) {
26139
+ function collectArcPeerDeps(packages) {
26140
+ const seen = new Set;
26141
+ for (const pkg of ["@arcote.tech/arc", "@arcote.tech/arc-ds", "@arcote.tech/arc-react", "@arcote.tech/platform"]) {
26142
+ seen.add(pkg);
26143
+ }
26144
+ for (const wp of packages) {
26145
+ const peerDeps = wp.packageJson.peerDependencies ?? {};
26146
+ for (const dep of Object.keys(peerDeps)) {
26147
+ if (dep.startsWith("@arcote.tech/"))
26148
+ seen.add(dep);
26149
+ }
26150
+ }
26151
+ return [...seen].map((pkg) => {
26152
+ const short = pkg === "@arcote.tech/platform" ? "platform" : pkg.replace("@arcote.tech/", "");
26153
+ return [short, pkg];
26154
+ });
26155
+ }
26156
+ async function buildShell(outDir, packages) {
27953
26157
  mkdirSync6(outDir, { recursive: true });
27954
26158
  const tmpDir = join7(outDir, "_tmp");
27955
26159
  mkdirSync6(tmpDir, { recursive: true });
@@ -28002,46 +26206,45 @@ export const { createPortal, flushSync } = ReactDOM;`
28002
26206
  console.error(l);
28003
26207
  throw new Error("Shell React build failed");
28004
26208
  }
28005
- const arcEntries = [
26209
+ const arcEntries = packages ? collectArcPeerDeps(packages) : [
28006
26210
  ["arc", "@arcote.tech/arc"],
28007
26211
  ["arc-ds", "@arcote.tech/arc-ds"],
28008
26212
  ["arc-react", "@arcote.tech/arc-react"],
28009
- ["arc-auth", "@arcote.tech/arc-auth"],
28010
- ["arc-utils", "@arcote.tech/arc-utils"],
28011
- ["arc-workspace", "@arcote.tech/arc-workspace"],
28012
26213
  ["platform", "@arcote.tech/platform"]
28013
26214
  ];
28014
- const arcEps = [];
26215
+ const baseExternal = [
26216
+ "react",
26217
+ "react-dom",
26218
+ "react/jsx-runtime",
26219
+ "react/jsx-dev-runtime",
26220
+ "react-dom/client"
26221
+ ];
26222
+ const allArcPkgs = arcEntries.map(([, pkg]) => pkg);
28015
26223
  for (const [name, pkg] of arcEntries) {
28016
26224
  const f = join7(tmpDir, `${name}.ts`);
28017
26225
  Bun.write(f, `export * from "${pkg}";
28018
26226
  `);
28019
- arcEps.push(f);
28020
- }
28021
- const r2 = await Bun.build({
28022
- entrypoints: arcEps,
28023
- outdir: outDir,
28024
- splitting: true,
28025
- format: "esm",
28026
- target: "browser",
28027
- naming: "[name].[ext]",
28028
- external: [
28029
- "react",
28030
- "react-dom",
28031
- "react/jsx-runtime",
28032
- "react/jsx-dev-runtime",
28033
- "react-dom/client"
28034
- ],
28035
- define: {
28036
- ONLY_SERVER: "false",
28037
- ONLY_BROWSER: "true",
28038
- ONLY_CLIENT: "true"
26227
+ const r2 = await Bun.build({
26228
+ entrypoints: [f],
26229
+ outdir: outDir,
26230
+ format: "esm",
26231
+ target: "browser",
26232
+ naming: "[name].[ext]",
26233
+ external: [
26234
+ ...baseExternal,
26235
+ ...allArcPkgs.filter((p) => p !== pkg)
26236
+ ],
26237
+ define: {
26238
+ ONLY_SERVER: "false",
26239
+ ONLY_BROWSER: "true",
26240
+ ONLY_CLIENT: "true"
26241
+ }
26242
+ });
26243
+ if (!r2.success) {
26244
+ for (const l of r2.logs)
26245
+ console.error(l);
26246
+ throw new Error(`Shell build failed for ${pkg}`);
28039
26247
  }
28040
- });
28041
- if (!r2.success) {
28042
- for (const l of r2.logs)
28043
- console.error(l);
28044
- throw new Error("Shell Arc build failed");
28045
26248
  }
28046
26249
  const { rmSync } = await import("node:fs");
28047
26250
  rmSync(tmpDir, { recursive: true, force: true });
@@ -28049,7 +26252,7 @@ export const { createPortal, flushSync } = ReactDOM;`
28049
26252
  async function loadServerContext(packages) {
28050
26253
  const ctxPackages = packages.filter((p) => isContextPackage(p.packageJson));
28051
26254
  if (ctxPackages.length === 0)
28052
- return null;
26255
+ return { context: null, moduleAccess: new Map };
28053
26256
  globalThis.ONLY_SERVER = true;
28054
26257
  globalThis.ONLY_BROWSER = false;
28055
26258
  globalThis.ONLY_CLIENT = false;
@@ -28069,8 +26272,17 @@ async function loadServerContext(packages) {
28069
26272
  err(`Failed to load server context from ${ctx.name}: ${e}`);
28070
26273
  }
28071
26274
  }
28072
- const { getContext } = await import(platformEntry);
28073
- return getContext() ?? null;
26275
+ const nonCtxPackages = packages.filter((p) => !isContextPackage(p.packageJson));
26276
+ for (const pkg of nonCtxPackages) {
26277
+ try {
26278
+ await import(pkg.entrypoint);
26279
+ } catch {}
26280
+ }
26281
+ const { getContext, getAllModuleAccess } = await import(platformEntry);
26282
+ return {
26283
+ context: getContext() ?? null,
26284
+ moduleAccess: getAllModuleAccess()
26285
+ };
28074
26286
  }
28075
26287
 
28076
26288
  // src/commands/platform-build.ts
@@ -28279,8 +26491,33 @@ class ContextHandler {
28279
26491
  if (this.initialized)
28280
26492
  return;
28281
26493
  await this.model.init();
26494
+ await this.runSeeds();
28282
26495
  this.initialized = true;
28283
26496
  }
26497
+ async runSeeds() {
26498
+ for (const element of this.context.elements) {
26499
+ if (!("getSeeds" in element))
26500
+ continue;
26501
+ const seedInfo = element.getSeeds();
26502
+ if (!seedInfo)
26503
+ continue;
26504
+ const { data, idFactory } = seedInfo;
26505
+ const tableName = element.name;
26506
+ const store = this.dataStorage.getStore(tableName);
26507
+ const existing = await store.find({});
26508
+ if (existing.length > 0)
26509
+ continue;
26510
+ const changes = data.map((row) => ({
26511
+ type: "set",
26512
+ data: {
26513
+ ...row,
26514
+ _id: row._id ?? idFactory.generate()
26515
+ }
26516
+ }));
26517
+ await store.applyChanges(changes);
26518
+ console.log(`[ARC:Seed] Seeded ${data.length} row(s) into ${tableName}`);
26519
+ }
26520
+ }
28284
26521
  async executeCommand(commandName, params, rawToken) {
28285
26522
  const scoped = new ScopedModel(this.model, "request");
28286
26523
  if (rawToken)
@@ -29368,7 +27605,7 @@ async function createArcServer(config) {
29368
27605
  const corsHeaders = {
29369
27606
  "Access-Control-Allow-Origin": "*",
29370
27607
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
29371
- "Access-Control-Allow-Headers": "Content-Type, Authorization, X-Arc-Scope"
27608
+ "Access-Control-Allow-Headers": "Content-Type, Authorization, X-Arc-Scope, X-Arc-Tokens"
29372
27609
  };
29373
27610
  function verifyToken(token) {
29374
27611
  try {
@@ -29487,7 +27724,13 @@ async function createArcServer(config) {
29487
27724
  // src/platform/server.ts
29488
27725
  import { existsSync as existsSync7, mkdirSync as mkdirSync7 } from "node:fs";
29489
27726
  import { join as join8 } from "node:path";
29490
- function generateShellHtml(appName, manifest) {
27727
+ function generateShellHtml(appName, manifest, arcEntries) {
27728
+ const arcImports = {};
27729
+ if (arcEntries) {
27730
+ for (const [short, pkg] of arcEntries) {
27731
+ arcImports[pkg] = `/shell/${short}.js`;
27732
+ }
27733
+ }
29491
27734
  const importMap = {
29492
27735
  imports: {
29493
27736
  react: "/shell/react.js",
@@ -29495,13 +27738,7 @@ function generateShellHtml(appName, manifest) {
29495
27738
  "react/jsx-dev-runtime": "/shell/jsx-dev-runtime.js",
29496
27739
  "react-dom": "/shell/react-dom.js",
29497
27740
  "react-dom/client": "/shell/react-dom-client.js",
29498
- "@arcote.tech/arc": "/shell/arc.js",
29499
- "@arcote.tech/arc-ds": "/shell/arc-ds.js",
29500
- "@arcote.tech/arc-react": "/shell/arc-react.js",
29501
- "@arcote.tech/arc-auth": "/shell/arc-auth.js",
29502
- "@arcote.tech/arc-utils": "/shell/arc-utils.js",
29503
- "@arcote.tech/arc-workspace": "/shell/arc-workspace.js",
29504
- "@arcote.tech/platform": "/shell/platform.js"
27741
+ ...arcImports
29505
27742
  }
29506
27743
  };
29507
27744
  return `<!doctype html>
@@ -29555,16 +27792,109 @@ function serveFile(filePath, headers = {}) {
29555
27792
  headers: { "Content-Type": getMime(filePath), ...headers }
29556
27793
  });
29557
27794
  }
29558
- function staticFilesHandler(ws, devMode) {
27795
+ var MODULE_SIG_SECRET = process.env.ARC_MODULE_SECRET ?? crypto.randomUUID();
27796
+ var MODULE_SIG_TTL = 3600;
27797
+ function signModuleUrl(filename) {
27798
+ const exp = Math.floor(Date.now() / 1000) + MODULE_SIG_TTL;
27799
+ const hasher = new Bun.CryptoHasher("sha256");
27800
+ hasher.update(`${filename}:${exp}:${MODULE_SIG_SECRET}`);
27801
+ const sig = hasher.digest("hex").slice(0, 16);
27802
+ return `/modules/${filename}?sig=${sig}&exp=${exp}`;
27803
+ }
27804
+ function verifyModuleSignature(filename, sig, exp) {
27805
+ if (!sig || !exp)
27806
+ return false;
27807
+ if (Number(exp) < Date.now() / 1000)
27808
+ return false;
27809
+ const hasher = new Bun.CryptoHasher("sha256");
27810
+ hasher.update(`${filename}:${exp}:${MODULE_SIG_SECRET}`);
27811
+ return hasher.digest("hex").slice(0, 16) === sig;
27812
+ }
27813
+ function decodeTokenPayload(jwt2) {
27814
+ try {
27815
+ const parts = jwt2.split(".");
27816
+ if (parts.length !== 3)
27817
+ return null;
27818
+ const payload = JSON.parse(atob(parts[1]));
27819
+ return {
27820
+ tokenType: payload.tokenName ?? payload.tokenType,
27821
+ params: payload.params || {},
27822
+ iat: payload.iat,
27823
+ exp: payload.exp
27824
+ };
27825
+ } catch {
27826
+ return null;
27827
+ }
27828
+ }
27829
+ function parseArcTokensHeader(header) {
27830
+ if (!header)
27831
+ return [];
27832
+ const payloads = [];
27833
+ for (const entry of header.split(",")) {
27834
+ const colonIdx = entry.indexOf(":");
27835
+ if (colonIdx < 0)
27836
+ continue;
27837
+ const jwt2 = entry.slice(colonIdx + 1);
27838
+ const payload = decodeTokenPayload(jwt2);
27839
+ if (payload)
27840
+ payloads.push(payload);
27841
+ }
27842
+ return payloads;
27843
+ }
27844
+ async function filterManifestForTokens(manifest, moduleAccessMap, tokenPayloads) {
27845
+ const filtered = [];
27846
+ console.log(`[arc:modules] Filtering ${manifest.modules.length} modules with ${tokenPayloads.length} token(s):`, tokenPayloads.map((t) => `${t.tokenType}(${JSON.stringify(t.params)})`).join(", ") || "none");
27847
+ console.log(`[arc:modules] Protected modules:`, [...moduleAccessMap.keys()].join(", ") || "none");
27848
+ for (const mod of manifest.modules) {
27849
+ const access = moduleAccessMap.get(mod.name);
27850
+ if (!access) {
27851
+ filtered.push(mod);
27852
+ continue;
27853
+ }
27854
+ if (tokenPayloads.length === 0) {
27855
+ console.log(`[arc:modules] ${mod.name}: SKIP (no tokens)`);
27856
+ continue;
27857
+ }
27858
+ let granted = false;
27859
+ for (const rule of access.rules) {
27860
+ const matching = tokenPayloads.find((t) => t.tokenType === rule.token.name);
27861
+ if (matching) {
27862
+ granted = rule.check ? await rule.check(matching) : true;
27863
+ console.log(`[arc:modules] ${mod.name}: rule ${rule.token.name} matched token, check=${granted}`);
27864
+ if (granted)
27865
+ break;
27866
+ } else {
27867
+ console.log(`[arc:modules] ${mod.name}: rule needs "${rule.token.name}", no matching token (have: ${tokenPayloads.map((t) => t.tokenType).join(",")})`);
27868
+ }
27869
+ }
27870
+ if (granted) {
27871
+ filtered.push({ ...mod, url: signModuleUrl(mod.file) });
27872
+ }
27873
+ }
27874
+ console.log(`[arc:modules] Result: ${filtered.map((m2) => m2.name).join(", ")}`);
27875
+ return { modules: filtered, buildTime: manifest.buildTime };
27876
+ }
27877
+ function staticFilesHandler(ws, devMode, moduleAccessMap) {
29559
27878
  return (_req, url, ctx) => {
29560
27879
  const path4 = url.pathname;
29561
27880
  if (path4.startsWith("/shell/"))
29562
27881
  return serveFile(join8(ws.shellDir, path4.slice(7)), ctx.corsHeaders);
29563
- if (path4.startsWith("/modules/"))
29564
- return serveFile(join8(ws.modulesDir, path4.slice(9)), {
27882
+ if (path4.startsWith("/modules/")) {
27883
+ const fileWithParams = path4.slice(9);
27884
+ const filename = fileWithParams.split("?")[0];
27885
+ const moduleName = filename.replace(/\.js$/, "");
27886
+ if (moduleAccessMap.has(moduleName)) {
27887
+ const sig = url.searchParams.get("sig");
27888
+ const exp = url.searchParams.get("exp");
27889
+ if (!verifyModuleSignature(filename, sig, exp)) {
27890
+ return new Response("Forbidden", { status: 403, headers: ctx.corsHeaders });
27891
+ }
27892
+ }
27893
+ return serveFile(join8(ws.modulesDir, filename), {
29565
27894
  ...ctx.corsHeaders,
29566
27895
  "Cache-Control": devMode ? "no-cache" : "max-age=31536000,immutable"
29567
27896
  });
27897
+ }
29568
27898
  if (path4.startsWith("/locales/"))
29569
27899
  return serveFile(join8(ws.arcDir, path4.slice(1)), ctx.corsHeaders);
29570
27900
  if (path4 === "/styles.css")
@@ -29582,10 +27912,16 @@ function staticFilesHandler(ws, devMode) {
29582
27912
  return null;
29583
27913
  };
29584
27914
  }
29585
- function apiEndpointsHandler(ws, getManifest, cm) {
29586
- return (_req, url, ctx) => {
29587
- if (url.pathname === "/api/modules")
29588
- return Response.json(getManifest(), { headers: ctx.corsHeaders });
27915
+ function apiEndpointsHandler(ws, getManifest, cm, moduleAccessMap) {
27916
+ return (req, url, ctx) => {
27917
+ if (url.pathname === "/api/modules") {
27918
+ const arcTokensHeader = req.headers.get("X-Arc-Tokens");
27919
+ let payloads = parseArcTokensHeader(arcTokensHeader);
27920
+ if (payloads.length === 0 && ctx.tokenPayload) {
27921
+ payloads = [ctx.tokenPayload];
27922
+ }
27923
+ return filterManifestForTokens(getManifest(), moduleAccessMap, payloads).then((filtered) => Response.json(filtered, { headers: ctx.corsHeaders }));
27924
+ }
29589
27925
  if (url.pathname === "/api/translations") {
29590
27926
  const config = readTranslationsConfig(ws.rootDir);
29591
27927
  return Response.json(config ?? { locales: [], sourceLocale: "" }, {
@@ -29636,15 +27972,16 @@ function spaFallbackHandler(shellHtml) {
29636
27972
  }
29637
27973
  async function startPlatformServer(opts) {
29638
27974
  const { ws, port, devMode, context } = opts;
27975
+ const moduleAccessMap = opts.moduleAccess ?? new Map;
29639
27976
  let manifest = opts.manifest;
29640
27977
  const getManifest = () => manifest;
29641
- const shellHtml = generateShellHtml(ws.appName, ws.manifest);
27978
+ const shellHtml = generateShellHtml(ws.appName, ws.manifest, opts.arcEntries);
29642
27979
  const sseClients = new Set;
29643
27980
  if (!context) {
29644
27981
  const cors = {
29645
27982
  "Access-Control-Allow-Origin": "*",
29646
27983
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
29647
- "Access-Control-Allow-Headers": "Content-Type, Authorization"
27984
+ "Access-Control-Allow-Headers": "Content-Type, Authorization, X-Arc-Tokens"
29648
27985
  };
29649
27986
  const server = Bun.serve({
29650
27987
  port,
@@ -29658,9 +27995,9 @@ async function startPlatformServer(opts) {
29658
27995
  corsHeaders: cors
29659
27996
  };
29660
27997
  const handlers = [
29661
- apiEndpointsHandler(ws, getManifest, null),
27998
+ apiEndpointsHandler(ws, getManifest, null, moduleAccessMap),
29662
27999
  ...devMode ? [devReloadHandler(sseClients)] : [],
29663
- staticFilesHandler(ws, !!devMode),
28000
+ staticFilesHandler(ws, !!devMode, moduleAccessMap),
29664
28001
  spaFallbackHandler(shellHtml)
29665
28002
  ];
29666
28003
  for (const handler of handlers) {
@@ -29705,9 +28042,9 @@ async function startPlatformServer(opts) {
29705
28042
  dbAdapterFactory: createBunSQLiteAdapterFactory2(dbPath),
29706
28043
  port,
29707
28044
  httpHandlers: [
29708
- apiEndpointsHandler(ws, getManifest, null),
28045
+ apiEndpointsHandler(ws, getManifest, null, moduleAccessMap),
29709
28046
  ...devMode ? [devReloadHandler(sseClients)] : [],
29710
- staticFilesHandler(ws, !!devMode),
28047
+ staticFilesHandler(ws, !!devMode, moduleAccessMap),
29711
28048
  spaFallbackHandler(shellHtml)
29712
28049
  ],
29713
28050
  onWsClose: (clientId) => cleanupClientSubs(clientId)
@@ -29741,19 +28078,22 @@ async function platformDev() {
29741
28078
  const port = 5005;
29742
28079
  let manifest = await buildAll(ws);
29743
28080
  log2("Loading server context...");
29744
- const context = await loadServerContext(ws.packages);
28081
+ const { context, moduleAccess } = await loadServerContext(ws.packages);
29745
28082
  if (context) {
29746
28083
  ok("Context loaded");
29747
28084
  } else {
29748
28085
  log2("No context \u2014 server endpoints skipped");
29749
28086
  }
28087
+ const arcEntries = collectArcPeerDeps(ws.packages);
29750
28088
  const platform3 = await startPlatformServer({
29751
28089
  ws,
29752
28090
  port,
29753
28091
  manifest,
29754
28092
  context,
28093
+ moduleAccess,
29755
28094
  dbPath: join9(ws.rootDir, ".arc", "data", "dev.db"),
29756
- devMode: true
28095
+ devMode: true,
28096
+ arcEntries
29757
28097
  });
29758
28098
  ok(`Server on http://localhost:${port}`);
29759
28099
  if (platform3.contextHandler)
@@ -29831,19 +28171,22 @@ async function platformStart() {
29831
28171
  }
29832
28172
  const manifest = JSON.parse(readFileSync7(manifestPath, "utf-8"));
29833
28173
  log2("Loading server context...");
29834
- const context = await loadServerContext(ws.packages);
28174
+ const { context, moduleAccess } = await loadServerContext(ws.packages);
29835
28175
  if (context) {
29836
28176
  ok("Context loaded");
29837
28177
  } else {
29838
28178
  log2("No context \u2014 server endpoints skipped");
29839
28179
  }
28180
+ const arcEntries = collectArcPeerDeps(ws.packages);
29840
28181
  const platform3 = await startPlatformServer({
29841
28182
  ws,
29842
28183
  port,
29843
28184
  manifest,
29844
28185
  context,
28186
+ moduleAccess,
29845
28187
  dbPath: join10(ws.rootDir, ".arc", "data", "prod.db"),
29846
- devMode: false
28188
+ devMode: false,
28189
+ arcEntries
29847
28190
  });
29848
28191
  ok(`Server on http://localhost:${port}`);
29849
28192
  if (platform3.contextHandler)