dsh-plugin-shop 0.8.0-beta.1 → 0.8.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -4,6 +4,9 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ //#region \0rolldown/runtime.js
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
+ //#endregion
7
10
  let react = require("react");
8
11
  let react_jsx_runtime = require("react/jsx-runtime");
9
12
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
@@ -2842,7 +2845,7 @@ window.__ModuleLoader__.load({
2842
2845
  external: params?.external ?? void 0
2843
2846
  };
2844
2847
  }
2845
- function process(schema, ctx, _params = {
2848
+ function process$1(schema, ctx, _params = {
2846
2849
  path: [],
2847
2850
  schemaPath: []
2848
2851
  }) {
@@ -2879,7 +2882,7 @@ window.__ModuleLoader__.load({
2879
2882
  const parent = schema._zod.parent;
2880
2883
  if (parent) {
2881
2884
  if (!result.ref) result.ref = parent;
2882
- process(parent, ctx, params);
2885
+ process$1(parent, ctx, params);
2883
2886
  ctx.seen.get(parent).isParent = true;
2884
2887
  }
2885
2888
  }
@@ -3101,7 +3104,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3101
3104
  ...params,
3102
3105
  processors
3103
3106
  });
3104
- process(schema, ctx);
3107
+ process$1(schema, ctx);
3105
3108
  extractDefs(ctx, schema);
3106
3109
  return finalize(ctx, schema);
3107
3110
  };
@@ -3113,7 +3116,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3113
3116
  io,
3114
3117
  processors
3115
3118
  });
3116
- process(schema, ctx);
3119
+ process$1(schema, ctx);
3117
3120
  extractDefs(ctx, schema);
3118
3121
  return finalize(ctx, schema);
3119
3122
  };
@@ -3220,7 +3223,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3220
3223
  if (typeof minimum === "number") json.minItems = minimum;
3221
3224
  if (typeof maximum === "number") json.maxItems = maximum;
3222
3225
  json.type = "array";
3223
- json.items = process(def.element, ctx, {
3226
+ json.items = process$1(def.element, ctx, {
3224
3227
  ...params,
3225
3228
  path: [...params.path, "items"]
3226
3229
  });
@@ -3231,7 +3234,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3231
3234
  json.type = "object";
3232
3235
  json.properties = {};
3233
3236
  const shape = def.shape;
3234
- for (const key in shape) json.properties[key] = process(shape[key], ctx, {
3237
+ for (const key in shape) json.properties[key] = process$1(shape[key], ctx, {
3235
3238
  ...params,
3236
3239
  path: [
3237
3240
  ...params.path,
@@ -3249,7 +3252,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3249
3252
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
3250
3253
  else if (!def.catchall) {
3251
3254
  if (ctx.io === "output") json.additionalProperties = false;
3252
- } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
3255
+ } else if (def.catchall) json.additionalProperties = process$1(def.catchall, ctx, {
3253
3256
  ...params,
3254
3257
  path: [...params.path, "additionalProperties"]
3255
3258
  });
@@ -3257,7 +3260,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3257
3260
  const unionProcessor = (schema, ctx, json, params) => {
3258
3261
  const def = schema._zod.def;
3259
3262
  const isExclusive = def.inclusive === false;
3260
- const options = def.options.map((x, i) => process(x, ctx, {
3263
+ const options = def.options.map((x, i) => process$1(x, ctx, {
3261
3264
  ...params,
3262
3265
  path: [
3263
3266
  ...params.path,
@@ -3270,7 +3273,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3270
3273
  };
3271
3274
  const intersectionProcessor = (schema, ctx, json, params) => {
3272
3275
  const def = schema._zod.def;
3273
- const a = process(def.left, ctx, {
3276
+ const a = process$1(def.left, ctx, {
3274
3277
  ...params,
3275
3278
  path: [
3276
3279
  ...params.path,
@@ -3278,7 +3281,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3278
3281
  0
3279
3282
  ]
3280
3283
  });
3281
- const b = process(def.right, ctx, {
3284
+ const b = process$1(def.right, ctx, {
3282
3285
  ...params,
3283
3286
  path: [
3284
3287
  ...params.path,
@@ -3296,7 +3299,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3296
3299
  const keyType = def.keyType;
3297
3300
  const patterns = keyType._zod.bag?.patterns;
3298
3301
  if (def.mode === "loose" && patterns && patterns.size > 0) {
3299
- const valueSchema = process(def.valueType, ctx, {
3302
+ const valueSchema = process$1(def.valueType, ctx, {
3300
3303
  ...params,
3301
3304
  path: [
3302
3305
  ...params.path,
@@ -3307,11 +3310,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3307
3310
  json.patternProperties = {};
3308
3311
  for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
3309
3312
  } else {
3310
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process(def.keyType, ctx, {
3313
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1(def.keyType, ctx, {
3311
3314
  ...params,
3312
3315
  path: [...params.path, "propertyNames"]
3313
3316
  });
3314
- json.additionalProperties = process(def.valueType, ctx, {
3317
+ json.additionalProperties = process$1(def.valueType, ctx, {
3315
3318
  ...params,
3316
3319
  path: [...params.path, "additionalProperties"]
3317
3320
  });
@@ -3324,7 +3327,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3324
3327
  };
3325
3328
  const nullableProcessor = (schema, ctx, json, params) => {
3326
3329
  const def = schema._zod.def;
3327
- const inner = process(def.innerType, ctx, params);
3330
+ const inner = process$1(def.innerType, ctx, params);
3328
3331
  const seen = ctx.seen.get(schema);
3329
3332
  if (ctx.target === "openapi-3.0") {
3330
3333
  seen.ref = def.innerType;
@@ -3333,27 +3336,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3333
3336
  };
3334
3337
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
3335
3338
  const def = schema._zod.def;
3336
- process(def.innerType, ctx, params);
3339
+ process$1(def.innerType, ctx, params);
3337
3340
  const seen = ctx.seen.get(schema);
3338
3341
  seen.ref = def.innerType;
3339
3342
  };
3340
3343
  const defaultProcessor = (schema, ctx, json, params) => {
3341
3344
  const def = schema._zod.def;
3342
- process(def.innerType, ctx, params);
3345
+ process$1(def.innerType, ctx, params);
3343
3346
  const seen = ctx.seen.get(schema);
3344
3347
  seen.ref = def.innerType;
3345
3348
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
3346
3349
  };
3347
3350
  const prefaultProcessor = (schema, ctx, json, params) => {
3348
3351
  const def = schema._zod.def;
3349
- process(def.innerType, ctx, params);
3352
+ process$1(def.innerType, ctx, params);
3350
3353
  const seen = ctx.seen.get(schema);
3351
3354
  seen.ref = def.innerType;
3352
3355
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3353
3356
  };
3354
3357
  const catchProcessor = (schema, ctx, json, params) => {
3355
3358
  const def = schema._zod.def;
3356
- process(def.innerType, ctx, params);
3359
+ process$1(def.innerType, ctx, params);
3357
3360
  const seen = ctx.seen.get(schema);
3358
3361
  seen.ref = def.innerType;
3359
3362
  let catchValue;
@@ -3368,20 +3371,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3368
3371
  const def = schema._zod.def;
3369
3372
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
3370
3373
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
3371
- process(innerType, ctx, params);
3374
+ process$1(innerType, ctx, params);
3372
3375
  const seen = ctx.seen.get(schema);
3373
3376
  seen.ref = innerType;
3374
3377
  };
3375
3378
  const readonlyProcessor = (schema, ctx, json, params) => {
3376
3379
  const def = schema._zod.def;
3377
- process(def.innerType, ctx, params);
3380
+ process$1(def.innerType, ctx, params);
3378
3381
  const seen = ctx.seen.get(schema);
3379
3382
  seen.ref = def.innerType;
3380
3383
  json.readOnly = true;
3381
3384
  };
3382
3385
  const optionalProcessor = (schema, ctx, _json, params) => {
3383
3386
  const def = schema._zod.def;
3384
- process(def.innerType, ctx, params);
3387
+ process$1(def.innerType, ctx, params);
3385
3388
  const seen = ctx.seen.get(schema);
3386
3389
  seen.ref = def.innerType;
3387
3390
  };
@@ -4332,6 +4335,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4332
4335
  "outdated": boolean(),
4333
4336
  "enabled": boolean()
4334
4337
  }));
4338
+ const dsh_plugin_shop_shop_installedSpecs_result$schema = union([literal(null), record(string(), string())]);
4335
4339
  const dsh_plugin_shop_shop_installStart_parameter_0$schema = object({
4336
4340
  "name": string(),
4337
4341
  "version": string(),
@@ -4359,7 +4363,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4359
4363
  literal("version-mismatch"),
4360
4364
  literal("needs-acknowledgement"),
4361
4365
  literal("tarball-integrity"),
4362
- literal("ambiguous-identity")
4366
+ literal("ambiguous-identity"),
4367
+ literal("name-taken")
4363
4368
  ]),
4364
4369
  "detail": string()
4365
4370
  })]);
@@ -4448,7 +4453,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4448
4453
  },
4449
4454
  sourceLocation: {
4450
4455
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4451
- "line": 678,
4456
+ "line": 733,
4452
4457
  "column": 9
4453
4458
  }
4454
4459
  },
@@ -4466,7 +4471,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4466
4471
  },
4467
4472
  sourceLocation: {
4468
4473
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4469
- "line": 863,
4474
+ "line": 966,
4475
+ "column": 9
4476
+ }
4477
+ },
4478
+ {
4479
+ id: "dsh-plugin-shop#shop/installedSpecs",
4480
+ service: "shop",
4481
+ namespace: "shop",
4482
+ method: "installedSpecs",
4483
+ invocation: { kind: "direct" },
4484
+ parameters: [],
4485
+ result: {
4486
+ mode: "strict",
4487
+ typeSymbol: "dsh-plugin-shop#shop/installedSpecs:result",
4488
+ schema: dsh_plugin_shop_shop_installedSpecs_result$schema
4489
+ },
4490
+ sourceLocation: {
4491
+ "file": "packages/dsh-plugin-shop/src/host/index.ts",
4492
+ "line": 957,
4470
4493
  "column": 9
4471
4494
  }
4472
4495
  },
@@ -4494,7 +4517,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4494
4517
  },
4495
4518
  sourceLocation: {
4496
4519
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4497
- "line": 726,
4520
+ "line": 781,
4498
4521
  "column": 9
4499
4522
  }
4500
4523
  },
@@ -4521,7 +4544,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4521
4544
  },
4522
4545
  sourceLocation: {
4523
4546
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4524
- "line": 852,
4547
+ "line": 933,
4525
4548
  "column": 3
4526
4549
  }
4527
4550
  },
@@ -4539,7 +4562,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4539
4562
  },
4540
4563
  sourceLocation: {
4541
4564
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4542
- "line": 1021,
4565
+ "line": 1124,
4543
4566
  "column": 9
4544
4567
  }
4545
4568
  },
@@ -4566,7 +4589,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4566
4589
  },
4567
4590
  sourceLocation: {
4568
4591
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4569
- "line": 535,
4592
+ "line": 590,
4570
4593
  "column": 9
4571
4594
  }
4572
4595
  },
@@ -4594,7 +4617,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4594
4617
  },
4595
4618
  sourceLocation: {
4596
4619
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4597
- "line": 956,
4620
+ "line": 1059,
4598
4621
  "column": 9
4599
4622
  }
4600
4623
  },
@@ -4621,7 +4644,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4621
4644
  },
4622
4645
  sourceLocation: {
4623
4646
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4624
- "line": 1106,
4647
+ "line": 1209,
4625
4648
  "column": 9
4626
4649
  }
4627
4650
  },
@@ -4639,7 +4662,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4639
4662
  },
4640
4663
  sourceLocation: {
4641
4664
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4642
- "line": 1089,
4665
+ "line": 1192,
4643
4666
  "column": 9
4644
4667
  }
4645
4668
  }
@@ -4720,15 +4743,1489 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4720
4743
  return hasPlugin || SHOP_KEYWORDS.includes(segments.at(-1));
4721
4744
  }
4722
4745
  //#endregion
4746
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
4747
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4748
+ module.exports = {
4749
+ MAX_LENGTH: 256,
4750
+ MAX_SAFE_COMPONENT_LENGTH: 16,
4751
+ MAX_SAFE_BUILD_LENGTH: 250,
4752
+ MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER ||
4753
+ /* istanbul ignore next */ 9007199254740991,
4754
+ RELEASE_TYPES: [
4755
+ "major",
4756
+ "premajor",
4757
+ "minor",
4758
+ "preminor",
4759
+ "patch",
4760
+ "prepatch",
4761
+ "prerelease"
4762
+ ],
4763
+ SEMVER_SPEC_VERSION: "2.0.0",
4764
+ FLAG_INCLUDE_PRERELEASE: 1,
4765
+ FLAG_LOOSE: 2
4766
+ };
4767
+ }));
4768
+ //#endregion
4769
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
4770
+ var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4771
+ module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
4772
+ }));
4773
+ //#endregion
4774
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
4775
+ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4776
+ const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
4777
+ const debug = require_debug();
4778
+ exports = module.exports = {};
4779
+ const re = exports.re = [];
4780
+ const safeRe = exports.safeRe = [];
4781
+ const src = exports.src = [];
4782
+ const safeSrc = exports.safeSrc = [];
4783
+ const t = exports.t = {};
4784
+ let R = 0;
4785
+ const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
4786
+ const safeRegexReplacements = [
4787
+ ["\\s", 1],
4788
+ ["\\d", MAX_LENGTH],
4789
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
4790
+ ];
4791
+ const makeSafeRegex = (value) => {
4792
+ for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
4793
+ return value;
4794
+ };
4795
+ const createToken = (name, value, isGlobal) => {
4796
+ const safe = makeSafeRegex(value);
4797
+ const index = R++;
4798
+ debug(name, index, value);
4799
+ t[name] = index;
4800
+ src[index] = value;
4801
+ safeSrc[index] = safe;
4802
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
4803
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
4804
+ };
4805
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
4806
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
4807
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
4808
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
4809
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
4810
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
4811
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
4812
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
4813
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
4814
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
4815
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
4816
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
4817
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
4818
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
4819
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
4820
+ createToken("GTLT", "((?:<|>)?=?)");
4821
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
4822
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
4823
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
4824
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
4825
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
4826
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
4827
+ createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
4828
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
4829
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
4830
+ createToken("COERCERTL", src[t.COERCE], true);
4831
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
4832
+ createToken("LONETILDE", "(?:~>?)");
4833
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
4834
+ exports.tildeTrimReplace = "$1~";
4835
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
4836
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
4837
+ createToken("LONECARET", "(?:\\^)");
4838
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
4839
+ exports.caretTrimReplace = "$1^";
4840
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
4841
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
4842
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
4843
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
4844
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
4845
+ exports.comparatorTrimReplace = "$1$2$3";
4846
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
4847
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
4848
+ createToken("STAR", "(<|>)?=?\\s*\\*");
4849
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
4850
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
4851
+ }));
4852
+ //#endregion
4853
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
4854
+ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4855
+ const looseOption = Object.freeze({ loose: true });
4856
+ const emptyOpts = Object.freeze({});
4857
+ const parseOptions = (options) => {
4858
+ if (!options) return emptyOpts;
4859
+ if (typeof options !== "object") return looseOption;
4860
+ return options;
4861
+ };
4862
+ module.exports = parseOptions;
4863
+ }));
4864
+ //#endregion
4865
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
4866
+ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4867
+ const numeric = /^[0-9]+$/;
4868
+ const compareIdentifiers = (a, b) => {
4869
+ if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
4870
+ const anum = numeric.test(a);
4871
+ const bnum = numeric.test(b);
4872
+ if (anum && bnum) {
4873
+ a = +a;
4874
+ b = +b;
4875
+ }
4876
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
4877
+ };
4878
+ const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
4879
+ module.exports = {
4880
+ compareIdentifiers,
4881
+ rcompareIdentifiers
4882
+ };
4883
+ }));
4884
+ //#endregion
4885
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
4886
+ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4887
+ const debug = require_debug();
4888
+ const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
4889
+ const { safeRe: re, t } = require_re();
4890
+ const parseOptions = require_parse_options();
4891
+ const { compareIdentifiers } = require_identifiers();
4892
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
4893
+ const identifiers = identifier.split(".");
4894
+ if (identifiers.length > prerelease.length) return false;
4895
+ for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
4896
+ return true;
4897
+ };
4898
+ module.exports = class SemVer {
4899
+ constructor(version, options) {
4900
+ options = parseOptions(options);
4901
+ if (version instanceof SemVer) {
4902
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
4903
+ else version = version.version;
4904
+ } else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
4905
+ if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
4906
+ debug("SemVer", version, options);
4907
+ this.options = options;
4908
+ this.loose = !!options.loose;
4909
+ this.includePrerelease = !!options.includePrerelease;
4910
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
4911
+ if (!m) throw new TypeError(`Invalid Version: ${version}`);
4912
+ this.raw = version;
4913
+ this.major = +m[1];
4914
+ this.minor = +m[2];
4915
+ this.patch = +m[3];
4916
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
4917
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
4918
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
4919
+ if (!m[4]) this.prerelease = [];
4920
+ else this.prerelease = m[4].split(".").map((id) => {
4921
+ if (/^[0-9]+$/.test(id)) {
4922
+ const num = +id;
4923
+ if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
4924
+ }
4925
+ return id;
4926
+ });
4927
+ this.build = m[5] ? m[5].split(".") : [];
4928
+ this.format();
4929
+ }
4930
+ format() {
4931
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
4932
+ if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
4933
+ return this.version;
4934
+ }
4935
+ toString() {
4936
+ return this.version;
4937
+ }
4938
+ compare(other) {
4939
+ debug("SemVer.compare", this.version, this.options, other);
4940
+ if (!(other instanceof SemVer)) {
4941
+ if (typeof other === "string" && other === this.version) return 0;
4942
+ other = new SemVer(other, this.options);
4943
+ }
4944
+ if (other.version === this.version) return 0;
4945
+ return this.compareMain(other) || this.comparePre(other);
4946
+ }
4947
+ compareMain(other) {
4948
+ if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
4949
+ if (this.major < other.major) return -1;
4950
+ if (this.major > other.major) return 1;
4951
+ if (this.minor < other.minor) return -1;
4952
+ if (this.minor > other.minor) return 1;
4953
+ if (this.patch < other.patch) return -1;
4954
+ if (this.patch > other.patch) return 1;
4955
+ return 0;
4956
+ }
4957
+ comparePre(other) {
4958
+ if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
4959
+ if (this.prerelease.length && !other.prerelease.length) return -1;
4960
+ else if (!this.prerelease.length && other.prerelease.length) return 1;
4961
+ else if (!this.prerelease.length && !other.prerelease.length) return 0;
4962
+ let i = 0;
4963
+ do {
4964
+ const a = this.prerelease[i];
4965
+ const b = other.prerelease[i];
4966
+ debug("prerelease compare", i, a, b);
4967
+ if (a === void 0 && b === void 0) return 0;
4968
+ else if (b === void 0) return 1;
4969
+ else if (a === void 0) return -1;
4970
+ else if (a === b) continue;
4971
+ else return compareIdentifiers(a, b);
4972
+ } while (++i);
4973
+ }
4974
+ compareBuild(other) {
4975
+ if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
4976
+ let i = 0;
4977
+ do {
4978
+ const a = this.build[i];
4979
+ const b = other.build[i];
4980
+ debug("build compare", i, a, b);
4981
+ if (a === void 0 && b === void 0) return 0;
4982
+ else if (b === void 0) return 1;
4983
+ else if (a === void 0) return -1;
4984
+ else if (a === b) continue;
4985
+ else return compareIdentifiers(a, b);
4986
+ } while (++i);
4987
+ }
4988
+ inc(release, identifier, identifierBase) {
4989
+ if (release.startsWith("pre")) {
4990
+ if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
4991
+ if (identifier) {
4992
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
4993
+ if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
4994
+ }
4995
+ }
4996
+ switch (release) {
4997
+ case "premajor":
4998
+ this.prerelease.length = 0;
4999
+ this.patch = 0;
5000
+ this.minor = 0;
5001
+ this.major++;
5002
+ this.inc("pre", identifier, identifierBase);
5003
+ break;
5004
+ case "preminor":
5005
+ this.prerelease.length = 0;
5006
+ this.patch = 0;
5007
+ this.minor++;
5008
+ this.inc("pre", identifier, identifierBase);
5009
+ break;
5010
+ case "prepatch":
5011
+ this.prerelease.length = 0;
5012
+ this.inc("patch", identifier, identifierBase);
5013
+ this.inc("pre", identifier, identifierBase);
5014
+ break;
5015
+ case "prerelease":
5016
+ if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
5017
+ this.inc("pre", identifier, identifierBase);
5018
+ break;
5019
+ case "release":
5020
+ if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
5021
+ this.prerelease.length = 0;
5022
+ break;
5023
+ case "major":
5024
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
5025
+ this.minor = 0;
5026
+ this.patch = 0;
5027
+ this.prerelease = [];
5028
+ break;
5029
+ case "minor":
5030
+ if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
5031
+ this.patch = 0;
5032
+ this.prerelease = [];
5033
+ break;
5034
+ case "patch":
5035
+ if (this.prerelease.length === 0) this.patch++;
5036
+ this.prerelease = [];
5037
+ break;
5038
+ case "pre": {
5039
+ const base = Number(identifierBase) ? 1 : 0;
5040
+ if (this.prerelease.length === 0) this.prerelease = [base];
5041
+ else {
5042
+ let i = this.prerelease.length;
5043
+ while (--i >= 0) if (typeof this.prerelease[i] === "number") {
5044
+ this.prerelease[i]++;
5045
+ i = -2;
5046
+ }
5047
+ if (i === -1) {
5048
+ if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
5049
+ this.prerelease.push(base);
5050
+ }
5051
+ }
5052
+ if (identifier) {
5053
+ let prerelease = [identifier, base];
5054
+ if (identifierBase === false) prerelease = [identifier];
5055
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
5056
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
5057
+ if (isNaN(prereleaseBase)) this.prerelease = prerelease;
5058
+ } else this.prerelease = prerelease;
5059
+ }
5060
+ break;
5061
+ }
5062
+ default: throw new Error(`invalid increment argument: ${release}`);
5063
+ }
5064
+ this.raw = this.format();
5065
+ if (this.build.length) this.raw += `+${this.build.join(".")}`;
5066
+ return this;
5067
+ }
5068
+ };
5069
+ }));
5070
+ //#endregion
5071
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
5072
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5073
+ const SemVer = require_semver$1();
5074
+ const parse = (version, options, throwErrors = false) => {
5075
+ if (version instanceof SemVer) return version;
5076
+ try {
5077
+ return new SemVer(version, options);
5078
+ } catch (er) {
5079
+ if (!throwErrors) return null;
5080
+ throw er;
5081
+ }
5082
+ };
5083
+ module.exports = parse;
5084
+ }));
5085
+ //#endregion
5086
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
5087
+ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5088
+ const parse = require_parse();
5089
+ const valid = (version, options) => {
5090
+ const v = parse(version, options);
5091
+ return v ? v.version : null;
5092
+ };
5093
+ module.exports = valid;
5094
+ }));
5095
+ //#endregion
5096
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
5097
+ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5098
+ const parse = require_parse();
5099
+ const clean = (version, options) => {
5100
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
5101
+ return s ? s.version : null;
5102
+ };
5103
+ module.exports = clean;
5104
+ }));
5105
+ //#endregion
5106
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
5107
+ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5108
+ const SemVer = require_semver$1();
5109
+ const inc = (version, release, options, identifier, identifierBase) => {
5110
+ if (typeof options === "string") {
5111
+ identifierBase = identifier;
5112
+ identifier = options;
5113
+ options = void 0;
5114
+ }
5115
+ try {
5116
+ return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
5117
+ } catch (er) {
5118
+ return null;
5119
+ }
5120
+ };
5121
+ module.exports = inc;
5122
+ }));
5123
+ //#endregion
5124
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
5125
+ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5126
+ const parse = require_parse();
5127
+ const diff = (version1, version2) => {
5128
+ const v1 = parse(version1, null, true);
5129
+ const v2 = parse(version2, null, true);
5130
+ const comparison = v1.compare(v2);
5131
+ if (comparison === 0) return null;
5132
+ const v1Higher = comparison > 0;
5133
+ const highVersion = v1Higher ? v1 : v2;
5134
+ const lowVersion = v1Higher ? v2 : v1;
5135
+ const highHasPre = !!highVersion.prerelease.length;
5136
+ if (!!lowVersion.prerelease.length && !highHasPre) {
5137
+ if (!lowVersion.patch && !lowVersion.minor) return "major";
5138
+ if (lowVersion.compareMain(highVersion) === 0) {
5139
+ if (lowVersion.minor && !lowVersion.patch) return "minor";
5140
+ return "patch";
5141
+ }
5142
+ }
5143
+ const prefix = highHasPre ? "pre" : "";
5144
+ if (v1.major !== v2.major) return prefix + "major";
5145
+ if (v1.minor !== v2.minor) return prefix + "minor";
5146
+ if (v1.patch !== v2.patch) return prefix + "patch";
5147
+ return "prerelease";
5148
+ };
5149
+ module.exports = diff;
5150
+ }));
5151
+ //#endregion
5152
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
5153
+ var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5154
+ const SemVer = require_semver$1();
5155
+ const major = (a, loose) => new SemVer(a, loose).major;
5156
+ module.exports = major;
5157
+ }));
5158
+ //#endregion
5159
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
5160
+ var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5161
+ const SemVer = require_semver$1();
5162
+ const minor = (a, loose) => new SemVer(a, loose).minor;
5163
+ module.exports = minor;
5164
+ }));
5165
+ //#endregion
5166
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
5167
+ var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5168
+ const SemVer = require_semver$1();
5169
+ const patch = (a, loose) => new SemVer(a, loose).patch;
5170
+ module.exports = patch;
5171
+ }));
5172
+ //#endregion
5173
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
5174
+ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5175
+ const parse = require_parse();
5176
+ const prerelease = (version, options) => {
5177
+ const parsed = parse(version, options);
5178
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
5179
+ };
5180
+ module.exports = prerelease;
5181
+ }));
5182
+ //#endregion
5183
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
5184
+ var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5185
+ const SemVer = require_semver$1();
5186
+ const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
5187
+ module.exports = compare;
5188
+ }));
5189
+ //#endregion
5190
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
5191
+ var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5192
+ const compare = require_compare();
5193
+ const rcompare = (a, b, loose) => compare(b, a, loose);
5194
+ module.exports = rcompare;
5195
+ }));
5196
+ //#endregion
5197
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
5198
+ var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5199
+ const compare = require_compare();
5200
+ const compareLoose = (a, b) => compare(a, b, true);
5201
+ module.exports = compareLoose;
5202
+ }));
5203
+ //#endregion
5204
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
5205
+ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5206
+ const SemVer = require_semver$1();
5207
+ const compareBuild = (a, b, loose) => {
5208
+ const versionA = new SemVer(a, loose);
5209
+ const versionB = new SemVer(b, loose);
5210
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
5211
+ };
5212
+ module.exports = compareBuild;
5213
+ }));
5214
+ //#endregion
5215
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
5216
+ var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5217
+ const compareBuild = require_compare_build();
5218
+ const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
5219
+ module.exports = sort;
5220
+ }));
5221
+ //#endregion
5222
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
5223
+ var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5224
+ const compareBuild = require_compare_build();
5225
+ const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
5226
+ module.exports = rsort;
5227
+ }));
5228
+ //#endregion
5229
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
5230
+ var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5231
+ const compare = require_compare();
5232
+ const gt = (a, b, loose) => compare(a, b, loose) > 0;
5233
+ module.exports = gt;
5234
+ }));
5235
+ //#endregion
5236
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
5237
+ var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5238
+ const compare = require_compare();
5239
+ const lt = (a, b, loose) => compare(a, b, loose) < 0;
5240
+ module.exports = lt;
5241
+ }));
5242
+ //#endregion
5243
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
5244
+ var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5245
+ const compare = require_compare();
5246
+ const eq = (a, b, loose) => compare(a, b, loose) === 0;
5247
+ module.exports = eq;
5248
+ }));
5249
+ //#endregion
5250
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
5251
+ var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5252
+ const compare = require_compare();
5253
+ const neq = (a, b, loose) => compare(a, b, loose) !== 0;
5254
+ module.exports = neq;
5255
+ }));
5256
+ //#endregion
5257
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
5258
+ var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5259
+ const compare = require_compare();
5260
+ const gte = (a, b, loose) => compare(a, b, loose) >= 0;
5261
+ module.exports = gte;
5262
+ }));
5263
+ //#endregion
5264
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
5265
+ var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5266
+ const compare = require_compare();
5267
+ const lte = (a, b, loose) => compare(a, b, loose) <= 0;
5268
+ module.exports = lte;
5269
+ }));
5270
+ //#endregion
5271
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
5272
+ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5273
+ const eq = require_eq();
5274
+ const neq = require_neq();
5275
+ const gt = require_gt();
5276
+ const gte = require_gte();
5277
+ const lt = require_lt();
5278
+ const lte = require_lte();
5279
+ const cmp = (a, op, b, loose) => {
5280
+ switch (op) {
5281
+ case "===":
5282
+ if (typeof a === "object") a = a.version;
5283
+ if (typeof b === "object") b = b.version;
5284
+ return a === b;
5285
+ case "!==":
5286
+ if (typeof a === "object") a = a.version;
5287
+ if (typeof b === "object") b = b.version;
5288
+ return a !== b;
5289
+ case "":
5290
+ case "=":
5291
+ case "==": return eq(a, b, loose);
5292
+ case "!=": return neq(a, b, loose);
5293
+ case ">": return gt(a, b, loose);
5294
+ case ">=": return gte(a, b, loose);
5295
+ case "<": return lt(a, b, loose);
5296
+ case "<=": return lte(a, b, loose);
5297
+ default: throw new TypeError(`Invalid operator: ${op}`);
5298
+ }
5299
+ };
5300
+ module.exports = cmp;
5301
+ }));
5302
+ //#endregion
5303
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
5304
+ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5305
+ const SemVer = require_semver$1();
5306
+ const parse = require_parse();
5307
+ const { safeRe: re, t } = require_re();
5308
+ const coerce = (version, options) => {
5309
+ if (version instanceof SemVer) return version;
5310
+ if (typeof version === "number") version = String(version);
5311
+ if (typeof version !== "string") return null;
5312
+ options = options || {};
5313
+ let match = null;
5314
+ if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
5315
+ else {
5316
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
5317
+ let next;
5318
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
5319
+ if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
5320
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
5321
+ }
5322
+ coerceRtlRegex.lastIndex = -1;
5323
+ }
5324
+ if (match === null) return null;
5325
+ const major = match[2];
5326
+ const minor = match[3] || "0";
5327
+ const patch = match[4] || "0";
5328
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
5329
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
5330
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
5331
+ };
5332
+ module.exports = coerce;
5333
+ }));
5334
+ //#endregion
5335
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
5336
+ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5337
+ const parse = require_parse();
5338
+ const constants = require_constants();
5339
+ const SemVer = require_semver$1();
5340
+ const truncate = (version, truncation, options) => {
5341
+ if (!constants.RELEASE_TYPES.includes(truncation)) return null;
5342
+ const clonedVersion = cloneInputVersion(version, options);
5343
+ return clonedVersion && doTruncation(clonedVersion, truncation);
5344
+ };
5345
+ const cloneInputVersion = (version, options) => {
5346
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
5347
+ return parse(versionStringToParse, options);
5348
+ };
5349
+ const doTruncation = (version, truncation) => {
5350
+ if (isPrerelease(truncation)) return version.version;
5351
+ version.prerelease = [];
5352
+ switch (truncation) {
5353
+ case "major":
5354
+ version.minor = 0;
5355
+ version.patch = 0;
5356
+ break;
5357
+ case "minor": version.patch = 0;
5358
+ }
5359
+ return version.format();
5360
+ };
5361
+ const isPrerelease = (type) => {
5362
+ return type.startsWith("pre");
5363
+ };
5364
+ module.exports = truncate;
5365
+ }));
5366
+ //#endregion
5367
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
5368
+ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5369
+ var LRUCache = class {
5370
+ constructor() {
5371
+ this.max = 1e3;
5372
+ this.map = /* @__PURE__ */ new Map();
5373
+ }
5374
+ get(key) {
5375
+ const value = this.map.get(key);
5376
+ if (value === void 0) return;
5377
+ else {
5378
+ this.map.delete(key);
5379
+ this.map.set(key, value);
5380
+ return value;
5381
+ }
5382
+ }
5383
+ delete(key) {
5384
+ return this.map.delete(key);
5385
+ }
5386
+ set(key, value) {
5387
+ if (!this.delete(key) && value !== void 0) {
5388
+ if (this.map.size >= this.max) {
5389
+ const firstKey = this.map.keys().next().value;
5390
+ this.delete(firstKey);
5391
+ }
5392
+ this.map.set(key, value);
5393
+ }
5394
+ return this;
5395
+ }
5396
+ };
5397
+ module.exports = LRUCache;
5398
+ }));
5399
+ //#endregion
5400
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
5401
+ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5402
+ const SPACE_CHARACTERS = /\s+/g;
5403
+ module.exports = class Range {
5404
+ constructor(range, options) {
5405
+ options = parseOptions(options);
5406
+ if (range instanceof Range) {
5407
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
5408
+ else return new Range(range.raw, options);
5409
+ }
5410
+ if (range instanceof Comparator) {
5411
+ this.raw = range.value;
5412
+ this.set = [[range]];
5413
+ this.formatted = void 0;
5414
+ return this;
5415
+ }
5416
+ this.options = options;
5417
+ this.loose = !!options.loose;
5418
+ this.includePrerelease = !!options.includePrerelease;
5419
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
5420
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
5421
+ if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
5422
+ if (this.set.length > 1) {
5423
+ const first = this.set[0];
5424
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
5425
+ if (this.set.length === 0) this.set = [first];
5426
+ else if (this.set.length > 1) {
5427
+ for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
5428
+ this.set = [c];
5429
+ break;
5430
+ }
5431
+ }
5432
+ }
5433
+ this.formatted = void 0;
5434
+ }
5435
+ get range() {
5436
+ if (this.formatted === void 0) {
5437
+ this.formatted = "";
5438
+ for (let i = 0; i < this.set.length; i++) {
5439
+ if (i > 0) this.formatted += "||";
5440
+ const comps = this.set[i];
5441
+ for (let k = 0; k < comps.length; k++) {
5442
+ if (k > 0) this.formatted += " ";
5443
+ this.formatted += comps[k].toString().trim();
5444
+ }
5445
+ }
5446
+ }
5447
+ return this.formatted;
5448
+ }
5449
+ format() {
5450
+ return this.range;
5451
+ }
5452
+ toString() {
5453
+ return this.range;
5454
+ }
5455
+ parseRange(range) {
5456
+ range = range.replace(BUILDSTRIPRE, "");
5457
+ const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
5458
+ const cached = cache.get(memoKey);
5459
+ if (cached) return cached;
5460
+ const loose = this.options.loose;
5461
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
5462
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
5463
+ debug("hyphen replace", range);
5464
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
5465
+ debug("comparator trim", range);
5466
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
5467
+ debug("tilde trim", range);
5468
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
5469
+ debug("caret trim", range);
5470
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
5471
+ if (loose) rangeList = rangeList.filter((comp) => {
5472
+ debug("loose invalid filter", comp, this.options);
5473
+ return !!comp.match(re[t.COMPARATORLOOSE]);
5474
+ });
5475
+ debug("range list", rangeList);
5476
+ const rangeMap = /* @__PURE__ */ new Map();
5477
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
5478
+ for (const comp of comparators) {
5479
+ if (isNullSet(comp)) return [comp];
5480
+ rangeMap.set(comp.value, comp);
5481
+ }
5482
+ if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
5483
+ const result = [...rangeMap.values()];
5484
+ cache.set(memoKey, result);
5485
+ return result;
5486
+ }
5487
+ intersects(range, options) {
5488
+ if (!(range instanceof Range)) throw new TypeError("a Range is required");
5489
+ return this.set.some((thisComparators) => {
5490
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
5491
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
5492
+ return rangeComparators.every((rangeComparator) => {
5493
+ return thisComparator.intersects(rangeComparator, options);
5494
+ });
5495
+ });
5496
+ });
5497
+ });
5498
+ }
5499
+ test(version) {
5500
+ if (!version) return false;
5501
+ if (typeof version === "string") try {
5502
+ version = new SemVer(version, this.options);
5503
+ } catch (er) {
5504
+ return false;
5505
+ }
5506
+ for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
5507
+ return false;
5508
+ }
5509
+ };
5510
+ const cache = new (require_lrucache())();
5511
+ const parseOptions = require_parse_options();
5512
+ const Comparator = require_comparator();
5513
+ const debug = require_debug();
5514
+ const SemVer = require_semver$1();
5515
+ const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
5516
+ const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
5517
+ const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
5518
+ const isNullSet = (c) => c.value === "<0.0.0-0";
5519
+ const isAny = (c) => c.value === "";
5520
+ const isSatisfiable = (comparators, options) => {
5521
+ let result = true;
5522
+ const remainingComparators = comparators.slice();
5523
+ let testComparator = remainingComparators.pop();
5524
+ while (result && remainingComparators.length) {
5525
+ result = remainingComparators.every((otherComparator) => {
5526
+ return testComparator.intersects(otherComparator, options);
5527
+ });
5528
+ testComparator = remainingComparators.pop();
5529
+ }
5530
+ return result;
5531
+ };
5532
+ const parseComparator = (comp, options) => {
5533
+ comp = comp.replace(re[t.BUILD], "");
5534
+ debug("comp", comp, options);
5535
+ comp = replaceCarets(comp, options);
5536
+ debug("caret", comp);
5537
+ comp = replaceTildes(comp, options);
5538
+ debug("tildes", comp);
5539
+ comp = replaceXRanges(comp, options);
5540
+ debug("xrange", comp);
5541
+ comp = replaceStars(comp, options);
5542
+ debug("stars", comp);
5543
+ return comp;
5544
+ };
5545
+ const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
5546
+ const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
5547
+ const replaceTildes = (comp, options) => {
5548
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
5549
+ };
5550
+ const replaceTilde = (comp, options) => {
5551
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
5552
+ const z = options.includePrerelease ? "-0" : "";
5553
+ return comp.replace(r, (_, M, m, p, pr) => {
5554
+ debug("tilde", comp, _, M, m, p, pr);
5555
+ let ret;
5556
+ if (isX(M)) ret = "";
5557
+ else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
5558
+ else if (isX(p)) ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
5559
+ else if (pr) {
5560
+ debug("replaceTilde pr", pr);
5561
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
5562
+ } else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
5563
+ debug("tilde return", ret);
5564
+ return ret;
5565
+ });
5566
+ };
5567
+ const replaceCarets = (comp, options) => {
5568
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
5569
+ };
5570
+ const replaceCaret = (comp, options) => {
5571
+ debug("caret", comp, options);
5572
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
5573
+ const z = options.includePrerelease ? "-0" : "";
5574
+ return comp.replace(r, (_, M, m, p, pr) => {
5575
+ debug("caret", comp, _, M, m, p, pr);
5576
+ let ret;
5577
+ if (isX(M)) ret = "";
5578
+ else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
5579
+ else if (isX(p)) {
5580
+ if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
5581
+ else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
5582
+ } else if (pr) {
5583
+ debug("replaceCaret pr", pr);
5584
+ if (M === "0") {
5585
+ if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
5586
+ else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
5587
+ } else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
5588
+ } else {
5589
+ debug("no pr");
5590
+ if (M === "0") {
5591
+ if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
5592
+ else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
5593
+ } else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
5594
+ }
5595
+ debug("caret return", ret);
5596
+ return ret;
5597
+ });
5598
+ };
5599
+ const replaceXRanges = (comp, options) => {
5600
+ debug("replaceXRanges", comp, options);
5601
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
5602
+ };
5603
+ const replaceXRange = (comp, options) => {
5604
+ comp = comp.trim();
5605
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
5606
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
5607
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
5608
+ if (invalidXRangeOrder(M, m, p)) return comp;
5609
+ const xM = isX(M);
5610
+ const xm = xM || isX(m);
5611
+ const xp = xm || isX(p);
5612
+ const anyX = xp;
5613
+ if (gtlt === "=" && anyX) gtlt = "";
5614
+ pr = options.includePrerelease ? "-0" : "";
5615
+ if (xM) {
5616
+ if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
5617
+ else ret = "*";
5618
+ } else if (gtlt && anyX) {
5619
+ if (xm) m = 0;
5620
+ p = 0;
5621
+ if (gtlt === ">") {
5622
+ gtlt = ">=";
5623
+ if (xm) {
5624
+ M = +M + 1;
5625
+ m = 0;
5626
+ p = 0;
5627
+ } else {
5628
+ m = +m + 1;
5629
+ p = 0;
5630
+ }
5631
+ } else if (gtlt === "<=") {
5632
+ gtlt = "<";
5633
+ if (xm) M = +M + 1;
5634
+ else m = +m + 1;
5635
+ }
5636
+ if (gtlt === "<") pr = "-0";
5637
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
5638
+ } else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
5639
+ else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
5640
+ debug("xRange return", ret);
5641
+ return ret;
5642
+ });
5643
+ };
5644
+ const replaceStars = (comp, options) => {
5645
+ debug("replaceStars", comp, options);
5646
+ return comp.trim().replace(re[t.STAR], "");
5647
+ };
5648
+ const replaceGTE0 = (comp, options) => {
5649
+ debug("replaceGTE0", comp, options);
5650
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
5651
+ };
5652
+ const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
5653
+ if (isX(fM)) from = "";
5654
+ else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
5655
+ else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
5656
+ else if (fpr) from = `>=${from}`;
5657
+ else from = `>=${from}${incPr ? "-0" : ""}`;
5658
+ if (isX(tM)) to = "";
5659
+ else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
5660
+ else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
5661
+ else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
5662
+ else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
5663
+ else to = `<=${to}`;
5664
+ return `${from} ${to}`.trim();
5665
+ };
5666
+ const testSet = (set, version, options) => {
5667
+ for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
5668
+ if (version.prerelease.length && !options.includePrerelease) {
5669
+ for (let i = 0; i < set.length; i++) {
5670
+ debug(set[i].semver);
5671
+ if (set[i].semver === Comparator.ANY) continue;
5672
+ if (set[i].semver.prerelease.length > 0) {
5673
+ const allowed = set[i].semver;
5674
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
5675
+ }
5676
+ }
5677
+ return false;
5678
+ }
5679
+ return true;
5680
+ };
5681
+ }));
5682
+ //#endregion
5683
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
5684
+ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5685
+ const ANY = Symbol("SemVer ANY");
5686
+ module.exports = class Comparator {
5687
+ static get ANY() {
5688
+ return ANY;
5689
+ }
5690
+ constructor(comp, options) {
5691
+ options = parseOptions(options);
5692
+ if (comp instanceof Comparator) {
5693
+ if (comp.loose === !!options.loose) return comp;
5694
+ else comp = comp.value;
5695
+ }
5696
+ comp = comp.trim().split(/\s+/).join(" ");
5697
+ debug("comparator", comp, options);
5698
+ this.options = options;
5699
+ this.loose = !!options.loose;
5700
+ this.parse(comp);
5701
+ if (this.semver === ANY) this.value = "";
5702
+ else this.value = this.operator + this.semver.version;
5703
+ debug("comp", this);
5704
+ }
5705
+ parse(comp) {
5706
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
5707
+ const m = comp.match(r);
5708
+ if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
5709
+ this.operator = m[1] !== void 0 ? m[1] : "";
5710
+ if (this.operator === "=") this.operator = "";
5711
+ if (!m[2]) this.semver = ANY;
5712
+ else this.semver = new SemVer(m[2], this.options.loose);
5713
+ }
5714
+ toString() {
5715
+ return this.value;
5716
+ }
5717
+ test(version) {
5718
+ debug("Comparator.test", version, this.options.loose);
5719
+ if (this.semver === ANY || version === ANY) return true;
5720
+ if (typeof version === "string") try {
5721
+ version = new SemVer(version, this.options);
5722
+ } catch (er) {
5723
+ return false;
5724
+ }
5725
+ return cmp(version, this.operator, this.semver, this.options);
5726
+ }
5727
+ intersects(comp, options) {
5728
+ if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
5729
+ if (this.operator === "") {
5730
+ if (this.value === "") return true;
5731
+ return new Range(comp.value, options).test(this.value);
5732
+ } else if (comp.operator === "") {
5733
+ if (comp.value === "") return true;
5734
+ return new Range(this.value, options).test(comp.semver);
5735
+ }
5736
+ options = parseOptions(options);
5737
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
5738
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
5739
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
5740
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
5741
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
5742
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
5743
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
5744
+ return false;
5745
+ }
5746
+ };
5747
+ const parseOptions = require_parse_options();
5748
+ const { safeRe: re, t } = require_re();
5749
+ const cmp = require_cmp();
5750
+ const debug = require_debug();
5751
+ const SemVer = require_semver$1();
5752
+ const Range = require_range();
5753
+ }));
5754
+ //#endregion
5755
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
5756
+ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5757
+ const Range = require_range();
5758
+ const satisfies = (version, range, options) => {
5759
+ try {
5760
+ range = new Range(range, options);
5761
+ } catch (er) {
5762
+ return false;
5763
+ }
5764
+ return range.test(version);
5765
+ };
5766
+ module.exports = satisfies;
5767
+ }));
5768
+ //#endregion
5769
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
5770
+ var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5771
+ const Range = require_range();
5772
+ const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
5773
+ module.exports = toComparators;
5774
+ }));
5775
+ //#endregion
5776
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
5777
+ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5778
+ const SemVer = require_semver$1();
5779
+ const Range = require_range();
5780
+ const maxSatisfying = (versions, range, options) => {
5781
+ let max = null;
5782
+ let maxSV = null;
5783
+ let rangeObj = null;
5784
+ try {
5785
+ rangeObj = new Range(range, options);
5786
+ } catch (er) {
5787
+ return null;
5788
+ }
5789
+ versions.forEach((v) => {
5790
+ if (rangeObj.test(v)) {
5791
+ if (!max || maxSV.compare(v) === -1) {
5792
+ max = v;
5793
+ maxSV = new SemVer(max, options);
5794
+ }
5795
+ }
5796
+ });
5797
+ return max;
5798
+ };
5799
+ module.exports = maxSatisfying;
5800
+ }));
5801
+ //#endregion
5802
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
5803
+ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5804
+ const SemVer = require_semver$1();
5805
+ const Range = require_range();
5806
+ const minSatisfying = (versions, range, options) => {
5807
+ let min = null;
5808
+ let minSV = null;
5809
+ let rangeObj = null;
5810
+ try {
5811
+ rangeObj = new Range(range, options);
5812
+ } catch (er) {
5813
+ return null;
5814
+ }
5815
+ versions.forEach((v) => {
5816
+ if (rangeObj.test(v)) {
5817
+ if (!min || minSV.compare(v) === 1) {
5818
+ min = v;
5819
+ minSV = new SemVer(min, options);
5820
+ }
5821
+ }
5822
+ });
5823
+ return min;
5824
+ };
5825
+ module.exports = minSatisfying;
5826
+ }));
5827
+ //#endregion
5828
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
5829
+ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5830
+ const SemVer = require_semver$1();
5831
+ const Range = require_range();
5832
+ const gt = require_gt();
5833
+ const minVersion = (range, loose) => {
5834
+ range = new Range(range, loose);
5835
+ let minver = new SemVer("0.0.0");
5836
+ if (range.test(minver)) return minver;
5837
+ minver = new SemVer("0.0.0-0");
5838
+ if (range.test(minver)) return minver;
5839
+ minver = null;
5840
+ for (let i = 0; i < range.set.length; ++i) {
5841
+ const comparators = range.set[i];
5842
+ let setMin = null;
5843
+ comparators.forEach((comparator) => {
5844
+ const compver = new SemVer(comparator.semver.version);
5845
+ switch (comparator.operator) {
5846
+ case ">":
5847
+ if (compver.prerelease.length === 0) compver.patch++;
5848
+ else compver.prerelease.push(0);
5849
+ compver.raw = compver.format();
5850
+ case "":
5851
+ case ">=":
5852
+ if (!setMin || gt(compver, setMin)) setMin = compver;
5853
+ break;
5854
+ case "<":
5855
+ case "<=": break;
5856
+ /* istanbul ignore next */
5857
+ default: throw new Error(`Unexpected operation: ${comparator.operator}`);
5858
+ }
5859
+ });
5860
+ if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
5861
+ }
5862
+ if (minver && range.test(minver)) return minver;
5863
+ return null;
5864
+ };
5865
+ module.exports = minVersion;
5866
+ }));
5867
+ //#endregion
5868
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
5869
+ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5870
+ const Range = require_range();
5871
+ const validRange = (range, options) => {
5872
+ try {
5873
+ return new Range(range, options).range || "*";
5874
+ } catch (er) {
5875
+ return null;
5876
+ }
5877
+ };
5878
+ module.exports = validRange;
5879
+ }));
5880
+ //#endregion
5881
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
5882
+ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5883
+ const SemVer = require_semver$1();
5884
+ const Comparator = require_comparator();
5885
+ const { ANY } = Comparator;
5886
+ const Range = require_range();
5887
+ const satisfies = require_satisfies();
5888
+ const gt = require_gt();
5889
+ const lt = require_lt();
5890
+ const lte = require_lte();
5891
+ const gte = require_gte();
5892
+ const outside = (version, range, hilo, options) => {
5893
+ version = new SemVer(version, options);
5894
+ range = new Range(range, options);
5895
+ let gtfn, ltefn, ltfn, comp, ecomp;
5896
+ switch (hilo) {
5897
+ case ">":
5898
+ gtfn = gt;
5899
+ ltefn = lte;
5900
+ ltfn = lt;
5901
+ comp = ">";
5902
+ ecomp = ">=";
5903
+ break;
5904
+ case "<":
5905
+ gtfn = lt;
5906
+ ltefn = gte;
5907
+ ltfn = gt;
5908
+ comp = "<";
5909
+ ecomp = "<=";
5910
+ break;
5911
+ default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
5912
+ }
5913
+ if (satisfies(version, range, options)) return false;
5914
+ for (let i = 0; i < range.set.length; ++i) {
5915
+ const comparators = range.set[i];
5916
+ let high = null;
5917
+ let low = null;
5918
+ comparators.forEach((comparator) => {
5919
+ if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
5920
+ high = high || comparator;
5921
+ low = low || comparator;
5922
+ if (gtfn(comparator.semver, high.semver, options)) high = comparator;
5923
+ else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
5924
+ });
5925
+ if (high.operator === comp || high.operator === ecomp) return false;
5926
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
5927
+ else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
5928
+ }
5929
+ return true;
5930
+ };
5931
+ module.exports = outside;
5932
+ }));
5933
+ //#endregion
5934
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
5935
+ var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5936
+ const outside = require_outside();
5937
+ const gtr = (version, range, options) => outside(version, range, ">", options);
5938
+ module.exports = gtr;
5939
+ }));
5940
+ //#endregion
5941
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
5942
+ var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5943
+ const outside = require_outside();
5944
+ const ltr = (version, range, options) => outside(version, range, "<", options);
5945
+ module.exports = ltr;
5946
+ }));
5947
+ //#endregion
5948
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
5949
+ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5950
+ const Range = require_range();
5951
+ const intersects = (r1, r2, options) => {
5952
+ r1 = new Range(r1, options);
5953
+ r2 = new Range(r2, options);
5954
+ return r1.intersects(r2, options);
5955
+ };
5956
+ module.exports = intersects;
5957
+ }));
5958
+ //#endregion
5959
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
5960
+ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5961
+ const satisfies = require_satisfies();
5962
+ const compare = require_compare();
5963
+ module.exports = (versions, range, options) => {
5964
+ const set = [];
5965
+ let first = null;
5966
+ let prev = null;
5967
+ const v = versions.sort((a, b) => compare(a, b, options));
5968
+ for (const version of v) if (satisfies(version, range, options)) {
5969
+ prev = version;
5970
+ if (!first) first = version;
5971
+ } else {
5972
+ if (prev) set.push([first, prev]);
5973
+ prev = null;
5974
+ first = null;
5975
+ }
5976
+ if (first) set.push([first, null]);
5977
+ const ranges = [];
5978
+ for (const [min, max] of set) if (min === max) ranges.push(min);
5979
+ else if (!max && min === v[0]) ranges.push("*");
5980
+ else if (!max) ranges.push(`>=${min}`);
5981
+ else if (min === v[0]) ranges.push(`<=${max}`);
5982
+ else ranges.push(`${min} - ${max}`);
5983
+ const simplified = ranges.join(" || ");
5984
+ const original = typeof range.raw === "string" ? range.raw : String(range);
5985
+ return simplified.length < original.length ? simplified : range;
5986
+ };
5987
+ }));
5988
+ //#endregion
5989
+ //#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
5990
+ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5991
+ const Range = require_range();
5992
+ const Comparator = require_comparator();
5993
+ const { ANY } = Comparator;
5994
+ const satisfies = require_satisfies();
5995
+ const compare = require_compare();
5996
+ const subset = (sub, dom, options = {}) => {
5997
+ if (sub === dom) return true;
5998
+ sub = new Range(sub, options);
5999
+ dom = new Range(dom, options);
6000
+ let sawNonNull = false;
6001
+ OUTER: for (const simpleSub of sub.set) {
6002
+ for (const simpleDom of dom.set) {
6003
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
6004
+ sawNonNull = sawNonNull || isSub !== null;
6005
+ if (isSub) continue OUTER;
6006
+ }
6007
+ if (sawNonNull) return false;
6008
+ }
6009
+ return true;
6010
+ };
6011
+ const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
6012
+ const minimumVersion = [new Comparator(">=0.0.0")];
6013
+ const simpleSubset = (sub, dom, options) => {
6014
+ if (sub === dom) return true;
6015
+ if (sub.length === 1 && sub[0].semver === ANY) {
6016
+ if (dom.length === 1 && dom[0].semver === ANY) return true;
6017
+ else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
6018
+ else sub = minimumVersion;
6019
+ }
6020
+ if (dom.length === 1 && dom[0].semver === ANY) {
6021
+ if (options.includePrerelease) return true;
6022
+ else dom = minimumVersion;
6023
+ }
6024
+ const eqSet = /* @__PURE__ */ new Set();
6025
+ let gt, lt;
6026
+ for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
6027
+ else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
6028
+ else eqSet.add(c.semver);
6029
+ if (eqSet.size > 1) return null;
6030
+ let gtltComp;
6031
+ if (gt && lt) {
6032
+ gtltComp = compare(gt.semver, lt.semver, options);
6033
+ if (gtltComp > 0) return null;
6034
+ else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
6035
+ }
6036
+ for (const eq of eqSet) {
6037
+ if (gt && !satisfies(eq, String(gt), options)) return null;
6038
+ if (lt && !satisfies(eq, String(lt), options)) return null;
6039
+ for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
6040
+ return true;
6041
+ }
6042
+ let higher, lower;
6043
+ let hasDomLT, hasDomGT;
6044
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
6045
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
6046
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
6047
+ for (const c of dom) {
6048
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
6049
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
6050
+ if (gt) {
6051
+ if (needDomGTPre) {
6052
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
6053
+ }
6054
+ if (c.operator === ">" || c.operator === ">=") {
6055
+ higher = higherGT(gt, c, options);
6056
+ if (higher === c && higher !== gt) return false;
6057
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
6058
+ }
6059
+ if (lt) {
6060
+ if (needDomLTPre) {
6061
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
6062
+ }
6063
+ if (c.operator === "<" || c.operator === "<=") {
6064
+ lower = lowerLT(lt, c, options);
6065
+ if (lower === c && lower !== lt) return false;
6066
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
6067
+ }
6068
+ if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
6069
+ }
6070
+ if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
6071
+ if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
6072
+ if (needDomGTPre || needDomLTPre) return false;
6073
+ return true;
6074
+ };
6075
+ const higherGT = (a, b, options) => {
6076
+ if (!a) return b;
6077
+ const comp = compare(a.semver, b.semver, options);
6078
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
6079
+ };
6080
+ const lowerLT = (a, b, options) => {
6081
+ if (!a) return b;
6082
+ const comp = compare(a.semver, b.semver, options);
6083
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
6084
+ };
6085
+ module.exports = subset;
6086
+ }));
6087
+ //#endregion
4723
6088
  //#region src/shared/identity.ts
6089
+ var import_semver = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
6090
+ const internalRe = require_re();
6091
+ const constants = require_constants();
6092
+ const SemVer = require_semver$1();
6093
+ const identifiers = require_identifiers();
6094
+ module.exports = {
6095
+ parse: require_parse(),
6096
+ valid: require_valid$1(),
6097
+ clean: require_clean(),
6098
+ inc: require_inc(),
6099
+ diff: require_diff(),
6100
+ major: require_major(),
6101
+ minor: require_minor(),
6102
+ patch: require_patch(),
6103
+ prerelease: require_prerelease(),
6104
+ compare: require_compare(),
6105
+ rcompare: require_rcompare(),
6106
+ compareLoose: require_compare_loose(),
6107
+ compareBuild: require_compare_build(),
6108
+ sort: require_sort(),
6109
+ rsort: require_rsort(),
6110
+ gt: require_gt(),
6111
+ lt: require_lt(),
6112
+ eq: require_eq(),
6113
+ neq: require_neq(),
6114
+ gte: require_gte(),
6115
+ lte: require_lte(),
6116
+ cmp: require_cmp(),
6117
+ coerce: require_coerce(),
6118
+ truncate: require_truncate(),
6119
+ Comparator: require_comparator(),
6120
+ Range: require_range(),
6121
+ satisfies: require_satisfies(),
6122
+ toComparators: require_to_comparators(),
6123
+ maxSatisfying: require_max_satisfying(),
6124
+ minSatisfying: require_min_satisfying(),
6125
+ minVersion: require_min_version(),
6126
+ validRange: require_valid(),
6127
+ outside: require_outside(),
6128
+ gtr: require_gtr(),
6129
+ ltr: require_ltr(),
6130
+ intersects: require_intersects(),
6131
+ simplifyRange: require_simplify(),
6132
+ subset: require_subset(),
6133
+ SemVer,
6134
+ re: internalRe.re,
6135
+ src: internalRe.src,
6136
+ tokens: internalRe.t,
6137
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
6138
+ RELEASE_TYPES: constants.RELEASE_TYPES,
6139
+ compareIdentifiers: identifiers.compareIdentifiers,
6140
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
6141
+ };
6142
+ })))();
4724
6143
  /** The registry's uniqueness rule, shared with the presentation layer. */
4725
6144
  function identityKey(identity) {
4726
6145
  return identity.source === "npm" ? `npm:${identity.name}` : `github:${identity.repo ?? identity.name}#${identity.subdir ?? ""}`;
4727
6146
  }
4728
- /** `owner/slug`, lowercased, or null when this is not a repository reference. */
6147
+ /** `owner/slug` inside a GitHub reference. */
4729
6148
  const REPO = "([\\w.-]+)\\/([\\w.-]+?)";
4730
- new RegExp(`^github:${REPO}(?:[#&].*)?$`);
4731
- new RegExp(`^(?:git\\+)?https?:\\/\\/(?:www\\.)?github\\.com\\/${REPO}(?:\\.git)?(?:[\\/?#].*)?$`);
6149
+ const GITHUB_SHORTHAND = new RegExp(`^github:${REPO}(?:[#&].*)?$`);
6150
+ const GITHUB_URL = new RegExp(`^(?:git\\+)?https?:\\/\\/(?:www\\.)?github\\.com\\/${REPO}(?:\\.git)?(?:[\\/?#].*)?$`);
6151
+ /**
6152
+ * Attribute a profile dependency spec to where its package came from.
6153
+ *
6154
+ * The single parse: every other function here reads its answer rather than
6155
+ * re-applying the regexes, so the grammar cannot be widened in one place and
6156
+ * not the other.
6157
+ *
6158
+ * `null` means this spec is a form the grammar does not cover — `git+ssh://`,
6159
+ * `git@github.com:`, a `file:`/`link:` checkout, `workspace:*`, an `npm:`
6160
+ * alias to a different package, a non-GitHub URL. Attribution is POSITIVE on
6161
+ * both arms and null is never guessed away: reading an unattributable spec as
6162
+ * npm is what let an npm entry silently replace a git install, and what
6163
+ * printed "already installed from the npm package X" about a local checkout.
6164
+ */
6165
+ function parseSpec(spec) {
6166
+ if (spec.trim() === "") return null;
6167
+ const shorthand = GITHUB_SHORTHAND.exec(spec);
6168
+ if (shorthand?.[1] !== void 0 && shorthand[2] !== void 0) return {
6169
+ kind: "github",
6170
+ repo: `${shorthand[1]}/${shorthand[2]}`
6171
+ };
6172
+ const url = GITHUB_URL.exec(spec);
6173
+ if (url?.[1] !== void 0 && url[2] !== void 0) return {
6174
+ kind: "github",
6175
+ repo: `${url[1]}/${url[2]}`
6176
+ };
6177
+ return (0, import_semver.validRange)(spec) !== null ? { kind: "npm" } : null;
6178
+ }
6179
+ /**
6180
+ * Whether two identities of the SAME bundle name are the same install.
6181
+ *
6182
+ * Deliberately coarser than `identityKey`: a profile records a dependency
6183
+ * spec, which carries the repository but not the subdirectory, so this is the
6184
+ * finest distinction the installed state can actually support. It ignores
6185
+ * `name` — every caller has already matched on it — and answers only "is the
6186
+ * thing under that name this one, or a different one?".
6187
+ */
6188
+ function sameInstall(a, b) {
6189
+ if (a.source !== b.source) return false;
6190
+ if (a.source === "npm") return true;
6191
+ return a.repo !== void 0 && a.repo.toLowerCase() === b.repo?.toLowerCase();
6192
+ }
6193
+ function specVerdict(entry, spec) {
6194
+ const origin = parseSpec(spec);
6195
+ if (origin === null) return "unknown";
6196
+ return sameInstall(entry, origin.kind === "npm" ? {
6197
+ source: "npm",
6198
+ name: entry.name
6199
+ } : {
6200
+ source: "github",
6201
+ name: entry.name,
6202
+ repo: origin.repo
6203
+ }) ? "same" : "different";
6204
+ }
6205
+ /** How long a raw spec may be when it is quoted back to a reader as the thing
6206
+ * holding a name. A profile manifest is not ours; a pathological value must
6207
+ * not become a wall of text in a rejection detail or a card. */
6208
+ const HOLDER_SPEC_CAP = 80;
6209
+ /**
6210
+ * The token naming whatever holds a bundle name, for someone deciding what to
6211
+ * do about it.
6212
+ *
6213
+ * One function for both halves. The host's refusal and the card's badge wrap
6214
+ * it in their own sentence — the host in English prose, the card in the
6215
+ * reader's language — but the token itself is identical, so the two surfaces
6216
+ * can never name one plugin two ways. It is language-neutral for that reason:
6217
+ * a github holder is its repository (the only thing that tells it apart from
6218
+ * the entry it blocks), an npm holder is `npm:<name>`, and a spec we cannot
6219
+ * attribute is quoted verbatim, because saying which string is in the way is
6220
+ * the only honest thing left to say about it.
6221
+ */
6222
+ function holderLabel(spec, name) {
6223
+ const origin = parseSpec(spec);
6224
+ if (origin?.kind === "github") return origin.repo;
6225
+ if (origin?.kind === "npm") return `npm:${name}`;
6226
+ if (spec.trim() === "") return "\"\"";
6227
+ return spec.length > HOLDER_SPEC_CAP ? `${spec.slice(0, 79)}…` : spec;
6228
+ }
4732
6229
  //#endregion
4733
6230
  //#region src/client/present.ts
4734
6231
  /** Hot-mount reason code → locale key, so the notice reads in the language
@@ -4759,6 +6256,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4759
6256
  function missingPeersOf(incompatible, key) {
4760
6257
  return incompatible[key] ?? [];
4761
6258
  }
6259
+ /**
6260
+ * The plugin already holding this entry's bundle name, if a DIFFERENT one is,
6261
+ * named the way the host's refusal names it.
6262
+ *
6263
+ * `specs` is the profile manifest's dependencies exactly as the install gate
6264
+ * reads them (`installedSpecs`), and the verdict is the gate's own function.
6265
+ * One rule on one input, so the badge and the refusal cannot disagree. The
6266
+ * first version of this derived the answer from `installed()`, which drops
6267
+ * every dependency no catalog entry matches — so a fork, a hand install or a
6268
+ * delisted holder was invisible here while the host still refused, and the
6269
+ * card showed a plain Install button for an install that could not proceed.
6270
+ *
6271
+ * `undefined` specs means the host could not read the manifest. The answer is
6272
+ * undefined there too: the card makes no claim rather than promising a clean
6273
+ * install it cannot vouch for.
6274
+ */
6275
+ function heldBy(entry, specs) {
6276
+ if (specs === void 0 || !Object.hasOwn(specs, entry.name)) return void 0;
6277
+ const spec = specs[entry.name];
6278
+ if (spec === void 0) return void 0;
6279
+ return specVerdict(entry, spec) === "same" ? void 0 : holderLabel(spec, entry.name);
6280
+ }
4762
6281
  /** Spec §9.3 verbatim — the community-tier acknowledgement. The zh dictionary
4763
6282
  * states the same facts in its own register; never soften this wording. */
4764
6283
  const ACKNOWLEDGEMENT_EN = "Once installed, this plugin holds the same privileges as a built-in one: reading and writing your files, running shell commands, and reading and modifying the requests sent to the model. It has not been reviewed.";
@@ -4774,6 +6293,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4774
6293
  case "needs-acknowledgement": return "needsAcknowledgementCode";
4775
6294
  case "tarball-integrity": return "tarballIntegrityCode";
4776
6295
  case "ambiguous-identity": return "ambiguousIdentityCode";
6296
+ case "name-taken": return "nameTakenCode";
4777
6297
  }
4778
6298
  }
4779
6299
  /** The version a card displays: full for npm, the short commit for github. */
@@ -4837,7 +6357,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4837
6357
  };
4838
6358
  if (status.state === "done") return {
4839
6359
  kind: "done",
4840
- needsRestart: !!status.needsRestart,
6360
+ needsRestart: status.needsRestart ?? true,
4841
6361
  log: status.log,
4842
6362
  ...status.restartReason !== void 0 ? { restartReason: status.restartReason } : {}
4843
6363
  };
@@ -4947,9 +6467,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4947
6467
  * identity (registry `emit.ts` assertCatalogInvariants): `npm:<name>` for an
4948
6468
  * npm entry, `github:<repo>#<subdir>` for a repo one — so two GitHub
4949
6469
  * repositories publishing the same `package.json` name are two legitimate
4950
- * entries under one name, as are two subpackages of one monorepo. The live
4951
- * catalog holds 151 such names over 243 entries, five of them cookiecutter
4952
- * templates that all name themselves `{{PKG_NAME}}`.
6470
+ * entries under one name, as are two subpackages of one monorepo. How many
6471
+ * such names the catalog holds is kept in ONE place `validateInstall`'s
6472
+ * docstring in host/install.ts, with the way to re-derive it — because the
6473
+ * copy that stood here had drifted to less than half the real figure.
4953
6474
  *
4954
6475
  * Keying the shelf by name handed React duplicate keys, and React could then
4955
6476
  * no longer match a card to its DOM node: changing the filter left every
@@ -5040,7 +6561,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5040
6561
  hotHostUnsupportedNotice: "当前环境不支持热挂载;重启 dsh 后生效",
5041
6562
  hotTimeoutNotice: "热挂载超时;重启 dsh 后生效",
5042
6563
  hotMountFailedNotice: "热挂载失败;重启 dsh 后生效",
5043
- installedNoRestartNotice: "已安装,但 profile 未变化——目录可能已过期,请刷新后重试",
6564
+ installedNoRestartNotice: "已安装并热挂载;现在即可使用,无需重启",
5044
6565
  installFailed: "安装失败",
5045
6566
  installTransportFailed: "安装请求未能送达。请稍后重试。",
5046
6567
  refresh: "刷新",
@@ -5061,6 +6582,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5061
6582
  needsAcknowledgementCode: "需要确认",
5062
6583
  tarballIntegrityCode: "压缩包完整性校验失败",
5063
6584
  ambiguousIdentityCode: "无法确定是哪一个条目",
6585
+ nameTakenCode: "同名的另一个插件已安装",
6586
+ nameTakenBadge: "名称被占用",
6587
+ nameTakenDetail: "已安装同名的另一个插件({holder})。\n两个同名插件声明相同的加载项 id,无法共存;安装它会替换掉已装的那个。",
5064
6588
  npmSource: "npm 包",
5065
6589
  githubSource: "源码在 GitHub",
5066
6590
  installedSection: "已安装",
@@ -5130,7 +6654,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5130
6654
  hotHostUnsupportedNotice: "this harness cannot hot-mount; restart dsh to activate",
5131
6655
  hotTimeoutNotice: "hot-mount timed out; restart dsh to activate",
5132
6656
  hotMountFailedNotice: "hot-mount failed; restart dsh to activate",
5133
- installedNoRestartNotice: "installed, but the profile did not change — the catalog may be stale; refresh and try again",
6657
+ installedNoRestartNotice: "installed and hot-mounted; running now, no restart needed",
5134
6658
  installFailed: "Install failed",
5135
6659
  installTransportFailed: "The install request could not be delivered. Please retry.",
5136
6660
  refresh: "Refresh",
@@ -5151,6 +6675,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5151
6675
  needsAcknowledgementCode: "Acknowledgement required",
5152
6676
  tarballIntegrityCode: "tarball integrity check failed",
5153
6677
  ambiguousIdentityCode: "Ambiguous entry",
6678
+ nameTakenCode: "Another plugin holds this name",
6679
+ nameTakenBadge: "Name taken",
6680
+ nameTakenDetail: "A different plugin of this name is installed ({holder}).\nTwo plugins of one name declare the same loader entry id and cannot both load; installing this one would replace it.",
5154
6681
  npmSource: "npm package",
5155
6682
  githubSource: "source on GitHub",
5156
6683
  installedSection: "Installed",
@@ -5516,8 +7043,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5516
7043
  * install controls. An installed plugin's card carries its installed row:
5517
7044
  * current → the non-interactive installed label, behind → the update button;
5518
7045
  * uninstalled → the install button. */
5519
- const EntryCard = (0, react.memo)(function EntryCard({ entry, stars, installed, missing, t, flowFor, installStatus, uninstall, restart, restartSupported, setEnabled, onSettled }) {
7046
+ const EntryCard = (0, react.memo)(function EntryCard({ entry, stars, installed, missing, nameTakenBy, t, flowFor, installStatus, uninstall, restart, restartSupported, setEnabled, onSettled }) {
5520
7047
  const [open, setOpen] = (0, react.useState)(false);
7048
+ const blockers = blockersOf(missing, nameTakenBy, t);
5521
7049
  const detailId = (0, react.useId)();
5522
7050
  const summary = entry.catalog?.summary;
5523
7051
  const npmUrl = npmPageUrl(entry);
@@ -5622,11 +7150,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5622
7150
  className: open ? `${_dsh_plugin_shop_css_e3675a89_default.summaryZh} ${_dsh_plugin_shop_css_e3675a89_default.summaryZhExpanded}` : _dsh_plugin_shop_css_e3675a89_default.summaryZh,
5623
7151
  children: summary.zh
5624
7152
  }),
5625
- missing.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7153
+ blockers.map((blocker) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5626
7154
  className: _dsh_plugin_shop_css_e3675a89_default.incompatibleDetail,
5627
7155
  "data-shop-incompatible-detail": true,
5628
- children: t("incompatibleDetail", { modules: missing.join(", ") })
5629
- }),
7156
+ children: blocker.text
7157
+ }, blocker.kind)),
5630
7158
  open && entry.catalog !== void 0 && entry.catalog.capabilities.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5631
7159
  className: _dsh_plugin_shop_css_e3675a89_default.capabilitiesBlock,
5632
7160
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -5687,6 +7215,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5687
7215
  target: installTarget,
5688
7216
  tier: entry.tier,
5689
7217
  missing,
7218
+ blockers,
5690
7219
  missingStated: true,
5691
7220
  flow,
5692
7221
  t,
@@ -5698,6 +7227,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5698
7227
  tier: entry.tier,
5699
7228
  variant: installed.outdated ? "update" : "install",
5700
7229
  missing,
7230
+ blockers,
5701
7231
  missingStated: true,
5702
7232
  flow,
5703
7233
  t,
@@ -5707,8 +7237,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5707
7237
  className: _dsh_plugin_shop_css_e3675a89_default.installedLabel,
5708
7238
  "data-shop-installed": true,
5709
7239
  children: t("installed")
5710
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IncompatibleBadge, {
5711
- missing,
7240
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockerBadge, {
7241
+ blockers,
5712
7242
  t
5713
7243
  })] }),
5714
7244
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EnabledSwitch, {
@@ -5734,22 +7264,42 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5734
7264
  ]
5735
7265
  });
5736
7266
  });
7267
+ /**
7268
+ * Everything standing in this entry's way, already localized.
7269
+ *
7270
+ * The two are independent and both can hold at once, so this is a list and
7271
+ * every surface renders the same list. The name conflict reads first: it is
7272
+ * about a plugin the reader chose and would lose.
7273
+ */
7274
+ function blockersOf(missing, nameTakenBy, t) {
7275
+ const blockers = [];
7276
+ if (nameTakenBy !== void 0) blockers.push({
7277
+ kind: "name-taken",
7278
+ text: t("nameTakenDetail", { holder: nameTakenBy })
7279
+ });
7280
+ if (missing.length > 0) blockers.push({
7281
+ kind: "missing-peers",
7282
+ text: t("incompatibleDetail", { modules: missing.join(", ") })
7283
+ });
7284
+ return blockers;
7285
+ }
5737
7286
  /** The harness-compatibility verdict, rendered beside the control it
5738
7287
  * qualifies. It answers "what happens if I press this", not "what is this",
5739
7288
  * so it belongs to the action row and not among the identity badges in the
5740
7289
  * header — where it also sat inside a <button>, competing with that button's
5741
7290
  * own hit area for the tooltip. Renders nothing when the harness provides
5742
7291
  * everything. */
5743
- function IncompatibleBadge({ missing, t }) {
5744
- if (missing.length === 0) return null;
5745
- const detail = t("incompatibleDetail", { modules: missing.join(", ") });
7292
+ function BlockerBadge({ blockers, t }) {
7293
+ if (blockers.length === 0) return null;
7294
+ const detail = blockers.map((blocker) => blocker.text).join("\n");
7295
+ const taken = blockers.some((blocker) => blocker.kind === "name-taken");
5746
7296
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5747
7297
  className: _dsh_plugin_shop_css_e3675a89_default.incompatibleBadge,
5748
- "data-shop-incompatible": true,
7298
+ "data-shop-blocker": taken ? "name-taken" : "missing-peers",
5749
7299
  role: "img",
5750
7300
  "aria-label": detail,
5751
7301
  title: detail,
5752
- children: t("incompatibleBadge")
7302
+ children: t(taken ? "nameTakenBadge" : "incompatibleBadge")
5753
7303
  });
5754
7304
  }
5755
7305
  /** One entry's install flow: the button, the §9.3 acknowledgement gate for
@@ -5757,7 +7307,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5757
7307
  * failure detail, rejection detail — driven by `useInstall`. Shared by the
5758
7308
  * catalog cards (`variant: 'install'`) and the outdated rows' update button
5759
7309
  * (`variant: 'update'`, which drives the same install flow for `name@latest`). */
5760
- function InstallPanel({ target, tier, missing, missingStated = false, variant = "install", flow, t, restart, restartSupported }) {
7310
+ function InstallPanel({ target, tier, missing, blockers, missingStated = false, variant = "install", flow, t, restart, restartSupported }) {
5761
7311
  const [gateOpen, setGateOpen] = (0, react.useState)(false);
5762
7312
  const { view, start } = flow;
5763
7313
  if (view.kind === "running") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -5840,11 +7390,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5840
7390
  className: _dsh_plugin_shop_css_e3675a89_default.gateBody,
5841
7391
  children: t("acknowledgementBody")
5842
7392
  }),
5843
- missing.length > 0 && !missingStated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7393
+ !missingStated && blockersOf(missing, void 0, t).map((blocker) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5844
7394
  className: _dsh_plugin_shop_css_e3675a89_default.gateWarning,
5845
7395
  "data-shop-incompatible-warning": true,
5846
- children: t("incompatibleDetail", { modules: missing.join(", ") })
5847
- }),
7396
+ children: blocker.text
7397
+ }, blocker.kind)),
5848
7398
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5849
7399
  className: _dsh_plugin_shop_css_e3675a89_default.gateActions,
5850
7400
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -5869,9 +7419,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5869
7419
  ]
5870
7420
  });
5871
7421
  const update = variant === "update";
7422
+ const refused = blockers.some((blocker) => blocker.kind === "name-taken");
5872
7423
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
5873
7424
  type: "button",
5874
7425
  className: _dsh_plugin_shop_css_e3675a89_default.installButton,
7426
+ disabled: refused,
7427
+ ...refused ? { "data-shop-refused": true } : {},
5875
7428
  ...update ? { "data-shop-update": true } : { "data-shop-install": true },
5876
7429
  onClick: () => {
5877
7430
  if (tier === "verified") start({
@@ -5881,8 +7434,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5881
7434
  else setGateOpen(true);
5882
7435
  },
5883
7436
  children: t(update ? "update" : "install")
5884
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IncompatibleBadge, {
5885
- missing,
7437
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockerBadge, {
7438
+ blockers,
5886
7439
  t
5887
7440
  })] });
5888
7441
  }
@@ -6156,6 +7709,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6156
7709
  tier,
6157
7710
  variant: "update",
6158
7711
  missing,
7712
+ blockers: blockersOf(missing, void 0, t),
6159
7713
  flow: flowFor(identityKey(row)),
6160
7714
  t,
6161
7715
  restart,
@@ -6204,9 +7758,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6204
7758
  /** The shop tab root: browse, search, refresh, and render one card per
6205
7759
  * entry. Data attributes on the e2e-relevant nodes follow the Task 3 list. */
6206
7760
  function ShopTab(props) {
6207
- const { t, catalog, install, installStatus, setEnabled, installed, uninstall, restart, version, updateStart } = props;
7761
+ const { t, catalog, install, installStatus, setEnabled, installed, installedSpecs, uninstall, restart, version, updateStart } = props;
6208
7762
  const [catalogState, setCatalogState] = (0, react.useState)({ kind: "loading" });
6209
7763
  const [installedState, setInstalledState] = (0, react.useState)({ kind: "loading" });
7764
+ /** The install gate's own input, or undefined while it is unknown — loading,
7765
+ * failed, or answered `null` by a host that could not read the manifest.
7766
+ * Undefined is never read as "nothing is installed": a card makes no claim
7767
+ * about a conflict it could not check. */
7768
+ const [specs, setSpecs] = (0, react.useState)(void 0);
6210
7769
  const [selfVersion, setSelfVersion] = (0, react.useState)(null);
6211
7770
  const restartSupported = selfVersion?.restartSupported ?? true;
6212
7771
  const [selfRestartGate, setSelfRestartGate] = (0, react.useState)(false);
@@ -6284,13 +7843,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6284
7843
  let cancelled = false;
6285
7844
  const load = async () => {
6286
7845
  try {
6287
- const entries = await installed();
6288
- if (!cancelled) setInstalledState({
7846
+ const [entries, held] = await Promise.all([installed(), installedSpecs()]);
7847
+ if (cancelled) return;
7848
+ setInstalledState({
6289
7849
  kind: "ready",
6290
7850
  entries
6291
7851
  });
7852
+ setSpecs(held ?? void 0);
6292
7853
  } catch {
6293
- if (!cancelled) setInstalledState({ kind: "error" });
7854
+ if (cancelled) return;
7855
+ setInstalledState({ kind: "error" });
7856
+ setSpecs(void 0);
6294
7857
  }
6295
7858
  };
6296
7859
  load();
@@ -6299,6 +7862,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6299
7862
  };
6300
7863
  }, [
6301
7864
  installed,
7865
+ installedSpecs,
6302
7866
  request,
6303
7867
  mutations
6304
7868
  ]);
@@ -6370,6 +7934,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6370
7934
  if (catalogState.kind === "ready") for (const entry of catalogState.result.plugins) map.set(entryKey(entry), missingPeersOf(catalogState.result.incompatible, entryKey(entry)));
6371
7935
  return map;
6372
7936
  }, [catalogState]);
7937
+ const nameTakenByKey = (0, react.useMemo)(() => {
7938
+ const map = /* @__PURE__ */ new Map();
7939
+ if (catalogState.kind !== "ready") return map;
7940
+ for (const entry of catalogState.result.plugins) {
7941
+ const holder = heldBy(entry, specs);
7942
+ if (holder !== void 0) map.set(entryKey(entry), holder);
7943
+ }
7944
+ return map;
7945
+ }, [catalogState, specs]);
6373
7946
  if (catalogState.kind === "loading") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6374
7947
  className: _dsh_plugin_shop_css_e3675a89_default.panel,
6375
7948
  "data-shop-tab": true,
@@ -6627,20 +8200,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6627
8200
  children: t("emptySearch")
6628
8201
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
6629
8202
  className: _dsh_plugin_shop_css_e3675a89_default.cards,
6630
- children: [visible.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EntryCard, {
6631
- entry,
6632
- stars: starsOf(entry, stars),
6633
- installed: installedByKey.get(entryKey(entry)),
6634
- missing: missingByKey.get(entryKey(entry)) ?? [],
6635
- t,
6636
- flowFor: flows.flowFor,
6637
- installStatus,
6638
- uninstall,
6639
- restart,
6640
- restartSupported,
6641
- setEnabled,
6642
- onSettled: noteMutation
6643
- }) }, entryKey(entry))), incremental && visibleCount < filtered.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
8203
+ children: [visible.map((entry) => {
8204
+ const key = entryKey(entry);
8205
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EntryCard, {
8206
+ entry,
8207
+ stars: starsOf(entry, stars),
8208
+ installed: installedByKey.get(key),
8209
+ missing: missingByKey.get(key) ?? [],
8210
+ nameTakenBy: nameTakenByKey.get(key),
8211
+ t,
8212
+ flowFor: flows.flowFor,
8213
+ installStatus,
8214
+ uninstall,
8215
+ restart,
8216
+ restartSupported,
8217
+ setEnabled,
8218
+ onSettled: noteMutation
8219
+ }) }, key);
8220
+ }), incremental && visibleCount < filtered.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
6644
8221
  ref: sentinelRef,
6645
8222
  className: _dsh_plugin_shop_css_e3675a89_default.cardsSentry,
6646
8223
  "data-shop-sentry": true,
@@ -6746,6 +8323,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6746
8323
  installStatus: async (args) => unwrap(await ns.installStatus(args)),
6747
8324
  setEnabled: async (args) => unwrap(await ns.setEnabled(args)),
6748
8325
  installed: async () => unwrap(await ns.installed()),
8326
+ installedSpecs: async () => unwrap(await ns.installedSpecs()),
6749
8327
  uninstall: async (args) => unwrap(await ns.uninstallStart(args)),
6750
8328
  restart: async () => unwrap(await ns.restart()),
6751
8329
  version: async () => unwrap(await ns.version()),