flowdular 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/distribution.js +453 -1972
  2. package/dist/index.js +741 -2009
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,1963 +1,4 @@
1
1
  #!/usr/bin/env node
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- try {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- } catch (e) {
12
- throw mod = 0, e;
13
- }
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
-
32
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
33
- var require_constants = __commonJS({
34
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js"(exports, module) {
35
- "use strict";
36
- var SEMVER_SPEC_VERSION = "2.0.0";
37
- var MAX_LENGTH = 256;
38
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
39
- 9007199254740991;
40
- var MAX_SAFE_COMPONENT_LENGTH = 16;
41
- var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
42
- var RELEASE_TYPES = [
43
- "major",
44
- "premajor",
45
- "minor",
46
- "preminor",
47
- "patch",
48
- "prepatch",
49
- "prerelease"
50
- ];
51
- module.exports = {
52
- MAX_LENGTH,
53
- MAX_SAFE_COMPONENT_LENGTH,
54
- MAX_SAFE_BUILD_LENGTH,
55
- MAX_SAFE_INTEGER,
56
- RELEASE_TYPES,
57
- SEMVER_SPEC_VERSION,
58
- FLAG_INCLUDE_PRERELEASE: 1,
59
- FLAG_LOOSE: 2
60
- };
61
- }
62
- });
63
-
64
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js
65
- var require_debug = __commonJS({
66
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js"(exports, module) {
67
- "use strict";
68
- var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
69
- };
70
- module.exports = debug;
71
- }
72
- });
73
-
74
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js
75
- var require_re = __commonJS({
76
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js"(exports, module) {
77
- "use strict";
78
- var {
79
- MAX_SAFE_COMPONENT_LENGTH,
80
- MAX_SAFE_BUILD_LENGTH,
81
- MAX_LENGTH
82
- } = require_constants();
83
- var debug = require_debug();
84
- exports = module.exports = {};
85
- var re = exports.re = [];
86
- var safeRe = exports.safeRe = [];
87
- var src = exports.src = [];
88
- var safeSrc = exports.safeSrc = [];
89
- var t = exports.t = {};
90
- var R = 0;
91
- var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
92
- var safeRegexReplacements = [
93
- ["\\s", 1],
94
- ["\\d", MAX_LENGTH],
95
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
96
- ];
97
- var makeSafeRegex = (value) => {
98
- for (const [token, max] of safeRegexReplacements) {
99
- value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
100
- }
101
- return value;
102
- };
103
- var createToken = (name, value, isGlobal) => {
104
- const safe = makeSafeRegex(value);
105
- const index = R++;
106
- debug(name, index, value);
107
- t[name] = index;
108
- src[index] = value;
109
- safeSrc[index] = safe;
110
- re[index] = new RegExp(value, isGlobal ? "g" : void 0);
111
- safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
112
- };
113
- createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
114
- createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
115
- createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
116
- createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
117
- createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
118
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
119
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
120
- createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
121
- createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
122
- createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
123
- createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
124
- createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
125
- createToken("FULL", `^${src[t.FULLPLAIN]}$`);
126
- createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
127
- createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
128
- createToken("GTLT", "((?:<|>)?=?)");
129
- createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
130
- createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
131
- createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
132
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
133
- createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
134
- createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
135
- createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
136
- createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
137
- createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
138
- createToken("COERCERTL", src[t.COERCE], true);
139
- createToken("COERCERTLFULL", src[t.COERCEFULL], true);
140
- createToken("LONETILDE", "(?:~>?)");
141
- createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
142
- exports.tildeTrimReplace = "$1~";
143
- createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
144
- createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
145
- createToken("LONECARET", "(?:\\^)");
146
- createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
147
- exports.caretTrimReplace = "$1^";
148
- createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
149
- createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
150
- createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
151
- createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
152
- createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
153
- exports.comparatorTrimReplace = "$1$2$3";
154
- createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
155
- createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
156
- createToken("STAR", "(<|>)?=?\\s*\\*");
157
- createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
158
- createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
159
- }
160
- });
161
-
162
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js
163
- var require_parse_options = __commonJS({
164
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js"(exports, module) {
165
- "use strict";
166
- var looseOption = Object.freeze({ loose: true });
167
- var emptyOpts = Object.freeze({});
168
- var parseOptions = (options) => {
169
- if (!options) {
170
- return emptyOpts;
171
- }
172
- if (typeof options !== "object") {
173
- return looseOption;
174
- }
175
- return options;
176
- };
177
- module.exports = parseOptions;
178
- }
179
- });
180
-
181
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js
182
- var require_identifiers = __commonJS({
183
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports, module) {
184
- "use strict";
185
- var numeric = /^[0-9]+$/;
186
- var compareIdentifiers = (a, b) => {
187
- if (typeof a === "number" && typeof b === "number") {
188
- return a === b ? 0 : a < b ? -1 : 1;
189
- }
190
- const anum = numeric.test(a);
191
- const bnum = numeric.test(b);
192
- if (anum && bnum) {
193
- a = +a;
194
- b = +b;
195
- }
196
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
197
- };
198
- var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
199
- module.exports = {
200
- compareIdentifiers,
201
- rcompareIdentifiers
202
- };
203
- }
204
- });
205
-
206
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js
207
- var require_semver = __commonJS({
208
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js"(exports, module) {
209
- "use strict";
210
- var debug = require_debug();
211
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
212
- var { safeRe: re, t } = require_re();
213
- var parseOptions = require_parse_options();
214
- var { compareIdentifiers } = require_identifiers();
215
- var SemVer = class _SemVer {
216
- constructor(version, options) {
217
- options = parseOptions(options);
218
- if (version instanceof _SemVer) {
219
- if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
220
- return version;
221
- } else {
222
- version = version.version;
223
- }
224
- } else if (typeof version !== "string") {
225
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
226
- }
227
- if (version.length > MAX_LENGTH) {
228
- throw new TypeError(
229
- `version is longer than ${MAX_LENGTH} characters`
230
- );
231
- }
232
- debug("SemVer", version, options);
233
- this.options = options;
234
- this.loose = !!options.loose;
235
- this.includePrerelease = !!options.includePrerelease;
236
- const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
237
- if (!m) {
238
- throw new TypeError(`Invalid Version: ${version}`);
239
- }
240
- this.raw = version;
241
- this.major = +m[1];
242
- this.minor = +m[2];
243
- this.patch = +m[3];
244
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
245
- throw new TypeError("Invalid major version");
246
- }
247
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
248
- throw new TypeError("Invalid minor version");
249
- }
250
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
251
- throw new TypeError("Invalid patch version");
252
- }
253
- if (!m[4]) {
254
- this.prerelease = [];
255
- } else {
256
- this.prerelease = m[4].split(".").map((id) => {
257
- if (/^[0-9]+$/.test(id)) {
258
- const num = +id;
259
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
260
- return num;
261
- }
262
- }
263
- return id;
264
- });
265
- }
266
- this.build = m[5] ? m[5].split(".") : [];
267
- this.format();
268
- }
269
- format() {
270
- this.version = `${this.major}.${this.minor}.${this.patch}`;
271
- if (this.prerelease.length) {
272
- this.version += `-${this.prerelease.join(".")}`;
273
- }
274
- return this.version;
275
- }
276
- toString() {
277
- return this.version;
278
- }
279
- compare(other) {
280
- debug("SemVer.compare", this.version, this.options, other);
281
- if (!(other instanceof _SemVer)) {
282
- if (typeof other === "string" && other === this.version) {
283
- return 0;
284
- }
285
- other = new _SemVer(other, this.options);
286
- }
287
- if (other.version === this.version) {
288
- return 0;
289
- }
290
- return this.compareMain(other) || this.comparePre(other);
291
- }
292
- compareMain(other) {
293
- if (!(other instanceof _SemVer)) {
294
- other = new _SemVer(other, this.options);
295
- }
296
- if (this.major < other.major) {
297
- return -1;
298
- }
299
- if (this.major > other.major) {
300
- return 1;
301
- }
302
- if (this.minor < other.minor) {
303
- return -1;
304
- }
305
- if (this.minor > other.minor) {
306
- return 1;
307
- }
308
- if (this.patch < other.patch) {
309
- return -1;
310
- }
311
- if (this.patch > other.patch) {
312
- return 1;
313
- }
314
- return 0;
315
- }
316
- comparePre(other) {
317
- if (!(other instanceof _SemVer)) {
318
- other = new _SemVer(other, this.options);
319
- }
320
- if (this.prerelease.length && !other.prerelease.length) {
321
- return -1;
322
- } else if (!this.prerelease.length && other.prerelease.length) {
323
- return 1;
324
- } else if (!this.prerelease.length && !other.prerelease.length) {
325
- return 0;
326
- }
327
- let i = 0;
328
- do {
329
- const a = this.prerelease[i];
330
- const b = other.prerelease[i];
331
- debug("prerelease compare", i, a, b);
332
- if (a === void 0 && b === void 0) {
333
- return 0;
334
- } else if (b === void 0) {
335
- return 1;
336
- } else if (a === void 0) {
337
- return -1;
338
- } else if (a === b) {
339
- continue;
340
- } else {
341
- return compareIdentifiers(a, b);
342
- }
343
- } while (++i);
344
- }
345
- compareBuild(other) {
346
- if (!(other instanceof _SemVer)) {
347
- other = new _SemVer(other, this.options);
348
- }
349
- let i = 0;
350
- do {
351
- const a = this.build[i];
352
- const b = other.build[i];
353
- debug("build compare", i, a, b);
354
- if (a === void 0 && b === void 0) {
355
- return 0;
356
- } else if (b === void 0) {
357
- return 1;
358
- } else if (a === void 0) {
359
- return -1;
360
- } else if (a === b) {
361
- continue;
362
- } else {
363
- return compareIdentifiers(a, b);
364
- }
365
- } while (++i);
366
- }
367
- // preminor will bump the version up to the next minor release, and immediately
368
- // down to pre-release. premajor and prepatch work the same way.
369
- inc(release, identifier2, identifierBase) {
370
- if (release.startsWith("pre")) {
371
- if (!identifier2 && identifierBase === false) {
372
- throw new Error("invalid increment argument: identifier is empty");
373
- }
374
- if (identifier2) {
375
- const match = `-${identifier2}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
376
- if (!match || match[1] !== identifier2) {
377
- throw new Error(`invalid identifier: ${identifier2}`);
378
- }
379
- }
380
- }
381
- switch (release) {
382
- case "premajor":
383
- this.prerelease.length = 0;
384
- this.patch = 0;
385
- this.minor = 0;
386
- this.major++;
387
- this.inc("pre", identifier2, identifierBase);
388
- break;
389
- case "preminor":
390
- this.prerelease.length = 0;
391
- this.patch = 0;
392
- this.minor++;
393
- this.inc("pre", identifier2, identifierBase);
394
- break;
395
- case "prepatch":
396
- this.prerelease.length = 0;
397
- this.inc("patch", identifier2, identifierBase);
398
- this.inc("pre", identifier2, identifierBase);
399
- break;
400
- // If the input is a non-prerelease version, this acts the same as
401
- // prepatch.
402
- case "prerelease":
403
- if (this.prerelease.length === 0) {
404
- this.inc("patch", identifier2, identifierBase);
405
- }
406
- this.inc("pre", identifier2, identifierBase);
407
- break;
408
- case "release":
409
- if (this.prerelease.length === 0) {
410
- throw new Error(`version ${this.raw} is not a prerelease`);
411
- }
412
- this.prerelease.length = 0;
413
- break;
414
- case "major":
415
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
416
- this.major++;
417
- }
418
- this.minor = 0;
419
- this.patch = 0;
420
- this.prerelease = [];
421
- break;
422
- case "minor":
423
- if (this.patch !== 0 || this.prerelease.length === 0) {
424
- this.minor++;
425
- }
426
- this.patch = 0;
427
- this.prerelease = [];
428
- break;
429
- case "patch":
430
- if (this.prerelease.length === 0) {
431
- this.patch++;
432
- }
433
- this.prerelease = [];
434
- break;
435
- // This probably shouldn't be used publicly.
436
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
437
- case "pre": {
438
- const base = Number(identifierBase) ? 1 : 0;
439
- if (this.prerelease.length === 0) {
440
- this.prerelease = [base];
441
- } else {
442
- let i = this.prerelease.length;
443
- while (--i >= 0) {
444
- if (typeof this.prerelease[i] === "number") {
445
- this.prerelease[i]++;
446
- i = -2;
447
- }
448
- }
449
- if (i === -1) {
450
- if (identifier2 === this.prerelease.join(".") && identifierBase === false) {
451
- throw new Error("invalid increment argument: identifier already exists");
452
- }
453
- this.prerelease.push(base);
454
- }
455
- }
456
- if (identifier2) {
457
- let prerelease = [identifier2, base];
458
- if (identifierBase === false) {
459
- prerelease = [identifier2];
460
- }
461
- if (compareIdentifiers(this.prerelease[0], identifier2) === 0) {
462
- if (isNaN(this.prerelease[1])) {
463
- this.prerelease = prerelease;
464
- }
465
- } else {
466
- this.prerelease = prerelease;
467
- }
468
- }
469
- break;
470
- }
471
- default:
472
- throw new Error(`invalid increment argument: ${release}`);
473
- }
474
- this.raw = this.format();
475
- if (this.build.length) {
476
- this.raw += `+${this.build.join(".")}`;
477
- }
478
- return this;
479
- }
480
- };
481
- module.exports = SemVer;
482
- }
483
- });
484
-
485
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
486
- var require_parse = __commonJS({
487
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(exports, module) {
488
- "use strict";
489
- var SemVer = require_semver();
490
- var parse = (version, options, throwErrors = false) => {
491
- if (version instanceof SemVer) {
492
- return version;
493
- }
494
- try {
495
- return new SemVer(version, options);
496
- } catch (er) {
497
- if (!throwErrors) {
498
- return null;
499
- }
500
- throw er;
501
- }
502
- };
503
- module.exports = parse;
504
- }
505
- });
506
-
507
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
508
- var require_valid = __commonJS({
509
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(exports, module) {
510
- "use strict";
511
- var parse = require_parse();
512
- var valid2 = (version, options) => {
513
- const v = parse(version, options);
514
- return v ? v.version : null;
515
- };
516
- module.exports = valid2;
517
- }
518
- });
519
-
520
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
521
- var require_clean = __commonJS({
522
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(exports, module) {
523
- "use strict";
524
- var parse = require_parse();
525
- var clean = (version, options) => {
526
- const s = parse(version.trim().replace(/^[=v]+/, ""), options);
527
- return s ? s.version : null;
528
- };
529
- module.exports = clean;
530
- }
531
- });
532
-
533
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
534
- var require_inc = __commonJS({
535
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js"(exports, module) {
536
- "use strict";
537
- var SemVer = require_semver();
538
- var inc2 = (version, release, options, identifier2, identifierBase) => {
539
- if (typeof options === "string") {
540
- identifierBase = identifier2;
541
- identifier2 = options;
542
- options = void 0;
543
- }
544
- try {
545
- return new SemVer(
546
- version instanceof SemVer ? version.version : version,
547
- options
548
- ).inc(release, identifier2, identifierBase).version;
549
- } catch (er) {
550
- return null;
551
- }
552
- };
553
- module.exports = inc2;
554
- }
555
- });
556
-
557
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
558
- var require_diff = __commonJS({
559
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(exports, module) {
560
- "use strict";
561
- var parse = require_parse();
562
- var diff = (version1, version2) => {
563
- const v1 = parse(version1, null, true);
564
- const v2 = parse(version2, null, true);
565
- const comparison = v1.compare(v2);
566
- if (comparison === 0) {
567
- return null;
568
- }
569
- const v1Higher = comparison > 0;
570
- const highVersion = v1Higher ? v1 : v2;
571
- const lowVersion = v1Higher ? v2 : v1;
572
- const highHasPre = !!highVersion.prerelease.length;
573
- const lowHasPre = !!lowVersion.prerelease.length;
574
- if (lowHasPre && !highHasPre) {
575
- if (!lowVersion.patch && !lowVersion.minor) {
576
- return "major";
577
- }
578
- if (lowVersion.compareMain(highVersion) === 0) {
579
- if (lowVersion.minor && !lowVersion.patch) {
580
- return "minor";
581
- }
582
- return "patch";
583
- }
584
- }
585
- const prefix = highHasPre ? "pre" : "";
586
- if (v1.major !== v2.major) {
587
- return prefix + "major";
588
- }
589
- if (v1.minor !== v2.minor) {
590
- return prefix + "minor";
591
- }
592
- if (v1.patch !== v2.patch) {
593
- return prefix + "patch";
594
- }
595
- return "prerelease";
596
- };
597
- module.exports = diff;
598
- }
599
- });
600
-
601
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
602
- var require_major = __commonJS({
603
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(exports, module) {
604
- "use strict";
605
- var SemVer = require_semver();
606
- var major = (a, loose) => new SemVer(a, loose).major;
607
- module.exports = major;
608
- }
609
- });
610
-
611
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
612
- var require_minor = __commonJS({
613
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(exports, module) {
614
- "use strict";
615
- var SemVer = require_semver();
616
- var minor = (a, loose) => new SemVer(a, loose).minor;
617
- module.exports = minor;
618
- }
619
- });
620
-
621
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
622
- var require_patch = __commonJS({
623
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(exports, module) {
624
- "use strict";
625
- var SemVer = require_semver();
626
- var patch = (a, loose) => new SemVer(a, loose).patch;
627
- module.exports = patch;
628
- }
629
- });
630
-
631
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
632
- var require_prerelease = __commonJS({
633
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(exports, module) {
634
- "use strict";
635
- var parse = require_parse();
636
- var prerelease = (version, options) => {
637
- const parsed = parse(version, options);
638
- return parsed && parsed.prerelease.length ? parsed.prerelease : null;
639
- };
640
- module.exports = prerelease;
641
- }
642
- });
643
-
644
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
645
- var require_compare = __commonJS({
646
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(exports, module) {
647
- "use strict";
648
- var SemVer = require_semver();
649
- var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
650
- module.exports = compare;
651
- }
652
- });
653
-
654
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
655
- var require_rcompare = __commonJS({
656
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports, module) {
657
- "use strict";
658
- var compare = require_compare();
659
- var rcompare2 = (a, b, loose) => compare(b, a, loose);
660
- module.exports = rcompare2;
661
- }
662
- });
663
-
664
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
665
- var require_compare_loose = __commonJS({
666
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports, module) {
667
- "use strict";
668
- var compare = require_compare();
669
- var compareLoose = (a, b) => compare(a, b, true);
670
- module.exports = compareLoose;
671
- }
672
- });
673
-
674
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
675
- var require_compare_build = __commonJS({
676
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports, module) {
677
- "use strict";
678
- var SemVer = require_semver();
679
- var compareBuild = (a, b, loose) => {
680
- const versionA = new SemVer(a, loose);
681
- const versionB = new SemVer(b, loose);
682
- return versionA.compare(versionB) || versionA.compareBuild(versionB);
683
- };
684
- module.exports = compareBuild;
685
- }
686
- });
687
-
688
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
689
- var require_sort = __commonJS({
690
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(exports, module) {
691
- "use strict";
692
- var compareBuild = require_compare_build();
693
- var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
694
- module.exports = sort;
695
- }
696
- });
697
-
698
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
699
- var require_rsort = __commonJS({
700
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports, module) {
701
- "use strict";
702
- var compareBuild = require_compare_build();
703
- var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
704
- module.exports = rsort;
705
- }
706
- });
707
-
708
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
709
- var require_gt = __commonJS({
710
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(exports, module) {
711
- "use strict";
712
- var compare = require_compare();
713
- var gt = (a, b, loose) => compare(a, b, loose) > 0;
714
- module.exports = gt;
715
- }
716
- });
717
-
718
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
719
- var require_lt = __commonJS({
720
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(exports, module) {
721
- "use strict";
722
- var compare = require_compare();
723
- var lt = (a, b, loose) => compare(a, b, loose) < 0;
724
- module.exports = lt;
725
- }
726
- });
727
-
728
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
729
- var require_eq = __commonJS({
730
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(exports, module) {
731
- "use strict";
732
- var compare = require_compare();
733
- var eq = (a, b, loose) => compare(a, b, loose) === 0;
734
- module.exports = eq;
735
- }
736
- });
737
-
738
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
739
- var require_neq = __commonJS({
740
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(exports, module) {
741
- "use strict";
742
- var compare = require_compare();
743
- var neq = (a, b, loose) => compare(a, b, loose) !== 0;
744
- module.exports = neq;
745
- }
746
- });
747
-
748
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
749
- var require_gte = __commonJS({
750
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports, module) {
751
- "use strict";
752
- var compare = require_compare();
753
- var gte = (a, b, loose) => compare(a, b, loose) >= 0;
754
- module.exports = gte;
755
- }
756
- });
757
-
758
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
759
- var require_lte = __commonJS({
760
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports, module) {
761
- "use strict";
762
- var compare = require_compare();
763
- var lte = (a, b, loose) => compare(a, b, loose) <= 0;
764
- module.exports = lte;
765
- }
766
- });
767
-
768
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
769
- var require_cmp = __commonJS({
770
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js"(exports, module) {
771
- "use strict";
772
- var eq = require_eq();
773
- var neq = require_neq();
774
- var gt = require_gt();
775
- var gte = require_gte();
776
- var lt = require_lt();
777
- var lte = require_lte();
778
- var cmp = (a, op, b, loose) => {
779
- switch (op) {
780
- case "===":
781
- if (typeof a === "object") {
782
- a = a.version;
783
- }
784
- if (typeof b === "object") {
785
- b = b.version;
786
- }
787
- return a === b;
788
- case "!==":
789
- if (typeof a === "object") {
790
- a = a.version;
791
- }
792
- if (typeof b === "object") {
793
- b = b.version;
794
- }
795
- return a !== b;
796
- case "":
797
- case "=":
798
- case "==":
799
- return eq(a, b, loose);
800
- case "!=":
801
- return neq(a, b, loose);
802
- case ">":
803
- return gt(a, b, loose);
804
- case ">=":
805
- return gte(a, b, loose);
806
- case "<":
807
- return lt(a, b, loose);
808
- case "<=":
809
- return lte(a, b, loose);
810
- default:
811
- throw new TypeError(`Invalid operator: ${op}`);
812
- }
813
- };
814
- module.exports = cmp;
815
- }
816
- });
817
-
818
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
819
- var require_coerce = __commonJS({
820
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports, module) {
821
- "use strict";
822
- var SemVer = require_semver();
823
- var parse = require_parse();
824
- var { safeRe: re, t } = require_re();
825
- var coerce = (version, options) => {
826
- if (version instanceof SemVer) {
827
- return version;
828
- }
829
- if (typeof version === "number") {
830
- version = String(version);
831
- }
832
- if (typeof version !== "string") {
833
- return null;
834
- }
835
- options = options || {};
836
- let match = null;
837
- if (!options.rtl) {
838
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
839
- } else {
840
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
841
- let next;
842
- while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
843
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
844
- match = next;
845
- }
846
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
847
- }
848
- coerceRtlRegex.lastIndex = -1;
849
- }
850
- if (match === null) {
851
- return null;
852
- }
853
- const major = match[2];
854
- const minor = match[3] || "0";
855
- const patch = match[4] || "0";
856
- const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
857
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
858
- return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
859
- };
860
- module.exports = coerce;
861
- }
862
- });
863
-
864
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
865
- var require_lrucache = __commonJS({
866
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js"(exports, module) {
867
- "use strict";
868
- var LRUCache = class {
869
- constructor() {
870
- this.max = 1e3;
871
- this.map = /* @__PURE__ */ new Map();
872
- }
873
- get(key) {
874
- const value = this.map.get(key);
875
- if (value === void 0) {
876
- return void 0;
877
- } else {
878
- this.map.delete(key);
879
- this.map.set(key, value);
880
- return value;
881
- }
882
- }
883
- delete(key) {
884
- return this.map.delete(key);
885
- }
886
- set(key, value) {
887
- const deleted = this.delete(key);
888
- if (!deleted && value !== void 0) {
889
- if (this.map.size >= this.max) {
890
- const firstKey = this.map.keys().next().value;
891
- this.delete(firstKey);
892
- }
893
- this.map.set(key, value);
894
- }
895
- return this;
896
- }
897
- };
898
- module.exports = LRUCache;
899
- }
900
- });
901
-
902
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
903
- var require_range = __commonJS({
904
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js"(exports, module) {
905
- "use strict";
906
- var SPACE_CHARACTERS = /\s+/g;
907
- var Range = class _Range {
908
- constructor(range, options) {
909
- options = parseOptions(options);
910
- if (range instanceof _Range) {
911
- if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
912
- return range;
913
- } else {
914
- return new _Range(range.raw, options);
915
- }
916
- }
917
- if (range instanceof Comparator) {
918
- this.raw = range.value;
919
- this.set = [[range]];
920
- this.formatted = void 0;
921
- return this;
922
- }
923
- this.options = options;
924
- this.loose = !!options.loose;
925
- this.includePrerelease = !!options.includePrerelease;
926
- this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
927
- this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
928
- if (!this.set.length) {
929
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
930
- }
931
- if (this.set.length > 1) {
932
- const first = this.set[0];
933
- this.set = this.set.filter((c) => !isNullSet(c[0]));
934
- if (this.set.length === 0) {
935
- this.set = [first];
936
- } else if (this.set.length > 1) {
937
- for (const c of this.set) {
938
- if (c.length === 1 && isAny(c[0])) {
939
- this.set = [c];
940
- break;
941
- }
942
- }
943
- }
944
- }
945
- this.formatted = void 0;
946
- }
947
- get range() {
948
- if (this.formatted === void 0) {
949
- this.formatted = "";
950
- for (let i = 0; i < this.set.length; i++) {
951
- if (i > 0) {
952
- this.formatted += "||";
953
- }
954
- const comps = this.set[i];
955
- for (let k = 0; k < comps.length; k++) {
956
- if (k > 0) {
957
- this.formatted += " ";
958
- }
959
- this.formatted += comps[k].toString().trim();
960
- }
961
- }
962
- }
963
- return this.formatted;
964
- }
965
- format() {
966
- return this.range;
967
- }
968
- toString() {
969
- return this.range;
970
- }
971
- parseRange(range) {
972
- const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
973
- const memoKey = memoOpts + ":" + range;
974
- const cached = cache.get(memoKey);
975
- if (cached) {
976
- return cached;
977
- }
978
- const loose = this.options.loose;
979
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
980
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
981
- debug("hyphen replace", range);
982
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
983
- debug("comparator trim", range);
984
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
985
- debug("tilde trim", range);
986
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
987
- debug("caret trim", range);
988
- let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
989
- if (loose) {
990
- rangeList = rangeList.filter((comp) => {
991
- debug("loose invalid filter", comp, this.options);
992
- return !!comp.match(re[t.COMPARATORLOOSE]);
993
- });
994
- }
995
- debug("range list", rangeList);
996
- const rangeMap = /* @__PURE__ */ new Map();
997
- const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
998
- for (const comp of comparators) {
999
- if (isNullSet(comp)) {
1000
- return [comp];
1001
- }
1002
- rangeMap.set(comp.value, comp);
1003
- }
1004
- if (rangeMap.size > 1 && rangeMap.has("")) {
1005
- rangeMap.delete("");
1006
- }
1007
- const result2 = [...rangeMap.values()];
1008
- cache.set(memoKey, result2);
1009
- return result2;
1010
- }
1011
- intersects(range, options) {
1012
- if (!(range instanceof _Range)) {
1013
- throw new TypeError("a Range is required");
1014
- }
1015
- return this.set.some((thisComparators) => {
1016
- return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
1017
- return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
1018
- return rangeComparators.every((rangeComparator) => {
1019
- return thisComparator.intersects(rangeComparator, options);
1020
- });
1021
- });
1022
- });
1023
- });
1024
- }
1025
- // if ANY of the sets match ALL of its comparators, then pass
1026
- test(version) {
1027
- if (!version) {
1028
- return false;
1029
- }
1030
- if (typeof version === "string") {
1031
- try {
1032
- version = new SemVer(version, this.options);
1033
- } catch (er) {
1034
- return false;
1035
- }
1036
- }
1037
- for (let i = 0; i < this.set.length; i++) {
1038
- if (testSet(this.set[i], version, this.options)) {
1039
- return true;
1040
- }
1041
- }
1042
- return false;
1043
- }
1044
- };
1045
- module.exports = Range;
1046
- var LRU = require_lrucache();
1047
- var cache = new LRU();
1048
- var parseOptions = require_parse_options();
1049
- var Comparator = require_comparator();
1050
- var debug = require_debug();
1051
- var SemVer = require_semver();
1052
- var {
1053
- safeRe: re,
1054
- t,
1055
- comparatorTrimReplace,
1056
- tildeTrimReplace,
1057
- caretTrimReplace
1058
- } = require_re();
1059
- var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1060
- var isNullSet = (c) => c.value === "<0.0.0-0";
1061
- var isAny = (c) => c.value === "";
1062
- var isSatisfiable = (comparators, options) => {
1063
- let result2 = true;
1064
- const remainingComparators = comparators.slice();
1065
- let testComparator = remainingComparators.pop();
1066
- while (result2 && remainingComparators.length) {
1067
- result2 = remainingComparators.every((otherComparator) => {
1068
- return testComparator.intersects(otherComparator, options);
1069
- });
1070
- testComparator = remainingComparators.pop();
1071
- }
1072
- return result2;
1073
- };
1074
- var parseComparator = (comp, options) => {
1075
- comp = comp.replace(re[t.BUILD], "");
1076
- debug("comp", comp, options);
1077
- comp = replaceCarets(comp, options);
1078
- debug("caret", comp);
1079
- comp = replaceTildes(comp, options);
1080
- debug("tildes", comp);
1081
- comp = replaceXRanges(comp, options);
1082
- debug("xrange", comp);
1083
- comp = replaceStars(comp, options);
1084
- debug("stars", comp);
1085
- return comp;
1086
- };
1087
- var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1088
- var replaceTildes = (comp, options) => {
1089
- return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1090
- };
1091
- var replaceTilde = (comp, options) => {
1092
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1093
- return comp.replace(r, (_, M, m, p, pr) => {
1094
- debug("tilde", comp, _, M, m, p, pr);
1095
- let ret;
1096
- if (isX(M)) {
1097
- ret = "";
1098
- } else if (isX(m)) {
1099
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
1100
- } else if (isX(p)) {
1101
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1102
- } else if (pr) {
1103
- debug("replaceTilde pr", pr);
1104
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1105
- } else {
1106
- ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1107
- }
1108
- debug("tilde return", ret);
1109
- return ret;
1110
- });
1111
- };
1112
- var replaceCarets = (comp, options) => {
1113
- return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1114
- };
1115
- var replaceCaret = (comp, options) => {
1116
- debug("caret", comp, options);
1117
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1118
- const z = options.includePrerelease ? "-0" : "";
1119
- return comp.replace(r, (_, M, m, p, pr) => {
1120
- debug("caret", comp, _, M, m, p, pr);
1121
- let ret;
1122
- if (isX(M)) {
1123
- ret = "";
1124
- } else if (isX(m)) {
1125
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1126
- } else if (isX(p)) {
1127
- if (M === "0") {
1128
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1129
- } else {
1130
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1131
- }
1132
- } else if (pr) {
1133
- debug("replaceCaret pr", pr);
1134
- if (M === "0") {
1135
- if (m === "0") {
1136
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1137
- } else {
1138
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1139
- }
1140
- } else {
1141
- ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1142
- }
1143
- } else {
1144
- debug("no pr");
1145
- if (M === "0") {
1146
- if (m === "0") {
1147
- ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1148
- } else {
1149
- ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1150
- }
1151
- } else {
1152
- ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1153
- }
1154
- }
1155
- debug("caret return", ret);
1156
- return ret;
1157
- });
1158
- };
1159
- var replaceXRanges = (comp, options) => {
1160
- debug("replaceXRanges", comp, options);
1161
- return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1162
- };
1163
- var replaceXRange = (comp, options) => {
1164
- comp = comp.trim();
1165
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1166
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1167
- debug("xRange", comp, ret, gtlt, M, m, p, pr);
1168
- const xM = isX(M);
1169
- const xm = xM || isX(m);
1170
- const xp = xm || isX(p);
1171
- const anyX = xp;
1172
- if (gtlt === "=" && anyX) {
1173
- gtlt = "";
1174
- }
1175
- pr = options.includePrerelease ? "-0" : "";
1176
- if (xM) {
1177
- if (gtlt === ">" || gtlt === "<") {
1178
- ret = "<0.0.0-0";
1179
- } else {
1180
- ret = "*";
1181
- }
1182
- } else if (gtlt && anyX) {
1183
- if (xm) {
1184
- m = 0;
1185
- }
1186
- p = 0;
1187
- if (gtlt === ">") {
1188
- gtlt = ">=";
1189
- if (xm) {
1190
- M = +M + 1;
1191
- m = 0;
1192
- p = 0;
1193
- } else {
1194
- m = +m + 1;
1195
- p = 0;
1196
- }
1197
- } else if (gtlt === "<=") {
1198
- gtlt = "<";
1199
- if (xm) {
1200
- M = +M + 1;
1201
- } else {
1202
- m = +m + 1;
1203
- }
1204
- }
1205
- if (gtlt === "<") {
1206
- pr = "-0";
1207
- }
1208
- ret = `${gtlt + M}.${m}.${p}${pr}`;
1209
- } else if (xm) {
1210
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1211
- } else if (xp) {
1212
- ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1213
- }
1214
- debug("xRange return", ret);
1215
- return ret;
1216
- });
1217
- };
1218
- var replaceStars = (comp, options) => {
1219
- debug("replaceStars", comp, options);
1220
- return comp.trim().replace(re[t.STAR], "");
1221
- };
1222
- var replaceGTE0 = (comp, options) => {
1223
- debug("replaceGTE0", comp, options);
1224
- return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1225
- };
1226
- var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1227
- if (isX(fM)) {
1228
- from = "";
1229
- } else if (isX(fm)) {
1230
- from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1231
- } else if (isX(fp)) {
1232
- from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1233
- } else if (fpr) {
1234
- from = `>=${from}`;
1235
- } else {
1236
- from = `>=${from}${incPr ? "-0" : ""}`;
1237
- }
1238
- if (isX(tM)) {
1239
- to = "";
1240
- } else if (isX(tm)) {
1241
- to = `<${+tM + 1}.0.0-0`;
1242
- } else if (isX(tp)) {
1243
- to = `<${tM}.${+tm + 1}.0-0`;
1244
- } else if (tpr) {
1245
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
1246
- } else if (incPr) {
1247
- to = `<${tM}.${tm}.${+tp + 1}-0`;
1248
- } else {
1249
- to = `<=${to}`;
1250
- }
1251
- return `${from} ${to}`.trim();
1252
- };
1253
- var testSet = (set, version, options) => {
1254
- for (let i = 0; i < set.length; i++) {
1255
- if (!set[i].test(version)) {
1256
- return false;
1257
- }
1258
- }
1259
- if (version.prerelease.length && !options.includePrerelease) {
1260
- for (let i = 0; i < set.length; i++) {
1261
- debug(set[i].semver);
1262
- if (set[i].semver === Comparator.ANY) {
1263
- continue;
1264
- }
1265
- if (set[i].semver.prerelease.length > 0) {
1266
- const allowed = set[i].semver;
1267
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1268
- return true;
1269
- }
1270
- }
1271
- }
1272
- return false;
1273
- }
1274
- return true;
1275
- };
1276
- }
1277
- });
1278
-
1279
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
1280
- var require_comparator = __commonJS({
1281
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js"(exports, module) {
1282
- "use strict";
1283
- var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
1284
- var Comparator = class _Comparator {
1285
- static get ANY() {
1286
- return ANY;
1287
- }
1288
- constructor(comp, options) {
1289
- options = parseOptions(options);
1290
- if (comp instanceof _Comparator) {
1291
- if (comp.loose === !!options.loose) {
1292
- return comp;
1293
- } else {
1294
- comp = comp.value;
1295
- }
1296
- }
1297
- comp = comp.trim().split(/\s+/).join(" ");
1298
- debug("comparator", comp, options);
1299
- this.options = options;
1300
- this.loose = !!options.loose;
1301
- this.parse(comp);
1302
- if (this.semver === ANY) {
1303
- this.value = "";
1304
- } else {
1305
- this.value = this.operator + this.semver.version;
1306
- }
1307
- debug("comp", this);
1308
- }
1309
- parse(comp) {
1310
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1311
- const m = comp.match(r);
1312
- if (!m) {
1313
- throw new TypeError(`Invalid comparator: ${comp}`);
1314
- }
1315
- this.operator = m[1] !== void 0 ? m[1] : "";
1316
- if (this.operator === "=") {
1317
- this.operator = "";
1318
- }
1319
- if (!m[2]) {
1320
- this.semver = ANY;
1321
- } else {
1322
- this.semver = new SemVer(m[2], this.options.loose);
1323
- }
1324
- }
1325
- toString() {
1326
- return this.value;
1327
- }
1328
- test(version) {
1329
- debug("Comparator.test", version, this.options.loose);
1330
- if (this.semver === ANY || version === ANY) {
1331
- return true;
1332
- }
1333
- if (typeof version === "string") {
1334
- try {
1335
- version = new SemVer(version, this.options);
1336
- } catch (er) {
1337
- return false;
1338
- }
1339
- }
1340
- return cmp(version, this.operator, this.semver, this.options);
1341
- }
1342
- intersects(comp, options) {
1343
- if (!(comp instanceof _Comparator)) {
1344
- throw new TypeError("a Comparator is required");
1345
- }
1346
- if (this.operator === "") {
1347
- if (this.value === "") {
1348
- return true;
1349
- }
1350
- return new Range(comp.value, options).test(this.value);
1351
- } else if (comp.operator === "") {
1352
- if (comp.value === "") {
1353
- return true;
1354
- }
1355
- return new Range(this.value, options).test(comp.semver);
1356
- }
1357
- options = parseOptions(options);
1358
- if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1359
- return false;
1360
- }
1361
- if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1362
- return false;
1363
- }
1364
- if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1365
- return true;
1366
- }
1367
- if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1368
- return true;
1369
- }
1370
- if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1371
- return true;
1372
- }
1373
- if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1374
- return true;
1375
- }
1376
- if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1377
- return true;
1378
- }
1379
- return false;
1380
- }
1381
- };
1382
- module.exports = Comparator;
1383
- var parseOptions = require_parse_options();
1384
- var { safeRe: re, t } = require_re();
1385
- var cmp = require_cmp();
1386
- var debug = require_debug();
1387
- var SemVer = require_semver();
1388
- var Range = require_range();
1389
- }
1390
- });
1391
-
1392
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
1393
- var require_satisfies = __commonJS({
1394
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(exports, module) {
1395
- "use strict";
1396
- var Range = require_range();
1397
- var satisfies2 = (version, range, options) => {
1398
- try {
1399
- range = new Range(range, options);
1400
- } catch (er) {
1401
- return false;
1402
- }
1403
- return range.test(version);
1404
- };
1405
- module.exports = satisfies2;
1406
- }
1407
- });
1408
-
1409
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
1410
- var require_to_comparators = __commonJS({
1411
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(exports, module) {
1412
- "use strict";
1413
- var Range = require_range();
1414
- var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1415
- module.exports = toComparators;
1416
- }
1417
- });
1418
-
1419
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
1420
- var require_max_satisfying = __commonJS({
1421
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1422
- "use strict";
1423
- var SemVer = require_semver();
1424
- var Range = require_range();
1425
- var maxSatisfying = (versions, range, options) => {
1426
- let max = null;
1427
- let maxSV = null;
1428
- let rangeObj = null;
1429
- try {
1430
- rangeObj = new Range(range, options);
1431
- } catch (er) {
1432
- return null;
1433
- }
1434
- versions.forEach((v) => {
1435
- if (rangeObj.test(v)) {
1436
- if (!max || maxSV.compare(v) === -1) {
1437
- max = v;
1438
- maxSV = new SemVer(max, options);
1439
- }
1440
- }
1441
- });
1442
- return max;
1443
- };
1444
- module.exports = maxSatisfying;
1445
- }
1446
- });
1447
-
1448
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
1449
- var require_min_satisfying = __commonJS({
1450
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1451
- "use strict";
1452
- var SemVer = require_semver();
1453
- var Range = require_range();
1454
- var minSatisfying = (versions, range, options) => {
1455
- let min = null;
1456
- let minSV = null;
1457
- let rangeObj = null;
1458
- try {
1459
- rangeObj = new Range(range, options);
1460
- } catch (er) {
1461
- return null;
1462
- }
1463
- versions.forEach((v) => {
1464
- if (rangeObj.test(v)) {
1465
- if (!min || minSV.compare(v) === 1) {
1466
- min = v;
1467
- minSV = new SemVer(min, options);
1468
- }
1469
- }
1470
- });
1471
- return min;
1472
- };
1473
- module.exports = minSatisfying;
1474
- }
1475
- });
1476
-
1477
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
1478
- var require_min_version = __commonJS({
1479
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js"(exports, module) {
1480
- "use strict";
1481
- var SemVer = require_semver();
1482
- var Range = require_range();
1483
- var gt = require_gt();
1484
- var minVersion = (range, loose) => {
1485
- range = new Range(range, loose);
1486
- let minver = new SemVer("0.0.0");
1487
- if (range.test(minver)) {
1488
- return minver;
1489
- }
1490
- minver = new SemVer("0.0.0-0");
1491
- if (range.test(minver)) {
1492
- return minver;
1493
- }
1494
- minver = null;
1495
- for (let i = 0; i < range.set.length; ++i) {
1496
- const comparators = range.set[i];
1497
- let setMin = null;
1498
- comparators.forEach((comparator) => {
1499
- const compver = new SemVer(comparator.semver.version);
1500
- switch (comparator.operator) {
1501
- case ">":
1502
- if (compver.prerelease.length === 0) {
1503
- compver.patch++;
1504
- } else {
1505
- compver.prerelease.push(0);
1506
- }
1507
- compver.raw = compver.format();
1508
- /* fallthrough */
1509
- case "":
1510
- case ">=":
1511
- if (!setMin || gt(compver, setMin)) {
1512
- setMin = compver;
1513
- }
1514
- break;
1515
- case "<":
1516
- case "<=":
1517
- break;
1518
- /* istanbul ignore next */
1519
- default:
1520
- throw new Error(`Unexpected operation: ${comparator.operator}`);
1521
- }
1522
- });
1523
- if (setMin && (!minver || gt(minver, setMin))) {
1524
- minver = setMin;
1525
- }
1526
- }
1527
- if (minver && range.test(minver)) {
1528
- return minver;
1529
- }
1530
- return null;
1531
- };
1532
- module.exports = minVersion;
1533
- }
1534
- });
1535
-
1536
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
1537
- var require_valid2 = __commonJS({
1538
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js"(exports, module) {
1539
- "use strict";
1540
- var Range = require_range();
1541
- var validRange2 = (range, options) => {
1542
- try {
1543
- return new Range(range, options).range || "*";
1544
- } catch (er) {
1545
- return null;
1546
- }
1547
- };
1548
- module.exports = validRange2;
1549
- }
1550
- });
1551
-
1552
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
1553
- var require_outside = __commonJS({
1554
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js"(exports, module) {
1555
- "use strict";
1556
- var SemVer = require_semver();
1557
- var Comparator = require_comparator();
1558
- var { ANY } = Comparator;
1559
- var Range = require_range();
1560
- var satisfies2 = require_satisfies();
1561
- var gt = require_gt();
1562
- var lt = require_lt();
1563
- var lte = require_lte();
1564
- var gte = require_gte();
1565
- var outside = (version, range, hilo, options) => {
1566
- version = new SemVer(version, options);
1567
- range = new Range(range, options);
1568
- let gtfn, ltefn, ltfn, comp, ecomp;
1569
- switch (hilo) {
1570
- case ">":
1571
- gtfn = gt;
1572
- ltefn = lte;
1573
- ltfn = lt;
1574
- comp = ">";
1575
- ecomp = ">=";
1576
- break;
1577
- case "<":
1578
- gtfn = lt;
1579
- ltefn = gte;
1580
- ltfn = gt;
1581
- comp = "<";
1582
- ecomp = "<=";
1583
- break;
1584
- default:
1585
- throw new TypeError('Must provide a hilo val of "<" or ">"');
1586
- }
1587
- if (satisfies2(version, range, options)) {
1588
- return false;
1589
- }
1590
- for (let i = 0; i < range.set.length; ++i) {
1591
- const comparators = range.set[i];
1592
- let high = null;
1593
- let low = null;
1594
- comparators.forEach((comparator) => {
1595
- if (comparator.semver === ANY) {
1596
- comparator = new Comparator(">=0.0.0");
1597
- }
1598
- high = high || comparator;
1599
- low = low || comparator;
1600
- if (gtfn(comparator.semver, high.semver, options)) {
1601
- high = comparator;
1602
- } else if (ltfn(comparator.semver, low.semver, options)) {
1603
- low = comparator;
1604
- }
1605
- });
1606
- if (high.operator === comp || high.operator === ecomp) {
1607
- return false;
1608
- }
1609
- if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1610
- return false;
1611
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1612
- return false;
1613
- }
1614
- }
1615
- return true;
1616
- };
1617
- module.exports = outside;
1618
- }
1619
- });
1620
-
1621
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
1622
- var require_gtr = __commonJS({
1623
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js"(exports, module) {
1624
- "use strict";
1625
- var outside = require_outside();
1626
- var gtr = (version, range, options) => outside(version, range, ">", options);
1627
- module.exports = gtr;
1628
- }
1629
- });
1630
-
1631
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
1632
- var require_ltr = __commonJS({
1633
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js"(exports, module) {
1634
- "use strict";
1635
- var outside = require_outside();
1636
- var ltr = (version, range, options) => outside(version, range, "<", options);
1637
- module.exports = ltr;
1638
- }
1639
- });
1640
-
1641
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
1642
- var require_intersects = __commonJS({
1643
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js"(exports, module) {
1644
- "use strict";
1645
- var Range = require_range();
1646
- var intersects = (r1, r2, options) => {
1647
- r1 = new Range(r1, options);
1648
- r2 = new Range(r2, options);
1649
- return r1.intersects(r2, options);
1650
- };
1651
- module.exports = intersects;
1652
- }
1653
- });
1654
-
1655
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
1656
- var require_simplify = __commonJS({
1657
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js"(exports, module) {
1658
- "use strict";
1659
- var satisfies2 = require_satisfies();
1660
- var compare = require_compare();
1661
- module.exports = (versions, range, options) => {
1662
- const set = [];
1663
- let first = null;
1664
- let prev = null;
1665
- const v = versions.sort((a, b) => compare(a, b, options));
1666
- for (const version of v) {
1667
- const included = satisfies2(version, range, options);
1668
- if (included) {
1669
- prev = version;
1670
- if (!first) {
1671
- first = version;
1672
- }
1673
- } else {
1674
- if (prev) {
1675
- set.push([first, prev]);
1676
- }
1677
- prev = null;
1678
- first = null;
1679
- }
1680
- }
1681
- if (first) {
1682
- set.push([first, null]);
1683
- }
1684
- const ranges = [];
1685
- for (const [min, max] of set) {
1686
- if (min === max) {
1687
- ranges.push(min);
1688
- } else if (!max && min === v[0]) {
1689
- ranges.push("*");
1690
- } else if (!max) {
1691
- ranges.push(`>=${min}`);
1692
- } else if (min === v[0]) {
1693
- ranges.push(`<=${max}`);
1694
- } else {
1695
- ranges.push(`${min} - ${max}`);
1696
- }
1697
- }
1698
- const simplified = ranges.join(" || ");
1699
- const original = typeof range.raw === "string" ? range.raw : String(range);
1700
- return simplified.length < original.length ? simplified : range;
1701
- };
1702
- }
1703
- });
1704
-
1705
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
1706
- var require_subset = __commonJS({
1707
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js"(exports, module) {
1708
- "use strict";
1709
- var Range = require_range();
1710
- var Comparator = require_comparator();
1711
- var { ANY } = Comparator;
1712
- var satisfies2 = require_satisfies();
1713
- var compare = require_compare();
1714
- var subset = (sub, dom, options = {}) => {
1715
- if (sub === dom) {
1716
- return true;
1717
- }
1718
- sub = new Range(sub, options);
1719
- dom = new Range(dom, options);
1720
- let sawNonNull = false;
1721
- OUTER: for (const simpleSub of sub.set) {
1722
- for (const simpleDom of dom.set) {
1723
- const isSub = simpleSubset(simpleSub, simpleDom, options);
1724
- sawNonNull = sawNonNull || isSub !== null;
1725
- if (isSub) {
1726
- continue OUTER;
1727
- }
1728
- }
1729
- if (sawNonNull) {
1730
- return false;
1731
- }
1732
- }
1733
- return true;
1734
- };
1735
- var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1736
- var minimumVersion = [new Comparator(">=0.0.0")];
1737
- var simpleSubset = (sub, dom, options) => {
1738
- if (sub === dom) {
1739
- return true;
1740
- }
1741
- if (sub.length === 1 && sub[0].semver === ANY) {
1742
- if (dom.length === 1 && dom[0].semver === ANY) {
1743
- return true;
1744
- } else if (options.includePrerelease) {
1745
- sub = minimumVersionWithPreRelease;
1746
- } else {
1747
- sub = minimumVersion;
1748
- }
1749
- }
1750
- if (dom.length === 1 && dom[0].semver === ANY) {
1751
- if (options.includePrerelease) {
1752
- return true;
1753
- } else {
1754
- dom = minimumVersion;
1755
- }
1756
- }
1757
- const eqSet = /* @__PURE__ */ new Set();
1758
- let gt, lt;
1759
- for (const c of sub) {
1760
- if (c.operator === ">" || c.operator === ">=") {
1761
- gt = higherGT(gt, c, options);
1762
- } else if (c.operator === "<" || c.operator === "<=") {
1763
- lt = lowerLT(lt, c, options);
1764
- } else {
1765
- eqSet.add(c.semver);
1766
- }
1767
- }
1768
- if (eqSet.size > 1) {
1769
- return null;
1770
- }
1771
- let gtltComp;
1772
- if (gt && lt) {
1773
- gtltComp = compare(gt.semver, lt.semver, options);
1774
- if (gtltComp > 0) {
1775
- return null;
1776
- } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1777
- return null;
1778
- }
1779
- }
1780
- for (const eq of eqSet) {
1781
- if (gt && !satisfies2(eq, String(gt), options)) {
1782
- return null;
1783
- }
1784
- if (lt && !satisfies2(eq, String(lt), options)) {
1785
- return null;
1786
- }
1787
- for (const c of dom) {
1788
- if (!satisfies2(eq, String(c), options)) {
1789
- return false;
1790
- }
1791
- }
1792
- return true;
1793
- }
1794
- let higher, lower;
1795
- let hasDomLT, hasDomGT;
1796
- let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1797
- let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1798
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1799
- needDomLTPre = false;
1800
- }
1801
- for (const c of dom) {
1802
- hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1803
- hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1804
- if (gt) {
1805
- if (needDomGTPre) {
1806
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1807
- needDomGTPre = false;
1808
- }
1809
- }
1810
- if (c.operator === ">" || c.operator === ">=") {
1811
- higher = higherGT(gt, c, options);
1812
- if (higher === c && higher !== gt) {
1813
- return false;
1814
- }
1815
- } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) {
1816
- return false;
1817
- }
1818
- }
1819
- if (lt) {
1820
- if (needDomLTPre) {
1821
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1822
- needDomLTPre = false;
1823
- }
1824
- }
1825
- if (c.operator === "<" || c.operator === "<=") {
1826
- lower = lowerLT(lt, c, options);
1827
- if (lower === c && lower !== lt) {
1828
- return false;
1829
- }
1830
- } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) {
1831
- return false;
1832
- }
1833
- }
1834
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
1835
- return false;
1836
- }
1837
- }
1838
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
1839
- return false;
1840
- }
1841
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
1842
- return false;
1843
- }
1844
- if (needDomGTPre || needDomLTPre) {
1845
- return false;
1846
- }
1847
- return true;
1848
- };
1849
- var higherGT = (a, b, options) => {
1850
- if (!a) {
1851
- return b;
1852
- }
1853
- const comp = compare(a.semver, b.semver, options);
1854
- return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1855
- };
1856
- var lowerLT = (a, b, options) => {
1857
- if (!a) {
1858
- return b;
1859
- }
1860
- const comp = compare(a.semver, b.semver, options);
1861
- return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1862
- };
1863
- module.exports = subset;
1864
- }
1865
- });
1866
-
1867
- // ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js
1868
- var require_semver2 = __commonJS({
1869
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(exports, module) {
1870
- "use strict";
1871
- var internalRe = require_re();
1872
- var constants3 = require_constants();
1873
- var SemVer = require_semver();
1874
- var identifiers = require_identifiers();
1875
- var parse = require_parse();
1876
- var valid2 = require_valid();
1877
- var clean = require_clean();
1878
- var inc2 = require_inc();
1879
- var diff = require_diff();
1880
- var major = require_major();
1881
- var minor = require_minor();
1882
- var patch = require_patch();
1883
- var prerelease = require_prerelease();
1884
- var compare = require_compare();
1885
- var rcompare2 = require_rcompare();
1886
- var compareLoose = require_compare_loose();
1887
- var compareBuild = require_compare_build();
1888
- var sort = require_sort();
1889
- var rsort = require_rsort();
1890
- var gt = require_gt();
1891
- var lt = require_lt();
1892
- var eq = require_eq();
1893
- var neq = require_neq();
1894
- var gte = require_gte();
1895
- var lte = require_lte();
1896
- var cmp = require_cmp();
1897
- var coerce = require_coerce();
1898
- var Comparator = require_comparator();
1899
- var Range = require_range();
1900
- var satisfies2 = require_satisfies();
1901
- var toComparators = require_to_comparators();
1902
- var maxSatisfying = require_max_satisfying();
1903
- var minSatisfying = require_min_satisfying();
1904
- var minVersion = require_min_version();
1905
- var validRange2 = require_valid2();
1906
- var outside = require_outside();
1907
- var gtr = require_gtr();
1908
- var ltr = require_ltr();
1909
- var intersects = require_intersects();
1910
- var simplifyRange = require_simplify();
1911
- var subset = require_subset();
1912
- module.exports = {
1913
- parse,
1914
- valid: valid2,
1915
- clean,
1916
- inc: inc2,
1917
- diff,
1918
- major,
1919
- minor,
1920
- patch,
1921
- prerelease,
1922
- compare,
1923
- rcompare: rcompare2,
1924
- compareLoose,
1925
- compareBuild,
1926
- sort,
1927
- rsort,
1928
- gt,
1929
- lt,
1930
- eq,
1931
- neq,
1932
- gte,
1933
- lte,
1934
- cmp,
1935
- coerce,
1936
- Comparator,
1937
- Range,
1938
- satisfies: satisfies2,
1939
- toComparators,
1940
- maxSatisfying,
1941
- minSatisfying,
1942
- minVersion,
1943
- validRange: validRange2,
1944
- outside,
1945
- gtr,
1946
- ltr,
1947
- intersects,
1948
- simplifyRange,
1949
- subset,
1950
- SemVer,
1951
- re: internalRe.re,
1952
- src: internalRe.src,
1953
- tokens: internalRe.t,
1954
- SEMVER_SPEC_VERSION: constants3.SEMVER_SPEC_VERSION,
1955
- RELEASE_TYPES: constants3.RELEASE_TYPES,
1956
- compareIdentifiers: identifiers.compareIdentifiers,
1957
- rcompareIdentifiers: identifiers.rcompareIdentifiers
1958
- };
1959
- }
1960
- });
1961
2
 
1962
3
  // ../dev-console/src/brand.mjs
1963
4
  var MARK = [
@@ -2650,6 +691,17 @@ var module_spec_schema_default = {
2650
691
  type: "array",
2651
692
  items: { $ref: "#/$defs/decision" },
2652
693
  uniqueItems: true
694
+ },
695
+ research: { $ref: "#/$defs/research" },
696
+ adapters: {
697
+ type: "array",
698
+ items: { $ref: "#/$defs/adapter" },
699
+ uniqueItems: true
700
+ },
701
+ templates: {
702
+ type: "array",
703
+ items: { $ref: "#/$defs/template" },
704
+ uniqueItems: true
2653
705
  }
2654
706
  },
2655
707
  allOf: [
@@ -2667,7 +719,10 @@ var module_spec_schema_default = {
2667
719
  settings: false,
2668
720
  agentTools: false,
2669
721
  outOfScope: false,
2670
- decisions: false
722
+ decisions: false,
723
+ research: false,
724
+ adapters: false,
725
+ templates: false
2671
726
  }
2672
727
  }
2673
728
  }
@@ -2873,6 +928,113 @@ var module_spec_schema_default = {
2873
928
  answer: { type: "string", minLength: 1 },
2874
929
  decidedBy: { enum: ["user", "default"] }
2875
930
  }
931
+ },
932
+ domain: {
933
+ type: "string",
934
+ maxLength: 253,
935
+ pattern: "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
936
+ },
937
+ research: {
938
+ type: "object",
939
+ additionalProperties: false,
940
+ required: ["adapter", "evidenceOwner"],
941
+ properties: {
942
+ adapter: {
943
+ enum: [
944
+ "model-native",
945
+ "searxng",
946
+ "firecrawl",
947
+ "connector",
948
+ "recorded"
949
+ ]
950
+ },
951
+ allowDomains: {
952
+ type: "array",
953
+ items: { $ref: "#/$defs/domain" },
954
+ uniqueItems: true
955
+ },
956
+ denyDomains: {
957
+ type: "array",
958
+ items: { $ref: "#/$defs/domain" },
959
+ uniqueItems: true
960
+ },
961
+ monthlyQueryBudget: { type: "integer", minimum: 1 },
962
+ evidenceOwner: { $ref: "#/$defs/entityId" }
963
+ }
964
+ },
965
+ adapter: {
966
+ type: "object",
967
+ additionalProperties: false,
968
+ required: [
969
+ "id",
970
+ "direction",
971
+ "connector",
972
+ "operation",
973
+ "port",
974
+ "mapping"
975
+ ],
976
+ properties: {
977
+ id: {
978
+ type: "string",
979
+ pattern: "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
980
+ },
981
+ direction: { enum: ["source", "sink"] },
982
+ connector: { type: "string", pattern: "^[a-z][a-z0-9-]{0,95}$" },
983
+ operation: { type: "string", pattern: "^[a-z][a-z0-9-]{0,63}$" },
984
+ port: {
985
+ type: "string",
986
+ maxLength: 96,
987
+ pattern: "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
988
+ },
989
+ schedule: {
990
+ anyOf: [
991
+ { type: "null" },
992
+ {
993
+ type: "string",
994
+ maxLength: 100,
995
+ pattern: "^[0-9a-z*,/-]+( [0-9a-z*,/-]+){4}$"
996
+ }
997
+ ]
998
+ },
999
+ mapping: {
1000
+ type: "array",
1001
+ minItems: 1,
1002
+ items: { $ref: "#/$defs/adapterMapping" },
1003
+ uniqueItems: true
1004
+ },
1005
+ recorded: {
1006
+ type: "string",
1007
+ pattern: "^adapters/[a-z0-9][a-z0-9-]*\\.recorded\\.json$"
1008
+ }
1009
+ }
1010
+ },
1011
+ adapterMapping: {
1012
+ type: "object",
1013
+ additionalProperties: false,
1014
+ required: ["to", "transform"],
1015
+ properties: {
1016
+ from: { type: "string", minLength: 1 },
1017
+ to: { type: "string", minLength: 1 },
1018
+ transform: { enum: ["rename", "constant", "format", "lookup"] },
1019
+ value: {
1020
+ anyOf: [{ type: "null" }, { type: "string", minLength: 1 }]
1021
+ }
1022
+ }
1023
+ },
1024
+ template: {
1025
+ type: "object",
1026
+ additionalProperties: false,
1027
+ required: ["id", "title", "inputEntity", "format", "body"],
1028
+ properties: {
1029
+ id: { $ref: "#/$defs/entityId" },
1030
+ title: { type: "string", minLength: 1 },
1031
+ inputEntity: { $ref: "#/$defs/entityId" },
1032
+ format: { enum: ["pdf", "docx"] },
1033
+ body: {
1034
+ type: "string",
1035
+ pattern: "^templates/[a-z][a-z0-9-]*\\.md$"
1036
+ }
1037
+ }
2876
1038
  }
2877
1039
  }
2878
1040
  };
@@ -3039,6 +1201,15 @@ var project_schema_default = {
3039
1201
  $ref: "#/$defs/githubAccount"
3040
1202
  },
3041
1203
  uniqueItems: true
1204
+ },
1205
+ labels: {
1206
+ type: "array",
1207
+ maxItems: 10,
1208
+ items: {
1209
+ type: "string",
1210
+ pattern: "^[A-Za-z0-9][A-Za-z0-9 ._:-]{0,49}$"
1211
+ },
1212
+ uniqueItems: true
3042
1213
  }
3043
1214
  }
3044
1215
  },
@@ -3286,8 +1457,83 @@ var projectSchema = project_schema_default;
3286
1457
  var moduleCatalogSchema = module_catalog_schema_default;
3287
1458
  var moduleArtifactSchema = module_artifact_schema_default;
3288
1459
 
1460
+ // ../contracts/src/translations.ts
1461
+ var PLURAL_CATEGORIES = [
1462
+ "zero",
1463
+ "one",
1464
+ "two",
1465
+ "few",
1466
+ "many",
1467
+ "other"
1468
+ ];
1469
+ var WHOLE_NUMBER_SAMPLES = [
1470
+ ...Array.from({ length: 200 }, (_, index) => index),
1471
+ 1e3,
1472
+ 1e4,
1473
+ 1e5,
1474
+ 1e6,
1475
+ 1e7,
1476
+ 1e8,
1477
+ 1e9
1478
+ ];
1479
+ function requiredPluralCategories(locale) {
1480
+ const rules = new Intl.PluralRules(locale);
1481
+ const selected = /* @__PURE__ */ new Set(["other"]);
1482
+ for (const sample of WHOLE_NUMBER_SAMPLES) selected.add(rules.select(sample));
1483
+ return PLURAL_CATEGORIES.filter((category) => selected.has(category));
1484
+ }
1485
+ function pluralMember(bundle, key) {
1486
+ const dot = key.lastIndexOf(".");
1487
+ if (dot <= 0) return null;
1488
+ const category = key.slice(dot + 1);
1489
+ if (!PLURAL_CATEGORIES.includes(category)) return null;
1490
+ const base = key.slice(0, dot);
1491
+ if (!Object.hasOwn(bundle, base + ".other")) return null;
1492
+ const inflected = PLURAL_CATEGORIES.some(
1493
+ (other) => other !== "other" && Object.hasOwn(bundle, base + "." + other)
1494
+ );
1495
+ return inflected ? { base, category } : null;
1496
+ }
1497
+ function translationKeys(bundle) {
1498
+ const keys = /* @__PURE__ */ new Set();
1499
+ for (const key of Object.keys(bundle)) {
1500
+ keys.add(pluralMember(bundle, key)?.base ?? key);
1501
+ }
1502
+ return [...keys].sort();
1503
+ }
1504
+ function pluralFamilyIssues(bundle, locale) {
1505
+ const families = /* @__PURE__ */ new Map();
1506
+ for (const key of Object.keys(bundle)) {
1507
+ const member = pluralMember(bundle, key);
1508
+ if (member === null) continue;
1509
+ const categories = families.get(member.base) ?? /* @__PURE__ */ new Set();
1510
+ categories.add(member.category);
1511
+ families.set(member.base, categories);
1512
+ }
1513
+ const required = requiredPluralCategories(locale);
1514
+ const known = new Intl.PluralRules(
1515
+ locale
1516
+ ).resolvedOptions().pluralCategories;
1517
+ const issues = [];
1518
+ for (const base of [...families.keys()].sort()) {
1519
+ const categories = families.get(base);
1520
+ const missing = required.filter((category) => !categories.has(category));
1521
+ if (missing.length > 0) {
1522
+ issues.push(
1523
+ `${base} lacks ${missing.map((category) => base + "." + category).join(", ")} for ${locale}`
1524
+ );
1525
+ }
1526
+ for (const category of categories) {
1527
+ if (!known.includes(category)) {
1528
+ issues.push(`${base}.${category} is never selected for ${locale}`);
1529
+ }
1530
+ }
1531
+ }
1532
+ return issues;
1533
+ }
1534
+
3289
1535
  // ../contracts/src/index.ts
3290
- var PLATFORM_API_VERSION = "0.1.9";
1536
+ var PLATFORM_API_VERSION = "0.1.22";
3291
1537
 
3292
1538
  // src/module-templates.ts
3293
1539
  function packageSuffix(id) {
@@ -3687,6 +1933,7 @@ function packageJson(model) {
3687
1933
  "migrations",
3688
1934
  "translations",
3689
1935
  "spec",
1936
+ ...spec.templates?.length ? ["templates"] : [],
3690
1937
  "README.md"
3691
1938
  ],
3692
1939
  scripts: {
@@ -4530,34 +2777,76 @@ export function create${names.pascal}ClientState() {
4530
2777
  }
4531
2778
  `;
4532
2779
  }
4533
- function columnWidth(index, count) {
4534
- if (count < 2) return "100%";
4535
- const rest = Math.max(1, Math.floor(35 / (count - 1)));
4536
- return index === 0 ? `${Math.max(1, 100 - rest * (count - 1))}%` : `${rest}%`;
4537
- }
4538
- function cellValue(field, namespace) {
2780
+ function scaffoldCell(field, namespace, index) {
4539
2781
  const access7 = `record.${field.id}`;
4540
- if (field.type === "enum") {
4541
- const label2 = `t('${namespace}.${field.id}.' + ${access7})`;
4542
- return field.required ? label2 : `${access7} === null ? '' : ${label2}`;
4543
- }
4544
- if (field.type === "json") return `JSON.stringify(${access7})`;
4545
- if (field.type === "integer" || field.type === "boolean") {
4546
- return field.required ? `String(${access7})` : `${access7} === null ? '' : String(${access7})`;
2782
+ const identity = index === 0;
2783
+ const priority = identity || field.state ? 1 : 2;
2784
+ const cell = (component, props, width, fieldPriority = priority, numeric = false) => ({
2785
+ component,
2786
+ markup: `<${component} ${props} />`,
2787
+ width: identity ? "auto" : width,
2788
+ priority: identity ? 1 : fieldPriority,
2789
+ numeric
2790
+ });
2791
+ switch (field.type) {
2792
+ case "enum":
2793
+ return cell(
2794
+ "CellTag",
2795
+ `label={t('${namespace}.${field.id}.' + ${access7})}` + (field.state ? " dot" : ""),
2796
+ "140px"
2797
+ );
2798
+ case "integer":
2799
+ case "decimal":
2800
+ return cell("CellNumber", `value={${access7}}`, "120px", priority, true);
2801
+ case "boolean":
2802
+ return cell("CellText", `value={String(${access7})}`, "100px");
2803
+ case "date":
2804
+ return cell("CellTime", `value={${access7}} kind="date"`, "140px");
2805
+ case "datetime":
2806
+ return cell("CellTime", `value={${access7}}`, "170px");
2807
+ case "reference":
2808
+ return cell("CellCode", `value={${access7}}`, "160px", 3);
2809
+ case "json":
2810
+ return cell(
2811
+ "CellText",
2812
+ `value={JSON.stringify(${access7})} mono`,
2813
+ "200px",
2814
+ 3
2815
+ );
2816
+ case "text":
2817
+ return cell("CellText", `value={${access7}} wrap muted`, "240px", 3);
2818
+ default:
2819
+ return cell(
2820
+ "CellText",
2821
+ `value={${access7}}` + (identity ? " strong" : ""),
2822
+ "200px"
2823
+ );
4547
2824
  }
4548
- return field.required ? access7 : `${access7} ?? ''`;
2825
+ }
2826
+ function scaffoldCells(model) {
2827
+ return model.columns.map(
2828
+ (field, index) => scaffoldCell(field, model.names.namespace, index)
2829
+ );
2830
+ }
2831
+ function cellImports(model) {
2832
+ const names = new Set(scaffoldCells(model).map((cell) => cell.component));
2833
+ if (model.columns.some((field) => !field.required)) names.add("CellMuted");
2834
+ return [...names].sort();
4549
2835
  }
4550
2836
  function tableColumns(model) {
4551
2837
  const { columns, names } = model;
2838
+ const cells = scaffoldCells(model);
4552
2839
  return columns.map((field, index) => {
4553
- const value = cellValue(field, names.namespace);
4554
- const cell = index === 0 ? `<b>{${value}}</b>` : value;
4555
- const numeric = field.type === "integer" || field.type === "decimal" ? " numeric: true,\n" : "";
2840
+ const cell = cells[index];
2841
+ const markup = field.required ? cell.markup : `record.${field.id} === null
2842
+ ? <CellMuted>{t('${names.namespace}.value.none')}</CellMuted>
2843
+ : ${cell.markup}`;
4556
2844
  return ` {
4557
2845
  key: '${field.id}',
4558
2846
  header: t('${names.namespace}.table.column.${field.id}'),
4559
- width: '${columnWidth(index, columns.length)}',
4560
- ${numeric} cell: (record) => ${cell},
2847
+ width: '${cell.width}',
2848
+ ${cell.priority > 1 ? ` priority: ${cell.priority},
2849
+ ` : ""}${cell.numeric ? " numeric: true,\n" : ""} cell: (record) => ${markup},
4561
2850
  },
4562
2851
  `;
4563
2852
  }).join("");
@@ -4592,7 +2881,8 @@ import { t } from '@flowdular/client';
4592
2881
  import {
4593
2882
  Alert,
4594
2883
  Button,
4595
- Icon,
2884
+ ${cellImports(model).map((name) => ` ${name},
2885
+ `).join("")} Icon,
4596
2886
  PageHeader,
4597
2887
  TableCard,
4598
2888
  type TableColumn,
@@ -4880,6 +3170,74 @@ export default defineCliExtension({
4880
3170
  });
4881
3171
  `;
4882
3172
  }
3173
+ function tsLiteral(value, depth) {
3174
+ if (typeof value === "string") return stringLiteral(value);
3175
+ if (value === null || typeof value !== "object") return String(value);
3176
+ const list = Array.isArray(value);
3177
+ const entries = list ? value.map((item) => tsLiteral(item, depth + 1)) : Object.entries(value).map(
3178
+ ([key, item]) => `${key}: ${tsLiteral(item, depth + 1)}`
3179
+ );
3180
+ if (entries.length === 0) return list ? "[]" : "{}";
3181
+ const indent = " ".repeat(depth + 1);
3182
+ return `${list ? "[" : "{"}
3183
+ ${entries.map((entry) => `${indent}${entry},
3184
+ `).join("")}${" ".repeat(depth)}${list ? "]" : "}"}`;
3185
+ }
3186
+ function researchFile(model, research) {
3187
+ return `import type { ModuleSpecResearch } from '@flowdular/contracts';
3188
+
3189
+ export const RESEARCH_CAPABILITIES = {
3190
+ search: 'research.search.v1',
3191
+ fetch: 'research.fetch.v1',
3192
+ evidence: 'research.evidence.v1',
3193
+ } as const;
3194
+
3195
+ export const ${model.names.constant}_RESEARCH = ${tsLiteral(research, 0)} as const satisfies ModuleSpecResearch;
3196
+ `;
3197
+ }
3198
+ function researchFixtures(research) {
3199
+ const host = research.allowDomains?.[0] ?? "example.com";
3200
+ const url = `https://${host}/example`;
3201
+ return json({
3202
+ queries: {
3203
+ example: [
3204
+ {
3205
+ url,
3206
+ title: "Example result",
3207
+ snippet: "Replace with a recorded search result.",
3208
+ source: host
3209
+ }
3210
+ ]
3211
+ },
3212
+ pages: {
3213
+ [url]: {
3214
+ title: "Example result",
3215
+ text: "Replace with the text of the recorded page."
3216
+ }
3217
+ }
3218
+ });
3219
+ }
3220
+ function recordedFixture(adapter) {
3221
+ return json({
3222
+ adapter: adapter.id,
3223
+ operation: adapter.operation,
3224
+ calls: [{ input: {}, body: {} }]
3225
+ });
3226
+ }
3227
+ function adapterFile(name, adapter) {
3228
+ const constant = name.replace(/-/g, "_").toUpperCase();
3229
+ return `import type { ModuleSpecAdapter } from '@flowdular/contracts';
3230
+
3231
+ export const ${constant}_ADAPTER = ${tsLiteral(adapter, 0)} as const satisfies ModuleSpecAdapter;
3232
+ `;
3233
+ }
3234
+ function templateBody(spec, template) {
3235
+ const fields = (spec.entities ?? []).find((entity) => entity.id === template.inputEntity)?.fields.map((field) => field.id).join(", ");
3236
+ return `# ${template.title}
3237
+
3238
+ <!-- Rendered as ${template.format} from one ${template.inputEntity} record. Fields: ${fields}. -->
3239
+ `;
3240
+ }
4883
3241
  var POLISH_LABELS = {
4884
3242
  name: "Nazwa",
4885
3243
  status: "Status",
@@ -4914,6 +3272,7 @@ function valueLabels(model, locale) {
4914
3272
  function translation(locale, name, description, model) {
4915
3273
  const columns = columnLabels(model, locale);
4916
3274
  const values2 = valueLabels(model, locale);
3275
+ const optional = model.columns.some((field) => !field.required);
4917
3276
  if (locale === "pl") {
4918
3277
  return json({
4919
3278
  "module.name": `Modu\u0142 ${name}`,
@@ -4925,12 +3284,16 @@ function translation(locale, name, description, model) {
4925
3284
  "action.refresh": "Od\u015Bwie\u017C",
4926
3285
  "table.title": "Rekordy",
4927
3286
  "table.caption": `Rekordy modu\u0142u ${name}`,
4928
- "table.count": "Liczba rekord\xF3w: {count}",
3287
+ "table.count.one": "{count} rekord",
3288
+ "table.count.few": "{count} rekordy",
3289
+ "table.count.many": "{count} rekord\xF3w",
3290
+ "table.count.other": "{count} rekordu",
4929
3291
  ...columns,
4930
3292
  "table.loading": "Wczytywanie rekord\xF3w\u2026",
4931
3293
  "table.emptyTitle": "Brak rekord\xF3w",
4932
3294
  "table.emptyHint": "Utworzone rekordy pojawi\u0105 si\u0119 w tym miejscu.",
4933
3295
  ...values2,
3296
+ ...optional ? { "value.none": "Brak" } : {},
4934
3297
  "error.load": "Nie uda\u0142o si\u0119 wczyta\u0107 rekord\xF3w.",
4935
3298
  "error.request": "Operacja na rekordach nie powiod\u0142a si\u0119."
4936
3299
  });
@@ -4945,12 +3308,18 @@ function translation(locale, name, description, model) {
4945
3308
  "action.refresh": "Refresh",
4946
3309
  "table.title": "Records",
4947
3310
  "table.caption": `${name} records`,
4948
- "table.count": "{count} records",
3311
+ ...Object.fromEntries(
3312
+ requiredPluralCategories(locale).map((category) => [
3313
+ `table.count.${category}`,
3314
+ category === "one" ? "{count} record" : "{count} records"
3315
+ ])
3316
+ ),
4949
3317
  ...columns,
4950
3318
  "table.loading": "Loading records\u2026",
4951
3319
  "table.emptyTitle": "No records yet",
4952
3320
  "table.emptyHint": "Records created in this workspace appear here.",
4953
3321
  ...values2,
3322
+ ...optional ? { "value.none": "None" } : {},
4954
3323
  "error.load": "Could not load records.",
4955
3324
  "error.request": "The records operation failed."
4956
3325
  });
@@ -5012,6 +3381,31 @@ function planScaffold(spec, specSource) {
5012
3381
  files.set("src/cli/commands.json", cliCatalog(model));
5013
3382
  files.set("src/cli/index.ts", cliEntry(model));
5014
3383
  }
3384
+ if (spec.research) {
3385
+ files.set("src/research.ts", researchFile(model, spec.research));
3386
+ files.set("research-fixtures.json", researchFixtures(spec.research));
3387
+ }
3388
+ for (const adapter of spec.adapters ?? []) {
3389
+ const name = adapter.id.slice(spec.id.length + 1).replace(/\./g, "-");
3390
+ const paths = [
3391
+ `src/adapters/${name}.ts`,
3392
+ adapter.recorded ?? `adapters/${name}.recorded.json`
3393
+ ];
3394
+ for (const path of paths) {
3395
+ if (files.has(path)) {
3396
+ throw new Error(
3397
+ `Adapter "${adapter.id}" and another adapter both map to ${path}.`
3398
+ );
3399
+ }
3400
+ }
3401
+ files.set(paths[0], adapterFile(name, adapter));
3402
+ files.set(paths[1], recordedFixture(adapter));
3403
+ }
3404
+ for (const template of spec.templates ?? []) {
3405
+ if (!files.has(template.body)) {
3406
+ files.set(template.body, templateBody(spec, template));
3407
+ }
3408
+ }
5015
3409
  files.set("tests/module.test.ts", testFile(model));
5016
3410
  for (const locale of /* @__PURE__ */ new Set(["en", ...spec.locales])) {
5017
3411
  files.set(
@@ -5068,6 +3462,51 @@ function duplicateIssues(items, key, section) {
5068
3462
  });
5069
3463
  return issues;
5070
3464
  }
3465
+ var MONTH_NAMES = "jan feb mar apr may jun jul aug sep oct nov dec".split(
3466
+ " "
3467
+ );
3468
+ var WEEKDAY_NAMES = "sun mon tue wed thu fri sat".split(" ");
3469
+ var CRON_FIELDS = [
3470
+ { name: "minute", min: 0, max: 59 },
3471
+ { name: "hour", min: 0, max: 23 },
3472
+ { name: "day of month", min: 1, max: 31 },
3473
+ { name: "month", min: 1, max: 12, names: MONTH_NAMES },
3474
+ { name: "day of week", min: 0, max: 7, names: WEEKDAY_NAMES }
3475
+ ];
3476
+ function cronIssue(expression) {
3477
+ const fields = expression.split(" ");
3478
+ if (fields.length !== 5) return "it needs five fields";
3479
+ for (const [index, field] of fields.entries()) {
3480
+ const spec = CRON_FIELDS[index];
3481
+ const names = "names" in spec ? spec.names : [];
3482
+ const value = (raw) => {
3483
+ const named = names.indexOf(raw);
3484
+ if (named >= 0) return named + spec.min;
3485
+ const number = /^\d{1,2}$/.test(raw) ? Number(raw) : Number.NaN;
3486
+ return number >= spec.min && number <= spec.max ? number : void 0;
3487
+ };
3488
+ const items = field.split(",");
3489
+ if (items.length > 32) return `${spec.name} lists too many values`;
3490
+ for (const item of items) {
3491
+ const [base = "", step, extra] = item.split("/");
3492
+ if (extra !== void 0 || base === "")
3493
+ return `${spec.name} has an unsupported value`;
3494
+ if (step !== void 0 && (!/^\d{1,2}$/.test(step) || Number(step) < 1 || Number(step) > spec.max - spec.min + 1))
3495
+ return `${spec.name} has an unsupported step`;
3496
+ if (base === "*") continue;
3497
+ const bounds = base.split("-");
3498
+ if (bounds.length > 2) return `${spec.name} has an unsupported range`;
3499
+ const from = value(bounds[0]);
3500
+ const to = bounds.length === 2 ? value(bounds[1]) : from;
3501
+ if (from === void 0 || to === void 0)
3502
+ return `${spec.name} must be between ${spec.min} and ${spec.max}`;
3503
+ if (bounds.length === 1 && step !== void 0)
3504
+ return `${spec.name} needs a range or * before a step`;
3505
+ if (to < from) return `${spec.name} range runs backwards`;
3506
+ }
3507
+ }
3508
+ return void 0;
3509
+ }
5071
3510
  function moduleSpecIssues(value) {
5072
3511
  const spec = value;
5073
3512
  if (!spec || typeof spec !== "object" || spec.schemaVersion !== 2) return [];
@@ -5091,7 +3530,9 @@ function moduleSpecIssues(value) {
5091
3530
  ...duplicateIssues(spec.widgets, "id", "widgets"),
5092
3531
  ...duplicateIssues(spec.settings, "key", "settings"),
5093
3532
  ...duplicateIssues(spec.agentTools, "id", "agentTools"),
5094
- ...duplicateIssues(spec.decisions, "id", "decisions")
3533
+ ...duplicateIssues(spec.decisions, "id", "decisions"),
3534
+ ...duplicateIssues(spec.adapters, "id", "adapters"),
3535
+ ...duplicateIssues(spec.templates, "id", "templates")
5095
3536
  ];
5096
3537
  if (capabilities2.has("database") && entities.length === 0) {
5097
3538
  issues.push(
@@ -5182,12 +3623,12 @@ function moduleSpecIssues(value) {
5182
3623
  });
5183
3624
  }
5184
3625
  });
5185
- const entityIssue = (entity, path) => {
3626
+ const entityIssue = (entity, path, key = "entity") => {
5186
3627
  if (entity === void 0 || fieldsByEntity.has(entity)) return void 0;
5187
3628
  return specIssue(
5188
3629
  "SPEC_ENTITY_UNKNOWN",
5189
3630
  `"${entity}" is not an entity of this specification.`,
5190
- `${path}/entity`
3631
+ `${path}/${key}`
5191
3632
  );
5192
3633
  };
5193
3634
  (spec.screens ?? []).forEach((screen, index) => {
@@ -5250,6 +3691,62 @@ function moduleSpecIssues(value) {
5250
3691
  )
5251
3692
  );
5252
3693
  });
3694
+ const evidenceOwner = entityIssue(
3695
+ spec.research?.evidenceOwner,
3696
+ "/research",
3697
+ "evidenceOwner"
3698
+ );
3699
+ if (evidenceOwner) issues.push(evidenceOwner);
3700
+ (spec.templates ?? []).forEach((template, index) => {
3701
+ const unknownEntity = entityIssue(
3702
+ template.inputEntity,
3703
+ `/templates/${index}`,
3704
+ "inputEntity"
3705
+ );
3706
+ if (unknownEntity) issues.push(unknownEntity);
3707
+ });
3708
+ (spec.adapters ?? []).forEach((adapter, index) => {
3709
+ const path = `/adapters/${index}`;
3710
+ if (!adapter.id.startsWith(`${spec.id}.`)) {
3711
+ issues.push(
3712
+ specIssue(
3713
+ "SPEC_ADAPTER_ID_NAMESPACE",
3714
+ `Adapter "${adapter.id}" must start with the module id "${spec.id}.".`,
3715
+ `${path}/id`
3716
+ )
3717
+ );
3718
+ }
3719
+ if (adapter.direction === "source" && ![...modules].some((owner) => adapter.port.startsWith(`${owner}.`))) {
3720
+ issues.push(
3721
+ specIssue(
3722
+ "SPEC_ADAPTER_PORT_UNKNOWN",
3723
+ `Source adapter "${adapter.id}" writes through port "${adapter.port}", which belongs neither to this module nor to a declared dependency.`,
3724
+ `${path}/port`
3725
+ )
3726
+ );
3727
+ }
3728
+ const schedule = typeof adapter.schedule === "string" ? cronIssue(adapter.schedule) : void 0;
3729
+ if (schedule) {
3730
+ issues.push(
3731
+ specIssue(
3732
+ "SPEC_ADAPTER_SCHEDULE_INVALID",
3733
+ `Schedule of adapter "${adapter.id}" is not a five-field cron: ${schedule}.`,
3734
+ `${path}/schedule`
3735
+ )
3736
+ );
3737
+ }
3738
+ adapter.mapping.forEach((entry, entryIndex) => {
3739
+ const missing = entry.transform !== "constant" && entry.from === void 0 ? "from" : entry.transform !== "rename" && typeof entry.value !== "string" ? "value" : void 0;
3740
+ if (!missing) return;
3741
+ issues.push(
3742
+ specIssue(
3743
+ "SPEC_ADAPTER_MAPPING_INVALID",
3744
+ `A ${entry.transform} mapping of adapter "${adapter.id}" needs "${missing}".`,
3745
+ `${path}/mapping/${entryIndex}/${missing}`
3746
+ )
3747
+ );
3748
+ });
3749
+ });
5253
3750
  if (capabilities2.has("client") && !(spec.screens ?? []).some(
5254
3751
  (screen) => RENDERABLE_SCREEN_KINDS.has(screen.kind)
5255
3752
  )) {
@@ -5269,10 +3766,10 @@ async function parseFile(path) {
5269
3766
  async function validateFile(path, validator, crossCheck) {
5270
3767
  try {
5271
3768
  const value = await parseFile(path);
5272
- const valid2 = validator(value);
3769
+ const valid = validator(value);
5273
3770
  const issues = [
5274
3771
  ...issuesFrom(validator.errors),
5275
- ...valid2 && crossCheck ? crossCheck(value) : []
3772
+ ...valid && crossCheck ? crossCheck(value) : []
5276
3773
  ];
5277
3774
  return {
5278
3775
  file: path,
@@ -5391,19 +3888,14 @@ var ALLOWED = Object.freeze({ allowed: true });
5391
3888
  var NO_POLICIES = Object.freeze([]);
5392
3889
 
5393
3890
  // ../kernel/src/approval-grant.ts
5394
- import { createHash as createHash2, createHmac, timingSafeEqual } from "node:crypto";
3891
+ import * as nodeCrypto2 from "node:crypto";
5395
3892
 
5396
3893
  // ../kernel/src/keyring.ts
5397
- import {
5398
- createCipheriv,
5399
- createDecipheriv,
5400
- createHash,
5401
- randomBytes
5402
- } from "node:crypto";
3894
+ import * as nodeCrypto from "node:crypto";
5403
3895
  var KEYRING_KEY_BYTES = 32;
5404
3896
  var KEYRING_MAX_PREVIOUS_KEYS = 8;
5405
3897
  function keyFingerprint(key) {
5406
- return createHash("sha256").update(key).digest("hex").slice(0, 16);
3898
+ return nodeCrypto.createHash("sha256").update(key).digest("hex").slice(0, 16);
5407
3899
  }
5408
3900
  function parsePreviousKeys(value, decode) {
5409
3901
  if (!value) return [];
@@ -5475,7 +3967,7 @@ function canonical(value) {
5475
3967
  return `{${entries.map(([key, entry]) => `${JSON.stringify(key)}:${canonical(entry)}`).join(",")}}`;
5476
3968
  }
5477
3969
  function approvalInputDigest(input) {
5478
- return createHash2("sha256").update(canonical(input), "utf8").digest("hex");
3970
+ return nodeCrypto2.createHash("sha256").update(canonical(input), "utf8").digest("hex");
5479
3971
  }
5480
3972
  function claimString(value, maximum = MAX_CLAIM_LENGTH) {
5481
3973
  return typeof value === "string" && value.length >= 1 && value.length <= maximum && !/[\s\u0000]/.test(value) ? value : void 0;
@@ -5513,7 +4005,7 @@ function readClaims(value) {
5513
4005
  };
5514
4006
  }
5515
4007
  function signature(key, signed) {
5516
- return createHmac("sha256", key).update(signed, "utf8").digest();
4008
+ return nodeCrypto2.createHmac("sha256", key).update(signed, "utf8").digest();
5517
4009
  }
5518
4010
  function invalid(message) {
5519
4011
  return { ok: false, reason: "APPROVAL_GRANT_INVALID", message };
@@ -5534,7 +4026,7 @@ function verifyApprovalGrant(keyring, token, expected, now = Date.now()) {
5534
4026
  }
5535
4027
  const expectedSignature = signature(key, `${prefix}.${keyId}.${payload}`);
5536
4028
  const suppliedSignature = Buffer.from(supplied, "base64url");
5537
- if (suppliedSignature.byteLength !== expectedSignature.byteLength || !timingSafeEqual(suppliedSignature, expectedSignature)) {
4029
+ if (suppliedSignature.byteLength !== expectedSignature.byteLength || !nodeCrypto2.timingSafeEqual(suppliedSignature, expectedSignature)) {
5538
4030
  return invalid("The approval grant signature does not verify.");
5539
4031
  }
5540
4032
  let parsed;
@@ -5562,10 +4054,89 @@ function verifyApprovalGrant(keyring, token, expected, now = Date.now()) {
5562
4054
  return { ok: true, claims };
5563
4055
  }
5564
4056
 
4057
+ // ../kernel/src/version-range.ts
4058
+ var VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
4059
+ var COMPARATOR = /^(\^|~|>=|<=|>|<|=)?\s*(.+)$/;
4060
+ function parseVersion(value) {
4061
+ const found = VERSION.exec(value.trim());
4062
+ return found ? [Number(found[1]), Number(found[2]), Number(found[3])] : null;
4063
+ }
4064
+ function compareVersions(left, right) {
4065
+ for (let part = 0; part < 3; part += 1) {
4066
+ if (left[part] !== right[part]) return left[part] - right[part];
4067
+ }
4068
+ return 0;
4069
+ }
4070
+ function upperBound(prefix, version) {
4071
+ const [major, minor] = version;
4072
+ if (prefix === "~") return [major, minor + 1, 0];
4073
+ if (major > 0) return [major + 1, 0, 0];
4074
+ if (minor > 0) return [major, minor + 1, 0];
4075
+ return [major, minor, version[2] + 1];
4076
+ }
4077
+ function comparatorMatches(version, comparator) {
4078
+ const found = COMPARATOR.exec(comparator);
4079
+ if (!found) return false;
4080
+ const operator = found[1] ?? "=";
4081
+ const bound = parseVersion(found[2]);
4082
+ if (!bound) return false;
4083
+ const order = compareVersions(version, bound);
4084
+ switch (operator) {
4085
+ case "^":
4086
+ case "~":
4087
+ return order >= 0 && compareVersions(version, upperBound(operator, bound)) < 0;
4088
+ case ">=":
4089
+ return order >= 0;
4090
+ case "<=":
4091
+ return order <= 0;
4092
+ case ">":
4093
+ return order > 0;
4094
+ case "<":
4095
+ return order < 0;
4096
+ default:
4097
+ return order === 0;
4098
+ }
4099
+ }
4100
+ function comparators(range) {
4101
+ const alternatives = range.split("||").map((part) => part.trim());
4102
+ const parsed = [];
4103
+ for (const alternative of alternatives) {
4104
+ if (alternative === "" || alternative === "*") {
4105
+ parsed.push([]);
4106
+ continue;
4107
+ }
4108
+ const terms = alternative.split(/\s+/);
4109
+ for (const term of terms) {
4110
+ const found = COMPARATOR.exec(term);
4111
+ if (!found || parseVersion(found[2]) === null) return null;
4112
+ }
4113
+ parsed.push(terms);
4114
+ }
4115
+ return parsed;
4116
+ }
4117
+ function isValidRange(range) {
4118
+ return comparators(range) !== null;
4119
+ }
4120
+ function rangeSatisfies(version, range) {
4121
+ const parsed = parseVersion(version);
4122
+ const alternatives = comparators(range);
4123
+ if (!parsed || !alternatives) return false;
4124
+ return alternatives.some(
4125
+ (terms) => terms.every((term) => comparatorMatches(parsed, term))
4126
+ );
4127
+ }
4128
+ function nextVersion(version, level) {
4129
+ const parsed = parseVersion(version);
4130
+ if (!parsed) return null;
4131
+ const [major, minor, patch] = parsed;
4132
+ if (level === "major") return `${major + 1}.0.0`;
4133
+ if (level === "minor") return `${major}.${minor + 1}.0`;
4134
+ return `${major}.${minor}.${patch + 1}`;
4135
+ }
4136
+
5565
4137
  // ../kernel/src/module-compatibility.ts
5566
- var import_semver = __toESM(require_semver2(), 1);
5567
4138
  function incrementModuleVersion(version, level) {
5568
- const next = (0, import_semver.valid)(version) === null ? null : (0, import_semver.inc)(version, level);
4139
+ const next = nextVersion(version, level);
5569
4140
  if (!next)
5570
4141
  throw new RegistryError(
5571
4142
  "MODULE_VERSION_INVALID",
@@ -5580,18 +4151,21 @@ function retargetModuleRange(range, version) {
5580
4151
  return `${simple[1]}${version}`;
5581
4152
  }
5582
4153
  function satisfiesModuleVersion(version, range) {
5583
- return (0, import_semver.valid)(version) !== null && (0, import_semver.validRange)(range) !== null && (0, import_semver.satisfies)(version, range);
4154
+ return rangeSatisfies(version, range);
5584
4155
  }
5585
4156
  function compareModuleVersions(left, right) {
5586
- return (0, import_semver.rcompare)(left, right);
4157
+ const first = parseVersion(left);
4158
+ const second = parseVersion(right);
4159
+ if (!first || !second) return 0;
4160
+ return compareVersions(second, first);
5587
4161
  }
5588
4162
  function assertModuleCompatibility(manifest2, platformVersion2 = PLATFORM_API_VERSION) {
5589
- if (!(0, import_semver.valid)(manifest2.version))
4163
+ if (parseVersion(manifest2.version) === null)
5590
4164
  throw new RegistryError(
5591
4165
  "MODULE_VERSION_INVALID",
5592
4166
  `Invalid version for ${manifest2.id}: ${manifest2.version}`
5593
4167
  );
5594
- if (manifest2.platformApi !== void 0 && (!(0, import_semver.validRange)(manifest2.platformApi) || platformVersion2 !== null && !satisfiesModuleVersion(platformVersion2, manifest2.platformApi))) {
4168
+ if (manifest2.platformApi !== void 0 && (!isValidRange(manifest2.platformApi) || platformVersion2 !== null && !satisfiesModuleVersion(platformVersion2, manifest2.platformApi))) {
5595
4169
  throw new RegistryError(
5596
4170
  "MODULE_PLATFORM_INCOMPATIBLE",
5597
4171
  `${manifest2.id} requires platform API ${manifest2.platformApi}; available ${PLATFORM_API_VERSION}.`
@@ -5599,7 +4173,7 @@ function assertModuleCompatibility(manifest2, platformVersion2 = PLATFORM_API_VE
5599
4173
  }
5600
4174
  const ids = /* @__PURE__ */ new Set();
5601
4175
  for (const dependency of manifest2.dependencies) {
5602
- if (!dependency.range.trim() || !(0, import_semver.validRange)(dependency.range))
4176
+ if (!dependency.range.trim() || !isValidRange(dependency.range))
5603
4177
  throw new RegistryError(
5604
4178
  "MODULE_RANGE_INVALID",
5605
4179
  `${manifest2.id} declares an invalid range for ${dependency.id}: ${dependency.range}`
@@ -6137,7 +4711,7 @@ import { dirname as dirname6, join as join5, relative as relative5 } from "node:
6137
4711
  import { createRequire } from "node:module";
6138
4712
  import { readFile as readFile4 } from "node:fs/promises";
6139
4713
  import { dirname as dirname4, join as join2 } from "node:path";
6140
- var SDK_VERSION = "0.3.2";
4714
+ var SDK_VERSION = "0.4.1";
6141
4715
  var LIBRARIES = /* @__PURE__ */ new Set([
6142
4716
  "ai-provider",
6143
4717
  "cli-protocol",
@@ -6317,6 +4891,113 @@ function failure(code, message, details) {
6317
4891
  };
6318
4892
  }
6319
4893
 
4894
+ // src/dom-properties.ts
4895
+ var DOM_PROPERTY_SPELLINGS = [
4896
+ "acceptCharset",
4897
+ "allowFullScreen",
4898
+ "autoCapitalize",
4899
+ "autoComplete",
4900
+ "autoCorrect",
4901
+ "autoFocus",
4902
+ "autoPlay",
4903
+ "charSet",
4904
+ "contentEditable",
4905
+ "crossOrigin",
4906
+ "defaultChecked",
4907
+ "defaultValue",
4908
+ "disablePictureInPicture",
4909
+ "disableRemotePlayback",
4910
+ "encType",
4911
+ "fetchPriority",
4912
+ "formAction",
4913
+ "formEncType",
4914
+ "formMethod",
4915
+ "formNoValidate",
4916
+ "formTarget",
4917
+ "httpEquiv",
4918
+ "imageSizes",
4919
+ "imageSrcSet",
4920
+ "inputMode",
4921
+ "itemID",
4922
+ "itemProp",
4923
+ "itemRef",
4924
+ "itemScope",
4925
+ "itemType",
4926
+ "maxLength",
4927
+ "noModule",
4928
+ "noValidate",
4929
+ "playsInline",
4930
+ "readOnly",
4931
+ "referrerPolicy",
4932
+ "spellCheck",
4933
+ "srcDoc",
4934
+ "srcLang",
4935
+ "srcSet",
4936
+ "tabIndex",
4937
+ "viewBox"
4938
+ ];
4939
+ var SPELLINGS = new Map(
4940
+ DOM_PROPERTY_SPELLINGS.map((name) => [name.toLowerCase(), name])
4941
+ );
4942
+ function hostTagAttributes(source) {
4943
+ const tags = [];
4944
+ for (const match of source.matchAll(/<[a-z][a-z0-9-]*/g)) {
4945
+ const start = match.index + match[0].length;
4946
+ let depth = 0;
4947
+ let quote = "";
4948
+ let text = "";
4949
+ let end = start;
4950
+ for (; end < source.length; end += 1) {
4951
+ const character = source[end];
4952
+ if (quote !== "") {
4953
+ if (character === quote) quote = "";
4954
+ text += " ";
4955
+ continue;
4956
+ }
4957
+ if (depth > 0) {
4958
+ if (character === "{") depth += 1;
4959
+ else if (character === "}") depth -= 1;
4960
+ text += depth === 0 ? character : " ";
4961
+ continue;
4962
+ }
4963
+ if (character === "{") {
4964
+ depth = 1;
4965
+ text += character;
4966
+ continue;
4967
+ }
4968
+ if (character === '"' || character === "'") {
4969
+ quote = character;
4970
+ text += character;
4971
+ continue;
4972
+ }
4973
+ if (character === ">") break;
4974
+ text += character;
4975
+ }
4976
+ tags.push({ start, text });
4977
+ }
4978
+ return tags;
4979
+ }
4980
+ function domPropertyMisspellings(source) {
4981
+ const found = [];
4982
+ for (const tag of hostTagAttributes(source)) {
4983
+ for (const attribute of tag.text.matchAll(
4984
+ /(?<=\s)([A-Za-z][A-Za-z-]*)=/g
4985
+ )) {
4986
+ const name = attribute[1];
4987
+ const expected = SPELLINGS.get(name.toLowerCase());
4988
+ if (expected === void 0 || expected === name) continue;
4989
+ const index = tag.start + attribute.index;
4990
+ found.push({
4991
+ name,
4992
+ expected,
4993
+ index,
4994
+ line: source.slice(0, index).split("\n").length
4995
+ });
4996
+ }
4997
+ }
4998
+ return found.sort((left, right) => left.index - right.index);
4999
+ }
5000
+
6320
5001
  // src/module-validate.ts
6321
5002
  function issue(code, message, path, severity = "error") {
6322
5003
  return { code, message, path, severity };
@@ -6506,6 +5187,7 @@ async function translationIssues(moduleRoot, manifest2, projectLocales) {
6506
5187
  }
6507
5188
  if (!manifest2.capabilities.includes("translations")) return issues;
6508
5189
  const keySets = /* @__PURE__ */ new Map();
5190
+ const referenceBundleKeys = /* @__PURE__ */ new Set();
6509
5191
  for (const locale of manifest2.locales) {
6510
5192
  const path = `translations/${locale}.json`;
6511
5193
  if (!await exists(join4(moduleRoot, path))) {
@@ -6523,7 +5205,21 @@ async function translationIssues(moduleRoot, manifest2, projectLocales) {
6523
5205
  if (!bundle || typeof bundle !== "object" || Array.isArray(bundle)) {
6524
5206
  throw new Error("Expected a JSON object.");
6525
5207
  }
6526
- keySets.set(locale, Object.keys(bundle).sort());
5208
+ const strings = bundle;
5209
+ keySets.set(locale, translationKeys(strings));
5210
+ if (keySets.size === 1) {
5211
+ for (const key of Object.keys(strings)) referenceBundleKeys.add(key);
5212
+ }
5213
+ const plurals = pluralFamilyIssues(strings, locale);
5214
+ if (plurals.length > 0) {
5215
+ issues.push(
5216
+ issue(
5217
+ "TRANSLATION_PLURAL_INCOMPLETE",
5218
+ `${path} plural families do not match the ${locale} plural rules: ${plurals.join("; ")}.`,
5219
+ path
5220
+ )
5221
+ );
5222
+ }
6527
5223
  } catch (error) {
6528
5224
  issues.push(
6529
5225
  issue(
@@ -6552,7 +5248,7 @@ async function translationIssues(moduleRoot, manifest2, projectLocales) {
6552
5248
  )
6553
5249
  );
6554
5250
  }
6555
- const referenceKeys = new Set(reference[1]);
5251
+ const referenceKeys = /* @__PURE__ */ new Set([...reference[1], ...referenceBundleKeys]);
6556
5252
  const files = await clientSourceFiles(moduleRoot);
6557
5253
  if (files.length > 0) {
6558
5254
  const namespace = manifest2.id.split(".")[0] ?? manifest2.id;
@@ -6584,6 +5280,21 @@ async function translationIssues(moduleRoot, manifest2, projectLocales) {
6584
5280
  }
6585
5281
  return issues;
6586
5282
  }
5283
+ function filtersTags(source) {
5284
+ const tags = [];
5285
+ for (const match of source.matchAll(/<Filters\b/g)) {
5286
+ let depth = 0;
5287
+ let end = match.index + match[0].length;
5288
+ for (; end < source.length; end += 1) {
5289
+ const character = source[end];
5290
+ if (character === "{") depth += 1;
5291
+ else if (character === "}") depth -= 1;
5292
+ else if (character === ">" && depth === 0) break;
5293
+ }
5294
+ tags.push(source.slice(match.index, end));
5295
+ }
5296
+ return tags;
5297
+ }
6587
5298
  async function userInterfaceIssues(moduleRoot) {
6588
5299
  const issues = [];
6589
5300
  for (const file of await clientSourceFiles(moduleRoot)) {
@@ -6607,6 +5318,27 @@ async function userInterfaceIssues(moduleRoot) {
6607
5318
  )
6608
5319
  );
6609
5320
  }
5321
+ const misspelled = domPropertyMisspellings(source);
5322
+ if (misspelled.length > 0) {
5323
+ issues.push(
5324
+ issue(
5325
+ "DOM_PROPERTY_CASING",
5326
+ "Host elements use Octane's DOM property spelling: " + misspelled.map(
5327
+ (found) => `line ${found.line} ${found.name} as ${found.expected}`
5328
+ ).join(", ") + ".",
5329
+ path
5330
+ )
5331
+ );
5332
+ }
5333
+ if (filtersTags(source).some((tag) => !/\slabel=/.test(tag))) {
5334
+ issues.push(
5335
+ issue(
5336
+ "FILTERS_LABEL_MISSING",
5337
+ 'Filters from @flowdular/ui needs a translated label; without one it shows the English word "Filters" in every locale.',
5338
+ path
5339
+ )
5340
+ );
5341
+ }
6610
5342
  }
6611
5343
  return issues;
6612
5344
  }