@alpic-ai/sdk 0.0.0-dev.g84d2c4c → 0.0.0-dev.g84d33a2

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.
@@ -1,25 +1,3688 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- export function detectRuntime() {
3
- const has = (file) => existsSync(file);
4
- const read = (file) => {
5
- try {
6
- return readFileSync(file, "utf8");
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/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
32
+ var require_constants = __commonJS({
33
+ "../../node_modules/.pnpm/semver@7.8.5/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 RELEASE_TYPES = [
42
+ "major",
43
+ "premajor",
44
+ "minor",
45
+ "preminor",
46
+ "patch",
47
+ "prepatch",
48
+ "prerelease"
49
+ ];
50
+ module.exports = {
51
+ MAX_LENGTH,
52
+ MAX_SAFE_COMPONENT_LENGTH,
53
+ MAX_SAFE_BUILD_LENGTH,
54
+ MAX_SAFE_INTEGER,
55
+ RELEASE_TYPES,
56
+ SEMVER_SPEC_VERSION,
57
+ FLAG_INCLUDE_PRERELEASE: 1,
58
+ FLAG_LOOSE: 2
59
+ };
60
+ }
61
+ });
62
+
63
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
64
+ var require_debug = __commonJS({
65
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
66
+ "use strict";
67
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
68
+ };
69
+ module.exports = debug;
70
+ }
71
+ });
72
+
73
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
74
+ var require_re = __commonJS({
75
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
76
+ "use strict";
77
+ var {
78
+ MAX_SAFE_COMPONENT_LENGTH,
79
+ MAX_SAFE_BUILD_LENGTH,
80
+ MAX_LENGTH
81
+ } = require_constants();
82
+ var debug = require_debug();
83
+ exports = module.exports = {};
84
+ var re = exports.re = [];
85
+ var safeRe = exports.safeRe = [];
86
+ var src = exports.src = [];
87
+ var safeSrc = exports.safeSrc = [];
88
+ var t = exports.t = {};
89
+ var R = 0;
90
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
91
+ var safeRegexReplacements = [
92
+ ["\\s", 1],
93
+ ["\\d", MAX_LENGTH],
94
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
95
+ ];
96
+ var makeSafeRegex = (value) => {
97
+ for (const [token, max] of safeRegexReplacements) {
98
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
99
+ }
100
+ return value;
101
+ };
102
+ var createToken = (name, value, isGlobal) => {
103
+ const safe = makeSafeRegex(value);
104
+ const index = R++;
105
+ debug(name, index, value);
106
+ t[name] = index;
107
+ src[index] = value;
108
+ safeSrc[index] = safe;
109
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
110
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
111
+ };
112
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
113
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
114
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
115
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
116
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
117
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
118
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
119
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
120
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
121
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
122
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
123
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
124
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
125
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
126
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
127
+ createToken("GTLT", "((?:<|>)?=?)");
128
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
129
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
130
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
131
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
132
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
133
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
134
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
135
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
136
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
137
+ createToken("COERCERTL", src[t.COERCE], true);
138
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
139
+ createToken("LONETILDE", "(?:~>?)");
140
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
141
+ exports.tildeTrimReplace = "$1~";
142
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
143
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
144
+ createToken("LONECARET", "(?:\\^)");
145
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
146
+ exports.caretTrimReplace = "$1^";
147
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
148
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
149
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
150
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
151
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
152
+ exports.comparatorTrimReplace = "$1$2$3";
153
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
154
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
155
+ createToken("STAR", "(<|>)?=?\\s*\\*");
156
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
157
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
158
+ }
159
+ });
160
+
161
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
162
+ var require_parse_options = __commonJS({
163
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
164
+ "use strict";
165
+ var looseOption = Object.freeze({ loose: true });
166
+ var emptyOpts = Object.freeze({});
167
+ var parseOptions = (options) => {
168
+ if (!options) {
169
+ return emptyOpts;
170
+ }
171
+ if (typeof options !== "object") {
172
+ return looseOption;
173
+ }
174
+ return options;
175
+ };
176
+ module.exports = parseOptions;
177
+ }
178
+ });
179
+
180
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
181
+ var require_identifiers = __commonJS({
182
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
183
+ "use strict";
184
+ var numeric = /^[0-9]+$/;
185
+ var compareIdentifiers = (a, b) => {
186
+ if (typeof a === "number" && typeof b === "number") {
187
+ return a === b ? 0 : a < b ? -1 : 1;
188
+ }
189
+ const anum = numeric.test(a);
190
+ const bnum = numeric.test(b);
191
+ if (anum && bnum) {
192
+ a = +a;
193
+ b = +b;
194
+ }
195
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
196
+ };
197
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
198
+ module.exports = {
199
+ compareIdentifiers,
200
+ rcompareIdentifiers
201
+ };
202
+ }
203
+ });
204
+
205
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
206
+ var require_semver = __commonJS({
207
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
208
+ "use strict";
209
+ var debug = require_debug();
210
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
211
+ var { safeRe: re, t } = require_re();
212
+ var parseOptions = require_parse_options();
213
+ var { compareIdentifiers } = require_identifiers();
214
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
215
+ const identifiers = identifier.split(".");
216
+ if (identifiers.length > prerelease.length) {
217
+ return false;
218
+ }
219
+ for (let i = 0; i < identifiers.length; i++) {
220
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
221
+ return false;
222
+ }
223
+ }
224
+ return true;
225
+ };
226
+ var SemVer = class _SemVer {
227
+ constructor(version, options) {
228
+ options = parseOptions(options);
229
+ if (version instanceof _SemVer) {
230
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
231
+ return version;
232
+ } else {
233
+ version = version.version;
234
+ }
235
+ } else if (typeof version !== "string") {
236
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
237
+ }
238
+ if (version.length > MAX_LENGTH) {
239
+ throw new TypeError(
240
+ `version is longer than ${MAX_LENGTH} characters`
241
+ );
242
+ }
243
+ debug("SemVer", version, options);
244
+ this.options = options;
245
+ this.loose = !!options.loose;
246
+ this.includePrerelease = !!options.includePrerelease;
247
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
248
+ if (!m) {
249
+ throw new TypeError(`Invalid Version: ${version}`);
250
+ }
251
+ this.raw = version;
252
+ this.major = +m[1];
253
+ this.minor = +m[2];
254
+ this.patch = +m[3];
255
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
256
+ throw new TypeError("Invalid major version");
257
+ }
258
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
259
+ throw new TypeError("Invalid minor version");
260
+ }
261
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
262
+ throw new TypeError("Invalid patch version");
263
+ }
264
+ if (!m[4]) {
265
+ this.prerelease = [];
266
+ } else {
267
+ this.prerelease = m[4].split(".").map((id) => {
268
+ if (/^[0-9]+$/.test(id)) {
269
+ const num = +id;
270
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
271
+ return num;
272
+ }
273
+ }
274
+ return id;
275
+ });
276
+ }
277
+ this.build = m[5] ? m[5].split(".") : [];
278
+ this.format();
279
+ }
280
+ format() {
281
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
282
+ if (this.prerelease.length) {
283
+ this.version += `-${this.prerelease.join(".")}`;
284
+ }
285
+ return this.version;
286
+ }
287
+ toString() {
288
+ return this.version;
289
+ }
290
+ compare(other) {
291
+ debug("SemVer.compare", this.version, this.options, other);
292
+ if (!(other instanceof _SemVer)) {
293
+ if (typeof other === "string" && other === this.version) {
294
+ return 0;
295
+ }
296
+ other = new _SemVer(other, this.options);
7
297
  }
8
- catch {
9
- return "";
298
+ if (other.version === this.version) {
299
+ return 0;
10
300
  }
301
+ return this.compareMain(other) || this.comparePre(other);
302
+ }
303
+ compareMain(other) {
304
+ if (!(other instanceof _SemVer)) {
305
+ other = new _SemVer(other, this.options);
306
+ }
307
+ if (this.major < other.major) {
308
+ return -1;
309
+ }
310
+ if (this.major > other.major) {
311
+ return 1;
312
+ }
313
+ if (this.minor < other.minor) {
314
+ return -1;
315
+ }
316
+ if (this.minor > other.minor) {
317
+ return 1;
318
+ }
319
+ if (this.patch < other.patch) {
320
+ return -1;
321
+ }
322
+ if (this.patch > other.patch) {
323
+ return 1;
324
+ }
325
+ return 0;
326
+ }
327
+ comparePre(other) {
328
+ if (!(other instanceof _SemVer)) {
329
+ other = new _SemVer(other, this.options);
330
+ }
331
+ if (this.prerelease.length && !other.prerelease.length) {
332
+ return -1;
333
+ } else if (!this.prerelease.length && other.prerelease.length) {
334
+ return 1;
335
+ } else if (!this.prerelease.length && !other.prerelease.length) {
336
+ return 0;
337
+ }
338
+ let i = 0;
339
+ do {
340
+ const a = this.prerelease[i];
341
+ const b = other.prerelease[i];
342
+ debug("prerelease compare", i, a, b);
343
+ if (a === void 0 && b === void 0) {
344
+ return 0;
345
+ } else if (b === void 0) {
346
+ return 1;
347
+ } else if (a === void 0) {
348
+ return -1;
349
+ } else if (a === b) {
350
+ continue;
351
+ } else {
352
+ return compareIdentifiers(a, b);
353
+ }
354
+ } while (++i);
355
+ }
356
+ compareBuild(other) {
357
+ if (!(other instanceof _SemVer)) {
358
+ other = new _SemVer(other, this.options);
359
+ }
360
+ let i = 0;
361
+ do {
362
+ const a = this.build[i];
363
+ const b = other.build[i];
364
+ debug("build compare", i, a, b);
365
+ if (a === void 0 && b === void 0) {
366
+ return 0;
367
+ } else if (b === void 0) {
368
+ return 1;
369
+ } else if (a === void 0) {
370
+ return -1;
371
+ } else if (a === b) {
372
+ continue;
373
+ } else {
374
+ return compareIdentifiers(a, b);
375
+ }
376
+ } while (++i);
377
+ }
378
+ // preminor will bump the version up to the next minor release, and immediately
379
+ // down to pre-release. premajor and prepatch work the same way.
380
+ inc(release, identifier, identifierBase) {
381
+ if (release.startsWith("pre")) {
382
+ if (!identifier && identifierBase === false) {
383
+ throw new Error("invalid increment argument: identifier is empty");
384
+ }
385
+ if (identifier) {
386
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
387
+ if (!match || match[1] !== identifier) {
388
+ throw new Error(`invalid identifier: ${identifier}`);
389
+ }
390
+ }
391
+ }
392
+ switch (release) {
393
+ case "premajor":
394
+ this.prerelease.length = 0;
395
+ this.patch = 0;
396
+ this.minor = 0;
397
+ this.major++;
398
+ this.inc("pre", identifier, identifierBase);
399
+ break;
400
+ case "preminor":
401
+ this.prerelease.length = 0;
402
+ this.patch = 0;
403
+ this.minor++;
404
+ this.inc("pre", identifier, identifierBase);
405
+ break;
406
+ case "prepatch":
407
+ this.prerelease.length = 0;
408
+ this.inc("patch", identifier, identifierBase);
409
+ this.inc("pre", identifier, identifierBase);
410
+ break;
411
+ // If the input is a non-prerelease version, this acts the same as
412
+ // prepatch.
413
+ case "prerelease":
414
+ if (this.prerelease.length === 0) {
415
+ this.inc("patch", identifier, identifierBase);
416
+ }
417
+ this.inc("pre", identifier, identifierBase);
418
+ break;
419
+ case "release":
420
+ if (this.prerelease.length === 0) {
421
+ throw new Error(`version ${this.raw} is not a prerelease`);
422
+ }
423
+ this.prerelease.length = 0;
424
+ break;
425
+ case "major":
426
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
427
+ this.major++;
428
+ }
429
+ this.minor = 0;
430
+ this.patch = 0;
431
+ this.prerelease = [];
432
+ break;
433
+ case "minor":
434
+ if (this.patch !== 0 || this.prerelease.length === 0) {
435
+ this.minor++;
436
+ }
437
+ this.patch = 0;
438
+ this.prerelease = [];
439
+ break;
440
+ case "patch":
441
+ if (this.prerelease.length === 0) {
442
+ this.patch++;
443
+ }
444
+ this.prerelease = [];
445
+ break;
446
+ // This probably shouldn't be used publicly.
447
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
448
+ case "pre": {
449
+ const base = Number(identifierBase) ? 1 : 0;
450
+ if (this.prerelease.length === 0) {
451
+ this.prerelease = [base];
452
+ } else {
453
+ let i = this.prerelease.length;
454
+ while (--i >= 0) {
455
+ if (typeof this.prerelease[i] === "number") {
456
+ this.prerelease[i]++;
457
+ i = -2;
458
+ }
459
+ }
460
+ if (i === -1) {
461
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
462
+ throw new Error("invalid increment argument: identifier already exists");
463
+ }
464
+ this.prerelease.push(base);
465
+ }
466
+ }
467
+ if (identifier) {
468
+ let prerelease = [identifier, base];
469
+ if (identifierBase === false) {
470
+ prerelease = [identifier];
471
+ }
472
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
473
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
474
+ if (isNaN(prereleaseBase)) {
475
+ this.prerelease = prerelease;
476
+ }
477
+ } else {
478
+ this.prerelease = prerelease;
479
+ }
480
+ }
481
+ break;
482
+ }
483
+ default:
484
+ throw new Error(`invalid increment argument: ${release}`);
485
+ }
486
+ this.raw = this.format();
487
+ if (this.build.length) {
488
+ this.raw += `+${this.build.join(".")}`;
489
+ }
490
+ return this;
491
+ }
11
492
  };
12
- if (has("pyproject.toml") || has("requirements.txt") || has("setup.py") || has(".python-version")) {
13
- return "python3.13";
14
- }
15
- if (has("package.json")) {
16
- const nvmrc = has(".nvmrc") ? (read(".nvmrc").trim().split(/\s/)[0] ?? "") : "";
17
- const major = nvmrc.replace(/^v/i, "").match(/^(\d+)/)?.[1];
18
- if (major === "22") {
19
- return "node22";
493
+ module.exports = SemVer;
494
+ }
495
+ });
496
+
497
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
498
+ var require_parse = __commonJS({
499
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
500
+ "use strict";
501
+ var SemVer = require_semver();
502
+ var parse = (version, options, throwErrors = false) => {
503
+ if (version instanceof SemVer) {
504
+ return version;
505
+ }
506
+ try {
507
+ return new SemVer(version, options);
508
+ } catch (er) {
509
+ if (!throwErrors) {
510
+ return null;
20
511
  }
21
- return "node24";
22
- }
512
+ throw er;
513
+ }
514
+ };
515
+ module.exports = parse;
516
+ }
517
+ });
518
+
519
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
520
+ var require_valid = __commonJS({
521
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
522
+ "use strict";
523
+ var parse = require_parse();
524
+ var valid = (version, options) => {
525
+ const v = parse(version, options);
526
+ return v ? v.version : null;
527
+ };
528
+ module.exports = valid;
529
+ }
530
+ });
531
+
532
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
533
+ var require_clean = __commonJS({
534
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module) {
535
+ "use strict";
536
+ var parse = require_parse();
537
+ var clean = (version, options) => {
538
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
539
+ return s ? s.version : null;
540
+ };
541
+ module.exports = clean;
542
+ }
543
+ });
544
+
545
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
546
+ var require_inc = __commonJS({
547
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module) {
548
+ "use strict";
549
+ var SemVer = require_semver();
550
+ var inc = (version, release, options, identifier, identifierBase) => {
551
+ if (typeof options === "string") {
552
+ identifierBase = identifier;
553
+ identifier = options;
554
+ options = void 0;
555
+ }
556
+ try {
557
+ return new SemVer(
558
+ version instanceof SemVer ? version.version : version,
559
+ options
560
+ ).inc(release, identifier, identifierBase).version;
561
+ } catch (er) {
562
+ return null;
563
+ }
564
+ };
565
+ module.exports = inc;
566
+ }
567
+ });
568
+
569
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
570
+ var require_diff = __commonJS({
571
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module) {
572
+ "use strict";
573
+ var parse = require_parse();
574
+ var diff = (version1, version2) => {
575
+ const v1 = parse(version1, null, true);
576
+ const v2 = parse(version2, null, true);
577
+ const comparison = v1.compare(v2);
578
+ if (comparison === 0) {
579
+ return null;
580
+ }
581
+ const v1Higher = comparison > 0;
582
+ const highVersion = v1Higher ? v1 : v2;
583
+ const lowVersion = v1Higher ? v2 : v1;
584
+ const highHasPre = !!highVersion.prerelease.length;
585
+ const lowHasPre = !!lowVersion.prerelease.length;
586
+ if (lowHasPre && !highHasPre) {
587
+ if (!lowVersion.patch && !lowVersion.minor) {
588
+ return "major";
589
+ }
590
+ if (lowVersion.compareMain(highVersion) === 0) {
591
+ if (lowVersion.minor && !lowVersion.patch) {
592
+ return "minor";
593
+ }
594
+ return "patch";
595
+ }
596
+ }
597
+ const prefix = highHasPre ? "pre" : "";
598
+ if (v1.major !== v2.major) {
599
+ return prefix + "major";
600
+ }
601
+ if (v1.minor !== v2.minor) {
602
+ return prefix + "minor";
603
+ }
604
+ if (v1.patch !== v2.patch) {
605
+ return prefix + "patch";
606
+ }
607
+ return "prerelease";
608
+ };
609
+ module.exports = diff;
610
+ }
611
+ });
612
+
613
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
614
+ var require_major = __commonJS({
615
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module) {
616
+ "use strict";
617
+ var SemVer = require_semver();
618
+ var major = (a, loose) => new SemVer(a, loose).major;
619
+ module.exports = major;
620
+ }
621
+ });
622
+
623
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
624
+ var require_minor = __commonJS({
625
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module) {
626
+ "use strict";
627
+ var SemVer = require_semver();
628
+ var minor = (a, loose) => new SemVer(a, loose).minor;
629
+ module.exports = minor;
630
+ }
631
+ });
632
+
633
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
634
+ var require_patch = __commonJS({
635
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module) {
636
+ "use strict";
637
+ var SemVer = require_semver();
638
+ var patch = (a, loose) => new SemVer(a, loose).patch;
639
+ module.exports = patch;
640
+ }
641
+ });
642
+
643
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
644
+ var require_prerelease = __commonJS({
645
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module) {
646
+ "use strict";
647
+ var parse = require_parse();
648
+ var prerelease = (version, options) => {
649
+ const parsed = parse(version, options);
650
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
651
+ };
652
+ module.exports = prerelease;
653
+ }
654
+ });
655
+
656
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
657
+ var require_compare = __commonJS({
658
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
659
+ "use strict";
660
+ var SemVer = require_semver();
661
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
662
+ module.exports = compare;
663
+ }
664
+ });
665
+
666
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
667
+ var require_rcompare = __commonJS({
668
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module) {
669
+ "use strict";
670
+ var compare = require_compare();
671
+ var rcompare = (a, b, loose) => compare(b, a, loose);
672
+ module.exports = rcompare;
673
+ }
674
+ });
675
+
676
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
677
+ var require_compare_loose = __commonJS({
678
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
679
+ "use strict";
680
+ var compare = require_compare();
681
+ var compareLoose = (a, b) => compare(a, b, true);
682
+ module.exports = compareLoose;
683
+ }
684
+ });
685
+
686
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
687
+ var require_compare_build = __commonJS({
688
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module) {
689
+ "use strict";
690
+ var SemVer = require_semver();
691
+ var compareBuild = (a, b, loose) => {
692
+ const versionA = new SemVer(a, loose);
693
+ const versionB = new SemVer(b, loose);
694
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
695
+ };
696
+ module.exports = compareBuild;
697
+ }
698
+ });
699
+
700
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
701
+ var require_sort = __commonJS({
702
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module) {
703
+ "use strict";
704
+ var compareBuild = require_compare_build();
705
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
706
+ module.exports = sort;
707
+ }
708
+ });
709
+
710
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
711
+ var require_rsort = __commonJS({
712
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module) {
713
+ "use strict";
714
+ var compareBuild = require_compare_build();
715
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
716
+ module.exports = rsort;
717
+ }
718
+ });
719
+
720
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
721
+ var require_gt = __commonJS({
722
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module) {
723
+ "use strict";
724
+ var compare = require_compare();
725
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
726
+ module.exports = gt;
727
+ }
728
+ });
729
+
730
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
731
+ var require_lt = __commonJS({
732
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module) {
733
+ "use strict";
734
+ var compare = require_compare();
735
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
736
+ module.exports = lt;
737
+ }
738
+ });
739
+
740
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
741
+ var require_eq = __commonJS({
742
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module) {
743
+ "use strict";
744
+ var compare = require_compare();
745
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
746
+ module.exports = eq;
747
+ }
748
+ });
749
+
750
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
751
+ var require_neq = __commonJS({
752
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module) {
753
+ "use strict";
754
+ var compare = require_compare();
755
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
756
+ module.exports = neq;
757
+ }
758
+ });
759
+
760
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
761
+ var require_gte = __commonJS({
762
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module) {
763
+ "use strict";
764
+ var compare = require_compare();
765
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
766
+ module.exports = gte;
767
+ }
768
+ });
769
+
770
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
771
+ var require_lte = __commonJS({
772
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module) {
773
+ "use strict";
774
+ var compare = require_compare();
775
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
776
+ module.exports = lte;
777
+ }
778
+ });
779
+
780
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
781
+ var require_cmp = __commonJS({
782
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module) {
783
+ "use strict";
784
+ var eq = require_eq();
785
+ var neq = require_neq();
786
+ var gt = require_gt();
787
+ var gte = require_gte();
788
+ var lt = require_lt();
789
+ var lte = require_lte();
790
+ var cmp = (a, op, b, loose) => {
791
+ switch (op) {
792
+ case "===":
793
+ if (typeof a === "object") {
794
+ a = a.version;
795
+ }
796
+ if (typeof b === "object") {
797
+ b = b.version;
798
+ }
799
+ return a === b;
800
+ case "!==":
801
+ if (typeof a === "object") {
802
+ a = a.version;
803
+ }
804
+ if (typeof b === "object") {
805
+ b = b.version;
806
+ }
807
+ return a !== b;
808
+ case "":
809
+ case "=":
810
+ case "==":
811
+ return eq(a, b, loose);
812
+ case "!=":
813
+ return neq(a, b, loose);
814
+ case ">":
815
+ return gt(a, b, loose);
816
+ case ">=":
817
+ return gte(a, b, loose);
818
+ case "<":
819
+ return lt(a, b, loose);
820
+ case "<=":
821
+ return lte(a, b, loose);
822
+ default:
823
+ throw new TypeError(`Invalid operator: ${op}`);
824
+ }
825
+ };
826
+ module.exports = cmp;
827
+ }
828
+ });
829
+
830
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
831
+ var require_coerce = __commonJS({
832
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module) {
833
+ "use strict";
834
+ var SemVer = require_semver();
835
+ var parse = require_parse();
836
+ var { safeRe: re, t } = require_re();
837
+ var coerce2 = (version, options) => {
838
+ if (version instanceof SemVer) {
839
+ return version;
840
+ }
841
+ if (typeof version === "number") {
842
+ version = String(version);
843
+ }
844
+ if (typeof version !== "string") {
845
+ return null;
846
+ }
847
+ options = options || {};
848
+ let match = null;
849
+ if (!options.rtl) {
850
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
851
+ } else {
852
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
853
+ let next;
854
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
855
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
856
+ match = next;
857
+ }
858
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
859
+ }
860
+ coerceRtlRegex.lastIndex = -1;
861
+ }
862
+ if (match === null) {
863
+ return null;
864
+ }
865
+ const major = match[2];
866
+ const minor = match[3] || "0";
867
+ const patch = match[4] || "0";
868
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
869
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
870
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
871
+ };
872
+ module.exports = coerce2;
873
+ }
874
+ });
875
+
876
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
877
+ var require_truncate = __commonJS({
878
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module) {
879
+ "use strict";
880
+ var parse = require_parse();
881
+ var constants = require_constants();
882
+ var SemVer = require_semver();
883
+ var truncate = (version, truncation, options) => {
884
+ if (!constants.RELEASE_TYPES.includes(truncation)) {
885
+ return null;
886
+ }
887
+ const clonedVersion = cloneInputVersion(version, options);
888
+ return clonedVersion && doTruncation(clonedVersion, truncation);
889
+ };
890
+ var cloneInputVersion = (version, options) => {
891
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
892
+ return parse(versionStringToParse, options);
893
+ };
894
+ var doTruncation = (version, truncation) => {
895
+ if (isPrerelease(truncation)) {
896
+ return version.version;
897
+ }
898
+ version.prerelease = [];
899
+ switch (truncation) {
900
+ case "major":
901
+ version.minor = 0;
902
+ version.patch = 0;
903
+ break;
904
+ case "minor":
905
+ version.patch = 0;
906
+ break;
907
+ }
908
+ return version.format();
909
+ };
910
+ var isPrerelease = (type) => {
911
+ return type.startsWith("pre");
912
+ };
913
+ module.exports = truncate;
914
+ }
915
+ });
916
+
917
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
918
+ var require_lrucache = __commonJS({
919
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module) {
920
+ "use strict";
921
+ var LRUCache = class {
922
+ constructor() {
923
+ this.max = 1e3;
924
+ this.map = /* @__PURE__ */ new Map();
925
+ }
926
+ get(key) {
927
+ const value = this.map.get(key);
928
+ if (value === void 0) {
929
+ return void 0;
930
+ } else {
931
+ this.map.delete(key);
932
+ this.map.set(key, value);
933
+ return value;
934
+ }
935
+ }
936
+ delete(key) {
937
+ return this.map.delete(key);
938
+ }
939
+ set(key, value) {
940
+ const deleted = this.delete(key);
941
+ if (!deleted && value !== void 0) {
942
+ if (this.map.size >= this.max) {
943
+ const firstKey = this.map.keys().next().value;
944
+ this.delete(firstKey);
945
+ }
946
+ this.map.set(key, value);
947
+ }
948
+ return this;
949
+ }
950
+ };
951
+ module.exports = LRUCache;
952
+ }
953
+ });
954
+
955
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
956
+ var require_range = __commonJS({
957
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module) {
958
+ "use strict";
959
+ var SPACE_CHARACTERS = /\s+/g;
960
+ var Range = class _Range {
961
+ constructor(range, options) {
962
+ options = parseOptions(options);
963
+ if (range instanceof _Range) {
964
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
965
+ return range;
966
+ } else {
967
+ return new _Range(range.raw, options);
968
+ }
969
+ }
970
+ if (range instanceof Comparator) {
971
+ this.raw = range.value;
972
+ this.set = [[range]];
973
+ this.formatted = void 0;
974
+ return this;
975
+ }
976
+ this.options = options;
977
+ this.loose = !!options.loose;
978
+ this.includePrerelease = !!options.includePrerelease;
979
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
980
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
981
+ if (!this.set.length) {
982
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
983
+ }
984
+ if (this.set.length > 1) {
985
+ const first = this.set[0];
986
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
987
+ if (this.set.length === 0) {
988
+ this.set = [first];
989
+ } else if (this.set.length > 1) {
990
+ for (const c of this.set) {
991
+ if (c.length === 1 && isAny(c[0])) {
992
+ this.set = [c];
993
+ break;
994
+ }
995
+ }
996
+ }
997
+ }
998
+ this.formatted = void 0;
999
+ }
1000
+ get range() {
1001
+ if (this.formatted === void 0) {
1002
+ this.formatted = "";
1003
+ for (let i = 0; i < this.set.length; i++) {
1004
+ if (i > 0) {
1005
+ this.formatted += "||";
1006
+ }
1007
+ const comps = this.set[i];
1008
+ for (let k = 0; k < comps.length; k++) {
1009
+ if (k > 0) {
1010
+ this.formatted += " ";
1011
+ }
1012
+ this.formatted += comps[k].toString().trim();
1013
+ }
1014
+ }
1015
+ }
1016
+ return this.formatted;
1017
+ }
1018
+ format() {
1019
+ return this.range;
1020
+ }
1021
+ toString() {
1022
+ return this.range;
1023
+ }
1024
+ parseRange(range) {
1025
+ range = range.replace(BUILDSTRIPRE, "");
1026
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
1027
+ const memoKey = memoOpts + ":" + range;
1028
+ const cached = cache.get(memoKey);
1029
+ if (cached) {
1030
+ return cached;
1031
+ }
1032
+ const loose = this.options.loose;
1033
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1034
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1035
+ debug("hyphen replace", range);
1036
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1037
+ debug("comparator trim", range);
1038
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1039
+ debug("tilde trim", range);
1040
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1041
+ debug("caret trim", range);
1042
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1043
+ if (loose) {
1044
+ rangeList = rangeList.filter((comp) => {
1045
+ debug("loose invalid filter", comp, this.options);
1046
+ return !!comp.match(re[t.COMPARATORLOOSE]);
1047
+ });
1048
+ }
1049
+ debug("range list", rangeList);
1050
+ const rangeMap = /* @__PURE__ */ new Map();
1051
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
1052
+ for (const comp of comparators) {
1053
+ if (isNullSet(comp)) {
1054
+ return [comp];
1055
+ }
1056
+ rangeMap.set(comp.value, comp);
1057
+ }
1058
+ if (rangeMap.size > 1 && rangeMap.has("")) {
1059
+ rangeMap.delete("");
1060
+ }
1061
+ const result = [...rangeMap.values()];
1062
+ cache.set(memoKey, result);
1063
+ return result;
1064
+ }
1065
+ intersects(range, options) {
1066
+ if (!(range instanceof _Range)) {
1067
+ throw new TypeError("a Range is required");
1068
+ }
1069
+ return this.set.some((thisComparators) => {
1070
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
1071
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
1072
+ return rangeComparators.every((rangeComparator) => {
1073
+ return thisComparator.intersects(rangeComparator, options);
1074
+ });
1075
+ });
1076
+ });
1077
+ });
1078
+ }
1079
+ // if ANY of the sets match ALL of its comparators, then pass
1080
+ test(version) {
1081
+ if (!version) {
1082
+ return false;
1083
+ }
1084
+ if (typeof version === "string") {
1085
+ try {
1086
+ version = new SemVer(version, this.options);
1087
+ } catch (er) {
1088
+ return false;
1089
+ }
1090
+ }
1091
+ for (let i = 0; i < this.set.length; i++) {
1092
+ if (testSet(this.set[i], version, this.options)) {
1093
+ return true;
1094
+ }
1095
+ }
1096
+ return false;
1097
+ }
1098
+ };
1099
+ module.exports = Range;
1100
+ var LRU = require_lrucache();
1101
+ var cache = new LRU();
1102
+ var parseOptions = require_parse_options();
1103
+ var Comparator = require_comparator();
1104
+ var debug = require_debug();
1105
+ var SemVer = require_semver();
1106
+ var {
1107
+ safeRe: re,
1108
+ src,
1109
+ t,
1110
+ comparatorTrimReplace,
1111
+ tildeTrimReplace,
1112
+ caretTrimReplace
1113
+ } = require_re();
1114
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1115
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
1116
+ var isNullSet = (c) => c.value === "<0.0.0-0";
1117
+ var isAny = (c) => c.value === "";
1118
+ var isSatisfiable = (comparators, options) => {
1119
+ let result = true;
1120
+ const remainingComparators = comparators.slice();
1121
+ let testComparator = remainingComparators.pop();
1122
+ while (result && remainingComparators.length) {
1123
+ result = remainingComparators.every((otherComparator) => {
1124
+ return testComparator.intersects(otherComparator, options);
1125
+ });
1126
+ testComparator = remainingComparators.pop();
1127
+ }
1128
+ return result;
1129
+ };
1130
+ var parseComparator = (comp, options) => {
1131
+ comp = comp.replace(re[t.BUILD], "");
1132
+ debug("comp", comp, options);
1133
+ comp = replaceCarets(comp, options);
1134
+ debug("caret", comp);
1135
+ comp = replaceTildes(comp, options);
1136
+ debug("tildes", comp);
1137
+ comp = replaceXRanges(comp, options);
1138
+ debug("xrange", comp);
1139
+ comp = replaceStars(comp, options);
1140
+ debug("stars", comp);
1141
+ return comp;
1142
+ };
1143
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1144
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
1145
+ var replaceTildes = (comp, options) => {
1146
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1147
+ };
1148
+ var replaceTilde = (comp, options) => {
1149
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1150
+ const z3 = options.includePrerelease ? "-0" : "";
1151
+ return comp.replace(r, (_, M, m, p, pr) => {
1152
+ debug("tilde", comp, _, M, m, p, pr);
1153
+ let ret;
1154
+ if (isX(M)) {
1155
+ ret = "";
1156
+ } else if (isX(m)) {
1157
+ ret = `>=${M}.0.0${z3} <${+M + 1}.0.0-0`;
1158
+ } else if (isX(p)) {
1159
+ ret = `>=${M}.${m}.0${z3} <${M}.${+m + 1}.0-0`;
1160
+ } else if (pr) {
1161
+ debug("replaceTilde pr", pr);
1162
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1163
+ } else {
1164
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1165
+ }
1166
+ debug("tilde return", ret);
1167
+ return ret;
1168
+ });
1169
+ };
1170
+ var replaceCarets = (comp, options) => {
1171
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1172
+ };
1173
+ var replaceCaret = (comp, options) => {
1174
+ debug("caret", comp, options);
1175
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1176
+ const z3 = options.includePrerelease ? "-0" : "";
1177
+ return comp.replace(r, (_, M, m, p, pr) => {
1178
+ debug("caret", comp, _, M, m, p, pr);
1179
+ let ret;
1180
+ if (isX(M)) {
1181
+ ret = "";
1182
+ } else if (isX(m)) {
1183
+ ret = `>=${M}.0.0${z3} <${+M + 1}.0.0-0`;
1184
+ } else if (isX(p)) {
1185
+ if (M === "0") {
1186
+ ret = `>=${M}.${m}.0${z3} <${M}.${+m + 1}.0-0`;
1187
+ } else {
1188
+ ret = `>=${M}.${m}.0${z3} <${+M + 1}.0.0-0`;
1189
+ }
1190
+ } else if (pr) {
1191
+ debug("replaceCaret pr", pr);
1192
+ if (M === "0") {
1193
+ if (m === "0") {
1194
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1195
+ } else {
1196
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1197
+ }
1198
+ } else {
1199
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1200
+ }
1201
+ } else {
1202
+ debug("no pr");
1203
+ if (M === "0") {
1204
+ if (m === "0") {
1205
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
1206
+ } else {
1207
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1208
+ }
1209
+ } else {
1210
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1211
+ }
1212
+ }
1213
+ debug("caret return", ret);
1214
+ return ret;
1215
+ });
1216
+ };
1217
+ var replaceXRanges = (comp, options) => {
1218
+ debug("replaceXRanges", comp, options);
1219
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1220
+ };
1221
+ var replaceXRange = (comp, options) => {
1222
+ comp = comp.trim();
1223
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1224
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1225
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
1226
+ if (invalidXRangeOrder(M, m, p)) {
1227
+ return comp;
1228
+ }
1229
+ const xM = isX(M);
1230
+ const xm = xM || isX(m);
1231
+ const xp = xm || isX(p);
1232
+ const anyX = xp;
1233
+ if (gtlt === "=" && anyX) {
1234
+ gtlt = "";
1235
+ }
1236
+ pr = options.includePrerelease ? "-0" : "";
1237
+ if (xM) {
1238
+ if (gtlt === ">" || gtlt === "<") {
1239
+ ret = "<0.0.0-0";
1240
+ } else {
1241
+ ret = "*";
1242
+ }
1243
+ } else if (gtlt && anyX) {
1244
+ if (xm) {
1245
+ m = 0;
1246
+ }
1247
+ p = 0;
1248
+ if (gtlt === ">") {
1249
+ gtlt = ">=";
1250
+ if (xm) {
1251
+ M = +M + 1;
1252
+ m = 0;
1253
+ p = 0;
1254
+ } else {
1255
+ m = +m + 1;
1256
+ p = 0;
1257
+ }
1258
+ } else if (gtlt === "<=") {
1259
+ gtlt = "<";
1260
+ if (xm) {
1261
+ M = +M + 1;
1262
+ } else {
1263
+ m = +m + 1;
1264
+ }
1265
+ }
1266
+ if (gtlt === "<") {
1267
+ pr = "-0";
1268
+ }
1269
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1270
+ } else if (xm) {
1271
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1272
+ } else if (xp) {
1273
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1274
+ }
1275
+ debug("xRange return", ret);
1276
+ return ret;
1277
+ });
1278
+ };
1279
+ var replaceStars = (comp, options) => {
1280
+ debug("replaceStars", comp, options);
1281
+ return comp.trim().replace(re[t.STAR], "");
1282
+ };
1283
+ var replaceGTE0 = (comp, options) => {
1284
+ debug("replaceGTE0", comp, options);
1285
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1286
+ };
1287
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1288
+ if (isX(fM)) {
1289
+ from = "";
1290
+ } else if (isX(fm)) {
1291
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1292
+ } else if (isX(fp)) {
1293
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1294
+ } else if (fpr) {
1295
+ from = `>=${from}`;
1296
+ } else {
1297
+ from = `>=${from}${incPr ? "-0" : ""}`;
1298
+ }
1299
+ if (isX(tM)) {
1300
+ to = "";
1301
+ } else if (isX(tm)) {
1302
+ to = `<${+tM + 1}.0.0-0`;
1303
+ } else if (isX(tp)) {
1304
+ to = `<${tM}.${+tm + 1}.0-0`;
1305
+ } else if (tpr) {
1306
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1307
+ } else if (incPr) {
1308
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1309
+ } else {
1310
+ to = `<=${to}`;
1311
+ }
1312
+ return `${from} ${to}`.trim();
1313
+ };
1314
+ var testSet = (set, version, options) => {
1315
+ for (let i = 0; i < set.length; i++) {
1316
+ if (!set[i].test(version)) {
1317
+ return false;
1318
+ }
1319
+ }
1320
+ if (version.prerelease.length && !options.includePrerelease) {
1321
+ for (let i = 0; i < set.length; i++) {
1322
+ debug(set[i].semver);
1323
+ if (set[i].semver === Comparator.ANY) {
1324
+ continue;
1325
+ }
1326
+ if (set[i].semver.prerelease.length > 0) {
1327
+ const allowed = set[i].semver;
1328
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1329
+ return true;
1330
+ }
1331
+ }
1332
+ }
1333
+ return false;
1334
+ }
1335
+ return true;
1336
+ };
1337
+ }
1338
+ });
1339
+
1340
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
1341
+ var require_comparator = __commonJS({
1342
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module) {
1343
+ "use strict";
1344
+ var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
1345
+ var Comparator = class _Comparator {
1346
+ static get ANY() {
1347
+ return ANY;
1348
+ }
1349
+ constructor(comp, options) {
1350
+ options = parseOptions(options);
1351
+ if (comp instanceof _Comparator) {
1352
+ if (comp.loose === !!options.loose) {
1353
+ return comp;
1354
+ } else {
1355
+ comp = comp.value;
1356
+ }
1357
+ }
1358
+ comp = comp.trim().split(/\s+/).join(" ");
1359
+ debug("comparator", comp, options);
1360
+ this.options = options;
1361
+ this.loose = !!options.loose;
1362
+ this.parse(comp);
1363
+ if (this.semver === ANY) {
1364
+ this.value = "";
1365
+ } else {
1366
+ this.value = this.operator + this.semver.version;
1367
+ }
1368
+ debug("comp", this);
1369
+ }
1370
+ parse(comp) {
1371
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1372
+ const m = comp.match(r);
1373
+ if (!m) {
1374
+ throw new TypeError(`Invalid comparator: ${comp}`);
1375
+ }
1376
+ this.operator = m[1] !== void 0 ? m[1] : "";
1377
+ if (this.operator === "=") {
1378
+ this.operator = "";
1379
+ }
1380
+ if (!m[2]) {
1381
+ this.semver = ANY;
1382
+ } else {
1383
+ this.semver = new SemVer(m[2], this.options.loose);
1384
+ }
1385
+ }
1386
+ toString() {
1387
+ return this.value;
1388
+ }
1389
+ test(version) {
1390
+ debug("Comparator.test", version, this.options.loose);
1391
+ if (this.semver === ANY || version === ANY) {
1392
+ return true;
1393
+ }
1394
+ if (typeof version === "string") {
1395
+ try {
1396
+ version = new SemVer(version, this.options);
1397
+ } catch (er) {
1398
+ return false;
1399
+ }
1400
+ }
1401
+ return cmp(version, this.operator, this.semver, this.options);
1402
+ }
1403
+ intersects(comp, options) {
1404
+ if (!(comp instanceof _Comparator)) {
1405
+ throw new TypeError("a Comparator is required");
1406
+ }
1407
+ if (this.operator === "") {
1408
+ if (this.value === "") {
1409
+ return true;
1410
+ }
1411
+ return new Range(comp.value, options).test(this.value);
1412
+ } else if (comp.operator === "") {
1413
+ if (comp.value === "") {
1414
+ return true;
1415
+ }
1416
+ return new Range(this.value, options).test(comp.semver);
1417
+ }
1418
+ options = parseOptions(options);
1419
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1420
+ return false;
1421
+ }
1422
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1423
+ return false;
1424
+ }
1425
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1426
+ return true;
1427
+ }
1428
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1429
+ return true;
1430
+ }
1431
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1432
+ return true;
1433
+ }
1434
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1435
+ return true;
1436
+ }
1437
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1438
+ return true;
1439
+ }
1440
+ return false;
1441
+ }
1442
+ };
1443
+ module.exports = Comparator;
1444
+ var parseOptions = require_parse_options();
1445
+ var { safeRe: re, t } = require_re();
1446
+ var cmp = require_cmp();
1447
+ var debug = require_debug();
1448
+ var SemVer = require_semver();
1449
+ var Range = require_range();
1450
+ }
1451
+ });
1452
+
1453
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
1454
+ var require_satisfies = __commonJS({
1455
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module) {
1456
+ "use strict";
1457
+ var Range = require_range();
1458
+ var satisfies = (version, range, options) => {
1459
+ try {
1460
+ range = new Range(range, options);
1461
+ } catch (er) {
1462
+ return false;
1463
+ }
1464
+ return range.test(version);
1465
+ };
1466
+ module.exports = satisfies;
1467
+ }
1468
+ });
1469
+
1470
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
1471
+ var require_to_comparators = __commonJS({
1472
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
1473
+ "use strict";
1474
+ var Range = require_range();
1475
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1476
+ module.exports = toComparators;
1477
+ }
1478
+ });
1479
+
1480
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
1481
+ var require_max_satisfying = __commonJS({
1482
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1483
+ "use strict";
1484
+ var SemVer = require_semver();
1485
+ var Range = require_range();
1486
+ var maxSatisfying = (versions, range, options) => {
1487
+ let max = null;
1488
+ let maxSV = null;
1489
+ let rangeObj = null;
1490
+ try {
1491
+ rangeObj = new Range(range, options);
1492
+ } catch (er) {
1493
+ return null;
1494
+ }
1495
+ versions.forEach((v) => {
1496
+ if (rangeObj.test(v)) {
1497
+ if (!max || maxSV.compare(v) === -1) {
1498
+ max = v;
1499
+ maxSV = new SemVer(max, options);
1500
+ }
1501
+ }
1502
+ });
1503
+ return max;
1504
+ };
1505
+ module.exports = maxSatisfying;
1506
+ }
1507
+ });
1508
+
1509
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
1510
+ var require_min_satisfying = __commonJS({
1511
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1512
+ "use strict";
1513
+ var SemVer = require_semver();
1514
+ var Range = require_range();
1515
+ var minSatisfying = (versions, range, options) => {
1516
+ let min = null;
1517
+ let minSV = null;
1518
+ let rangeObj = null;
1519
+ try {
1520
+ rangeObj = new Range(range, options);
1521
+ } catch (er) {
1522
+ return null;
1523
+ }
1524
+ versions.forEach((v) => {
1525
+ if (rangeObj.test(v)) {
1526
+ if (!min || minSV.compare(v) === 1) {
1527
+ min = v;
1528
+ minSV = new SemVer(min, options);
1529
+ }
1530
+ }
1531
+ });
1532
+ return min;
1533
+ };
1534
+ module.exports = minSatisfying;
1535
+ }
1536
+ });
1537
+
1538
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
1539
+ var require_min_version = __commonJS({
1540
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module) {
1541
+ "use strict";
1542
+ var SemVer = require_semver();
1543
+ var Range = require_range();
1544
+ var gt = require_gt();
1545
+ var minVersion2 = (range, loose) => {
1546
+ range = new Range(range, loose);
1547
+ let minver = new SemVer("0.0.0");
1548
+ if (range.test(minver)) {
1549
+ return minver;
1550
+ }
1551
+ minver = new SemVer("0.0.0-0");
1552
+ if (range.test(minver)) {
1553
+ return minver;
1554
+ }
1555
+ minver = null;
1556
+ for (let i = 0; i < range.set.length; ++i) {
1557
+ const comparators = range.set[i];
1558
+ let setMin = null;
1559
+ comparators.forEach((comparator) => {
1560
+ const compver = new SemVer(comparator.semver.version);
1561
+ switch (comparator.operator) {
1562
+ case ">":
1563
+ if (compver.prerelease.length === 0) {
1564
+ compver.patch++;
1565
+ } else {
1566
+ compver.prerelease.push(0);
1567
+ }
1568
+ compver.raw = compver.format();
1569
+ /* fallthrough */
1570
+ case "":
1571
+ case ">=":
1572
+ if (!setMin || gt(compver, setMin)) {
1573
+ setMin = compver;
1574
+ }
1575
+ break;
1576
+ case "<":
1577
+ case "<=":
1578
+ break;
1579
+ /* istanbul ignore next */
1580
+ default:
1581
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
1582
+ }
1583
+ });
1584
+ if (setMin && (!minver || gt(minver, setMin))) {
1585
+ minver = setMin;
1586
+ }
1587
+ }
1588
+ if (minver && range.test(minver)) {
1589
+ return minver;
1590
+ }
1591
+ return null;
1592
+ };
1593
+ module.exports = minVersion2;
1594
+ }
1595
+ });
1596
+
1597
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
1598
+ var require_valid2 = __commonJS({
1599
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module) {
1600
+ "use strict";
1601
+ var Range = require_range();
1602
+ var validRange = (range, options) => {
1603
+ try {
1604
+ return new Range(range, options).range || "*";
1605
+ } catch (er) {
1606
+ return null;
1607
+ }
1608
+ };
1609
+ module.exports = validRange;
1610
+ }
1611
+ });
1612
+
1613
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
1614
+ var require_outside = __commonJS({
1615
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module) {
1616
+ "use strict";
1617
+ var SemVer = require_semver();
1618
+ var Comparator = require_comparator();
1619
+ var { ANY } = Comparator;
1620
+ var Range = require_range();
1621
+ var satisfies = require_satisfies();
1622
+ var gt = require_gt();
1623
+ var lt = require_lt();
1624
+ var lte = require_lte();
1625
+ var gte = require_gte();
1626
+ var outside = (version, range, hilo, options) => {
1627
+ version = new SemVer(version, options);
1628
+ range = new Range(range, options);
1629
+ let gtfn, ltefn, ltfn, comp, ecomp;
1630
+ switch (hilo) {
1631
+ case ">":
1632
+ gtfn = gt;
1633
+ ltefn = lte;
1634
+ ltfn = lt;
1635
+ comp = ">";
1636
+ ecomp = ">=";
1637
+ break;
1638
+ case "<":
1639
+ gtfn = lt;
1640
+ ltefn = gte;
1641
+ ltfn = gt;
1642
+ comp = "<";
1643
+ ecomp = "<=";
1644
+ break;
1645
+ default:
1646
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
1647
+ }
1648
+ if (satisfies(version, range, options)) {
1649
+ return false;
1650
+ }
1651
+ for (let i = 0; i < range.set.length; ++i) {
1652
+ const comparators = range.set[i];
1653
+ let high = null;
1654
+ let low = null;
1655
+ comparators.forEach((comparator) => {
1656
+ if (comparator.semver === ANY) {
1657
+ comparator = new Comparator(">=0.0.0");
1658
+ }
1659
+ high = high || comparator;
1660
+ low = low || comparator;
1661
+ if (gtfn(comparator.semver, high.semver, options)) {
1662
+ high = comparator;
1663
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1664
+ low = comparator;
1665
+ }
1666
+ });
1667
+ if (high.operator === comp || high.operator === ecomp) {
1668
+ return false;
1669
+ }
1670
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1671
+ return false;
1672
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1673
+ return false;
1674
+ }
1675
+ }
1676
+ return true;
1677
+ };
1678
+ module.exports = outside;
1679
+ }
1680
+ });
1681
+
1682
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
1683
+ var require_gtr = __commonJS({
1684
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module) {
1685
+ "use strict";
1686
+ var outside = require_outside();
1687
+ var gtr = (version, range, options) => outside(version, range, ">", options);
1688
+ module.exports = gtr;
1689
+ }
1690
+ });
1691
+
1692
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
1693
+ var require_ltr = __commonJS({
1694
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module) {
1695
+ "use strict";
1696
+ var outside = require_outside();
1697
+ var ltr = (version, range, options) => outside(version, range, "<", options);
1698
+ module.exports = ltr;
1699
+ }
1700
+ });
1701
+
1702
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
1703
+ var require_intersects = __commonJS({
1704
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module) {
1705
+ "use strict";
1706
+ var Range = require_range();
1707
+ var intersects = (r1, r2, options) => {
1708
+ r1 = new Range(r1, options);
1709
+ r2 = new Range(r2, options);
1710
+ return r1.intersects(r2, options);
1711
+ };
1712
+ module.exports = intersects;
1713
+ }
1714
+ });
1715
+
1716
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
1717
+ var require_simplify = __commonJS({
1718
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module) {
1719
+ "use strict";
1720
+ var satisfies = require_satisfies();
1721
+ var compare = require_compare();
1722
+ module.exports = (versions, range, options) => {
1723
+ const set = [];
1724
+ let first = null;
1725
+ let prev = null;
1726
+ const v = versions.sort((a, b) => compare(a, b, options));
1727
+ for (const version of v) {
1728
+ const included = satisfies(version, range, options);
1729
+ if (included) {
1730
+ prev = version;
1731
+ if (!first) {
1732
+ first = version;
1733
+ }
1734
+ } else {
1735
+ if (prev) {
1736
+ set.push([first, prev]);
1737
+ }
1738
+ prev = null;
1739
+ first = null;
1740
+ }
1741
+ }
1742
+ if (first) {
1743
+ set.push([first, null]);
1744
+ }
1745
+ const ranges = [];
1746
+ for (const [min, max] of set) {
1747
+ if (min === max) {
1748
+ ranges.push(min);
1749
+ } else if (!max && min === v[0]) {
1750
+ ranges.push("*");
1751
+ } else if (!max) {
1752
+ ranges.push(`>=${min}`);
1753
+ } else if (min === v[0]) {
1754
+ ranges.push(`<=${max}`);
1755
+ } else {
1756
+ ranges.push(`${min} - ${max}`);
1757
+ }
1758
+ }
1759
+ const simplified = ranges.join(" || ");
1760
+ const original = typeof range.raw === "string" ? range.raw : String(range);
1761
+ return simplified.length < original.length ? simplified : range;
1762
+ };
1763
+ }
1764
+ });
1765
+
1766
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
1767
+ var require_subset = __commonJS({
1768
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module) {
1769
+ "use strict";
1770
+ var Range = require_range();
1771
+ var Comparator = require_comparator();
1772
+ var { ANY } = Comparator;
1773
+ var satisfies = require_satisfies();
1774
+ var compare = require_compare();
1775
+ var subset = (sub, dom, options = {}) => {
1776
+ if (sub === dom) {
1777
+ return true;
1778
+ }
1779
+ sub = new Range(sub, options);
1780
+ dom = new Range(dom, options);
1781
+ let sawNonNull = false;
1782
+ OUTER: for (const simpleSub of sub.set) {
1783
+ for (const simpleDom of dom.set) {
1784
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
1785
+ sawNonNull = sawNonNull || isSub !== null;
1786
+ if (isSub) {
1787
+ continue OUTER;
1788
+ }
1789
+ }
1790
+ if (sawNonNull) {
1791
+ return false;
1792
+ }
1793
+ }
1794
+ return true;
1795
+ };
1796
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1797
+ var minimumVersion = [new Comparator(">=0.0.0")];
1798
+ var simpleSubset = (sub, dom, options) => {
1799
+ if (sub === dom) {
1800
+ return true;
1801
+ }
1802
+ if (sub.length === 1 && sub[0].semver === ANY) {
1803
+ if (dom.length === 1 && dom[0].semver === ANY) {
1804
+ return true;
1805
+ } else if (options.includePrerelease) {
1806
+ sub = minimumVersionWithPreRelease;
1807
+ } else {
1808
+ sub = minimumVersion;
1809
+ }
1810
+ }
1811
+ if (dom.length === 1 && dom[0].semver === ANY) {
1812
+ if (options.includePrerelease) {
1813
+ return true;
1814
+ } else {
1815
+ dom = minimumVersion;
1816
+ }
1817
+ }
1818
+ const eqSet = /* @__PURE__ */ new Set();
1819
+ let gt, lt;
1820
+ for (const c of sub) {
1821
+ if (c.operator === ">" || c.operator === ">=") {
1822
+ gt = higherGT(gt, c, options);
1823
+ } else if (c.operator === "<" || c.operator === "<=") {
1824
+ lt = lowerLT(lt, c, options);
1825
+ } else {
1826
+ eqSet.add(c.semver);
1827
+ }
1828
+ }
1829
+ if (eqSet.size > 1) {
1830
+ return null;
1831
+ }
1832
+ let gtltComp;
1833
+ if (gt && lt) {
1834
+ gtltComp = compare(gt.semver, lt.semver, options);
1835
+ if (gtltComp > 0) {
1836
+ return null;
1837
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1838
+ return null;
1839
+ }
1840
+ }
1841
+ for (const eq of eqSet) {
1842
+ if (gt && !satisfies(eq, String(gt), options)) {
1843
+ return null;
1844
+ }
1845
+ if (lt && !satisfies(eq, String(lt), options)) {
1846
+ return null;
1847
+ }
1848
+ for (const c of dom) {
1849
+ if (!satisfies(eq, String(c), options)) {
1850
+ return false;
1851
+ }
1852
+ }
1853
+ return true;
1854
+ }
1855
+ let higher, lower;
1856
+ let hasDomLT, hasDomGT;
1857
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1858
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1859
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1860
+ needDomLTPre = false;
1861
+ }
1862
+ for (const c of dom) {
1863
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1864
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1865
+ if (gt) {
1866
+ if (needDomGTPre) {
1867
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1868
+ needDomGTPre = false;
1869
+ }
1870
+ }
1871
+ if (c.operator === ">" || c.operator === ">=") {
1872
+ higher = higherGT(gt, c, options);
1873
+ if (higher === c && higher !== gt) {
1874
+ return false;
1875
+ }
1876
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) {
1877
+ return false;
1878
+ }
1879
+ }
1880
+ if (lt) {
1881
+ if (needDomLTPre) {
1882
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1883
+ needDomLTPre = false;
1884
+ }
1885
+ }
1886
+ if (c.operator === "<" || c.operator === "<=") {
1887
+ lower = lowerLT(lt, c, options);
1888
+ if (lower === c && lower !== lt) {
1889
+ return false;
1890
+ }
1891
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) {
1892
+ return false;
1893
+ }
1894
+ }
1895
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
1896
+ return false;
1897
+ }
1898
+ }
1899
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
1900
+ return false;
1901
+ }
1902
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
1903
+ return false;
1904
+ }
1905
+ if (needDomGTPre || needDomLTPre) {
1906
+ return false;
1907
+ }
1908
+ return true;
1909
+ };
1910
+ var higherGT = (a, b, options) => {
1911
+ if (!a) {
1912
+ return b;
1913
+ }
1914
+ const comp = compare(a.semver, b.semver, options);
1915
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1916
+ };
1917
+ var lowerLT = (a, b, options) => {
1918
+ if (!a) {
1919
+ return b;
1920
+ }
1921
+ const comp = compare(a.semver, b.semver, options);
1922
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1923
+ };
1924
+ module.exports = subset;
1925
+ }
1926
+ });
1927
+
1928
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js
1929
+ var require_semver2 = __commonJS({
1930
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module) {
1931
+ "use strict";
1932
+ var internalRe = require_re();
1933
+ var constants = require_constants();
1934
+ var SemVer = require_semver();
1935
+ var identifiers = require_identifiers();
1936
+ var parse = require_parse();
1937
+ var valid = require_valid();
1938
+ var clean = require_clean();
1939
+ var inc = require_inc();
1940
+ var diff = require_diff();
1941
+ var major = require_major();
1942
+ var minor = require_minor();
1943
+ var patch = require_patch();
1944
+ var prerelease = require_prerelease();
1945
+ var compare = require_compare();
1946
+ var rcompare = require_rcompare();
1947
+ var compareLoose = require_compare_loose();
1948
+ var compareBuild = require_compare_build();
1949
+ var sort = require_sort();
1950
+ var rsort = require_rsort();
1951
+ var gt = require_gt();
1952
+ var lt = require_lt();
1953
+ var eq = require_eq();
1954
+ var neq = require_neq();
1955
+ var gte = require_gte();
1956
+ var lte = require_lte();
1957
+ var cmp = require_cmp();
1958
+ var coerce2 = require_coerce();
1959
+ var truncate = require_truncate();
1960
+ var Comparator = require_comparator();
1961
+ var Range = require_range();
1962
+ var satisfies = require_satisfies();
1963
+ var toComparators = require_to_comparators();
1964
+ var maxSatisfying = require_max_satisfying();
1965
+ var minSatisfying = require_min_satisfying();
1966
+ var minVersion2 = require_min_version();
1967
+ var validRange = require_valid2();
1968
+ var outside = require_outside();
1969
+ var gtr = require_gtr();
1970
+ var ltr = require_ltr();
1971
+ var intersects = require_intersects();
1972
+ var simplifyRange = require_simplify();
1973
+ var subset = require_subset();
1974
+ module.exports = {
1975
+ parse,
1976
+ valid,
1977
+ clean,
1978
+ inc,
1979
+ diff,
1980
+ major,
1981
+ minor,
1982
+ patch,
1983
+ prerelease,
1984
+ compare,
1985
+ rcompare,
1986
+ compareLoose,
1987
+ compareBuild,
1988
+ sort,
1989
+ rsort,
1990
+ gt,
1991
+ lt,
1992
+ eq,
1993
+ neq,
1994
+ gte,
1995
+ lte,
1996
+ cmp,
1997
+ coerce: coerce2,
1998
+ truncate,
1999
+ Comparator,
2000
+ Range,
2001
+ satisfies,
2002
+ toComparators,
2003
+ maxSatisfying,
2004
+ minSatisfying,
2005
+ minVersion: minVersion2,
2006
+ validRange,
2007
+ outside,
2008
+ gtr,
2009
+ ltr,
2010
+ intersects,
2011
+ simplifyRange,
2012
+ subset,
2013
+ SemVer,
2014
+ re: internalRe.re,
2015
+ src: internalRe.src,
2016
+ tokens: internalRe.t,
2017
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
2018
+ RELEASE_TYPES: constants.RELEASE_TYPES,
2019
+ compareIdentifiers: identifiers.compareIdentifiers,
2020
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
2021
+ };
2022
+ }
2023
+ });
2024
+
2025
+ // src/project/detect-runtime.ts
2026
+ import { existsSync, readFileSync } from "node:fs";
2027
+
2028
+ // ../domains/dist/index.mjs
2029
+ import { z as z2 } from "zod";
2030
+
2031
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@8.1.1_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
2032
+ import * as z from "zod/v4";
2033
+ var SafeUrlSchema = z.url().superRefine((val, ctx) => {
2034
+ if (!URL.canParse(val)) {
2035
+ ctx.addIssue({
2036
+ code: z.ZodIssueCode.custom,
2037
+ message: "URL must be parseable",
2038
+ fatal: true
2039
+ });
2040
+ return z.NEVER;
2041
+ }
2042
+ }).refine((url2) => {
2043
+ const u = new URL(url2);
2044
+ return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
2045
+ }, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
2046
+ var OAuthProtectedResourceMetadataSchema = z.looseObject({
2047
+ resource: z.string().url(),
2048
+ authorization_servers: z.array(SafeUrlSchema).optional(),
2049
+ jwks_uri: z.string().url().optional(),
2050
+ scopes_supported: z.array(z.string()).optional(),
2051
+ bearer_methods_supported: z.array(z.string()).optional(),
2052
+ resource_signing_alg_values_supported: z.array(z.string()).optional(),
2053
+ resource_name: z.string().optional(),
2054
+ resource_documentation: z.string().optional(),
2055
+ resource_policy_uri: z.string().url().optional(),
2056
+ resource_tos_uri: z.string().url().optional(),
2057
+ tls_client_certificate_bound_access_tokens: z.boolean().optional(),
2058
+ authorization_details_types_supported: z.array(z.string()).optional(),
2059
+ dpop_signing_alg_values_supported: z.array(z.string()).optional(),
2060
+ dpop_bound_access_tokens_required: z.boolean().optional()
2061
+ });
2062
+ var OAuthMetadataSchema = z.looseObject({
2063
+ issuer: z.string(),
2064
+ authorization_endpoint: SafeUrlSchema,
2065
+ token_endpoint: SafeUrlSchema,
2066
+ registration_endpoint: SafeUrlSchema.optional(),
2067
+ scopes_supported: z.array(z.string()).optional(),
2068
+ response_types_supported: z.array(z.string()),
2069
+ response_modes_supported: z.array(z.string()).optional(),
2070
+ grant_types_supported: z.array(z.string()).optional(),
2071
+ token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
2072
+ token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
2073
+ service_documentation: SafeUrlSchema.optional(),
2074
+ revocation_endpoint: SafeUrlSchema.optional(),
2075
+ revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),
2076
+ revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
2077
+ introspection_endpoint: z.string().optional(),
2078
+ introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(),
2079
+ introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
2080
+ code_challenge_methods_supported: z.array(z.string()).optional(),
2081
+ client_id_metadata_document_supported: z.boolean().optional()
2082
+ });
2083
+ var OpenIdProviderMetadataSchema = z.looseObject({
2084
+ issuer: z.string(),
2085
+ authorization_endpoint: SafeUrlSchema,
2086
+ token_endpoint: SafeUrlSchema,
2087
+ userinfo_endpoint: SafeUrlSchema.optional(),
2088
+ jwks_uri: SafeUrlSchema,
2089
+ registration_endpoint: SafeUrlSchema.optional(),
2090
+ scopes_supported: z.array(z.string()).optional(),
2091
+ response_types_supported: z.array(z.string()),
2092
+ response_modes_supported: z.array(z.string()).optional(),
2093
+ grant_types_supported: z.array(z.string()).optional(),
2094
+ acr_values_supported: z.array(z.string()).optional(),
2095
+ subject_types_supported: z.array(z.string()),
2096
+ id_token_signing_alg_values_supported: z.array(z.string()),
2097
+ id_token_encryption_alg_values_supported: z.array(z.string()).optional(),
2098
+ id_token_encryption_enc_values_supported: z.array(z.string()).optional(),
2099
+ userinfo_signing_alg_values_supported: z.array(z.string()).optional(),
2100
+ userinfo_encryption_alg_values_supported: z.array(z.string()).optional(),
2101
+ userinfo_encryption_enc_values_supported: z.array(z.string()).optional(),
2102
+ request_object_signing_alg_values_supported: z.array(z.string()).optional(),
2103
+ request_object_encryption_alg_values_supported: z.array(z.string()).optional(),
2104
+ request_object_encryption_enc_values_supported: z.array(z.string()).optional(),
2105
+ token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
2106
+ token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
2107
+ display_values_supported: z.array(z.string()).optional(),
2108
+ claim_types_supported: z.array(z.string()).optional(),
2109
+ claims_supported: z.array(z.string()).optional(),
2110
+ service_documentation: z.string().optional(),
2111
+ claims_locales_supported: z.array(z.string()).optional(),
2112
+ ui_locales_supported: z.array(z.string()).optional(),
2113
+ claims_parameter_supported: z.boolean().optional(),
2114
+ request_parameter_supported: z.boolean().optional(),
2115
+ request_uri_parameter_supported: z.boolean().optional(),
2116
+ require_request_uri_registration: z.boolean().optional(),
2117
+ op_policy_uri: SafeUrlSchema.optional(),
2118
+ op_tos_uri: SafeUrlSchema.optional(),
2119
+ client_id_metadata_document_supported: z.boolean().optional()
2120
+ });
2121
+ var OpenIdProviderDiscoveryMetadataSchema = z.object({
2122
+ ...OpenIdProviderMetadataSchema.shape,
2123
+ ...OAuthMetadataSchema.pick({
2124
+ code_challenge_methods_supported: true
2125
+ }).shape
2126
+ });
2127
+ var OAuthTokensSchema = z.object({
2128
+ access_token: z.string(),
2129
+ id_token: z.string().optional(),
2130
+ // Optional for OAuth 2.1, but necessary in OpenID Connect
2131
+ token_type: z.string(),
2132
+ expires_in: z.coerce.number().optional(),
2133
+ scope: z.string().optional(),
2134
+ refresh_token: z.string().optional(),
2135
+ /**
2136
+ * Not part of the wire format: the authorization server this value was obtained from, added by
2137
+ * the client's `auth()` before it is stored and compared when it is read back.
2138
+ */
2139
+ issuer: z.string().optional().catch(void 0)
2140
+ }).strip();
2141
+ var OAuthErrorResponseSchema = z.object({
2142
+ error: z.string(),
2143
+ error_description: z.string().optional(),
2144
+ error_uri: z.string().optional()
2145
+ });
2146
+ var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal("").transform(() => void 0));
2147
+ var OAuthClientMetadataSchema = z.object({
2148
+ redirect_uris: z.array(SafeUrlSchema),
2149
+ token_endpoint_auth_method: z.string().optional(),
2150
+ grant_types: z.array(z.string()).optional(),
2151
+ response_types: z.array(z.string()).optional(),
2152
+ client_name: z.string().optional(),
2153
+ client_uri: SafeUrlSchema.optional(),
2154
+ logo_uri: OptionalSafeUrlSchema,
2155
+ scope: z.string().optional(),
2156
+ contacts: z.array(z.string()).optional(),
2157
+ tos_uri: OptionalSafeUrlSchema,
2158
+ policy_uri: z.string().optional(),
2159
+ jwks_uri: SafeUrlSchema.optional(),
2160
+ jwks: z.any().optional(),
2161
+ software_id: z.string().optional(),
2162
+ software_version: z.string().optional(),
2163
+ software_statement: z.string().optional()
2164
+ }).strip();
2165
+ var OAuthClientInformationSchema = z.object({
2166
+ client_id: z.string(),
2167
+ client_secret: z.string().optional(),
2168
+ client_id_issued_at: z.number().optional(),
2169
+ client_secret_expires_at: z.number().optional(),
2170
+ /**
2171
+ * Not part of the wire format: the authorization server this value was obtained from, added by
2172
+ * the client's `auth()` before it is stored and compared when it is read back.
2173
+ */
2174
+ issuer: z.string().optional().catch(void 0)
2175
+ }).strip();
2176
+ var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
2177
+ var OAuthClientRegistrationErrorSchema = z.object({
2178
+ error: z.string(),
2179
+ error_description: z.string().optional()
2180
+ }).strip();
2181
+ var OAuthTokenRevocationRequestSchema = z.object({
2182
+ token: z.string(),
2183
+ token_type_hint: z.string().optional()
2184
+ }).strip();
2185
+
2186
+ // ../domains/dist/index.mjs
2187
+ var import_semver = __toESM(require_semver2(), 1);
2188
+ var AI_PLATFORMS = ["chatgpt", "claudeai"];
2189
+ var platformSchema = z2.enum(AI_PLATFORMS);
2190
+ var WAF_PLATFORMS = [
2191
+ "akamai",
2192
+ "cato",
2193
+ "cloudflare",
2194
+ "fastly"
2195
+ ];
2196
+ var ALLOWED_PLATFORMS = [...AI_PLATFORMS, ...WAF_PLATFORMS];
2197
+ var allowedPlatformSchema = z2.enum(ALLOWED_PLATFORMS);
2198
+ var auditStatusSchema = z2.enum([
2199
+ "pending",
2200
+ "partial",
2201
+ "completed",
2202
+ "failed"
2203
+ ]);
2204
+ var checkSeveritySchema = z2.enum([
2205
+ "error",
2206
+ "warning",
2207
+ "info"
2208
+ ]);
2209
+ var checkCategorySchema = z2.enum([
2210
+ "connectivity",
2211
+ "tool-metadata",
2212
+ "resource-metadata",
2213
+ "performance",
2214
+ "e2e"
2215
+ ]);
2216
+ var checkScopeSchema = z2.enum(["server", "view"]);
2217
+ var checkDetailSchema = z2.object({
2218
+ label: z2.string(),
2219
+ value: z2.string().optional()
2220
+ });
2221
+ var checkResultSchema = z2.object({
2222
+ checkId: z2.string(),
2223
+ checkName: z2.string(),
2224
+ description: z2.string(),
2225
+ status: z2.enum([
2226
+ "pass",
2227
+ "fail",
2228
+ "skip",
2229
+ "pending"
2230
+ ]),
2231
+ message: z2.string(),
2232
+ skipReason: z2.string().optional(),
2233
+ severity: checkSeveritySchema,
2234
+ category: checkCategorySchema,
2235
+ scope: checkScopeSchema,
2236
+ platforms: z2.array(platformSchema).readonly().optional(),
2237
+ durationMs: z2.number(),
2238
+ details: z2.array(checkDetailSchema).optional(),
2239
+ hint: z2.object({ text: z2.string() }).optional()
2240
+ });
2241
+ var auditReportSchema = z2.object({
2242
+ schemaVersion: z2.string(),
2243
+ auditId: z2.string(),
2244
+ targetUrl: z2.string(),
2245
+ startedAt: z2.string(),
2246
+ completedAt: z2.string(),
2247
+ durationMs: z2.number(),
2248
+ results: z2.array(checkResultSchema),
2249
+ requiresAuth: z2.boolean(),
2250
+ hasViewSupport: z2.boolean(),
2251
+ viewPlatforms: z2.array(platformSchema).readonly().optional(),
2252
+ isReadyForPlatform: z2.record(platformSchema, z2.boolean()),
2253
+ widgetScreenshotKeys: z2.object({
2254
+ chatgpt: z2.string().optional(),
2255
+ claudeai: z2.string().optional()
2256
+ })
2257
+ });
2258
+ var widgetScreenshotSchema = z2.object({ url: z2.string() });
2259
+ var auditReportWithScreenshotsSchema = auditReportSchema.extend({ widgetScreenshots: z2.object({
2260
+ chatgpt: widgetScreenshotSchema.optional(),
2261
+ claudeai: widgetScreenshotSchema.optional()
2262
+ }) });
2263
+ var clientPoolSchema = z2.object({
2264
+ id: z2.string(),
2265
+ environmentId: z2.string(),
2266
+ clientId: z2.string(),
2267
+ clientSecret: z2.string(),
2268
+ clientScopes: z2.array(z2.string())
2269
+ });
2270
+ var NANO_USD_PER_USD = 1e9;
2271
+ var NANO_USD_PER_CENT = NANO_USD_PER_USD / 100;
2272
+ var FREE_CREDIT_SEED_IN_NANO_USD = 5 * NANO_USD_PER_USD;
2273
+ var PAID_CONVERSION_CREDIT_FLOOR_IN_NANO_USD = 5 * NANO_USD_PER_USD;
2274
+ var creditEntryReasonSchema = z2.enum([
2275
+ "free_seed",
2276
+ "paid_conversion_floor",
2277
+ "top_up",
2278
+ "usage",
2279
+ "admin_adjustment"
2280
+ ]);
2281
+ var creditEntrySourceSchema = z2.enum(["playground"]);
2282
+ var creditTopUpAmountInCentsSchema = z2.number().int().min(500);
2283
+ var creditActivityEntrySchema = z2.object({
2284
+ reason: creditEntryReasonSchema,
2285
+ day: z2.number(),
2286
+ amountInNanoUSD: z2.number(),
2287
+ messageCount: z2.number().nullable()
2288
+ });
2289
+ var teamCreditsSchema = z2.object({
2290
+ balanceInNanoUSD: z2.number(),
2291
+ recentActivity: z2.array(creditActivityEntrySchema)
2292
+ });
2293
+ var deploymentStatusSchema = z2.enum([
2294
+ "ongoing",
2295
+ "deployed",
2296
+ "failed",
2297
+ "canceled"
2298
+ ]);
2299
+ var deploymentLogSchema = z2.object({
2300
+ timestamp: z2.coerce.date().optional(),
2301
+ content: z2.string().optional()
2302
+ });
2303
+ var deploymentSummarySchema = z2.object({
2304
+ id: z2.string(),
2305
+ status: deploymentStatusSchema,
2306
+ sourceBucket: z2.string().nullable(),
2307
+ sourceObjectKey: z2.string().nullable(),
2308
+ sourceRef: z2.string().nullable(),
2309
+ sourceCommitId: z2.string().nullable(),
2310
+ sourceCommitMessage: z2.string().nullable(),
2311
+ environmentId: z2.string(),
2312
+ authorUsername: z2.string().nullable(),
2313
+ authorAvatarUrl: z2.string().nullable(),
2314
+ startedAt: z2.coerce.date().nullable(),
2315
+ completedAt: z2.coerce.date().nullable(),
2316
+ isCurrent: z2.boolean().optional(),
2317
+ createdAt: z2.coerce.date(),
2318
+ updatedAt: z2.coerce.date()
2319
+ });
2320
+ var publicEnvironmentSchema = z2.object({
2321
+ allowsAnonymous: z2.literal(true),
2322
+ oAuthMetadata: z2.strictObject({})
2323
+ });
2324
+ var externalResourceMetadataEnvironmentSchema = z2.object({
2325
+ allowsAnonymous: z2.boolean(),
2326
+ oAuthMetadata: z2.object({ externalResourceMetadataUrl: z2.url() }),
2327
+ scope: z2.string().optional()
2328
+ });
2329
+ var externalAuthorizationServerEnvironmentSchema = z2.object({
2330
+ allowsAnonymous: z2.boolean(),
2331
+ oAuthMetadata: z2.object({
2332
+ externalAuthorizationServerUrl: z2.url(),
2333
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
2334
+ }),
2335
+ scope: z2.string().optional()
2336
+ });
2337
+ var standaloneEnvironmentSchema = z2.object({
2338
+ allowsAnonymous: z2.boolean(),
2339
+ oAuthMetadata: z2.object({
2340
+ authorizationServerMetadata: z2.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
2341
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
2342
+ }),
2343
+ scope: z2.string().optional()
2344
+ });
2345
+ var protectedWithoutDiscoveryEnvironmentSchema = z2.object({
2346
+ allowsAnonymous: z2.literal(false),
2347
+ oAuthMetadata: z2.strictObject({}),
2348
+ scope: z2.string().optional(),
2349
+ wwwAuthenticate: z2.string().optional()
2350
+ });
2351
+ var legacyPublicEnvironmentSchema = z2.object({
2352
+ isPublic: z2.literal(true),
2353
+ oAuthMetadata: z2.undefined().optional()
2354
+ });
2355
+ var legacyExternalResourceMetadataEnvironmentSchema = z2.object({
2356
+ isPublic: z2.literal(false),
2357
+ oAuthMetadata: z2.object({ externalResourceMetadataUrl: z2.url() }),
2358
+ scope: z2.string().optional()
2359
+ });
2360
+ var legacyExternalAuthorizationServerEnvironmentSchema = z2.object({
2361
+ isPublic: z2.literal(false),
2362
+ oAuthMetadata: z2.object({
2363
+ externalAuthorizationServerUrl: z2.url(),
2364
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
2365
+ }),
2366
+ scope: z2.string().optional()
2367
+ });
2368
+ var legacyStandaloneEnvironmentSchema = z2.object({
2369
+ isPublic: z2.literal(false),
2370
+ oAuthMetadata: z2.object({
2371
+ authorizationServerMetadata: z2.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
2372
+ resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
2373
+ }),
2374
+ scope: z2.string().optional()
2375
+ });
2376
+ var legacyProtectedWithoutDiscoveryEnvironmentSchema = z2.object({
2377
+ isPublic: z2.literal(false),
2378
+ oAuthMetadata: z2.strictObject({}),
2379
+ scope: z2.string().optional()
2380
+ });
2381
+ var environmentOAuthMetadataSchema = z2.union([
2382
+ publicEnvironmentSchema,
2383
+ externalResourceMetadataEnvironmentSchema,
2384
+ externalAuthorizationServerEnvironmentSchema,
2385
+ standaloneEnvironmentSchema,
2386
+ protectedWithoutDiscoveryEnvironmentSchema,
2387
+ legacyPublicEnvironmentSchema,
2388
+ legacyExternalResourceMetadataEnvironmentSchema,
2389
+ legacyExternalAuthorizationServerEnvironmentSchema,
2390
+ legacyStandaloneEnvironmentSchema,
2391
+ legacyProtectedWithoutDiscoveryEnvironmentSchema
2392
+ ]);
2393
+ var PLAYGROUND_MODELS = [
2394
+ "global.anthropic.claude-haiku-5-5",
2395
+ "global.anthropic.claude-haiku-4-5-20251001-v1:0",
2396
+ "global.anthropic.claude-sonnet-5-5",
2397
+ "openai.gpt-5.4",
2398
+ "openai.gpt-5.5",
2399
+ "openai.gpt-6-luna",
2400
+ "openai.gpt-6.1-sol"
2401
+ ];
2402
+ var playgroundModelSchema = z2.enum(PLAYGROUND_MODELS);
2403
+ var environmentDomainSchema = z2.object({
2404
+ name: z2.string(),
2405
+ status: z2.enum([
2406
+ "ongoing",
2407
+ "deployed",
2408
+ "failed"
2409
+ ]),
2410
+ createdAt: z2.coerce.date(),
2411
+ updatedAt: z2.coerce.date()
2412
+ });
2413
+ var environmentSchema = z2.object({
2414
+ id: z2.string(),
2415
+ name: z2.string(),
2416
+ sourceBranch: z2.string().nullable(),
2417
+ mcpServerUrl: z2.string(),
2418
+ activeDeployment: deploymentSummarySchema.optional(),
2419
+ latestDeployment: deploymentSummarySchema.optional(),
2420
+ openaiAppsChallenge: z2.string().nullable().optional(),
2421
+ isPlaygroundEnabled: z2.boolean(),
2422
+ playgroundModel: playgroundModelSchema,
2423
+ isIpWhitelistEnabled: z2.boolean(),
2424
+ ipAllowlist: z2.array(z2.string()).nullable(),
2425
+ allowedPlatforms: z2.array(allowedPlatformSchema),
2426
+ projectId: z2.string(),
2427
+ createdAt: z2.coerce.date(),
2428
+ updatedAt: z2.coerce.date()
2429
+ });
2430
+ var environmentWithDomainsSchema = environmentSchema.extend({ domains: z2.array(environmentDomainSchema) });
2431
+ var privacySettingsSchema = z2.object({
2432
+ sessionReplayEnabled: z2.boolean(),
2433
+ collectRequestPayload: z2.boolean(),
2434
+ collectResponsePayload: z2.boolean(),
2435
+ collectErrorMessage: z2.boolean(),
2436
+ collectUserData: z2.boolean(),
2437
+ identityTraitKey: z2.string().min(1).max(200).nullable(),
2438
+ leadEventName: z2.string().min(1).max(200).nullable()
2439
+ });
2440
+ var feedbackSchema = z2.object({
2441
+ id: z2.string(),
2442
+ createdAt: z2.coerce.date(),
2443
+ environmentId: z2.string(),
2444
+ content: z2.string(),
2445
+ source: z2.enum(["model", "user"]),
2446
+ clientName: z2.string().nullable()
2447
+ });
2448
+ var feedbackMetaSchema = z2.object({
2449
+ content: z2.string(),
2450
+ source: z2.enum(["model", "user"])
2451
+ });
2452
+ var intentCategoryColorSchema = z2.enum([
2453
+ "red",
2454
+ "orange",
2455
+ "yellow",
2456
+ "green",
2457
+ "blue",
2458
+ "purple",
2459
+ "pink",
2460
+ "gray"
2461
+ ]);
2462
+ var INTENT_CATEGORY_COLORS = intentCategoryColorSchema.options;
2463
+ var intentCategorySchema = z2.object({
2464
+ id: z2.string(),
2465
+ createdAt: z2.coerce.date(),
2466
+ environmentId: z2.string(),
2467
+ name: z2.string(),
2468
+ color: intentCategoryColorSchema
2469
+ });
2470
+ var intentCategorySummarySchema = z2.object({
2471
+ id: z2.string(),
2472
+ name: z2.string(),
2473
+ color: intentCategoryColorSchema,
2474
+ intentCount: z2.number().int().nonnegative()
2475
+ });
2476
+ var intentSchema = z2.object({
2477
+ id: z2.string(),
2478
+ createdAt: z2.coerce.date(),
2479
+ environmentId: z2.string(),
2480
+ toolName: z2.string(),
2481
+ message: z2.string(),
2482
+ clientName: z2.string().nullable(),
2483
+ categories: z2.array(intentCategorySchema)
2484
+ });
2485
+ var signalCategorySchema = z2.object({
2486
+ id: z2.string(),
2487
+ name: z2.string(),
2488
+ color: intentCategoryColorSchema
2489
+ });
2490
+ var signalSchema = z2.discriminatedUnion("kind", [
2491
+ z2.object({
2492
+ kind: z2.literal("new"),
2493
+ category: signalCategorySchema,
2494
+ currentCount: z2.number().int().nonnegative(),
2495
+ currentShare: z2.number()
2496
+ }),
2497
+ z2.object({
2498
+ kind: z2.literal("resurging"),
2499
+ category: signalCategorySchema,
2500
+ currentCount: z2.number().int().nonnegative(),
2501
+ daysQuiet: z2.number(),
2502
+ currentShare: z2.number()
2503
+ }),
2504
+ z2.object({
2505
+ kind: z2.literal("spike"),
2506
+ category: signalCategorySchema,
2507
+ currentCount: z2.number().int().nonnegative(),
2508
+ previousCount: z2.number().int().nonnegative(),
2509
+ currentShare: z2.number(),
2510
+ previousShare: z2.number(),
2511
+ changeRatio: z2.number()
2512
+ }),
2513
+ z2.object({
2514
+ kind: z2.literal("declining"),
2515
+ category: signalCategorySchema,
2516
+ currentCount: z2.number().int().nonnegative(),
2517
+ previousCount: z2.number().int().nonnegative(),
2518
+ currentShare: z2.number(),
2519
+ previousShare: z2.number(),
2520
+ changeRatio: z2.number()
2521
+ })
2522
+ ]);
2523
+ var intentCategorySuggestionSchema = z2.discriminatedUnion("kind", [z2.object({
2524
+ kind: z2.literal("existing"),
2525
+ categoryId: z2.string(),
2526
+ categoryName: z2.string(),
2527
+ intentIds: z2.array(z2.string())
2528
+ }), z2.object({
2529
+ kind: z2.literal("new"),
2530
+ categoryName: z2.string(),
2531
+ intentIds: z2.array(z2.string())
2532
+ })]);
2533
+ var invitationSchema = z2.object({
2534
+ id: z2.string(),
2535
+ teamId: z2.string(),
2536
+ email: z2.string(),
2537
+ expiresAt: z2.coerce.date(),
2538
+ createdAt: z2.coerce.date(),
2539
+ updatedAt: z2.coerce.date()
2540
+ });
2541
+ var alpicMcpRequestLogSchema = z2.object({
2542
+ type: z2.literal("mcp_request"),
2543
+ method: z2.string()
2544
+ });
2545
+ var alpicMcpErrorLogSchema = z2.object({
2546
+ type: z2.literal("mcp_error"),
2547
+ method: z2.string(),
2548
+ error: z2.string()
2549
+ });
2550
+ var alpicLogContentSchema = z2.union([alpicMcpRequestLogSchema, alpicMcpErrorLogSchema]);
2551
+ var logLevelSchema = z2.enum([
2552
+ "INFO",
2553
+ "WARNING",
2554
+ "DEBUG",
2555
+ "ERROR"
2556
+ ]);
2557
+ var LOG_SEARCH_MAX_ESCAPED_LENGTH = 960;
2558
+ function escapeLogSearchTerm(search) {
2559
+ return [...search].flatMap((character) => [...new TextEncoder().encode(character)]).map((byte) => {
2560
+ const character = String.fromCharCode(byte);
2561
+ return /^[a-zA-Z0-9]$/.test(character) ? character : `\\x${byte.toString(16).toUpperCase().padStart(2, "0")}`;
2562
+ }).join("");
2563
+ }
2564
+ var logSearchSchema = z2.string().max(240, `Search must be 240 characters or fewer`).refine((search) => escapeLogSearchTerm(search).length <= LOG_SEARCH_MAX_ESCAPED_LENGTH, "Search is too complex; shorten it or use fewer special characters");
2565
+ var UNNAMED_MCP_CLIENT_ID = "unnamed_client";
2566
+ var MCP_CLIENT_GROUPS = [
2567
+ {
2568
+ id: "claude_code",
2569
+ label: "Claude Code",
2570
+ vendor: "anthropic",
2571
+ rawNames: ["claude-code", "Anthropic/ClaudeCodeDesktop"]
2572
+ },
2573
+ {
2574
+ id: "claude",
2575
+ label: "Claude",
2576
+ vendor: "anthropic",
2577
+ rawNames: [
2578
+ "Anthropic/ClaudeAI",
2579
+ "claude-ai",
2580
+ "claude",
2581
+ "Claude",
2582
+ "claude-desktop",
2583
+ "claude-desktop-3p"
2584
+ ]
2585
+ },
2586
+ {
2587
+ id: "claude_mobile",
2588
+ label: "Claude mobile",
2589
+ vendor: "anthropic",
2590
+ rawNames: ["claude-ios", "ClaudeAndroid"]
2591
+ },
2592
+ {
2593
+ id: "claude_cowork",
2594
+ label: "Claude Cowork",
2595
+ vendor: "anthropic",
2596
+ rawNames: ["Anthropic/Cowork"]
2597
+ },
2598
+ {
2599
+ id: "claude_sheet_add_in",
2600
+ label: "Claude (Sheet Add-In)",
2601
+ vendor: "anthropic",
2602
+ rawNames: ["sheet-add-in"]
2603
+ },
2604
+ {
2605
+ id: "claude_toolbox",
2606
+ label: "Claude Toolbox",
2607
+ vendor: "anthropic",
2608
+ rawNames: ["Anthropic/Toolbox", "Anthropic/toolbox-bootstrap"]
2609
+ },
2610
+ {
2611
+ id: "anthropic_api",
2612
+ label: "Anthropic API",
2613
+ vendor: "anthropic",
2614
+ rawNames: ["Anthropic/API"]
2615
+ },
2616
+ {
2617
+ id: "anthropic_connector_refresh",
2618
+ label: "Anthropic (connector refresh)",
2619
+ vendor: "anthropic",
2620
+ rawNames: ["Anthropic"]
2621
+ },
2622
+ {
2623
+ id: "codex",
2624
+ label: "Codex",
2625
+ vendor: "openai",
2626
+ rawNames: [
2627
+ "codex-mcp-client",
2628
+ "codex",
2629
+ "Codex",
2630
+ "codex-cli",
2631
+ "openai-mcp (Codex)"
2632
+ ]
2633
+ },
2634
+ {
2635
+ id: "chatgpt",
2636
+ label: "ChatGPT",
2637
+ vendor: "openai",
2638
+ rawNames: ["openai-mcp", "openai-mcp (ChatGPT)"]
2639
+ },
2640
+ {
2641
+ id: "openai_responses_api",
2642
+ label: "OpenAI Responses API",
2643
+ vendor: "openai",
2644
+ rawNames: ["openai-mcp (Responses API)"]
2645
+ },
2646
+ {
2647
+ id: "openai_agent_builder",
2648
+ label: "OpenAI Agent Builder",
2649
+ vendor: "openai",
2650
+ rawNames: ["openai-mcp (Agent Builder)"]
2651
+ },
2652
+ {
2653
+ id: "cursor",
2654
+ label: "Cursor",
2655
+ vendor: "cursor",
2656
+ rawNames: [
2657
+ "cursor-vscode",
2658
+ "Cursor",
2659
+ "cursor"
2660
+ ]
2661
+ },
2662
+ {
2663
+ id: "cline",
2664
+ label: "Cline",
2665
+ vendor: "cline",
2666
+ rawNames: [
2667
+ "Cline",
2668
+ "cline",
2669
+ "@cline/core"
2670
+ ]
2671
+ },
2672
+ {
2673
+ id: "github_copilot",
2674
+ label: "GitHub Copilot",
2675
+ vendor: "githubCopilot",
2676
+ rawNames: [
2677
+ "Copilot",
2678
+ "github-copilot-developer",
2679
+ "Copilot MCP Gateway",
2680
+ "Xcode/copilot-xcode"
2681
+ ]
2682
+ },
2683
+ {
2684
+ id: "gemini_cli",
2685
+ label: "Gemini CLI",
2686
+ vendor: "google",
2687
+ rawNames: ["gemini-cli-mcp-client", "gemini-cli"]
2688
+ },
2689
+ {
2690
+ id: "antigravity",
2691
+ label: "Antigravity",
2692
+ vendor: "google",
2693
+ rawNames: ["antigravity-client"]
2694
+ },
2695
+ {
2696
+ id: "gemini",
2697
+ label: "Gemini",
2698
+ vendor: "google",
2699
+ rawNames: ["Gemini", "google-ai-edge-gallery"]
2700
+ },
2701
+ {
2702
+ id: "windsurf",
2703
+ label: "Windsurf",
2704
+ vendor: "windsurf",
2705
+ rawNames: ["Windsurf", "windsurf-client"]
2706
+ },
2707
+ {
2708
+ id: "mistral",
2709
+ label: "Mistral / Le Chat",
2710
+ vendor: "mistral",
2711
+ rawNames: ["Mistral"],
2712
+ rawNamePrefixes: ["connector:custom-mcp:"]
2713
+ },
2714
+ {
2715
+ id: "n8n",
2716
+ label: "n8n",
2717
+ vendor: "n8n",
2718
+ rawNames: [
2719
+ "@n8n/n8n-nodes-langchain.mcpClient",
2720
+ "@n8n/n8n-nodes-langchain.mcpClientTool",
2721
+ "n8n"
2722
+ ]
2723
+ },
2724
+ {
2725
+ id: "alpic_playground",
2726
+ label: "Alpic Playground",
2727
+ vendor: "alpic",
2728
+ rawNames: ["alpic-playground", "playground"]
2729
+ },
2730
+ {
2731
+ id: "opencode",
2732
+ label: "opencode",
2733
+ vendor: "opencode",
2734
+ rawNames: ["opencode"]
2735
+ },
2736
+ {
2737
+ id: "zed",
2738
+ label: "Zed",
2739
+ vendor: "zed",
2740
+ rawNames: ["Zed", "zed"]
2741
+ },
2742
+ {
2743
+ id: "zapier",
2744
+ label: "Zapier",
2745
+ vendor: "zapier",
2746
+ rawNames: ["Zapier", "zapier"]
2747
+ },
2748
+ {
2749
+ id: "make",
2750
+ label: "Make",
2751
+ vendor: "make",
2752
+ rawNames: ["Make", "make"]
2753
+ },
2754
+ {
2755
+ id: "librechat",
2756
+ label: "LibreChat",
2757
+ vendor: "mcp",
2758
+ rawNames: ["LibreChat", "librechat"]
2759
+ },
2760
+ {
2761
+ id: "jan",
2762
+ label: "Jan",
2763
+ vendor: "mcp",
2764
+ rawNames: ["Jan", "jan"]
2765
+ },
2766
+ {
2767
+ id: "goose",
2768
+ label: "goose",
2769
+ vendor: "mcp",
2770
+ rawNames: ["goose", "Goose"]
2771
+ },
2772
+ {
2773
+ id: "mcphost",
2774
+ label: "mcphost",
2775
+ vendor: "mcp",
2776
+ rawNames: ["mcphost"]
2777
+ },
2778
+ {
2779
+ id: "mcporter",
2780
+ label: "mcporter",
2781
+ vendor: "mcp",
2782
+ rawNames: ["mcporter"]
2783
+ },
2784
+ {
2785
+ id: "rmcp",
2786
+ label: "rmcp",
2787
+ vendor: "mcp",
2788
+ rawNames: ["rmcp"]
2789
+ },
2790
+ {
2791
+ id: UNNAMED_MCP_CLIENT_ID,
2792
+ label: "Unnamed client",
2793
+ vendor: "mcp",
2794
+ rawNames: [
2795
+ "mcp",
2796
+ "unknown",
2797
+ ""
2798
+ ]
2799
+ }
2800
+ ];
2801
+ var MCP_REMOTE_WRAPPER_SUFFIX = String.raw` \(via mcp-remote [^\n]+?\)$`;
2802
+ var MCP_REMOTE_WRAPPER = new RegExp(MCP_REMOTE_WRAPPER_SUFFIX);
2803
+ var groupById = new Map(MCP_CLIENT_GROUPS.map((group) => [group.id, group]));
2804
+ var LTS_CODENAMES = /* @__PURE__ */ new Map([
2805
+ ["gallium", 16],
2806
+ ["hydrogen", 18],
2807
+ ["iron", 20],
2808
+ ["jod", 22],
2809
+ ["krypton", 24],
2810
+ ["lithium", 26]
2811
+ ]);
2812
+ var LATEST_LTS_VERSION = 26;
2813
+ function detectNodeRuntime(input) {
2814
+ for (const content of [input.nvmrcContent, input.nodeVersionContent]) {
2815
+ if (!content?.trim()) continue;
2816
+ const version = parseNodeVersion(content);
2817
+ if (version !== null) return mapNodeVersionToRuntime(version);
2818
+ }
2819
+ if (!input.packageJsonEnginesNode) return null;
2820
+ try {
2821
+ const version = (0, import_semver.minVersion)(input.packageJsonEnginesNode);
2822
+ return version ? mapNodeVersionToRuntime(version.major) : null;
2823
+ } catch {
23
2824
  return null;
2825
+ }
2826
+ }
2827
+ function parseNodeVersion(content) {
2828
+ const trimmed = content.trim().toLowerCase();
2829
+ if (!trimmed || trimmed === "node" || trimmed === "stable" || trimmed === "lts/*") return LATEST_LTS_VERSION;
2830
+ if (trimmed.startsWith("lts/")) return LTS_CODENAMES.get(trimmed.slice(4)) ?? null;
2831
+ const majorMatch = (trimmed.startsWith("v") ? trimmed.slice(1) : trimmed).match(/^(\d+)/);
2832
+ return majorMatch?.[1] ? parseInt(majorMatch[1], 10) : null;
2833
+ }
2834
+ function mapNodeVersionToRuntime(version) {
2835
+ if (version === null || version >= 26) return "node26";
2836
+ if (version >= 24) return "node24";
2837
+ return "node22";
2838
+ }
2839
+ var runtimeSchema = z2.enum([
2840
+ "python3.13",
2841
+ "python3.14",
2842
+ "node22",
2843
+ "node24",
2844
+ "node26"
2845
+ ]);
2846
+ var transportSchema = z2.enum([
2847
+ "stdio",
2848
+ "sse",
2849
+ "streamablehttp"
2850
+ ]);
2851
+ var projectSchema = z2.object({
2852
+ id: z2.string(),
2853
+ name: z2.string(),
2854
+ teamId: z2.string(),
2855
+ sourceRepository: z2.string().nullable(),
2856
+ createdAt: z2.coerce.date().optional(),
2857
+ runtime: runtimeSchema,
2858
+ transport: transportSchema.nullable(),
2859
+ rootDirectory: z2.string().nullable(),
2860
+ installCommand: z2.string().nullable(),
2861
+ buildCommand: z2.string().nullable(),
2862
+ buildOutputDir: z2.string().nullable(),
2863
+ startCommand: z2.string().nullable(),
2864
+ fixedOutboundIp: z2.boolean(),
2865
+ environments: z2.array(environmentWithDomainsSchema),
2866
+ productionEnvironment: environmentWithDomainsSchema.nullable()
2867
+ });
2868
+ var domainFailureReasonSchema = z2.enum([
2869
+ "caa",
2870
+ "dns",
2871
+ "invalid_domain",
2872
+ "other"
2873
+ ]);
2874
+ var projectDomainMappingSchema = z2.object({
2875
+ pathPrefix: z2.string(),
2876
+ environment: environmentSchema
2877
+ });
2878
+ var projectDomainSchema = z2.object({
2879
+ name: z2.string(),
2880
+ createdAt: z2.coerce.date(),
2881
+ status: z2.enum([
2882
+ "ongoing",
2883
+ "deployed",
2884
+ "failed"
2885
+ ]),
2886
+ failureReason: domainFailureReasonSchema.nullable(),
2887
+ environment: environmentSchema,
2888
+ mappings: z2.array(projectDomainMappingSchema)
2889
+ });
2890
+ var serverFieldsSchema = z2.object({
2891
+ $schema: z2.string(),
2892
+ name: z2.string(),
2893
+ description: z2.string(),
2894
+ version: z2.string().optional(),
2895
+ title: z2.string().optional(),
2896
+ websiteUrl: z2.string().optional(),
2897
+ icons: z2.array(z2.object({
2898
+ src: z2.string(),
2899
+ mimeType: z2.string().optional(),
2900
+ sizes: z2.array(z2.string()).optional()
2901
+ })).optional(),
2902
+ remotes: z2.array(z2.object({
2903
+ type: z2.string(),
2904
+ url: z2.string().optional(),
2905
+ headers: z2.array(z2.object({
2906
+ name: z2.string(),
2907
+ description: z2.string(),
2908
+ isRequired: z2.boolean().optional(),
2909
+ isSecret: z2.boolean().optional()
2910
+ })).optional()
2911
+ })).optional()
2912
+ }).catchall(z2.unknown());
2913
+ var serverJsonSchema = z2.object({
2914
+ serverFields: serverFieldsSchema,
2915
+ source: z2.enum(["registry", "defaults"])
2916
+ });
2917
+ var clampStringField = (field) => {
2918
+ const max = field.maxLength;
2919
+ if (max === null) return field;
2920
+ const clamped = z2.string().overwrite((value) => value.slice(0, max)).max(max);
2921
+ const withMin = field.minLength === null ? clamped : clamped.min(field.minLength);
2922
+ return field.description ? withMin.describe(field.description) : withMin;
2923
+ };
2924
+ var unboundedArrayField = (field) => {
2925
+ const unbounded = z2.array(field.element);
2926
+ return field.description ? unbounded.describe(field.description) : unbounded;
2927
+ };
2928
+ var toolDefinitionSchema = z2.object({
2929
+ name: z2.string(),
2930
+ title: z2.string().optional().describe("Human-friendly name for the tool, used in the UI. If not provided, `name` will be used."),
2931
+ description: z2.string().optional(),
2932
+ annotations: z2.object({
2933
+ readOnlyHint: z2.boolean().optional(),
2934
+ destructiveHint: z2.boolean().optional(),
2935
+ openWorldHint: z2.boolean().optional(),
2936
+ idempotentHint: z2.boolean().optional()
2937
+ }).optional()
2938
+ });
2939
+ var positiveTestCaseSchema = z2.object({
2940
+ scenario: z2.string().min(1).describe("Short label for what this case demonstrates."),
2941
+ userPrompt: z2.string().min(1).describe("A realistic, standalone user message a reviewer can paste and run with no prior state or multi-turn setup. Vary phrasing and tone across cases."),
2942
+ toolTriggered: z2.string().optional().describe("The tool this prompt should invoke."),
2943
+ expectedOutput: z2.string().optional().describe("What the user should see, including post-interaction behaviour where relevant.")
2944
+ }).describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
2945
+ var positiveTestCaseDraftSchema = positiveTestCaseSchema.partial().extend({
2946
+ scenario: z2.string().optional(),
2947
+ userPrompt: z2.string().optional()
2948
+ });
2949
+ var blankPositiveTestCase = () => ({
2950
+ scenario: "",
2951
+ userPrompt: "",
2952
+ toolTriggered: "",
2953
+ expectedOutput: ""
2954
+ });
2955
+ var toFixedLength = (entries, length, blank) => Array.from({ length }, (_, index) => entries[index] ?? blank());
2956
+ var screenshotEntrySchema = z2.object({
2957
+ prompt: z2.string(),
2958
+ url: z2.url()
2959
+ }).describe("Each screenshot: the user prompt that produced it + the image URL.");
2960
+ var screenshotDraftEntrySchema = screenshotEntrySchema.extend({ url: z2.string() });
2961
+ var supportChannelSchema = z2.string().refine((value) => z2.email().safeParse(value).success || z2.url().safeParse(value).success, { error: "Must be a valid email or URL" });
2962
+ var urlField = z2.url({ error: "Enter a full URL including https:// (e.g. https://example.com)" });
2963
+ var chatgptCategorySchema = z2.enum([
2964
+ "BUSINESS",
2965
+ "COLLABORATION",
2966
+ "DESIGN",
2967
+ "DEVELOPER_TOOLS",
2968
+ "EDUCATION",
2969
+ "ENTERTAINMENT",
2970
+ "FINANCE",
2971
+ "FOOD",
2972
+ "LIFESTYLE",
2973
+ "NEWS",
2974
+ "PRODUCTIVITY",
2975
+ "SHOPPING",
2976
+ "TRAVEL"
2977
+ ]);
2978
+ var chatgptAuthenticationSchema = z2.enum(["No auth needed", "OAuth 2.0"]);
2979
+ var chatgptCountryCodeSchema = z2.enum([
2980
+ "AD",
2981
+ "AE",
2982
+ "AF",
2983
+ "AG",
2984
+ "AL",
2985
+ "AM",
2986
+ "AO",
2987
+ "AR",
2988
+ "AT",
2989
+ "AU",
2990
+ "AW",
2991
+ "AX",
2992
+ "AZ",
2993
+ "BA",
2994
+ "BB",
2995
+ "BD",
2996
+ "BE",
2997
+ "BF",
2998
+ "BG",
2999
+ "BH",
3000
+ "BI",
3001
+ "BJ",
3002
+ "BL",
3003
+ "BM",
3004
+ "BN",
3005
+ "BO",
3006
+ "BR",
3007
+ "BS",
3008
+ "BT",
3009
+ "BW",
3010
+ "BZ",
3011
+ "CA",
3012
+ "CD",
3013
+ "CF",
3014
+ "CG",
3015
+ "CH",
3016
+ "CI",
3017
+ "CL",
3018
+ "CM",
3019
+ "CO",
3020
+ "CR",
3021
+ "CV",
3022
+ "CY",
3023
+ "CZ",
3024
+ "DE",
3025
+ "DJ",
3026
+ "DK",
3027
+ "DM",
3028
+ "DO",
3029
+ "DZ",
3030
+ "EC",
3031
+ "EE",
3032
+ "EG",
3033
+ "ER",
3034
+ "ES",
3035
+ "ET",
3036
+ "FI",
3037
+ "FJ",
3038
+ "FM",
3039
+ "FO",
3040
+ "FR",
3041
+ "GA",
3042
+ "GB",
3043
+ "GD",
3044
+ "GE",
3045
+ "GF",
3046
+ "GH",
3047
+ "GL",
3048
+ "GM",
3049
+ "GN",
3050
+ "GP",
3051
+ "GQ",
3052
+ "GR",
3053
+ "GT",
3054
+ "GW",
3055
+ "GY",
3056
+ "HN",
3057
+ "HR",
3058
+ "HT",
3059
+ "HU",
3060
+ "ID",
3061
+ "IE",
3062
+ "IL",
3063
+ "IN",
3064
+ "IQ",
3065
+ "IS",
3066
+ "IT",
3067
+ "JM",
3068
+ "JO",
3069
+ "JP",
3070
+ "KE",
3071
+ "KG",
3072
+ "KH",
3073
+ "KI",
3074
+ "KM",
3075
+ "KN",
3076
+ "KR",
3077
+ "KW",
3078
+ "KY",
3079
+ "KZ",
3080
+ "LA",
3081
+ "LB",
3082
+ "LC",
3083
+ "LI",
3084
+ "LK",
3085
+ "LR",
3086
+ "LS",
3087
+ "LT",
3088
+ "LU",
3089
+ "LV",
3090
+ "LY",
3091
+ "MA",
3092
+ "MC",
3093
+ "MD",
3094
+ "ME",
3095
+ "MF",
3096
+ "MG",
3097
+ "MH",
3098
+ "MK",
3099
+ "ML",
3100
+ "MM",
3101
+ "MN",
3102
+ "MQ",
3103
+ "MR",
3104
+ "MT",
3105
+ "MU",
3106
+ "MV",
3107
+ "MW",
3108
+ "MX",
3109
+ "MY",
3110
+ "MZ",
3111
+ "NA",
3112
+ "NC",
3113
+ "NE",
3114
+ "NG",
3115
+ "NI",
3116
+ "NL",
3117
+ "NO",
3118
+ "NP",
3119
+ "NR",
3120
+ "NZ",
3121
+ "OM",
3122
+ "PA",
3123
+ "PE",
3124
+ "PF",
3125
+ "PG",
3126
+ "PH",
3127
+ "PK",
3128
+ "PL",
3129
+ "PM",
3130
+ "PS",
3131
+ "PT",
3132
+ "PW",
3133
+ "PY",
3134
+ "QA",
3135
+ "RE",
3136
+ "RO",
3137
+ "RS",
3138
+ "RW",
3139
+ "SA",
3140
+ "SB",
3141
+ "SC",
3142
+ "SD",
3143
+ "SE",
3144
+ "SG",
3145
+ "SH",
3146
+ "SI",
3147
+ "SJ",
3148
+ "SK",
3149
+ "SL",
3150
+ "SM",
3151
+ "SN",
3152
+ "SO",
3153
+ "SR",
3154
+ "SS",
3155
+ "ST",
3156
+ "SV",
3157
+ "SZ",
3158
+ "TD",
3159
+ "TF",
3160
+ "TG",
3161
+ "TH",
3162
+ "TJ",
3163
+ "TL",
3164
+ "TM",
3165
+ "TN",
3166
+ "TO",
3167
+ "TR",
3168
+ "TT",
3169
+ "TV",
3170
+ "TW",
3171
+ "TZ",
3172
+ "UA",
3173
+ "UG",
3174
+ "US",
3175
+ "UY",
3176
+ "UZ",
3177
+ "VA",
3178
+ "VC",
3179
+ "VN",
3180
+ "VU",
3181
+ "WF",
3182
+ "WS",
3183
+ "YE",
3184
+ "YT",
3185
+ "ZA",
3186
+ "ZM",
3187
+ "ZW"
3188
+ ]);
3189
+ var chatgptAllowedCountriesSchema = z2.discriminatedUnion("mode", [
3190
+ z2.object({ mode: z2.literal("all") }),
3191
+ z2.object({
3192
+ mode: z2.literal("allow"),
3193
+ countries: z2.array(chatgptCountryCodeSchema)
3194
+ }),
3195
+ z2.object({
3196
+ mode: z2.literal("block"),
3197
+ countries: z2.array(chatgptCountryCodeSchema)
3198
+ })
3199
+ ]);
3200
+ var chatgptTranslationLocaleSchema = z2.enum([
3201
+ "am",
3202
+ "ar",
3203
+ "bg-BG",
3204
+ "bn-BD",
3205
+ "bs-BA",
3206
+ "ca-ES",
3207
+ "cs-CZ",
3208
+ "da-DK",
3209
+ "de-DE",
3210
+ "el-GR",
3211
+ "es-419",
3212
+ "es-ES",
3213
+ "et-EE",
3214
+ "fi-FI",
3215
+ "fr-CA",
3216
+ "fr-FR",
3217
+ "gu-IN",
3218
+ "hi-IN",
3219
+ "hr-HR",
3220
+ "hu-HU",
3221
+ "hy-AM",
3222
+ "id-ID",
3223
+ "is-IS",
3224
+ "it-IT",
3225
+ "ja-JP",
3226
+ "ka-GE",
3227
+ "kk",
3228
+ "kn-IN",
3229
+ "ko-KR",
3230
+ "lt",
3231
+ "lv-LV",
3232
+ "mk-MK",
3233
+ "ml",
3234
+ "mn",
3235
+ "mr-IN",
3236
+ "ms-MY",
3237
+ "my-MM",
3238
+ "nb-NO",
3239
+ "nl-NL",
3240
+ "pa",
3241
+ "pl-PL",
3242
+ "pt-BR",
3243
+ "pt-PT",
3244
+ "ro-RO",
3245
+ "ru-RU",
3246
+ "sk-SK",
3247
+ "sl-SI",
3248
+ "so-SO",
3249
+ "sq-AL",
3250
+ "sr-RS",
3251
+ "sv-SE",
3252
+ "sw-TZ",
3253
+ "ta-IN",
3254
+ "te-IN",
3255
+ "th-TH",
3256
+ "tl",
3257
+ "tr-TR",
3258
+ "uk-UA",
3259
+ "ur",
3260
+ "vi-VN",
3261
+ "zh-CN",
3262
+ "zh-HK",
3263
+ "zh-TW"
3264
+ ]);
3265
+ var negativeTestCaseSchema = z2.object({
3266
+ scenario: z2.string().min(1),
3267
+ userPrompt: z2.string().min(1)
3268
+ }).describe("Each case: Scenario + User prompt (the plugin should NOT trigger).");
3269
+ var negativeTestCaseDraftSchema = negativeTestCaseSchema.partial().extend({
3270
+ scenario: z2.string().optional(),
3271
+ userPrompt: z2.string().optional()
3272
+ });
3273
+ var blankNegativeTestCase = () => ({
3274
+ scenario: "",
3275
+ userPrompt: ""
3276
+ });
3277
+ var chatgptSkillSchema = z2.object({ name: z2.string() }).describe("A skill discovered on the MCP server, by name.");
3278
+ var chatgptToolJustificationSchema = z2.object({
3279
+ toolName: z2.string(),
3280
+ readOnlyJustification: z2.string().describe("One sentence on what the tool reads and returns."),
3281
+ openWorldJustification: z2.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
3282
+ destructiveJustification: z2.string().describe('One sentence on whether the tool changes data. For a read-only tool, state the full triad: "No data is created, modified, or deleted."')
3283
+ }).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
3284
+ var chatgptTaglineSchema = z2.string().max(30);
3285
+ var chatgptDescriptionSchema = z2.string();
3286
+ var chatgptTranslationSchema = z2.object({
3287
+ locale: chatgptTranslationLocaleSchema,
3288
+ tagline: chatgptTaglineSchema,
3289
+ description: chatgptDescriptionSchema
3290
+ }).describe("Locale-scoped override for tagline + description. English (US) is the default.");
3291
+ var chatgptTranslationGenerationSchema = chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
3292
+ var chatgptSubmissionFormDataSchema = z2.object({
3293
+ logoLight: z2.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
3294
+ logoDark: z2.string().optional().describe("Optional dark-mode logo icon. Square PNG, same specs as the light icon. Leave empty if the light icon also works on dark backgrounds."),
3295
+ appName: z2.string().describe("The name users will see in ChatGPT and in the Plugin Directory."),
3296
+ tagline: chatgptTaglineSchema.describe('Plain-language phrase focused on function and user value, 30 chars max. Avoid generic superlatives like "the best \u2026".'),
3297
+ description: chatgptDescriptionSchema.describe("Clear, engaging description highlighting what the plugin does and why people will love it. Appears publicly on the directory page. End it by naming the product categories or intents the plugin does NOT cover, so ChatGPT learns when not to route to it (define exclusions by absent categories or wrong intents, never by naming other brands)."),
3298
+ category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
3299
+ developerName: z2.string().describe("Developer name shown publicly on the plugin's directory page."),
3300
+ companyUrl: urlField.describe("Your company's main website URL."),
3301
+ supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
3302
+ privacyPolicyUrl: urlField.describe("URL to your privacy policy."),
3303
+ termsOfServiceUrl: urlField.describe("URL to the plugin's terms of service."),
3304
+ demoRecordingUrl: urlField.describe("URL to a video demonstrating the plugin, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
3305
+ appCommerceAndPurchasing: z2.boolean().describe("Checkbox: 'My plugin links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the plugin does not offer digital goods."),
3306
+ serverUrl: urlField.describe("URL of the MCP server."),
3307
+ authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
3308
+ tools: z2.array(toolDefinitionSchema).describe("List of tools exposed by the MCP server (auto-populated from the production server's manifest)."),
3309
+ toolJustifications: z2.array(chatgptToolJustificationSchema).describe("Per-tool justification of `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotation values. One short, specific sentence per hint describing what the tool actually does."),
3310
+ skills: z2.array(chatgptSkillSchema).optional().describe("Skills the server exposes over MCP (auto-populated from the production server's manifest). Left unset when the server does not advertise the skills extension, which is a different state from advertising it and exposing none."),
3311
+ testCases: z2.array(positiveTestCaseSchema).length(5).describe("Exactly 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output. Collectively cover the full capability across different flow stages (initial search or browse, market or locale handling, post-interaction detail, an action ChatGPT performs on the user's behalf, and a conversion or secondary tool) rather than five variations of the same first step."),
3312
+ negativeTestCases: z2.array(negativeTestCaseSchema).length(3).describe("Exactly 3 negative test cases: prompts where the plugin should NOT trigger but the model might think it is relevant. These become production routing metadata that teaches ChatGPT when to stay silent, so pick tight near-misses: a product category the plugin does not carry, the right brand or domain but an intent the plugin does not serve, or a boundary with a sibling plugin."),
3313
+ screenshots: z2.array(screenshotEntrySchema.extend({ prompt: z2.string().max(75, { error: "Screenshot prompts are limited to 75 characters." }) })).max(3).describe("In-plugin screenshots paired with the user prompt that produced them (each prompt is 75 characters max). Widget plugins must show the widget UI; non-widget plugins show the model response. Min 1, max 3 entries, all public. Images: 706px wide, 400\u2013860px tall, PNG."),
3314
+ translations: z2.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
3315
+ allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
3316
+ releaseNotes: z2.string().describe("Publicly displayed on the plugin details page.")
3317
+ });
3318
+ var chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
3319
+ tagline: z2.string().optional(),
3320
+ companyUrl: z2.string().optional(),
3321
+ supportChannel: z2.string().optional(),
3322
+ privacyPolicyUrl: z2.string().optional(),
3323
+ termsOfServiceUrl: z2.string().optional(),
3324
+ demoRecordingUrl: z2.string().optional(),
3325
+ serverUrl: z2.string().optional(),
3326
+ screenshots: z2.array(screenshotDraftEntrySchema).optional(),
3327
+ testCases: z2.array(positiveTestCaseDraftSchema).optional(),
3328
+ negativeTestCases: z2.array(negativeTestCaseDraftSchema).optional(),
3329
+ translations: z2.array(chatgptTranslationSchema.extend({ tagline: z2.string() })).optional()
3330
+ });
3331
+ var chatgptPrefillFormDataSchema = chatgptSubmissionFormDataSchema.pick({
3332
+ appName: true,
3333
+ developerName: true,
3334
+ serverUrl: true,
3335
+ tools: true,
3336
+ skills: true,
3337
+ authentication: true
3338
+ });
3339
+ var chatgptAiGeneratedFormDataRawSchema = chatgptSubmissionFormDataSchema.pick({
3340
+ tagline: true,
3341
+ description: true,
3342
+ category: true,
3343
+ testCases: true,
3344
+ negativeTestCases: true,
3345
+ toolJustifications: true
3346
+ }).extend({
3347
+ testCases: unboundedArrayField(chatgptSubmissionFormDataSchema.shape.testCases),
3348
+ negativeTestCases: unboundedArrayField(chatgptSubmissionFormDataSchema.shape.negativeTestCases)
3349
+ });
3350
+ var chatgptAiGeneratedFormDataSchema = chatgptAiGeneratedFormDataRawSchema.extend({
3351
+ tagline: clampStringField(chatgptSubmissionFormDataSchema.shape.tagline),
3352
+ testCases: z2.array(positiveTestCaseDraftSchema).transform((cases) => toFixedLength(cases, 5, blankPositiveTestCase)),
3353
+ negativeTestCases: z2.array(negativeTestCaseDraftSchema).transform((cases) => toFixedLength(cases, 3, blankNegativeTestCase))
3354
+ });
3355
+ var claudeCategorySchema = z2.enum([
3356
+ "Productivity",
3357
+ "Communication",
3358
+ "Data & Analytics",
3359
+ "Development tools",
3360
+ "Financial Services",
3361
+ "Consumer Health",
3362
+ "Health & Life Sciences",
3363
+ "Media & Entertainment",
3364
+ "Commerce & Shopping",
3365
+ "Legal",
3366
+ "Sales and marketing",
3367
+ "Creative",
3368
+ "Nonprofit",
3369
+ "Education",
3370
+ "Other"
3371
+ ]);
3372
+ var claudeCategoryDescription = `The categories used to filter connectors in the directory UI. Select up to 5 that best describe your connector.`;
3373
+ var claudeReadWriteCapabilitiesSchema = z2.enum([
3374
+ "read_only",
3375
+ "write_only",
3376
+ "read_write"
3377
+ ]);
3378
+ var claudeAuthenticationSchema = z2.enum([
3379
+ "oauth_dcr",
3380
+ "oauth_cimd",
3381
+ "oauth_anthropic_creds",
3382
+ "custom_connection",
3383
+ "none"
3384
+ ]);
3385
+ var claudeApiOwnershipSchema = z2.enum([
3386
+ "first_party",
3387
+ "proxied",
3388
+ "third_party"
3389
+ ]);
3390
+ var claudeYesNoOtherSchema = z2.union([z2.boolean(), z2.object({ other: z2.string() })]);
3391
+ var claudePolicyAcknowledgementSchema = z2.enum([
3392
+ "I have read and understand the MCP Directory developer guidelines.",
3393
+ "My server calls our own first-party APIs (or APIs we legitimately proxy with permission).",
3394
+ "My connector does not transfer money, cryptocurrency, or other financial assets on a user's behalf.",
3395
+ "My connector does not use AI models to generate images, video, or audio.",
3396
+ "Tool descriptions contain no instructions about model behavior, other tools, or external instruction sources, and no hidden or encoded text.",
3397
+ "My connector does not collect conversation data beyond what is needed for its function.",
3398
+ "Public documentation for this connector will be live by the publish date."
3399
+ ]);
3400
+ var claudeSubmissionFormDataSchema = z2.object({
3401
+ serverUrl: z2.url().describe(`The full https:// URL where your MCP server is hosted and reachable. In the claude.ai wizard this is read live
3402
+ from the custom connector you select \u2014 the connection is used to verify the URL and the tool list at submission time.
3403
+ The server must be publicly accessible without VPN or whitelisting.`),
3404
+ name: z2.string().max(100).describe(`The public display name for your connector as it appears in the directory. Use your brand/product name. You must
3405
+ own or have the right to use this name. Max 100 characters.`),
3406
+ slug: z2.string().max(50).regex(/^[a-z0-9-]+$/).describe(`URL-safe identifier for your connector's directory page. Lowercase letters, numbers, and hyphens only.
3407
+ PERMANENT after submission \u2014 it cannot be changed. Pre-filled from the name. Max 50 characters.`),
3408
+ oneLiner: z2.string().max(200).describe(`A short tagline shown below your connector name in the directory listing. Max 200 characters. Avoid generic
3409
+ phrases like 'The best MCP server for...'. Example: 'Manage tasks and projects in Linear'.`),
3410
+ description: z2.string().max(2e3).describe(`A description of what your connector does and its key features, shown on the connector's detail page in
3411
+ claude.ai. Write it from a user perspective and be specific. Max 2000 characters.`),
3412
+ categories: z2.array(claudeCategorySchema).max(5).describe(claudeCategoryDescription),
3413
+ iconUrl: z2.url().optional().describe(`Optional custom icon for the directory listing \u2014 a square SVG. By default the favicon from your MCP URL is used
3414
+ (recommended); upload a custom icon only to override it.`),
3415
+ documentation: z2.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. Must be publicly
3416
+ accessible without login. IT admins often review these when deciding whether to approve a server. Required to be live
3417
+ by your publish date.`),
3418
+ support: supportChannelSchema.describe(`A support URL or email address where users can get help with your connector. Displayed in the directory listing and
3419
+ used to notify you of security or compliance issues, so make sure it's actively monitored.`),
3420
+ privacyPolicy: z2.url().describe(`URL to your privacy policy. Mandatory and displayed in the directory listing. Must be publicly accessible and cover
3421
+ what data you collect, how you use and store it, and whether you share it with third parties.`),
3422
+ screenshots: z2.array(screenshotEntrySchema).optional().describe(`Carousel images shown on your connector's directory page (PNG). Each is paired with the user prompt that produced
3423
+ it. This is editable on the directory page only after the connector is submitted \u2014 optional here so you can prepare it.`),
3424
+ primaryUseCases: z2.string().describe(`Describe the main tasks users will accomplish with this connector, and include a few example prompts a user might
3425
+ type. These may be shown publicly but are primarily used for internal review \u2014 reviewers test your server using them.`),
3426
+ connectionRequirements: z2.string().describe(`What accounts, permissions, or setup a user needs before connecting (e.g. 'Requires a paid Acme account with admin
3427
+ permissions'). If there are genuinely no special requirements, say so explicitly.`),
3428
+ readWriteCapabilities: claudeReadWriteCapabilitiesSchema.describe(`What your server can do:
3429
+ \u2022 'read_only': retrieves data but never modifies it.
3430
+ \u2022 'write_only': creates or modifies data but does not read it.
3431
+ \u2022 'read_write': both retrieves and modifies data (most common).`),
3432
+ companyName: z2.string().describe("The company or organization behind this connector \u2014 its legal name or publicly known product name."),
3433
+ companyWebsite: z2.url().describe("The company's main website URL, e.g. https://example.com."),
3434
+ primaryContactName: z2.string().describe("Full name of the person Anthropic should contact about this submission. Receives review feedback and follow-up questions."),
3435
+ primaryContactEmail: z2.email().describe("Email for the primary contact (pre-filled from the Claude account). Anthropic uses this to communicate about your submission."),
3436
+ primaryContactRole: z2.string().optional().describe("The primary contact's role at the company (e.g. 'Engineer', 'Product Manager'). Optional."),
3437
+ anthropicPointOfContact: z2.string().optional().describe("If you've been working with someone at Anthropic, their name or email. Optional, can expedite review."),
3438
+ authentication: claudeAuthenticationSchema.describe(`How users authenticate with your server:
3439
+ \u2022 'oauth_dcr': OAuth 2.0 + Dynamic Client Registration (RFC 7591) \u2014 clients register themselves.
3440
+ \u2022 'oauth_cimd': OAuth 2.0 + Client ID Metadata Document \u2014 a published client_id metadata document.
3441
+ \u2022 'oauth_anthropic_creds': OAuth 2.0 with Anthropic-held client credentials (a static client_id, and secret if needed).
3442
+ \u2022 'custom_connection': users supply their own URL or client details at connection time (e.g. Snowflake).
3443
+ \u2022 'none': no authentication (authless) \u2014 anyone can connect and call tools without credentials.`),
3444
+ partialAuth: z2.boolean().optional().describe("Whether some tools return 401 and prompt for auth on demand while the server otherwise starts authless (partial auth)."),
3445
+ apiOwnership: claudeApiOwnershipSchema.describe(`How your connector relates to the API it calls:
3446
+ \u2022 'first_party': the MCP server calls your own production APIs.
3447
+ \u2022 'proxied': calls go to a third-party API you're authorized to integrate (e.g. a Zapier-style integration).
3448
+ \u2022 'third_party': calls a third-party API you don't control \u2014 typically blocks listing; explain in 'additionalNotes'.`),
3449
+ personalHealthData: claudeYesNoOtherSchema.describe(`Whether this connector accesses, processes, or stores personal health information.
3450
+ No \u2192 false, Yes \u2192 true, or { other: explanation } when it depends on configuration.`),
3451
+ sponsoredContent: claudeYesNoOtherSchema.describe(`Whether this connector surfaces sponsored, promoted, or advertising content (prohibited in directory connectors).
3452
+ No \u2192 false, Yes \u2192 true, or { other: explanation }.`),
3453
+ testInstructions: z2.string().optional().describe(`Clear test-account setup and access instructions for reviewers: every link, credential, and step needed to access
3454
+ the MCP server autonomously. For accounts that need to be populated, provide test credentials granting access to a
3455
+ fully populated account.`),
3456
+ selfTested: z2.boolean().optional().describe("Confirmation that you have run every tool via MCP Inspector or as a custom connector in Claude."),
3457
+ policyAcknowledgements: z2.array(claudePolicyAcknowledgementSchema).describe(`Anthropic directory policy acknowledgements. All items must be acknowledged before the claude.ai wizard allows
3458
+ submission. Each is an attestation you are legally agreeing to by submitting.`),
3459
+ additionalNotes: z2.string().optional().describe("Anything else the review team should know about your connector. Optional.")
3460
+ });
3461
+ var claudeSubmissionDraftSchema = claudeSubmissionFormDataSchema.partial().extend({
3462
+ serverUrl: z2.string().optional(),
3463
+ name: z2.string().optional(),
3464
+ slug: z2.string().optional(),
3465
+ oneLiner: z2.string().optional(),
3466
+ description: z2.string().optional(),
3467
+ iconUrl: z2.string().optional(),
3468
+ documentation: z2.string().optional(),
3469
+ support: z2.string().optional(),
3470
+ privacyPolicy: z2.string().optional(),
3471
+ companyWebsite: z2.string().optional(),
3472
+ primaryContactEmail: z2.string().optional(),
3473
+ categories: z2.array(claudeCategorySchema).optional(),
3474
+ screenshots: z2.array(screenshotDraftEntrySchema).optional()
3475
+ });
3476
+ var claudePrefillFormDataSchema = claudeSubmissionFormDataSchema.pick({
3477
+ serverUrl: true,
3478
+ name: true,
3479
+ slug: true,
3480
+ companyName: true,
3481
+ primaryContactEmail: true,
3482
+ primaryContactName: true,
3483
+ readWriteCapabilities: true,
3484
+ authentication: true,
3485
+ apiOwnership: true,
3486
+ personalHealthData: true
3487
+ }).extend({
3488
+ connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
3489
+ testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
3490
+ });
3491
+ var claudeAiGeneratedFormDataRawSchema = z2.object({
3492
+ oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
3493
+ description: claudeSubmissionFormDataSchema.shape.description,
3494
+ categories: z2.array(claudeCategorySchema).describe(claudeCategoryDescription),
3495
+ primaryUseCases: claudeSubmissionFormDataSchema.shape.primaryUseCases
3496
+ });
3497
+ var claudeAiGeneratedFormDataSchema = claudeAiGeneratedFormDataRawSchema.extend({
3498
+ oneLiner: clampStringField(claudeSubmissionFormDataSchema.shape.oneLiner),
3499
+ categories: claudeAiGeneratedFormDataRawSchema.shape.categories.transform((categories) => categories.slice(0, 5))
3500
+ });
3501
+ function provenanceByField(prefillShape, aiGeneratedShape) {
3502
+ const byField = {};
3503
+ for (const field of Object.keys(prefillShape)) byField[field] = "prefilled";
3504
+ for (const field of Object.keys(aiGeneratedShape)) byField[field] = "ai-generated";
3505
+ return byField;
3506
+ }
3507
+ var PROVENANCE_BY_PLATFORM = {
3508
+ claudeai: provenanceByField(claudePrefillFormDataSchema.shape, claudeAiGeneratedFormDataSchema.shape),
3509
+ chatgpt: provenanceByField(chatgptPrefillFormDataSchema.shape, chatgptAiGeneratedFormDataSchema.shape)
3510
+ };
3511
+ var urlVerificationOutcomeSchema = z2.enum([
3512
+ "pass",
3513
+ "fail",
3514
+ "unverified"
3515
+ ]);
3516
+ var VERIFIABLE_URL_FIELDS = {
3517
+ chatgpt: ["privacyPolicyUrl", "termsOfServiceUrl"],
3518
+ claudeai: ["privacyPolicy"]
3519
+ };
3520
+ var verifiableUrlFieldSchema = z2.enum([...VERIFIABLE_URL_FIELDS.chatgpt, ...VERIFIABLE_URL_FIELDS.claudeai]);
3521
+ var POLICY_DISCLOSURES = [
3522
+ "dataCategories",
3523
+ "purposesOfUse",
3524
+ "recipients",
3525
+ "retention"
3526
+ ];
3527
+ var policyDisclosureSchema = z2.enum(POLICY_DISCLOSURES);
3528
+ var urlVerificationFieldResultSchema = z2.object({
3529
+ field: verifiableUrlFieldSchema,
3530
+ url: z2.string(),
3531
+ outcome: urlVerificationOutcomeSchema,
3532
+ reason: z2.string(),
3533
+ concerns: z2.array(z2.string()).optional(),
3534
+ scrapedWith: z2.enum(["fetch", "firecrawl"]).optional()
3535
+ });
3536
+ var urlVerificationSchema = z2.object({
3537
+ verifiedAt: z2.coerce.date(),
3538
+ results: z2.array(urlVerificationFieldResultSchema)
3539
+ });
3540
+ var PAGE_KINDS = [
3541
+ "expectedDocument",
3542
+ "errorPage",
3543
+ "loginWall",
3544
+ "parkedDomain",
3545
+ "comingSoon",
3546
+ "marketingPage",
3547
+ "unrelatedDocument"
3548
+ ];
3549
+ var pageKindSchema = z2.enum(PAGE_KINDS);
3550
+ var urlJudgementSchema = z2.object({
3551
+ pageKind: pageKindSchema.describe("What the page actually is. Use 'expectedDocument' only when it is genuinely the document the field claims."),
3552
+ reason: z2.string().max(200).describe("One sentence naming what the page is, addressed to the developer who entered the URL."),
3553
+ missingDisclosures: z2.array(policyDisclosureSchema).describe("For a privacy policy only: which of the four required disclosures the text does not cover. Empty for every other page kind.")
3554
+ });
3555
+ var submissionMetaFieldsSchema = z2.object({
3556
+ id: z2.string(),
3557
+ environmentId: z2.string(),
3558
+ auditId: z2.string().nullable(),
3559
+ urlVerification: urlVerificationSchema.nullable().default(null),
3560
+ createdAt: z2.coerce.date(),
3561
+ updatedAt: z2.coerce.date()
3562
+ });
3563
+ var claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
3564
+ platform: z2.literal("claudeai"),
3565
+ formData: claudeSubmissionDraftSchema,
3566
+ prefillSnapshot: claudeSubmissionDraftSchema.nullable().default(null)
3567
+ });
3568
+ var chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
3569
+ platform: z2.literal("chatgpt"),
3570
+ formData: chatgptSubmissionDraftSchema,
3571
+ prefillSnapshot: chatgptSubmissionDraftSchema.nullable().default(null)
3572
+ });
3573
+ var submissionSchemaInternal = z2.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
3574
+ var submissionFormDataSchemaInternal = z2.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
3575
+ var REQUEST_USAGE_THRESHOLD_PERCENTS = [
3576
+ 100,
3577
+ 75,
3578
+ 50
3579
+ ];
3580
+ var requestUsageThresholdPercentSchema = z2.literal(REQUEST_USAGE_THRESHOLD_PERCENTS);
3581
+ var subscriptionPlanSchema = z2.enum([
3582
+ "pro",
3583
+ "business",
3584
+ "enterprise"
3585
+ ]);
3586
+ var subscriptionSchema = z2.object({ plan: subscriptionPlanSchema.nullable() });
3587
+ var customerCreditsSchema = z2.object({
3588
+ balanceInCents: z2.number(),
3589
+ expiresAt: z2.number().nullable(),
3590
+ currency: z2.string()
3591
+ });
3592
+ var partnerDiscountSchema = z2.object({ endsAt: z2.number() });
3593
+ var customerBillingSchema = z2.object({
3594
+ customerCredits: customerCreditsSchema.nullable(),
3595
+ partnerDiscount: partnerDiscountSchema.nullable()
3596
+ });
3597
+ var metricsQueueEventSchema = z2.object({
3598
+ ts: z2.number().int(),
3599
+ method: z2.string(),
3600
+ tool: z2.string().nullable(),
3601
+ client: z2.string(),
3602
+ sessionId: z2.string().nullable(),
3603
+ conversationId: z2.string().nullable().optional(),
3604
+ durationMs: z2.number().int(),
3605
+ outputTokens: z2.number().int().nullable(),
3606
+ errorType: z2.enum([
3607
+ "mcp_error",
3608
+ "tool_error",
3609
+ "timeout"
3610
+ ]).nullable(),
3611
+ errorCode: z2.number().int().nullable()
3612
+ });
3613
+ var metricsQueueMessageSchema = z2.object({
3614
+ v: z2.literal(1),
3615
+ envId: z2.string(),
3616
+ events: z2.array(metricsQueueEventSchema)
3617
+ });
3618
+ var metricsQueueMessageVersionSchema = z2.object({ v: z2.number() });
3619
+ var TELEMETRY_SIGNALS = [
3620
+ "logs",
3621
+ "metrics",
3622
+ "traces"
3623
+ ];
3624
+ var telemetrySignalSchema = z2.enum(TELEMETRY_SIGNALS);
3625
+ var OTLP_PROTOCOLS = ["http/protobuf", "http/json"];
3626
+ var otlpProtocolSchema = z2.enum(OTLP_PROTOCOLS);
3627
+ var otlpEndpointSchema = z2.string().trim().min(1).max(2048);
3628
+ var OTLP_HEADER_VALUE_MAX_LENGTH = 2048;
3629
+ var OTLP_HEADER_NAME_PATTERN = /^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/;
3630
+ var otlpHeaderNameSchema = z2.string().trim().min(1, "Enter a header name").max(128).regex(OTLP_HEADER_NAME_PATTERN, "Use letters, digits and !#$%&'*+-.^_`|~ only");
3631
+ var otlpHeaderValueSchema = z2.string().trim().max(OTLP_HEADER_VALUE_MAX_LENGTH).refine((value) => !/[\r\n]/.test(value), "Line breaks are not allowed in a header value");
3632
+ var telemetryDestinationHeaderSchema = z2.object({
3633
+ id: z2.string(),
3634
+ name: otlpHeaderNameSchema,
3635
+ value: otlpHeaderValueSchema,
3636
+ isSecret: z2.boolean()
3637
+ });
3638
+ var OTLP_PUSH_FAILURE_REASONS = [
3639
+ "credentials",
3640
+ "wrong-path",
3641
+ "wrong-protocol",
3642
+ "invalid-payload",
3643
+ "partial-rejection",
3644
+ "blocked-target",
3645
+ "timeout",
3646
+ "unreachable",
3647
+ "receiver-error",
3648
+ "unexpected-status"
3649
+ ];
3650
+ var otlpPushFailureReasonSchema = z2.enum(OTLP_PUSH_FAILURE_REASONS);
3651
+ var TELEMETRY_DESTINATION_STATUSES = ["active", "suspended"];
3652
+ var telemetryDestinationStatusSchema = z2.enum(TELEMETRY_DESTINATION_STATUSES);
3653
+ var telemetryDestinationSchema = z2.object({
3654
+ id: z2.string(),
3655
+ signal: telemetrySignalSchema,
3656
+ endpoint: otlpEndpointSchema,
3657
+ protocol: otlpProtocolSchema,
3658
+ headers: z2.array(telemetryDestinationHeaderSchema),
3659
+ status: telemetryDestinationStatusSchema,
3660
+ lastFailureReason: otlpPushFailureReasonSchema.nullable(),
3661
+ isScopedToIntentionalRequestsOnly: z2.boolean()
3662
+ });
3663
+
3664
+ // src/project/detect-runtime.ts
3665
+ function detectRuntime() {
3666
+ const has = (file) => existsSync(file);
3667
+ const read = (file) => {
3668
+ try {
3669
+ return readFileSync(file, "utf8");
3670
+ } catch {
3671
+ return "";
3672
+ }
3673
+ };
3674
+ if (has("pyproject.toml") || has("requirements.txt") || has("setup.py") || has(".python-version")) {
3675
+ return "python3.13";
3676
+ }
3677
+ if (has("package.json")) {
3678
+ return detectNodeRuntime({
3679
+ nvmrcContent: has(".nvmrc") ? read(".nvmrc") : null,
3680
+ nodeVersionContent: has(".node-version") ? read(".node-version") : null
3681
+ }) ?? "node26";
3682
+ }
3683
+ return null;
24
3684
  }
25
- //# sourceMappingURL=detect-runtime.js.map
3685
+ export {
3686
+ detectRuntime
3687
+ };
3688
+ //# sourceMappingURL=detect-runtime.js.map