poe-code 3.0.21-beta.8 → 3.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/cli/commands/ralph.js +12 -0
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/usage.d.ts +3 -0
- package/dist/cli/commands/usage.js +186 -0
- package/dist/cli/commands/usage.js.map +1 -0
- package/dist/cli/program.js +12 -0
- package/dist/cli/program.js.map +1 -1
- package/dist/index.js +1015 -1483
- package/dist/index.js.map +4 -4
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1060,7 +1060,7 @@ function renderTemplate(template, variables) {
|
|
|
1060
1060
|
processed[key] = value;
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
|
-
Mustache2.escape = (
|
|
1063
|
+
Mustache2.escape = (text4) => text4;
|
|
1064
1064
|
try {
|
|
1065
1065
|
return Mustache2.render(template, processed);
|
|
1066
1066
|
} finally {
|
|
@@ -1731,134 +1731,6 @@ var init_context = __esm({
|
|
|
1731
1731
|
}
|
|
1732
1732
|
});
|
|
1733
1733
|
|
|
1734
|
-
// node_modules/sisteransi/src/index.js
|
|
1735
|
-
var require_src = __commonJS({
|
|
1736
|
-
"node_modules/sisteransi/src/index.js"(exports, module) {
|
|
1737
|
-
"use strict";
|
|
1738
|
-
var ESC = "\x1B";
|
|
1739
|
-
var CSI = `${ESC}[`;
|
|
1740
|
-
var beep = "\x07";
|
|
1741
|
-
var cursor = {
|
|
1742
|
-
to(x2, y3) {
|
|
1743
|
-
if (!y3) return `${CSI}${x2 + 1}G`;
|
|
1744
|
-
return `${CSI}${y3 + 1};${x2 + 1}H`;
|
|
1745
|
-
},
|
|
1746
|
-
move(x2, y3) {
|
|
1747
|
-
let ret = "";
|
|
1748
|
-
if (x2 < 0) ret += `${CSI}${-x2}D`;
|
|
1749
|
-
else if (x2 > 0) ret += `${CSI}${x2}C`;
|
|
1750
|
-
if (y3 < 0) ret += `${CSI}${-y3}A`;
|
|
1751
|
-
else if (y3 > 0) ret += `${CSI}${y3}B`;
|
|
1752
|
-
return ret;
|
|
1753
|
-
},
|
|
1754
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
1755
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
1756
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
1757
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
1758
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
1759
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
1760
|
-
left: `${CSI}G`,
|
|
1761
|
-
hide: `${CSI}?25l`,
|
|
1762
|
-
show: `${CSI}?25h`,
|
|
1763
|
-
save: `${ESC}7`,
|
|
1764
|
-
restore: `${ESC}8`
|
|
1765
|
-
};
|
|
1766
|
-
var scroll = {
|
|
1767
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
1768
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
1769
|
-
};
|
|
1770
|
-
var erase = {
|
|
1771
|
-
screen: `${CSI}2J`,
|
|
1772
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
1773
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
1774
|
-
line: `${CSI}2K`,
|
|
1775
|
-
lineEnd: `${CSI}K`,
|
|
1776
|
-
lineStart: `${CSI}1K`,
|
|
1777
|
-
lines(count) {
|
|
1778
|
-
let clear = "";
|
|
1779
|
-
for (let i = 0; i < count; i++)
|
|
1780
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
1781
|
-
if (count)
|
|
1782
|
-
clear += cursor.left;
|
|
1783
|
-
return clear;
|
|
1784
|
-
}
|
|
1785
|
-
};
|
|
1786
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
1787
|
-
}
|
|
1788
|
-
});
|
|
1789
|
-
|
|
1790
|
-
// node_modules/picocolors/picocolors.js
|
|
1791
|
-
var require_picocolors = __commonJS({
|
|
1792
|
-
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
1793
|
-
var p2 = process || {};
|
|
1794
|
-
var argv = p2.argv || [];
|
|
1795
|
-
var env = p2.env || {};
|
|
1796
|
-
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p2.platform === "win32" || (p2.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
1797
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
1798
|
-
let string3 = "" + input, index = string3.indexOf(close, open.length);
|
|
1799
|
-
return ~index ? open + replaceClose(string3, close, replace, index) + close : open + string3 + close;
|
|
1800
|
-
};
|
|
1801
|
-
var replaceClose = (string3, close, replace, index) => {
|
|
1802
|
-
let result = "", cursor = 0;
|
|
1803
|
-
do {
|
|
1804
|
-
result += string3.substring(cursor, index) + replace;
|
|
1805
|
-
cursor = index + close.length;
|
|
1806
|
-
index = string3.indexOf(close, cursor);
|
|
1807
|
-
} while (~index);
|
|
1808
|
-
return result + string3.substring(cursor);
|
|
1809
|
-
};
|
|
1810
|
-
var createColors = (enabled = isColorSupported) => {
|
|
1811
|
-
let f = enabled ? formatter : () => String;
|
|
1812
|
-
return {
|
|
1813
|
-
isColorSupported: enabled,
|
|
1814
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
1815
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
1816
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
1817
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
1818
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
1819
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
1820
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
1821
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
1822
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
1823
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
1824
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
1825
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
1826
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
1827
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
1828
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
1829
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
1830
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
1831
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
1832
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
1833
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
1834
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
1835
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
1836
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
1837
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
1838
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
1839
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
1840
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
1841
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
1842
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
1843
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
1844
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
1845
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
1846
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
1847
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
1848
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
1849
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
1850
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
1851
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
1852
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
1853
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
1854
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
1855
|
-
};
|
|
1856
|
-
};
|
|
1857
|
-
module.exports = createColors();
|
|
1858
|
-
module.exports.createColors = createColors;
|
|
1859
|
-
}
|
|
1860
|
-
});
|
|
1861
|
-
|
|
1862
1734
|
// src/templates/python/env.hbs
|
|
1863
1735
|
var require_env = __commonJS({
|
|
1864
1736
|
"src/templates/python/env.hbs"(exports, module) {
|
|
@@ -2430,7 +2302,7 @@ var require_code = __commonJS({
|
|
|
2430
2302
|
};
|
|
2431
2303
|
exports._Code = _Code;
|
|
2432
2304
|
exports.nil = new _Code("");
|
|
2433
|
-
function
|
|
2305
|
+
function _(strs, ...args) {
|
|
2434
2306
|
const code = [strs[0]];
|
|
2435
2307
|
let i = 0;
|
|
2436
2308
|
while (i < args.length) {
|
|
@@ -2439,7 +2311,7 @@ var require_code = __commonJS({
|
|
|
2439
2311
|
}
|
|
2440
2312
|
return new _Code(code);
|
|
2441
2313
|
}
|
|
2442
|
-
exports._ =
|
|
2314
|
+
exports._ = _;
|
|
2443
2315
|
var plus = new _Code("+");
|
|
2444
2316
|
function str(strs, ...args) {
|
|
2445
2317
|
const expr = [safeStringify2(strs[0])];
|
|
@@ -2476,41 +2348,41 @@ var require_code = __commonJS({
|
|
|
2476
2348
|
i++;
|
|
2477
2349
|
}
|
|
2478
2350
|
}
|
|
2479
|
-
function mergeExprItems(a,
|
|
2480
|
-
if (
|
|
2351
|
+
function mergeExprItems(a, b) {
|
|
2352
|
+
if (b === '""')
|
|
2481
2353
|
return a;
|
|
2482
2354
|
if (a === '""')
|
|
2483
|
-
return
|
|
2355
|
+
return b;
|
|
2484
2356
|
if (typeof a == "string") {
|
|
2485
|
-
if (
|
|
2357
|
+
if (b instanceof Name || a[a.length - 1] !== '"')
|
|
2486
2358
|
return;
|
|
2487
|
-
if (typeof
|
|
2488
|
-
return `${a.slice(0, -1)}${
|
|
2489
|
-
if (
|
|
2490
|
-
return a.slice(0, -1) +
|
|
2359
|
+
if (typeof b != "string")
|
|
2360
|
+
return `${a.slice(0, -1)}${b}"`;
|
|
2361
|
+
if (b[0] === '"')
|
|
2362
|
+
return a.slice(0, -1) + b.slice(1);
|
|
2491
2363
|
return;
|
|
2492
2364
|
}
|
|
2493
|
-
if (typeof
|
|
2494
|
-
return `"${a}${
|
|
2365
|
+
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
|
|
2366
|
+
return `"${a}${b.slice(1)}`;
|
|
2495
2367
|
return;
|
|
2496
2368
|
}
|
|
2497
2369
|
function strConcat(c1, c2) {
|
|
2498
2370
|
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
|
|
2499
2371
|
}
|
|
2500
2372
|
exports.strConcat = strConcat;
|
|
2501
|
-
function interpolate(
|
|
2502
|
-
return typeof
|
|
2373
|
+
function interpolate(x) {
|
|
2374
|
+
return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify2(Array.isArray(x) ? x.join(",") : x);
|
|
2503
2375
|
}
|
|
2504
|
-
function stringify3(
|
|
2505
|
-
return new _Code(safeStringify2(
|
|
2376
|
+
function stringify3(x) {
|
|
2377
|
+
return new _Code(safeStringify2(x));
|
|
2506
2378
|
}
|
|
2507
2379
|
exports.stringify = stringify3;
|
|
2508
|
-
function safeStringify2(
|
|
2509
|
-
return JSON.stringify(
|
|
2380
|
+
function safeStringify2(x) {
|
|
2381
|
+
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
2510
2382
|
}
|
|
2511
2383
|
exports.safeStringify = safeStringify2;
|
|
2512
2384
|
function getProperty(key) {
|
|
2513
|
-
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) :
|
|
2385
|
+
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
|
|
2514
2386
|
}
|
|
2515
2387
|
exports.getProperty = getProperty;
|
|
2516
2388
|
function getEsmExportName(key) {
|
|
@@ -2907,17 +2779,17 @@ var require_codegen = __commonJS({
|
|
|
2907
2779
|
const cond = this.condition;
|
|
2908
2780
|
if (cond === true)
|
|
2909
2781
|
return this.nodes;
|
|
2910
|
-
let
|
|
2911
|
-
if (
|
|
2912
|
-
const ns =
|
|
2913
|
-
|
|
2782
|
+
let e = this.else;
|
|
2783
|
+
if (e) {
|
|
2784
|
+
const ns = e.optimizeNodes();
|
|
2785
|
+
e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
|
|
2914
2786
|
}
|
|
2915
|
-
if (
|
|
2787
|
+
if (e) {
|
|
2916
2788
|
if (cond === false)
|
|
2917
|
-
return
|
|
2789
|
+
return e instanceof _If ? e : e.nodes;
|
|
2918
2790
|
if (this.nodes.length)
|
|
2919
2791
|
return this;
|
|
2920
|
-
return new _If(not(cond),
|
|
2792
|
+
return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
|
|
2921
2793
|
}
|
|
2922
2794
|
if (cond === false || !this.nodes.length)
|
|
2923
2795
|
return void 0;
|
|
@@ -3361,16 +3233,16 @@ var require_codegen = __commonJS({
|
|
|
3361
3233
|
delete names[n.str];
|
|
3362
3234
|
return c;
|
|
3363
3235
|
}
|
|
3364
|
-
function canOptimize(
|
|
3365
|
-
return
|
|
3236
|
+
function canOptimize(e) {
|
|
3237
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
|
|
3366
3238
|
}
|
|
3367
3239
|
}
|
|
3368
3240
|
function subtractNames(names, from) {
|
|
3369
3241
|
for (const n in from)
|
|
3370
3242
|
names[n] = (names[n] || 0) - (from[n] || 0);
|
|
3371
3243
|
}
|
|
3372
|
-
function not(
|
|
3373
|
-
return typeof
|
|
3244
|
+
function not(x) {
|
|
3245
|
+
return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
|
|
3374
3246
|
}
|
|
3375
3247
|
exports.not = not;
|
|
3376
3248
|
var andCode = mappend(exports.operators.AND);
|
|
@@ -3384,10 +3256,10 @@ var require_codegen = __commonJS({
|
|
|
3384
3256
|
}
|
|
3385
3257
|
exports.or = or;
|
|
3386
3258
|
function mappend(op) {
|
|
3387
|
-
return (
|
|
3259
|
+
return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
|
|
3388
3260
|
}
|
|
3389
|
-
function par(
|
|
3390
|
-
return
|
|
3261
|
+
function par(x) {
|
|
3262
|
+
return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
|
|
3391
3263
|
}
|
|
3392
3264
|
}
|
|
3393
3265
|
});
|
|
@@ -3477,8 +3349,8 @@ var require_util = __commonJS({
|
|
|
3477
3349
|
exports.unescapeJsonPointer = unescapeJsonPointer;
|
|
3478
3350
|
function eachItem(xs, f) {
|
|
3479
3351
|
if (Array.isArray(xs)) {
|
|
3480
|
-
for (const
|
|
3481
|
-
f(
|
|
3352
|
+
for (const x of xs)
|
|
3353
|
+
f(x);
|
|
3482
3354
|
} else {
|
|
3483
3355
|
f(xs);
|
|
3484
3356
|
}
|
|
@@ -3523,7 +3395,7 @@ var require_util = __commonJS({
|
|
|
3523
3395
|
}
|
|
3524
3396
|
exports.evaluatedPropsToName = evaluatedPropsToName;
|
|
3525
3397
|
function setEvaluated(gen, props, ps) {
|
|
3526
|
-
Object.keys(ps).forEach((
|
|
3398
|
+
Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
|
|
3527
3399
|
}
|
|
3528
3400
|
exports.setEvaluated = setEvaluated;
|
|
3529
3401
|
var snippets = {};
|
|
@@ -3779,8 +3651,8 @@ var require_rules = __commonJS({
|
|
|
3779
3651
|
exports.getRules = exports.isJSONType = void 0;
|
|
3780
3652
|
var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
3781
3653
|
var jsonTypes = new Set(_jsonTypes);
|
|
3782
|
-
function isJSONType(
|
|
3783
|
-
return typeof
|
|
3654
|
+
function isJSONType(x) {
|
|
3655
|
+
return typeof x == "string" && jsonTypes.has(x);
|
|
3784
3656
|
}
|
|
3785
3657
|
exports.isJSONType = isJSONType;
|
|
3786
3658
|
function getRules() {
|
|
@@ -4096,11 +3968,11 @@ var require_code2 = __commonJS({
|
|
|
4096
3968
|
}
|
|
4097
3969
|
exports.noPropertyInData = noPropertyInData;
|
|
4098
3970
|
function allSchemaProperties(schemaMap) {
|
|
4099
|
-
return schemaMap ? Object.keys(schemaMap).filter((
|
|
3971
|
+
return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
|
|
4100
3972
|
}
|
|
4101
3973
|
exports.allSchemaProperties = allSchemaProperties;
|
|
4102
3974
|
function schemaProperties(it, schemaMap) {
|
|
4103
|
-
return allSchemaProperties(schemaMap).filter((
|
|
3975
|
+
return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
|
|
4104
3976
|
}
|
|
4105
3977
|
exports.schemaProperties = schemaProperties;
|
|
4106
3978
|
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
|
|
@@ -4119,13 +3991,13 @@ var require_code2 = __commonJS({
|
|
|
4119
3991
|
exports.callValidateCode = callValidateCode;
|
|
4120
3992
|
var newRegExp = (0, codegen_1._)`new RegExp`;
|
|
4121
3993
|
function usePattern({ gen, it: { opts } }, pattern) {
|
|
4122
|
-
const
|
|
3994
|
+
const u = opts.unicodeRegExp ? "u" : "";
|
|
4123
3995
|
const { regExp } = opts.code;
|
|
4124
|
-
const rx = regExp(pattern,
|
|
3996
|
+
const rx = regExp(pattern, u);
|
|
4125
3997
|
return gen.scopeValue("pattern", {
|
|
4126
3998
|
key: rx.toString(),
|
|
4127
3999
|
ref: rx,
|
|
4128
|
-
code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${
|
|
4000
|
+
code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
|
|
4129
4001
|
});
|
|
4130
4002
|
}
|
|
4131
4003
|
exports.usePattern = usePattern;
|
|
@@ -4230,7 +4102,7 @@ var require_keyword = __commonJS({
|
|
|
4230
4102
|
}
|
|
4231
4103
|
function validateAsync() {
|
|
4232
4104
|
const ruleErrs = gen.let("ruleErrs", null);
|
|
4233
|
-
gen.try(() => assignValid((0, codegen_1._)`await `), (
|
|
4105
|
+
gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
|
|
4234
4106
|
return ruleErrs;
|
|
4235
4107
|
}
|
|
4236
4108
|
function validateSync() {
|
|
@@ -4384,33 +4256,33 @@ var require_subschema = __commonJS({
|
|
|
4384
4256
|
var require_fast_deep_equal = __commonJS({
|
|
4385
4257
|
"node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
4386
4258
|
"use strict";
|
|
4387
|
-
module.exports = function equal(a,
|
|
4388
|
-
if (a ===
|
|
4389
|
-
if (a &&
|
|
4390
|
-
if (a.constructor !==
|
|
4259
|
+
module.exports = function equal(a, b) {
|
|
4260
|
+
if (a === b) return true;
|
|
4261
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
4262
|
+
if (a.constructor !== b.constructor) return false;
|
|
4391
4263
|
var length, i, keys;
|
|
4392
4264
|
if (Array.isArray(a)) {
|
|
4393
4265
|
length = a.length;
|
|
4394
|
-
if (length !=
|
|
4266
|
+
if (length != b.length) return false;
|
|
4395
4267
|
for (i = length; i-- !== 0; )
|
|
4396
|
-
if (!equal(a[i],
|
|
4268
|
+
if (!equal(a[i], b[i])) return false;
|
|
4397
4269
|
return true;
|
|
4398
4270
|
}
|
|
4399
|
-
if (a.constructor === RegExp) return a.source ===
|
|
4400
|
-
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() ===
|
|
4401
|
-
if (a.toString !== Object.prototype.toString) return a.toString() ===
|
|
4271
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
4272
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
4273
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
4402
4274
|
keys = Object.keys(a);
|
|
4403
4275
|
length = keys.length;
|
|
4404
|
-
if (length !== Object.keys(
|
|
4276
|
+
if (length !== Object.keys(b).length) return false;
|
|
4405
4277
|
for (i = length; i-- !== 0; )
|
|
4406
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
4278
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
4407
4279
|
for (i = length; i-- !== 0; ) {
|
|
4408
4280
|
var key = keys[i];
|
|
4409
|
-
if (!equal(a[key],
|
|
4281
|
+
if (!equal(a[key], b[key])) return false;
|
|
4410
4282
|
}
|
|
4411
4283
|
return true;
|
|
4412
4284
|
}
|
|
4413
|
-
return a !== a &&
|
|
4285
|
+
return a !== a && b !== b;
|
|
4414
4286
|
};
|
|
4415
4287
|
}
|
|
4416
4288
|
});
|
|
@@ -4578,12 +4450,12 @@ var require_resolve = __commonJS({
|
|
|
4578
4450
|
function getFullPath(resolver, id = "", normalize) {
|
|
4579
4451
|
if (normalize !== false)
|
|
4580
4452
|
id = normalizeId(id);
|
|
4581
|
-
const
|
|
4582
|
-
return _getFullPath(resolver,
|
|
4453
|
+
const p = resolver.parse(id);
|
|
4454
|
+
return _getFullPath(resolver, p);
|
|
4583
4455
|
}
|
|
4584
4456
|
exports.getFullPath = getFullPath;
|
|
4585
|
-
function _getFullPath(resolver,
|
|
4586
|
-
const serialized = resolver.serialize(
|
|
4457
|
+
function _getFullPath(resolver, p) {
|
|
4458
|
+
const serialized = resolver.serialize(p);
|
|
4587
4459
|
return serialized.split("#")[0] + "#";
|
|
4588
4460
|
}
|
|
4589
4461
|
exports._getFullPath = _getFullPath;
|
|
@@ -4607,7 +4479,7 @@ var require_resolve = __commonJS({
|
|
|
4607
4479
|
const pathPrefix = getFullPath(uriResolver, schId, false);
|
|
4608
4480
|
const localRefs = {};
|
|
4609
4481
|
const schemaRefs = /* @__PURE__ */ new Set();
|
|
4610
|
-
traverse(schema, { allKeys: true }, (sch, jsonPtr,
|
|
4482
|
+
traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
|
|
4611
4483
|
if (parentJsonPtr === void 0)
|
|
4612
4484
|
return;
|
|
4613
4485
|
const fullPath = pathPrefix + jsonPtr;
|
|
@@ -5307,12 +5179,12 @@ var require_compile = __commonJS({
|
|
|
5307
5179
|
}
|
|
5308
5180
|
sch.validate = validate;
|
|
5309
5181
|
return sch;
|
|
5310
|
-
} catch (
|
|
5182
|
+
} catch (e) {
|
|
5311
5183
|
delete sch.validate;
|
|
5312
5184
|
delete sch.validateName;
|
|
5313
5185
|
if (sourceCode)
|
|
5314
5186
|
this.logger.error("Error compiling schema, function code:", sourceCode);
|
|
5315
|
-
throw
|
|
5187
|
+
throw e;
|
|
5316
5188
|
} finally {
|
|
5317
5189
|
this._compilations.delete(sch);
|
|
5318
5190
|
}
|
|
@@ -5358,11 +5230,11 @@ var require_compile = __commonJS({
|
|
|
5358
5230
|
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
5359
5231
|
}
|
|
5360
5232
|
function resolveSchema(root, ref) {
|
|
5361
|
-
const
|
|
5362
|
-
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver,
|
|
5233
|
+
const p = this.opts.uriResolver.parse(ref);
|
|
5234
|
+
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
|
|
5363
5235
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
5364
5236
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
|
|
5365
|
-
return getJsonPointer.call(this,
|
|
5237
|
+
return getJsonPointer.call(this, p, root);
|
|
5366
5238
|
}
|
|
5367
5239
|
const id = (0, resolve_1.normalizeId)(refPath);
|
|
5368
5240
|
const schOrRef = this.refs[id] || this.schemas[id];
|
|
@@ -5370,7 +5242,7 @@ var require_compile = __commonJS({
|
|
|
5370
5242
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
5371
5243
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
|
|
5372
5244
|
return;
|
|
5373
|
-
return getJsonPointer.call(this,
|
|
5245
|
+
return getJsonPointer.call(this, p, sch);
|
|
5374
5246
|
}
|
|
5375
5247
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
|
|
5376
5248
|
return;
|
|
@@ -5384,7 +5256,7 @@ var require_compile = __commonJS({
|
|
|
5384
5256
|
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
5385
5257
|
return new SchemaEnv({ schema, schemaId, root, baseId });
|
|
5386
5258
|
}
|
|
5387
|
-
return getJsonPointer.call(this,
|
|
5259
|
+
return getJsonPointer.call(this, p, schOrRef);
|
|
5388
5260
|
}
|
|
5389
5261
|
exports.resolveSchema = resolveSchema;
|
|
5390
5262
|
var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
|
|
@@ -6121,8 +5993,8 @@ var require_fast_uri = __commonJS({
|
|
|
6121
5993
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
6122
5994
|
try {
|
|
6123
5995
|
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
6124
|
-
} catch (
|
|
6125
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " +
|
|
5996
|
+
} catch (e) {
|
|
5997
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
6126
5998
|
}
|
|
6127
5999
|
}
|
|
6128
6000
|
}
|
|
@@ -6256,31 +6128,31 @@ var require_core = __commonJS({
|
|
|
6256
6128
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
6257
6129
|
};
|
|
6258
6130
|
var MAX_EXPRESSION = 200;
|
|
6259
|
-
function requiredOptions(
|
|
6131
|
+
function requiredOptions(o) {
|
|
6260
6132
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
6261
|
-
const s =
|
|
6262
|
-
const _optz = (_a2 =
|
|
6133
|
+
const s = o.strict;
|
|
6134
|
+
const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
|
|
6263
6135
|
const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
|
|
6264
|
-
const regExp = (_c = (_b =
|
|
6265
|
-
const uriResolver = (_d =
|
|
6136
|
+
const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
|
|
6137
|
+
const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
|
|
6266
6138
|
return {
|
|
6267
|
-
strictSchema: (_f = (_e =
|
|
6268
|
-
strictNumbers: (_h = (_g =
|
|
6269
|
-
strictTypes: (_k = (_j =
|
|
6270
|
-
strictTuples: (_m = (_l =
|
|
6271
|
-
strictRequired: (_p = (_o =
|
|
6272
|
-
code:
|
|
6273
|
-
loopRequired: (_q =
|
|
6274
|
-
loopEnum: (_r =
|
|
6275
|
-
meta: (_s =
|
|
6276
|
-
messages: (_t =
|
|
6277
|
-
inlineRefs: (_u =
|
|
6278
|
-
schemaId: (_v =
|
|
6279
|
-
addUsedSchema: (_w =
|
|
6280
|
-
validateSchema: (_x =
|
|
6281
|
-
validateFormats: (_y =
|
|
6282
|
-
unicodeRegExp: (_z =
|
|
6283
|
-
int32range: (_0 =
|
|
6139
|
+
strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
|
|
6140
|
+
strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
|
|
6141
|
+
strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
|
|
6142
|
+
strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
|
|
6143
|
+
strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
|
|
6144
|
+
code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
|
|
6145
|
+
loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
|
|
6146
|
+
loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
|
|
6147
|
+
meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
|
|
6148
|
+
messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
|
|
6149
|
+
inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
|
|
6150
|
+
schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
|
|
6151
|
+
addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
|
|
6152
|
+
validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
|
|
6153
|
+
validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
|
|
6154
|
+
unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
|
|
6155
|
+
int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
|
|
6284
6156
|
uriResolver
|
|
6285
6157
|
};
|
|
6286
6158
|
}
|
|
@@ -6332,17 +6204,17 @@ var require_core = __commonJS({
|
|
|
6332
6204
|
return this.opts.defaultMeta = typeof meta3 == "object" ? meta3[schemaId] || meta3 : void 0;
|
|
6333
6205
|
}
|
|
6334
6206
|
validate(schemaKeyRef, data) {
|
|
6335
|
-
let
|
|
6207
|
+
let v;
|
|
6336
6208
|
if (typeof schemaKeyRef == "string") {
|
|
6337
|
-
|
|
6338
|
-
if (!
|
|
6209
|
+
v = this.getSchema(schemaKeyRef);
|
|
6210
|
+
if (!v)
|
|
6339
6211
|
throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
|
|
6340
6212
|
} else {
|
|
6341
|
-
|
|
6213
|
+
v = this.compile(schemaKeyRef);
|
|
6342
6214
|
}
|
|
6343
|
-
const valid =
|
|
6344
|
-
if (!("$async" in
|
|
6345
|
-
this.errors =
|
|
6215
|
+
const valid = v(data);
|
|
6216
|
+
if (!("$async" in v))
|
|
6217
|
+
this.errors = v.errors;
|
|
6346
6218
|
return valid;
|
|
6347
6219
|
}
|
|
6348
6220
|
compile(schema, _meta) {
|
|
@@ -6368,11 +6240,11 @@ var require_core = __commonJS({
|
|
|
6368
6240
|
async function _compileAsync(sch) {
|
|
6369
6241
|
try {
|
|
6370
6242
|
return this._compileSchemaEnv(sch);
|
|
6371
|
-
} catch (
|
|
6372
|
-
if (!(
|
|
6373
|
-
throw
|
|
6374
|
-
checkLoaded.call(this,
|
|
6375
|
-
await loadMissingSchema.call(this,
|
|
6243
|
+
} catch (e) {
|
|
6244
|
+
if (!(e instanceof ref_error_1.default))
|
|
6245
|
+
throw e;
|
|
6246
|
+
checkLoaded.call(this, e);
|
|
6247
|
+
await loadMissingSchema.call(this, e.missingSchema);
|
|
6376
6248
|
return _compileAsync.call(this, sch);
|
|
6377
6249
|
}
|
|
6378
6250
|
}
|
|
@@ -6389,9 +6261,9 @@ var require_core = __commonJS({
|
|
|
6389
6261
|
this.addSchema(_schema, ref, meta3);
|
|
6390
6262
|
}
|
|
6391
6263
|
async function _loadSchema(ref) {
|
|
6392
|
-
const
|
|
6393
|
-
if (
|
|
6394
|
-
return
|
|
6264
|
+
const p = this._loading[ref];
|
|
6265
|
+
if (p)
|
|
6266
|
+
return p;
|
|
6395
6267
|
try {
|
|
6396
6268
|
return await (this._loading[ref] = loadSchema(ref));
|
|
6397
6269
|
} finally {
|
|
@@ -6539,7 +6411,7 @@ var require_core = __commonJS({
|
|
|
6539
6411
|
type: (0, dataType_1.getJSONTypes)(def.type),
|
|
6540
6412
|
schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
|
|
6541
6413
|
};
|
|
6542
|
-
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (
|
|
6414
|
+
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
|
|
6543
6415
|
return this;
|
|
6544
6416
|
}
|
|
6545
6417
|
getKeyword(keyword) {
|
|
@@ -6568,7 +6440,7 @@ var require_core = __commonJS({
|
|
|
6568
6440
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
6569
6441
|
if (!errors || errors.length === 0)
|
|
6570
6442
|
return "No errors";
|
|
6571
|
-
return errors.map((
|
|
6443
|
+
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text4, msg) => text4 + separator + msg);
|
|
6572
6444
|
}
|
|
6573
6445
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
6574
6446
|
const rules = this.RULES.all;
|
|
@@ -6657,11 +6529,11 @@ var require_core = __commonJS({
|
|
|
6657
6529
|
Ajv2.ValidationError = validation_error_1.default;
|
|
6658
6530
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
6659
6531
|
exports.default = Ajv2;
|
|
6660
|
-
function checkOptions(checkOpts, options, msg,
|
|
6532
|
+
function checkOptions(checkOpts, options, msg, log3 = "error") {
|
|
6661
6533
|
for (const key in checkOpts) {
|
|
6662
6534
|
const opt = key;
|
|
6663
6535
|
if (opt in options)
|
|
6664
|
-
this.logger[
|
|
6536
|
+
this.logger[log3](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
6665
6537
|
}
|
|
6666
6538
|
}
|
|
6667
6539
|
function getSchEnv(keyRef) {
|
|
@@ -6836,8 +6708,8 @@ var require_ref = __commonJS({
|
|
|
6836
6708
|
return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
|
|
6837
6709
|
}
|
|
6838
6710
|
function callValidate(sch) {
|
|
6839
|
-
const
|
|
6840
|
-
callRef(cxt,
|
|
6711
|
+
const v = getValidate(cxt, sch);
|
|
6712
|
+
callRef(cxt, v, sch, sch.$async);
|
|
6841
6713
|
}
|
|
6842
6714
|
function inlineRefSchema(sch) {
|
|
6843
6715
|
const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
|
|
@@ -6859,7 +6731,7 @@ var require_ref = __commonJS({
|
|
|
6859
6731
|
return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
|
|
6860
6732
|
}
|
|
6861
6733
|
exports.getValidate = getValidate;
|
|
6862
|
-
function callRef(cxt,
|
|
6734
|
+
function callRef(cxt, v, sch, $async) {
|
|
6863
6735
|
const { gen, it } = cxt;
|
|
6864
6736
|
const { allErrors, schemaEnv: env, opts } = it;
|
|
6865
6737
|
const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
|
|
@@ -6872,20 +6744,20 @@ var require_ref = __commonJS({
|
|
|
6872
6744
|
throw new Error("async schema referenced by sync schema");
|
|
6873
6745
|
const valid = gen.let("valid");
|
|
6874
6746
|
gen.try(() => {
|
|
6875
|
-
gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt,
|
|
6876
|
-
addEvaluatedFrom(
|
|
6747
|
+
gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
|
|
6748
|
+
addEvaluatedFrom(v);
|
|
6877
6749
|
if (!allErrors)
|
|
6878
6750
|
gen.assign(valid, true);
|
|
6879
|
-
}, (
|
|
6880
|
-
gen.if((0, codegen_1._)`!(${
|
|
6881
|
-
addErrorsFrom(
|
|
6751
|
+
}, (e) => {
|
|
6752
|
+
gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
|
|
6753
|
+
addErrorsFrom(e);
|
|
6882
6754
|
if (!allErrors)
|
|
6883
6755
|
gen.assign(valid, false);
|
|
6884
6756
|
});
|
|
6885
6757
|
cxt.ok(valid);
|
|
6886
6758
|
}
|
|
6887
6759
|
function callSyncRef() {
|
|
6888
|
-
cxt.result((0, code_1.callValidateCode)(cxt,
|
|
6760
|
+
cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
|
|
6889
6761
|
}
|
|
6890
6762
|
function addErrorsFrom(source) {
|
|
6891
6763
|
const errs = (0, codegen_1._)`${source}.errors`;
|
|
@@ -7082,8 +6954,8 @@ var require_pattern = __commonJS({
|
|
|
7082
6954
|
error: error2,
|
|
7083
6955
|
code(cxt) {
|
|
7084
6956
|
const { data, $data, schema, schemaCode, it } = cxt;
|
|
7085
|
-
const
|
|
7086
|
-
const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${
|
|
6957
|
+
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
6958
|
+
const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
|
|
7087
6959
|
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
7088
6960
|
}
|
|
7089
6961
|
};
|
|
@@ -7252,8 +7124,8 @@ var require_uniqueItems = __commonJS({
|
|
|
7252
7124
|
var util_1 = require_util();
|
|
7253
7125
|
var equal_1 = require_equal();
|
|
7254
7126
|
var error2 = {
|
|
7255
|
-
message: ({ params: { i, j
|
|
7256
|
-
params: ({ params: { i, j
|
|
7127
|
+
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
7128
|
+
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
7257
7129
|
};
|
|
7258
7130
|
var def = {
|
|
7259
7131
|
keyword: "uniqueItems",
|
|
@@ -7271,15 +7143,15 @@ var require_uniqueItems = __commonJS({
|
|
|
7271
7143
|
cxt.ok(valid);
|
|
7272
7144
|
function validateUniqueItems() {
|
|
7273
7145
|
const i = gen.let("i", (0, codegen_1._)`${data}.length`);
|
|
7274
|
-
const
|
|
7275
|
-
cxt.setParams({ i, j
|
|
7146
|
+
const j = gen.let("j");
|
|
7147
|
+
cxt.setParams({ i, j });
|
|
7276
7148
|
gen.assign(valid, true);
|
|
7277
|
-
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i,
|
|
7149
|
+
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
|
|
7278
7150
|
}
|
|
7279
7151
|
function canOptimize() {
|
|
7280
7152
|
return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
|
|
7281
7153
|
}
|
|
7282
|
-
function loopN(i,
|
|
7154
|
+
function loopN(i, j) {
|
|
7283
7155
|
const item = gen.name("item");
|
|
7284
7156
|
const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
|
|
7285
7157
|
const indices = gen.const("indices", (0, codegen_1._)`{}`);
|
|
@@ -7289,16 +7161,16 @@ var require_uniqueItems = __commonJS({
|
|
|
7289
7161
|
if (itemTypes.length > 1)
|
|
7290
7162
|
gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
|
|
7291
7163
|
gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
|
|
7292
|
-
gen.assign(
|
|
7164
|
+
gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
|
|
7293
7165
|
cxt.error();
|
|
7294
7166
|
gen.assign(valid, false).break();
|
|
7295
7167
|
}).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
|
|
7296
7168
|
});
|
|
7297
7169
|
}
|
|
7298
|
-
function loopN2(i,
|
|
7170
|
+
function loopN2(i, j) {
|
|
7299
7171
|
const eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
7300
7172
|
const outer = gen.name("outer");
|
|
7301
|
-
gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${
|
|
7173
|
+
gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
|
|
7302
7174
|
cxt.error();
|
|
7303
7175
|
gen.assign(valid, false).break(outer);
|
|
7304
7176
|
})));
|
|
@@ -7375,7 +7247,7 @@ var require_enum = __commonJS({
|
|
|
7375
7247
|
cxt.pass(valid);
|
|
7376
7248
|
function loopEnum() {
|
|
7377
7249
|
gen.assign(valid, false);
|
|
7378
|
-
gen.forOf("v", schemaCode, (
|
|
7250
|
+
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
7379
7251
|
}
|
|
7380
7252
|
function equalCode(vSchema, i) {
|
|
7381
7253
|
const sch = schema[i];
|
|
@@ -7522,10 +7394,10 @@ var require_items = __commonJS({
|
|
|
7522
7394
|
});
|
|
7523
7395
|
function checkStrictTuple(sch) {
|
|
7524
7396
|
const { opts, errSchemaPath } = it;
|
|
7525
|
-
const
|
|
7526
|
-
const fullTuple =
|
|
7397
|
+
const l = schArr.length;
|
|
7398
|
+
const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
|
|
7527
7399
|
if (opts.strictTuples && !fullTuple) {
|
|
7528
|
-
const msg = `"${keyword}" is ${
|
|
7400
|
+
const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
|
|
7529
7401
|
(0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
|
|
7530
7402
|
}
|
|
7531
7403
|
}
|
|
@@ -7864,12 +7736,12 @@ var require_additionalProperties = __commonJS({
|
|
|
7864
7736
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
7865
7737
|
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
|
|
7866
7738
|
} else if (props.length) {
|
|
7867
|
-
definedProp = (0, codegen_1.or)(...props.map((
|
|
7739
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
|
|
7868
7740
|
} else {
|
|
7869
7741
|
definedProp = codegen_1.nil;
|
|
7870
7742
|
}
|
|
7871
7743
|
if (patProps.length) {
|
|
7872
|
-
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((
|
|
7744
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
|
|
7873
7745
|
}
|
|
7874
7746
|
return (0, codegen_1.not)(definedProp);
|
|
7875
7747
|
}
|
|
@@ -7949,7 +7821,7 @@ var require_properties = __commonJS({
|
|
|
7949
7821
|
if (it.opts.unevaluated && allProps.length && it.props !== true) {
|
|
7950
7822
|
it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
7951
7823
|
}
|
|
7952
|
-
const properties = allProps.filter((
|
|
7824
|
+
const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
7953
7825
|
if (properties.length === 0)
|
|
7954
7826
|
return;
|
|
7955
7827
|
const valid = gen.name("valid");
|
|
@@ -7999,7 +7871,7 @@ var require_patternProperties = __commonJS({
|
|
|
7999
7871
|
const { gen, schema, data, parentSchema, it } = cxt;
|
|
8000
7872
|
const { opts } = it;
|
|
8001
7873
|
const patterns = (0, code_1.allSchemaProperties)(schema);
|
|
8002
|
-
const alwaysValidPatterns = patterns.filter((
|
|
7874
|
+
const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
8003
7875
|
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
|
|
8004
7876
|
return;
|
|
8005
7877
|
}
|
|
@@ -8761,7 +8633,7 @@ var require_ajv = __commonJS({
|
|
|
8761
8633
|
var Ajv2 = class extends core_1.default {
|
|
8762
8634
|
_addVocabularies() {
|
|
8763
8635
|
super._addVocabularies();
|
|
8764
|
-
draft7_1.default.forEach((
|
|
8636
|
+
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
8765
8637
|
if (this.opts.discriminator)
|
|
8766
8638
|
this.addKeyword(discriminator_1.default);
|
|
8767
8639
|
}
|
|
@@ -8902,12 +8774,12 @@ var require_formats = __commonJS({
|
|
|
8902
8774
|
const day = +matches[3];
|
|
8903
8775
|
return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
|
|
8904
8776
|
}
|
|
8905
|
-
function compareDate(d1,
|
|
8906
|
-
if (!(d1 &&
|
|
8777
|
+
function compareDate(d1, d2) {
|
|
8778
|
+
if (!(d1 && d2))
|
|
8907
8779
|
return void 0;
|
|
8908
|
-
if (d1 >
|
|
8780
|
+
if (d1 > d2)
|
|
8909
8781
|
return 1;
|
|
8910
|
-
if (d1 <
|
|
8782
|
+
if (d1 < d2)
|
|
8911
8783
|
return -1;
|
|
8912
8784
|
return 0;
|
|
8913
8785
|
}
|
|
@@ -8969,17 +8841,17 @@ var require_formats = __commonJS({
|
|
|
8969
8841
|
if (!(dt1 && dt2))
|
|
8970
8842
|
return void 0;
|
|
8971
8843
|
const d1 = new Date(dt1).valueOf();
|
|
8972
|
-
const
|
|
8973
|
-
if (!(d1 &&
|
|
8844
|
+
const d2 = new Date(dt2).valueOf();
|
|
8845
|
+
if (!(d1 && d2))
|
|
8974
8846
|
return void 0;
|
|
8975
|
-
return d1 -
|
|
8847
|
+
return d1 - d2;
|
|
8976
8848
|
}
|
|
8977
8849
|
function compareIsoDateTime(dt1, dt2) {
|
|
8978
8850
|
if (!(dt1 && dt2))
|
|
8979
8851
|
return void 0;
|
|
8980
8852
|
const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
|
|
8981
|
-
const [
|
|
8982
|
-
const res = compareDate(d1,
|
|
8853
|
+
const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
|
|
8854
|
+
const res = compareDate(d1, d2);
|
|
8983
8855
|
if (res === void 0)
|
|
8984
8856
|
return void 0;
|
|
8985
8857
|
return res || compareTime(t1, t2);
|
|
@@ -9012,7 +8884,7 @@ var require_formats = __commonJS({
|
|
|
9012
8884
|
try {
|
|
9013
8885
|
new RegExp(str);
|
|
9014
8886
|
return true;
|
|
9015
|
-
} catch (
|
|
8887
|
+
} catch (e) {
|
|
9016
8888
|
return false;
|
|
9017
8889
|
}
|
|
9018
8890
|
}
|
|
@@ -9076,7 +8948,7 @@ var require_code3 = __commonJS({
|
|
|
9076
8948
|
};
|
|
9077
8949
|
exports._Code = _Code;
|
|
9078
8950
|
exports.nil = new _Code("");
|
|
9079
|
-
function
|
|
8951
|
+
function _(strs, ...args) {
|
|
9080
8952
|
const code = [strs[0]];
|
|
9081
8953
|
let i = 0;
|
|
9082
8954
|
while (i < args.length) {
|
|
@@ -9085,7 +8957,7 @@ var require_code3 = __commonJS({
|
|
|
9085
8957
|
}
|
|
9086
8958
|
return new _Code(code);
|
|
9087
8959
|
}
|
|
9088
|
-
exports._ =
|
|
8960
|
+
exports._ = _;
|
|
9089
8961
|
var plus = new _Code("+");
|
|
9090
8962
|
function str(strs, ...args) {
|
|
9091
8963
|
const expr = [safeStringify2(strs[0])];
|
|
@@ -9122,41 +8994,41 @@ var require_code3 = __commonJS({
|
|
|
9122
8994
|
i++;
|
|
9123
8995
|
}
|
|
9124
8996
|
}
|
|
9125
|
-
function mergeExprItems(a,
|
|
9126
|
-
if (
|
|
8997
|
+
function mergeExprItems(a, b) {
|
|
8998
|
+
if (b === '""')
|
|
9127
8999
|
return a;
|
|
9128
9000
|
if (a === '""')
|
|
9129
|
-
return
|
|
9001
|
+
return b;
|
|
9130
9002
|
if (typeof a == "string") {
|
|
9131
|
-
if (
|
|
9003
|
+
if (b instanceof Name || a[a.length - 1] !== '"')
|
|
9132
9004
|
return;
|
|
9133
|
-
if (typeof
|
|
9134
|
-
return `${a.slice(0, -1)}${
|
|
9135
|
-
if (
|
|
9136
|
-
return a.slice(0, -1) +
|
|
9005
|
+
if (typeof b != "string")
|
|
9006
|
+
return `${a.slice(0, -1)}${b}"`;
|
|
9007
|
+
if (b[0] === '"')
|
|
9008
|
+
return a.slice(0, -1) + b.slice(1);
|
|
9137
9009
|
return;
|
|
9138
9010
|
}
|
|
9139
|
-
if (typeof
|
|
9140
|
-
return `"${a}${
|
|
9011
|
+
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
|
|
9012
|
+
return `"${a}${b.slice(1)}`;
|
|
9141
9013
|
return;
|
|
9142
9014
|
}
|
|
9143
9015
|
function strConcat(c1, c2) {
|
|
9144
9016
|
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
|
|
9145
9017
|
}
|
|
9146
9018
|
exports.strConcat = strConcat;
|
|
9147
|
-
function interpolate(
|
|
9148
|
-
return typeof
|
|
9019
|
+
function interpolate(x) {
|
|
9020
|
+
return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify2(Array.isArray(x) ? x.join(",") : x);
|
|
9149
9021
|
}
|
|
9150
|
-
function stringify3(
|
|
9151
|
-
return new _Code(safeStringify2(
|
|
9022
|
+
function stringify3(x) {
|
|
9023
|
+
return new _Code(safeStringify2(x));
|
|
9152
9024
|
}
|
|
9153
9025
|
exports.stringify = stringify3;
|
|
9154
|
-
function safeStringify2(
|
|
9155
|
-
return JSON.stringify(
|
|
9026
|
+
function safeStringify2(x) {
|
|
9027
|
+
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
9156
9028
|
}
|
|
9157
9029
|
exports.safeStringify = safeStringify2;
|
|
9158
9030
|
function getProperty(key) {
|
|
9159
|
-
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) :
|
|
9031
|
+
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
|
|
9160
9032
|
}
|
|
9161
9033
|
exports.getProperty = getProperty;
|
|
9162
9034
|
function getEsmExportName(key) {
|
|
@@ -9553,17 +9425,17 @@ var require_codegen2 = __commonJS({
|
|
|
9553
9425
|
const cond = this.condition;
|
|
9554
9426
|
if (cond === true)
|
|
9555
9427
|
return this.nodes;
|
|
9556
|
-
let
|
|
9557
|
-
if (
|
|
9558
|
-
const ns =
|
|
9559
|
-
|
|
9428
|
+
let e = this.else;
|
|
9429
|
+
if (e) {
|
|
9430
|
+
const ns = e.optimizeNodes();
|
|
9431
|
+
e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
|
|
9560
9432
|
}
|
|
9561
|
-
if (
|
|
9433
|
+
if (e) {
|
|
9562
9434
|
if (cond === false)
|
|
9563
|
-
return
|
|
9435
|
+
return e instanceof _If ? e : e.nodes;
|
|
9564
9436
|
if (this.nodes.length)
|
|
9565
9437
|
return this;
|
|
9566
|
-
return new _If(not(cond),
|
|
9438
|
+
return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
|
|
9567
9439
|
}
|
|
9568
9440
|
if (cond === false || !this.nodes.length)
|
|
9569
9441
|
return void 0;
|
|
@@ -10007,16 +9879,16 @@ var require_codegen2 = __commonJS({
|
|
|
10007
9879
|
delete names[n.str];
|
|
10008
9880
|
return c;
|
|
10009
9881
|
}
|
|
10010
|
-
function canOptimize(
|
|
10011
|
-
return
|
|
9882
|
+
function canOptimize(e) {
|
|
9883
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
|
|
10012
9884
|
}
|
|
10013
9885
|
}
|
|
10014
9886
|
function subtractNames(names, from) {
|
|
10015
9887
|
for (const n in from)
|
|
10016
9888
|
names[n] = (names[n] || 0) - (from[n] || 0);
|
|
10017
9889
|
}
|
|
10018
|
-
function not(
|
|
10019
|
-
return typeof
|
|
9890
|
+
function not(x) {
|
|
9891
|
+
return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
|
|
10020
9892
|
}
|
|
10021
9893
|
exports.not = not;
|
|
10022
9894
|
var andCode = mappend(exports.operators.AND);
|
|
@@ -10030,10 +9902,10 @@ var require_codegen2 = __commonJS({
|
|
|
10030
9902
|
}
|
|
10031
9903
|
exports.or = or;
|
|
10032
9904
|
function mappend(op) {
|
|
10033
|
-
return (
|
|
9905
|
+
return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
|
|
10034
9906
|
}
|
|
10035
|
-
function par(
|
|
10036
|
-
return
|
|
9907
|
+
function par(x) {
|
|
9908
|
+
return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
|
|
10037
9909
|
}
|
|
10038
9910
|
}
|
|
10039
9911
|
});
|
|
@@ -10123,8 +9995,8 @@ var require_util2 = __commonJS({
|
|
|
10123
9995
|
exports.unescapeJsonPointer = unescapeJsonPointer;
|
|
10124
9996
|
function eachItem(xs, f) {
|
|
10125
9997
|
if (Array.isArray(xs)) {
|
|
10126
|
-
for (const
|
|
10127
|
-
f(
|
|
9998
|
+
for (const x of xs)
|
|
9999
|
+
f(x);
|
|
10128
10000
|
} else {
|
|
10129
10001
|
f(xs);
|
|
10130
10002
|
}
|
|
@@ -10169,7 +10041,7 @@ var require_util2 = __commonJS({
|
|
|
10169
10041
|
}
|
|
10170
10042
|
exports.evaluatedPropsToName = evaluatedPropsToName;
|
|
10171
10043
|
function setEvaluated(gen, props, ps) {
|
|
10172
|
-
Object.keys(ps).forEach((
|
|
10044
|
+
Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
|
|
10173
10045
|
}
|
|
10174
10046
|
exports.setEvaluated = setEvaluated;
|
|
10175
10047
|
var snippets = {};
|
|
@@ -10425,8 +10297,8 @@ var require_rules2 = __commonJS({
|
|
|
10425
10297
|
exports.getRules = exports.isJSONType = void 0;
|
|
10426
10298
|
var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
10427
10299
|
var jsonTypes = new Set(_jsonTypes);
|
|
10428
|
-
function isJSONType(
|
|
10429
|
-
return typeof
|
|
10300
|
+
function isJSONType(x) {
|
|
10301
|
+
return typeof x == "string" && jsonTypes.has(x);
|
|
10430
10302
|
}
|
|
10431
10303
|
exports.isJSONType = isJSONType;
|
|
10432
10304
|
function getRules() {
|
|
@@ -10742,11 +10614,11 @@ var require_code4 = __commonJS({
|
|
|
10742
10614
|
}
|
|
10743
10615
|
exports.noPropertyInData = noPropertyInData;
|
|
10744
10616
|
function allSchemaProperties(schemaMap) {
|
|
10745
|
-
return schemaMap ? Object.keys(schemaMap).filter((
|
|
10617
|
+
return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
|
|
10746
10618
|
}
|
|
10747
10619
|
exports.allSchemaProperties = allSchemaProperties;
|
|
10748
10620
|
function schemaProperties(it, schemaMap) {
|
|
10749
|
-
return allSchemaProperties(schemaMap).filter((
|
|
10621
|
+
return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
|
|
10750
10622
|
}
|
|
10751
10623
|
exports.schemaProperties = schemaProperties;
|
|
10752
10624
|
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
|
|
@@ -10765,13 +10637,13 @@ var require_code4 = __commonJS({
|
|
|
10765
10637
|
exports.callValidateCode = callValidateCode;
|
|
10766
10638
|
var newRegExp = (0, codegen_1._)`new RegExp`;
|
|
10767
10639
|
function usePattern({ gen, it: { opts } }, pattern) {
|
|
10768
|
-
const
|
|
10640
|
+
const u = opts.unicodeRegExp ? "u" : "";
|
|
10769
10641
|
const { regExp } = opts.code;
|
|
10770
|
-
const rx = regExp(pattern,
|
|
10642
|
+
const rx = regExp(pattern, u);
|
|
10771
10643
|
return gen.scopeValue("pattern", {
|
|
10772
10644
|
key: rx.toString(),
|
|
10773
10645
|
ref: rx,
|
|
10774
|
-
code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${
|
|
10646
|
+
code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
|
|
10775
10647
|
});
|
|
10776
10648
|
}
|
|
10777
10649
|
exports.usePattern = usePattern;
|
|
@@ -10876,7 +10748,7 @@ var require_keyword2 = __commonJS({
|
|
|
10876
10748
|
}
|
|
10877
10749
|
function validateAsync() {
|
|
10878
10750
|
const ruleErrs = gen.let("ruleErrs", null);
|
|
10879
|
-
gen.try(() => assignValid((0, codegen_1._)`await `), (
|
|
10751
|
+
gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
|
|
10880
10752
|
return ruleErrs;
|
|
10881
10753
|
}
|
|
10882
10754
|
function validateSync() {
|
|
@@ -11189,12 +11061,12 @@ var require_resolve2 = __commonJS({
|
|
|
11189
11061
|
function getFullPath(resolver, id = "", normalize) {
|
|
11190
11062
|
if (normalize !== false)
|
|
11191
11063
|
id = normalizeId(id);
|
|
11192
|
-
const
|
|
11193
|
-
return _getFullPath(resolver,
|
|
11064
|
+
const p = resolver.parse(id);
|
|
11065
|
+
return _getFullPath(resolver, p);
|
|
11194
11066
|
}
|
|
11195
11067
|
exports.getFullPath = getFullPath;
|
|
11196
|
-
function _getFullPath(resolver,
|
|
11197
|
-
const serialized = resolver.serialize(
|
|
11068
|
+
function _getFullPath(resolver, p) {
|
|
11069
|
+
const serialized = resolver.serialize(p);
|
|
11198
11070
|
return serialized.split("#")[0] + "#";
|
|
11199
11071
|
}
|
|
11200
11072
|
exports._getFullPath = _getFullPath;
|
|
@@ -11218,7 +11090,7 @@ var require_resolve2 = __commonJS({
|
|
|
11218
11090
|
const pathPrefix = getFullPath(uriResolver, schId, false);
|
|
11219
11091
|
const localRefs = {};
|
|
11220
11092
|
const schemaRefs = /* @__PURE__ */ new Set();
|
|
11221
|
-
traverse(schema, { allKeys: true }, (sch, jsonPtr,
|
|
11093
|
+
traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
|
|
11222
11094
|
if (parentJsonPtr === void 0)
|
|
11223
11095
|
return;
|
|
11224
11096
|
const fullPath = pathPrefix + jsonPtr;
|
|
@@ -11918,12 +11790,12 @@ var require_compile2 = __commonJS({
|
|
|
11918
11790
|
}
|
|
11919
11791
|
sch.validate = validate;
|
|
11920
11792
|
return sch;
|
|
11921
|
-
} catch (
|
|
11793
|
+
} catch (e) {
|
|
11922
11794
|
delete sch.validate;
|
|
11923
11795
|
delete sch.validateName;
|
|
11924
11796
|
if (sourceCode)
|
|
11925
11797
|
this.logger.error("Error compiling schema, function code:", sourceCode);
|
|
11926
|
-
throw
|
|
11798
|
+
throw e;
|
|
11927
11799
|
} finally {
|
|
11928
11800
|
this._compilations.delete(sch);
|
|
11929
11801
|
}
|
|
@@ -11969,11 +11841,11 @@ var require_compile2 = __commonJS({
|
|
|
11969
11841
|
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
11970
11842
|
}
|
|
11971
11843
|
function resolveSchema(root, ref) {
|
|
11972
|
-
const
|
|
11973
|
-
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver,
|
|
11844
|
+
const p = this.opts.uriResolver.parse(ref);
|
|
11845
|
+
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
|
|
11974
11846
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
11975
11847
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
|
|
11976
|
-
return getJsonPointer.call(this,
|
|
11848
|
+
return getJsonPointer.call(this, p, root);
|
|
11977
11849
|
}
|
|
11978
11850
|
const id = (0, resolve_1.normalizeId)(refPath);
|
|
11979
11851
|
const schOrRef = this.refs[id] || this.schemas[id];
|
|
@@ -11981,7 +11853,7 @@ var require_compile2 = __commonJS({
|
|
|
11981
11853
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
11982
11854
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
|
|
11983
11855
|
return;
|
|
11984
|
-
return getJsonPointer.call(this,
|
|
11856
|
+
return getJsonPointer.call(this, p, sch);
|
|
11985
11857
|
}
|
|
11986
11858
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
|
|
11987
11859
|
return;
|
|
@@ -11995,7 +11867,7 @@ var require_compile2 = __commonJS({
|
|
|
11995
11867
|
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
11996
11868
|
return new SchemaEnv({ schema, schemaId, root, baseId });
|
|
11997
11869
|
}
|
|
11998
|
-
return getJsonPointer.call(this,
|
|
11870
|
+
return getJsonPointer.call(this, p, schOrRef);
|
|
11999
11871
|
}
|
|
12000
11872
|
exports.resolveSchema = resolveSchema;
|
|
12001
11873
|
var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
|
|
@@ -12145,31 +12017,31 @@ var require_core3 = __commonJS({
|
|
|
12145
12017
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
12146
12018
|
};
|
|
12147
12019
|
var MAX_EXPRESSION = 200;
|
|
12148
|
-
function requiredOptions(
|
|
12020
|
+
function requiredOptions(o) {
|
|
12149
12021
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
12150
|
-
const s =
|
|
12151
|
-
const _optz = (_a2 =
|
|
12022
|
+
const s = o.strict;
|
|
12023
|
+
const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
|
|
12152
12024
|
const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
|
|
12153
|
-
const regExp = (_c = (_b =
|
|
12154
|
-
const uriResolver = (_d =
|
|
12025
|
+
const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
|
|
12026
|
+
const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
|
|
12155
12027
|
return {
|
|
12156
|
-
strictSchema: (_f = (_e =
|
|
12157
|
-
strictNumbers: (_h = (_g =
|
|
12158
|
-
strictTypes: (_k = (_j =
|
|
12159
|
-
strictTuples: (_m = (_l =
|
|
12160
|
-
strictRequired: (_p = (_o =
|
|
12161
|
-
code:
|
|
12162
|
-
loopRequired: (_q =
|
|
12163
|
-
loopEnum: (_r =
|
|
12164
|
-
meta: (_s =
|
|
12165
|
-
messages: (_t =
|
|
12166
|
-
inlineRefs: (_u =
|
|
12167
|
-
schemaId: (_v =
|
|
12168
|
-
addUsedSchema: (_w =
|
|
12169
|
-
validateSchema: (_x =
|
|
12170
|
-
validateFormats: (_y =
|
|
12171
|
-
unicodeRegExp: (_z =
|
|
12172
|
-
int32range: (_0 =
|
|
12028
|
+
strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
|
|
12029
|
+
strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
|
|
12030
|
+
strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
|
|
12031
|
+
strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
|
|
12032
|
+
strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
|
|
12033
|
+
code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
|
|
12034
|
+
loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
|
|
12035
|
+
loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
|
|
12036
|
+
meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
|
|
12037
|
+
messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
|
|
12038
|
+
inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
|
|
12039
|
+
schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
|
|
12040
|
+
addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
|
|
12041
|
+
validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
|
|
12042
|
+
validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
|
|
12043
|
+
unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
|
|
12044
|
+
int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
|
|
12173
12045
|
uriResolver
|
|
12174
12046
|
};
|
|
12175
12047
|
}
|
|
@@ -12221,17 +12093,17 @@ var require_core3 = __commonJS({
|
|
|
12221
12093
|
return this.opts.defaultMeta = typeof meta3 == "object" ? meta3[schemaId] || meta3 : void 0;
|
|
12222
12094
|
}
|
|
12223
12095
|
validate(schemaKeyRef, data) {
|
|
12224
|
-
let
|
|
12096
|
+
let v;
|
|
12225
12097
|
if (typeof schemaKeyRef == "string") {
|
|
12226
|
-
|
|
12227
|
-
if (!
|
|
12098
|
+
v = this.getSchema(schemaKeyRef);
|
|
12099
|
+
if (!v)
|
|
12228
12100
|
throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
|
|
12229
12101
|
} else {
|
|
12230
|
-
|
|
12102
|
+
v = this.compile(schemaKeyRef);
|
|
12231
12103
|
}
|
|
12232
|
-
const valid =
|
|
12233
|
-
if (!("$async" in
|
|
12234
|
-
this.errors =
|
|
12104
|
+
const valid = v(data);
|
|
12105
|
+
if (!("$async" in v))
|
|
12106
|
+
this.errors = v.errors;
|
|
12235
12107
|
return valid;
|
|
12236
12108
|
}
|
|
12237
12109
|
compile(schema, _meta) {
|
|
@@ -12257,11 +12129,11 @@ var require_core3 = __commonJS({
|
|
|
12257
12129
|
async function _compileAsync(sch) {
|
|
12258
12130
|
try {
|
|
12259
12131
|
return this._compileSchemaEnv(sch);
|
|
12260
|
-
} catch (
|
|
12261
|
-
if (!(
|
|
12262
|
-
throw
|
|
12263
|
-
checkLoaded.call(this,
|
|
12264
|
-
await loadMissingSchema.call(this,
|
|
12132
|
+
} catch (e) {
|
|
12133
|
+
if (!(e instanceof ref_error_1.default))
|
|
12134
|
+
throw e;
|
|
12135
|
+
checkLoaded.call(this, e);
|
|
12136
|
+
await loadMissingSchema.call(this, e.missingSchema);
|
|
12265
12137
|
return _compileAsync.call(this, sch);
|
|
12266
12138
|
}
|
|
12267
12139
|
}
|
|
@@ -12278,9 +12150,9 @@ var require_core3 = __commonJS({
|
|
|
12278
12150
|
this.addSchema(_schema, ref, meta3);
|
|
12279
12151
|
}
|
|
12280
12152
|
async function _loadSchema(ref) {
|
|
12281
|
-
const
|
|
12282
|
-
if (
|
|
12283
|
-
return
|
|
12153
|
+
const p = this._loading[ref];
|
|
12154
|
+
if (p)
|
|
12155
|
+
return p;
|
|
12284
12156
|
try {
|
|
12285
12157
|
return await (this._loading[ref] = loadSchema(ref));
|
|
12286
12158
|
} finally {
|
|
@@ -12428,7 +12300,7 @@ var require_core3 = __commonJS({
|
|
|
12428
12300
|
type: (0, dataType_1.getJSONTypes)(def.type),
|
|
12429
12301
|
schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
|
|
12430
12302
|
};
|
|
12431
|
-
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (
|
|
12303
|
+
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
|
|
12432
12304
|
return this;
|
|
12433
12305
|
}
|
|
12434
12306
|
getKeyword(keyword) {
|
|
@@ -12457,7 +12329,7 @@ var require_core3 = __commonJS({
|
|
|
12457
12329
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
12458
12330
|
if (!errors || errors.length === 0)
|
|
12459
12331
|
return "No errors";
|
|
12460
|
-
return errors.map((
|
|
12332
|
+
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text4, msg) => text4 + separator + msg);
|
|
12461
12333
|
}
|
|
12462
12334
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
12463
12335
|
const rules = this.RULES.all;
|
|
@@ -12546,11 +12418,11 @@ var require_core3 = __commonJS({
|
|
|
12546
12418
|
Ajv2.ValidationError = validation_error_1.default;
|
|
12547
12419
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
12548
12420
|
exports.default = Ajv2;
|
|
12549
|
-
function checkOptions(checkOpts, options, msg,
|
|
12421
|
+
function checkOptions(checkOpts, options, msg, log3 = "error") {
|
|
12550
12422
|
for (const key in checkOpts) {
|
|
12551
12423
|
const opt = key;
|
|
12552
12424
|
if (opt in options)
|
|
12553
|
-
this.logger[
|
|
12425
|
+
this.logger[log3](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
12554
12426
|
}
|
|
12555
12427
|
}
|
|
12556
12428
|
function getSchEnv(keyRef) {
|
|
@@ -12725,8 +12597,8 @@ var require_ref2 = __commonJS({
|
|
|
12725
12597
|
return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
|
|
12726
12598
|
}
|
|
12727
12599
|
function callValidate(sch) {
|
|
12728
|
-
const
|
|
12729
|
-
callRef(cxt,
|
|
12600
|
+
const v = getValidate(cxt, sch);
|
|
12601
|
+
callRef(cxt, v, sch, sch.$async);
|
|
12730
12602
|
}
|
|
12731
12603
|
function inlineRefSchema(sch) {
|
|
12732
12604
|
const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
|
|
@@ -12748,7 +12620,7 @@ var require_ref2 = __commonJS({
|
|
|
12748
12620
|
return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
|
|
12749
12621
|
}
|
|
12750
12622
|
exports.getValidate = getValidate;
|
|
12751
|
-
function callRef(cxt,
|
|
12623
|
+
function callRef(cxt, v, sch, $async) {
|
|
12752
12624
|
const { gen, it } = cxt;
|
|
12753
12625
|
const { allErrors, schemaEnv: env, opts } = it;
|
|
12754
12626
|
const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
|
|
@@ -12761,20 +12633,20 @@ var require_ref2 = __commonJS({
|
|
|
12761
12633
|
throw new Error("async schema referenced by sync schema");
|
|
12762
12634
|
const valid = gen.let("valid");
|
|
12763
12635
|
gen.try(() => {
|
|
12764
|
-
gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt,
|
|
12765
|
-
addEvaluatedFrom(
|
|
12636
|
+
gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
|
|
12637
|
+
addEvaluatedFrom(v);
|
|
12766
12638
|
if (!allErrors)
|
|
12767
12639
|
gen.assign(valid, true);
|
|
12768
|
-
}, (
|
|
12769
|
-
gen.if((0, codegen_1._)`!(${
|
|
12770
|
-
addErrorsFrom(
|
|
12640
|
+
}, (e) => {
|
|
12641
|
+
gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
|
|
12642
|
+
addErrorsFrom(e);
|
|
12771
12643
|
if (!allErrors)
|
|
12772
12644
|
gen.assign(valid, false);
|
|
12773
12645
|
});
|
|
12774
12646
|
cxt.ok(valid);
|
|
12775
12647
|
}
|
|
12776
12648
|
function callSyncRef() {
|
|
12777
|
-
cxt.result((0, code_1.callValidateCode)(cxt,
|
|
12649
|
+
cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
|
|
12778
12650
|
}
|
|
12779
12651
|
function addErrorsFrom(source) {
|
|
12780
12652
|
const errs = (0, codegen_1._)`${source}.errors`;
|
|
@@ -12971,8 +12843,8 @@ var require_pattern2 = __commonJS({
|
|
|
12971
12843
|
error: error2,
|
|
12972
12844
|
code(cxt) {
|
|
12973
12845
|
const { data, $data, schema, schemaCode, it } = cxt;
|
|
12974
|
-
const
|
|
12975
|
-
const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${
|
|
12846
|
+
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
12847
|
+
const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
|
|
12976
12848
|
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
12977
12849
|
}
|
|
12978
12850
|
};
|
|
@@ -13141,8 +13013,8 @@ var require_uniqueItems2 = __commonJS({
|
|
|
13141
13013
|
var util_1 = require_util2();
|
|
13142
13014
|
var equal_1 = require_equal2();
|
|
13143
13015
|
var error2 = {
|
|
13144
|
-
message: ({ params: { i, j
|
|
13145
|
-
params: ({ params: { i, j
|
|
13016
|
+
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
13017
|
+
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
13146
13018
|
};
|
|
13147
13019
|
var def = {
|
|
13148
13020
|
keyword: "uniqueItems",
|
|
@@ -13160,15 +13032,15 @@ var require_uniqueItems2 = __commonJS({
|
|
|
13160
13032
|
cxt.ok(valid);
|
|
13161
13033
|
function validateUniqueItems() {
|
|
13162
13034
|
const i = gen.let("i", (0, codegen_1._)`${data}.length`);
|
|
13163
|
-
const
|
|
13164
|
-
cxt.setParams({ i, j
|
|
13035
|
+
const j = gen.let("j");
|
|
13036
|
+
cxt.setParams({ i, j });
|
|
13165
13037
|
gen.assign(valid, true);
|
|
13166
|
-
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i,
|
|
13038
|
+
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
|
|
13167
13039
|
}
|
|
13168
13040
|
function canOptimize() {
|
|
13169
13041
|
return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
|
|
13170
13042
|
}
|
|
13171
|
-
function loopN(i,
|
|
13043
|
+
function loopN(i, j) {
|
|
13172
13044
|
const item = gen.name("item");
|
|
13173
13045
|
const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
|
|
13174
13046
|
const indices = gen.const("indices", (0, codegen_1._)`{}`);
|
|
@@ -13178,16 +13050,16 @@ var require_uniqueItems2 = __commonJS({
|
|
|
13178
13050
|
if (itemTypes.length > 1)
|
|
13179
13051
|
gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
|
|
13180
13052
|
gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
|
|
13181
|
-
gen.assign(
|
|
13053
|
+
gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
|
|
13182
13054
|
cxt.error();
|
|
13183
13055
|
gen.assign(valid, false).break();
|
|
13184
13056
|
}).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
|
|
13185
13057
|
});
|
|
13186
13058
|
}
|
|
13187
|
-
function loopN2(i,
|
|
13059
|
+
function loopN2(i, j) {
|
|
13188
13060
|
const eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
13189
13061
|
const outer = gen.name("outer");
|
|
13190
|
-
gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${
|
|
13062
|
+
gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
|
|
13191
13063
|
cxt.error();
|
|
13192
13064
|
gen.assign(valid, false).break(outer);
|
|
13193
13065
|
})));
|
|
@@ -13264,7 +13136,7 @@ var require_enum2 = __commonJS({
|
|
|
13264
13136
|
cxt.pass(valid);
|
|
13265
13137
|
function loopEnum() {
|
|
13266
13138
|
gen.assign(valid, false);
|
|
13267
|
-
gen.forOf("v", schemaCode, (
|
|
13139
|
+
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
13268
13140
|
}
|
|
13269
13141
|
function equalCode(vSchema, i) {
|
|
13270
13142
|
const sch = schema[i];
|
|
@@ -13411,10 +13283,10 @@ var require_items2 = __commonJS({
|
|
|
13411
13283
|
});
|
|
13412
13284
|
function checkStrictTuple(sch) {
|
|
13413
13285
|
const { opts, errSchemaPath } = it;
|
|
13414
|
-
const
|
|
13415
|
-
const fullTuple =
|
|
13286
|
+
const l = schArr.length;
|
|
13287
|
+
const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
|
|
13416
13288
|
if (opts.strictTuples && !fullTuple) {
|
|
13417
|
-
const msg = `"${keyword}" is ${
|
|
13289
|
+
const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
|
|
13418
13290
|
(0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
|
|
13419
13291
|
}
|
|
13420
13292
|
}
|
|
@@ -13753,12 +13625,12 @@ var require_additionalProperties2 = __commonJS({
|
|
|
13753
13625
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
13754
13626
|
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
|
|
13755
13627
|
} else if (props.length) {
|
|
13756
|
-
definedProp = (0, codegen_1.or)(...props.map((
|
|
13628
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
|
|
13757
13629
|
} else {
|
|
13758
13630
|
definedProp = codegen_1.nil;
|
|
13759
13631
|
}
|
|
13760
13632
|
if (patProps.length) {
|
|
13761
|
-
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((
|
|
13633
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
|
|
13762
13634
|
}
|
|
13763
13635
|
return (0, codegen_1.not)(definedProp);
|
|
13764
13636
|
}
|
|
@@ -13838,7 +13710,7 @@ var require_properties2 = __commonJS({
|
|
|
13838
13710
|
if (it.opts.unevaluated && allProps.length && it.props !== true) {
|
|
13839
13711
|
it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
13840
13712
|
}
|
|
13841
|
-
const properties = allProps.filter((
|
|
13713
|
+
const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
13842
13714
|
if (properties.length === 0)
|
|
13843
13715
|
return;
|
|
13844
13716
|
const valid = gen.name("valid");
|
|
@@ -13888,7 +13760,7 @@ var require_patternProperties2 = __commonJS({
|
|
|
13888
13760
|
const { gen, schema, data, parentSchema, it } = cxt;
|
|
13889
13761
|
const { opts } = it;
|
|
13890
13762
|
const patterns = (0, code_1.allSchemaProperties)(schema);
|
|
13891
|
-
const alwaysValidPatterns = patterns.filter((
|
|
13763
|
+
const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
13892
13764
|
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
|
|
13893
13765
|
return;
|
|
13894
13766
|
}
|
|
@@ -14650,7 +14522,7 @@ var require_ajv2 = __commonJS({
|
|
|
14650
14522
|
var Ajv2 = class extends core_1.default {
|
|
14651
14523
|
_addVocabularies() {
|
|
14652
14524
|
super._addVocabularies();
|
|
14653
|
-
draft7_1.default.forEach((
|
|
14525
|
+
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
14654
14526
|
if (this.opts.discriminator)
|
|
14655
14527
|
this.addKeyword(discriminator_1.default);
|
|
14656
14528
|
}
|
|
@@ -15337,44 +15209,51 @@ function createOptionResolvers(init) {
|
|
|
15337
15209
|
// packages/design-system/src/tokens/colors.ts
|
|
15338
15210
|
import chalk2 from "chalk";
|
|
15339
15211
|
var dark = {
|
|
15340
|
-
header: (
|
|
15341
|
-
divider: (
|
|
15342
|
-
prompt: (
|
|
15343
|
-
number: (
|
|
15344
|
-
intro: (
|
|
15212
|
+
header: (text4) => chalk2.magentaBright.bold(text4),
|
|
15213
|
+
divider: (text4) => chalk2.dim(text4),
|
|
15214
|
+
prompt: (text4) => chalk2.cyan(text4),
|
|
15215
|
+
number: (text4) => chalk2.cyanBright(text4),
|
|
15216
|
+
intro: (text4) => chalk2.bgMagenta.white(` Poe - ${text4} `),
|
|
15345
15217
|
resolvedSymbol: chalk2.magenta("\u25C7"),
|
|
15346
15218
|
errorSymbol: chalk2.red("\u25A0"),
|
|
15347
|
-
accent: (
|
|
15348
|
-
muted: (
|
|
15349
|
-
success: (
|
|
15350
|
-
warning: (
|
|
15351
|
-
error: (
|
|
15352
|
-
info: (
|
|
15219
|
+
accent: (text4) => chalk2.cyan(text4),
|
|
15220
|
+
muted: (text4) => chalk2.dim(text4),
|
|
15221
|
+
success: (text4) => chalk2.green(text4),
|
|
15222
|
+
warning: (text4) => chalk2.yellow(text4),
|
|
15223
|
+
error: (text4) => chalk2.red(text4),
|
|
15224
|
+
info: (text4) => chalk2.magenta(text4)
|
|
15353
15225
|
};
|
|
15354
15226
|
var light = {
|
|
15355
|
-
header: (
|
|
15356
|
-
divider: (
|
|
15357
|
-
prompt: (
|
|
15358
|
-
number: (
|
|
15359
|
-
intro: (
|
|
15227
|
+
header: (text4) => chalk2.hex("#a200ff").bold(text4),
|
|
15228
|
+
divider: (text4) => chalk2.hex("#666666")(text4),
|
|
15229
|
+
prompt: (text4) => chalk2.hex("#006699").bold(text4),
|
|
15230
|
+
number: (text4) => chalk2.hex("#0077cc").bold(text4),
|
|
15231
|
+
intro: (text4) => chalk2.bgHex("#a200ff").white(` Poe - ${text4} `),
|
|
15360
15232
|
resolvedSymbol: chalk2.hex("#a200ff")("\u25C7"),
|
|
15361
15233
|
errorSymbol: chalk2.hex("#cc0000")("\u25A0"),
|
|
15362
|
-
accent: (
|
|
15363
|
-
muted: (
|
|
15364
|
-
success: (
|
|
15365
|
-
warning: (
|
|
15366
|
-
error: (
|
|
15367
|
-
info: (
|
|
15234
|
+
accent: (text4) => chalk2.hex("#006699").bold(text4),
|
|
15235
|
+
muted: (text4) => chalk2.hex("#666666")(text4),
|
|
15236
|
+
success: (text4) => chalk2.hex("#008800")(text4),
|
|
15237
|
+
warning: (text4) => chalk2.hex("#cc6600")(text4),
|
|
15238
|
+
error: (text4) => chalk2.hex("#cc0000")(text4),
|
|
15239
|
+
info: (text4) => chalk2.hex("#a200ff")(text4)
|
|
15368
15240
|
};
|
|
15369
15241
|
|
|
15370
15242
|
// packages/design-system/src/tokens/typography.ts
|
|
15371
15243
|
import chalk3 from "chalk";
|
|
15372
15244
|
var typography = {
|
|
15373
|
-
bold: (
|
|
15374
|
-
dim: (
|
|
15375
|
-
italic: (
|
|
15376
|
-
underline: (
|
|
15377
|
-
strikethrough: (
|
|
15245
|
+
bold: (text4) => chalk3.bold(text4),
|
|
15246
|
+
dim: (text4) => chalk3.dim(text4),
|
|
15247
|
+
italic: (text4) => chalk3.italic(text4),
|
|
15248
|
+
underline: (text4) => chalk3.underline(text4),
|
|
15249
|
+
strikethrough: (text4) => chalk3.strikethrough(text4)
|
|
15250
|
+
};
|
|
15251
|
+
|
|
15252
|
+
// packages/design-system/src/tokens/widths.ts
|
|
15253
|
+
var widths = {
|
|
15254
|
+
header: 60,
|
|
15255
|
+
helpColumn: 24,
|
|
15256
|
+
maxLine: 80
|
|
15378
15257
|
};
|
|
15379
15258
|
|
|
15380
15259
|
// packages/design-system/src/components/text.ts
|
|
@@ -15493,636 +15372,8 @@ var symbols = {
|
|
|
15493
15372
|
inactive: "\u25CB"
|
|
15494
15373
|
};
|
|
15495
15374
|
|
|
15496
|
-
// node_modules/@clack/prompts/dist/index.mjs
|
|
15497
|
-
import { stripVTControlCharacters as S2 } from "node:util";
|
|
15498
|
-
|
|
15499
|
-
// node_modules/@clack/core/dist/index.mjs
|
|
15500
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
15501
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
15502
|
-
import { stdin as j, stdout as M } from "node:process";
|
|
15503
|
-
import * as g from "node:readline";
|
|
15504
|
-
import O from "node:readline";
|
|
15505
|
-
import { Writable as X } from "node:stream";
|
|
15506
|
-
function DD({ onlyFirst: e2 = false } = {}) {
|
|
15507
|
-
const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
15508
|
-
return new RegExp(t, e2 ? void 0 : "g");
|
|
15509
|
-
}
|
|
15510
|
-
var uD = DD();
|
|
15511
|
-
function P(e2) {
|
|
15512
|
-
if (typeof e2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e2}\``);
|
|
15513
|
-
return e2.replace(uD, "");
|
|
15514
|
-
}
|
|
15515
|
-
function L(e2) {
|
|
15516
|
-
return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
|
|
15517
|
-
}
|
|
15518
|
-
var W = { exports: {} };
|
|
15519
|
-
(function(e2) {
|
|
15520
|
-
var u2 = {};
|
|
15521
|
-
e2.exports = u2, u2.eastAsianWidth = function(F2) {
|
|
15522
|
-
var s = F2.charCodeAt(0), i = F2.length == 2 ? F2.charCodeAt(1) : 0, D2 = s;
|
|
15523
|
-
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D2 = s << 10 | i, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
|
|
15524
|
-
}, u2.characterLength = function(F2) {
|
|
15525
|
-
var s = this.eastAsianWidth(F2);
|
|
15526
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
15527
|
-
};
|
|
15528
|
-
function t(F2) {
|
|
15529
|
-
return F2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
15530
|
-
}
|
|
15531
|
-
u2.length = function(F2) {
|
|
15532
|
-
for (var s = t(F2), i = 0, D2 = 0; D2 < s.length; D2++) i = i + this.characterLength(s[D2]);
|
|
15533
|
-
return i;
|
|
15534
|
-
}, u2.slice = function(F2, s, i) {
|
|
15535
|
-
textLen = u2.length(F2), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
15536
|
-
for (var D2 = "", C2 = 0, n = t(F2), E = 0; E < n.length; E++) {
|
|
15537
|
-
var a = n[E], o2 = u2.length(a);
|
|
15538
|
-
if (C2 >= s - (o2 == 2 ? 1 : 0)) if (C2 + o2 <= i) D2 += a;
|
|
15539
|
-
else break;
|
|
15540
|
-
C2 += o2;
|
|
15541
|
-
}
|
|
15542
|
-
return D2;
|
|
15543
|
-
};
|
|
15544
|
-
})(W);
|
|
15545
|
-
var tD = W.exports;
|
|
15546
|
-
var eD = L(tD);
|
|
15547
|
-
var FD = function() {
|
|
15548
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
15549
|
-
};
|
|
15550
|
-
var sD = L(FD);
|
|
15551
|
-
function p(e2, u2 = {}) {
|
|
15552
|
-
if (typeof e2 != "string" || e2.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, e2 = P(e2), e2.length === 0)) return 0;
|
|
15553
|
-
e2 = e2.replace(sD(), " ");
|
|
15554
|
-
const t = u2.ambiguousIsNarrow ? 1 : 2;
|
|
15555
|
-
let F2 = 0;
|
|
15556
|
-
for (const s of e2) {
|
|
15557
|
-
const i = s.codePointAt(0);
|
|
15558
|
-
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
15559
|
-
switch (eD.eastAsianWidth(s)) {
|
|
15560
|
-
case "F":
|
|
15561
|
-
case "W":
|
|
15562
|
-
F2 += 2;
|
|
15563
|
-
break;
|
|
15564
|
-
case "A":
|
|
15565
|
-
F2 += t;
|
|
15566
|
-
break;
|
|
15567
|
-
default:
|
|
15568
|
-
F2 += 1;
|
|
15569
|
-
}
|
|
15570
|
-
}
|
|
15571
|
-
return F2;
|
|
15572
|
-
}
|
|
15573
|
-
var w = 10;
|
|
15574
|
-
var N = (e2 = 0) => (u2) => `\x1B[${u2 + e2}m`;
|
|
15575
|
-
var I = (e2 = 0) => (u2) => `\x1B[${38 + e2};5;${u2}m`;
|
|
15576
|
-
var R = (e2 = 0) => (u2, t, F2) => `\x1B[${38 + e2};2;${u2};${t};${F2}m`;
|
|
15577
|
-
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
15578
|
-
Object.keys(r.modifier);
|
|
15579
|
-
var iD = Object.keys(r.color);
|
|
15580
|
-
var CD = Object.keys(r.bgColor);
|
|
15581
|
-
[...iD, ...CD];
|
|
15582
|
-
function rD() {
|
|
15583
|
-
const e2 = /* @__PURE__ */ new Map();
|
|
15584
|
-
for (const [u2, t] of Object.entries(r)) {
|
|
15585
|
-
for (const [F2, s] of Object.entries(t)) r[F2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F2] = r[F2], e2.set(s[0], s[1]);
|
|
15586
|
-
Object.defineProperty(r, u2, { value: t, enumerable: false });
|
|
15587
|
-
}
|
|
15588
|
-
return Object.defineProperty(r, "codes", { value: e2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, { rgbToAnsi256: { value: (u2, t, F2) => u2 === t && t === F2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
|
|
15589
|
-
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
|
|
15590
|
-
if (!t) return [0, 0, 0];
|
|
15591
|
-
let [F2] = t;
|
|
15592
|
-
F2.length === 3 && (F2 = [...F2].map((i) => i + i).join(""));
|
|
15593
|
-
const s = Number.parseInt(F2, 16);
|
|
15594
|
-
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
15595
|
-
}, enumerable: false }, hexToAnsi256: { value: (u2) => r.rgbToAnsi256(...r.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
|
|
15596
|
-
if (u2 < 8) return 30 + u2;
|
|
15597
|
-
if (u2 < 16) return 90 + (u2 - 8);
|
|
15598
|
-
let t, F2, s;
|
|
15599
|
-
if (u2 >= 232) t = ((u2 - 232) * 10 + 8) / 255, F2 = t, s = t;
|
|
15600
|
-
else {
|
|
15601
|
-
u2 -= 16;
|
|
15602
|
-
const C2 = u2 % 36;
|
|
15603
|
-
t = Math.floor(u2 / 36) / 5, F2 = Math.floor(C2 / 6) / 5, s = C2 % 6 / 5;
|
|
15604
|
-
}
|
|
15605
|
-
const i = Math.max(t, F2, s) * 2;
|
|
15606
|
-
if (i === 0) return 30;
|
|
15607
|
-
let D2 = 30 + (Math.round(s) << 2 | Math.round(F2) << 1 | Math.round(t));
|
|
15608
|
-
return i === 2 && (D2 += 60), D2;
|
|
15609
|
-
}, enumerable: false }, rgbToAnsi: { value: (u2, t, F2) => r.ansi256ToAnsi(r.rgbToAnsi256(u2, t, F2)), enumerable: false }, hexToAnsi: { value: (u2) => r.ansi256ToAnsi(r.hexToAnsi256(u2)), enumerable: false } }), r;
|
|
15610
|
-
}
|
|
15611
|
-
var ED = rD();
|
|
15612
|
-
var d = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
15613
|
-
var oD = 39;
|
|
15614
|
-
var y = "\x07";
|
|
15615
|
-
var V = "[";
|
|
15616
|
-
var nD = "]";
|
|
15617
|
-
var G = "m";
|
|
15618
|
-
var _ = `${nD}8;;`;
|
|
15619
|
-
var z = (e2) => `${d.values().next().value}${V}${e2}${G}`;
|
|
15620
|
-
var K = (e2) => `${d.values().next().value}${_}${e2}${y}`;
|
|
15621
|
-
var aD = (e2) => e2.split(" ").map((u2) => p(u2));
|
|
15622
|
-
var k = (e2, u2, t) => {
|
|
15623
|
-
const F2 = [...u2];
|
|
15624
|
-
let s = false, i = false, D2 = p(P(e2[e2.length - 1]));
|
|
15625
|
-
for (const [C2, n] of F2.entries()) {
|
|
15626
|
-
const E = p(n);
|
|
15627
|
-
if (D2 + E <= t ? e2[e2.length - 1] += n : (e2.push(n), D2 = 0), d.has(n) && (s = true, i = F2.slice(C2 + 1).join("").startsWith(_)), s) {
|
|
15628
|
-
i ? n === y && (s = false, i = false) : n === G && (s = false);
|
|
15629
|
-
continue;
|
|
15630
|
-
}
|
|
15631
|
-
D2 += E, D2 === t && C2 < F2.length - 1 && (e2.push(""), D2 = 0);
|
|
15632
|
-
}
|
|
15633
|
-
!D2 && e2[e2.length - 1].length > 0 && e2.length > 1 && (e2[e2.length - 2] += e2.pop());
|
|
15634
|
-
};
|
|
15635
|
-
var hD = (e2) => {
|
|
15636
|
-
const u2 = e2.split(" ");
|
|
15637
|
-
let t = u2.length;
|
|
15638
|
-
for (; t > 0 && !(p(u2[t - 1]) > 0); ) t--;
|
|
15639
|
-
return t === u2.length ? e2 : u2.slice(0, t).join(" ") + u2.slice(t).join("");
|
|
15640
|
-
};
|
|
15641
|
-
var lD = (e2, u2, t = {}) => {
|
|
15642
|
-
if (t.trim !== false && e2.trim() === "") return "";
|
|
15643
|
-
let F2 = "", s, i;
|
|
15644
|
-
const D2 = aD(e2);
|
|
15645
|
-
let C2 = [""];
|
|
15646
|
-
for (const [E, a] of e2.split(" ").entries()) {
|
|
15647
|
-
t.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
|
|
15648
|
-
let o2 = p(C2[C2.length - 1]);
|
|
15649
|
-
if (E !== 0 && (o2 >= u2 && (t.wordWrap === false || t.trim === false) && (C2.push(""), o2 = 0), (o2 > 0 || t.trim === false) && (C2[C2.length - 1] += " ", o2++)), t.hard && D2[E] > u2) {
|
|
15650
|
-
const c = u2 - o2, f = 1 + Math.floor((D2[E] - c - 1) / u2);
|
|
15651
|
-
Math.floor((D2[E] - 1) / u2) < f && C2.push(""), k(C2, a, u2);
|
|
15652
|
-
continue;
|
|
15653
|
-
}
|
|
15654
|
-
if (o2 + D2[E] > u2 && o2 > 0 && D2[E] > 0) {
|
|
15655
|
-
if (t.wordWrap === false && o2 < u2) {
|
|
15656
|
-
k(C2, a, u2);
|
|
15657
|
-
continue;
|
|
15658
|
-
}
|
|
15659
|
-
C2.push("");
|
|
15660
|
-
}
|
|
15661
|
-
if (o2 + D2[E] > u2 && t.wordWrap === false) {
|
|
15662
|
-
k(C2, a, u2);
|
|
15663
|
-
continue;
|
|
15664
|
-
}
|
|
15665
|
-
C2[C2.length - 1] += a;
|
|
15666
|
-
}
|
|
15667
|
-
t.trim !== false && (C2 = C2.map((E) => hD(E)));
|
|
15668
|
-
const n = [...C2.join(`
|
|
15669
|
-
`)];
|
|
15670
|
-
for (const [E, a] of n.entries()) {
|
|
15671
|
-
if (F2 += a, d.has(a)) {
|
|
15672
|
-
const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
|
|
15673
|
-
if (c.code !== void 0) {
|
|
15674
|
-
const f = Number.parseFloat(c.code);
|
|
15675
|
-
s = f === oD ? void 0 : f;
|
|
15676
|
-
} else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
|
|
15677
|
-
}
|
|
15678
|
-
const o2 = ED.codes.get(Number(s));
|
|
15679
|
-
n[E + 1] === `
|
|
15680
|
-
` ? (i && (F2 += K("")), s && o2 && (F2 += z(o2))) : a === `
|
|
15681
|
-
` && (s && o2 && (F2 += z(s)), i && (F2 += K(i)));
|
|
15682
|
-
}
|
|
15683
|
-
return F2;
|
|
15684
|
-
};
|
|
15685
|
-
function Y(e2, u2, t) {
|
|
15686
|
-
return String(e2).normalize().replace(/\r\n/g, `
|
|
15687
|
-
`).split(`
|
|
15688
|
-
`).map((F2) => lD(F2, u2, t)).join(`
|
|
15689
|
-
`);
|
|
15690
|
-
}
|
|
15691
|
-
var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
15692
|
-
var B = { actions: new Set(xD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
|
|
15693
|
-
function $(e2, u2) {
|
|
15694
|
-
if (typeof e2 == "string") return B.aliases.get(e2) === u2;
|
|
15695
|
-
for (const t of e2) if (t !== void 0 && $(t, u2)) return true;
|
|
15696
|
-
return false;
|
|
15697
|
-
}
|
|
15698
|
-
function BD(e2, u2) {
|
|
15699
|
-
if (e2 === u2) return;
|
|
15700
|
-
const t = e2.split(`
|
|
15701
|
-
`), F2 = u2.split(`
|
|
15702
|
-
`), s = [];
|
|
15703
|
-
for (let i = 0; i < Math.max(t.length, F2.length); i++) t[i] !== F2[i] && s.push(i);
|
|
15704
|
-
return s;
|
|
15705
|
-
}
|
|
15706
|
-
var AD = globalThis.process.platform.startsWith("win");
|
|
15707
|
-
var S = /* @__PURE__ */ Symbol("clack:cancel");
|
|
15708
|
-
function pD(e2) {
|
|
15709
|
-
return e2 === S;
|
|
15710
|
-
}
|
|
15711
|
-
function m(e2, u2) {
|
|
15712
|
-
const t = e2;
|
|
15713
|
-
t.isTTY && t.setRawMode(u2);
|
|
15714
|
-
}
|
|
15715
|
-
function fD({ input: e2 = j, output: u2 = M, overwrite: t = true, hideCursor: F2 = true } = {}) {
|
|
15716
|
-
const s = g.createInterface({ input: e2, output: u2, prompt: "", tabSize: 1 });
|
|
15717
|
-
g.emitKeypressEvents(e2, s), e2.isTTY && e2.setRawMode(true);
|
|
15718
|
-
const i = (D2, { name: C2, sequence: n }) => {
|
|
15719
|
-
const E = String(D2);
|
|
15720
|
-
if ($([E, C2, n], "cancel")) {
|
|
15721
|
-
F2 && u2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
15722
|
-
return;
|
|
15723
|
-
}
|
|
15724
|
-
if (!t) return;
|
|
15725
|
-
const a = C2 === "return" ? 0 : -1, o2 = C2 === "return" ? -1 : 0;
|
|
15726
|
-
g.moveCursor(u2, a, o2, () => {
|
|
15727
|
-
g.clearLine(u2, 1, () => {
|
|
15728
|
-
e2.once("keypress", i);
|
|
15729
|
-
});
|
|
15730
|
-
});
|
|
15731
|
-
};
|
|
15732
|
-
return F2 && u2.write(import_sisteransi.cursor.hide), e2.once("keypress", i), () => {
|
|
15733
|
-
e2.off("keypress", i), F2 && u2.write(import_sisteransi.cursor.show), e2.isTTY && !AD && e2.setRawMode(false), s.terminal = false, s.close();
|
|
15734
|
-
};
|
|
15735
|
-
}
|
|
15736
|
-
var gD = Object.defineProperty;
|
|
15737
|
-
var vD = (e2, u2, t) => u2 in e2 ? gD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
|
|
15738
|
-
var h = (e2, u2, t) => (vD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
|
|
15739
|
-
var x = class {
|
|
15740
|
-
constructor(u2, t = true) {
|
|
15741
|
-
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
15742
|
-
const { input: F2 = j, output: s = M, render: i, signal: D2, ...C2 } = u2;
|
|
15743
|
-
this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D2, this.input = F2, this.output = s;
|
|
15744
|
-
}
|
|
15745
|
-
unsubscribe() {
|
|
15746
|
-
this._subscribers.clear();
|
|
15747
|
-
}
|
|
15748
|
-
setSubscriber(u2, t) {
|
|
15749
|
-
const F2 = this._subscribers.get(u2) ?? [];
|
|
15750
|
-
F2.push(t), this._subscribers.set(u2, F2);
|
|
15751
|
-
}
|
|
15752
|
-
on(u2, t) {
|
|
15753
|
-
this.setSubscriber(u2, { cb: t });
|
|
15754
|
-
}
|
|
15755
|
-
once(u2, t) {
|
|
15756
|
-
this.setSubscriber(u2, { cb: t, once: true });
|
|
15757
|
-
}
|
|
15758
|
-
emit(u2, ...t) {
|
|
15759
|
-
const F2 = this._subscribers.get(u2) ?? [], s = [];
|
|
15760
|
-
for (const i of F2) i.cb(...t), i.once && s.push(() => F2.splice(F2.indexOf(i), 1));
|
|
15761
|
-
for (const i of s) i();
|
|
15762
|
-
}
|
|
15763
|
-
prompt() {
|
|
15764
|
-
return new Promise((u2, t) => {
|
|
15765
|
-
if (this._abortSignal) {
|
|
15766
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u2(S);
|
|
15767
|
-
this._abortSignal.addEventListener("abort", () => {
|
|
15768
|
-
this.state = "cancel", this.close();
|
|
15769
|
-
}, { once: true });
|
|
15770
|
-
}
|
|
15771
|
-
const F2 = new X();
|
|
15772
|
-
F2._write = (s, i, D2) => {
|
|
15773
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
|
|
15774
|
-
}, this.input.pipe(F2), this.rl = O.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
15775
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(this.value);
|
|
15776
|
-
}), this.once("cancel", () => {
|
|
15777
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(S);
|
|
15778
|
-
});
|
|
15779
|
-
});
|
|
15780
|
-
}
|
|
15781
|
-
onKeypress(u2, t) {
|
|
15782
|
-
if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), t?.name === "return") {
|
|
15783
|
-
if (this.opts.validate) {
|
|
15784
|
-
const F2 = this.opts.validate(this.value);
|
|
15785
|
-
F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", this.rl?.write(this.value));
|
|
15786
|
-
}
|
|
15787
|
-
this.state !== "error" && (this.state = "submit");
|
|
15788
|
-
}
|
|
15789
|
-
$([u2, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
15790
|
-
}
|
|
15791
|
-
close() {
|
|
15792
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
15793
|
-
`), m(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
15794
|
-
}
|
|
15795
|
-
restoreCursor() {
|
|
15796
|
-
const u2 = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
15797
|
-
`).length - 1;
|
|
15798
|
-
this.output.write(import_sisteransi.cursor.move(-999, u2 * -1));
|
|
15799
|
-
}
|
|
15800
|
-
render() {
|
|
15801
|
-
const u2 = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
15802
|
-
if (u2 !== this._prevFrame) {
|
|
15803
|
-
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
15804
|
-
else {
|
|
15805
|
-
const t = BD(this._prevFrame, u2);
|
|
15806
|
-
if (this.restoreCursor(), t && t?.length === 1) {
|
|
15807
|
-
const F2 = t[0];
|
|
15808
|
-
this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
15809
|
-
const s = u2.split(`
|
|
15810
|
-
`);
|
|
15811
|
-
this.output.write(s[F2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s.length - F2 - 1));
|
|
15812
|
-
return;
|
|
15813
|
-
}
|
|
15814
|
-
if (t && t?.length > 1) {
|
|
15815
|
-
const F2 = t[0];
|
|
15816
|
-
this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.down());
|
|
15817
|
-
const s = u2.split(`
|
|
15818
|
-
`).slice(F2);
|
|
15819
|
-
this.output.write(s.join(`
|
|
15820
|
-
`)), this._prevFrame = u2;
|
|
15821
|
-
return;
|
|
15822
|
-
}
|
|
15823
|
-
this.output.write(import_sisteransi.erase.down());
|
|
15824
|
-
}
|
|
15825
|
-
this.output.write(u2), this.state === "initial" && (this.state = "active"), this._prevFrame = u2;
|
|
15826
|
-
}
|
|
15827
|
-
}
|
|
15828
|
-
};
|
|
15829
|
-
var A;
|
|
15830
|
-
A = /* @__PURE__ */ new WeakMap();
|
|
15831
|
-
var TD = Object.defineProperty;
|
|
15832
|
-
var jD = (e2, u2, t) => u2 in e2 ? TD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
|
|
15833
|
-
var U = (e2, u2, t) => (jD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
|
|
15834
|
-
var MD = class extends x {
|
|
15835
|
-
constructor({ mask: u2, ...t }) {
|
|
15836
|
-
super(t), U(this, "valueWithCursor", ""), U(this, "_mask", "\u2022"), this._mask = u2 ?? "\u2022", this.on("finalize", () => {
|
|
15837
|
-
this.valueWithCursor = this.masked;
|
|
15838
|
-
}), this.on("value", () => {
|
|
15839
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
15840
|
-
else {
|
|
15841
|
-
const F2 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
15842
|
-
this.valueWithCursor = `${F2}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
|
|
15843
|
-
}
|
|
15844
|
-
});
|
|
15845
|
-
}
|
|
15846
|
-
get cursor() {
|
|
15847
|
-
return this._cursor;
|
|
15848
|
-
}
|
|
15849
|
-
get masked() {
|
|
15850
|
-
return this.value.replaceAll(/./g, this._mask);
|
|
15851
|
-
}
|
|
15852
|
-
};
|
|
15853
|
-
var OD = Object.defineProperty;
|
|
15854
|
-
var PD = (e2, u2, t) => u2 in e2 ? OD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
|
|
15855
|
-
var J = (e2, u2, t) => (PD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
|
|
15856
|
-
var LD = class extends x {
|
|
15857
|
-
constructor(u2) {
|
|
15858
|
-
super(u2, false), J(this, "options"), J(this, "cursor", 0), this.options = u2.options, this.cursor = this.options.findIndex(({ value: t }) => t === u2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
|
|
15859
|
-
switch (t) {
|
|
15860
|
-
case "left":
|
|
15861
|
-
case "up":
|
|
15862
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
15863
|
-
break;
|
|
15864
|
-
case "down":
|
|
15865
|
-
case "right":
|
|
15866
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
15867
|
-
break;
|
|
15868
|
-
}
|
|
15869
|
-
this.changeValue();
|
|
15870
|
-
});
|
|
15871
|
-
}
|
|
15872
|
-
get _value() {
|
|
15873
|
-
return this.options[this.cursor];
|
|
15874
|
-
}
|
|
15875
|
-
changeValue() {
|
|
15876
|
-
this.value = this._value.value;
|
|
15877
|
-
}
|
|
15878
|
-
};
|
|
15879
|
-
var RD = class extends x {
|
|
15880
|
-
get valueWithCursor() {
|
|
15881
|
-
if (this.state === "submit") return this.value;
|
|
15882
|
-
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
15883
|
-
const u2 = this.value.slice(0, this.cursor), [t, ...F2] = this.value.slice(this.cursor);
|
|
15884
|
-
return `${u2}${import_picocolors.default.inverse(t)}${F2.join("")}`;
|
|
15885
|
-
}
|
|
15886
|
-
get cursor() {
|
|
15887
|
-
return this._cursor;
|
|
15888
|
-
}
|
|
15889
|
-
constructor(u2) {
|
|
15890
|
-
super(u2), this.on("finalize", () => {
|
|
15891
|
-
this.value || (this.value = u2.defaultValue);
|
|
15892
|
-
});
|
|
15893
|
-
}
|
|
15894
|
-
};
|
|
15895
|
-
|
|
15896
|
-
// node_modules/@clack/prompts/dist/index.mjs
|
|
15897
|
-
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
15898
|
-
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
15899
|
-
import y2 from "node:process";
|
|
15900
|
-
function ce() {
|
|
15901
|
-
return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
15902
|
-
}
|
|
15903
|
-
var V2 = ce();
|
|
15904
|
-
var u = (t, n) => V2 ? t : n;
|
|
15905
|
-
var le = u("\u25C6", "*");
|
|
15906
|
-
var L2 = u("\u25A0", "x");
|
|
15907
|
-
var W2 = u("\u25B2", "x");
|
|
15908
|
-
var C = u("\u25C7", "o");
|
|
15909
|
-
var ue = u("\u250C", "T");
|
|
15910
|
-
var o = u("\u2502", "|");
|
|
15911
|
-
var d2 = u("\u2514", "\u2014");
|
|
15912
|
-
var k2 = u("\u25CF", ">");
|
|
15913
|
-
var P2 = u("\u25CB", " ");
|
|
15914
|
-
var A2 = u("\u25FB", "[\u2022]");
|
|
15915
|
-
var T = u("\u25FC", "[+]");
|
|
15916
|
-
var F = u("\u25FB", "[ ]");
|
|
15917
|
-
var $e = u("\u25AA", "\u2022");
|
|
15918
|
-
var _2 = u("\u2500", "-");
|
|
15919
|
-
var me = u("\u256E", "+");
|
|
15920
|
-
var de = u("\u251C", "+");
|
|
15921
|
-
var pe = u("\u256F", "+");
|
|
15922
|
-
var q = u("\u25CF", "\u2022");
|
|
15923
|
-
var D = u("\u25C6", "*");
|
|
15924
|
-
var U2 = u("\u25B2", "!");
|
|
15925
|
-
var K2 = u("\u25A0", "x");
|
|
15926
|
-
var b2 = (t) => {
|
|
15927
|
-
switch (t) {
|
|
15928
|
-
case "initial":
|
|
15929
|
-
case "active":
|
|
15930
|
-
return import_picocolors2.default.cyan(le);
|
|
15931
|
-
case "cancel":
|
|
15932
|
-
return import_picocolors2.default.red(L2);
|
|
15933
|
-
case "error":
|
|
15934
|
-
return import_picocolors2.default.yellow(W2);
|
|
15935
|
-
case "submit":
|
|
15936
|
-
return import_picocolors2.default.green(C);
|
|
15937
|
-
}
|
|
15938
|
-
};
|
|
15939
|
-
var G2 = (t) => {
|
|
15940
|
-
const { cursor: n, options: r2, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
|
|
15941
|
-
let l2 = 0;
|
|
15942
|
-
n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r2.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
|
|
15943
|
-
const $2 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
|
|
15944
|
-
return r2.slice(l2, l2 + a).map((p2, v2, f) => {
|
|
15945
|
-
const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
|
|
15946
|
-
return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
|
|
15947
|
-
});
|
|
15948
|
-
};
|
|
15949
|
-
var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
15950
|
-
const n = `${import_picocolors2.default.gray(o)}
|
|
15951
|
-
${b2(this.state)} ${t.message}
|
|
15952
|
-
`, r2 = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
|
|
15953
|
-
switch (this.state) {
|
|
15954
|
-
case "error":
|
|
15955
|
-
return `${n.trim()}
|
|
15956
|
-
${import_picocolors2.default.yellow(o)} ${i}
|
|
15957
|
-
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
15958
|
-
`;
|
|
15959
|
-
case "submit":
|
|
15960
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
|
|
15961
|
-
case "cancel":
|
|
15962
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
15963
|
-
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
15964
|
-
default:
|
|
15965
|
-
return `${n}${import_picocolors2.default.cyan(o)} ${i}
|
|
15966
|
-
${import_picocolors2.default.cyan(d2)}
|
|
15967
|
-
`;
|
|
15968
|
-
}
|
|
15969
|
-
} }).prompt();
|
|
15970
|
-
var ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
15971
|
-
const n = `${import_picocolors2.default.gray(o)}
|
|
15972
|
-
${b2(this.state)} ${t.message}
|
|
15973
|
-
`, r2 = this.valueWithCursor, i = this.masked;
|
|
15974
|
-
switch (this.state) {
|
|
15975
|
-
case "error":
|
|
15976
|
-
return `${n.trim()}
|
|
15977
|
-
${import_picocolors2.default.yellow(o)} ${i}
|
|
15978
|
-
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
15979
|
-
`;
|
|
15980
|
-
case "submit":
|
|
15981
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(i)}`;
|
|
15982
|
-
case "cancel":
|
|
15983
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i ?? ""))}${i ? `
|
|
15984
|
-
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
15985
|
-
default:
|
|
15986
|
-
return `${n}${import_picocolors2.default.cyan(o)} ${r2}
|
|
15987
|
-
${import_picocolors2.default.cyan(d2)}
|
|
15988
|
-
`;
|
|
15989
|
-
}
|
|
15990
|
-
} }).prompt();
|
|
15991
|
-
var ve = (t) => {
|
|
15992
|
-
const n = (r2, i) => {
|
|
15993
|
-
const s = r2.label ?? String(r2.value);
|
|
15994
|
-
switch (i) {
|
|
15995
|
-
case "selected":
|
|
15996
|
-
return `${import_picocolors2.default.dim(s)}`;
|
|
15997
|
-
case "active":
|
|
15998
|
-
return `${import_picocolors2.default.green(k2)} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}`;
|
|
15999
|
-
case "cancelled":
|
|
16000
|
-
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
|
|
16001
|
-
default:
|
|
16002
|
-
return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
|
|
16003
|
-
}
|
|
16004
|
-
};
|
|
16005
|
-
return new LD({ options: t.options, initialValue: t.initialValue, render() {
|
|
16006
|
-
const r2 = `${import_picocolors2.default.gray(o)}
|
|
16007
|
-
${b2(this.state)} ${t.message}
|
|
16008
|
-
`;
|
|
16009
|
-
switch (this.state) {
|
|
16010
|
-
case "submit":
|
|
16011
|
-
return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
16012
|
-
case "cancel":
|
|
16013
|
-
return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
16014
|
-
${import_picocolors2.default.gray(o)}`;
|
|
16015
|
-
default:
|
|
16016
|
-
return `${r2}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
|
|
16017
|
-
${import_picocolors2.default.cyan(o)} `)}
|
|
16018
|
-
${import_picocolors2.default.cyan(d2)}
|
|
16019
|
-
`;
|
|
16020
|
-
}
|
|
16021
|
-
} }).prompt();
|
|
16022
|
-
};
|
|
16023
|
-
var Me = (t = "", n = "") => {
|
|
16024
|
-
const r2 = `
|
|
16025
|
-
${t}
|
|
16026
|
-
`.split(`
|
|
16027
|
-
`), i = S2(n).length, s = Math.max(r2.reduce((a, l2) => {
|
|
16028
|
-
const $2 = S2(l2);
|
|
16029
|
-
return $2.length > a ? $2.length : a;
|
|
16030
|
-
}, 0), i) + 2, c = r2.map((a) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(a)}${" ".repeat(s - S2(a).length)}${import_picocolors2.default.gray(o)}`).join(`
|
|
16031
|
-
`);
|
|
16032
|
-
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
16033
|
-
${import_picocolors2.default.green(C)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
16034
|
-
${c}
|
|
16035
|
-
${import_picocolors2.default.gray(de + _2.repeat(s + 2) + pe)}
|
|
16036
|
-
`);
|
|
16037
|
-
};
|
|
16038
|
-
var xe = (t = "") => {
|
|
16039
|
-
process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
|
|
16040
|
-
|
|
16041
|
-
`);
|
|
16042
|
-
};
|
|
16043
|
-
var Ie = (t = "") => {
|
|
16044
|
-
process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
|
|
16045
|
-
`);
|
|
16046
|
-
};
|
|
16047
|
-
var Se = (t = "") => {
|
|
16048
|
-
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
16049
|
-
${import_picocolors2.default.gray(d2)} ${t}
|
|
16050
|
-
|
|
16051
|
-
`);
|
|
16052
|
-
};
|
|
16053
|
-
var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
|
|
16054
|
-
const r2 = [`${import_picocolors2.default.gray(o)}`];
|
|
16055
|
-
if (t) {
|
|
16056
|
-
const [i, ...s] = t.split(`
|
|
16057
|
-
`);
|
|
16058
|
-
r2.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
|
|
16059
|
-
}
|
|
16060
|
-
process.stdout.write(`${r2.join(`
|
|
16061
|
-
`)}
|
|
16062
|
-
`);
|
|
16063
|
-
}, info: (t) => {
|
|
16064
|
-
M2.message(t, { symbol: import_picocolors2.default.blue(q) });
|
|
16065
|
-
}, success: (t) => {
|
|
16066
|
-
M2.message(t, { symbol: import_picocolors2.default.green(D) });
|
|
16067
|
-
}, step: (t) => {
|
|
16068
|
-
M2.message(t, { symbol: import_picocolors2.default.green(C) });
|
|
16069
|
-
}, warn: (t) => {
|
|
16070
|
-
M2.message(t, { symbol: import_picocolors2.default.yellow(U2) });
|
|
16071
|
-
}, warning: (t) => {
|
|
16072
|
-
M2.warn(t);
|
|
16073
|
-
}, error: (t) => {
|
|
16074
|
-
M2.message(t, { symbol: import_picocolors2.default.red(K2) });
|
|
16075
|
-
} };
|
|
16076
|
-
var J2 = `${import_picocolors2.default.gray(o)} `;
|
|
16077
|
-
var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
16078
|
-
const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
|
|
16079
|
-
let s, c, a = false, l2 = "", $2, g2 = performance.now();
|
|
16080
|
-
const p2 = (m2) => {
|
|
16081
|
-
const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
|
|
16082
|
-
a && N2(h2, m2);
|
|
16083
|
-
}, v2 = () => p2(2), f = () => p2(1), j2 = () => {
|
|
16084
|
-
process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
|
|
16085
|
-
}, E = () => {
|
|
16086
|
-
process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
|
|
16087
|
-
}, B2 = () => {
|
|
16088
|
-
if ($2 === void 0) return;
|
|
16089
|
-
i && process.stdout.write(`
|
|
16090
|
-
`);
|
|
16091
|
-
const m2 = $2.split(`
|
|
16092
|
-
`);
|
|
16093
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
|
|
16094
|
-
}, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
|
|
16095
|
-
const h2 = (performance.now() - m2) / 1e3, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
|
|
16096
|
-
return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
|
|
16097
|
-
}, H = (m2 = "") => {
|
|
16098
|
-
a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
16099
|
-
`);
|
|
16100
|
-
let h2 = 0, w2 = 0;
|
|
16101
|
-
j2(), c = setInterval(() => {
|
|
16102
|
-
if (i && l2 === $2) return;
|
|
16103
|
-
B2(), $2 = l2;
|
|
16104
|
-
const I2 = import_picocolors2.default.magenta(n[h2]);
|
|
16105
|
-
if (i) process.stdout.write(`${I2} ${l2}...`);
|
|
16106
|
-
else if (t === "timer") process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
|
|
16107
|
-
else {
|
|
16108
|
-
const z3 = ".".repeat(Math.floor(w2)).slice(0, 3);
|
|
16109
|
-
process.stdout.write(`${I2} ${l2}${z3}`);
|
|
16110
|
-
}
|
|
16111
|
-
h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
|
|
16112
|
-
}, r2);
|
|
16113
|
-
}, N2 = (m2 = "", h2 = 0) => {
|
|
16114
|
-
a = false, clearInterval(c), B2();
|
|
16115
|
-
const w2 = h2 === 0 ? import_picocolors2.default.green(C) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
|
|
16116
|
-
l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
|
|
16117
|
-
`) : process.stdout.write(`${w2} ${l2}
|
|
16118
|
-
`), E(), s();
|
|
16119
|
-
};
|
|
16120
|
-
return { start: H, stop: N2, message: (m2 = "") => {
|
|
16121
|
-
l2 = R2(m2 ?? l2);
|
|
16122
|
-
} };
|
|
16123
|
-
};
|
|
16124
|
-
|
|
16125
15375
|
// packages/design-system/src/components/logger.ts
|
|
15376
|
+
import { log } from "@clack/prompts";
|
|
16126
15377
|
import chalk6 from "chalk";
|
|
16127
15378
|
function createLogger(emitter) {
|
|
16128
15379
|
const emit = (level, message) => {
|
|
@@ -16131,18 +15382,18 @@ function createLogger(emitter) {
|
|
|
16131
15382
|
return;
|
|
16132
15383
|
}
|
|
16133
15384
|
if (level === "success") {
|
|
16134
|
-
|
|
15385
|
+
log.message(message, { symbol: symbols.success });
|
|
16135
15386
|
return;
|
|
16136
15387
|
}
|
|
16137
15388
|
if (level === "warn") {
|
|
16138
|
-
|
|
15389
|
+
log.warn(message);
|
|
16139
15390
|
return;
|
|
16140
15391
|
}
|
|
16141
15392
|
if (level === "error") {
|
|
16142
|
-
|
|
15393
|
+
log.error(message);
|
|
16143
15394
|
return;
|
|
16144
15395
|
}
|
|
16145
|
-
|
|
15396
|
+
log.message(message, { symbol: symbols.info });
|
|
16146
15397
|
};
|
|
16147
15398
|
return {
|
|
16148
15399
|
info(message) {
|
|
@@ -16162,7 +15413,7 @@ function createLogger(emitter) {
|
|
|
16162
15413
|
emitter(`${label}: ${value}`);
|
|
16163
15414
|
return;
|
|
16164
15415
|
}
|
|
16165
|
-
|
|
15416
|
+
log.message(`${label}
|
|
16166
15417
|
${value}`, { symbol: symbols.resolved });
|
|
16167
15418
|
},
|
|
16168
15419
|
errorResolved(label, value) {
|
|
@@ -16170,7 +15421,7 @@ function createLogger(emitter) {
|
|
|
16170
15421
|
emitter(`${label}: ${value}`);
|
|
16171
15422
|
return;
|
|
16172
15423
|
}
|
|
16173
|
-
|
|
15424
|
+
log.message(`${label}
|
|
16174
15425
|
${value}`, { symbol: symbols.errorResolved });
|
|
16175
15426
|
},
|
|
16176
15427
|
message(message, symbol2) {
|
|
@@ -16178,7 +15429,7 @@ function createLogger(emitter) {
|
|
|
16178
15429
|
emitter(message);
|
|
16179
15430
|
return;
|
|
16180
15431
|
}
|
|
16181
|
-
|
|
15432
|
+
log.message(message, { symbol: symbol2 ?? chalk6.gray("\u2502") });
|
|
16182
15433
|
}
|
|
16183
15434
|
};
|
|
16184
15435
|
}
|
|
@@ -16204,6 +15455,51 @@ function formatCommandNotFoundPanel(input) {
|
|
|
16204
15455
|
};
|
|
16205
15456
|
}
|
|
16206
15457
|
|
|
15458
|
+
// packages/design-system/src/components/table.ts
|
|
15459
|
+
import { Table } from "console-table-printer";
|
|
15460
|
+
function renderTable(options) {
|
|
15461
|
+
const { theme, columns, rows } = options;
|
|
15462
|
+
const table = new Table({
|
|
15463
|
+
style: {
|
|
15464
|
+
headerTop: {
|
|
15465
|
+
left: theme.muted("\u250C"),
|
|
15466
|
+
mid: theme.muted("\u252C"),
|
|
15467
|
+
right: theme.muted("\u2510"),
|
|
15468
|
+
other: theme.muted("\u2500")
|
|
15469
|
+
},
|
|
15470
|
+
headerBottom: {
|
|
15471
|
+
left: theme.muted("\u251C"),
|
|
15472
|
+
mid: theme.muted("\u253C"),
|
|
15473
|
+
right: theme.muted("\u2524"),
|
|
15474
|
+
other: theme.muted("\u2500")
|
|
15475
|
+
},
|
|
15476
|
+
tableBottom: {
|
|
15477
|
+
left: theme.muted("\u2514"),
|
|
15478
|
+
mid: theme.muted("\u2534"),
|
|
15479
|
+
right: theme.muted("\u2518"),
|
|
15480
|
+
other: theme.muted("\u2500")
|
|
15481
|
+
},
|
|
15482
|
+
vertical: theme.muted("\u2502"),
|
|
15483
|
+
rowSeparator: {
|
|
15484
|
+
left: theme.muted("\u251C"),
|
|
15485
|
+
mid: theme.muted("\u253C"),
|
|
15486
|
+
right: theme.muted("\u2524"),
|
|
15487
|
+
other: theme.muted("\u2500")
|
|
15488
|
+
}
|
|
15489
|
+
},
|
|
15490
|
+
columns: columns.map((col) => ({
|
|
15491
|
+
name: col.name,
|
|
15492
|
+
title: theme.header(col.title),
|
|
15493
|
+
alignment: col.alignment,
|
|
15494
|
+
maxLen: col.maxLen
|
|
15495
|
+
}))
|
|
15496
|
+
});
|
|
15497
|
+
for (const row of rows) {
|
|
15498
|
+
table.addRow(row);
|
|
15499
|
+
}
|
|
15500
|
+
return table.render();
|
|
15501
|
+
}
|
|
15502
|
+
|
|
16207
15503
|
// packages/design-system/src/acp/index.ts
|
|
16208
15504
|
var acp_exports = {};
|
|
16209
15505
|
__export(acp_exports, {
|
|
@@ -16217,29 +15513,29 @@ __export(acp_exports, {
|
|
|
16217
15513
|
|
|
16218
15514
|
// packages/design-system/src/acp/components.ts
|
|
16219
15515
|
import chalk7 from "chalk";
|
|
16220
|
-
function truncate(
|
|
16221
|
-
if (
|
|
16222
|
-
if (maxLength <= 3) return
|
|
16223
|
-
return `${
|
|
15516
|
+
function truncate(text4, maxLength) {
|
|
15517
|
+
if (text4.length <= maxLength) return text4;
|
|
15518
|
+
if (maxLength <= 3) return text4.slice(0, maxLength);
|
|
15519
|
+
return `${text4.slice(0, maxLength - 3)}...`;
|
|
16224
15520
|
}
|
|
16225
15521
|
var KIND_COLORS = {
|
|
16226
|
-
exec: (
|
|
16227
|
-
edit: (
|
|
16228
|
-
read: (
|
|
16229
|
-
search: (
|
|
16230
|
-
think: (
|
|
16231
|
-
other: (
|
|
15522
|
+
exec: (text4) => chalk7.yellow(text4),
|
|
15523
|
+
edit: (text4) => chalk7.magenta(text4),
|
|
15524
|
+
read: (text4) => chalk7.cyan(text4),
|
|
15525
|
+
search: (text4) => chalk7.blue(text4),
|
|
15526
|
+
think: (text4) => chalk7.dim(text4),
|
|
15527
|
+
other: (text4) => chalk7.dim(text4)
|
|
16232
15528
|
};
|
|
16233
15529
|
function colorForKind(kind) {
|
|
16234
|
-
return KIND_COLORS[kind] ?? ((
|
|
15530
|
+
return KIND_COLORS[kind] ?? ((text4) => chalk7.dim(text4));
|
|
16235
15531
|
}
|
|
16236
15532
|
function writeLine(line) {
|
|
16237
15533
|
process.stdout.write(`${line}
|
|
16238
15534
|
`);
|
|
16239
15535
|
}
|
|
16240
15536
|
var AGENT_PREFIX = `${chalk7.green.bold("\u2713")} agent: `;
|
|
16241
|
-
function renderAgentMessage(
|
|
16242
|
-
writeLine(`${AGENT_PREFIX}${
|
|
15537
|
+
function renderAgentMessage(text4) {
|
|
15538
|
+
writeLine(`${AGENT_PREFIX}${text4}`);
|
|
16243
15539
|
}
|
|
16244
15540
|
function renderToolStart(kind, title) {
|
|
16245
15541
|
const color = colorForKind(kind);
|
|
@@ -16249,8 +15545,8 @@ function renderToolComplete(kind) {
|
|
|
16249
15545
|
const color = colorForKind(kind);
|
|
16250
15546
|
writeLine(color(` \u2713 ${kind}`));
|
|
16251
15547
|
}
|
|
16252
|
-
function renderReasoning(
|
|
16253
|
-
writeLine(chalk7.dim(` \u2713 ${truncate(
|
|
15548
|
+
function renderReasoning(text4) {
|
|
15549
|
+
writeLine(chalk7.dim(` \u2713 ${truncate(text4, 80)}`));
|
|
16254
15550
|
}
|
|
16255
15551
|
function renderUsage(tokens) {
|
|
16256
15552
|
const cached2 = typeof tokens.cached === "number" && tokens.cached > 0 ? ` (${tokens.cached} cached)` : "";
|
|
@@ -16275,29 +15571,34 @@ function renderError(message) {
|
|
|
16275
15571
|
}
|
|
16276
15572
|
|
|
16277
15573
|
// packages/design-system/src/prompts/index.ts
|
|
16278
|
-
|
|
16279
|
-
|
|
15574
|
+
import * as clack from "@clack/prompts";
|
|
15575
|
+
import { isCancel, cancel, log as log2 } from "@clack/prompts";
|
|
15576
|
+
function intro2(title) {
|
|
15577
|
+
clack.intro(text.intro(title));
|
|
16280
15578
|
}
|
|
16281
15579
|
function introPlain(title) {
|
|
16282
|
-
|
|
15580
|
+
clack.intro(title);
|
|
16283
15581
|
}
|
|
16284
|
-
function
|
|
16285
|
-
|
|
15582
|
+
function outro2(message) {
|
|
15583
|
+
clack.outro(message);
|
|
16286
15584
|
}
|
|
16287
|
-
function
|
|
16288
|
-
|
|
15585
|
+
function note2(message, title) {
|
|
15586
|
+
clack.note(message, title);
|
|
16289
15587
|
}
|
|
16290
|
-
async function
|
|
16291
|
-
return
|
|
15588
|
+
async function select2(opts) {
|
|
15589
|
+
return clack.select(opts);
|
|
16292
15590
|
}
|
|
16293
|
-
async function
|
|
16294
|
-
return
|
|
15591
|
+
async function text3(opts) {
|
|
15592
|
+
return clack.text(opts);
|
|
16295
15593
|
}
|
|
16296
|
-
async function
|
|
16297
|
-
return
|
|
15594
|
+
async function confirm2(opts) {
|
|
15595
|
+
return clack.confirm(opts);
|
|
16298
15596
|
}
|
|
16299
|
-
function
|
|
16300
|
-
return
|
|
15597
|
+
async function password2(opts) {
|
|
15598
|
+
return clack.password(opts);
|
|
15599
|
+
}
|
|
15600
|
+
function spinner2() {
|
|
15601
|
+
return clack.spinner();
|
|
16301
15602
|
}
|
|
16302
15603
|
|
|
16303
15604
|
// packages/design-system/src/static/spinner.ts
|
|
@@ -16308,8 +15609,8 @@ import chalk9 from "chalk";
|
|
|
16308
15609
|
|
|
16309
15610
|
// src/cli/logger.ts
|
|
16310
15611
|
import chalk10 from "chalk";
|
|
16311
|
-
function wrapText(
|
|
16312
|
-
const words =
|
|
15612
|
+
function wrapText(text4, maxWidth) {
|
|
15613
|
+
const words = text4.split(" ");
|
|
16313
15614
|
const lines = [];
|
|
16314
15615
|
let currentLine = "";
|
|
16315
15616
|
for (const word of words) {
|
|
@@ -16337,18 +15638,18 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16337
15638
|
return;
|
|
16338
15639
|
}
|
|
16339
15640
|
if (level === "success") {
|
|
16340
|
-
|
|
15641
|
+
log2.message(message, { symbol: successSymbol });
|
|
16341
15642
|
return;
|
|
16342
15643
|
}
|
|
16343
15644
|
if (level === "warn") {
|
|
16344
|
-
|
|
15645
|
+
log2.warn(message);
|
|
16345
15646
|
return;
|
|
16346
15647
|
}
|
|
16347
15648
|
if (level === "error") {
|
|
16348
|
-
|
|
15649
|
+
log2.error(message);
|
|
16349
15650
|
return;
|
|
16350
15651
|
}
|
|
16351
|
-
|
|
15652
|
+
log2.message(message, { symbol: infoSymbol });
|
|
16352
15653
|
};
|
|
16353
15654
|
const create = (context = {}) => {
|
|
16354
15655
|
const dryRun = context.dryRun ?? false;
|
|
@@ -16375,7 +15676,7 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16375
15676
|
return;
|
|
16376
15677
|
}
|
|
16377
15678
|
const symbol2 = theme?.errorSymbol ?? chalk10.red("\u25A0");
|
|
16378
|
-
|
|
15679
|
+
log2.message(`${label}
|
|
16379
15680
|
${value}`, { symbol: symbol2 });
|
|
16380
15681
|
},
|
|
16381
15682
|
errorWithStack(error2, errorContext) {
|
|
@@ -16419,7 +15720,7 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16419
15720
|
emitter(formatMessage(message));
|
|
16420
15721
|
return;
|
|
16421
15722
|
}
|
|
16422
|
-
|
|
15723
|
+
log2.message(formatMessage(message), { symbol: chalk10.gray("\u2502") });
|
|
16423
15724
|
},
|
|
16424
15725
|
intro(title) {
|
|
16425
15726
|
if (emitter) {
|
|
@@ -16430,7 +15731,7 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16430
15731
|
introPlain(theme.intro(title));
|
|
16431
15732
|
return;
|
|
16432
15733
|
}
|
|
16433
|
-
|
|
15734
|
+
intro2(title);
|
|
16434
15735
|
},
|
|
16435
15736
|
resolved(label, value) {
|
|
16436
15737
|
if (emitter) {
|
|
@@ -16438,7 +15739,7 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16438
15739
|
return;
|
|
16439
15740
|
}
|
|
16440
15741
|
const symbol2 = theme?.resolvedSymbol ?? chalk10.magenta("\u25C7");
|
|
16441
|
-
|
|
15742
|
+
log2.message(`${label}
|
|
16442
15743
|
${value}`, { symbol: symbol2 });
|
|
16443
15744
|
},
|
|
16444
15745
|
nextSteps(steps) {
|
|
@@ -16451,14 +15752,14 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16451
15752
|
}
|
|
16452
15753
|
const maxWidth = Math.min(process.stdout.columns || 80, 80) - 6;
|
|
16453
15754
|
const wrapped = steps.map((step) => wrapText(step, maxWidth)).join("\n");
|
|
16454
|
-
|
|
15755
|
+
note2(wrapped, "Next steps.");
|
|
16455
15756
|
},
|
|
16456
15757
|
feedback(label, url2) {
|
|
16457
15758
|
if (emitter) {
|
|
16458
15759
|
emitter(`${label} ${url2}`);
|
|
16459
15760
|
return;
|
|
16460
15761
|
}
|
|
16461
|
-
|
|
15762
|
+
outro2(chalk10.dim(`${label} ${url2}`));
|
|
16462
15763
|
},
|
|
16463
15764
|
child(next) {
|
|
16464
15765
|
return create({
|
|
@@ -16471,7 +15772,7 @@ function createLoggerFactory(emitter, theme) {
|
|
|
16471
15772
|
return scoped;
|
|
16472
15773
|
};
|
|
16473
15774
|
return {
|
|
16474
|
-
base: emitter ?? ((message) =>
|
|
15775
|
+
base: emitter ?? ((message) => log2.message(message, { symbol: infoSymbol })),
|
|
16475
15776
|
errorLogger,
|
|
16476
15777
|
create,
|
|
16477
15778
|
setErrorLogger(logger2) {
|
|
@@ -16917,10 +16218,10 @@ async function renderAcpStream(events) {
|
|
|
16917
16218
|
import { spawn as spawnChildProcess2 } from "node:child_process";
|
|
16918
16219
|
|
|
16919
16220
|
// packages/agent-spawn/src/adapters/utils.ts
|
|
16920
|
-
function truncate2(
|
|
16921
|
-
if (
|
|
16922
|
-
if (maxLength <= 3) return
|
|
16923
|
-
return `${
|
|
16221
|
+
function truncate2(text4, maxLength) {
|
|
16222
|
+
if (text4.length <= maxLength) return text4;
|
|
16223
|
+
if (maxLength <= 3) return text4.slice(0, maxLength);
|
|
16224
|
+
return `${text4.slice(0, maxLength - 3)}...`;
|
|
16924
16225
|
}
|
|
16925
16226
|
function isNonEmptyString(value) {
|
|
16926
16227
|
return typeof value === "string" && value.length > 0;
|
|
@@ -17115,9 +16416,9 @@ async function* adaptCodex(lines) {
|
|
|
17115
16416
|
continue;
|
|
17116
16417
|
}
|
|
17117
16418
|
if (itemType === "reasoning") {
|
|
17118
|
-
const
|
|
17119
|
-
if (!
|
|
17120
|
-
yield { event: "reasoning", text:
|
|
16419
|
+
const text4 = isNonEmptyString(item.text) ? item.text : isNonEmptyString(item.content) ? item.content : isNonEmptyString(item.summary) ? item.summary : void 0;
|
|
16420
|
+
if (!text4) continue;
|
|
16421
|
+
yield { event: "reasoning", text: text4 };
|
|
17121
16422
|
continue;
|
|
17122
16423
|
}
|
|
17123
16424
|
if (!isNonEmptyString(item.id)) continue;
|
|
@@ -17529,7 +16830,7 @@ function createBinaryExistsCheck(binaryName, id, description) {
|
|
|
17529
16830
|
command: "sh",
|
|
17530
16831
|
args: [
|
|
17531
16832
|
"-c",
|
|
17532
|
-
commonPaths.map((
|
|
16833
|
+
commonPaths.map((p) => `test -f "${p}"`).join(" || ")
|
|
17533
16834
|
],
|
|
17534
16835
|
validate: (result) => result.exitCode === 0
|
|
17535
16836
|
}
|
|
@@ -18208,10 +17509,10 @@ var kimiService = createProvider({
|
|
|
18208
17509
|
const { model, apiKey, env } = ctx ?? {};
|
|
18209
17510
|
const selectedModel = model ?? DEFAULT_KIMI_MODEL;
|
|
18210
17511
|
const models = {};
|
|
18211
|
-
for (const
|
|
18212
|
-
models[providerModel2(
|
|
17512
|
+
for (const m of KIMI_MODELS) {
|
|
17513
|
+
models[providerModel2(m)] = {
|
|
18213
17514
|
provider: PROVIDER_NAME,
|
|
18214
|
-
model: stripModelNamespace(
|
|
17515
|
+
model: stripModelNamespace(m),
|
|
18215
17516
|
max_context_size: 256e3
|
|
18216
17517
|
};
|
|
18217
17518
|
}
|
|
@@ -18944,8 +18245,8 @@ function spawn3(service, promptOrOptions, maybeOptions) {
|
|
|
18944
18245
|
resolveEvents?.(value);
|
|
18945
18246
|
};
|
|
18946
18247
|
const events = (async function* () {
|
|
18947
|
-
for await (const
|
|
18948
|
-
yield
|
|
18248
|
+
for await (const e of await eventsPromise) {
|
|
18249
|
+
yield e;
|
|
18949
18250
|
}
|
|
18950
18251
|
})();
|
|
18951
18252
|
const result = (async () => {
|
|
@@ -19244,7 +18545,7 @@ async function isolatedEnvRunner(input) {
|
|
|
19244
18545
|
...details.env
|
|
19245
18546
|
}
|
|
19246
18547
|
});
|
|
19247
|
-
return await new Promise((
|
|
18548
|
+
return await new Promise((_, reject) => {
|
|
19248
18549
|
child.on("error", (error2) => {
|
|
19249
18550
|
reject(error2);
|
|
19250
18551
|
});
|
|
@@ -19812,8 +19113,8 @@ async function readErrorBody(response) {
|
|
|
19812
19113
|
return void 0;
|
|
19813
19114
|
}
|
|
19814
19115
|
try {
|
|
19815
|
-
const
|
|
19816
|
-
return
|
|
19116
|
+
const text4 = await response.text();
|
|
19117
|
+
return text4?.trim() || void 0;
|
|
19817
19118
|
} catch {
|
|
19818
19119
|
return void 0;
|
|
19819
19120
|
}
|
|
@@ -19984,18 +19285,18 @@ function registerGenerateCommand(program, container) {
|
|
|
19984
19285
|
);
|
|
19985
19286
|
return;
|
|
19986
19287
|
}
|
|
19987
|
-
|
|
19288
|
+
intro2("generate");
|
|
19988
19289
|
const client = await resolveClient(container);
|
|
19989
19290
|
const response = await withSpinner({
|
|
19990
19291
|
message: `Generating with ${model}...`,
|
|
19991
19292
|
fn: () => client.text({ model, prompt, params }),
|
|
19992
19293
|
stopMessage: () => model,
|
|
19993
|
-
subtext: (
|
|
19294
|
+
subtext: (r) => r.content
|
|
19994
19295
|
});
|
|
19995
19296
|
if (!response.content) {
|
|
19996
19297
|
throw new ValidationError("No response from LLM");
|
|
19997
19298
|
}
|
|
19998
|
-
|
|
19299
|
+
outro2("");
|
|
19999
19300
|
});
|
|
20000
19301
|
generate2.command("text").description(`Generate text (default model: ${DEFAULT_TEXT_MODEL})`).option("--model <model>", `Model identifier (default: ${DEFAULT_TEXT_MODEL})`).option(
|
|
20001
19302
|
"--param <key=value>",
|
|
@@ -20015,18 +19316,18 @@ function registerGenerateCommand(program, container) {
|
|
|
20015
19316
|
);
|
|
20016
19317
|
return;
|
|
20017
19318
|
}
|
|
20018
|
-
|
|
19319
|
+
intro2("generate text");
|
|
20019
19320
|
const client = await resolveClient(container);
|
|
20020
19321
|
const response = await withSpinner({
|
|
20021
19322
|
message: `Generating with ${model}...`,
|
|
20022
19323
|
fn: () => client.text({ model, prompt, params }),
|
|
20023
19324
|
stopMessage: () => model,
|
|
20024
|
-
subtext: (
|
|
19325
|
+
subtext: (r) => r.content
|
|
20025
19326
|
});
|
|
20026
19327
|
if (!response.content) {
|
|
20027
19328
|
throw new ValidationError("No response from LLM");
|
|
20028
19329
|
}
|
|
20029
|
-
|
|
19330
|
+
outro2("");
|
|
20030
19331
|
});
|
|
20031
19332
|
registerMediaSubcommand(generate2, program, container, "image");
|
|
20032
19333
|
registerMediaSubcommand(generate2, program, container, "video");
|
|
@@ -20052,7 +19353,7 @@ function registerMediaSubcommand(generate2, program, container, type) {
|
|
|
20052
19353
|
);
|
|
20053
19354
|
return;
|
|
20054
19355
|
}
|
|
20055
|
-
|
|
19356
|
+
intro2(`generate ${type}`);
|
|
20056
19357
|
const client = await resolveClient(container);
|
|
20057
19358
|
const saved = await withSpinner({
|
|
20058
19359
|
message: `Generating ${type} with ${model}...`,
|
|
@@ -20090,7 +19391,7 @@ The file may no longer be available or the URL may have expired.`
|
|
|
20090
19391
|
},
|
|
20091
19392
|
stopMessage: () => `Generated ${type}`
|
|
20092
19393
|
});
|
|
20093
|
-
|
|
19394
|
+
outro2(`Saved ${saved.label}`);
|
|
20094
19395
|
});
|
|
20095
19396
|
}
|
|
20096
19397
|
function parseParams(params) {
|
|
@@ -20160,7 +19461,7 @@ async function withSpinner(options) {
|
|
|
20160
19461
|
}
|
|
20161
19462
|
return result;
|
|
20162
19463
|
}
|
|
20163
|
-
const s =
|
|
19464
|
+
const s = spinner2();
|
|
20164
19465
|
s.start(message);
|
|
20165
19466
|
try {
|
|
20166
19467
|
const result = await fn();
|
|
@@ -20596,8 +19897,8 @@ var File2 = class _File {
|
|
|
20596
19897
|
const isText = isTextMimeType(mimeType);
|
|
20597
19898
|
return new _File(data, mimeType, isText);
|
|
20598
19899
|
}
|
|
20599
|
-
static fromText(
|
|
20600
|
-
return new _File(
|
|
19900
|
+
static fromText(text4, mimeType = "text/plain") {
|
|
19901
|
+
return new _File(text4, mimeType, true);
|
|
20601
19902
|
}
|
|
20602
19903
|
static fromBase64(base643, mimeType) {
|
|
20603
19904
|
const data = Buffer.from(base643, "base64");
|
|
@@ -20607,18 +19908,18 @@ var File2 = class _File {
|
|
|
20607
19908
|
toContentBlock() {
|
|
20608
19909
|
const uri = this.name ? `file:///${this.name}` : "file:///data";
|
|
20609
19910
|
if (this.isText) {
|
|
20610
|
-
let
|
|
19911
|
+
let text4;
|
|
20611
19912
|
if (typeof this.data === "string") {
|
|
20612
|
-
|
|
19913
|
+
text4 = this.data;
|
|
20613
19914
|
} else {
|
|
20614
|
-
|
|
19915
|
+
text4 = new TextDecoder("utf-8").decode(this.data);
|
|
20615
19916
|
}
|
|
20616
19917
|
return {
|
|
20617
19918
|
type: "resource",
|
|
20618
19919
|
resource: {
|
|
20619
19920
|
uri,
|
|
20620
19921
|
mimeType: this.mimeType,
|
|
20621
|
-
text:
|
|
19922
|
+
text: text4
|
|
20622
19923
|
}
|
|
20623
19924
|
};
|
|
20624
19925
|
} else {
|
|
@@ -20887,7 +20188,7 @@ function defineSchema(definition) {
|
|
|
20887
20188
|
// node_modules/zod/v3/helpers/util.js
|
|
20888
20189
|
var util;
|
|
20889
20190
|
(function(util2) {
|
|
20890
|
-
util2.assertEqual = (
|
|
20191
|
+
util2.assertEqual = (_) => {
|
|
20891
20192
|
};
|
|
20892
20193
|
function assertIs2(_arg) {
|
|
20893
20194
|
}
|
|
@@ -20904,16 +20205,16 @@ var util;
|
|
|
20904
20205
|
return obj;
|
|
20905
20206
|
};
|
|
20906
20207
|
util2.getValidEnumValues = (obj) => {
|
|
20907
|
-
const validKeys = util2.objectKeys(obj).filter((
|
|
20208
|
+
const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
20908
20209
|
const filtered = {};
|
|
20909
|
-
for (const
|
|
20910
|
-
filtered[
|
|
20210
|
+
for (const k of validKeys) {
|
|
20211
|
+
filtered[k] = obj[k];
|
|
20911
20212
|
}
|
|
20912
20213
|
return util2.objectValues(filtered);
|
|
20913
20214
|
};
|
|
20914
20215
|
util2.objectValues = (obj) => {
|
|
20915
|
-
return util2.objectKeys(obj).map(function(
|
|
20916
|
-
return obj[
|
|
20216
|
+
return util2.objectKeys(obj).map(function(e) {
|
|
20217
|
+
return obj[e];
|
|
20917
20218
|
});
|
|
20918
20219
|
};
|
|
20919
20220
|
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object3) => {
|
|
@@ -20937,7 +20238,7 @@ var util;
|
|
|
20937
20238
|
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
20938
20239
|
}
|
|
20939
20240
|
util2.joinValues = joinValues2;
|
|
20940
|
-
util2.jsonStringifyReplacer = (
|
|
20241
|
+
util2.jsonStringifyReplacer = (_, value) => {
|
|
20941
20242
|
if (typeof value === "bigint") {
|
|
20942
20243
|
return value.toString();
|
|
20943
20244
|
}
|
|
@@ -21257,7 +20558,7 @@ var makeIssue = (params) => {
|
|
|
21257
20558
|
};
|
|
21258
20559
|
}
|
|
21259
20560
|
let errorMessage = "";
|
|
21260
|
-
const maps = errorMaps.filter((
|
|
20561
|
+
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
21261
20562
|
for (const map2 of maps) {
|
|
21262
20563
|
errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
|
|
21263
20564
|
}
|
|
@@ -21282,7 +20583,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
21282
20583
|
// then global override map
|
|
21283
20584
|
overrideMap === en_default ? void 0 : en_default
|
|
21284
20585
|
// then global default map
|
|
21285
|
-
].filter((
|
|
20586
|
+
].filter((x) => !!x)
|
|
21286
20587
|
});
|
|
21287
20588
|
ctx.common.issues.push(issue2);
|
|
21288
20589
|
}
|
|
@@ -21345,10 +20646,10 @@ var INVALID = Object.freeze({
|
|
|
21345
20646
|
});
|
|
21346
20647
|
var DIRTY = (value) => ({ status: "dirty", value });
|
|
21347
20648
|
var OK = (value) => ({ status: "valid", value });
|
|
21348
|
-
var isAborted = (
|
|
21349
|
-
var isDirty = (
|
|
21350
|
-
var isValid = (
|
|
21351
|
-
var isAsync = (
|
|
20649
|
+
var isAborted = (x) => x.status === "aborted";
|
|
20650
|
+
var isDirty = (x) => x.status === "dirty";
|
|
20651
|
+
var isValid = (x) => x.status === "valid";
|
|
20652
|
+
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
21352
20653
|
|
|
21353
20654
|
// node_modules/zod/v3/helpers/errorUtil.js
|
|
21354
20655
|
var errorUtil;
|
|
@@ -23668,17 +22969,17 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
23668
22969
|
});
|
|
23669
22970
|
}
|
|
23670
22971
|
};
|
|
23671
|
-
function mergeValues(a,
|
|
22972
|
+
function mergeValues(a, b) {
|
|
23672
22973
|
const aType = getParsedType(a);
|
|
23673
|
-
const bType = getParsedType(
|
|
23674
|
-
if (a ===
|
|
22974
|
+
const bType = getParsedType(b);
|
|
22975
|
+
if (a === b) {
|
|
23675
22976
|
return { valid: true, data: a };
|
|
23676
22977
|
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
|
23677
|
-
const bKeys = util.objectKeys(
|
|
22978
|
+
const bKeys = util.objectKeys(b);
|
|
23678
22979
|
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
23679
|
-
const newObj = { ...a, ...
|
|
22980
|
+
const newObj = { ...a, ...b };
|
|
23680
22981
|
for (const key of sharedKeys) {
|
|
23681
|
-
const sharedValue = mergeValues(a[key],
|
|
22982
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
|
23682
22983
|
if (!sharedValue.valid) {
|
|
23683
22984
|
return { valid: false };
|
|
23684
22985
|
}
|
|
@@ -23686,13 +22987,13 @@ function mergeValues(a, b3) {
|
|
|
23686
22987
|
}
|
|
23687
22988
|
return { valid: true, data: newObj };
|
|
23688
22989
|
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
|
23689
|
-
if (a.length !==
|
|
22990
|
+
if (a.length !== b.length) {
|
|
23690
22991
|
return { valid: false };
|
|
23691
22992
|
}
|
|
23692
22993
|
const newArray = [];
|
|
23693
22994
|
for (let index = 0; index < a.length; index++) {
|
|
23694
22995
|
const itemA = a[index];
|
|
23695
|
-
const itemB =
|
|
22996
|
+
const itemB = b[index];
|
|
23696
22997
|
const sharedValue = mergeValues(itemA, itemB);
|
|
23697
22998
|
if (!sharedValue.valid) {
|
|
23698
22999
|
return { valid: false };
|
|
@@ -23700,7 +23001,7 @@ function mergeValues(a, b3) {
|
|
|
23700
23001
|
newArray.push(sharedValue.data);
|
|
23701
23002
|
}
|
|
23702
23003
|
return { valid: true, data: newArray };
|
|
23703
|
-
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +
|
|
23004
|
+
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
|
23704
23005
|
return { valid: true, data: a };
|
|
23705
23006
|
} else {
|
|
23706
23007
|
return { valid: false };
|
|
@@ -23796,7 +23097,7 @@ var ZodTuple = class _ZodTuple extends ZodType {
|
|
|
23796
23097
|
if (!schema)
|
|
23797
23098
|
return null;
|
|
23798
23099
|
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
23799
|
-
}).filter((
|
|
23100
|
+
}).filter((x) => !!x);
|
|
23800
23101
|
if (ctx.common.async) {
|
|
23801
23102
|
return Promise.all(items).then((results) => {
|
|
23802
23103
|
return ParseStatus.mergeArray(status, results);
|
|
@@ -24049,7 +23350,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
24049
23350
|
return makeIssue({
|
|
24050
23351
|
data: args,
|
|
24051
23352
|
path: ctx.path,
|
|
24052
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((
|
|
23353
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
24053
23354
|
issueData: {
|
|
24054
23355
|
code: ZodIssueCode.invalid_arguments,
|
|
24055
23356
|
argumentsError: error2
|
|
@@ -24060,7 +23361,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
24060
23361
|
return makeIssue({
|
|
24061
23362
|
data: returns,
|
|
24062
23363
|
path: ctx.path,
|
|
24063
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((
|
|
23364
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
24064
23365
|
issueData: {
|
|
24065
23366
|
code: ZodIssueCode.invalid_return_type,
|
|
24066
23367
|
returnTypeError: error2
|
|
@@ -24070,29 +23371,29 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
24070
23371
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
24071
23372
|
const fn = ctx.data;
|
|
24072
23373
|
if (this._def.returns instanceof ZodPromise) {
|
|
24073
|
-
const
|
|
23374
|
+
const me = this;
|
|
24074
23375
|
return OK(async function(...args) {
|
|
24075
23376
|
const error2 = new ZodError([]);
|
|
24076
|
-
const parsedArgs = await
|
|
24077
|
-
error2.addIssue(makeArgsIssue(args,
|
|
23377
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
23378
|
+
error2.addIssue(makeArgsIssue(args, e));
|
|
24078
23379
|
throw error2;
|
|
24079
23380
|
});
|
|
24080
23381
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
24081
|
-
const parsedReturns = await
|
|
24082
|
-
error2.addIssue(makeReturnsIssue(result,
|
|
23382
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
23383
|
+
error2.addIssue(makeReturnsIssue(result, e));
|
|
24083
23384
|
throw error2;
|
|
24084
23385
|
});
|
|
24085
23386
|
return parsedReturns;
|
|
24086
23387
|
});
|
|
24087
23388
|
} else {
|
|
24088
|
-
const
|
|
23389
|
+
const me = this;
|
|
24089
23390
|
return OK(function(...args) {
|
|
24090
|
-
const parsedArgs =
|
|
23391
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
24091
23392
|
if (!parsedArgs.success) {
|
|
24092
23393
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
24093
23394
|
}
|
|
24094
23395
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
24095
|
-
const parsedReturns =
|
|
23396
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
24096
23397
|
if (!parsedReturns.success) {
|
|
24097
23398
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
24098
23399
|
}
|
|
@@ -24653,10 +23954,10 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
|
24653
23954
|
}
|
|
24654
23955
|
}
|
|
24655
23956
|
}
|
|
24656
|
-
static create(a,
|
|
23957
|
+
static create(a, b) {
|
|
24657
23958
|
return new _ZodPipeline({
|
|
24658
23959
|
in: a,
|
|
24659
|
-
out:
|
|
23960
|
+
out: b,
|
|
24660
23961
|
typeName: ZodFirstPartyTypeKind.ZodPipeline
|
|
24661
23962
|
});
|
|
24662
23963
|
}
|
|
@@ -24771,7 +24072,7 @@ function $constructor(name, initializer3, params) {
|
|
|
24771
24072
|
Object.defineProperty(inst, "_zod", {
|
|
24772
24073
|
value: {
|
|
24773
24074
|
def,
|
|
24774
|
-
constr:
|
|
24075
|
+
constr: _,
|
|
24775
24076
|
traits: /* @__PURE__ */ new Set()
|
|
24776
24077
|
},
|
|
24777
24078
|
enumerable: false
|
|
@@ -24782,12 +24083,12 @@ function $constructor(name, initializer3, params) {
|
|
|
24782
24083
|
}
|
|
24783
24084
|
inst._zod.traits.add(name);
|
|
24784
24085
|
initializer3(inst, def);
|
|
24785
|
-
const proto =
|
|
24086
|
+
const proto = _.prototype;
|
|
24786
24087
|
const keys = Object.keys(proto);
|
|
24787
24088
|
for (let i = 0; i < keys.length; i++) {
|
|
24788
|
-
const
|
|
24789
|
-
if (!(
|
|
24790
|
-
inst[
|
|
24089
|
+
const k = keys[i];
|
|
24090
|
+
if (!(k in inst)) {
|
|
24091
|
+
inst[k] = proto[k].bind(inst);
|
|
24791
24092
|
}
|
|
24792
24093
|
}
|
|
24793
24094
|
}
|
|
@@ -24795,7 +24096,7 @@ function $constructor(name, initializer3, params) {
|
|
|
24795
24096
|
class Definition extends Parent {
|
|
24796
24097
|
}
|
|
24797
24098
|
Object.defineProperty(Definition, "name", { value: name });
|
|
24798
|
-
function
|
|
24099
|
+
function _(def) {
|
|
24799
24100
|
var _a2;
|
|
24800
24101
|
const inst = params?.Parent ? new Definition() : this;
|
|
24801
24102
|
init(inst, def);
|
|
@@ -24805,16 +24106,16 @@ function $constructor(name, initializer3, params) {
|
|
|
24805
24106
|
}
|
|
24806
24107
|
return inst;
|
|
24807
24108
|
}
|
|
24808
|
-
Object.defineProperty(
|
|
24809
|
-
Object.defineProperty(
|
|
24109
|
+
Object.defineProperty(_, "init", { value: init });
|
|
24110
|
+
Object.defineProperty(_, Symbol.hasInstance, {
|
|
24810
24111
|
value: (inst) => {
|
|
24811
24112
|
if (params?.Parent && inst instanceof params.Parent)
|
|
24812
24113
|
return true;
|
|
24813
24114
|
return inst?._zod?.traits?.has(name);
|
|
24814
24115
|
}
|
|
24815
24116
|
});
|
|
24816
|
-
Object.defineProperty(
|
|
24817
|
-
return
|
|
24117
|
+
Object.defineProperty(_, "name", { value: name });
|
|
24118
|
+
return _;
|
|
24818
24119
|
}
|
|
24819
24120
|
var $ZodAsyncError = class extends Error {
|
|
24820
24121
|
constructor() {
|
|
@@ -24911,17 +24212,17 @@ function assertIs(_arg) {
|
|
|
24911
24212
|
function assertNever(_x) {
|
|
24912
24213
|
throw new Error("Unexpected value in exhaustive check");
|
|
24913
24214
|
}
|
|
24914
|
-
function assert(
|
|
24215
|
+
function assert(_) {
|
|
24915
24216
|
}
|
|
24916
24217
|
function getEnumValues(entries) {
|
|
24917
|
-
const numericValues = Object.values(entries).filter((
|
|
24918
|
-
const values = Object.entries(entries).filter(([
|
|
24218
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
24219
|
+
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
24919
24220
|
return values;
|
|
24920
24221
|
}
|
|
24921
24222
|
function joinValues(array2, separator = "|") {
|
|
24922
24223
|
return array2.map((val) => stringifyPrimitive(val)).join(separator);
|
|
24923
24224
|
}
|
|
24924
|
-
function jsonStringifyReplacer(
|
|
24225
|
+
function jsonStringifyReplacer(_, value) {
|
|
24925
24226
|
if (typeof value === "bigint")
|
|
24926
24227
|
return value.toString();
|
|
24927
24228
|
return value;
|
|
@@ -24976,9 +24277,9 @@ function defineLazy(object3, key, getter) {
|
|
|
24976
24277
|
}
|
|
24977
24278
|
return value;
|
|
24978
24279
|
},
|
|
24979
|
-
set(
|
|
24280
|
+
set(v) {
|
|
24980
24281
|
Object.defineProperty(object3, key, {
|
|
24981
|
-
value:
|
|
24282
|
+
value: v
|
|
24982
24283
|
// configurable: true,
|
|
24983
24284
|
});
|
|
24984
24285
|
},
|
|
@@ -25047,17 +24348,17 @@ var allowsEval = cached(() => {
|
|
|
25047
24348
|
return false;
|
|
25048
24349
|
}
|
|
25049
24350
|
try {
|
|
25050
|
-
const
|
|
25051
|
-
new
|
|
24351
|
+
const F = Function;
|
|
24352
|
+
new F("");
|
|
25052
24353
|
return true;
|
|
25053
|
-
} catch (
|
|
24354
|
+
} catch (_) {
|
|
25054
24355
|
return false;
|
|
25055
24356
|
}
|
|
25056
24357
|
});
|
|
25057
|
-
function isPlainObject(
|
|
25058
|
-
if (isObject(
|
|
24358
|
+
function isPlainObject(o) {
|
|
24359
|
+
if (isObject(o) === false)
|
|
25059
24360
|
return false;
|
|
25060
|
-
const ctor =
|
|
24361
|
+
const ctor = o.constructor;
|
|
25061
24362
|
if (ctor === void 0)
|
|
25062
24363
|
return true;
|
|
25063
24364
|
if (typeof ctor !== "function")
|
|
@@ -25070,12 +24371,12 @@ function isPlainObject(o2) {
|
|
|
25070
24371
|
}
|
|
25071
24372
|
return true;
|
|
25072
24373
|
}
|
|
25073
|
-
function shallowClone(
|
|
25074
|
-
if (isPlainObject(
|
|
25075
|
-
return { ...
|
|
25076
|
-
if (Array.isArray(
|
|
25077
|
-
return [...
|
|
25078
|
-
return
|
|
24374
|
+
function shallowClone(o) {
|
|
24375
|
+
if (isPlainObject(o))
|
|
24376
|
+
return { ...o };
|
|
24377
|
+
if (Array.isArray(o))
|
|
24378
|
+
return [...o];
|
|
24379
|
+
return o;
|
|
25079
24380
|
}
|
|
25080
24381
|
function numKeys(data) {
|
|
25081
24382
|
let keyCount = 0;
|
|
@@ -25160,31 +24461,31 @@ function normalizeParams(_params) {
|
|
|
25160
24461
|
function createTransparentProxy(getter) {
|
|
25161
24462
|
let target;
|
|
25162
24463
|
return new Proxy({}, {
|
|
25163
|
-
get(
|
|
24464
|
+
get(_, prop, receiver) {
|
|
25164
24465
|
target ?? (target = getter());
|
|
25165
24466
|
return Reflect.get(target, prop, receiver);
|
|
25166
24467
|
},
|
|
25167
|
-
set(
|
|
24468
|
+
set(_, prop, value, receiver) {
|
|
25168
24469
|
target ?? (target = getter());
|
|
25169
24470
|
return Reflect.set(target, prop, value, receiver);
|
|
25170
24471
|
},
|
|
25171
|
-
has(
|
|
24472
|
+
has(_, prop) {
|
|
25172
24473
|
target ?? (target = getter());
|
|
25173
24474
|
return Reflect.has(target, prop);
|
|
25174
24475
|
},
|
|
25175
|
-
deleteProperty(
|
|
24476
|
+
deleteProperty(_, prop) {
|
|
25176
24477
|
target ?? (target = getter());
|
|
25177
24478
|
return Reflect.deleteProperty(target, prop);
|
|
25178
24479
|
},
|
|
25179
|
-
ownKeys(
|
|
24480
|
+
ownKeys(_) {
|
|
25180
24481
|
target ?? (target = getter());
|
|
25181
24482
|
return Reflect.ownKeys(target);
|
|
25182
24483
|
},
|
|
25183
|
-
getOwnPropertyDescriptor(
|
|
24484
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
25184
24485
|
target ?? (target = getter());
|
|
25185
24486
|
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
25186
24487
|
},
|
|
25187
|
-
defineProperty(
|
|
24488
|
+
defineProperty(_, prop, descriptor) {
|
|
25188
24489
|
target ?? (target = getter());
|
|
25189
24490
|
return Reflect.defineProperty(target, prop, descriptor);
|
|
25190
24491
|
}
|
|
@@ -25198,8 +24499,8 @@ function stringifyPrimitive(value) {
|
|
|
25198
24499
|
return `${value}`;
|
|
25199
24500
|
}
|
|
25200
24501
|
function optionalKeys(shape) {
|
|
25201
|
-
return Object.keys(shape).filter((
|
|
25202
|
-
return shape[
|
|
24502
|
+
return Object.keys(shape).filter((k) => {
|
|
24503
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
25203
24504
|
});
|
|
25204
24505
|
}
|
|
25205
24506
|
var NUMBER_FORMAT_RANGES = {
|
|
@@ -25299,15 +24600,15 @@ function safeExtend(schema, shape) {
|
|
|
25299
24600
|
});
|
|
25300
24601
|
return clone(schema, def);
|
|
25301
24602
|
}
|
|
25302
|
-
function merge4(a,
|
|
24603
|
+
function merge4(a, b) {
|
|
25303
24604
|
const def = mergeDefs(a._zod.def, {
|
|
25304
24605
|
get shape() {
|
|
25305
|
-
const _shape = { ...a._zod.def.shape, ...
|
|
24606
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
25306
24607
|
assignProp(this, "shape", _shape);
|
|
25307
24608
|
return _shape;
|
|
25308
24609
|
},
|
|
25309
24610
|
get catchall() {
|
|
25310
|
-
return
|
|
24611
|
+
return b._zod.def.catchall;
|
|
25311
24612
|
},
|
|
25312
24613
|
checks: []
|
|
25313
24614
|
// delete existing checks
|
|
@@ -25383,11 +24684,11 @@ function required(Class2, schema, mask) {
|
|
|
25383
24684
|
});
|
|
25384
24685
|
return clone(schema, def);
|
|
25385
24686
|
}
|
|
25386
|
-
function aborted(
|
|
25387
|
-
if (
|
|
24687
|
+
function aborted(x, startIndex = 0) {
|
|
24688
|
+
if (x.aborted === true)
|
|
25388
24689
|
return true;
|
|
25389
|
-
for (let i = startIndex; i <
|
|
25390
|
-
if (
|
|
24690
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
24691
|
+
if (x.issues[i]?.continue !== true) {
|
|
25391
24692
|
return true;
|
|
25392
24693
|
}
|
|
25393
24694
|
}
|
|
@@ -25467,8 +24768,8 @@ function issue(...args) {
|
|
|
25467
24768
|
return { ...iss };
|
|
25468
24769
|
}
|
|
25469
24770
|
function cleanEnum(obj) {
|
|
25470
|
-
return Object.entries(obj).filter(([
|
|
25471
|
-
return Number.isNaN(Number.parseInt(
|
|
24771
|
+
return Object.entries(obj).filter(([k, _]) => {
|
|
24772
|
+
return Number.isNaN(Number.parseInt(k, 10));
|
|
25472
24773
|
}).map((el) => el[1]);
|
|
25473
24774
|
}
|
|
25474
24775
|
function base64ToUint8Array(base643) {
|
|
@@ -25506,7 +24807,7 @@ function hexToUint8Array(hex3) {
|
|
|
25506
24807
|
return bytes;
|
|
25507
24808
|
}
|
|
25508
24809
|
function uint8ArrayToHex(bytes) {
|
|
25509
|
-
return Array.from(bytes).map((
|
|
24810
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
25510
24811
|
}
|
|
25511
24812
|
var Class = class {
|
|
25512
24813
|
constructor(..._args) {
|
|
@@ -25587,9 +24888,9 @@ var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
25587
24888
|
throw new $ZodAsyncError();
|
|
25588
24889
|
}
|
|
25589
24890
|
if (result.issues.length) {
|
|
25590
|
-
const
|
|
25591
|
-
captureStackTrace(
|
|
25592
|
-
throw
|
|
24891
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
24892
|
+
captureStackTrace(e, _params?.callee);
|
|
24893
|
+
throw e;
|
|
25593
24894
|
}
|
|
25594
24895
|
return result.value;
|
|
25595
24896
|
};
|
|
@@ -25600,9 +24901,9 @@ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
|
25600
24901
|
if (result instanceof Promise)
|
|
25601
24902
|
result = await result;
|
|
25602
24903
|
if (result.issues.length) {
|
|
25603
|
-
const
|
|
25604
|
-
captureStackTrace(
|
|
25605
|
-
throw
|
|
24904
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
24905
|
+
captureStackTrace(e, params?.callee);
|
|
24906
|
+
throw e;
|
|
25606
24907
|
}
|
|
25607
24908
|
return result.value;
|
|
25608
24909
|
};
|
|
@@ -26384,19 +25685,19 @@ var Doc = class {
|
|
|
26384
25685
|
return;
|
|
26385
25686
|
}
|
|
26386
25687
|
const content = arg;
|
|
26387
|
-
const lines = content.split("\n").filter((
|
|
26388
|
-
const minIndent = Math.min(...lines.map((
|
|
26389
|
-
const dedented = lines.map((
|
|
25688
|
+
const lines = content.split("\n").filter((x) => x);
|
|
25689
|
+
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
25690
|
+
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
26390
25691
|
for (const line of dedented) {
|
|
26391
25692
|
this.content.push(line);
|
|
26392
25693
|
}
|
|
26393
25694
|
}
|
|
26394
25695
|
compile() {
|
|
26395
|
-
const
|
|
25696
|
+
const F = Function;
|
|
26396
25697
|
const args = this?.args;
|
|
26397
25698
|
const content = this?.content ?? [``];
|
|
26398
|
-
const lines = [...content.map((
|
|
26399
|
-
return new
|
|
25699
|
+
const lines = [...content.map((x) => ` ${x}`)];
|
|
25700
|
+
return new F(...args, lines.join("\n"));
|
|
26400
25701
|
}
|
|
26401
25702
|
};
|
|
26402
25703
|
|
|
@@ -26441,13 +25742,13 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
26441
25742
|
continue;
|
|
26442
25743
|
}
|
|
26443
25744
|
const currLen = payload.issues.length;
|
|
26444
|
-
const
|
|
26445
|
-
if (
|
|
25745
|
+
const _ = ch._zod.check(payload);
|
|
25746
|
+
if (_ instanceof Promise && ctx?.async === false) {
|
|
26446
25747
|
throw new $ZodAsyncError();
|
|
26447
25748
|
}
|
|
26448
|
-
if (asyncResult ||
|
|
25749
|
+
if (asyncResult || _ instanceof Promise) {
|
|
26449
25750
|
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
26450
|
-
await
|
|
25751
|
+
await _;
|
|
26451
25752
|
const nextLen = payload.issues.length;
|
|
26452
25753
|
if (nextLen === currLen)
|
|
26453
25754
|
return;
|
|
@@ -26507,10 +25808,10 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
26507
25808
|
defineLazy(inst, "~standard", () => ({
|
|
26508
25809
|
validate: (value) => {
|
|
26509
25810
|
try {
|
|
26510
|
-
const
|
|
26511
|
-
return
|
|
26512
|
-
} catch (
|
|
26513
|
-
return safeParseAsync(inst, value).then((
|
|
25811
|
+
const r = safeParse(inst, value);
|
|
25812
|
+
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
25813
|
+
} catch (_) {
|
|
25814
|
+
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
26514
25815
|
}
|
|
26515
25816
|
},
|
|
26516
25817
|
vendor: "zod",
|
|
@@ -26520,11 +25821,11 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
26520
25821
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
26521
25822
|
$ZodType.init(inst, def);
|
|
26522
25823
|
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
|
|
26523
|
-
inst._zod.parse = (payload,
|
|
25824
|
+
inst._zod.parse = (payload, _) => {
|
|
26524
25825
|
if (def.coerce)
|
|
26525
25826
|
try {
|
|
26526
25827
|
payload.value = String(payload.value);
|
|
26527
|
-
} catch (
|
|
25828
|
+
} catch (_2) {
|
|
26528
25829
|
}
|
|
26529
25830
|
if (typeof payload.value === "string")
|
|
26530
25831
|
return payload;
|
|
@@ -26557,10 +25858,10 @@ var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
|
26557
25858
|
v7: 7,
|
|
26558
25859
|
v8: 8
|
|
26559
25860
|
};
|
|
26560
|
-
const
|
|
26561
|
-
if (
|
|
25861
|
+
const v = versionMap[def.version];
|
|
25862
|
+
if (v === void 0)
|
|
26562
25863
|
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
26563
|
-
def.pattern ?? (def.pattern = uuid(
|
|
25864
|
+
def.pattern ?? (def.pattern = uuid(v));
|
|
26564
25865
|
} else
|
|
26565
25866
|
def.pattern ?? (def.pattern = uuid());
|
|
26566
25867
|
$ZodStringFormat.init(inst, def);
|
|
@@ -26609,7 +25910,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
26609
25910
|
payload.value = trimmed;
|
|
26610
25911
|
}
|
|
26611
25912
|
return;
|
|
26612
|
-
} catch (
|
|
25913
|
+
} catch (_) {
|
|
26613
25914
|
payload.issues.push({
|
|
26614
25915
|
code: "invalid_format",
|
|
26615
25916
|
format: "url",
|
|
@@ -26834,7 +26135,7 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
26834
26135
|
if (def.coerce)
|
|
26835
26136
|
try {
|
|
26836
26137
|
payload.value = Number(payload.value);
|
|
26837
|
-
} catch (
|
|
26138
|
+
} catch (_) {
|
|
26838
26139
|
}
|
|
26839
26140
|
const input = payload.value;
|
|
26840
26141
|
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
|
|
@@ -26862,7 +26163,7 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
26862
26163
|
if (def.coerce)
|
|
26863
26164
|
try {
|
|
26864
26165
|
payload.value = Boolean(payload.value);
|
|
26865
|
-
} catch (
|
|
26166
|
+
} catch (_) {
|
|
26866
26167
|
}
|
|
26867
26168
|
const input = payload.value;
|
|
26868
26169
|
if (typeof input === "boolean")
|
|
@@ -26883,7 +26184,7 @@ var $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
|
|
|
26883
26184
|
if (def.coerce)
|
|
26884
26185
|
try {
|
|
26885
26186
|
payload.value = BigInt(payload.value);
|
|
26886
|
-
} catch (
|
|
26187
|
+
} catch (_) {
|
|
26887
26188
|
}
|
|
26888
26189
|
if (typeof payload.value === "bigint")
|
|
26889
26190
|
return payload;
|
|
@@ -27066,9 +26367,9 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
27066
26367
|
}
|
|
27067
26368
|
function normalizeDef(def) {
|
|
27068
26369
|
const keys = Object.keys(def.shape);
|
|
27069
|
-
for (const
|
|
27070
|
-
if (!def.shape?.[
|
|
27071
|
-
throw new Error(`Invalid element at key "${
|
|
26370
|
+
for (const k of keys) {
|
|
26371
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
26372
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
27072
26373
|
}
|
|
27073
26374
|
}
|
|
27074
26375
|
const okeys = optionalKeys(def.shape);
|
|
@@ -27093,11 +26394,11 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
27093
26394
|
unrecognized.push(key);
|
|
27094
26395
|
continue;
|
|
27095
26396
|
}
|
|
27096
|
-
const
|
|
27097
|
-
if (
|
|
27098
|
-
proms.push(
|
|
26397
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
26398
|
+
if (r instanceof Promise) {
|
|
26399
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
|
|
27099
26400
|
} else {
|
|
27100
|
-
handlePropertyResult(
|
|
26401
|
+
handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
27101
26402
|
}
|
|
27102
26403
|
}
|
|
27103
26404
|
if (unrecognized.length) {
|
|
@@ -27137,8 +26438,8 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
27137
26438
|
const field = shape[key]._zod;
|
|
27138
26439
|
if (field.values) {
|
|
27139
26440
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
27140
|
-
for (const
|
|
27141
|
-
propValues[key].add(
|
|
26441
|
+
for (const v of field.values)
|
|
26442
|
+
propValues[key].add(v);
|
|
27142
26443
|
}
|
|
27143
26444
|
}
|
|
27144
26445
|
return propValues;
|
|
@@ -27164,11 +26465,11 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
27164
26465
|
for (const key of value.keys) {
|
|
27165
26466
|
const el = shape[key];
|
|
27166
26467
|
const isOptionalOut = el._zod.optout === "optional";
|
|
27167
|
-
const
|
|
27168
|
-
if (
|
|
27169
|
-
proms.push(
|
|
26468
|
+
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
26469
|
+
if (r instanceof Promise) {
|
|
26470
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
|
|
27170
26471
|
} else {
|
|
27171
|
-
handlePropertyResult(
|
|
26472
|
+
handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
27172
26473
|
}
|
|
27173
26474
|
}
|
|
27174
26475
|
if (!catchall) {
|
|
@@ -27185,8 +26486,8 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
27185
26486
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
27186
26487
|
const normalized = _normalized.value;
|
|
27187
26488
|
const parseStr = (key) => {
|
|
27188
|
-
const
|
|
27189
|
-
return `shape[${
|
|
26489
|
+
const k = esc(key);
|
|
26490
|
+
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
27190
26491
|
};
|
|
27191
26492
|
doc.write(`const input = payload.value;`);
|
|
27192
26493
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -27197,27 +26498,27 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
27197
26498
|
doc.write(`const newResult = {};`);
|
|
27198
26499
|
for (const key of normalized.keys) {
|
|
27199
26500
|
const id = ids[key];
|
|
27200
|
-
const
|
|
26501
|
+
const k = esc(key);
|
|
27201
26502
|
const schema = shape[key];
|
|
27202
26503
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
27203
26504
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
27204
26505
|
if (isOptionalOut) {
|
|
27205
26506
|
doc.write(`
|
|
27206
26507
|
if (${id}.issues.length) {
|
|
27207
|
-
if (${
|
|
26508
|
+
if (${k} in input) {
|
|
27208
26509
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
27209
26510
|
...iss,
|
|
27210
|
-
path: iss.path ? [${
|
|
26511
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
27211
26512
|
})));
|
|
27212
26513
|
}
|
|
27213
26514
|
}
|
|
27214
26515
|
|
|
27215
26516
|
if (${id}.value === undefined) {
|
|
27216
|
-
if (${
|
|
27217
|
-
newResult[${
|
|
26517
|
+
if (${k} in input) {
|
|
26518
|
+
newResult[${k}] = undefined;
|
|
27218
26519
|
}
|
|
27219
26520
|
} else {
|
|
27220
|
-
newResult[${
|
|
26521
|
+
newResult[${k}] = ${id}.value;
|
|
27221
26522
|
}
|
|
27222
26523
|
|
|
27223
26524
|
`);
|
|
@@ -27226,16 +26527,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
27226
26527
|
if (${id}.issues.length) {
|
|
27227
26528
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
27228
26529
|
...iss,
|
|
27229
|
-
path: iss.path ? [${
|
|
26530
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
27230
26531
|
})));
|
|
27231
26532
|
}
|
|
27232
26533
|
|
|
27233
26534
|
if (${id}.value === undefined) {
|
|
27234
|
-
if (${
|
|
27235
|
-
newResult[${
|
|
26535
|
+
if (${k} in input) {
|
|
26536
|
+
newResult[${k}] = undefined;
|
|
27236
26537
|
}
|
|
27237
26538
|
} else {
|
|
27238
|
-
newResult[${
|
|
26539
|
+
newResult[${k}] = ${id}.value;
|
|
27239
26540
|
}
|
|
27240
26541
|
|
|
27241
26542
|
`);
|
|
@@ -27283,7 +26584,7 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
27283
26584
|
return final;
|
|
27284
26585
|
}
|
|
27285
26586
|
}
|
|
27286
|
-
const nonaborted = results.filter((
|
|
26587
|
+
const nonaborted = results.filter((r) => !aborted(r));
|
|
27287
26588
|
if (nonaborted.length === 1) {
|
|
27288
26589
|
final.value = nonaborted[0].value;
|
|
27289
26590
|
return nonaborted[0];
|
|
@@ -27298,18 +26599,18 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
27298
26599
|
}
|
|
27299
26600
|
var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
27300
26601
|
$ZodType.init(inst, def);
|
|
27301
|
-
defineLazy(inst._zod, "optin", () => def.options.some((
|
|
27302
|
-
defineLazy(inst._zod, "optout", () => def.options.some((
|
|
26602
|
+
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
26603
|
+
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
27303
26604
|
defineLazy(inst._zod, "values", () => {
|
|
27304
|
-
if (def.options.every((
|
|
26605
|
+
if (def.options.every((o) => o._zod.values)) {
|
|
27305
26606
|
return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
27306
26607
|
}
|
|
27307
26608
|
return void 0;
|
|
27308
26609
|
});
|
|
27309
26610
|
defineLazy(inst._zod, "pattern", () => {
|
|
27310
|
-
if (def.options.every((
|
|
27311
|
-
const patterns = def.options.map((
|
|
27312
|
-
return new RegExp(`^(${patterns.map((
|
|
26611
|
+
if (def.options.every((o) => o._zod.pattern)) {
|
|
26612
|
+
const patterns = def.options.map((o) => o._zod.pattern);
|
|
26613
|
+
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
27313
26614
|
}
|
|
27314
26615
|
return void 0;
|
|
27315
26616
|
});
|
|
@@ -27343,7 +26644,7 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
27343
26644
|
};
|
|
27344
26645
|
});
|
|
27345
26646
|
function handleExclusiveUnionResults(results, final, inst, ctx) {
|
|
27346
|
-
const successes = results.filter((
|
|
26647
|
+
const successes = results.filter((r) => r.issues.length === 0);
|
|
27347
26648
|
if (successes.length === 1) {
|
|
27348
26649
|
final.value = successes[0].value;
|
|
27349
26650
|
return final;
|
|
@@ -27406,11 +26707,11 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
27406
26707
|
const pv = option._zod.propValues;
|
|
27407
26708
|
if (!pv || Object.keys(pv).length === 0)
|
|
27408
26709
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
27409
|
-
for (const [
|
|
27410
|
-
if (!propValues[
|
|
27411
|
-
propValues[
|
|
27412
|
-
for (const val of
|
|
27413
|
-
propValues[
|
|
26710
|
+
for (const [k, v] of Object.entries(pv)) {
|
|
26711
|
+
if (!propValues[k])
|
|
26712
|
+
propValues[k] = /* @__PURE__ */ new Set();
|
|
26713
|
+
for (const val of v) {
|
|
26714
|
+
propValues[k].add(val);
|
|
27414
26715
|
}
|
|
27415
26716
|
}
|
|
27416
26717
|
}
|
|
@@ -27419,15 +26720,15 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
27419
26720
|
const disc = cached(() => {
|
|
27420
26721
|
const opts = def.options;
|
|
27421
26722
|
const map2 = /* @__PURE__ */ new Map();
|
|
27422
|
-
for (const
|
|
27423
|
-
const values =
|
|
26723
|
+
for (const o of opts) {
|
|
26724
|
+
const values = o._zod.propValues?.[def.discriminator];
|
|
27424
26725
|
if (!values || values.size === 0)
|
|
27425
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(
|
|
27426
|
-
for (const
|
|
27427
|
-
if (map2.has(
|
|
27428
|
-
throw new Error(`Duplicate discriminator value "${String(
|
|
26726
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
26727
|
+
for (const v of values) {
|
|
26728
|
+
if (map2.has(v)) {
|
|
26729
|
+
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
27429
26730
|
}
|
|
27430
|
-
map2.set(
|
|
26731
|
+
map2.set(v, o);
|
|
27431
26732
|
}
|
|
27432
26733
|
}
|
|
27433
26734
|
return map2;
|
|
@@ -27477,19 +26778,19 @@ var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, d
|
|
|
27477
26778
|
return handleIntersectionResults(payload, left, right);
|
|
27478
26779
|
};
|
|
27479
26780
|
});
|
|
27480
|
-
function mergeValues2(a,
|
|
27481
|
-
if (a ===
|
|
26781
|
+
function mergeValues2(a, b) {
|
|
26782
|
+
if (a === b) {
|
|
27482
26783
|
return { valid: true, data: a };
|
|
27483
26784
|
}
|
|
27484
|
-
if (a instanceof Date &&
|
|
26785
|
+
if (a instanceof Date && b instanceof Date && +a === +b) {
|
|
27485
26786
|
return { valid: true, data: a };
|
|
27486
26787
|
}
|
|
27487
|
-
if (isPlainObject(a) && isPlainObject(
|
|
27488
|
-
const bKeys = Object.keys(
|
|
26788
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
26789
|
+
const bKeys = Object.keys(b);
|
|
27489
26790
|
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
27490
|
-
const newObj = { ...a, ...
|
|
26791
|
+
const newObj = { ...a, ...b };
|
|
27491
26792
|
for (const key of sharedKeys) {
|
|
27492
|
-
const sharedValue = mergeValues2(a[key],
|
|
26793
|
+
const sharedValue = mergeValues2(a[key], b[key]);
|
|
27493
26794
|
if (!sharedValue.valid) {
|
|
27494
26795
|
return {
|
|
27495
26796
|
valid: false,
|
|
@@ -27500,14 +26801,14 @@ function mergeValues2(a, b3) {
|
|
|
27500
26801
|
}
|
|
27501
26802
|
return { valid: true, data: newObj };
|
|
27502
26803
|
}
|
|
27503
|
-
if (Array.isArray(a) && Array.isArray(
|
|
27504
|
-
if (a.length !==
|
|
26804
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
26805
|
+
if (a.length !== b.length) {
|
|
27505
26806
|
return { valid: false, mergeErrorPath: [] };
|
|
27506
26807
|
}
|
|
27507
26808
|
const newArray = [];
|
|
27508
26809
|
for (let index = 0; index < a.length; index++) {
|
|
27509
26810
|
const itemA = a[index];
|
|
27510
|
-
const itemB =
|
|
26811
|
+
const itemB = b[index];
|
|
27511
26812
|
const sharedValue = mergeValues2(itemA, itemB);
|
|
27512
26813
|
if (!sharedValue.valid) {
|
|
27513
26814
|
return {
|
|
@@ -27527,10 +26828,10 @@ function handleIntersectionResults(result, left, right) {
|
|
|
27527
26828
|
for (const iss of left.issues) {
|
|
27528
26829
|
if (iss.code === "unrecognized_keys") {
|
|
27529
26830
|
unrecIssue ?? (unrecIssue = iss);
|
|
27530
|
-
for (const
|
|
27531
|
-
if (!unrecKeys.has(
|
|
27532
|
-
unrecKeys.set(
|
|
27533
|
-
unrecKeys.get(
|
|
26831
|
+
for (const k of iss.keys) {
|
|
26832
|
+
if (!unrecKeys.has(k))
|
|
26833
|
+
unrecKeys.set(k, {});
|
|
26834
|
+
unrecKeys.get(k).l = true;
|
|
27534
26835
|
}
|
|
27535
26836
|
} else {
|
|
27536
26837
|
result.issues.push(iss);
|
|
@@ -27538,16 +26839,16 @@ function handleIntersectionResults(result, left, right) {
|
|
|
27538
26839
|
}
|
|
27539
26840
|
for (const iss of right.issues) {
|
|
27540
26841
|
if (iss.code === "unrecognized_keys") {
|
|
27541
|
-
for (const
|
|
27542
|
-
if (!unrecKeys.has(
|
|
27543
|
-
unrecKeys.set(
|
|
27544
|
-
unrecKeys.get(
|
|
26842
|
+
for (const k of iss.keys) {
|
|
26843
|
+
if (!unrecKeys.has(k))
|
|
26844
|
+
unrecKeys.set(k, {});
|
|
26845
|
+
unrecKeys.get(k).r = true;
|
|
27545
26846
|
}
|
|
27546
26847
|
} else {
|
|
27547
26848
|
result.issues.push(iss);
|
|
27548
26849
|
}
|
|
27549
26850
|
}
|
|
27550
|
-
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([
|
|
26851
|
+
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
27551
26852
|
if (bothKeys.length && unrecIssue) {
|
|
27552
26853
|
result.issues.push({ ...unrecIssue, keys: bothKeys });
|
|
27553
26854
|
}
|
|
@@ -27841,7 +27142,7 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
27841
27142
|
const values = getEnumValues(def.entries);
|
|
27842
27143
|
const valuesSet = new Set(values);
|
|
27843
27144
|
inst._zod.values = valuesSet;
|
|
27844
|
-
inst._zod.pattern = new RegExp(`^(${values.filter((
|
|
27145
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
27845
27146
|
inst._zod.parse = (payload, _ctx) => {
|
|
27846
27147
|
const input = payload.value;
|
|
27847
27148
|
if (valuesSet.has(input)) {
|
|
@@ -27863,7 +27164,7 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
27863
27164
|
}
|
|
27864
27165
|
const values = new Set(def.values);
|
|
27865
27166
|
inst._zod.values = values;
|
|
27866
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((
|
|
27167
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
27867
27168
|
inst._zod.parse = (payload, _ctx) => {
|
|
27868
27169
|
const input = payload.value;
|
|
27869
27170
|
if (values.has(input)) {
|
|
@@ -27935,7 +27236,7 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
27935
27236
|
if (def.innerType._zod.optin === "optional") {
|
|
27936
27237
|
const result = def.innerType._zod.run(payload, ctx);
|
|
27937
27238
|
if (result instanceof Promise)
|
|
27938
|
-
return result.then((
|
|
27239
|
+
return result.then((r) => handleOptionalResult(r, payload.value));
|
|
27939
27240
|
return handleOptionalResult(result, payload.value);
|
|
27940
27241
|
}
|
|
27941
27242
|
if (payload.value === void 0) {
|
|
@@ -28011,8 +27312,8 @@ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
|
|
|
28011
27312
|
var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
|
|
28012
27313
|
$ZodType.init(inst, def);
|
|
28013
27314
|
defineLazy(inst._zod, "values", () => {
|
|
28014
|
-
const
|
|
28015
|
-
return
|
|
27315
|
+
const v = def.innerType._zod.values;
|
|
27316
|
+
return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
|
|
28016
27317
|
});
|
|
28017
27318
|
inst._zod.parse = (payload, ctx) => {
|
|
28018
27319
|
const result = def.innerType._zod.run(payload, ctx);
|
|
@@ -28298,9 +27599,9 @@ var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
|
|
|
28298
27599
|
return payload;
|
|
28299
27600
|
};
|
|
28300
27601
|
inst.input = (...args) => {
|
|
28301
|
-
const
|
|
27602
|
+
const F = inst.constructor;
|
|
28302
27603
|
if (Array.isArray(args[0])) {
|
|
28303
|
-
return new
|
|
27604
|
+
return new F({
|
|
28304
27605
|
type: "function",
|
|
28305
27606
|
input: new $ZodTuple({
|
|
28306
27607
|
type: "tuple",
|
|
@@ -28310,15 +27611,15 @@ var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
|
|
|
28310
27611
|
output: inst._def.output
|
|
28311
27612
|
});
|
|
28312
27613
|
}
|
|
28313
|
-
return new
|
|
27614
|
+
return new F({
|
|
28314
27615
|
type: "function",
|
|
28315
27616
|
input: args[0],
|
|
28316
27617
|
output: inst._def.output
|
|
28317
27618
|
});
|
|
28318
27619
|
};
|
|
28319
27620
|
inst.output = (output) => {
|
|
28320
|
-
const
|
|
28321
|
-
return new
|
|
27621
|
+
const F = inst.constructor;
|
|
27622
|
+
return new F({
|
|
28322
27623
|
type: "function",
|
|
28323
27624
|
input: inst._def.input,
|
|
28324
27625
|
output
|
|
@@ -28347,16 +27648,16 @@ var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
|
|
|
28347
27648
|
var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
28348
27649
|
$ZodCheck.init(inst, def);
|
|
28349
27650
|
$ZodType.init(inst, def);
|
|
28350
|
-
inst._zod.parse = (payload,
|
|
27651
|
+
inst._zod.parse = (payload, _) => {
|
|
28351
27652
|
return payload;
|
|
28352
27653
|
};
|
|
28353
27654
|
inst._zod.check = (payload) => {
|
|
28354
27655
|
const input = payload.value;
|
|
28355
|
-
const
|
|
28356
|
-
if (
|
|
28357
|
-
return
|
|
27656
|
+
const r = def.fn(input);
|
|
27657
|
+
if (r instanceof Promise) {
|
|
27658
|
+
return r.then((r2) => handleRefineResult(r2, payload, input, inst));
|
|
28358
27659
|
}
|
|
28359
|
-
handleRefineResult(
|
|
27660
|
+
handleRefineResult(r, payload, input, inst);
|
|
28360
27661
|
return;
|
|
28361
27662
|
};
|
|
28362
27663
|
});
|
|
@@ -28516,9 +27817,9 @@ var $ZodRegistry = class {
|
|
|
28516
27817
|
return this;
|
|
28517
27818
|
}
|
|
28518
27819
|
get(schema) {
|
|
28519
|
-
const
|
|
28520
|
-
if (
|
|
28521
|
-
const pm = { ...this.get(
|
|
27820
|
+
const p = schema._zod.parent;
|
|
27821
|
+
if (p) {
|
|
27822
|
+
const pm = { ...this.get(p) ?? {} };
|
|
28522
27823
|
delete pm.id;
|
|
28523
27824
|
const f = { ...pm, ...this._map.get(schema) };
|
|
28524
27825
|
return Object.keys(f).length ? f : void 0;
|
|
@@ -29276,8 +28577,8 @@ function _stringbool(Classes, _params) {
|
|
|
29276
28577
|
let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
|
|
29277
28578
|
let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
|
|
29278
28579
|
if (params.case !== "sensitive") {
|
|
29279
|
-
truthyArray = truthyArray.map((
|
|
29280
|
-
falsyArray = falsyArray.map((
|
|
28580
|
+
truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
28581
|
+
falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
29281
28582
|
}
|
|
29282
28583
|
const truthySet = new Set(truthyArray);
|
|
29283
28584
|
const falsySet = new Set(falsyArray);
|
|
@@ -29823,9 +29124,9 @@ var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
|
29823
29124
|
var enumProcessor = (schema, _ctx, json2, _params) => {
|
|
29824
29125
|
const def = schema._zod.def;
|
|
29825
29126
|
const values = getEnumValues(def.entries);
|
|
29826
|
-
if (values.every((
|
|
29127
|
+
if (values.every((v) => typeof v === "number"))
|
|
29827
29128
|
json2.type = "number";
|
|
29828
|
-
if (values.every((
|
|
29129
|
+
if (values.every((v) => typeof v === "string"))
|
|
29829
29130
|
json2.type = "string";
|
|
29830
29131
|
json2.enum = values;
|
|
29831
29132
|
};
|
|
@@ -29858,13 +29159,13 @@ var literalProcessor = (schema, ctx, json2, _params) => {
|
|
|
29858
29159
|
json2.const = val;
|
|
29859
29160
|
}
|
|
29860
29161
|
} else {
|
|
29861
|
-
if (vals.every((
|
|
29162
|
+
if (vals.every((v) => typeof v === "number"))
|
|
29862
29163
|
json2.type = "number";
|
|
29863
|
-
if (vals.every((
|
|
29164
|
+
if (vals.every((v) => typeof v === "string"))
|
|
29864
29165
|
json2.type = "string";
|
|
29865
|
-
if (vals.every((
|
|
29166
|
+
if (vals.every((v) => typeof v === "boolean"))
|
|
29866
29167
|
json2.type = "boolean";
|
|
29867
|
-
if (vals.every((
|
|
29168
|
+
if (vals.every((v) => v === null))
|
|
29868
29169
|
json2.type = "null";
|
|
29869
29170
|
json2.enum = vals;
|
|
29870
29171
|
}
|
|
@@ -29900,7 +29201,7 @@ var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
|
29900
29201
|
Object.assign(_json, file2);
|
|
29901
29202
|
} else {
|
|
29902
29203
|
Object.assign(_json, file2);
|
|
29903
|
-
_json.anyOf = mime.map((
|
|
29204
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
29904
29205
|
}
|
|
29905
29206
|
} else {
|
|
29906
29207
|
Object.assign(_json, file2);
|
|
@@ -29959,11 +29260,11 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
29959
29260
|
}
|
|
29960
29261
|
const allKeys = new Set(Object.keys(shape));
|
|
29961
29262
|
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
29962
|
-
const
|
|
29263
|
+
const v = def.shape[key]._zod;
|
|
29963
29264
|
if (ctx.io === "input") {
|
|
29964
|
-
return
|
|
29265
|
+
return v.optin === void 0;
|
|
29965
29266
|
} else {
|
|
29966
|
-
return
|
|
29267
|
+
return v.optout === void 0;
|
|
29967
29268
|
}
|
|
29968
29269
|
}));
|
|
29969
29270
|
if (requiredKeys.size > 0) {
|
|
@@ -29984,7 +29285,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
29984
29285
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
29985
29286
|
const def = schema._zod.def;
|
|
29986
29287
|
const isExclusive = def.inclusive === false;
|
|
29987
|
-
const options = def.options.map((
|
|
29288
|
+
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
29988
29289
|
...params,
|
|
29989
29290
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
29990
29291
|
}));
|
|
@@ -30000,14 +29301,14 @@ var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
|
30000
29301
|
...params,
|
|
30001
29302
|
path: [...params.path, "allOf", 0]
|
|
30002
29303
|
});
|
|
30003
|
-
const
|
|
29304
|
+
const b = process2(def.right, ctx, {
|
|
30004
29305
|
...params,
|
|
30005
29306
|
path: [...params.path, "allOf", 1]
|
|
30006
29307
|
});
|
|
30007
29308
|
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
30008
29309
|
const allOf = [
|
|
30009
29310
|
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
30010
|
-
...isSimpleIntersection(
|
|
29311
|
+
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
30011
29312
|
];
|
|
30012
29313
|
json2.allOf = allOf;
|
|
30013
29314
|
};
|
|
@@ -30017,7 +29318,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
30017
29318
|
json2.type = "array";
|
|
30018
29319
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
30019
29320
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
30020
|
-
const prefixItems = def.items.map((
|
|
29321
|
+
const prefixItems = def.items.map((x, i) => process2(x, ctx, {
|
|
30021
29322
|
...params,
|
|
30022
29323
|
path: [...params.path, prefixPath, i]
|
|
30023
29324
|
}));
|
|
@@ -30083,7 +29384,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
30083
29384
|
}
|
|
30084
29385
|
const keyValues = keyType._zod.values;
|
|
30085
29386
|
if (keyValues) {
|
|
30086
|
-
const validKeyValues = [...keyValues].filter((
|
|
29387
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
30087
29388
|
if (validKeyValues.length > 0) {
|
|
30088
29389
|
json2.required = validKeyValues;
|
|
30089
29390
|
}
|
|
@@ -31102,11 +30403,11 @@ function record(keyType, valueType, params) {
|
|
|
31102
30403
|
});
|
|
31103
30404
|
}
|
|
31104
30405
|
function partialRecord(keyType, valueType, params) {
|
|
31105
|
-
const
|
|
31106
|
-
|
|
30406
|
+
const k = clone(keyType);
|
|
30407
|
+
k._zod.values = void 0;
|
|
31107
30408
|
return new ZodRecord2({
|
|
31108
30409
|
type: "record",
|
|
31109
|
-
keyType:
|
|
30410
|
+
keyType: k,
|
|
31110
30411
|
valueType,
|
|
31111
30412
|
...util_exports.normalizeParams(params)
|
|
31112
30413
|
});
|
|
@@ -31194,7 +30495,7 @@ var ZodEnum2 = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
31194
30495
|
};
|
|
31195
30496
|
});
|
|
31196
30497
|
function _enum(values, params) {
|
|
31197
|
-
const entries = Array.isArray(values) ? Object.fromEntries(values.map((
|
|
30498
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
31198
30499
|
return new ZodEnum2({
|
|
31199
30500
|
type: "enum",
|
|
31200
30501
|
entries,
|
|
@@ -31550,7 +30851,7 @@ var ZodFirstPartyTypeKind2;
|
|
|
31550
30851
|
})(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {}));
|
|
31551
30852
|
|
|
31552
30853
|
// node_modules/zod/v4/classic/from-json-schema.js
|
|
31553
|
-
var
|
|
30854
|
+
var z = {
|
|
31554
30855
|
...schemas_exports3,
|
|
31555
30856
|
...checks_exports2,
|
|
31556
30857
|
iso: iso_exports2
|
|
@@ -31562,7 +30863,7 @@ config(en_default2());
|
|
|
31562
30863
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
31563
30864
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
31564
30865
|
var JSONRPC_VERSION = "2.0";
|
|
31565
|
-
var AssertObjectSchema = custom((
|
|
30866
|
+
var AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
31566
30867
|
var ProgressTokenSchema = union([string2(), number2().int()]);
|
|
31567
30868
|
var CursorSchema = string2();
|
|
31568
30869
|
var TaskCreationParamsSchema = looseObject({
|
|
@@ -33526,8 +32827,8 @@ function throwCommandNotFound(input) {
|
|
|
33526
32827
|
const shouldRenderIntroOutro = container.dependencies.logger == null;
|
|
33527
32828
|
if (shouldRenderIntroOutro) {
|
|
33528
32829
|
logger2.intro(panel.title);
|
|
33529
|
-
|
|
33530
|
-
|
|
32830
|
+
log2.message(panel.label, { symbol: symbols.errorResolved });
|
|
32831
|
+
outro2(panel.footer);
|
|
33531
32832
|
} else {
|
|
33532
32833
|
logger2.error(`${panel.label}
|
|
33533
32834
|
${panel.footer}`);
|
|
@@ -33804,12 +33105,12 @@ function registerMcpCommand(program, container) {
|
|
|
33804
33105
|
if (options.yes) {
|
|
33805
33106
|
agent = DEFAULT_MCP_AGENT;
|
|
33806
33107
|
} else {
|
|
33807
|
-
const selected = await
|
|
33108
|
+
const selected = await select2({
|
|
33808
33109
|
message: "Select agent to configure:",
|
|
33809
33110
|
options: supportedAgents.map((a) => ({ value: a, label: a }))
|
|
33810
33111
|
});
|
|
33811
|
-
if (
|
|
33812
|
-
|
|
33112
|
+
if (isCancel(selected)) {
|
|
33113
|
+
cancel("Operation cancelled");
|
|
33813
33114
|
return;
|
|
33814
33115
|
}
|
|
33815
33116
|
agent = selected;
|
|
@@ -34120,12 +33421,12 @@ function registerSkillCommand(program, container) {
|
|
|
34120
33421
|
if (flags.assumeYes) {
|
|
34121
33422
|
agent = DEFAULT_SKILL_AGENT;
|
|
34122
33423
|
} else {
|
|
34123
|
-
const selected = await
|
|
33424
|
+
const selected = await select2({
|
|
34124
33425
|
message: "Select agent to configure:",
|
|
34125
33426
|
options: supportedAgents2.map((a) => ({ value: a, label: a }))
|
|
34126
33427
|
});
|
|
34127
|
-
if (
|
|
34128
|
-
|
|
33428
|
+
if (isCancel(selected)) {
|
|
33429
|
+
cancel("Operation cancelled");
|
|
34129
33430
|
return;
|
|
34130
33431
|
}
|
|
34131
33432
|
agent = selected;
|
|
@@ -34150,15 +33451,15 @@ function registerSkillCommand(program, container) {
|
|
|
34150
33451
|
} else if (flags.assumeYes) {
|
|
34151
33452
|
scope = "global";
|
|
34152
33453
|
} else {
|
|
34153
|
-
const selected = await
|
|
33454
|
+
const selected = await select2({
|
|
34154
33455
|
message: "Select scope:",
|
|
34155
33456
|
options: [
|
|
34156
33457
|
{ value: "global", label: "Global" },
|
|
34157
33458
|
{ value: "local", label: "Local" }
|
|
34158
33459
|
]
|
|
34159
33460
|
});
|
|
34160
|
-
if (
|
|
34161
|
-
|
|
33461
|
+
if (isCancel(selected)) {
|
|
33462
|
+
cancel("Operation cancelled");
|
|
34162
33463
|
return;
|
|
34163
33464
|
}
|
|
34164
33465
|
scope = selected;
|
|
@@ -34199,12 +33500,12 @@ function registerSkillCommand(program, container) {
|
|
|
34199
33500
|
}
|
|
34200
33501
|
let agent = options.agent ?? agentArg;
|
|
34201
33502
|
if (!agent) {
|
|
34202
|
-
const selected = await
|
|
33503
|
+
const selected = await select2({
|
|
34203
33504
|
message: "Select agent to unconfigure:",
|
|
34204
33505
|
options: supportedAgents2.map((a) => ({ value: a, label: a }))
|
|
34205
33506
|
});
|
|
34206
|
-
if (
|
|
34207
|
-
|
|
33507
|
+
if (isCancel(selected)) {
|
|
33508
|
+
cancel("Operation cancelled");
|
|
34208
33509
|
return;
|
|
34209
33510
|
}
|
|
34210
33511
|
agent = selected;
|
|
@@ -34226,15 +33527,15 @@ function registerSkillCommand(program, container) {
|
|
|
34226
33527
|
} else if (options.global) {
|
|
34227
33528
|
scope = "global";
|
|
34228
33529
|
} else {
|
|
34229
|
-
const selected = await
|
|
33530
|
+
const selected = await select2({
|
|
34230
33531
|
message: "Select scope:",
|
|
34231
33532
|
options: [
|
|
34232
33533
|
{ value: "global", label: "Global" },
|
|
34233
33534
|
{ value: "local", label: "Local" }
|
|
34234
33535
|
]
|
|
34235
33536
|
});
|
|
34236
|
-
if (
|
|
34237
|
-
|
|
33537
|
+
if (isCancel(selected)) {
|
|
33538
|
+
cancel("Operation cancelled");
|
|
34238
33539
|
return;
|
|
34239
33540
|
}
|
|
34240
33541
|
scope = selected;
|
|
@@ -34378,9 +33679,9 @@ import { execSync as execSync2 } from "node:child_process";
|
|
|
34378
33679
|
// packages/ralph/src/lock/lock.ts
|
|
34379
33680
|
import * as fsPromises from "node:fs/promises";
|
|
34380
33681
|
var defaultFs = {
|
|
34381
|
-
mkdir: (
|
|
34382
|
-
rmdir: (
|
|
34383
|
-
stat: (
|
|
33682
|
+
mkdir: (p) => fsPromises.mkdir(p),
|
|
33683
|
+
rmdir: (p) => fsPromises.rmdir(p),
|
|
33684
|
+
stat: (p) => fsPromises.stat(p)
|
|
34384
33685
|
};
|
|
34385
33686
|
function sleep(ms) {
|
|
34386
33687
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -34448,57 +33749,50 @@ async function lockFile(filePath, options = {}) {
|
|
|
34448
33749
|
init_src();
|
|
34449
33750
|
|
|
34450
33751
|
// packages/worktree/src/create.ts
|
|
34451
|
-
import { join as
|
|
33752
|
+
import { join as join2 } from "node:path";
|
|
34452
33753
|
|
|
34453
33754
|
// packages/worktree/src/registry.ts
|
|
34454
|
-
import {
|
|
33755
|
+
import { dirname as dirname2 } from "node:path";
|
|
34455
33756
|
import { parse as parse6, stringify } from "yaml";
|
|
34456
|
-
|
|
34457
|
-
var REGISTRY_FILE = "worktrees.yaml";
|
|
34458
|
-
function registryPath(cwd) {
|
|
34459
|
-
return join2(cwd, REGISTRY_DIR, REGISTRY_FILE);
|
|
34460
|
-
}
|
|
34461
|
-
async function readRegistry(cwd, fs3) {
|
|
34462
|
-
const path16 = registryPath(cwd);
|
|
33757
|
+
async function readRegistry(registryFile, fs3) {
|
|
34463
33758
|
try {
|
|
34464
|
-
const content = await fs3.readFile(
|
|
33759
|
+
const content = await fs3.readFile(registryFile, "utf8");
|
|
34465
33760
|
const parsed = parse6(content);
|
|
34466
33761
|
return parsed?.worktrees ? parsed : { worktrees: [] };
|
|
34467
33762
|
} catch {
|
|
34468
33763
|
return { worktrees: [] };
|
|
34469
33764
|
}
|
|
34470
33765
|
}
|
|
34471
|
-
async function writeRegistry(
|
|
34472
|
-
|
|
34473
|
-
await fs3.mkdir(dirname2(path16), { recursive: true });
|
|
33766
|
+
async function writeRegistry(registryFile, registry2, fs3) {
|
|
33767
|
+
await fs3.mkdir(dirname2(registryFile), { recursive: true });
|
|
34474
33768
|
const yaml = stringify(registry2, { lineWidth: 0 });
|
|
34475
|
-
await fs3.writeFile(
|
|
33769
|
+
await fs3.writeFile(registryFile, yaml, { encoding: "utf8" });
|
|
34476
33770
|
}
|
|
34477
|
-
async function addWorktreeEntry(
|
|
34478
|
-
const registry2 = await readRegistry(
|
|
33771
|
+
async function addWorktreeEntry(registryFile, entry, fs3) {
|
|
33772
|
+
const registry2 = await readRegistry(registryFile, fs3);
|
|
34479
33773
|
registry2.worktrees.push(entry);
|
|
34480
|
-
await writeRegistry(
|
|
33774
|
+
await writeRegistry(registryFile, registry2, fs3);
|
|
34481
33775
|
}
|
|
34482
|
-
async function removeWorktreeEntry(
|
|
34483
|
-
const registry2 = await readRegistry(
|
|
34484
|
-
registry2.worktrees = registry2.worktrees.filter((
|
|
34485
|
-
await writeRegistry(
|
|
33776
|
+
async function removeWorktreeEntry(registryFile, name, fs3) {
|
|
33777
|
+
const registry2 = await readRegistry(registryFile, fs3);
|
|
33778
|
+
registry2.worktrees = registry2.worktrees.filter((w) => w.name !== name);
|
|
33779
|
+
await writeRegistry(registryFile, registry2, fs3);
|
|
34486
33780
|
}
|
|
34487
|
-
async function updateWorktreeStatus(
|
|
33781
|
+
async function updateWorktreeStatus(registryFile, name, status, deps) {
|
|
34488
33782
|
const { fs: fs3 } = deps;
|
|
34489
|
-
const registry2 = await readRegistry(
|
|
34490
|
-
const entry = registry2.worktrees.find((
|
|
33783
|
+
const registry2 = await readRegistry(registryFile, fs3);
|
|
33784
|
+
const entry = registry2.worktrees.find((w) => w.name === name);
|
|
34491
33785
|
if (!entry) {
|
|
34492
33786
|
throw new Error(`Worktree "${name}" not found in registry`);
|
|
34493
33787
|
}
|
|
34494
33788
|
entry.status = status;
|
|
34495
|
-
await writeRegistry(
|
|
33789
|
+
await writeRegistry(registryFile, registry2, fs3);
|
|
34496
33790
|
}
|
|
34497
33791
|
|
|
34498
33792
|
// packages/worktree/src/create.ts
|
|
34499
33793
|
async function createWorktree(opts) {
|
|
34500
33794
|
const branch = `poe-code/${opts.name}`;
|
|
34501
|
-
const worktreePath =
|
|
33795
|
+
const worktreePath = join2(opts.worktreeDir, opts.name);
|
|
34502
33796
|
try {
|
|
34503
33797
|
await opts.deps.exec(`git worktree remove ${worktreePath} --force`, { cwd: opts.cwd });
|
|
34504
33798
|
} catch {
|
|
@@ -34507,7 +33801,7 @@ async function createWorktree(opts) {
|
|
|
34507
33801
|
await opts.deps.exec(`git branch -D ${branch}`, { cwd: opts.cwd });
|
|
34508
33802
|
} catch {
|
|
34509
33803
|
}
|
|
34510
|
-
await removeWorktreeEntry(opts.
|
|
33804
|
+
await removeWorktreeEntry(opts.registryFile, opts.name, opts.deps.fs).catch(() => {
|
|
34511
33805
|
});
|
|
34512
33806
|
await opts.deps.exec(
|
|
34513
33807
|
`git worktree add -b ${branch} ${worktreePath} ${opts.baseBranch}`,
|
|
@@ -34526,7 +33820,7 @@ async function createWorktree(opts) {
|
|
|
34526
33820
|
...opts.planPath !== void 0 && { planPath: opts.planPath },
|
|
34527
33821
|
...opts.prompt !== void 0 && { prompt: opts.prompt }
|
|
34528
33822
|
};
|
|
34529
|
-
await addWorktreeEntry(opts.
|
|
33823
|
+
await addWorktreeEntry(opts.registryFile, entry, opts.deps.fs);
|
|
34530
33824
|
return entry;
|
|
34531
33825
|
}
|
|
34532
33826
|
|
|
@@ -34642,9 +33936,9 @@ function asStringArray(value, field) {
|
|
|
34642
33936
|
if (value === void 0 || value === null) return [];
|
|
34643
33937
|
if (typeof value === "string") return [value];
|
|
34644
33938
|
if (Array.isArray(value)) {
|
|
34645
|
-
return value.map((
|
|
34646
|
-
if (typeof
|
|
34647
|
-
return
|
|
33939
|
+
return value.map((v, i) => {
|
|
33940
|
+
if (typeof v !== "string") throw new Error(`Invalid ${field}[${i}]: expected string`);
|
|
33941
|
+
return v;
|
|
34648
33942
|
});
|
|
34649
33943
|
}
|
|
34650
33944
|
throw new Error(`Invalid ${field}: expected string[]`);
|
|
@@ -35189,7 +34483,7 @@ async function defaultPromptOverbake(args) {
|
|
|
35189
34483
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
35190
34484
|
return "continue";
|
|
35191
34485
|
}
|
|
35192
|
-
const value = await
|
|
34486
|
+
const value = await select2({
|
|
35193
34487
|
message: `Overbaking detected for ${args.storyId} (${args.consecutiveFailures}/${args.threshold} failures).`,
|
|
35194
34488
|
options: [
|
|
35195
34489
|
{ value: "continue", label: "Continue" },
|
|
@@ -35197,7 +34491,7 @@ async function defaultPromptOverbake(args) {
|
|
|
35197
34491
|
{ value: "abort", label: "Abort run" }
|
|
35198
34492
|
]
|
|
35199
34493
|
});
|
|
35200
|
-
if (
|
|
34494
|
+
if (isCancel(value)) return "abort";
|
|
35201
34495
|
return value;
|
|
35202
34496
|
}
|
|
35203
34497
|
async function buildLoop(options) {
|
|
@@ -35220,63 +34514,79 @@ async function buildLoop(options) {
|
|
|
35220
34514
|
let planPath = absPath(cwd, options.planPath);
|
|
35221
34515
|
let worktreeBranch;
|
|
35222
34516
|
let worktreeName;
|
|
34517
|
+
const registryFile = absPath(originalCwd, ".poe-code-ralph/worktrees.yaml");
|
|
34518
|
+
const worktreeDir = absPath(originalCwd, ".poe-code-ralph/worktrees");
|
|
35223
34519
|
if (options.worktree?.enabled) {
|
|
35224
34520
|
const worktreeDeps = options.deps?.worktree ?? {
|
|
35225
34521
|
fs: {
|
|
35226
|
-
readFile: (
|
|
35227
|
-
writeFile: (
|
|
35228
|
-
mkdir: (
|
|
34522
|
+
readFile: (p, enc) => fs3.readFile(p, enc),
|
|
34523
|
+
writeFile: (p, data, opts) => fs3.writeFile(p, data, opts),
|
|
34524
|
+
mkdir: (p, opts) => fs3.mkdir(p, opts)
|
|
35229
34525
|
},
|
|
35230
34526
|
exec: defaultExec
|
|
35231
34527
|
};
|
|
35232
34528
|
worktreeName = options.worktree.name ?? deriveWorktreeName(options.planPath);
|
|
35233
|
-
const
|
|
35234
|
-
const
|
|
35235
|
-
|
|
35236
|
-
|
|
35237
|
-
|
|
35238
|
-
|
|
35239
|
-
|
|
35240
|
-
|
|
35241
|
-
|
|
35242
|
-
|
|
35243
|
-
|
|
35244
|
-
|
|
35245
|
-
|
|
35246
|
-
|
|
35247
|
-
|
|
35248
|
-
|
|
35249
|
-
|
|
35250
|
-
|
|
35251
|
-
|
|
35252
|
-
|
|
34529
|
+
const registry2 = await readRegistry(registryFile, worktreeDeps.fs);
|
|
34530
|
+
const existing = registry2.worktrees.find((w) => w.name === worktreeName);
|
|
34531
|
+
const isResume = !!existing && (existing.status === "failed" || existing.status === "active");
|
|
34532
|
+
if (isResume) {
|
|
34533
|
+
worktreeBranch = existing.branch;
|
|
34534
|
+
cwd = existing.path;
|
|
34535
|
+
planPath = absPath(existing.path, options.planPath);
|
|
34536
|
+
await updateWorktreeStatus(registryFile, worktreeName, "active", {
|
|
34537
|
+
fs: worktreeDeps.fs
|
|
34538
|
+
});
|
|
34539
|
+
} else {
|
|
34540
|
+
const baseBranch = (git.getCurrentBranch ?? getCurrentBranch)(cwd);
|
|
34541
|
+
const entry = await createWorktree({
|
|
34542
|
+
cwd,
|
|
34543
|
+
name: worktreeName,
|
|
34544
|
+
baseBranch,
|
|
34545
|
+
source: "ralph-build",
|
|
34546
|
+
agent: options.agent,
|
|
34547
|
+
planPath: options.planPath,
|
|
34548
|
+
registryFile,
|
|
34549
|
+
worktreeDir,
|
|
34550
|
+
deps: worktreeDeps
|
|
34551
|
+
});
|
|
34552
|
+
worktreeBranch = entry.branch;
|
|
34553
|
+
const worktreePath = entry.path;
|
|
34554
|
+
const symlinkFn = fs3.symlink ?? ((target, path16) => fsPromises5.symlink(target, path16));
|
|
34555
|
+
const exec = worktreeDeps.exec;
|
|
34556
|
+
const dirsToLink = [".poe-code-ralph", ".agents/poe-code-ralph"];
|
|
34557
|
+
for (const dir of dirsToLink) {
|
|
34558
|
+
try {
|
|
34559
|
+
await exec(`git check-ignore -q ${dir}`, { cwd: originalCwd });
|
|
34560
|
+
} catch {
|
|
34561
|
+
continue;
|
|
34562
|
+
}
|
|
34563
|
+
const src = absPath(originalCwd, dir);
|
|
34564
|
+
const dest = absPath(worktreePath, dir);
|
|
34565
|
+
await fs3.mkdir(dirname6(dest), { recursive: true });
|
|
34566
|
+
try {
|
|
34567
|
+
await symlinkFn(src, dest);
|
|
34568
|
+
} catch {
|
|
34569
|
+
}
|
|
35253
34570
|
}
|
|
35254
|
-
const
|
|
35255
|
-
|
|
35256
|
-
await
|
|
35257
|
-
|
|
35258
|
-
|
|
35259
|
-
|
|
34571
|
+
const destPlanPath = absPath(worktreePath, options.planPath);
|
|
34572
|
+
await fs3.mkdir(dirname6(destPlanPath), { recursive: true });
|
|
34573
|
+
await copyFile3(planPath, destPlanPath);
|
|
34574
|
+
const copiedRaw = await fs3.readFile(destPlanPath, "utf8");
|
|
34575
|
+
const copiedPlan = parsePlan(copiedRaw);
|
|
34576
|
+
for (const story of copiedPlan.stories) {
|
|
34577
|
+
story.status = "open";
|
|
34578
|
+
story.startedAt = void 0;
|
|
34579
|
+
story.completedAt = void 0;
|
|
34580
|
+
story.updatedAt = void 0;
|
|
35260
34581
|
}
|
|
34582
|
+
await writePlan(destPlanPath, copiedPlan, {
|
|
34583
|
+
fs: fs3,
|
|
34584
|
+
lock: async () => async () => {
|
|
34585
|
+
}
|
|
34586
|
+
});
|
|
34587
|
+
cwd = worktreePath;
|
|
34588
|
+
planPath = destPlanPath;
|
|
35261
34589
|
}
|
|
35262
|
-
const destPlanPath = absPath(worktreePath, options.planPath);
|
|
35263
|
-
await fs3.mkdir(dirname6(destPlanPath), { recursive: true });
|
|
35264
|
-
await copyFile3(planPath, destPlanPath);
|
|
35265
|
-
const copiedRaw = await fs3.readFile(destPlanPath, "utf8");
|
|
35266
|
-
const copiedPlan = parsePlan(copiedRaw);
|
|
35267
|
-
for (const story of copiedPlan.stories) {
|
|
35268
|
-
story.status = "open";
|
|
35269
|
-
story.startedAt = void 0;
|
|
35270
|
-
story.completedAt = void 0;
|
|
35271
|
-
story.updatedAt = void 0;
|
|
35272
|
-
}
|
|
35273
|
-
await writePlan(destPlanPath, copiedPlan, {
|
|
35274
|
-
fs: fs3,
|
|
35275
|
-
lock: async () => async () => {
|
|
35276
|
-
}
|
|
35277
|
-
});
|
|
35278
|
-
cwd = worktreePath;
|
|
35279
|
-
planPath = destPlanPath;
|
|
35280
34590
|
}
|
|
35281
34591
|
const progressPath = absPath(cwd, options.progressPath ?? ".poe-code-ralph/progress.md");
|
|
35282
34592
|
const guardrailsPath = absPath(cwd, options.guardrailsPath ?? ".poe-code-ralph/guardrails.md");
|
|
@@ -35488,14 +34798,14 @@ ${agentStderr}` : ""
|
|
|
35488
34798
|
}
|
|
35489
34799
|
const worktreeDeps = options.deps?.worktree ?? {
|
|
35490
34800
|
fs: {
|
|
35491
|
-
readFile: (
|
|
35492
|
-
writeFile: (
|
|
35493
|
-
mkdir: (
|
|
34801
|
+
readFile: (p, enc) => fs3.readFile(p, enc),
|
|
34802
|
+
writeFile: (p, data, opts) => fs3.writeFile(p, data, opts),
|
|
34803
|
+
mkdir: (p, opts) => fs3.mkdir(p, opts)
|
|
35494
34804
|
},
|
|
35495
34805
|
exec: defaultExec
|
|
35496
34806
|
};
|
|
35497
34807
|
const worktreeStatus = result.storiesDone.length > 0 ? "done" : "failed";
|
|
35498
|
-
await updateWorktreeStatus(
|
|
34808
|
+
await updateWorktreeStatus(registryFile, worktreeName, worktreeStatus, {
|
|
35499
34809
|
fs: worktreeDeps.fs
|
|
35500
34810
|
});
|
|
35501
34811
|
result.worktreeBranch = worktreeBranch;
|
|
@@ -35548,7 +34858,7 @@ async function listPlanCandidates(fs3, cwd) {
|
|
|
35548
34858
|
}
|
|
35549
34859
|
candidates.push(path12.relative(cwd, absPath2));
|
|
35550
34860
|
}
|
|
35551
|
-
candidates.sort((a,
|
|
34861
|
+
candidates.sort((a, b) => a.localeCompare(b));
|
|
35552
34862
|
return candidates;
|
|
35553
34863
|
}
|
|
35554
34864
|
async function resolvePlanPath(options) {
|
|
@@ -35584,14 +34894,14 @@ async function resolvePlanPath(options) {
|
|
|
35584
34894
|
if (candidates.length === 1) {
|
|
35585
34895
|
return candidates[0];
|
|
35586
34896
|
}
|
|
35587
|
-
const selection = await
|
|
34897
|
+
const selection = await select2({
|
|
35588
34898
|
message: "Select a plan file to use for this Ralph run",
|
|
35589
34899
|
options: candidates.map((candidate) => ({
|
|
35590
34900
|
label: candidate,
|
|
35591
34901
|
value: candidate
|
|
35592
34902
|
}))
|
|
35593
34903
|
});
|
|
35594
|
-
if (
|
|
34904
|
+
if (isCancel(selection)) {
|
|
35595
34905
|
return null;
|
|
35596
34906
|
}
|
|
35597
34907
|
if (typeof selection !== "string" || selection.trim().length === 0) {
|
|
@@ -36042,12 +35352,12 @@ function registerRalphCommand(program, container) {
|
|
|
36042
35352
|
if (flags.assumeYes) {
|
|
36043
35353
|
agent2 = DEFAULT_RALPH_AGENT;
|
|
36044
35354
|
} else {
|
|
36045
|
-
const selected = await
|
|
35355
|
+
const selected = await select2({
|
|
36046
35356
|
message: "Select agent to install Ralph for:",
|
|
36047
35357
|
options: supportedAgents2.map((a) => ({ value: a, label: a }))
|
|
36048
35358
|
});
|
|
36049
|
-
if (
|
|
36050
|
-
|
|
35359
|
+
if (isCancel(selected)) {
|
|
35360
|
+
cancel("Operation cancelled");
|
|
36051
35361
|
return;
|
|
36052
35362
|
}
|
|
36053
35363
|
agent2 = selected;
|
|
@@ -36068,15 +35378,15 @@ function registerRalphCommand(program, container) {
|
|
|
36068
35378
|
} else if (flags.assumeYes) {
|
|
36069
35379
|
scope = "local";
|
|
36070
35380
|
} else {
|
|
36071
|
-
const selected = await
|
|
35381
|
+
const selected = await select2({
|
|
36072
35382
|
message: "Select scope:",
|
|
36073
35383
|
options: [
|
|
36074
35384
|
{ value: "local", label: "Local (project)" },
|
|
36075
35385
|
{ value: "global", label: "Global (user home)" }
|
|
36076
35386
|
]
|
|
36077
35387
|
});
|
|
36078
|
-
if (
|
|
36079
|
-
|
|
35388
|
+
if (isCancel(selected)) {
|
|
35389
|
+
cancel("Operation cancelled");
|
|
36080
35390
|
return;
|
|
36081
35391
|
}
|
|
36082
35392
|
scope = selected;
|
|
@@ -36135,6 +35445,19 @@ function registerRalphCommand(program, container) {
|
|
|
36135
35445
|
resources.logger.info(`Iterations: ${maxIterations}`);
|
|
36136
35446
|
if (noCommit) resources.logger.info("No-commit: true");
|
|
36137
35447
|
if (worktree) resources.logger.info(`Worktree: ${worktree.name ?? "(auto)"}`);
|
|
35448
|
+
try {
|
|
35449
|
+
const planContent = await container.fs.readFile(
|
|
35450
|
+
path15.resolve(cwd, planPath),
|
|
35451
|
+
"utf8"
|
|
35452
|
+
);
|
|
35453
|
+
const plan = parsePlan(planContent);
|
|
35454
|
+
const total = plan.stories.length;
|
|
35455
|
+
const done = plan.stories.filter((s) => s.status === "done").length;
|
|
35456
|
+
const inProgress = plan.stories.filter((s) => s.status === "in_progress").length;
|
|
35457
|
+
const open = total - done - inProgress;
|
|
35458
|
+
resources.logger.info(`Stories: ${done}/${total} done${inProgress ? `, ${inProgress} in progress` : ""}${open ? `, ${open} open` : ""}`);
|
|
35459
|
+
} catch {
|
|
35460
|
+
}
|
|
36138
35461
|
await ralphBuild({
|
|
36139
35462
|
planPath,
|
|
36140
35463
|
progressPath: config2.progressPath,
|
|
@@ -36162,6 +35485,202 @@ function registerRalphCommand(program, container) {
|
|
|
36162
35485
|
});
|
|
36163
35486
|
}
|
|
36164
35487
|
|
|
35488
|
+
// src/cli/commands/usage.ts
|
|
35489
|
+
init_shared();
|
|
35490
|
+
init_credentials();
|
|
35491
|
+
async function executeBalance(program, container) {
|
|
35492
|
+
const flags = resolveCommandFlags(program);
|
|
35493
|
+
const resources = createExecutionResources(
|
|
35494
|
+
container,
|
|
35495
|
+
flags,
|
|
35496
|
+
"usage:balance"
|
|
35497
|
+
);
|
|
35498
|
+
resources.logger.intro("usage balance");
|
|
35499
|
+
try {
|
|
35500
|
+
const apiKey = await loadCredentials({
|
|
35501
|
+
fs: container.fs,
|
|
35502
|
+
filePath: container.env.credentialsPath
|
|
35503
|
+
});
|
|
35504
|
+
if (!apiKey) {
|
|
35505
|
+
throw new AuthenticationError(
|
|
35506
|
+
"Poe API key not found. Run 'poe-code login' first."
|
|
35507
|
+
);
|
|
35508
|
+
}
|
|
35509
|
+
if (flags.dryRun) {
|
|
35510
|
+
resources.logger.dryRun(
|
|
35511
|
+
"Dry run: would fetch usage balance from Poe API."
|
|
35512
|
+
);
|
|
35513
|
+
return;
|
|
35514
|
+
}
|
|
35515
|
+
const response = await container.httpClient(
|
|
35516
|
+
`${container.env.poeBaseUrl}/usage/current_balance`,
|
|
35517
|
+
{
|
|
35518
|
+
method: "GET",
|
|
35519
|
+
headers: {
|
|
35520
|
+
Authorization: `Bearer ${apiKey}`
|
|
35521
|
+
}
|
|
35522
|
+
}
|
|
35523
|
+
);
|
|
35524
|
+
if (!response.ok) {
|
|
35525
|
+
throw new ApiError(
|
|
35526
|
+
`Failed to fetch usage balance (HTTP ${response.status})`,
|
|
35527
|
+
{
|
|
35528
|
+
httpStatus: response.status,
|
|
35529
|
+
endpoint: "/usage/current_balance"
|
|
35530
|
+
}
|
|
35531
|
+
);
|
|
35532
|
+
}
|
|
35533
|
+
const data = await response.json();
|
|
35534
|
+
const theme = getTheme();
|
|
35535
|
+
const formatted = data.current_point_balance.toLocaleString("en-US");
|
|
35536
|
+
const styledBalance = typography.bold(theme.accent(formatted));
|
|
35537
|
+
resources.logger.info(`Current balance: ${styledBalance} points`);
|
|
35538
|
+
resources.logger.feedback(
|
|
35539
|
+
"Need more points?",
|
|
35540
|
+
"https://poe.com/api/keys"
|
|
35541
|
+
);
|
|
35542
|
+
} catch (error2) {
|
|
35543
|
+
if (error2 instanceof Error) {
|
|
35544
|
+
resources.logger.logException(error2, "usage balance", {
|
|
35545
|
+
operation: "fetch-balance"
|
|
35546
|
+
});
|
|
35547
|
+
}
|
|
35548
|
+
throw error2;
|
|
35549
|
+
}
|
|
35550
|
+
}
|
|
35551
|
+
function registerUsageCommand(program, container) {
|
|
35552
|
+
const usage = program.command("usage").description("Check Poe API usage information.").action(async () => {
|
|
35553
|
+
await executeBalance(program, container);
|
|
35554
|
+
});
|
|
35555
|
+
usage.command("balance").description("Display current point balance.").action(async () => {
|
|
35556
|
+
await executeBalance(program, container);
|
|
35557
|
+
});
|
|
35558
|
+
usage.command("list").description("Display usage history.").option("--filter <model>", "Filter results by model name").option("--pages <count>", "Number of pages to load automatically", parseInt).action(async function() {
|
|
35559
|
+
const flags = resolveCommandFlags(program);
|
|
35560
|
+
const resources = createExecutionResources(
|
|
35561
|
+
container,
|
|
35562
|
+
flags,
|
|
35563
|
+
"usage:list"
|
|
35564
|
+
);
|
|
35565
|
+
const commandOptions = this.opts();
|
|
35566
|
+
resources.logger.intro("usage list");
|
|
35567
|
+
try {
|
|
35568
|
+
const apiKey = await loadCredentials({
|
|
35569
|
+
fs: container.fs,
|
|
35570
|
+
filePath: container.env.credentialsPath
|
|
35571
|
+
});
|
|
35572
|
+
if (!apiKey) {
|
|
35573
|
+
throw new AuthenticationError(
|
|
35574
|
+
"Poe API key not found. Run 'poe-code login' first."
|
|
35575
|
+
);
|
|
35576
|
+
}
|
|
35577
|
+
if (flags.dryRun) {
|
|
35578
|
+
resources.logger.dryRun(
|
|
35579
|
+
"Dry run: would fetch usage history from Poe API."
|
|
35580
|
+
);
|
|
35581
|
+
return;
|
|
35582
|
+
}
|
|
35583
|
+
const theme = getTheme();
|
|
35584
|
+
const filterTerm = commandOptions.filter;
|
|
35585
|
+
const tzAbbr = Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(/* @__PURE__ */ new Date()).find((p) => p.type === "timeZoneName")?.value ?? "local";
|
|
35586
|
+
const dateTitle = `Date [${tzAbbr}]`;
|
|
35587
|
+
const dateWidth = Math.max(16, dateTitle.length);
|
|
35588
|
+
const costTitle = "Cost (compute points)";
|
|
35589
|
+
const costWidth = Math.max(10, costTitle.length);
|
|
35590
|
+
const tableChrome = 10;
|
|
35591
|
+
const modelMaxWidth = widths.maxLine - dateWidth - costWidth - tableChrome;
|
|
35592
|
+
const tableColumns = [
|
|
35593
|
+
{ name: "Date", title: dateTitle, alignment: "left", maxLen: dateWidth },
|
|
35594
|
+
{ name: "Model", title: "Model", alignment: "left", maxLen: modelMaxWidth },
|
|
35595
|
+
{ name: "Cost", title: costTitle, alignment: "right", maxLen: costWidth }
|
|
35596
|
+
];
|
|
35597
|
+
const formatEntry = (entry) => {
|
|
35598
|
+
const date4 = new Date(entry.creation_time / 1e3);
|
|
35599
|
+
const year = date4.getFullYear();
|
|
35600
|
+
const month = String(date4.getMonth() + 1).padStart(2, "0");
|
|
35601
|
+
const day = String(date4.getDate()).padStart(2, "0");
|
|
35602
|
+
const hours = String(date4.getHours()).padStart(2, "0");
|
|
35603
|
+
const minutes = String(date4.getMinutes()).padStart(2, "0");
|
|
35604
|
+
const formatted = `${year}-${month}-${day} ${hours}:${minutes}`;
|
|
35605
|
+
const modelName = entry.bot_name.length > modelMaxWidth ? entry.bot_name.slice(0, modelMaxWidth - 1) + "\u2026" : entry.bot_name;
|
|
35606
|
+
return {
|
|
35607
|
+
Date: theme.muted(formatted),
|
|
35608
|
+
Model: theme.accent(modelName),
|
|
35609
|
+
Cost: entry.cost_points < 0 ? theme.error(String(entry.cost_points)) : theme.success(String(entry.cost_points))
|
|
35610
|
+
};
|
|
35611
|
+
};
|
|
35612
|
+
let totalFetched = 0;
|
|
35613
|
+
let totalFiltered = 0;
|
|
35614
|
+
let startingAfter;
|
|
35615
|
+
let pagesLoaded = 0;
|
|
35616
|
+
const maxPages = commandOptions.pages;
|
|
35617
|
+
while (true) {
|
|
35618
|
+
let url2 = `${container.env.poeBaseUrl}/usage/points_history?limit=20`;
|
|
35619
|
+
if (startingAfter) {
|
|
35620
|
+
url2 += `&starting_after=${startingAfter}`;
|
|
35621
|
+
}
|
|
35622
|
+
const response = await container.httpClient(url2, {
|
|
35623
|
+
method: "GET",
|
|
35624
|
+
headers: {
|
|
35625
|
+
Authorization: `Bearer ${apiKey}`
|
|
35626
|
+
}
|
|
35627
|
+
});
|
|
35628
|
+
if (!response.ok) {
|
|
35629
|
+
throw new ApiError(
|
|
35630
|
+
`Failed to fetch usage history (HTTP ${response.status})`,
|
|
35631
|
+
{
|
|
35632
|
+
httpStatus: response.status,
|
|
35633
|
+
endpoint: "/usage/points_history"
|
|
35634
|
+
}
|
|
35635
|
+
);
|
|
35636
|
+
}
|
|
35637
|
+
const result = await response.json();
|
|
35638
|
+
pagesLoaded++;
|
|
35639
|
+
totalFetched += result.data.length;
|
|
35640
|
+
const pageEntries = filterTerm ? result.data.filter(
|
|
35641
|
+
(entry) => entry.bot_name.toLowerCase().includes(filterTerm.toLowerCase())
|
|
35642
|
+
) : result.data;
|
|
35643
|
+
totalFiltered += pageEntries.length;
|
|
35644
|
+
if (pageEntries.length > 0) {
|
|
35645
|
+
const rows = pageEntries.map(formatEntry);
|
|
35646
|
+
resources.logger.info(renderTable({ theme, columns: tableColumns, rows }));
|
|
35647
|
+
}
|
|
35648
|
+
if (!result.has_more || result.data.length === 0) {
|
|
35649
|
+
break;
|
|
35650
|
+
}
|
|
35651
|
+
if (maxPages !== void 0 && pagesLoaded >= maxPages) {
|
|
35652
|
+
break;
|
|
35653
|
+
}
|
|
35654
|
+
startingAfter = result.data[result.data.length - 1].query_id;
|
|
35655
|
+
if (maxPages === void 0) {
|
|
35656
|
+
const shouldContinue = await confirm2({ message: "Load more?" });
|
|
35657
|
+
if (isCancel(shouldContinue) || !shouldContinue) {
|
|
35658
|
+
break;
|
|
35659
|
+
}
|
|
35660
|
+
}
|
|
35661
|
+
}
|
|
35662
|
+
if (totalFetched === 0) {
|
|
35663
|
+
resources.logger.info("No usage history found.");
|
|
35664
|
+
} else if (filterTerm && totalFiltered === 0) {
|
|
35665
|
+
resources.logger.info(
|
|
35666
|
+
`No entries match "${filterTerm}".`
|
|
35667
|
+
);
|
|
35668
|
+
} else if (filterTerm && totalFiltered > 0) {
|
|
35669
|
+
resources.logger.info(
|
|
35670
|
+
`Showing entries matching "${filterTerm}".`
|
|
35671
|
+
);
|
|
35672
|
+
}
|
|
35673
|
+
} catch (error2) {
|
|
35674
|
+
if (error2 instanceof Error) {
|
|
35675
|
+
resources.logger.logException(error2, "usage list", {
|
|
35676
|
+
operation: "fetch-history"
|
|
35677
|
+
});
|
|
35678
|
+
}
|
|
35679
|
+
throw error2;
|
|
35680
|
+
}
|
|
35681
|
+
});
|
|
35682
|
+
}
|
|
35683
|
+
|
|
36165
35684
|
// package.json
|
|
36166
35685
|
var package_default = {
|
|
36167
35686
|
name: "poe-code",
|
|
@@ -36224,8 +35743,10 @@ var package_default = {
|
|
|
36224
35743
|
},
|
|
36225
35744
|
packageManager: "npm@10.9.2",
|
|
36226
35745
|
dependencies: {
|
|
35746
|
+
"@clack/prompts": "^0.11.0",
|
|
36227
35747
|
chalk: "^5.3.0",
|
|
36228
35748
|
commander: "^11.1.0",
|
|
35749
|
+
"console-table-printer": "^2.15.0",
|
|
36229
35750
|
diff: ">=8.0.3",
|
|
36230
35751
|
"jsonc-parser": "^3.3.1",
|
|
36231
35752
|
mustache: "^4.2.0",
|
|
@@ -36325,6 +35846,16 @@ function formatHelpText(input) {
|
|
|
36325
35846
|
name: "skill unconfigure",
|
|
36326
35847
|
args: "[agent]",
|
|
36327
35848
|
description: "Remove agent skills configuration"
|
|
35849
|
+
},
|
|
35850
|
+
{
|
|
35851
|
+
name: "usage",
|
|
35852
|
+
args: "",
|
|
35853
|
+
description: "Display current Poe compute points balance"
|
|
35854
|
+
},
|
|
35855
|
+
{
|
|
35856
|
+
name: "usage list",
|
|
35857
|
+
args: "",
|
|
35858
|
+
description: "Display usage history"
|
|
36328
35859
|
}
|
|
36329
35860
|
];
|
|
36330
35861
|
const nameWidth = Math.max(0, ...commandRows.map((row) => row.name.length));
|
|
@@ -36470,6 +36001,7 @@ function bootstrapProgram(container) {
|
|
|
36470
36001
|
registerMcpCommand(program, container);
|
|
36471
36002
|
registerSkillCommand(program, container);
|
|
36472
36003
|
registerRalphCommand(program, container);
|
|
36004
|
+
registerUsageCommand(program, container);
|
|
36473
36005
|
program.action(function() {
|
|
36474
36006
|
const args = this.args;
|
|
36475
36007
|
if (args.length > 0) {
|
|
@@ -36509,7 +36041,7 @@ import * as nodeFsSync3 from "node:fs";
|
|
|
36509
36041
|
import { realpathSync } from "node:fs";
|
|
36510
36042
|
import { homedir as homedir3 } from "node:os";
|
|
36511
36043
|
import { pathToFileURL } from "node:url";
|
|
36512
|
-
import { join as
|
|
36044
|
+
import { join as join3 } from "node:path";
|
|
36513
36045
|
import chalk13 from "chalk";
|
|
36514
36046
|
|
|
36515
36047
|
// src/cli/prompt-runner.ts
|
|
@@ -36529,11 +36061,11 @@ function resolveSelectInitial(descriptor) {
|
|
|
36529
36061
|
return descriptor.initial;
|
|
36530
36062
|
}
|
|
36531
36063
|
function createPromptRunner(adapter = {
|
|
36532
|
-
text:
|
|
36533
|
-
password,
|
|
36534
|
-
select,
|
|
36535
|
-
isCancel
|
|
36536
|
-
cancel
|
|
36064
|
+
text: text3,
|
|
36065
|
+
password: password2,
|
|
36066
|
+
select: select2,
|
|
36067
|
+
isCancel,
|
|
36068
|
+
cancel
|
|
36537
36069
|
}) {
|
|
36538
36070
|
const runPrompt = async (descriptor) => {
|
|
36539
36071
|
const type = descriptor.type ?? "text";
|
|
@@ -36589,7 +36121,7 @@ var fsAdapter = nodeFs;
|
|
|
36589
36121
|
function createCliMain(programFactory) {
|
|
36590
36122
|
return async function runCli() {
|
|
36591
36123
|
const homeDir = homedir3();
|
|
36592
|
-
const logDir =
|
|
36124
|
+
const logDir = join3(homeDir, ".poe-code", "logs");
|
|
36593
36125
|
const promptRunner = createPromptRunner();
|
|
36594
36126
|
const shouldLogToStderr = process.env.POE_CODE_STDERR_LOGS === "1" || process.env.POE_CODE_STDERR_LOGS === "true";
|
|
36595
36127
|
const errorLogger = new ErrorLogger({
|
|
@@ -36620,11 +36152,11 @@ function createCliMain(programFactory) {
|
|
|
36620
36152
|
argv: process.argv
|
|
36621
36153
|
});
|
|
36622
36154
|
if (error2 instanceof CliError && error2.isUserError) {
|
|
36623
|
-
|
|
36155
|
+
log2.error(error2.message);
|
|
36624
36156
|
} else {
|
|
36625
|
-
|
|
36626
|
-
|
|
36627
|
-
`See logs at ${
|
|
36157
|
+
log2.error(`Error: ${error2.message}`);
|
|
36158
|
+
log2.message(
|
|
36159
|
+
`See logs at ${join3(logDir, "errors.log")} for more details.`,
|
|
36628
36160
|
{ symbol: chalk13.magenta("\u25CF") }
|
|
36629
36161
|
);
|
|
36630
36162
|
}
|