@qodalis/cli-core 2.0.0-beta.8 → 2.0.0-rc.1

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/public-api.mjs CHANGED
@@ -5,7 +5,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
8
+ try {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ } catch (e) {
11
+ throw mod = 0, e;
12
+ }
9
13
  };
10
14
  var __copyProps = (to, from, except, desc) => {
11
15
  if (from && typeof from === "object" || typeof from === "function") {
@@ -24,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
28
  mod
25
29
  ));
26
30
 
27
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
31
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
28
32
  var require_constants = __commonJS({
29
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js"(exports$1, module) {
33
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
30
34
  var SEMVER_SPEC_VERSION = "2.0.0";
31
35
  var MAX_LENGTH = 256;
32
36
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
@@ -55,30 +59,30 @@ var require_constants = __commonJS({
55
59
  }
56
60
  });
57
61
 
58
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js
62
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
59
63
  var require_debug = __commonJS({
60
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js"(exports$1, module) {
64
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
61
65
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
62
66
  };
63
67
  module.exports = debug;
64
68
  }
65
69
  });
66
70
 
67
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js
71
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
68
72
  var require_re = __commonJS({
69
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js"(exports$1, module) {
73
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
70
74
  var {
71
75
  MAX_SAFE_COMPONENT_LENGTH,
72
76
  MAX_SAFE_BUILD_LENGTH,
73
77
  MAX_LENGTH
74
78
  } = require_constants();
75
79
  var debug = require_debug();
76
- exports$1 = module.exports = {};
77
- var re = exports$1.re = [];
78
- var safeRe = exports$1.safeRe = [];
79
- var src = exports$1.src = [];
80
- var safeSrc = exports$1.safeSrc = [];
81
- var t = exports$1.t = {};
80
+ exports = module.exports = {};
81
+ var re = exports.re = [];
82
+ var safeRe = exports.safeRe = [];
83
+ var src = exports.src = [];
84
+ var safeSrc = exports.safeSrc = [];
85
+ var t = exports.t = {};
82
86
  var R = 0;
83
87
  var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
84
88
  var safeRegexReplacements = [
@@ -131,18 +135,18 @@ var require_re = __commonJS({
131
135
  createToken("COERCERTLFULL", src[t.COERCEFULL], true);
132
136
  createToken("LONETILDE", "(?:~>?)");
133
137
  createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
134
- exports$1.tildeTrimReplace = "$1~";
138
+ exports.tildeTrimReplace = "$1~";
135
139
  createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
136
140
  createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
137
141
  createToken("LONECARET", "(?:\\^)");
138
142
  createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
139
- exports$1.caretTrimReplace = "$1^";
143
+ exports.caretTrimReplace = "$1^";
140
144
  createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
141
145
  createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
142
146
  createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
143
147
  createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
144
148
  createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
145
- exports$1.comparatorTrimReplace = "$1$2$3";
149
+ exports.comparatorTrimReplace = "$1$2$3";
146
150
  createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
147
151
  createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
148
152
  createToken("STAR", "(<|>)?=?\\s*\\*");
@@ -151,9 +155,9 @@ var require_re = __commonJS({
151
155
  }
152
156
  });
153
157
 
154
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js
158
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
155
159
  var require_parse_options = __commonJS({
156
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js"(exports$1, module) {
160
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
157
161
  var looseOption = Object.freeze({ loose: true });
158
162
  var emptyOpts = Object.freeze({});
159
163
  var parseOptions = (options) => {
@@ -169,9 +173,9 @@ var require_parse_options = __commonJS({
169
173
  }
170
174
  });
171
175
 
172
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js
176
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
173
177
  var require_identifiers = __commonJS({
174
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports$1, module) {
178
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
175
179
  var numeric = /^[0-9]+$/;
176
180
  var compareIdentifiers = (a, b) => {
177
181
  if (typeof a === "number" && typeof b === "number") {
@@ -193,14 +197,26 @@ var require_identifiers = __commonJS({
193
197
  }
194
198
  });
195
199
 
196
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js
200
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
197
201
  var require_semver = __commonJS({
198
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js"(exports$1, module) {
202
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
199
203
  var debug = require_debug();
200
204
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
201
205
  var { safeRe: re, t } = require_re();
202
206
  var parseOptions = require_parse_options();
203
207
  var { compareIdentifiers } = require_identifiers();
208
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
209
+ const identifiers = identifier.split(".");
210
+ if (identifiers.length > prerelease.length) {
211
+ return false;
212
+ }
213
+ for (let i = 0; i < identifiers.length; i++) {
214
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
215
+ return false;
216
+ }
217
+ }
218
+ return true;
219
+ };
204
220
  var SemVer = class _SemVer {
205
221
  constructor(version, options) {
206
222
  options = parseOptions(options);
@@ -447,8 +463,9 @@ var require_semver = __commonJS({
447
463
  if (identifierBase === false) {
448
464
  prerelease = [identifier];
449
465
  }
450
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
451
- if (isNaN(this.prerelease[1])) {
466
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
467
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
468
+ if (isNaN(prereleaseBase)) {
452
469
  this.prerelease = prerelease;
453
470
  }
454
471
  } else {
@@ -471,9 +488,9 @@ var require_semver = __commonJS({
471
488
  }
472
489
  });
473
490
 
474
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
491
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
475
492
  var require_parse = __commonJS({
476
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(exports$1, module) {
493
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
477
494
  var SemVer = require_semver();
478
495
  var parse = (version, options, throwErrors = false) => {
479
496
  if (version instanceof SemVer) {
@@ -492,9 +509,9 @@ var require_parse = __commonJS({
492
509
  }
493
510
  });
494
511
 
495
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
512
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
496
513
  var require_valid = __commonJS({
497
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(exports$1, module) {
514
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
498
515
  var parse = require_parse();
499
516
  var valid2 = (version, options) => {
500
517
  const v = parse(version, options);
@@ -504,9 +521,9 @@ var require_valid = __commonJS({
504
521
  }
505
522
  });
506
523
 
507
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
524
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
508
525
  var require_clean = __commonJS({
509
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(exports$1, module) {
526
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module) {
510
527
  var parse = require_parse();
511
528
  var clean = (version, options) => {
512
529
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
@@ -516,9 +533,9 @@ var require_clean = __commonJS({
516
533
  }
517
534
  });
518
535
 
519
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
536
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
520
537
  var require_inc = __commonJS({
521
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js"(exports$1, module) {
538
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module) {
522
539
  var SemVer = require_semver();
523
540
  var inc = (version, release, options, identifier, identifierBase) => {
524
541
  if (typeof options === "string") {
@@ -539,9 +556,9 @@ var require_inc = __commonJS({
539
556
  }
540
557
  });
541
558
 
542
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
559
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
543
560
  var require_diff = __commonJS({
544
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(exports$1, module) {
561
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module) {
545
562
  var parse = require_parse();
546
563
  var diff = (version1, version2) => {
547
564
  const v1 = parse(version1, null, true);
@@ -582,36 +599,36 @@ var require_diff = __commonJS({
582
599
  }
583
600
  });
584
601
 
585
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
602
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
586
603
  var require_major = __commonJS({
587
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(exports$1, module) {
604
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module) {
588
605
  var SemVer = require_semver();
589
606
  var major = (a, loose) => new SemVer(a, loose).major;
590
607
  module.exports = major;
591
608
  }
592
609
  });
593
610
 
594
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
611
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
595
612
  var require_minor = __commonJS({
596
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(exports$1, module) {
613
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module) {
597
614
  var SemVer = require_semver();
598
615
  var minor = (a, loose) => new SemVer(a, loose).minor;
599
616
  module.exports = minor;
600
617
  }
601
618
  });
602
619
 
603
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
620
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
604
621
  var require_patch = __commonJS({
605
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(exports$1, module) {
622
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module) {
606
623
  var SemVer = require_semver();
607
624
  var patch = (a, loose) => new SemVer(a, loose).patch;
608
625
  module.exports = patch;
609
626
  }
610
627
  });
611
628
 
612
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
629
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
613
630
  var require_prerelease = __commonJS({
614
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(exports$1, module) {
631
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module) {
615
632
  var parse = require_parse();
616
633
  var prerelease = (version, options) => {
617
634
  const parsed = parse(version, options);
@@ -621,36 +638,36 @@ var require_prerelease = __commonJS({
621
638
  }
622
639
  });
623
640
 
624
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
641
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
625
642
  var require_compare = __commonJS({
626
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(exports$1, module) {
643
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
627
644
  var SemVer = require_semver();
628
645
  var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
629
646
  module.exports = compare2;
630
647
  }
631
648
  });
632
649
 
633
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
650
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
634
651
  var require_rcompare = __commonJS({
635
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports$1, module) {
652
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module) {
636
653
  var compare2 = require_compare();
637
654
  var rcompare = (a, b, loose) => compare2(b, a, loose);
638
655
  module.exports = rcompare;
639
656
  }
640
657
  });
641
658
 
642
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
659
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
643
660
  var require_compare_loose = __commonJS({
644
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
661
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
645
662
  var compare2 = require_compare();
646
663
  var compareLoose = (a, b) => compare2(a, b, true);
647
664
  module.exports = compareLoose;
648
665
  }
649
666
  });
650
667
 
651
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
668
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
652
669
  var require_compare_build = __commonJS({
653
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports$1, module) {
670
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module) {
654
671
  var SemVer = require_semver();
655
672
  var compareBuild = (a, b, loose) => {
656
673
  const versionA = new SemVer(a, loose);
@@ -661,81 +678,81 @@ var require_compare_build = __commonJS({
661
678
  }
662
679
  });
663
680
 
664
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
681
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
665
682
  var require_sort = __commonJS({
666
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(exports$1, module) {
683
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module) {
667
684
  var compareBuild = require_compare_build();
668
- var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
685
+ var sort = (list2, loose) => list2.sort((a, b) => compareBuild(a, b, loose));
669
686
  module.exports = sort;
670
687
  }
671
688
  });
672
689
 
673
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
690
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
674
691
  var require_rsort = __commonJS({
675
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports$1, module) {
692
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module) {
676
693
  var compareBuild = require_compare_build();
677
- var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
694
+ var rsort = (list2, loose) => list2.sort((a, b) => compareBuild(b, a, loose));
678
695
  module.exports = rsort;
679
696
  }
680
697
  });
681
698
 
682
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
699
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
683
700
  var require_gt = __commonJS({
684
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(exports$1, module) {
701
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module) {
685
702
  var compare2 = require_compare();
686
703
  var gt = (a, b, loose) => compare2(a, b, loose) > 0;
687
704
  module.exports = gt;
688
705
  }
689
706
  });
690
707
 
691
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
708
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
692
709
  var require_lt = __commonJS({
693
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(exports$1, module) {
710
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module) {
694
711
  var compare2 = require_compare();
695
712
  var lt = (a, b, loose) => compare2(a, b, loose) < 0;
696
713
  module.exports = lt;
697
714
  }
698
715
  });
699
716
 
700
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
717
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
701
718
  var require_eq = __commonJS({
702
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(exports$1, module) {
719
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module) {
703
720
  var compare2 = require_compare();
704
721
  var eq = (a, b, loose) => compare2(a, b, loose) === 0;
705
722
  module.exports = eq;
706
723
  }
707
724
  });
708
725
 
709
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
726
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
710
727
  var require_neq = __commonJS({
711
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(exports$1, module) {
728
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module) {
712
729
  var compare2 = require_compare();
713
730
  var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
714
731
  module.exports = neq;
715
732
  }
716
733
  });
717
734
 
718
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
735
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
719
736
  var require_gte = __commonJS({
720
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports$1, module) {
737
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module) {
721
738
  var compare2 = require_compare();
722
739
  var gte2 = (a, b, loose) => compare2(a, b, loose) >= 0;
723
740
  module.exports = gte2;
724
741
  }
725
742
  });
726
743
 
727
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
744
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
728
745
  var require_lte = __commonJS({
729
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports$1, module) {
746
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module) {
730
747
  var compare2 = require_compare();
731
748
  var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
732
749
  module.exports = lte;
733
750
  }
734
751
  });
735
752
 
736
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
753
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
737
754
  var require_cmp = __commonJS({
738
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js"(exports$1, module) {
755
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module) {
739
756
  var eq = require_eq();
740
757
  var neq = require_neq();
741
758
  var gt = require_gt();
@@ -782,9 +799,9 @@ var require_cmp = __commonJS({
782
799
  }
783
800
  });
784
801
 
785
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
802
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
786
803
  var require_coerce = __commonJS({
787
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports$1, module) {
804
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module) {
788
805
  var SemVer = require_semver();
789
806
  var parse = require_parse();
790
807
  var { safeRe: re, t } = require_re();
@@ -827,9 +844,49 @@ var require_coerce = __commonJS({
827
844
  }
828
845
  });
829
846
 
830
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
847
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
848
+ var require_truncate = __commonJS({
849
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module) {
850
+ var parse = require_parse();
851
+ var constants2 = require_constants();
852
+ var SemVer = require_semver();
853
+ var truncate = (version, truncation, options) => {
854
+ if (!constants2.RELEASE_TYPES.includes(truncation)) {
855
+ return null;
856
+ }
857
+ const clonedVersion = cloneInputVersion(version, options);
858
+ return clonedVersion && doTruncation(clonedVersion, truncation);
859
+ };
860
+ var cloneInputVersion = (version, options) => {
861
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
862
+ return parse(versionStringToParse, options);
863
+ };
864
+ var doTruncation = (version, truncation) => {
865
+ if (isPrerelease(truncation)) {
866
+ return version.version;
867
+ }
868
+ version.prerelease = [];
869
+ switch (truncation) {
870
+ case "major":
871
+ version.minor = 0;
872
+ version.patch = 0;
873
+ break;
874
+ case "minor":
875
+ version.patch = 0;
876
+ break;
877
+ }
878
+ return version.format();
879
+ };
880
+ var isPrerelease = (type) => {
881
+ return type.startsWith("pre");
882
+ };
883
+ module.exports = truncate;
884
+ }
885
+ });
886
+
887
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
831
888
  var require_lrucache = __commonJS({
832
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js"(exports$1, module) {
889
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module) {
833
890
  var LRUCache = class {
834
891
  constructor() {
835
892
  this.max = 1e3;
@@ -864,9 +921,9 @@ var require_lrucache = __commonJS({
864
921
  }
865
922
  });
866
923
 
867
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
924
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
868
925
  var require_range = __commonJS({
869
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js"(exports$1, module) {
926
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module) {
870
927
  var SPACE_CHARACTERS = /\s+/g;
871
928
  var Range = class _Range {
872
929
  constructor(range, options) {
@@ -933,6 +990,7 @@ var require_range = __commonJS({
933
990
  return this.range;
934
991
  }
935
992
  parseRange(range) {
993
+ range = range.replace(BUILDSTRIPRE, "");
936
994
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
937
995
  const memoKey = memoOpts + ":" + range;
938
996
  const cached = cache.get(memoKey);
@@ -1015,12 +1073,14 @@ var require_range = __commonJS({
1015
1073
  var SemVer = require_semver();
1016
1074
  var {
1017
1075
  safeRe: re,
1076
+ src,
1018
1077
  t,
1019
1078
  comparatorTrimReplace,
1020
1079
  tildeTrimReplace,
1021
1080
  caretTrimReplace
1022
1081
  } = require_re();
1023
1082
  var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1083
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
1024
1084
  var isNullSet = (c) => c.value === "<0.0.0-0";
1025
1085
  var isAny = (c) => c.value === "";
1026
1086
  var isSatisfiable = (comparators, options) => {
@@ -1049,20 +1109,22 @@ var require_range = __commonJS({
1049
1109
  return comp;
1050
1110
  };
1051
1111
  var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1112
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
1052
1113
  var replaceTildes = (comp, options) => {
1053
1114
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1054
1115
  };
1055
1116
  var replaceTilde = (comp, options) => {
1056
1117
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1118
+ const z = options.includePrerelease ? "-0" : "";
1057
1119
  return comp.replace(r, (_, M, m, p, pr) => {
1058
1120
  debug("tilde", comp, _, M, m, p, pr);
1059
1121
  let ret;
1060
1122
  if (isX(M)) {
1061
1123
  ret = "";
1062
1124
  } else if (isX(m)) {
1063
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
1125
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1064
1126
  } else if (isX(p)) {
1065
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1127
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1066
1128
  } else if (pr) {
1067
1129
  debug("replaceTilde pr", pr);
1068
1130
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
@@ -1108,9 +1170,9 @@ var require_range = __commonJS({
1108
1170
  debug("no pr");
1109
1171
  if (M === "0") {
1110
1172
  if (m === "0") {
1111
- ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1173
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
1112
1174
  } else {
1113
- ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1175
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1114
1176
  }
1115
1177
  } else {
1116
1178
  ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
@@ -1129,6 +1191,9 @@ var require_range = __commonJS({
1129
1191
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1130
1192
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1131
1193
  debug("xRange", comp, ret, gtlt, M, m, p, pr);
1194
+ if (invalidXRangeOrder(M, m, p)) {
1195
+ return comp;
1196
+ }
1132
1197
  const xM = isX(M);
1133
1198
  const xm = xM || isX(m);
1134
1199
  const xp = xm || isX(p);
@@ -1240,9 +1305,9 @@ var require_range = __commonJS({
1240
1305
  }
1241
1306
  });
1242
1307
 
1243
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
1308
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
1244
1309
  var require_comparator = __commonJS({
1245
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js"(exports$1, module) {
1310
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module) {
1246
1311
  var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
1247
1312
  var Comparator = class _Comparator {
1248
1313
  static get ANY() {
@@ -1352,9 +1417,9 @@ var require_comparator = __commonJS({
1352
1417
  }
1353
1418
  });
1354
1419
 
1355
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
1420
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
1356
1421
  var require_satisfies = __commonJS({
1357
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(exports$1, module) {
1422
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module) {
1358
1423
  var Range = require_range();
1359
1424
  var satisfies2 = (version, range, options) => {
1360
1425
  try {
@@ -1368,18 +1433,18 @@ var require_satisfies = __commonJS({
1368
1433
  }
1369
1434
  });
1370
1435
 
1371
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
1436
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
1372
1437
  var require_to_comparators = __commonJS({
1373
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
1438
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
1374
1439
  var Range = require_range();
1375
1440
  var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1376
1441
  module.exports = toComparators;
1377
1442
  }
1378
1443
  });
1379
1444
 
1380
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
1445
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
1381
1446
  var require_max_satisfying = __commonJS({
1382
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
1447
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1383
1448
  var SemVer = require_semver();
1384
1449
  var Range = require_range();
1385
1450
  var maxSatisfying = (versions, range, options) => {
@@ -1405,9 +1470,9 @@ var require_max_satisfying = __commonJS({
1405
1470
  }
1406
1471
  });
1407
1472
 
1408
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
1473
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
1409
1474
  var require_min_satisfying = __commonJS({
1410
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
1475
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1411
1476
  var SemVer = require_semver();
1412
1477
  var Range = require_range();
1413
1478
  var minSatisfying = (versions, range, options) => {
@@ -1433,9 +1498,9 @@ var require_min_satisfying = __commonJS({
1433
1498
  }
1434
1499
  });
1435
1500
 
1436
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
1501
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
1437
1502
  var require_min_version = __commonJS({
1438
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js"(exports$1, module) {
1503
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module) {
1439
1504
  var SemVer = require_semver();
1440
1505
  var Range = require_range();
1441
1506
  var gt = require_gt();
@@ -1491,9 +1556,9 @@ var require_min_version = __commonJS({
1491
1556
  }
1492
1557
  });
1493
1558
 
1494
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
1559
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
1495
1560
  var require_valid2 = __commonJS({
1496
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js"(exports$1, module) {
1561
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module) {
1497
1562
  var Range = require_range();
1498
1563
  var validRange = (range, options) => {
1499
1564
  try {
@@ -1506,9 +1571,9 @@ var require_valid2 = __commonJS({
1506
1571
  }
1507
1572
  });
1508
1573
 
1509
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
1574
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
1510
1575
  var require_outside = __commonJS({
1511
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js"(exports$1, module) {
1576
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module) {
1512
1577
  var SemVer = require_semver();
1513
1578
  var Comparator = require_comparator();
1514
1579
  var { ANY } = Comparator;
@@ -1574,27 +1639,27 @@ var require_outside = __commonJS({
1574
1639
  }
1575
1640
  });
1576
1641
 
1577
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
1642
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
1578
1643
  var require_gtr = __commonJS({
1579
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js"(exports$1, module) {
1644
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module) {
1580
1645
  var outside = require_outside();
1581
1646
  var gtr = (version, range, options) => outside(version, range, ">", options);
1582
1647
  module.exports = gtr;
1583
1648
  }
1584
1649
  });
1585
1650
 
1586
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
1651
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
1587
1652
  var require_ltr = __commonJS({
1588
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js"(exports$1, module) {
1653
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module) {
1589
1654
  var outside = require_outside();
1590
1655
  var ltr = (version, range, options) => outside(version, range, "<", options);
1591
1656
  module.exports = ltr;
1592
1657
  }
1593
1658
  });
1594
1659
 
1595
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
1660
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
1596
1661
  var require_intersects = __commonJS({
1597
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js"(exports$1, module) {
1662
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module) {
1598
1663
  var Range = require_range();
1599
1664
  var intersects = (r1, r2, options) => {
1600
1665
  r1 = new Range(r1, options);
@@ -1605,9 +1670,9 @@ var require_intersects = __commonJS({
1605
1670
  }
1606
1671
  });
1607
1672
 
1608
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
1673
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
1609
1674
  var require_simplify = __commonJS({
1610
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js"(exports$1, module) {
1675
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module) {
1611
1676
  var satisfies2 = require_satisfies();
1612
1677
  var compare2 = require_compare();
1613
1678
  module.exports = (versions, range, options) => {
@@ -1654,9 +1719,9 @@ var require_simplify = __commonJS({
1654
1719
  }
1655
1720
  });
1656
1721
 
1657
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
1722
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
1658
1723
  var require_subset = __commonJS({
1659
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js"(exports$1, module) {
1724
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module) {
1660
1725
  var Range = require_range();
1661
1726
  var Comparator = require_comparator();
1662
1727
  var { ANY } = Comparator;
@@ -1763,7 +1828,7 @@ var require_subset = __commonJS({
1763
1828
  if (higher === c && higher !== gt) {
1764
1829
  return false;
1765
1830
  }
1766
- } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) {
1831
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) {
1767
1832
  return false;
1768
1833
  }
1769
1834
  }
@@ -1778,7 +1843,7 @@ var require_subset = __commonJS({
1778
1843
  if (lower === c && lower !== lt) {
1779
1844
  return false;
1780
1845
  }
1781
- } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) {
1846
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) {
1782
1847
  return false;
1783
1848
  }
1784
1849
  }
@@ -1815,9 +1880,9 @@ var require_subset = __commonJS({
1815
1880
  }
1816
1881
  });
1817
1882
 
1818
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js
1883
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js
1819
1884
  var require_semver2 = __commonJS({
1820
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(exports$1, module) {
1885
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module) {
1821
1886
  var internalRe = require_re();
1822
1887
  var constants2 = require_constants();
1823
1888
  var SemVer = require_semver();
@@ -1845,6 +1910,7 @@ var require_semver2 = __commonJS({
1845
1910
  var lte = require_lte();
1846
1911
  var cmp = require_cmp();
1847
1912
  var coerce2 = require_coerce();
1913
+ var truncate = require_truncate();
1848
1914
  var Comparator = require_comparator();
1849
1915
  var Range = require_range();
1850
1916
  var satisfies2 = require_satisfies();
@@ -1883,6 +1949,7 @@ var require_semver2 = __commonJS({
1883
1949
  lte,
1884
1950
  cmp,
1885
1951
  coerce: coerce2,
1952
+ truncate,
1886
1953
  Comparator,
1887
1954
  Range,
1888
1955
  satisfies: satisfies2,
@@ -1909,11 +1976,7 @@ var require_semver2 = __commonJS({
1909
1976
  }
1910
1977
  });
1911
1978
 
1912
- // src/lib/models/permissions.ts
1913
- var DEFAULT_FILE_PERMISSIONS = "rw-r--r--";
1914
- var DEFAULT_DIR_PERMISSIONS = "rwxr-xr-x";
1915
-
1916
- // src/lib/models/index.ts
1979
+ // src/lib/models/colors.ts
1917
1980
  var CliForegroundColor = /* @__PURE__ */ ((CliForegroundColor2) => {
1918
1981
  CliForegroundColor2["Black"] = "\x1B[30m";
1919
1982
  CliForegroundColor2["Red"] = "\x1B[31m";
@@ -1937,6 +2000,8 @@ var CliBackgroundColor = /* @__PURE__ */ ((CliBackgroundColor2) => {
1937
2000
  CliBackgroundColor2["White"] = "\x1B[47m";
1938
2001
  return CliBackgroundColor2;
1939
2002
  })(CliBackgroundColor || {});
2003
+
2004
+ // src/lib/models/icons.ts
1940
2005
  var CliIcon = /* @__PURE__ */ ((CliIcon2) => {
1941
2006
  CliIcon2["CheckIcon"] = "\u2714";
1942
2007
  CliIcon2["CrossIcon"] = "\u2718";
@@ -2006,7 +2071,7 @@ var CliIcon = /* @__PURE__ */ ((CliIcon2) => {
2006
2071
  CliIcon2["Server"] = "\u{1F5A5}";
2007
2072
  CliIcon2["Cloud"] = "\u2601";
2008
2073
  CliIcon2["Network"] = "\u{1F310}";
2009
- CliIcon2["Monitor"] = "\u{1F5A5}";
2074
+ CliIcon2["Monitor"] = "\u{1F4FA}";
2010
2075
  CliIcon2["Printer"] = "\u{1F5A8}";
2011
2076
  CliIcon2["USB"] = "\u{1F50C}";
2012
2077
  CliIcon2["Speaker"] = "\u{1F50A}";
@@ -2016,14 +2081,14 @@ var CliIcon = /* @__PURE__ */ ((CliIcon2) => {
2016
2081
  CliIcon2["Music"] = "\u{1F3B5}";
2017
2082
  CliIcon2["Phone"] = "\u{1F4DE}";
2018
2083
  CliIcon2["Package"] = "\u{1F4E6}";
2019
- CliIcon2["Plugin"] = "\u{1F50C}";
2020
- CliIcon2["Extension"] = "\u{1F9E9}";
2021
- CliIcon2["Module"] = "\u{1F4E6}";
2084
+ CliIcon2["Plugin"] = "\u{1F9E9}";
2085
+ CliIcon2["Extension"] = "\u{1F50C}";
2086
+ CliIcon2["Module"] = "\u{1F9F1}";
2022
2087
  CliIcon2["Evaluate"] = "\u{1F50D}";
2023
- CliIcon2["Variable"] = "\u{1F527}";
2088
+ CliIcon2["Variable"] = "\u{1D465}";
2024
2089
  CliIcon2["Script"] = "\u{1F4DC}";
2025
- CliIcon2["Code"] = "\u{1F4BE}";
2026
- CliIcon2["Logs"] = "\u{1F4DC}";
2090
+ CliIcon2["Code"] = "\u{1F4DD}";
2091
+ CliIcon2["Logs"] = "\u{1F4CB}";
2027
2092
  CliIcon2["Power"] = "\u23FB";
2028
2093
  CliIcon2["Heart"] = "\u2764";
2029
2094
  CliIcon2["Flame"] = "\u{1F525}";
@@ -2054,6 +2119,54 @@ var CliIcon = /* @__PURE__ */ ((CliIcon2) => {
2054
2119
  CliIcon2["Gift"] = "\u{1F381}";
2055
2120
  return CliIcon2;
2056
2121
  })(CliIcon || {});
2122
+
2123
+ // src/lib/models/services.ts
2124
+ function createCliToken(name) {
2125
+ return name;
2126
+ }
2127
+
2128
+ // src/lib/tokens.ts
2129
+ var ICliUserSessionService_TOKEN = createCliToken("cli-user-session-service");
2130
+ var ICliUsersStoreService_TOKEN = createCliToken("cli-users-store-service");
2131
+ var ICliGroupsStoreService_TOKEN = createCliToken("cli-groups-store-service");
2132
+ var ICliAuthService_TOKEN = createCliToken("cli-auth-service");
2133
+ var ICliCompletionProvider_TOKEN = createCliToken("cli-completion-provider");
2134
+ var ICliDragDropService_TOKEN = createCliToken("cli-drag-drop-service");
2135
+ var ICliFileTransferService_TOKEN = createCliToken("cli-file-transfer-service");
2136
+ var ICliTranslationService_TOKEN = createCliToken("cli-translation-service");
2137
+ var ICliPermissionService_TOKEN = createCliToken("cli-permission-service");
2138
+ var ICliFilePickerProvider_TOKEN = createCliToken("cli-file-picker-provider");
2139
+ var ICliHttpClient_TOKEN = createCliToken("cli-http-client");
2140
+ var ICliUserEventService_TOKEN = createCliToken("cli-user-event-service");
2141
+ var ICliAuditService_TOKEN = createCliToken("cli-audit-service");
2142
+ var ICliAuthorizationService_TOKEN = createCliToken("cli-authorization-service");
2143
+ var ICliPermissionRegistry_TOKEN = createCliToken("cli-permission-registry");
2144
+ var ICliSessionsService_TOKEN = createCliToken("cli-sessions-service");
2145
+ var ICliKeyValueStore_TOKEN = createCliToken("cli-key-value-store");
2146
+
2147
+ // src/lib/interfaces/services.ts
2148
+ var ICliServerAuthTokenProvider_TOKEN = createCliToken("cli-server-auth-token-provider");
2149
+ var ICliServerAuthService_TOKEN = createCliToken("cli-server-auth-service");
2150
+ var ICliServerManager_TOKEN = createCliToken("cli-server-manager");
2151
+
2152
+ // src/lib/models/server.ts
2153
+ function resolveHeaders(provider) {
2154
+ if (!provider) return {};
2155
+ return typeof provider === "function" ? provider() : provider;
2156
+ }
2157
+ function resolveServerHeaders(services, serverName, configHeaders) {
2158
+ if (services) {
2159
+ const authService = services.get(
2160
+ ICliServerAuthService_TOKEN
2161
+ );
2162
+ if (authService) {
2163
+ return authService.getHeaders(serverName, configHeaders);
2164
+ }
2165
+ }
2166
+ return resolveHeaders(configHeaders);
2167
+ }
2168
+
2169
+ // src/lib/models/options.ts
2057
2170
  var CliLogLevel = /* @__PURE__ */ ((CliLogLevel2) => {
2058
2171
  CliLogLevel2[CliLogLevel2["None"] = 0] = "None";
2059
2172
  CliLogLevel2[CliLogLevel2["DEBUG"] = 1] = "DEBUG";
@@ -2063,6 +2176,12 @@ var CliLogLevel = /* @__PURE__ */ ((CliLogLevel2) => {
2063
2176
  CliLogLevel2[CliLogLevel2["ERROR"] = 5] = "ERROR";
2064
2177
  return CliLogLevel2;
2065
2178
  })(CliLogLevel || {});
2179
+
2180
+ // src/lib/models/permissions.ts
2181
+ var DEFAULT_FILE_PERMISSIONS = "rw-r--r--";
2182
+ var DEFAULT_DIR_PERMISSIONS = "rwxr-xr-x";
2183
+
2184
+ // src/lib/models/index.ts
2066
2185
  var enums = {
2067
2186
  CliForegroundColor,
2068
2187
  CliBackgroundColor,
@@ -2070,18 +2189,115 @@ var enums = {
2070
2189
  CliLogLevel
2071
2190
  };
2072
2191
 
2073
- // src/lib/interfaces/completion.ts
2074
- var ICliCompletionProvider_TOKEN = "cli-completion-provider";
2192
+ // src/lib/interfaces/command-guards.ts
2193
+ var ICliCommandGuard_TOKEN = createCliToken("cli-command-guard");
2194
+
2195
+ // src/lib/utils/permissions.ts
2196
+ function cliPermissionMatches(granted, required) {
2197
+ const g = granted.trim().toLowerCase().split(":");
2198
+ const r = required.trim().toLowerCase().split(":");
2199
+ for (let i = 0; i < g.length; i++) {
2200
+ if (g[i] === "*" && i === g.length - 1) return true;
2201
+ if (i >= r.length || g[i] !== "*" && g[i] !== r[i]) return false;
2202
+ }
2203
+ return g.length === r.length;
2204
+ }
2205
+ function cliHasPermission(granted, required) {
2206
+ return !!granted?.some((p) => cliPermissionMatches(p, required));
2207
+ }
2208
+ function cliMissingPermissions(granted, required) {
2209
+ return required.filter((r) => !cliHasPermission(granted, r));
2210
+ }
2211
+ function cliMergePermissions(...lists) {
2212
+ const seen = /* @__PURE__ */ new Set();
2213
+ const out = [];
2214
+ for (const list2 of lists) {
2215
+ for (const p of list2 ?? []) {
2216
+ const key = p.trim();
2217
+ if (key && !seen.has(key.toLowerCase())) {
2218
+ seen.add(key.toLowerCase());
2219
+ out.push(key);
2220
+ }
2221
+ }
2222
+ }
2223
+ return out;
2224
+ }
2225
+ var CliServerPermissions = {
2226
+ /** Open a remote shell on a server (`ssh`) */
2227
+ ShellExecute: "shell:execute"
2228
+ };
2229
+ var CliUsersPermissions = {
2230
+ UsersRead: "users:read",
2231
+ UsersCreate: "users:create",
2232
+ UsersUpdate: "users:update",
2233
+ UsersDelete: "users:delete",
2234
+ GroupsRead: "groups:read",
2235
+ GroupsCreate: "groups:create",
2236
+ GroupsUpdate: "groups:update",
2237
+ GroupsDelete: "groups:delete",
2238
+ SessionsRead: "sessions:read",
2239
+ SessionsRevoke: "sessions:revoke",
2240
+ AuditRead: "audit:read",
2241
+ AuditClear: "audit:clear"
2242
+ };
2075
2243
 
2076
- // src/lib/interfaces/file-transfer.ts
2077
- var ICliFileTransferService_TOKEN = "cli-file-transfer-service";
2244
+ // src/lib/interfaces/authorization.ts
2245
+ var CliAccessDeniedError = class _CliAccessDeniedError extends Error {
2246
+ constructor(message = "permission denied") {
2247
+ super(message);
2248
+ this.code = "EACCES";
2249
+ this.name = "CliAccessDeniedError";
2250
+ Object.setPrototypeOf(this, _CliAccessDeniedError.prototype);
2251
+ }
2252
+ };
2253
+ function isCliAccessDeniedError(error) {
2254
+ return error instanceof CliAccessDeniedError || !!error && typeof error === "object" && error.name === "CliAccessDeniedError";
2255
+ }
2256
+ function authorizationService(context) {
2257
+ try {
2258
+ return context.services.get(ICliAuthorizationService_TOKEN);
2259
+ } catch {
2260
+ return void 0;
2261
+ }
2262
+ }
2263
+ function cliAuthorize(context, permission) {
2264
+ const auth = authorizationService(context);
2265
+ return auth ? auth.can(permission) : true;
2266
+ }
2267
+ function cliCanAccess(context, resource, action, bypassPermissions) {
2268
+ const auth = authorizationService(context);
2269
+ return auth ? auth.canAccess(resource, action, bypassPermissions) : true;
2270
+ }
2271
+ function cliEvaluateAccess(principal, resource, action, bypassPermissions = []) {
2272
+ const mode = resource.permissions;
2273
+ const owner = resource.ownership;
2274
+ if (!mode || mode.length < 9 || !owner) return true;
2275
+ if (principal && (cliHasPermission(principal.permissions, "*") || bypassPermissions.some((p) => cliHasPermission(principal.permissions, p)))) {
2276
+ return true;
2277
+ }
2278
+ let offset = 6;
2279
+ if (principal) {
2280
+ if (owner.uid === principal.name || owner.uid === principal.id) offset = 0;
2281
+ else if (principal.groups.some((g) => g.toLowerCase() === owner.gid.toLowerCase())) offset = 3;
2282
+ }
2283
+ const index = offset + (action === "read" ? 0 : action === "write" ? 1 : 2);
2284
+ return mode.charAt(index) !== "-";
2285
+ }
2078
2286
 
2079
- // src/lib/interfaces/drag-drop.ts
2080
- var ICliDragDropService_TOKEN = "cli-drag-drop-service";
2287
+ // src/lib/interfaces/event-bus.ts
2288
+ var ICliEventBus_TOKEN = createCliToken("cli-event-bus");
2081
2289
 
2082
- // src/lib/interfaces/index.ts
2083
- var ICliTranslationService_TOKEN = "cli-translation-service";
2084
- var ICliPermissionService_TOKEN = "cli-permission-service";
2290
+ // src/lib/interfaces/http-client.ts
2291
+ var CliHttpError = class _CliHttpError extends Error {
2292
+ constructor(message, status, statusText = "", body) {
2293
+ super(message);
2294
+ this.status = status;
2295
+ this.statusText = statusText;
2296
+ this.body = body;
2297
+ this.name = "CliHttpError";
2298
+ Object.setPrototypeOf(this, _CliHttpError.prototype);
2299
+ }
2300
+ };
2085
2301
 
2086
2302
  // src/lib/constants/index.ts
2087
2303
  var DefaultLibraryAuthor = {
@@ -2097,6 +2313,57 @@ var delay = (ms) => {
2097
2313
  return new Promise((resolve) => setTimeout(resolve, ms));
2098
2314
  };
2099
2315
 
2316
+ // src/lib/utils/shell-words.ts
2317
+ function splitShellWords(text) {
2318
+ const words = [];
2319
+ let current = "";
2320
+ let inWord = false;
2321
+ for (let i = 0; i < text.length; i++) {
2322
+ const ch = text[i];
2323
+ if (ch === "\\" && i + 1 < text.length) {
2324
+ current += text[++i];
2325
+ inWord = true;
2326
+ } else if (ch === "'" && text.indexOf("'", i + 1) !== -1) {
2327
+ const end = text.indexOf("'", i + 1);
2328
+ current += text.slice(i + 1, end);
2329
+ inWord = true;
2330
+ i = end;
2331
+ } else if (ch === '"' && closingDoubleQuote(text, i) !== -1) {
2332
+ const end = closingDoubleQuote(text, i);
2333
+ current += unescapeDoubleQuoted(text.slice(i + 1, end));
2334
+ inWord = true;
2335
+ i = end;
2336
+ } else if (/\s/.test(ch)) {
2337
+ if (inWord) words.push(current);
2338
+ current = "";
2339
+ inWord = false;
2340
+ } else {
2341
+ current += ch;
2342
+ inWord = true;
2343
+ }
2344
+ }
2345
+ if (inWord) words.push(current);
2346
+ return words;
2347
+ }
2348
+ function joinShellWords(text) {
2349
+ return splitShellWords(text).join(" ");
2350
+ }
2351
+ function quoteShellWord(value) {
2352
+ if (value !== "" && !/[\s"'\\$`|&;<>(){}*?[\]#~]/.test(value)) return value;
2353
+ if (!value.includes("'")) return `'${value}'`;
2354
+ return `"${value.replace(/(["\\$`])/g, "\\$1")}"`;
2355
+ }
2356
+ function closingDoubleQuote(text, start) {
2357
+ for (let i = start + 1; i < text.length; i++) {
2358
+ if (text[i] === "\\") i++;
2359
+ else if (text[i] === '"') return i;
2360
+ }
2361
+ return -1;
2362
+ }
2363
+ function unescapeDoubleQuoted(text) {
2364
+ return text.replace(/\\(["\\$`])/g, "$1");
2365
+ }
2366
+
2100
2367
  // src/lib/utils/object-describer.ts
2101
2368
  var ObjectDescriber = class {
2102
2369
  static describe(obj, options) {
@@ -2155,16 +2422,17 @@ var ObjectDescriber = class {
2155
2422
  argsToCallF.push(command.args[arg]);
2156
2423
  }
2157
2424
  }
2158
- if (supportsDynamicArgs && command.value) {
2425
+ const value = command.value === void 0 ? void 0 : joinShellWords(command.value);
2426
+ if (supportsDynamicArgs && value) {
2159
2427
  const delimiter = command.args["delimiter"] || ",";
2160
- argsToCallF.push(...command.value.split(delimiter));
2428
+ argsToCallF.push(...value.split(delimiter));
2161
2429
  }
2162
2430
  if (debug) {
2163
2431
  context.writer.writeln(
2164
2432
  "Arguments after processing: " + JSON.stringify(argsToCallF)
2165
2433
  );
2166
2434
  }
2167
- const result = supportsDynamicArgs && args.length === 0 ? funcValue(...argsToCallF) : funcValue(command.value, ...argsToCallF);
2435
+ const result = supportsDynamicArgs && args.length === 0 ? funcValue(...argsToCallF) : funcValue(value, ...argsToCallF);
2168
2436
  context.writer.write(
2169
2437
  context.writer.wrapInColor(
2170
2438
  "Result: ",
@@ -2243,6 +2511,19 @@ function getConfigValue(state, category, key, defaultValue) {
2243
2511
  }
2244
2512
  return defaultValue;
2245
2513
  }
2514
+ function getPluginConfigValue(context, category, key, defaultValue) {
2515
+ try {
2516
+ const storeManager = context.services.getRequired(
2517
+ "cli-state-store-manager"
2518
+ );
2519
+ if (!storeManager) return defaultValue;
2520
+ const store = storeManager.getStateStore(CLI_CONFIGURE_STORE_NAME);
2521
+ if (!store) return defaultValue;
2522
+ return getConfigValue(store, category, key, defaultValue);
2523
+ } catch {
2524
+ return defaultValue;
2525
+ }
2526
+ }
2246
2527
  function resolveConfigurationCategories(registry) {
2247
2528
  const categories = /* @__PURE__ */ new Map();
2248
2529
  for (const processor of registry.processors) {
@@ -2264,7 +2545,8 @@ function resolveConfigurationCategories(registry) {
2264
2545
 
2265
2546
  // src/lib/utils/terminal-utils.ts
2266
2547
  var clearTerminalLine = (terminal, contentLength) => {
2267
- const lines = Math.max(1, Math.ceil(contentLength / terminal.cols));
2548
+ if (contentLength <= 0) return;
2549
+ const lines = Math.ceil(contentLength / terminal.cols);
2268
2550
  for (let i = 0; i < lines; i++) {
2269
2551
  terminal.write("\x1B[2K");
2270
2552
  if (i < lines - 1) {
@@ -2295,10 +2577,15 @@ function satisfiesVersionRange(installed, range) {
2295
2577
  return semver.satisfies(coerced, range);
2296
2578
  }
2297
2579
 
2580
+ // src/lib/version.ts
2581
+ var LIBRARY_VERSION = "2.0.0-rc.1";
2582
+ var API_VERSION = 2;
2583
+
2298
2584
  // src/lib/utils/server-version-negotiator.ts
2585
+ var VERSIONS_ENDPOINT = "/api/qcli/versions";
2299
2586
  var ServerVersionNegotiator = class {
2300
2587
  static {
2301
- this.CLIENT_SUPPORTED_VERSIONS = [2];
2588
+ this.CLIENT_SUPPORTED_VERSIONS = [API_VERSION];
2302
2589
  }
2303
2590
  /**
2304
2591
  * Given a server's version info, pick the highest mutually compatible version.
@@ -2315,9 +2602,18 @@ var ServerVersionNegotiator = class {
2315
2602
  * Returns the negotiated API version and the base path for all subsequent calls,
2316
2603
  * or null if the server is unreachable or incompatible.
2317
2604
  */
2318
- static async discover(baseUrl) {
2605
+ static async discover(baseUrl, headers, options) {
2606
+ let response;
2607
+ try {
2608
+ const resolved = resolveHeaders(headers);
2609
+ response = await fetch(`${baseUrl}${VERSIONS_ENDPOINT}`, {
2610
+ headers: Object.keys(resolved).length > 0 ? resolved : void 0
2611
+ });
2612
+ } catch (e) {
2613
+ if (options?.rethrowNetworkErrors) throw e;
2614
+ return null;
2615
+ }
2319
2616
  try {
2320
- const response = await fetch(`${baseUrl}/api/qcli/versions`);
2321
2617
  if (!response.ok) return null;
2322
2618
  const info = await response.json();
2323
2619
  const version = this.negotiate(info);
@@ -2332,9 +2628,36 @@ var ServerVersionNegotiator = class {
2332
2628
  }
2333
2629
  };
2334
2630
 
2631
+ // src/lib/utils/websocket-auth.ts
2632
+ function buildAuthenticatedWebSocketUrl(wsUrl, headers) {
2633
+ const resolved = resolveHeaders(headers);
2634
+ if (Object.keys(resolved).length === 0) {
2635
+ return wsUrl;
2636
+ }
2637
+ const separator = wsUrl.includes("?") ? "&" : "?";
2638
+ const params = Object.entries(resolved).map(
2639
+ ([key, value]) => `_header_${encodeURIComponent(key)}=${encodeURIComponent(value)}`
2640
+ ).join("&");
2641
+ return `${wsUrl}${separator}${params}`;
2642
+ }
2643
+ async function resolveServerWebSocketUrl(services, serverName, wsUrl, configHeaders) {
2644
+ const authService = services?.get(ICliServerAuthService_TOKEN);
2645
+ const params = await authService?.getWebSocketParams?.(serverName);
2646
+ if (params) {
2647
+ return appendQueryParams(wsUrl, params);
2648
+ }
2649
+ return buildAuthenticatedWebSocketUrl(wsUrl, () => resolveServerHeaders(services, serverName, configHeaders));
2650
+ }
2651
+ function appendQueryParams(url, params) {
2652
+ const entries = Object.entries(params);
2653
+ if (!entries.length) return url;
2654
+ const query = entries.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&");
2655
+ return `${url}${url.includes("?") ? "&" : "?"}${query}`;
2656
+ }
2657
+
2335
2658
  // src/lib/utils/panel-theme-sync.ts
2336
2659
  function hexToRgb(hex) {
2337
- const m = /^#?([0-9A-Fa-f]{6})$/.exec(hex);
2660
+ const m = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/.exec(hex);
2338
2661
  if (!m) return null;
2339
2662
  const n = parseInt(m[1], 16);
2340
2663
  return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
@@ -2352,10 +2675,13 @@ function hexToRgba(hex, alpha) {
2352
2675
  if (!rgb) return hex;
2353
2676
  return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`;
2354
2677
  }
2678
+ var DEFAULT_BG = "#111827";
2679
+ var DEFAULT_FG = "#ffffff";
2680
+ var DEFAULT_ACCENT = "#818cf8";
2355
2681
  function derivePanelThemeStyles(theme) {
2356
- const bg = theme.background || "#111827";
2357
- const fg = theme.foreground || "#ffffff";
2358
- const accent = theme.cyan || theme.blue || theme.magenta || "#818cf8";
2682
+ const bg = theme.background || DEFAULT_BG;
2683
+ const fg = theme.foreground || DEFAULT_FG;
2684
+ const accent = theme.cyan || theme.blue || theme.magenta || DEFAULT_ACCENT;
2359
2685
  return {
2360
2686
  "--cli-panel-bg": bg,
2361
2687
  "--cli-panel-header-bg": shiftColor(bg, 12),
@@ -2389,9 +2715,233 @@ function savePanelPosition(position) {
2389
2715
  }
2390
2716
  function nextPanelPosition(current) {
2391
2717
  const index = POSITION_CYCLE.indexOf(current);
2718
+ if (index === -1) {
2719
+ return POSITION_CYCLE[0];
2720
+ }
2392
2721
  return POSITION_CYCLE[(index + 1) % POSITION_CYCLE.length];
2393
2722
  }
2394
2723
 
2724
+ // src/lib/utils/ansi-utils.ts
2725
+ var ANSI_RE = /\x1b\[[0-9;]*m/g;
2726
+ function stripAnsi(text) {
2727
+ return text.replace(ANSI_RE, "");
2728
+ }
2729
+ function visibleLength(text) {
2730
+ const stripped = stripAnsi(text);
2731
+ let width = 0;
2732
+ for (const ch of stripped) {
2733
+ const cp = ch.codePointAt(0);
2734
+ if (cp >= 65024 && cp <= 65039) continue;
2735
+ if (cp === 8205) continue;
2736
+ if (cp >= 768 && cp <= 879) continue;
2737
+ width += isWideCharacter(cp) ? 2 : 1;
2738
+ }
2739
+ return width;
2740
+ }
2741
+ function truncateToWidth(text, width, ellipsis = "\u2026") {
2742
+ if (width < 1) return "";
2743
+ if (visibleLength(text) <= width) return text;
2744
+ const room = Math.max(0, width - visibleLength(ellipsis));
2745
+ let out = "";
2746
+ let used = 0;
2747
+ let i = 0;
2748
+ while (i < text.length) {
2749
+ if (text[i] === "\x1B") {
2750
+ const m = /^\x1b\[[0-9;]*m/.exec(text.slice(i));
2751
+ if (m) {
2752
+ out += m[0];
2753
+ i += m[0].length;
2754
+ continue;
2755
+ }
2756
+ }
2757
+ const ch = String.fromCodePoint(text.codePointAt(i));
2758
+ const w = visibleLength(ch);
2759
+ if (used + w > room) break;
2760
+ out += ch;
2761
+ used += w;
2762
+ i += ch.length;
2763
+ }
2764
+ return `${out}${ellipsis}\x1B[0m`;
2765
+ }
2766
+ function isWideCharacter(cp) {
2767
+ if (cp >= 126976) return true;
2768
+ if (cp >= 9728 && cp <= 10175) return true;
2769
+ if (cp >= 9984 && cp <= 10175) return true;
2770
+ if (cp >= 19968 && cp <= 40959) return true;
2771
+ if (cp >= 63744 && cp <= 64255) return true;
2772
+ if (cp >= 65281 && cp <= 65376) return true;
2773
+ if (cp >= 65504 && cp <= 65510) return true;
2774
+ if (cp >= 11904 && cp <= 12255) return true;
2775
+ if (cp >= 12288 && cp <= 12543) return true;
2776
+ if (cp >= 12800 && cp <= 13055) return true;
2777
+ if (cp >= 13056 && cp <= 13311) return true;
2778
+ if (cp >= 127232 && cp <= 127487) return true;
2779
+ if (cp >= 8960 && cp <= 9215) return true;
2780
+ return false;
2781
+ }
2782
+
2783
+ // src/lib/utils/access-guards.ts
2784
+ var list = (value) => Array.isArray(value) ? value.filter((v) => typeof v === "string" && v.trim()) : [];
2785
+ var authorization = (context) => {
2786
+ try {
2787
+ return context.services.get(ICliAuthorizationService_TOKEN);
2788
+ } catch {
2789
+ return void 0;
2790
+ }
2791
+ };
2792
+ function chain(processor) {
2793
+ const out = [];
2794
+ let current = processor;
2795
+ while (current && out.length < 32 && !out.includes(current)) {
2796
+ out.push(current);
2797
+ current = current.parent;
2798
+ }
2799
+ return out;
2800
+ }
2801
+ var requiredPermissionsOf = (p) => [...new Set(chain(p).flatMap((x) => list(x.metadata?.requiredPermissions)))];
2802
+ var requiredGroupLevels = (p) => chain(p).map((x) => list(x.metadata?.requiredGroups)).filter((g) => g.length > 0);
2803
+ var needsAuth = (p) => chain(p).some((x) => x.metadata?.requireAuth === true) || requiredGroupLevels(p).length > 0 || requiredPermissionsOf(p).length > 0;
2804
+ var cliRequireAuthGuard = {
2805
+ name: "access:require-auth",
2806
+ priority: -100,
2807
+ appliesTo: (processor, _command, context) => needsAuth(processor) && !!authorization(context),
2808
+ canActivate: (_command, processor, context) => authorization(context).getPrincipal() ? true : `${processor.command}: login required`
2809
+ };
2810
+ var cliRequiredGroupsGuard = {
2811
+ name: "access:required-groups",
2812
+ priority: -90,
2813
+ appliesTo: (processor, _command, context) => requiredGroupLevels(processor).length > 0 && !!authorization(context),
2814
+ canActivate: (_command, processor, context) => {
2815
+ const auth = authorization(context);
2816
+ const principal = auth.getPrincipal();
2817
+ if (!principal) return `${processor.command}: login required`;
2818
+ if (auth.can("*")) return true;
2819
+ for (const required of requiredGroupLevels(processor)) {
2820
+ const member = required.some((g) => principal.groups.some((pg) => pg.toLowerCase() === g.toLowerCase()));
2821
+ if (!member) return `${processor.command}: permission denied (requires group: ${required.join(" or ")})`;
2822
+ }
2823
+ return true;
2824
+ }
2825
+ };
2826
+ var cliRequiredPermissionsGuard = {
2827
+ name: "access:required-permissions",
2828
+ priority: -80,
2829
+ appliesTo: (processor, _command, context) => requiredPermissionsOf(processor).length > 0 && !!authorization(context),
2830
+ canActivate: (_command, processor, context) => {
2831
+ const principal = authorization(context).getPrincipal();
2832
+ if (!principal) return `${processor.command}: login required`;
2833
+ const missing = cliMissingPermissions(principal.permissions, requiredPermissionsOf(processor));
2834
+ return missing.length === 0 ? true : `${processor.command}: permission denied (requires ${missing.join(", ")})`;
2835
+ }
2836
+ };
2837
+ var cliAccessMetadataGuards = [
2838
+ cliRequireAuthGuard,
2839
+ cliRequiredGroupsGuard,
2840
+ cliRequiredPermissionsGuard
2841
+ ];
2842
+
2843
+ // src/lib/utils/server-target.ts
2844
+ function cliDefaultServer(context) {
2845
+ const servers = context.options?.servers ?? [];
2846
+ const manager = context.services?.get(ICliServerManager_TOKEN);
2847
+ const preferred = manager?.preferredServer?.();
2848
+ return (preferred ? servers.find((s) => s.name === preferred) : void 0) ?? servers[0];
2849
+ }
2850
+
2851
+ // src/lib/utils/help-format.ts
2852
+ function writeColumns(context, rows, formatLeft, formatRight) {
2853
+ const width = Math.max(...rows.map(([left]) => left.length)) + 2;
2854
+ for (const [left, right] of rows) {
2855
+ context.writer.writeln(
2856
+ ` ${formatLeft(left.padEnd(width))}${formatRight(right)}`
2857
+ );
2858
+ }
2859
+ }
2860
+ function writeUsage(context, rows) {
2861
+ const { writer, translator } = context;
2862
+ writer.writeln(`\u{1F4CB} ${translator.t("cli.common.usage", "Usage:")}`);
2863
+ writeColumns(
2864
+ context,
2865
+ rows,
2866
+ (cmd) => writer.wrapInColor(cmd, "\x1B[36m" /* Cyan */),
2867
+ (text) => text
2868
+ );
2869
+ }
2870
+ function writeExamples(context, rows) {
2871
+ const { writer, translator } = context;
2872
+ writer.writeln(`\u{1F4DD} ${translator.t("cli.common.examples", "Examples:")}`);
2873
+ writeColumns(
2874
+ context,
2875
+ rows,
2876
+ (cmd) => cmd,
2877
+ (comment) => writer.wrapInColor(`# ${comment}`, "\x1B[32m" /* Green */)
2878
+ );
2879
+ }
2880
+ function writeWrapped(context, text, indent = 0) {
2881
+ const cols = context.terminal?.cols ?? 80;
2882
+ const width = Math.max(20, Math.min(cols - 1, 100) - indent);
2883
+ const pad = " ".repeat(indent);
2884
+ let line = "";
2885
+ for (const word of text.split(/\s+/).filter(Boolean)) {
2886
+ if (line && visibleLength2(line) + 1 + visibleLength2(word) > width) {
2887
+ context.writer.writeln(pad + line);
2888
+ line = word;
2889
+ } else {
2890
+ line = line ? `${line} ${word}` : word;
2891
+ }
2892
+ }
2893
+ if (line) context.writer.writeln(pad + line);
2894
+ }
2895
+ function visibleLength2(text) {
2896
+ return text.replace(/\x1b\[[0-9;]*m/g, "").length;
2897
+ }
2898
+ function writeHint(context, command, action) {
2899
+ const { writer, translator } = context;
2900
+ const text = `\u{1F4A1} ${translator.t("cli.common.use_hint", "Use {command} {action}", {
2901
+ command: writer.wrapInColor(command, "\x1B[36m" /* Cyan */),
2902
+ action
2903
+ })}`;
2904
+ const width = Math.min((context.terminal?.cols ?? 80) - 1, 100) - 3;
2905
+ if (visibleLength2(text) + 1 <= width) {
2906
+ writer.writeInfo(text);
2907
+ return;
2908
+ }
2909
+ const lines = [];
2910
+ let line = "";
2911
+ for (const word of text.split(" ")) {
2912
+ if (line && visibleLength2(line) + 1 + visibleLength2(word) > width) {
2913
+ lines.push(line);
2914
+ line = word;
2915
+ } else {
2916
+ line = line ? `${line} ${word}` : word;
2917
+ }
2918
+ }
2919
+ if (line) lines.push(line);
2920
+ writer.writeInfo(lines[0]);
2921
+ for (const rest of lines.slice(1)) {
2922
+ writer.writeln(` ${rest}`);
2923
+ }
2924
+ }
2925
+
2926
+ // src/lib/utils/raw-argument.ts
2927
+ function unquoteRawArgument(text) {
2928
+ const value = text.trim();
2929
+ if (value.length < 2) return value;
2930
+ const quote = value[0];
2931
+ if (quote === "'") {
2932
+ return value.indexOf("'", 1) === value.length - 1 ? value.slice(1, -1) : value;
2933
+ }
2934
+ if (quote === '"') {
2935
+ for (let i = 1; i < value.length; i++) {
2936
+ if (value[i] === "\\") i++;
2937
+ else if (value[i] === '"') {
2938
+ return i === value.length - 1 ? value.slice(1, -1).replace(/\\(["\\$`])/g, "$1") : value;
2939
+ }
2940
+ }
2941
+ }
2942
+ return value;
2943
+ }
2944
+
2395
2945
  // src/lib/utils/index.ts
2396
2946
  var getParameterValue = (p, args) => {
2397
2947
  if (args[p.name] !== void 0) {
@@ -2405,18 +2955,46 @@ var formatJson = (json) => {
2405
2955
  return colorizeJson(identedJson.split("\n").join("\r\n"));
2406
2956
  };
2407
2957
  var colorizeJson = (jsonString) => {
2408
- return jsonString.replace(/"([^"]+)":/g, '\x1B[33m"$1":\x1B[0m').replace(/: "([^"]*)"/g, ': \x1B[32m"$1"\x1B[0m').replace(/: (\d+)/g, ": \x1B[34m$1\x1B[0m").replace(/: (true|false)/g, ": \x1B[35m$1\x1B[0m").replace(/: (null)/g, ": \x1B[36m$1\x1B[0m");
2958
+ const RST = "\x1B[0m";
2959
+ const CYN = "\x1B[36m";
2960
+ const GRN = "\x1B[32m";
2961
+ const YLW = "\x1B[33m";
2962
+ const GRY = "\x1B[90m";
2963
+ const tokenRe = /("(?:[^"\\]|\\.)*"?)(\s*:)?|(\btrue\b|\bfalse\b|\bnull\b)|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|([{}[\],])/g;
2964
+ let result = "";
2965
+ let lastIndex = 0;
2966
+ let m;
2967
+ while ((m = tokenRe.exec(jsonString)) !== null) {
2968
+ if (m.index > lastIndex) {
2969
+ result += jsonString.slice(lastIndex, m.index);
2970
+ }
2971
+ if (m[1] !== void 0) {
2972
+ if (m[2] !== void 0) {
2973
+ result += CYN + m[1] + RST + m[2];
2974
+ } else {
2975
+ result += GRN + m[1] + RST;
2976
+ }
2977
+ } else if (m[3] !== void 0) {
2978
+ result += YLW + m[3] + RST;
2979
+ } else if (m[4] !== void 0) {
2980
+ result += YLW + m[4] + RST;
2981
+ } else if (m[5] !== void 0) {
2982
+ result += GRY + m[5] + RST;
2983
+ }
2984
+ lastIndex = m.index + m[0].length;
2985
+ }
2986
+ if (lastIndex < jsonString.length) {
2987
+ result += jsonString.slice(lastIndex);
2988
+ }
2989
+ return result;
2409
2990
  };
2410
2991
  var toQueryString = (params) => {
2411
2992
  const searchParams = new URLSearchParams();
2412
- for (const key in params) {
2413
- if (params.hasOwnProperty(key)) {
2414
- const value = params[key];
2415
- if (Array.isArray(value)) {
2416
- value.forEach((v) => searchParams.append(key, v.toString()));
2417
- } else if (value !== null && value !== void 0) {
2418
- searchParams.append(key, value.toString());
2419
- }
2993
+ for (const [key, value] of Object.entries(params)) {
2994
+ if (Array.isArray(value)) {
2995
+ value.forEach((v) => searchParams.append(key, v.toString()));
2996
+ } else if (value !== null && value !== void 0) {
2997
+ searchParams.append(key, value.toString());
2420
2998
  }
2421
2999
  }
2422
3000
  return searchParams.toString();
@@ -2453,19 +3031,19 @@ var utils = {
2453
3031
  ObjectDescriber,
2454
3032
  delay,
2455
3033
  getConfigValue,
3034
+ getPluginConfigValue,
2456
3035
  resolveConfigurationCategories,
2457
3036
  CLI_CONFIGURE_STORE_NAME
2458
3037
  };
2459
3038
 
2460
- // src/lib/version.ts
2461
- var LIBRARY_VERSION = "2.0.0-beta.8";
2462
- var API_VERSION = 2;
2463
-
2464
3039
  // src/lib/modules/cli-module-registry.ts
2465
3040
  var CliModuleRegistry = class {
2466
3041
  constructor() {
2467
3042
  this.modules = /* @__PURE__ */ new Map();
2468
3043
  this.bootHandlers = [];
3044
+ this.unregisterHandlers = [];
3045
+ /** Registrations whose boot handlers are still running. */
3046
+ this.inFlight = /* @__PURE__ */ new Set();
2469
3047
  }
2470
3048
  /**
2471
3049
  * Register a handler that is called whenever a new module is registered.
@@ -2474,21 +3052,80 @@ var CliModuleRegistry = class {
2474
3052
  this.bootHandlers.push(handler);
2475
3053
  }
2476
3054
  /**
2477
- * Register a module and notify all boot handlers.
2478
- * Modules that do not meet the required API version are silently skipped.
3055
+ * Register a web plugin module and notify all boot handlers.
3056
+ * Modules whose `apiVersion` is below the runtime's `API_VERSION` are
3057
+ * skipped with a warning — this ensures only compatible frontend plugins load.
2479
3058
  */
2480
- async register(module) {
3059
+ register(module) {
3060
+ const registration = this.registerInternal(module);
3061
+ this.inFlight.add(registration);
3062
+ const done = () => this.inFlight.delete(registration);
3063
+ registration.then(done, done);
3064
+ return registration;
3065
+ }
3066
+ /**
3067
+ * Resolve once every registration in progress (including ones started
3068
+ * meanwhile, e.g. a plugin loading another) has finished booting.
3069
+ */
3070
+ async whenIdle() {
3071
+ while (this.inFlight.size > 0) {
3072
+ await Promise.allSettled([...this.inFlight]);
3073
+ }
3074
+ }
3075
+ async registerInternal(module) {
2481
3076
  const modApiVersion = module.apiVersion;
2482
3077
  if (typeof modApiVersion !== "number" || modApiVersion < API_VERSION) {
2483
- console.warn(
2484
- `[CLI] Plugin "${module.name}" targets API version ${modApiVersion ?? "unknown"}, but this runtime requires API version ${API_VERSION}. Skipping.`
2485
- );
3078
+ const msg = `[CLI] Plugin "${module.name}" targets API version ${modApiVersion ?? "unknown"}, but this runtime requires API version ${API_VERSION}. Skipping.`;
3079
+ if (this.onWarn) {
3080
+ this.onWarn(msg);
3081
+ } else {
3082
+ console.warn(msg);
3083
+ }
2486
3084
  return;
2487
3085
  }
2488
3086
  this.modules.set(module.name, module);
2489
3087
  for (const handler of this.bootHandlers) {
2490
- await handler(module);
3088
+ try {
3089
+ await handler(module);
3090
+ } catch (e) {
3091
+ const msg = `[CLI] Boot handler failed for module "${module.name}": ${e instanceof Error ? e.message : e}`;
3092
+ if (this.onWarn) {
3093
+ this.onWarn(msg);
3094
+ } else {
3095
+ console.warn(msg);
3096
+ }
3097
+ }
3098
+ }
3099
+ }
3100
+ /**
3101
+ * Register a handler that is called when a module is unregistered,
3102
+ * e.g. so its processors can be removed.
3103
+ */
3104
+ onModuleUnregister(handler) {
3105
+ this.unregisterHandlers.push(handler);
3106
+ }
3107
+ /**
3108
+ * Unregister a module and notify all unregister handlers. A module
3109
+ * registered again afterwards (e.g. a newer version) boots again.
3110
+ * Returns the removed module, or `undefined` when it was not registered.
3111
+ */
3112
+ unregister(name) {
3113
+ const module = this.modules.get(name);
3114
+ if (!module) return void 0;
3115
+ this.modules.delete(name);
3116
+ for (const handler of this.unregisterHandlers) {
3117
+ try {
3118
+ handler(module);
3119
+ } catch (e) {
3120
+ const msg = `[CLI] Unregister handler failed for module "${name}": ${e instanceof Error ? e.message : e}`;
3121
+ if (this.onWarn) {
3122
+ this.onWarn(msg);
3123
+ } else {
3124
+ console.warn(msg);
3125
+ }
3126
+ }
2491
3127
  }
3128
+ return module;
2492
3129
  }
2493
3130
  /**
2494
3131
  * Get a module by name.
@@ -2528,8 +3165,7 @@ var initializeBrowserEnvironment = ({
2528
3165
  ...constants,
2529
3166
  ...utils,
2530
3167
  ...enums,
2531
- bootCliModule,
2532
- bootUmdModule
3168
+ bootCliModule
2533
3169
  };
2534
3170
  Object.defineProperty(window, "ngCore", {
2535
3171
  configurable: true,
@@ -2547,21 +3183,23 @@ var bootCliModule = async (module) => {
2547
3183
  await window.__cliModuleRegistry.register(module);
2548
3184
  }
2549
3185
  };
2550
- var bootUmdModule = async (module) => {
2551
- await bootCliModule(module);
2552
- };
2553
3186
 
2554
3187
  // src/lib/types/CancellablePromise.ts
3188
+ var CANCELLATION_ERROR_MESSAGE = "Promise cancelled";
2555
3189
  var CancellablePromise = class {
2556
3190
  constructor(executor) {
2557
3191
  this.executor = executor;
2558
3192
  this.hasCancelled = false;
2559
3193
  this.abortController = new AbortController();
2560
3194
  }
3195
+ /**
3196
+ * Run the executor and return a promise for its result.
3197
+ * If `cancel()` has been called, the promise rejects immediately.
3198
+ */
2561
3199
  execute() {
2562
3200
  return new Promise((resolve, reject) => {
2563
3201
  this.abortController.signal.onabort = () => {
2564
- reject(new Error("Promise cancelled"));
3202
+ reject(new Error(CANCELLATION_ERROR_MESSAGE));
2565
3203
  };
2566
3204
  this.executor(
2567
3205
  (value) => {
@@ -2577,13 +3215,17 @@ var CancellablePromise = class {
2577
3215
  );
2578
3216
  });
2579
3217
  }
3218
+ /**
3219
+ * Cancel the promise. The executing promise rejects with
3220
+ * `Error('Promise cancelled')` and subsequent resolve/reject calls are ignored.
3221
+ */
2580
3222
  cancel() {
2581
3223
  this.hasCancelled = true;
2582
3224
  this.abortController.abort();
2583
3225
  }
2584
3226
  };
2585
3227
 
2586
- // src/lib/themes/index.ts
3228
+ // src/lib/themes/default-themes.ts
2587
3229
  var DefaultThemes = {
2588
3230
  default: {
2589
3231
  background: "#070b14",
@@ -3219,6 +3861,8 @@ var DefaultThemes = {
3219
3861
  }
3220
3862
  };
3221
3863
  DefaultThemes.yellow = DefaultThemes.highContrastLight;
3864
+
3865
+ // src/lib/themes/default-theme-infos.ts
3222
3866
  var DefaultThemeInfos = {
3223
3867
  default: {
3224
3868
  theme: DefaultThemes.default,
@@ -3396,12 +4040,6 @@ var DefaultThemeInfos = {
3396
4040
  }
3397
4041
  };
3398
4042
 
3399
- // src/lib/tokens.ts
3400
- var ICliUserSessionService_TOKEN = "cli-user-session-service";
3401
- var ICliUsersStoreService_TOKEN = "cli-users-store-service";
3402
- var ICliGroupsStoreService_TOKEN = "cli-groups-store-service";
3403
- var ICliAuthService_TOKEN = "cli-auth-service";
3404
-
3405
4043
  // src/lib/worker/create-worker-service.ts
3406
4044
  function createWorkerService(handlers) {
3407
4045
  const abortController = new AbortController();
@@ -3494,9 +4132,17 @@ var BrowserFileTransferService = class {
3494
4132
  const filename = path.split("/").pop() || "download";
3495
4133
  this.downloadToBrowser(filename, content);
3496
4134
  }
4135
+ /**
4136
+ * Not supported in browser — always returns an empty array.
4137
+ * Use `@qodalis/cli-files` for directory listing.
4138
+ */
3497
4139
  async listFiles(_path) {
3498
4140
  return [];
3499
4141
  }
4142
+ /**
4143
+ * Not supported in browser — always returns `false`.
4144
+ * Use `@qodalis/cli-files` for file existence checks.
4145
+ */
3500
4146
  async exists(_path) {
3501
4147
  return false;
3502
4148
  }
@@ -3540,6 +4186,6 @@ var BrowserFileTransferService = class {
3540
4186
  }
3541
4187
  };
3542
4188
 
3543
- export { API_VERSION, BrowserFileTransferService, CLI_CONFIGURE_STORE_NAME, CancellablePromise, CliBackgroundColor, CliForegroundColor, CliIcon, CliLogLevel, CliModuleRegistry, DEFAULT_DIR_PERMISSIONS, DEFAULT_FILE_PERMISSIONS, DefaultLibraryAuthor, DefaultThemeInfos, DefaultThemes, ICliAuthService_TOKEN, ICliCompletionProvider_TOKEN, ICliDragDropService_TOKEN, ICliFileTransferService_TOKEN, ICliGroupsStoreService_TOKEN, ICliPermissionService_TOKEN, ICliTranslationService_TOKEN, ICliUserSessionService_TOKEN, ICliUsersStoreService_TOKEN, LIBRARY_VERSION, ObjectDescriber, ServerVersionNegotiator, bootCliModule, bootUmdModule, clearTerminalLine, colorFirstWord, colorizeJson, compareVersions, constants, createWorkerService, delay, derivePanelThemeStyles, enums, formatJson, getConfigValue, getParameterValue, getRightOfWord, highlightTextWithBg, initializeBrowserEnvironment, loadPanelPosition, nextPanelPosition, resolveConfigurationCategories, satisfiesMinVersion, satisfiesVersionRange, savePanelPosition, toQueryString, utils };
4189
+ export { API_VERSION, BrowserFileTransferService, CANCELLATION_ERROR_MESSAGE, CLI_CONFIGURE_STORE_NAME, CancellablePromise, CliAccessDeniedError, CliBackgroundColor, CliForegroundColor, CliHttpError, CliIcon, CliLogLevel, CliModuleRegistry, CliServerPermissions, CliUsersPermissions, DEFAULT_DIR_PERMISSIONS, DEFAULT_FILE_PERMISSIONS, DefaultLibraryAuthor, DefaultThemeInfos, DefaultThemes, ICliAuditService_TOKEN, ICliAuthService_TOKEN, ICliAuthorizationService_TOKEN, ICliCommandGuard_TOKEN, ICliCompletionProvider_TOKEN, ICliDragDropService_TOKEN, ICliEventBus_TOKEN, ICliFilePickerProvider_TOKEN, ICliFileTransferService_TOKEN, ICliGroupsStoreService_TOKEN, ICliHttpClient_TOKEN, ICliKeyValueStore_TOKEN, ICliPermissionRegistry_TOKEN, ICliPermissionService_TOKEN, ICliServerAuthService_TOKEN, ICliServerAuthTokenProvider_TOKEN, ICliServerManager_TOKEN, ICliSessionsService_TOKEN, ICliTranslationService_TOKEN, ICliUserEventService_TOKEN, ICliUserSessionService_TOKEN, ICliUsersStoreService_TOKEN, LIBRARY_VERSION, ObjectDescriber, ServerVersionNegotiator, appendQueryParams, bootCliModule, buildAuthenticatedWebSocketUrl, clearTerminalLine, cliAccessMetadataGuards, cliAuthorize, cliCanAccess, cliDefaultServer, cliEvaluateAccess, cliHasPermission, cliMergePermissions, cliMissingPermissions, cliPermissionMatches, cliRequireAuthGuard, cliRequiredGroupsGuard, cliRequiredPermissionsGuard, colorFirstWord, colorizeJson, compareVersions, constants, createCliToken, createWorkerService, delay, derivePanelThemeStyles, enums, formatJson, getConfigValue, getParameterValue, getPluginConfigValue, getRightOfWord, highlightTextWithBg, initializeBrowserEnvironment, isCliAccessDeniedError, joinShellWords, loadPanelPosition, nextPanelPosition, quoteShellWord, resolveConfigurationCategories, resolveHeaders, resolveServerHeaders, resolveServerWebSocketUrl, satisfiesMinVersion, satisfiesVersionRange, savePanelPosition, splitShellWords, stripAnsi, toQueryString, truncateToWidth, unquoteRawArgument, utils, visibleLength, writeExamples, writeHint, writeUsage, writeWrapped };
3544
4190
  //# sourceMappingURL=public-api.mjs.map
3545
4191
  //# sourceMappingURL=public-api.mjs.map