ccski 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +4460 -231
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{registry-DGrbpgs5.mjs → registry-ChUc2356.mjs} +61 -24
- package/dist/registry-ChUc2356.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/registry-DGrbpgs5.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as
|
|
3
|
-
import { existsSync, statSync } from "node:fs";
|
|
2
|
+
import { A as intersectionType, D as custom, E as booleanType, F as recordType, G as __require, H as SkillNotFoundError, I as stringType, K as __toESM, L as unionType, M as numberType, N as objectType, O as discriminatedUnionType, P as optionalType, R as unknownType, T as arrayType, W as __commonJS, _ as tone, b as parseSkillFile, c as colors$3, d as formatBytes, f as heading, g as success, h as setColorEnabled, j as literalType, k as enumType, l as dim, m as renderList, n as containsCaseInsensitive, p as highlight, r as rankStrings, t as SkillRegistry, u as error, v as warn, x as validateSkillFile, y as wrap } from "./registry-ChUc2356.mjs";
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync } from "node:fs";
|
|
4
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
5
|
import { readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1, writeFile } from "fs";
|
|
5
|
-
import {
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
import { dirname, join, resolve } from "node:path";
|
|
6
8
|
import { notStrictEqual, strictEqual } from "assert";
|
|
7
9
|
import { basename, dirname as dirname$1, extname, normalize, relative, resolve as resolve$1 } from "path";
|
|
8
10
|
import { format, inspect } from "util";
|
|
9
11
|
import { URL as URL$1, fileURLToPath } from "url";
|
|
10
|
-
import { createServer } from "node:http";
|
|
11
12
|
import { randomUUID } from "node:crypto";
|
|
12
13
|
import process$1 from "node:process";
|
|
14
|
+
import { createServer } from "node:http";
|
|
13
15
|
import { parse } from "node:url";
|
|
16
|
+
import { execSync } from "node:child_process";
|
|
17
|
+
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
18
|
+
import * as readline from "node:readline";
|
|
14
19
|
|
|
15
20
|
//#region node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/index.js
|
|
16
21
|
const align = {
|
|
@@ -229,12 +234,12 @@ function cliui(opts, _mixin) {
|
|
|
229
234
|
//#endregion
|
|
230
235
|
//#region node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/string-utils.js
|
|
231
236
|
const ansi = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
|
|
232
|
-
function stripAnsi(str$1) {
|
|
237
|
+
function stripAnsi$2(str$1) {
|
|
233
238
|
return str$1.replace(ansi, "");
|
|
234
239
|
}
|
|
235
|
-
function wrap$
|
|
240
|
+
function wrap$2(str$1, width) {
|
|
236
241
|
const [start, end] = str$1.match(ansi) || ["", ""];
|
|
237
|
-
str$1 = stripAnsi(str$1);
|
|
242
|
+
str$1 = stripAnsi$2(str$1);
|
|
238
243
|
let wrapped = "";
|
|
239
244
|
for (let i$3 = 0; i$3 < str$1.length; i$3++) {
|
|
240
245
|
if (i$3 !== 0 && i$3 % width === 0) wrapped += "\n";
|
|
@@ -251,8 +256,8 @@ function ui(opts) {
|
|
|
251
256
|
stringWidth: (str$1) => {
|
|
252
257
|
return [...str$1].length;
|
|
253
258
|
},
|
|
254
|
-
stripAnsi,
|
|
255
|
-
wrap: wrap$
|
|
259
|
+
stripAnsi: stripAnsi$2,
|
|
260
|
+
wrap: wrap$2
|
|
256
261
|
});
|
|
257
262
|
}
|
|
258
263
|
|
|
@@ -1263,7 +1268,7 @@ try {
|
|
|
1263
1268
|
__dirname = process.cwd();
|
|
1264
1269
|
}
|
|
1265
1270
|
const mainFilename = __dirname.substring(0, __dirname.lastIndexOf("node_modules"));
|
|
1266
|
-
var esm_default = {
|
|
1271
|
+
var esm_default$2 = {
|
|
1267
1272
|
assert: {
|
|
1268
1273
|
notStrictEqual,
|
|
1269
1274
|
strictEqual
|
|
@@ -1424,24 +1429,24 @@ var GlobalMiddleware = class {
|
|
|
1424
1429
|
this.frozens = [];
|
|
1425
1430
|
this.yargs = yargs;
|
|
1426
1431
|
}
|
|
1427
|
-
addMiddleware(callback, applyBeforeValidation, global$
|
|
1432
|
+
addMiddleware(callback, applyBeforeValidation, global$2 = true, mutates = false) {
|
|
1428
1433
|
argsert("<array|function> [boolean] [boolean] [boolean]", [
|
|
1429
1434
|
callback,
|
|
1430
1435
|
applyBeforeValidation,
|
|
1431
|
-
global$
|
|
1436
|
+
global$2
|
|
1432
1437
|
], arguments.length);
|
|
1433
1438
|
if (Array.isArray(callback)) {
|
|
1434
1439
|
for (let i$3 = 0; i$3 < callback.length; i$3++) {
|
|
1435
1440
|
if (typeof callback[i$3] !== "function") throw Error("middleware must be a function");
|
|
1436
1441
|
const m = callback[i$3];
|
|
1437
1442
|
m.applyBeforeValidation = applyBeforeValidation;
|
|
1438
|
-
m.global = global$
|
|
1443
|
+
m.global = global$2;
|
|
1439
1444
|
}
|
|
1440
1445
|
Array.prototype.push.apply(this.globalMiddleware, callback);
|
|
1441
1446
|
} else if (typeof callback === "function") {
|
|
1442
1447
|
const m = callback;
|
|
1443
1448
|
m.applyBeforeValidation = applyBeforeValidation;
|
|
1444
|
-
m.global = global$
|
|
1449
|
+
m.global = global$2;
|
|
1445
1450
|
m.mutates = mutates;
|
|
1446
1451
|
this.globalMiddleware.push(callback);
|
|
1447
1452
|
}
|
|
@@ -1992,18 +1997,18 @@ function usage(yargs, shim$2) {
|
|
|
1992
1997
|
epilogs.push(msg);
|
|
1993
1998
|
};
|
|
1994
1999
|
let wrapSet = false;
|
|
1995
|
-
let wrap$
|
|
2000
|
+
let wrap$3;
|
|
1996
2001
|
self.wrap = (cols) => {
|
|
1997
2002
|
wrapSet = true;
|
|
1998
|
-
wrap$
|
|
2003
|
+
wrap$3 = cols;
|
|
1999
2004
|
};
|
|
2000
2005
|
self.getWrap = () => {
|
|
2001
2006
|
if (shim$2.getEnv("YARGS_DISABLE_WRAP")) return null;
|
|
2002
2007
|
if (!wrapSet) {
|
|
2003
|
-
wrap$
|
|
2008
|
+
wrap$3 = windowWidth();
|
|
2004
2009
|
wrapSet = true;
|
|
2005
2010
|
}
|
|
2006
|
-
return wrap$
|
|
2011
|
+
return wrap$3;
|
|
2007
2012
|
};
|
|
2008
2013
|
const deferY18nLookupPrefix = "__yargsString__:";
|
|
2009
2014
|
self.deferY18nLookup = (str$1) => deferY18nLookupPrefix + str$1;
|
|
@@ -3015,8 +3020,8 @@ var YargsInstance = class {
|
|
|
3015
3020
|
this[kTrackManuallySetKeys](keys);
|
|
3016
3021
|
return this;
|
|
3017
3022
|
}
|
|
3018
|
-
check(f, global$
|
|
3019
|
-
argsert("<function> [boolean]", [f, global$
|
|
3023
|
+
check(f, global$2) {
|
|
3024
|
+
argsert("<function> [boolean]", [f, global$2], arguments.length);
|
|
3020
3025
|
this.middleware((argv, _yargs) => {
|
|
3021
3026
|
return maybeAsyncResult(() => {
|
|
3022
3027
|
return f(argv, _yargs.getOptions());
|
|
@@ -3028,7 +3033,7 @@ var YargsInstance = class {
|
|
|
3028
3033
|
__classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
|
|
3029
3034
|
return argv;
|
|
3030
3035
|
});
|
|
3031
|
-
}, false, global$
|
|
3036
|
+
}, false, global$2);
|
|
3032
3037
|
return this;
|
|
3033
3038
|
}
|
|
3034
3039
|
choices(key$1, value) {
|
|
@@ -3316,10 +3321,10 @@ var YargsInstance = class {
|
|
|
3316
3321
|
getStrictOptions() {
|
|
3317
3322
|
return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f");
|
|
3318
3323
|
}
|
|
3319
|
-
global(globals, global$
|
|
3320
|
-
argsert("<string|array> [boolean]", [globals, global$
|
|
3324
|
+
global(globals, global$2) {
|
|
3325
|
+
argsert("<string|array> [boolean]", [globals, global$2], arguments.length);
|
|
3321
3326
|
globals = [].concat(globals);
|
|
3322
|
-
if (global$
|
|
3327
|
+
if (global$2 !== false) __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter((l) => globals.indexOf(l) === -1);
|
|
3323
3328
|
else globals.forEach((g) => {
|
|
3324
3329
|
if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g)) __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g);
|
|
3325
3330
|
});
|
|
@@ -3356,8 +3361,8 @@ var YargsInstance = class {
|
|
|
3356
3361
|
__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale);
|
|
3357
3362
|
return this;
|
|
3358
3363
|
}
|
|
3359
|
-
middleware(callback, applyBeforeValidation, global$
|
|
3360
|
-
return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global$
|
|
3364
|
+
middleware(callback, applyBeforeValidation, global$2) {
|
|
3365
|
+
return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global$2);
|
|
3361
3366
|
}
|
|
3362
3367
|
nargs(key$1, value) {
|
|
3363
3368
|
argsert("<string|object|array> [number]", [key$1, value], arguments.length);
|
|
@@ -4133,19 +4138,22 @@ function isYargsInstance(y) {
|
|
|
4133
4138
|
|
|
4134
4139
|
//#endregion
|
|
4135
4140
|
//#region node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/index.mjs
|
|
4136
|
-
const Yargs = YargsFactory(esm_default);
|
|
4141
|
+
const Yargs = YargsFactory(esm_default$2);
|
|
4137
4142
|
var yargs_default = Yargs;
|
|
4138
4143
|
|
|
4139
4144
|
//#endregion
|
|
4140
4145
|
//#region src/cli/registry-options.ts
|
|
4141
|
-
function buildRegistryOptions(argv) {
|
|
4146
|
+
function buildRegistryOptions(argv, extras = {}) {
|
|
4142
4147
|
const options = {};
|
|
4143
4148
|
if (Array.isArray(argv.skillDir)) options.customDirs = argv.skillDir;
|
|
4144
4149
|
if (argv.noPlugins === true) options.skipPlugins = true;
|
|
4145
4150
|
if (argv.scanDefaultDirs === false) options.scanDefaultDirs = false;
|
|
4146
4151
|
if (typeof argv.pluginsFile === "string") options.pluginsFile = argv.pluginsFile;
|
|
4147
4152
|
if (typeof argv.pluginsRoot === "string") options.pluginsRoot = argv.pluginsRoot;
|
|
4148
|
-
return
|
|
4153
|
+
return {
|
|
4154
|
+
...options,
|
|
4155
|
+
...extras
|
|
4156
|
+
};
|
|
4149
4157
|
}
|
|
4150
4158
|
|
|
4151
4159
|
//#endregion
|
|
@@ -4211,7 +4219,10 @@ async function infoCommand(argv) {
|
|
|
4211
4219
|
async function listCommand(argv) {
|
|
4212
4220
|
if (argv.noColor || process.env.FORCE_COLOR === "0") setColorEnabled(false);
|
|
4213
4221
|
if (argv.color) setColorEnabled(true);
|
|
4214
|
-
|
|
4222
|
+
let skills = new SkillRegistry(buildRegistryOptions(argv, { includeDisabled: argv.all || argv.disabled })).getAll();
|
|
4223
|
+
if (argv.disabled) skills = skills.filter((s) => s.disabled);
|
|
4224
|
+
else if (!argv.all) skills = skills.filter((s) => !s.disabled);
|
|
4225
|
+
skills = skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
4215
4226
|
if ((argv.json ? "json" : argv.format ?? "plain") === "json") {
|
|
4216
4227
|
console.log(JSON.stringify(skills, null, 2));
|
|
4217
4228
|
return;
|
|
@@ -4237,18 +4248,21 @@ async function listCommand(argv) {
|
|
|
4237
4248
|
]) {
|
|
4238
4249
|
const list = groups[location];
|
|
4239
4250
|
if (!list.length) continue;
|
|
4240
|
-
sections.push(`${colors.underline(colors.bold(labels[location]))} (${list.length})`);
|
|
4251
|
+
sections.push(`${colors$3.underline(colors$3.bold(labels[location]))} (${list.length})`);
|
|
4241
4252
|
sections.push(renderList(list.map((skill) => ({
|
|
4242
4253
|
title: skill.name,
|
|
4254
|
+
color: skill.disabled ? colors$3.red : void 0,
|
|
4255
|
+
badge: skill.disabled ? colors$3.red("[disabled]") : void 0,
|
|
4243
4256
|
meta: location === "plugin" ? skill.pluginInfo?.pluginName ?? dim(location) : dim(location),
|
|
4244
4257
|
description: skill.description
|
|
4245
4258
|
}))));
|
|
4246
4259
|
}
|
|
4247
4260
|
if (sections.length === 0) {
|
|
4248
|
-
console.log("No skills found.");
|
|
4261
|
+
console.log(argv.disabled ? "No disabled skills found." : "No skills found.");
|
|
4249
4262
|
return;
|
|
4250
4263
|
}
|
|
4251
|
-
|
|
4264
|
+
const heading$1 = argv.disabled ? "Disabled skills" : argv.all ? "All skills" : "Skills";
|
|
4265
|
+
console.log(`${colors$3.bold(heading$1)} (${skills.length})\n` + sections.join("\n\n"));
|
|
4252
4266
|
}
|
|
4253
4267
|
|
|
4254
4268
|
//#endregion
|
|
@@ -5486,7 +5500,7 @@ var Protocol = class {
|
|
|
5486
5500
|
this._notificationHandlers.delete(method);
|
|
5487
5501
|
}
|
|
5488
5502
|
};
|
|
5489
|
-
function isPlainObject(value) {
|
|
5503
|
+
function isPlainObject$1(value) {
|
|
5490
5504
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5491
5505
|
}
|
|
5492
5506
|
function mergeCapabilities(base, additional) {
|
|
@@ -5496,7 +5510,7 @@ function mergeCapabilities(base, additional) {
|
|
|
5496
5510
|
const addValue = additional[k];
|
|
5497
5511
|
if (addValue === void 0) continue;
|
|
5498
5512
|
const baseValue = result[k];
|
|
5499
|
-
if (isPlainObject(baseValue) && isPlainObject(addValue)) result[k] = {
|
|
5513
|
+
if (isPlainObject$1(baseValue) && isPlainObject$1(addValue)) result[k] = {
|
|
5500
5514
|
...baseValue,
|
|
5501
5515
|
...addValue
|
|
5502
5516
|
};
|
|
@@ -7701,8 +7715,8 @@ var require_validate = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17
|
|
|
7701
7715
|
}
|
|
7702
7716
|
}
|
|
7703
7717
|
function returnResults(it) {
|
|
7704
|
-
const { gen, schemaEnv, validateName, ValidationError: ValidationError$
|
|
7705
|
-
if (schemaEnv.$async) gen.if((0, codegen_1$28._)`${names_1$3.default.errors} === 0`, () => gen.return(names_1$3.default.data), () => gen.throw((0, codegen_1$28._)`new ${ValidationError$
|
|
7718
|
+
const { gen, schemaEnv, validateName, ValidationError: ValidationError$2, opts } = it;
|
|
7719
|
+
if (schemaEnv.$async) gen.if((0, codegen_1$28._)`${names_1$3.default.errors} === 0`, () => gen.return(names_1$3.default.data), () => gen.throw((0, codegen_1$28._)`new ${ValidationError$2}(${names_1$3.default.vErrors})`));
|
|
7706
7720
|
else {
|
|
7707
7721
|
gen.assign((0, codegen_1$28._)`${validateName}.errors`, names_1$3.default.vErrors);
|
|
7708
7722
|
if (opts.unevaluated) assignEvaluated(it);
|
|
@@ -7988,14 +8002,14 @@ var require_validate = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17
|
|
|
7988
8002
|
//#region node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js
|
|
7989
8003
|
var require_validation_error = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js": ((exports) => {
|
|
7990
8004
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7991
|
-
var ValidationError = class extends Error {
|
|
8005
|
+
var ValidationError$1 = class extends Error {
|
|
7992
8006
|
constructor(errors) {
|
|
7993
8007
|
super("validation failed");
|
|
7994
8008
|
this.errors = errors;
|
|
7995
8009
|
this.ajv = this.validation = true;
|
|
7996
8010
|
}
|
|
7997
8011
|
};
|
|
7998
|
-
exports.default = ValidationError;
|
|
8012
|
+
exports.default = ValidationError$1;
|
|
7999
8013
|
}) });
|
|
8000
8014
|
|
|
8001
8015
|
//#endregion
|
|
@@ -9328,9 +9342,9 @@ var require_core$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17.1
|
|
|
9328
9342
|
}
|
|
9329
9343
|
return this;
|
|
9330
9344
|
}
|
|
9331
|
-
addFormat(name, format$
|
|
9332
|
-
if (typeof format$
|
|
9333
|
-
this.formats[name] = format$
|
|
9345
|
+
addFormat(name, format$4) {
|
|
9346
|
+
if (typeof format$4 == "string") format$4 = new RegExp(format$4);
|
|
9347
|
+
this.formats[name] = format$4;
|
|
9334
9348
|
return this;
|
|
9335
9349
|
}
|
|
9336
9350
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
@@ -9432,8 +9446,8 @@ var require_core$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17.1
|
|
|
9432
9446
|
}
|
|
9433
9447
|
function addInitialFormats() {
|
|
9434
9448
|
for (const name in this.opts.formats) {
|
|
9435
|
-
const format$
|
|
9436
|
-
if (format$
|
|
9449
|
+
const format$4 = this.opts.formats[name];
|
|
9450
|
+
if (format$4) this.addFormat(name, format$4);
|
|
9437
9451
|
}
|
|
9438
9452
|
}
|
|
9439
9453
|
function addInitialKeywords(defs) {
|
|
@@ -10916,17 +10930,17 @@ var require_format$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17
|
|
|
10916
10930
|
});
|
|
10917
10931
|
const fDef = gen.const("fDef", (0, codegen_1$4._)`${fmts}[${schemaCode}]`);
|
|
10918
10932
|
const fType = gen.let("fType");
|
|
10919
|
-
const format$
|
|
10920
|
-
gen.if((0, codegen_1$4._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1$4._)`${fDef}.type || "string"`).assign(format$
|
|
10933
|
+
const format$4 = gen.let("format");
|
|
10934
|
+
gen.if((0, codegen_1$4._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1$4._)`${fDef}.type || "string"`).assign(format$4, (0, codegen_1$4._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1$4._)`"string"`).assign(format$4, fDef));
|
|
10921
10935
|
cxt.fail$data((0, codegen_1$4.or)(unknownFmt(), invalidFmt()));
|
|
10922
10936
|
function unknownFmt() {
|
|
10923
10937
|
if (opts.strictSchema === false) return codegen_1$4.nil;
|
|
10924
|
-
return (0, codegen_1$4._)`${schemaCode} && !${format$
|
|
10938
|
+
return (0, codegen_1$4._)`${schemaCode} && !${format$4}`;
|
|
10925
10939
|
}
|
|
10926
10940
|
function invalidFmt() {
|
|
10927
|
-
const callFormat = schemaEnv.$async ? (0, codegen_1$4._)`(${fDef}.async ? await ${format$
|
|
10928
|
-
const validData = (0, codegen_1$4._)`(typeof ${format$
|
|
10929
|
-
return (0, codegen_1$4._)`${format$
|
|
10941
|
+
const callFormat = schemaEnv.$async ? (0, codegen_1$4._)`(${fDef}.async ? await ${format$4}(${data}) : ${format$4}(${data}))` : (0, codegen_1$4._)`${format$4}(${data})`;
|
|
10942
|
+
const validData = (0, codegen_1$4._)`(typeof ${format$4} == "function" ? ${callFormat} : ${format$4}.test(${data}))`;
|
|
10943
|
+
return (0, codegen_1$4._)`${format$4} && ${format$4} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
10930
10944
|
}
|
|
10931
10945
|
}
|
|
10932
10946
|
function validateFormat() {
|
|
@@ -10936,7 +10950,7 @@ var require_format$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17
|
|
|
10936
10950
|
return;
|
|
10937
10951
|
}
|
|
10938
10952
|
if (formatDef === true) return;
|
|
10939
|
-
const [fmtType, format$
|
|
10953
|
+
const [fmtType, format$4, fmtRef] = getFormat(formatDef);
|
|
10940
10954
|
if (fmtType === ruleType) cxt.pass(validCondition());
|
|
10941
10955
|
function unknownFormat() {
|
|
10942
10956
|
if (opts.strictSchema === false) {
|
|
@@ -10971,7 +10985,7 @@ var require_format$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17
|
|
|
10971
10985
|
if (!schemaEnv.$async) throw new Error("async format in sync schema");
|
|
10972
10986
|
return (0, codegen_1$4._)`await ${fmtRef}(${data})`;
|
|
10973
10987
|
}
|
|
10974
|
-
return typeof format$
|
|
10988
|
+
return typeof format$4 == "function" ? (0, codegen_1$4._)`${fmtRef}(${data})` : (0, codegen_1$4._)`${fmtRef}.test(${data})`;
|
|
10975
10989
|
}
|
|
10976
10990
|
}
|
|
10977
10991
|
}
|
|
@@ -10983,8 +10997,8 @@ var require_format$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17
|
|
|
10983
10997
|
//#region node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js
|
|
10984
10998
|
var require_format = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js": ((exports) => {
|
|
10985
10999
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10986
|
-
const format$
|
|
10987
|
-
exports.default = format$
|
|
11000
|
+
const format$3 = [require_format$1().default];
|
|
11001
|
+
exports.default = format$3;
|
|
10988
11002
|
}) });
|
|
10989
11003
|
|
|
10990
11004
|
//#endregion
|
|
@@ -11612,14 +11626,14 @@ var require_limit = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ajv-formats
|
|
|
11612
11626
|
cxt.fail$data((0, codegen_1$1.or)((0, codegen_1$1._)`typeof ${fmt} != "object"`, (0, codegen_1$1._)`${fmt} instanceof RegExp`, (0, codegen_1$1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
|
|
11613
11627
|
}
|
|
11614
11628
|
function validateFormat() {
|
|
11615
|
-
const format$
|
|
11616
|
-
const fmtDef$1 = self.formats[format$
|
|
11629
|
+
const format$4 = fCxt.schema;
|
|
11630
|
+
const fmtDef$1 = self.formats[format$4];
|
|
11617
11631
|
if (!fmtDef$1 || fmtDef$1 === true) return;
|
|
11618
|
-
if (typeof fmtDef$1 != "object" || fmtDef$1 instanceof RegExp || typeof fmtDef$1.compare != "function") throw new Error(`"${keyword}": format "${format$
|
|
11632
|
+
if (typeof fmtDef$1 != "object" || fmtDef$1 instanceof RegExp || typeof fmtDef$1.compare != "function") throw new Error(`"${keyword}": format "${format$4}" does not define "compare" function`);
|
|
11619
11633
|
const fmt = gen.scopeValue("formats", {
|
|
11620
|
-
key: format$
|
|
11634
|
+
key: format$4,
|
|
11621
11635
|
ref: fmtDef$1,
|
|
11622
|
-
code: opts.code.formats ? (0, codegen_1$1._)`${opts.code.formats}${(0, codegen_1$1.getProperty)(format$
|
|
11636
|
+
code: opts.code.formats ? (0, codegen_1$1._)`${opts.code.formats}${(0, codegen_1$1.getProperty)(format$4)}` : void 0
|
|
11623
11637
|
});
|
|
11624
11638
|
cxt.fail$data(compareCode(fmt));
|
|
11625
11639
|
}
|
|
@@ -11977,7 +11991,7 @@ var require_bytes = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/bytes@3.1.2
|
|
|
11977
11991
|
* @public
|
|
11978
11992
|
*/
|
|
11979
11993
|
module.exports = bytes$1;
|
|
11980
|
-
module.exports.format = format$
|
|
11994
|
+
module.exports.format = format$2;
|
|
11981
11995
|
module.exports.parse = parse$2;
|
|
11982
11996
|
/**
|
|
11983
11997
|
* Module variables.
|
|
@@ -12010,7 +12024,7 @@ var require_bytes = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/bytes@3.1.2
|
|
|
12010
12024
|
*/
|
|
12011
12025
|
function bytes$1(value, options) {
|
|
12012
12026
|
if (typeof value === "string") return parse$2(value);
|
|
12013
|
-
if (typeof value === "number") return format$
|
|
12027
|
+
if (typeof value === "number") return format$2(value, options);
|
|
12014
12028
|
return null;
|
|
12015
12029
|
}
|
|
12016
12030
|
/**
|
|
@@ -12030,7 +12044,7 @@ var require_bytes = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/bytes@3.1.2
|
|
|
12030
12044
|
* @returns {string|null}
|
|
12031
12045
|
* @public
|
|
12032
12046
|
*/
|
|
12033
|
-
function format$
|
|
12047
|
+
function format$2(value, options) {
|
|
12034
12048
|
if (!Number.isFinite(value)) return null;
|
|
12035
12049
|
var mag = Math.abs(value);
|
|
12036
12050
|
var thousandsSeparator = options && options.thousandsSeparator || "";
|
|
@@ -21461,7 +21475,7 @@ var require_streams = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/iconv-lit
|
|
|
21461
21475
|
|
|
21462
21476
|
//#endregion
|
|
21463
21477
|
//#region node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/lib/index.js
|
|
21464
|
-
var require_lib = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/lib/index.js": ((exports, module) => {
|
|
21478
|
+
var require_lib$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/iconv-lite@0.7.0/node_modules/iconv-lite/lib/index.js": ((exports, module) => {
|
|
21465
21479
|
var Buffer$1 = require_safer().Buffer;
|
|
21466
21480
|
var bomHandling = require_bom_handling();
|
|
21467
21481
|
var mergeModules = require_merge_exports();
|
|
@@ -21629,7 +21643,7 @@ var require_raw_body = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/raw-body
|
|
|
21629
21643
|
var asyncHooks = tryRequireAsyncHooks();
|
|
21630
21644
|
var bytes = require_bytes();
|
|
21631
21645
|
var createError = require_http_errors();
|
|
21632
|
-
var iconv = require_lib();
|
|
21646
|
+
var iconv = require_lib$1();
|
|
21633
21647
|
var unpipe = require_unpipe();
|
|
21634
21648
|
/**
|
|
21635
21649
|
* Module exports.
|
|
@@ -21682,7 +21696,7 @@ var require_raw_body = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/raw-body
|
|
|
21682
21696
|
var encoding = opts.encoding !== true ? opts.encoding : "utf-8";
|
|
21683
21697
|
var limit = bytes.parse(opts.limit);
|
|
21684
21698
|
var length = opts.length != null && !isNaN(opts.length) ? parseInt(opts.length, 10) : null;
|
|
21685
|
-
if (done) return readStream(stream, encoding, length, limit, wrap(done));
|
|
21699
|
+
if (done) return readStream(stream, encoding, length, limit, wrap$1(done));
|
|
21686
21700
|
return new Promise(function executor(resolve$4, reject) {
|
|
21687
21701
|
readStream(stream, encoding, length, limit, function onRead(err, buf) {
|
|
21688
21702
|
if (err) return reject(err);
|
|
@@ -21805,7 +21819,7 @@ var require_raw_body = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/raw-body
|
|
|
21805
21819
|
* AsyncResource.bind static method backported.
|
|
21806
21820
|
* @private
|
|
21807
21821
|
*/
|
|
21808
|
-
function wrap(fn) {
|
|
21822
|
+
function wrap$1(fn) {
|
|
21809
21823
|
var res;
|
|
21810
21824
|
if (asyncHooks.AsyncResource) res = new asyncHooks.AsyncResource(fn.name || "bound-anonymous-fn");
|
|
21811
21825
|
if (!res || !res.runInAsyncScope) return fn;
|
|
@@ -22048,6 +22062,92 @@ var SSEServerTransport = class {
|
|
|
22048
22062
|
}
|
|
22049
22063
|
};
|
|
22050
22064
|
|
|
22065
|
+
//#endregion
|
|
22066
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.22.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
22067
|
+
/**
|
|
22068
|
+
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
|
22069
|
+
*/
|
|
22070
|
+
var ReadBuffer = class {
|
|
22071
|
+
append(chunk) {
|
|
22072
|
+
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
22073
|
+
}
|
|
22074
|
+
readMessage() {
|
|
22075
|
+
if (!this._buffer) return null;
|
|
22076
|
+
const index = this._buffer.indexOf("\n");
|
|
22077
|
+
if (index === -1) return null;
|
|
22078
|
+
const line$1 = this._buffer.toString("utf8", 0, index).replace(/\r$/, "");
|
|
22079
|
+
this._buffer = this._buffer.subarray(index + 1);
|
|
22080
|
+
return deserializeMessage(line$1);
|
|
22081
|
+
}
|
|
22082
|
+
clear() {
|
|
22083
|
+
this._buffer = void 0;
|
|
22084
|
+
}
|
|
22085
|
+
};
|
|
22086
|
+
function deserializeMessage(line$1) {
|
|
22087
|
+
return JSONRPCMessageSchema.parse(JSON.parse(line$1));
|
|
22088
|
+
}
|
|
22089
|
+
function serializeMessage(message) {
|
|
22090
|
+
return JSON.stringify(message) + "\n";
|
|
22091
|
+
}
|
|
22092
|
+
|
|
22093
|
+
//#endregion
|
|
22094
|
+
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.22.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
22095
|
+
/**
|
|
22096
|
+
* Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout.
|
|
22097
|
+
*
|
|
22098
|
+
* This transport is only available in Node.js environments.
|
|
22099
|
+
*/
|
|
22100
|
+
var StdioServerTransport = class {
|
|
22101
|
+
constructor(_stdin = process$1.stdin, _stdout = process$1.stdout) {
|
|
22102
|
+
this._stdin = _stdin;
|
|
22103
|
+
this._stdout = _stdout;
|
|
22104
|
+
this._readBuffer = new ReadBuffer();
|
|
22105
|
+
this._started = false;
|
|
22106
|
+
this._ondata = (chunk) => {
|
|
22107
|
+
this._readBuffer.append(chunk);
|
|
22108
|
+
this.processReadBuffer();
|
|
22109
|
+
};
|
|
22110
|
+
this._onerror = (error$2) => {
|
|
22111
|
+
var _a$1;
|
|
22112
|
+
(_a$1 = this.onerror) === null || _a$1 === void 0 || _a$1.call(this, error$2);
|
|
22113
|
+
};
|
|
22114
|
+
}
|
|
22115
|
+
/**
|
|
22116
|
+
* Starts listening for messages on stdin.
|
|
22117
|
+
*/
|
|
22118
|
+
async start() {
|
|
22119
|
+
if (this._started) throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
|
|
22120
|
+
this._started = true;
|
|
22121
|
+
this._stdin.on("data", this._ondata);
|
|
22122
|
+
this._stdin.on("error", this._onerror);
|
|
22123
|
+
}
|
|
22124
|
+
processReadBuffer() {
|
|
22125
|
+
var _a$1, _b$1;
|
|
22126
|
+
while (true) try {
|
|
22127
|
+
const message = this._readBuffer.readMessage();
|
|
22128
|
+
if (message === null) break;
|
|
22129
|
+
(_a$1 = this.onmessage) === null || _a$1 === void 0 || _a$1.call(this, message);
|
|
22130
|
+
} catch (error$2) {
|
|
22131
|
+
(_b$1 = this.onerror) === null || _b$1 === void 0 || _b$1.call(this, error$2);
|
|
22132
|
+
}
|
|
22133
|
+
}
|
|
22134
|
+
async close() {
|
|
22135
|
+
var _a$1;
|
|
22136
|
+
this._stdin.off("data", this._ondata);
|
|
22137
|
+
this._stdin.off("error", this._onerror);
|
|
22138
|
+
if (this._stdin.listenerCount("data") === 0) this._stdin.pause();
|
|
22139
|
+
this._readBuffer.clear();
|
|
22140
|
+
(_a$1 = this.onclose) === null || _a$1 === void 0 || _a$1.call(this);
|
|
22141
|
+
}
|
|
22142
|
+
send(message) {
|
|
22143
|
+
return new Promise((resolve$4) => {
|
|
22144
|
+
const json = serializeMessage(message);
|
|
22145
|
+
if (this._stdout.write(json)) resolve$4();
|
|
22146
|
+
else this._stdout.once("drain", resolve$4);
|
|
22147
|
+
});
|
|
22148
|
+
}
|
|
22149
|
+
};
|
|
22150
|
+
|
|
22051
22151
|
//#endregion
|
|
22052
22152
|
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.22.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js
|
|
22053
22153
|
var import_raw_body = /* @__PURE__ */ __toESM(require_raw_body(), 1);
|
|
@@ -22510,92 +22610,6 @@ var StreamableHTTPServerTransport = class {
|
|
|
22510
22610
|
}
|
|
22511
22611
|
};
|
|
22512
22612
|
|
|
22513
|
-
//#endregion
|
|
22514
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.22.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
22515
|
-
/**
|
|
22516
|
-
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
|
22517
|
-
*/
|
|
22518
|
-
var ReadBuffer = class {
|
|
22519
|
-
append(chunk) {
|
|
22520
|
-
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
22521
|
-
}
|
|
22522
|
-
readMessage() {
|
|
22523
|
-
if (!this._buffer) return null;
|
|
22524
|
-
const index = this._buffer.indexOf("\n");
|
|
22525
|
-
if (index === -1) return null;
|
|
22526
|
-
const line$1 = this._buffer.toString("utf8", 0, index).replace(/\r$/, "");
|
|
22527
|
-
this._buffer = this._buffer.subarray(index + 1);
|
|
22528
|
-
return deserializeMessage(line$1);
|
|
22529
|
-
}
|
|
22530
|
-
clear() {
|
|
22531
|
-
this._buffer = void 0;
|
|
22532
|
-
}
|
|
22533
|
-
};
|
|
22534
|
-
function deserializeMessage(line$1) {
|
|
22535
|
-
return JSONRPCMessageSchema.parse(JSON.parse(line$1));
|
|
22536
|
-
}
|
|
22537
|
-
function serializeMessage(message) {
|
|
22538
|
-
return JSON.stringify(message) + "\n";
|
|
22539
|
-
}
|
|
22540
|
-
|
|
22541
|
-
//#endregion
|
|
22542
|
-
//#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.22.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
22543
|
-
/**
|
|
22544
|
-
* Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout.
|
|
22545
|
-
*
|
|
22546
|
-
* This transport is only available in Node.js environments.
|
|
22547
|
-
*/
|
|
22548
|
-
var StdioServerTransport = class {
|
|
22549
|
-
constructor(_stdin = process$1.stdin, _stdout = process$1.stdout) {
|
|
22550
|
-
this._stdin = _stdin;
|
|
22551
|
-
this._stdout = _stdout;
|
|
22552
|
-
this._readBuffer = new ReadBuffer();
|
|
22553
|
-
this._started = false;
|
|
22554
|
-
this._ondata = (chunk) => {
|
|
22555
|
-
this._readBuffer.append(chunk);
|
|
22556
|
-
this.processReadBuffer();
|
|
22557
|
-
};
|
|
22558
|
-
this._onerror = (error$2) => {
|
|
22559
|
-
var _a$1;
|
|
22560
|
-
(_a$1 = this.onerror) === null || _a$1 === void 0 || _a$1.call(this, error$2);
|
|
22561
|
-
};
|
|
22562
|
-
}
|
|
22563
|
-
/**
|
|
22564
|
-
* Starts listening for messages on stdin.
|
|
22565
|
-
*/
|
|
22566
|
-
async start() {
|
|
22567
|
-
if (this._started) throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
|
|
22568
|
-
this._started = true;
|
|
22569
|
-
this._stdin.on("data", this._ondata);
|
|
22570
|
-
this._stdin.on("error", this._onerror);
|
|
22571
|
-
}
|
|
22572
|
-
processReadBuffer() {
|
|
22573
|
-
var _a$1, _b$1;
|
|
22574
|
-
while (true) try {
|
|
22575
|
-
const message = this._readBuffer.readMessage();
|
|
22576
|
-
if (message === null) break;
|
|
22577
|
-
(_a$1 = this.onmessage) === null || _a$1 === void 0 || _a$1.call(this, message);
|
|
22578
|
-
} catch (error$2) {
|
|
22579
|
-
(_b$1 = this.onerror) === null || _b$1 === void 0 || _b$1.call(this, error$2);
|
|
22580
|
-
}
|
|
22581
|
-
}
|
|
22582
|
-
async close() {
|
|
22583
|
-
var _a$1;
|
|
22584
|
-
this._stdin.off("data", this._ondata);
|
|
22585
|
-
this._stdin.off("error", this._onerror);
|
|
22586
|
-
if (this._stdin.listenerCount("data") === 0) this._stdin.pause();
|
|
22587
|
-
this._readBuffer.clear();
|
|
22588
|
-
(_a$1 = this.onclose) === null || _a$1 === void 0 || _a$1.call(this);
|
|
22589
|
-
}
|
|
22590
|
-
send(message) {
|
|
22591
|
-
return new Promise((resolve$4) => {
|
|
22592
|
-
const json = serializeMessage(message);
|
|
22593
|
-
if (this._stdout.write(json)) resolve$4();
|
|
22594
|
-
else this._stdout.once("drain", resolve$4);
|
|
22595
|
-
});
|
|
22596
|
-
}
|
|
22597
|
-
};
|
|
22598
|
-
|
|
22599
22613
|
//#endregion
|
|
22600
22614
|
//#region src/mcp/server.ts
|
|
22601
22615
|
/**
|
|
@@ -22761,11 +22775,40 @@ async function startMCPServer(options = {}) {
|
|
|
22761
22775
|
});
|
|
22762
22776
|
}
|
|
22763
22777
|
function buildSkillDescription(registry) {
|
|
22764
|
-
|
|
22765
|
-
|
|
22778
|
+
const skills = registry.getAll();
|
|
22779
|
+
const diagnostics = registry.getDiagnostics();
|
|
22780
|
+
const exampleCommands = skills.slice(0, 2).map((skill) => ` - command: "${skill.name}"`);
|
|
22781
|
+
const skillBlocks = skills.map((skill) => {
|
|
22782
|
+
const location = skill.location === "user" ? "global" : skill.location;
|
|
22783
|
+
return [
|
|
22784
|
+
"<skill>",
|
|
22785
|
+
`<name>${skill.name}</name>`,
|
|
22786
|
+
`<description>${skill.description}</description>`,
|
|
22787
|
+
`<location>${location}</location>`,
|
|
22788
|
+
"</skill>"
|
|
22789
|
+
].join("\n");
|
|
22790
|
+
}).join("\n");
|
|
22791
|
+
const discoveryLines = ["- `<available_skills>` is generated from the skills discovered on this machine at runtime.", "- Discovery scans project and user skill directories"];
|
|
22792
|
+
if (diagnostics.pluginSources.length > 0) discoveryLines.push(`- Plugin skills loaded from: ${diagnostics.pluginSources.join(", ")}`);
|
|
22793
|
+
const exampleSection = exampleCommands.length > 0 ? ["- Examples:", ...exampleCommands].join("\n") : "";
|
|
22794
|
+
return `${`Execute a skill within the main conversation
|
|
22795
|
+
|
|
22796
|
+
<skills_instructions>
|
|
22797
|
+
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
|
|
22766
22798
|
|
|
22767
|
-
|
|
22768
|
-
${
|
|
22799
|
+
Source of truth:
|
|
22800
|
+
${discoveryLines.join("\n")}
|
|
22801
|
+
|
|
22802
|
+
How to use skills:
|
|
22803
|
+
- Invoke this tool with the skill name only (case-insensitive)
|
|
22804
|
+
- The skill's prompt will expand and provide detailed instructions on how to complete the task
|
|
22805
|
+
${exampleSection}
|
|
22806
|
+
|
|
22807
|
+
Important:
|
|
22808
|
+
- Only use skills listed in <available_skills> below (this list reflects what is actually installed)
|
|
22809
|
+
- Do not invoke a skill that is already running
|
|
22810
|
+
- Do not use this tool for built-in CLI commands (like /help, /clear, etc.)
|
|
22811
|
+
</skills_instructions>`}\n\n${`<available_skills>\n${skillBlocks || "<skill>\n<name>none</name>\n<description>No skills discovered</description>\n<location>none</location>\n</skill>"}\n</available_skills>`}`;
|
|
22769
22812
|
}
|
|
22770
22813
|
function formatSkillContent(skill) {
|
|
22771
22814
|
return `${[
|
|
@@ -22817,7 +22860,7 @@ async function searchCommand(argv) {
|
|
|
22817
22860
|
console.log("No skills matched your query.");
|
|
22818
22861
|
return;
|
|
22819
22862
|
}
|
|
22820
|
-
console.log(`${colors.underline(colors.bold("Matches"))} (${filtered.length})\n`);
|
|
22863
|
+
console.log(`${colors$3.underline(colors$3.bold("Matches"))} (${filtered.length})\n`);
|
|
22821
22864
|
console.log(renderList(filtered.map((skill) => ({
|
|
22822
22865
|
title: highlight(skill.name, argv.query),
|
|
22823
22866
|
meta: `(${skill.location})`,
|
|
@@ -22887,83 +22930,4173 @@ function resolveSkillFile(input) {
|
|
|
22887
22930
|
}
|
|
22888
22931
|
|
|
22889
22932
|
//#endregion
|
|
22890
|
-
//#region
|
|
22891
|
-
|
|
22892
|
-
|
|
22893
|
-
|
|
22894
|
-
|
|
22895
|
-
|
|
22896
|
-
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22933
|
+
//#region node_modules/.pnpm/@inquirer+figures@1.0.0/node_modules/@inquirer/figures/dist/esm/index.mjs
|
|
22934
|
+
function isUnicodeSupported$1() {
|
|
22935
|
+
if (process$1.platform !== "win32") return process$1.env["TERM"] !== "linux";
|
|
22936
|
+
return Boolean(process$1.env["WT_SESSION"]) || Boolean(process$1.env["TERMINUS_SUBLIME"]) || process$1.env["ConEmuTask"] === "{cmd::Cmder}" || process$1.env["TERM_PROGRAM"] === "Terminus-Sublime" || process$1.env["TERM_PROGRAM"] === "vscode" || process$1.env["TERM"] === "xterm-256color" || process$1.env["TERM"] === "alacritty" || process$1.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
22937
|
+
}
|
|
22938
|
+
const common$1 = {
|
|
22939
|
+
circleQuestionMark: "(?)",
|
|
22940
|
+
questionMarkPrefix: "(?)",
|
|
22941
|
+
square: "█",
|
|
22942
|
+
squareDarkShade: "▓",
|
|
22943
|
+
squareMediumShade: "▒",
|
|
22944
|
+
squareLightShade: "░",
|
|
22945
|
+
squareTop: "▀",
|
|
22946
|
+
squareBottom: "▄",
|
|
22947
|
+
squareLeft: "▌",
|
|
22948
|
+
squareRight: "▐",
|
|
22949
|
+
squareCenter: "■",
|
|
22950
|
+
bullet: "●",
|
|
22951
|
+
dot: "․",
|
|
22952
|
+
ellipsis: "…",
|
|
22953
|
+
pointerSmall: "›",
|
|
22954
|
+
triangleUp: "▲",
|
|
22955
|
+
triangleUpSmall: "▴",
|
|
22956
|
+
triangleDown: "▼",
|
|
22957
|
+
triangleDownSmall: "▾",
|
|
22958
|
+
triangleLeftSmall: "◂",
|
|
22959
|
+
triangleRightSmall: "▸",
|
|
22960
|
+
home: "⌂",
|
|
22961
|
+
heart: "♥",
|
|
22962
|
+
musicNote: "♪",
|
|
22963
|
+
musicNoteBeamed: "♫",
|
|
22964
|
+
arrowUp: "↑",
|
|
22965
|
+
arrowDown: "↓",
|
|
22966
|
+
arrowLeft: "←",
|
|
22967
|
+
arrowRight: "→",
|
|
22968
|
+
arrowLeftRight: "↔",
|
|
22969
|
+
arrowUpDown: "↕",
|
|
22970
|
+
almostEqual: "≈",
|
|
22971
|
+
notEqual: "≠",
|
|
22972
|
+
lessOrEqual: "≤",
|
|
22973
|
+
greaterOrEqual: "≥",
|
|
22974
|
+
identical: "≡",
|
|
22975
|
+
infinity: "∞",
|
|
22976
|
+
subscriptZero: "₀",
|
|
22977
|
+
subscriptOne: "₁",
|
|
22978
|
+
subscriptTwo: "₂",
|
|
22979
|
+
subscriptThree: "₃",
|
|
22980
|
+
subscriptFour: "₄",
|
|
22981
|
+
subscriptFive: "₅",
|
|
22982
|
+
subscriptSix: "₆",
|
|
22983
|
+
subscriptSeven: "₇",
|
|
22984
|
+
subscriptEight: "₈",
|
|
22985
|
+
subscriptNine: "₉",
|
|
22986
|
+
oneHalf: "½",
|
|
22987
|
+
oneThird: "⅓",
|
|
22988
|
+
oneQuarter: "¼",
|
|
22989
|
+
oneFifth: "⅕",
|
|
22990
|
+
oneSixth: "⅙",
|
|
22991
|
+
oneEighth: "⅛",
|
|
22992
|
+
twoThirds: "⅔",
|
|
22993
|
+
twoFifths: "⅖",
|
|
22994
|
+
threeQuarters: "¾",
|
|
22995
|
+
threeFifths: "⅗",
|
|
22996
|
+
threeEighths: "⅜",
|
|
22997
|
+
fourFifths: "⅘",
|
|
22998
|
+
fiveSixths: "⅚",
|
|
22999
|
+
fiveEighths: "⅝",
|
|
23000
|
+
sevenEighths: "⅞",
|
|
23001
|
+
line: "─",
|
|
23002
|
+
lineBold: "━",
|
|
23003
|
+
lineDouble: "═",
|
|
23004
|
+
lineDashed0: "┄",
|
|
23005
|
+
lineDashed1: "┅",
|
|
23006
|
+
lineDashed2: "┈",
|
|
23007
|
+
lineDashed3: "┉",
|
|
23008
|
+
lineDashed4: "╌",
|
|
23009
|
+
lineDashed5: "╍",
|
|
23010
|
+
lineDashed6: "╴",
|
|
23011
|
+
lineDashed7: "╶",
|
|
23012
|
+
lineDashed8: "╸",
|
|
23013
|
+
lineDashed9: "╺",
|
|
23014
|
+
lineDashed10: "╼",
|
|
23015
|
+
lineDashed11: "╾",
|
|
23016
|
+
lineDashed12: "−",
|
|
23017
|
+
lineDashed13: "–",
|
|
23018
|
+
lineDashed14: "‐",
|
|
23019
|
+
lineDashed15: "⁃",
|
|
23020
|
+
lineVertical: "│",
|
|
23021
|
+
lineVerticalBold: "┃",
|
|
23022
|
+
lineVerticalDouble: "║",
|
|
23023
|
+
lineVerticalDashed0: "┆",
|
|
23024
|
+
lineVerticalDashed1: "┇",
|
|
23025
|
+
lineVerticalDashed2: "┊",
|
|
23026
|
+
lineVerticalDashed3: "┋",
|
|
23027
|
+
lineVerticalDashed4: "╎",
|
|
23028
|
+
lineVerticalDashed5: "╏",
|
|
23029
|
+
lineVerticalDashed6: "╵",
|
|
23030
|
+
lineVerticalDashed7: "╷",
|
|
23031
|
+
lineVerticalDashed8: "╹",
|
|
23032
|
+
lineVerticalDashed9: "╻",
|
|
23033
|
+
lineVerticalDashed10: "╽",
|
|
23034
|
+
lineVerticalDashed11: "╿",
|
|
23035
|
+
lineDownLeft: "┐",
|
|
23036
|
+
lineDownLeftArc: "╮",
|
|
23037
|
+
lineDownBoldLeftBold: "┓",
|
|
23038
|
+
lineDownBoldLeft: "┒",
|
|
23039
|
+
lineDownLeftBold: "┑",
|
|
23040
|
+
lineDownDoubleLeftDouble: "╗",
|
|
23041
|
+
lineDownDoubleLeft: "╖",
|
|
23042
|
+
lineDownLeftDouble: "╕",
|
|
23043
|
+
lineDownRight: "┌",
|
|
23044
|
+
lineDownRightArc: "╭",
|
|
23045
|
+
lineDownBoldRightBold: "┏",
|
|
23046
|
+
lineDownBoldRight: "┎",
|
|
23047
|
+
lineDownRightBold: "┍",
|
|
23048
|
+
lineDownDoubleRightDouble: "╔",
|
|
23049
|
+
lineDownDoubleRight: "╓",
|
|
23050
|
+
lineDownRightDouble: "╒",
|
|
23051
|
+
lineUpLeft: "┘",
|
|
23052
|
+
lineUpLeftArc: "╯",
|
|
23053
|
+
lineUpBoldLeftBold: "┛",
|
|
23054
|
+
lineUpBoldLeft: "┚",
|
|
23055
|
+
lineUpLeftBold: "┙",
|
|
23056
|
+
lineUpDoubleLeftDouble: "╝",
|
|
23057
|
+
lineUpDoubleLeft: "╜",
|
|
23058
|
+
lineUpLeftDouble: "╛",
|
|
23059
|
+
lineUpRight: "└",
|
|
23060
|
+
lineUpRightArc: "╰",
|
|
23061
|
+
lineUpBoldRightBold: "┗",
|
|
23062
|
+
lineUpBoldRight: "┖",
|
|
23063
|
+
lineUpRightBold: "┕",
|
|
23064
|
+
lineUpDoubleRightDouble: "╚",
|
|
23065
|
+
lineUpDoubleRight: "╙",
|
|
23066
|
+
lineUpRightDouble: "╘",
|
|
23067
|
+
lineUpDownLeft: "┤",
|
|
23068
|
+
lineUpBoldDownBoldLeftBold: "┫",
|
|
23069
|
+
lineUpBoldDownBoldLeft: "┨",
|
|
23070
|
+
lineUpDownLeftBold: "┥",
|
|
23071
|
+
lineUpBoldDownLeftBold: "┩",
|
|
23072
|
+
lineUpDownBoldLeftBold: "┪",
|
|
23073
|
+
lineUpDownBoldLeft: "┧",
|
|
23074
|
+
lineUpBoldDownLeft: "┦",
|
|
23075
|
+
lineUpDoubleDownDoubleLeftDouble: "╣",
|
|
23076
|
+
lineUpDoubleDownDoubleLeft: "╢",
|
|
23077
|
+
lineUpDownLeftDouble: "╡",
|
|
23078
|
+
lineUpDownRight: "├",
|
|
23079
|
+
lineUpBoldDownBoldRightBold: "┣",
|
|
23080
|
+
lineUpBoldDownBoldRight: "┠",
|
|
23081
|
+
lineUpDownRightBold: "┝",
|
|
23082
|
+
lineUpBoldDownRightBold: "┡",
|
|
23083
|
+
lineUpDownBoldRightBold: "┢",
|
|
23084
|
+
lineUpDownBoldRight: "┟",
|
|
23085
|
+
lineUpBoldDownRight: "┞",
|
|
23086
|
+
lineUpDoubleDownDoubleRightDouble: "╠",
|
|
23087
|
+
lineUpDoubleDownDoubleRight: "╟",
|
|
23088
|
+
lineUpDownRightDouble: "╞",
|
|
23089
|
+
lineDownLeftRight: "┬",
|
|
23090
|
+
lineDownBoldLeftBoldRightBold: "┳",
|
|
23091
|
+
lineDownLeftBoldRightBold: "┯",
|
|
23092
|
+
lineDownBoldLeftRight: "┰",
|
|
23093
|
+
lineDownBoldLeftBoldRight: "┱",
|
|
23094
|
+
lineDownBoldLeftRightBold: "┲",
|
|
23095
|
+
lineDownLeftRightBold: "┮",
|
|
23096
|
+
lineDownLeftBoldRight: "┭",
|
|
23097
|
+
lineDownDoubleLeftDoubleRightDouble: "╦",
|
|
23098
|
+
lineDownDoubleLeftRight: "╥",
|
|
23099
|
+
lineDownLeftDoubleRightDouble: "╤",
|
|
23100
|
+
lineUpLeftRight: "┴",
|
|
23101
|
+
lineUpBoldLeftBoldRightBold: "┻",
|
|
23102
|
+
lineUpLeftBoldRightBold: "┷",
|
|
23103
|
+
lineUpBoldLeftRight: "┸",
|
|
23104
|
+
lineUpBoldLeftBoldRight: "┹",
|
|
23105
|
+
lineUpBoldLeftRightBold: "┺",
|
|
23106
|
+
lineUpLeftRightBold: "┶",
|
|
23107
|
+
lineUpLeftBoldRight: "┵",
|
|
23108
|
+
lineUpDoubleLeftDoubleRightDouble: "╩",
|
|
23109
|
+
lineUpDoubleLeftRight: "╨",
|
|
23110
|
+
lineUpLeftDoubleRightDouble: "╧",
|
|
23111
|
+
lineUpDownLeftRight: "┼",
|
|
23112
|
+
lineUpBoldDownBoldLeftBoldRightBold: "╋",
|
|
23113
|
+
lineUpDownBoldLeftBoldRightBold: "╈",
|
|
23114
|
+
lineUpBoldDownLeftBoldRightBold: "╇",
|
|
23115
|
+
lineUpBoldDownBoldLeftRightBold: "╊",
|
|
23116
|
+
lineUpBoldDownBoldLeftBoldRight: "╉",
|
|
23117
|
+
lineUpBoldDownLeftRight: "╀",
|
|
23118
|
+
lineUpDownBoldLeftRight: "╁",
|
|
23119
|
+
lineUpDownLeftBoldRight: "┽",
|
|
23120
|
+
lineUpDownLeftRightBold: "┾",
|
|
23121
|
+
lineUpBoldDownBoldLeftRight: "╂",
|
|
23122
|
+
lineUpDownLeftBoldRightBold: "┿",
|
|
23123
|
+
lineUpBoldDownLeftBoldRight: "╃",
|
|
23124
|
+
lineUpBoldDownLeftRightBold: "╄",
|
|
23125
|
+
lineUpDownBoldLeftBoldRight: "╅",
|
|
23126
|
+
lineUpDownBoldLeftRightBold: "╆",
|
|
23127
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
|
|
23128
|
+
lineUpDoubleDownDoubleLeftRight: "╫",
|
|
23129
|
+
lineUpDownLeftDoubleRightDouble: "╪",
|
|
23130
|
+
lineCross: "╳",
|
|
23131
|
+
lineBackslash: "╲",
|
|
23132
|
+
lineSlash: "╱"
|
|
22904
23133
|
};
|
|
22905
|
-
const
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
23134
|
+
const specialMainSymbols$1 = {
|
|
23135
|
+
tick: "✔",
|
|
23136
|
+
info: "ℹ",
|
|
23137
|
+
warning: "⚠",
|
|
23138
|
+
cross: "✘",
|
|
23139
|
+
squareSmall: "◻",
|
|
23140
|
+
squareSmallFilled: "◼",
|
|
23141
|
+
circle: "◯",
|
|
23142
|
+
circleFilled: "◉",
|
|
23143
|
+
circleDotted: "◌",
|
|
23144
|
+
circleDouble: "◎",
|
|
23145
|
+
circleCircle: "ⓞ",
|
|
23146
|
+
circleCross: "ⓧ",
|
|
23147
|
+
circlePipe: "Ⓘ",
|
|
23148
|
+
radioOn: "◉",
|
|
23149
|
+
radioOff: "◯",
|
|
23150
|
+
checkboxOn: "☒",
|
|
23151
|
+
checkboxOff: "☐",
|
|
23152
|
+
checkboxCircleOn: "ⓧ",
|
|
23153
|
+
checkboxCircleOff: "Ⓘ",
|
|
23154
|
+
pointer: "❯",
|
|
23155
|
+
triangleUpOutline: "△",
|
|
23156
|
+
triangleLeft: "◀",
|
|
23157
|
+
triangleRight: "▶",
|
|
23158
|
+
lozenge: "◆",
|
|
23159
|
+
lozengeOutline: "◇",
|
|
23160
|
+
hamburger: "☰",
|
|
23161
|
+
smiley: "㋡",
|
|
23162
|
+
mustache: "෴",
|
|
23163
|
+
star: "★",
|
|
23164
|
+
play: "▶",
|
|
23165
|
+
nodejs: "⬢",
|
|
23166
|
+
oneSeventh: "⅐",
|
|
23167
|
+
oneNinth: "⅑",
|
|
23168
|
+
oneTenth: "⅒"
|
|
22920
23169
|
};
|
|
22921
|
-
const
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
22934
|
-
|
|
22935
|
-
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
23170
|
+
const specialFallbackSymbols$1 = {
|
|
23171
|
+
tick: "√",
|
|
23172
|
+
info: "i",
|
|
23173
|
+
warning: "‼",
|
|
23174
|
+
cross: "×",
|
|
23175
|
+
squareSmall: "□",
|
|
23176
|
+
squareSmallFilled: "■",
|
|
23177
|
+
circle: "( )",
|
|
23178
|
+
circleFilled: "(*)",
|
|
23179
|
+
circleDotted: "( )",
|
|
23180
|
+
circleDouble: "( )",
|
|
23181
|
+
circleCircle: "(○)",
|
|
23182
|
+
circleCross: "(×)",
|
|
23183
|
+
circlePipe: "(│)",
|
|
23184
|
+
radioOn: "(*)",
|
|
23185
|
+
radioOff: "( )",
|
|
23186
|
+
checkboxOn: "[×]",
|
|
23187
|
+
checkboxOff: "[ ]",
|
|
23188
|
+
checkboxCircleOn: "(×)",
|
|
23189
|
+
checkboxCircleOff: "( )",
|
|
23190
|
+
pointer: ">",
|
|
23191
|
+
triangleUpOutline: "∆",
|
|
23192
|
+
triangleLeft: "◄",
|
|
23193
|
+
triangleRight: "►",
|
|
23194
|
+
lozenge: "♦",
|
|
23195
|
+
lozengeOutline: "◊",
|
|
23196
|
+
hamburger: "≡",
|
|
23197
|
+
smiley: "☺",
|
|
23198
|
+
mustache: "┌─┐",
|
|
23199
|
+
star: "✶",
|
|
23200
|
+
play: "►",
|
|
23201
|
+
nodejs: "♦",
|
|
23202
|
+
oneSeventh: "1/7",
|
|
23203
|
+
oneNinth: "1/9",
|
|
23204
|
+
oneTenth: "1/10"
|
|
22940
23205
|
};
|
|
22941
|
-
const
|
|
22942
|
-
|
|
22943
|
-
|
|
22944
|
-
builder: (cmd) => cmd.positional("path", {
|
|
22945
|
-
type: "string",
|
|
22946
|
-
demandOption: true
|
|
22947
|
-
}),
|
|
22948
|
-
handler: validateCommand
|
|
23206
|
+
const mainSymbols$1 = {
|
|
23207
|
+
...common$1,
|
|
23208
|
+
...specialMainSymbols$1
|
|
22949
23209
|
};
|
|
22950
|
-
const
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
23210
|
+
const fallbackSymbols$1 = {
|
|
23211
|
+
...common$1,
|
|
23212
|
+
...specialFallbackSymbols$1
|
|
23213
|
+
};
|
|
23214
|
+
const shouldUseMain$1 = isUnicodeSupported$1();
|
|
23215
|
+
const figures$1 = shouldUseMain$1 ? mainSymbols$1 : fallbackSymbols$1;
|
|
23216
|
+
var esm_default = figures$1;
|
|
23217
|
+
const replacements$1 = Object.entries(specialMainSymbols$1);
|
|
23218
|
+
|
|
23219
|
+
//#endregion
|
|
23220
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
23221
|
+
const isUpKey = (key$1, keybindings = []) => key$1.name === "up" || keybindings.includes("vim") && key$1.name === "k" || keybindings.includes("emacs") && key$1.ctrl && key$1.name === "p";
|
|
23222
|
+
const isDownKey = (key$1, keybindings = []) => key$1.name === "down" || keybindings.includes("vim") && key$1.name === "j" || keybindings.includes("emacs") && key$1.ctrl && key$1.name === "n";
|
|
23223
|
+
const isSpaceKey = (key$1) => key$1.name === "space";
|
|
23224
|
+
const isNumberKey = (key$1) => "1234567890".includes(key$1.name);
|
|
23225
|
+
const isEnterKey = (key$1) => key$1.name === "enter" || key$1.name === "return";
|
|
23226
|
+
|
|
23227
|
+
//#endregion
|
|
23228
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
|
23229
|
+
var AbortPromptError = class extends Error {
|
|
23230
|
+
name = "AbortPromptError";
|
|
23231
|
+
message = "Prompt was aborted";
|
|
23232
|
+
constructor(options) {
|
|
23233
|
+
super();
|
|
23234
|
+
this.cause = options?.cause;
|
|
23235
|
+
}
|
|
23236
|
+
};
|
|
23237
|
+
var CancelPromptError = class extends Error {
|
|
23238
|
+
name = "CancelPromptError";
|
|
23239
|
+
message = "Prompt was canceled";
|
|
23240
|
+
};
|
|
23241
|
+
var ExitPromptError = class extends Error {
|
|
23242
|
+
name = "ExitPromptError";
|
|
23243
|
+
};
|
|
23244
|
+
var HookError = class extends Error {
|
|
23245
|
+
name = "HookError";
|
|
23246
|
+
};
|
|
23247
|
+
var ValidationError = class extends Error {
|
|
23248
|
+
name = "ValidationError";
|
|
23249
|
+
};
|
|
23250
|
+
|
|
23251
|
+
//#endregion
|
|
23252
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
|
23253
|
+
const hookStorage = new AsyncLocalStorage();
|
|
23254
|
+
function createStore(rl) {
|
|
23255
|
+
return {
|
|
23256
|
+
rl,
|
|
23257
|
+
hooks: [],
|
|
23258
|
+
hooksCleanup: [],
|
|
23259
|
+
hooksEffect: [],
|
|
23260
|
+
index: 0,
|
|
23261
|
+
handleChange() {}
|
|
23262
|
+
};
|
|
23263
|
+
}
|
|
23264
|
+
function withHooks(rl, cb) {
|
|
23265
|
+
const store = createStore(rl);
|
|
23266
|
+
return hookStorage.run(store, () => {
|
|
23267
|
+
function cycle(render) {
|
|
23268
|
+
store.handleChange = () => {
|
|
23269
|
+
store.index = 0;
|
|
23270
|
+
render();
|
|
23271
|
+
};
|
|
23272
|
+
store.handleChange();
|
|
23273
|
+
}
|
|
23274
|
+
return cb(cycle);
|
|
23275
|
+
});
|
|
23276
|
+
}
|
|
23277
|
+
function getStore() {
|
|
23278
|
+
const store = hookStorage.getStore();
|
|
23279
|
+
if (!store) throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
|
|
23280
|
+
return store;
|
|
23281
|
+
}
|
|
23282
|
+
function readline$1() {
|
|
23283
|
+
return getStore().rl;
|
|
23284
|
+
}
|
|
23285
|
+
function withUpdates(fn) {
|
|
23286
|
+
const wrapped = (...args) => {
|
|
23287
|
+
const store = getStore();
|
|
23288
|
+
let shouldUpdate = false;
|
|
23289
|
+
const oldHandleChange = store.handleChange;
|
|
23290
|
+
store.handleChange = () => {
|
|
23291
|
+
shouldUpdate = true;
|
|
23292
|
+
};
|
|
23293
|
+
const returnValue = fn(...args);
|
|
23294
|
+
if (shouldUpdate) oldHandleChange();
|
|
23295
|
+
store.handleChange = oldHandleChange;
|
|
23296
|
+
return returnValue;
|
|
23297
|
+
};
|
|
23298
|
+
return AsyncResource.bind(wrapped);
|
|
23299
|
+
}
|
|
23300
|
+
function withPointer(cb) {
|
|
23301
|
+
const store = getStore();
|
|
23302
|
+
const { index } = store;
|
|
23303
|
+
const returnValue = cb({
|
|
23304
|
+
get() {
|
|
23305
|
+
return store.hooks[index];
|
|
23306
|
+
},
|
|
23307
|
+
set(value) {
|
|
23308
|
+
store.hooks[index] = value;
|
|
23309
|
+
},
|
|
23310
|
+
initialized: index in store.hooks
|
|
23311
|
+
});
|
|
23312
|
+
store.index++;
|
|
23313
|
+
return returnValue;
|
|
23314
|
+
}
|
|
23315
|
+
function handleChange() {
|
|
23316
|
+
getStore().handleChange();
|
|
23317
|
+
}
|
|
23318
|
+
const effectScheduler = {
|
|
23319
|
+
queue(cb) {
|
|
23320
|
+
const store = getStore();
|
|
23321
|
+
const { index } = store;
|
|
23322
|
+
store.hooksEffect.push(() => {
|
|
23323
|
+
store.hooksCleanup[index]?.();
|
|
23324
|
+
const cleanFn = cb(readline$1());
|
|
23325
|
+
if (cleanFn != null && typeof cleanFn !== "function") throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
|
|
23326
|
+
store.hooksCleanup[index] = cleanFn;
|
|
23327
|
+
});
|
|
23328
|
+
},
|
|
23329
|
+
run() {
|
|
23330
|
+
const store = getStore();
|
|
23331
|
+
withUpdates(() => {
|
|
23332
|
+
store.hooksEffect.forEach((effect) => {
|
|
23333
|
+
effect();
|
|
23334
|
+
});
|
|
23335
|
+
store.hooksEffect.length = 0;
|
|
23336
|
+
})();
|
|
23337
|
+
},
|
|
23338
|
+
clearAll() {
|
|
23339
|
+
const store = getStore();
|
|
23340
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
|
23341
|
+
cleanFn?.();
|
|
23342
|
+
});
|
|
23343
|
+
store.hooksEffect.length = 0;
|
|
23344
|
+
store.hooksCleanup.length = 0;
|
|
23345
|
+
}
|
|
23346
|
+
};
|
|
23347
|
+
|
|
23348
|
+
//#endregion
|
|
23349
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
|
23350
|
+
function useState(defaultValue) {
|
|
23351
|
+
return withPointer((pointer) => {
|
|
23352
|
+
const setState = AsyncResource.bind(function setState$1(newValue) {
|
|
23353
|
+
if (pointer.get() !== newValue) {
|
|
23354
|
+
pointer.set(newValue);
|
|
23355
|
+
handleChange();
|
|
23356
|
+
}
|
|
23357
|
+
});
|
|
23358
|
+
if (pointer.initialized) return [pointer.get(), setState];
|
|
23359
|
+
const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
23360
|
+
pointer.set(value);
|
|
23361
|
+
return [value, setState];
|
|
23362
|
+
});
|
|
23363
|
+
}
|
|
23364
|
+
|
|
23365
|
+
//#endregion
|
|
23366
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
|
23367
|
+
function useEffect(cb, depArray) {
|
|
23368
|
+
withPointer((pointer) => {
|
|
23369
|
+
const oldDeps = pointer.get();
|
|
23370
|
+
if (!Array.isArray(oldDeps) || depArray.some((dep, i$3) => !Object.is(dep, oldDeps[i$3]))) effectScheduler.queue(cb);
|
|
23371
|
+
pointer.set(depArray);
|
|
23372
|
+
});
|
|
23373
|
+
}
|
|
23374
|
+
|
|
23375
|
+
//#endregion
|
|
23376
|
+
//#region node_modules/.pnpm/yoctocolors-cjs@2.1.3/node_modules/yoctocolors-cjs/index.js
|
|
23377
|
+
var require_yoctocolors_cjs = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/yoctocolors-cjs@2.1.3/node_modules/yoctocolors-cjs/index.js": ((exports, module) => {
|
|
23378
|
+
const hasColors = __require("node:tty")?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
23379
|
+
const format$1 = (open, close) => {
|
|
23380
|
+
if (!hasColors) return (input) => input;
|
|
23381
|
+
const openCode = `\u001B[${open}m`;
|
|
23382
|
+
const closeCode = `\u001B[${close}m`;
|
|
23383
|
+
return (input) => {
|
|
23384
|
+
const string = input + "";
|
|
23385
|
+
let index = string.indexOf(closeCode);
|
|
23386
|
+
if (index === -1) return openCode + string + closeCode;
|
|
23387
|
+
let result = openCode;
|
|
23388
|
+
let lastIndex = 0;
|
|
23389
|
+
const replaceCode = (close === 22 ? closeCode : "") + openCode;
|
|
23390
|
+
while (index !== -1) {
|
|
23391
|
+
result += string.slice(lastIndex, index) + replaceCode;
|
|
23392
|
+
lastIndex = index + closeCode.length;
|
|
23393
|
+
index = string.indexOf(closeCode, lastIndex);
|
|
23394
|
+
}
|
|
23395
|
+
result += string.slice(lastIndex) + closeCode;
|
|
23396
|
+
return result;
|
|
23397
|
+
};
|
|
23398
|
+
};
|
|
23399
|
+
const colors$2 = {};
|
|
23400
|
+
colors$2.reset = format$1(0, 0);
|
|
23401
|
+
colors$2.bold = format$1(1, 22);
|
|
23402
|
+
colors$2.dim = format$1(2, 22);
|
|
23403
|
+
colors$2.italic = format$1(3, 23);
|
|
23404
|
+
colors$2.underline = format$1(4, 24);
|
|
23405
|
+
colors$2.overline = format$1(53, 55);
|
|
23406
|
+
colors$2.inverse = format$1(7, 27);
|
|
23407
|
+
colors$2.hidden = format$1(8, 28);
|
|
23408
|
+
colors$2.strikethrough = format$1(9, 29);
|
|
23409
|
+
colors$2.black = format$1(30, 39);
|
|
23410
|
+
colors$2.red = format$1(31, 39);
|
|
23411
|
+
colors$2.green = format$1(32, 39);
|
|
23412
|
+
colors$2.yellow = format$1(33, 39);
|
|
23413
|
+
colors$2.blue = format$1(34, 39);
|
|
23414
|
+
colors$2.magenta = format$1(35, 39);
|
|
23415
|
+
colors$2.cyan = format$1(36, 39);
|
|
23416
|
+
colors$2.white = format$1(37, 39);
|
|
23417
|
+
colors$2.gray = format$1(90, 39);
|
|
23418
|
+
colors$2.bgBlack = format$1(40, 49);
|
|
23419
|
+
colors$2.bgRed = format$1(41, 49);
|
|
23420
|
+
colors$2.bgGreen = format$1(42, 49);
|
|
23421
|
+
colors$2.bgYellow = format$1(43, 49);
|
|
23422
|
+
colors$2.bgBlue = format$1(44, 49);
|
|
23423
|
+
colors$2.bgMagenta = format$1(45, 49);
|
|
23424
|
+
colors$2.bgCyan = format$1(46, 49);
|
|
23425
|
+
colors$2.bgWhite = format$1(47, 49);
|
|
23426
|
+
colors$2.bgGray = format$1(100, 49);
|
|
23427
|
+
colors$2.redBright = format$1(91, 39);
|
|
23428
|
+
colors$2.greenBright = format$1(92, 39);
|
|
23429
|
+
colors$2.yellowBright = format$1(93, 39);
|
|
23430
|
+
colors$2.blueBright = format$1(94, 39);
|
|
23431
|
+
colors$2.magentaBright = format$1(95, 39);
|
|
23432
|
+
colors$2.cyanBright = format$1(96, 39);
|
|
23433
|
+
colors$2.whiteBright = format$1(97, 39);
|
|
23434
|
+
colors$2.bgRedBright = format$1(101, 49);
|
|
23435
|
+
colors$2.bgGreenBright = format$1(102, 49);
|
|
23436
|
+
colors$2.bgYellowBright = format$1(103, 49);
|
|
23437
|
+
colors$2.bgBlueBright = format$1(104, 49);
|
|
23438
|
+
colors$2.bgMagentaBright = format$1(105, 49);
|
|
23439
|
+
colors$2.bgCyanBright = format$1(106, 49);
|
|
23440
|
+
colors$2.bgWhiteBright = format$1(107, 49);
|
|
23441
|
+
module.exports = colors$2;
|
|
23442
|
+
}) });
|
|
23443
|
+
|
|
23444
|
+
//#endregion
|
|
23445
|
+
//#region node_modules/.pnpm/@inquirer+figures@1.0.15/node_modules/@inquirer/figures/dist/esm/index.js
|
|
23446
|
+
function isUnicodeSupported() {
|
|
23447
|
+
if (process$1.platform !== "win32") return process$1.env["TERM"] !== "linux";
|
|
23448
|
+
return Boolean(process$1.env["WT_SESSION"]) || Boolean(process$1.env["TERMINUS_SUBLIME"]) || process$1.env["ConEmuTask"] === "{cmd::Cmder}" || process$1.env["TERM_PROGRAM"] === "Terminus-Sublime" || process$1.env["TERM_PROGRAM"] === "vscode" || process$1.env["TERM"] === "xterm-256color" || process$1.env["TERM"] === "alacritty" || process$1.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
23449
|
+
}
|
|
23450
|
+
const common = {
|
|
23451
|
+
circleQuestionMark: "(?)",
|
|
23452
|
+
questionMarkPrefix: "(?)",
|
|
23453
|
+
square: "█",
|
|
23454
|
+
squareDarkShade: "▓",
|
|
23455
|
+
squareMediumShade: "▒",
|
|
23456
|
+
squareLightShade: "░",
|
|
23457
|
+
squareTop: "▀",
|
|
23458
|
+
squareBottom: "▄",
|
|
23459
|
+
squareLeft: "▌",
|
|
23460
|
+
squareRight: "▐",
|
|
23461
|
+
squareCenter: "■",
|
|
23462
|
+
bullet: "●",
|
|
23463
|
+
dot: "․",
|
|
23464
|
+
ellipsis: "…",
|
|
23465
|
+
pointerSmall: "›",
|
|
23466
|
+
triangleUp: "▲",
|
|
23467
|
+
triangleUpSmall: "▴",
|
|
23468
|
+
triangleDown: "▼",
|
|
23469
|
+
triangleDownSmall: "▾",
|
|
23470
|
+
triangleLeftSmall: "◂",
|
|
23471
|
+
triangleRightSmall: "▸",
|
|
23472
|
+
home: "⌂",
|
|
23473
|
+
heart: "♥",
|
|
23474
|
+
musicNote: "♪",
|
|
23475
|
+
musicNoteBeamed: "♫",
|
|
23476
|
+
arrowUp: "↑",
|
|
23477
|
+
arrowDown: "↓",
|
|
23478
|
+
arrowLeft: "←",
|
|
23479
|
+
arrowRight: "→",
|
|
23480
|
+
arrowLeftRight: "↔",
|
|
23481
|
+
arrowUpDown: "↕",
|
|
23482
|
+
almostEqual: "≈",
|
|
23483
|
+
notEqual: "≠",
|
|
23484
|
+
lessOrEqual: "≤",
|
|
23485
|
+
greaterOrEqual: "≥",
|
|
23486
|
+
identical: "≡",
|
|
23487
|
+
infinity: "∞",
|
|
23488
|
+
subscriptZero: "₀",
|
|
23489
|
+
subscriptOne: "₁",
|
|
23490
|
+
subscriptTwo: "₂",
|
|
23491
|
+
subscriptThree: "₃",
|
|
23492
|
+
subscriptFour: "₄",
|
|
23493
|
+
subscriptFive: "₅",
|
|
23494
|
+
subscriptSix: "₆",
|
|
23495
|
+
subscriptSeven: "₇",
|
|
23496
|
+
subscriptEight: "₈",
|
|
23497
|
+
subscriptNine: "₉",
|
|
23498
|
+
oneHalf: "½",
|
|
23499
|
+
oneThird: "⅓",
|
|
23500
|
+
oneQuarter: "¼",
|
|
23501
|
+
oneFifth: "⅕",
|
|
23502
|
+
oneSixth: "⅙",
|
|
23503
|
+
oneEighth: "⅛",
|
|
23504
|
+
twoThirds: "⅔",
|
|
23505
|
+
twoFifths: "⅖",
|
|
23506
|
+
threeQuarters: "¾",
|
|
23507
|
+
threeFifths: "⅗",
|
|
23508
|
+
threeEighths: "⅜",
|
|
23509
|
+
fourFifths: "⅘",
|
|
23510
|
+
fiveSixths: "⅚",
|
|
23511
|
+
fiveEighths: "⅝",
|
|
23512
|
+
sevenEighths: "⅞",
|
|
23513
|
+
line: "─",
|
|
23514
|
+
lineBold: "━",
|
|
23515
|
+
lineDouble: "═",
|
|
23516
|
+
lineDashed0: "┄",
|
|
23517
|
+
lineDashed1: "┅",
|
|
23518
|
+
lineDashed2: "┈",
|
|
23519
|
+
lineDashed3: "┉",
|
|
23520
|
+
lineDashed4: "╌",
|
|
23521
|
+
lineDashed5: "╍",
|
|
23522
|
+
lineDashed6: "╴",
|
|
23523
|
+
lineDashed7: "╶",
|
|
23524
|
+
lineDashed8: "╸",
|
|
23525
|
+
lineDashed9: "╺",
|
|
23526
|
+
lineDashed10: "╼",
|
|
23527
|
+
lineDashed11: "╾",
|
|
23528
|
+
lineDashed12: "−",
|
|
23529
|
+
lineDashed13: "–",
|
|
23530
|
+
lineDashed14: "‐",
|
|
23531
|
+
lineDashed15: "⁃",
|
|
23532
|
+
lineVertical: "│",
|
|
23533
|
+
lineVerticalBold: "┃",
|
|
23534
|
+
lineVerticalDouble: "║",
|
|
23535
|
+
lineVerticalDashed0: "┆",
|
|
23536
|
+
lineVerticalDashed1: "┇",
|
|
23537
|
+
lineVerticalDashed2: "┊",
|
|
23538
|
+
lineVerticalDashed3: "┋",
|
|
23539
|
+
lineVerticalDashed4: "╎",
|
|
23540
|
+
lineVerticalDashed5: "╏",
|
|
23541
|
+
lineVerticalDashed6: "╵",
|
|
23542
|
+
lineVerticalDashed7: "╷",
|
|
23543
|
+
lineVerticalDashed8: "╹",
|
|
23544
|
+
lineVerticalDashed9: "╻",
|
|
23545
|
+
lineVerticalDashed10: "╽",
|
|
23546
|
+
lineVerticalDashed11: "╿",
|
|
23547
|
+
lineDownLeft: "┐",
|
|
23548
|
+
lineDownLeftArc: "╮",
|
|
23549
|
+
lineDownBoldLeftBold: "┓",
|
|
23550
|
+
lineDownBoldLeft: "┒",
|
|
23551
|
+
lineDownLeftBold: "┑",
|
|
23552
|
+
lineDownDoubleLeftDouble: "╗",
|
|
23553
|
+
lineDownDoubleLeft: "╖",
|
|
23554
|
+
lineDownLeftDouble: "╕",
|
|
23555
|
+
lineDownRight: "┌",
|
|
23556
|
+
lineDownRightArc: "╭",
|
|
23557
|
+
lineDownBoldRightBold: "┏",
|
|
23558
|
+
lineDownBoldRight: "┎",
|
|
23559
|
+
lineDownRightBold: "┍",
|
|
23560
|
+
lineDownDoubleRightDouble: "╔",
|
|
23561
|
+
lineDownDoubleRight: "╓",
|
|
23562
|
+
lineDownRightDouble: "╒",
|
|
23563
|
+
lineUpLeft: "┘",
|
|
23564
|
+
lineUpLeftArc: "╯",
|
|
23565
|
+
lineUpBoldLeftBold: "┛",
|
|
23566
|
+
lineUpBoldLeft: "┚",
|
|
23567
|
+
lineUpLeftBold: "┙",
|
|
23568
|
+
lineUpDoubleLeftDouble: "╝",
|
|
23569
|
+
lineUpDoubleLeft: "╜",
|
|
23570
|
+
lineUpLeftDouble: "╛",
|
|
23571
|
+
lineUpRight: "└",
|
|
23572
|
+
lineUpRightArc: "╰",
|
|
23573
|
+
lineUpBoldRightBold: "┗",
|
|
23574
|
+
lineUpBoldRight: "┖",
|
|
23575
|
+
lineUpRightBold: "┕",
|
|
23576
|
+
lineUpDoubleRightDouble: "╚",
|
|
23577
|
+
lineUpDoubleRight: "╙",
|
|
23578
|
+
lineUpRightDouble: "╘",
|
|
23579
|
+
lineUpDownLeft: "┤",
|
|
23580
|
+
lineUpBoldDownBoldLeftBold: "┫",
|
|
23581
|
+
lineUpBoldDownBoldLeft: "┨",
|
|
23582
|
+
lineUpDownLeftBold: "┥",
|
|
23583
|
+
lineUpBoldDownLeftBold: "┩",
|
|
23584
|
+
lineUpDownBoldLeftBold: "┪",
|
|
23585
|
+
lineUpDownBoldLeft: "┧",
|
|
23586
|
+
lineUpBoldDownLeft: "┦",
|
|
23587
|
+
lineUpDoubleDownDoubleLeftDouble: "╣",
|
|
23588
|
+
lineUpDoubleDownDoubleLeft: "╢",
|
|
23589
|
+
lineUpDownLeftDouble: "╡",
|
|
23590
|
+
lineUpDownRight: "├",
|
|
23591
|
+
lineUpBoldDownBoldRightBold: "┣",
|
|
23592
|
+
lineUpBoldDownBoldRight: "┠",
|
|
23593
|
+
lineUpDownRightBold: "┝",
|
|
23594
|
+
lineUpBoldDownRightBold: "┡",
|
|
23595
|
+
lineUpDownBoldRightBold: "┢",
|
|
23596
|
+
lineUpDownBoldRight: "┟",
|
|
23597
|
+
lineUpBoldDownRight: "┞",
|
|
23598
|
+
lineUpDoubleDownDoubleRightDouble: "╠",
|
|
23599
|
+
lineUpDoubleDownDoubleRight: "╟",
|
|
23600
|
+
lineUpDownRightDouble: "╞",
|
|
23601
|
+
lineDownLeftRight: "┬",
|
|
23602
|
+
lineDownBoldLeftBoldRightBold: "┳",
|
|
23603
|
+
lineDownLeftBoldRightBold: "┯",
|
|
23604
|
+
lineDownBoldLeftRight: "┰",
|
|
23605
|
+
lineDownBoldLeftBoldRight: "┱",
|
|
23606
|
+
lineDownBoldLeftRightBold: "┲",
|
|
23607
|
+
lineDownLeftRightBold: "┮",
|
|
23608
|
+
lineDownLeftBoldRight: "┭",
|
|
23609
|
+
lineDownDoubleLeftDoubleRightDouble: "╦",
|
|
23610
|
+
lineDownDoubleLeftRight: "╥",
|
|
23611
|
+
lineDownLeftDoubleRightDouble: "╤",
|
|
23612
|
+
lineUpLeftRight: "┴",
|
|
23613
|
+
lineUpBoldLeftBoldRightBold: "┻",
|
|
23614
|
+
lineUpLeftBoldRightBold: "┷",
|
|
23615
|
+
lineUpBoldLeftRight: "┸",
|
|
23616
|
+
lineUpBoldLeftBoldRight: "┹",
|
|
23617
|
+
lineUpBoldLeftRightBold: "┺",
|
|
23618
|
+
lineUpLeftRightBold: "┶",
|
|
23619
|
+
lineUpLeftBoldRight: "┵",
|
|
23620
|
+
lineUpDoubleLeftDoubleRightDouble: "╩",
|
|
23621
|
+
lineUpDoubleLeftRight: "╨",
|
|
23622
|
+
lineUpLeftDoubleRightDouble: "╧",
|
|
23623
|
+
lineUpDownLeftRight: "┼",
|
|
23624
|
+
lineUpBoldDownBoldLeftBoldRightBold: "╋",
|
|
23625
|
+
lineUpDownBoldLeftBoldRightBold: "╈",
|
|
23626
|
+
lineUpBoldDownLeftBoldRightBold: "╇",
|
|
23627
|
+
lineUpBoldDownBoldLeftRightBold: "╊",
|
|
23628
|
+
lineUpBoldDownBoldLeftBoldRight: "╉",
|
|
23629
|
+
lineUpBoldDownLeftRight: "╀",
|
|
23630
|
+
lineUpDownBoldLeftRight: "╁",
|
|
23631
|
+
lineUpDownLeftBoldRight: "┽",
|
|
23632
|
+
lineUpDownLeftRightBold: "┾",
|
|
23633
|
+
lineUpBoldDownBoldLeftRight: "╂",
|
|
23634
|
+
lineUpDownLeftBoldRightBold: "┿",
|
|
23635
|
+
lineUpBoldDownLeftBoldRight: "╃",
|
|
23636
|
+
lineUpBoldDownLeftRightBold: "╄",
|
|
23637
|
+
lineUpDownBoldLeftBoldRight: "╅",
|
|
23638
|
+
lineUpDownBoldLeftRightBold: "╆",
|
|
23639
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
|
|
23640
|
+
lineUpDoubleDownDoubleLeftRight: "╫",
|
|
23641
|
+
lineUpDownLeftDoubleRightDouble: "╪",
|
|
23642
|
+
lineCross: "╳",
|
|
23643
|
+
lineBackslash: "╲",
|
|
23644
|
+
lineSlash: "╱"
|
|
23645
|
+
};
|
|
23646
|
+
const specialMainSymbols = {
|
|
23647
|
+
tick: "✔",
|
|
23648
|
+
info: "ℹ",
|
|
23649
|
+
warning: "⚠",
|
|
23650
|
+
cross: "✘",
|
|
23651
|
+
squareSmall: "◻",
|
|
23652
|
+
squareSmallFilled: "◼",
|
|
23653
|
+
circle: "◯",
|
|
23654
|
+
circleFilled: "◉",
|
|
23655
|
+
circleDotted: "◌",
|
|
23656
|
+
circleDouble: "◎",
|
|
23657
|
+
circleCircle: "ⓞ",
|
|
23658
|
+
circleCross: "ⓧ",
|
|
23659
|
+
circlePipe: "Ⓘ",
|
|
23660
|
+
radioOn: "◉",
|
|
23661
|
+
radioOff: "◯",
|
|
23662
|
+
checkboxOn: "☒",
|
|
23663
|
+
checkboxOff: "☐",
|
|
23664
|
+
checkboxCircleOn: "ⓧ",
|
|
23665
|
+
checkboxCircleOff: "Ⓘ",
|
|
23666
|
+
pointer: "❯",
|
|
23667
|
+
triangleUpOutline: "△",
|
|
23668
|
+
triangleLeft: "◀",
|
|
23669
|
+
triangleRight: "▶",
|
|
23670
|
+
lozenge: "◆",
|
|
23671
|
+
lozengeOutline: "◇",
|
|
23672
|
+
hamburger: "☰",
|
|
23673
|
+
smiley: "㋡",
|
|
23674
|
+
mustache: "෴",
|
|
23675
|
+
star: "★",
|
|
23676
|
+
play: "▶",
|
|
23677
|
+
nodejs: "⬢",
|
|
23678
|
+
oneSeventh: "⅐",
|
|
23679
|
+
oneNinth: "⅑",
|
|
23680
|
+
oneTenth: "⅒"
|
|
23681
|
+
};
|
|
23682
|
+
const specialFallbackSymbols = {
|
|
23683
|
+
tick: "√",
|
|
23684
|
+
info: "i",
|
|
23685
|
+
warning: "‼",
|
|
23686
|
+
cross: "×",
|
|
23687
|
+
squareSmall: "□",
|
|
23688
|
+
squareSmallFilled: "■",
|
|
23689
|
+
circle: "( )",
|
|
23690
|
+
circleFilled: "(*)",
|
|
23691
|
+
circleDotted: "( )",
|
|
23692
|
+
circleDouble: "( )",
|
|
23693
|
+
circleCircle: "(○)",
|
|
23694
|
+
circleCross: "(×)",
|
|
23695
|
+
circlePipe: "(│)",
|
|
23696
|
+
radioOn: "(*)",
|
|
23697
|
+
radioOff: "( )",
|
|
23698
|
+
checkboxOn: "[×]",
|
|
23699
|
+
checkboxOff: "[ ]",
|
|
23700
|
+
checkboxCircleOn: "(×)",
|
|
23701
|
+
checkboxCircleOff: "( )",
|
|
23702
|
+
pointer: ">",
|
|
23703
|
+
triangleUpOutline: "∆",
|
|
23704
|
+
triangleLeft: "◄",
|
|
23705
|
+
triangleRight: "►",
|
|
23706
|
+
lozenge: "♦",
|
|
23707
|
+
lozengeOutline: "◊",
|
|
23708
|
+
hamburger: "≡",
|
|
23709
|
+
smiley: "☺",
|
|
23710
|
+
mustache: "┌─┐",
|
|
23711
|
+
star: "✶",
|
|
23712
|
+
play: "►",
|
|
23713
|
+
nodejs: "♦",
|
|
23714
|
+
oneSeventh: "1/7",
|
|
23715
|
+
oneNinth: "1/9",
|
|
23716
|
+
oneTenth: "1/10"
|
|
23717
|
+
};
|
|
23718
|
+
const mainSymbols = {
|
|
23719
|
+
...common,
|
|
23720
|
+
...specialMainSymbols
|
|
23721
|
+
};
|
|
23722
|
+
const fallbackSymbols = {
|
|
23723
|
+
...common,
|
|
23724
|
+
...specialFallbackSymbols
|
|
23725
|
+
};
|
|
23726
|
+
const shouldUseMain = isUnicodeSupported();
|
|
23727
|
+
const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
23728
|
+
var esm_default$1 = figures;
|
|
23729
|
+
const replacements = Object.entries(specialMainSymbols);
|
|
23730
|
+
|
|
23731
|
+
//#endregion
|
|
23732
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
23733
|
+
var import_yoctocolors_cjs$1 = /* @__PURE__ */ __toESM(require_yoctocolors_cjs(), 1);
|
|
23734
|
+
const defaultTheme = {
|
|
23735
|
+
prefix: {
|
|
23736
|
+
idle: import_yoctocolors_cjs$1.default.blue("?"),
|
|
23737
|
+
done: import_yoctocolors_cjs$1.default.green(esm_default$1.tick)
|
|
23738
|
+
},
|
|
23739
|
+
spinner: {
|
|
23740
|
+
interval: 80,
|
|
23741
|
+
frames: [
|
|
23742
|
+
"⠋",
|
|
23743
|
+
"⠙",
|
|
23744
|
+
"⠹",
|
|
23745
|
+
"⠸",
|
|
23746
|
+
"⠼",
|
|
23747
|
+
"⠴",
|
|
23748
|
+
"⠦",
|
|
23749
|
+
"⠧",
|
|
23750
|
+
"⠇",
|
|
23751
|
+
"⠏"
|
|
23752
|
+
].map((frame) => import_yoctocolors_cjs$1.default.yellow(frame))
|
|
23753
|
+
},
|
|
23754
|
+
style: {
|
|
23755
|
+
answer: import_yoctocolors_cjs$1.default.cyan,
|
|
23756
|
+
message: import_yoctocolors_cjs$1.default.bold,
|
|
23757
|
+
error: (text) => import_yoctocolors_cjs$1.default.red(`> ${text}`),
|
|
23758
|
+
defaultAnswer: (text) => import_yoctocolors_cjs$1.default.dim(`(${text})`),
|
|
23759
|
+
help: import_yoctocolors_cjs$1.default.dim,
|
|
23760
|
+
highlight: import_yoctocolors_cjs$1.default.cyan,
|
|
23761
|
+
key: (text) => import_yoctocolors_cjs$1.default.cyan(import_yoctocolors_cjs$1.default.bold(`<${text}>`))
|
|
23762
|
+
}
|
|
23763
|
+
};
|
|
23764
|
+
|
|
23765
|
+
//#endregion
|
|
23766
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
|
23767
|
+
function isPlainObject(value) {
|
|
23768
|
+
if (typeof value !== "object" || value === null) return false;
|
|
23769
|
+
let proto = value;
|
|
23770
|
+
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
23771
|
+
return Object.getPrototypeOf(value) === proto;
|
|
23772
|
+
}
|
|
23773
|
+
function deepMerge(...objects) {
|
|
23774
|
+
const output = {};
|
|
23775
|
+
for (const obj of objects) for (const [key$1, value] of Object.entries(obj)) {
|
|
23776
|
+
const prevValue = output[key$1];
|
|
23777
|
+
output[key$1] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
|
|
23778
|
+
}
|
|
23779
|
+
return output;
|
|
23780
|
+
}
|
|
23781
|
+
function makeTheme(...themes) {
|
|
23782
|
+
return deepMerge(...[defaultTheme, ...themes.filter((theme) => theme != null)]);
|
|
23783
|
+
}
|
|
23784
|
+
|
|
23785
|
+
//#endregion
|
|
23786
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
|
23787
|
+
function usePrefix({ status: status$1 = "idle", theme }) {
|
|
23788
|
+
const [showLoader, setShowLoader] = useState(false);
|
|
23789
|
+
const [tick, setTick] = useState(0);
|
|
23790
|
+
const { prefix, spinner } = makeTheme(theme);
|
|
23791
|
+
useEffect(() => {
|
|
23792
|
+
if (status$1 === "loading") {
|
|
23793
|
+
let tickInterval;
|
|
23794
|
+
let inc = -1;
|
|
23795
|
+
const delayTimeout = setTimeout(() => {
|
|
23796
|
+
setShowLoader(true);
|
|
23797
|
+
tickInterval = setInterval(() => {
|
|
23798
|
+
inc = inc + 1;
|
|
23799
|
+
setTick(inc % spinner.frames.length);
|
|
23800
|
+
}, spinner.interval);
|
|
23801
|
+
}, 300);
|
|
23802
|
+
return () => {
|
|
23803
|
+
clearTimeout(delayTimeout);
|
|
23804
|
+
clearInterval(tickInterval);
|
|
23805
|
+
};
|
|
23806
|
+
} else setShowLoader(false);
|
|
23807
|
+
}, [status$1]);
|
|
23808
|
+
if (showLoader) return spinner.frames[tick];
|
|
23809
|
+
return typeof prefix === "string" ? prefix : prefix[status$1 === "loading" ? "idle" : status$1] ?? prefix["idle"];
|
|
23810
|
+
}
|
|
23811
|
+
|
|
23812
|
+
//#endregion
|
|
23813
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
|
23814
|
+
function useMemo(fn, dependencies) {
|
|
23815
|
+
return withPointer((pointer) => {
|
|
23816
|
+
const prev = pointer.get();
|
|
23817
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i$3) => dep !== dependencies[i$3])) {
|
|
23818
|
+
const value = fn();
|
|
23819
|
+
pointer.set({
|
|
23820
|
+
value,
|
|
23821
|
+
dependencies
|
|
23822
|
+
});
|
|
23823
|
+
return value;
|
|
23824
|
+
}
|
|
23825
|
+
return prev.value;
|
|
23826
|
+
});
|
|
23827
|
+
}
|
|
23828
|
+
|
|
23829
|
+
//#endregion
|
|
23830
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
|
23831
|
+
function useRef(val) {
|
|
23832
|
+
return useState({ current: val })[0];
|
|
23833
|
+
}
|
|
23834
|
+
|
|
23835
|
+
//#endregion
|
|
23836
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
|
23837
|
+
function useKeypress(userHandler) {
|
|
23838
|
+
const signal = useRef(userHandler);
|
|
23839
|
+
signal.current = userHandler;
|
|
23840
|
+
useEffect((rl) => {
|
|
23841
|
+
let ignore = false;
|
|
23842
|
+
const handler = withUpdates((_input, event) => {
|
|
23843
|
+
if (ignore) return;
|
|
23844
|
+
signal.current(event, rl);
|
|
23845
|
+
});
|
|
23846
|
+
rl.input.on("keypress", handler);
|
|
23847
|
+
return () => {
|
|
23848
|
+
ignore = true;
|
|
23849
|
+
rl.input.removeListener("keypress", handler);
|
|
23850
|
+
};
|
|
23851
|
+
}, []);
|
|
23852
|
+
}
|
|
23853
|
+
|
|
23854
|
+
//#endregion
|
|
23855
|
+
//#region node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
23856
|
+
var require_cli_width = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js": ((exports, module) => {
|
|
23857
|
+
module.exports = cliWidth$1;
|
|
23858
|
+
function normalizeOpts(options) {
|
|
23859
|
+
const defaultOpts = {
|
|
23860
|
+
defaultWidth: 0,
|
|
23861
|
+
output: process.stdout,
|
|
23862
|
+
tty: __require("tty")
|
|
23863
|
+
};
|
|
23864
|
+
if (!options) return defaultOpts;
|
|
23865
|
+
Object.keys(defaultOpts).forEach(function(key$1) {
|
|
23866
|
+
if (!options[key$1]) options[key$1] = defaultOpts[key$1];
|
|
23867
|
+
});
|
|
23868
|
+
return options;
|
|
23869
|
+
}
|
|
23870
|
+
function cliWidth$1(options) {
|
|
23871
|
+
const opts = normalizeOpts(options);
|
|
23872
|
+
if (opts.output.getWindowSize) return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
23873
|
+
if (opts.tty.getWindowSize) return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
23874
|
+
if (opts.output.columns) return opts.output.columns;
|
|
23875
|
+
if (process.env.CLI_WIDTH) {
|
|
23876
|
+
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
23877
|
+
if (!isNaN(width) && width !== 0) return width;
|
|
23878
|
+
}
|
|
23879
|
+
return opts.defaultWidth;
|
|
23880
|
+
}
|
|
23881
|
+
}) });
|
|
23882
|
+
|
|
23883
|
+
//#endregion
|
|
23884
|
+
//#region node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
|
|
23885
|
+
var require_ansi_regex = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js": ((exports, module) => {
|
|
23886
|
+
module.exports = ({ onlyFirst = false } = {}) => {
|
|
23887
|
+
const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
23888
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
23889
|
+
};
|
|
23890
|
+
}) });
|
|
23891
|
+
|
|
23892
|
+
//#endregion
|
|
23893
|
+
//#region node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
|
|
23894
|
+
var require_strip_ansi = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js": ((exports, module) => {
|
|
23895
|
+
const ansiRegex = require_ansi_regex();
|
|
23896
|
+
module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string;
|
|
23897
|
+
}) });
|
|
23898
|
+
|
|
23899
|
+
//#endregion
|
|
23900
|
+
//#region node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
23901
|
+
var require_is_fullwidth_code_point = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": ((exports, module) => {
|
|
23902
|
+
const isFullwidthCodePoint$1 = (codePoint) => {
|
|
23903
|
+
if (Number.isNaN(codePoint)) return false;
|
|
23904
|
+
if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) return true;
|
|
23905
|
+
return false;
|
|
23906
|
+
};
|
|
23907
|
+
module.exports = isFullwidthCodePoint$1;
|
|
23908
|
+
module.exports.default = isFullwidthCodePoint$1;
|
|
23909
|
+
}) });
|
|
23910
|
+
|
|
23911
|
+
//#endregion
|
|
23912
|
+
//#region node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
|
|
23913
|
+
var require_emoji_regex = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js": ((exports, module) => {
|
|
23914
|
+
module.exports = function() {
|
|
23915
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
23916
|
+
};
|
|
23917
|
+
}) });
|
|
23918
|
+
|
|
23919
|
+
//#endregion
|
|
23920
|
+
//#region node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
|
|
23921
|
+
var require_string_width = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js": ((exports, module) => {
|
|
23922
|
+
const stripAnsi$1 = require_strip_ansi();
|
|
23923
|
+
const isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
23924
|
+
const emojiRegex = require_emoji_regex();
|
|
23925
|
+
const stringWidth$1 = (string) => {
|
|
23926
|
+
if (typeof string !== "string" || string.length === 0) return 0;
|
|
23927
|
+
string = stripAnsi$1(string);
|
|
23928
|
+
if (string.length === 0) return 0;
|
|
23929
|
+
string = string.replace(emojiRegex(), " ");
|
|
23930
|
+
let width = 0;
|
|
23931
|
+
for (let i$3 = 0; i$3 < string.length; i$3++) {
|
|
23932
|
+
const code = string.codePointAt(i$3);
|
|
23933
|
+
if (code <= 31 || code >= 127 && code <= 159) continue;
|
|
23934
|
+
if (code >= 768 && code <= 879) continue;
|
|
23935
|
+
if (code > 65535) i$3++;
|
|
23936
|
+
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
23937
|
+
}
|
|
23938
|
+
return width;
|
|
23939
|
+
};
|
|
23940
|
+
module.exports = stringWidth$1;
|
|
23941
|
+
module.exports.default = stringWidth$1;
|
|
23942
|
+
}) });
|
|
23943
|
+
|
|
23944
|
+
//#endregion
|
|
23945
|
+
//#region node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
|
|
23946
|
+
var require_color_name = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js": ((exports, module) => {
|
|
23947
|
+
module.exports = {
|
|
23948
|
+
"aliceblue": [
|
|
23949
|
+
240,
|
|
23950
|
+
248,
|
|
23951
|
+
255
|
|
23952
|
+
],
|
|
23953
|
+
"antiquewhite": [
|
|
23954
|
+
250,
|
|
23955
|
+
235,
|
|
23956
|
+
215
|
|
23957
|
+
],
|
|
23958
|
+
"aqua": [
|
|
23959
|
+
0,
|
|
23960
|
+
255,
|
|
23961
|
+
255
|
|
23962
|
+
],
|
|
23963
|
+
"aquamarine": [
|
|
23964
|
+
127,
|
|
23965
|
+
255,
|
|
23966
|
+
212
|
|
23967
|
+
],
|
|
23968
|
+
"azure": [
|
|
23969
|
+
240,
|
|
23970
|
+
255,
|
|
23971
|
+
255
|
|
23972
|
+
],
|
|
23973
|
+
"beige": [
|
|
23974
|
+
245,
|
|
23975
|
+
245,
|
|
23976
|
+
220
|
|
23977
|
+
],
|
|
23978
|
+
"bisque": [
|
|
23979
|
+
255,
|
|
23980
|
+
228,
|
|
23981
|
+
196
|
|
23982
|
+
],
|
|
23983
|
+
"black": [
|
|
23984
|
+
0,
|
|
23985
|
+
0,
|
|
23986
|
+
0
|
|
23987
|
+
],
|
|
23988
|
+
"blanchedalmond": [
|
|
23989
|
+
255,
|
|
23990
|
+
235,
|
|
23991
|
+
205
|
|
23992
|
+
],
|
|
23993
|
+
"blue": [
|
|
23994
|
+
0,
|
|
23995
|
+
0,
|
|
23996
|
+
255
|
|
23997
|
+
],
|
|
23998
|
+
"blueviolet": [
|
|
23999
|
+
138,
|
|
24000
|
+
43,
|
|
24001
|
+
226
|
|
24002
|
+
],
|
|
24003
|
+
"brown": [
|
|
24004
|
+
165,
|
|
24005
|
+
42,
|
|
24006
|
+
42
|
|
24007
|
+
],
|
|
24008
|
+
"burlywood": [
|
|
24009
|
+
222,
|
|
24010
|
+
184,
|
|
24011
|
+
135
|
|
24012
|
+
],
|
|
24013
|
+
"cadetblue": [
|
|
24014
|
+
95,
|
|
24015
|
+
158,
|
|
24016
|
+
160
|
|
24017
|
+
],
|
|
24018
|
+
"chartreuse": [
|
|
24019
|
+
127,
|
|
24020
|
+
255,
|
|
24021
|
+
0
|
|
24022
|
+
],
|
|
24023
|
+
"chocolate": [
|
|
24024
|
+
210,
|
|
24025
|
+
105,
|
|
24026
|
+
30
|
|
24027
|
+
],
|
|
24028
|
+
"coral": [
|
|
24029
|
+
255,
|
|
24030
|
+
127,
|
|
24031
|
+
80
|
|
24032
|
+
],
|
|
24033
|
+
"cornflowerblue": [
|
|
24034
|
+
100,
|
|
24035
|
+
149,
|
|
24036
|
+
237
|
|
24037
|
+
],
|
|
24038
|
+
"cornsilk": [
|
|
24039
|
+
255,
|
|
24040
|
+
248,
|
|
24041
|
+
220
|
|
24042
|
+
],
|
|
24043
|
+
"crimson": [
|
|
24044
|
+
220,
|
|
24045
|
+
20,
|
|
24046
|
+
60
|
|
24047
|
+
],
|
|
24048
|
+
"cyan": [
|
|
24049
|
+
0,
|
|
24050
|
+
255,
|
|
24051
|
+
255
|
|
24052
|
+
],
|
|
24053
|
+
"darkblue": [
|
|
24054
|
+
0,
|
|
24055
|
+
0,
|
|
24056
|
+
139
|
|
24057
|
+
],
|
|
24058
|
+
"darkcyan": [
|
|
24059
|
+
0,
|
|
24060
|
+
139,
|
|
24061
|
+
139
|
|
24062
|
+
],
|
|
24063
|
+
"darkgoldenrod": [
|
|
24064
|
+
184,
|
|
24065
|
+
134,
|
|
24066
|
+
11
|
|
24067
|
+
],
|
|
24068
|
+
"darkgray": [
|
|
24069
|
+
169,
|
|
24070
|
+
169,
|
|
24071
|
+
169
|
|
24072
|
+
],
|
|
24073
|
+
"darkgreen": [
|
|
24074
|
+
0,
|
|
24075
|
+
100,
|
|
24076
|
+
0
|
|
24077
|
+
],
|
|
24078
|
+
"darkgrey": [
|
|
24079
|
+
169,
|
|
24080
|
+
169,
|
|
24081
|
+
169
|
|
24082
|
+
],
|
|
24083
|
+
"darkkhaki": [
|
|
24084
|
+
189,
|
|
24085
|
+
183,
|
|
24086
|
+
107
|
|
24087
|
+
],
|
|
24088
|
+
"darkmagenta": [
|
|
24089
|
+
139,
|
|
24090
|
+
0,
|
|
24091
|
+
139
|
|
24092
|
+
],
|
|
24093
|
+
"darkolivegreen": [
|
|
24094
|
+
85,
|
|
24095
|
+
107,
|
|
24096
|
+
47
|
|
24097
|
+
],
|
|
24098
|
+
"darkorange": [
|
|
24099
|
+
255,
|
|
24100
|
+
140,
|
|
24101
|
+
0
|
|
24102
|
+
],
|
|
24103
|
+
"darkorchid": [
|
|
24104
|
+
153,
|
|
24105
|
+
50,
|
|
24106
|
+
204
|
|
24107
|
+
],
|
|
24108
|
+
"darkred": [
|
|
24109
|
+
139,
|
|
24110
|
+
0,
|
|
24111
|
+
0
|
|
24112
|
+
],
|
|
24113
|
+
"darksalmon": [
|
|
24114
|
+
233,
|
|
24115
|
+
150,
|
|
24116
|
+
122
|
|
24117
|
+
],
|
|
24118
|
+
"darkseagreen": [
|
|
24119
|
+
143,
|
|
24120
|
+
188,
|
|
24121
|
+
143
|
|
24122
|
+
],
|
|
24123
|
+
"darkslateblue": [
|
|
24124
|
+
72,
|
|
24125
|
+
61,
|
|
24126
|
+
139
|
|
24127
|
+
],
|
|
24128
|
+
"darkslategray": [
|
|
24129
|
+
47,
|
|
24130
|
+
79,
|
|
24131
|
+
79
|
|
24132
|
+
],
|
|
24133
|
+
"darkslategrey": [
|
|
24134
|
+
47,
|
|
24135
|
+
79,
|
|
24136
|
+
79
|
|
24137
|
+
],
|
|
24138
|
+
"darkturquoise": [
|
|
24139
|
+
0,
|
|
24140
|
+
206,
|
|
24141
|
+
209
|
|
24142
|
+
],
|
|
24143
|
+
"darkviolet": [
|
|
24144
|
+
148,
|
|
24145
|
+
0,
|
|
24146
|
+
211
|
|
24147
|
+
],
|
|
24148
|
+
"deeppink": [
|
|
24149
|
+
255,
|
|
24150
|
+
20,
|
|
24151
|
+
147
|
|
24152
|
+
],
|
|
24153
|
+
"deepskyblue": [
|
|
24154
|
+
0,
|
|
24155
|
+
191,
|
|
24156
|
+
255
|
|
24157
|
+
],
|
|
24158
|
+
"dimgray": [
|
|
24159
|
+
105,
|
|
24160
|
+
105,
|
|
24161
|
+
105
|
|
24162
|
+
],
|
|
24163
|
+
"dimgrey": [
|
|
24164
|
+
105,
|
|
24165
|
+
105,
|
|
24166
|
+
105
|
|
24167
|
+
],
|
|
24168
|
+
"dodgerblue": [
|
|
24169
|
+
30,
|
|
24170
|
+
144,
|
|
24171
|
+
255
|
|
24172
|
+
],
|
|
24173
|
+
"firebrick": [
|
|
24174
|
+
178,
|
|
24175
|
+
34,
|
|
24176
|
+
34
|
|
24177
|
+
],
|
|
24178
|
+
"floralwhite": [
|
|
24179
|
+
255,
|
|
24180
|
+
250,
|
|
24181
|
+
240
|
|
24182
|
+
],
|
|
24183
|
+
"forestgreen": [
|
|
24184
|
+
34,
|
|
24185
|
+
139,
|
|
24186
|
+
34
|
|
24187
|
+
],
|
|
24188
|
+
"fuchsia": [
|
|
24189
|
+
255,
|
|
24190
|
+
0,
|
|
24191
|
+
255
|
|
24192
|
+
],
|
|
24193
|
+
"gainsboro": [
|
|
24194
|
+
220,
|
|
24195
|
+
220,
|
|
24196
|
+
220
|
|
24197
|
+
],
|
|
24198
|
+
"ghostwhite": [
|
|
24199
|
+
248,
|
|
24200
|
+
248,
|
|
24201
|
+
255
|
|
24202
|
+
],
|
|
24203
|
+
"gold": [
|
|
24204
|
+
255,
|
|
24205
|
+
215,
|
|
24206
|
+
0
|
|
24207
|
+
],
|
|
24208
|
+
"goldenrod": [
|
|
24209
|
+
218,
|
|
24210
|
+
165,
|
|
24211
|
+
32
|
|
24212
|
+
],
|
|
24213
|
+
"gray": [
|
|
24214
|
+
128,
|
|
24215
|
+
128,
|
|
24216
|
+
128
|
|
24217
|
+
],
|
|
24218
|
+
"green": [
|
|
24219
|
+
0,
|
|
24220
|
+
128,
|
|
24221
|
+
0
|
|
24222
|
+
],
|
|
24223
|
+
"greenyellow": [
|
|
24224
|
+
173,
|
|
24225
|
+
255,
|
|
24226
|
+
47
|
|
24227
|
+
],
|
|
24228
|
+
"grey": [
|
|
24229
|
+
128,
|
|
24230
|
+
128,
|
|
24231
|
+
128
|
|
24232
|
+
],
|
|
24233
|
+
"honeydew": [
|
|
24234
|
+
240,
|
|
24235
|
+
255,
|
|
24236
|
+
240
|
|
24237
|
+
],
|
|
24238
|
+
"hotpink": [
|
|
24239
|
+
255,
|
|
24240
|
+
105,
|
|
24241
|
+
180
|
|
24242
|
+
],
|
|
24243
|
+
"indianred": [
|
|
24244
|
+
205,
|
|
24245
|
+
92,
|
|
24246
|
+
92
|
|
24247
|
+
],
|
|
24248
|
+
"indigo": [
|
|
24249
|
+
75,
|
|
24250
|
+
0,
|
|
24251
|
+
130
|
|
24252
|
+
],
|
|
24253
|
+
"ivory": [
|
|
24254
|
+
255,
|
|
24255
|
+
255,
|
|
24256
|
+
240
|
|
24257
|
+
],
|
|
24258
|
+
"khaki": [
|
|
24259
|
+
240,
|
|
24260
|
+
230,
|
|
24261
|
+
140
|
|
24262
|
+
],
|
|
24263
|
+
"lavender": [
|
|
24264
|
+
230,
|
|
24265
|
+
230,
|
|
24266
|
+
250
|
|
24267
|
+
],
|
|
24268
|
+
"lavenderblush": [
|
|
24269
|
+
255,
|
|
24270
|
+
240,
|
|
24271
|
+
245
|
|
24272
|
+
],
|
|
24273
|
+
"lawngreen": [
|
|
24274
|
+
124,
|
|
24275
|
+
252,
|
|
24276
|
+
0
|
|
24277
|
+
],
|
|
24278
|
+
"lemonchiffon": [
|
|
24279
|
+
255,
|
|
24280
|
+
250,
|
|
24281
|
+
205
|
|
24282
|
+
],
|
|
24283
|
+
"lightblue": [
|
|
24284
|
+
173,
|
|
24285
|
+
216,
|
|
24286
|
+
230
|
|
24287
|
+
],
|
|
24288
|
+
"lightcoral": [
|
|
24289
|
+
240,
|
|
24290
|
+
128,
|
|
24291
|
+
128
|
|
24292
|
+
],
|
|
24293
|
+
"lightcyan": [
|
|
24294
|
+
224,
|
|
24295
|
+
255,
|
|
24296
|
+
255
|
|
24297
|
+
],
|
|
24298
|
+
"lightgoldenrodyellow": [
|
|
24299
|
+
250,
|
|
24300
|
+
250,
|
|
24301
|
+
210
|
|
24302
|
+
],
|
|
24303
|
+
"lightgray": [
|
|
24304
|
+
211,
|
|
24305
|
+
211,
|
|
24306
|
+
211
|
|
24307
|
+
],
|
|
24308
|
+
"lightgreen": [
|
|
24309
|
+
144,
|
|
24310
|
+
238,
|
|
24311
|
+
144
|
|
24312
|
+
],
|
|
24313
|
+
"lightgrey": [
|
|
24314
|
+
211,
|
|
24315
|
+
211,
|
|
24316
|
+
211
|
|
24317
|
+
],
|
|
24318
|
+
"lightpink": [
|
|
24319
|
+
255,
|
|
24320
|
+
182,
|
|
24321
|
+
193
|
|
24322
|
+
],
|
|
24323
|
+
"lightsalmon": [
|
|
24324
|
+
255,
|
|
24325
|
+
160,
|
|
24326
|
+
122
|
|
24327
|
+
],
|
|
24328
|
+
"lightseagreen": [
|
|
24329
|
+
32,
|
|
24330
|
+
178,
|
|
24331
|
+
170
|
|
24332
|
+
],
|
|
24333
|
+
"lightskyblue": [
|
|
24334
|
+
135,
|
|
24335
|
+
206,
|
|
24336
|
+
250
|
|
24337
|
+
],
|
|
24338
|
+
"lightslategray": [
|
|
24339
|
+
119,
|
|
24340
|
+
136,
|
|
24341
|
+
153
|
|
24342
|
+
],
|
|
24343
|
+
"lightslategrey": [
|
|
24344
|
+
119,
|
|
24345
|
+
136,
|
|
24346
|
+
153
|
|
24347
|
+
],
|
|
24348
|
+
"lightsteelblue": [
|
|
24349
|
+
176,
|
|
24350
|
+
196,
|
|
24351
|
+
222
|
|
24352
|
+
],
|
|
24353
|
+
"lightyellow": [
|
|
24354
|
+
255,
|
|
24355
|
+
255,
|
|
24356
|
+
224
|
|
24357
|
+
],
|
|
24358
|
+
"lime": [
|
|
24359
|
+
0,
|
|
24360
|
+
255,
|
|
24361
|
+
0
|
|
24362
|
+
],
|
|
24363
|
+
"limegreen": [
|
|
24364
|
+
50,
|
|
24365
|
+
205,
|
|
24366
|
+
50
|
|
24367
|
+
],
|
|
24368
|
+
"linen": [
|
|
24369
|
+
250,
|
|
24370
|
+
240,
|
|
24371
|
+
230
|
|
24372
|
+
],
|
|
24373
|
+
"magenta": [
|
|
24374
|
+
255,
|
|
24375
|
+
0,
|
|
24376
|
+
255
|
|
24377
|
+
],
|
|
24378
|
+
"maroon": [
|
|
24379
|
+
128,
|
|
24380
|
+
0,
|
|
24381
|
+
0
|
|
24382
|
+
],
|
|
24383
|
+
"mediumaquamarine": [
|
|
24384
|
+
102,
|
|
24385
|
+
205,
|
|
24386
|
+
170
|
|
24387
|
+
],
|
|
24388
|
+
"mediumblue": [
|
|
24389
|
+
0,
|
|
24390
|
+
0,
|
|
24391
|
+
205
|
|
24392
|
+
],
|
|
24393
|
+
"mediumorchid": [
|
|
24394
|
+
186,
|
|
24395
|
+
85,
|
|
24396
|
+
211
|
|
24397
|
+
],
|
|
24398
|
+
"mediumpurple": [
|
|
24399
|
+
147,
|
|
24400
|
+
112,
|
|
24401
|
+
219
|
|
24402
|
+
],
|
|
24403
|
+
"mediumseagreen": [
|
|
24404
|
+
60,
|
|
24405
|
+
179,
|
|
24406
|
+
113
|
|
24407
|
+
],
|
|
24408
|
+
"mediumslateblue": [
|
|
24409
|
+
123,
|
|
24410
|
+
104,
|
|
24411
|
+
238
|
|
24412
|
+
],
|
|
24413
|
+
"mediumspringgreen": [
|
|
24414
|
+
0,
|
|
24415
|
+
250,
|
|
24416
|
+
154
|
|
24417
|
+
],
|
|
24418
|
+
"mediumturquoise": [
|
|
24419
|
+
72,
|
|
24420
|
+
209,
|
|
24421
|
+
204
|
|
24422
|
+
],
|
|
24423
|
+
"mediumvioletred": [
|
|
24424
|
+
199,
|
|
24425
|
+
21,
|
|
24426
|
+
133
|
|
24427
|
+
],
|
|
24428
|
+
"midnightblue": [
|
|
24429
|
+
25,
|
|
24430
|
+
25,
|
|
24431
|
+
112
|
|
24432
|
+
],
|
|
24433
|
+
"mintcream": [
|
|
24434
|
+
245,
|
|
24435
|
+
255,
|
|
24436
|
+
250
|
|
24437
|
+
],
|
|
24438
|
+
"mistyrose": [
|
|
24439
|
+
255,
|
|
24440
|
+
228,
|
|
24441
|
+
225
|
|
24442
|
+
],
|
|
24443
|
+
"moccasin": [
|
|
24444
|
+
255,
|
|
24445
|
+
228,
|
|
24446
|
+
181
|
|
24447
|
+
],
|
|
24448
|
+
"navajowhite": [
|
|
24449
|
+
255,
|
|
24450
|
+
222,
|
|
24451
|
+
173
|
|
24452
|
+
],
|
|
24453
|
+
"navy": [
|
|
24454
|
+
0,
|
|
24455
|
+
0,
|
|
24456
|
+
128
|
|
24457
|
+
],
|
|
24458
|
+
"oldlace": [
|
|
24459
|
+
253,
|
|
24460
|
+
245,
|
|
24461
|
+
230
|
|
24462
|
+
],
|
|
24463
|
+
"olive": [
|
|
24464
|
+
128,
|
|
24465
|
+
128,
|
|
24466
|
+
0
|
|
24467
|
+
],
|
|
24468
|
+
"olivedrab": [
|
|
24469
|
+
107,
|
|
24470
|
+
142,
|
|
24471
|
+
35
|
|
24472
|
+
],
|
|
24473
|
+
"orange": [
|
|
24474
|
+
255,
|
|
24475
|
+
165,
|
|
24476
|
+
0
|
|
24477
|
+
],
|
|
24478
|
+
"orangered": [
|
|
24479
|
+
255,
|
|
24480
|
+
69,
|
|
24481
|
+
0
|
|
24482
|
+
],
|
|
24483
|
+
"orchid": [
|
|
24484
|
+
218,
|
|
24485
|
+
112,
|
|
24486
|
+
214
|
|
24487
|
+
],
|
|
24488
|
+
"palegoldenrod": [
|
|
24489
|
+
238,
|
|
24490
|
+
232,
|
|
24491
|
+
170
|
|
24492
|
+
],
|
|
24493
|
+
"palegreen": [
|
|
24494
|
+
152,
|
|
24495
|
+
251,
|
|
24496
|
+
152
|
|
24497
|
+
],
|
|
24498
|
+
"paleturquoise": [
|
|
24499
|
+
175,
|
|
24500
|
+
238,
|
|
24501
|
+
238
|
|
24502
|
+
],
|
|
24503
|
+
"palevioletred": [
|
|
24504
|
+
219,
|
|
24505
|
+
112,
|
|
24506
|
+
147
|
|
24507
|
+
],
|
|
24508
|
+
"papayawhip": [
|
|
24509
|
+
255,
|
|
24510
|
+
239,
|
|
24511
|
+
213
|
|
24512
|
+
],
|
|
24513
|
+
"peachpuff": [
|
|
24514
|
+
255,
|
|
24515
|
+
218,
|
|
24516
|
+
185
|
|
24517
|
+
],
|
|
24518
|
+
"peru": [
|
|
24519
|
+
205,
|
|
24520
|
+
133,
|
|
24521
|
+
63
|
|
24522
|
+
],
|
|
24523
|
+
"pink": [
|
|
24524
|
+
255,
|
|
24525
|
+
192,
|
|
24526
|
+
203
|
|
24527
|
+
],
|
|
24528
|
+
"plum": [
|
|
24529
|
+
221,
|
|
24530
|
+
160,
|
|
24531
|
+
221
|
|
24532
|
+
],
|
|
24533
|
+
"powderblue": [
|
|
24534
|
+
176,
|
|
24535
|
+
224,
|
|
24536
|
+
230
|
|
24537
|
+
],
|
|
24538
|
+
"purple": [
|
|
24539
|
+
128,
|
|
24540
|
+
0,
|
|
24541
|
+
128
|
|
24542
|
+
],
|
|
24543
|
+
"rebeccapurple": [
|
|
24544
|
+
102,
|
|
24545
|
+
51,
|
|
24546
|
+
153
|
|
24547
|
+
],
|
|
24548
|
+
"red": [
|
|
24549
|
+
255,
|
|
24550
|
+
0,
|
|
24551
|
+
0
|
|
24552
|
+
],
|
|
24553
|
+
"rosybrown": [
|
|
24554
|
+
188,
|
|
24555
|
+
143,
|
|
24556
|
+
143
|
|
24557
|
+
],
|
|
24558
|
+
"royalblue": [
|
|
24559
|
+
65,
|
|
24560
|
+
105,
|
|
24561
|
+
225
|
|
24562
|
+
],
|
|
24563
|
+
"saddlebrown": [
|
|
24564
|
+
139,
|
|
24565
|
+
69,
|
|
24566
|
+
19
|
|
24567
|
+
],
|
|
24568
|
+
"salmon": [
|
|
24569
|
+
250,
|
|
24570
|
+
128,
|
|
24571
|
+
114
|
|
24572
|
+
],
|
|
24573
|
+
"sandybrown": [
|
|
24574
|
+
244,
|
|
24575
|
+
164,
|
|
24576
|
+
96
|
|
24577
|
+
],
|
|
24578
|
+
"seagreen": [
|
|
24579
|
+
46,
|
|
24580
|
+
139,
|
|
24581
|
+
87
|
|
24582
|
+
],
|
|
24583
|
+
"seashell": [
|
|
24584
|
+
255,
|
|
24585
|
+
245,
|
|
24586
|
+
238
|
|
24587
|
+
],
|
|
24588
|
+
"sienna": [
|
|
24589
|
+
160,
|
|
24590
|
+
82,
|
|
24591
|
+
45
|
|
24592
|
+
],
|
|
24593
|
+
"silver": [
|
|
24594
|
+
192,
|
|
24595
|
+
192,
|
|
24596
|
+
192
|
|
24597
|
+
],
|
|
24598
|
+
"skyblue": [
|
|
24599
|
+
135,
|
|
24600
|
+
206,
|
|
24601
|
+
235
|
|
24602
|
+
],
|
|
24603
|
+
"slateblue": [
|
|
24604
|
+
106,
|
|
24605
|
+
90,
|
|
24606
|
+
205
|
|
24607
|
+
],
|
|
24608
|
+
"slategray": [
|
|
24609
|
+
112,
|
|
24610
|
+
128,
|
|
24611
|
+
144
|
|
24612
|
+
],
|
|
24613
|
+
"slategrey": [
|
|
24614
|
+
112,
|
|
24615
|
+
128,
|
|
24616
|
+
144
|
|
24617
|
+
],
|
|
24618
|
+
"snow": [
|
|
24619
|
+
255,
|
|
24620
|
+
250,
|
|
24621
|
+
250
|
|
24622
|
+
],
|
|
24623
|
+
"springgreen": [
|
|
24624
|
+
0,
|
|
24625
|
+
255,
|
|
24626
|
+
127
|
|
24627
|
+
],
|
|
24628
|
+
"steelblue": [
|
|
24629
|
+
70,
|
|
24630
|
+
130,
|
|
24631
|
+
180
|
|
24632
|
+
],
|
|
24633
|
+
"tan": [
|
|
24634
|
+
210,
|
|
24635
|
+
180,
|
|
24636
|
+
140
|
|
24637
|
+
],
|
|
24638
|
+
"teal": [
|
|
24639
|
+
0,
|
|
24640
|
+
128,
|
|
24641
|
+
128
|
|
24642
|
+
],
|
|
24643
|
+
"thistle": [
|
|
24644
|
+
216,
|
|
24645
|
+
191,
|
|
24646
|
+
216
|
|
24647
|
+
],
|
|
24648
|
+
"tomato": [
|
|
24649
|
+
255,
|
|
24650
|
+
99,
|
|
24651
|
+
71
|
|
24652
|
+
],
|
|
24653
|
+
"turquoise": [
|
|
24654
|
+
64,
|
|
24655
|
+
224,
|
|
24656
|
+
208
|
|
24657
|
+
],
|
|
24658
|
+
"violet": [
|
|
24659
|
+
238,
|
|
24660
|
+
130,
|
|
24661
|
+
238
|
|
24662
|
+
],
|
|
24663
|
+
"wheat": [
|
|
24664
|
+
245,
|
|
24665
|
+
222,
|
|
24666
|
+
179
|
|
24667
|
+
],
|
|
24668
|
+
"white": [
|
|
24669
|
+
255,
|
|
24670
|
+
255,
|
|
24671
|
+
255
|
|
24672
|
+
],
|
|
24673
|
+
"whitesmoke": [
|
|
24674
|
+
245,
|
|
24675
|
+
245,
|
|
24676
|
+
245
|
|
24677
|
+
],
|
|
24678
|
+
"yellow": [
|
|
24679
|
+
255,
|
|
24680
|
+
255,
|
|
24681
|
+
0
|
|
24682
|
+
],
|
|
24683
|
+
"yellowgreen": [
|
|
24684
|
+
154,
|
|
24685
|
+
205,
|
|
24686
|
+
50
|
|
24687
|
+
]
|
|
24688
|
+
};
|
|
24689
|
+
}) });
|
|
24690
|
+
|
|
24691
|
+
//#endregion
|
|
24692
|
+
//#region node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
|
|
24693
|
+
var require_conversions = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js": ((exports, module) => {
|
|
24694
|
+
const cssKeywords = require_color_name();
|
|
24695
|
+
const reverseKeywords = {};
|
|
24696
|
+
for (const key$1 of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key$1]] = key$1;
|
|
24697
|
+
const convert$1 = {
|
|
24698
|
+
rgb: {
|
|
24699
|
+
channels: 3,
|
|
24700
|
+
labels: "rgb"
|
|
24701
|
+
},
|
|
24702
|
+
hsl: {
|
|
24703
|
+
channels: 3,
|
|
24704
|
+
labels: "hsl"
|
|
24705
|
+
},
|
|
24706
|
+
hsv: {
|
|
24707
|
+
channels: 3,
|
|
24708
|
+
labels: "hsv"
|
|
24709
|
+
},
|
|
24710
|
+
hwb: {
|
|
24711
|
+
channels: 3,
|
|
24712
|
+
labels: "hwb"
|
|
24713
|
+
},
|
|
24714
|
+
cmyk: {
|
|
24715
|
+
channels: 4,
|
|
24716
|
+
labels: "cmyk"
|
|
24717
|
+
},
|
|
24718
|
+
xyz: {
|
|
24719
|
+
channels: 3,
|
|
24720
|
+
labels: "xyz"
|
|
24721
|
+
},
|
|
24722
|
+
lab: {
|
|
24723
|
+
channels: 3,
|
|
24724
|
+
labels: "lab"
|
|
24725
|
+
},
|
|
24726
|
+
lch: {
|
|
24727
|
+
channels: 3,
|
|
24728
|
+
labels: "lch"
|
|
24729
|
+
},
|
|
24730
|
+
hex: {
|
|
24731
|
+
channels: 1,
|
|
24732
|
+
labels: ["hex"]
|
|
24733
|
+
},
|
|
24734
|
+
keyword: {
|
|
24735
|
+
channels: 1,
|
|
24736
|
+
labels: ["keyword"]
|
|
24737
|
+
},
|
|
24738
|
+
ansi16: {
|
|
24739
|
+
channels: 1,
|
|
24740
|
+
labels: ["ansi16"]
|
|
24741
|
+
},
|
|
24742
|
+
ansi256: {
|
|
24743
|
+
channels: 1,
|
|
24744
|
+
labels: ["ansi256"]
|
|
24745
|
+
},
|
|
24746
|
+
hcg: {
|
|
24747
|
+
channels: 3,
|
|
24748
|
+
labels: [
|
|
24749
|
+
"h",
|
|
24750
|
+
"c",
|
|
24751
|
+
"g"
|
|
24752
|
+
]
|
|
24753
|
+
},
|
|
24754
|
+
apple: {
|
|
24755
|
+
channels: 3,
|
|
24756
|
+
labels: [
|
|
24757
|
+
"r16",
|
|
24758
|
+
"g16",
|
|
24759
|
+
"b16"
|
|
24760
|
+
]
|
|
24761
|
+
},
|
|
24762
|
+
gray: {
|
|
24763
|
+
channels: 1,
|
|
24764
|
+
labels: ["gray"]
|
|
24765
|
+
}
|
|
24766
|
+
};
|
|
24767
|
+
module.exports = convert$1;
|
|
24768
|
+
for (const model of Object.keys(convert$1)) {
|
|
24769
|
+
if (!("channels" in convert$1[model])) throw new Error("missing channels property: " + model);
|
|
24770
|
+
if (!("labels" in convert$1[model])) throw new Error("missing channel labels property: " + model);
|
|
24771
|
+
if (convert$1[model].labels.length !== convert$1[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
24772
|
+
const { channels, labels } = convert$1[model];
|
|
24773
|
+
delete convert$1[model].channels;
|
|
24774
|
+
delete convert$1[model].labels;
|
|
24775
|
+
Object.defineProperty(convert$1[model], "channels", { value: channels });
|
|
24776
|
+
Object.defineProperty(convert$1[model], "labels", { value: labels });
|
|
24777
|
+
}
|
|
24778
|
+
convert$1.rgb.hsl = function(rgb) {
|
|
24779
|
+
const r = rgb[0] / 255;
|
|
24780
|
+
const g = rgb[1] / 255;
|
|
24781
|
+
const b = rgb[2] / 255;
|
|
24782
|
+
const min = Math.min(r, g, b);
|
|
24783
|
+
const max = Math.max(r, g, b);
|
|
24784
|
+
const delta = max - min;
|
|
24785
|
+
let h;
|
|
24786
|
+
let s;
|
|
24787
|
+
if (max === min) h = 0;
|
|
24788
|
+
else if (r === max) h = (g - b) / delta;
|
|
24789
|
+
else if (g === max) h = 2 + (b - r) / delta;
|
|
24790
|
+
else if (b === max) h = 4 + (r - g) / delta;
|
|
24791
|
+
h = Math.min(h * 60, 360);
|
|
24792
|
+
if (h < 0) h += 360;
|
|
24793
|
+
const l = (min + max) / 2;
|
|
24794
|
+
if (max === min) s = 0;
|
|
24795
|
+
else if (l <= .5) s = delta / (max + min);
|
|
24796
|
+
else s = delta / (2 - max - min);
|
|
24797
|
+
return [
|
|
24798
|
+
h,
|
|
24799
|
+
s * 100,
|
|
24800
|
+
l * 100
|
|
24801
|
+
];
|
|
24802
|
+
};
|
|
24803
|
+
convert$1.rgb.hsv = function(rgb) {
|
|
24804
|
+
let rdif;
|
|
24805
|
+
let gdif;
|
|
24806
|
+
let bdif;
|
|
24807
|
+
let h;
|
|
24808
|
+
let s;
|
|
24809
|
+
const r = rgb[0] / 255;
|
|
24810
|
+
const g = rgb[1] / 255;
|
|
24811
|
+
const b = rgb[2] / 255;
|
|
24812
|
+
const v = Math.max(r, g, b);
|
|
24813
|
+
const diff = v - Math.min(r, g, b);
|
|
24814
|
+
const diffc = function(c) {
|
|
24815
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
24816
|
+
};
|
|
24817
|
+
if (diff === 0) {
|
|
24818
|
+
h = 0;
|
|
24819
|
+
s = 0;
|
|
24820
|
+
} else {
|
|
24821
|
+
s = diff / v;
|
|
24822
|
+
rdif = diffc(r);
|
|
24823
|
+
gdif = diffc(g);
|
|
24824
|
+
bdif = diffc(b);
|
|
24825
|
+
if (r === v) h = bdif - gdif;
|
|
24826
|
+
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
24827
|
+
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
24828
|
+
if (h < 0) h += 1;
|
|
24829
|
+
else if (h > 1) h -= 1;
|
|
24830
|
+
}
|
|
24831
|
+
return [
|
|
24832
|
+
h * 360,
|
|
24833
|
+
s * 100,
|
|
24834
|
+
v * 100
|
|
24835
|
+
];
|
|
24836
|
+
};
|
|
24837
|
+
convert$1.rgb.hwb = function(rgb) {
|
|
24838
|
+
const r = rgb[0];
|
|
24839
|
+
const g = rgb[1];
|
|
24840
|
+
let b = rgb[2];
|
|
24841
|
+
const h = convert$1.rgb.hsl(rgb)[0];
|
|
24842
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
24843
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
24844
|
+
return [
|
|
24845
|
+
h,
|
|
24846
|
+
w * 100,
|
|
24847
|
+
b * 100
|
|
24848
|
+
];
|
|
24849
|
+
};
|
|
24850
|
+
convert$1.rgb.cmyk = function(rgb) {
|
|
24851
|
+
const r = rgb[0] / 255;
|
|
24852
|
+
const g = rgb[1] / 255;
|
|
24853
|
+
const b = rgb[2] / 255;
|
|
24854
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
24855
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
24856
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
24857
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
24858
|
+
return [
|
|
24859
|
+
c * 100,
|
|
24860
|
+
m * 100,
|
|
24861
|
+
y * 100,
|
|
24862
|
+
k * 100
|
|
24863
|
+
];
|
|
24864
|
+
};
|
|
24865
|
+
function comparativeDistance(x, y) {
|
|
24866
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
24867
|
+
}
|
|
24868
|
+
convert$1.rgb.keyword = function(rgb) {
|
|
24869
|
+
const reversed = reverseKeywords[rgb];
|
|
24870
|
+
if (reversed) return reversed;
|
|
24871
|
+
let currentClosestDistance = Infinity;
|
|
24872
|
+
let currentClosestKeyword;
|
|
24873
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
24874
|
+
const value = cssKeywords[keyword];
|
|
24875
|
+
const distance = comparativeDistance(rgb, value);
|
|
24876
|
+
if (distance < currentClosestDistance) {
|
|
24877
|
+
currentClosestDistance = distance;
|
|
24878
|
+
currentClosestKeyword = keyword;
|
|
24879
|
+
}
|
|
24880
|
+
}
|
|
24881
|
+
return currentClosestKeyword;
|
|
24882
|
+
};
|
|
24883
|
+
convert$1.keyword.rgb = function(keyword) {
|
|
24884
|
+
return cssKeywords[keyword];
|
|
24885
|
+
};
|
|
24886
|
+
convert$1.rgb.xyz = function(rgb) {
|
|
24887
|
+
let r = rgb[0] / 255;
|
|
24888
|
+
let g = rgb[1] / 255;
|
|
24889
|
+
let b = rgb[2] / 255;
|
|
24890
|
+
r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
|
|
24891
|
+
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
24892
|
+
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
24893
|
+
const x = r * .4124 + g * .3576 + b * .1805;
|
|
24894
|
+
const y = r * .2126 + g * .7152 + b * .0722;
|
|
24895
|
+
const z = r * .0193 + g * .1192 + b * .9505;
|
|
24896
|
+
return [
|
|
24897
|
+
x * 100,
|
|
24898
|
+
y * 100,
|
|
24899
|
+
z * 100
|
|
24900
|
+
];
|
|
24901
|
+
};
|
|
24902
|
+
convert$1.rgb.lab = function(rgb) {
|
|
24903
|
+
const xyz = convert$1.rgb.xyz(rgb);
|
|
24904
|
+
let x = xyz[0];
|
|
24905
|
+
let y = xyz[1];
|
|
24906
|
+
let z = xyz[2];
|
|
24907
|
+
x /= 95.047;
|
|
24908
|
+
y /= 100;
|
|
24909
|
+
z /= 108.883;
|
|
24910
|
+
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
24911
|
+
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
24912
|
+
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
24913
|
+
return [
|
|
24914
|
+
116 * y - 16,
|
|
24915
|
+
500 * (x - y),
|
|
24916
|
+
200 * (y - z)
|
|
24917
|
+
];
|
|
24918
|
+
};
|
|
24919
|
+
convert$1.hsl.rgb = function(hsl) {
|
|
24920
|
+
const h = hsl[0] / 360;
|
|
24921
|
+
const s = hsl[1] / 100;
|
|
24922
|
+
const l = hsl[2] / 100;
|
|
24923
|
+
let t2;
|
|
24924
|
+
let t3;
|
|
24925
|
+
let val;
|
|
24926
|
+
if (s === 0) {
|
|
24927
|
+
val = l * 255;
|
|
24928
|
+
return [
|
|
24929
|
+
val,
|
|
24930
|
+
val,
|
|
24931
|
+
val
|
|
24932
|
+
];
|
|
24933
|
+
}
|
|
24934
|
+
if (l < .5) t2 = l * (1 + s);
|
|
24935
|
+
else t2 = l + s - l * s;
|
|
24936
|
+
const t1 = 2 * l - t2;
|
|
24937
|
+
const rgb = [
|
|
24938
|
+
0,
|
|
24939
|
+
0,
|
|
24940
|
+
0
|
|
24941
|
+
];
|
|
24942
|
+
for (let i$3 = 0; i$3 < 3; i$3++) {
|
|
24943
|
+
t3 = h + 1 / 3 * -(i$3 - 1);
|
|
24944
|
+
if (t3 < 0) t3++;
|
|
24945
|
+
if (t3 > 1) t3--;
|
|
24946
|
+
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
24947
|
+
else if (2 * t3 < 1) val = t2;
|
|
24948
|
+
else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
24949
|
+
else val = t1;
|
|
24950
|
+
rgb[i$3] = val * 255;
|
|
24951
|
+
}
|
|
24952
|
+
return rgb;
|
|
24953
|
+
};
|
|
24954
|
+
convert$1.hsl.hsv = function(hsl) {
|
|
24955
|
+
const h = hsl[0];
|
|
24956
|
+
let s = hsl[1] / 100;
|
|
24957
|
+
let l = hsl[2] / 100;
|
|
24958
|
+
let smin = s;
|
|
24959
|
+
const lmin = Math.max(l, .01);
|
|
24960
|
+
l *= 2;
|
|
24961
|
+
s *= l <= 1 ? l : 2 - l;
|
|
24962
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
24963
|
+
const v = (l + s) / 2;
|
|
24964
|
+
return [
|
|
24965
|
+
h,
|
|
24966
|
+
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
24967
|
+
v * 100
|
|
24968
|
+
];
|
|
24969
|
+
};
|
|
24970
|
+
convert$1.hsv.rgb = function(hsv) {
|
|
24971
|
+
const h = hsv[0] / 60;
|
|
24972
|
+
const s = hsv[1] / 100;
|
|
24973
|
+
let v = hsv[2] / 100;
|
|
24974
|
+
const hi = Math.floor(h) % 6;
|
|
24975
|
+
const f = h - Math.floor(h);
|
|
24976
|
+
const p = 255 * v * (1 - s);
|
|
24977
|
+
const q = 255 * v * (1 - s * f);
|
|
24978
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
24979
|
+
v *= 255;
|
|
24980
|
+
switch (hi) {
|
|
24981
|
+
case 0: return [
|
|
24982
|
+
v,
|
|
24983
|
+
t,
|
|
24984
|
+
p
|
|
24985
|
+
];
|
|
24986
|
+
case 1: return [
|
|
24987
|
+
q,
|
|
24988
|
+
v,
|
|
24989
|
+
p
|
|
24990
|
+
];
|
|
24991
|
+
case 2: return [
|
|
24992
|
+
p,
|
|
24993
|
+
v,
|
|
24994
|
+
t
|
|
24995
|
+
];
|
|
24996
|
+
case 3: return [
|
|
24997
|
+
p,
|
|
24998
|
+
q,
|
|
24999
|
+
v
|
|
25000
|
+
];
|
|
25001
|
+
case 4: return [
|
|
25002
|
+
t,
|
|
25003
|
+
p,
|
|
25004
|
+
v
|
|
25005
|
+
];
|
|
25006
|
+
case 5: return [
|
|
25007
|
+
v,
|
|
25008
|
+
p,
|
|
25009
|
+
q
|
|
25010
|
+
];
|
|
25011
|
+
}
|
|
25012
|
+
};
|
|
25013
|
+
convert$1.hsv.hsl = function(hsv) {
|
|
25014
|
+
const h = hsv[0];
|
|
25015
|
+
const s = hsv[1] / 100;
|
|
25016
|
+
const v = hsv[2] / 100;
|
|
25017
|
+
const vmin = Math.max(v, .01);
|
|
25018
|
+
let sl;
|
|
25019
|
+
let l;
|
|
25020
|
+
l = (2 - s) * v;
|
|
25021
|
+
const lmin = (2 - s) * vmin;
|
|
25022
|
+
sl = s * vmin;
|
|
25023
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
25024
|
+
sl = sl || 0;
|
|
25025
|
+
l /= 2;
|
|
25026
|
+
return [
|
|
25027
|
+
h,
|
|
25028
|
+
sl * 100,
|
|
25029
|
+
l * 100
|
|
25030
|
+
];
|
|
25031
|
+
};
|
|
25032
|
+
convert$1.hwb.rgb = function(hwb) {
|
|
25033
|
+
const h = hwb[0] / 360;
|
|
25034
|
+
let wh = hwb[1] / 100;
|
|
25035
|
+
let bl = hwb[2] / 100;
|
|
25036
|
+
const ratio = wh + bl;
|
|
25037
|
+
let f;
|
|
25038
|
+
if (ratio > 1) {
|
|
25039
|
+
wh /= ratio;
|
|
25040
|
+
bl /= ratio;
|
|
25041
|
+
}
|
|
25042
|
+
const i$3 = Math.floor(6 * h);
|
|
25043
|
+
const v = 1 - bl;
|
|
25044
|
+
f = 6 * h - i$3;
|
|
25045
|
+
if ((i$3 & 1) !== 0) f = 1 - f;
|
|
25046
|
+
const n = wh + f * (v - wh);
|
|
25047
|
+
let r;
|
|
25048
|
+
let g;
|
|
25049
|
+
let b;
|
|
25050
|
+
switch (i$3) {
|
|
25051
|
+
default:
|
|
25052
|
+
case 6:
|
|
25053
|
+
case 0:
|
|
25054
|
+
r = v;
|
|
25055
|
+
g = n;
|
|
25056
|
+
b = wh;
|
|
25057
|
+
break;
|
|
25058
|
+
case 1:
|
|
25059
|
+
r = n;
|
|
25060
|
+
g = v;
|
|
25061
|
+
b = wh;
|
|
25062
|
+
break;
|
|
25063
|
+
case 2:
|
|
25064
|
+
r = wh;
|
|
25065
|
+
g = v;
|
|
25066
|
+
b = n;
|
|
25067
|
+
break;
|
|
25068
|
+
case 3:
|
|
25069
|
+
r = wh;
|
|
25070
|
+
g = n;
|
|
25071
|
+
b = v;
|
|
25072
|
+
break;
|
|
25073
|
+
case 4:
|
|
25074
|
+
r = n;
|
|
25075
|
+
g = wh;
|
|
25076
|
+
b = v;
|
|
25077
|
+
break;
|
|
25078
|
+
case 5:
|
|
25079
|
+
r = v;
|
|
25080
|
+
g = wh;
|
|
25081
|
+
b = n;
|
|
25082
|
+
break;
|
|
25083
|
+
}
|
|
25084
|
+
return [
|
|
25085
|
+
r * 255,
|
|
25086
|
+
g * 255,
|
|
25087
|
+
b * 255
|
|
25088
|
+
];
|
|
25089
|
+
};
|
|
25090
|
+
convert$1.cmyk.rgb = function(cmyk) {
|
|
25091
|
+
const c = cmyk[0] / 100;
|
|
25092
|
+
const m = cmyk[1] / 100;
|
|
25093
|
+
const y = cmyk[2] / 100;
|
|
25094
|
+
const k = cmyk[3] / 100;
|
|
25095
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
25096
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
25097
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
25098
|
+
return [
|
|
25099
|
+
r * 255,
|
|
25100
|
+
g * 255,
|
|
25101
|
+
b * 255
|
|
25102
|
+
];
|
|
25103
|
+
};
|
|
25104
|
+
convert$1.xyz.rgb = function(xyz) {
|
|
25105
|
+
const x = xyz[0] / 100;
|
|
25106
|
+
const y = xyz[1] / 100;
|
|
25107
|
+
const z = xyz[2] / 100;
|
|
25108
|
+
let r;
|
|
25109
|
+
let g;
|
|
25110
|
+
let b;
|
|
25111
|
+
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
25112
|
+
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
25113
|
+
b = x * .0557 + y * -.204 + z * 1.057;
|
|
25114
|
+
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
25115
|
+
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
25116
|
+
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
25117
|
+
r = Math.min(Math.max(0, r), 1);
|
|
25118
|
+
g = Math.min(Math.max(0, g), 1);
|
|
25119
|
+
b = Math.min(Math.max(0, b), 1);
|
|
25120
|
+
return [
|
|
25121
|
+
r * 255,
|
|
25122
|
+
g * 255,
|
|
25123
|
+
b * 255
|
|
25124
|
+
];
|
|
25125
|
+
};
|
|
25126
|
+
convert$1.xyz.lab = function(xyz) {
|
|
25127
|
+
let x = xyz[0];
|
|
25128
|
+
let y = xyz[1];
|
|
25129
|
+
let z = xyz[2];
|
|
25130
|
+
x /= 95.047;
|
|
25131
|
+
y /= 100;
|
|
25132
|
+
z /= 108.883;
|
|
25133
|
+
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
25134
|
+
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
25135
|
+
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
25136
|
+
return [
|
|
25137
|
+
116 * y - 16,
|
|
25138
|
+
500 * (x - y),
|
|
25139
|
+
200 * (y - z)
|
|
25140
|
+
];
|
|
25141
|
+
};
|
|
25142
|
+
convert$1.lab.xyz = function(lab) {
|
|
25143
|
+
const l = lab[0];
|
|
25144
|
+
const a = lab[1];
|
|
25145
|
+
const b = lab[2];
|
|
25146
|
+
let x;
|
|
25147
|
+
let y;
|
|
25148
|
+
let z;
|
|
25149
|
+
y = (l + 16) / 116;
|
|
25150
|
+
x = a / 500 + y;
|
|
25151
|
+
z = y - b / 200;
|
|
25152
|
+
const y2 = y ** 3;
|
|
25153
|
+
const x2 = x ** 3;
|
|
25154
|
+
const z2 = z ** 3;
|
|
25155
|
+
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
25156
|
+
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
25157
|
+
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
25158
|
+
x *= 95.047;
|
|
25159
|
+
y *= 100;
|
|
25160
|
+
z *= 108.883;
|
|
25161
|
+
return [
|
|
25162
|
+
x,
|
|
25163
|
+
y,
|
|
25164
|
+
z
|
|
25165
|
+
];
|
|
25166
|
+
};
|
|
25167
|
+
convert$1.lab.lch = function(lab) {
|
|
25168
|
+
const l = lab[0];
|
|
25169
|
+
const a = lab[1];
|
|
25170
|
+
const b = lab[2];
|
|
25171
|
+
let h;
|
|
25172
|
+
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
25173
|
+
if (h < 0) h += 360;
|
|
25174
|
+
return [
|
|
25175
|
+
l,
|
|
25176
|
+
Math.sqrt(a * a + b * b),
|
|
25177
|
+
h
|
|
25178
|
+
];
|
|
25179
|
+
};
|
|
25180
|
+
convert$1.lch.lab = function(lch) {
|
|
25181
|
+
const l = lch[0];
|
|
25182
|
+
const c = lch[1];
|
|
25183
|
+
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
25184
|
+
return [
|
|
25185
|
+
l,
|
|
25186
|
+
c * Math.cos(hr),
|
|
25187
|
+
c * Math.sin(hr)
|
|
25188
|
+
];
|
|
25189
|
+
};
|
|
25190
|
+
convert$1.rgb.ansi16 = function(args, saturation = null) {
|
|
25191
|
+
const [r, g, b] = args;
|
|
25192
|
+
let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation;
|
|
25193
|
+
value = Math.round(value / 50);
|
|
25194
|
+
if (value === 0) return 30;
|
|
25195
|
+
let ansi$1 = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
25196
|
+
if (value === 2) ansi$1 += 60;
|
|
25197
|
+
return ansi$1;
|
|
25198
|
+
};
|
|
25199
|
+
convert$1.hsv.ansi16 = function(args) {
|
|
25200
|
+
return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
|
|
25201
|
+
};
|
|
25202
|
+
convert$1.rgb.ansi256 = function(args) {
|
|
25203
|
+
const r = args[0];
|
|
25204
|
+
const g = args[1];
|
|
25205
|
+
const b = args[2];
|
|
25206
|
+
if (r === g && g === b) {
|
|
25207
|
+
if (r < 8) return 16;
|
|
25208
|
+
if (r > 248) return 231;
|
|
25209
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
25210
|
+
}
|
|
25211
|
+
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
25212
|
+
};
|
|
25213
|
+
convert$1.ansi16.rgb = function(args) {
|
|
25214
|
+
let color = args % 10;
|
|
25215
|
+
if (color === 0 || color === 7) {
|
|
25216
|
+
if (args > 50) color += 3.5;
|
|
25217
|
+
color = color / 10.5 * 255;
|
|
25218
|
+
return [
|
|
25219
|
+
color,
|
|
25220
|
+
color,
|
|
25221
|
+
color
|
|
25222
|
+
];
|
|
25223
|
+
}
|
|
25224
|
+
const mult = (~~(args > 50) + 1) * .5;
|
|
25225
|
+
return [
|
|
25226
|
+
(color & 1) * mult * 255,
|
|
25227
|
+
(color >> 1 & 1) * mult * 255,
|
|
25228
|
+
(color >> 2 & 1) * mult * 255
|
|
25229
|
+
];
|
|
25230
|
+
};
|
|
25231
|
+
convert$1.ansi256.rgb = function(args) {
|
|
25232
|
+
if (args >= 232) {
|
|
25233
|
+
const c = (args - 232) * 10 + 8;
|
|
25234
|
+
return [
|
|
25235
|
+
c,
|
|
25236
|
+
c,
|
|
25237
|
+
c
|
|
25238
|
+
];
|
|
25239
|
+
}
|
|
25240
|
+
args -= 16;
|
|
25241
|
+
let rem;
|
|
25242
|
+
return [
|
|
25243
|
+
Math.floor(args / 36) / 5 * 255,
|
|
25244
|
+
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
25245
|
+
rem % 6 / 5 * 255
|
|
25246
|
+
];
|
|
25247
|
+
};
|
|
25248
|
+
convert$1.rgb.hex = function(args) {
|
|
25249
|
+
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
25250
|
+
return "000000".substring(string.length) + string;
|
|
25251
|
+
};
|
|
25252
|
+
convert$1.hex.rgb = function(args) {
|
|
25253
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
25254
|
+
if (!match) return [
|
|
25255
|
+
0,
|
|
25256
|
+
0,
|
|
25257
|
+
0
|
|
25258
|
+
];
|
|
25259
|
+
let colorString = match[0];
|
|
25260
|
+
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
25261
|
+
return char + char;
|
|
25262
|
+
}).join("");
|
|
25263
|
+
const integer = parseInt(colorString, 16);
|
|
25264
|
+
return [
|
|
25265
|
+
integer >> 16 & 255,
|
|
25266
|
+
integer >> 8 & 255,
|
|
25267
|
+
integer & 255
|
|
25268
|
+
];
|
|
25269
|
+
};
|
|
25270
|
+
convert$1.rgb.hcg = function(rgb) {
|
|
25271
|
+
const r = rgb[0] / 255;
|
|
25272
|
+
const g = rgb[1] / 255;
|
|
25273
|
+
const b = rgb[2] / 255;
|
|
25274
|
+
const max = Math.max(Math.max(r, g), b);
|
|
25275
|
+
const min = Math.min(Math.min(r, g), b);
|
|
25276
|
+
const chroma = max - min;
|
|
25277
|
+
let grayscale;
|
|
25278
|
+
let hue;
|
|
25279
|
+
if (chroma < 1) grayscale = min / (1 - chroma);
|
|
25280
|
+
else grayscale = 0;
|
|
25281
|
+
if (chroma <= 0) hue = 0;
|
|
25282
|
+
else if (max === r) hue = (g - b) / chroma % 6;
|
|
25283
|
+
else if (max === g) hue = 2 + (b - r) / chroma;
|
|
25284
|
+
else hue = 4 + (r - g) / chroma;
|
|
25285
|
+
hue /= 6;
|
|
25286
|
+
hue %= 1;
|
|
25287
|
+
return [
|
|
25288
|
+
hue * 360,
|
|
25289
|
+
chroma * 100,
|
|
25290
|
+
grayscale * 100
|
|
25291
|
+
];
|
|
25292
|
+
};
|
|
25293
|
+
convert$1.hsl.hcg = function(hsl) {
|
|
25294
|
+
const s = hsl[1] / 100;
|
|
25295
|
+
const l = hsl[2] / 100;
|
|
25296
|
+
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
25297
|
+
let f = 0;
|
|
25298
|
+
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
25299
|
+
return [
|
|
25300
|
+
hsl[0],
|
|
25301
|
+
c * 100,
|
|
25302
|
+
f * 100
|
|
25303
|
+
];
|
|
25304
|
+
};
|
|
25305
|
+
convert$1.hsv.hcg = function(hsv) {
|
|
25306
|
+
const s = hsv[1] / 100;
|
|
25307
|
+
const v = hsv[2] / 100;
|
|
25308
|
+
const c = s * v;
|
|
25309
|
+
let f = 0;
|
|
25310
|
+
if (c < 1) f = (v - c) / (1 - c);
|
|
25311
|
+
return [
|
|
25312
|
+
hsv[0],
|
|
25313
|
+
c * 100,
|
|
25314
|
+
f * 100
|
|
25315
|
+
];
|
|
25316
|
+
};
|
|
25317
|
+
convert$1.hcg.rgb = function(hcg) {
|
|
25318
|
+
const h = hcg[0] / 360;
|
|
25319
|
+
const c = hcg[1] / 100;
|
|
25320
|
+
const g = hcg[2] / 100;
|
|
25321
|
+
if (c === 0) return [
|
|
25322
|
+
g * 255,
|
|
25323
|
+
g * 255,
|
|
25324
|
+
g * 255
|
|
25325
|
+
];
|
|
25326
|
+
const pure = [
|
|
25327
|
+
0,
|
|
25328
|
+
0,
|
|
25329
|
+
0
|
|
25330
|
+
];
|
|
25331
|
+
const hi = h % 1 * 6;
|
|
25332
|
+
const v = hi % 1;
|
|
25333
|
+
const w = 1 - v;
|
|
25334
|
+
let mg = 0;
|
|
25335
|
+
switch (Math.floor(hi)) {
|
|
25336
|
+
case 0:
|
|
25337
|
+
pure[0] = 1;
|
|
25338
|
+
pure[1] = v;
|
|
25339
|
+
pure[2] = 0;
|
|
25340
|
+
break;
|
|
25341
|
+
case 1:
|
|
25342
|
+
pure[0] = w;
|
|
25343
|
+
pure[1] = 1;
|
|
25344
|
+
pure[2] = 0;
|
|
25345
|
+
break;
|
|
25346
|
+
case 2:
|
|
25347
|
+
pure[0] = 0;
|
|
25348
|
+
pure[1] = 1;
|
|
25349
|
+
pure[2] = v;
|
|
25350
|
+
break;
|
|
25351
|
+
case 3:
|
|
25352
|
+
pure[0] = 0;
|
|
25353
|
+
pure[1] = w;
|
|
25354
|
+
pure[2] = 1;
|
|
25355
|
+
break;
|
|
25356
|
+
case 4:
|
|
25357
|
+
pure[0] = v;
|
|
25358
|
+
pure[1] = 0;
|
|
25359
|
+
pure[2] = 1;
|
|
25360
|
+
break;
|
|
25361
|
+
default:
|
|
25362
|
+
pure[0] = 1;
|
|
25363
|
+
pure[1] = 0;
|
|
25364
|
+
pure[2] = w;
|
|
25365
|
+
}
|
|
25366
|
+
mg = (1 - c) * g;
|
|
25367
|
+
return [
|
|
25368
|
+
(c * pure[0] + mg) * 255,
|
|
25369
|
+
(c * pure[1] + mg) * 255,
|
|
25370
|
+
(c * pure[2] + mg) * 255
|
|
25371
|
+
];
|
|
25372
|
+
};
|
|
25373
|
+
convert$1.hcg.hsv = function(hcg) {
|
|
25374
|
+
const c = hcg[1] / 100;
|
|
25375
|
+
const v = c + hcg[2] / 100 * (1 - c);
|
|
25376
|
+
let f = 0;
|
|
25377
|
+
if (v > 0) f = c / v;
|
|
25378
|
+
return [
|
|
25379
|
+
hcg[0],
|
|
25380
|
+
f * 100,
|
|
25381
|
+
v * 100
|
|
25382
|
+
];
|
|
25383
|
+
};
|
|
25384
|
+
convert$1.hcg.hsl = function(hcg) {
|
|
25385
|
+
const c = hcg[1] / 100;
|
|
25386
|
+
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
25387
|
+
let s = 0;
|
|
25388
|
+
if (l > 0 && l < .5) s = c / (2 * l);
|
|
25389
|
+
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
25390
|
+
return [
|
|
25391
|
+
hcg[0],
|
|
25392
|
+
s * 100,
|
|
25393
|
+
l * 100
|
|
25394
|
+
];
|
|
25395
|
+
};
|
|
25396
|
+
convert$1.hcg.hwb = function(hcg) {
|
|
25397
|
+
const c = hcg[1] / 100;
|
|
25398
|
+
const v = c + hcg[2] / 100 * (1 - c);
|
|
25399
|
+
return [
|
|
25400
|
+
hcg[0],
|
|
25401
|
+
(v - c) * 100,
|
|
25402
|
+
(1 - v) * 100
|
|
25403
|
+
];
|
|
25404
|
+
};
|
|
25405
|
+
convert$1.hwb.hcg = function(hwb) {
|
|
25406
|
+
const w = hwb[1] / 100;
|
|
25407
|
+
const v = 1 - hwb[2] / 100;
|
|
25408
|
+
const c = v - w;
|
|
25409
|
+
let g = 0;
|
|
25410
|
+
if (c < 1) g = (v - c) / (1 - c);
|
|
25411
|
+
return [
|
|
25412
|
+
hwb[0],
|
|
25413
|
+
c * 100,
|
|
25414
|
+
g * 100
|
|
25415
|
+
];
|
|
25416
|
+
};
|
|
25417
|
+
convert$1.apple.rgb = function(apple) {
|
|
25418
|
+
return [
|
|
25419
|
+
apple[0] / 65535 * 255,
|
|
25420
|
+
apple[1] / 65535 * 255,
|
|
25421
|
+
apple[2] / 65535 * 255
|
|
25422
|
+
];
|
|
25423
|
+
};
|
|
25424
|
+
convert$1.rgb.apple = function(rgb) {
|
|
25425
|
+
return [
|
|
25426
|
+
rgb[0] / 255 * 65535,
|
|
25427
|
+
rgb[1] / 255 * 65535,
|
|
25428
|
+
rgb[2] / 255 * 65535
|
|
25429
|
+
];
|
|
25430
|
+
};
|
|
25431
|
+
convert$1.gray.rgb = function(args) {
|
|
25432
|
+
return [
|
|
25433
|
+
args[0] / 100 * 255,
|
|
25434
|
+
args[0] / 100 * 255,
|
|
25435
|
+
args[0] / 100 * 255
|
|
25436
|
+
];
|
|
25437
|
+
};
|
|
25438
|
+
convert$1.gray.hsl = function(args) {
|
|
25439
|
+
return [
|
|
25440
|
+
0,
|
|
25441
|
+
0,
|
|
25442
|
+
args[0]
|
|
25443
|
+
];
|
|
25444
|
+
};
|
|
25445
|
+
convert$1.gray.hsv = convert$1.gray.hsl;
|
|
25446
|
+
convert$1.gray.hwb = function(gray) {
|
|
25447
|
+
return [
|
|
25448
|
+
0,
|
|
25449
|
+
100,
|
|
25450
|
+
gray[0]
|
|
25451
|
+
];
|
|
25452
|
+
};
|
|
25453
|
+
convert$1.gray.cmyk = function(gray) {
|
|
25454
|
+
return [
|
|
25455
|
+
0,
|
|
25456
|
+
0,
|
|
25457
|
+
0,
|
|
25458
|
+
gray[0]
|
|
25459
|
+
];
|
|
25460
|
+
};
|
|
25461
|
+
convert$1.gray.lab = function(gray) {
|
|
25462
|
+
return [
|
|
25463
|
+
gray[0],
|
|
25464
|
+
0,
|
|
25465
|
+
0
|
|
25466
|
+
];
|
|
25467
|
+
};
|
|
25468
|
+
convert$1.gray.hex = function(gray) {
|
|
25469
|
+
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
25470
|
+
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
25471
|
+
return "000000".substring(string.length) + string;
|
|
25472
|
+
};
|
|
25473
|
+
convert$1.rgb.gray = function(rgb) {
|
|
25474
|
+
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
25475
|
+
};
|
|
25476
|
+
}) });
|
|
25477
|
+
|
|
25478
|
+
//#endregion
|
|
25479
|
+
//#region node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
|
|
25480
|
+
var require_route = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js": ((exports, module) => {
|
|
25481
|
+
const conversions$1 = require_conversions();
|
|
25482
|
+
function buildGraph() {
|
|
25483
|
+
const graph = {};
|
|
25484
|
+
const models$1 = Object.keys(conversions$1);
|
|
25485
|
+
for (let len = models$1.length, i$3 = 0; i$3 < len; i$3++) graph[models$1[i$3]] = {
|
|
25486
|
+
distance: -1,
|
|
25487
|
+
parent: null
|
|
25488
|
+
};
|
|
25489
|
+
return graph;
|
|
25490
|
+
}
|
|
25491
|
+
function deriveBFS(fromModel) {
|
|
25492
|
+
const graph = buildGraph();
|
|
25493
|
+
const queue = [fromModel];
|
|
25494
|
+
graph[fromModel].distance = 0;
|
|
25495
|
+
while (queue.length) {
|
|
25496
|
+
const current = queue.pop();
|
|
25497
|
+
const adjacents = Object.keys(conversions$1[current]);
|
|
25498
|
+
for (let len = adjacents.length, i$3 = 0; i$3 < len; i$3++) {
|
|
25499
|
+
const adjacent = adjacents[i$3];
|
|
25500
|
+
const node = graph[adjacent];
|
|
25501
|
+
if (node.distance === -1) {
|
|
25502
|
+
node.distance = graph[current].distance + 1;
|
|
25503
|
+
node.parent = current;
|
|
25504
|
+
queue.unshift(adjacent);
|
|
25505
|
+
}
|
|
25506
|
+
}
|
|
25507
|
+
}
|
|
25508
|
+
return graph;
|
|
25509
|
+
}
|
|
25510
|
+
function link(from, to) {
|
|
25511
|
+
return function(args) {
|
|
25512
|
+
return to(from(args));
|
|
25513
|
+
};
|
|
25514
|
+
}
|
|
25515
|
+
function wrapConversion(toModel, graph) {
|
|
25516
|
+
const path = [graph[toModel].parent, toModel];
|
|
25517
|
+
let fn = conversions$1[graph[toModel].parent][toModel];
|
|
25518
|
+
let cur = graph[toModel].parent;
|
|
25519
|
+
while (graph[cur].parent) {
|
|
25520
|
+
path.unshift(graph[cur].parent);
|
|
25521
|
+
fn = link(conversions$1[graph[cur].parent][cur], fn);
|
|
25522
|
+
cur = graph[cur].parent;
|
|
25523
|
+
}
|
|
25524
|
+
fn.conversion = path;
|
|
25525
|
+
return fn;
|
|
25526
|
+
}
|
|
25527
|
+
module.exports = function(fromModel) {
|
|
25528
|
+
const graph = deriveBFS(fromModel);
|
|
25529
|
+
const conversion = {};
|
|
25530
|
+
const models$1 = Object.keys(graph);
|
|
25531
|
+
for (let len = models$1.length, i$3 = 0; i$3 < len; i$3++) {
|
|
25532
|
+
const toModel = models$1[i$3];
|
|
25533
|
+
if (graph[toModel].parent === null) continue;
|
|
25534
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
25535
|
+
}
|
|
25536
|
+
return conversion;
|
|
25537
|
+
};
|
|
25538
|
+
}) });
|
|
25539
|
+
|
|
25540
|
+
//#endregion
|
|
25541
|
+
//#region node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
|
|
25542
|
+
var require_color_convert = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js": ((exports, module) => {
|
|
25543
|
+
const conversions = require_conversions();
|
|
25544
|
+
const route = require_route();
|
|
25545
|
+
const convert = {};
|
|
25546
|
+
const models = Object.keys(conversions);
|
|
25547
|
+
function wrapRaw(fn) {
|
|
25548
|
+
const wrappedFn = function(...args) {
|
|
25549
|
+
const arg0 = args[0];
|
|
25550
|
+
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
25551
|
+
if (arg0.length > 1) args = arg0;
|
|
25552
|
+
return fn(args);
|
|
25553
|
+
};
|
|
25554
|
+
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
25555
|
+
return wrappedFn;
|
|
25556
|
+
}
|
|
25557
|
+
function wrapRounded(fn) {
|
|
25558
|
+
const wrappedFn = function(...args) {
|
|
25559
|
+
const arg0 = args[0];
|
|
25560
|
+
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
25561
|
+
if (arg0.length > 1) args = arg0;
|
|
25562
|
+
const result = fn(args);
|
|
25563
|
+
if (typeof result === "object") for (let len = result.length, i$3 = 0; i$3 < len; i$3++) result[i$3] = Math.round(result[i$3]);
|
|
25564
|
+
return result;
|
|
25565
|
+
};
|
|
25566
|
+
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
25567
|
+
return wrappedFn;
|
|
25568
|
+
}
|
|
25569
|
+
models.forEach((fromModel) => {
|
|
25570
|
+
convert[fromModel] = {};
|
|
25571
|
+
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
25572
|
+
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
25573
|
+
const routes = route(fromModel);
|
|
25574
|
+
Object.keys(routes).forEach((toModel) => {
|
|
25575
|
+
const fn = routes[toModel];
|
|
25576
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
25577
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
25578
|
+
});
|
|
25579
|
+
});
|
|
25580
|
+
module.exports = convert;
|
|
25581
|
+
}) });
|
|
25582
|
+
|
|
25583
|
+
//#endregion
|
|
25584
|
+
//#region node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
|
|
25585
|
+
var require_ansi_styles = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js": ((exports, module) => {
|
|
25586
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
25587
|
+
return `\u001B[${fn(...args) + offset}m`;
|
|
25588
|
+
};
|
|
25589
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
25590
|
+
const code = fn(...args);
|
|
25591
|
+
return `\u001B[${38 + offset};5;${code}m`;
|
|
25592
|
+
};
|
|
25593
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
25594
|
+
const rgb = fn(...args);
|
|
25595
|
+
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
25596
|
+
};
|
|
25597
|
+
const ansi2ansi = (n) => n;
|
|
25598
|
+
const rgb2rgb = (r, g, b) => [
|
|
25599
|
+
r,
|
|
25600
|
+
g,
|
|
25601
|
+
b
|
|
25602
|
+
];
|
|
25603
|
+
const setLazyProperty = (object, property, get) => {
|
|
25604
|
+
Object.defineProperty(object, property, {
|
|
25605
|
+
get: () => {
|
|
25606
|
+
const value = get();
|
|
25607
|
+
Object.defineProperty(object, property, {
|
|
25608
|
+
value,
|
|
25609
|
+
enumerable: true,
|
|
25610
|
+
configurable: true
|
|
25611
|
+
});
|
|
25612
|
+
return value;
|
|
25613
|
+
},
|
|
25614
|
+
enumerable: true,
|
|
25615
|
+
configurable: true
|
|
25616
|
+
});
|
|
25617
|
+
};
|
|
25618
|
+
/** @type {typeof import('color-convert')} */
|
|
25619
|
+
let colorConvert;
|
|
25620
|
+
const makeDynamicStyles = (wrap$3, targetSpace, identity, isBackground) => {
|
|
25621
|
+
if (colorConvert === void 0) colorConvert = require_color_convert();
|
|
25622
|
+
const offset = isBackground ? 10 : 0;
|
|
25623
|
+
const styles = {};
|
|
25624
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
25625
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
25626
|
+
if (sourceSpace === targetSpace) styles[name] = wrap$3(identity, offset);
|
|
25627
|
+
else if (typeof suite === "object") styles[name] = wrap$3(suite[targetSpace], offset);
|
|
25628
|
+
}
|
|
25629
|
+
return styles;
|
|
25630
|
+
};
|
|
25631
|
+
function assembleStyles() {
|
|
25632
|
+
const codes$1 = /* @__PURE__ */ new Map();
|
|
25633
|
+
const styles = {
|
|
25634
|
+
modifier: {
|
|
25635
|
+
reset: [0, 0],
|
|
25636
|
+
bold: [1, 22],
|
|
25637
|
+
dim: [2, 22],
|
|
25638
|
+
italic: [3, 23],
|
|
25639
|
+
underline: [4, 24],
|
|
25640
|
+
inverse: [7, 27],
|
|
25641
|
+
hidden: [8, 28],
|
|
25642
|
+
strikethrough: [9, 29]
|
|
25643
|
+
},
|
|
25644
|
+
color: {
|
|
25645
|
+
black: [30, 39],
|
|
25646
|
+
red: [31, 39],
|
|
25647
|
+
green: [32, 39],
|
|
25648
|
+
yellow: [33, 39],
|
|
25649
|
+
blue: [34, 39],
|
|
25650
|
+
magenta: [35, 39],
|
|
25651
|
+
cyan: [36, 39],
|
|
25652
|
+
white: [37, 39],
|
|
25653
|
+
blackBright: [90, 39],
|
|
25654
|
+
redBright: [91, 39],
|
|
25655
|
+
greenBright: [92, 39],
|
|
25656
|
+
yellowBright: [93, 39],
|
|
25657
|
+
blueBright: [94, 39],
|
|
25658
|
+
magentaBright: [95, 39],
|
|
25659
|
+
cyanBright: [96, 39],
|
|
25660
|
+
whiteBright: [97, 39]
|
|
25661
|
+
},
|
|
25662
|
+
bgColor: {
|
|
25663
|
+
bgBlack: [40, 49],
|
|
25664
|
+
bgRed: [41, 49],
|
|
25665
|
+
bgGreen: [42, 49],
|
|
25666
|
+
bgYellow: [43, 49],
|
|
25667
|
+
bgBlue: [44, 49],
|
|
25668
|
+
bgMagenta: [45, 49],
|
|
25669
|
+
bgCyan: [46, 49],
|
|
25670
|
+
bgWhite: [47, 49],
|
|
25671
|
+
bgBlackBright: [100, 49],
|
|
25672
|
+
bgRedBright: [101, 49],
|
|
25673
|
+
bgGreenBright: [102, 49],
|
|
25674
|
+
bgYellowBright: [103, 49],
|
|
25675
|
+
bgBlueBright: [104, 49],
|
|
25676
|
+
bgMagentaBright: [105, 49],
|
|
25677
|
+
bgCyanBright: [106, 49],
|
|
25678
|
+
bgWhiteBright: [107, 49]
|
|
25679
|
+
}
|
|
25680
|
+
};
|
|
25681
|
+
styles.color.gray = styles.color.blackBright;
|
|
25682
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
25683
|
+
styles.color.grey = styles.color.blackBright;
|
|
25684
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
25685
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
25686
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
25687
|
+
styles[styleName] = {
|
|
25688
|
+
open: `\u001B[${style[0]}m`,
|
|
25689
|
+
close: `\u001B[${style[1]}m`
|
|
25690
|
+
};
|
|
25691
|
+
group[styleName] = styles[styleName];
|
|
25692
|
+
codes$1.set(style[0], style[1]);
|
|
25693
|
+
}
|
|
25694
|
+
Object.defineProperty(styles, groupName, {
|
|
25695
|
+
value: group,
|
|
25696
|
+
enumerable: false
|
|
25697
|
+
});
|
|
25698
|
+
}
|
|
25699
|
+
Object.defineProperty(styles, "codes", {
|
|
25700
|
+
value: codes$1,
|
|
25701
|
+
enumerable: false
|
|
25702
|
+
});
|
|
25703
|
+
styles.color.close = "\x1B[39m";
|
|
25704
|
+
styles.bgColor.close = "\x1B[49m";
|
|
25705
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
25706
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
25707
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
25708
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
25709
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
25710
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
25711
|
+
return styles;
|
|
25712
|
+
}
|
|
25713
|
+
Object.defineProperty(module, "exports", {
|
|
25714
|
+
enumerable: true,
|
|
25715
|
+
get: assembleStyles
|
|
25716
|
+
});
|
|
25717
|
+
}) });
|
|
25718
|
+
|
|
25719
|
+
//#endregion
|
|
25720
|
+
//#region node_modules/.pnpm/wrap-ansi@6.2.0/node_modules/wrap-ansi/index.js
|
|
25721
|
+
var require_wrap_ansi = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/wrap-ansi@6.2.0/node_modules/wrap-ansi/index.js": ((exports, module) => {
|
|
25722
|
+
const stringWidth = require_string_width();
|
|
25723
|
+
const stripAnsi = require_strip_ansi();
|
|
25724
|
+
const ansiStyles = require_ansi_styles();
|
|
25725
|
+
const ESCAPES = new Set(["\x1B", ""]);
|
|
25726
|
+
const END_CODE = 39;
|
|
25727
|
+
const wrapAnsi$1 = (code) => `${ESCAPES.values().next().value}[${code}m`;
|
|
25728
|
+
const wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
25729
|
+
const wrapWord = (rows, word, columns) => {
|
|
25730
|
+
const characters = [...word];
|
|
25731
|
+
let isInsideEscape = false;
|
|
25732
|
+
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
|
25733
|
+
for (const [index, character] of characters.entries()) {
|
|
25734
|
+
const characterLength = stringWidth(character);
|
|
25735
|
+
if (visible + characterLength <= columns) rows[rows.length - 1] += character;
|
|
25736
|
+
else {
|
|
25737
|
+
rows.push(character);
|
|
25738
|
+
visible = 0;
|
|
25739
|
+
}
|
|
25740
|
+
if (ESCAPES.has(character)) isInsideEscape = true;
|
|
25741
|
+
else if (isInsideEscape && character === "m") {
|
|
25742
|
+
isInsideEscape = false;
|
|
25743
|
+
continue;
|
|
25744
|
+
}
|
|
25745
|
+
if (isInsideEscape) continue;
|
|
25746
|
+
visible += characterLength;
|
|
25747
|
+
if (visible === columns && index < characters.length - 1) {
|
|
25748
|
+
rows.push("");
|
|
25749
|
+
visible = 0;
|
|
25750
|
+
}
|
|
25751
|
+
}
|
|
25752
|
+
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) rows[rows.length - 2] += rows.pop();
|
|
25753
|
+
};
|
|
25754
|
+
const stringVisibleTrimSpacesRight = (str$1) => {
|
|
25755
|
+
const words = str$1.split(" ");
|
|
25756
|
+
let last = words.length;
|
|
25757
|
+
while (last > 0) {
|
|
25758
|
+
if (stringWidth(words[last - 1]) > 0) break;
|
|
25759
|
+
last--;
|
|
25760
|
+
}
|
|
25761
|
+
if (last === words.length) return str$1;
|
|
25762
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
25763
|
+
};
|
|
25764
|
+
const exec = (string, columns, options = {}) => {
|
|
25765
|
+
if (options.trim !== false && string.trim() === "") return "";
|
|
25766
|
+
let pre = "";
|
|
25767
|
+
let ret = "";
|
|
25768
|
+
let escapeCode;
|
|
25769
|
+
const lengths = wordLengths(string);
|
|
25770
|
+
let rows = [""];
|
|
25771
|
+
for (const [index, word] of string.split(" ").entries()) {
|
|
25772
|
+
if (options.trim !== false) rows[rows.length - 1] = rows[rows.length - 1].trimLeft();
|
|
25773
|
+
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
25774
|
+
if (index !== 0) {
|
|
25775
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
25776
|
+
rows.push("");
|
|
25777
|
+
rowLength = 0;
|
|
25778
|
+
}
|
|
25779
|
+
if (rowLength > 0 || options.trim === false) {
|
|
25780
|
+
rows[rows.length - 1] += " ";
|
|
25781
|
+
rowLength++;
|
|
25782
|
+
}
|
|
25783
|
+
}
|
|
25784
|
+
if (options.hard && lengths[index] > columns) {
|
|
25785
|
+
const remainingColumns = columns - rowLength;
|
|
25786
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
25787
|
+
if (Math.floor((lengths[index] - 1) / columns) < breaksStartingThisLine) rows.push("");
|
|
25788
|
+
wrapWord(rows, word, columns);
|
|
25789
|
+
continue;
|
|
25790
|
+
}
|
|
25791
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
25792
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
25793
|
+
wrapWord(rows, word, columns);
|
|
25794
|
+
continue;
|
|
25795
|
+
}
|
|
25796
|
+
rows.push("");
|
|
25797
|
+
}
|
|
25798
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
25799
|
+
wrapWord(rows, word, columns);
|
|
25800
|
+
continue;
|
|
25801
|
+
}
|
|
25802
|
+
rows[rows.length - 1] += word;
|
|
25803
|
+
}
|
|
25804
|
+
if (options.trim !== false) rows = rows.map(stringVisibleTrimSpacesRight);
|
|
25805
|
+
pre = rows.join("\n");
|
|
25806
|
+
for (const [index, character] of [...pre].entries()) {
|
|
25807
|
+
ret += character;
|
|
25808
|
+
if (ESCAPES.has(character)) {
|
|
25809
|
+
const code$1 = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4)));
|
|
25810
|
+
escapeCode = code$1 === END_CODE ? null : code$1;
|
|
25811
|
+
}
|
|
25812
|
+
const code = ansiStyles.codes.get(Number(escapeCode));
|
|
25813
|
+
if (escapeCode && code) {
|
|
25814
|
+
if (pre[index + 1] === "\n") ret += wrapAnsi$1(code);
|
|
25815
|
+
else if (character === "\n") ret += wrapAnsi$1(escapeCode);
|
|
25816
|
+
}
|
|
25817
|
+
}
|
|
25818
|
+
return ret;
|
|
25819
|
+
};
|
|
25820
|
+
module.exports = (string, columns, options) => {
|
|
25821
|
+
return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line$1) => exec(line$1, columns, options)).join("\n");
|
|
25822
|
+
};
|
|
25823
|
+
}) });
|
|
25824
|
+
|
|
25825
|
+
//#endregion
|
|
25826
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
|
25827
|
+
var import_cli_width = /* @__PURE__ */ __toESM(require_cli_width(), 1);
|
|
25828
|
+
var import_wrap_ansi = /* @__PURE__ */ __toESM(require_wrap_ansi(), 1);
|
|
25829
|
+
/**
|
|
25830
|
+
* Force line returns at specific width. This function is ANSI code friendly and it'll
|
|
25831
|
+
* ignore invisible codes during width calculation.
|
|
25832
|
+
* @param {string} content
|
|
25833
|
+
* @param {number} width
|
|
25834
|
+
* @return {string}
|
|
25835
|
+
*/
|
|
25836
|
+
function breakLines(content, width) {
|
|
25837
|
+
return content.split("\n").flatMap((line$1) => (0, import_wrap_ansi.default)(line$1, width, {
|
|
25838
|
+
trim: false,
|
|
25839
|
+
hard: true
|
|
25840
|
+
}).split("\n").map((str$1) => str$1.trimEnd())).join("\n");
|
|
25841
|
+
}
|
|
25842
|
+
/**
|
|
25843
|
+
* Returns the width of the active readline, or 80 as default value.
|
|
25844
|
+
* @returns {number}
|
|
25845
|
+
*/
|
|
25846
|
+
function readlineWidth() {
|
|
25847
|
+
return (0, import_cli_width.default)({
|
|
25848
|
+
defaultWidth: 80,
|
|
25849
|
+
output: readline$1().output
|
|
25850
|
+
});
|
|
25851
|
+
}
|
|
25852
|
+
|
|
25853
|
+
//#endregion
|
|
25854
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
|
25855
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
25856
|
+
const state = useRef({
|
|
25857
|
+
lastPointer: active,
|
|
25858
|
+
lastActive: void 0
|
|
25859
|
+
});
|
|
25860
|
+
const { lastPointer, lastActive } = state.current;
|
|
25861
|
+
const middle = Math.floor(pageSize / 2);
|
|
25862
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
25863
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
25864
|
+
let pointer = defaultPointerPosition;
|
|
25865
|
+
if (renderedLength > pageSize) if (loop) {
|
|
25866
|
+
/**
|
|
25867
|
+
* Creates the next position for the pointer considering an infinitely
|
|
25868
|
+
* looping list of items to be rendered on the page.
|
|
25869
|
+
*
|
|
25870
|
+
* The goal is to progressively move the cursor to the middle position as the user move down, and then keep
|
|
25871
|
+
* the cursor there. When the user move up, maintain the cursor position.
|
|
25872
|
+
*/
|
|
25873
|
+
pointer = lastPointer;
|
|
25874
|
+
if (lastActive != null && lastActive < active && active - lastActive < pageSize) pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
|
25875
|
+
} else {
|
|
25876
|
+
/**
|
|
25877
|
+
* Creates the next position for the pointer considering a finite list of
|
|
25878
|
+
* items to be rendered on a page.
|
|
25879
|
+
*
|
|
25880
|
+
* The goal is to keep the pointer in the middle of the page whenever possible, until
|
|
25881
|
+
* we reach the bounds of the list (top or bottom). In which case, the cursor moves progressively
|
|
25882
|
+
* to the bottom or top of the list.
|
|
25883
|
+
*/
|
|
25884
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
25885
|
+
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
|
25886
|
+
}
|
|
25887
|
+
state.current.lastPointer = pointer;
|
|
25888
|
+
state.current.lastActive = active;
|
|
25889
|
+
return pointer;
|
|
25890
|
+
}
|
|
25891
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
25892
|
+
const width = readlineWidth();
|
|
25893
|
+
const bound = (num) => (num % items.length + items.length) % items.length;
|
|
25894
|
+
const renderedItems = items.map((item, index) => {
|
|
25895
|
+
if (item == null) return [];
|
|
25896
|
+
return breakLines(renderItem({
|
|
25897
|
+
item,
|
|
25898
|
+
index,
|
|
25899
|
+
isActive: index === active
|
|
25900
|
+
}), width).split("\n");
|
|
25901
|
+
});
|
|
25902
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
25903
|
+
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
|
25904
|
+
const pointer = usePointerPosition({
|
|
25905
|
+
active,
|
|
25906
|
+
renderedItems,
|
|
25907
|
+
pageSize,
|
|
25908
|
+
loop
|
|
25909
|
+
});
|
|
25910
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
25911
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
25912
|
+
const pageBuffer = Array.from({ length: pageSize });
|
|
25913
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
25914
|
+
const itemVisited = new Set([active]);
|
|
25915
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
|
25916
|
+
let itemPointer = bound(active + 1);
|
|
25917
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
25918
|
+
const linesToAdd = renderItemAtIndex(itemPointer).slice(0, pageSize - bufferPointer);
|
|
25919
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
25920
|
+
itemVisited.add(itemPointer);
|
|
25921
|
+
bufferPointer += linesToAdd.length;
|
|
25922
|
+
itemPointer = bound(itemPointer + 1);
|
|
25923
|
+
}
|
|
25924
|
+
bufferPointer = activeItemPosition - 1;
|
|
25925
|
+
itemPointer = bound(active - 1);
|
|
25926
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
25927
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
25928
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
25929
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
25930
|
+
itemVisited.add(itemPointer);
|
|
25931
|
+
bufferPointer -= linesToAdd.length;
|
|
25932
|
+
itemPointer = bound(itemPointer - 1);
|
|
25933
|
+
}
|
|
25934
|
+
return pageBuffer.filter((line$1) => typeof line$1 === "string").join("\n");
|
|
25935
|
+
}
|
|
25936
|
+
|
|
25937
|
+
//#endregion
|
|
25938
|
+
//#region node_modules/.pnpm/mute-stream@2.0.0/node_modules/mute-stream/lib/index.js
|
|
25939
|
+
var require_lib = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/mute-stream@2.0.0/node_modules/mute-stream/lib/index.js": ((exports, module) => {
|
|
25940
|
+
const Stream = __require("stream");
|
|
25941
|
+
var MuteStream$1 = class extends Stream {
|
|
25942
|
+
#isTTY = null;
|
|
25943
|
+
constructor(opts = {}) {
|
|
25944
|
+
super(opts);
|
|
25945
|
+
this.writable = this.readable = true;
|
|
25946
|
+
this.muted = false;
|
|
25947
|
+
this.on("pipe", this._onpipe);
|
|
25948
|
+
this.replace = opts.replace;
|
|
25949
|
+
this._prompt = opts.prompt || null;
|
|
25950
|
+
this._hadControl = false;
|
|
25951
|
+
}
|
|
25952
|
+
#destSrc(key$1, def$30) {
|
|
25953
|
+
if (this._dest) return this._dest[key$1];
|
|
25954
|
+
if (this._src) return this._src[key$1];
|
|
25955
|
+
return def$30;
|
|
25956
|
+
}
|
|
25957
|
+
#proxy(method, ...args) {
|
|
25958
|
+
if (typeof this._dest?.[method] === "function") this._dest[method](...args);
|
|
25959
|
+
if (typeof this._src?.[method] === "function") this._src[method](...args);
|
|
25960
|
+
}
|
|
25961
|
+
get isTTY() {
|
|
25962
|
+
if (this.#isTTY !== null) return this.#isTTY;
|
|
25963
|
+
return this.#destSrc("isTTY", false);
|
|
25964
|
+
}
|
|
25965
|
+
set isTTY(val) {
|
|
25966
|
+
this.#isTTY = val;
|
|
25967
|
+
}
|
|
25968
|
+
get rows() {
|
|
25969
|
+
return this.#destSrc("rows");
|
|
25970
|
+
}
|
|
25971
|
+
get columns() {
|
|
25972
|
+
return this.#destSrc("columns");
|
|
25973
|
+
}
|
|
25974
|
+
mute() {
|
|
25975
|
+
this.muted = true;
|
|
25976
|
+
}
|
|
25977
|
+
unmute() {
|
|
25978
|
+
this.muted = false;
|
|
25979
|
+
}
|
|
25980
|
+
_onpipe(src) {
|
|
25981
|
+
this._src = src;
|
|
25982
|
+
}
|
|
25983
|
+
pipe(dest, options) {
|
|
25984
|
+
this._dest = dest;
|
|
25985
|
+
return super.pipe(dest, options);
|
|
25986
|
+
}
|
|
25987
|
+
pause() {
|
|
25988
|
+
if (this._src) return this._src.pause();
|
|
25989
|
+
}
|
|
25990
|
+
resume() {
|
|
25991
|
+
if (this._src) return this._src.resume();
|
|
25992
|
+
}
|
|
25993
|
+
write(c) {
|
|
25994
|
+
if (this.muted) {
|
|
25995
|
+
if (!this.replace) return true;
|
|
25996
|
+
if (c.match(/^\u001b/)) {
|
|
25997
|
+
if (c.indexOf(this._prompt) === 0) {
|
|
25998
|
+
c = c.slice(this._prompt.length);
|
|
25999
|
+
c = c.replace(/./g, this.replace);
|
|
26000
|
+
c = this._prompt + c;
|
|
26001
|
+
}
|
|
26002
|
+
this._hadControl = true;
|
|
26003
|
+
return this.emit("data", c);
|
|
26004
|
+
} else {
|
|
26005
|
+
if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
|
|
26006
|
+
this._hadControl = false;
|
|
26007
|
+
this.emit("data", this._prompt);
|
|
26008
|
+
c = c.slice(this._prompt.length);
|
|
26009
|
+
}
|
|
26010
|
+
c = c.toString().replace(/./g, this.replace);
|
|
26011
|
+
}
|
|
26012
|
+
}
|
|
26013
|
+
this.emit("data", c);
|
|
26014
|
+
}
|
|
26015
|
+
end(c) {
|
|
26016
|
+
if (this.muted) if (c && this.replace) c = c.toString().replace(/./g, this.replace);
|
|
26017
|
+
else c = null;
|
|
26018
|
+
if (c) this.emit("data", c);
|
|
26019
|
+
this.emit("end");
|
|
26020
|
+
}
|
|
26021
|
+
destroy(...args) {
|
|
26022
|
+
return this.#proxy("destroy", ...args);
|
|
26023
|
+
}
|
|
26024
|
+
destroySoon(...args) {
|
|
26025
|
+
return this.#proxy("destroySoon", ...args);
|
|
26026
|
+
}
|
|
26027
|
+
close(...args) {
|
|
26028
|
+
return this.#proxy("close", ...args);
|
|
26029
|
+
}
|
|
26030
|
+
};
|
|
26031
|
+
module.exports = MuteStream$1;
|
|
26032
|
+
}) });
|
|
26033
|
+
|
|
26034
|
+
//#endregion
|
|
26035
|
+
//#region node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
26036
|
+
/**
|
|
26037
|
+
* This is not the set of all possible signals.
|
|
26038
|
+
*
|
|
26039
|
+
* It IS, however, the set of all signals that trigger
|
|
26040
|
+
* an exit on either Linux or BSD systems. Linux is a
|
|
26041
|
+
* superset of the signal names supported on BSD, and
|
|
26042
|
+
* the unknown signals just fail to register, so we can
|
|
26043
|
+
* catch that easily enough.
|
|
26044
|
+
*
|
|
26045
|
+
* Windows signals are a different set, since there are
|
|
26046
|
+
* signals that terminate Windows processes, but don't
|
|
26047
|
+
* terminate (or don't even exist) on Posix systems.
|
|
26048
|
+
*
|
|
26049
|
+
* Don't bother with SIGKILL. It's uncatchable, which
|
|
26050
|
+
* means that we can't fire any callbacks anyway.
|
|
26051
|
+
*
|
|
26052
|
+
* If a user does happen to register a handler on a non-
|
|
26053
|
+
* fatal signal like SIGWINCH or something, and then
|
|
26054
|
+
* exit, it'll end up firing `process.emit('exit')`, so
|
|
26055
|
+
* the handler will be fired anyway.
|
|
26056
|
+
*
|
|
26057
|
+
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
26058
|
+
* artificially, inherently leave the process in a
|
|
26059
|
+
* state from which it is not safe to try and enter JS
|
|
26060
|
+
* listeners.
|
|
26061
|
+
*/
|
|
26062
|
+
const signals = [];
|
|
26063
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
26064
|
+
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
26065
|
+
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
26066
|
+
|
|
26067
|
+
//#endregion
|
|
26068
|
+
//#region node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
26069
|
+
const processOk = (process$3) => !!process$3 && typeof process$3 === "object" && typeof process$3.removeListener === "function" && typeof process$3.emit === "function" && typeof process$3.reallyExit === "function" && typeof process$3.listeners === "function" && typeof process$3.kill === "function" && typeof process$3.pid === "number" && typeof process$3.on === "function";
|
|
26070
|
+
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
26071
|
+
const global$1 = globalThis;
|
|
26072
|
+
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
26073
|
+
var Emitter = class {
|
|
26074
|
+
emitted = {
|
|
26075
|
+
afterExit: false,
|
|
26076
|
+
exit: false
|
|
26077
|
+
};
|
|
26078
|
+
listeners = {
|
|
26079
|
+
afterExit: [],
|
|
26080
|
+
exit: []
|
|
26081
|
+
};
|
|
26082
|
+
count = 0;
|
|
26083
|
+
id = Math.random();
|
|
26084
|
+
constructor() {
|
|
26085
|
+
if (global$1[kExitEmitter]) return global$1[kExitEmitter];
|
|
26086
|
+
ObjectDefineProperty(global$1, kExitEmitter, {
|
|
26087
|
+
value: this,
|
|
26088
|
+
writable: false,
|
|
26089
|
+
enumerable: false,
|
|
26090
|
+
configurable: false
|
|
26091
|
+
});
|
|
26092
|
+
}
|
|
26093
|
+
on(ev, fn) {
|
|
26094
|
+
this.listeners[ev].push(fn);
|
|
26095
|
+
}
|
|
26096
|
+
removeListener(ev, fn) {
|
|
26097
|
+
const list = this.listeners[ev];
|
|
26098
|
+
const i$3 = list.indexOf(fn);
|
|
26099
|
+
/* c8 ignore start */
|
|
26100
|
+
if (i$3 === -1) return;
|
|
26101
|
+
/* c8 ignore stop */
|
|
26102
|
+
if (i$3 === 0 && list.length === 1) list.length = 0;
|
|
26103
|
+
else list.splice(i$3, 1);
|
|
26104
|
+
}
|
|
26105
|
+
emit(ev, code, signal) {
|
|
26106
|
+
if (this.emitted[ev]) return false;
|
|
26107
|
+
this.emitted[ev] = true;
|
|
26108
|
+
let ret = false;
|
|
26109
|
+
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
26110
|
+
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
26111
|
+
return ret;
|
|
26112
|
+
}
|
|
26113
|
+
};
|
|
26114
|
+
var SignalExitBase = class {};
|
|
26115
|
+
const signalExitWrap = (handler) => {
|
|
26116
|
+
return {
|
|
26117
|
+
onExit(cb, opts) {
|
|
26118
|
+
return handler.onExit(cb, opts);
|
|
26119
|
+
},
|
|
26120
|
+
load() {
|
|
26121
|
+
return handler.load();
|
|
26122
|
+
},
|
|
26123
|
+
unload() {
|
|
26124
|
+
return handler.unload();
|
|
26125
|
+
}
|
|
26126
|
+
};
|
|
26127
|
+
};
|
|
26128
|
+
var SignalExitFallback = class extends SignalExitBase {
|
|
26129
|
+
onExit() {
|
|
26130
|
+
return () => {};
|
|
26131
|
+
}
|
|
26132
|
+
load() {}
|
|
26133
|
+
unload() {}
|
|
26134
|
+
};
|
|
26135
|
+
var SignalExit = class extends SignalExitBase {
|
|
26136
|
+
/* c8 ignore start */
|
|
26137
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
26138
|
+
/* c8 ignore stop */
|
|
26139
|
+
#emitter = new Emitter();
|
|
26140
|
+
#process;
|
|
26141
|
+
#originalProcessEmit;
|
|
26142
|
+
#originalProcessReallyExit;
|
|
26143
|
+
#sigListeners = {};
|
|
26144
|
+
#loaded = false;
|
|
26145
|
+
constructor(process$3) {
|
|
26146
|
+
super();
|
|
26147
|
+
this.#process = process$3;
|
|
26148
|
+
this.#sigListeners = {};
|
|
26149
|
+
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
26150
|
+
const listeners = this.#process.listeners(sig);
|
|
26151
|
+
let { count } = this.#emitter;
|
|
26152
|
+
/* c8 ignore start */
|
|
26153
|
+
const p = process$3;
|
|
26154
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
26155
|
+
/* c8 ignore stop */
|
|
26156
|
+
if (listeners.length === count) {
|
|
26157
|
+
this.unload();
|
|
26158
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
26159
|
+
/* c8 ignore start */
|
|
26160
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
26161
|
+
if (!ret) process$3.kill(process$3.pid, s);
|
|
26162
|
+
}
|
|
26163
|
+
};
|
|
26164
|
+
this.#originalProcessReallyExit = process$3.reallyExit;
|
|
26165
|
+
this.#originalProcessEmit = process$3.emit;
|
|
26166
|
+
}
|
|
26167
|
+
onExit(cb, opts) {
|
|
26168
|
+
/* c8 ignore start */
|
|
26169
|
+
if (!processOk(this.#process)) return () => {};
|
|
26170
|
+
/* c8 ignore stop */
|
|
26171
|
+
if (this.#loaded === false) this.load();
|
|
26172
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
26173
|
+
this.#emitter.on(ev, cb);
|
|
26174
|
+
return () => {
|
|
26175
|
+
this.#emitter.removeListener(ev, cb);
|
|
26176
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
|
26177
|
+
};
|
|
26178
|
+
}
|
|
26179
|
+
load() {
|
|
26180
|
+
if (this.#loaded) return;
|
|
26181
|
+
this.#loaded = true;
|
|
26182
|
+
this.#emitter.count += 1;
|
|
26183
|
+
for (const sig of signals) try {
|
|
26184
|
+
const fn = this.#sigListeners[sig];
|
|
26185
|
+
if (fn) this.#process.on(sig, fn);
|
|
26186
|
+
} catch (_$1) {}
|
|
26187
|
+
this.#process.emit = (ev, ...a) => {
|
|
26188
|
+
return this.#processEmit(ev, ...a);
|
|
26189
|
+
};
|
|
26190
|
+
this.#process.reallyExit = (code) => {
|
|
26191
|
+
return this.#processReallyExit(code);
|
|
26192
|
+
};
|
|
26193
|
+
}
|
|
26194
|
+
unload() {
|
|
26195
|
+
if (!this.#loaded) return;
|
|
26196
|
+
this.#loaded = false;
|
|
26197
|
+
signals.forEach((sig) => {
|
|
26198
|
+
const listener = this.#sigListeners[sig];
|
|
26199
|
+
/* c8 ignore start */
|
|
26200
|
+
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
|
26201
|
+
/* c8 ignore stop */
|
|
26202
|
+
try {
|
|
26203
|
+
this.#process.removeListener(sig, listener);
|
|
26204
|
+
} catch (_$1) {}
|
|
26205
|
+
/* c8 ignore stop */
|
|
26206
|
+
});
|
|
26207
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
26208
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
26209
|
+
this.#emitter.count -= 1;
|
|
26210
|
+
}
|
|
26211
|
+
#processReallyExit(code) {
|
|
26212
|
+
/* c8 ignore start */
|
|
26213
|
+
if (!processOk(this.#process)) return 0;
|
|
26214
|
+
this.#process.exitCode = code || 0;
|
|
26215
|
+
/* c8 ignore stop */
|
|
26216
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
26217
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
26218
|
+
}
|
|
26219
|
+
#processEmit(ev, ...args) {
|
|
26220
|
+
const og = this.#originalProcessEmit;
|
|
26221
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
26222
|
+
if (typeof args[0] === "number") this.#process.exitCode = args[0];
|
|
26223
|
+
/* c8 ignore start */
|
|
26224
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
26225
|
+
/* c8 ignore start */
|
|
26226
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
26227
|
+
/* c8 ignore stop */
|
|
26228
|
+
return ret;
|
|
26229
|
+
} else return og.call(this.#process, ev, ...args);
|
|
26230
|
+
}
|
|
26231
|
+
};
|
|
26232
|
+
const process$2 = globalThis.process;
|
|
26233
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
26234
|
+
|
|
26235
|
+
//#endregion
|
|
26236
|
+
//#region node_modules/.pnpm/@inquirer+ansi@1.0.2/node_modules/@inquirer/ansi/dist/esm/index.js
|
|
26237
|
+
const ESC = "\x1B[";
|
|
26238
|
+
/** Move cursor to first column */
|
|
26239
|
+
const cursorLeft = ESC + "G";
|
|
26240
|
+
/** Hide the cursor */
|
|
26241
|
+
const cursorHide = ESC + "?25l";
|
|
26242
|
+
/** Show the cursor */
|
|
26243
|
+
const cursorShow = ESC + "?25h";
|
|
26244
|
+
/** Move cursor up by count rows */
|
|
26245
|
+
const cursorUp = (rows = 1) => rows > 0 ? `${ESC}${rows}A` : "";
|
|
26246
|
+
/** Move cursor down by count rows */
|
|
26247
|
+
const cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : "";
|
|
26248
|
+
/** Move cursor to position (x, y) */
|
|
26249
|
+
const cursorTo = (x, y) => {
|
|
26250
|
+
if (typeof y === "number" && !Number.isNaN(y)) return `${ESC}${y + 1};${x + 1}H`;
|
|
26251
|
+
return `${ESC}${x + 1}G`;
|
|
26252
|
+
};
|
|
26253
|
+
const eraseLine = ESC + "2K";
|
|
26254
|
+
/** Erase the specified number of lines above the cursor */
|
|
26255
|
+
const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
26256
|
+
|
|
26257
|
+
//#endregion
|
|
26258
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
|
26259
|
+
const height = (content) => content.split("\n").length;
|
|
26260
|
+
const lastLine = (content) => content.split("\n").pop() ?? "";
|
|
26261
|
+
var ScreenManager = class {
|
|
26262
|
+
height = 0;
|
|
26263
|
+
extraLinesUnderPrompt = 0;
|
|
26264
|
+
cursorPos;
|
|
26265
|
+
rl;
|
|
26266
|
+
constructor(rl) {
|
|
26267
|
+
this.rl = rl;
|
|
26268
|
+
this.cursorPos = rl.getCursorPos();
|
|
26269
|
+
}
|
|
26270
|
+
write(content) {
|
|
26271
|
+
this.rl.output.unmute();
|
|
26272
|
+
this.rl.output.write(content);
|
|
26273
|
+
this.rl.output.mute();
|
|
26274
|
+
}
|
|
26275
|
+
render(content, bottomContent = "") {
|
|
26276
|
+
const rawPromptLine = stripVTControlCharacters(lastLine(content));
|
|
26277
|
+
let prompt = rawPromptLine;
|
|
26278
|
+
if (this.rl.line.length > 0) prompt = prompt.slice(0, -this.rl.line.length);
|
|
26279
|
+
this.rl.setPrompt(prompt);
|
|
26280
|
+
this.cursorPos = this.rl.getCursorPos();
|
|
26281
|
+
const width = readlineWidth();
|
|
26282
|
+
content = breakLines(content, width);
|
|
26283
|
+
bottomContent = breakLines(bottomContent, width);
|
|
26284
|
+
if (rawPromptLine.length % width === 0) content += "\n";
|
|
26285
|
+
let output = content + (bottomContent ? "\n" + bottomContent : "");
|
|
26286
|
+
const bottomContentHeight = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows + (bottomContent ? height(bottomContent) : 0);
|
|
26287
|
+
if (bottomContentHeight > 0) output += cursorUp(bottomContentHeight);
|
|
26288
|
+
output += cursorTo(this.cursorPos.cols);
|
|
26289
|
+
/**
|
|
26290
|
+
* Render and store state for future re-rendering
|
|
26291
|
+
*/
|
|
26292
|
+
this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
|
|
26293
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
|
26294
|
+
this.height = height(output);
|
|
26295
|
+
}
|
|
26296
|
+
checkCursorPos() {
|
|
26297
|
+
const cursorPos = this.rl.getCursorPos();
|
|
26298
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
|
26299
|
+
this.write(cursorTo(cursorPos.cols));
|
|
26300
|
+
this.cursorPos = cursorPos;
|
|
26301
|
+
}
|
|
26302
|
+
}
|
|
26303
|
+
done({ clearContent }) {
|
|
26304
|
+
this.rl.setPrompt("");
|
|
26305
|
+
let output = cursorDown(this.extraLinesUnderPrompt);
|
|
26306
|
+
output += clearContent ? eraseLines(this.height) : "\n";
|
|
26307
|
+
output += cursorShow;
|
|
26308
|
+
this.write(output);
|
|
26309
|
+
this.rl.close();
|
|
26310
|
+
}
|
|
26311
|
+
};
|
|
26312
|
+
|
|
26313
|
+
//#endregion
|
|
26314
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
|
26315
|
+
var PromisePolyfill = class extends Promise {
|
|
26316
|
+
static withResolver() {
|
|
26317
|
+
let resolve$4;
|
|
26318
|
+
let reject;
|
|
26319
|
+
return {
|
|
26320
|
+
promise: new Promise((res, rej) => {
|
|
26321
|
+
resolve$4 = res;
|
|
26322
|
+
reject = rej;
|
|
26323
|
+
}),
|
|
26324
|
+
resolve: resolve$4,
|
|
26325
|
+
reject
|
|
26326
|
+
};
|
|
26327
|
+
}
|
|
26328
|
+
};
|
|
26329
|
+
|
|
26330
|
+
//#endregion
|
|
26331
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
26332
|
+
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
26333
|
+
function getCallSites() {
|
|
26334
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
|
26335
|
+
let result = [];
|
|
26336
|
+
try {
|
|
26337
|
+
Error.prepareStackTrace = (_$1, callSites) => {
|
|
26338
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
|
26339
|
+
result = callSitesWithoutCurrent;
|
|
26340
|
+
return callSitesWithoutCurrent;
|
|
26341
|
+
};
|
|
26342
|
+
(/* @__PURE__ */ new Error()).stack;
|
|
26343
|
+
} catch {
|
|
26344
|
+
return result;
|
|
26345
|
+
}
|
|
26346
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
|
26347
|
+
return result;
|
|
26348
|
+
}
|
|
26349
|
+
function createPrompt(view) {
|
|
26350
|
+
const callSites = getCallSites();
|
|
26351
|
+
const prompt = (config, context = {}) => {
|
|
26352
|
+
const { input = process.stdin, signal } = context;
|
|
26353
|
+
const cleanups = /* @__PURE__ */ new Set();
|
|
26354
|
+
const output = new import_lib.default();
|
|
26355
|
+
output.pipe(context.output ?? process.stdout);
|
|
26356
|
+
const rl = readline.createInterface({
|
|
26357
|
+
terminal: true,
|
|
26358
|
+
input,
|
|
26359
|
+
output
|
|
26360
|
+
});
|
|
26361
|
+
const screen = new ScreenManager(rl);
|
|
26362
|
+
const { promise, resolve: resolve$4, reject } = PromisePolyfill.withResolver();
|
|
26363
|
+
const cancel = () => reject(new CancelPromptError());
|
|
26364
|
+
if (signal) {
|
|
26365
|
+
const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
|
|
26366
|
+
if (signal.aborted) {
|
|
26367
|
+
abort();
|
|
26368
|
+
return Object.assign(promise, { cancel });
|
|
26369
|
+
}
|
|
26370
|
+
signal.addEventListener("abort", abort);
|
|
26371
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
|
26372
|
+
}
|
|
26373
|
+
cleanups.add(onExit((code, signal$1) => {
|
|
26374
|
+
reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal$1}`));
|
|
26375
|
+
}));
|
|
26376
|
+
const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
26377
|
+
rl.on("SIGINT", sigint);
|
|
26378
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
|
26379
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
|
26380
|
+
rl.input.on("keypress", checkCursorPos);
|
|
26381
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
26382
|
+
return withHooks(rl, (cycle) => {
|
|
26383
|
+
const hooksCleanup = AsyncResource.bind(() => effectScheduler.clearAll());
|
|
26384
|
+
rl.on("close", hooksCleanup);
|
|
26385
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
26386
|
+
cycle(() => {
|
|
26387
|
+
try {
|
|
26388
|
+
const nextView = view(config, (value) => {
|
|
26389
|
+
setImmediate(() => resolve$4(value));
|
|
26390
|
+
});
|
|
26391
|
+
if (nextView === void 0) {
|
|
26392
|
+
const callerFilename = callSites[1]?.getFileName();
|
|
26393
|
+
throw new Error(`Prompt functions must return a string.\n at ${callerFilename}`);
|
|
26394
|
+
}
|
|
26395
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
26396
|
+
screen.render(content, bottomContent);
|
|
26397
|
+
effectScheduler.run();
|
|
26398
|
+
} catch (error$2) {
|
|
26399
|
+
reject(error$2);
|
|
26400
|
+
}
|
|
26401
|
+
});
|
|
26402
|
+
return Object.assign(promise.then((answer) => {
|
|
26403
|
+
effectScheduler.clearAll();
|
|
26404
|
+
return answer;
|
|
26405
|
+
}, (error$2) => {
|
|
26406
|
+
effectScheduler.clearAll();
|
|
26407
|
+
throw error$2;
|
|
26408
|
+
}).finally(() => {
|
|
26409
|
+
cleanups.forEach((cleanup) => cleanup());
|
|
26410
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
|
26411
|
+
output.end();
|
|
26412
|
+
}).then(() => promise), { cancel });
|
|
26413
|
+
});
|
|
26414
|
+
};
|
|
26415
|
+
return prompt;
|
|
26416
|
+
}
|
|
26417
|
+
|
|
26418
|
+
//#endregion
|
|
26419
|
+
//#region node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.1/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
|
26420
|
+
var import_yoctocolors_cjs = /* @__PURE__ */ __toESM(require_yoctocolors_cjs(), 1);
|
|
26421
|
+
/**
|
|
26422
|
+
* Separator object
|
|
26423
|
+
* Used to space/separate choices group
|
|
26424
|
+
*/
|
|
26425
|
+
var Separator = class {
|
|
26426
|
+
separator = import_yoctocolors_cjs.default.dim(Array.from({ length: 15 }).join(esm_default$1.line));
|
|
26427
|
+
type = "separator";
|
|
26428
|
+
constructor(separator) {
|
|
26429
|
+
if (separator) this.separator = separator;
|
|
26430
|
+
}
|
|
26431
|
+
static isSeparator(choice) {
|
|
26432
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
26433
|
+
}
|
|
26434
|
+
};
|
|
26435
|
+
|
|
26436
|
+
//#endregion
|
|
26437
|
+
//#region src/cli/prompts/multiSelect.ts
|
|
26438
|
+
const checkboxTheme = {
|
|
26439
|
+
icon: {
|
|
26440
|
+
checked: tone.success(esm_default.circleFilled),
|
|
26441
|
+
unchecked: esm_default.circle,
|
|
26442
|
+
cursor: esm_default.pointer
|
|
26443
|
+
},
|
|
26444
|
+
style: {
|
|
26445
|
+
disabledChoice: (text) => tone.muted(`- ${text}`),
|
|
26446
|
+
renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "),
|
|
26447
|
+
description: (text) => tone.info(text),
|
|
26448
|
+
keysHelpTip: (keys) => keys.map(([key$1, action]) => `${tone.bold(key$1)} ${tone.muted(action)}`).join(tone.muted(" • "))
|
|
26449
|
+
},
|
|
26450
|
+
helpMode: "always",
|
|
26451
|
+
keybindings: []
|
|
26452
|
+
};
|
|
26453
|
+
const isSelectable = (item) => !Separator.isSeparator(item) && !item.disabled;
|
|
26454
|
+
const isChecked = (item) => isSelectable(item) && item.checked === true;
|
|
26455
|
+
function normalizeChoices(choices, defaultChecked) {
|
|
26456
|
+
return choices.map((choice) => ({
|
|
26457
|
+
value: choice.value,
|
|
26458
|
+
name: choice.label,
|
|
26459
|
+
short: choice.label,
|
|
26460
|
+
checkedName: choice.label,
|
|
26461
|
+
description: choice.description,
|
|
26462
|
+
checked: choice.checked ?? defaultChecked,
|
|
26463
|
+
disabled: false
|
|
26464
|
+
}));
|
|
26465
|
+
}
|
|
26466
|
+
function buildPreview(command$1, selected) {
|
|
26467
|
+
if (!command$1) return void 0;
|
|
26468
|
+
const label = command$1.label ?? "Command";
|
|
26469
|
+
const base = command$1.base.trim();
|
|
26470
|
+
const renderedArgs = [...command$1.staticArgs?.filter(Boolean) ?? [], ...selected].map((arg) => tone.primary(arg)).join(" ");
|
|
26471
|
+
const renderedBase = tone.bold(tone.accent(base));
|
|
26472
|
+
const suffix = renderedArgs.length ? ` ${renderedArgs}` : tone.muted(" <none>");
|
|
26473
|
+
return `${tone.info(`${label}:`)} ${renderedBase}${suffix}`;
|
|
26474
|
+
}
|
|
26475
|
+
const promptImpl = createPrompt((config, done) => {
|
|
26476
|
+
const { instructions, pageSize = 12, loop = false, required, validate = () => true, defaultChecked = false, command: command$1 } = config;
|
|
26477
|
+
const shortcuts = {
|
|
26478
|
+
all: "a",
|
|
26479
|
+
invert: "i",
|
|
26480
|
+
...config.shortcuts
|
|
26481
|
+
};
|
|
26482
|
+
const theme = makeTheme(checkboxTheme, config.theme);
|
|
26483
|
+
const { keybindings } = theme;
|
|
26484
|
+
const [status$1, setStatus] = useState("idle");
|
|
26485
|
+
const prefix = usePrefix({
|
|
26486
|
+
status: status$1,
|
|
26487
|
+
theme
|
|
26488
|
+
});
|
|
26489
|
+
const [items, setItems] = useState(normalizeChoices(config.choices, defaultChecked));
|
|
26490
|
+
const bounds = useMemo(() => {
|
|
26491
|
+
const first = items.findIndex(isSelectable);
|
|
26492
|
+
let last = -1;
|
|
26493
|
+
for (let i$3 = items.length - 1; i$3 >= 0; i$3 -= 1) if (isSelectable(items[i$3])) {
|
|
26494
|
+
last = i$3;
|
|
26495
|
+
break;
|
|
26496
|
+
}
|
|
26497
|
+
if (first === -1) throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled.");
|
|
26498
|
+
return {
|
|
26499
|
+
first,
|
|
26500
|
+
last
|
|
26501
|
+
};
|
|
26502
|
+
}, [items]);
|
|
26503
|
+
const [active, setActive] = useState(bounds.first);
|
|
26504
|
+
const [errorMsg, setError] = useState();
|
|
26505
|
+
useKeypress(async (key$1) => {
|
|
26506
|
+
if (key$1.name === shortcuts.all) {
|
|
26507
|
+
const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
|
|
26508
|
+
setItems(items.map((choice) => isSelectable(choice) ? {
|
|
26509
|
+
...choice,
|
|
26510
|
+
checked: selectAll
|
|
26511
|
+
} : choice));
|
|
26512
|
+
setError(void 0);
|
|
26513
|
+
return;
|
|
26514
|
+
}
|
|
26515
|
+
if (key$1.name === shortcuts.invert) {
|
|
26516
|
+
setItems(items.map((choice) => isSelectable(choice) ? {
|
|
26517
|
+
...choice,
|
|
26518
|
+
checked: !choice.checked
|
|
26519
|
+
} : choice));
|
|
26520
|
+
setError(void 0);
|
|
26521
|
+
return;
|
|
26522
|
+
}
|
|
26523
|
+
if (isSpaceKey(key$1)) {
|
|
26524
|
+
setItems(items.map((choice, idx) => idx === active ? {
|
|
26525
|
+
...choice,
|
|
26526
|
+
checked: !choice.checked
|
|
26527
|
+
} : choice));
|
|
26528
|
+
setError(void 0);
|
|
26529
|
+
return;
|
|
26530
|
+
}
|
|
26531
|
+
if (isEnterKey(key$1)) {
|
|
26532
|
+
const selection = items.filter(isChecked);
|
|
26533
|
+
const isValid = await validate([...selection]);
|
|
26534
|
+
if (required && !selection.length) setError("At least one choice must be selected");
|
|
26535
|
+
else if (isValid === true) {
|
|
26536
|
+
setStatus("done");
|
|
26537
|
+
done(selection.map((choice) => choice.value));
|
|
26538
|
+
} else setError(typeof isValid === "string" ? isValid : "You must select a valid value");
|
|
26539
|
+
return;
|
|
26540
|
+
}
|
|
26541
|
+
if (isUpKey(key$1, keybindings) || isDownKey(key$1, keybindings)) {
|
|
26542
|
+
if (loop || isUpKey(key$1, keybindings) && active !== bounds.first || isDownKey(key$1, keybindings) && active !== bounds.last) {
|
|
26543
|
+
const offset = isUpKey(key$1, keybindings) ? -1 : 1;
|
|
26544
|
+
let next = active;
|
|
26545
|
+
do
|
|
26546
|
+
next = (next + offset + items.length) % items.length;
|
|
26547
|
+
while (!isSelectable(items[next]));
|
|
26548
|
+
setActive(next);
|
|
26549
|
+
}
|
|
26550
|
+
return;
|
|
26551
|
+
}
|
|
26552
|
+
if (isNumberKey(key$1)) {
|
|
26553
|
+
const selectedIndex = Number(key$1.name) - 1;
|
|
26554
|
+
let selectableIndex = -1;
|
|
26555
|
+
const position = items.findIndex((item) => {
|
|
26556
|
+
if (Separator.isSeparator(item)) return false;
|
|
26557
|
+
selectableIndex += 1;
|
|
26558
|
+
return selectableIndex === selectedIndex;
|
|
26559
|
+
});
|
|
26560
|
+
const selectedItem = items[position];
|
|
26561
|
+
if (selectedItem && isSelectable(selectedItem)) {
|
|
26562
|
+
setActive(position);
|
|
26563
|
+
setItems(items.map((choice, i$3) => i$3 === position ? {
|
|
26564
|
+
...choice,
|
|
26565
|
+
checked: !choice.checked
|
|
26566
|
+
} : choice));
|
|
26567
|
+
}
|
|
26568
|
+
}
|
|
26569
|
+
});
|
|
26570
|
+
const message = theme.style.message(config.message, status$1);
|
|
26571
|
+
const preview = buildPreview(command$1, items.filter(isChecked).map((c) => c.value));
|
|
26572
|
+
let description;
|
|
26573
|
+
const page = usePagination({
|
|
26574
|
+
items,
|
|
26575
|
+
active,
|
|
26576
|
+
renderItem({ item, isActive }) {
|
|
26577
|
+
if (Separator.isSeparator(item)) return ` ${item.separator}`;
|
|
26578
|
+
if (item.disabled) {
|
|
26579
|
+
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
26580
|
+
return theme.style.disabledChoice(`${item.name} ${disabledLabel}`);
|
|
26581
|
+
}
|
|
26582
|
+
if (isActive && config.showActiveDescription) description = item.description;
|
|
26583
|
+
const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked;
|
|
26584
|
+
const name = item.checked ? item.checkedName : item.name;
|
|
26585
|
+
return (isActive ? theme.style.highlight : (x) => x)(`${isActive ? theme.icon.cursor : " "}${checkbox} ${name}`);
|
|
26586
|
+
},
|
|
26587
|
+
pageSize,
|
|
26588
|
+
loop
|
|
26589
|
+
});
|
|
26590
|
+
if (status$1 === "done") {
|
|
26591
|
+
const selection = items.filter(isChecked);
|
|
26592
|
+
return [
|
|
26593
|
+
prefix,
|
|
26594
|
+
message,
|
|
26595
|
+
theme.style.answer(theme.style.renderSelectedChoices(selection, items))
|
|
26596
|
+
].filter(Boolean).join(" ");
|
|
26597
|
+
}
|
|
26598
|
+
let helpLine;
|
|
26599
|
+
if (theme.helpMode !== "never" && instructions !== false) if (typeof instructions === "string") helpLine = instructions;
|
|
26600
|
+
else {
|
|
26601
|
+
const keys = [["↑↓", "navigate"], ["space", "select"]];
|
|
26602
|
+
if (shortcuts.all) keys.push([shortcuts.all, "all"]);
|
|
26603
|
+
if (shortcuts.invert) keys.push([shortcuts.invert, "invert"]);
|
|
26604
|
+
keys.push(["⏎", "submit"]);
|
|
26605
|
+
helpLine = theme.style.keysHelpTip(keys);
|
|
26606
|
+
}
|
|
26607
|
+
return [
|
|
26608
|
+
[prefix, message].filter(Boolean).join(" "),
|
|
26609
|
+
page,
|
|
26610
|
+
" ",
|
|
26611
|
+
preview,
|
|
26612
|
+
description ? theme.style.description(description) : "",
|
|
26613
|
+
errorMsg ? theme.style.error(errorMsg) : "",
|
|
26614
|
+
helpLine
|
|
26615
|
+
].filter(Boolean).join("\n").trimEnd();
|
|
26616
|
+
});
|
|
26617
|
+
function promptMultiSelect(options) {
|
|
26618
|
+
return promptImpl(options);
|
|
26619
|
+
}
|
|
26620
|
+
|
|
26621
|
+
//#endregion
|
|
26622
|
+
//#region src/cli/commands/install.ts
|
|
26623
|
+
function normalizeSourcePath(source) {
|
|
26624
|
+
return source.startsWith("file://") ? new URL(source).pathname : source;
|
|
26625
|
+
}
|
|
26626
|
+
function ensureDir(dir) {
|
|
26627
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
26628
|
+
}
|
|
26629
|
+
function installSkillDir(skillDir, targetRoot, force = false) {
|
|
26630
|
+
const skillFile = join(skillDir, "SKILL.md");
|
|
26631
|
+
if (!existsSync(skillFile)) throw new Error(`No SKILL.md found in ${skillDir}`);
|
|
26632
|
+
const skillName = parseSkillFile(skillFile).frontmatter.name;
|
|
26633
|
+
const destDir = join(targetRoot, skillName);
|
|
26634
|
+
ensureDir(targetRoot);
|
|
26635
|
+
if (!force && existsSync(destDir)) throw new Error(`Skill '${skillName}' already exists at ${destDir} (use --force/--override to overwrite)`);
|
|
26636
|
+
cpSync(skillDir, destDir, {
|
|
26637
|
+
recursive: true,
|
|
26638
|
+
force: true
|
|
26639
|
+
});
|
|
26640
|
+
return destDir;
|
|
26641
|
+
}
|
|
26642
|
+
var MultiSkillSelectionError = class extends Error {
|
|
26643
|
+
constructor(message, listing) {
|
|
26644
|
+
super(message);
|
|
26645
|
+
this.listing = listing;
|
|
26646
|
+
this.name = "MultiSkillSelectionError";
|
|
26647
|
+
}
|
|
26648
|
+
};
|
|
26649
|
+
async function installCommand(argv) {
|
|
26650
|
+
if (argv.noColor || process.env.FORCE_COLOR === "0") setColorEnabled(false);
|
|
26651
|
+
if (argv.color) setColorEnabled(true);
|
|
26652
|
+
try {
|
|
26653
|
+
const targetRoot = argv.global ? join(process.env.HOME ?? "~", ".claude/skills") : join(process.cwd(), ".claude/skills");
|
|
26654
|
+
const materialized = await materializeSource(argv.source);
|
|
26655
|
+
const targets = resolveInstallTargets(materialized.base, argv.use ?? materialized.useHint);
|
|
26656
|
+
if (targets.length === 0) throw new Error(`No skills found to install in ${materialized.base}`);
|
|
26657
|
+
const force = argv.force === true || argv.override === true;
|
|
26658
|
+
const selection = await selectSkills(targets, argv, argv.source);
|
|
26659
|
+
const installed = [];
|
|
26660
|
+
for (const entry of selection) installed.push(installSkillDir(entry.dir, targetRoot, force));
|
|
26661
|
+
console.log(success(`Installed ${installed.length} skill(s):`));
|
|
26662
|
+
installed.forEach((d) => console.log(` - ${d}`));
|
|
26663
|
+
} catch (err) {
|
|
26664
|
+
if (err instanceof MultiSkillSelectionError) {
|
|
26665
|
+
const advisory = warn(`Input needed: ${err.message}`);
|
|
26666
|
+
console.log(advisory);
|
|
26667
|
+
console.log(err.listing.trimEnd());
|
|
26668
|
+
console.log(`\n${advisory}`);
|
|
26669
|
+
} else console.error(error(`Install failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
26670
|
+
process.exitCode = 1;
|
|
26671
|
+
}
|
|
26672
|
+
}
|
|
26673
|
+
function parseGithubTree(url) {
|
|
26674
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
26675
|
+
if (parts.length >= 4 && parts[2] === "tree") {
|
|
26676
|
+
const [owner, repo, , ref, ...rest] = parts;
|
|
26677
|
+
return {
|
|
26678
|
+
repo: `https://github.com/${owner}/${repo}.git`,
|
|
26679
|
+
ref,
|
|
26680
|
+
subdir: rest.length ? rest.join("/") : void 0
|
|
26681
|
+
};
|
|
26682
|
+
}
|
|
26683
|
+
return null;
|
|
26684
|
+
}
|
|
26685
|
+
function parseGithubBlob(url) {
|
|
26686
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
26687
|
+
if (parts.length >= 5 && parts[2] === "blob") {
|
|
26688
|
+
const [owner, repo, , ref, ...rest] = parts;
|
|
26689
|
+
return {
|
|
26690
|
+
repo: `https://github.com/${owner}/${repo}.git`,
|
|
26691
|
+
ref,
|
|
26692
|
+
path: rest.join("/")
|
|
26693
|
+
};
|
|
26694
|
+
}
|
|
26695
|
+
return null;
|
|
26696
|
+
}
|
|
26697
|
+
async function materializeSource(source) {
|
|
26698
|
+
if (source.startsWith("file://")) return { base: new URL(source).pathname };
|
|
26699
|
+
if (source.startsWith("http://") || source.startsWith("https://") || source.endsWith(".git")) {
|
|
26700
|
+
let repo = source;
|
|
26701
|
+
let ref;
|
|
26702
|
+
let subdir;
|
|
26703
|
+
let useHint;
|
|
26704
|
+
try {
|
|
26705
|
+
const url = new URL(source);
|
|
26706
|
+
const ghTree = parseGithubTree(url);
|
|
26707
|
+
if (ghTree) {
|
|
26708
|
+
repo = ghTree.repo;
|
|
26709
|
+
ref = ghTree.ref;
|
|
26710
|
+
subdir = ghTree.subdir;
|
|
26711
|
+
} else {
|
|
26712
|
+
const ghBlob = parseGithubBlob(url);
|
|
26713
|
+
if (ghBlob) {
|
|
26714
|
+
repo = ghBlob.repo;
|
|
26715
|
+
ref = ghBlob.ref;
|
|
26716
|
+
useHint = ghBlob.path;
|
|
26717
|
+
}
|
|
26718
|
+
}
|
|
26719
|
+
} catch {}
|
|
26720
|
+
const tmp = mkdtempSync(join(tmpdir(), "ccski-install-"));
|
|
26721
|
+
const clone = [
|
|
26722
|
+
"git",
|
|
26723
|
+
"clone",
|
|
26724
|
+
"--depth",
|
|
26725
|
+
"1"
|
|
26726
|
+
];
|
|
26727
|
+
if (ref) clone.push("--branch", ref);
|
|
26728
|
+
clone.push(repo, tmp);
|
|
26729
|
+
execSync(clone.join(" "), { stdio: "ignore" });
|
|
26730
|
+
return {
|
|
26731
|
+
base: subdir ? join(tmp, subdir) : tmp,
|
|
26732
|
+
useHint
|
|
26733
|
+
};
|
|
26734
|
+
}
|
|
26735
|
+
return { base: normalizeSourcePath(source) };
|
|
26736
|
+
}
|
|
26737
|
+
function resolveSkillPath(baseDir, rel) {
|
|
26738
|
+
const cleaned = rel.replace(/^\.\//, "");
|
|
26739
|
+
const candidates = [];
|
|
26740
|
+
if (cleaned.endsWith("SKILL.md")) {
|
|
26741
|
+
candidates.push(dirname(join(baseDir, cleaned)));
|
|
26742
|
+
candidates.push(dirname(join(baseDir, "..", cleaned)));
|
|
26743
|
+
} else {
|
|
26744
|
+
candidates.push(join(baseDir, cleaned));
|
|
26745
|
+
candidates.push(join(baseDir, "..", cleaned));
|
|
26746
|
+
}
|
|
26747
|
+
for (const dir of candidates) if (existsSync(join(dir, "SKILL.md"))) return dir;
|
|
26748
|
+
return null;
|
|
26749
|
+
}
|
|
26750
|
+
function marketplaceSkills(marketplacePath) {
|
|
26751
|
+
const data = JSON.parse(readFileSync(marketplacePath, "utf8"));
|
|
26752
|
+
const dir = dirname(marketplacePath);
|
|
26753
|
+
const plugins = Array.isArray(data.plugins) ? data.plugins : [];
|
|
26754
|
+
const skillPaths = /* @__PURE__ */ new Set();
|
|
26755
|
+
for (const plugin of plugins) {
|
|
26756
|
+
if (!plugin || !Array.isArray(plugin.skills)) continue;
|
|
26757
|
+
for (const rel of plugin.skills) {
|
|
26758
|
+
if (typeof rel !== "string") continue;
|
|
26759
|
+
const resolved = resolveSkillPath(dir, rel);
|
|
26760
|
+
if (resolved) skillPaths.add(resolve(resolved));
|
|
26761
|
+
}
|
|
26762
|
+
}
|
|
26763
|
+
return Array.from(skillPaths);
|
|
26764
|
+
}
|
|
26765
|
+
function resolveInstallTargets(root, usePath) {
|
|
26766
|
+
const base = resolve(root);
|
|
26767
|
+
const candidatePath = usePath ? resolve(base, usePath) : base;
|
|
26768
|
+
if (!usePath && base.toLowerCase().endsWith("skill.md") && existsSync(base)) return [dirname(base)];
|
|
26769
|
+
if (usePath && candidatePath.toLowerCase().endsWith("skill.md") && existsSync(candidatePath)) return [dirname(candidatePath)];
|
|
26770
|
+
if (usePath && existsSync(candidatePath) && statSync(candidatePath).isDirectory()) {
|
|
26771
|
+
if (existsSync(join(candidatePath, "SKILL.md"))) return [candidatePath];
|
|
26772
|
+
if (existsSync(join(candidatePath, "marketplace.json"))) return marketplaceSkills(join(candidatePath, "marketplace.json"));
|
|
26773
|
+
}
|
|
26774
|
+
if ((usePath || !statSync(base).isDirectory()) && existsSync(candidatePath) && candidatePath.endsWith("marketplace.json")) return marketplaceSkills(candidatePath);
|
|
26775
|
+
if (existsSync(join(base, ".claude-plugin", "marketplace.json"))) return marketplaceSkills(join(base, ".claude-plugin", "marketplace.json"));
|
|
26776
|
+
if (existsSync(join(base, "SKILL.md"))) return [base];
|
|
26777
|
+
if (existsSync(join(base, "marketplace.json"))) return marketplaceSkills(join(base, "marketplace.json"));
|
|
26778
|
+
throw new Error(`No SKILL.md or marketplace.json found in ${base}${usePath ? ` (use: ${usePath})` : ""}`);
|
|
26779
|
+
}
|
|
26780
|
+
function buildSkillEntries(dirs) {
|
|
26781
|
+
return dirs.map((dir) => {
|
|
26782
|
+
const parsed = parseSkillFile(join(dir, "SKILL.md"));
|
|
26783
|
+
return {
|
|
26784
|
+
name: parsed.frontmatter.name,
|
|
26785
|
+
description: parsed.frontmatter.description ?? "",
|
|
26786
|
+
dir
|
|
26787
|
+
};
|
|
26788
|
+
});
|
|
26789
|
+
}
|
|
26790
|
+
async function promptSelectSkills(entries, sourceLabel) {
|
|
26791
|
+
const pickedNames = await promptMultiSelect({
|
|
26792
|
+
message: `Select skills to install from ${sourceLabel}`,
|
|
26793
|
+
choices: entries.map((e) => ({
|
|
26794
|
+
value: e.name,
|
|
26795
|
+
label: formatChoiceLabel$1(e),
|
|
26796
|
+
description: e.description,
|
|
26797
|
+
checked: true
|
|
26798
|
+
})),
|
|
26799
|
+
defaultChecked: true,
|
|
26800
|
+
command: {
|
|
26801
|
+
base: "ccski install",
|
|
26802
|
+
staticArgs: [sourceLabel]
|
|
26803
|
+
}
|
|
26804
|
+
});
|
|
26805
|
+
if (!Array.isArray(pickedNames) || pickedNames.length === 0) throw new Error("No skills selected.");
|
|
26806
|
+
const pickedSet = new Set(pickedNames.map((n) => n.toLowerCase()));
|
|
26807
|
+
return entries.filter((e) => pickedSet.has(e.name.toLowerCase()));
|
|
26808
|
+
}
|
|
26809
|
+
function parseSelectors(argv) {
|
|
26810
|
+
return (argv._ ? argv._.slice(1) : []).flatMap((val) => String(val).split(/[\/,]/)).map((s) => s.trim()).filter(Boolean);
|
|
26811
|
+
}
|
|
26812
|
+
async function selectSkills(targetDirs, argv, sourceLabel) {
|
|
26813
|
+
const entries = buildSkillEntries(targetDirs);
|
|
26814
|
+
if (entries.length === 1) return entries;
|
|
26815
|
+
const listing = formatSkillListing(entries, sourceLabel);
|
|
26816
|
+
const selectors = parseSelectors(argv);
|
|
26817
|
+
if (argv.all) return entries;
|
|
26818
|
+
if (argv.interactive) {
|
|
26819
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new MultiSkillSelectionError(`Interactive mode requires a TTY. Specify names or use --all instead for ${sourceLabel}.`, listing);
|
|
26820
|
+
return await promptSelectSkills(entries, sourceLabel);
|
|
26821
|
+
}
|
|
26822
|
+
if (selectors.length === 0) throw new MultiSkillSelectionError(`Multiple skills found (${entries.length}) in ${sourceLabel}. Specify names, use --all, or --interactive.`, listing);
|
|
26823
|
+
const selected = [];
|
|
26824
|
+
const names$1 = entries.map((e) => e.name);
|
|
26825
|
+
for (const raw of selectors) {
|
|
26826
|
+
const sel = raw.trim();
|
|
26827
|
+
const lower = sel.toLowerCase();
|
|
26828
|
+
let match;
|
|
26829
|
+
const exact = entries.find((e) => e.name.toLowerCase() === lower);
|
|
26830
|
+
if (exact) match = exact;
|
|
26831
|
+
else {
|
|
26832
|
+
const partial = entries.filter((e) => e.name.toLowerCase().includes(lower));
|
|
26833
|
+
if (partial.length === 1) match = partial[0];
|
|
26834
|
+
}
|
|
26835
|
+
if (!match) {
|
|
26836
|
+
const rankedIdx = rankStrings(names$1, sel);
|
|
26837
|
+
const ranked = (rankedIdx.length ? rankedIdx : names$1.map((_$1, idx) => idx)).slice(0, 3).map((i$3) => names$1[i$3]);
|
|
26838
|
+
const hint = ranked.length ? ` Did you mean: ${ranked.join(", ")}?` : "";
|
|
26839
|
+
throw new Error(`Skill '${sel}' not found.${hint}`);
|
|
26840
|
+
}
|
|
26841
|
+
if (!selected.some((s) => s.name === match.name)) selected.push(match);
|
|
26842
|
+
}
|
|
26843
|
+
return selected;
|
|
26844
|
+
}
|
|
26845
|
+
function formatSkillListing(entries, label) {
|
|
26846
|
+
return `${heading(`Available skills from ${label}`)} (${entries.length})\n` + renderList(entries.map((e) => ({
|
|
26847
|
+
title: e.name,
|
|
26848
|
+
description: e.description
|
|
26849
|
+
})));
|
|
26850
|
+
}
|
|
26851
|
+
function formatChoiceLabel$1(entry) {
|
|
26852
|
+
const wrapWidth = Math.max(24, Math.min(process.stdout?.columns ?? 80, 120) - 6);
|
|
26853
|
+
const description = entry.description ? "\n " + wrap(entry.description, {
|
|
26854
|
+
width: wrapWidth,
|
|
26855
|
+
indent: "",
|
|
26856
|
+
newline: "\n",
|
|
26857
|
+
trim: true,
|
|
26858
|
+
cut: false
|
|
26859
|
+
}).replace(/\n/g, "\n ") : "";
|
|
26860
|
+
return `${tone.primary(entry.name)}${description}`;
|
|
26861
|
+
}
|
|
26862
|
+
|
|
26863
|
+
//#endregion
|
|
26864
|
+
//#region src/cli/commands/toggle.ts
|
|
26865
|
+
async function enableCommand(argv) {
|
|
26866
|
+
await toggleCommand("enable", argv);
|
|
26867
|
+
}
|
|
26868
|
+
async function disableCommand(argv) {
|
|
26869
|
+
await toggleCommand("disable", argv);
|
|
26870
|
+
}
|
|
26871
|
+
async function toggleCommand(mode, argv) {
|
|
26872
|
+
if (argv.noColor || process.env.FORCE_COLOR === "0") setColorEnabled(false);
|
|
26873
|
+
if (argv.color) setColorEnabled(true);
|
|
26874
|
+
const skills = new SkillRegistry(buildRegistryOptions(argv, { includeDisabled: true })).getAll();
|
|
26875
|
+
const candidates = mode === "disable" ? skills.filter((s) => !s.disabled) : skills.filter((s) => s.disabled);
|
|
26876
|
+
if (candidates.length === 0) {
|
|
26877
|
+
console.log(mode === "disable" ? warn("No enabled skills found to disable.") : warn("No disabled skills found to enable."));
|
|
26878
|
+
return;
|
|
26879
|
+
}
|
|
26880
|
+
try {
|
|
26881
|
+
const selected = await pickSkills(mode, candidates, argv);
|
|
26882
|
+
const force = argv.force === true || argv.override === true;
|
|
26883
|
+
const succeeded = [];
|
|
26884
|
+
const failures = [];
|
|
26885
|
+
for (const skill of selected) try {
|
|
26886
|
+
if (mode === "disable") disableSkill(skill, force);
|
|
26887
|
+
else enableSkill(skill, force);
|
|
26888
|
+
succeeded.push(skill.name);
|
|
26889
|
+
} catch (err) {
|
|
26890
|
+
failures.push(skill.name);
|
|
26891
|
+
console.error(error(`${capitalize(mode)} ${skill.name} failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
26892
|
+
}
|
|
26893
|
+
if (succeeded.length) {
|
|
26894
|
+
console.log(success(`${capitalize(mode)}d ${succeeded.length} skill(s):`));
|
|
26895
|
+
succeeded.forEach((name) => console.log(` - ${name}`));
|
|
26896
|
+
}
|
|
26897
|
+
if (failures.length) process.exitCode = 1;
|
|
26898
|
+
} catch (err) {
|
|
26899
|
+
if (err instanceof MultiSelectError) {
|
|
26900
|
+
const advisory = warn(`Input needed: ${err.message}`);
|
|
26901
|
+
console.log(advisory);
|
|
26902
|
+
console.log(err.listing.trimEnd());
|
|
26903
|
+
console.log(`\n${advisory}`);
|
|
26904
|
+
process.exitCode = 1;
|
|
26905
|
+
return;
|
|
26906
|
+
}
|
|
26907
|
+
console.error(error(err instanceof Error ? err.message : String(err)));
|
|
26908
|
+
process.exitCode = 1;
|
|
26909
|
+
}
|
|
26910
|
+
}
|
|
26911
|
+
var MultiSelectError = class extends Error {
|
|
26912
|
+
constructor(message, listing) {
|
|
26913
|
+
super(message);
|
|
26914
|
+
this.listing = listing;
|
|
26915
|
+
this.name = "MultiSelectError";
|
|
26916
|
+
}
|
|
26917
|
+
};
|
|
26918
|
+
async function pickSkills(mode, candidates, argv) {
|
|
26919
|
+
const selectors = parseNames(argv);
|
|
26920
|
+
const listing = `${heading(mode === "disable" ? "Enabled skills" : "Disabled skills")} (${candidates.length})\n${renderList(toListItems(candidates))}`;
|
|
26921
|
+
if (argv.all) return candidates;
|
|
26922
|
+
if (selectors.length > 0) return resolveSelectors(selectors, candidates);
|
|
26923
|
+
if (argv.interactive) {
|
|
26924
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new MultiSelectError("Interactive mode requires a TTY.", listing);
|
|
26925
|
+
const names$1 = await promptMultiSelect({
|
|
26926
|
+
message: mode === "disable" ? "Select skills to disable" : "Select skills to enable",
|
|
26927
|
+
choices: candidates.map((skill) => ({
|
|
26928
|
+
value: skill.name,
|
|
26929
|
+
label: formatChoiceLabel(skill),
|
|
26930
|
+
description: skill.description,
|
|
26931
|
+
checked: false
|
|
26932
|
+
})),
|
|
26933
|
+
defaultChecked: false,
|
|
26934
|
+
command: { base: `ccski ${mode}` }
|
|
26935
|
+
});
|
|
26936
|
+
if (!Array.isArray(names$1) || names$1.length === 0) throw new MultiSelectError("No skills selected.", listing);
|
|
26937
|
+
const pickedSet = new Set(names$1.map((n) => n.toLowerCase()));
|
|
26938
|
+
return candidates.filter((c) => pickedSet.has(c.name.toLowerCase()));
|
|
26939
|
+
}
|
|
26940
|
+
throw new MultiSelectError(`Multiple skills available. Provide names, use --all, or enable interactive mode (-i).`, listing);
|
|
26941
|
+
}
|
|
26942
|
+
function parseNames(argv) {
|
|
26943
|
+
return [].concat(Array.isArray(argv.names) ? argv.names : [], (argv._ ?? []).slice(1).map(String)).flatMap((item) => item.split(/[\\/,]/)).map((s) => s.trim()).filter(Boolean);
|
|
26944
|
+
}
|
|
26945
|
+
function resolveSelectors(selectors, candidates) {
|
|
26946
|
+
const names$1 = candidates.map((c) => c.name);
|
|
26947
|
+
const picked = [];
|
|
26948
|
+
for (const raw of selectors) {
|
|
26949
|
+
const lower = raw.toLowerCase();
|
|
26950
|
+
const exact = candidates.find((c) => c.name.toLowerCase() === lower);
|
|
26951
|
+
if (exact) {
|
|
26952
|
+
if (!picked.some((p) => p.name === exact.name)) picked.push(exact);
|
|
26953
|
+
continue;
|
|
26954
|
+
}
|
|
26955
|
+
const partial = candidates.filter((c) => c.name.toLowerCase().includes(lower));
|
|
26956
|
+
if (partial.length === 1) {
|
|
26957
|
+
picked.push(partial[0]);
|
|
26958
|
+
continue;
|
|
26959
|
+
}
|
|
26960
|
+
const rankedIdx = rankStrings(names$1, raw);
|
|
26961
|
+
const suggestions = (rankedIdx.length ? rankedIdx : names$1.map((_$1, idx) => idx)).slice(0, 3).map((i$3) => names$1[i$3]);
|
|
26962
|
+
const hint = suggestions.length ? ` Did you mean: ${suggestions.join(", ")}?` : "";
|
|
26963
|
+
throw new Error(`Skill '${raw}' not found among candidates.${hint}`);
|
|
26964
|
+
}
|
|
26965
|
+
return picked;
|
|
26966
|
+
}
|
|
26967
|
+
function disableSkill(skill, force) {
|
|
26968
|
+
const skillFile = join(skill.path, "SKILL.md");
|
|
26969
|
+
const disabledFile = join(skill.path, ".SKILL.md");
|
|
26970
|
+
const hasSkill = existsSync(skillFile);
|
|
26971
|
+
const hasDisabled = existsSync(disabledFile);
|
|
26972
|
+
if (!hasSkill && !hasDisabled) throw new Error("No SKILL.md found in directory.");
|
|
26973
|
+
if (!hasSkill && hasDisabled) throw new Error("Skill is already disabled.");
|
|
26974
|
+
if (hasSkill && hasDisabled && !force) throw new Error("Both SKILL.md and .SKILL.md exist. Use --force to overwrite the disabled copy.");
|
|
26975
|
+
if (hasDisabled && force) rmSync(disabledFile);
|
|
26976
|
+
if (hasSkill) renameSync(skillFile, disabledFile);
|
|
26977
|
+
}
|
|
26978
|
+
function enableSkill(skill, force) {
|
|
26979
|
+
const skillFile = join(skill.path, "SKILL.md");
|
|
26980
|
+
const disabledFile = join(skill.path, ".SKILL.md");
|
|
26981
|
+
const hasSkill = existsSync(skillFile);
|
|
26982
|
+
const hasDisabled = existsSync(disabledFile);
|
|
26983
|
+
if (!hasSkill && !hasDisabled) throw new Error("No .SKILL.md found to enable.");
|
|
26984
|
+
if (hasSkill && !hasDisabled) throw new Error("Skill is already enabled.");
|
|
26985
|
+
if (hasSkill && hasDisabled && !force) throw new Error("Both SKILL.md and .SKILL.md exist. Use --force to replace SKILL.md with the disabled copy.");
|
|
26986
|
+
if (hasSkill && force) rmSync(skillFile);
|
|
26987
|
+
if (!hasDisabled) throw new Error("No .SKILL.md found to enable.");
|
|
26988
|
+
renameSync(disabledFile, skillFile);
|
|
26989
|
+
}
|
|
26990
|
+
function toListItems(skills) {
|
|
26991
|
+
return skills.map((skill) => ({
|
|
26992
|
+
title: skill.name,
|
|
26993
|
+
color: skill.disabled ? tone.danger : void 0,
|
|
26994
|
+
badge: skill.disabled ? tone.danger("[disabled]") : void 0,
|
|
26995
|
+
meta: skill.location === "plugin" ? skill.pluginInfo?.pluginName ?? dim(skill.location) : dim(skill.location),
|
|
26996
|
+
description: skill.description
|
|
26997
|
+
}));
|
|
26998
|
+
}
|
|
26999
|
+
function formatChoiceLabel(skill) {
|
|
27000
|
+
const wrapWidth = Math.max(24, Math.min(process.stdout?.columns ?? 80, 120) - 6);
|
|
27001
|
+
const description = skill.description ? "\n " + wrap(skill.description, {
|
|
27002
|
+
width: wrapWidth,
|
|
27003
|
+
indent: "",
|
|
27004
|
+
newline: "\n",
|
|
27005
|
+
trim: true,
|
|
27006
|
+
cut: false
|
|
27007
|
+
}).replace(/\n/g, "\n ") : "";
|
|
27008
|
+
return `${tone.primary(skill.name)}${description}`;
|
|
27009
|
+
}
|
|
27010
|
+
function capitalize(value) {
|
|
27011
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
27012
|
+
}
|
|
27013
|
+
|
|
27014
|
+
//#endregion
|
|
27015
|
+
//#region src/cli.ts
|
|
27016
|
+
const listModule = {
|
|
27017
|
+
command: "list",
|
|
27018
|
+
describe: "List all available skills",
|
|
27019
|
+
builder: (cmd) => cmd.option("format", {
|
|
27020
|
+
alias: "f",
|
|
27021
|
+
choices: ["plain", "json"],
|
|
27022
|
+
default: "plain"
|
|
27023
|
+
}).option("all", {
|
|
27024
|
+
type: "boolean",
|
|
27025
|
+
default: false,
|
|
27026
|
+
description: "Show enabled and disabled skills"
|
|
27027
|
+
}).option("disabled", {
|
|
27028
|
+
type: "boolean",
|
|
27029
|
+
default: false,
|
|
27030
|
+
description: "Show only disabled skills"
|
|
27031
|
+
}).option("scan-default-dirs", {
|
|
27032
|
+
type: "boolean",
|
|
27033
|
+
default: true,
|
|
27034
|
+
description: "Scan built-in .agent/.claude directories"
|
|
27035
|
+
}),
|
|
27036
|
+
handler: listCommand
|
|
27037
|
+
};
|
|
27038
|
+
const infoModule = {
|
|
27039
|
+
command: "info <name>",
|
|
27040
|
+
describe: "Show detailed info for a skill",
|
|
27041
|
+
builder: (cmd) => cmd.positional("name", {
|
|
27042
|
+
type: "string",
|
|
27043
|
+
demandOption: true
|
|
27044
|
+
}).option("full", {
|
|
27045
|
+
type: "boolean",
|
|
27046
|
+
default: false,
|
|
27047
|
+
description: "Show full SKILL.md"
|
|
27048
|
+
}).option("scan-default-dirs", {
|
|
27049
|
+
type: "boolean",
|
|
27050
|
+
default: true
|
|
27051
|
+
}),
|
|
27052
|
+
handler: infoCommand
|
|
27053
|
+
};
|
|
27054
|
+
const searchModule = {
|
|
27055
|
+
command: "search <query>",
|
|
27056
|
+
describe: "Search for skills",
|
|
27057
|
+
builder: (cmd) => cmd.positional("query", {
|
|
27058
|
+
type: "string",
|
|
27059
|
+
demandOption: true
|
|
27060
|
+
}).option("content", {
|
|
27061
|
+
type: "boolean",
|
|
27062
|
+
default: false,
|
|
27063
|
+
description: "Search inside SKILL.md content"
|
|
27064
|
+
}).option("format", {
|
|
27065
|
+
alias: "f",
|
|
27066
|
+
choices: ["plain", "json"],
|
|
27067
|
+
default: "plain"
|
|
27068
|
+
}).option("scan-default-dirs", {
|
|
27069
|
+
type: "boolean",
|
|
27070
|
+
default: true
|
|
27071
|
+
}),
|
|
27072
|
+
handler: searchCommand
|
|
27073
|
+
};
|
|
27074
|
+
const validateModule = {
|
|
27075
|
+
command: "validate <path>",
|
|
27076
|
+
describe: "Validate a SKILL.md or skill directory",
|
|
27077
|
+
builder: (cmd) => cmd.positional("path", {
|
|
27078
|
+
type: "string",
|
|
27079
|
+
demandOption: true
|
|
27080
|
+
}),
|
|
27081
|
+
handler: validateCommand
|
|
27082
|
+
};
|
|
27083
|
+
const mcpModule = {
|
|
27084
|
+
command: "mcp",
|
|
27085
|
+
describe: "Start MCP server",
|
|
27086
|
+
builder: (cmd) => cmd.option("refresh-interval", {
|
|
27087
|
+
type: "number",
|
|
27088
|
+
description: "Auto refresh interval (ms)",
|
|
27089
|
+
default: 3e4
|
|
27090
|
+
}).option("no-refresh", {
|
|
27091
|
+
type: "boolean",
|
|
27092
|
+
description: "Disable auto refresh"
|
|
27093
|
+
}).option("transport", {
|
|
27094
|
+
choices: [
|
|
27095
|
+
"stdio",
|
|
27096
|
+
"http",
|
|
27097
|
+
"sse"
|
|
27098
|
+
],
|
|
27099
|
+
default: "stdio",
|
|
22967
27100
|
description: "Transport for MCP server"
|
|
22968
27101
|
}).option("port", {
|
|
22969
27102
|
type: "number",
|
|
@@ -22979,6 +27112,102 @@ const mcpModule = {
|
|
|
22979
27112
|
}),
|
|
22980
27113
|
handler: mcpCommand
|
|
22981
27114
|
};
|
|
27115
|
+
const installModule = {
|
|
27116
|
+
command: "install <source>",
|
|
27117
|
+
describe: "Install a skill into .claude/skills",
|
|
27118
|
+
builder: (cmd) => cmd.positional("source", {
|
|
27119
|
+
type: "string",
|
|
27120
|
+
demandOption: true
|
|
27121
|
+
}).option("global", {
|
|
27122
|
+
type: "boolean",
|
|
27123
|
+
default: false,
|
|
27124
|
+
description: "Install to ~/.claude/skills"
|
|
27125
|
+
}).option("force", {
|
|
27126
|
+
type: "boolean",
|
|
27127
|
+
default: false,
|
|
27128
|
+
description: "Overwrite if skill already exists"
|
|
27129
|
+
}).option("override", {
|
|
27130
|
+
type: "boolean",
|
|
27131
|
+
default: false,
|
|
27132
|
+
description: "Alias for --force"
|
|
27133
|
+
}).option("use", {
|
|
27134
|
+
type: "string",
|
|
27135
|
+
description: "Explicit SKILL.md or marketplace.json path inside source"
|
|
27136
|
+
}).option("interactive", {
|
|
27137
|
+
alias: "i",
|
|
27138
|
+
type: "boolean",
|
|
27139
|
+
default: false,
|
|
27140
|
+
description: "Interactively choose skills (requires TTY)"
|
|
27141
|
+
}).option("all", {
|
|
27142
|
+
alias: "a",
|
|
27143
|
+
type: "boolean",
|
|
27144
|
+
default: false,
|
|
27145
|
+
description: "Install all discovered skills"
|
|
27146
|
+
}),
|
|
27147
|
+
handler: installCommand
|
|
27148
|
+
};
|
|
27149
|
+
const disableModule = {
|
|
27150
|
+
command: "disable [names...]",
|
|
27151
|
+
describe: "Disable skills by renaming SKILL.md to .SKILL.md",
|
|
27152
|
+
builder: (cmd) => cmd.positional("names", {
|
|
27153
|
+
type: "string",
|
|
27154
|
+
array: true
|
|
27155
|
+
}).option("interactive", {
|
|
27156
|
+
alias: "i",
|
|
27157
|
+
type: "boolean",
|
|
27158
|
+
default: false,
|
|
27159
|
+
description: "Interactively choose skills to disable"
|
|
27160
|
+
}).option("all", {
|
|
27161
|
+
alias: "a",
|
|
27162
|
+
type: "boolean",
|
|
27163
|
+
default: false,
|
|
27164
|
+
description: "Disable all available skills"
|
|
27165
|
+
}).option("force", {
|
|
27166
|
+
alias: "f",
|
|
27167
|
+
type: "boolean",
|
|
27168
|
+
default: false,
|
|
27169
|
+
description: "Overwrite when both SKILL.md and .SKILL.md exist"
|
|
27170
|
+
}).option("override", {
|
|
27171
|
+
type: "boolean",
|
|
27172
|
+
default: false,
|
|
27173
|
+
description: "Alias for --force"
|
|
27174
|
+
}).option("scan-default-dirs", {
|
|
27175
|
+
type: "boolean",
|
|
27176
|
+
default: true
|
|
27177
|
+
}),
|
|
27178
|
+
handler: disableCommand
|
|
27179
|
+
};
|
|
27180
|
+
const enableModule = {
|
|
27181
|
+
command: "enable [names...]",
|
|
27182
|
+
describe: "Enable skills by restoring SKILL.md from .SKILL.md",
|
|
27183
|
+
builder: (cmd) => cmd.positional("names", {
|
|
27184
|
+
type: "string",
|
|
27185
|
+
array: true
|
|
27186
|
+
}).option("interactive", {
|
|
27187
|
+
alias: "i",
|
|
27188
|
+
type: "boolean",
|
|
27189
|
+
default: false,
|
|
27190
|
+
description: "Interactively choose skills to enable"
|
|
27191
|
+
}).option("all", {
|
|
27192
|
+
alias: "a",
|
|
27193
|
+
type: "boolean",
|
|
27194
|
+
default: false,
|
|
27195
|
+
description: "Enable all disabled skills"
|
|
27196
|
+
}).option("force", {
|
|
27197
|
+
alias: "f",
|
|
27198
|
+
type: "boolean",
|
|
27199
|
+
default: false,
|
|
27200
|
+
description: "Overwrite when both SKILL.md and .SKILL.md exist"
|
|
27201
|
+
}).option("override", {
|
|
27202
|
+
type: "boolean",
|
|
27203
|
+
default: false,
|
|
27204
|
+
description: "Alias for --force"
|
|
27205
|
+
}).option("scan-default-dirs", {
|
|
27206
|
+
type: "boolean",
|
|
27207
|
+
default: true
|
|
27208
|
+
}),
|
|
27209
|
+
handler: enableCommand
|
|
27210
|
+
};
|
|
22982
27211
|
await yargs_default(hideBin(process.argv)).scriptName("ccski").usage("$0 <command> [options]").option("no-color", {
|
|
22983
27212
|
type: "boolean",
|
|
22984
27213
|
description: "Disable colored output",
|
|
@@ -23005,7 +27234,7 @@ await yargs_default(hideBin(process.argv)).scriptName("ccski").usage("$0 <comman
|
|
|
23005
27234
|
}).option("plugins-root", {
|
|
23006
27235
|
type: "string",
|
|
23007
27236
|
description: "Root directory for plugin install paths"
|
|
23008
|
-
}).command(listModule).command(infoModule).command(searchModule).command(validateModule).command(mcpModule).demandCommand(1, "Please provide a command").strict().help().alias("h", "help").alias("v", "version").parse();
|
|
27237
|
+
}).command(listModule).command(infoModule).command(searchModule).command(validateModule).command(mcpModule).command(installModule).command(disableModule).command(enableModule).demandCommand(1, "Please provide a command").strict().help().alias("h", "help").alias("v", "version").parse();
|
|
23009
27238
|
|
|
23010
27239
|
//#endregion
|
|
23011
27240
|
export { };
|