@camunda8/cli 4.7.0-alpha.4 → 4.7.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CONTEXT.md +12 -0
  2. package/PLUGIN-HELP.md +1 -1
  3. package/README.md +8 -1
  4. package/dist/commands/deploy.d.ts.map +1 -1
  5. package/dist/commands/deploy.js +2 -2
  6. package/dist/commands/deploy.js.map +1 -1
  7. package/dist/commands/helpers/deploy-helpers.d.ts +14 -1
  8. package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
  9. package/dist/commands/helpers/deploy-helpers.js +69 -13
  10. package/dist/commands/helpers/deploy-helpers.js.map +1 -1
  11. package/dist/commands/mcp-proxy.d.ts.map +1 -1
  12. package/dist/commands/mcp-proxy.js +13 -8
  13. package/dist/commands/mcp-proxy.js.map +1 -1
  14. package/dist/commands/profiles.d.ts.map +1 -1
  15. package/dist/commands/profiles.js +13 -7
  16. package/dist/commands/profiles.js.map +1 -1
  17. package/dist/commands/run.d.ts.map +1 -1
  18. package/dist/commands/run.js +1 -8
  19. package/dist/commands/run.js.map +1 -1
  20. package/dist/commands/watch.d.ts.map +1 -1
  21. package/dist/commands/watch.js +10 -2
  22. package/dist/commands/watch.js.map +1 -1
  23. package/dist/core/client.d.ts +13 -0
  24. package/dist/core/client.d.ts.map +1 -1
  25. package/dist/core/client.js +48 -21
  26. package/dist/core/client.js.map +1 -1
  27. package/dist/core/config.d.ts +34 -3
  28. package/dist/core/config.d.ts.map +1 -1
  29. package/dist/core/config.js +91 -9
  30. package/dist/core/config.js.map +1 -1
  31. package/dist/core/env-address.d.ts +22 -0
  32. package/dist/core/env-address.d.ts.map +1 -0
  33. package/dist/core/env-address.js +30 -0
  34. package/dist/core/env-address.js.map +1 -0
  35. package/dist/core/errors.d.ts +17 -0
  36. package/dist/core/errors.d.ts.map +1 -1
  37. package/dist/core/errors.js +32 -0
  38. package/dist/core/errors.js.map +1 -1
  39. package/dist/core/index.d.ts +2 -0
  40. package/dist/core/index.d.ts.map +1 -1
  41. package/dist/core/index.js +2 -0
  42. package/dist/core/index.js.map +1 -1
  43. package/dist/core/logger.d.ts.map +1 -1
  44. package/dist/core/logger.js +2 -1
  45. package/dist/core/logger.js.map +1 -1
  46. package/dist/core/node-version.d.ts +18 -0
  47. package/dist/core/node-version.d.ts.map +1 -0
  48. package/dist/core/node-version.js +38 -0
  49. package/dist/core/node-version.js.map +1 -0
  50. package/dist/default-plugins/cluster/README.md +16 -1
  51. package/dist/default-plugins/cluster/c8ctl-plugin.js +745 -115
  52. package/dist/default-plugins/element-template/c8ctl-plugin.js +248 -7
  53. package/dist/default-plugins/mcp/README.md +37 -0
  54. package/dist/default-plugins/mcp/c8ctl-plugin.js +4973 -0
  55. package/dist/default-plugins/mcp/package.json +8 -0
  56. package/dist/default-plugins/modeler/README.md +23 -0
  57. package/dist/default-plugins/modeler/c8ctl-plugin.js +4314 -0
  58. package/dist/default-plugins/modeler/package.json +8 -0
  59. package/dist/default-plugins/setup/README.md +42 -0
  60. package/dist/default-plugins/setup/c8ctl-plugin.js +6845 -0
  61. package/dist/default-plugins/setup/package.json +8 -0
  62. package/dist/default-plugins/skills/README.md +35 -0
  63. package/dist/default-plugins/skills/c8ctl-plugin.js +3369 -0
  64. package/dist/default-plugins/skills/package.json +8 -0
  65. package/dist/framework/argv-parser.d.ts +14 -0
  66. package/dist/framework/argv-parser.d.ts.map +1 -1
  67. package/dist/framework/argv-parser.js +25 -0
  68. package/dist/framework/argv-parser.js.map +1 -1
  69. package/dist/framework/command-registry.d.ts +28 -2
  70. package/dist/framework/command-registry.d.ts.map +1 -1
  71. package/dist/framework/command-registry.js +47 -2
  72. package/dist/framework/command-registry.js.map +1 -1
  73. package/dist/framework/plugins/plugin-loader.d.ts +20 -2
  74. package/dist/framework/plugins/plugin-loader.d.ts.map +1 -1
  75. package/dist/framework/plugins/plugin-loader.js.map +1 -1
  76. package/dist/framework/ui/help.d.ts.map +1 -1
  77. package/dist/framework/ui/help.js +57 -14
  78. package/dist/framework/ui/help.js.map +1 -1
  79. package/dist/framework/ui/prompt.d.ts +88 -0
  80. package/dist/framework/ui/prompt.d.ts.map +1 -1
  81. package/dist/framework/ui/prompt.js +558 -20
  82. package/dist/framework/ui/prompt.js.map +1 -1
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +68 -12
  85. package/dist/index.js.map +1 -1
  86. package/dist/utils/command-local/mcp-install-helpers.d.ts +68 -0
  87. package/dist/utils/command-local/mcp-install-helpers.d.ts.map +1 -0
  88. package/dist/utils/command-local/mcp-install-helpers.js +485 -0
  89. package/dist/utils/command-local/mcp-install-helpers.js.map +1 -0
  90. package/dist/utils/command-local/process-instance-helpers.d.ts +6 -0
  91. package/dist/utils/command-local/process-instance-helpers.d.ts.map +1 -1
  92. package/dist/utils/command-local/process-instance-helpers.js +9 -0
  93. package/dist/utils/command-local/process-instance-helpers.js.map +1 -1
  94. package/dist/utils/command-local/skills-install-helpers.d.ts +49 -0
  95. package/dist/utils/command-local/skills-install-helpers.d.ts.map +1 -0
  96. package/dist/utils/command-local/skills-install-helpers.js +436 -0
  97. package/dist/utils/command-local/skills-install-helpers.js.map +1 -0
  98. package/dist/utils/index.d.ts +2 -2
  99. package/dist/utils/index.d.ts.map +1 -1
  100. package/dist/utils/index.js +2 -2
  101. package/dist/utils/index.js.map +1 -1
  102. package/dist/utils/shared/camunda-json.d.ts +16 -3
  103. package/dist/utils/shared/camunda-json.d.ts.map +1 -1
  104. package/dist/utils/shared/camunda-json.js +20 -5
  105. package/dist/utils/shared/camunda-json.js.map +1 -1
  106. package/dist/utils/shared/deploy-resource-selection.d.ts +7 -15
  107. package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -1
  108. package/dist/utils/shared/deploy-resource-selection.js +9 -19
  109. package/dist/utils/shared/deploy-resource-selection.js.map +1 -1
  110. package/dist/utils/shared/ignore.d.ts +6 -0
  111. package/dist/utils/shared/ignore.d.ts.map +1 -1
  112. package/dist/utils/shared/ignore.js +9 -1
  113. package/dist/utils/shared/ignore.js.map +1 -1
  114. package/package.json +3 -2
  115. package/dist/utils/command-local/setup-detectors.d.ts +0 -51
  116. package/dist/utils/command-local/setup-detectors.d.ts.map +0 -1
  117. package/dist/utils/command-local/setup-detectors.js +0 -115
  118. package/dist/utils/command-local/setup-detectors.js.map +0 -1
  119. package/dist/utils/command-local/setup-prerequisites.d.ts +0 -67
  120. package/dist/utils/command-local/setup-prerequisites.d.ts.map +0 -1
  121. package/dist/utils/command-local/setup-prerequisites.js +0 -238
  122. package/dist/utils/command-local/setup-prerequisites.js.map +0 -1
@@ -0,0 +1,3369 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
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
+ }
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+
31
+ // node_modules/semver/internal/constants.js
32
+ var require_constants = __commonJS({
33
+ "node_modules/semver/internal/constants.js"(exports, module) {
34
+ "use strict";
35
+ var SEMVER_SPEC_VERSION = "2.0.0";
36
+ var MAX_LENGTH = 256;
37
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
38
+ 9007199254740991;
39
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
40
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
41
+ var WHITESPACE_CHARACTERS = [
42
+ " ",
43
+ "\n",
44
+ "\v",
45
+ "\f",
46
+ "\r",
47
+ " ",
48
+ "\xA0",
49
+ "\u1680",
50
+ "\u2000",
51
+ "\u2001",
52
+ "\u2002",
53
+ "\u2003",
54
+ "\u2004",
55
+ "\u2005",
56
+ "\u2006",
57
+ "\u2007",
58
+ "\u2008",
59
+ "\u2009",
60
+ "\u200A",
61
+ "\u2028",
62
+ "\u2029",
63
+ "\u202F",
64
+ "\u205F",
65
+ "\u3000",
66
+ "\uFEFF"
67
+ ];
68
+ var RELEASE_TYPES = [
69
+ "major",
70
+ "premajor",
71
+ "minor",
72
+ "preminor",
73
+ "patch",
74
+ "prepatch",
75
+ "prerelease"
76
+ ];
77
+ module.exports = {
78
+ MAX_LENGTH,
79
+ MAX_SAFE_COMPONENT_LENGTH,
80
+ MAX_SAFE_BUILD_LENGTH,
81
+ MAX_SAFE_INTEGER,
82
+ WHITESPACE_CHARACTERS,
83
+ RELEASE_TYPES,
84
+ SEMVER_SPEC_VERSION,
85
+ FLAG_INCLUDE_PRERELEASE: 1,
86
+ FLAG_LOOSE: 2
87
+ };
88
+ }
89
+ });
90
+
91
+ // node_modules/semver/internal/debug.js
92
+ var require_debug = __commonJS({
93
+ "node_modules/semver/internal/debug.js"(exports, module) {
94
+ "use strict";
95
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
96
+ };
97
+ module.exports = debug;
98
+ }
99
+ });
100
+
101
+ // node_modules/semver/internal/re.js
102
+ var require_re = __commonJS({
103
+ "node_modules/semver/internal/re.js"(exports, module) {
104
+ "use strict";
105
+ var {
106
+ MAX_SAFE_COMPONENT_LENGTH,
107
+ MAX_SAFE_BUILD_LENGTH,
108
+ MAX_LENGTH
109
+ } = require_constants();
110
+ var debug = require_debug();
111
+ exports = module.exports = {};
112
+ var re = exports.re = [];
113
+ var safeRe = exports.safeRe = [];
114
+ var src = exports.src = [];
115
+ var safeSrc = exports.safeSrc = [];
116
+ var t = exports.t = {};
117
+ var R = 0;
118
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
119
+ var safeRegexReplacements = [
120
+ ["\\s", 1],
121
+ ["\\d", MAX_LENGTH],
122
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
123
+ ];
124
+ var makeSafeRegex = (value) => {
125
+ for (const [token, max] of safeRegexReplacements) {
126
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
127
+ }
128
+ return value;
129
+ };
130
+ var createToken = (name, value, isGlobal) => {
131
+ const safe = makeSafeRegex(value);
132
+ const index = R++;
133
+ debug(name, index, value);
134
+ t[name] = index;
135
+ src[index] = value;
136
+ safeSrc[index] = safe;
137
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
138
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
139
+ };
140
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
141
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
142
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
143
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
144
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
145
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
146
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
147
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
148
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
149
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
150
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
151
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
152
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
153
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
154
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
155
+ createToken("GTLT", "((?:<|>)?=?)");
156
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
157
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
158
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
159
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
160
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
161
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
162
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
163
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
164
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
165
+ createToken("COERCERTL", src[t.COERCE], true);
166
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
167
+ createToken("LONETILDE", "(?:~>?)");
168
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
169
+ exports.tildeTrimReplace = "$1~";
170
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
171
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
172
+ createToken("LONECARET", "(?:\\^)");
173
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
174
+ exports.caretTrimReplace = "$1^";
175
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
176
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
177
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
178
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
179
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
180
+ exports.comparatorTrimReplace = "$1$2$3";
181
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
182
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
183
+ createToken("STAR", "(<|>)?=?\\s*\\*");
184
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
185
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
186
+ }
187
+ });
188
+
189
+ // node_modules/semver/internal/parse-options.js
190
+ var require_parse_options = __commonJS({
191
+ "node_modules/semver/internal/parse-options.js"(exports, module) {
192
+ "use strict";
193
+ var looseOption = Object.freeze({ loose: true });
194
+ var emptyOpts = Object.freeze({});
195
+ var parseOptions = (options) => {
196
+ if (!options) {
197
+ return emptyOpts;
198
+ }
199
+ if (typeof options !== "object") {
200
+ return looseOption;
201
+ }
202
+ return options;
203
+ };
204
+ module.exports = parseOptions;
205
+ }
206
+ });
207
+
208
+ // node_modules/semver/internal/identifiers.js
209
+ var require_identifiers = __commonJS({
210
+ "node_modules/semver/internal/identifiers.js"(exports, module) {
211
+ "use strict";
212
+ var numeric = /^[0-9]+$/;
213
+ var compareIdentifiers = (a, b) => {
214
+ if (typeof a === "number" && typeof b === "number") {
215
+ return a === b ? 0 : a < b ? -1 : 1;
216
+ }
217
+ const anum = numeric.test(a);
218
+ const bnum = numeric.test(b);
219
+ if (anum && bnum) {
220
+ a = +a;
221
+ b = +b;
222
+ }
223
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
224
+ };
225
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
226
+ module.exports = {
227
+ compareIdentifiers,
228
+ rcompareIdentifiers
229
+ };
230
+ }
231
+ });
232
+
233
+ // node_modules/semver/classes/semver.js
234
+ var require_semver = __commonJS({
235
+ "node_modules/semver/classes/semver.js"(exports, module) {
236
+ "use strict";
237
+ var debug = require_debug();
238
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
239
+ var { safeRe: re, t } = require_re();
240
+ var parseOptions = require_parse_options();
241
+ var { compareIdentifiers } = require_identifiers();
242
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
243
+ const identifiers = identifier.split(".");
244
+ if (identifiers.length > prerelease.length) {
245
+ return false;
246
+ }
247
+ for (let i = 0; i < identifiers.length; i++) {
248
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
249
+ return false;
250
+ }
251
+ }
252
+ return true;
253
+ };
254
+ var SemVer = class _SemVer {
255
+ constructor(version, options) {
256
+ options = parseOptions(options);
257
+ if (version instanceof _SemVer) {
258
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
259
+ return version;
260
+ } else {
261
+ version = version.version;
262
+ }
263
+ } else if (typeof version !== "string") {
264
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
265
+ }
266
+ if (version.length > MAX_LENGTH) {
267
+ throw new TypeError(
268
+ `version is longer than ${MAX_LENGTH} characters`
269
+ );
270
+ }
271
+ debug("SemVer", version, options);
272
+ this.options = options;
273
+ this.loose = !!options.loose;
274
+ this.includePrerelease = !!options.includePrerelease;
275
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
276
+ if (!m) {
277
+ throw new TypeError(`Invalid Version: ${version}`);
278
+ }
279
+ this.raw = version;
280
+ this.major = +m[1];
281
+ this.minor = +m[2];
282
+ this.patch = +m[3];
283
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
284
+ throw new TypeError("Invalid major version");
285
+ }
286
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
287
+ throw new TypeError("Invalid minor version");
288
+ }
289
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
290
+ throw new TypeError("Invalid patch version");
291
+ }
292
+ if (!m[4]) {
293
+ this.prerelease = [];
294
+ } else {
295
+ this.prerelease = m[4].split(".").map((id) => {
296
+ if (/^[0-9]+$/.test(id)) {
297
+ const num = +id;
298
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
299
+ return num;
300
+ }
301
+ }
302
+ return id;
303
+ });
304
+ }
305
+ this.build = m[5] ? m[5].split(".") : [];
306
+ this.format();
307
+ }
308
+ format() {
309
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
310
+ if (this.prerelease.length) {
311
+ this.version += `-${this.prerelease.join(".")}`;
312
+ }
313
+ return this.version;
314
+ }
315
+ toString() {
316
+ return this.version;
317
+ }
318
+ compare(other) {
319
+ debug("SemVer.compare", this.version, this.options, other);
320
+ if (!(other instanceof _SemVer)) {
321
+ if (typeof other === "string" && other === this.version) {
322
+ return 0;
323
+ }
324
+ other = new _SemVer(other, this.options);
325
+ }
326
+ if (other.version === this.version) {
327
+ return 0;
328
+ }
329
+ return this.compareMain(other) || this.comparePre(other);
330
+ }
331
+ compareMain(other) {
332
+ if (!(other instanceof _SemVer)) {
333
+ other = new _SemVer(other, this.options);
334
+ }
335
+ if (this.major < other.major) {
336
+ return -1;
337
+ }
338
+ if (this.major > other.major) {
339
+ return 1;
340
+ }
341
+ if (this.minor < other.minor) {
342
+ return -1;
343
+ }
344
+ if (this.minor > other.minor) {
345
+ return 1;
346
+ }
347
+ if (this.patch < other.patch) {
348
+ return -1;
349
+ }
350
+ if (this.patch > other.patch) {
351
+ return 1;
352
+ }
353
+ return 0;
354
+ }
355
+ comparePre(other) {
356
+ if (!(other instanceof _SemVer)) {
357
+ other = new _SemVer(other, this.options);
358
+ }
359
+ if (this.prerelease.length && !other.prerelease.length) {
360
+ return -1;
361
+ } else if (!this.prerelease.length && other.prerelease.length) {
362
+ return 1;
363
+ } else if (!this.prerelease.length && !other.prerelease.length) {
364
+ return 0;
365
+ }
366
+ let i = 0;
367
+ do {
368
+ const a = this.prerelease[i];
369
+ const b = other.prerelease[i];
370
+ debug("prerelease compare", i, a, b);
371
+ if (a === void 0 && b === void 0) {
372
+ return 0;
373
+ } else if (b === void 0) {
374
+ return 1;
375
+ } else if (a === void 0) {
376
+ return -1;
377
+ } else if (a === b) {
378
+ continue;
379
+ } else {
380
+ return compareIdentifiers(a, b);
381
+ }
382
+ } while (++i);
383
+ }
384
+ compareBuild(other) {
385
+ if (!(other instanceof _SemVer)) {
386
+ other = new _SemVer(other, this.options);
387
+ }
388
+ let i = 0;
389
+ do {
390
+ const a = this.build[i];
391
+ const b = other.build[i];
392
+ debug("build compare", i, a, b);
393
+ if (a === void 0 && b === void 0) {
394
+ return 0;
395
+ } else if (b === void 0) {
396
+ return 1;
397
+ } else if (a === void 0) {
398
+ return -1;
399
+ } else if (a === b) {
400
+ continue;
401
+ } else {
402
+ return compareIdentifiers(a, b);
403
+ }
404
+ } while (++i);
405
+ }
406
+ // preminor will bump the version up to the next minor release, and immediately
407
+ // down to pre-release. premajor and prepatch work the same way.
408
+ inc(release, identifier, identifierBase) {
409
+ if (release.startsWith("pre")) {
410
+ if (!identifier && identifierBase === false) {
411
+ throw new Error("invalid increment argument: identifier is empty");
412
+ }
413
+ if (identifier) {
414
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
415
+ if (!match || match[1] !== identifier) {
416
+ throw new Error(`invalid identifier: ${identifier}`);
417
+ }
418
+ }
419
+ }
420
+ switch (release) {
421
+ case "premajor":
422
+ this.prerelease.length = 0;
423
+ this.patch = 0;
424
+ this.minor = 0;
425
+ this.major++;
426
+ this.inc("pre", identifier, identifierBase);
427
+ break;
428
+ case "preminor":
429
+ this.prerelease.length = 0;
430
+ this.patch = 0;
431
+ this.minor++;
432
+ this.inc("pre", identifier, identifierBase);
433
+ break;
434
+ case "prepatch":
435
+ this.prerelease.length = 0;
436
+ this.inc("patch", identifier, identifierBase);
437
+ this.inc("pre", identifier, identifierBase);
438
+ break;
439
+ // If the input is a non-prerelease version, this acts the same as
440
+ // prepatch.
441
+ case "prerelease":
442
+ if (this.prerelease.length === 0) {
443
+ this.inc("patch", identifier, identifierBase);
444
+ }
445
+ this.inc("pre", identifier, identifierBase);
446
+ break;
447
+ case "release":
448
+ if (this.prerelease.length === 0) {
449
+ throw new Error(`version ${this.raw} is not a prerelease`);
450
+ }
451
+ this.prerelease.length = 0;
452
+ break;
453
+ case "major":
454
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
455
+ this.major++;
456
+ }
457
+ this.minor = 0;
458
+ this.patch = 0;
459
+ this.prerelease = [];
460
+ break;
461
+ case "minor":
462
+ if (this.patch !== 0 || this.prerelease.length === 0) {
463
+ this.minor++;
464
+ }
465
+ this.patch = 0;
466
+ this.prerelease = [];
467
+ break;
468
+ case "patch":
469
+ if (this.prerelease.length === 0) {
470
+ this.patch++;
471
+ }
472
+ this.prerelease = [];
473
+ break;
474
+ // This probably shouldn't be used publicly.
475
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
476
+ case "pre": {
477
+ const base = Number(identifierBase) ? 1 : 0;
478
+ if (this.prerelease.length === 0) {
479
+ this.prerelease = [base];
480
+ } else {
481
+ let i = this.prerelease.length;
482
+ while (--i >= 0) {
483
+ if (typeof this.prerelease[i] === "number") {
484
+ this.prerelease[i]++;
485
+ i = -2;
486
+ }
487
+ }
488
+ if (i === -1) {
489
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
490
+ throw new Error("invalid increment argument: identifier already exists");
491
+ }
492
+ this.prerelease.push(base);
493
+ }
494
+ }
495
+ if (identifier) {
496
+ let prerelease = [identifier, base];
497
+ if (identifierBase === false) {
498
+ prerelease = [identifier];
499
+ }
500
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
501
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
502
+ if (isNaN(prereleaseBase)) {
503
+ this.prerelease = prerelease;
504
+ }
505
+ } else {
506
+ this.prerelease = prerelease;
507
+ }
508
+ }
509
+ break;
510
+ }
511
+ default:
512
+ throw new Error(`invalid increment argument: ${release}`);
513
+ }
514
+ this.raw = this.format();
515
+ if (this.build.length) {
516
+ this.raw += `+${this.build.join(".")}`;
517
+ }
518
+ return this;
519
+ }
520
+ };
521
+ module.exports = SemVer;
522
+ }
523
+ });
524
+
525
+ // node_modules/semver/functions/parse.js
526
+ var require_parse = __commonJS({
527
+ "node_modules/semver/functions/parse.js"(exports, module) {
528
+ "use strict";
529
+ var SemVer = require_semver();
530
+ var parse = (version, options, throwErrors = false) => {
531
+ if (version instanceof SemVer) {
532
+ return version;
533
+ }
534
+ try {
535
+ return new SemVer(version, options);
536
+ } catch (er) {
537
+ if (!throwErrors) {
538
+ return null;
539
+ }
540
+ throw er;
541
+ }
542
+ };
543
+ module.exports = parse;
544
+ }
545
+ });
546
+
547
+ // node_modules/semver/functions/valid.js
548
+ var require_valid = __commonJS({
549
+ "node_modules/semver/functions/valid.js"(exports, module) {
550
+ "use strict";
551
+ var parse = require_parse();
552
+ var valid = (version, options) => {
553
+ const v = parse(version, options);
554
+ return v ? v.version : null;
555
+ };
556
+ module.exports = valid;
557
+ }
558
+ });
559
+
560
+ // node_modules/semver/functions/clean.js
561
+ var require_clean = __commonJS({
562
+ "node_modules/semver/functions/clean.js"(exports, module) {
563
+ "use strict";
564
+ var parse = require_parse();
565
+ var clean = (version, options) => {
566
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
567
+ return s ? s.version : null;
568
+ };
569
+ module.exports = clean;
570
+ }
571
+ });
572
+
573
+ // node_modules/semver/functions/inc.js
574
+ var require_inc = __commonJS({
575
+ "node_modules/semver/functions/inc.js"(exports, module) {
576
+ "use strict";
577
+ var SemVer = require_semver();
578
+ var inc = (version, release, options, identifier, identifierBase) => {
579
+ if (typeof options === "string") {
580
+ identifierBase = identifier;
581
+ identifier = options;
582
+ options = void 0;
583
+ }
584
+ try {
585
+ return new SemVer(
586
+ version instanceof SemVer ? version.version : version,
587
+ options
588
+ ).inc(release, identifier, identifierBase).version;
589
+ } catch (er) {
590
+ return null;
591
+ }
592
+ };
593
+ module.exports = inc;
594
+ }
595
+ });
596
+
597
+ // node_modules/semver/functions/diff.js
598
+ var require_diff = __commonJS({
599
+ "node_modules/semver/functions/diff.js"(exports, module) {
600
+ "use strict";
601
+ var parse = require_parse();
602
+ var diff = (version1, version2) => {
603
+ const v1 = parse(version1, null, true);
604
+ const v2 = parse(version2, null, true);
605
+ const comparison = v1.compare(v2);
606
+ if (comparison === 0) {
607
+ return null;
608
+ }
609
+ const v1Higher = comparison > 0;
610
+ const highVersion = v1Higher ? v1 : v2;
611
+ const lowVersion = v1Higher ? v2 : v1;
612
+ const highHasPre = !!highVersion.prerelease.length;
613
+ const lowHasPre = !!lowVersion.prerelease.length;
614
+ if (lowHasPre && !highHasPre) {
615
+ if (!lowVersion.patch && !lowVersion.minor) {
616
+ return "major";
617
+ }
618
+ if (lowVersion.compareMain(highVersion) === 0) {
619
+ if (lowVersion.minor && !lowVersion.patch) {
620
+ return "minor";
621
+ }
622
+ return "patch";
623
+ }
624
+ }
625
+ const prefix = highHasPre ? "pre" : "";
626
+ if (v1.major !== v2.major) {
627
+ return prefix + "major";
628
+ }
629
+ if (v1.minor !== v2.minor) {
630
+ return prefix + "minor";
631
+ }
632
+ if (v1.patch !== v2.patch) {
633
+ return prefix + "patch";
634
+ }
635
+ return "prerelease";
636
+ };
637
+ module.exports = diff;
638
+ }
639
+ });
640
+
641
+ // node_modules/semver/functions/major.js
642
+ var require_major = __commonJS({
643
+ "node_modules/semver/functions/major.js"(exports, module) {
644
+ "use strict";
645
+ var SemVer = require_semver();
646
+ var major = (a, loose) => new SemVer(a, loose).major;
647
+ module.exports = major;
648
+ }
649
+ });
650
+
651
+ // node_modules/semver/functions/minor.js
652
+ var require_minor = __commonJS({
653
+ "node_modules/semver/functions/minor.js"(exports, module) {
654
+ "use strict";
655
+ var SemVer = require_semver();
656
+ var minor = (a, loose) => new SemVer(a, loose).minor;
657
+ module.exports = minor;
658
+ }
659
+ });
660
+
661
+ // node_modules/semver/functions/patch.js
662
+ var require_patch = __commonJS({
663
+ "node_modules/semver/functions/patch.js"(exports, module) {
664
+ "use strict";
665
+ var SemVer = require_semver();
666
+ var patch = (a, loose) => new SemVer(a, loose).patch;
667
+ module.exports = patch;
668
+ }
669
+ });
670
+
671
+ // node_modules/semver/functions/prerelease.js
672
+ var require_prerelease = __commonJS({
673
+ "node_modules/semver/functions/prerelease.js"(exports, module) {
674
+ "use strict";
675
+ var parse = require_parse();
676
+ var prerelease = (version, options) => {
677
+ const parsed = parse(version, options);
678
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
679
+ };
680
+ module.exports = prerelease;
681
+ }
682
+ });
683
+
684
+ // node_modules/semver/functions/compare.js
685
+ var require_compare = __commonJS({
686
+ "node_modules/semver/functions/compare.js"(exports, module) {
687
+ "use strict";
688
+ var SemVer = require_semver();
689
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
690
+ module.exports = compare;
691
+ }
692
+ });
693
+
694
+ // node_modules/semver/functions/rcompare.js
695
+ var require_rcompare = __commonJS({
696
+ "node_modules/semver/functions/rcompare.js"(exports, module) {
697
+ "use strict";
698
+ var compare = require_compare();
699
+ var rcompare = (a, b, loose) => compare(b, a, loose);
700
+ module.exports = rcompare;
701
+ }
702
+ });
703
+
704
+ // node_modules/semver/functions/compare-loose.js
705
+ var require_compare_loose = __commonJS({
706
+ "node_modules/semver/functions/compare-loose.js"(exports, module) {
707
+ "use strict";
708
+ var compare = require_compare();
709
+ var compareLoose = (a, b) => compare(a, b, true);
710
+ module.exports = compareLoose;
711
+ }
712
+ });
713
+
714
+ // node_modules/semver/functions/compare-build.js
715
+ var require_compare_build = __commonJS({
716
+ "node_modules/semver/functions/compare-build.js"(exports, module) {
717
+ "use strict";
718
+ var SemVer = require_semver();
719
+ var compareBuild = (a, b, loose) => {
720
+ const versionA = new SemVer(a, loose);
721
+ const versionB = new SemVer(b, loose);
722
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
723
+ };
724
+ module.exports = compareBuild;
725
+ }
726
+ });
727
+
728
+ // node_modules/semver/functions/sort.js
729
+ var require_sort = __commonJS({
730
+ "node_modules/semver/functions/sort.js"(exports, module) {
731
+ "use strict";
732
+ var compareBuild = require_compare_build();
733
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
734
+ module.exports = sort;
735
+ }
736
+ });
737
+
738
+ // node_modules/semver/functions/rsort.js
739
+ var require_rsort = __commonJS({
740
+ "node_modules/semver/functions/rsort.js"(exports, module) {
741
+ "use strict";
742
+ var compareBuild = require_compare_build();
743
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
744
+ module.exports = rsort;
745
+ }
746
+ });
747
+
748
+ // node_modules/semver/functions/gt.js
749
+ var require_gt = __commonJS({
750
+ "node_modules/semver/functions/gt.js"(exports, module) {
751
+ "use strict";
752
+ var compare = require_compare();
753
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
754
+ module.exports = gt;
755
+ }
756
+ });
757
+
758
+ // node_modules/semver/functions/lt.js
759
+ var require_lt = __commonJS({
760
+ "node_modules/semver/functions/lt.js"(exports, module) {
761
+ "use strict";
762
+ var compare = require_compare();
763
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
764
+ module.exports = lt;
765
+ }
766
+ });
767
+
768
+ // node_modules/semver/functions/eq.js
769
+ var require_eq = __commonJS({
770
+ "node_modules/semver/functions/eq.js"(exports, module) {
771
+ "use strict";
772
+ var compare = require_compare();
773
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
774
+ module.exports = eq;
775
+ }
776
+ });
777
+
778
+ // node_modules/semver/functions/neq.js
779
+ var require_neq = __commonJS({
780
+ "node_modules/semver/functions/neq.js"(exports, module) {
781
+ "use strict";
782
+ var compare = require_compare();
783
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
784
+ module.exports = neq;
785
+ }
786
+ });
787
+
788
+ // node_modules/semver/functions/gte.js
789
+ var require_gte = __commonJS({
790
+ "node_modules/semver/functions/gte.js"(exports, module) {
791
+ "use strict";
792
+ var compare = require_compare();
793
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
794
+ module.exports = gte;
795
+ }
796
+ });
797
+
798
+ // node_modules/semver/functions/lte.js
799
+ var require_lte = __commonJS({
800
+ "node_modules/semver/functions/lte.js"(exports, module) {
801
+ "use strict";
802
+ var compare = require_compare();
803
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
804
+ module.exports = lte;
805
+ }
806
+ });
807
+
808
+ // node_modules/semver/functions/cmp.js
809
+ var require_cmp = __commonJS({
810
+ "node_modules/semver/functions/cmp.js"(exports, module) {
811
+ "use strict";
812
+ var eq = require_eq();
813
+ var neq = require_neq();
814
+ var gt = require_gt();
815
+ var gte = require_gte();
816
+ var lt = require_lt();
817
+ var lte = require_lte();
818
+ var cmp = (a, op, b, loose) => {
819
+ switch (op) {
820
+ case "===":
821
+ if (typeof a === "object") {
822
+ a = a.version;
823
+ }
824
+ if (typeof b === "object") {
825
+ b = b.version;
826
+ }
827
+ return a === b;
828
+ case "!==":
829
+ if (typeof a === "object") {
830
+ a = a.version;
831
+ }
832
+ if (typeof b === "object") {
833
+ b = b.version;
834
+ }
835
+ return a !== b;
836
+ case "":
837
+ case "=":
838
+ case "==":
839
+ return eq(a, b, loose);
840
+ case "!=":
841
+ return neq(a, b, loose);
842
+ case ">":
843
+ return gt(a, b, loose);
844
+ case ">=":
845
+ return gte(a, b, loose);
846
+ case "<":
847
+ return lt(a, b, loose);
848
+ case "<=":
849
+ return lte(a, b, loose);
850
+ default:
851
+ throw new TypeError(`Invalid operator: ${op}`);
852
+ }
853
+ };
854
+ module.exports = cmp;
855
+ }
856
+ });
857
+
858
+ // node_modules/semver/functions/coerce.js
859
+ var require_coerce = __commonJS({
860
+ "node_modules/semver/functions/coerce.js"(exports, module) {
861
+ "use strict";
862
+ var SemVer = require_semver();
863
+ var parse = require_parse();
864
+ var { safeRe: re, t } = require_re();
865
+ var coerce = (version, options) => {
866
+ if (version instanceof SemVer) {
867
+ return version;
868
+ }
869
+ if (typeof version === "number") {
870
+ version = String(version);
871
+ }
872
+ if (typeof version !== "string") {
873
+ return null;
874
+ }
875
+ options = options || {};
876
+ let match = null;
877
+ if (!options.rtl) {
878
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
879
+ } else {
880
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
881
+ let next;
882
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
883
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
884
+ match = next;
885
+ }
886
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
887
+ }
888
+ coerceRtlRegex.lastIndex = -1;
889
+ }
890
+ if (match === null) {
891
+ return null;
892
+ }
893
+ const major = match[2];
894
+ const minor = match[3] || "0";
895
+ const patch = match[4] || "0";
896
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
897
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
898
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
899
+ };
900
+ module.exports = coerce;
901
+ }
902
+ });
903
+
904
+ // node_modules/semver/functions/truncate.js
905
+ var require_truncate = __commonJS({
906
+ "node_modules/semver/functions/truncate.js"(exports, module) {
907
+ "use strict";
908
+ var parse = require_parse();
909
+ var constants = require_constants();
910
+ var SemVer = require_semver();
911
+ var truncate = (version, truncation, options) => {
912
+ if (!constants.RELEASE_TYPES.includes(truncation)) {
913
+ return null;
914
+ }
915
+ const clonedVersion = cloneInputVersion(version, options);
916
+ return clonedVersion && doTruncation(clonedVersion, truncation);
917
+ };
918
+ var cloneInputVersion = (version, options) => {
919
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
920
+ return parse(versionStringToParse, options);
921
+ };
922
+ var doTruncation = (version, truncation) => {
923
+ if (isPrerelease(truncation)) {
924
+ return version.version;
925
+ }
926
+ version.prerelease = [];
927
+ switch (truncation) {
928
+ case "major":
929
+ version.minor = 0;
930
+ version.patch = 0;
931
+ break;
932
+ case "minor":
933
+ version.patch = 0;
934
+ break;
935
+ }
936
+ return version.format();
937
+ };
938
+ var isPrerelease = (type) => {
939
+ return type.startsWith("pre");
940
+ };
941
+ module.exports = truncate;
942
+ }
943
+ });
944
+
945
+ // node_modules/semver/internal/lrucache.js
946
+ var require_lrucache = __commonJS({
947
+ "node_modules/semver/internal/lrucache.js"(exports, module) {
948
+ "use strict";
949
+ var LRUCache = class {
950
+ constructor() {
951
+ this.max = 1e3;
952
+ this.map = /* @__PURE__ */ new Map();
953
+ }
954
+ get(key) {
955
+ const value = this.map.get(key);
956
+ if (value === void 0) {
957
+ return void 0;
958
+ } else {
959
+ this.map.delete(key);
960
+ this.map.set(key, value);
961
+ return value;
962
+ }
963
+ }
964
+ delete(key) {
965
+ return this.map.delete(key);
966
+ }
967
+ set(key, value) {
968
+ const deleted = this.delete(key);
969
+ if (!deleted && value !== void 0) {
970
+ if (this.map.size >= this.max) {
971
+ const firstKey = this.map.keys().next().value;
972
+ this.delete(firstKey);
973
+ }
974
+ this.map.set(key, value);
975
+ }
976
+ return this;
977
+ }
978
+ };
979
+ module.exports = LRUCache;
980
+ }
981
+ });
982
+
983
+ // node_modules/semver/internal/trim-comparator-whitespace.js
984
+ var require_trim_comparator_whitespace = __commonJS({
985
+ "node_modules/semver/internal/trim-comparator-whitespace.js"(exports, module) {
986
+ "use strict";
987
+ var {
988
+ MAX_LENGTH,
989
+ MAX_SAFE_BUILD_LENGTH,
990
+ WHITESPACE_CHARACTERS
991
+ } = require_constants();
992
+ var whitespace = new Uint8Array(65536);
993
+ for (const char of WHITESPACE_CHARACTERS) {
994
+ whitespace[char.charCodeAt(0)] = 1;
995
+ }
996
+ var isWhitespace = (char) => char !== void 0 && whitespace[char.charCodeAt(0)] === 1;
997
+ var isVersionPrefix = (char) => char === "v" || char === "=" || isWhitespace(char);
998
+ var isDigit = (char) => char !== void 0 && char >= "0" && char <= "9";
999
+ var isLetter = (char) => char !== void 0 && (char >= "a" && char <= "z" || char >= "A" && char <= "Z");
1000
+ var isIdentifierCharacter = (char) => isDigit(char) || isLetter(char) || char === "-";
1001
+ var isVersionStart = (char) => isDigit(char) || char === "x" || char === "X" || char === "*";
1002
+ var findDigitsEndIndex = (range, start, limit, digitRuns) => {
1003
+ if (!isDigit(range[start])) {
1004
+ return start;
1005
+ }
1006
+ if (start >= digitRuns.start && start < digitRuns.end) {
1007
+ return Math.min(start + limit, digitRuns.end);
1008
+ }
1009
+ if (start >= digitRuns.previousStart && start < digitRuns.previousEnd) {
1010
+ return Math.min(start + limit, digitRuns.previousEnd);
1011
+ }
1012
+ let end = start + 1;
1013
+ while (isDigit(range[end])) {
1014
+ end++;
1015
+ }
1016
+ digitRuns.previousStart = digitRuns.start;
1017
+ digitRuns.previousEnd = digitRuns.end;
1018
+ digitRuns.start = start;
1019
+ digitRuns.end = end;
1020
+ return Math.min(start + limit, end);
1021
+ };
1022
+ var findVersionNumberEndIndex = (range, start, loose, digitRuns) => {
1023
+ if (!loose && range[start] === "0") {
1024
+ return start + 1;
1025
+ }
1026
+ return findDigitsEndIndex(range, start, loose ? MAX_LENGTH : MAX_LENGTH + 1, digitRuns);
1027
+ };
1028
+ var findPrereleaseIdentifierEndIndex = (range, start, loose, digitRuns) => {
1029
+ const digitsEnd = findDigitsEndIndex(range, start, MAX_LENGTH, digitRuns);
1030
+ if (isLetter(range[digitsEnd]) || range[digitsEnd] === "-") {
1031
+ let end = digitsEnd + 1;
1032
+ const limit = end + MAX_SAFE_BUILD_LENGTH;
1033
+ while (end < limit && isIdentifierCharacter(range[end])) {
1034
+ end++;
1035
+ }
1036
+ return end;
1037
+ }
1038
+ return findVersionNumberEndIndex(range, start, loose, digitRuns);
1039
+ };
1040
+ var findPrereleaseEndIndex = (range, start, loose, digitRuns) => {
1041
+ const hyphen = range[start] === "-";
1042
+ if (!loose && !hyphen) {
1043
+ return start;
1044
+ }
1045
+ const identifierStart = start + (hyphen ? 1 : 0);
1046
+ let end = findPrereleaseIdentifierEndIndex(range, identifierStart, loose, digitRuns);
1047
+ if (end === identifierStart) {
1048
+ if (!loose || !hyphen) {
1049
+ return start;
1050
+ }
1051
+ end = findPrereleaseIdentifierEndIndex(range, start, loose, digitRuns);
1052
+ }
1053
+ while (range[end] === ".") {
1054
+ const next = findPrereleaseIdentifierEndIndex(range, end + 1, loose, digitRuns);
1055
+ if (next === end + 1) {
1056
+ break;
1057
+ }
1058
+ end = next;
1059
+ }
1060
+ return end;
1061
+ };
1062
+ var findBuildIdentifierEndIndex = (range, start) => {
1063
+ let end = start;
1064
+ while (end - start < MAX_SAFE_BUILD_LENGTH && isIdentifierCharacter(range[end])) {
1065
+ end++;
1066
+ }
1067
+ return end;
1068
+ };
1069
+ var findBuildEndIndex = (range, start) => {
1070
+ if (range[start] !== "+") {
1071
+ return start;
1072
+ }
1073
+ let end = findBuildIdentifierEndIndex(range, start + 1);
1074
+ if (end === start + 1) {
1075
+ return start;
1076
+ }
1077
+ while (range[end] === ".") {
1078
+ const next = findBuildIdentifierEndIndex(range, end + 1);
1079
+ if (next === end + 1) {
1080
+ break;
1081
+ }
1082
+ end = next;
1083
+ }
1084
+ return end;
1085
+ };
1086
+ var findLooseFullVersionEndIndex = (range, start, digitRuns) => {
1087
+ let end = start;
1088
+ for (let component = 0; component < 3; component++) {
1089
+ const next = findVersionNumberEndIndex(range, end, true, digitRuns);
1090
+ if (next === end) {
1091
+ return start;
1092
+ }
1093
+ end = next;
1094
+ if (component < 2) {
1095
+ if (range[end] !== ".") {
1096
+ return start;
1097
+ }
1098
+ end++;
1099
+ }
1100
+ }
1101
+ const prereleaseEnd = findPrereleaseEndIndex(range, end, true, digitRuns);
1102
+ return findBuildEndIndex(range, prereleaseEnd);
1103
+ };
1104
+ var findPartialVersionComponentEndIndex = (range, start, digitRuns) => {
1105
+ if (isDigit(range[start])) {
1106
+ return findVersionNumberEndIndex(range, start, false, digitRuns);
1107
+ }
1108
+ return isVersionStart(range[start]) ? start + 1 : start;
1109
+ };
1110
+ var findPartialVersionEndIndex = (range, start, digitRuns) => {
1111
+ let end = findPartialVersionComponentEndIndex(range, start, digitRuns);
1112
+ for (let component = 0; component < 2; component++) {
1113
+ if (range[end] !== ".") {
1114
+ return end;
1115
+ }
1116
+ const next = findPartialVersionComponentEndIndex(range, end + 1, digitRuns);
1117
+ if (next === end + 1) {
1118
+ return end;
1119
+ }
1120
+ end = next;
1121
+ }
1122
+ const prereleaseEnd = findPrereleaseEndIndex(range, end, false, digitRuns);
1123
+ return findBuildEndIndex(range, prereleaseEnd);
1124
+ };
1125
+ var findVersionEndIndex = (range, start, digitRuns) => {
1126
+ const fullVersionEnd = findLooseFullVersionEndIndex(range, start, digitRuns);
1127
+ return fullVersionEnd !== start ? fullVersionEnd : findPartialVersionEndIndex(range, start, digitRuns);
1128
+ };
1129
+ var findRemovableWhitespaceIndex = (range, matchStart) => {
1130
+ let position = matchStart;
1131
+ if (isWhitespace(range[position])) {
1132
+ position++;
1133
+ }
1134
+ if (range[position] === "<" || range[position] === ">") {
1135
+ position++;
1136
+ }
1137
+ if (range[position] === "=") {
1138
+ position++;
1139
+ }
1140
+ return isWhitespace(range[position]) ? position : -1;
1141
+ };
1142
+ var trimComparatorWhitespace = (range) => {
1143
+ let result = "";
1144
+ let copyFrom = 0;
1145
+ let cursor = 0;
1146
+ const digitRuns = { start: -1, end: -1, previousStart: -1, previousEnd: -1 };
1147
+ while (cursor < range.length) {
1148
+ const matchStart = cursor;
1149
+ if (range[cursor] === "<" || range[cursor] === ">") {
1150
+ cursor++;
1151
+ } else if (!isVersionPrefix(range[cursor]) && !isVersionStart(range[cursor])) {
1152
+ cursor++;
1153
+ continue;
1154
+ }
1155
+ while (cursor < range.length && isVersionPrefix(range[cursor])) {
1156
+ cursor++;
1157
+ }
1158
+ if (!isVersionStart(range[cursor])) {
1159
+ continue;
1160
+ }
1161
+ const whitespacePosition = findRemovableWhitespaceIndex(range, matchStart);
1162
+ if (whitespacePosition !== -1) {
1163
+ result += range.slice(copyFrom, whitespacePosition);
1164
+ copyFrom = whitespacePosition + 1;
1165
+ }
1166
+ cursor = findVersionEndIndex(range, cursor, digitRuns);
1167
+ }
1168
+ return result + range.slice(copyFrom);
1169
+ };
1170
+ module.exports = trimComparatorWhitespace;
1171
+ }
1172
+ });
1173
+
1174
+ // node_modules/semver/classes/range.js
1175
+ var require_range = __commonJS({
1176
+ "node_modules/semver/classes/range.js"(exports, module) {
1177
+ "use strict";
1178
+ var SPACE_CHARACTERS = /\s+/g;
1179
+ var Range = class _Range {
1180
+ constructor(range, options) {
1181
+ options = parseOptions(options);
1182
+ if (range instanceof _Range) {
1183
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
1184
+ return range;
1185
+ } else {
1186
+ return new _Range(range.raw, options);
1187
+ }
1188
+ }
1189
+ if (range instanceof Comparator) {
1190
+ this.raw = range.value;
1191
+ this.set = [[range]];
1192
+ this.formatted = void 0;
1193
+ return this;
1194
+ }
1195
+ this.options = options;
1196
+ this.loose = !!options.loose;
1197
+ this.includePrerelease = !!options.includePrerelease;
1198
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
1199
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
1200
+ if (!this.set.length) {
1201
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
1202
+ }
1203
+ if (this.set.length > 1) {
1204
+ const first = this.set[0];
1205
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
1206
+ if (this.set.length === 0) {
1207
+ this.set = [first];
1208
+ } else if (this.set.length > 1) {
1209
+ for (const c of this.set) {
1210
+ if (c.length === 1 && isAny(c[0])) {
1211
+ this.set = [c];
1212
+ break;
1213
+ }
1214
+ }
1215
+ }
1216
+ }
1217
+ this.formatted = void 0;
1218
+ }
1219
+ get range() {
1220
+ if (this.formatted === void 0) {
1221
+ this.formatted = "";
1222
+ for (let i = 0; i < this.set.length; i++) {
1223
+ if (i > 0) {
1224
+ this.formatted += "||";
1225
+ }
1226
+ const comps = this.set[i];
1227
+ for (let k = 0; k < comps.length; k++) {
1228
+ if (k > 0) {
1229
+ this.formatted += " ";
1230
+ }
1231
+ this.formatted += comps[k].toString().trim();
1232
+ }
1233
+ }
1234
+ }
1235
+ return this.formatted;
1236
+ }
1237
+ format() {
1238
+ return this.range;
1239
+ }
1240
+ toString() {
1241
+ return this.range;
1242
+ }
1243
+ parseRange(range) {
1244
+ range = range.replace(BUILDSTRIPRE, "");
1245
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
1246
+ const memoKey = memoOpts + ":" + range;
1247
+ const cached = cache.get(memoKey);
1248
+ if (cached) {
1249
+ return cached;
1250
+ }
1251
+ const loose = this.options.loose;
1252
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1253
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1254
+ debug("hyphen replace", range);
1255
+ range = trimComparatorWhitespace(range);
1256
+ debug("comparator trim", range);
1257
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1258
+ debug("tilde trim", range);
1259
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1260
+ debug("caret trim", range);
1261
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1262
+ if (loose) {
1263
+ rangeList = rangeList.filter((comp) => {
1264
+ debug("loose invalid filter", comp, this.options);
1265
+ return !!comp.match(re[t.COMPARATORLOOSE]);
1266
+ });
1267
+ }
1268
+ debug("range list", rangeList);
1269
+ const rangeMap = /* @__PURE__ */ new Map();
1270
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
1271
+ for (const comp of comparators) {
1272
+ if (isNullSet(comp)) {
1273
+ return [comp];
1274
+ }
1275
+ rangeMap.set(comp.value, comp);
1276
+ }
1277
+ if (rangeMap.size > 1 && rangeMap.has("")) {
1278
+ rangeMap.delete("");
1279
+ }
1280
+ const result = [...rangeMap.values()];
1281
+ cache.set(memoKey, result);
1282
+ return result;
1283
+ }
1284
+ intersects(range, options) {
1285
+ if (!(range instanceof _Range)) {
1286
+ throw new TypeError("a Range is required");
1287
+ }
1288
+ return this.set.some((thisComparators) => {
1289
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
1290
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
1291
+ return rangeComparators.every((rangeComparator) => {
1292
+ return thisComparator.intersects(rangeComparator, options);
1293
+ });
1294
+ });
1295
+ });
1296
+ });
1297
+ }
1298
+ // if ANY of the sets match ALL of its comparators, then pass
1299
+ test(version) {
1300
+ if (!version) {
1301
+ return false;
1302
+ }
1303
+ if (typeof version === "string") {
1304
+ try {
1305
+ version = new SemVer(version, this.options);
1306
+ } catch (er) {
1307
+ return false;
1308
+ }
1309
+ }
1310
+ for (let i = 0; i < this.set.length; i++) {
1311
+ if (testSet(this.set[i], version, this.options)) {
1312
+ return true;
1313
+ }
1314
+ }
1315
+ return false;
1316
+ }
1317
+ };
1318
+ module.exports = Range;
1319
+ var LRU = require_lrucache();
1320
+ var cache = new LRU();
1321
+ var parseOptions = require_parse_options();
1322
+ var Comparator = require_comparator();
1323
+ var debug = require_debug();
1324
+ var SemVer = require_semver();
1325
+ var trimComparatorWhitespace = require_trim_comparator_whitespace();
1326
+ var {
1327
+ safeRe: re,
1328
+ src,
1329
+ t,
1330
+ tildeTrimReplace,
1331
+ caretTrimReplace
1332
+ } = require_re();
1333
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1334
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
1335
+ var isNullSet = (c) => c.value === "<0.0.0-0";
1336
+ var isAny = (c) => c.value === "";
1337
+ var isSatisfiable = (comparators, options) => {
1338
+ let result = true;
1339
+ const remainingComparators = comparators.slice();
1340
+ let testComparator = remainingComparators.pop();
1341
+ while (result && remainingComparators.length) {
1342
+ result = remainingComparators.every((otherComparator) => {
1343
+ return testComparator.intersects(otherComparator, options);
1344
+ });
1345
+ testComparator = remainingComparators.pop();
1346
+ }
1347
+ return result;
1348
+ };
1349
+ var parseComparator = (comp, options) => {
1350
+ comp = comp.replace(re[t.BUILD], "");
1351
+ debug("comp", comp, options);
1352
+ comp = replaceCarets(comp, options);
1353
+ debug("caret", comp);
1354
+ comp = replaceTildes(comp, options);
1355
+ debug("tildes", comp);
1356
+ comp = replaceXRanges(comp, options);
1357
+ debug("xrange", comp);
1358
+ comp = replaceStars(comp, options);
1359
+ debug("stars", comp);
1360
+ return comp;
1361
+ };
1362
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1363
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
1364
+ var replaceTildes = (comp, options) => {
1365
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1366
+ };
1367
+ var replaceTilde = (comp, options) => {
1368
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1369
+ const z = options.includePrerelease ? "-0" : "";
1370
+ return comp.replace(r, (_, M, m, p, pr) => {
1371
+ debug("tilde", comp, _, M, m, p, pr);
1372
+ let ret;
1373
+ if (isX(M)) {
1374
+ ret = "";
1375
+ } else if (isX(m)) {
1376
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1377
+ } else if (isX(p)) {
1378
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1379
+ } else if (pr) {
1380
+ debug("replaceTilde pr", pr);
1381
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1382
+ } else {
1383
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1384
+ }
1385
+ debug("tilde return", ret);
1386
+ return ret;
1387
+ });
1388
+ };
1389
+ var replaceCarets = (comp, options) => {
1390
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1391
+ };
1392
+ var replaceCaret = (comp, options) => {
1393
+ debug("caret", comp, options);
1394
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1395
+ const z = options.includePrerelease ? "-0" : "";
1396
+ return comp.replace(r, (_, M, m, p, pr) => {
1397
+ debug("caret", comp, _, M, m, p, pr);
1398
+ let ret;
1399
+ if (isX(M)) {
1400
+ ret = "";
1401
+ } else if (isX(m)) {
1402
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1403
+ } else if (isX(p)) {
1404
+ if (M === "0") {
1405
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1406
+ } else {
1407
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1408
+ }
1409
+ } else if (pr) {
1410
+ debug("replaceCaret pr", pr);
1411
+ if (M === "0") {
1412
+ if (m === "0") {
1413
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1414
+ } else {
1415
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1416
+ }
1417
+ } else {
1418
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1419
+ }
1420
+ } else {
1421
+ debug("no pr");
1422
+ if (M === "0") {
1423
+ if (m === "0") {
1424
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
1425
+ } else {
1426
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1427
+ }
1428
+ } else {
1429
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1430
+ }
1431
+ }
1432
+ debug("caret return", ret);
1433
+ return ret;
1434
+ });
1435
+ };
1436
+ var replaceXRanges = (comp, options) => {
1437
+ debug("replaceXRanges", comp, options);
1438
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1439
+ };
1440
+ var replaceXRange = (comp, options) => {
1441
+ comp = comp.trim();
1442
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1443
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1444
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
1445
+ if (invalidXRangeOrder(M, m, p)) {
1446
+ return comp;
1447
+ }
1448
+ const xM = isX(M);
1449
+ const xm = xM || isX(m);
1450
+ const xp = xm || isX(p);
1451
+ const anyX = xp;
1452
+ if (gtlt === "=" && anyX) {
1453
+ gtlt = "";
1454
+ }
1455
+ pr = options.includePrerelease ? "-0" : "";
1456
+ if (xM) {
1457
+ if (gtlt === ">" || gtlt === "<") {
1458
+ ret = "<0.0.0-0";
1459
+ } else {
1460
+ ret = "*";
1461
+ }
1462
+ } else if (gtlt && anyX) {
1463
+ if (xm) {
1464
+ m = 0;
1465
+ }
1466
+ p = 0;
1467
+ if (gtlt === ">") {
1468
+ gtlt = ">=";
1469
+ if (xm) {
1470
+ M = +M + 1;
1471
+ m = 0;
1472
+ p = 0;
1473
+ } else {
1474
+ m = +m + 1;
1475
+ p = 0;
1476
+ }
1477
+ } else if (gtlt === "<=") {
1478
+ gtlt = "<";
1479
+ if (xm) {
1480
+ M = +M + 1;
1481
+ } else {
1482
+ m = +m + 1;
1483
+ }
1484
+ }
1485
+ if (gtlt === "<") {
1486
+ pr = "-0";
1487
+ }
1488
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1489
+ } else if (xm) {
1490
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1491
+ } else if (xp) {
1492
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1493
+ }
1494
+ debug("xRange return", ret);
1495
+ return ret;
1496
+ });
1497
+ };
1498
+ var replaceStars = (comp, options) => {
1499
+ debug("replaceStars", comp, options);
1500
+ return comp.trim().replace(re[t.STAR], "");
1501
+ };
1502
+ var replaceGTE0 = (comp, options) => {
1503
+ debug("replaceGTE0", comp, options);
1504
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1505
+ };
1506
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1507
+ if (isX(fM)) {
1508
+ from = "";
1509
+ } else if (isX(fm)) {
1510
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1511
+ } else if (isX(fp)) {
1512
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1513
+ } else if (fpr) {
1514
+ from = `>=${from}`;
1515
+ } else {
1516
+ from = `>=${from}${incPr ? "-0" : ""}`;
1517
+ }
1518
+ if (isX(tM)) {
1519
+ to = "";
1520
+ } else if (isX(tm)) {
1521
+ to = `<${+tM + 1}.0.0-0`;
1522
+ } else if (isX(tp)) {
1523
+ to = `<${tM}.${+tm + 1}.0-0`;
1524
+ } else if (tpr) {
1525
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1526
+ } else if (incPr) {
1527
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1528
+ } else {
1529
+ to = `<=${to}`;
1530
+ }
1531
+ return `${from} ${to}`.trim();
1532
+ };
1533
+ var testSet = (set, version, options) => {
1534
+ for (let i = 0; i < set.length; i++) {
1535
+ if (!set[i].test(version)) {
1536
+ return false;
1537
+ }
1538
+ }
1539
+ if (version.prerelease.length && !options.includePrerelease) {
1540
+ for (let i = 0; i < set.length; i++) {
1541
+ debug(set[i].semver);
1542
+ if (set[i].semver === Comparator.ANY) {
1543
+ continue;
1544
+ }
1545
+ if (set[i].semver.prerelease.length > 0) {
1546
+ const allowed = set[i].semver;
1547
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1548
+ return true;
1549
+ }
1550
+ }
1551
+ }
1552
+ return false;
1553
+ }
1554
+ return true;
1555
+ };
1556
+ }
1557
+ });
1558
+
1559
+ // node_modules/semver/classes/comparator.js
1560
+ var require_comparator = __commonJS({
1561
+ "node_modules/semver/classes/comparator.js"(exports, module) {
1562
+ "use strict";
1563
+ var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
1564
+ var Comparator = class _Comparator {
1565
+ static get ANY() {
1566
+ return ANY;
1567
+ }
1568
+ constructor(comp, options) {
1569
+ options = parseOptions(options);
1570
+ if (comp instanceof _Comparator) {
1571
+ if (comp.loose === !!options.loose) {
1572
+ return comp;
1573
+ } else {
1574
+ comp = comp.value;
1575
+ }
1576
+ }
1577
+ comp = comp.trim().split(/\s+/).join(" ");
1578
+ debug("comparator", comp, options);
1579
+ this.options = options;
1580
+ this.loose = !!options.loose;
1581
+ this.parse(comp);
1582
+ if (this.semver === ANY) {
1583
+ this.value = "";
1584
+ } else {
1585
+ this.value = this.operator + this.semver.version;
1586
+ }
1587
+ debug("comp", this);
1588
+ }
1589
+ parse(comp) {
1590
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1591
+ const m = comp.match(r);
1592
+ if (!m) {
1593
+ throw new TypeError(`Invalid comparator: ${comp}`);
1594
+ }
1595
+ this.operator = m[1] !== void 0 ? m[1] : "";
1596
+ if (this.operator === "=") {
1597
+ this.operator = "";
1598
+ }
1599
+ if (!m[2]) {
1600
+ this.semver = ANY;
1601
+ } else {
1602
+ this.semver = new SemVer(m[2], this.options.loose);
1603
+ }
1604
+ }
1605
+ toString() {
1606
+ return this.value;
1607
+ }
1608
+ test(version) {
1609
+ debug("Comparator.test", version, this.options.loose);
1610
+ if (this.semver === ANY || version === ANY) {
1611
+ return true;
1612
+ }
1613
+ if (typeof version === "string") {
1614
+ try {
1615
+ version = new SemVer(version, this.options);
1616
+ } catch (er) {
1617
+ return false;
1618
+ }
1619
+ }
1620
+ return cmp(version, this.operator, this.semver, this.options);
1621
+ }
1622
+ intersects(comp, options) {
1623
+ if (!(comp instanceof _Comparator)) {
1624
+ throw new TypeError("a Comparator is required");
1625
+ }
1626
+ if (this.operator === "") {
1627
+ if (this.value === "") {
1628
+ return true;
1629
+ }
1630
+ return new Range(comp.value, options).test(this.value);
1631
+ } else if (comp.operator === "") {
1632
+ if (comp.value === "") {
1633
+ return true;
1634
+ }
1635
+ return new Range(this.value, options).test(comp.semver);
1636
+ }
1637
+ options = parseOptions(options);
1638
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1639
+ return false;
1640
+ }
1641
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1642
+ return false;
1643
+ }
1644
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1645
+ return true;
1646
+ }
1647
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1648
+ return true;
1649
+ }
1650
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1651
+ return true;
1652
+ }
1653
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1654
+ return true;
1655
+ }
1656
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1657
+ return true;
1658
+ }
1659
+ return false;
1660
+ }
1661
+ };
1662
+ module.exports = Comparator;
1663
+ var parseOptions = require_parse_options();
1664
+ var { safeRe: re, t } = require_re();
1665
+ var cmp = require_cmp();
1666
+ var debug = require_debug();
1667
+ var SemVer = require_semver();
1668
+ var Range = require_range();
1669
+ }
1670
+ });
1671
+
1672
+ // node_modules/semver/functions/satisfies.js
1673
+ var require_satisfies = __commonJS({
1674
+ "node_modules/semver/functions/satisfies.js"(exports, module) {
1675
+ "use strict";
1676
+ var Range = require_range();
1677
+ var satisfies = (version, range, options) => {
1678
+ try {
1679
+ range = new Range(range, options);
1680
+ } catch (er) {
1681
+ return false;
1682
+ }
1683
+ return range.test(version);
1684
+ };
1685
+ module.exports = satisfies;
1686
+ }
1687
+ });
1688
+
1689
+ // node_modules/semver/ranges/to-comparators.js
1690
+ var require_to_comparators = __commonJS({
1691
+ "node_modules/semver/ranges/to-comparators.js"(exports, module) {
1692
+ "use strict";
1693
+ var Range = require_range();
1694
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1695
+ module.exports = toComparators;
1696
+ }
1697
+ });
1698
+
1699
+ // node_modules/semver/ranges/max-satisfying.js
1700
+ var require_max_satisfying = __commonJS({
1701
+ "node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1702
+ "use strict";
1703
+ var SemVer = require_semver();
1704
+ var Range = require_range();
1705
+ var maxSatisfying = (versions, range, options) => {
1706
+ let max = null;
1707
+ let maxSV = null;
1708
+ let rangeObj = null;
1709
+ try {
1710
+ rangeObj = new Range(range, options);
1711
+ } catch (er) {
1712
+ return null;
1713
+ }
1714
+ versions.forEach((v) => {
1715
+ if (rangeObj.test(v)) {
1716
+ if (!max || maxSV.compare(v) === -1) {
1717
+ max = v;
1718
+ maxSV = new SemVer(max, options);
1719
+ }
1720
+ }
1721
+ });
1722
+ return max;
1723
+ };
1724
+ module.exports = maxSatisfying;
1725
+ }
1726
+ });
1727
+
1728
+ // node_modules/semver/ranges/min-satisfying.js
1729
+ var require_min_satisfying = __commonJS({
1730
+ "node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1731
+ "use strict";
1732
+ var SemVer = require_semver();
1733
+ var Range = require_range();
1734
+ var minSatisfying = (versions, range, options) => {
1735
+ let min = null;
1736
+ let minSV = null;
1737
+ let rangeObj = null;
1738
+ try {
1739
+ rangeObj = new Range(range, options);
1740
+ } catch (er) {
1741
+ return null;
1742
+ }
1743
+ versions.forEach((v) => {
1744
+ if (rangeObj.test(v)) {
1745
+ if (!min || minSV.compare(v) === 1) {
1746
+ min = v;
1747
+ minSV = new SemVer(min, options);
1748
+ }
1749
+ }
1750
+ });
1751
+ return min;
1752
+ };
1753
+ module.exports = minSatisfying;
1754
+ }
1755
+ });
1756
+
1757
+ // node_modules/semver/ranges/min-version.js
1758
+ var require_min_version = __commonJS({
1759
+ "node_modules/semver/ranges/min-version.js"(exports, module) {
1760
+ "use strict";
1761
+ var SemVer = require_semver();
1762
+ var Range = require_range();
1763
+ var gt = require_gt();
1764
+ var minVersion = (range, loose) => {
1765
+ range = new Range(range, loose);
1766
+ let minver = new SemVer("0.0.0");
1767
+ if (range.test(minver)) {
1768
+ return minver;
1769
+ }
1770
+ minver = new SemVer("0.0.0-0");
1771
+ if (range.test(minver)) {
1772
+ return minver;
1773
+ }
1774
+ minver = null;
1775
+ for (let i = 0; i < range.set.length; ++i) {
1776
+ const comparators = range.set[i];
1777
+ let setMin = null;
1778
+ comparators.forEach((comparator) => {
1779
+ const compver = new SemVer(comparator.semver.version);
1780
+ switch (comparator.operator) {
1781
+ case ">":
1782
+ if (compver.prerelease.length === 0) {
1783
+ compver.patch++;
1784
+ } else {
1785
+ compver.prerelease.push(0);
1786
+ }
1787
+ compver.raw = compver.format();
1788
+ /* fallthrough */
1789
+ case "":
1790
+ case ">=":
1791
+ if (!setMin || gt(compver, setMin)) {
1792
+ setMin = compver;
1793
+ }
1794
+ break;
1795
+ case "<":
1796
+ case "<=":
1797
+ break;
1798
+ /* istanbul ignore next */
1799
+ default:
1800
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
1801
+ }
1802
+ });
1803
+ if (setMin && (!minver || gt(minver, setMin))) {
1804
+ minver = setMin;
1805
+ }
1806
+ }
1807
+ if (minver && range.test(minver)) {
1808
+ return minver;
1809
+ }
1810
+ return null;
1811
+ };
1812
+ module.exports = minVersion;
1813
+ }
1814
+ });
1815
+
1816
+ // node_modules/semver/ranges/valid.js
1817
+ var require_valid2 = __commonJS({
1818
+ "node_modules/semver/ranges/valid.js"(exports, module) {
1819
+ "use strict";
1820
+ var Range = require_range();
1821
+ var validRange = (range, options) => {
1822
+ try {
1823
+ return new Range(range, options).range || "*";
1824
+ } catch (er) {
1825
+ return null;
1826
+ }
1827
+ };
1828
+ module.exports = validRange;
1829
+ }
1830
+ });
1831
+
1832
+ // node_modules/semver/ranges/outside.js
1833
+ var require_outside = __commonJS({
1834
+ "node_modules/semver/ranges/outside.js"(exports, module) {
1835
+ "use strict";
1836
+ var SemVer = require_semver();
1837
+ var Comparator = require_comparator();
1838
+ var { ANY } = Comparator;
1839
+ var Range = require_range();
1840
+ var satisfies = require_satisfies();
1841
+ var gt = require_gt();
1842
+ var lt = require_lt();
1843
+ var lte = require_lte();
1844
+ var gte = require_gte();
1845
+ var outside = (version, range, hilo, options) => {
1846
+ version = new SemVer(version, options);
1847
+ range = new Range(range, options);
1848
+ let gtfn, ltefn, ltfn, comp, ecomp;
1849
+ switch (hilo) {
1850
+ case ">":
1851
+ gtfn = gt;
1852
+ ltefn = lte;
1853
+ ltfn = lt;
1854
+ comp = ">";
1855
+ ecomp = ">=";
1856
+ break;
1857
+ case "<":
1858
+ gtfn = lt;
1859
+ ltefn = gte;
1860
+ ltfn = gt;
1861
+ comp = "<";
1862
+ ecomp = "<=";
1863
+ break;
1864
+ default:
1865
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
1866
+ }
1867
+ if (satisfies(version, range, options)) {
1868
+ return false;
1869
+ }
1870
+ for (let i = 0; i < range.set.length; ++i) {
1871
+ const comparators = range.set[i];
1872
+ let high = null;
1873
+ let low = null;
1874
+ comparators.forEach((comparator) => {
1875
+ if (comparator.semver === ANY) {
1876
+ comparator = new Comparator(">=0.0.0");
1877
+ }
1878
+ high = high || comparator;
1879
+ low = low || comparator;
1880
+ if (gtfn(comparator.semver, high.semver, options)) {
1881
+ high = comparator;
1882
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1883
+ low = comparator;
1884
+ }
1885
+ });
1886
+ if (high.operator === comp || high.operator === ecomp) {
1887
+ return false;
1888
+ }
1889
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1890
+ return false;
1891
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1892
+ return false;
1893
+ }
1894
+ }
1895
+ return true;
1896
+ };
1897
+ module.exports = outside;
1898
+ }
1899
+ });
1900
+
1901
+ // node_modules/semver/ranges/gtr.js
1902
+ var require_gtr = __commonJS({
1903
+ "node_modules/semver/ranges/gtr.js"(exports, module) {
1904
+ "use strict";
1905
+ var outside = require_outside();
1906
+ var gtr = (version, range, options) => outside(version, range, ">", options);
1907
+ module.exports = gtr;
1908
+ }
1909
+ });
1910
+
1911
+ // node_modules/semver/ranges/ltr.js
1912
+ var require_ltr = __commonJS({
1913
+ "node_modules/semver/ranges/ltr.js"(exports, module) {
1914
+ "use strict";
1915
+ var outside = require_outside();
1916
+ var ltr = (version, range, options) => outside(version, range, "<", options);
1917
+ module.exports = ltr;
1918
+ }
1919
+ });
1920
+
1921
+ // node_modules/semver/ranges/intersects.js
1922
+ var require_intersects = __commonJS({
1923
+ "node_modules/semver/ranges/intersects.js"(exports, module) {
1924
+ "use strict";
1925
+ var Range = require_range();
1926
+ var intersects = (r1, r2, options) => {
1927
+ r1 = new Range(r1, options);
1928
+ r2 = new Range(r2, options);
1929
+ return r1.intersects(r2, options);
1930
+ };
1931
+ module.exports = intersects;
1932
+ }
1933
+ });
1934
+
1935
+ // node_modules/semver/ranges/simplify.js
1936
+ var require_simplify = __commonJS({
1937
+ "node_modules/semver/ranges/simplify.js"(exports, module) {
1938
+ "use strict";
1939
+ var satisfies = require_satisfies();
1940
+ var compare = require_compare();
1941
+ module.exports = (versions, range, options) => {
1942
+ const set = [];
1943
+ let first = null;
1944
+ let prev = null;
1945
+ const v = versions.sort((a, b) => compare(a, b, options));
1946
+ for (const version of v) {
1947
+ const included = satisfies(version, range, options);
1948
+ if (included) {
1949
+ prev = version;
1950
+ if (!first) {
1951
+ first = version;
1952
+ }
1953
+ } else {
1954
+ if (prev) {
1955
+ set.push([first, prev]);
1956
+ }
1957
+ prev = null;
1958
+ first = null;
1959
+ }
1960
+ }
1961
+ if (first) {
1962
+ set.push([first, null]);
1963
+ }
1964
+ const ranges = [];
1965
+ for (const [min, max] of set) {
1966
+ if (min === max) {
1967
+ ranges.push(min);
1968
+ } else if (!max && min === v[0]) {
1969
+ ranges.push("*");
1970
+ } else if (!max) {
1971
+ ranges.push(`>=${min}`);
1972
+ } else if (min === v[0]) {
1973
+ ranges.push(`<=${max}`);
1974
+ } else {
1975
+ ranges.push(`${min} - ${max}`);
1976
+ }
1977
+ }
1978
+ const simplified = ranges.join(" || ");
1979
+ const original = typeof range.raw === "string" ? range.raw : String(range);
1980
+ return simplified.length < original.length ? simplified : range;
1981
+ };
1982
+ }
1983
+ });
1984
+
1985
+ // node_modules/semver/ranges/subset.js
1986
+ var require_subset = __commonJS({
1987
+ "node_modules/semver/ranges/subset.js"(exports, module) {
1988
+ "use strict";
1989
+ var Range = require_range();
1990
+ var Comparator = require_comparator();
1991
+ var { ANY } = Comparator;
1992
+ var satisfies = require_satisfies();
1993
+ var compare = require_compare();
1994
+ var subset = (sub, dom, options = {}) => {
1995
+ if (sub === dom) {
1996
+ return true;
1997
+ }
1998
+ sub = new Range(sub, options);
1999
+ dom = new Range(dom, options);
2000
+ let sawNonNull = false;
2001
+ OUTER: for (const simpleSub of sub.set) {
2002
+ for (const simpleDom of dom.set) {
2003
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
2004
+ sawNonNull = sawNonNull || isSub !== null;
2005
+ if (isSub) {
2006
+ continue OUTER;
2007
+ }
2008
+ }
2009
+ if (sawNonNull) {
2010
+ return false;
2011
+ }
2012
+ }
2013
+ return true;
2014
+ };
2015
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
2016
+ var minimumVersion = [new Comparator(">=0.0.0")];
2017
+ var simpleSubset = (sub, dom, options) => {
2018
+ if (sub === dom) {
2019
+ return true;
2020
+ }
2021
+ if (sub.length === 1 && sub[0].semver === ANY) {
2022
+ if (dom.length === 1 && dom[0].semver === ANY) {
2023
+ return true;
2024
+ } else if (options.includePrerelease) {
2025
+ sub = minimumVersionWithPreRelease;
2026
+ } else {
2027
+ sub = minimumVersion;
2028
+ }
2029
+ }
2030
+ if (dom.length === 1 && dom[0].semver === ANY) {
2031
+ if (options.includePrerelease) {
2032
+ return true;
2033
+ } else {
2034
+ dom = minimumVersion;
2035
+ }
2036
+ }
2037
+ const eqSet = /* @__PURE__ */ new Set();
2038
+ let gt, lt;
2039
+ for (const c of sub) {
2040
+ if (c.operator === ">" || c.operator === ">=") {
2041
+ gt = higherGT(gt, c, options);
2042
+ } else if (c.operator === "<" || c.operator === "<=") {
2043
+ lt = lowerLT(lt, c, options);
2044
+ } else {
2045
+ eqSet.add(c.semver);
2046
+ }
2047
+ }
2048
+ if (eqSet.size > 1) {
2049
+ return null;
2050
+ }
2051
+ let gtltComp;
2052
+ if (gt && lt) {
2053
+ gtltComp = compare(gt.semver, lt.semver, options);
2054
+ if (gtltComp > 0) {
2055
+ return null;
2056
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
2057
+ return null;
2058
+ }
2059
+ }
2060
+ for (const eq of eqSet) {
2061
+ if (gt && !satisfies(eq, String(gt), options)) {
2062
+ return null;
2063
+ }
2064
+ if (lt && !satisfies(eq, String(lt), options)) {
2065
+ return null;
2066
+ }
2067
+ for (const c of dom) {
2068
+ if (!satisfies(eq, String(c), options)) {
2069
+ return false;
2070
+ }
2071
+ }
2072
+ return true;
2073
+ }
2074
+ let higher, lower;
2075
+ let hasDomLT, hasDomGT;
2076
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
2077
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
2078
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
2079
+ needDomLTPre = false;
2080
+ }
2081
+ for (const c of dom) {
2082
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
2083
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
2084
+ if (gt) {
2085
+ if (needDomGTPre) {
2086
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
2087
+ needDomGTPre = false;
2088
+ }
2089
+ }
2090
+ if (c.operator === ">" || c.operator === ">=") {
2091
+ higher = higherGT(gt, c, options);
2092
+ if (higher === c && higher !== gt) {
2093
+ return false;
2094
+ }
2095
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) {
2096
+ return false;
2097
+ }
2098
+ }
2099
+ if (lt) {
2100
+ if (needDomLTPre) {
2101
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
2102
+ needDomLTPre = false;
2103
+ }
2104
+ }
2105
+ if (c.operator === "<" || c.operator === "<=") {
2106
+ lower = lowerLT(lt, c, options);
2107
+ if (lower === c && lower !== lt) {
2108
+ return false;
2109
+ }
2110
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) {
2111
+ return false;
2112
+ }
2113
+ }
2114
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
2115
+ return false;
2116
+ }
2117
+ }
2118
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
2119
+ return false;
2120
+ }
2121
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
2122
+ return false;
2123
+ }
2124
+ if (needDomGTPre || needDomLTPre) {
2125
+ return false;
2126
+ }
2127
+ return true;
2128
+ };
2129
+ var higherGT = (a, b, options) => {
2130
+ if (!a) {
2131
+ return b;
2132
+ }
2133
+ const comp = compare(a.semver, b.semver, options);
2134
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
2135
+ };
2136
+ var lowerLT = (a, b, options) => {
2137
+ if (!a) {
2138
+ return b;
2139
+ }
2140
+ const comp = compare(a.semver, b.semver, options);
2141
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
2142
+ };
2143
+ module.exports = subset;
2144
+ }
2145
+ });
2146
+
2147
+ // node_modules/semver/index.js
2148
+ var require_semver2 = __commonJS({
2149
+ "node_modules/semver/index.js"(exports, module) {
2150
+ "use strict";
2151
+ var internalRe = require_re();
2152
+ var constants = require_constants();
2153
+ var SemVer = require_semver();
2154
+ var identifiers = require_identifiers();
2155
+ var parse = require_parse();
2156
+ var valid = require_valid();
2157
+ var clean = require_clean();
2158
+ var inc = require_inc();
2159
+ var diff = require_diff();
2160
+ var major = require_major();
2161
+ var minor = require_minor();
2162
+ var patch = require_patch();
2163
+ var prerelease = require_prerelease();
2164
+ var compare = require_compare();
2165
+ var rcompare = require_rcompare();
2166
+ var compareLoose = require_compare_loose();
2167
+ var compareBuild = require_compare_build();
2168
+ var sort = require_sort();
2169
+ var rsort = require_rsort();
2170
+ var gt = require_gt();
2171
+ var lt = require_lt();
2172
+ var eq = require_eq();
2173
+ var neq = require_neq();
2174
+ var gte = require_gte();
2175
+ var lte = require_lte();
2176
+ var cmp = require_cmp();
2177
+ var coerce = require_coerce();
2178
+ var truncate = require_truncate();
2179
+ var Comparator = require_comparator();
2180
+ var Range = require_range();
2181
+ var satisfies = require_satisfies();
2182
+ var toComparators = require_to_comparators();
2183
+ var maxSatisfying = require_max_satisfying();
2184
+ var minSatisfying = require_min_satisfying();
2185
+ var minVersion = require_min_version();
2186
+ var validRange = require_valid2();
2187
+ var outside = require_outside();
2188
+ var gtr = require_gtr();
2189
+ var ltr = require_ltr();
2190
+ var intersects = require_intersects();
2191
+ var simplifyRange = require_simplify();
2192
+ var subset = require_subset();
2193
+ module.exports = {
2194
+ parse,
2195
+ valid,
2196
+ clean,
2197
+ inc,
2198
+ diff,
2199
+ major,
2200
+ minor,
2201
+ patch,
2202
+ prerelease,
2203
+ compare,
2204
+ rcompare,
2205
+ compareLoose,
2206
+ compareBuild,
2207
+ sort,
2208
+ rsort,
2209
+ gt,
2210
+ lt,
2211
+ eq,
2212
+ neq,
2213
+ gte,
2214
+ lte,
2215
+ cmp,
2216
+ coerce,
2217
+ truncate,
2218
+ Comparator,
2219
+ Range,
2220
+ satisfies,
2221
+ toComparators,
2222
+ maxSatisfying,
2223
+ minSatisfying,
2224
+ minVersion,
2225
+ validRange,
2226
+ outside,
2227
+ gtr,
2228
+ ltr,
2229
+ intersects,
2230
+ simplifyRange,
2231
+ subset,
2232
+ SemVer,
2233
+ re: internalRe.re,
2234
+ src: internalRe.src,
2235
+ tokens: internalRe.t,
2236
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
2237
+ RELEASE_TYPES: constants.RELEASE_TYPES,
2238
+ compareIdentifiers: identifiers.compareIdentifiers,
2239
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
2240
+ };
2241
+ }
2242
+ });
2243
+
2244
+ // src/core/config.ts
2245
+ import { homedir, platform } from "node:os";
2246
+
2247
+ // src/core/runtime.ts
2248
+ import { readFileSync } from "node:fs";
2249
+ import { dirname, join } from "node:path";
2250
+ import { fileURLToPath } from "node:url";
2251
+ var __filename = fileURLToPath(import.meta.url);
2252
+ var __dirname = dirname(__filename);
2253
+ var UNVERSIONED_DEV_BUILD = "0.0.0-semantically-released";
2254
+ function getVersion() {
2255
+ try {
2256
+ const packageJsonPath = join(__dirname, "..", "..", "package.json");
2257
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
2258
+ return packageJson.version || UNVERSIONED_DEV_BUILD;
2259
+ } catch {
2260
+ return UNVERSIONED_DEV_BUILD;
2261
+ }
2262
+ }
2263
+ var C8ctl = class {
2264
+ _activeProfile;
2265
+ _activeTenant;
2266
+ _outputMode = "text";
2267
+ _fields;
2268
+ _dryRun;
2269
+ _verbose;
2270
+ _quiet;
2271
+ _resolvedBaseUrl;
2272
+ _deps;
2273
+ env = {
2274
+ version: getVersion(),
2275
+ nodeVersion: process.version,
2276
+ platform: process.platform,
2277
+ arch: process.arch,
2278
+ cwd: process.cwd(),
2279
+ rootDir: join(__dirname, "..", "..")
2280
+ };
2281
+ /**
2282
+ * Inject dependencies that cannot be imported at module level
2283
+ * due to circular imports. Must be called once during startup,
2284
+ * before any plugin or command accesses createClient/resolveTenantId/getLogger.
2285
+ */
2286
+ init(deps) {
2287
+ if (this._deps) {
2288
+ throw new Error("c8ctl.init() must only be called once");
2289
+ }
2290
+ this._deps = deps;
2291
+ }
2292
+ createClient(profileFlag, additionalSdkConfig) {
2293
+ if (!this._deps) {
2294
+ throw new Error("c8ctl.init() must be called before createClient()");
2295
+ }
2296
+ return this._deps.createClient(profileFlag, additionalSdkConfig);
2297
+ }
2298
+ resolveTenantId(profileFlag) {
2299
+ if (!this._deps) {
2300
+ throw new Error("c8ctl.init() must be called before resolveTenantId()");
2301
+ }
2302
+ return this._deps.resolveTenantId(profileFlag);
2303
+ }
2304
+ getLogger(mode) {
2305
+ if (!this._deps) {
2306
+ throw new Error("c8ctl.init() must be called before getLogger()");
2307
+ }
2308
+ return this._deps.getLogger(mode);
2309
+ }
2310
+ getUserDataDir() {
2311
+ if (!this._deps) {
2312
+ throw new Error("c8ctl.init() must be called before getUserDataDir()");
2313
+ }
2314
+ return this._deps.getUserDataDir();
2315
+ }
2316
+ getModelerDataDir() {
2317
+ if (!this._deps) {
2318
+ throw new Error("c8ctl.init() must be called before getModelerDataDir()");
2319
+ }
2320
+ return this._deps.getModelerDataDir();
2321
+ }
2322
+ npm(options) {
2323
+ if (!this._deps) {
2324
+ throw new Error("c8ctl.init() must be called before npm()");
2325
+ }
2326
+ return options.stdout === true ? this._deps.npm(options) : this._deps.npm(options);
2327
+ }
2328
+ // Expose env properties directly for plugin compatibility
2329
+ get version() {
2330
+ return this.env.version;
2331
+ }
2332
+ get nodeVersion() {
2333
+ return this.env.nodeVersion;
2334
+ }
2335
+ get platform() {
2336
+ return this.env.platform;
2337
+ }
2338
+ get arch() {
2339
+ return this.env.arch;
2340
+ }
2341
+ get cwd() {
2342
+ return this.env.cwd;
2343
+ }
2344
+ get activeProfile() {
2345
+ return this._activeProfile;
2346
+ }
2347
+ set activeProfile(value) {
2348
+ this._activeProfile = value;
2349
+ }
2350
+ get activeTenant() {
2351
+ return this._activeTenant;
2352
+ }
2353
+ set activeTenant(value) {
2354
+ this._activeTenant = value;
2355
+ }
2356
+ get outputMode() {
2357
+ return this._outputMode;
2358
+ }
2359
+ set outputMode(value) {
2360
+ this._outputMode = value;
2361
+ }
2362
+ get fields() {
2363
+ return this._fields;
2364
+ }
2365
+ set fields(value) {
2366
+ this._fields = value;
2367
+ }
2368
+ get dryRun() {
2369
+ return this._dryRun;
2370
+ }
2371
+ set dryRun(value) {
2372
+ this._dryRun = value;
2373
+ }
2374
+ get verbose() {
2375
+ return this._verbose;
2376
+ }
2377
+ set verbose(value) {
2378
+ this._verbose = value;
2379
+ }
2380
+ get quiet() {
2381
+ return this._quiet;
2382
+ }
2383
+ set quiet(value) {
2384
+ this._quiet = value;
2385
+ }
2386
+ get resolvedBaseUrl() {
2387
+ return this._resolvedBaseUrl;
2388
+ }
2389
+ set resolvedBaseUrl(value) {
2390
+ this._resolvedBaseUrl = value;
2391
+ }
2392
+ };
2393
+ var c8ctl = new C8ctl();
2394
+
2395
+ // src/core/logger.ts
2396
+ function isRecord(value) {
2397
+ return value != null && typeof value === "object" && !Array.isArray(value);
2398
+ }
2399
+
2400
+ // src/core/config.ts
2401
+ var VALIDATION_PATTERNS = {
2402
+ URL: /^https?:\/\//,
2403
+ CAMUNDA_CLOUD_REST_URL: /^https:\/\/[a-z]+-\d+\.zeebe\.camunda\.io(:443|)\/[a-z\d-]+\/?$/
2404
+ };
2405
+ var CAMUNDA_CLOUD_URL_PATTERN = VALIDATION_PATTERNS.CAMUNDA_CLOUD_REST_URL;
2406
+ var isWindows = platform() === "win32";
2407
+
2408
+ // src/core/errors.ts
2409
+ var SilentError = class extends Error {
2410
+ constructor(message) {
2411
+ super(message);
2412
+ this.name = "SilentError";
2413
+ }
2414
+ };
2415
+ function normalizeToError(error, fallbackMessage = "Operation failed") {
2416
+ if (error instanceof Error) {
2417
+ return error;
2418
+ }
2419
+ const raw = isRecord(error) ? error : {};
2420
+ const title = typeof raw.title === "string" ? raw.title : void 0;
2421
+ const detail = typeof raw.detail === "string" ? raw.detail : void 0;
2422
+ const status = typeof raw.status === "number" ? raw.status : void 0;
2423
+ const head = [title ?? fallbackMessage, detail].filter((p) => Boolean(p)).join(": ");
2424
+ const message = status !== void 0 ? `${head} (status ${status})` : head;
2425
+ return new Error(message, { cause: error });
2426
+ }
2427
+ function renderCommandFailure(logger, message, error, { verbose = false } = {}) {
2428
+ const normalizedError = normalizeToError(error, message);
2429
+ if (verbose) {
2430
+ throw normalizedError;
2431
+ }
2432
+ if (error instanceof SilentError) {
2433
+ return;
2434
+ }
2435
+ if (normalizedError.message === message) {
2436
+ logger.error(message);
2437
+ } else {
2438
+ logger.error(message, normalizedError);
2439
+ }
2440
+ logger.info("For more details on the error, run with the --verbose flag", {
2441
+ essential: true
2442
+ });
2443
+ }
2444
+
2445
+ // src/core/node-version.ts
2446
+ var import_semver = __toESM(require_semver2(), 1);
2447
+ import { readFileSync as readFileSync2 } from "node:fs";
2448
+ import { dirname as dirname2, join as join2 } from "node:path";
2449
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
2450
+ function readRequiredNodeRange() {
2451
+ try {
2452
+ const packageJson = join2(
2453
+ dirname2(fileURLToPath2(import.meta.url)),
2454
+ "..",
2455
+ "..",
2456
+ "package.json"
2457
+ );
2458
+ const pkg = JSON.parse(readFileSync2(packageJson, "utf-8"));
2459
+ const node = isRecord(pkg) && isRecord(pkg.engines) && pkg.engines.node;
2460
+ return typeof node === "string" ? node : void 0;
2461
+ } catch {
2462
+ return void 0;
2463
+ }
2464
+ }
2465
+ var REQUIRED_NODE_RANGE = readRequiredNodeRange();
2466
+
2467
+ // src/core/update-check.ts
2468
+ var CHECK_INTERVAL_MS = 60 * 60 * 1e3;
2469
+
2470
+ // src/utils/command-local/skills-install-helpers.ts
2471
+ import { spawn } from "node:child_process";
2472
+ import {
2473
+ existsSync,
2474
+ lstatSync,
2475
+ realpathSync,
2476
+ rmSync,
2477
+ statSync,
2478
+ unlinkSync
2479
+ } from "node:fs";
2480
+ import { homedir as homedir2 } from "node:os";
2481
+ import {
2482
+ basename,
2483
+ dirname as dirname3,
2484
+ isAbsolute,
2485
+ posix,
2486
+ relative,
2487
+ resolve,
2488
+ sep,
2489
+ win32
2490
+ } from "node:path";
2491
+ var HARNESS_DETECTORS = [
2492
+ { id: "claude-code", executable: "claude" },
2493
+ { id: "github-copilot", executable: "copilot" }
2494
+ ];
2495
+ var HARNESS_ALIASES = {
2496
+ claude: "claude-code",
2497
+ copilot: "github-copilot"
2498
+ };
2499
+ var HARNESS_USER_SKILL_DIRS = {
2500
+ "github-copilot": ".copilot/skills",
2501
+ "claude-code": ".claude/skills",
2502
+ cursor: ".cursor/skills",
2503
+ codex: ".agents/skills",
2504
+ "gemini-cli": ".gemini/skills",
2505
+ antigravity: ".gemini/antigravity/skills",
2506
+ "antigravity-cli": ".gemini/antigravity-cli/skills",
2507
+ "antigravity2.0": ".gemini/config/skills",
2508
+ adal: ".adal/skills",
2509
+ amp: ".config/agents/skills",
2510
+ augment: ".augment/skills",
2511
+ bob: ".bob/skills",
2512
+ cline: ".agents/skills",
2513
+ codebuddy: ".codebuddy/skills",
2514
+ "command-code": ".commandcode/skills",
2515
+ continue: ".continue/skills",
2516
+ cortex: ".snowflake/cortex/skills",
2517
+ crush: ".config/crush/skills",
2518
+ deepagents: ".deepagents/agent/skills",
2519
+ devin: ".devin/skills",
2520
+ droid: ".factory/skills",
2521
+ firebender: ".firebender/skills",
2522
+ goose: ".config/goose/skills",
2523
+ grok: ".grok/skills",
2524
+ "iflow-cli": ".iflow/skills",
2525
+ junie: ".junie/skills",
2526
+ kilo: ".kilocode/skills",
2527
+ "kimi-cli": ".config/agents/skills",
2528
+ "kiro-cli": ".kiro/skills",
2529
+ kode: ".kode/skills",
2530
+ mcpjam: ".mcpjam/skills",
2531
+ "mistral-vibe": ".vibe/skills",
2532
+ mux: ".mux/skills",
2533
+ neovate: ".neovate/skills",
2534
+ openclaw: ".openclaw/skills",
2535
+ opencode: ".config/opencode/skills",
2536
+ openhands: ".openhands/skills",
2537
+ pi: ".pi/agent/skills",
2538
+ pochi: ".pochi/skills",
2539
+ qoder: ".qoder/skills",
2540
+ "qwen-code": ".qwen/skills",
2541
+ replit: ".config/agents/skills",
2542
+ roo: ".roo/skills",
2543
+ trae: ".trae/skills",
2544
+ "trae-cn": ".trae-cn/skills",
2545
+ universal: ".agents/skills",
2546
+ warp: ".agents/skills",
2547
+ zencoder: ".zencoder/skills"
2548
+ };
2549
+ var CAMUNDA_SKILLS_REPOSITORY = "camunda/skills";
2550
+ var CAMUNDA_SKILLS_URL = `https://github.com/${CAMUNDA_SKILLS_REPOSITORY}`;
2551
+ function normalizeSkillHarness(value) {
2552
+ const normalized = value.trim().toLowerCase();
2553
+ if (!/^[a-z0-9][a-z0-9.-]*$/.test(normalized)) {
2554
+ throw new Error(
2555
+ "Invalid harness ID. Use a non-empty GitHub CLI skill agent ID, such as claude-code, github-copilot, or cursor."
2556
+ );
2557
+ }
2558
+ return Object.hasOwn(HARNESS_ALIASES, normalized) ? HARNESS_ALIASES[normalized] : normalized;
2559
+ }
2560
+ function buildSkillInstallArgs(harness) {
2561
+ return [
2562
+ "skill",
2563
+ "install",
2564
+ CAMUNDA_SKILLS_REPOSITORY,
2565
+ "--all",
2566
+ "--agent",
2567
+ harness,
2568
+ "--scope",
2569
+ "user"
2570
+ ];
2571
+ }
2572
+ function buildSkillListArgs(harness) {
2573
+ return [
2574
+ "skill",
2575
+ "list",
2576
+ "--agent",
2577
+ harness,
2578
+ "--scope",
2579
+ "user",
2580
+ "--json",
2581
+ "skillName,sourceURL,path"
2582
+ ];
2583
+ }
2584
+ function buildSkillDiscoveryArgs() {
2585
+ return ["skill", "install", CAMUNDA_SKILLS_REPOSITORY];
2586
+ }
2587
+ function buildSkillInstallSpecificArgs({
2588
+ harness,
2589
+ skill
2590
+ }) {
2591
+ return [
2592
+ "skill",
2593
+ "install",
2594
+ CAMUNDA_SKILLS_REPOSITORY,
2595
+ skill,
2596
+ "--agent",
2597
+ harness,
2598
+ "--scope",
2599
+ "user"
2600
+ ];
2601
+ }
2602
+ function buildSkillUpdateArgs(skills, directory) {
2603
+ return ["skill", "update", "--all", "--dir", directory, ...skills];
2604
+ }
2605
+ function installedCamundaSkills(stdout) {
2606
+ return listedSkills(stdout).camunda;
2607
+ }
2608
+ function listedSkills(stdout) {
2609
+ let parsed;
2610
+ try {
2611
+ parsed = JSON.parse(stdout);
2612
+ } catch {
2613
+ throw new Error("GitHub CLI returned invalid JSON while listing skills.");
2614
+ }
2615
+ if (!Array.isArray(parsed)) {
2616
+ throw new Error("GitHub CLI returned an invalid installed-skills list.");
2617
+ }
2618
+ const skills = [];
2619
+ const others = [];
2620
+ for (const entry of parsed) {
2621
+ if (!isRecord(entry)) continue;
2622
+ if (typeof entry.sourceURL !== "string" || entry.sourceURL.replace(/\/+$/, "").toLowerCase() !== CAMUNDA_SKILLS_URL) {
2623
+ if (typeof entry.skillName === "string") others.push(entry.skillName);
2624
+ continue;
2625
+ }
2626
+ if (typeof entry.skillName !== "string" || entry.skillName.length === 0 || typeof entry.path !== "string" || entry.path.length === 0) {
2627
+ throw new Error("GitHub CLI returned incomplete Camunda skill metadata.");
2628
+ }
2629
+ skills.push({
2630
+ name: entry.skillName,
2631
+ directory: dirname3(entry.path),
2632
+ path: entry.path
2633
+ });
2634
+ }
2635
+ return { camunda: skills, others };
2636
+ }
2637
+ function availableCamundaSkills(stdout) {
2638
+ const names = stdout.split(/\r?\n/).filter((line) => line.includes(" ")).map((line) => line.split(" ", 1)[0].trim()).filter((name) => name.length > 0);
2639
+ if (names.length === 0) {
2640
+ throw new Error("GitHub CLI returned no available Camunda skills.");
2641
+ }
2642
+ if (names.some((name) => !/^[a-z0-9][a-z0-9._/-]*$/i.test(name))) {
2643
+ throw new Error(
2644
+ "GitHub CLI returned an invalid available Camunda skills list."
2645
+ );
2646
+ }
2647
+ return [...new Set(names)];
2648
+ }
2649
+ function joinForPlatform(platform2, ...paths) {
2650
+ return platform2 === "win32" ? win32.join(...paths) : posix.join(...paths);
2651
+ }
2652
+ function harnessConfigDirectories({
2653
+ harness,
2654
+ env,
2655
+ home,
2656
+ platform: platform2
2657
+ }) {
2658
+ if (harness === "claude-code") {
2659
+ return [
2660
+ ...env.CLAUDE_CONFIG_DIR ? [env.CLAUDE_CONFIG_DIR] : [],
2661
+ joinForPlatform(platform2, home, ".claude")
2662
+ ];
2663
+ }
2664
+ if (harness === "github-copilot") {
2665
+ return [joinForPlatform(platform2, home, ".copilot")];
2666
+ }
2667
+ return [];
2668
+ }
2669
+ function executableIsOnPath({
2670
+ name,
2671
+ env,
2672
+ platform: platform2
2673
+ }) {
2674
+ const pathSeparator = platform2 === "win32" ? ";" : ":";
2675
+ const directories = (env.PATH ?? "").split(pathSeparator).filter((directory) => directory.length > 0);
2676
+ const extensions = platform2 === "win32" ? (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((extension) => extension.length > 0) : [""];
2677
+ return directories.some(
2678
+ (directory) => extensions.some(
2679
+ (extension) => existsSync(joinForPlatform(platform2, directory, `${name}${extension}`))
2680
+ )
2681
+ );
2682
+ }
2683
+ function detectInstalledHarnesses({
2684
+ env = process.env,
2685
+ home,
2686
+ platform: platform2 = process.platform
2687
+ } = {}) {
2688
+ const userHome = home ?? (platform2 === "win32" ? env.USERPROFILE || env.HOME || homedir2() : env.HOME || homedir2());
2689
+ return HARNESS_DETECTORS.filter(
2690
+ ({ id, executable }) => harnessConfigDirectories({
2691
+ harness: id,
2692
+ env,
2693
+ home: userHome,
2694
+ platform: platform2
2695
+ }).some((directory) => existsSync(directory)) || executableIsOnPath({ name: executable, env, platform: platform2 })
2696
+ ).map(({ id }) => id);
2697
+ }
2698
+ function runCommand(command, args) {
2699
+ return new Promise((resolveRun) => {
2700
+ const child = spawn(command, args);
2701
+ let stdout = "";
2702
+ let stderr = "";
2703
+ child.stdout?.setEncoding("utf8");
2704
+ child.stderr?.setEncoding("utf8");
2705
+ child.stdout?.on("data", (chunk) => {
2706
+ stdout += chunk;
2707
+ });
2708
+ child.stderr?.on("data", (chunk) => {
2709
+ stderr += chunk;
2710
+ });
2711
+ let settled = false;
2712
+ const done = (result) => {
2713
+ if (settled) return;
2714
+ settled = true;
2715
+ resolveRun(result);
2716
+ };
2717
+ child.on("error", (error) => done({ status: null, stdout, stderr, error }));
2718
+ child.on("close", (status) => done({ status, stdout, stderr }));
2719
+ });
2720
+ }
2721
+ async function listCamundaSkills(harness, runner = runCommand) {
2722
+ const listed = await runner("gh", buildSkillListArgs(harness));
2723
+ requireSuccessfulSkillCommand(listed, "check for installed");
2724
+ return installedCamundaSkills(listed.stdout).map((skill) => ({
2725
+ ...skill,
2726
+ harness
2727
+ }));
2728
+ }
2729
+ function isWithinPath(root, candidate) {
2730
+ const relativePath = relative(root, candidate);
2731
+ return relativePath === "" || relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath);
2732
+ }
2733
+ function harnessSkillDirectories({
2734
+ harness,
2735
+ env,
2736
+ home,
2737
+ platform: platform2
2738
+ }) {
2739
+ const directories = [];
2740
+ if (harness === "claude-code" && env.CLAUDE_CONFIG_DIR) {
2741
+ directories.push(
2742
+ joinForPlatform(platform2, env.CLAUDE_CONFIG_DIR, "skills")
2743
+ );
2744
+ }
2745
+ if (harness === "pi" && env.PI_CODING_AGENT_DIR) {
2746
+ directories.push(
2747
+ joinForPlatform(platform2, env.PI_CODING_AGENT_DIR, "skills")
2748
+ );
2749
+ }
2750
+ const userDir = HARNESS_USER_SKILL_DIRS[harness];
2751
+ if (userDir) {
2752
+ directories.push(joinForPlatform(platform2, home, userDir));
2753
+ }
2754
+ return directories.map((directory) => resolve(directory));
2755
+ }
2756
+ function skillRemovalLocation(skill, { env = process.env, home, platform: platform2 = process.platform }) {
2757
+ const userHome = home ?? (platform2 === "win32" ? env.USERPROFILE || env.HOME || homedir2() : env.HOME || homedir2());
2758
+ if (!isAbsolute(skill.path)) {
2759
+ throw new Error(
2760
+ `Cannot safely remove Camunda skill "${skill.name}": GitHub CLI returned a non-absolute path.`
2761
+ );
2762
+ }
2763
+ const directory = resolve(skill.path);
2764
+ const skillName = skill.name.split(/[\\/]/).at(-1);
2765
+ if (!skillName || basename(directory) !== skillName) {
2766
+ throw new Error(
2767
+ `Cannot safely remove Camunda skill "${skill.name}": its listed path does not match the skill name.`
2768
+ );
2769
+ }
2770
+ const roots = harnessSkillDirectories({
2771
+ harness: skill.harness,
2772
+ env,
2773
+ home: userHome,
2774
+ platform: platform2
2775
+ });
2776
+ const root = roots.find(
2777
+ (candidate) => candidate !== directory && isWithinPath(candidate, directory)
2778
+ );
2779
+ if (!root) {
2780
+ throw new Error(
2781
+ `Cannot safely remove Camunda skill "${skill.name}" from ${skill.path}: the path is outside the ${skill.harness} user skills directory.`
2782
+ );
2783
+ }
2784
+ if (statSync(root, { throwIfNoEntry: false })?.isDirectory()) {
2785
+ const rootRealPath = realpathSync(root);
2786
+ const envRoots = [
2787
+ ...skill.harness === "claude-code" && env.CLAUDE_CONFIG_DIR ? [env.CLAUDE_CONFIG_DIR] : [],
2788
+ ...skill.harness === "pi" && env.PI_CODING_AGENT_DIR ? [env.PI_CODING_AGENT_DIR] : []
2789
+ ];
2790
+ const isEnvRoot = envRoots.some(
2791
+ (envRoot) => resolve(envRoot) === resolve(dirname3(root))
2792
+ );
2793
+ if (!isEnvRoot && (!statSync(userHome, { throwIfNoEntry: false })?.isDirectory() || !isWithinPath(realpathSync(resolve(userHome)), rootRealPath))) {
2794
+ throw new Error(
2795
+ `Cannot safely remove Camunda skill "${skill.name}": the ${skill.harness} user skills directory resolves outside the home directory.`
2796
+ );
2797
+ }
2798
+ const directoryInfo = lstatSync(directory, { throwIfNoEntry: false });
2799
+ if (directoryInfo && !directoryInfo.isSymbolicLink()) {
2800
+ const directoryRealPath = realpathSync(directory);
2801
+ if (!isWithinPath(rootRealPath, directoryRealPath) || directoryRealPath === rootRealPath) {
2802
+ throw new Error(
2803
+ `Cannot safely remove Camunda skill "${skill.name}": its directory resolves outside the ${skill.harness} user skills directory.`
2804
+ );
2805
+ }
2806
+ }
2807
+ }
2808
+ return { directory, root };
2809
+ }
2810
+ function camundaSkillRemovalPath(skill, options = {}) {
2811
+ return skillRemovalLocation(skill, options).directory;
2812
+ }
2813
+ function removeCamundaSkill(skill, options = {}) {
2814
+ const { directory, root } = skillRemovalLocation(skill, options);
2815
+ const directoryInfo = lstatSync(directory, { throwIfNoEntry: false });
2816
+ if (!directoryInfo) return;
2817
+ if (directoryInfo.isSymbolicLink()) {
2818
+ const rootInfo2 = statSync(root, { throwIfNoEntry: false });
2819
+ if (!rootInfo2?.isDirectory()) {
2820
+ throw new Error(
2821
+ `Cannot safely remove Camunda skill "${skill.name}": its user skills directory is unavailable.`
2822
+ );
2823
+ }
2824
+ const rootRealPath2 = realpathSync(root);
2825
+ const parentRealPath = realpathSync(dirname3(directory));
2826
+ if (!isWithinPath(rootRealPath2, parentRealPath)) {
2827
+ throw new Error(
2828
+ `Cannot safely remove Camunda skill "${skill.name}": its parent directory resolves outside the user skills directory.`
2829
+ );
2830
+ }
2831
+ unlinkSync(directory);
2832
+ return;
2833
+ }
2834
+ if (!directoryInfo.isDirectory()) {
2835
+ throw new Error(
2836
+ `Cannot safely remove Camunda skill "${skill.name}": its listed path is not a directory.`
2837
+ );
2838
+ }
2839
+ const rootInfo = statSync(root, { throwIfNoEntry: false });
2840
+ if (!rootInfo?.isDirectory()) {
2841
+ throw new Error(
2842
+ `Cannot safely remove Camunda skill "${skill.name}": its user skills directory is unavailable.`
2843
+ );
2844
+ }
2845
+ const rootRealPath = realpathSync(root);
2846
+ const directoryRealPath = realpathSync(directory);
2847
+ if (!isWithinPath(rootRealPath, directoryRealPath) || directoryRealPath === rootRealPath) {
2848
+ throw new Error(
2849
+ `Cannot safely remove Camunda skill "${skill.name}": its directory resolves outside the user skills directory.`
2850
+ );
2851
+ }
2852
+ rmSync(directory, { recursive: true });
2853
+ }
2854
+ async function runSkillInstall(harness, runner = runCommand) {
2855
+ const listed = await runner("gh", buildSkillListArgs(harness));
2856
+ requireSuccessfulSkillCommand(listed, "check for installed");
2857
+ const { camunda: installed, others } = listedSkills(listed.stdout);
2858
+ if (installed.length === 0 && others.length === 0) {
2859
+ requireSuccessfulSkillCommand(
2860
+ await runner("gh", buildSkillInstallArgs(harness)),
2861
+ "install"
2862
+ );
2863
+ return { unmanaged: [] };
2864
+ }
2865
+ const availableResult = await runner("gh", buildSkillDiscoveryArgs());
2866
+ requireSuccessfulSkillCommand(availableResult, "list available");
2867
+ const available = availableCamundaSkills(availableResult.stdout);
2868
+ const installedNames = new Set(installed.map(({ name }) => name));
2869
+ const unmanaged = available.filter((skill) => others.includes(skill));
2870
+ const missing = available.filter(
2871
+ (skill) => !installedNames.has(skill) && !unmanaged.includes(skill)
2872
+ );
2873
+ const byDirectory = /* @__PURE__ */ new Map();
2874
+ for (const skill of installed) {
2875
+ const skills = byDirectory.get(skill.directory) ?? [];
2876
+ if (!skills.includes(skill.name)) skills.push(skill.name);
2877
+ byDirectory.set(skill.directory, skills);
2878
+ }
2879
+ for (const [directory, skills] of byDirectory) {
2880
+ requireSuccessfulSkillCommand(
2881
+ await runner("gh", buildSkillUpdateArgs(skills, directory)),
2882
+ "update"
2883
+ );
2884
+ }
2885
+ for (const skill of missing) {
2886
+ requireSuccessfulSkillCommand(
2887
+ await runner("gh", buildSkillInstallSpecificArgs({ harness, skill })),
2888
+ "install"
2889
+ );
2890
+ }
2891
+ return { unmanaged };
2892
+ }
2893
+ function requireSuccessfulSkillCommand(result, action) {
2894
+ if (result.error) {
2895
+ const errorCode = "code" in result.error && typeof result.error.code === "string" ? result.error.code : void 0;
2896
+ if (errorCode === "ENOENT") {
2897
+ throw new Error(
2898
+ "GitHub CLI was not found. Install GitHub CLI 2.95 or later from https://cli.github.com/."
2899
+ );
2900
+ }
2901
+ throw new Error(`Could not run GitHub CLI: ${result.error.message}`);
2902
+ }
2903
+ if (result.status === 0) return;
2904
+ const details = [result.stderr.trim(), result.stdout.trim()].filter((output) => output.length > 0).join("\n");
2905
+ if (/unknown (command\s+["']?(skill|list)\b|flag:)/i.test(details)) {
2906
+ throw new Error(
2907
+ "`gh skill` requires GitHub CLI 2.95 or later. Upgrade GitHub CLI from https://cli.github.com/."
2908
+ );
2909
+ }
2910
+ throw new Error(
2911
+ `GitHub CLI failed to ${action} Camunda skills${result.status === null ? "" : ` (exit code ${result.status})`}: ${details || "No details were reported."}`
2912
+ );
2913
+ }
2914
+
2915
+ // default-plugins/skills/c8ctl-plugin.ts
2916
+ var HARNESS_LABELS = {
2917
+ "claude-code": "Claude Code",
2918
+ "github-copilot": "GitHub Copilot CLI",
2919
+ cursor: "Cursor"
2920
+ };
2921
+ var metadata = {
2922
+ name: "skills",
2923
+ description: "Manage Camunda AI coding skills",
2924
+ commands: {
2925
+ skills: {
2926
+ description: "Manage Camunda AI coding skills",
2927
+ helpDescription: `Manage Camunda skills installed in AI coding harnesses.
2928
+
2929
+ Requires GitHub CLI 2.95 or later; its skill commands are in preview.
2930
+ Re-run to update the same skill directories without duplicates when upstream changes. Local edits to up-to-date skills are preserved; upstream updates may replace edited files.
2931
+ To restore one skill's upstream files, use \`gh skill update --force --dir <skills-root> <skill-name>\`; pass the parent skills directory (for example \`~/.claude/skills\`), not the listed skill directory. Find names with \`gh skill list --scope user --agent <agent-id>\`. Extra local files are retained.
2932
+ Use \`skills list\` to inspect installed skills and \`skills uninstall\` to remove them (\`skills remove\` remains a compatibility alias). Removal deletes the full skill directories, including local edits. Name one or more skills to remove only those; unknown names fail before anything is deleted. When a name is installed at multiple paths, pair each positional name with a matching \`--skill-path\` value to remove only that installation. Use a GitHub CLI agent ID for --harness; see \`gh skill install --help\` for supported IDs. Pass \`--yes\` for non-interactive removal; \`--dry-run\` previews without deleting.`,
2933
+ subcommands: [
2934
+ {
2935
+ name: "install",
2936
+ description: "Install or update skills for detected harnesses"
2937
+ },
2938
+ {
2939
+ name: "list",
2940
+ description: "List installed Camunda skills by harness"
2941
+ },
2942
+ {
2943
+ name: "uninstall",
2944
+ description: "Remove installed Camunda skills"
2945
+ },
2946
+ {
2947
+ name: "remove",
2948
+ description: "Alias for uninstall"
2949
+ }
2950
+ ],
2951
+ examples: [
2952
+ {
2953
+ command: "c8ctl skills install",
2954
+ description: "Install or update skills for detected harnesses"
2955
+ },
2956
+ {
2957
+ command: "c8ctl skills install --harness claude-code",
2958
+ description: "Install or update skills for Claude Code"
2959
+ },
2960
+ {
2961
+ command: "c8ctl skills install --harness github-copilot",
2962
+ description: "Install or update skills for GitHub Copilot CLI"
2963
+ },
2964
+ {
2965
+ command: "c8ctl skills list",
2966
+ description: "List installed Camunda skills by harness"
2967
+ },
2968
+ {
2969
+ command: "c8ctl skills uninstall --dry-run",
2970
+ description: "Preview Camunda skills removal"
2971
+ },
2972
+ {
2973
+ command: "c8ctl skills uninstall camunda-c8ctl --yes",
2974
+ description: "Remove only the named Camunda skills"
2975
+ },
2976
+ {
2977
+ command: "c8ctl skills uninstall --harness claude-code --yes",
2978
+ description: "Remove Camunda skills from Claude Code"
2979
+ }
2980
+ ]
2981
+ }
2982
+ }
2983
+ };
2984
+ function resolveHarnesses(rawHarness) {
2985
+ if (rawHarness !== void 0 && (typeof rawHarness !== "string" || rawHarness === "")) {
2986
+ throw new Error("Invalid --harness: value must not be empty");
2987
+ }
2988
+ const requestedHarness = typeof rawHarness === "string" ? normalizeSkillHarness(rawHarness) : void 0;
2989
+ const harnesses = requestedHarness ? [requestedHarness] : detectInstalledHarnesses();
2990
+ if (harnesses.length === 0) {
2991
+ throw new Error(
2992
+ "No supported AI coding harness was detected. Install Claude Code or GitHub Copilot CLI, or pass --harness <agent-id>."
2993
+ );
2994
+ }
2995
+ return { harnesses, requestedHarness };
2996
+ }
2997
+ async function inspectSkills(harnesses) {
2998
+ const skills = [];
2999
+ for (const harness of harnesses) {
3000
+ skills.push(...await listCamundaSkills(harness));
3001
+ }
3002
+ return skills;
3003
+ }
3004
+ function skillRows(skills) {
3005
+ return skills.map(({ name, harness, path }) => ({ name, harness, path }));
3006
+ }
3007
+ function parseSkillPaths(rawSkillPaths) {
3008
+ if (rawSkillPaths === void 0) return void 0;
3009
+ const values = Array.isArray(rawSkillPaths) ? rawSkillPaths : [rawSkillPaths];
3010
+ const paths = [];
3011
+ for (const value of values) {
3012
+ if (typeof value !== "string" || value.length === 0) {
3013
+ throw new Error(
3014
+ "Invalid --skill-path: provide one non-empty path for each named skill."
3015
+ );
3016
+ }
3017
+ paths.push(value);
3018
+ }
3019
+ if (paths.length === 0) {
3020
+ throw new Error(
3021
+ "Invalid --skill-path: provide one non-empty path for each named skill."
3022
+ );
3023
+ }
3024
+ return paths;
3025
+ }
3026
+ function emitRowsJson(ctx, envelope, rows) {
3027
+ if (ctx.fields && ctx.fields.length > 0) {
3028
+ ctx.logger.json(rows);
3029
+ } else {
3030
+ ctx.logger.json(envelope);
3031
+ }
3032
+ }
3033
+ async function listSkills(rawHarness, ctx) {
3034
+ const { logger } = ctx;
3035
+ try {
3036
+ const { harnesses } = resolveHarnesses(rawHarness);
3037
+ const skills = await inspectSkills(harnesses);
3038
+ const rows = skillRows(skills);
3039
+ if (ctx.outputMode === "json") {
3040
+ emitRowsJson(
3041
+ ctx,
3042
+ { command: "skills list", harnesses, skills: rows },
3043
+ rows
3044
+ );
3045
+ } else if (rows.length === 0) {
3046
+ const labels = harnesses.map((harness) => HARNESS_LABELS[harness] ?? harness).join(", ");
3047
+ logger.info(`No Camunda skills are installed for ${labels}.`, {
3048
+ essential: true
3049
+ });
3050
+ } else {
3051
+ logger.table(rows);
3052
+ }
3053
+ } catch (error) {
3054
+ renderCommandFailure(logger, "Failed to skills list", error, {
3055
+ verbose: ctx.verbose
3056
+ });
3057
+ process.exitCode = 1;
3058
+ }
3059
+ }
3060
+ async function removeSkills(rawHarness, extraArgs, rawSkillPaths, ctx) {
3061
+ const { logger } = ctx;
3062
+ try {
3063
+ if (ctx.unrecognizedFlags && ctx.unrecognizedFlags.length > 0) {
3064
+ throw new Error(
3065
+ `Unknown flag${ctx.unrecognizedFlags.length === 1 ? "" : "s"} ${ctx.unrecognizedFlags.join(", ")} for 'skills uninstall'. Only --harness and --skill-path are supported removal selectors; fix or remove the flag before deleting skills.`
3066
+ );
3067
+ }
3068
+ const swallowed = ctx.suspiciousFlagValues?.[0];
3069
+ if (swallowed) {
3070
+ throw new Error(
3071
+ `"${swallowed}" looks like a flag but was passed as a value. Fix the invocation before deleting skills.`
3072
+ );
3073
+ }
3074
+ const skillPaths = parseSkillPaths(rawSkillPaths);
3075
+ if (skillPaths !== void 0 && skillPaths.length !== extraArgs.length) {
3076
+ throw new Error(
3077
+ "Provide --skill-path once for each positional skill name, in the same order; nothing was removed."
3078
+ );
3079
+ }
3080
+ const requestedNames = skillPaths === void 0 ? [...new Set(extraArgs)] : extraArgs;
3081
+ let requestedTargets;
3082
+ if (skillPaths !== void 0) {
3083
+ requestedTargets = [];
3084
+ for (const [index, path] of skillPaths.entries()) {
3085
+ const name = requestedNames[index];
3086
+ if (name === void 0) {
3087
+ throw new Error(
3088
+ "Provide --skill-path once for each positional skill name, in the same order; nothing was removed."
3089
+ );
3090
+ }
3091
+ requestedTargets.push({ name, path });
3092
+ }
3093
+ }
3094
+ const { harnesses, requestedHarness } = resolveHarnesses(rawHarness);
3095
+ const discovered = await inspectSkills(harnesses);
3096
+ if (requestedTargets !== void 0) {
3097
+ const unknown = requestedTargets.filter(
3098
+ (target) => !discovered.some(
3099
+ (skill) => skill.name === target.name && skill.path === target.path
3100
+ )
3101
+ );
3102
+ if (unknown.length > 0) {
3103
+ throw new Error(
3104
+ `Unknown Camunda skill target${unknown.length === 1 ? "" : "s"} ${unknown.map(({ name, path }) => `"${name}" (${path})`).join(
3105
+ ", "
3106
+ )} \u2014 not installed for ${harnesses.join(", ")}. Run "c8ctl skills list" for the installed set; nothing was removed.`
3107
+ );
3108
+ }
3109
+ } else if (requestedNames.length > 0) {
3110
+ const installedNames = new Set(discovered.map((skill) => skill.name));
3111
+ const unknown = requestedNames.filter(
3112
+ (name) => !installedNames.has(name)
3113
+ );
3114
+ if (unknown.length > 0) {
3115
+ throw new Error(
3116
+ `Unknown Camunda skill${unknown.length === 1 ? "" : "s"} ${unknown.map((name) => `"${name}"`).join(
3117
+ ", "
3118
+ )} \u2014 not installed for ${harnesses.join(", ")}. Run "c8ctl skills list" for the installed set; nothing was removed.`
3119
+ );
3120
+ }
3121
+ }
3122
+ const skills = requestedTargets !== void 0 ? discovered.filter(
3123
+ (skill) => requestedTargets.some(
3124
+ (target) => skill.name === target.name && skill.path === target.path
3125
+ )
3126
+ ) : requestedNames.length === 0 ? discovered : discovered.filter((skill) => requestedNames.includes(skill.name));
3127
+ for (const skill of skills) camundaSkillRemovalPath(skill);
3128
+ const items = skills.map(({ name, harness, path }) => ({
3129
+ type: "skill",
3130
+ harness,
3131
+ name,
3132
+ path
3133
+ }));
3134
+ const preview = {
3135
+ command: "skills uninstall",
3136
+ action: "remove",
3137
+ preview: true,
3138
+ items
3139
+ };
3140
+ if (ctx.dryRun) {
3141
+ emitRowsJson(ctx, { dryRun: true, ...preview }, items);
3142
+ return;
3143
+ }
3144
+ if (skills.length === 0) {
3145
+ if (ctx.outputMode === "json") {
3146
+ emitRowsJson(
3147
+ ctx,
3148
+ { command: "skills uninstall", harnesses, removed: [] },
3149
+ []
3150
+ );
3151
+ } else {
3152
+ const labels = harnesses.map((harness) => HARNESS_LABELS[harness] ?? harness).join(", ");
3153
+ logger.info(`No Camunda skills are installed for ${labels}.`, {
3154
+ essential: true
3155
+ });
3156
+ }
3157
+ return;
3158
+ }
3159
+ if (ctx.outputMode === "text") {
3160
+ logger.output(
3161
+ [
3162
+ "Skills removal preview:",
3163
+ ...skills.map(
3164
+ ({ name, harness, path }) => ` Remove Camunda skill "${name}" for ${HARNESS_LABELS[harness] ?? harness} (${path}; all contents will be removed)`
3165
+ )
3166
+ ].join("\n")
3167
+ );
3168
+ } else if (!ctx.yes) {
3169
+ emitRowsJson(ctx, preview, items);
3170
+ return;
3171
+ }
3172
+ if (!ctx.yes) {
3173
+ if (!ctx.quiet && ctx.prompt.isInteractive()) {
3174
+ const confirmation = await ctx.prompt.select({
3175
+ message: "Remove the listed Camunda skills?",
3176
+ options: [
3177
+ { label: "Keep these skills", value: false },
3178
+ { label: "Remove the listed skills", value: true }
3179
+ ]
3180
+ });
3181
+ if (confirmation.cancelled || !confirmation.value) {
3182
+ logger.info("Cancelled \u2014 nothing was removed.", {
3183
+ essential: true
3184
+ });
3185
+ return;
3186
+ }
3187
+ } else {
3188
+ if (skillPaths !== void 0) {
3189
+ logger.info(
3190
+ "Nothing was removed. Re-run the same command with --yes to confirm.",
3191
+ { essential: true }
3192
+ );
3193
+ } else {
3194
+ const command = [
3195
+ "c8ctl",
3196
+ "skills",
3197
+ "uninstall",
3198
+ ...requestedNames,
3199
+ ...requestedHarness ? ["--harness", requestedHarness] : [],
3200
+ "--yes"
3201
+ ].join(" ");
3202
+ logger.info(`Nothing was removed. Run "${command}" to confirm.`, {
3203
+ essential: true
3204
+ });
3205
+ }
3206
+ return;
3207
+ }
3208
+ }
3209
+ const revalidated = await inspectSkills(harnesses);
3210
+ const listedKeys = new Set(
3211
+ revalidated.map(
3212
+ (skill) => JSON.stringify([skill.harness, skill.name, skill.path])
3213
+ )
3214
+ );
3215
+ const stale = skills.filter(
3216
+ (skill) => !listedKeys.has(
3217
+ JSON.stringify([skill.harness, skill.name, skill.path])
3218
+ )
3219
+ );
3220
+ if (stale.length > 0) {
3221
+ throw new Error(
3222
+ `The installed-skills inventory changed after the preview: ${stale.map((skill) => `"${skill.name}" (${skill.path})`).join(
3223
+ ", "
3224
+ )}. Run "c8ctl skills uninstall" again for a fresh preview before deleting.`
3225
+ );
3226
+ }
3227
+ const removed = [];
3228
+ const failures = [];
3229
+ for (const skill of skills) {
3230
+ try {
3231
+ removeCamundaSkill(skill);
3232
+ removed.push(skill);
3233
+ } catch (error) {
3234
+ failures.push({ skill, error });
3235
+ }
3236
+ }
3237
+ if (ctx.outputMode === "json") {
3238
+ emitRowsJson(
3239
+ ctx,
3240
+ { command: "skills uninstall", removed: skillRows(removed) },
3241
+ skillRows(removed)
3242
+ );
3243
+ } else {
3244
+ for (const skill of removed) {
3245
+ logger.info(
3246
+ `Removed Camunda skill "${skill.name}" for ${HARNESS_LABELS[skill.harness] ?? skill.harness} (${skill.path}).`,
3247
+ { essential: true }
3248
+ );
3249
+ }
3250
+ logger.info(
3251
+ failures.length === 0 ? "Skills removal finished." : `Skills removal finished with ${failures.length} failed action(s).`,
3252
+ { essential: true }
3253
+ );
3254
+ }
3255
+ for (const { skill, error } of failures) {
3256
+ renderCommandFailure(
3257
+ logger,
3258
+ `Could not remove Camunda skill "${skill.name}" for ${skill.harness}`,
3259
+ error,
3260
+ { verbose: ctx.verbose }
3261
+ );
3262
+ }
3263
+ if (failures.length > 0) process.exitCode = 1;
3264
+ } catch (error) {
3265
+ renderCommandFailure(logger, "Failed to skills uninstall", error, {
3266
+ verbose: ctx.verbose
3267
+ });
3268
+ process.exitCode = 1;
3269
+ }
3270
+ }
3271
+ async function skillsHandler(args, flags, ctx) {
3272
+ if (!ctx) throw new Error("skills requires the plugin host context");
3273
+ const { logger } = ctx;
3274
+ const subcommand = args[0];
3275
+ const isUninstall = subcommand === "uninstall" || subcommand === "remove";
3276
+ if (!isUninstall && flags?.["skill-path"] !== void 0) {
3277
+ logger.error("--skill-path can only be used with 'skills uninstall'.");
3278
+ process.exitCode = 1;
3279
+ return;
3280
+ }
3281
+ if (subcommand === "list") {
3282
+ await listSkills(flags?.harness, ctx);
3283
+ return;
3284
+ }
3285
+ if (isUninstall) {
3286
+ await removeSkills(
3287
+ flags?.harness,
3288
+ args.slice(1),
3289
+ flags?.["skill-path"],
3290
+ ctx
3291
+ );
3292
+ return;
3293
+ }
3294
+ if (subcommand !== "install") {
3295
+ if (subcommand === void 0) {
3296
+ logger.info(
3297
+ "\nUsage: c8ctl skills <install|list|uninstall> [--harness <agent-id>]\n\nAvailable commands:\n install\n list\n uninstall",
3298
+ {
3299
+ essential: true
3300
+ }
3301
+ );
3302
+ } else {
3303
+ logger.error(`Unknown command: skills ${args.join(" ")}`);
3304
+ logger.info('Run "c8 help" for usage information', { essential: true });
3305
+ }
3306
+ process.exitCode = 1;
3307
+ return;
3308
+ }
3309
+ try {
3310
+ const rawHarness = flags?.harness;
3311
+ if (rawHarness !== void 0 && (typeof rawHarness !== "string" || rawHarness === "")) {
3312
+ logger.error("Invalid --harness: value must not be empty");
3313
+ process.exitCode = 1;
3314
+ return;
3315
+ }
3316
+ const requestedHarness = typeof rawHarness === "string" ? normalizeSkillHarness(rawHarness) : void 0;
3317
+ const harnesses = requestedHarness ? [requestedHarness] : detectInstalledHarnesses();
3318
+ if (harnesses.length === 0) {
3319
+ throw new Error(
3320
+ "No supported AI coding harness was detected. Install Claude Code or GitHub Copilot CLI, or pass --harness <agent-id>."
3321
+ );
3322
+ }
3323
+ if (ctx.dryRun) {
3324
+ logger.json({
3325
+ dryRun: true,
3326
+ command: "skills install",
3327
+ source: CAMUNDA_SKILLS_REPOSITORY,
3328
+ harnesses
3329
+ });
3330
+ return;
3331
+ }
3332
+ for (const harness of harnesses) {
3333
+ const { unmanaged } = await runSkillInstall(harness);
3334
+ if (unmanaged.length > 0) {
3335
+ logger.warn(
3336
+ `Kept ${unmanaged.length} Camunda skill${unmanaged.length === 1 ? "" : "s"} for ${HARNESS_LABELS[harness] ?? harness} that another tool installed: ${unmanaged.join(", ")}. Update them with that tool, or replace them so c8ctl can update them: gh skill install ${CAMUNDA_SKILLS_REPOSITORY} --all --agent ${harness} --scope user --force`
3337
+ );
3338
+ }
3339
+ }
3340
+ const labels = harnesses.map((harness) => HARNESS_LABELS[harness] ?? harness).join(", ");
3341
+ logger.success(`Installed or updated Camunda skills for ${labels}.`);
3342
+ } catch (error) {
3343
+ renderCommandFailure(logger, "Failed to skills install", error, {
3344
+ verbose: ctx.verbose
3345
+ });
3346
+ process.exitCode = 1;
3347
+ }
3348
+ }
3349
+ var commands = {
3350
+ skills: {
3351
+ flags: {
3352
+ harness: {
3353
+ type: "string",
3354
+ rejectEmpty: true,
3355
+ description: "GitHub CLI agent ID to target (auto-detects Claude Code and GitHub Copilot CLI when omitted)"
3356
+ },
3357
+ "skill-path": {
3358
+ type: "string",
3359
+ multiple: true,
3360
+ description: "During removal, match each positional skill name to one installed path; repeat once for each name"
3361
+ }
3362
+ },
3363
+ handler: skillsHandler
3364
+ }
3365
+ };
3366
+ export {
3367
+ commands,
3368
+ metadata
3369
+ };