@acidicsoil/portable-capabilities 0.1.2 → 0.1.3
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-release/cli.js +1415 -105
- package/dist-release/cli.js.map +4 -4
- package/dist-release/index.js +1418 -108
- package/dist-release/index.js.map +4 -4
- package/package.json +1 -1
package/dist-release/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
-
get: (
|
|
11
|
+
get: (a3, b) => (typeof require !== "undefined" ? require : a3)[b]
|
|
12
12
|
}) : x)(function(x) {
|
|
13
13
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
14
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
@@ -231,8 +231,8 @@ var require_help = __commonJS({
|
|
|
231
231
|
visibleCommands.push(helpCommand);
|
|
232
232
|
}
|
|
233
233
|
if (this.sortSubcommands) {
|
|
234
|
-
visibleCommands.sort((
|
|
235
|
-
return
|
|
234
|
+
visibleCommands.sort((a3, b) => {
|
|
235
|
+
return a3.name().localeCompare(b.name());
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
return visibleCommands;
|
|
@@ -244,11 +244,11 @@ var require_help = __commonJS({
|
|
|
244
244
|
* @param {Option} b
|
|
245
245
|
* @returns {number}
|
|
246
246
|
*/
|
|
247
|
-
compareOptions(
|
|
247
|
+
compareOptions(a3, b) {
|
|
248
248
|
const getSortKey = (option) => {
|
|
249
249
|
return option.short ? option.short.replace(/^-/, "") : option.long.replace(/^--/, "");
|
|
250
250
|
};
|
|
251
|
-
return getSortKey(
|
|
251
|
+
return getSortKey(a3).localeCompare(getSortKey(b));
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
254
254
|
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
|
|
@@ -1113,38 +1113,38 @@ var require_option = __commonJS({
|
|
|
1113
1113
|
var require_suggestSimilar = __commonJS({
|
|
1114
1114
|
"node_modules/.pnpm/commander@14.0.0/node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
1115
1115
|
var maxDistance = 3;
|
|
1116
|
-
function editDistance(
|
|
1117
|
-
if (Math.abs(
|
|
1118
|
-
return Math.max(
|
|
1116
|
+
function editDistance(a3, b) {
|
|
1117
|
+
if (Math.abs(a3.length - b.length) > maxDistance)
|
|
1118
|
+
return Math.max(a3.length, b.length);
|
|
1119
1119
|
const d = [];
|
|
1120
|
-
for (let
|
|
1121
|
-
d[
|
|
1120
|
+
for (let i3 = 0; i3 <= a3.length; i3++) {
|
|
1121
|
+
d[i3] = [i3];
|
|
1122
1122
|
}
|
|
1123
1123
|
for (let j = 0; j <= b.length; j++) {
|
|
1124
1124
|
d[0][j] = j;
|
|
1125
1125
|
}
|
|
1126
1126
|
for (let j = 1; j <= b.length; j++) {
|
|
1127
|
-
for (let
|
|
1127
|
+
for (let i3 = 1; i3 <= a3.length; i3++) {
|
|
1128
1128
|
let cost = 1;
|
|
1129
|
-
if (
|
|
1129
|
+
if (a3[i3 - 1] === b[j - 1]) {
|
|
1130
1130
|
cost = 0;
|
|
1131
1131
|
} else {
|
|
1132
1132
|
cost = 1;
|
|
1133
1133
|
}
|
|
1134
|
-
d[
|
|
1135
|
-
d[
|
|
1134
|
+
d[i3][j] = Math.min(
|
|
1135
|
+
d[i3 - 1][j] + 1,
|
|
1136
1136
|
// deletion
|
|
1137
|
-
d[
|
|
1137
|
+
d[i3][j - 1] + 1,
|
|
1138
1138
|
// insertion
|
|
1139
|
-
d[
|
|
1139
|
+
d[i3 - 1][j - 1] + cost
|
|
1140
1140
|
// substitution
|
|
1141
1141
|
);
|
|
1142
|
-
if (
|
|
1143
|
-
d[
|
|
1142
|
+
if (i3 > 1 && j > 1 && a3[i3 - 1] === b[j - 2] && a3[i3 - 2] === b[j - 1]) {
|
|
1143
|
+
d[i3][j] = Math.min(d[i3][j], d[i3 - 2][j - 2] + 1);
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
|
-
return d[
|
|
1147
|
+
return d[a3.length][b.length];
|
|
1148
1148
|
}
|
|
1149
1149
|
function suggestSimilar(word, candidates) {
|
|
1150
1150
|
if (!candidates || candidates.length === 0) return "";
|
|
@@ -1171,7 +1171,7 @@ var require_suggestSimilar = __commonJS({
|
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
1173
|
});
|
|
1174
|
-
similar.sort((
|
|
1174
|
+
similar.sort((a3, b) => a3.localeCompare(b));
|
|
1175
1175
|
if (searchingOptions) {
|
|
1176
1176
|
similar = similar.map((candidate) => `--${candidate}`);
|
|
1177
1177
|
}
|
|
@@ -2366,8 +2366,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2366
2366
|
* @private
|
|
2367
2367
|
*/
|
|
2368
2368
|
_checkNumberOfArguments() {
|
|
2369
|
-
this.registeredArguments.forEach((arg,
|
|
2370
|
-
if (arg.required && this.args[
|
|
2369
|
+
this.registeredArguments.forEach((arg, i3) => {
|
|
2370
|
+
if (arg.required && this.args[i3] == null) {
|
|
2371
2371
|
this.missingArgument(arg.name());
|
|
2372
2372
|
}
|
|
2373
2373
|
});
|
|
@@ -2753,8 +2753,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2753
2753
|
if (this._storeOptionsAsProperties) {
|
|
2754
2754
|
const result2 = {};
|
|
2755
2755
|
const len = this.options.length;
|
|
2756
|
-
for (let
|
|
2757
|
-
const key = this.options[
|
|
2756
|
+
for (let i3 = 0; i3 < len; i3++) {
|
|
2757
|
+
const key = this.options[i3].attributeName();
|
|
2758
2758
|
result2[key] = key === this._versionOptionName ? this._version : this[key];
|
|
2759
2759
|
}
|
|
2760
2760
|
return result2;
|
|
@@ -3198,9 +3198,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3198
3198
|
helpWidth: context.helpWidth,
|
|
3199
3199
|
outputHasColors: context.hasColors
|
|
3200
3200
|
});
|
|
3201
|
-
const
|
|
3202
|
-
if (context.hasColors) return
|
|
3203
|
-
return this._outputConfiguration.stripColor(
|
|
3201
|
+
const text2 = helper.formatHelp(this, helper);
|
|
3202
|
+
if (context.hasColors) return text2;
|
|
3203
|
+
return this._outputConfiguration.stripColor(text2);
|
|
3204
3204
|
}
|
|
3205
3205
|
/**
|
|
3206
3206
|
* @typedef HelpContext
|
|
@@ -3360,7 +3360,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3360
3360
|
* @param {(string | Function)} text - string to add, or a function returning a string
|
|
3361
3361
|
* @return {Command} `this` command for chaining
|
|
3362
3362
|
*/
|
|
3363
|
-
addHelpText(position,
|
|
3363
|
+
addHelpText(position, text2) {
|
|
3364
3364
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
3365
3365
|
if (!allowedValues.includes(position)) {
|
|
3366
3366
|
throw new Error(`Unexpected value for position to addHelpText.
|
|
@@ -3369,10 +3369,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3369
3369
|
const helpEvent = `${position}Help`;
|
|
3370
3370
|
this.on(helpEvent, (context) => {
|
|
3371
3371
|
let helpStr;
|
|
3372
|
-
if (typeof
|
|
3373
|
-
helpStr =
|
|
3372
|
+
if (typeof text2 === "function") {
|
|
3373
|
+
helpStr = text2({ error: context.error, command: context.command });
|
|
3374
3374
|
} else {
|
|
3375
|
-
helpStr =
|
|
3375
|
+
helpStr = text2;
|
|
3376
3376
|
}
|
|
3377
3377
|
if (helpStr) {
|
|
3378
3378
|
context.write(`${helpStr}
|
|
@@ -3459,6 +3459,62 @@ var require_commander = __commonJS({
|
|
|
3459
3459
|
}
|
|
3460
3460
|
});
|
|
3461
3461
|
|
|
3462
|
+
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
3463
|
+
var require_src = __commonJS({
|
|
3464
|
+
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
|
|
3465
|
+
"use strict";
|
|
3466
|
+
var ESC2 = "\x1B";
|
|
3467
|
+
var CSI2 = `${ESC2}[`;
|
|
3468
|
+
var beep = "\x07";
|
|
3469
|
+
var cursor3 = {
|
|
3470
|
+
to(x, y) {
|
|
3471
|
+
if (!y) return `${CSI2}${x + 1}G`;
|
|
3472
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
3473
|
+
},
|
|
3474
|
+
move(x, y) {
|
|
3475
|
+
let ret = "";
|
|
3476
|
+
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
3477
|
+
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
3478
|
+
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
3479
|
+
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
3480
|
+
return ret;
|
|
3481
|
+
},
|
|
3482
|
+
up: (count2 = 1) => `${CSI2}${count2}A`,
|
|
3483
|
+
down: (count2 = 1) => `${CSI2}${count2}B`,
|
|
3484
|
+
forward: (count2 = 1) => `${CSI2}${count2}C`,
|
|
3485
|
+
backward: (count2 = 1) => `${CSI2}${count2}D`,
|
|
3486
|
+
nextLine: (count2 = 1) => `${CSI2}E`.repeat(count2),
|
|
3487
|
+
prevLine: (count2 = 1) => `${CSI2}F`.repeat(count2),
|
|
3488
|
+
left: `${CSI2}G`,
|
|
3489
|
+
hide: `${CSI2}?25l`,
|
|
3490
|
+
show: `${CSI2}?25h`,
|
|
3491
|
+
save: `${ESC2}7`,
|
|
3492
|
+
restore: `${ESC2}8`
|
|
3493
|
+
};
|
|
3494
|
+
var scroll = {
|
|
3495
|
+
up: (count2 = 1) => `${CSI2}S`.repeat(count2),
|
|
3496
|
+
down: (count2 = 1) => `${CSI2}T`.repeat(count2)
|
|
3497
|
+
};
|
|
3498
|
+
var erase3 = {
|
|
3499
|
+
screen: `${CSI2}2J`,
|
|
3500
|
+
up: (count2 = 1) => `${CSI2}1J`.repeat(count2),
|
|
3501
|
+
down: (count2 = 1) => `${CSI2}J`.repeat(count2),
|
|
3502
|
+
line: `${CSI2}2K`,
|
|
3503
|
+
lineEnd: `${CSI2}K`,
|
|
3504
|
+
lineStart: `${CSI2}1K`,
|
|
3505
|
+
lines(count2) {
|
|
3506
|
+
let clear = "";
|
|
3507
|
+
for (let i3 = 0; i3 < count2; i3++)
|
|
3508
|
+
clear += this.line + (i3 < count2 - 1 ? cursor3.up() : "");
|
|
3509
|
+
if (count2)
|
|
3510
|
+
clear += cursor3.left;
|
|
3511
|
+
return clear;
|
|
3512
|
+
}
|
|
3513
|
+
};
|
|
3514
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
3515
|
+
}
|
|
3516
|
+
});
|
|
3517
|
+
|
|
3462
3518
|
// packages/cli/src/cli.ts
|
|
3463
3519
|
import { createHash as createHash5 } from "node:crypto";
|
|
3464
3520
|
|
|
@@ -4288,17 +4344,17 @@ ${operationalBody}
|
|
|
4288
4344
|
}
|
|
4289
4345
|
}
|
|
4290
4346
|
if (primitiveArtifact) {
|
|
4291
|
-
const
|
|
4347
|
+
const text2 = decoder.decode(primitiveArtifact.content);
|
|
4292
4348
|
const core = `${ir.runtime.nativeRoot}/${ir.role.id}/SKILL.md`;
|
|
4293
|
-
if (!
|
|
4349
|
+
if (!text2.includes(core) && !text2.includes(`skills:
|
|
4294
4350
|
- ${ir.role.id}`)) {
|
|
4295
4351
|
diagnostics.push("client activation artifact does not delegate to behavioral core");
|
|
4296
4352
|
}
|
|
4297
4353
|
}
|
|
4298
4354
|
if (skill) {
|
|
4299
|
-
const
|
|
4355
|
+
const text2 = decoder.decode(skill.content);
|
|
4300
4356
|
const availableResources = files.filter((file) => file.path.startsWith(`${prefix}resources/`)).map((file) => file.path.slice(prefix.length));
|
|
4301
|
-
const operationalDiagnostics = validateRenderedOperationalSkill(
|
|
4357
|
+
const operationalDiagnostics = validateRenderedOperationalSkill(text2, availableResources);
|
|
4302
4358
|
diagnostics.push(...operationalDiagnostics);
|
|
4303
4359
|
for (const required of [
|
|
4304
4360
|
"generated: true",
|
|
@@ -4308,7 +4364,7 @@ ${operationalBody}
|
|
|
4308
4364
|
"repositoryWrites: denied",
|
|
4309
4365
|
"Do not edit by hand"
|
|
4310
4366
|
]) {
|
|
4311
|
-
if (!
|
|
4367
|
+
if (!text2.includes(required)) diagnostics.push(`missing skill metadata: ${required}`);
|
|
4312
4368
|
}
|
|
4313
4369
|
}
|
|
4314
4370
|
if (!lock) {
|
|
@@ -4407,9 +4463,9 @@ function normalizeFileSet(files) {
|
|
|
4407
4463
|
const normalizedPath = posix2.normalize(path9);
|
|
4408
4464
|
if (seen.has(normalizedPath)) throw new Error(`Duplicate generated path: ${normalizedPath}`);
|
|
4409
4465
|
seen.add(normalizedPath);
|
|
4410
|
-
const
|
|
4411
|
-
return Object.freeze({ path: normalizedPath, content: encoder2.encode(
|
|
4412
|
-
}).sort((
|
|
4466
|
+
const text2 = decoder2.decode(file.content).replace(/\r\n?/g, "\n").replace(/\n*$/, "\n");
|
|
4467
|
+
return Object.freeze({ path: normalizedPath, content: encoder2.encode(text2) });
|
|
4468
|
+
}).sort((a3, b) => a3.path.localeCompare(b.path));
|
|
4413
4469
|
}
|
|
4414
4470
|
|
|
4415
4471
|
// packages/compiler/src/output/write-file-set.ts
|
|
@@ -4651,7 +4707,7 @@ async function resolveContractLibrary(root = process.cwd()) {
|
|
|
4651
4707
|
return Object.freeze({
|
|
4652
4708
|
operations: Object.freeze([...operations]),
|
|
4653
4709
|
families: Object.freeze([...families]),
|
|
4654
|
-
roles: Object.freeze(roles.sort((
|
|
4710
|
+
roles: Object.freeze(roles.sort((a3, b) => a3.id.localeCompare(b.id)))
|
|
4655
4711
|
});
|
|
4656
4712
|
}
|
|
4657
4713
|
|
|
@@ -4665,11 +4721,11 @@ import { extname, resolve as resolve4 } from "node:path";
|
|
|
4665
4721
|
import { parseDocument } from "yaml";
|
|
4666
4722
|
async function loadDocument(file) {
|
|
4667
4723
|
const absolute = resolve4(file);
|
|
4668
|
-
const
|
|
4724
|
+
const text2 = await readFile2(absolute, "utf8");
|
|
4669
4725
|
if (extname(absolute).toLowerCase() === ".json") {
|
|
4670
|
-
return { file: absolute, data: JSON.parse(
|
|
4726
|
+
return { file: absolute, data: JSON.parse(text2) };
|
|
4671
4727
|
}
|
|
4672
|
-
const document = parseDocument(
|
|
4728
|
+
const document = parseDocument(text2, { prettyErrors: true, strict: true });
|
|
4673
4729
|
if (document.errors.length > 0) throw document.errors[0];
|
|
4674
4730
|
return { file: absolute, data: document.toJS({ maxAliasCount: 0 }) };
|
|
4675
4731
|
}
|
|
@@ -4760,9 +4816,9 @@ async function resolveSystem(file) {
|
|
|
4760
4816
|
return Object.freeze({
|
|
4761
4817
|
id: root.data.id,
|
|
4762
4818
|
sourceFile: root.file,
|
|
4763
|
-
roles: Object.freeze(roles.sort((
|
|
4764
|
-
runtimes: Object.freeze(runtimes.sort((
|
|
4765
|
-
exceptions: Object.freeze(exceptions.sort((
|
|
4819
|
+
roles: Object.freeze(roles.sort((a3, b) => a3.id.localeCompare(b.id))),
|
|
4820
|
+
runtimes: Object.freeze(runtimes.sort((a3, b) => a3.id.localeCompare(b.id))),
|
|
4821
|
+
exceptions: Object.freeze(exceptions.sort((a3, b) => a3.id.localeCompare(b.id)))
|
|
4766
4822
|
});
|
|
4767
4823
|
}
|
|
4768
4824
|
|
|
@@ -5736,17 +5792,17 @@ var parseExpression = (expression) => {
|
|
|
5736
5792
|
}
|
|
5737
5793
|
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
5738
5794
|
};
|
|
5739
|
-
var getSubprocessResult = ({ stdout }) => {
|
|
5740
|
-
if (typeof
|
|
5741
|
-
return
|
|
5795
|
+
var getSubprocessResult = ({ stdout: stdout2 }) => {
|
|
5796
|
+
if (typeof stdout2 === "string") {
|
|
5797
|
+
return stdout2;
|
|
5742
5798
|
}
|
|
5743
|
-
if (isUint8Array(
|
|
5744
|
-
return uint8ArrayToString(
|
|
5799
|
+
if (isUint8Array(stdout2)) {
|
|
5800
|
+
return uint8ArrayToString(stdout2);
|
|
5745
5801
|
}
|
|
5746
|
-
if (
|
|
5802
|
+
if (stdout2 === void 0) {
|
|
5747
5803
|
throw new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);
|
|
5748
5804
|
}
|
|
5749
|
-
throw new TypeError(`Unexpected "${typeof
|
|
5805
|
+
throw new TypeError(`Unexpected "${typeof stdout2}" stdout in template expression`);
|
|
5750
5806
|
};
|
|
5751
5807
|
|
|
5752
5808
|
// node_modules/.pnpm/execa@10.0.0/node_modules/execa/lib/methods/main-sync.js
|
|
@@ -7106,8 +7162,8 @@ var disconnect = (anyProcess) => {
|
|
|
7106
7162
|
// node_modules/.pnpm/execa@10.0.0/node_modules/execa/lib/utils/deferred.js
|
|
7107
7163
|
var createDeferred = () => {
|
|
7108
7164
|
const methods = {};
|
|
7109
|
-
const promise = new Promise((
|
|
7110
|
-
Object.assign(methods, { resolve:
|
|
7165
|
+
const promise = new Promise((resolve9, reject) => {
|
|
7166
|
+
Object.assign(methods, { resolve: resolve9, reject });
|
|
7111
7167
|
});
|
|
7112
7168
|
return Object.assign(promise, methods);
|
|
7113
7169
|
};
|
|
@@ -8040,16 +8096,16 @@ var c = class {
|
|
|
8040
8096
|
#n;
|
|
8041
8097
|
#r = false;
|
|
8042
8098
|
#e = void 0;
|
|
8043
|
-
constructor(e,
|
|
8044
|
-
this.#t = e, this.#n =
|
|
8099
|
+
constructor(e, t2) {
|
|
8100
|
+
this.#t = e, this.#n = t2;
|
|
8045
8101
|
}
|
|
8046
8102
|
next() {
|
|
8047
8103
|
const e = () => this.#s();
|
|
8048
8104
|
return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;
|
|
8049
8105
|
}
|
|
8050
8106
|
return(e) {
|
|
8051
|
-
const
|
|
8052
|
-
return this.#e ? this.#e.then(
|
|
8107
|
+
const t2 = () => this.#i(e);
|
|
8108
|
+
return this.#e ? this.#e.then(t2, t2) : t2();
|
|
8053
8109
|
}
|
|
8054
8110
|
async #s() {
|
|
8055
8111
|
if (this.#r)
|
|
@@ -8060,8 +8116,8 @@ var c = class {
|
|
|
8060
8116
|
let e;
|
|
8061
8117
|
try {
|
|
8062
8118
|
e = await this.#t.read();
|
|
8063
|
-
} catch (
|
|
8064
|
-
throw this.#e = void 0, this.#r = true, this.#t.releaseLock(),
|
|
8119
|
+
} catch (t2) {
|
|
8120
|
+
throw this.#e = void 0, this.#r = true, this.#t.releaseLock(), t2;
|
|
8065
8121
|
}
|
|
8066
8122
|
return e.done && (this.#e = void 0, this.#r = true, this.#t.releaseLock()), e;
|
|
8067
8123
|
}
|
|
@@ -8072,8 +8128,8 @@ var c = class {
|
|
|
8072
8128
|
value: e
|
|
8073
8129
|
};
|
|
8074
8130
|
if (this.#r = true, !this.#n) {
|
|
8075
|
-
const
|
|
8076
|
-
return this.#t.releaseLock(), await
|
|
8131
|
+
const t2 = this.#t.cancel(e);
|
|
8132
|
+
return this.#t.releaseLock(), await t2, {
|
|
8077
8133
|
done: true,
|
|
8078
8134
|
value: e
|
|
8079
8135
|
};
|
|
@@ -8089,8 +8145,8 @@ function i() {
|
|
|
8089
8145
|
return this[n].next();
|
|
8090
8146
|
}
|
|
8091
8147
|
Object.defineProperty(i, "name", { value: "next" });
|
|
8092
|
-
function o(
|
|
8093
|
-
return this[n].return(
|
|
8148
|
+
function o(r2) {
|
|
8149
|
+
return this[n].return(r2);
|
|
8094
8150
|
}
|
|
8095
8151
|
Object.defineProperty(o, "name", { value: "return" });
|
|
8096
8152
|
var u = Object.create(a, {
|
|
@@ -8107,12 +8163,12 @@ var u = Object.create(a, {
|
|
|
8107
8163
|
value: o
|
|
8108
8164
|
}
|
|
8109
8165
|
});
|
|
8110
|
-
function h({ preventCancel:
|
|
8111
|
-
const e = this.getReader(),
|
|
8166
|
+
function h({ preventCancel: r2 = false } = {}) {
|
|
8167
|
+
const e = this.getReader(), t2 = new c(
|
|
8112
8168
|
e,
|
|
8113
|
-
|
|
8169
|
+
r2
|
|
8114
8170
|
), s = Object.create(u);
|
|
8115
|
-
return s[n] =
|
|
8171
|
+
return s[n] = t2, s;
|
|
8116
8172
|
}
|
|
8117
8173
|
|
|
8118
8174
|
// node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.js
|
|
@@ -9323,13 +9379,13 @@ var getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => {
|
|
|
9323
9379
|
return `The "${optionName}: ${serializeOptionValue(optionValue)}" option is incompatible with using "${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}".
|
|
9324
9380
|
Please set this option with "pipe" instead.`;
|
|
9325
9381
|
};
|
|
9326
|
-
var getInvalidStdioOption = (fdNumber, { stdin, stdout, stderr, stdio }) => {
|
|
9382
|
+
var getInvalidStdioOption = (fdNumber, { stdin: stdin2, stdout: stdout2, stderr, stdio }) => {
|
|
9327
9383
|
const usedDescriptor = getUsedDescriptor(fdNumber);
|
|
9328
|
-
if (usedDescriptor === 0 &&
|
|
9329
|
-
return { optionName: "stdin", optionValue:
|
|
9384
|
+
if (usedDescriptor === 0 && stdin2 !== void 0) {
|
|
9385
|
+
return { optionName: "stdin", optionValue: stdin2 };
|
|
9330
9386
|
}
|
|
9331
|
-
if (usedDescriptor === 1 &&
|
|
9332
|
-
return { optionName: "stdout", optionValue:
|
|
9387
|
+
if (usedDescriptor === 1 && stdout2 !== void 0) {
|
|
9388
|
+
return { optionName: "stdout", optionValue: stdout2 };
|
|
9333
9389
|
}
|
|
9334
9390
|
if (usedDescriptor === 2 && stderr !== void 0) {
|
|
9335
9391
|
return { optionName: "stderr", optionValue: stderr };
|
|
@@ -10219,26 +10275,26 @@ var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
|
10219
10275
|
};
|
|
10220
10276
|
|
|
10221
10277
|
// node_modules/.pnpm/execa@10.0.0/node_modules/execa/lib/resolve/all-sync.js
|
|
10222
|
-
var getAllSync = ([,
|
|
10278
|
+
var getAllSync = ([, stdout2, stderr], options) => {
|
|
10223
10279
|
if (!options.all) {
|
|
10224
10280
|
return;
|
|
10225
10281
|
}
|
|
10226
|
-
if (
|
|
10282
|
+
if (stdout2 === void 0) {
|
|
10227
10283
|
return stderr;
|
|
10228
10284
|
}
|
|
10229
10285
|
if (stderr === void 0) {
|
|
10230
|
-
return
|
|
10286
|
+
return stdout2;
|
|
10231
10287
|
}
|
|
10232
|
-
if (Array.isArray(
|
|
10233
|
-
return Array.isArray(stderr) ? [...
|
|
10288
|
+
if (Array.isArray(stdout2)) {
|
|
10289
|
+
return Array.isArray(stderr) ? [...stdout2, ...stderr] : [...stdout2, stripNewline(stderr, options, "all")];
|
|
10234
10290
|
}
|
|
10235
10291
|
if (Array.isArray(stderr)) {
|
|
10236
|
-
return [stripNewline(
|
|
10292
|
+
return [stripNewline(stdout2, options, "all"), ...stderr];
|
|
10237
10293
|
}
|
|
10238
|
-
if (isUint8Array(
|
|
10239
|
-
return concatUint8Arrays([
|
|
10294
|
+
if (isUint8Array(stdout2) && isUint8Array(stderr)) {
|
|
10295
|
+
return concatUint8Arrays([stdout2, stderr]);
|
|
10240
10296
|
}
|
|
10241
|
-
return `${
|
|
10297
|
+
return `${stdout2}${stderr}`;
|
|
10242
10298
|
};
|
|
10243
10299
|
|
|
10244
10300
|
// node_modules/.pnpm/execa@10.0.0/node_modules/execa/lib/resolve/exit-async.js
|
|
@@ -10684,15 +10740,15 @@ var handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, optio
|
|
|
10684
10740
|
};
|
|
10685
10741
|
};
|
|
10686
10742
|
var createDummyStreams = (subprocess, fileDescriptors) => {
|
|
10687
|
-
const
|
|
10688
|
-
const
|
|
10743
|
+
const stdin2 = createDummyStream();
|
|
10744
|
+
const stdout2 = createDummyStream();
|
|
10689
10745
|
const stderr = createDummyStream();
|
|
10690
10746
|
const extraStdio = Array.from({ length: fileDescriptors.length - 3 }, createDummyStream);
|
|
10691
10747
|
const all = createDummyStream();
|
|
10692
|
-
const stdio = [
|
|
10748
|
+
const stdio = [stdin2, stdout2, stderr, ...extraStdio];
|
|
10693
10749
|
Object.assign(subprocess, {
|
|
10694
|
-
stdin,
|
|
10695
|
-
stdout,
|
|
10750
|
+
stdin: stdin2,
|
|
10751
|
+
stdout: stdout2,
|
|
10696
10752
|
stderr,
|
|
10697
10753
|
stdio
|
|
10698
10754
|
});
|
|
@@ -11177,14 +11233,14 @@ var Emitter = class {
|
|
|
11177
11233
|
}
|
|
11178
11234
|
removeListener(ev, fn) {
|
|
11179
11235
|
const list = this.listeners[ev];
|
|
11180
|
-
const
|
|
11181
|
-
if (
|
|
11236
|
+
const i3 = list.indexOf(fn);
|
|
11237
|
+
if (i3 === -1) {
|
|
11182
11238
|
return;
|
|
11183
11239
|
}
|
|
11184
|
-
if (
|
|
11240
|
+
if (i3 === 0 && list.length === 1) {
|
|
11185
11241
|
list.length = 0;
|
|
11186
11242
|
} else {
|
|
11187
|
-
list.splice(
|
|
11243
|
+
list.splice(i3, 1);
|
|
11188
11244
|
}
|
|
11189
11245
|
}
|
|
11190
11246
|
emit(ev, code, signal) {
|
|
@@ -11294,8 +11350,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
11294
11350
|
} catch (_) {
|
|
11295
11351
|
}
|
|
11296
11352
|
}
|
|
11297
|
-
this.#process.emit = (ev, ...
|
|
11298
|
-
return this.#processEmit(ev, ...
|
|
11353
|
+
this.#process.emit = (ev, ...a3) => {
|
|
11354
|
+
return this.#processEmit(ev, ...a3);
|
|
11299
11355
|
};
|
|
11300
11356
|
this.#process.reallyExit = (code) => {
|
|
11301
11357
|
return this.#processReallyExit(code);
|
|
@@ -11399,11 +11455,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
11399
11455
|
const promises = weakMap.get(stream);
|
|
11400
11456
|
const promise = createDeferred();
|
|
11401
11457
|
promises.push(promise);
|
|
11402
|
-
const
|
|
11403
|
-
return { resolve:
|
|
11458
|
+
const resolve9 = promise.resolve.bind(promise);
|
|
11459
|
+
return { resolve: resolve9, promises };
|
|
11404
11460
|
};
|
|
11405
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
11406
|
-
|
|
11461
|
+
var waitForConcurrentStreams = async ({ resolve: resolve9, promises }, subprocess) => {
|
|
11462
|
+
resolve9();
|
|
11407
11463
|
const [isSubprocessExit] = await Promise.race([
|
|
11408
11464
|
Promise.allSettled([true, subprocess]),
|
|
11409
11465
|
Promise.all([false, ...promises])
|
|
@@ -12237,7 +12293,7 @@ var waitForSubprocessStream = async ({ stream, fdNumber, encoding, buffer, maxBu
|
|
|
12237
12293
|
};
|
|
12238
12294
|
|
|
12239
12295
|
// node_modules/.pnpm/execa@10.0.0/node_modules/execa/lib/resolve/all-async.js
|
|
12240
|
-
var makeAllStream = ({ stdout, stderr }, { all }) => all && (
|
|
12296
|
+
var makeAllStream = ({ stdout: stdout2, stderr }, { all }) => all && (stdout2 || stderr) ? mergeStreams([stdout2, stderr].filter(Boolean)) : void 0;
|
|
12241
12297
|
var waitForAllStream = ({ subprocess, all, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => waitForSubprocessStream({
|
|
12242
12298
|
...getAllStream(subprocess, all, buffer),
|
|
12243
12299
|
fdNumber: "all",
|
|
@@ -12249,7 +12305,7 @@ var waitForAllStream = ({ subprocess, all, encoding, buffer, maxBuffer, lines, s
|
|
|
12249
12305
|
verboseInfo,
|
|
12250
12306
|
streamInfo
|
|
12251
12307
|
});
|
|
12252
|
-
var getAllStream = ({ stdout, stderr }, all, [, bufferStdout, bufferStderr]) => {
|
|
12308
|
+
var getAllStream = ({ stdout: stdout2, stderr }, all, [, bufferStdout, bufferStderr]) => {
|
|
12253
12309
|
const buffer = bufferStdout || bufferStderr;
|
|
12254
12310
|
if (!buffer) {
|
|
12255
12311
|
return { stream: all, buffer };
|
|
@@ -12258,11 +12314,11 @@ var getAllStream = ({ stdout, stderr }, all, [, bufferStdout, bufferStderr]) =>
|
|
|
12258
12314
|
return { stream: stderr, buffer };
|
|
12259
12315
|
}
|
|
12260
12316
|
if (!bufferStderr) {
|
|
12261
|
-
return { stream:
|
|
12317
|
+
return { stream: stdout2, buffer };
|
|
12262
12318
|
}
|
|
12263
12319
|
return { stream: all, buffer };
|
|
12264
12320
|
};
|
|
12265
|
-
var getAllMixed = ({ stdout, stderr }, all) => all &&
|
|
12321
|
+
var getAllMixed = ({ stdout: stdout2, stderr }, all) => all && stdout2 && stderr && stdout2.readableObjectMode !== stderr.readableObjectMode;
|
|
12266
12322
|
|
|
12267
12323
|
// node_modules/.pnpm/execa@10.0.0/node_modules/execa/lib/resolve/wait-subprocess.js
|
|
12268
12324
|
import { once as once8 } from "node:events";
|
|
@@ -12956,7 +13012,7 @@ function permissionEvidence(request) {
|
|
|
12956
13012
|
}
|
|
12957
13013
|
function redact(value, environment) {
|
|
12958
13014
|
return Object.values(environment).reduce(
|
|
12959
|
-
(
|
|
13015
|
+
(text2, secret) => secret ? text2.replaceAll(secret, "[REDACTED]") : text2,
|
|
12960
13016
|
value
|
|
12961
13017
|
);
|
|
12962
13018
|
}
|
|
@@ -12992,7 +13048,7 @@ function sandboxArguments(request) {
|
|
|
12992
13048
|
"/tmp/home"
|
|
12993
13049
|
];
|
|
12994
13050
|
for (const [key, value] of Object.entries(request.environment).sort(
|
|
12995
|
-
([
|
|
13051
|
+
([a3], [b]) => a3.localeCompare(b)
|
|
12996
13052
|
)) {
|
|
12997
13053
|
args.push("--setenv", key, value);
|
|
12998
13054
|
}
|
|
@@ -13018,7 +13074,7 @@ async function executeInvocation(request) {
|
|
|
13018
13074
|
maxBuffer: 1024 * 1024
|
|
13019
13075
|
});
|
|
13020
13076
|
const durationMs = Math.round(performance.now() - started);
|
|
13021
|
-
const
|
|
13077
|
+
const stdout2 = redact(outcome.stdout, request.environment);
|
|
13022
13078
|
const stderr = redact(outcome.stderr, request.environment);
|
|
13023
13079
|
const after = Object.freeze({
|
|
13024
13080
|
sourceWorkspaceDigest: await sourceWorkspaceDigest(request.sourceWorkspace),
|
|
@@ -13060,7 +13116,7 @@ async function executeInvocation(request) {
|
|
|
13060
13116
|
after,
|
|
13061
13117
|
permissions,
|
|
13062
13118
|
violations,
|
|
13063
|
-
stdout,
|
|
13119
|
+
stdout: stdout2,
|
|
13064
13120
|
stderr,
|
|
13065
13121
|
exitCode: outcome.exitCode,
|
|
13066
13122
|
signal: outcome.signal
|
|
@@ -13073,7 +13129,7 @@ async function executeInvocation(request) {
|
|
|
13073
13129
|
executable: request.executable,
|
|
13074
13130
|
argv: request.argv,
|
|
13075
13131
|
cwd: request.cwd,
|
|
13076
|
-
stdout,
|
|
13132
|
+
stdout: stdout2,
|
|
13077
13133
|
stderr,
|
|
13078
13134
|
exitCode: outcome.exitCode ?? null,
|
|
13079
13135
|
...outcome.signal ? { signal: outcome.signal } : {},
|
|
@@ -13455,6 +13511,1256 @@ async function inspectProduction(system, options) {
|
|
|
13455
13511
|
};
|
|
13456
13512
|
}
|
|
13457
13513
|
|
|
13514
|
+
// node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
13515
|
+
import { styleText } from "node:util";
|
|
13516
|
+
import { stdout, stdin } from "node:process";
|
|
13517
|
+
import * as l from "node:readline";
|
|
13518
|
+
import l__default from "node:readline";
|
|
13519
|
+
|
|
13520
|
+
// node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
13521
|
+
var getCodePointsLength = /* @__PURE__ */ (() => {
|
|
13522
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
13523
|
+
return (input) => {
|
|
13524
|
+
let surrogatePairsNr = 0;
|
|
13525
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
13526
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
13527
|
+
surrogatePairsNr += 1;
|
|
13528
|
+
}
|
|
13529
|
+
return input.length - surrogatePairsNr;
|
|
13530
|
+
};
|
|
13531
|
+
})();
|
|
13532
|
+
var isFullWidth = (x) => {
|
|
13533
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
13534
|
+
};
|
|
13535
|
+
var isWideNotCJKTNotEmoji = (x) => {
|
|
13536
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
13537
|
+
};
|
|
13538
|
+
|
|
13539
|
+
// node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
13540
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
13541
|
+
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
13542
|
+
var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
13543
|
+
var TAB_RE = /\t{1,1000}/y;
|
|
13544
|
+
var EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
13545
|
+
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
13546
|
+
var MODIFIER_RE = new RegExp("\\p{M}+", "gu");
|
|
13547
|
+
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
13548
|
+
var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
13549
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
13550
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
13551
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
13552
|
+
const ANSI_WIDTH = 0;
|
|
13553
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
13554
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
13555
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
13556
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
13557
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
13558
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
13559
|
+
const PARSE_BLOCKS = [
|
|
13560
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
13561
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
13562
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
13563
|
+
[TAB_RE, TAB_WIDTH],
|
|
13564
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
13565
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
13566
|
+
];
|
|
13567
|
+
let indexPrev = 0;
|
|
13568
|
+
let index = 0;
|
|
13569
|
+
let length = input.length;
|
|
13570
|
+
let lengthExtra = 0;
|
|
13571
|
+
let truncationEnabled = false;
|
|
13572
|
+
let truncationIndex = length;
|
|
13573
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
13574
|
+
let unmatchedStart = 0;
|
|
13575
|
+
let unmatchedEnd = 0;
|
|
13576
|
+
let width = 0;
|
|
13577
|
+
let widthExtra = 0;
|
|
13578
|
+
outer: while (true) {
|
|
13579
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
13580
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
13581
|
+
lengthExtra = 0;
|
|
13582
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
13583
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
13584
|
+
if (isFullWidth(codePoint)) {
|
|
13585
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
13586
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
13587
|
+
widthExtra = WIDE_WIDTH;
|
|
13588
|
+
} else {
|
|
13589
|
+
widthExtra = REGULAR_WIDTH;
|
|
13590
|
+
}
|
|
13591
|
+
if (width + widthExtra > truncationLimit) {
|
|
13592
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
13593
|
+
}
|
|
13594
|
+
if (width + widthExtra > LIMIT) {
|
|
13595
|
+
truncationEnabled = true;
|
|
13596
|
+
break outer;
|
|
13597
|
+
}
|
|
13598
|
+
lengthExtra += char.length;
|
|
13599
|
+
width += widthExtra;
|
|
13600
|
+
}
|
|
13601
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
13602
|
+
}
|
|
13603
|
+
if (index >= length) {
|
|
13604
|
+
break outer;
|
|
13605
|
+
}
|
|
13606
|
+
for (let i3 = 0, l2 = PARSE_BLOCKS.length; i3 < l2; i3++) {
|
|
13607
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i3];
|
|
13608
|
+
BLOCK_RE.lastIndex = index;
|
|
13609
|
+
if (BLOCK_RE.test(input)) {
|
|
13610
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
13611
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
13612
|
+
if (width + widthExtra > truncationLimit) {
|
|
13613
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
13614
|
+
}
|
|
13615
|
+
if (width + widthExtra > LIMIT) {
|
|
13616
|
+
truncationEnabled = true;
|
|
13617
|
+
break outer;
|
|
13618
|
+
}
|
|
13619
|
+
width += widthExtra;
|
|
13620
|
+
unmatchedStart = indexPrev;
|
|
13621
|
+
unmatchedEnd = index;
|
|
13622
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
13623
|
+
continue outer;
|
|
13624
|
+
}
|
|
13625
|
+
}
|
|
13626
|
+
index += 1;
|
|
13627
|
+
}
|
|
13628
|
+
return {
|
|
13629
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
13630
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
13631
|
+
truncated: truncationEnabled,
|
|
13632
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
13633
|
+
};
|
|
13634
|
+
};
|
|
13635
|
+
var dist_default = getStringTruncatedWidth;
|
|
13636
|
+
|
|
13637
|
+
// node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
13638
|
+
var NO_TRUNCATION2 = {
|
|
13639
|
+
limit: Infinity,
|
|
13640
|
+
ellipsis: "",
|
|
13641
|
+
ellipsisWidth: 0
|
|
13642
|
+
};
|
|
13643
|
+
var fastStringWidth = (input, options = {}) => {
|
|
13644
|
+
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
13645
|
+
};
|
|
13646
|
+
var dist_default2 = fastStringWidth;
|
|
13647
|
+
|
|
13648
|
+
// node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
13649
|
+
var ESC = "\x1B";
|
|
13650
|
+
var CSI = "\x9B";
|
|
13651
|
+
var END_CODE = 39;
|
|
13652
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
13653
|
+
var ANSI_CSI = "[";
|
|
13654
|
+
var ANSI_OSC = "]";
|
|
13655
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
13656
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
13657
|
+
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
13658
|
+
var getClosingCode = (openingCode) => {
|
|
13659
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
13660
|
+
return 39;
|
|
13661
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
13662
|
+
return 39;
|
|
13663
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
13664
|
+
return 49;
|
|
13665
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
13666
|
+
return 49;
|
|
13667
|
+
if (openingCode === 1 || openingCode === 2)
|
|
13668
|
+
return 22;
|
|
13669
|
+
if (openingCode === 3)
|
|
13670
|
+
return 23;
|
|
13671
|
+
if (openingCode === 4)
|
|
13672
|
+
return 24;
|
|
13673
|
+
if (openingCode === 7)
|
|
13674
|
+
return 27;
|
|
13675
|
+
if (openingCode === 8)
|
|
13676
|
+
return 28;
|
|
13677
|
+
if (openingCode === 9)
|
|
13678
|
+
return 29;
|
|
13679
|
+
if (openingCode === 0)
|
|
13680
|
+
return 0;
|
|
13681
|
+
return void 0;
|
|
13682
|
+
};
|
|
13683
|
+
var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
13684
|
+
var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
13685
|
+
var wrapWord = (rows, word, columns) => {
|
|
13686
|
+
const characters = word[Symbol.iterator]();
|
|
13687
|
+
let isInsideEscape = false;
|
|
13688
|
+
let isInsideLinkEscape = false;
|
|
13689
|
+
let lastRow = rows.at(-1);
|
|
13690
|
+
let visible = lastRow === void 0 ? 0 : dist_default2(lastRow);
|
|
13691
|
+
let currentCharacter = characters.next();
|
|
13692
|
+
let nextCharacter = characters.next();
|
|
13693
|
+
let rawCharacterIndex = 0;
|
|
13694
|
+
while (!currentCharacter.done) {
|
|
13695
|
+
const character = currentCharacter.value;
|
|
13696
|
+
const characterLength = dist_default2(character);
|
|
13697
|
+
if (visible + characterLength <= columns) {
|
|
13698
|
+
rows[rows.length - 1] += character;
|
|
13699
|
+
} else {
|
|
13700
|
+
rows.push(character);
|
|
13701
|
+
visible = 0;
|
|
13702
|
+
}
|
|
13703
|
+
if (character === ESC || character === CSI) {
|
|
13704
|
+
isInsideEscape = true;
|
|
13705
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
13706
|
+
}
|
|
13707
|
+
if (isInsideEscape) {
|
|
13708
|
+
if (isInsideLinkEscape) {
|
|
13709
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
13710
|
+
isInsideEscape = false;
|
|
13711
|
+
isInsideLinkEscape = false;
|
|
13712
|
+
}
|
|
13713
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
13714
|
+
isInsideEscape = false;
|
|
13715
|
+
}
|
|
13716
|
+
} else {
|
|
13717
|
+
visible += characterLength;
|
|
13718
|
+
if (visible === columns && !nextCharacter.done) {
|
|
13719
|
+
rows.push("");
|
|
13720
|
+
visible = 0;
|
|
13721
|
+
}
|
|
13722
|
+
}
|
|
13723
|
+
currentCharacter = nextCharacter;
|
|
13724
|
+
nextCharacter = characters.next();
|
|
13725
|
+
rawCharacterIndex += character.length;
|
|
13726
|
+
}
|
|
13727
|
+
lastRow = rows.at(-1);
|
|
13728
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
|
|
13729
|
+
rows[rows.length - 2] += rows.pop();
|
|
13730
|
+
}
|
|
13731
|
+
};
|
|
13732
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
13733
|
+
const words = string.split(" ");
|
|
13734
|
+
let last = words.length;
|
|
13735
|
+
while (last) {
|
|
13736
|
+
if (dist_default2(words[last - 1])) {
|
|
13737
|
+
break;
|
|
13738
|
+
}
|
|
13739
|
+
last--;
|
|
13740
|
+
}
|
|
13741
|
+
if (last === words.length) {
|
|
13742
|
+
return string;
|
|
13743
|
+
}
|
|
13744
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
13745
|
+
};
|
|
13746
|
+
var exec = (string, columns, options = {}) => {
|
|
13747
|
+
if (options.trim !== false && string.trim() === "") {
|
|
13748
|
+
return "";
|
|
13749
|
+
}
|
|
13750
|
+
let returnValue = "";
|
|
13751
|
+
let escapeCode;
|
|
13752
|
+
let escapeUrl;
|
|
13753
|
+
const words = string.split(" ");
|
|
13754
|
+
let rows = [""];
|
|
13755
|
+
let rowLength = 0;
|
|
13756
|
+
for (let index = 0; index < words.length; index++) {
|
|
13757
|
+
const word = words[index];
|
|
13758
|
+
if (options.trim !== false) {
|
|
13759
|
+
const row = rows.at(-1) ?? "";
|
|
13760
|
+
const trimmed = row.trimStart();
|
|
13761
|
+
if (row.length !== trimmed.length) {
|
|
13762
|
+
rows[rows.length - 1] = trimmed;
|
|
13763
|
+
rowLength = dist_default2(trimmed);
|
|
13764
|
+
}
|
|
13765
|
+
}
|
|
13766
|
+
if (index !== 0) {
|
|
13767
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
13768
|
+
rows.push("");
|
|
13769
|
+
rowLength = 0;
|
|
13770
|
+
}
|
|
13771
|
+
if (rowLength || options.trim === false) {
|
|
13772
|
+
rows[rows.length - 1] += " ";
|
|
13773
|
+
rowLength++;
|
|
13774
|
+
}
|
|
13775
|
+
}
|
|
13776
|
+
const wordLength = dist_default2(word);
|
|
13777
|
+
if (options.hard && wordLength > columns) {
|
|
13778
|
+
const remainingColumns = columns - rowLength;
|
|
13779
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
13780
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
13781
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
13782
|
+
rows.push("");
|
|
13783
|
+
}
|
|
13784
|
+
wrapWord(rows, word, columns);
|
|
13785
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
13786
|
+
continue;
|
|
13787
|
+
}
|
|
13788
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
13789
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
13790
|
+
wrapWord(rows, word, columns);
|
|
13791
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
13792
|
+
continue;
|
|
13793
|
+
}
|
|
13794
|
+
rows.push("");
|
|
13795
|
+
rowLength = 0;
|
|
13796
|
+
}
|
|
13797
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
13798
|
+
wrapWord(rows, word, columns);
|
|
13799
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
13800
|
+
continue;
|
|
13801
|
+
}
|
|
13802
|
+
rows[rows.length - 1] += word;
|
|
13803
|
+
rowLength += wordLength;
|
|
13804
|
+
}
|
|
13805
|
+
if (options.trim !== false) {
|
|
13806
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
13807
|
+
}
|
|
13808
|
+
const preString = rows.join("\n");
|
|
13809
|
+
let inSurrogate = false;
|
|
13810
|
+
for (let i3 = 0; i3 < preString.length; i3++) {
|
|
13811
|
+
const character = preString[i3];
|
|
13812
|
+
returnValue += character;
|
|
13813
|
+
if (!inSurrogate) {
|
|
13814
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
13815
|
+
if (inSurrogate) {
|
|
13816
|
+
continue;
|
|
13817
|
+
}
|
|
13818
|
+
} else {
|
|
13819
|
+
inSurrogate = false;
|
|
13820
|
+
}
|
|
13821
|
+
if (character === ESC || character === CSI) {
|
|
13822
|
+
GROUP_REGEX.lastIndex = i3 + 1;
|
|
13823
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
13824
|
+
const groups = groupsResult?.groups;
|
|
13825
|
+
if (groups?.code !== void 0) {
|
|
13826
|
+
const code = Number.parseFloat(groups.code);
|
|
13827
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
13828
|
+
} else if (groups?.uri !== void 0) {
|
|
13829
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
13830
|
+
}
|
|
13831
|
+
}
|
|
13832
|
+
if (preString[i3 + 1] === "\n") {
|
|
13833
|
+
if (escapeUrl) {
|
|
13834
|
+
returnValue += wrapAnsiHyperlink("");
|
|
13835
|
+
}
|
|
13836
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
13837
|
+
if (escapeCode && closingCode) {
|
|
13838
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
13839
|
+
}
|
|
13840
|
+
} else if (character === "\n") {
|
|
13841
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
13842
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
13843
|
+
}
|
|
13844
|
+
if (escapeUrl) {
|
|
13845
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
13846
|
+
}
|
|
13847
|
+
}
|
|
13848
|
+
}
|
|
13849
|
+
return returnValue;
|
|
13850
|
+
};
|
|
13851
|
+
var CRLF_OR_LF = /\r?\n/;
|
|
13852
|
+
function wrapAnsi(string, columns, options) {
|
|
13853
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
13854
|
+
}
|
|
13855
|
+
|
|
13856
|
+
// node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
13857
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
13858
|
+
import { ReadStream } from "node:tty";
|
|
13859
|
+
function findCursor(s, o2, l2) {
|
|
13860
|
+
if (!l2.some((r2) => !r2.disabled))
|
|
13861
|
+
return s;
|
|
13862
|
+
const t2 = s + o2, n4 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n4 : t2 > n4 ? 0 : t2;
|
|
13863
|
+
return l2[e]?.disabled ? findCursor(e, o2 < 0 ? -1 : 1, l2) : e;
|
|
13864
|
+
}
|
|
13865
|
+
var a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
13866
|
+
var t = [
|
|
13867
|
+
"January",
|
|
13868
|
+
"February",
|
|
13869
|
+
"March",
|
|
13870
|
+
"April",
|
|
13871
|
+
"May",
|
|
13872
|
+
"June",
|
|
13873
|
+
"July",
|
|
13874
|
+
"August",
|
|
13875
|
+
"September",
|
|
13876
|
+
"October",
|
|
13877
|
+
"November",
|
|
13878
|
+
"December"
|
|
13879
|
+
];
|
|
13880
|
+
var settings = {
|
|
13881
|
+
actions: new Set(a$1),
|
|
13882
|
+
aliases: /* @__PURE__ */ new Map([
|
|
13883
|
+
// vim support
|
|
13884
|
+
["k", "up"],
|
|
13885
|
+
["j", "down"],
|
|
13886
|
+
["h", "left"],
|
|
13887
|
+
["l", "right"],
|
|
13888
|
+
["", "cancel"],
|
|
13889
|
+
// opinionated defaults!
|
|
13890
|
+
["escape", "cancel"]
|
|
13891
|
+
]),
|
|
13892
|
+
messages: {
|
|
13893
|
+
cancel: "Canceled",
|
|
13894
|
+
error: "Something went wrong"
|
|
13895
|
+
},
|
|
13896
|
+
withGuide: true,
|
|
13897
|
+
date: {
|
|
13898
|
+
monthNames: [...t],
|
|
13899
|
+
messages: {
|
|
13900
|
+
required: "Please enter a valid date",
|
|
13901
|
+
invalidMonth: "There are only 12 months in a year",
|
|
13902
|
+
invalidDay: (n4, e) => `There are only ${n4} days in ${e}`,
|
|
13903
|
+
afterMin: (n4) => `Date must be on or after ${n4.toISOString().slice(0, 10)}`,
|
|
13904
|
+
beforeMax: (n4) => `Date must be on or before ${n4.toISOString().slice(0, 10)}`
|
|
13905
|
+
}
|
|
13906
|
+
}
|
|
13907
|
+
};
|
|
13908
|
+
function isActionKey(n4, e) {
|
|
13909
|
+
if (typeof n4 == "string")
|
|
13910
|
+
return settings.aliases.get(n4) === e;
|
|
13911
|
+
for (const s of n4)
|
|
13912
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
13913
|
+
return true;
|
|
13914
|
+
return false;
|
|
13915
|
+
}
|
|
13916
|
+
function diffLines(i3, s) {
|
|
13917
|
+
if (i3 === s) return;
|
|
13918
|
+
const e = i3.split(`
|
|
13919
|
+
`), t2 = s.split(`
|
|
13920
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
13921
|
+
for (let n4 = 0; n4 < r2; n4++)
|
|
13922
|
+
e[n4] !== t2[n4] && f.push(n4);
|
|
13923
|
+
return {
|
|
13924
|
+
lines: f,
|
|
13925
|
+
numLinesBefore: e.length,
|
|
13926
|
+
numLinesAfter: t2.length,
|
|
13927
|
+
numLines: r2
|
|
13928
|
+
};
|
|
13929
|
+
}
|
|
13930
|
+
var R = globalThis.process.platform.startsWith("win");
|
|
13931
|
+
var CANCEL_SYMBOL = Symbol("clack:cancel");
|
|
13932
|
+
function isCancel(e) {
|
|
13933
|
+
return e === CANCEL_SYMBOL;
|
|
13934
|
+
}
|
|
13935
|
+
function setRawMode(e, r2) {
|
|
13936
|
+
const o2 = e;
|
|
13937
|
+
o2.isTTY && o2.setRawMode(r2);
|
|
13938
|
+
}
|
|
13939
|
+
function block({
|
|
13940
|
+
input: e = stdin,
|
|
13941
|
+
output: r2 = stdout,
|
|
13942
|
+
overwrite: o2 = true,
|
|
13943
|
+
hideCursor: t2 = true
|
|
13944
|
+
} = {}) {
|
|
13945
|
+
const s = l.createInterface({
|
|
13946
|
+
input: e,
|
|
13947
|
+
output: r2,
|
|
13948
|
+
prompt: "",
|
|
13949
|
+
tabSize: 1
|
|
13950
|
+
});
|
|
13951
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
13952
|
+
const n4 = (f, { name: a3, sequence: p }) => {
|
|
13953
|
+
const c4 = String(f);
|
|
13954
|
+
if (isActionKey([c4, a3, p], "cancel")) {
|
|
13955
|
+
t2 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
13956
|
+
return;
|
|
13957
|
+
}
|
|
13958
|
+
if (!o2) return;
|
|
13959
|
+
const i3 = a3 === "return" ? 0 : -1, m = a3 === "return" ? -1 : 0;
|
|
13960
|
+
l.moveCursor(r2, i3, m, () => {
|
|
13961
|
+
l.clearLine(r2, 1, () => {
|
|
13962
|
+
e.once("keypress", n4);
|
|
13963
|
+
});
|
|
13964
|
+
});
|
|
13965
|
+
};
|
|
13966
|
+
return t2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", n4), () => {
|
|
13967
|
+
e.off("keypress", n4), t2 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
13968
|
+
};
|
|
13969
|
+
}
|
|
13970
|
+
var getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
13971
|
+
var getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
13972
|
+
function wrapTextWithPrefix(e, r2, o2, t2 = o2, s = o2, n4) {
|
|
13973
|
+
const f = getColumns(e ?? stdout);
|
|
13974
|
+
return wrapAnsi(r2, f - o2.length, {
|
|
13975
|
+
hard: true,
|
|
13976
|
+
trim: false
|
|
13977
|
+
}).split(`
|
|
13978
|
+
`).map((c4, i3, m) => {
|
|
13979
|
+
const d = n4 ? n4(c4, i3) : c4;
|
|
13980
|
+
return i3 === 0 ? `${t2}${d}` : i3 === m.length - 1 ? `${s}${d}` : `${o2}${d}`;
|
|
13981
|
+
}).join(`
|
|
13982
|
+
`);
|
|
13983
|
+
}
|
|
13984
|
+
function runValidation(e, n4) {
|
|
13985
|
+
if ("~standard" in e) {
|
|
13986
|
+
const a3 = e["~standard"].validate(n4);
|
|
13987
|
+
if (a3 instanceof Promise)
|
|
13988
|
+
throw new TypeError(
|
|
13989
|
+
"Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic."
|
|
13990
|
+
);
|
|
13991
|
+
return a3.issues?.at(0)?.message;
|
|
13992
|
+
}
|
|
13993
|
+
return e(n4);
|
|
13994
|
+
}
|
|
13995
|
+
var V = class {
|
|
13996
|
+
input;
|
|
13997
|
+
output;
|
|
13998
|
+
_abortSignal;
|
|
13999
|
+
rl;
|
|
14000
|
+
opts;
|
|
14001
|
+
_render;
|
|
14002
|
+
_track = false;
|
|
14003
|
+
_prevFrame = "";
|
|
14004
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
14005
|
+
_cursor = 0;
|
|
14006
|
+
state = "initial";
|
|
14007
|
+
error = "";
|
|
14008
|
+
value;
|
|
14009
|
+
userInput = "";
|
|
14010
|
+
constructor(t2, e = true) {
|
|
14011
|
+
const { input: i3 = stdin, output: n4 = stdout, render: s, signal: r2, ...o2 } = t2;
|
|
14012
|
+
this.opts = o2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r2, this.input = i3, this.output = n4;
|
|
14013
|
+
}
|
|
14014
|
+
/**
|
|
14015
|
+
* Unsubscribe all listeners
|
|
14016
|
+
*/
|
|
14017
|
+
unsubscribe() {
|
|
14018
|
+
this._subscribers.clear();
|
|
14019
|
+
}
|
|
14020
|
+
/**
|
|
14021
|
+
* Set a subscriber with opts
|
|
14022
|
+
* @param event - The event name
|
|
14023
|
+
*/
|
|
14024
|
+
setSubscriber(t2, e) {
|
|
14025
|
+
const i3 = this._subscribers.get(t2) ?? [];
|
|
14026
|
+
i3.push(e), this._subscribers.set(t2, i3);
|
|
14027
|
+
}
|
|
14028
|
+
/**
|
|
14029
|
+
* Subscribe to an event
|
|
14030
|
+
* @param event - The event name
|
|
14031
|
+
* @param cb - The callback
|
|
14032
|
+
*/
|
|
14033
|
+
on(t2, e) {
|
|
14034
|
+
this.setSubscriber(t2, { cb: e });
|
|
14035
|
+
}
|
|
14036
|
+
/**
|
|
14037
|
+
* Subscribe to an event once
|
|
14038
|
+
* @param event - The event name
|
|
14039
|
+
* @param cb - The callback
|
|
14040
|
+
*/
|
|
14041
|
+
once(t2, e) {
|
|
14042
|
+
this.setSubscriber(t2, { cb: e, once: true });
|
|
14043
|
+
}
|
|
14044
|
+
/**
|
|
14045
|
+
* Emit an event with data
|
|
14046
|
+
* @param event - The event name
|
|
14047
|
+
* @param data - The data to pass to the callback
|
|
14048
|
+
*/
|
|
14049
|
+
emit(t2, ...e) {
|
|
14050
|
+
const i3 = this._subscribers.get(t2) ?? [], n4 = [];
|
|
14051
|
+
for (const s of i3)
|
|
14052
|
+
s.cb(...e), s.once && n4.push(() => i3.splice(i3.indexOf(s), 1));
|
|
14053
|
+
for (const s of n4)
|
|
14054
|
+
s();
|
|
14055
|
+
}
|
|
14056
|
+
prompt() {
|
|
14057
|
+
return new Promise((t2) => {
|
|
14058
|
+
if (this._abortSignal) {
|
|
14059
|
+
if (this._abortSignal.aborted)
|
|
14060
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
14061
|
+
this._abortSignal.addEventListener(
|
|
14062
|
+
"abort",
|
|
14063
|
+
() => {
|
|
14064
|
+
this.state = "cancel", this.close();
|
|
14065
|
+
},
|
|
14066
|
+
{ once: true }
|
|
14067
|
+
);
|
|
14068
|
+
}
|
|
14069
|
+
this.rl = l__default.createInterface({
|
|
14070
|
+
input: this.input,
|
|
14071
|
+
tabSize: 2,
|
|
14072
|
+
prompt: "",
|
|
14073
|
+
escapeCodeTimeout: 50,
|
|
14074
|
+
terminal: true
|
|
14075
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
14076
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
14077
|
+
}), this.once("cancel", () => {
|
|
14078
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
14079
|
+
});
|
|
14080
|
+
});
|
|
14081
|
+
}
|
|
14082
|
+
_isActionKey(t2, e) {
|
|
14083
|
+
return t2 === " ";
|
|
14084
|
+
}
|
|
14085
|
+
_shouldSubmit(t2, e) {
|
|
14086
|
+
return true;
|
|
14087
|
+
}
|
|
14088
|
+
_setValue(t2) {
|
|
14089
|
+
this.value = t2, this.emit("value", this.value);
|
|
14090
|
+
}
|
|
14091
|
+
_setUserInput(t2, e) {
|
|
14092
|
+
this.userInput = t2 ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
14093
|
+
}
|
|
14094
|
+
_clearUserInput() {
|
|
14095
|
+
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
14096
|
+
}
|
|
14097
|
+
onKeypress(t2, e) {
|
|
14098
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
|
|
14099
|
+
if (this.opts.validate) {
|
|
14100
|
+
const i3 = runValidation(this.opts.validate, this.value);
|
|
14101
|
+
i3 && (this.error = i3 instanceof Error ? i3.message : i3, this.state = "error", this.rl?.write(this.userInput));
|
|
14102
|
+
}
|
|
14103
|
+
this.state !== "error" && (this.state = "submit");
|
|
14104
|
+
}
|
|
14105
|
+
isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
14106
|
+
}
|
|
14107
|
+
close() {
|
|
14108
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
14109
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
14110
|
+
}
|
|
14111
|
+
restoreCursor() {
|
|
14112
|
+
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
14113
|
+
`).length - 1;
|
|
14114
|
+
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
14115
|
+
}
|
|
14116
|
+
render() {
|
|
14117
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
14118
|
+
hard: true,
|
|
14119
|
+
trim: false
|
|
14120
|
+
});
|
|
14121
|
+
if (t2 !== this._prevFrame) {
|
|
14122
|
+
if (this.state === "initial")
|
|
14123
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
14124
|
+
else {
|
|
14125
|
+
const e = diffLines(this._prevFrame, t2), i3 = getRows(this.output);
|
|
14126
|
+
if (this.restoreCursor(), e) {
|
|
14127
|
+
const n4 = Math.max(0, e.numLinesAfter - i3), s = Math.max(0, e.numLinesBefore - i3);
|
|
14128
|
+
let r2 = e.lines.find((o2) => o2 >= n4);
|
|
14129
|
+
if (r2 === void 0) {
|
|
14130
|
+
this._prevFrame = t2;
|
|
14131
|
+
return;
|
|
14132
|
+
}
|
|
14133
|
+
if (e.lines.length === 1) {
|
|
14134
|
+
this.output.write(import_sisteransi.cursor.move(0, r2 - s)), this.output.write(import_sisteransi.erase.lines(1));
|
|
14135
|
+
const o2 = t2.split(`
|
|
14136
|
+
`);
|
|
14137
|
+
this.output.write(o2[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o2.length - r2 - 1));
|
|
14138
|
+
return;
|
|
14139
|
+
} else if (e.lines.length > 1) {
|
|
14140
|
+
if (n4 < s)
|
|
14141
|
+
r2 = n4;
|
|
14142
|
+
else {
|
|
14143
|
+
const h3 = r2 - s;
|
|
14144
|
+
h3 > 0 && this.output.write(import_sisteransi.cursor.move(0, h3));
|
|
14145
|
+
}
|
|
14146
|
+
this.output.write(import_sisteransi.erase.down());
|
|
14147
|
+
const f = t2.split(`
|
|
14148
|
+
`).slice(r2);
|
|
14149
|
+
this.output.write(f.join(`
|
|
14150
|
+
`)), this._prevFrame = t2;
|
|
14151
|
+
return;
|
|
14152
|
+
}
|
|
14153
|
+
}
|
|
14154
|
+
this.output.write(import_sisteransi.erase.down());
|
|
14155
|
+
}
|
|
14156
|
+
this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
|
|
14157
|
+
}
|
|
14158
|
+
}
|
|
14159
|
+
};
|
|
14160
|
+
var r = class extends V {
|
|
14161
|
+
get cursor() {
|
|
14162
|
+
return this.value ? 0 : 1;
|
|
14163
|
+
}
|
|
14164
|
+
get _value() {
|
|
14165
|
+
return this.cursor === 0;
|
|
14166
|
+
}
|
|
14167
|
+
constructor(t2) {
|
|
14168
|
+
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
14169
|
+
this.value = this._value;
|
|
14170
|
+
}), this.on("confirm", (i3) => {
|
|
14171
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i3, this.state = "submit", this.close();
|
|
14172
|
+
}), this.on("cursor", () => {
|
|
14173
|
+
this.value = !this.value;
|
|
14174
|
+
});
|
|
14175
|
+
}
|
|
14176
|
+
};
|
|
14177
|
+
var n$1 = class n2 extends V {
|
|
14178
|
+
options;
|
|
14179
|
+
cursor = 0;
|
|
14180
|
+
get _selectedValue() {
|
|
14181
|
+
return this.options[this.cursor];
|
|
14182
|
+
}
|
|
14183
|
+
changeValue() {
|
|
14184
|
+
const e = this._selectedValue;
|
|
14185
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
14186
|
+
}
|
|
14187
|
+
constructor(e) {
|
|
14188
|
+
super(e, false), this.options = e.options;
|
|
14189
|
+
const o2 = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o2 === -1 ? 0 : o2;
|
|
14190
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
14191
|
+
switch (s) {
|
|
14192
|
+
case "left":
|
|
14193
|
+
case "up":
|
|
14194
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
14195
|
+
break;
|
|
14196
|
+
case "down":
|
|
14197
|
+
case "right":
|
|
14198
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
14199
|
+
break;
|
|
14200
|
+
}
|
|
14201
|
+
this.changeValue();
|
|
14202
|
+
});
|
|
14203
|
+
}
|
|
14204
|
+
};
|
|
14205
|
+
var n3 = class extends V {
|
|
14206
|
+
get userInputWithCursor() {
|
|
14207
|
+
if (this.state === "submit")
|
|
14208
|
+
return this.userInput;
|
|
14209
|
+
const t2 = this.userInput;
|
|
14210
|
+
if (this.cursor >= t2.length)
|
|
14211
|
+
return `${this.userInput}\u2588`;
|
|
14212
|
+
const r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
|
|
14213
|
+
return `${r2}${styleText("inverse", s)}${e}`;
|
|
14214
|
+
}
|
|
14215
|
+
get cursor() {
|
|
14216
|
+
return this._cursor;
|
|
14217
|
+
}
|
|
14218
|
+
constructor(t2) {
|
|
14219
|
+
super({
|
|
14220
|
+
...t2,
|
|
14221
|
+
initialUserInput: t2.initialUserInput ?? t2.initialValue
|
|
14222
|
+
}), this.on("userInput", (r2) => {
|
|
14223
|
+
this._setValue(r2);
|
|
14224
|
+
}), this.on("finalize", () => {
|
|
14225
|
+
this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
|
|
14226
|
+
});
|
|
14227
|
+
}
|
|
14228
|
+
};
|
|
14229
|
+
|
|
14230
|
+
// node_modules/.pnpm/@clack+prompts@1.7.0/node_modules/@clack/prompts/dist/index.mjs
|
|
14231
|
+
import { styleText as styleText2, stripVTControlCharacters as stripVTControlCharacters2 } from "node:util";
|
|
14232
|
+
import process$1 from "node:process";
|
|
14233
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
14234
|
+
function isUnicodeSupported2() {
|
|
14235
|
+
if (process$1.platform !== "win32") {
|
|
14236
|
+
return process$1.env.TERM !== "linux";
|
|
14237
|
+
}
|
|
14238
|
+
return Boolean(process$1.env.CI) || 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";
|
|
14239
|
+
}
|
|
14240
|
+
var unicode = isUnicodeSupported2();
|
|
14241
|
+
var isCI = () => process.env.CI === "true";
|
|
14242
|
+
var unicodeOr = (o2, e) => unicode ? o2 : e;
|
|
14243
|
+
var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
14244
|
+
var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
14245
|
+
var S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
14246
|
+
var S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
14247
|
+
var S_BAR_START = unicodeOr("\u250C", "T");
|
|
14248
|
+
var S_BAR = unicodeOr("\u2502", "|");
|
|
14249
|
+
var S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
14250
|
+
var S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
14251
|
+
var S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
14252
|
+
var S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
14253
|
+
var S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
14254
|
+
var S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
14255
|
+
var S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
14256
|
+
var S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
14257
|
+
var S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
14258
|
+
var S_BAR_H = unicodeOr("\u2500", "-");
|
|
14259
|
+
var S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
14260
|
+
var S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
14261
|
+
var S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
14262
|
+
var S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
14263
|
+
var S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
14264
|
+
var S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
14265
|
+
var S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
14266
|
+
var S_WARN = unicodeOr("\u25B2", "!");
|
|
14267
|
+
var S_ERROR = unicodeOr("\u25A0", "x");
|
|
14268
|
+
var symbol = (o2) => {
|
|
14269
|
+
switch (o2) {
|
|
14270
|
+
case "initial":
|
|
14271
|
+
case "active":
|
|
14272
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
14273
|
+
case "cancel":
|
|
14274
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
14275
|
+
case "error":
|
|
14276
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
14277
|
+
case "submit":
|
|
14278
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
14279
|
+
}
|
|
14280
|
+
};
|
|
14281
|
+
var symbolBar = (o2) => {
|
|
14282
|
+
switch (o2) {
|
|
14283
|
+
case "initial":
|
|
14284
|
+
case "active":
|
|
14285
|
+
return styleText2("cyan", S_BAR);
|
|
14286
|
+
case "cancel":
|
|
14287
|
+
return styleText2("red", S_BAR);
|
|
14288
|
+
case "error":
|
|
14289
|
+
return styleText2("yellow", S_BAR);
|
|
14290
|
+
case "submit":
|
|
14291
|
+
return styleText2("green", S_BAR);
|
|
14292
|
+
}
|
|
14293
|
+
};
|
|
14294
|
+
function formatInstructionFooter(o2, e) {
|
|
14295
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o2.join(" \u2022 ")}`];
|
|
14296
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
14297
|
+
}
|
|
14298
|
+
var I = (l2, e, w, p, b, C = false) => {
|
|
14299
|
+
let r2 = e, O = 0;
|
|
14300
|
+
if (C)
|
|
14301
|
+
for (let i3 = p - 1; i3 >= w; i3--) {
|
|
14302
|
+
const m = l2[i3];
|
|
14303
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
14304
|
+
}
|
|
14305
|
+
else
|
|
14306
|
+
for (let i3 = w; i3 < p; i3++) {
|
|
14307
|
+
const m = l2[i3];
|
|
14308
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
14309
|
+
}
|
|
14310
|
+
return { lineCount: r2, removals: O };
|
|
14311
|
+
};
|
|
14312
|
+
var limitOptions = ({
|
|
14313
|
+
cursor: l2,
|
|
14314
|
+
options: e,
|
|
14315
|
+
style: w,
|
|
14316
|
+
output: p = process.stdout,
|
|
14317
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
14318
|
+
columnPadding: C = 0,
|
|
14319
|
+
rowPadding: r2 = 4
|
|
14320
|
+
}) => {
|
|
14321
|
+
const i3 = getColumns(p) - C, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a3 = Math.max(Math.min(b, v), 5);
|
|
14322
|
+
let f = 0;
|
|
14323
|
+
l2 >= a3 - 3 && (f = Math.max(
|
|
14324
|
+
Math.min(l2 - a3 + 3, e.length - a3),
|
|
14325
|
+
0
|
|
14326
|
+
));
|
|
14327
|
+
let d = a3 < e.length && f > 0, c4 = a3 < e.length && f + a3 < e.length;
|
|
14328
|
+
const W2 = Math.min(
|
|
14329
|
+
f + a3,
|
|
14330
|
+
e.length
|
|
14331
|
+
), s = [];
|
|
14332
|
+
let g = 0;
|
|
14333
|
+
d && g++, c4 && g++;
|
|
14334
|
+
const T = f + (d ? 1 : 0), y = W2 - (c4 ? 1 : 0);
|
|
14335
|
+
for (let t2 = T; t2 < y; t2++) {
|
|
14336
|
+
const n4 = e[t2], o2 = n4 ? w(n4, t2 === l2) : "", h3 = wrapAnsi(o2, i3, {
|
|
14337
|
+
hard: true,
|
|
14338
|
+
trim: false
|
|
14339
|
+
}).split(`
|
|
14340
|
+
`);
|
|
14341
|
+
s.push(h3), g += h3.length;
|
|
14342
|
+
}
|
|
14343
|
+
if (g > v) {
|
|
14344
|
+
let t2 = 0, n4 = 0, o2 = g;
|
|
14345
|
+
const h3 = l2 - T;
|
|
14346
|
+
let u4 = v;
|
|
14347
|
+
const L = () => I(s, o2, 0, h3, u4), E = () => I(
|
|
14348
|
+
s,
|
|
14349
|
+
o2,
|
|
14350
|
+
h3 + 1,
|
|
14351
|
+
s.length,
|
|
14352
|
+
u4,
|
|
14353
|
+
true
|
|
14354
|
+
);
|
|
14355
|
+
d ? ({ lineCount: o2, removals: t2 } = L(), o2 > u4 && (c4 || (u4 -= 1), { lineCount: o2, removals: n4 } = E())) : (c4 || (u4 -= 1), { lineCount: o2, removals: n4 } = E(), o2 > u4 && (u4 -= 1, { lineCount: o2, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n4 > 0 && (c4 = true, s.splice(s.length - n4, n4));
|
|
14356
|
+
}
|
|
14357
|
+
const x = [];
|
|
14358
|
+
d && x.push(M);
|
|
14359
|
+
for (const t2 of s)
|
|
14360
|
+
for (const n4 of t2)
|
|
14361
|
+
x.push(n4);
|
|
14362
|
+
return c4 && x.push(M), x;
|
|
14363
|
+
};
|
|
14364
|
+
var confirm = (i3) => {
|
|
14365
|
+
const a3 = i3.active ?? "Yes", s = i3.inactive ?? "No";
|
|
14366
|
+
return new r({
|
|
14367
|
+
active: a3,
|
|
14368
|
+
inactive: s,
|
|
14369
|
+
signal: i3.signal,
|
|
14370
|
+
input: i3.input,
|
|
14371
|
+
output: i3.output,
|
|
14372
|
+
initialValue: i3.initialValue ?? true,
|
|
14373
|
+
render() {
|
|
14374
|
+
const e = i3.withGuide ?? settings.withGuide, u4 = `${symbol(this.state)} `, l2 = e ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
14375
|
+
i3.output,
|
|
14376
|
+
i3.message,
|
|
14377
|
+
l2,
|
|
14378
|
+
u4
|
|
14379
|
+
), o2 = `${e ? `${styleText2("gray", S_BAR)}
|
|
14380
|
+
` : ""}${f}
|
|
14381
|
+
`, c4 = this.value ? a3 : s;
|
|
14382
|
+
switch (this.state) {
|
|
14383
|
+
case "submit": {
|
|
14384
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
14385
|
+
return `${o2}${r2}${styleText2("dim", c4)}`;
|
|
14386
|
+
}
|
|
14387
|
+
case "cancel": {
|
|
14388
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
14389
|
+
return `${o2}${r2}${styleText2(["strikethrough", "dim"], c4)}${e ? `
|
|
14390
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
14391
|
+
}
|
|
14392
|
+
default: {
|
|
14393
|
+
const r2 = e ? `${styleText2("cyan", S_BAR)} ` : "", g = e ? styleText2("cyan", S_BAR_END) : "";
|
|
14394
|
+
return `${o2}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a3}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a3)}`}${i3.vertical ? e ? `
|
|
14395
|
+
${styleText2("cyan", S_BAR)} ` : `
|
|
14396
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", s)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${s}`}
|
|
14397
|
+
${g}
|
|
14398
|
+
`;
|
|
14399
|
+
}
|
|
14400
|
+
}
|
|
14401
|
+
}
|
|
14402
|
+
}).prompt();
|
|
14403
|
+
};
|
|
14404
|
+
var MULTISELECT_INSTRUCTIONS = [
|
|
14405
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
14406
|
+
`${styleText2("dim", "Space:")} select`,
|
|
14407
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
14408
|
+
];
|
|
14409
|
+
var log = {
|
|
14410
|
+
message: (s = [], {
|
|
14411
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
14412
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
14413
|
+
output: m = process.stdout,
|
|
14414
|
+
spacing: l2 = 1,
|
|
14415
|
+
withGuide: c4
|
|
14416
|
+
} = {}) => {
|
|
14417
|
+
const t2 = [], o2 = c4 ?? settings.withGuide, f = o2 ? r2 : "", O = o2 ? `${e} ` : "", u4 = o2 ? `${r2} ` : "";
|
|
14418
|
+
for (let i3 = 0; i3 < l2; i3++)
|
|
14419
|
+
t2.push(f);
|
|
14420
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
14421
|
+
`);
|
|
14422
|
+
if (g.length > 0) {
|
|
14423
|
+
const [i3, ...y] = g;
|
|
14424
|
+
i3.length > 0 ? t2.push(`${O}${i3}`) : t2.push(o2 ? e : "");
|
|
14425
|
+
for (const p of y)
|
|
14426
|
+
p.length > 0 ? t2.push(`${u4}${p}`) : t2.push(o2 ? r2 : "");
|
|
14427
|
+
}
|
|
14428
|
+
m.write(`${t2.join(`
|
|
14429
|
+
`)}
|
|
14430
|
+
`);
|
|
14431
|
+
},
|
|
14432
|
+
info: (s, e) => {
|
|
14433
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
14434
|
+
},
|
|
14435
|
+
success: (s, e) => {
|
|
14436
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
14437
|
+
},
|
|
14438
|
+
step: (s, e) => {
|
|
14439
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
14440
|
+
},
|
|
14441
|
+
warn: (s, e) => {
|
|
14442
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
14443
|
+
},
|
|
14444
|
+
/** alias for `log.warn()`. */
|
|
14445
|
+
warning: (s, e) => {
|
|
14446
|
+
log.warn(s, e);
|
|
14447
|
+
},
|
|
14448
|
+
error: (s, e) => {
|
|
14449
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
14450
|
+
}
|
|
14451
|
+
};
|
|
14452
|
+
var cancel = (o2 = "", t2) => {
|
|
14453
|
+
const i3 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
14454
|
+
i3.write(`${e}${styleText2("red", o2)}
|
|
14455
|
+
|
|
14456
|
+
`);
|
|
14457
|
+
};
|
|
14458
|
+
var intro = (o2 = "", t2) => {
|
|
14459
|
+
const i3 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
14460
|
+
i3.write(`${e}${o2}
|
|
14461
|
+
`);
|
|
14462
|
+
};
|
|
14463
|
+
var outro = (o2 = "", t2) => {
|
|
14464
|
+
const i3 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
14465
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
14466
|
+
i3.write(`${e}${o2}
|
|
14467
|
+
|
|
14468
|
+
`);
|
|
14469
|
+
};
|
|
14470
|
+
var W = (l2) => styleText2("magenta", l2);
|
|
14471
|
+
var spinner = ({
|
|
14472
|
+
indicator: l2 = "dots",
|
|
14473
|
+
onCancel: h3,
|
|
14474
|
+
output: n4 = process.stdout,
|
|
14475
|
+
cancelMessage: G,
|
|
14476
|
+
errorMessage: O,
|
|
14477
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
14478
|
+
delay: F = unicode ? 80 : 120,
|
|
14479
|
+
signal: m,
|
|
14480
|
+
...I2
|
|
14481
|
+
} = {}) => {
|
|
14482
|
+
const u4 = isCI();
|
|
14483
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
14484
|
+
const x = getColumns(n4), k = I2?.styleFrame ?? W, g = (e) => {
|
|
14485
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
14486
|
+
S = e === 1, d && (a3(r2, e), S && typeof h3 == "function" && h3());
|
|
14487
|
+
}, f = () => g(2), i3 = () => g(1), A = () => {
|
|
14488
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i3), process.on("SIGTERM", i3), process.on("exit", g), m && m.addEventListener("abort", i3);
|
|
14489
|
+
}, H = () => {
|
|
14490
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i3), process.removeListener("SIGTERM", i3), process.removeListener("exit", g), m && m.removeEventListener("abort", i3);
|
|
14491
|
+
}, y = () => {
|
|
14492
|
+
if (p === void 0) return;
|
|
14493
|
+
u4 && n4.write(`
|
|
14494
|
+
`);
|
|
14495
|
+
const r2 = wrapAnsi(p, x, {
|
|
14496
|
+
hard: true,
|
|
14497
|
+
trim: false
|
|
14498
|
+
}).split(`
|
|
14499
|
+
`);
|
|
14500
|
+
r2.length > 1 && n4.write(import_sisteransi2.cursor.up(r2.length - 1)), n4.write(import_sisteransi2.cursor.to(0)), n4.write(import_sisteransi2.erase.down());
|
|
14501
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
14502
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o2 = Math.floor(r2 % 60);
|
|
14503
|
+
return t2 > 0 ? `[${t2}m ${o2}s]` : `[${o2}s]`;
|
|
14504
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
14505
|
+
d = true, M = block({ output: n4 }), s = C(e), w = performance.now(), N && n4.write(`${styleText2("gray", S_BAR)}
|
|
14506
|
+
`);
|
|
14507
|
+
let r2 = 0, t2 = 0;
|
|
14508
|
+
A(), T = setInterval(() => {
|
|
14509
|
+
if (u4 && s === p)
|
|
14510
|
+
return;
|
|
14511
|
+
y(), p = s;
|
|
14512
|
+
const o2 = k(E[r2]);
|
|
14513
|
+
let v;
|
|
14514
|
+
if (u4)
|
|
14515
|
+
v = `${o2} ${s}...`;
|
|
14516
|
+
else if (l2 === "timer")
|
|
14517
|
+
v = `${o2} ${s} ${_(w)}`;
|
|
14518
|
+
else {
|
|
14519
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
14520
|
+
v = `${o2} ${s}${B}`;
|
|
14521
|
+
}
|
|
14522
|
+
const j = wrapAnsi(v, x, {
|
|
14523
|
+
hard: true,
|
|
14524
|
+
trim: false
|
|
14525
|
+
});
|
|
14526
|
+
n4.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
14527
|
+
}, F);
|
|
14528
|
+
}, a3 = (e = "", r2 = 0, t2 = false) => {
|
|
14529
|
+
if (!d) return;
|
|
14530
|
+
d = false, clearInterval(T), y();
|
|
14531
|
+
const o2 = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
14532
|
+
s = e ?? s, t2 || (l2 === "timer" ? n4.write(`${o2} ${s} ${_(w)}
|
|
14533
|
+
`) : n4.write(`${o2} ${s}
|
|
14534
|
+
`)), H(), M();
|
|
14535
|
+
};
|
|
14536
|
+
return {
|
|
14537
|
+
start: P,
|
|
14538
|
+
stop: (e = "") => a3(e, 0),
|
|
14539
|
+
message: (e = "") => {
|
|
14540
|
+
s = C(e ?? s);
|
|
14541
|
+
},
|
|
14542
|
+
cancel: (e = "") => a3(e, 1),
|
|
14543
|
+
error: (e = "") => a3(e, 2),
|
|
14544
|
+
clear: () => a3("", 0, true),
|
|
14545
|
+
get isCancelled() {
|
|
14546
|
+
return S;
|
|
14547
|
+
}
|
|
14548
|
+
};
|
|
14549
|
+
};
|
|
14550
|
+
var u3 = {
|
|
14551
|
+
light: unicodeOr("\u2500", "-"),
|
|
14552
|
+
heavy: unicodeOr("\u2501", "="),
|
|
14553
|
+
block: unicodeOr("\u2588", "#")
|
|
14554
|
+
};
|
|
14555
|
+
var SELECT_INSTRUCTIONS = [
|
|
14556
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
14557
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
14558
|
+
];
|
|
14559
|
+
var c3 = (t2, o2) => t2.includes(`
|
|
14560
|
+
`) ? t2.split(`
|
|
14561
|
+
`).map((d) => o2(d)).join(`
|
|
14562
|
+
`) : o2(t2);
|
|
14563
|
+
var select2 = (t2) => {
|
|
14564
|
+
const o2 = (n4, m) => {
|
|
14565
|
+
if (n4 === void 0)
|
|
14566
|
+
return "";
|
|
14567
|
+
const s = n4.label ?? String(n4.value);
|
|
14568
|
+
switch (m) {
|
|
14569
|
+
case "disabled":
|
|
14570
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c3(s, (i3) => styleText2("gray", i3))}${n4.hint ? ` ${styleText2("dim", `(${n4.hint ?? "disabled"})`)}` : ""}`;
|
|
14571
|
+
case "selected":
|
|
14572
|
+
return `${c3(s, (i3) => styleText2("dim", i3))}`;
|
|
14573
|
+
case "active":
|
|
14574
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n4.hint ? ` ${styleText2("dim", `(${n4.hint})`)}` : ""}`;
|
|
14575
|
+
case "cancelled":
|
|
14576
|
+
return `${c3(s, (i3) => styleText2(["strikethrough", "dim"], i3))}`;
|
|
14577
|
+
default:
|
|
14578
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c3(s, (i3) => styleText2("dim", i3))}`;
|
|
14579
|
+
}
|
|
14580
|
+
}, d = t2.showInstructions ?? true;
|
|
14581
|
+
return new n$1({
|
|
14582
|
+
options: t2.options,
|
|
14583
|
+
signal: t2.signal,
|
|
14584
|
+
input: t2.input,
|
|
14585
|
+
output: t2.output,
|
|
14586
|
+
initialValue: t2.initialValue,
|
|
14587
|
+
render() {
|
|
14588
|
+
const n4 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i3 = wrapTextWithPrefix(
|
|
14589
|
+
t2.output,
|
|
14590
|
+
t2.message,
|
|
14591
|
+
s,
|
|
14592
|
+
m
|
|
14593
|
+
), u4 = `${n4 ? `${styleText2("gray", S_BAR)}
|
|
14594
|
+
` : ""}${i3}
|
|
14595
|
+
`;
|
|
14596
|
+
switch (this.state) {
|
|
14597
|
+
case "submit": {
|
|
14598
|
+
const r2 = n4 ? `${styleText2("gray", S_BAR)} ` : "", a3 = wrapTextWithPrefix(
|
|
14599
|
+
t2.output,
|
|
14600
|
+
o2(this.options[this.cursor], "selected"),
|
|
14601
|
+
r2
|
|
14602
|
+
);
|
|
14603
|
+
return `${u4}${a3}`;
|
|
14604
|
+
}
|
|
14605
|
+
case "cancel": {
|
|
14606
|
+
const r2 = n4 ? `${styleText2("gray", S_BAR)} ` : "", a3 = wrapTextWithPrefix(
|
|
14607
|
+
t2.output,
|
|
14608
|
+
o2(this.options[this.cursor], "cancelled"),
|
|
14609
|
+
r2
|
|
14610
|
+
);
|
|
14611
|
+
return `${u4}${a3}${n4 ? `
|
|
14612
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
14613
|
+
}
|
|
14614
|
+
default: {
|
|
14615
|
+
const r2 = n4 ? `${styleText2("cyan", S_BAR)} ` : "", a3 = u4.split(`
|
|
14616
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n4) : n4 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
|
|
14617
|
+
`), f = p.length + 1;
|
|
14618
|
+
return `${u4}${r2}${limitOptions({
|
|
14619
|
+
output: t2.output,
|
|
14620
|
+
cursor: this.cursor,
|
|
14621
|
+
options: this.options,
|
|
14622
|
+
maxItems: t2.maxItems,
|
|
14623
|
+
columnPadding: r2.length,
|
|
14624
|
+
rowPadding: a3 + f,
|
|
14625
|
+
style: (g, x) => o2(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
14626
|
+
}).join(`
|
|
14627
|
+
${r2}`)}
|
|
14628
|
+
${b}
|
|
14629
|
+
`;
|
|
14630
|
+
}
|
|
14631
|
+
}
|
|
14632
|
+
}
|
|
14633
|
+
}).prompt();
|
|
14634
|
+
};
|
|
14635
|
+
var i2 = `${styleText2("gray", S_BAR)} `;
|
|
14636
|
+
var text = (e) => new n3({
|
|
14637
|
+
validate: e.validate,
|
|
14638
|
+
placeholder: e.placeholder,
|
|
14639
|
+
defaultValue: e.defaultValue,
|
|
14640
|
+
initialValue: e.initialValue,
|
|
14641
|
+
output: e.output,
|
|
14642
|
+
signal: e.signal,
|
|
14643
|
+
input: e.input,
|
|
14644
|
+
render() {
|
|
14645
|
+
const i3 = e?.withGuide ?? settings.withGuide, s = `${`${i3 ? `${styleText2("gray", S_BAR)}
|
|
14646
|
+
` : ""}${symbol(this.state)} `}${e.message}
|
|
14647
|
+
`, c4 = e.placeholder && e.placeholder.length > 0 ? (
|
|
14648
|
+
// biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
|
|
14649
|
+
styleText2("inverse", e.placeholder[0]) + styleText2("dim", e.placeholder.slice(1))
|
|
14650
|
+
) : styleText2(["inverse", "hidden"], "_"), o2 = this.userInput ? this.userInputWithCursor : c4, l2 = this.value ?? "";
|
|
14651
|
+
switch (this.state) {
|
|
14652
|
+
case "error": {
|
|
14653
|
+
const n4 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r2 = i3 ? `${styleText2("yellow", S_BAR)} ` : "", d = i3 ? styleText2("yellow", S_BAR_END) : "";
|
|
14654
|
+
return `${s.trim()}
|
|
14655
|
+
${r2}${o2}
|
|
14656
|
+
${d}${n4}
|
|
14657
|
+
`;
|
|
14658
|
+
}
|
|
14659
|
+
case "submit": {
|
|
14660
|
+
const n4 = l2 ? ` ${styleText2("dim", l2)}` : "", r2 = i3 ? styleText2("gray", S_BAR) : "";
|
|
14661
|
+
return `${s}${r2}${n4}`;
|
|
14662
|
+
}
|
|
14663
|
+
case "cancel": {
|
|
14664
|
+
const n4 = l2 ? ` ${styleText2(["strikethrough", "dim"], l2)}` : "", r2 = i3 ? styleText2("gray", S_BAR) : "";
|
|
14665
|
+
return `${s}${r2}${n4}${l2.trim() ? `
|
|
14666
|
+
${r2}` : ""}`;
|
|
14667
|
+
}
|
|
14668
|
+
default: {
|
|
14669
|
+
const n4 = i3 ? `${styleText2("cyan", S_BAR)} ` : "", r2 = i3 ? styleText2("cyan", S_BAR_END) : "";
|
|
14670
|
+
return `${s}${n4}${o2}
|
|
14671
|
+
${r2}
|
|
14672
|
+
`;
|
|
14673
|
+
}
|
|
14674
|
+
}
|
|
14675
|
+
}
|
|
14676
|
+
}).prompt();
|
|
14677
|
+
|
|
14678
|
+
// packages/cli/src/wizard.ts
|
|
14679
|
+
import { resolve as resolve8 } from "node:path";
|
|
14680
|
+
var supportedRuntimes = [
|
|
14681
|
+
"oh-my-pi",
|
|
14682
|
+
"opencode",
|
|
14683
|
+
"pi",
|
|
14684
|
+
"claude-code",
|
|
14685
|
+
"codex",
|
|
14686
|
+
"antigravity",
|
|
14687
|
+
"dcode"
|
|
14688
|
+
];
|
|
14689
|
+
function unwrap(value) {
|
|
14690
|
+
if (isCancel(value)) {
|
|
14691
|
+
cancel("Setup cancelled.");
|
|
14692
|
+
process.exitCode = 130;
|
|
14693
|
+
throw new Error("cancelled");
|
|
14694
|
+
}
|
|
14695
|
+
return value;
|
|
14696
|
+
}
|
|
14697
|
+
async function runInstallWizard() {
|
|
14698
|
+
intro("Portable Capabilities setup");
|
|
14699
|
+
try {
|
|
14700
|
+
const source = String(
|
|
14701
|
+
unwrap(
|
|
14702
|
+
await text({
|
|
14703
|
+
message: "Generated capability bundle directory",
|
|
14704
|
+
placeholder: "/absolute/path/to/generated-bundle",
|
|
14705
|
+
validate: (value) => value?.trim() ? void 0 : "Source directory is required"
|
|
14706
|
+
})
|
|
14707
|
+
)
|
|
14708
|
+
);
|
|
14709
|
+
const target = String(
|
|
14710
|
+
unwrap(
|
|
14711
|
+
await text({
|
|
14712
|
+
message: "Project directory to install into",
|
|
14713
|
+
initialValue: process.cwd(),
|
|
14714
|
+
validate: (value) => value?.trim() ? void 0 : "Target directory is required"
|
|
14715
|
+
})
|
|
14716
|
+
)
|
|
14717
|
+
);
|
|
14718
|
+
const runtime = unwrap(
|
|
14719
|
+
await select2({
|
|
14720
|
+
message: "Choose a runtime",
|
|
14721
|
+
options: supportedRuntimes.map((value) => ({ value, label: value }))
|
|
14722
|
+
})
|
|
14723
|
+
);
|
|
14724
|
+
const capabilityInput = String(
|
|
14725
|
+
unwrap(
|
|
14726
|
+
await text({
|
|
14727
|
+
message: "Capability IDs",
|
|
14728
|
+
placeholder: "Leave blank to install all capabilities"
|
|
14729
|
+
})
|
|
14730
|
+
)
|
|
14731
|
+
);
|
|
14732
|
+
const dryRun = unwrap(
|
|
14733
|
+
await confirm({
|
|
14734
|
+
message: "Preview changes without writing?",
|
|
14735
|
+
initialValue: false
|
|
14736
|
+
})
|
|
14737
|
+
);
|
|
14738
|
+
const capabilityIds = capabilityInput.split(",").map((value) => value.trim()).filter(Boolean);
|
|
14739
|
+
const spinner2 = spinner();
|
|
14740
|
+
spinner2.start(dryRun ? "Planning installation" : "Installing capabilities");
|
|
14741
|
+
const result2 = await installPackage({
|
|
14742
|
+
sourceRoot: resolve8(source),
|
|
14743
|
+
targetRoot: resolve8(target),
|
|
14744
|
+
runtimeId: runtime,
|
|
14745
|
+
packageVersion: cliVersion,
|
|
14746
|
+
...capabilityIds.length ? { capabilityIds } : {},
|
|
14747
|
+
allCapabilities: capabilityIds.length === 0,
|
|
14748
|
+
dryRun
|
|
14749
|
+
});
|
|
14750
|
+
spinner2.stop(result2.ok ? "Installation complete" : "Installation failed");
|
|
14751
|
+
if (!result2.ok) {
|
|
14752
|
+
for (const diagnostic of result2.diagnostics) log.error(diagnostic);
|
|
14753
|
+
process.exitCode = 4;
|
|
14754
|
+
return;
|
|
14755
|
+
}
|
|
14756
|
+
if (result2.installed.length) log.success(`Installed ${result2.installed.length} file(s).`);
|
|
14757
|
+
if (result2.preserved.length) log.info(`Preserved ${result2.preserved.length} file(s).`);
|
|
14758
|
+
outro(dryRun ? "Preview complete." : "Project is ready.");
|
|
14759
|
+
} catch (error) {
|
|
14760
|
+
if (error.message !== "cancelled") throw error;
|
|
14761
|
+
}
|
|
14762
|
+
}
|
|
14763
|
+
|
|
13458
14764
|
// packages/cli/src/program.ts
|
|
13459
14765
|
function formatOf(options) {
|
|
13460
14766
|
return options.format === "json" ? "json" : "human";
|
|
@@ -13479,7 +14785,11 @@ function writeLifecycleResult(command, lifecycle, options) {
|
|
|
13479
14785
|
if (!lifecycle.ok) process.exitCode = 4;
|
|
13480
14786
|
}
|
|
13481
14787
|
function createProgram() {
|
|
13482
|
-
const program2 = new Command().name("portable-capabilities").version(cliVersion).description("Portable analytical capability compiler");
|
|
14788
|
+
const program2 = new Command().name("portable-capabilities").version(cliVersion).description("Portable analytical capability compiler").action(runInstallWizard);
|
|
14789
|
+
program2.command("wizard").description("Guided capability installation").action(runInstallWizard);
|
|
14790
|
+
program2.command("runtimes").description("List supported runtime IDs").action(() => {
|
|
14791
|
+
for (const runtime of supportedRuntimes) console.log(runtime);
|
|
14792
|
+
});
|
|
13483
14793
|
common2(
|
|
13484
14794
|
program2.command("build").argument("<manifest>", "system manifest").option("--output <dir>").option("--target <ids...>").option("--role <ids...>")
|
|
13485
14795
|
).action(async (manifest, options) => {
|