@ariestools/toolchain 8.7.3 → 8.7.5
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/actions/api-exposure/analyzer/analyzePackage.d.ts.map +1 -1
- package/dist/actions/api-exposure/analyzer/depSignals.d.ts +8 -0
- package/dist/actions/api-exposure/analyzer/depSignals.d.ts.map +1 -1
- package/dist/actions/api-exposure/analyzer/exposureWalk.d.ts.map +1 -1
- package/dist/actions/api-exposure/analyzer/importedPackages.d.ts +15 -0
- package/dist/actions/api-exposure/analyzer/importedPackages.d.ts.map +1 -0
- package/dist/actions/api-exposure/analyzer/structuralType.d.ts +9 -0
- package/dist/actions/api-exposure/analyzer/structuralType.d.ts.map +1 -0
- package/dist/actions/api-exposure/config.d.ts +3 -1
- package/dist/actions/api-exposure/config.d.ts.map +1 -1
- package/dist/actions/api-exposure/rules.d.ts.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.d.ts +18 -1
- package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.d.ts.map +1 -1
- package/dist/actions/deplint/rules.d.ts.map +1 -1
- package/dist/actions/deplint/rulesMisplaced.d.ts.map +1 -1
- package/dist/actions/deplint/snapshot.d.ts.map +1 -1
- package/dist/actions/deplint/types.d.ts +7 -1
- package/dist/actions/deplint/types.d.ts.map +1 -1
- package/dist/actions/package/compile/ApiExposureConfig.d.ts +16 -0
- package/dist/actions/package/compile/ApiExposureConfig.d.ts.map +1 -1
- package/dist/bin/skills.mjs +2073 -1205
- package/dist/bin/skills.mjs.map +1 -1
- package/dist/bin/xy.mjs +256 -42
- package/dist/bin/xy.mjs.map +1 -1
- package/package.json +6 -6
package/dist/bin/skills.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import module, { createRequire } from "node:module";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { Buffer as Buffer$1 } from "node:buffer";
|
|
9
|
-
import { execFile, execSync, spawn, spawnSync } from "child_process";
|
|
3
|
+
import { stripVTControlCharacters, styleText } from "node:util";
|
|
4
|
+
import process$1, { stdin, stdout } from "node:process";
|
|
5
|
+
import * as l from "node:readline";
|
|
6
|
+
import l__default from "node:readline";
|
|
7
|
+
import { ReadStream } from "node:tty";
|
|
10
8
|
import { normalize } from "node:path";
|
|
9
|
+
import { execFile, execSync, spawn, spawnSync } from "child_process";
|
|
11
10
|
import { EventEmitter } from "node:events";
|
|
12
11
|
import path, { basename, dirname, extname, isAbsolute, join, normalize as normalize$1, relative, resolve, sep } from "path";
|
|
13
12
|
import os, { homedir, platform, tmpdir } from "os";
|
|
@@ -15,9 +14,9 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from
|
|
|
15
14
|
import { fileURLToPath } from "url";
|
|
16
15
|
import { createHash } from "node:crypto";
|
|
17
16
|
import * as readline from "readline";
|
|
18
|
-
import { Writable
|
|
17
|
+
import { Writable } from "stream";
|
|
19
18
|
import { promisify } from "util";
|
|
20
|
-
import { access, cp, lstat, mkdir, mkdtemp, readFile, readdir, readlink, realpath, rm, stat, symlink, writeFile } from "fs/promises";
|
|
19
|
+
import { access, chmod, cp, lstat, mkdir, mkdtemp, readFile, readdir, readlink, realpath, rm, stat, symlink, writeFile } from "fs/promises";
|
|
21
20
|
import { createHash as createHash$1 } from "crypto";
|
|
22
21
|
import { gunzipSync, inflateRawSync } from "node:zlib";
|
|
23
22
|
//#region \0rolldown/runtime.js
|
|
@@ -42,7 +41,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
42
41
|
};
|
|
43
42
|
var __require$1 = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
44
43
|
//#endregion
|
|
45
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
44
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/rolldown-runtime.mjs
|
|
46
45
|
var __create, __defProp$1, __getOwnPropDesc$1, __getOwnPropNames$1, __getProtoOf, __hasOwnProp$1, __commonJSMin, __copyProps$1, __toESM, __require;
|
|
47
46
|
var init_rolldown_runtime = __esmMin((() => {
|
|
48
47
|
__create = Object.create;
|
|
@@ -51,7 +50,7 @@ var init_rolldown_runtime = __esmMin((() => {
|
|
|
51
50
|
__getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
52
51
|
__getProtoOf = Object.getPrototypeOf;
|
|
53
52
|
__hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
54
|
-
__commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
53
|
+
__commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
55
54
|
__copyProps$1 = (to, from, except, desc) => {
|
|
56
55
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
57
56
|
key = keys[i];
|
|
@@ -66,174 +65,365 @@ var init_rolldown_runtime = __esmMin((() => {
|
|
|
66
65
|
value: mod,
|
|
67
66
|
enumerable: true
|
|
68
67
|
}) : target, mod));
|
|
69
|
-
__require = /*
|
|
68
|
+
__require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
70
69
|
}));
|
|
71
70
|
//#endregion
|
|
72
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return e
|
|
80
|
-
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (typeof e != "string" || e.length === 0 || (u = {
|
|
86
|
-
ambiguousIsNarrow: !0,
|
|
87
|
-
...u
|
|
88
|
-
}, e = P$1(e), e.length === 0)) return 0;
|
|
89
|
-
e = e.replace(sD(), " ");
|
|
90
|
-
const t = u.ambiguousIsNarrow ? 1 : 2;
|
|
91
|
-
let F = 0;
|
|
92
|
-
for (const s of e) {
|
|
93
|
-
const i = s.codePointAt(0);
|
|
94
|
-
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
95
|
-
switch (eD.eastAsianWidth(s)) {
|
|
96
|
-
case "F":
|
|
97
|
-
case "W":
|
|
98
|
-
F += 2;
|
|
99
|
-
break;
|
|
100
|
-
case "A":
|
|
101
|
-
F += t;
|
|
102
|
-
break;
|
|
103
|
-
default: F += 1;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return F;
|
|
107
|
-
}
|
|
108
|
-
function rD() {
|
|
109
|
-
const e = /* @__PURE__ */ new Map();
|
|
110
|
-
for (const [u, t] of Object.entries(r)) {
|
|
111
|
-
for (const [F, s] of Object.entries(t)) r[F] = {
|
|
112
|
-
open: `\x1B[${s[0]}m`,
|
|
113
|
-
close: `\x1B[${s[1]}m`
|
|
114
|
-
}, t[F] = r[F], e.set(s[0], s[1]);
|
|
115
|
-
Object.defineProperty(r, u, {
|
|
116
|
-
value: t,
|
|
117
|
-
enumerable: !1
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return Object.defineProperty(r, "codes", {
|
|
121
|
-
value: e,
|
|
122
|
-
enumerable: !1
|
|
123
|
-
}), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, {
|
|
124
|
-
rgbToAnsi256: {
|
|
125
|
-
value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5),
|
|
126
|
-
enumerable: !1
|
|
127
|
-
},
|
|
128
|
-
hexToRgb: {
|
|
129
|
-
value: (u) => {
|
|
130
|
-
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
|
|
131
|
-
if (!t) return [
|
|
132
|
-
0,
|
|
133
|
-
0,
|
|
134
|
-
0
|
|
135
|
-
];
|
|
136
|
-
let [F] = t;
|
|
137
|
-
F.length === 3 && (F = [...F].map((i) => i + i).join(""));
|
|
138
|
-
const s = Number.parseInt(F, 16);
|
|
139
|
-
return [
|
|
140
|
-
s >> 16 & 255,
|
|
141
|
-
s >> 8 & 255,
|
|
142
|
-
s & 255
|
|
143
|
-
];
|
|
144
|
-
},
|
|
145
|
-
enumerable: !1
|
|
146
|
-
},
|
|
147
|
-
hexToAnsi256: {
|
|
148
|
-
value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)),
|
|
149
|
-
enumerable: !1
|
|
150
|
-
},
|
|
151
|
-
ansi256ToAnsi: {
|
|
152
|
-
value: (u) => {
|
|
153
|
-
if (u < 8) return 30 + u;
|
|
154
|
-
if (u < 16) return 90 + (u - 8);
|
|
155
|
-
let t, F, s;
|
|
156
|
-
if (u >= 232) t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
|
|
157
|
-
else {
|
|
158
|
-
u -= 16;
|
|
159
|
-
const C = u % 36;
|
|
160
|
-
t = Math.floor(u / 36) / 5, F = Math.floor(C / 6) / 5, s = C % 6 / 5;
|
|
161
|
-
}
|
|
162
|
-
const i = Math.max(t, F, s) * 2;
|
|
163
|
-
if (i === 0) return 30;
|
|
164
|
-
let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
|
|
165
|
-
return i === 2 && (D += 60), D;
|
|
166
|
-
},
|
|
167
|
-
enumerable: !1
|
|
168
|
-
},
|
|
169
|
-
rgbToAnsi: {
|
|
170
|
-
value: (u, t, F) => r.ansi256ToAnsi(r.rgbToAnsi256(u, t, F)),
|
|
171
|
-
enumerable: !1
|
|
172
|
-
},
|
|
173
|
-
hexToAnsi: {
|
|
174
|
-
value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)),
|
|
175
|
-
enumerable: !1
|
|
176
|
-
}
|
|
177
|
-
}), r;
|
|
178
|
-
}
|
|
179
|
-
function Y$1(e, u, t) {
|
|
180
|
-
return String(e).normalize().replace(/\r\n/g, `
|
|
181
|
-
`).split(`
|
|
182
|
-
`).map((F) => lD(F, u, t)).join(`
|
|
183
|
-
`);
|
|
184
|
-
}
|
|
185
|
-
function $(e, u) {
|
|
186
|
-
if (typeof e == "string") return B.aliases.get(e) === u;
|
|
187
|
-
for (const t of e) if (t !== void 0 && $(t, u)) return !0;
|
|
188
|
-
return !1;
|
|
71
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@clack/core.mjs
|
|
72
|
+
function wrapAnsi(string, columns, options) {
|
|
73
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
74
|
+
}
|
|
75
|
+
function findCursor(s, o, l) {
|
|
76
|
+
if (!l.some((r) => !r.disabled)) return s;
|
|
77
|
+
const t = s + o, n = Math.max(l.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;
|
|
78
|
+
return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
|
|
79
|
+
}
|
|
80
|
+
function isActionKey(n, e) {
|
|
81
|
+
if (typeof n == "string") return settings.aliases.get(n) === e;
|
|
82
|
+
for (const s of n) if (s !== void 0 && isActionKey(s, e)) return true;
|
|
83
|
+
return false;
|
|
189
84
|
}
|
|
190
|
-
function
|
|
191
|
-
if (
|
|
192
|
-
const
|
|
193
|
-
`),
|
|
194
|
-
`),
|
|
195
|
-
for (let
|
|
196
|
-
return
|
|
85
|
+
function diffLines(i, s) {
|
|
86
|
+
if (i === s) return;
|
|
87
|
+
const e = i.split(`
|
|
88
|
+
`), t = s.split(`
|
|
89
|
+
`), r = Math.max(e.length, t.length), f = [];
|
|
90
|
+
for (let n = 0; n < r; n++) e[n] !== t[n] && f.push(n);
|
|
91
|
+
return {
|
|
92
|
+
lines: f,
|
|
93
|
+
numLinesBefore: e.length,
|
|
94
|
+
numLinesAfter: t.length,
|
|
95
|
+
numLines: r
|
|
96
|
+
};
|
|
197
97
|
}
|
|
198
|
-
function
|
|
199
|
-
return e ===
|
|
98
|
+
function isCancel(e) {
|
|
99
|
+
return e === CANCEL_SYMBOL;
|
|
200
100
|
}
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
|
|
101
|
+
function setRawMode(e, r) {
|
|
102
|
+
const o = e;
|
|
103
|
+
o.isTTY && o.setRawMode(r);
|
|
204
104
|
}
|
|
205
|
-
function
|
|
206
|
-
const s =
|
|
105
|
+
function block({ input: e = stdin, output: r = stdout, overwrite: o = true, hideCursor: t = true } = {}) {
|
|
106
|
+
const s = l.createInterface({
|
|
207
107
|
input: e,
|
|
208
|
-
output:
|
|
108
|
+
output: r,
|
|
209
109
|
prompt: "",
|
|
210
110
|
tabSize: 1
|
|
211
111
|
});
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
215
|
-
String(
|
|
216
|
-
|
|
217
|
-
|
|
112
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
113
|
+
const n = (f, { name: a, sequence: p }) => {
|
|
114
|
+
if (isActionKey([
|
|
115
|
+
String(f),
|
|
116
|
+
a,
|
|
117
|
+
p
|
|
218
118
|
], "cancel")) {
|
|
219
|
-
|
|
119
|
+
t && r.write(import_src$2.cursor.show), process.exit(0);
|
|
220
120
|
return;
|
|
221
121
|
}
|
|
222
|
-
if (!
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
e.once("keypress",
|
|
122
|
+
if (!o) return;
|
|
123
|
+
const i = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
|
|
124
|
+
l.moveCursor(r, i, m, () => {
|
|
125
|
+
l.clearLine(r, 1, () => {
|
|
126
|
+
e.once("keypress", n);
|
|
227
127
|
});
|
|
228
128
|
});
|
|
229
129
|
};
|
|
230
|
-
return
|
|
231
|
-
e.off("keypress",
|
|
130
|
+
return t && r.write(import_src$2.cursor.hide), e.once("keypress", n), () => {
|
|
131
|
+
e.off("keypress", n), t && r.write(import_src$2.cursor.show), e instanceof ReadStream && e.isTTY && !R$1 && e.setRawMode(false), s.terminal = false, s.close();
|
|
232
132
|
};
|
|
233
133
|
}
|
|
234
|
-
|
|
134
|
+
function wrapTextWithPrefix(e, r, o, t = o, s = o, n) {
|
|
135
|
+
return wrapAnsi(r, getColumns(e ?? stdout) - o.length, {
|
|
136
|
+
hard: true,
|
|
137
|
+
trim: false
|
|
138
|
+
}).split(`
|
|
139
|
+
`).map((c, i, m) => {
|
|
140
|
+
const d = n ? n(c, i) : c;
|
|
141
|
+
return i === 0 ? `${t}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
142
|
+
}).join(`
|
|
143
|
+
`);
|
|
144
|
+
}
|
|
145
|
+
function runValidation(e, n) {
|
|
146
|
+
if ("~standard" in e) {
|
|
147
|
+
const a = e["~standard"].validate(n);
|
|
148
|
+
if (a instanceof Promise) throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
|
|
149
|
+
return a.issues?.at(0)?.message;
|
|
150
|
+
}
|
|
151
|
+
return e(n);
|
|
152
|
+
}
|
|
153
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji, ANSI_RE, CONTROL_RE$1, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION$1, getStringTruncatedWidth, NO_TRUNCATION, fastStringWidth, ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF, require_src$2, import_src$2, settings, R$1, CANCEL_SYMBOL, getColumns, getRows, V$1, r$1, u$2, a, n$1;
|
|
235
154
|
var init_core = __esmMin((() => {
|
|
236
155
|
init_rolldown_runtime();
|
|
156
|
+
getCodePointsLength = (() => {
|
|
157
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
158
|
+
return (input) => {
|
|
159
|
+
let surrogatePairsNr = 0;
|
|
160
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
161
|
+
while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
|
|
162
|
+
return input.length - surrogatePairsNr;
|
|
163
|
+
};
|
|
164
|
+
})();
|
|
165
|
+
isFullWidth = (x) => {
|
|
166
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
167
|
+
};
|
|
168
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
169
|
+
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;
|
|
170
|
+
};
|
|
171
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
172
|
+
CONTROL_RE$1 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
173
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
|
|
174
|
+
TAB_RE = /\t{1,1000}/y;
|
|
175
|
+
EMOJI_RE = /[\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?))*/uy;
|
|
176
|
+
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
177
|
+
MODIFIER_RE = /\p{M}+/gu;
|
|
178
|
+
NO_TRUNCATION$1 = {
|
|
179
|
+
limit: Infinity,
|
|
180
|
+
ellipsis: ""
|
|
181
|
+
};
|
|
182
|
+
getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
183
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
184
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
185
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
|
|
186
|
+
const ANSI_WIDTH = 0;
|
|
187
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
188
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
189
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
190
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
191
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
192
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
193
|
+
const PARSE_BLOCKS = [
|
|
194
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
195
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
196
|
+
[CONTROL_RE$1, CONTROL_WIDTH],
|
|
197
|
+
[TAB_RE, TAB_WIDTH],
|
|
198
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
199
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
200
|
+
];
|
|
201
|
+
let indexPrev = 0;
|
|
202
|
+
let index = 0;
|
|
203
|
+
let length = input.length;
|
|
204
|
+
let lengthExtra = 0;
|
|
205
|
+
let truncationEnabled = false;
|
|
206
|
+
let truncationIndex = length;
|
|
207
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
208
|
+
let unmatchedStart = 0;
|
|
209
|
+
let unmatchedEnd = 0;
|
|
210
|
+
let width = 0;
|
|
211
|
+
let widthExtra = 0;
|
|
212
|
+
outer: while (true) {
|
|
213
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
214
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
215
|
+
lengthExtra = 0;
|
|
216
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
217
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
218
|
+
if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
|
|
219
|
+
else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
|
|
220
|
+
else widthExtra = REGULAR_WIDTH;
|
|
221
|
+
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
222
|
+
if (width + widthExtra > LIMIT) {
|
|
223
|
+
truncationEnabled = true;
|
|
224
|
+
break outer;
|
|
225
|
+
}
|
|
226
|
+
lengthExtra += char.length;
|
|
227
|
+
width += widthExtra;
|
|
228
|
+
}
|
|
229
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
230
|
+
}
|
|
231
|
+
if (index >= length) break outer;
|
|
232
|
+
for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
|
|
233
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
234
|
+
BLOCK_RE.lastIndex = index;
|
|
235
|
+
if (BLOCK_RE.test(input)) {
|
|
236
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
237
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
238
|
+
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
239
|
+
if (width + widthExtra > LIMIT) {
|
|
240
|
+
truncationEnabled = true;
|
|
241
|
+
break outer;
|
|
242
|
+
}
|
|
243
|
+
width += widthExtra;
|
|
244
|
+
unmatchedStart = indexPrev;
|
|
245
|
+
unmatchedEnd = index;
|
|
246
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
247
|
+
continue outer;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
index += 1;
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
254
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
255
|
+
truncated: truncationEnabled,
|
|
256
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
NO_TRUNCATION = {
|
|
260
|
+
limit: Infinity,
|
|
261
|
+
ellipsis: "",
|
|
262
|
+
ellipsisWidth: 0
|
|
263
|
+
};
|
|
264
|
+
fastStringWidth = (input, options = {}) => {
|
|
265
|
+
return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
|
|
266
|
+
};
|
|
267
|
+
ESC = "\x1B";
|
|
268
|
+
CSI = "";
|
|
269
|
+
END_CODE = 39;
|
|
270
|
+
ANSI_ESCAPE_BELL = "\x07";
|
|
271
|
+
ANSI_CSI = "[";
|
|
272
|
+
ANSI_OSC = "]";
|
|
273
|
+
ANSI_SGR_TERMINATOR = "m";
|
|
274
|
+
ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
275
|
+
GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
276
|
+
getClosingCode = (openingCode) => {
|
|
277
|
+
if (openingCode >= 30 && openingCode <= 37) return 39;
|
|
278
|
+
if (openingCode >= 90 && openingCode <= 97) return 39;
|
|
279
|
+
if (openingCode >= 40 && openingCode <= 47) return 49;
|
|
280
|
+
if (openingCode >= 100 && openingCode <= 107) return 49;
|
|
281
|
+
if (openingCode === 1 || openingCode === 2) return 22;
|
|
282
|
+
if (openingCode === 3) return 23;
|
|
283
|
+
if (openingCode === 4) return 24;
|
|
284
|
+
if (openingCode === 7) return 27;
|
|
285
|
+
if (openingCode === 8) return 28;
|
|
286
|
+
if (openingCode === 9) return 29;
|
|
287
|
+
if (openingCode === 0) return 0;
|
|
288
|
+
};
|
|
289
|
+
wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
290
|
+
wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
291
|
+
wrapWord = (rows, word, columns) => {
|
|
292
|
+
const characters = word[Symbol.iterator]();
|
|
293
|
+
let isInsideEscape = false;
|
|
294
|
+
let isInsideLinkEscape = false;
|
|
295
|
+
let lastRow = rows.at(-1);
|
|
296
|
+
let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
|
|
297
|
+
let currentCharacter = characters.next();
|
|
298
|
+
let nextCharacter = characters.next();
|
|
299
|
+
let rawCharacterIndex = 0;
|
|
300
|
+
while (!currentCharacter.done) {
|
|
301
|
+
const character = currentCharacter.value;
|
|
302
|
+
const characterLength = fastStringWidth(character);
|
|
303
|
+
if (visible + characterLength <= columns) rows[rows.length - 1] += character;
|
|
304
|
+
else {
|
|
305
|
+
rows.push(character);
|
|
306
|
+
visible = 0;
|
|
307
|
+
}
|
|
308
|
+
if (character === ESC || character === CSI) {
|
|
309
|
+
isInsideEscape = true;
|
|
310
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
311
|
+
}
|
|
312
|
+
if (isInsideEscape) {
|
|
313
|
+
if (isInsideLinkEscape) {
|
|
314
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
315
|
+
isInsideEscape = false;
|
|
316
|
+
isInsideLinkEscape = false;
|
|
317
|
+
}
|
|
318
|
+
} else if (character === ANSI_SGR_TERMINATOR) isInsideEscape = false;
|
|
319
|
+
} else {
|
|
320
|
+
visible += characterLength;
|
|
321
|
+
if (visible === columns && !nextCharacter.done) {
|
|
322
|
+
rows.push("");
|
|
323
|
+
visible = 0;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
currentCharacter = nextCharacter;
|
|
327
|
+
nextCharacter = characters.next();
|
|
328
|
+
rawCharacterIndex += character.length;
|
|
329
|
+
}
|
|
330
|
+
lastRow = rows.at(-1);
|
|
331
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) rows[rows.length - 2] += rows.pop();
|
|
332
|
+
};
|
|
333
|
+
stringVisibleTrimSpacesRight = (string) => {
|
|
334
|
+
const words = string.split(" ");
|
|
335
|
+
let last = words.length;
|
|
336
|
+
while (last) {
|
|
337
|
+
if (fastStringWidth(words[last - 1])) break;
|
|
338
|
+
last--;
|
|
339
|
+
}
|
|
340
|
+
if (last === words.length) return string;
|
|
341
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
342
|
+
};
|
|
343
|
+
exec = (string, columns, options = {}) => {
|
|
344
|
+
if (options.trim !== false && string.trim() === "") return "";
|
|
345
|
+
let returnValue = "";
|
|
346
|
+
let escapeCode;
|
|
347
|
+
let escapeUrl;
|
|
348
|
+
const words = string.split(" ");
|
|
349
|
+
let rows = [""];
|
|
350
|
+
let rowLength = 0;
|
|
351
|
+
for (let index = 0; index < words.length; index++) {
|
|
352
|
+
const word = words[index];
|
|
353
|
+
if (options.trim !== false) {
|
|
354
|
+
const row = rows.at(-1) ?? "";
|
|
355
|
+
const trimmed = row.trimStart();
|
|
356
|
+
if (row.length !== trimmed.length) {
|
|
357
|
+
rows[rows.length - 1] = trimmed;
|
|
358
|
+
rowLength = fastStringWidth(trimmed);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (index !== 0) {
|
|
362
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
363
|
+
rows.push("");
|
|
364
|
+
rowLength = 0;
|
|
365
|
+
}
|
|
366
|
+
if (rowLength || options.trim === false) {
|
|
367
|
+
rows[rows.length - 1] += " ";
|
|
368
|
+
rowLength++;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const wordLength = fastStringWidth(word);
|
|
372
|
+
if (options.hard && wordLength > columns) {
|
|
373
|
+
const remainingColumns = columns - rowLength;
|
|
374
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
375
|
+
if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
|
|
376
|
+
wrapWord(rows, word, columns);
|
|
377
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
381
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
382
|
+
wrapWord(rows, word, columns);
|
|
383
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
rows.push("");
|
|
387
|
+
rowLength = 0;
|
|
388
|
+
}
|
|
389
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
390
|
+
wrapWord(rows, word, columns);
|
|
391
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
rows[rows.length - 1] += word;
|
|
395
|
+
rowLength += wordLength;
|
|
396
|
+
}
|
|
397
|
+
if (options.trim !== false) rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
398
|
+
const preString = rows.join("\n");
|
|
399
|
+
let inSurrogate = false;
|
|
400
|
+
for (let i = 0; i < preString.length; i++) {
|
|
401
|
+
const character = preString[i];
|
|
402
|
+
returnValue += character;
|
|
403
|
+
if (!inSurrogate) {
|
|
404
|
+
inSurrogate = character >= "\ud800" && character <= "\udbff";
|
|
405
|
+
if (inSurrogate) continue;
|
|
406
|
+
} else inSurrogate = false;
|
|
407
|
+
if (character === ESC || character === CSI) {
|
|
408
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
409
|
+
const groups = GROUP_REGEX.exec(preString)?.groups;
|
|
410
|
+
if (groups?.code !== void 0) {
|
|
411
|
+
const code = Number.parseFloat(groups.code);
|
|
412
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
413
|
+
} else if (groups?.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
414
|
+
}
|
|
415
|
+
if (preString[i + 1] === "\n") {
|
|
416
|
+
if (escapeUrl) returnValue += wrapAnsiHyperlink("");
|
|
417
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
418
|
+
if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
|
|
419
|
+
} else if (character === "\n") {
|
|
420
|
+
if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
|
|
421
|
+
if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return returnValue;
|
|
425
|
+
};
|
|
426
|
+
CRLF_OR_LF = /\r?\n/;
|
|
237
427
|
require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
238
428
|
const ESC = "\x1B";
|
|
239
429
|
const CSI = `${ESC}[`;
|
|
@@ -286,244 +476,8 @@ var init_core = __esmMin((() => {
|
|
|
286
476
|
beep
|
|
287
477
|
};
|
|
288
478
|
}));
|
|
289
|
-
require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
290
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
291
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
292
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
293
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
294
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
295
|
-
};
|
|
296
|
-
let replaceClose = (string, close, replace, index) => {
|
|
297
|
-
let result = "", cursor = 0;
|
|
298
|
-
do {
|
|
299
|
-
result += string.substring(cursor, index) + replace;
|
|
300
|
-
cursor = index + close.length;
|
|
301
|
-
index = string.indexOf(close, cursor);
|
|
302
|
-
} while (~index);
|
|
303
|
-
return result + string.substring(cursor);
|
|
304
|
-
};
|
|
305
|
-
let createColors = (enabled = isColorSupported) => {
|
|
306
|
-
let f = enabled ? formatter : () => String;
|
|
307
|
-
return {
|
|
308
|
-
isColorSupported: enabled,
|
|
309
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
310
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
311
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
312
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
313
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
314
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
315
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
316
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
317
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
318
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
319
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
320
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
321
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
322
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
323
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
324
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
325
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
326
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
327
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
328
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
329
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
330
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
331
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
332
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
333
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
334
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
335
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
336
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
337
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
338
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
339
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
340
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
341
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
342
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
343
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
344
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
345
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
346
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
347
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
348
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
349
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
module.exports = createColors();
|
|
353
|
-
module.exports.createColors = createColors;
|
|
354
|
-
}));
|
|
355
479
|
import_src$2 = require_src$2();
|
|
356
|
-
|
|
357
|
-
uD = DD();
|
|
358
|
-
W$1 = { exports: {} };
|
|
359
|
-
(function(e) {
|
|
360
|
-
var u = {};
|
|
361
|
-
e.exports = u, u.eastAsianWidth = function(F) {
|
|
362
|
-
var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
|
|
363
|
-
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
|
|
364
|
-
}, u.characterLength = function(F) {
|
|
365
|
-
var s = this.eastAsianWidth(F);
|
|
366
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
367
|
-
};
|
|
368
|
-
function t(F) {
|
|
369
|
-
return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
370
|
-
}
|
|
371
|
-
u.length = function(F) {
|
|
372
|
-
for (var s = t(F), i = 0, D = 0; D < s.length; D++) i = i + this.characterLength(s[D]);
|
|
373
|
-
return i;
|
|
374
|
-
}, u.slice = function(F, s, i) {
|
|
375
|
-
textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
376
|
-
for (var D = "", C = 0, n = t(F), E = 0; E < n.length; E++) {
|
|
377
|
-
var a = n[E], o = u.length(a);
|
|
378
|
-
if (C >= s - (o == 2 ? 1 : 0)) if (C + o <= i) D += a;
|
|
379
|
-
else break;
|
|
380
|
-
C += o;
|
|
381
|
-
}
|
|
382
|
-
return D;
|
|
383
|
-
};
|
|
384
|
-
})(W$1);
|
|
385
|
-
tD = W$1.exports;
|
|
386
|
-
eD = L$1(tD);
|
|
387
|
-
FD = function() {
|
|
388
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
389
|
-
};
|
|
390
|
-
sD = L$1(FD);
|
|
391
|
-
w = 10;
|
|
392
|
-
N = (e = 0) => (u) => `\x1B[${u + e}m`;
|
|
393
|
-
I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`;
|
|
394
|
-
R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`;
|
|
395
|
-
r = {
|
|
396
|
-
modifier: {
|
|
397
|
-
reset: [0, 0],
|
|
398
|
-
bold: [1, 22],
|
|
399
|
-
dim: [2, 22],
|
|
400
|
-
italic: [3, 23],
|
|
401
|
-
underline: [4, 24],
|
|
402
|
-
overline: [53, 55],
|
|
403
|
-
inverse: [7, 27],
|
|
404
|
-
hidden: [8, 28],
|
|
405
|
-
strikethrough: [9, 29]
|
|
406
|
-
},
|
|
407
|
-
color: {
|
|
408
|
-
black: [30, 39],
|
|
409
|
-
red: [31, 39],
|
|
410
|
-
green: [32, 39],
|
|
411
|
-
yellow: [33, 39],
|
|
412
|
-
blue: [34, 39],
|
|
413
|
-
magenta: [35, 39],
|
|
414
|
-
cyan: [36, 39],
|
|
415
|
-
white: [37, 39],
|
|
416
|
-
blackBright: [90, 39],
|
|
417
|
-
gray: [90, 39],
|
|
418
|
-
grey: [90, 39],
|
|
419
|
-
redBright: [91, 39],
|
|
420
|
-
greenBright: [92, 39],
|
|
421
|
-
yellowBright: [93, 39],
|
|
422
|
-
blueBright: [94, 39],
|
|
423
|
-
magentaBright: [95, 39],
|
|
424
|
-
cyanBright: [96, 39],
|
|
425
|
-
whiteBright: [97, 39]
|
|
426
|
-
},
|
|
427
|
-
bgColor: {
|
|
428
|
-
bgBlack: [40, 49],
|
|
429
|
-
bgRed: [41, 49],
|
|
430
|
-
bgGreen: [42, 49],
|
|
431
|
-
bgYellow: [43, 49],
|
|
432
|
-
bgBlue: [44, 49],
|
|
433
|
-
bgMagenta: [45, 49],
|
|
434
|
-
bgCyan: [46, 49],
|
|
435
|
-
bgWhite: [47, 49],
|
|
436
|
-
bgBlackBright: [100, 49],
|
|
437
|
-
bgGray: [100, 49],
|
|
438
|
-
bgGrey: [100, 49],
|
|
439
|
-
bgRedBright: [101, 49],
|
|
440
|
-
bgGreenBright: [102, 49],
|
|
441
|
-
bgYellowBright: [103, 49],
|
|
442
|
-
bgBlueBright: [104, 49],
|
|
443
|
-
bgMagentaBright: [105, 49],
|
|
444
|
-
bgCyanBright: [106, 49],
|
|
445
|
-
bgWhiteBright: [107, 49]
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
Object.keys(r.modifier);
|
|
449
|
-
iD = Object.keys(r.color);
|
|
450
|
-
CD = Object.keys(r.bgColor);
|
|
451
|
-
[...iD, ...CD];
|
|
452
|
-
ED = rD();
|
|
453
|
-
d$1 = /* @__PURE__ */ new Set(["\x1B", ""]);
|
|
454
|
-
oD = 39;
|
|
455
|
-
y$1 = "\x07";
|
|
456
|
-
V$1 = "[";
|
|
457
|
-
nD = "]";
|
|
458
|
-
G$1 = "m";
|
|
459
|
-
_$1 = `${nD}8;;`;
|
|
460
|
-
z = (e) => `${d$1.values().next().value}${V$1}${e}${G$1}`;
|
|
461
|
-
K$1 = (e) => `${d$1.values().next().value}${_$1}${e}${y$1}`;
|
|
462
|
-
aD = (e) => e.split(" ").map((u) => p(u));
|
|
463
|
-
k$1 = (e, u, t) => {
|
|
464
|
-
const F = [...u];
|
|
465
|
-
let s = !1, i = !1, D = p(P$1(e[e.length - 1]));
|
|
466
|
-
for (const [C, n] of F.entries()) {
|
|
467
|
-
const E = p(n);
|
|
468
|
-
if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d$1.has(n) && (s = !0, i = F.slice(C + 1).join("").startsWith(_$1)), s) {
|
|
469
|
-
i ? n === y$1 && (s = !1, i = !1) : n === G$1 && (s = !1);
|
|
470
|
-
continue;
|
|
471
|
-
}
|
|
472
|
-
D += E, D === t && C < F.length - 1 && (e.push(""), D = 0);
|
|
473
|
-
}
|
|
474
|
-
!D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
475
|
-
};
|
|
476
|
-
hD = (e) => {
|
|
477
|
-
const u = e.split(" ");
|
|
478
|
-
let t = u.length;
|
|
479
|
-
for (; t > 0 && !(p(u[t - 1]) > 0);) t--;
|
|
480
|
-
return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
|
|
481
|
-
};
|
|
482
|
-
lD = (e, u, t = {}) => {
|
|
483
|
-
if (t.trim !== !1 && e.trim() === "") return "";
|
|
484
|
-
let F = "", s, i;
|
|
485
|
-
const D = aD(e);
|
|
486
|
-
let C = [""];
|
|
487
|
-
for (const [E, a] of e.split(" ").entries()) {
|
|
488
|
-
t.trim !== !1 && (C[C.length - 1] = C[C.length - 1].trimStart());
|
|
489
|
-
let o = p(C[C.length - 1]);
|
|
490
|
-
if (E !== 0 && (o >= u && (t.wordWrap === !1 || t.trim === !1) && (C.push(""), o = 0), (o > 0 || t.trim === !1) && (C[C.length - 1] += " ", o++)), t.hard && D[E] > u) {
|
|
491
|
-
const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
|
|
492
|
-
Math.floor((D[E] - 1) / u) < f && C.push(""), k$1(C, a, u);
|
|
493
|
-
continue;
|
|
494
|
-
}
|
|
495
|
-
if (o + D[E] > u && o > 0 && D[E] > 0) {
|
|
496
|
-
if (t.wordWrap === !1 && o < u) {
|
|
497
|
-
k$1(C, a, u);
|
|
498
|
-
continue;
|
|
499
|
-
}
|
|
500
|
-
C.push("");
|
|
501
|
-
}
|
|
502
|
-
if (o + D[E] > u && t.wordWrap === !1) {
|
|
503
|
-
k$1(C, a, u);
|
|
504
|
-
continue;
|
|
505
|
-
}
|
|
506
|
-
C[C.length - 1] += a;
|
|
507
|
-
}
|
|
508
|
-
t.trim !== !1 && (C = C.map((E) => hD(E)));
|
|
509
|
-
const n = [...C.join(`
|
|
510
|
-
`)];
|
|
511
|
-
for (const [E, a] of n.entries()) {
|
|
512
|
-
if (F += a, d$1.has(a)) {
|
|
513
|
-
const { groups: c } = new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`).exec(n.slice(E).join("")) || { groups: {} };
|
|
514
|
-
if (c.code !== void 0) {
|
|
515
|
-
const f = Number.parseFloat(c.code);
|
|
516
|
-
s = f === oD ? void 0 : f;
|
|
517
|
-
} else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
|
|
518
|
-
}
|
|
519
|
-
const o = ED.codes.get(Number(s));
|
|
520
|
-
n[E + 1] === `
|
|
521
|
-
` ? (i && (F += K$1("")), s && o && (F += z(o))) : a === `
|
|
522
|
-
` && (s && o && (F += z(s)), i && (F += K$1(i)));
|
|
523
|
-
}
|
|
524
|
-
return F;
|
|
525
|
-
};
|
|
526
|
-
B = {
|
|
480
|
+
settings = {
|
|
527
481
|
actions: /* @__PURE__ */ new Set([
|
|
528
482
|
"up",
|
|
529
483
|
"down",
|
|
@@ -540,181 +494,252 @@ var init_core = __esmMin((() => {
|
|
|
540
494
|
["l", "right"],
|
|
541
495
|
["", "cancel"],
|
|
542
496
|
["escape", "cancel"]
|
|
543
|
-
])
|
|
497
|
+
]),
|
|
498
|
+
messages: {
|
|
499
|
+
cancel: "Canceled",
|
|
500
|
+
error: "Something went wrong"
|
|
501
|
+
},
|
|
502
|
+
withGuide: true,
|
|
503
|
+
date: {
|
|
504
|
+
monthNames: [...[
|
|
505
|
+
"January",
|
|
506
|
+
"February",
|
|
507
|
+
"March",
|
|
508
|
+
"April",
|
|
509
|
+
"May",
|
|
510
|
+
"June",
|
|
511
|
+
"July",
|
|
512
|
+
"August",
|
|
513
|
+
"September",
|
|
514
|
+
"October",
|
|
515
|
+
"November",
|
|
516
|
+
"December"
|
|
517
|
+
]],
|
|
518
|
+
messages: {
|
|
519
|
+
required: "Please enter a valid date",
|
|
520
|
+
invalidMonth: "There are only 12 months in a year",
|
|
521
|
+
invalidDay: (n, e) => `There are only ${n} days in ${e}`,
|
|
522
|
+
afterMin: (n) => `Date must be on or after ${n.toISOString().slice(0, 10)}`,
|
|
523
|
+
beforeMax: (n) => `Date must be on or before ${n.toISOString().slice(0, 10)}`
|
|
524
|
+
}
|
|
525
|
+
}
|
|
544
526
|
};
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
527
|
+
R$1 = globalThis.process.platform.startsWith("win");
|
|
528
|
+
CANCEL_SYMBOL = Symbol("clack:cancel");
|
|
529
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
530
|
+
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
531
|
+
V$1 = class {
|
|
532
|
+
input;
|
|
533
|
+
output;
|
|
534
|
+
_abortSignal;
|
|
535
|
+
rl;
|
|
536
|
+
opts;
|
|
537
|
+
_render;
|
|
538
|
+
_track = false;
|
|
539
|
+
_prevFrame = "";
|
|
540
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
541
|
+
_cursor = 0;
|
|
542
|
+
state = "initial";
|
|
543
|
+
error = "";
|
|
544
|
+
value;
|
|
545
|
+
userInput = "";
|
|
546
|
+
constructor(t, e = true) {
|
|
547
|
+
const { input: i = stdin, output: n = stdout, render: s, signal: r, ...o } = t;
|
|
548
|
+
this.opts = o, 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 = r, this.input = i, this.output = n;
|
|
560
549
|
}
|
|
561
550
|
unsubscribe() {
|
|
562
551
|
this._subscribers.clear();
|
|
563
552
|
}
|
|
564
|
-
setSubscriber(
|
|
565
|
-
const
|
|
566
|
-
|
|
553
|
+
setSubscriber(t, e) {
|
|
554
|
+
const i = this._subscribers.get(t) ?? [];
|
|
555
|
+
i.push(e), this._subscribers.set(t, i);
|
|
567
556
|
}
|
|
568
|
-
on(
|
|
569
|
-
this.setSubscriber(
|
|
557
|
+
on(t, e) {
|
|
558
|
+
this.setSubscriber(t, { cb: e });
|
|
570
559
|
}
|
|
571
|
-
once(
|
|
572
|
-
this.setSubscriber(
|
|
573
|
-
cb:
|
|
574
|
-
once:
|
|
560
|
+
once(t, e) {
|
|
561
|
+
this.setSubscriber(t, {
|
|
562
|
+
cb: e,
|
|
563
|
+
once: true
|
|
575
564
|
});
|
|
576
565
|
}
|
|
577
|
-
emit(
|
|
578
|
-
const
|
|
579
|
-
for (const
|
|
580
|
-
for (const
|
|
566
|
+
emit(t, ...e) {
|
|
567
|
+
const i = this._subscribers.get(t) ?? [], n = [];
|
|
568
|
+
for (const s of i) s.cb(...e), s.once && n.push(() => i.splice(i.indexOf(s), 1));
|
|
569
|
+
for (const s of n) s();
|
|
581
570
|
}
|
|
582
571
|
prompt() {
|
|
583
|
-
return new Promise((
|
|
572
|
+
return new Promise((t) => {
|
|
584
573
|
if (this._abortSignal) {
|
|
585
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(),
|
|
574
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(CANCEL_SYMBOL);
|
|
586
575
|
this._abortSignal.addEventListener("abort", () => {
|
|
587
576
|
this.state = "cancel", this.close();
|
|
588
|
-
}, { once:
|
|
577
|
+
}, { once: true });
|
|
589
578
|
}
|
|
590
|
-
|
|
591
|
-
F._write = (s, i, D) => {
|
|
592
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
593
|
-
}, this.input.pipe(F), this.rl = O.createInterface({
|
|
579
|
+
this.rl = l__default.createInterface({
|
|
594
580
|
input: this.input,
|
|
595
|
-
output: F,
|
|
596
581
|
tabSize: 2,
|
|
597
582
|
prompt: "",
|
|
598
583
|
escapeCodeTimeout: 50,
|
|
599
|
-
terminal:
|
|
600
|
-
}),
|
|
601
|
-
this.output.write(import_src$2.cursor.show), this.output.off("resize", this.render),
|
|
584
|
+
terminal: true
|
|
585
|
+
}), 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", () => {
|
|
586
|
+
this.output.write(import_src$2.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(this.value);
|
|
602
587
|
}), this.once("cancel", () => {
|
|
603
|
-
this.output.write(import_src$2.cursor.show), this.output.off("resize", this.render),
|
|
588
|
+
this.output.write(import_src$2.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(CANCEL_SYMBOL);
|
|
604
589
|
});
|
|
605
590
|
});
|
|
606
591
|
}
|
|
607
|
-
|
|
608
|
-
|
|
592
|
+
_isActionKey(t, e) {
|
|
593
|
+
return t === " ";
|
|
594
|
+
}
|
|
595
|
+
_shouldSubmit(t, e) {
|
|
596
|
+
return true;
|
|
597
|
+
}
|
|
598
|
+
_setValue(t) {
|
|
599
|
+
this.value = t, this.emit("value", this.value);
|
|
600
|
+
}
|
|
601
|
+
_setUserInput(t, e) {
|
|
602
|
+
this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
603
|
+
}
|
|
604
|
+
_clearUserInput() {
|
|
605
|
+
this.rl?.write(null, {
|
|
606
|
+
ctrl: true,
|
|
607
|
+
name: "u"
|
|
608
|
+
}), this._setUserInput("");
|
|
609
|
+
}
|
|
610
|
+
onKeypress(t, e) {
|
|
611
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
|
|
612
|
+
ctrl: true,
|
|
613
|
+
name: "h"
|
|
614
|
+
}), 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)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, e), e?.name === "return" && this._shouldSubmit(t, e)) {
|
|
609
615
|
if (this.opts.validate) {
|
|
610
|
-
const
|
|
611
|
-
|
|
616
|
+
const i = runValidation(this.opts.validate, this.value);
|
|
617
|
+
i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
|
|
612
618
|
}
|
|
613
619
|
this.state !== "error" && (this.state = "submit");
|
|
614
620
|
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
621
|
+
isActionKey([
|
|
622
|
+
t,
|
|
623
|
+
e?.name,
|
|
624
|
+
e?.sequence
|
|
619
625
|
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
620
626
|
}
|
|
621
627
|
close() {
|
|
622
628
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
623
|
-
`),
|
|
629
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
624
630
|
}
|
|
625
631
|
restoreCursor() {
|
|
626
|
-
const
|
|
632
|
+
const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
|
|
633
|
+
hard: true,
|
|
634
|
+
trim: false
|
|
635
|
+
}).split(`
|
|
627
636
|
`).length - 1;
|
|
628
|
-
this.output.write(import_src$2.cursor.move(-999,
|
|
637
|
+
this.output.write(import_src$2.cursor.move(-999, t * -1));
|
|
629
638
|
}
|
|
630
639
|
render() {
|
|
631
|
-
const
|
|
632
|
-
|
|
640
|
+
const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
641
|
+
hard: true,
|
|
642
|
+
trim: false
|
|
643
|
+
});
|
|
644
|
+
if (t !== this._prevFrame) {
|
|
633
645
|
if (this.state === "initial") this.output.write(import_src$2.cursor.hide);
|
|
634
646
|
else {
|
|
635
|
-
const
|
|
636
|
-
if (this.restoreCursor(),
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
647
|
+
const e = diffLines(this._prevFrame, t), i = getRows(this.output);
|
|
648
|
+
if (this.restoreCursor(), e) {
|
|
649
|
+
const n = Math.max(0, e.numLinesAfter - i), s = Math.max(0, e.numLinesBefore - i);
|
|
650
|
+
let r = e.lines.find((o) => o >= n);
|
|
651
|
+
if (r === void 0) {
|
|
652
|
+
this._prevFrame = t;
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
if (e.lines.length === 1) {
|
|
656
|
+
this.output.write(import_src$2.cursor.move(0, r - s)), this.output.write(import_src$2.erase.lines(1));
|
|
657
|
+
const o = t.split(`
|
|
640
658
|
`);
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
659
|
+
this.output.write(o[r]), this._prevFrame = t, this.output.write(import_src$2.cursor.move(0, o.length - r - 1));
|
|
660
|
+
return;
|
|
661
|
+
} else if (e.lines.length > 1) {
|
|
662
|
+
if (n < s) r = n;
|
|
663
|
+
else {
|
|
664
|
+
const h = r - s;
|
|
665
|
+
h > 0 && this.output.write(import_src$2.cursor.move(0, h));
|
|
666
|
+
}
|
|
667
|
+
this.output.write(import_src$2.erase.down());
|
|
668
|
+
const f = t.split(`
|
|
669
|
+
`).slice(r);
|
|
670
|
+
this.output.write(f.join(`
|
|
671
|
+
`)), this._prevFrame = t;
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
652
674
|
}
|
|
653
675
|
this.output.write(import_src$2.erase.down());
|
|
654
676
|
}
|
|
655
|
-
this.output.write(
|
|
677
|
+
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
656
678
|
}
|
|
657
679
|
}
|
|
658
680
|
};
|
|
659
|
-
|
|
681
|
+
r$1 = class extends V$1 {
|
|
660
682
|
get cursor() {
|
|
661
683
|
return this.value ? 0 : 1;
|
|
662
684
|
}
|
|
663
685
|
get _value() {
|
|
664
686
|
return this.cursor === 0;
|
|
665
687
|
}
|
|
666
|
-
constructor(
|
|
667
|
-
super(
|
|
688
|
+
constructor(t) {
|
|
689
|
+
super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
|
|
668
690
|
this.value = this._value;
|
|
669
|
-
}), this.on("confirm", (
|
|
670
|
-
this.output.write(import_src$2.cursor.move(0, -1)), this.value =
|
|
691
|
+
}), this.on("confirm", (i) => {
|
|
692
|
+
this.output.write(import_src$2.cursor.move(0, -1)), this.value = i, this.state = "submit", this.close();
|
|
671
693
|
}), this.on("cursor", () => {
|
|
672
694
|
this.value = !this.value;
|
|
673
695
|
});
|
|
674
696
|
}
|
|
675
697
|
};
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
698
|
+
u$2 = class u extends V$1 {
|
|
699
|
+
options;
|
|
700
|
+
cursor = 0;
|
|
701
|
+
#t;
|
|
702
|
+
getGroupItems(t) {
|
|
703
|
+
return this.options.filter((r) => r.group === t);
|
|
704
|
+
}
|
|
705
|
+
isGroupSelected(t) {
|
|
706
|
+
const r = this.getGroupItems(t), e = this.value;
|
|
707
|
+
return e === void 0 ? false : r.every((s) => e.includes(s.value));
|
|
708
|
+
}
|
|
709
|
+
toggleValue() {
|
|
710
|
+
const t = this.options[this.cursor];
|
|
711
|
+
if (t !== void 0) if (this.value === void 0 && (this.value = []), t.group === true) {
|
|
712
|
+
const r = t.value, e = this.getGroupItems(r);
|
|
713
|
+
this.isGroupSelected(r) ? this.value = this.value.filter((s) => e.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
714
|
+
} else {
|
|
715
|
+
const r = this.value.includes(t.value);
|
|
716
|
+
this.value = r ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
constructor(t) {
|
|
720
|
+
super(t, false);
|
|
721
|
+
const { options: r } = t;
|
|
722
|
+
this.#t = t.selectableGroups !== false, this.options = Object.entries(r).flatMap(([e, s]) => [{
|
|
723
|
+
value: e,
|
|
724
|
+
group: true,
|
|
725
|
+
label: e
|
|
701
726
|
}, ...s.map((i) => ({
|
|
702
727
|
...i,
|
|
703
|
-
group:
|
|
704
|
-
}))]), this.value = [...
|
|
705
|
-
switch (
|
|
728
|
+
group: e
|
|
729
|
+
}))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), this.#t ? 0 : 1), this.on("cursor", (e) => {
|
|
730
|
+
switch (e) {
|
|
706
731
|
case "left":
|
|
707
732
|
case "up": {
|
|
708
733
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
709
|
-
const s = this.options[this.cursor]?.group ===
|
|
710
|
-
!
|
|
734
|
+
const s = this.options[this.cursor]?.group === true;
|
|
735
|
+
!this.#t && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
711
736
|
break;
|
|
712
737
|
}
|
|
713
738
|
case "down":
|
|
714
739
|
case "right": {
|
|
715
740
|
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
716
|
-
const s = this.options[this.cursor]?.group ===
|
|
717
|
-
!
|
|
741
|
+
const s = this.options[this.cursor]?.group === true;
|
|
742
|
+
!this.#t && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
718
743
|
break;
|
|
719
744
|
}
|
|
720
745
|
case "space":
|
|
@@ -723,42 +748,45 @@ var init_core = __esmMin((() => {
|
|
|
723
748
|
}
|
|
724
749
|
});
|
|
725
750
|
}
|
|
726
|
-
|
|
727
|
-
|
|
751
|
+
};
|
|
752
|
+
a = class extends V$1 {
|
|
753
|
+
options;
|
|
754
|
+
cursor = 0;
|
|
755
|
+
get _value() {
|
|
756
|
+
return this.options[this.cursor]?.value;
|
|
728
757
|
}
|
|
729
|
-
|
|
730
|
-
return this.
|
|
758
|
+
get _enabledOptions() {
|
|
759
|
+
return this.options.filter((e) => e.disabled !== true);
|
|
731
760
|
}
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
const t = u.value, F = this.getGroupItems(t);
|
|
736
|
-
this.isGroupSelected(t) ? this.value = this.value.filter((s) => F.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
737
|
-
} else this.value = this.value.includes(u.value) ? this.value.filter((F) => F !== u.value) : [...this.value, u.value];
|
|
761
|
+
toggleAll() {
|
|
762
|
+
const e = this._enabledOptions, i = this.value !== void 0 && this.value.length === e.length;
|
|
763
|
+
this.value = i ? [] : e.map((t) => t.value);
|
|
738
764
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
constructor(
|
|
751
|
-
super(
|
|
752
|
-
|
|
765
|
+
toggleInvert() {
|
|
766
|
+
const e = this.value;
|
|
767
|
+
if (!e) return;
|
|
768
|
+
const i = this._enabledOptions.filter((t) => !e.includes(t.value));
|
|
769
|
+
this.value = i.map((t) => t.value);
|
|
770
|
+
}
|
|
771
|
+
toggleValue() {
|
|
772
|
+
this.value === void 0 && (this.value = []);
|
|
773
|
+
const e = this.value.includes(this._value);
|
|
774
|
+
this.value = e ? this.value.filter((i) => i !== this._value) : [...this.value, this._value];
|
|
775
|
+
}
|
|
776
|
+
constructor(e) {
|
|
777
|
+
super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
|
|
778
|
+
const i = Math.max(this.options.findIndex(({ value: t }) => t === e.cursorAt), 0);
|
|
779
|
+
this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t, l) => {
|
|
780
|
+
l.name === "a" && this.toggleAll(), l.name === "i" && this.toggleInvert();
|
|
753
781
|
}), this.on("cursor", (t) => {
|
|
754
782
|
switch (t) {
|
|
755
783
|
case "left":
|
|
756
784
|
case "up":
|
|
757
|
-
this.cursor = this.cursor
|
|
785
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
758
786
|
break;
|
|
759
787
|
case "down":
|
|
760
788
|
case "right":
|
|
761
|
-
this.cursor = this.cursor
|
|
789
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
762
790
|
break;
|
|
763
791
|
case "space":
|
|
764
792
|
this.toggleValue();
|
|
@@ -766,395 +794,653 @@ var init_core = __esmMin((() => {
|
|
|
766
794
|
}
|
|
767
795
|
});
|
|
768
796
|
}
|
|
769
|
-
get _value() {
|
|
770
|
-
return this.options[this.cursor].value;
|
|
771
|
-
}
|
|
772
|
-
toggleAll() {
|
|
773
|
-
this.value = this.value.length === this.options.length ? [] : this.options.map((t) => t.value);
|
|
774
|
-
}
|
|
775
|
-
toggleValue() {
|
|
776
|
-
this.value = this.value.includes(this._value) ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
|
|
777
|
-
}
|
|
778
797
|
};
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
798
|
+
n$1 = class n extends V$1 {
|
|
799
|
+
options;
|
|
800
|
+
cursor = 0;
|
|
801
|
+
get _selectedValue() {
|
|
802
|
+
return this.options[this.cursor];
|
|
803
|
+
}
|
|
804
|
+
changeValue() {
|
|
805
|
+
const e = this._selectedValue;
|
|
806
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
807
|
+
}
|
|
808
|
+
constructor(e) {
|
|
809
|
+
super(e, false), this.options = e.options;
|
|
810
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t = o === -1 ? 0 : o;
|
|
811
|
+
this.cursor = this.options[t]?.disabled ? findCursor(t, 1, this.options) : t, this.changeValue(), this.on("cursor", (s) => {
|
|
812
|
+
switch (s) {
|
|
791
813
|
case "left":
|
|
792
814
|
case "up":
|
|
793
|
-
this.cursor = this.cursor
|
|
815
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
794
816
|
break;
|
|
795
817
|
case "down":
|
|
796
818
|
case "right":
|
|
797
|
-
this.cursor = this.cursor
|
|
819
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
798
820
|
break;
|
|
799
821
|
}
|
|
800
822
|
this.changeValue();
|
|
801
823
|
});
|
|
802
824
|
}
|
|
803
|
-
get _value() {
|
|
804
|
-
return this.options[this.cursor];
|
|
805
|
-
}
|
|
806
|
-
changeValue() {
|
|
807
|
-
this.value = this._value.value;
|
|
808
|
-
}
|
|
809
825
|
};
|
|
810
826
|
}));
|
|
811
827
|
//#endregion
|
|
812
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
813
|
-
function
|
|
814
|
-
|
|
828
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@clack/prompts.mjs
|
|
829
|
+
function isUnicodeSupported() {
|
|
830
|
+
if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
|
|
831
|
+
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";
|
|
815
832
|
}
|
|
816
|
-
|
|
833
|
+
function formatInstructionFooter(o, e) {
|
|
834
|
+
const r = [`${e ? `${styleText("cyan", S_BAR$1)} ` : ""}${o.join(" • ")}`];
|
|
835
|
+
return e && r.push(styleText("cyan", S_BAR_END)), r;
|
|
836
|
+
}
|
|
837
|
+
var import_src$1, unicode, isCI$1, unicodeOr, S_STEP_ACTIVE$1, S_STEP_CANCEL$1, S_STEP_ERROR, S_STEP_SUBMIT$1, S_BAR_START, S_BAR$1, S_BAR_END, S_RADIO_ACTIVE$1, S_RADIO_INACTIVE$1, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_BAR_H$1, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I$1, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, m, multiselect$1, groupMultiselect, log, cancel, intro, outro, W$1, C$1, note, W$2, spinner, SELECT_INSTRUCTIONS, c$2, select;
|
|
817
838
|
var init_prompts = __esmMin((() => {
|
|
818
|
-
init_rolldown_runtime();
|
|
819
839
|
init_core();
|
|
820
|
-
import_picocolors$1 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
821
840
|
import_src$1 = require_src$2();
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
841
|
+
unicode = isUnicodeSupported();
|
|
842
|
+
isCI$1 = () => process.env.CI === "true";
|
|
843
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
844
|
+
S_STEP_ACTIVE$1 = unicodeOr("◆", "*");
|
|
845
|
+
S_STEP_CANCEL$1 = unicodeOr("■", "x");
|
|
846
|
+
S_STEP_ERROR = unicodeOr("▲", "x");
|
|
847
|
+
S_STEP_SUBMIT$1 = unicodeOr("◇", "o");
|
|
848
|
+
S_BAR_START = unicodeOr("┌", "T");
|
|
849
|
+
S_BAR$1 = unicodeOr("│", "|");
|
|
850
|
+
S_BAR_END = unicodeOr("└", "—");
|
|
851
|
+
S_RADIO_ACTIVE$1 = unicodeOr("●", ">");
|
|
852
|
+
S_RADIO_INACTIVE$1 = unicodeOr("○", " ");
|
|
853
|
+
S_CHECKBOX_ACTIVE = unicodeOr("◻", "[•]");
|
|
854
|
+
S_CHECKBOX_SELECTED = unicodeOr("◼", "[+]");
|
|
855
|
+
S_CHECKBOX_INACTIVE = unicodeOr("◻", "[ ]");
|
|
856
|
+
S_BAR_H$1 = unicodeOr("─", "-");
|
|
857
|
+
S_CORNER_TOP_RIGHT = unicodeOr("╮", "+");
|
|
858
|
+
S_CONNECT_LEFT = unicodeOr("├", "+");
|
|
859
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("╯", "+");
|
|
860
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("╰", "+");
|
|
861
|
+
S_INFO = unicodeOr("●", "•");
|
|
862
|
+
S_SUCCESS = unicodeOr("◆", "*");
|
|
863
|
+
S_WARN = unicodeOr("▲", "!");
|
|
864
|
+
S_ERROR = unicodeOr("■", "x");
|
|
865
|
+
symbol = (o) => {
|
|
866
|
+
switch (o) {
|
|
846
867
|
case "initial":
|
|
847
|
-
case "active": return
|
|
848
|
-
case "cancel": return
|
|
849
|
-
case "error": return
|
|
850
|
-
case "submit": return
|
|
868
|
+
case "active": return styleText("cyan", S_STEP_ACTIVE$1);
|
|
869
|
+
case "cancel": return styleText("red", S_STEP_CANCEL$1);
|
|
870
|
+
case "error": return styleText("yellow", S_STEP_ERROR);
|
|
871
|
+
case "submit": return styleText("green", S_STEP_SUBMIT$1);
|
|
851
872
|
}
|
|
852
873
|
};
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
});
|
|
862
|
-
};
|
|
863
|
-
ye = (t) => {
|
|
864
|
-
const n = t.active ?? "Yes", r = t.inactive ?? "No";
|
|
865
|
-
return new dD({
|
|
866
|
-
active: n,
|
|
867
|
-
inactive: r,
|
|
868
|
-
initialValue: t.initialValue ?? !0,
|
|
869
|
-
render() {
|
|
870
|
-
const i = `${import_picocolors$1.default.gray(o)}
|
|
871
|
-
${b(this.state)} ${t.message}
|
|
872
|
-
`, s = this.value ? n : r;
|
|
873
|
-
switch (this.state) {
|
|
874
|
-
case "submit": return `${i}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.dim(s)}`;
|
|
875
|
-
case "cancel": return `${i}${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.strikethrough(import_picocolors$1.default.dim(s))}
|
|
876
|
-
${import_picocolors$1.default.gray(o)}`;
|
|
877
|
-
default: return `${i}${import_picocolors$1.default.cyan(o)} ${this.value ? `${import_picocolors$1.default.green(k)} ${n}` : `${import_picocolors$1.default.dim(P)} ${import_picocolors$1.default.dim(n)}`} ${import_picocolors$1.default.dim("/")} ${this.value ? `${import_picocolors$1.default.dim(P)} ${import_picocolors$1.default.dim(r)}` : `${import_picocolors$1.default.green(k)} ${r}`}
|
|
878
|
-
${import_picocolors$1.default.cyan(d)}
|
|
879
|
-
`;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
}).prompt();
|
|
874
|
+
symbolBar = (o) => {
|
|
875
|
+
switch (o) {
|
|
876
|
+
case "initial":
|
|
877
|
+
case "active": return styleText("cyan", S_BAR$1);
|
|
878
|
+
case "cancel": return styleText("red", S_BAR$1);
|
|
879
|
+
case "error": return styleText("yellow", S_BAR$1);
|
|
880
|
+
case "submit": return styleText("green", S_BAR$1);
|
|
881
|
+
}
|
|
883
882
|
};
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
883
|
+
I$1 = (l, e, w, p, b, C = false) => {
|
|
884
|
+
let r = e, O = 0;
|
|
885
|
+
if (C) for (let i = p - 1; i >= w; i--) {
|
|
886
|
+
const m = l[i];
|
|
887
|
+
if (m && (r -= m.length), O++, r <= b) break;
|
|
888
|
+
}
|
|
889
|
+
else for (let i = w; i < p; i++) {
|
|
890
|
+
const m = l[i];
|
|
891
|
+
if (m && (r -= m.length), O++, r <= b) break;
|
|
892
|
+
}
|
|
893
|
+
return {
|
|
894
|
+
lineCount: r,
|
|
895
|
+
removals: O
|
|
893
896
|
};
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
+
};
|
|
898
|
+
limitOptions = ({ cursor: l, options: e, style: w, output: p = process.stdout, maxItems: b = Number.POSITIVE_INFINITY, columnPadding: C = 0, rowPadding: r = 4 }) => {
|
|
899
|
+
const i = getColumns(p) - C, m = getRows(p), M = styleText("dim", "..."), v = Math.max(m - r, 0), a = Math.max(Math.min(b, v), 5);
|
|
900
|
+
let f = 0;
|
|
901
|
+
l >= a - 3 && (f = Math.max(Math.min(l - a + 3, e.length - a), 0));
|
|
902
|
+
let d = a < e.length && f > 0, c = a < e.length && f + a < e.length;
|
|
903
|
+
const W = Math.min(f + a, e.length), s = [];
|
|
904
|
+
let g = 0;
|
|
905
|
+
d && g++, c && g++;
|
|
906
|
+
const T = f + (d ? 1 : 0), y = W - (c ? 1 : 0);
|
|
907
|
+
for (let t = T; t < y; t++) {
|
|
908
|
+
const n = e[t], h = wrapAnsi(n ? w(n, t === l) : "", i, {
|
|
909
|
+
hard: true,
|
|
910
|
+
trim: false
|
|
911
|
+
}).split(`
|
|
912
|
+
`);
|
|
913
|
+
s.push(h), g += h.length;
|
|
914
|
+
}
|
|
915
|
+
if (g > v) {
|
|
916
|
+
let t = 0, n = 0, o = g;
|
|
917
|
+
const h = l - T;
|
|
918
|
+
let u = v;
|
|
919
|
+
const L = () => I$1(s, o, 0, h, u), E = () => I$1(s, o, h + 1, s.length, u, true);
|
|
920
|
+
d ? ({lineCount: o, removals: t} = L(), o > u && (c || (u -= 1), {lineCount: o, removals: n} = E())) : (c || (u -= 1), {lineCount: o, removals: n} = E(), o > u && (u -= 1, {lineCount: o, removals: t} = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));
|
|
921
|
+
}
|
|
922
|
+
const x = [];
|
|
923
|
+
d && x.push(M);
|
|
924
|
+
for (const t of s) for (const n of t) x.push(n);
|
|
925
|
+
return c && x.push(M), x;
|
|
926
|
+
};
|
|
927
|
+
confirm = (i) => {
|
|
928
|
+
const a = i.active ?? "Yes", s = i.inactive ?? "No";
|
|
929
|
+
return new r$1({
|
|
930
|
+
active: a,
|
|
931
|
+
inactive: s,
|
|
932
|
+
signal: i.signal,
|
|
933
|
+
input: i.input,
|
|
934
|
+
output: i.output,
|
|
935
|
+
initialValue: i.initialValue ?? true,
|
|
897
936
|
render() {
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
|
|
937
|
+
const e = i.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = e ? `${styleText("gray", S_BAR$1)} ` : "", f = wrapTextWithPrefix(i.output, i.message, l, u), o = `${e ? `${styleText("gray", S_BAR$1)}
|
|
938
|
+
` : ""}${f}
|
|
939
|
+
`, c = this.value ? a : s;
|
|
901
940
|
switch (this.state) {
|
|
902
|
-
case "submit": return `${
|
|
903
|
-
case "cancel": return `${
|
|
904
|
-
${
|
|
905
|
-
default:
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
${import_picocolors$1.default.cyan(o)} `)}
|
|
912
|
-
${import_picocolors$1.default.cyan(d)}
|
|
941
|
+
case "submit": return `${o}${e ? `${styleText("gray", S_BAR$1)} ` : ""}${styleText("dim", c)}`;
|
|
942
|
+
case "cancel": return `${o}${e ? `${styleText("gray", S_BAR$1)} ` : ""}${styleText(["strikethrough", "dim"], c)}${e ? `
|
|
943
|
+
${styleText("gray", S_BAR$1)}` : ""}`;
|
|
944
|
+
default: {
|
|
945
|
+
const r = e ? `${styleText("cyan", S_BAR$1)} ` : "", g = e ? styleText("cyan", S_BAR_END) : "";
|
|
946
|
+
return `${o}${r}${this.value ? `${styleText("green", S_RADIO_ACTIVE$1)} ${a}` : `${styleText("dim", S_RADIO_INACTIVE$1)} ${styleText("dim", a)}`}${i.vertical ? e ? `
|
|
947
|
+
${styleText("cyan", S_BAR$1)} ` : `
|
|
948
|
+
` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", S_RADIO_INACTIVE$1)} ${styleText("dim", s)}` : `${styleText("green", S_RADIO_ACTIVE$1)} ${s}`}
|
|
949
|
+
${g}
|
|
913
950
|
`;
|
|
951
|
+
}
|
|
914
952
|
}
|
|
915
953
|
}
|
|
916
954
|
}).prompt();
|
|
917
955
|
};
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
956
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
957
|
+
`${styleText("dim", "↑/↓")} to navigate`,
|
|
958
|
+
`${styleText("dim", "Space:")} select`,
|
|
959
|
+
`${styleText("dim", "Enter:")} confirm`
|
|
960
|
+
];
|
|
961
|
+
m = (i, u) => i.split(`
|
|
962
|
+
`).map((d) => u(d)).join(`
|
|
963
|
+
`);
|
|
964
|
+
multiselect$1 = (i) => {
|
|
965
|
+
const u = (t, a) => {
|
|
966
|
+
const r = t.label ?? String(t.value);
|
|
967
|
+
return a === "disabled" ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText(["strikethrough", "gray"], o))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${m(r, (o) => styleText("dim", o))}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "cancelled" ? `${m(r, (o) => styleText(["strikethrough", "dim"], o))}` : a === "active-selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "submitted" ? `${m(r, (o) => styleText("dim", o))}` : `${styleText("dim", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText("dim", o))}`;
|
|
968
|
+
}, d = i.required ?? true, v = i.showInstructions ?? true;
|
|
969
|
+
return new a({
|
|
970
|
+
options: i.options,
|
|
971
|
+
signal: i.signal,
|
|
972
|
+
input: i.input,
|
|
973
|
+
output: i.output,
|
|
974
|
+
initialValues: i.initialValues,
|
|
975
|
+
required: d,
|
|
976
|
+
cursorAt: i.cursorAt,
|
|
977
|
+
validate(t) {
|
|
978
|
+
if (d && (t === void 0 || t.length === 0)) return `Please select at least one option.
|
|
979
|
+
${styleText("reset", styleText("dim", `Press ${styleText([
|
|
980
|
+
"gray",
|
|
981
|
+
"bgWhite",
|
|
982
|
+
"inverse"
|
|
983
|
+
], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
|
|
931
984
|
},
|
|
932
985
|
render() {
|
|
933
|
-
const r = `${
|
|
934
|
-
|
|
935
|
-
`,
|
|
936
|
-
|
|
937
|
-
|
|
986
|
+
const t = i.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(i.output, i.message, t ? `${symbolBar(this.state)} ` : "", `${symbol(this.state)} `), r = `${t ? `${styleText("gray", S_BAR$1)}
|
|
987
|
+
` : ""}${a}
|
|
988
|
+
`, o = this.value ?? [], p = (n, l) => {
|
|
989
|
+
if (n.disabled) return u(n, "disabled");
|
|
990
|
+
const s = o.includes(n.value);
|
|
991
|
+
return l && s ? u(n, "active-selected") : s ? u(n, "selected") : u(n, l ? "active" : "inactive");
|
|
938
992
|
};
|
|
939
993
|
switch (this.state) {
|
|
940
|
-
case "submit":
|
|
994
|
+
case "submit": {
|
|
995
|
+
const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none");
|
|
996
|
+
return `${r}${wrapTextWithPrefix(i.output, n, t ? `${styleText("gray", S_BAR$1)} ` : "")}`;
|
|
997
|
+
}
|
|
941
998
|
case "cancel": {
|
|
942
|
-
const
|
|
943
|
-
return `${r}${
|
|
944
|
-
${
|
|
999
|
+
const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "cancelled")).join(styleText("dim", ", "));
|
|
1000
|
+
if (n.trim() === "") return `${r}${styleText("gray", S_BAR$1)}`;
|
|
1001
|
+
return `${r}${wrapTextWithPrefix(i.output, n, t ? `${styleText("gray", S_BAR$1)} ` : "")}${t ? `
|
|
1002
|
+
${styleText("gray", S_BAR$1)}` : ""}`;
|
|
945
1003
|
}
|
|
946
1004
|
case "error": {
|
|
947
|
-
const
|
|
948
|
-
`).map((
|
|
949
|
-
`)
|
|
950
|
-
|
|
1005
|
+
const n = t ? `${styleText("yellow", S_BAR$1)} ` : "", l = this.error.split(`
|
|
1006
|
+
`).map(($, C) => C === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", $)}` : ` ${$}`).join(`
|
|
1007
|
+
`), s = r.split(`
|
|
1008
|
+
`).length, h = l.split(`
|
|
1009
|
+
`).length + 1;
|
|
1010
|
+
return `${r}${n}${limitOptions({
|
|
1011
|
+
output: i.output,
|
|
951
1012
|
options: this.options,
|
|
952
1013
|
cursor: this.cursor,
|
|
953
|
-
maxItems:
|
|
954
|
-
|
|
1014
|
+
maxItems: i.maxItems,
|
|
1015
|
+
columnPadding: n.length,
|
|
1016
|
+
rowPadding: s + h,
|
|
1017
|
+
style: p
|
|
955
1018
|
}).join(`
|
|
956
|
-
${
|
|
957
|
-
${
|
|
1019
|
+
${n}`)}
|
|
1020
|
+
${l}
|
|
958
1021
|
`;
|
|
959
1022
|
}
|
|
960
|
-
default:
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1023
|
+
default: {
|
|
1024
|
+
const n = t ? `${styleText("cyan", S_BAR$1)} ` : "", l = r.split(`
|
|
1025
|
+
`).length, s = v ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
|
|
1026
|
+
`), $ = s.length + 1;
|
|
1027
|
+
return `${r}${n}${limitOptions({
|
|
1028
|
+
output: i.output,
|
|
1029
|
+
options: this.options,
|
|
1030
|
+
cursor: this.cursor,
|
|
1031
|
+
maxItems: i.maxItems,
|
|
1032
|
+
columnPadding: n.length,
|
|
1033
|
+
rowPadding: l + $,
|
|
1034
|
+
style: p
|
|
1035
|
+
}).join(`
|
|
1036
|
+
${n}`)}
|
|
1037
|
+
${h}
|
|
968
1038
|
`;
|
|
1039
|
+
}
|
|
969
1040
|
}
|
|
970
1041
|
}
|
|
971
1042
|
}).prompt();
|
|
972
1043
|
};
|
|
973
|
-
|
|
974
|
-
const { selectableGroups:
|
|
975
|
-
const a =
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
if (
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
}
|
|
983
|
-
if (
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
return `${
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1044
|
+
groupMultiselect = (o) => {
|
|
1045
|
+
const { selectableGroups: h = true, groupSpacing: x = 0 } = o, m = (n, l, g = []) => {
|
|
1046
|
+
const a = n.label ?? String(n.value), t = typeof n.group == "string", s = t && (g[g.indexOf(n) + 1] ?? { group: true }), u = t && s && s.group === true;
|
|
1047
|
+
let r = "", c = "";
|
|
1048
|
+
t && (h ? (r = u ? `${S_BAR_END} ` : `${S_BAR$1} `, c = u ? " " : `${S_BAR$1} `) : r = " ");
|
|
1049
|
+
let i = "";
|
|
1050
|
+
if (x > 0 && !t && (i = `
|
|
1051
|
+
`.repeat(x)), l === "active") return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `, `${i}${styleText("dim", c)} `);
|
|
1052
|
+
if (l === "group-active") return wrapTextWithPrefix(o.output, a, `${i}${r} `, `${i}${r}${styleText("cyan", S_CHECKBOX_ACTIVE)} `, `${i}${c} `, (d) => styleText("dim", d));
|
|
1053
|
+
if (l === "group-active-selected") return wrapTextWithPrefix(o.output, a, `${i}${r} `, `${i}${r}${styleText("green", S_CHECKBOX_SELECTED)} `, `${i}${c} `, (d) => styleText("dim", d));
|
|
1054
|
+
if (l === "selected") {
|
|
1055
|
+
const d = t || h ? styleText("green", S_CHECKBOX_SELECTED) : "";
|
|
1056
|
+
return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` (${n.hint})` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${d} `, `${i}${styleText("dim", c)} `, (S) => styleText("dim", S));
|
|
1057
|
+
}
|
|
1058
|
+
if (l === "cancelled") return `${styleText(["strikethrough", "dim"], a)}`;
|
|
1059
|
+
if (l === "active-selected") return wrapTextWithPrefix(o.output, `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${styleText("green", S_CHECKBOX_SELECTED)} `, `${i}${styleText("dim", c)} `);
|
|
1060
|
+
if (l === "submitted") return `${styleText("dim", a)}`;
|
|
1061
|
+
const f = t || h ? styleText("dim", S_CHECKBOX_INACTIVE) : "";
|
|
1062
|
+
return wrapTextWithPrefix(o.output, a, `${i}${styleText("dim", r)} `, `${i}${styleText("dim", r)}${f} `, `${i}${styleText("dim", c)} `, (d) => styleText("dim", d));
|
|
1063
|
+
}, y = o.required ?? true, I = o.showInstructions ?? true;
|
|
1064
|
+
return new u$2({
|
|
1065
|
+
options: o.options,
|
|
1066
|
+
signal: o.signal,
|
|
1067
|
+
input: o.input,
|
|
1068
|
+
output: o.output,
|
|
1069
|
+
initialValues: o.initialValues,
|
|
1070
|
+
required: y,
|
|
1071
|
+
cursorAt: o.cursorAt,
|
|
1072
|
+
selectableGroups: h,
|
|
1073
|
+
validate(n) {
|
|
1074
|
+
if (y && (n === void 0 || n.length === 0)) return `Please select at least one option.
|
|
1075
|
+
${styleText("reset", styleText("dim", `Press ${styleText([
|
|
1076
|
+
"gray",
|
|
1077
|
+
"bgWhite",
|
|
1078
|
+
"inverse"
|
|
1079
|
+
], " space ")} to select, ${styleText("gray", styleText(["bgWhite", "inverse"], " enter "))} to submit`))}`;
|
|
998
1080
|
},
|
|
999
1081
|
render() {
|
|
1000
|
-
const
|
|
1001
|
-
${
|
|
1002
|
-
|
|
1082
|
+
const n = o.withGuide ?? settings.withGuide, l = `${n ? `${styleText("gray", S_BAR$1)}
|
|
1083
|
+
` : ""}${symbol(this.state)} ${o.message}
|
|
1084
|
+
`, g = this.value ?? [], a = (t, s) => {
|
|
1085
|
+
const u = this.options, r = g.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
|
|
1086
|
+
return !s && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? m(t, r ? "group-active-selected" : "group-active", u) : s && r ? m(t, "active-selected", u) : r ? m(t, "selected", u) : m(t, s ? "active" : "inactive", u);
|
|
1087
|
+
};
|
|
1003
1088
|
switch (this.state) {
|
|
1004
|
-
case "submit":
|
|
1089
|
+
case "submit": {
|
|
1090
|
+
const t = this.options.filter(({ value: u }) => g.includes(u)).map((u) => m(u, "submitted")), s = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
|
|
1091
|
+
return `${l}${n ? styleText("gray", S_BAR$1) : ""}${s}`;
|
|
1092
|
+
}
|
|
1005
1093
|
case "cancel": {
|
|
1006
|
-
const
|
|
1007
|
-
return `${
|
|
1008
|
-
${
|
|
1094
|
+
const t = this.options.filter(({ value: s }) => g.includes(s)).map((s) => m(s, "cancelled")).join(styleText("dim", ", "));
|
|
1095
|
+
return `${l}${n ? `${styleText("gray", S_BAR$1)} ` : ""}${t.trim() ? `${t}${n ? `
|
|
1096
|
+
${styleText("gray", S_BAR$1)}` : ""}` : ""}`;
|
|
1009
1097
|
}
|
|
1010
1098
|
case "error": {
|
|
1011
|
-
const s = this.error.split(`
|
|
1012
|
-
`).map((
|
|
1013
|
-
`)
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1099
|
+
const t = n ? `${styleText("yellow", S_BAR$1)} ` : "", s = this.error.split(`
|
|
1100
|
+
`).map((i, f) => f === 0 ? `${n ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", i)}` : ` ${i}`).join(`
|
|
1101
|
+
`), u = l.split(`
|
|
1102
|
+
`).length, r = s.split(`
|
|
1103
|
+
`).length + 1;
|
|
1104
|
+
return `${l}${t}${limitOptions({
|
|
1105
|
+
output: o.output,
|
|
1106
|
+
options: this.options,
|
|
1107
|
+
cursor: this.cursor,
|
|
1108
|
+
maxItems: o.maxItems,
|
|
1109
|
+
columnPadding: t.length,
|
|
1110
|
+
rowPadding: u + r,
|
|
1111
|
+
style: a
|
|
1017
1112
|
}).join(`
|
|
1018
|
-
${
|
|
1113
|
+
${t}`)}
|
|
1019
1114
|
${s}
|
|
1020
1115
|
`;
|
|
1021
1116
|
}
|
|
1022
|
-
default:
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
${
|
|
1027
|
-
|
|
1117
|
+
default: {
|
|
1118
|
+
const t = n ? `${styleText("cyan", S_BAR$1)} ` : "", s = l.split(`
|
|
1119
|
+
`).length, u = I ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], r = u.join(`
|
|
1120
|
+
`), c = u.length + 1;
|
|
1121
|
+
return `${l}${t}${limitOptions({
|
|
1122
|
+
output: o.output,
|
|
1123
|
+
options: this.options,
|
|
1124
|
+
cursor: this.cursor,
|
|
1125
|
+
maxItems: o.maxItems,
|
|
1126
|
+
columnPadding: t.length,
|
|
1127
|
+
rowPadding: s + c,
|
|
1128
|
+
style: a
|
|
1129
|
+
}).join(`
|
|
1130
|
+
${t}`)}
|
|
1131
|
+
${r}
|
|
1028
1132
|
`;
|
|
1133
|
+
}
|
|
1029
1134
|
}
|
|
1030
1135
|
}
|
|
1031
1136
|
}).prompt();
|
|
1032
1137
|
};
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
const $ = stripVTControlCharacters(l);
|
|
1039
|
-
return $.length > a ? $.length : a;
|
|
1040
|
-
}, 0), i) + 2, c = r.map((a) => `${import_picocolors$1.default.gray(o)} ${import_picocolors$1.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors$1.default.gray(o)}`).join(`
|
|
1138
|
+
log = {
|
|
1139
|
+
message: (s = [], { symbol: e = styleText("gray", S_BAR$1), secondarySymbol: r = styleText("gray", S_BAR$1), output: m = process.stdout, spacing: l = 1, withGuide: c } = {}) => {
|
|
1140
|
+
const t = [], o = c ?? settings.withGuide, f = o ? r : "", O = o ? `${e} ` : "", u = o ? `${r} ` : "";
|
|
1141
|
+
for (let i = 0; i < l; i++) t.push(f);
|
|
1142
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
1041
1143
|
`);
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
${
|
|
1045
|
-
|
|
1144
|
+
if (g.length > 0) {
|
|
1145
|
+
const [i, ...y] = g;
|
|
1146
|
+
i.length > 0 ? t.push(`${O}${i}`) : t.push(o ? e : "");
|
|
1147
|
+
for (const p of y) p.length > 0 ? t.push(`${u}${p}`) : t.push(o ? r : "");
|
|
1148
|
+
}
|
|
1149
|
+
m.write(`${t.join(`
|
|
1150
|
+
`)}
|
|
1046
1151
|
`);
|
|
1152
|
+
},
|
|
1153
|
+
info: (s, e) => {
|
|
1154
|
+
log.message(s, {
|
|
1155
|
+
...e,
|
|
1156
|
+
symbol: styleText("blue", S_INFO)
|
|
1157
|
+
});
|
|
1158
|
+
},
|
|
1159
|
+
success: (s, e) => {
|
|
1160
|
+
log.message(s, {
|
|
1161
|
+
...e,
|
|
1162
|
+
symbol: styleText("green", S_SUCCESS)
|
|
1163
|
+
});
|
|
1164
|
+
},
|
|
1165
|
+
step: (s, e) => {
|
|
1166
|
+
log.message(s, {
|
|
1167
|
+
...e,
|
|
1168
|
+
symbol: styleText("green", S_STEP_SUBMIT$1)
|
|
1169
|
+
});
|
|
1170
|
+
},
|
|
1171
|
+
warn: (s, e) => {
|
|
1172
|
+
log.message(s, {
|
|
1173
|
+
...e,
|
|
1174
|
+
symbol: styleText("yellow", S_WARN)
|
|
1175
|
+
});
|
|
1176
|
+
},
|
|
1177
|
+
warning: (s, e) => {
|
|
1178
|
+
log.warn(s, e);
|
|
1179
|
+
},
|
|
1180
|
+
error: (s, e) => {
|
|
1181
|
+
log.message(s, {
|
|
1182
|
+
...e,
|
|
1183
|
+
symbol: styleText("red", S_ERROR)
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1047
1186
|
};
|
|
1048
|
-
|
|
1049
|
-
process.stdout.
|
|
1187
|
+
cancel = (o = "", t) => {
|
|
1188
|
+
const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_END)} ` : "";
|
|
1189
|
+
i.write(`${e}${styleText("red", o)}
|
|
1050
1190
|
|
|
1051
1191
|
`);
|
|
1052
1192
|
};
|
|
1053
|
-
|
|
1054
|
-
process.stdout.
|
|
1193
|
+
intro = (o = "", t) => {
|
|
1194
|
+
const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_START)} ` : "";
|
|
1195
|
+
i.write(`${e}${o}
|
|
1055
1196
|
`);
|
|
1056
1197
|
};
|
|
1057
|
-
|
|
1058
|
-
process.stdout.
|
|
1059
|
-
${
|
|
1198
|
+
outro = (o = "", t) => {
|
|
1199
|
+
const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR$1)}
|
|
1200
|
+
${styleText("gray", S_BAR_END)} ` : "";
|
|
1201
|
+
i.write(`${e}${o}
|
|
1060
1202
|
|
|
1061
1203
|
`);
|
|
1062
1204
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
`
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1205
|
+
W$1 = (o) => o;
|
|
1206
|
+
C$1 = (o, e, s) => {
|
|
1207
|
+
const a = {
|
|
1208
|
+
hard: true,
|
|
1209
|
+
trim: false
|
|
1210
|
+
}, i = wrapAnsi(o, e, a).split(`
|
|
1211
|
+
`), c = i.reduce((n, t) => Math.max(fastStringWidth(t), n), 0);
|
|
1212
|
+
return wrapAnsi(o, e - (i.map(s).reduce((n, t) => Math.max(fastStringWidth(t), n), 0) - c), a);
|
|
1213
|
+
};
|
|
1214
|
+
note = (o = "", e = "", s) => {
|
|
1215
|
+
const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = [
|
|
1216
|
+
"",
|
|
1217
|
+
...C$1(o, getColumns(a) - 6, c).split(`
|
|
1218
|
+
`).map(c),
|
|
1219
|
+
""
|
|
1220
|
+
], n = fastStringWidth(e), t = Math.max(g.reduce((m, F) => {
|
|
1221
|
+
const O = fastStringWidth(F);
|
|
1222
|
+
return O > m ? O : m;
|
|
1223
|
+
}, 0), n) + 2, h = g.map((m) => `${styleText("gray", S_BAR$1)} ${m}${" ".repeat(t - fastStringWidth(m))}${styleText("gray", S_BAR$1)}`).join(`
|
|
1224
|
+
`), T = i ? `${styleText("gray", S_BAR$1)}
|
|
1225
|
+
` : "", l$1 = i ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
1226
|
+
a.write(`${T}${styleText("green", S_STEP_SUBMIT$1)} ${styleText("reset", e)} ${styleText("gray", S_BAR_H$1.repeat(Math.max(t - n - 1, 1)) + S_CORNER_TOP_RIGHT)}
|
|
1227
|
+
${h}
|
|
1228
|
+
${styleText("gray", l$1 + S_BAR_H$1.repeat(t + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
1073
1229
|
`);
|
|
1074
|
-
},
|
|
1075
|
-
info: (t) => {
|
|
1076
|
-
M.message(t, { symbol: import_picocolors$1.default.blue(q) });
|
|
1077
|
-
},
|
|
1078
|
-
success: (t) => {
|
|
1079
|
-
M.message(t, { symbol: import_picocolors$1.default.green(D) });
|
|
1080
|
-
},
|
|
1081
|
-
step: (t) => {
|
|
1082
|
-
M.message(t, { symbol: import_picocolors$1.default.green(C) });
|
|
1083
|
-
},
|
|
1084
|
-
warn: (t) => {
|
|
1085
|
-
M.message(t, { symbol: import_picocolors$1.default.yellow(U) });
|
|
1086
|
-
},
|
|
1087
|
-
warning: (t) => {
|
|
1088
|
-
M.warn(t);
|
|
1089
|
-
},
|
|
1090
|
-
error: (t) => {
|
|
1091
|
-
M.message(t, { symbol: import_picocolors$1.default.red(K) });
|
|
1092
|
-
}
|
|
1093
1230
|
};
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
let
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1231
|
+
W$2 = (l) => styleText("magenta", l);
|
|
1232
|
+
spinner = ({ indicator: l = "dots", onCancel: h, output: n = process.stdout, cancelMessage: G, errorMessage: O, frames: E = unicode ? [
|
|
1233
|
+
"◒",
|
|
1234
|
+
"◐",
|
|
1235
|
+
"◓",
|
|
1236
|
+
"◑"
|
|
1237
|
+
] : [
|
|
1238
|
+
"•",
|
|
1239
|
+
"o",
|
|
1240
|
+
"O",
|
|
1241
|
+
"0"
|
|
1242
|
+
], delay: F = unicode ? 80 : 120, signal: m, ...I } = {}) => {
|
|
1243
|
+
const u = isCI$1();
|
|
1244
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1245
|
+
const x = getColumns(n), k = I?.styleFrame ?? W$2, g = (e) => {
|
|
1246
|
+
const r = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1247
|
+
S = e === 1, d && (a(r, e), S && typeof h == "function" && h());
|
|
1248
|
+
}, f = () => g(2), i = () => g(1), A = () => {
|
|
1249
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i), process.on("SIGTERM", i), process.on("exit", g), m && m.addEventListener("abort", i);
|
|
1250
|
+
}, H = () => {
|
|
1251
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i), process.removeListener("SIGTERM", i), process.removeListener("exit", g), m && m.removeEventListener("abort", i);
|
|
1252
|
+
}, y = () => {
|
|
1253
|
+
if (p === void 0) return;
|
|
1254
|
+
u && n.write(`
|
|
1117
1255
|
`);
|
|
1118
|
-
const
|
|
1256
|
+
const r = wrapAnsi(p, x, {
|
|
1257
|
+
hard: true,
|
|
1258
|
+
trim: false
|
|
1259
|
+
}).split(`
|
|
1119
1260
|
`);
|
|
1120
|
-
|
|
1121
|
-
},
|
|
1122
|
-
const
|
|
1123
|
-
return
|
|
1124
|
-
},
|
|
1125
|
-
|
|
1261
|
+
r.length > 1 && n.write(import_src$1.cursor.up(r.length - 1)), n.write(import_src$1.cursor.to(0)), n.write(import_src$1.erase.down());
|
|
1262
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1263
|
+
const r = (performance.now() - e) / 1e3, t = Math.floor(r / 60), o = Math.floor(r % 60);
|
|
1264
|
+
return t > 0 ? `[${t}m ${o}s]` : `[${o}s]`;
|
|
1265
|
+
}, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1266
|
+
d = true, M = block({ output: n }), s = C(e), w = performance.now(), N && n.write(`${styleText("gray", S_BAR$1)}
|
|
1126
1267
|
`);
|
|
1127
|
-
let
|
|
1128
|
-
|
|
1129
|
-
if (
|
|
1130
|
-
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
|
|
1268
|
+
let r = 0, t = 0;
|
|
1269
|
+
A(), T = setInterval(() => {
|
|
1270
|
+
if (u && s === p) return;
|
|
1271
|
+
y(), p = s;
|
|
1272
|
+
const o = k(E[r]);
|
|
1273
|
+
let v;
|
|
1274
|
+
if (u) v = `${o} ${s}...`;
|
|
1275
|
+
else if (l === "timer") v = `${o} ${s} ${_(w)}`;
|
|
1134
1276
|
else {
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1277
|
+
const B = ".".repeat(Math.floor(t)).slice(0, 3);
|
|
1278
|
+
v = `${o} ${s}${B}`;
|
|
1137
1279
|
}
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1280
|
+
const j = wrapAnsi(v, x, {
|
|
1281
|
+
hard: true,
|
|
1282
|
+
trim: false
|
|
1283
|
+
});
|
|
1284
|
+
n.write(j), r = r + 1 < E.length ? r + 1 : 0, t = t < 4 ? t + .125 : 0;
|
|
1285
|
+
}, F);
|
|
1286
|
+
}, a = (e = "", r = 0, t = false) => {
|
|
1287
|
+
if (!d) return;
|
|
1288
|
+
d = false, clearInterval(T), y();
|
|
1289
|
+
const o = r === 0 ? styleText("green", S_STEP_SUBMIT$1) : r === 1 ? styleText("red", S_STEP_CANCEL$1) : styleText("red", S_STEP_ERROR);
|
|
1290
|
+
s = e ?? s, t || (l === "timer" ? n.write(`${o} ${s} ${_(w)}
|
|
1291
|
+
`) : n.write(`${o} ${s}
|
|
1292
|
+
`)), H(), M();
|
|
1146
1293
|
};
|
|
1147
1294
|
return {
|
|
1148
|
-
start:
|
|
1149
|
-
stop:
|
|
1150
|
-
message: (
|
|
1151
|
-
|
|
1295
|
+
start: P,
|
|
1296
|
+
stop: (e = "") => a(e, 0),
|
|
1297
|
+
message: (e = "") => {
|
|
1298
|
+
s = C(e ?? s);
|
|
1299
|
+
},
|
|
1300
|
+
cancel: (e = "") => a(e, 1),
|
|
1301
|
+
error: (e = "") => a(e, 2),
|
|
1302
|
+
clear: () => a("", 0, true),
|
|
1303
|
+
get isCancelled() {
|
|
1304
|
+
return S;
|
|
1152
1305
|
}
|
|
1153
1306
|
};
|
|
1154
|
-
};
|
|
1307
|
+
};
|
|
1308
|
+
SELECT_INSTRUCTIONS = [`${styleText("dim", "↑/↓")} to navigate`, `${styleText("dim", "Enter:")} confirm`];
|
|
1309
|
+
c$2 = (t, o) => t.includes(`
|
|
1310
|
+
`) ? t.split(`
|
|
1311
|
+
`).map((d) => o(d)).join(`
|
|
1312
|
+
`) : o(t);
|
|
1313
|
+
select = (t) => {
|
|
1314
|
+
const o = (n, m) => {
|
|
1315
|
+
if (n === void 0) return "";
|
|
1316
|
+
const s = n.label ?? String(n.value);
|
|
1317
|
+
switch (m) {
|
|
1318
|
+
case "disabled": return `${styleText("gray", S_RADIO_INACTIVE$1)} ${c$2(s, (i) => styleText("gray", i))}${n.hint ? ` ${styleText("dim", `(${n.hint ?? "disabled"})`)}` : ""}`;
|
|
1319
|
+
case "selected": return `${c$2(s, (i) => styleText("dim", i))}`;
|
|
1320
|
+
case "active": return `${styleText("green", S_RADIO_ACTIVE$1)} ${s}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
|
|
1321
|
+
case "cancelled": return `${c$2(s, (i) => styleText(["strikethrough", "dim"], i))}`;
|
|
1322
|
+
default: return `${styleText("dim", S_RADIO_INACTIVE$1)} ${c$2(s, (i) => styleText("dim", i))}`;
|
|
1323
|
+
}
|
|
1324
|
+
}, d = t.showInstructions ?? true;
|
|
1325
|
+
return new n$1({
|
|
1326
|
+
options: t.options,
|
|
1327
|
+
signal: t.signal,
|
|
1328
|
+
input: t.input,
|
|
1329
|
+
output: t.output,
|
|
1330
|
+
initialValue: t.initialValue,
|
|
1331
|
+
render() {
|
|
1332
|
+
const n = t.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i = wrapTextWithPrefix(t.output, t.message, s, m), u = `${n ? `${styleText("gray", S_BAR$1)}
|
|
1333
|
+
` : ""}${i}
|
|
1334
|
+
`;
|
|
1335
|
+
switch (this.state) {
|
|
1336
|
+
case "submit": {
|
|
1337
|
+
const r = n ? `${styleText("gray", S_BAR$1)} ` : "";
|
|
1338
|
+
return `${u}${wrapTextWithPrefix(t.output, o(this.options[this.cursor], "selected"), r)}`;
|
|
1339
|
+
}
|
|
1340
|
+
case "cancel": {
|
|
1341
|
+
const r = n ? `${styleText("gray", S_BAR$1)} ` : "";
|
|
1342
|
+
return `${u}${wrapTextWithPrefix(t.output, o(this.options[this.cursor], "cancelled"), r)}${n ? `
|
|
1343
|
+
${styleText("gray", S_BAR$1)}` : ""}`;
|
|
1344
|
+
}
|
|
1345
|
+
default: {
|
|
1346
|
+
const r = n ? `${styleText("cyan", S_BAR$1)} ` : "", a = u.split(`
|
|
1347
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], b = p.join(`
|
|
1348
|
+
`), f = p.length + 1;
|
|
1349
|
+
return `${u}${r}${limitOptions({
|
|
1350
|
+
output: t.output,
|
|
1351
|
+
cursor: this.cursor,
|
|
1352
|
+
options: this.options,
|
|
1353
|
+
maxItems: t.maxItems,
|
|
1354
|
+
columnPadding: r.length,
|
|
1355
|
+
rowPadding: a + f,
|
|
1356
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1357
|
+
}).join(`
|
|
1358
|
+
${r}`)}
|
|
1359
|
+
${b}
|
|
1360
|
+
`;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
}).prompt();
|
|
1365
|
+
};
|
|
1366
|
+
`${styleText("gray", S_BAR$1)}`;
|
|
1367
|
+
}));
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/picocolors.mjs
|
|
1370
|
+
var require_picocolors;
|
|
1371
|
+
var init_picocolors = __esmMin((() => {
|
|
1372
|
+
init_rolldown_runtime();
|
|
1373
|
+
require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1374
|
+
let p = process || {};
|
|
1375
|
+
let argv = p.argv || [];
|
|
1376
|
+
let env = p.env || {};
|
|
1377
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
1378
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
1379
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
1380
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
1381
|
+
};
|
|
1382
|
+
let replaceClose = (string, close, replace, index) => {
|
|
1383
|
+
let result = "", cursor = 0;
|
|
1384
|
+
do {
|
|
1385
|
+
result += string.substring(cursor, index) + replace;
|
|
1386
|
+
cursor = index + close.length;
|
|
1387
|
+
index = string.indexOf(close, cursor);
|
|
1388
|
+
} while (~index);
|
|
1389
|
+
return result + string.substring(cursor);
|
|
1390
|
+
};
|
|
1391
|
+
let createColors = (enabled = isColorSupported) => {
|
|
1392
|
+
let f = enabled ? formatter : () => String;
|
|
1393
|
+
return {
|
|
1394
|
+
isColorSupported: enabled,
|
|
1395
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
1396
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
1397
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
1398
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
1399
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
1400
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
1401
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
1402
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
1403
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
1404
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
1405
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
1406
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
1407
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
1408
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
1409
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
1410
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
1411
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
1412
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
1413
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
1414
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
1415
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
1416
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
1417
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
1418
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
1419
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
1420
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
1421
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
1422
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
1423
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
1424
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
1425
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
1426
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
1427
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
1428
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
1429
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
1430
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
1431
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
1432
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
1433
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
1434
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
1435
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
module.exports = createColors();
|
|
1439
|
+
module.exports.createColors = createColors;
|
|
1440
|
+
}));
|
|
1155
1441
|
}));
|
|
1156
1442
|
//#endregion
|
|
1157
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1443
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@kwsites/file-exists.mjs
|
|
1158
1444
|
var require_ms, require_common, require_browser, require_node, require_src$1, require_src, require_dist$3;
|
|
1159
1445
|
var init_file_exists = __esmMin((() => {
|
|
1160
1446
|
init_rolldown_runtime();
|
|
@@ -1720,7 +2006,23 @@ var init_file_exists = __esmMin((() => {
|
|
|
1720
2006
|
}));
|
|
1721
2007
|
}));
|
|
1722
2008
|
//#endregion
|
|
1723
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
2009
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@simple-git/args-pathspec.mjs
|
|
2010
|
+
function c$1(...n) {
|
|
2011
|
+
const e = new String(n);
|
|
2012
|
+
return t.set(e, n), e;
|
|
2013
|
+
}
|
|
2014
|
+
function r(n) {
|
|
2015
|
+
return n instanceof String && t.has(n);
|
|
2016
|
+
}
|
|
2017
|
+
function o(n) {
|
|
2018
|
+
return t.get(n) ?? [];
|
|
2019
|
+
}
|
|
2020
|
+
var t;
|
|
2021
|
+
var init_args_pathspec = __esmMin((() => {
|
|
2022
|
+
t = /* @__PURE__ */ new WeakMap();
|
|
2023
|
+
}));
|
|
2024
|
+
//#endregion
|
|
2025
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@kwsites/promise-deferred.mjs
|
|
1724
2026
|
var require_dist$2;
|
|
1725
2027
|
var init_promise_deferred = __esmMin((() => {
|
|
1726
2028
|
init_rolldown_runtime();
|
|
@@ -1761,18 +2063,482 @@ var init_promise_deferred = __esmMin((() => {
|
|
|
1761
2063
|
}));
|
|
1762
2064
|
}));
|
|
1763
2065
|
//#endregion
|
|
1764
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1765
|
-
function
|
|
1766
|
-
const
|
|
1767
|
-
|
|
1768
|
-
|
|
2066
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@simple-git/argv-parser.mjs
|
|
2067
|
+
function* U(e, t) {
|
|
2068
|
+
const n = t === "global";
|
|
2069
|
+
for (const o of e) o.isGlobal === n && (yield o);
|
|
2070
|
+
}
|
|
2071
|
+
function F(e, t) {
|
|
2072
|
+
for (const { name: o } of U(e, "task")) {
|
|
2073
|
+
if (k.has(o)) return p(!0, t);
|
|
2074
|
+
if (S.has(o)) return p(!1, t);
|
|
2075
|
+
}
|
|
2076
|
+
const n = t.at(0)?.toLowerCase();
|
|
2077
|
+
return n === void 0 ? null : P.has(n) ? p(!0, t.slice(1)) : E.has(n) ? p(!1, t.slice(1)) : t.length === 1 ? p(!1, t) : p(!0, t);
|
|
2078
|
+
}
|
|
2079
|
+
function p(e = !1, t = []) {
|
|
2080
|
+
const n = t.at(0)?.toLowerCase();
|
|
2081
|
+
return n === void 0 ? null : {
|
|
2082
|
+
isWrite: e,
|
|
2083
|
+
isRead: !e,
|
|
2084
|
+
key: n,
|
|
2085
|
+
value: t.at(1)
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
function A(e, t) {
|
|
2089
|
+
return t.isWrite && t.value !== void 0 ? {
|
|
2090
|
+
key: t.key,
|
|
2091
|
+
value: t.value,
|
|
2092
|
+
scope: e
|
|
2093
|
+
} : {
|
|
2094
|
+
key: t.key,
|
|
2095
|
+
scope: e
|
|
2096
|
+
};
|
|
2097
|
+
}
|
|
2098
|
+
function M(e) {
|
|
2099
|
+
const t = e?.indexOf("=") || -1;
|
|
2100
|
+
return !e || t < 0 ? null : {
|
|
2101
|
+
key: e.slice(0, t).trim().toLowerCase(),
|
|
2102
|
+
value: e.slice(t + 1)
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
function N(e) {
|
|
2106
|
+
for (const { name: t } of U(e, "task")) switch (t) {
|
|
2107
|
+
case "--global": return "global";
|
|
2108
|
+
case "--system": return "system";
|
|
2109
|
+
case "--worktree": return "worktree";
|
|
2110
|
+
case "--local": return "local";
|
|
2111
|
+
case "--file":
|
|
2112
|
+
case "-f": return "file";
|
|
2113
|
+
}
|
|
2114
|
+
return "local";
|
|
2115
|
+
}
|
|
2116
|
+
function G({ name: e }) {
|
|
2117
|
+
if (e === "-c" || e === "--config") return "inline";
|
|
2118
|
+
if (e === "--config-env") return "env";
|
|
2119
|
+
}
|
|
2120
|
+
function* O(e) {
|
|
2121
|
+
for (const t of e) {
|
|
2122
|
+
const n = G(t), o = n && M(t.value);
|
|
2123
|
+
o && (yield {
|
|
2124
|
+
...o,
|
|
2125
|
+
scope: n
|
|
2126
|
+
});
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
function L(e, t, n) {
|
|
2130
|
+
const o = {
|
|
2131
|
+
read: [],
|
|
2132
|
+
write: [...O(t)]
|
|
2133
|
+
};
|
|
2134
|
+
return e === "config" && $(o, N(t), F(t, n)), o;
|
|
2135
|
+
}
|
|
2136
|
+
function $(e, t, n) {
|
|
2137
|
+
if (n === null) return;
|
|
2138
|
+
const o = A(t, n);
|
|
2139
|
+
n.isWrite ? e.write.push(o) : e.read.push(o);
|
|
2140
|
+
}
|
|
2141
|
+
function I(e) {
|
|
2142
|
+
const t = R[e ?? ""] ?? T;
|
|
2143
|
+
return {
|
|
2144
|
+
short: new Map([...x.short.entries(), ...t.short.entries()]),
|
|
2145
|
+
long: t.long
|
|
2146
|
+
};
|
|
2147
|
+
}
|
|
2148
|
+
function b(e, t = D) {
|
|
2149
|
+
if (e.startsWith("--")) {
|
|
2150
|
+
const n = e.indexOf("=");
|
|
2151
|
+
if (n > 2) return [{
|
|
2152
|
+
name: e.slice(0, n),
|
|
2153
|
+
value: e.slice(n + 1),
|
|
2154
|
+
needsNext: !1
|
|
2155
|
+
}];
|
|
2156
|
+
const o = e.slice(2);
|
|
2157
|
+
return [{
|
|
2158
|
+
name: e,
|
|
2159
|
+
needsNext: t.long.has(o)
|
|
2160
|
+
}];
|
|
2161
|
+
}
|
|
2162
|
+
if (e.length === 2) {
|
|
2163
|
+
const n = e.charAt(1);
|
|
2164
|
+
return [{
|
|
2165
|
+
name: e,
|
|
2166
|
+
needsNext: t.short.get(n) === !0
|
|
2167
|
+
}];
|
|
2168
|
+
}
|
|
2169
|
+
return W(e, t.short);
|
|
2170
|
+
}
|
|
2171
|
+
function W(e, t) {
|
|
2172
|
+
const n = e.slice(1).split(""), o = [];
|
|
2173
|
+
for (let s = 0; s < n.length; s++) {
|
|
2174
|
+
const r = n[s], l = t.get(r);
|
|
2175
|
+
if (l === void 0) return [{
|
|
2176
|
+
name: e,
|
|
2177
|
+
needsNext: !1
|
|
2178
|
+
}];
|
|
2179
|
+
if (l) {
|
|
2180
|
+
const a = n.slice(s + 1).join("");
|
|
2181
|
+
if (a && ![...a].every((w) => t.has(w))) return o.push({
|
|
2182
|
+
name: `-${r}`,
|
|
2183
|
+
value: a,
|
|
2184
|
+
needsNext: !1
|
|
2185
|
+
}), o;
|
|
2186
|
+
}
|
|
2187
|
+
o.push({
|
|
2188
|
+
name: `-${r}`,
|
|
2189
|
+
needsNext: l
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
return o;
|
|
2193
|
+
}
|
|
2194
|
+
function j(e, t = []) {
|
|
2195
|
+
let n = 0;
|
|
2196
|
+
for (; n < e.length;) {
|
|
2197
|
+
const o = String(e[n]);
|
|
2198
|
+
if (!o.startsWith("-") || o.length < 2) break;
|
|
2199
|
+
const s = b(o);
|
|
2200
|
+
let r = n + 1;
|
|
2201
|
+
for (const l of s) {
|
|
2202
|
+
const a = {
|
|
2203
|
+
name: l.name,
|
|
2204
|
+
value: l.value,
|
|
2205
|
+
absorbedNext: !1,
|
|
2206
|
+
isGlobal: !0
|
|
2207
|
+
};
|
|
2208
|
+
l.needsNext && a.value === void 0 && r < e.length && (a.value = String(e[r]), a.absorbedNext = !0, r++), t.push(a);
|
|
2209
|
+
}
|
|
2210
|
+
n = r;
|
|
2211
|
+
}
|
|
2212
|
+
return {
|
|
2213
|
+
flags: t,
|
|
2214
|
+
taskIndex: n
|
|
2215
|
+
};
|
|
2216
|
+
}
|
|
2217
|
+
function B(e, t, n = []) {
|
|
2218
|
+
const o$1 = I(t), s = [], r$1 = [];
|
|
2219
|
+
let l = 0;
|
|
2220
|
+
for (; l < e.length;) {
|
|
2221
|
+
const a = e[l];
|
|
2222
|
+
if (r(a)) {
|
|
2223
|
+
r$1.push(...o(a)), l++;
|
|
2224
|
+
continue;
|
|
2225
|
+
}
|
|
2226
|
+
const f = String(a);
|
|
2227
|
+
if (f === "--") {
|
|
2228
|
+
for (let g = l + 1; g < e.length; g++) {
|
|
2229
|
+
const u = e[g];
|
|
2230
|
+
r(u) ? r$1.push(...o(u)) : r$1.push(String(u));
|
|
2231
|
+
}
|
|
2232
|
+
break;
|
|
2233
|
+
}
|
|
2234
|
+
if (!f.startsWith("-") || f.length < 2) {
|
|
2235
|
+
s.push(f), l++;
|
|
2236
|
+
continue;
|
|
2237
|
+
}
|
|
2238
|
+
const w = b(f, o$1);
|
|
2239
|
+
let d = l + 1;
|
|
2240
|
+
for (const g of w) {
|
|
2241
|
+
const u = {
|
|
2242
|
+
name: g.name,
|
|
2243
|
+
value: g.value,
|
|
2244
|
+
absorbedNext: !1,
|
|
2245
|
+
isGlobal: !1
|
|
2246
|
+
};
|
|
2247
|
+
g.needsNext && u.value === void 0 && d < e.length && !r(e[d]) && (u.value = String(e[d]), u.absorbedNext = !0, d++), n.push(u);
|
|
2248
|
+
}
|
|
2249
|
+
l = d;
|
|
2250
|
+
}
|
|
2251
|
+
return {
|
|
2252
|
+
flags: n,
|
|
2253
|
+
positionals: s,
|
|
2254
|
+
pathspecs: r$1
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
function* V({ write: e }) {
|
|
2258
|
+
for (const t of e) for (const n of q) {
|
|
2259
|
+
const o = n(t.key);
|
|
2260
|
+
o && (yield o);
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
function c(e, t, n = String(e)) {
|
|
2264
|
+
const o = typeof e == "string" ? new RegExp(`\\s*${e.toLowerCase()}`) : e;
|
|
2265
|
+
return function(r) {
|
|
2266
|
+
if (o.test(r)) return {
|
|
2267
|
+
category: t,
|
|
2268
|
+
message: `Configuring ${n} is not permitted without enabling ${t}`
|
|
2269
|
+
};
|
|
2270
|
+
};
|
|
2271
|
+
}
|
|
2272
|
+
function i(e, t) {
|
|
2273
|
+
return c(new RegExp(`\\s*${e.toLowerCase().replace(/\./g, "(..+)?.")}`), t, e);
|
|
2274
|
+
}
|
|
2275
|
+
function* K(e, t) {
|
|
2276
|
+
for (const n of t) for (const o of H) {
|
|
2277
|
+
const s = o(e, n.name);
|
|
2278
|
+
s && (yield s);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
function h(e, t, n, o = String(t)) {
|
|
2282
|
+
const s = typeof t == "string" ? new RegExp(`\\s*${t.toLowerCase()}`) : t, r = `Use of ${e ? `${e} with option ` : ""}${o} is not permitted without enabling ${n}`;
|
|
2283
|
+
return function(a, f) {
|
|
2284
|
+
if ((!e || a === e) && s.test(f)) return {
|
|
2285
|
+
category: n,
|
|
2286
|
+
message: r
|
|
2287
|
+
};
|
|
2288
|
+
};
|
|
2289
|
+
}
|
|
2290
|
+
function C(e, t, n) {
|
|
2291
|
+
return [...K(e, t), ...V(n)];
|
|
2292
|
+
}
|
|
2293
|
+
function Y(...e) {
|
|
2294
|
+
const { flags: t, taskIndex: n } = j(e), o = n < e.length ? String(e[n]).toLowerCase() : null, { positionals: r, pathspecs: l } = B(o !== null ? e.slice(n + 1) : [], o, t), a = L(o, t, r);
|
|
2295
|
+
return {
|
|
2296
|
+
task: o,
|
|
2297
|
+
flags: t.map(J),
|
|
2298
|
+
paths: l,
|
|
2299
|
+
config: a,
|
|
2300
|
+
vulnerabilities: z(C(o, t, a))
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
function z(e) {
|
|
2304
|
+
return Object.defineProperty(e, "vulnerabilities", { value: e });
|
|
2305
|
+
}
|
|
2306
|
+
function J({ value: e, name: t }) {
|
|
2307
|
+
return e !== void 0 ? {
|
|
2308
|
+
name: t,
|
|
2309
|
+
value: e
|
|
2310
|
+
} : { name: t };
|
|
2311
|
+
}
|
|
2312
|
+
function* Q(e) {
|
|
2313
|
+
const t = parseInt(e.git_config_count ?? "0", 10);
|
|
2314
|
+
for (let n = 0; n < t; n++) {
|
|
2315
|
+
const o = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];
|
|
2316
|
+
o !== void 0 && (yield {
|
|
2317
|
+
key: o.toLowerCase().trim(),
|
|
2318
|
+
value: s,
|
|
2319
|
+
scope: "env"
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
function* X(e) {
|
|
2324
|
+
for (const t of Object.keys(e)) if (_(t)) {
|
|
2325
|
+
const n = y[t];
|
|
2326
|
+
yield {
|
|
2327
|
+
category: n,
|
|
2328
|
+
message: `Use of "${t.toUpperCase()}" is not permitted without enabling ${n}`
|
|
2329
|
+
};
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
function _(e) {
|
|
2333
|
+
return Object.hasOwn(y, e);
|
|
1769
2334
|
}
|
|
1770
|
-
function
|
|
1771
|
-
|
|
2335
|
+
function Z(e) {
|
|
2336
|
+
const t = {};
|
|
2337
|
+
for (const [n, o] of Object.entries(e)) {
|
|
2338
|
+
const s = n.toLowerCase().trim();
|
|
2339
|
+
(_(s) || s.startsWith("git")) && (t[s] = String(o));
|
|
2340
|
+
}
|
|
2341
|
+
return t;
|
|
1772
2342
|
}
|
|
1773
|
-
function
|
|
1774
|
-
|
|
2343
|
+
function ee(e) {
|
|
2344
|
+
const t = Z(e), n = {
|
|
2345
|
+
read: [],
|
|
2346
|
+
write: [...Q(t)]
|
|
2347
|
+
};
|
|
2348
|
+
return {
|
|
2349
|
+
config: n,
|
|
2350
|
+
vulnerabilities: [...X(t), ...C(null, [], n)]
|
|
2351
|
+
};
|
|
1775
2352
|
}
|
|
2353
|
+
function ne(e, t) {
|
|
2354
|
+
return [...Y(...e).vulnerabilities, ...ee(t).vulnerabilities];
|
|
2355
|
+
}
|
|
2356
|
+
var k, S, P, E, x, D, R, T, q, H, y;
|
|
2357
|
+
var init_argv_parser = __esmMin((() => {
|
|
2358
|
+
init_args_pathspec();
|
|
2359
|
+
k = /* @__PURE__ */ new Set([
|
|
2360
|
+
"--add",
|
|
2361
|
+
"--edit",
|
|
2362
|
+
"--remove-section",
|
|
2363
|
+
"--rename-section",
|
|
2364
|
+
"--replace-all",
|
|
2365
|
+
"--unset",
|
|
2366
|
+
"--unset-all",
|
|
2367
|
+
"-e"
|
|
2368
|
+
]);
|
|
2369
|
+
S = /* @__PURE__ */ new Set([
|
|
2370
|
+
"--get",
|
|
2371
|
+
"--get-all",
|
|
2372
|
+
"--get-color",
|
|
2373
|
+
"--get-colorbool",
|
|
2374
|
+
"--get-regexp",
|
|
2375
|
+
"--get-urlmatch",
|
|
2376
|
+
"--list",
|
|
2377
|
+
"-l"
|
|
2378
|
+
]);
|
|
2379
|
+
P = /* @__PURE__ */ new Set([
|
|
2380
|
+
"edit",
|
|
2381
|
+
"remove-section",
|
|
2382
|
+
"rename-section",
|
|
2383
|
+
"set",
|
|
2384
|
+
"unset"
|
|
2385
|
+
]);
|
|
2386
|
+
E = /* @__PURE__ */ new Set([
|
|
2387
|
+
"get",
|
|
2388
|
+
"get-color",
|
|
2389
|
+
"get-colorbool",
|
|
2390
|
+
"list"
|
|
2391
|
+
]);
|
|
2392
|
+
x = { short: /* @__PURE__ */ new Map([["c", !0]]) };
|
|
2393
|
+
D = {
|
|
2394
|
+
short: new Map([
|
|
2395
|
+
["C", !0],
|
|
2396
|
+
["P", !1],
|
|
2397
|
+
["h", !1],
|
|
2398
|
+
["p", !1],
|
|
2399
|
+
["v", !1],
|
|
2400
|
+
...x.short.entries()
|
|
2401
|
+
]),
|
|
2402
|
+
long: /* @__PURE__ */ new Set([
|
|
2403
|
+
"attr-source",
|
|
2404
|
+
"config-env",
|
|
2405
|
+
"exec-path",
|
|
2406
|
+
"git-dir",
|
|
2407
|
+
"list-cmds",
|
|
2408
|
+
"namespace",
|
|
2409
|
+
"super-prefix",
|
|
2410
|
+
"work-tree"
|
|
2411
|
+
])
|
|
2412
|
+
};
|
|
2413
|
+
R = {
|
|
2414
|
+
clone: {
|
|
2415
|
+
short: /* @__PURE__ */ new Map([
|
|
2416
|
+
["b", !0],
|
|
2417
|
+
["j", !0],
|
|
2418
|
+
["l", !1],
|
|
2419
|
+
["n", !1],
|
|
2420
|
+
["o", !0],
|
|
2421
|
+
["q", !1],
|
|
2422
|
+
["s", !1],
|
|
2423
|
+
["u", !0]
|
|
2424
|
+
]),
|
|
2425
|
+
long: /* @__PURE__ */ new Set([
|
|
2426
|
+
"branch",
|
|
2427
|
+
"config",
|
|
2428
|
+
"jobs",
|
|
2429
|
+
"origin",
|
|
2430
|
+
"upload-pack",
|
|
2431
|
+
"u",
|
|
2432
|
+
"template"
|
|
2433
|
+
])
|
|
2434
|
+
},
|
|
2435
|
+
commit: {
|
|
2436
|
+
short: /* @__PURE__ */ new Map([
|
|
2437
|
+
["C", !0],
|
|
2438
|
+
["F", !0],
|
|
2439
|
+
["c", !0],
|
|
2440
|
+
["m", !0],
|
|
2441
|
+
["t", !0]
|
|
2442
|
+
]),
|
|
2443
|
+
long: /* @__PURE__ */ new Set([
|
|
2444
|
+
"file",
|
|
2445
|
+
"message",
|
|
2446
|
+
"reedit-message",
|
|
2447
|
+
"reuse-message",
|
|
2448
|
+
"template"
|
|
2449
|
+
])
|
|
2450
|
+
},
|
|
2451
|
+
config: {
|
|
2452
|
+
short: /* @__PURE__ */ new Map([
|
|
2453
|
+
["e", !1],
|
|
2454
|
+
["f", !0],
|
|
2455
|
+
["l", !1]
|
|
2456
|
+
]),
|
|
2457
|
+
long: /* @__PURE__ */ new Set([
|
|
2458
|
+
"blob",
|
|
2459
|
+
"comment",
|
|
2460
|
+
"default",
|
|
2461
|
+
"file",
|
|
2462
|
+
"type",
|
|
2463
|
+
"value"
|
|
2464
|
+
])
|
|
2465
|
+
},
|
|
2466
|
+
fetch: {
|
|
2467
|
+
short: /* @__PURE__ */ new Map(),
|
|
2468
|
+
long: /* @__PURE__ */ new Set(["upload-pack"])
|
|
2469
|
+
},
|
|
2470
|
+
init: {
|
|
2471
|
+
short: /* @__PURE__ */ new Map(),
|
|
2472
|
+
long: /* @__PURE__ */ new Set(["template"])
|
|
2473
|
+
},
|
|
2474
|
+
pull: {
|
|
2475
|
+
short: /* @__PURE__ */ new Map(),
|
|
2476
|
+
long: /* @__PURE__ */ new Set(["upload-pack"])
|
|
2477
|
+
},
|
|
2478
|
+
push: {
|
|
2479
|
+
short: /* @__PURE__ */ new Map(),
|
|
2480
|
+
long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
T = {
|
|
2484
|
+
short: /* @__PURE__ */ new Map(),
|
|
2485
|
+
long: /* @__PURE__ */ new Set()
|
|
2486
|
+
};
|
|
2487
|
+
q = [
|
|
2488
|
+
c("alias", "allowUnsafeAlias"),
|
|
2489
|
+
c("core.askPass", "allowUnsafeAskPass"),
|
|
2490
|
+
c("core.editor", "allowUnsafeEditor"),
|
|
2491
|
+
c("core.fsmonitor", "allowUnsafeFsMonitor"),
|
|
2492
|
+
c("core.gitProxy", "allowUnsafeGitProxy"),
|
|
2493
|
+
c("core.hooksPath", "allowUnsafeHooksPath"),
|
|
2494
|
+
c("core.pager", "allowUnsafePager"),
|
|
2495
|
+
c("core.sshCommand", "allowUnsafeSshCommand"),
|
|
2496
|
+
i("credential.helper", "allowUnsafeCredentialHelper"),
|
|
2497
|
+
i("diff.command", "allowUnsafeDiffExternal"),
|
|
2498
|
+
c("diff.external", "allowUnsafeDiffExternal"),
|
|
2499
|
+
i("diff.textconv", "allowUnsafeDiffTextConv"),
|
|
2500
|
+
i("filter.clean", "allowUnsafeFilter"),
|
|
2501
|
+
i("filter.smudge", "allowUnsafeFilter"),
|
|
2502
|
+
i("gpg.program", "allowUnsafeGpgProgram"),
|
|
2503
|
+
c("init.templateDir", "allowUnsafeTemplateDir"),
|
|
2504
|
+
i("merge.driver", "allowUnsafeMergeDriver"),
|
|
2505
|
+
i("mergetool.path", "allowUnsafeMergeDriver"),
|
|
2506
|
+
i("mergetool.cmd", "allowUnsafeMergeDriver"),
|
|
2507
|
+
i("protocol.allow", "allowUnsafeProtocolOverride"),
|
|
2508
|
+
i("remote.receivepack", "allowUnsafePack"),
|
|
2509
|
+
i("remote.uploadpack", "allowUnsafePack"),
|
|
2510
|
+
c("sequence.editor", "allowUnsafeEditor")
|
|
2511
|
+
];
|
|
2512
|
+
H = [
|
|
2513
|
+
h(null, /--(upload|receive)-pack/, "allowUnsafePack", "--upload-pack or --receive-pack"),
|
|
2514
|
+
h("clone", /^-\w*u/, "allowUnsafePack"),
|
|
2515
|
+
h("clone", "--u", "allowUnsafePack"),
|
|
2516
|
+
h("push", "--exec", "allowUnsafePack"),
|
|
2517
|
+
h(null, "--template", "allowUnsafeTemplateDir")
|
|
2518
|
+
];
|
|
2519
|
+
y = {
|
|
2520
|
+
editor: "allowUnsafeEditor",
|
|
2521
|
+
git_askpass: "allowUnsafeAskPass",
|
|
2522
|
+
git_config_global: "allowUnsafeConfigPaths",
|
|
2523
|
+
git_config_system: "allowUnsafeConfigPaths",
|
|
2524
|
+
git_config_count: "allowUnsafeConfigEnvCount",
|
|
2525
|
+
git_config: "allowUnsafeConfigPaths",
|
|
2526
|
+
git_editor: "allowUnsafeEditor",
|
|
2527
|
+
git_exec_path: "allowUnsafeConfigPaths",
|
|
2528
|
+
git_external_diff: "allowUnsafeDiffExternal",
|
|
2529
|
+
git_pager: "allowUnsafePager",
|
|
2530
|
+
git_proxy_command: "allowUnsafeGitProxy",
|
|
2531
|
+
git_template_dir: "allowUnsafeTemplateDir",
|
|
2532
|
+
git_sequence_editor: "allowUnsafeEditor",
|
|
2533
|
+
git_ssh: "allowUnsafeSshCommand",
|
|
2534
|
+
git_ssh_command: "allowUnsafeSshCommand",
|
|
2535
|
+
pager: "allowUnsafePager",
|
|
2536
|
+
prefix: "allowUnsafeConfigPaths",
|
|
2537
|
+
ssh_askpass: "allowUnsafeAskPass"
|
|
2538
|
+
};
|
|
2539
|
+
}));
|
|
2540
|
+
//#endregion
|
|
2541
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/simple-git.mjs
|
|
1776
2542
|
function asFunction(source) {
|
|
1777
2543
|
if (typeof source !== "function") return NOOP;
|
|
1778
2544
|
return source;
|
|
@@ -1848,7 +2614,7 @@ function prefixedArray(input, prefix) {
|
|
|
1848
2614
|
return output;
|
|
1849
2615
|
}
|
|
1850
2616
|
function bufferToString(input) {
|
|
1851
|
-
return (Array.isArray(input) ? Buffer
|
|
2617
|
+
return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
|
|
1852
2618
|
}
|
|
1853
2619
|
function pick(source, properties) {
|
|
1854
2620
|
const out = {};
|
|
@@ -1869,7 +2635,7 @@ function filterType(input, filter, def) {
|
|
|
1869
2635
|
return arguments.length > 2 ? def : void 0;
|
|
1870
2636
|
}
|
|
1871
2637
|
function filterPrimitives(input, omit) {
|
|
1872
|
-
const type =
|
|
2638
|
+
const type = r(input) ? "string" : typeof input;
|
|
1873
2639
|
return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
|
|
1874
2640
|
}
|
|
1875
2641
|
function filterPlainObject(input) {
|
|
@@ -1895,7 +2661,7 @@ function appendTaskOptions(options, commands = []) {
|
|
|
1895
2661
|
if (!filterPlainObject(options)) return commands;
|
|
1896
2662
|
return Object.keys(options).reduce((commands2, key) => {
|
|
1897
2663
|
const value = options[key];
|
|
1898
|
-
if (
|
|
2664
|
+
if (r(value)) commands2.push(value);
|
|
1899
2665
|
else if (filterPrimitives(value, ["boolean"])) commands2.push(key + "=" + value);
|
|
1900
2666
|
else if (Array.isArray(value)) {
|
|
1901
2667
|
for (const v of value) if (!filterPrimitives(v, ["string", "number"])) commands2.push(key + "=" + v);
|
|
@@ -2549,7 +3315,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
|
|
|
2549
3315
|
const rangeOperator = opt.symmetric !== false ? "..." : "..";
|
|
2550
3316
|
suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
|
|
2551
3317
|
}
|
|
2552
|
-
if (filterString(opt.file)) command.push("--follow",
|
|
3318
|
+
if (filterString(opt.file)) command.push("--follow", c$1(opt.file));
|
|
2553
3319
|
appendTaskOptions(userOptions(opt), command);
|
|
2554
3320
|
return {
|
|
2555
3321
|
fields,
|
|
@@ -2677,13 +3443,13 @@ function parser3(indexX, indexY, handler) {
|
|
|
2677
3443
|
return [`${indexX}${indexY}`, handler];
|
|
2678
3444
|
}
|
|
2679
3445
|
function conflicts(indexX, ...indexY) {
|
|
2680
|
-
return indexY.map((y) => parser3(indexX, y, (result, file) =>
|
|
3446
|
+
return indexY.map((y) => parser3(indexX, y, (result, file) => result.conflicted.push(file)));
|
|
2681
3447
|
}
|
|
2682
3448
|
function splitLine(result, lineStr) {
|
|
2683
3449
|
const trimmed2 = lineStr.trim();
|
|
2684
3450
|
switch (" ") {
|
|
2685
|
-
case trimmed2.charAt(2): return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.
|
|
2686
|
-
case trimmed2.charAt(1): return data(" ", trimmed2.charAt(0), trimmed2.
|
|
3451
|
+
case trimmed2.charAt(2): return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
|
|
3452
|
+
case trimmed2.charAt(1): return data(" ", trimmed2.charAt(0), trimmed2.slice(2));
|
|
2687
3453
|
default: return;
|
|
2688
3454
|
}
|
|
2689
3455
|
function data(index, workingDir, path) {
|
|
@@ -2744,6 +3510,20 @@ function versionParser(stdOut) {
|
|
|
2744
3510
|
if (stdOut === NOT_INSTALLED) return notInstalledResponse();
|
|
2745
3511
|
return parseStringResponse(versionResponse(0, 0, 0, stdOut), parsers7, stdOut);
|
|
2746
3512
|
}
|
|
3513
|
+
function createCloneTask(api, task, repoPath, ...args) {
|
|
3514
|
+
if (!filterString(repoPath)) return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
|
|
3515
|
+
return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
|
|
3516
|
+
}
|
|
3517
|
+
function clone_default() {
|
|
3518
|
+
return {
|
|
3519
|
+
clone(repo, ...rest) {
|
|
3520
|
+
return this._runTask(createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest), trailingFunctionArgument(arguments));
|
|
3521
|
+
},
|
|
3522
|
+
mirror(repo, ...rest) {
|
|
3523
|
+
return this._runTask(createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest), trailingFunctionArgument(arguments));
|
|
3524
|
+
}
|
|
3525
|
+
};
|
|
3526
|
+
}
|
|
2747
3527
|
function applyPatchTask(patches, customArgs) {
|
|
2748
3528
|
return straightThroughStringTask([
|
|
2749
3529
|
"apply",
|
|
@@ -2854,20 +3634,6 @@ function checkIgnoreTask(paths) {
|
|
|
2854
3634
|
parser: parseCheckIgnore
|
|
2855
3635
|
};
|
|
2856
3636
|
}
|
|
2857
|
-
function disallowedCommand(command) {
|
|
2858
|
-
return /^--upload-pack(=|$)/.test(command);
|
|
2859
|
-
}
|
|
2860
|
-
function cloneTask(repo, directory, customArgs) {
|
|
2861
|
-
const commands = ["clone", ...customArgs];
|
|
2862
|
-
filterString(repo) && commands.push(repo);
|
|
2863
|
-
filterString(directory) && commands.push(directory);
|
|
2864
|
-
if (commands.find(disallowedCommand)) return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
|
|
2865
|
-
return straightThroughStringTask(commands);
|
|
2866
|
-
}
|
|
2867
|
-
function cloneMirrorTask(repo, directory, customArgs) {
|
|
2868
|
-
append(customArgs, "--mirror");
|
|
2869
|
-
return cloneTask(repo, directory, customArgs);
|
|
2870
|
-
}
|
|
2871
3637
|
function parseFetchResult(stdOut, stdErr) {
|
|
2872
3638
|
return parseStringResponse({
|
|
2873
3639
|
raw: stdOut,
|
|
@@ -2878,13 +3644,13 @@ function parseFetchResult(stdOut, stdErr) {
|
|
|
2878
3644
|
deleted: []
|
|
2879
3645
|
}, parsers10, [stdOut, stdErr]);
|
|
2880
3646
|
}
|
|
2881
|
-
function
|
|
3647
|
+
function disallowedCommand(command) {
|
|
2882
3648
|
return /^--upload-pack(=|$)/.test(command);
|
|
2883
3649
|
}
|
|
2884
3650
|
function fetchTask(remote, branch, customArgs) {
|
|
2885
3651
|
const commands = ["fetch", ...customArgs];
|
|
2886
3652
|
if (remote && branch) commands.push(remote, branch);
|
|
2887
|
-
if (commands.find(
|
|
3653
|
+
if (commands.find(disallowedCommand)) return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
|
|
2888
3654
|
return {
|
|
2889
3655
|
commands,
|
|
2890
3656
|
format: "utf-8",
|
|
@@ -3083,28 +3849,11 @@ function abortPlugin(signal) {
|
|
|
3083
3849
|
}
|
|
3084
3850
|
}];
|
|
3085
3851
|
}
|
|
3086
|
-
function
|
|
3087
|
-
return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
|
|
3088
|
-
}
|
|
3089
|
-
function preventProtocolOverride(arg, next) {
|
|
3090
|
-
if (!isConfigSwitch(arg)) return;
|
|
3091
|
-
if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) return;
|
|
3092
|
-
throw new GitPluginError(void 0, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol");
|
|
3093
|
-
}
|
|
3094
|
-
function preventUploadPack(arg, method) {
|
|
3095
|
-
if (/^\s*--(upload|receive)-pack/.test(arg)) throw new GitPluginError(void 0, "unsafe", `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`);
|
|
3096
|
-
if (method === "clone" && /^\s*-u\b/.test(arg)) throw new GitPluginError(void 0, "unsafe", `Use of clone with option -u is not permitted without enabling allowUnsafePack`);
|
|
3097
|
-
if (method === "push" && /^\s*--exec\b/.test(arg)) throw new GitPluginError(void 0, "unsafe", `Use of push with option --exec is not permitted without enabling allowUnsafePack`);
|
|
3098
|
-
}
|
|
3099
|
-
function blockUnsafeOperationsPlugin({ allowUnsafeProtocolOverride = false, allowUnsafePack = false } = {}) {
|
|
3852
|
+
function blockUnsafeOperationsPlugin(options = {}) {
|
|
3100
3853
|
return {
|
|
3101
3854
|
type: "spawn.args",
|
|
3102
|
-
action(args,
|
|
3103
|
-
|
|
3104
|
-
const next = index < args.length ? args[index + 1] : "";
|
|
3105
|
-
allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
|
|
3106
|
-
allowUnsafePack || preventUploadPack(current, context.method);
|
|
3107
|
-
});
|
|
3855
|
+
action(args, { env }) {
|
|
3856
|
+
for (const vulnerability of ne(args, env)) if (options[vulnerability.category] !== true) throw new GitPluginError(void 0, "unsafe", vulnerability.message);
|
|
3108
3857
|
return args;
|
|
3109
3858
|
}
|
|
3110
3859
|
};
|
|
@@ -3171,7 +3920,7 @@ function completionDetectionPlugin({ onClose = true, onExit = 50 } = {}) {
|
|
|
3171
3920
|
};
|
|
3172
3921
|
}
|
|
3173
3922
|
function isBadArgument(arg) {
|
|
3174
|
-
return !arg || !/^([a-z]:)?([a-z0-9/.\\_
|
|
3923
|
+
return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
|
|
3175
3924
|
}
|
|
3176
3925
|
function toBinaryConfig(input, allowUnsafe) {
|
|
3177
3926
|
if (input.length < 1 || input.length > 2) throw new GitPluginError(void 0, "binary", WRONG_NUMBER_ERR);
|
|
@@ -3308,12 +4057,12 @@ function suffixPathsPlugin() {
|
|
|
3308
4057
|
}
|
|
3309
4058
|
for (let i = 0; i < data.length; i++) {
|
|
3310
4059
|
const param = data[i];
|
|
3311
|
-
if (
|
|
3312
|
-
append2(
|
|
4060
|
+
if (r(param)) {
|
|
4061
|
+
append2(o(param));
|
|
3313
4062
|
continue;
|
|
3314
4063
|
}
|
|
3315
4064
|
if (param === "--") {
|
|
3316
|
-
append2(data.slice(i + 1).flatMap((item) =>
|
|
4065
|
+
append2(data.slice(i + 1).flatMap((item) => r(item) && o(item) || item));
|
|
3317
4066
|
break;
|
|
3318
4067
|
}
|
|
3319
4068
|
prefix.push(param);
|
|
@@ -3332,22 +4081,24 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
3332
4081
|
if (!folderExists(config.baseDir)) throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`);
|
|
3333
4082
|
if (Array.isArray(config.config)) plugins.add(commandConfigPrefixingPlugin(config.config));
|
|
3334
4083
|
plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
|
|
3335
|
-
plugins.add(suffixPathsPlugin());
|
|
3336
4084
|
plugins.add(completionDetectionPlugin(config.completion));
|
|
3337
4085
|
config.abort && plugins.add(abortPlugin(config.abort));
|
|
3338
4086
|
config.progress && plugins.add(progressMonitorPlugin(config.progress));
|
|
3339
4087
|
config.timeout && plugins.add(timeoutPlugin(config.timeout));
|
|
3340
4088
|
config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
|
|
4089
|
+
plugins.add(suffixPathsPlugin());
|
|
3341
4090
|
plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
|
|
3342
4091
|
config.errors && plugins.add(errorDetectionPlugin(config.errors));
|
|
3343
4092
|
customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
|
|
3344
4093
|
return new Git(config, plugins);
|
|
3345
4094
|
}
|
|
3346
|
-
var import_dist$2, import_src, import_dist$1$1, __defProp, __getOwnPropDesc, __getOwnPropNames, __hasOwnProp, __esm, __commonJS, __export, __copyProps, __toCommonJS,
|
|
4095
|
+
var import_dist$2, import_src, import_dist$1$1, __defProp, __getOwnPropDesc, __getOwnPropNames, __hasOwnProp, __esm, __commonJS, __export, __copyProps, __toCommonJS, GitError, init_git_error, GitResponseError, init_git_response_error, TaskConfigurationError, init_task_configuration_error, NULL, NOOP, objectToString, init_util, filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength, init_argument_filters, ExitCodes, init_exit_codes, GitOutputStreams, init_git_output_streams, LineParser, RemoteLineParser, init_line_parser, defaultOptions, init_simple_git_options, init_task_options, init_task_parser, utils_exports, init_utils, check_is_repo_exports, CheckRepoActions, onError, parser, init_check_is_repo, CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp, init_CleanSummary, task_exports, EMPTY_COMMANDS, init_task, clean_exports, CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues, init_clean, ConfigList, init_ConfigList, GitConfigScope, init_config, DiffNameStatus, diffNameStatus, init_diff_name_status, disallowedOptions, Query, _a, GrepQuery, init_grep, reset_exports, ResetMode, validResetModes, init_reset, init_git_logger, TasksPendingQueue, init_tasks_pending_queue, GitExecutorChain, init_git_executor_chain, git_executor_exports, GitExecutor, init_git_executor, init_task_callback, init_change_working_directory, init_checkout, parser2, init_count_objects, parsers, init_parse_commit, init_commit, init_first_commit, init_hash_object, InitSummary, initResponseRegex, reInitResponseRegex, init_InitSummary, bareCommand, init_init, logFormatRegex, init_log_format, DiffSummary, init_DiffSummary, statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers, init_parse_diff_summary, START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames, init_parse_list_log_summary, diff_exports, init_diff, excludeOptions, init_log, MergeSummaryConflict, MergeSummaryDetail, init_MergeSummary, PullSummary, PullFailedSummary, init_PullSummary, remoteMessagesObjectParsers, init_parse_remote_objects, parsers2, RemoteMessageSummary, init_parse_remote_messages, FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers3, errorParsers, parsePullDetail, parsePullResult, init_parse_pull, parsers4, parseMergeResult, parseMergeDetail, init_parse_merge, init_merge, parsers5, parsePushResult, parsePushDetail, init_parse_push, push_exports, init_push, init_show, fromPathRegex, FileStatusSummary, init_FileStatusSummary, StatusSummary, parsers6, parseStatusSummary, init_StatusSummary, ignoredOptions, init_status, NOT_INSTALLED, parsers7, init_version, cloneTask, cloneMirrorTask, init_clone, simple_git_api_exports, SimpleGitApi, init_simple_git_api, scheduler_exports, createScheduledTask, Scheduler, init_scheduler, apply_patch_exports, init_apply_patch, BranchDeletionBatch, init_BranchDeleteSummary, deleteSuccessRegex, deleteErrorRegex, parsers8, parseBranchDeletions, init_parse_branch_delete, BranchSummaryResult, init_BranchSummary, parsers9, currentBranchParser, init_parse_branch, branch_exports, init_branch, parseCheckIgnore, init_CheckIgnore, check_ignore_exports, init_check_ignore, parsers10, init_parse_fetch, fetch_exports, init_fetch, parsers11, init_parse_move, move_exports, init_move, pull_exports, init_pull, init_GetRemoteSummary, remote_exports, init_remote, stash_list_exports, init_stash_list, sub_module_exports, init_sub_module, TagList, parseTagList, init_TagList, tag_exports, init_tag, require_git, GitConstructError, GitPluginError, never, WRONG_NUMBER_ERR, WRONG_CHARS_ERR, PluginStore, Git, esm_default;
|
|
3347
4096
|
var init_simple_git = __esmMin((() => {
|
|
3348
4097
|
init_rolldown_runtime();
|
|
3349
4098
|
init_file_exists();
|
|
4099
|
+
init_args_pathspec();
|
|
3350
4100
|
init_promise_deferred();
|
|
4101
|
+
init_argv_parser();
|
|
3351
4102
|
import_dist$2 = require_dist$3();
|
|
3352
4103
|
import_src = /* @__PURE__ */ __toESM(require_src$1(), 1);
|
|
3353
4104
|
import_dist$1$1 = require_dist$2();
|
|
@@ -3377,10 +4128,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
3377
4128
|
return to;
|
|
3378
4129
|
};
|
|
3379
4130
|
__toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
3380
|
-
init_pathspec = __esm({ "src/lib/args/pathspec.ts"() {
|
|
3381
|
-
"use strict";
|
|
3382
|
-
cache = /* @__PURE__ */ new WeakMap();
|
|
3383
|
-
} });
|
|
3384
4131
|
init_git_error = __esm({ "src/lib/errors/git-error.ts"() {
|
|
3385
4132
|
"use strict";
|
|
3386
4133
|
GitError = class extends Error {
|
|
@@ -3419,7 +4166,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
3419
4166
|
} });
|
|
3420
4167
|
init_argument_filters = __esm({ "src/lib/utils/argument-filters.ts"() {
|
|
3421
4168
|
"use strict";
|
|
3422
|
-
init_pathspec();
|
|
3423
4169
|
init_util();
|
|
3424
4170
|
filterArray = (input) => {
|
|
3425
4171
|
return Array.isArray(input);
|
|
@@ -3428,7 +4174,7 @@ var init_simple_git = __esmMin((() => {
|
|
|
3428
4174
|
return typeof input === "number";
|
|
3429
4175
|
};
|
|
3430
4176
|
filterString = (input) => {
|
|
3431
|
-
return typeof input === "string";
|
|
4177
|
+
return typeof input === "string" || r(input);
|
|
3432
4178
|
};
|
|
3433
4179
|
filterStringOrStringArray = (input) => {
|
|
3434
4180
|
return filterString(input) || Array.isArray(input) && input.every(filterString);
|
|
@@ -3511,7 +4257,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
3511
4257
|
"use strict";
|
|
3512
4258
|
init_argument_filters();
|
|
3513
4259
|
init_util();
|
|
3514
|
-
init_pathspec();
|
|
3515
4260
|
} });
|
|
3516
4261
|
init_task_parser = __esm({ "src/lib/utils/task-parser.ts"() {
|
|
3517
4262
|
"use strict";
|
|
@@ -3876,7 +4621,10 @@ var init_simple_git = __esmMin((() => {
|
|
|
3876
4621
|
}
|
|
3877
4622
|
async attemptRemoteTask(task, logger) {
|
|
3878
4623
|
const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
|
|
3879
|
-
const args = this._plugins.exec("spawn.args", [...task.commands],
|
|
4624
|
+
const args = this._plugins.exec("spawn.args", [...task.commands], {
|
|
4625
|
+
...pluginContext(task, task.commands),
|
|
4626
|
+
env: { ...this.env }
|
|
4627
|
+
});
|
|
3880
4628
|
const raw = await this.gitResponse(task, binary, args, this.outputHandler, logger.step("SPAWN"));
|
|
3881
4629
|
const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
|
|
3882
4630
|
logger(`passing response to task's parser as a %s`, task.format);
|
|
@@ -4213,7 +4961,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
4213
4961
|
init_log = __esm({ "src/lib/tasks/log.ts"() {
|
|
4214
4962
|
"use strict";
|
|
4215
4963
|
init_log_format();
|
|
4216
|
-
init_pathspec();
|
|
4217
4964
|
init_parse_list_log_summary();
|
|
4218
4965
|
init_utils();
|
|
4219
4966
|
init_task();
|
|
@@ -4540,26 +5287,42 @@ var init_simple_git = __esmMin((() => {
|
|
|
4540
5287
|
}
|
|
4541
5288
|
};
|
|
4542
5289
|
parsers6 = new Map([
|
|
4543
|
-
parser3(" ", "A", (result, file) =>
|
|
4544
|
-
parser3(" ", "D", (result, file) =>
|
|
4545
|
-
parser3(" ", "M", (result, file) =>
|
|
4546
|
-
parser3("A", " ", (result, file) =>
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
parser3("
|
|
5290
|
+
parser3(" ", "A", (result, file) => result.created.push(file)),
|
|
5291
|
+
parser3(" ", "D", (result, file) => result.deleted.push(file)),
|
|
5292
|
+
parser3(" ", "M", (result, file) => result.modified.push(file)),
|
|
5293
|
+
parser3("A", " ", (result, file) => {
|
|
5294
|
+
result.created.push(file);
|
|
5295
|
+
result.staged.push(file);
|
|
5296
|
+
}),
|
|
5297
|
+
parser3("A", "M", (result, file) => {
|
|
5298
|
+
result.created.push(file);
|
|
5299
|
+
result.staged.push(file);
|
|
5300
|
+
result.modified.push(file);
|
|
5301
|
+
}),
|
|
5302
|
+
parser3("D", " ", (result, file) => {
|
|
5303
|
+
result.deleted.push(file);
|
|
5304
|
+
result.staged.push(file);
|
|
5305
|
+
}),
|
|
5306
|
+
parser3("M", " ", (result, file) => {
|
|
5307
|
+
result.modified.push(file);
|
|
5308
|
+
result.staged.push(file);
|
|
5309
|
+
}),
|
|
5310
|
+
parser3("M", "M", (result, file) => {
|
|
5311
|
+
result.modified.push(file);
|
|
5312
|
+
result.staged.push(file);
|
|
5313
|
+
}),
|
|
4551
5314
|
parser3("R", " ", (result, file) => {
|
|
4552
|
-
|
|
5315
|
+
result.renamed.push(renamedFile(file));
|
|
4553
5316
|
}),
|
|
4554
5317
|
parser3("R", "M", (result, file) => {
|
|
4555
5318
|
const renamed = renamedFile(file);
|
|
4556
|
-
|
|
4557
|
-
|
|
5319
|
+
result.renamed.push(renamed);
|
|
5320
|
+
result.modified.push(renamed.to);
|
|
4558
5321
|
}),
|
|
4559
5322
|
parser3("!", "!", (_result, _file) => {
|
|
4560
|
-
|
|
5323
|
+
(_result.ignored = _result.ignored || []).push(_file);
|
|
4561
5324
|
}),
|
|
4562
|
-
parser3("?", "?", (result, file) =>
|
|
5325
|
+
parser3("?", "?", (result, file) => result.not_added.push(file)),
|
|
4563
5326
|
...conflicts("A", "A", "U"),
|
|
4564
5327
|
...conflicts("D", "D", "U"),
|
|
4565
5328
|
...conflicts("U", "A", "D", "U"),
|
|
@@ -4609,6 +5372,21 @@ var init_simple_git = __esmMin((() => {
|
|
|
4609
5372
|
Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent));
|
|
4610
5373
|
})];
|
|
4611
5374
|
} });
|
|
5375
|
+
init_clone = __esm({ "src/lib/tasks/clone.ts"() {
|
|
5376
|
+
"use strict";
|
|
5377
|
+
init_task();
|
|
5378
|
+
init_utils();
|
|
5379
|
+
cloneTask = (repo, directory, customArgs) => {
|
|
5380
|
+
const commands = ["clone", ...customArgs];
|
|
5381
|
+
filterString(repo) && commands.push(c$1(repo));
|
|
5382
|
+
filterString(directory) && commands.push(c$1(directory));
|
|
5383
|
+
return straightThroughStringTask(commands);
|
|
5384
|
+
};
|
|
5385
|
+
cloneMirrorTask = (repo, directory, customArgs) => {
|
|
5386
|
+
append(customArgs, "--mirror");
|
|
5387
|
+
return cloneTask(repo, directory, customArgs);
|
|
5388
|
+
};
|
|
5389
|
+
} });
|
|
4612
5390
|
simple_git_api_exports = {};
|
|
4613
5391
|
__export(simple_git_api_exports, { SimpleGitApi: () => SimpleGitApi });
|
|
4614
5392
|
init_simple_git_api = __esm({ "src/lib/simple-git-api.ts"() {
|
|
@@ -4631,6 +5409,7 @@ var init_simple_git = __esmMin((() => {
|
|
|
4631
5409
|
init_task();
|
|
4632
5410
|
init_version();
|
|
4633
5411
|
init_utils();
|
|
5412
|
+
init_clone();
|
|
4634
5413
|
SimpleGitApi = class {
|
|
4635
5414
|
constructor(_executor) {
|
|
4636
5415
|
this._executor = _executor;
|
|
@@ -4689,7 +5468,7 @@ var init_simple_git = __esmMin((() => {
|
|
|
4689
5468
|
return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
|
|
4690
5469
|
}
|
|
4691
5470
|
};
|
|
4692
|
-
Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
|
|
5471
|
+
Object.assign(SimpleGitApi.prototype, checkout_default(), clone_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
|
|
4693
5472
|
} });
|
|
4694
5473
|
scheduler_exports = {};
|
|
4695
5474
|
__export(scheduler_exports, { Scheduler: () => Scheduler });
|
|
@@ -4842,16 +5621,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
4842
5621
|
"use strict";
|
|
4843
5622
|
init_CheckIgnore();
|
|
4844
5623
|
} });
|
|
4845
|
-
clone_exports = {};
|
|
4846
|
-
__export(clone_exports, {
|
|
4847
|
-
cloneMirrorTask: () => cloneMirrorTask,
|
|
4848
|
-
cloneTask: () => cloneTask
|
|
4849
|
-
});
|
|
4850
|
-
init_clone = __esm({ "src/lib/tasks/clone.ts"() {
|
|
4851
|
-
"use strict";
|
|
4852
|
-
init_task();
|
|
4853
|
-
init_utils();
|
|
4854
|
-
} });
|
|
4855
5624
|
init_parse_fetch = __esm({ "src/lib/parsers/parse-fetch.ts"() {
|
|
4856
5625
|
"use strict";
|
|
4857
5626
|
init_utils();
|
|
@@ -4992,13 +5761,12 @@ var init_simple_git = __esmMin((() => {
|
|
|
4992
5761
|
var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
|
|
4993
5762
|
var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
|
|
4994
5763
|
var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
|
|
4995
|
-
var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
|
|
5764
|
+
var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
|
|
4996
5765
|
var { asArray: asArray2, filterArray: filterArray2, filterPrimitives: filterPrimitives2, filterString: filterString2, filterStringOrStringArray: filterStringOrStringArray2, filterType: filterType2, getTrailingOptions: getTrailingOptions2, trailingFunctionArgument: trailingFunctionArgument2, trailingOptionsArgument: trailingOptionsArgument2 } = (init_utils(), __toCommonJS(utils_exports));
|
|
4997
5766
|
var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports));
|
|
4998
5767
|
var { branchTask: branchTask2, branchLocalTask: branchLocalTask2, deleteBranchesTask: deleteBranchesTask2, deleteBranchTask: deleteBranchTask2 } = (init_branch(), __toCommonJS(branch_exports));
|
|
4999
5768
|
var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
|
|
5000
5769
|
var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
|
|
5001
|
-
var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));
|
|
5002
5770
|
var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
|
|
5003
5771
|
var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
|
|
5004
5772
|
var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
|
|
@@ -5029,16 +5797,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
5029
5797
|
Git2.prototype.stashList = function(options) {
|
|
5030
5798
|
return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));
|
|
5031
5799
|
};
|
|
5032
|
-
function createCloneTask(api, task, repoPath, localPath) {
|
|
5033
|
-
if (typeof repoPath !== "string") return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
|
|
5034
|
-
return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
|
|
5035
|
-
}
|
|
5036
|
-
Git2.prototype.clone = function() {
|
|
5037
|
-
return this._runTask(createCloneTask("clone", cloneTask2, ...arguments), trailingFunctionArgument2(arguments));
|
|
5038
|
-
};
|
|
5039
|
-
Git2.prototype.mirror = function() {
|
|
5040
|
-
return this._runTask(createCloneTask("mirror", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments));
|
|
5041
|
-
};
|
|
5042
5800
|
Git2.prototype.mv = function(from, to) {
|
|
5043
5801
|
return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
|
|
5044
5802
|
};
|
|
@@ -5057,8 +5815,7 @@ var init_simple_git = __esmMin((() => {
|
|
|
5057
5815
|
return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
|
|
5058
5816
|
};
|
|
5059
5817
|
Git2.prototype.silent = function(silence) {
|
|
5060
|
-
console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be
|
|
5061
|
-
return this;
|
|
5818
|
+
return this._runTask(adhocExecTask2(() => console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")));
|
|
5062
5819
|
};
|
|
5063
5820
|
Git2.prototype.tags = function(options, then) {
|
|
5064
5821
|
return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
|
|
@@ -5208,7 +5965,7 @@ var init_simple_git = __esmMin((() => {
|
|
|
5208
5965
|
});
|
|
5209
5966
|
};
|
|
5210
5967
|
Git2.prototype.clearQueue = function() {
|
|
5211
|
-
return this;
|
|
5968
|
+
return this._runTask(adhocExecTask2(() => console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")));
|
|
5212
5969
|
};
|
|
5213
5970
|
Git2.prototype.checkIgnore = function(pathnames, then) {
|
|
5214
5971
|
return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));
|
|
@@ -5218,7 +5975,6 @@ var init_simple_git = __esmMin((() => {
|
|
|
5218
5975
|
};
|
|
5219
5976
|
module.exports = Git2;
|
|
5220
5977
|
} });
|
|
5221
|
-
init_pathspec();
|
|
5222
5978
|
init_git_error();
|
|
5223
5979
|
GitConstructError = class extends GitError {
|
|
5224
5980
|
constructor(config, message) {
|
|
@@ -5286,14 +6042,13 @@ var init_simple_git = __esmMin((() => {
|
|
|
5286
6042
|
};
|
|
5287
6043
|
init_utils();
|
|
5288
6044
|
init_utils();
|
|
5289
|
-
init_pathspec();
|
|
5290
6045
|
init_utils();
|
|
5291
6046
|
Git = require_git();
|
|
5292
6047
|
init_git_response_error();
|
|
5293
6048
|
esm_default = gitInstanceFactory;
|
|
5294
6049
|
}));
|
|
5295
6050
|
//#endregion
|
|
5296
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
6051
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/xdg-basedir.mjs
|
|
5297
6052
|
var homeDirectory, env, xdgData, xdgConfig, xdgDataDirectories, xdgConfigDirectories;
|
|
5298
6053
|
var init_xdg_basedir = __esmMin((() => {
|
|
5299
6054
|
homeDirectory = os.homedir();
|
|
@@ -5309,7 +6064,7 @@ var init_xdg_basedir = __esmMin((() => {
|
|
|
5309
6064
|
if (xdgConfig) xdgConfigDirectories.unshift(xdgConfig);
|
|
5310
6065
|
}));
|
|
5311
6066
|
//#endregion
|
|
5312
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
6067
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/_chunks/libs/@vercel/detect-agent.mjs
|
|
5313
6068
|
var require_dist$1;
|
|
5314
6069
|
var init_detect_agent = __esmMin((() => {
|
|
5315
6070
|
init_rolldown_runtime();
|
|
@@ -5448,6 +6203,10 @@ var init_detect_agent = __esmMin((() => {
|
|
|
5448
6203
|
agent: void 0
|
|
5449
6204
|
};
|
|
5450
6205
|
}
|
|
6206
|
+
0 && (module.exports = {
|
|
6207
|
+
KNOWN_AGENTS,
|
|
6208
|
+
determineAgent
|
|
6209
|
+
});
|
|
5451
6210
|
}));
|
|
5452
6211
|
}));
|
|
5453
6212
|
//#endregion
|
|
@@ -12064,7 +12823,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin$1(((exports) => {
|
|
|
12064
12823
|
exports.visitAsync = visit.visitAsync;
|
|
12065
12824
|
}));
|
|
12066
12825
|
//#endregion
|
|
12067
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
12826
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/dist/cli.mjs
|
|
12068
12827
|
var cli_exports = /* @__PURE__ */ __exportAll({});
|
|
12069
12828
|
function getOwnerRepo(parsed) {
|
|
12070
12829
|
if (parsed.type === "local") return null;
|
|
@@ -12511,7 +13270,8 @@ function createGitClient(extraEnv) {
|
|
|
12511
13270
|
"filter.lfs.smudge=",
|
|
12512
13271
|
"filter.lfs.clean=",
|
|
12513
13272
|
"filter.lfs.process="
|
|
12514
|
-
]
|
|
13273
|
+
],
|
|
13274
|
+
unsafe: { allowUnsafeFilter: true }
|
|
12515
13275
|
});
|
|
12516
13276
|
}
|
|
12517
13277
|
async function resetTempDir(dir) {
|
|
@@ -12567,6 +13327,7 @@ function buildGitHubAuthError(url, repo, message) {
|
|
|
12567
13327
|
return `Authentication failed for ${url}.\n - For private repos, ensure you have access\n - For SSH: Check your keys with 'ssh -T git@github.com'\n - For HTTPS: Run 'gh auth login' or configure git credentials`;
|
|
12568
13328
|
}
|
|
12569
13329
|
async function cloneRepo(url, ref) {
|
|
13330
|
+
if (/^ext::/i.test(url)) throw new GitCloneError("Unsupported Git transport: ext", url);
|
|
12570
13331
|
const tempDir = await mkdtemp(join(tmpdir(), "skills-"));
|
|
12571
13332
|
const cloneOptions = ref ? [
|
|
12572
13333
|
"--depth",
|
|
@@ -12917,6 +13678,9 @@ function getOpenClawGlobalSkillsDir(homeDir = home, pathExists = existsSync) {
|
|
|
12917
13678
|
if (pathExists(join(homeDir, ".moltbot"))) return join(homeDir, ".moltbot/skills");
|
|
12918
13679
|
return join(homeDir, ".openclaw/skills");
|
|
12919
13680
|
}
|
|
13681
|
+
function isZCodeInstalled(homeDir = home, pathExists = existsSync) {
|
|
13682
|
+
return pathExists(join(homeDir, ".zcode")) || pathExists("/Applications/ZCode.app");
|
|
13683
|
+
}
|
|
12920
13684
|
async function detectInstalledAgents() {
|
|
12921
13685
|
return (await Promise.all(Object.entries(agents).map(async ([type, config]) => ({
|
|
12922
13686
|
type,
|
|
@@ -13091,7 +13855,7 @@ async function installSkillForAgent(skill, agentType, options = {}) {
|
|
|
13091
13855
|
mode: "symlink"
|
|
13092
13856
|
};
|
|
13093
13857
|
if (!isGlobal && !isUniversalAgent(agentType)) {
|
|
13094
|
-
if (!existsSync(join(cwd, agents[agentType].skillsDir.split("/")[0]))) return {
|
|
13858
|
+
if (!existsSync(join(cwd, agents[agentType].skillsDir.split("/")[0])) && agentType !== "claude-code") return {
|
|
13095
13859
|
success: true,
|
|
13096
13860
|
path: canonicalDir,
|
|
13097
13861
|
canonicalPath: canonicalDir,
|
|
@@ -13154,6 +13918,7 @@ async function copyDirectory(src, dest, agentType) {
|
|
|
13154
13918
|
dereference: true,
|
|
13155
13919
|
recursive: true
|
|
13156
13920
|
});
|
|
13921
|
+
await chmod(destPath, (await stat(srcPath)).mode & 511);
|
|
13157
13922
|
} catch (err) {
|
|
13158
13923
|
if (err instanceof Error && "code" in err && err.code === "ENOENT" && entry.isSymbolicLink()) console.warn(`Skipping broken symlink: ${srcPath}`);
|
|
13159
13924
|
else throw err;
|
|
@@ -13581,9 +14346,26 @@ async function flushTelemetry(timeoutMs = 5e3) {
|
|
|
13581
14346
|
const timeout = new Promise((resolve) => setTimeout(resolve, timeoutMs));
|
|
13582
14347
|
await Promise.race([Promise.all(pendingTelemetry), timeout]);
|
|
13583
14348
|
}
|
|
14349
|
+
function hasStrongCursorAgentSignal() {
|
|
14350
|
+
return Boolean(process.env.CURSOR_AGENT?.trim()) || process.env.CURSOR_EXTENSION_HOST_ROLE === "agent-exec";
|
|
14351
|
+
}
|
|
14352
|
+
function refineAgentResult(result) {
|
|
14353
|
+
if (!result.isAgent || !result.agent) return result;
|
|
14354
|
+
if (result.agent.name === "cursor" || result.agent.name === "cursor-cli") {
|
|
14355
|
+
if (!hasStrongCursorAgentSignal()) return {
|
|
14356
|
+
isAgent: false,
|
|
14357
|
+
agent: void 0
|
|
14358
|
+
};
|
|
14359
|
+
if (result.agent.name === "cursor") return {
|
|
14360
|
+
isAgent: true,
|
|
14361
|
+
agent: { name: "cursor-cli" }
|
|
14362
|
+
};
|
|
14363
|
+
}
|
|
14364
|
+
return result;
|
|
14365
|
+
}
|
|
13584
14366
|
async function detectAgent() {
|
|
13585
14367
|
if (cachedResult) return cachedResult;
|
|
13586
|
-
cachedResult = await (0, import_dist$1.determineAgent)();
|
|
14368
|
+
cachedResult = refineAgentResult(await (0, import_dist$1.determineAgent)());
|
|
13587
14369
|
if (cachedResult.isAgent) setDetectedAgent(cachedResult.agent.name);
|
|
13588
14370
|
return cachedResult;
|
|
13589
14371
|
}
|
|
@@ -13924,7 +14706,16 @@ async function isSourcePrivate(source) {
|
|
|
13924
14706
|
return isRepoPrivate(ownerRepo.owner, ownerRepo.repo);
|
|
13925
14707
|
}
|
|
13926
14708
|
function getLockSource(parsedUrl, normalizedSource) {
|
|
13927
|
-
|
|
14709
|
+
if (parsedUrl.startsWith("git@") || parsedUrl.startsWith("ssh://")) return parsedUrl;
|
|
14710
|
+
if (parsedUrl.startsWith("http://") || parsedUrl.startsWith("https://")) try {
|
|
14711
|
+
if (new URL(parsedUrl).hostname !== "github.com") return parsedUrl;
|
|
14712
|
+
} catch {
|
|
14713
|
+
return normalizedSource;
|
|
14714
|
+
}
|
|
14715
|
+
return normalizedSource;
|
|
14716
|
+
}
|
|
14717
|
+
function getProjectLockSourceUrl(sourceType, sourceUrl) {
|
|
14718
|
+
return sourceType === "git" || sourceType === "gitlab" ? sourceUrl : void 0;
|
|
13928
14719
|
}
|
|
13929
14720
|
function initTelemetry(version) {
|
|
13930
14721
|
setVersion(version);
|
|
@@ -14066,7 +14857,7 @@ function buildResultLines(results, targetAgents) {
|
|
|
14066
14857
|
return lines;
|
|
14067
14858
|
}
|
|
14068
14859
|
function multiselect(opts) {
|
|
14069
|
-
return
|
|
14860
|
+
return multiselect$1({
|
|
14070
14861
|
...opts,
|
|
14071
14862
|
options: opts.options,
|
|
14072
14863
|
message: `${opts.message} ${import_picocolors.default.dim("(space to toggle)")}`
|
|
@@ -14135,46 +14926,46 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14135
14926
|
const skills = await wellKnownProvider.fetchAllSkills(url);
|
|
14136
14927
|
if (skills.length === 0) {
|
|
14137
14928
|
spinner.stop(import_picocolors.default.red("No skills found"));
|
|
14138
|
-
|
|
14929
|
+
outro(import_picocolors.default.red("No skills found at this URL. Make sure the server has a /.well-known/agent-skills/index.json or /.well-known/skills/index.json file."));
|
|
14139
14930
|
process.exit(1);
|
|
14140
14931
|
}
|
|
14141
14932
|
spinner.stop(`Found ${import_picocolors.default.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
14142
14933
|
for (const skill of skills) {
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
if (skill.files.size > 1)
|
|
14934
|
+
log.info(`Skill: ${import_picocolors.default.cyan(skill.installName)}`);
|
|
14935
|
+
log.message(import_picocolors.default.dim(skill.description));
|
|
14936
|
+
if (skill.files.size > 1) log.message(import_picocolors.default.dim(` Files: ${Array.from(skill.files.keys()).join(", ")}`));
|
|
14146
14937
|
}
|
|
14147
14938
|
if (options.list) {
|
|
14148
14939
|
console.log();
|
|
14149
|
-
|
|
14940
|
+
log.step(import_picocolors.default.bold("Available Skills"));
|
|
14150
14941
|
for (const skill of skills) {
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
if (skill.files.size > 1)
|
|
14942
|
+
log.message(` ${import_picocolors.default.cyan(skill.installName)}`);
|
|
14943
|
+
log.message(` ${import_picocolors.default.dim(skill.description)}`);
|
|
14944
|
+
if (skill.files.size > 1) log.message(` ${import_picocolors.default.dim(`Files: ${skill.files.size}`)}`);
|
|
14154
14945
|
}
|
|
14155
14946
|
console.log();
|
|
14156
|
-
|
|
14947
|
+
outro("Run without --list to install");
|
|
14157
14948
|
process.exit(0);
|
|
14158
14949
|
}
|
|
14159
14950
|
let selectedSkills;
|
|
14160
14951
|
if (options.skill?.includes("*")) {
|
|
14161
14952
|
selectedSkills = skills;
|
|
14162
|
-
|
|
14953
|
+
log.info(`Installing all ${skills.length} skills`);
|
|
14163
14954
|
} else if (options.skill && options.skill.length > 0) {
|
|
14164
14955
|
selectedSkills = skills.filter((s) => options.skill.some((name) => s.installName.toLowerCase() === name.toLowerCase() || s.name.toLowerCase() === name.toLowerCase()));
|
|
14165
14956
|
if (selectedSkills.length === 0) {
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
for (const s of skills)
|
|
14957
|
+
log.error(`No matching skills found for: ${options.skill.join(", ")}`);
|
|
14958
|
+
log.info("Available skills:");
|
|
14959
|
+
for (const s of skills) log.message(` - ${s.installName}`);
|
|
14169
14960
|
process.exit(1);
|
|
14170
14961
|
}
|
|
14171
14962
|
} else if (skills.length === 1) {
|
|
14172
14963
|
selectedSkills = skills;
|
|
14173
14964
|
const firstSkill = skills[0];
|
|
14174
|
-
|
|
14965
|
+
log.info(`Skill: ${import_picocolors.default.cyan(firstSkill.installName)}`);
|
|
14175
14966
|
} else if (options.yes) {
|
|
14176
14967
|
selectedSkills = skills;
|
|
14177
|
-
|
|
14968
|
+
log.info(`Installing all ${skills.length} skills`);
|
|
14178
14969
|
} else {
|
|
14179
14970
|
const selected = await multiselect({
|
|
14180
14971
|
message: "Select skills to install",
|
|
@@ -14185,8 +14976,8 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14185
14976
|
})),
|
|
14186
14977
|
required: true
|
|
14187
14978
|
});
|
|
14188
|
-
if (
|
|
14189
|
-
|
|
14979
|
+
if (isCancel(selected)) {
|
|
14980
|
+
cancel("Installation cancelled");
|
|
14190
14981
|
process.exit(0);
|
|
14191
14982
|
}
|
|
14192
14983
|
selectedSkills = selected;
|
|
@@ -14195,12 +14986,12 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14195
14986
|
const validAgents = Object.keys(agents);
|
|
14196
14987
|
if (options.agent?.includes("*")) {
|
|
14197
14988
|
targetAgents = validAgents;
|
|
14198
|
-
|
|
14989
|
+
log.info(`Installing to all ${targetAgents.length} agents`);
|
|
14199
14990
|
} else if (options.agent && options.agent.length > 0) {
|
|
14200
14991
|
const invalidAgents = options.agent.filter((a) => !validAgents.includes(a));
|
|
14201
14992
|
if (invalidAgents.length > 0) {
|
|
14202
|
-
|
|
14203
|
-
|
|
14993
|
+
log.error(`Invalid agents: ${invalidAgents.join(", ")}`);
|
|
14994
|
+
log.info(`Valid agents: ${validAgents.join(", ")}`);
|
|
14204
14995
|
process.exit(1);
|
|
14205
14996
|
}
|
|
14206
14997
|
targetAgents = options.agent;
|
|
@@ -14211,15 +15002,15 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14211
15002
|
spinner.stop(`${totalAgents} agents`);
|
|
14212
15003
|
if (installedAgents.length === 0) if (options.yes) {
|
|
14213
15004
|
targetAgents = validAgents;
|
|
14214
|
-
|
|
15005
|
+
log.info("Installing to all agents");
|
|
14215
15006
|
} else {
|
|
14216
|
-
|
|
15007
|
+
log.info("Select agents to install skills to");
|
|
14217
15008
|
const selected = await promptForAgents("Which agents do you want to install to?", Object.entries(agents).map(([key, config]) => ({
|
|
14218
15009
|
value: key,
|
|
14219
15010
|
label: config.displayName
|
|
14220
15011
|
})));
|
|
14221
|
-
if (
|
|
14222
|
-
|
|
15012
|
+
if (isCancel(selected)) {
|
|
15013
|
+
cancel("Installation cancelled");
|
|
14223
15014
|
process.exit(0);
|
|
14224
15015
|
}
|
|
14225
15016
|
targetAgents = selected;
|
|
@@ -14228,12 +15019,12 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14228
15019
|
targetAgents = ensureUniversalAgents(installedAgents);
|
|
14229
15020
|
if (installedAgents.length === 1) {
|
|
14230
15021
|
const firstAgent = installedAgents[0];
|
|
14231
|
-
|
|
14232
|
-
} else
|
|
15022
|
+
log.info(`Installing to: ${import_picocolors.default.cyan(agents[firstAgent].displayName)}`);
|
|
15023
|
+
} else log.info(`Installing to: ${installedAgents.map((a) => import_picocolors.default.cyan(agents[a].displayName)).join(", ")}`);
|
|
14233
15024
|
} else {
|
|
14234
15025
|
const selected = await selectAgentsInteractive({ global: options.global });
|
|
14235
|
-
if (
|
|
14236
|
-
|
|
15026
|
+
if (isCancel(selected)) {
|
|
15027
|
+
cancel("Installation cancelled");
|
|
14237
15028
|
process.exit(0);
|
|
14238
15029
|
}
|
|
14239
15030
|
targetAgents = selected;
|
|
@@ -14242,7 +15033,7 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14242
15033
|
let installGlobally = options.global ?? false;
|
|
14243
15034
|
const supportsGlobal = targetAgents.some((a) => agents[a].globalSkillsDir !== void 0);
|
|
14244
15035
|
if (options.global === void 0 && !options.yes && supportsGlobal) {
|
|
14245
|
-
const scope = await
|
|
15036
|
+
const scope = await select({
|
|
14246
15037
|
message: "Installation scope",
|
|
14247
15038
|
options: [{
|
|
14248
15039
|
value: false,
|
|
@@ -14254,8 +15045,8 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14254
15045
|
hint: "Install in home directory (available across all projects)"
|
|
14255
15046
|
}]
|
|
14256
15047
|
});
|
|
14257
|
-
if (
|
|
14258
|
-
|
|
15048
|
+
if (isCancel(scope)) {
|
|
15049
|
+
cancel("Installation cancelled");
|
|
14259
15050
|
process.exit(0);
|
|
14260
15051
|
}
|
|
14261
15052
|
installGlobally = scope;
|
|
@@ -14263,7 +15054,7 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14263
15054
|
let installMode = options.copy ? "copy" : "symlink";
|
|
14264
15055
|
const uniqueDirs = new Set(targetAgents.map((a) => agents[a].skillsDir));
|
|
14265
15056
|
if (!options.copy && !options.yes && uniqueDirs.size > 1) {
|
|
14266
|
-
const modeChoice = await
|
|
15057
|
+
const modeChoice = await select({
|
|
14267
15058
|
message: "Installation method",
|
|
14268
15059
|
options: [{
|
|
14269
15060
|
value: "symlink",
|
|
@@ -14275,8 +15066,8 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14275
15066
|
hint: "Independent copies for each agent"
|
|
14276
15067
|
}]
|
|
14277
15068
|
});
|
|
14278
|
-
if (
|
|
14279
|
-
|
|
15069
|
+
if (isCancel(modeChoice)) {
|
|
15070
|
+
cancel("Installation cancelled");
|
|
14280
15071
|
process.exit(0);
|
|
14281
15072
|
}
|
|
14282
15073
|
installMode = modeChoice;
|
|
@@ -14305,11 +15096,11 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14305
15096
|
if (overwriteAgents.length > 0) summaryLines.push(` ${import_picocolors.default.yellow("overwrites:")} ${formatList$1(overwriteAgents)}`);
|
|
14306
15097
|
}
|
|
14307
15098
|
console.log();
|
|
14308
|
-
|
|
15099
|
+
note(summaryLines.join("\n"), "Installation Summary");
|
|
14309
15100
|
if (!options.yes) {
|
|
14310
|
-
const confirmed = await
|
|
14311
|
-
if (
|
|
14312
|
-
|
|
15101
|
+
const confirmed = await confirm({ message: "Proceed with installation?" });
|
|
15102
|
+
if (isCancel(confirmed) || !confirmed) {
|
|
15103
|
+
cancel("Installation cancelled");
|
|
14313
15104
|
process.exit(0);
|
|
14314
15105
|
}
|
|
14315
15106
|
}
|
|
@@ -14341,6 +15132,7 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14341
15132
|
agents: targetAgents.join(","),
|
|
14342
15133
|
...installGlobally && { global: "1" },
|
|
14343
15134
|
skillFiles: JSON.stringify(skillFiles),
|
|
15135
|
+
metadata: options.metadata,
|
|
14344
15136
|
sourceType: "well-known"
|
|
14345
15137
|
});
|
|
14346
15138
|
if (successful.length > 0 && installGlobally) {
|
|
@@ -14397,19 +15189,19 @@ async function handleWellKnownSkills(source, url, options, spinner) {
|
|
|
14397
15189
|
}
|
|
14398
15190
|
}
|
|
14399
15191
|
const title = import_picocolors.default.green(`Installed ${skillCount} skill${skillCount !== 1 ? "s" : ""}`);
|
|
14400
|
-
|
|
15192
|
+
note(resultLines.join("\n"), title);
|
|
14401
15193
|
if (symlinkFailures.length > 0) {
|
|
14402
|
-
|
|
14403
|
-
|
|
15194
|
+
log.warn(import_picocolors.default.yellow(`Symlinks failed for: ${formatList$1(copiedAgents)}`));
|
|
15195
|
+
log.message(import_picocolors.default.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support."));
|
|
14404
15196
|
}
|
|
14405
15197
|
}
|
|
14406
15198
|
if (failed.length > 0) {
|
|
14407
15199
|
console.log();
|
|
14408
|
-
|
|
14409
|
-
for (const r of failed)
|
|
15200
|
+
log.error(import_picocolors.default.red(`Failed to install ${failed.length}`));
|
|
15201
|
+
for (const r of failed) log.message(` ${import_picocolors.default.red("✗")} ${r.skill} → ${r.agent}: ${import_picocolors.default.dim(r.error)}`);
|
|
14410
15202
|
}
|
|
14411
15203
|
console.log();
|
|
14412
|
-
|
|
15204
|
+
outro(import_picocolors.default.green("Done!") + import_picocolors.default.dim(" Review skills before use; they run with full agent permissions."));
|
|
14413
15205
|
await promptForFindSkills(options, targetAgents);
|
|
14414
15206
|
}
|
|
14415
15207
|
async function runAdd(args, options = {}) {
|
|
@@ -14417,7 +15209,7 @@ async function runAdd(args, options = {}) {
|
|
|
14417
15209
|
let installTipShown = false;
|
|
14418
15210
|
const showInstallTip = () => {
|
|
14419
15211
|
if (installTipShown) return;
|
|
14420
|
-
|
|
15212
|
+
log.message(import_picocolors.default.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts."));
|
|
14421
15213
|
installTipShown = true;
|
|
14422
15214
|
};
|
|
14423
15215
|
if (!source) {
|
|
@@ -14446,15 +15238,15 @@ async function runAdd(args, options = {}) {
|
|
|
14446
15238
|
}
|
|
14447
15239
|
}
|
|
14448
15240
|
console.log();
|
|
14449
|
-
if (!agentResult.isAgent)
|
|
14450
|
-
if (agentResult.isAgent)
|
|
15241
|
+
if (!agentResult.isAgent) intro(import_picocolors.default.bgCyan(import_picocolors.default.black(" skills ")));
|
|
15242
|
+
if (agentResult.isAgent) log.info(import_picocolors.default.bgCyan(import_picocolors.default.black(import_picocolors.default.bold(` ${agentResult.agent.name} `))) + " Agent detected — installing non-interactively");
|
|
14451
15243
|
else if (!process.stdin.isTTY) showInstallTip();
|
|
14452
15244
|
let tempDir = null;
|
|
14453
15245
|
try {
|
|
14454
|
-
const spinner =
|
|
14455
|
-
spinner.start("Parsing source...");
|
|
15246
|
+
const spinner$3 = spinner();
|
|
15247
|
+
spinner$3.start("Parsing source...");
|
|
14456
15248
|
const parsed = parseSource(source);
|
|
14457
|
-
spinner.stop(`Source: ${parsed.type === "local" ? parsed.localPath : parsed.url}${parsed.ref ? ` @ ${import_picocolors.default.yellow(parsed.ref)}` : ""}${parsed.subpath ? ` (${parsed.subpath})` : ""}${parsed.skillFilter ? ` ${import_picocolors.default.dim("@")}${import_picocolors.default.cyan(parsed.skillFilter)}` : ""}`);
|
|
15249
|
+
spinner$3.stop(`Source: ${parsed.type === "local" ? parsed.localPath : parsed.url}${parsed.ref ? ` @ ${import_picocolors.default.yellow(parsed.ref)}` : ""}${parsed.subpath ? ` (${parsed.subpath})` : ""}${parsed.skillFilter ? ` ${import_picocolors.default.dim("@")}${import_picocolors.default.cyan(parsed.skillFilter)}` : ""}`);
|
|
14458
15250
|
const ownerRepoRaw = getOwnerRepo(parsed);
|
|
14459
15251
|
const repoPrivacyPromise = (() => {
|
|
14460
15252
|
if (!ownerRepoRaw) return Promise.resolve(null);
|
|
@@ -14463,7 +15255,7 @@ async function runAdd(args, options = {}) {
|
|
|
14463
15255
|
return isRepoPrivate(ownerRepo.owner, ownerRepo.repo).catch(() => null);
|
|
14464
15256
|
})();
|
|
14465
15257
|
if (parsed.type === "well-known") {
|
|
14466
|
-
await handleWellKnownSkills(source, parsed.url, options, spinner);
|
|
15258
|
+
await handleWellKnownSkills(source, parsed.url, options, spinner$3);
|
|
14467
15259
|
return;
|
|
14468
15260
|
}
|
|
14469
15261
|
if (parsed.skillFilter) {
|
|
@@ -14474,14 +15266,14 @@ async function runAdd(args, options = {}) {
|
|
|
14474
15266
|
let skills;
|
|
14475
15267
|
let blobResult = null;
|
|
14476
15268
|
if (parsed.type === "local") {
|
|
14477
|
-
spinner.start("Validating local path...");
|
|
15269
|
+
spinner$3.start("Validating local path...");
|
|
14478
15270
|
if (!existsSync(parsed.localPath)) {
|
|
14479
|
-
spinner.stop(import_picocolors.default.red("Path not found"));
|
|
14480
|
-
|
|
15271
|
+
spinner$3.stop(import_picocolors.default.red("Path not found"));
|
|
15272
|
+
outro(import_picocolors.default.red(`Local path does not exist: ${parsed.localPath}`));
|
|
14481
15273
|
process.exit(1);
|
|
14482
15274
|
}
|
|
14483
|
-
spinner.stop("Local path validated");
|
|
14484
|
-
spinner.start("Discovering skills...");
|
|
15275
|
+
spinner$3.stop("Local path validated");
|
|
15276
|
+
spinner$3.start("Discovering skills...");
|
|
14485
15277
|
skills = await discoverSkills(parsed.localPath, parsed.subpath, {
|
|
14486
15278
|
includeInternal,
|
|
14487
15279
|
fullDepth: options.fullDepth
|
|
@@ -14496,7 +15288,7 @@ async function runAdd(args, options = {}) {
|
|
|
14496
15288
|
const owner = ownerRepo?.split("/")[0]?.toLowerCase();
|
|
14497
15289
|
const isSelfHostedRepo = !!ownerRepo && Object.hasOwn(BLOB_ALLOWED_REPOS, ownerRepo.toLowerCase());
|
|
14498
15290
|
if (ownerRepo && owner && (isSelfHostedRepo || BLOB_ALLOWED_OWNERS.includes(owner))) {
|
|
14499
|
-
spinner.start("Fetching skills...");
|
|
15291
|
+
spinner$3.start("Fetching skills...");
|
|
14500
15292
|
blobResult = await tryBlobInstall(ownerRepo, {
|
|
14501
15293
|
subpath: parsed.subpath,
|
|
14502
15294
|
skillFilter: parsed.skillFilter,
|
|
@@ -14504,41 +15296,41 @@ async function runAdd(args, options = {}) {
|
|
|
14504
15296
|
getToken: getGitHubToken,
|
|
14505
15297
|
includeInternal
|
|
14506
15298
|
});
|
|
14507
|
-
if (!blobResult) spinner.stop(import_picocolors.default.dim("Falling back to clone..."));
|
|
15299
|
+
if (!blobResult) spinner$3.stop(import_picocolors.default.dim("Falling back to clone..."));
|
|
14508
15300
|
}
|
|
14509
15301
|
if (blobResult) {
|
|
14510
15302
|
skills = blobResult.skills;
|
|
14511
|
-
spinner.stop(`Found ${import_picocolors.default.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
15303
|
+
spinner$3.stop(`Found ${import_picocolors.default.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
14512
15304
|
} else {
|
|
14513
|
-
spinner.start("Cloning repository...");
|
|
15305
|
+
spinner$3.start("Cloning repository...");
|
|
14514
15306
|
tempDir = await cloneRepo(parsed.url, parsed.ref);
|
|
14515
|
-
spinner.stop("Repository cloned");
|
|
14516
|
-
spinner.start("Discovering skills...");
|
|
15307
|
+
spinner$3.stop("Repository cloned");
|
|
15308
|
+
spinner$3.start("Discovering skills...");
|
|
14517
15309
|
skills = await discoverSkills(tempDir, parsed.subpath, {
|
|
14518
15310
|
includeInternal,
|
|
14519
15311
|
fullDepth: options.fullDepth
|
|
14520
15312
|
});
|
|
14521
15313
|
}
|
|
14522
15314
|
} else {
|
|
14523
|
-
spinner.start("Cloning repository...");
|
|
15315
|
+
spinner$3.start("Cloning repository...");
|
|
14524
15316
|
tempDir = await cloneRepo(parsed.url, parsed.ref);
|
|
14525
|
-
spinner.stop("Repository cloned");
|
|
14526
|
-
spinner.start("Discovering skills...");
|
|
15317
|
+
spinner$3.stop("Repository cloned");
|
|
15318
|
+
spinner$3.start("Discovering skills...");
|
|
14527
15319
|
skills = await discoverSkills(tempDir, parsed.subpath, {
|
|
14528
15320
|
includeInternal,
|
|
14529
15321
|
fullDepth: options.fullDepth
|
|
14530
15322
|
});
|
|
14531
15323
|
}
|
|
14532
15324
|
if (skills.length === 0) {
|
|
14533
|
-
spinner.stop(import_picocolors.default.red("No skills found"));
|
|
14534
|
-
|
|
15325
|
+
spinner$3.stop(import_picocolors.default.red("No skills found"));
|
|
15326
|
+
outro(import_picocolors.default.red("No valid skills found. Skills require a SKILL.md with name and description."));
|
|
14535
15327
|
await cleanup(tempDir);
|
|
14536
15328
|
process.exit(1);
|
|
14537
15329
|
}
|
|
14538
|
-
if (!blobResult) spinner.stop(`Found ${import_picocolors.default.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
15330
|
+
if (!blobResult) spinner$3.stop(`Found ${import_picocolors.default.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
14539
15331
|
if (options.list) {
|
|
14540
15332
|
console.log();
|
|
14541
|
-
|
|
15333
|
+
log.step(import_picocolors.default.bold("Available Skills"));
|
|
14542
15334
|
const groupedSkills = {};
|
|
14543
15335
|
const ungroupedSkills = [];
|
|
14544
15336
|
for (const skill of skills) if (skill.pluginName) {
|
|
@@ -14551,45 +15343,45 @@ async function runAdd(args, options = {}) {
|
|
|
14551
15343
|
const title = group.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
14552
15344
|
console.log(import_picocolors.default.bold(title));
|
|
14553
15345
|
for (const skill of groupedSkills[group]) {
|
|
14554
|
-
|
|
14555
|
-
|
|
15346
|
+
log.message(` ${import_picocolors.default.cyan(getSkillDisplayName(skill))}`);
|
|
15347
|
+
log.message(` ${import_picocolors.default.dim(skill.description)}`);
|
|
14556
15348
|
}
|
|
14557
15349
|
console.log();
|
|
14558
15350
|
}
|
|
14559
15351
|
if (ungroupedSkills.length > 0) {
|
|
14560
15352
|
if (sortedGroups.length > 0) console.log(import_picocolors.default.bold("General"));
|
|
14561
15353
|
for (const skill of ungroupedSkills) {
|
|
14562
|
-
|
|
14563
|
-
|
|
15354
|
+
log.message(` ${import_picocolors.default.cyan(getSkillDisplayName(skill))}`);
|
|
15355
|
+
log.message(` ${import_picocolors.default.dim(skill.description)}`);
|
|
14564
15356
|
}
|
|
14565
15357
|
}
|
|
14566
15358
|
console.log();
|
|
14567
|
-
|
|
15359
|
+
outro("Use --skill <name> to install specific skills");
|
|
14568
15360
|
await cleanup(tempDir);
|
|
14569
15361
|
process.exit(0);
|
|
14570
15362
|
}
|
|
14571
15363
|
let selectedSkills;
|
|
14572
15364
|
if (options.skill?.includes("*")) {
|
|
14573
15365
|
selectedSkills = skills;
|
|
14574
|
-
|
|
15366
|
+
log.info(`Installing all ${skills.length} skills`);
|
|
14575
15367
|
} else if (options.skill && options.skill.length > 0) {
|
|
14576
15368
|
selectedSkills = filterSkills(skills, options.skill);
|
|
14577
15369
|
if (selectedSkills.length === 0) {
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
for (const s of skills)
|
|
15370
|
+
log.error(`No matching skills found for: ${options.skill.join(", ")}`);
|
|
15371
|
+
log.info("Available skills:");
|
|
15372
|
+
for (const s of skills) log.message(` - ${getSkillDisplayName(s)}`);
|
|
14581
15373
|
await cleanup(tempDir);
|
|
14582
15374
|
process.exit(1);
|
|
14583
15375
|
}
|
|
14584
|
-
|
|
15376
|
+
log.info(`Selected ${selectedSkills.length} skill${selectedSkills.length !== 1 ? "s" : ""}: ${selectedSkills.map((s) => import_picocolors.default.cyan(getSkillDisplayName(s))).join(", ")}`);
|
|
14585
15377
|
} else if (skills.length === 1) {
|
|
14586
15378
|
selectedSkills = skills;
|
|
14587
15379
|
const firstSkill = skills[0];
|
|
14588
|
-
|
|
14589
|
-
|
|
15380
|
+
log.info(`Skill: ${import_picocolors.default.cyan(getSkillDisplayName(firstSkill))}`);
|
|
15381
|
+
log.message(import_picocolors.default.dim(firstSkill.description));
|
|
14590
15382
|
} else if (options.yes) {
|
|
14591
15383
|
selectedSkills = skills;
|
|
14592
|
-
|
|
15384
|
+
log.info(`Installing all ${skills.length} skills`);
|
|
14593
15385
|
} else {
|
|
14594
15386
|
const sortedSkills = [...skills].sort((a, b) => {
|
|
14595
15387
|
if (a.pluginName && !b.pluginName) return -1;
|
|
@@ -14611,7 +15403,7 @@ async function runAdd(args, options = {}) {
|
|
|
14611
15403
|
hint: s.description.length > 60 ? s.description.slice(0, 57) + "..." : s.description
|
|
14612
15404
|
});
|
|
14613
15405
|
}
|
|
14614
|
-
selected = await
|
|
15406
|
+
selected = await groupMultiselect({
|
|
14615
15407
|
message: `Select skills to install ${import_picocolors.default.dim("(space to toggle)")}`,
|
|
14616
15408
|
options: grouped,
|
|
14617
15409
|
required: true
|
|
@@ -14625,8 +15417,8 @@ async function runAdd(args, options = {}) {
|
|
|
14625
15417
|
})),
|
|
14626
15418
|
required: true
|
|
14627
15419
|
});
|
|
14628
|
-
if (
|
|
14629
|
-
|
|
15420
|
+
if (isCancel(selected)) {
|
|
15421
|
+
cancel("Installation cancelled");
|
|
14630
15422
|
await cleanup(tempDir);
|
|
14631
15423
|
process.exit(0);
|
|
14632
15424
|
}
|
|
@@ -14638,38 +15430,38 @@ async function runAdd(args, options = {}) {
|
|
|
14638
15430
|
const validAgents = Object.keys(agents);
|
|
14639
15431
|
if (options.agent?.includes("*")) {
|
|
14640
15432
|
targetAgents = validAgents;
|
|
14641
|
-
|
|
15433
|
+
log.info(`Installing to all ${targetAgents.length} agents`);
|
|
14642
15434
|
} else if (options.agent && options.agent.length > 0) {
|
|
14643
15435
|
const invalidAgents = options.agent.filter((a) => !validAgents.includes(a));
|
|
14644
15436
|
if (invalidAgents.length > 0) {
|
|
14645
|
-
|
|
14646
|
-
|
|
15437
|
+
log.error(`Invalid agents: ${invalidAgents.join(", ")}`);
|
|
15438
|
+
log.info(`Valid agents: ${validAgents.join(", ")}`);
|
|
14647
15439
|
await cleanup(tempDir);
|
|
14648
15440
|
process.exit(1);
|
|
14649
15441
|
}
|
|
14650
15442
|
targetAgents = options.agent;
|
|
14651
15443
|
} else {
|
|
14652
|
-
spinner.start("Loading agents...");
|
|
15444
|
+
spinner$3.start("Loading agents...");
|
|
14653
15445
|
const installedAgents = await detectInstalledAgents();
|
|
14654
15446
|
const totalAgents = Object.keys(agents).length;
|
|
14655
|
-
spinner.stop(`${totalAgents} agents`);
|
|
15447
|
+
spinner$3.stop(`${totalAgents} agents`);
|
|
14656
15448
|
if (installedAgents.includes("eve") && (options.yes || !agentResult.isAgent)) {
|
|
14657
|
-
const useEve = options.yes ? true : await
|
|
15449
|
+
const useEve = options.yes ? true : await confirm({
|
|
14658
15450
|
message: formatEveInstallPromptMessage(selectedSkills),
|
|
14659
15451
|
initialValue: true
|
|
14660
15452
|
});
|
|
14661
|
-
if (
|
|
14662
|
-
|
|
15453
|
+
if (isCancel(useEve)) {
|
|
15454
|
+
cancel("Installation cancelled");
|
|
14663
15455
|
await cleanup(tempDir);
|
|
14664
15456
|
process.exit(0);
|
|
14665
15457
|
}
|
|
14666
15458
|
if (useEve) {
|
|
14667
15459
|
targetAgents = ["eve"];
|
|
14668
|
-
|
|
15460
|
+
log.info(`Installing to: ${import_picocolors.default.cyan(EVE_AGENT_LABEL)}`);
|
|
14669
15461
|
} else {
|
|
14670
15462
|
const selected = await selectAgentsInteractive({ global: options.global });
|
|
14671
|
-
if (
|
|
14672
|
-
|
|
15463
|
+
if (isCancel(selected)) {
|
|
15464
|
+
cancel("Installation cancelled");
|
|
14673
15465
|
await cleanup(tempDir);
|
|
14674
15466
|
process.exit(0);
|
|
14675
15467
|
}
|
|
@@ -14677,15 +15469,15 @@ async function runAdd(args, options = {}) {
|
|
|
14677
15469
|
}
|
|
14678
15470
|
} else if (installedAgents.length === 0) if (options.yes) {
|
|
14679
15471
|
targetAgents = validAgents;
|
|
14680
|
-
|
|
15472
|
+
log.info("Installing to all agents");
|
|
14681
15473
|
} else {
|
|
14682
|
-
|
|
15474
|
+
log.info("Select agents to install skills to");
|
|
14683
15475
|
const selected = await promptForAgents("Which agents do you want to install to?", Object.entries(agents).filter(([key]) => key !== "eve").map(([key, config]) => ({
|
|
14684
15476
|
value: key,
|
|
14685
15477
|
label: config.displayName
|
|
14686
15478
|
})));
|
|
14687
|
-
if (
|
|
14688
|
-
|
|
15479
|
+
if (isCancel(selected)) {
|
|
15480
|
+
cancel("Installation cancelled");
|
|
14689
15481
|
await cleanup(tempDir);
|
|
14690
15482
|
process.exit(0);
|
|
14691
15483
|
}
|
|
@@ -14695,12 +15487,12 @@ async function runAdd(args, options = {}) {
|
|
|
14695
15487
|
targetAgents = ensureUniversalAgents(installedAgents);
|
|
14696
15488
|
if (installedAgents.length === 1) {
|
|
14697
15489
|
const firstAgent = installedAgents[0];
|
|
14698
|
-
|
|
14699
|
-
} else
|
|
15490
|
+
log.info(`Installing to: ${import_picocolors.default.cyan(agents[firstAgent].displayName)}`);
|
|
15491
|
+
} else log.info(`Installing to: ${installedAgents.map((a) => import_picocolors.default.cyan(agents[a].displayName)).join(", ")}`);
|
|
14700
15492
|
} else {
|
|
14701
15493
|
const selected = await selectAgentsInteractive({ global: options.global });
|
|
14702
|
-
if (
|
|
14703
|
-
|
|
15494
|
+
if (isCancel(selected)) {
|
|
15495
|
+
cancel("Installation cancelled");
|
|
14704
15496
|
await cleanup(tempDir);
|
|
14705
15497
|
process.exit(0);
|
|
14706
15498
|
}
|
|
@@ -14713,7 +15505,7 @@ async function runAdd(args, options = {}) {
|
|
|
14713
15505
|
const availableSubagents = getEveSubagents(process.cwd());
|
|
14714
15506
|
if (options.subagent && options.subagent.length > 0) eveSubagentTargets = options.subagent.map((s) => s === "root" || s === "." ? void 0 : s);
|
|
14715
15507
|
else if (availableSubagents.length > 0 && !options.yes) {
|
|
14716
|
-
const selectedSubagents = await
|
|
15508
|
+
const selectedSubagents = await multiselect$1({
|
|
14717
15509
|
message: "Where should Eve skills be installed?",
|
|
14718
15510
|
options: [{
|
|
14719
15511
|
value: "",
|
|
@@ -14727,8 +15519,8 @@ async function runAdd(args, options = {}) {
|
|
|
14727
15519
|
initialValues: [""],
|
|
14728
15520
|
required: true
|
|
14729
15521
|
});
|
|
14730
|
-
if (
|
|
14731
|
-
|
|
15522
|
+
if (isCancel(selectedSubagents)) {
|
|
15523
|
+
cancel("Installation cancelled");
|
|
14732
15524
|
await cleanup(tempDir);
|
|
14733
15525
|
process.exit(0);
|
|
14734
15526
|
}
|
|
@@ -14739,7 +15531,7 @@ async function runAdd(args, options = {}) {
|
|
|
14739
15531
|
let installGlobally = options.global ?? false;
|
|
14740
15532
|
const supportsGlobal = targetAgents.some((a) => agents[a].globalSkillsDir !== void 0);
|
|
14741
15533
|
if (options.global === void 0 && !options.yes && supportsGlobal) {
|
|
14742
|
-
const scope = await
|
|
15534
|
+
const scope = await select({
|
|
14743
15535
|
message: "Installation scope",
|
|
14744
15536
|
options: [{
|
|
14745
15537
|
value: false,
|
|
@@ -14751,8 +15543,8 @@ async function runAdd(args, options = {}) {
|
|
|
14751
15543
|
hint: "Install in home directory (available across all projects)"
|
|
14752
15544
|
}]
|
|
14753
15545
|
});
|
|
14754
|
-
if (
|
|
14755
|
-
|
|
15546
|
+
if (isCancel(scope)) {
|
|
15547
|
+
cancel("Installation cancelled");
|
|
14756
15548
|
await cleanup(tempDir);
|
|
14757
15549
|
process.exit(0);
|
|
14758
15550
|
}
|
|
@@ -14762,7 +15554,7 @@ async function runAdd(args, options = {}) {
|
|
|
14762
15554
|
const allEve = installTargets.every((t) => t.agent === "eve");
|
|
14763
15555
|
const uniqueDirs = new Set(installTargets.map((t) => t.subagent ? `eve:subagent:${t.subagent}` : agents[t.agent].skillsDir));
|
|
14764
15556
|
if (!options.copy && !options.yes && uniqueDirs.size > 1 && !allEve) {
|
|
14765
|
-
const modeChoice = await
|
|
15557
|
+
const modeChoice = await select({
|
|
14766
15558
|
message: "Installation method",
|
|
14767
15559
|
options: [{
|
|
14768
15560
|
value: "symlink",
|
|
@@ -14774,8 +15566,8 @@ async function runAdd(args, options = {}) {
|
|
|
14774
15566
|
hint: "Independent copies for each agent"
|
|
14775
15567
|
}]
|
|
14776
15568
|
});
|
|
14777
|
-
if (
|
|
14778
|
-
|
|
15569
|
+
if (isCancel(modeChoice)) {
|
|
15570
|
+
cancel("Installation cancelled");
|
|
14779
15571
|
await cleanup(tempDir);
|
|
14780
15572
|
process.exit(0);
|
|
14781
15573
|
}
|
|
@@ -14833,7 +15625,7 @@ async function runAdd(args, options = {}) {
|
|
|
14833
15625
|
printSkillSummary(ungroupedSummary);
|
|
14834
15626
|
}
|
|
14835
15627
|
console.log();
|
|
14836
|
-
|
|
15628
|
+
note(summaryLines.join("\n"), "Installation Summary");
|
|
14837
15629
|
try {
|
|
14838
15630
|
const auditData = await auditPromise;
|
|
14839
15631
|
if (auditData && ownerRepoForAudit) {
|
|
@@ -14841,18 +15633,18 @@ async function runAdd(args, options = {}) {
|
|
|
14841
15633
|
slug: getSkillDisplayName(s),
|
|
14842
15634
|
displayName: getSkillDisplayName(s)
|
|
14843
15635
|
})), ownerRepoForAudit);
|
|
14844
|
-
if (securityLines.length > 0)
|
|
15636
|
+
if (securityLines.length > 0) note(securityLines.join("\n"), "Security Risk Assessments");
|
|
14845
15637
|
}
|
|
14846
15638
|
} catch {}
|
|
14847
15639
|
if (!options.yes) {
|
|
14848
|
-
const confirmed = await
|
|
14849
|
-
if (
|
|
14850
|
-
|
|
15640
|
+
const confirmed = await confirm({ message: "Proceed with installation?" });
|
|
15641
|
+
if (isCancel(confirmed) || !confirmed) {
|
|
15642
|
+
cancel("Installation cancelled");
|
|
14851
15643
|
await cleanup(tempDir);
|
|
14852
15644
|
process.exit(0);
|
|
14853
15645
|
}
|
|
14854
15646
|
}
|
|
14855
|
-
spinner.start("Installing skills...");
|
|
15647
|
+
spinner$3.start("Installing skills...");
|
|
14856
15648
|
const results = [];
|
|
14857
15649
|
for (const skill of selectedSkills) for (const target of installTargets) {
|
|
14858
15650
|
const { agent, subagent } = target;
|
|
@@ -14889,7 +15681,7 @@ async function runAdd(args, options = {}) {
|
|
|
14889
15681
|
...result
|
|
14890
15682
|
});
|
|
14891
15683
|
}
|
|
14892
|
-
spinner.stop("Installation complete");
|
|
15684
|
+
spinner$3.stop("Installation complete");
|
|
14893
15685
|
console.log();
|
|
14894
15686
|
const successful = results.filter((r) => r.success);
|
|
14895
15687
|
const failed = results.filter((r) => !r.success);
|
|
@@ -14900,6 +15692,7 @@ async function runAdd(args, options = {}) {
|
|
|
14900
15692
|
else continue;
|
|
14901
15693
|
const normalizedSource = getOwnerRepo(parsed);
|
|
14902
15694
|
const lockSource = getLockSource(parsed.url, normalizedSource);
|
|
15695
|
+
const projectLockSourceUrl = getProjectLockSourceUrl(parsed.type, parsed.url);
|
|
14903
15696
|
if (normalizedSource) if (parseOwnerRepo(normalizedSource)) {
|
|
14904
15697
|
if (await repoPrivacyPromise === false) track({
|
|
14905
15698
|
event: "install",
|
|
@@ -14907,7 +15700,8 @@ async function runAdd(args, options = {}) {
|
|
|
14907
15700
|
skills: selectedSkills.map((s) => s.name).join(","),
|
|
14908
15701
|
agents: targetAgents.join(","),
|
|
14909
15702
|
...installGlobally && { global: "1" },
|
|
14910
|
-
skillFiles: JSON.stringify(skillFiles)
|
|
15703
|
+
skillFiles: JSON.stringify(skillFiles),
|
|
15704
|
+
metadata: options.metadata
|
|
14911
15705
|
});
|
|
14912
15706
|
} else track({
|
|
14913
15707
|
event: "install",
|
|
@@ -14915,7 +15709,8 @@ async function runAdd(args, options = {}) {
|
|
|
14915
15709
|
skills: selectedSkills.map((s) => s.name).join(","),
|
|
14916
15710
|
agents: targetAgents.join(","),
|
|
14917
15711
|
...installGlobally && { global: "1" },
|
|
14918
|
-
skillFiles: JSON.stringify(skillFiles)
|
|
15712
|
+
skillFiles: JSON.stringify(skillFiles),
|
|
15713
|
+
metadata: options.metadata
|
|
14919
15714
|
});
|
|
14920
15715
|
if (successful.length > 0 && installGlobally && normalizedSource) {
|
|
14921
15716
|
const successfulSkillNames = new Set(successful.map((r) => r.skill));
|
|
@@ -14959,6 +15754,7 @@ async function runAdd(args, options = {}) {
|
|
|
14959
15754
|
const skillPathValue = skillFiles[skill.name];
|
|
14960
15755
|
await addSkillToLocalLock(skill.name, {
|
|
14961
15756
|
source: lockSource || parsed.url,
|
|
15757
|
+
...projectLockSourceUrl && { sourceUrl: projectLockSourceUrl },
|
|
14962
15758
|
ref: parsed.ref,
|
|
14963
15759
|
sourceType: parsed.type,
|
|
14964
15760
|
...skillPathValue && { skillPath: skillPathValue },
|
|
@@ -15020,27 +15816,27 @@ async function runAdd(args, options = {}) {
|
|
|
15020
15816
|
printSkillResults(ungroupedResults);
|
|
15021
15817
|
}
|
|
15022
15818
|
const title = import_picocolors.default.green(`Installed ${skillCount} skill${skillCount !== 1 ? "s" : ""}`);
|
|
15023
|
-
|
|
15819
|
+
note(resultLines.join("\n"), title);
|
|
15024
15820
|
if (symlinkFailures.length > 0) {
|
|
15025
|
-
|
|
15026
|
-
|
|
15821
|
+
log.warn(import_picocolors.default.yellow(`Symlinks failed for: ${formatList$1(copiedAgents)}`));
|
|
15822
|
+
log.message(import_picocolors.default.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support."));
|
|
15027
15823
|
}
|
|
15028
15824
|
}
|
|
15029
15825
|
if (failed.length > 0) {
|
|
15030
15826
|
console.log();
|
|
15031
|
-
|
|
15032
|
-
for (const r of failed)
|
|
15827
|
+
log.error(import_picocolors.default.red(`Failed to install ${failed.length}`));
|
|
15828
|
+
for (const r of failed) log.message(` ${import_picocolors.default.red("✗")} ${r.skill} → ${r.agent}: ${import_picocolors.default.dim(r.error)}`);
|
|
15033
15829
|
}
|
|
15034
15830
|
console.log();
|
|
15035
|
-
|
|
15831
|
+
outro(import_picocolors.default.green("Done!") + import_picocolors.default.dim(" Review skills before use; they run with full agent permissions."));
|
|
15036
15832
|
await promptForFindSkills(options, targetAgents);
|
|
15037
15833
|
} catch (error) {
|
|
15038
15834
|
if (error instanceof GitCloneError) {
|
|
15039
|
-
|
|
15040
|
-
for (const line of error.message.split("\n"))
|
|
15041
|
-
} else
|
|
15835
|
+
log.error(import_picocolors.default.red("Failed to clone repository"));
|
|
15836
|
+
for (const line of error.message.split("\n")) log.message(import_picocolors.default.dim(line));
|
|
15837
|
+
} else log.error(error instanceof Error ? error.message : "Unknown error occurred");
|
|
15042
15838
|
showInstallTip();
|
|
15043
|
-
|
|
15839
|
+
outro(import_picocolors.default.red("Installation failed"));
|
|
15044
15840
|
process.exit(1);
|
|
15045
15841
|
} finally {
|
|
15046
15842
|
await cleanup(tempDir);
|
|
@@ -15061,9 +15857,9 @@ async function promptForFindSkills(options, targetAgents) {
|
|
|
15061
15857
|
return;
|
|
15062
15858
|
}
|
|
15063
15859
|
console.log();
|
|
15064
|
-
|
|
15065
|
-
const install = await
|
|
15066
|
-
if (
|
|
15860
|
+
log.message(import_picocolors.default.dim("One-time prompt - you won't be asked again if you dismiss."));
|
|
15861
|
+
const install = await confirm({ message: `Install the ${import_picocolors.default.cyan("find-skills")} skill? It helps your agent discover and suggest skills.` });
|
|
15862
|
+
if (isCancel(install)) {
|
|
15067
15863
|
await dismissPrompt("findSkillsPrompt");
|
|
15068
15864
|
return;
|
|
15069
15865
|
}
|
|
@@ -15072,7 +15868,7 @@ async function promptForFindSkills(options, targetAgents) {
|
|
|
15072
15868
|
const findSkillsAgents = targetAgents?.filter((a) => a !== "replit");
|
|
15073
15869
|
if (!findSkillsAgents || findSkillsAgents.length === 0) return;
|
|
15074
15870
|
console.log();
|
|
15075
|
-
|
|
15871
|
+
log.step("Installing find-skills skill...");
|
|
15076
15872
|
try {
|
|
15077
15873
|
await runAdd(["vercel-labs/skills"], {
|
|
15078
15874
|
skill: ["find-skills"],
|
|
@@ -15081,18 +15877,19 @@ async function promptForFindSkills(options, targetAgents) {
|
|
|
15081
15877
|
agent: findSkillsAgents
|
|
15082
15878
|
});
|
|
15083
15879
|
} catch {
|
|
15084
|
-
|
|
15085
|
-
|
|
15880
|
+
log.warn("Failed to install find-skills. You can try again with:");
|
|
15881
|
+
log.message(import_picocolors.default.dim(" npx skills add vercel-labs/skills@find-skills -g -y --all"));
|
|
15086
15882
|
}
|
|
15087
15883
|
} else {
|
|
15088
15884
|
await dismissPrompt("findSkillsPrompt");
|
|
15089
|
-
|
|
15885
|
+
log.message(import_picocolors.default.dim("You can install it later with: npx skills add vercel-labs/skills@find-skills"));
|
|
15090
15886
|
}
|
|
15091
15887
|
} catch {}
|
|
15092
15888
|
}
|
|
15093
15889
|
function parseAddOptions(args) {
|
|
15094
15890
|
const options = {};
|
|
15095
15891
|
const source = [];
|
|
15892
|
+
const errors = [];
|
|
15096
15893
|
for (let i = 0; i < args.length; i++) {
|
|
15097
15894
|
const arg = args[i];
|
|
15098
15895
|
if (arg === "-g" || arg === "--global") options.global = true;
|
|
@@ -15119,6 +15916,15 @@ function parseAddOptions(args) {
|
|
|
15119
15916
|
nextArg = args[i];
|
|
15120
15917
|
}
|
|
15121
15918
|
i--;
|
|
15919
|
+
} else if (arg === "--metadata") {
|
|
15920
|
+
const metadata = args[++i];
|
|
15921
|
+
if (metadata === void 0) errors.push("--metadata requires a JSON value");
|
|
15922
|
+
else try {
|
|
15923
|
+
JSON.parse(metadata);
|
|
15924
|
+
options.metadata = metadata;
|
|
15925
|
+
} catch {
|
|
15926
|
+
errors.push("--metadata must be valid JSON");
|
|
15927
|
+
}
|
|
15122
15928
|
} else if (arg === "--full-depth") options.fullDepth = true;
|
|
15123
15929
|
else if (arg === "--copy") options.copy = true;
|
|
15124
15930
|
else if (arg === "--subagent") {
|
|
@@ -15135,7 +15941,8 @@ function parseAddOptions(args) {
|
|
|
15135
15941
|
}
|
|
15136
15942
|
return {
|
|
15137
15943
|
source,
|
|
15138
|
-
options
|
|
15944
|
+
options,
|
|
15945
|
+
errors
|
|
15139
15946
|
};
|
|
15140
15947
|
}
|
|
15141
15948
|
function formatInstalls(count) {
|
|
@@ -15487,27 +16294,27 @@ async function runSync(args, options = {}) {
|
|
|
15487
16294
|
}
|
|
15488
16295
|
}
|
|
15489
16296
|
console.log();
|
|
15490
|
-
if (!agentResult.isAgent)
|
|
15491
|
-
if (agentResult.isAgent)
|
|
15492
|
-
const spinner =
|
|
15493
|
-
spinner.start("Scanning node_modules for skills...");
|
|
16297
|
+
if (!agentResult.isAgent) intro(import_picocolors.default.bgCyan(import_picocolors.default.black(" skills experimental_sync ")));
|
|
16298
|
+
if (agentResult.isAgent) log.info(import_picocolors.default.bgCyan(import_picocolors.default.black(import_picocolors.default.bold(` ${agentResult.agent.name} `))) + " Agent detected — installing non-interactively");
|
|
16299
|
+
const spinner$2 = spinner();
|
|
16300
|
+
spinner$2.start("Scanning node_modules for skills...");
|
|
15494
16301
|
const discoveredSkills = await discoverNodeModuleSkills(cwd);
|
|
15495
16302
|
if (discoveredSkills.length === 0) {
|
|
15496
|
-
spinner.stop(import_picocolors.default.yellow("No skills found"));
|
|
15497
|
-
|
|
16303
|
+
spinner$2.stop(import_picocolors.default.yellow("No skills found"));
|
|
16304
|
+
outro(import_picocolors.default.dim("No SKILL.md files found in node_modules."));
|
|
15498
16305
|
return;
|
|
15499
16306
|
}
|
|
15500
|
-
spinner.stop(`Found ${import_picocolors.default.green(String(discoveredSkills.length))} skill${discoveredSkills.length > 1 ? "s" : ""} in node_modules`);
|
|
16307
|
+
spinner$2.stop(`Found ${import_picocolors.default.green(String(discoveredSkills.length))} skill${discoveredSkills.length > 1 ? "s" : ""} in node_modules`);
|
|
15501
16308
|
for (const skill of discoveredSkills) {
|
|
15502
|
-
|
|
15503
|
-
if (skill.description)
|
|
16309
|
+
log.info(`${import_picocolors.default.cyan(skill.name)} ${import_picocolors.default.dim(`from ${skill.packageName}`)}`);
|
|
16310
|
+
if (skill.description) log.message(import_picocolors.default.dim(` ${skill.description}`));
|
|
15504
16311
|
}
|
|
15505
16312
|
const localLock = await readLocalLock(cwd);
|
|
15506
16313
|
const toInstall = [];
|
|
15507
16314
|
const upToDate = [];
|
|
15508
16315
|
if (options.force) {
|
|
15509
16316
|
toInstall.push(...discoveredSkills);
|
|
15510
|
-
|
|
16317
|
+
log.info(import_picocolors.default.dim("Force mode: reinstalling all skills"));
|
|
15511
16318
|
} else {
|
|
15512
16319
|
for (const skill of discoveredSkills) {
|
|
15513
16320
|
const existingEntry = localLock.skills[skill.name];
|
|
@@ -15519,37 +16326,37 @@ async function runSync(args, options = {}) {
|
|
|
15519
16326
|
}
|
|
15520
16327
|
toInstall.push(skill);
|
|
15521
16328
|
}
|
|
15522
|
-
if (upToDate.length > 0)
|
|
16329
|
+
if (upToDate.length > 0) log.info(import_picocolors.default.dim(`${upToDate.length} skill${upToDate.length !== 1 ? "s" : ""} already up to date`));
|
|
15523
16330
|
if (toInstall.length === 0) {
|
|
15524
16331
|
console.log();
|
|
15525
|
-
|
|
16332
|
+
outro(import_picocolors.default.green("All skills are up to date."));
|
|
15526
16333
|
return;
|
|
15527
16334
|
}
|
|
15528
16335
|
}
|
|
15529
|
-
|
|
16336
|
+
log.info(`${toInstall.length} skill${toInstall.length !== 1 ? "s" : ""} to install/update`);
|
|
15530
16337
|
let targetAgents;
|
|
15531
16338
|
const validAgents = Object.keys(agents);
|
|
15532
16339
|
const universalAgents = getUniversalAgents();
|
|
15533
16340
|
const visibleUniversalAgents = getVisibleUniversalAgents();
|
|
15534
16341
|
if (options.agent?.includes("*")) {
|
|
15535
16342
|
targetAgents = validAgents;
|
|
15536
|
-
|
|
16343
|
+
log.info(`Installing to all ${targetAgents.length} agents`);
|
|
15537
16344
|
} else if (options.agent && options.agent.length > 0) {
|
|
15538
16345
|
const invalidAgents = options.agent.filter((a) => !validAgents.includes(a));
|
|
15539
16346
|
if (invalidAgents.length > 0) {
|
|
15540
|
-
|
|
15541
|
-
|
|
16347
|
+
log.error(`Invalid agents: ${invalidAgents.join(", ")}`);
|
|
16348
|
+
log.info(`Valid agents: ${validAgents.join(", ")}`);
|
|
15542
16349
|
process.exit(1);
|
|
15543
16350
|
}
|
|
15544
16351
|
targetAgents = options.agent;
|
|
15545
16352
|
} else {
|
|
15546
|
-
spinner.start("Loading agents...");
|
|
16353
|
+
spinner$2.start("Loading agents...");
|
|
15547
16354
|
const installedAgents = await detectInstalledAgents();
|
|
15548
16355
|
const totalAgents = Object.keys(agents).length;
|
|
15549
|
-
spinner.stop(`${totalAgents} agents`);
|
|
16356
|
+
spinner$2.stop(`${totalAgents} agents`);
|
|
15550
16357
|
if (installedAgents.length === 0) if (options.yes) {
|
|
15551
16358
|
targetAgents = universalAgents;
|
|
15552
|
-
|
|
16359
|
+
log.info("Installing to universal agents");
|
|
15553
16360
|
} else {
|
|
15554
16361
|
const selected = await searchMultiselect({
|
|
15555
16362
|
message: "Which agents do you want to install to?",
|
|
@@ -15569,7 +16376,7 @@ async function runSync(args, options = {}) {
|
|
|
15569
16376
|
}
|
|
15570
16377
|
});
|
|
15571
16378
|
if (isCancelled(selected)) {
|
|
15572
|
-
|
|
16379
|
+
cancel("Sync cancelled");
|
|
15573
16380
|
process.exit(0);
|
|
15574
16381
|
}
|
|
15575
16382
|
targetAgents = selected;
|
|
@@ -15596,7 +16403,7 @@ async function runSync(args, options = {}) {
|
|
|
15596
16403
|
}
|
|
15597
16404
|
});
|
|
15598
16405
|
if (isCancelled(selected)) {
|
|
15599
|
-
|
|
16406
|
+
cancel("Sync cancelled");
|
|
15600
16407
|
process.exit(0);
|
|
15601
16408
|
}
|
|
15602
16409
|
targetAgents = selected;
|
|
@@ -15609,15 +16416,15 @@ async function runSync(args, options = {}) {
|
|
|
15609
16416
|
summaryLines.push(` ${import_picocolors.default.dim(shortCanonical)}`);
|
|
15610
16417
|
}
|
|
15611
16418
|
console.log();
|
|
15612
|
-
|
|
16419
|
+
note(summaryLines.join("\n"), "Sync Summary");
|
|
15613
16420
|
if (!options.yes) {
|
|
15614
|
-
const confirmed = await
|
|
15615
|
-
if (
|
|
15616
|
-
|
|
16421
|
+
const confirmed = await confirm({ message: "Proceed with sync?" });
|
|
16422
|
+
if (isCancel(confirmed) || !confirmed) {
|
|
16423
|
+
cancel("Sync cancelled");
|
|
15617
16424
|
process.exit(0);
|
|
15618
16425
|
}
|
|
15619
16426
|
}
|
|
15620
|
-
spinner.start("Syncing skills...");
|
|
16427
|
+
spinner$2.start("Syncing skills...");
|
|
15621
16428
|
const results = [];
|
|
15622
16429
|
for (const skill of toInstall) for (const agent of targetAgents) {
|
|
15623
16430
|
const result = await installSkillForAgent(skill, agent, {
|
|
@@ -15635,7 +16442,7 @@ async function runSync(args, options = {}) {
|
|
|
15635
16442
|
error: result.error
|
|
15636
16443
|
});
|
|
15637
16444
|
}
|
|
15638
|
-
spinner.stop("Sync complete");
|
|
16445
|
+
spinner$2.stop("Sync complete");
|
|
15639
16446
|
const successful = results.filter((r) => r.success);
|
|
15640
16447
|
const failed = results.filter((r) => !r.success);
|
|
15641
16448
|
const successfulSkillNames = new Set(successful.map((r) => r.skill));
|
|
@@ -15667,12 +16474,12 @@ async function runSync(args, options = {}) {
|
|
|
15667
16474
|
}
|
|
15668
16475
|
const skillCount = bySkill.size;
|
|
15669
16476
|
const title = import_picocolors.default.green(`Synced ${skillCount} skill${skillCount !== 1 ? "s" : ""}`);
|
|
15670
|
-
|
|
16477
|
+
note(resultLines.join("\n"), title);
|
|
15671
16478
|
}
|
|
15672
16479
|
if (failed.length > 0) {
|
|
15673
16480
|
console.log();
|
|
15674
|
-
|
|
15675
|
-
for (const r of failed)
|
|
16481
|
+
log.error(import_picocolors.default.red(`Failed to install ${failed.length}`));
|
|
16482
|
+
for (const r of failed) log.message(` ${import_picocolors.default.red("✗")} ${r.skill} → ${r.agent}: ${import_picocolors.default.dim(r.error)}`);
|
|
15676
16483
|
}
|
|
15677
16484
|
track({
|
|
15678
16485
|
event: "experimental_sync",
|
|
@@ -15681,7 +16488,7 @@ async function runSync(args, options = {}) {
|
|
|
15681
16488
|
agents: targetAgents.join(",")
|
|
15682
16489
|
});
|
|
15683
16490
|
console.log();
|
|
15684
|
-
|
|
16491
|
+
outro(import_picocolors.default.green("Done!") + import_picocolors.default.dim(" Review skills before use; they run with full agent permissions."));
|
|
15685
16492
|
}
|
|
15686
16493
|
function parseSyncOptions(args) {
|
|
15687
16494
|
const options = {};
|
|
@@ -15703,12 +16510,64 @@ function parseSyncOptions(args) {
|
|
|
15703
16510
|
}
|
|
15704
16511
|
return { options };
|
|
15705
16512
|
}
|
|
16513
|
+
function formatSourceInput(sourceUrl, ref) {
|
|
16514
|
+
if (!ref) return sourceUrl;
|
|
16515
|
+
return `${sourceUrl}#${ref}`;
|
|
16516
|
+
}
|
|
16517
|
+
function deriveSkillFolder(skillPath) {
|
|
16518
|
+
let folder = skillPath;
|
|
16519
|
+
if (folder.endsWith("/SKILL.md")) folder = folder.slice(0, -9);
|
|
16520
|
+
else if (folder.endsWith("SKILL.md")) folder = folder.slice(0, -8);
|
|
16521
|
+
if (folder.endsWith("/")) folder = folder.slice(0, -1);
|
|
16522
|
+
return folder;
|
|
16523
|
+
}
|
|
16524
|
+
function supportsAppendedSubpath(source) {
|
|
16525
|
+
if (source.startsWith("git@")) return false;
|
|
16526
|
+
if (source.endsWith(".git")) return false;
|
|
16527
|
+
if (source.startsWith("http://") || source.startsWith("https://")) try {
|
|
16528
|
+
const host = new URL(source).hostname;
|
|
16529
|
+
return host === "github.com" || host === "gitlab.com";
|
|
16530
|
+
} catch {
|
|
16531
|
+
return false;
|
|
16532
|
+
}
|
|
16533
|
+
return true;
|
|
16534
|
+
}
|
|
16535
|
+
function isBareShorthand(source) {
|
|
16536
|
+
return !source.includes(":") && !source.startsWith(".") && !source.startsWith("/");
|
|
16537
|
+
}
|
|
16538
|
+
function getLocalSource(entry) {
|
|
16539
|
+
if (entry.sourceUrl) return entry.sourceUrl;
|
|
16540
|
+
if ((entry.sourceType === "git" || entry.sourceType === "gitlab") && isBareShorthand(entry.source)) return null;
|
|
16541
|
+
return entry.source;
|
|
16542
|
+
}
|
|
16543
|
+
function appendFolderAndRef(source, skillPath, ref) {
|
|
16544
|
+
if (!supportsAppendedSubpath(source)) return formatSourceInput(source, ref);
|
|
16545
|
+
const folder = deriveSkillFolder(skillPath);
|
|
16546
|
+
const withFolder = folder ? `${source}/${folder}` : source;
|
|
16547
|
+
return ref ? `${withFolder}#${ref}` : withFolder;
|
|
16548
|
+
}
|
|
16549
|
+
function buildUpdateInstallSource(entry) {
|
|
16550
|
+
if (!entry.skillPath) {
|
|
16551
|
+
const source = entry.sourceType && entry.sourceType !== "github" ? getLocalSource(entry) : entry.sourceUrl || entry.source;
|
|
16552
|
+
if (!source) return null;
|
|
16553
|
+
return formatSourceInput(source, entry.ref);
|
|
16554
|
+
}
|
|
16555
|
+
const source = entry.sourceType && entry.sourceType !== "github" ? getLocalSource(entry) : entry.source;
|
|
16556
|
+
if (!source) return null;
|
|
16557
|
+
return appendFolderAndRef(source, entry.skillPath, entry.ref);
|
|
16558
|
+
}
|
|
16559
|
+
function buildLocalUpdateSource(entry) {
|
|
16560
|
+
const source = getLocalSource(entry);
|
|
16561
|
+
if (!source) return null;
|
|
16562
|
+
if (!entry.skillPath) return formatSourceInput(source, entry.ref);
|
|
16563
|
+
return appendFolderAndRef(source, entry.skillPath, entry.ref);
|
|
16564
|
+
}
|
|
15706
16565
|
async function runInstallFromLock(args) {
|
|
15707
16566
|
const lock = await readLocalLock(process.cwd());
|
|
15708
16567
|
const skillEntries = Object.entries(lock.skills);
|
|
15709
16568
|
if (skillEntries.length === 0) {
|
|
15710
|
-
|
|
15711
|
-
|
|
16569
|
+
log.warn("No project skills found in skills-lock.json");
|
|
16570
|
+
log.info(`Add project-level skills with ${import_picocolors.default.cyan("npx skills add <package>")} (without ${import_picocolors.default.cyan("-g")})`);
|
|
15712
16571
|
return;
|
|
15713
16572
|
}
|
|
15714
16573
|
const universalAgentNames = getUniversalAgents();
|
|
@@ -15719,7 +16578,11 @@ async function runInstallFromLock(args) {
|
|
|
15719
16578
|
nodeModuleSkills.push(skillName);
|
|
15720
16579
|
continue;
|
|
15721
16580
|
}
|
|
15722
|
-
const installSource = entry
|
|
16581
|
+
const installSource = buildLocalUpdateSource(entry);
|
|
16582
|
+
if (!installSource) {
|
|
16583
|
+
log.error(`Cannot restore ${import_picocolors.default.cyan(skillName)}: skills-lock.json is missing sourceUrl for this generic Git source`);
|
|
16584
|
+
continue;
|
|
16585
|
+
}
|
|
15723
16586
|
const existing = bySource.get(installSource);
|
|
15724
16587
|
if (existing) existing.skills.push(skillName);
|
|
15725
16588
|
else bySource.set(installSource, {
|
|
@@ -15728,7 +16591,7 @@ async function runInstallFromLock(args) {
|
|
|
15728
16591
|
});
|
|
15729
16592
|
}
|
|
15730
16593
|
const remoteCount = skillEntries.length - nodeModuleSkills.length;
|
|
15731
|
-
if (remoteCount > 0)
|
|
16594
|
+
if (remoteCount > 0) log.info(`Restoring ${import_picocolors.default.cyan(String(remoteCount))} skill${remoteCount !== 1 ? "s" : ""} from skills-lock.json into ${import_picocolors.default.dim(".agents/skills/")}`);
|
|
15732
16595
|
for (const [source, { skills }] of bySource) try {
|
|
15733
16596
|
await runAdd([source], {
|
|
15734
16597
|
skill: skills,
|
|
@@ -15736,10 +16599,10 @@ async function runInstallFromLock(args) {
|
|
|
15736
16599
|
yes: true
|
|
15737
16600
|
});
|
|
15738
16601
|
} catch (error) {
|
|
15739
|
-
|
|
16602
|
+
log.error(`Failed to install from ${import_picocolors.default.cyan(source)}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
15740
16603
|
}
|
|
15741
16604
|
if (nodeModuleSkills.length > 0) {
|
|
15742
|
-
|
|
16605
|
+
log.info(`${import_picocolors.default.cyan(String(nodeModuleSkills.length))} skill${nodeModuleSkills.length !== 1 ? "s" : ""} from node_modules`);
|
|
15743
16606
|
try {
|
|
15744
16607
|
const { options: syncOptions } = parseSyncOptions(args);
|
|
15745
16608
|
await runSync(args, {
|
|
@@ -15748,7 +16611,7 @@ async function runInstallFromLock(args) {
|
|
|
15748
16611
|
agent: universalAgentNames
|
|
15749
16612
|
});
|
|
15750
16613
|
} catch (error) {
|
|
15751
|
-
|
|
16614
|
+
log.error(`Failed to sync node_modules skills: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
15752
16615
|
}
|
|
15753
16616
|
}
|
|
15754
16617
|
}
|
|
@@ -15888,19 +16751,19 @@ async function removeCommand(skillNames, options) {
|
|
|
15888
16751
|
const agentResult = await detectAgent();
|
|
15889
16752
|
if (agentResult.isAgent) {
|
|
15890
16753
|
options.yes = true;
|
|
15891
|
-
|
|
16754
|
+
log.info(import_picocolors.default.bgCyan(import_picocolors.default.black(import_picocolors.default.bold(` ${agentResult.agent.name} `))) + " Agent detected — removing non-interactively");
|
|
15892
16755
|
}
|
|
15893
16756
|
const isGlobal = options.global ?? false;
|
|
15894
16757
|
const cwd = process.cwd();
|
|
15895
|
-
const spinner =
|
|
15896
|
-
spinner.start("Scanning for installed skills...");
|
|
16758
|
+
const spinner$1 = spinner();
|
|
16759
|
+
spinner$1.start("Scanning for installed skills...");
|
|
15897
16760
|
const skillNamesSet = /* @__PURE__ */ new Set();
|
|
15898
16761
|
const scanDir = async (dir) => {
|
|
15899
16762
|
try {
|
|
15900
16763
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
15901
16764
|
for (const entry of entries) if (entry.isDirectory()) skillNamesSet.add(entry.name);
|
|
15902
16765
|
} catch (err) {
|
|
15903
|
-
if (err instanceof Error && err.code !== "ENOENT")
|
|
16766
|
+
if (err instanceof Error && err.code !== "ENOENT") log.warn(`Could not scan directory ${dir}: ${err.message}`);
|
|
15904
16767
|
}
|
|
15905
16768
|
};
|
|
15906
16769
|
if (isGlobal) {
|
|
@@ -15912,17 +16775,17 @@ async function removeCommand(skillNames, options) {
|
|
|
15912
16775
|
for (const subagent of getEveSubagents(cwd)) await scanDir(getEveSubagentSkillsDir(subagent, cwd));
|
|
15913
16776
|
}
|
|
15914
16777
|
const installedSkills = Array.from(skillNamesSet).sort();
|
|
15915
|
-
spinner.stop(`Found ${installedSkills.length} unique installed skill(s)`);
|
|
16778
|
+
spinner$1.stop(`Found ${installedSkills.length} unique installed skill(s)`);
|
|
15916
16779
|
if (installedSkills.length === 0) {
|
|
15917
|
-
|
|
16780
|
+
outro(import_picocolors.default.yellow("No skills found to remove."));
|
|
15918
16781
|
return;
|
|
15919
16782
|
}
|
|
15920
16783
|
if (options.agent && options.agent.length > 0) {
|
|
15921
16784
|
const validAgents = Object.keys(agents);
|
|
15922
16785
|
const invalidAgents = options.agent.filter((a) => !validAgents.includes(a));
|
|
15923
16786
|
if (invalidAgents.length > 0) {
|
|
15924
|
-
|
|
15925
|
-
|
|
16787
|
+
log.error(`Invalid agents: ${invalidAgents.join(", ")}`);
|
|
16788
|
+
log.info(`Valid agents: ${validAgents.join(", ")}`);
|
|
15926
16789
|
process.exit(1);
|
|
15927
16790
|
}
|
|
15928
16791
|
}
|
|
@@ -15931,7 +16794,7 @@ async function removeCommand(skillNames, options) {
|
|
|
15931
16794
|
else if (skillNames.length > 0) {
|
|
15932
16795
|
selectedSkills = installedSkills.filter((s) => skillNames.some((name) => name.toLowerCase() === s.toLowerCase()));
|
|
15933
16796
|
if (selectedSkills.length === 0) {
|
|
15934
|
-
|
|
16797
|
+
log.error(`No matching skills found for: ${skillNames.join(", ")}`);
|
|
15935
16798
|
return;
|
|
15936
16799
|
}
|
|
15937
16800
|
} else {
|
|
@@ -15939,13 +16802,13 @@ async function removeCommand(skillNames, options) {
|
|
|
15939
16802
|
value: s,
|
|
15940
16803
|
label: s
|
|
15941
16804
|
}));
|
|
15942
|
-
const selected = await
|
|
16805
|
+
const selected = await multiselect$1({
|
|
15943
16806
|
message: `Select skills to remove ${import_picocolors.default.dim("(space to toggle)")}`,
|
|
15944
16807
|
options: choices,
|
|
15945
16808
|
required: true
|
|
15946
16809
|
});
|
|
15947
|
-
if (
|
|
15948
|
-
|
|
16810
|
+
if (isCancel(selected)) {
|
|
16811
|
+
cancel("Removal cancelled");
|
|
15949
16812
|
process.exit(0);
|
|
15950
16813
|
}
|
|
15951
16814
|
selectedSkills = selected;
|
|
@@ -15954,20 +16817,20 @@ async function removeCommand(skillNames, options) {
|
|
|
15954
16817
|
if (options.agent && options.agent.length > 0) targetAgents = options.agent;
|
|
15955
16818
|
else {
|
|
15956
16819
|
targetAgents = Object.keys(agents);
|
|
15957
|
-
spinner.stop(`Targeting ${targetAgents.length} potential agent(s)`);
|
|
16820
|
+
spinner$1.stop(`Targeting ${targetAgents.length} potential agent(s)`);
|
|
15958
16821
|
}
|
|
15959
16822
|
if (!options.yes) {
|
|
15960
16823
|
console.log();
|
|
15961
|
-
|
|
15962
|
-
for (const skill of selectedSkills)
|
|
16824
|
+
log.info("Skills to remove:");
|
|
16825
|
+
for (const skill of selectedSkills) log.message(` ${import_picocolors.default.red("•")} ${skill}`);
|
|
15963
16826
|
console.log();
|
|
15964
|
-
const confirmed = await
|
|
15965
|
-
if (
|
|
15966
|
-
|
|
16827
|
+
const confirmed = await confirm({ message: `Are you sure you want to uninstall ${selectedSkills.length} skill(s)?` });
|
|
16828
|
+
if (isCancel(confirmed) || !confirmed) {
|
|
16829
|
+
cancel("Removal cancelled");
|
|
15967
16830
|
process.exit(0);
|
|
15968
16831
|
}
|
|
15969
16832
|
}
|
|
15970
|
-
spinner.start("Removing skills...");
|
|
16833
|
+
spinner$1.start("Removing skills...");
|
|
15971
16834
|
const results = [];
|
|
15972
16835
|
for (const skillName of selectedSkills) try {
|
|
15973
16836
|
const canonicalPath = getCanonicalPath(skillName, {
|
|
@@ -15995,7 +16858,7 @@ async function removeCommand(skillNames, options) {
|
|
|
15995
16858
|
force: true
|
|
15996
16859
|
});
|
|
15997
16860
|
} catch (err) {
|
|
15998
|
-
|
|
16861
|
+
log.warn(`Could not remove skill from ${agent.displayName}: ${err instanceof Error ? err.message : String(err)}`);
|
|
15999
16862
|
}
|
|
16000
16863
|
}
|
|
16001
16864
|
}
|
|
@@ -16029,7 +16892,7 @@ async function removeCommand(skillNames, options) {
|
|
|
16029
16892
|
error: err instanceof Error ? err.message : String(err)
|
|
16030
16893
|
});
|
|
16031
16894
|
}
|
|
16032
|
-
spinner.stop("Removal process complete");
|
|
16895
|
+
spinner$1.stop("Removal process complete");
|
|
16033
16896
|
const successful = results.filter((r) => r.success);
|
|
16034
16897
|
const failed = results.filter((r) => !r.success);
|
|
16035
16898
|
if (successful.length > 0) {
|
|
@@ -16050,13 +16913,13 @@ async function removeCommand(skillNames, options) {
|
|
|
16050
16913
|
sourceType: data.sourceType
|
|
16051
16914
|
});
|
|
16052
16915
|
}
|
|
16053
|
-
if (successful.length > 0)
|
|
16916
|
+
if (successful.length > 0) log.success(import_picocolors.default.green(`Successfully removed ${successful.length} skill(s)`));
|
|
16054
16917
|
if (failed.length > 0) {
|
|
16055
|
-
|
|
16056
|
-
for (const r of failed)
|
|
16918
|
+
log.error(import_picocolors.default.red(`Failed to remove ${failed.length} skill(s)`));
|
|
16919
|
+
for (const r of failed) log.message(` ${import_picocolors.default.red("✗")} ${r.skill}: ${r.error}`);
|
|
16057
16920
|
}
|
|
16058
16921
|
console.log();
|
|
16059
|
-
|
|
16922
|
+
outro(import_picocolors.default.green("Done!"));
|
|
16060
16923
|
}
|
|
16061
16924
|
function parseRemoveOptions(args) {
|
|
16062
16925
|
const options = {};
|
|
@@ -16083,38 +16946,6 @@ function parseRemoveOptions(args) {
|
|
|
16083
16946
|
options
|
|
16084
16947
|
};
|
|
16085
16948
|
}
|
|
16086
|
-
function formatSourceInput(sourceUrl, ref) {
|
|
16087
|
-
if (!ref) return sourceUrl;
|
|
16088
|
-
return `${sourceUrl}#${ref}`;
|
|
16089
|
-
}
|
|
16090
|
-
function deriveSkillFolder(skillPath) {
|
|
16091
|
-
let folder = skillPath;
|
|
16092
|
-
if (folder.endsWith("/SKILL.md")) folder = folder.slice(0, -9);
|
|
16093
|
-
else if (folder.endsWith("SKILL.md")) folder = folder.slice(0, -8);
|
|
16094
|
-
if (folder.endsWith("/")) folder = folder.slice(0, -1);
|
|
16095
|
-
return folder;
|
|
16096
|
-
}
|
|
16097
|
-
function supportsAppendedSubpath(source) {
|
|
16098
|
-
if (source.startsWith("git@")) return false;
|
|
16099
|
-
if (source.endsWith(".git")) return false;
|
|
16100
|
-
if (source.startsWith("http://") || source.startsWith("https://")) try {
|
|
16101
|
-
const host = new URL(source).hostname;
|
|
16102
|
-
return host === "github.com" || host === "gitlab.com";
|
|
16103
|
-
} catch {
|
|
16104
|
-
return false;
|
|
16105
|
-
}
|
|
16106
|
-
return true;
|
|
16107
|
-
}
|
|
16108
|
-
function appendFolderAndRef(source, skillPath, ref) {
|
|
16109
|
-
if (!supportsAppendedSubpath(source)) return formatSourceInput(source, ref);
|
|
16110
|
-
const folder = deriveSkillFolder(skillPath);
|
|
16111
|
-
const withFolder = folder ? `${source}/${folder}` : source;
|
|
16112
|
-
return ref ? `${withFolder}#${ref}` : withFolder;
|
|
16113
|
-
}
|
|
16114
|
-
function buildUpdateInstallSource(entry) {
|
|
16115
|
-
if (!entry.skillPath) return formatSourceInput(entry.sourceUrl, entry.ref);
|
|
16116
|
-
return appendFolderAndRef(entry.source, entry.skillPath, entry.ref);
|
|
16117
|
-
}
|
|
16118
16949
|
function parseUpdateOptions(args) {
|
|
16119
16950
|
const options = {};
|
|
16120
16951
|
const positional = [];
|
|
@@ -16147,7 +16978,7 @@ async function resolveUpdateScope(options) {
|
|
|
16147
16978
|
if (options.global) return "global";
|
|
16148
16979
|
if (options.project) return "project";
|
|
16149
16980
|
if (options.yes || !process.stdin.isTTY) return hasProjectSkills() ? "project" : "global";
|
|
16150
|
-
const scope = await
|
|
16981
|
+
const scope = await select({
|
|
16151
16982
|
message: "Update scope",
|
|
16152
16983
|
options: [
|
|
16153
16984
|
{
|
|
@@ -16167,8 +16998,8 @@ async function resolveUpdateScope(options) {
|
|
|
16167
16998
|
}
|
|
16168
16999
|
]
|
|
16169
17000
|
});
|
|
16170
|
-
if (
|
|
16171
|
-
|
|
17001
|
+
if (isCancel(scope)) {
|
|
17002
|
+
cancel("Cancelled");
|
|
16172
17003
|
process.exit(0);
|
|
16173
17004
|
}
|
|
16174
17005
|
return scope;
|
|
@@ -16225,7 +17056,7 @@ async function getProjectSkillsForUpdate(skillFilter) {
|
|
|
16225
17056
|
if (entry.sourceType === "node_modules" || entry.sourceType === "local") continue;
|
|
16226
17057
|
skills.push({
|
|
16227
17058
|
name,
|
|
16228
|
-
source: entry.source,
|
|
17059
|
+
source: entry.sourceUrl || entry.source,
|
|
16229
17060
|
entry
|
|
16230
17061
|
});
|
|
16231
17062
|
}
|
|
@@ -16243,8 +17074,8 @@ async function checkAndPromptForDeletions(source, allLockedForSource, lockSkills
|
|
|
16243
17074
|
for (const s of deletedSkills) console.log(` ${DIM$1}•${RESET$1} ${s}`);
|
|
16244
17075
|
if (options.yes || !process.stdin.isTTY) console.log(`${DIM$1}Skipping deletion in non-interactive mode.${RESET$1}`);
|
|
16245
17076
|
else {
|
|
16246
|
-
const confirmed = await
|
|
16247
|
-
if (confirmed && !
|
|
17077
|
+
const confirmed = await confirm({ message: `Would you like to remove the local copies of these deleted skills?` });
|
|
17078
|
+
if (confirmed && !isCancel(confirmed)) for (const s of deletedSkills) {
|
|
16248
17079
|
console.log(`${DIM$1}Removing${RESET$1} ${s}...`);
|
|
16249
17080
|
await removeCommand([s], {
|
|
16250
17081
|
yes: true,
|
|
@@ -16381,6 +17212,11 @@ async function updateGlobalSkills(options = {}) {
|
|
|
16381
17212
|
const safeName = sanitizeMetadata(update.name);
|
|
16382
17213
|
console.log(`${TEXT$1}Updating ${safeName}...${RESET$1}`);
|
|
16383
17214
|
const installUrl = buildUpdateInstallSource(update.entry);
|
|
17215
|
+
if (!installUrl) {
|
|
17216
|
+
failCount++;
|
|
17217
|
+
console.log(` ${DIM$1}✗ Cannot update ${safeName}: lock file is missing sourceUrl for this generic Git source${RESET$1}`);
|
|
17218
|
+
continue;
|
|
17219
|
+
}
|
|
16384
17220
|
const cliEntry = join(__dirname$1, "..", "bin", "cli.mjs");
|
|
16385
17221
|
if (!existsSync(cliEntry)) {
|
|
16386
17222
|
failCount++;
|
|
@@ -16400,7 +17236,7 @@ async function updateGlobalSkills(options = {}) {
|
|
|
16400
17236
|
"pipe"
|
|
16401
17237
|
],
|
|
16402
17238
|
encoding: "utf-8",
|
|
16403
|
-
shell:
|
|
17239
|
+
shell: false
|
|
16404
17240
|
}).status === 0) {
|
|
16405
17241
|
successCount++;
|
|
16406
17242
|
console.log(` ${TEXT$1}✓${RESET$1} Updated ${safeName}`);
|
|
@@ -16459,7 +17295,7 @@ async function updateProjectSkills(options = {}) {
|
|
|
16459
17295
|
console.log();
|
|
16460
17296
|
const bySource = /* @__PURE__ */ new Map();
|
|
16461
17297
|
for (const skill of updatable) {
|
|
16462
|
-
const source = skill.entry.source;
|
|
17298
|
+
const source = skill.entry.sourceUrl || skill.entry.source;
|
|
16463
17299
|
const existing = bySource.get(source) || [];
|
|
16464
17300
|
existing.push(skill);
|
|
16465
17301
|
bySource.set(source, existing);
|
|
@@ -16476,11 +17312,16 @@ async function updateProjectSkills(options = {}) {
|
|
|
16476
17312
|
}
|
|
16477
17313
|
for (const [source, skillsForSource] of bySource) {
|
|
16478
17314
|
const firstEntry = skillsForSource[0].entry;
|
|
16479
|
-
const sourceUrl = firstEntry.source;
|
|
17315
|
+
const sourceUrl = firstEntry.sourceUrl || firstEntry.source;
|
|
16480
17316
|
const ref = firstEntry.ref;
|
|
16481
|
-
const allLockedForSource = Object.entries(localLock.skills).filter(([_, entry]) => entry.source === source).map(([name, _]) => name);
|
|
17317
|
+
const allLockedForSource = Object.entries(localLock.skills).filter(([_, entry]) => (entry.sourceUrl || entry.source) === source).map(([name, _]) => name);
|
|
16482
17318
|
let tempDir = null;
|
|
16483
17319
|
let deletedSkills = [];
|
|
17320
|
+
if (buildLocalUpdateSource(firstEntry) === null) {
|
|
17321
|
+
failCount += skillsForSource.length;
|
|
17322
|
+
console.log(`${DIM$1}✗ Cannot update ${source}: skills-lock.json is missing sourceUrl for this generic Git source${RESET$1}`);
|
|
17323
|
+
continue;
|
|
17324
|
+
}
|
|
16484
17325
|
try {
|
|
16485
17326
|
tempDir = await cloneRepo(sourceUrl, ref);
|
|
16486
17327
|
const discoveredPaths = (await discoverSkills(tempDir)).map((s) => {
|
|
@@ -16496,7 +17337,12 @@ async function updateProjectSkills(options = {}) {
|
|
|
16496
17337
|
for (const skill of remainingSkills) {
|
|
16497
17338
|
const safeName = sanitizeMetadata(skill.name);
|
|
16498
17339
|
console.log(`${TEXT$1}Updating ${safeName}...${RESET$1}`);
|
|
16499
|
-
const installUrl =
|
|
17340
|
+
const installUrl = buildLocalUpdateSource(skill.entry);
|
|
17341
|
+
if (!installUrl) {
|
|
17342
|
+
failCount++;
|
|
17343
|
+
console.log(` ${DIM$1}✗ Cannot update ${safeName}: skills-lock.json is missing sourceUrl for this generic Git source${RESET$1}`);
|
|
17344
|
+
continue;
|
|
17345
|
+
}
|
|
16500
17346
|
const subagentArgs = skill.entry.subagents?.length ? ["--subagent", ...skill.entry.subagents.map((s) => s === "" ? "root" : s)] : [];
|
|
16501
17347
|
if (spawnSync(process.execPath, [
|
|
16502
17348
|
cliEntry,
|
|
@@ -16513,7 +17359,7 @@ async function updateProjectSkills(options = {}) {
|
|
|
16513
17359
|
"pipe"
|
|
16514
17360
|
],
|
|
16515
17361
|
encoding: "utf-8",
|
|
16516
|
-
shell:
|
|
17362
|
+
shell: false
|
|
16517
17363
|
}).status === 0) {
|
|
16518
17364
|
successCount++;
|
|
16519
17365
|
console.log(` ${TEXT$1}✓${RESET$1} Updated ${safeName}`);
|
|
@@ -16535,9 +17381,10 @@ function printLegacyProjectSkills(legacy) {
|
|
|
16535
17381
|
console.log();
|
|
16536
17382
|
console.log(`${DIM$1}${legacy.length} project skill(s) cannot be updated automatically (installed before skillPath tracking):${RESET$1}`);
|
|
16537
17383
|
for (const skill of legacy) {
|
|
16538
|
-
const reinstall =
|
|
17384
|
+
const reinstall = buildLocalUpdateSource(skill.entry);
|
|
16539
17385
|
console.log(` ${TEXT$1}•${RESET$1} ${sanitizeMetadata(skill.name)}`);
|
|
16540
|
-
console.log(` ${DIM$1}To refresh: ${TEXT$1}npx skills add ${reinstall} -y${RESET$1}`);
|
|
17386
|
+
if (reinstall) console.log(` ${DIM$1}To refresh: ${TEXT$1}npx skills add ${reinstall} -y${RESET$1}`);
|
|
17387
|
+
else console.log(` ${DIM$1}To refresh: reinstall using the original full Git URL; this lock entry only has an ambiguous shorthand.${RESET$1}`);
|
|
16541
17388
|
}
|
|
16542
17389
|
}
|
|
16543
17390
|
async function runUpdate(args = []) {
|
|
@@ -16567,7 +17414,10 @@ async function runUpdate(args = []) {
|
|
|
16567
17414
|
if (options.skills && totalFound === 0) console.log(`${DIM$1}No installed skills found matching: ${options.skills.join(", ")}${RESET$1}`);
|
|
16568
17415
|
console.log();
|
|
16569
17416
|
if (totalSuccess > 0) console.log(`${TEXT$1}✓ Updated ${totalSuccess} skill(s)${RESET$1}`);
|
|
16570
|
-
if (totalFail > 0)
|
|
17417
|
+
if (totalFail > 0) {
|
|
17418
|
+
console.log(`${DIM$1}Failed to update ${totalFail} skill(s)${RESET$1}`);
|
|
17419
|
+
process.exitCode = 1;
|
|
17420
|
+
}
|
|
16571
17421
|
track({
|
|
16572
17422
|
event: "update",
|
|
16573
17423
|
scope,
|
|
@@ -16989,6 +17839,7 @@ ${BOLD}Add Options:${RESET}
|
|
|
16989
17839
|
-l, --list List available skills in the repository without installing
|
|
16990
17840
|
-y, --yes Skip confirmation prompts
|
|
16991
17841
|
--copy Copy files instead of symlinking to agent directories
|
|
17842
|
+
--metadata <json> Attach valid JSON to the install telemetry event
|
|
16992
17843
|
--subagent <names> Install to Eve subagents (use 'root' for the root agent)
|
|
16993
17844
|
--all Shorthand for --skill '*' --agent '*' -y
|
|
16994
17845
|
--full-depth Search all subdirectories even when a root SKILL.md exists
|
|
@@ -17157,7 +18008,12 @@ async function main() {
|
|
|
17157
18008
|
case "a":
|
|
17158
18009
|
case "add": {
|
|
17159
18010
|
if (!inAgent) showLogo();
|
|
17160
|
-
const { source: addSource, options: addOpts } = parseAddOptions(restArgs);
|
|
18011
|
+
const { source: addSource, options: addOpts, errors } = parseAddOptions(restArgs);
|
|
18012
|
+
if (errors.length > 0) {
|
|
18013
|
+
for (const error of errors) console.error(`Error: ${error}`);
|
|
18014
|
+
process.exitCode = 1;
|
|
18015
|
+
break;
|
|
18016
|
+
}
|
|
17161
18017
|
await runAdd(addSource, addOpts);
|
|
17162
18018
|
break;
|
|
17163
18019
|
}
|
|
@@ -17209,6 +18065,7 @@ var init_cli = __esmMin((() => {
|
|
|
17209
18065
|
init_rolldown_runtime();
|
|
17210
18066
|
init_core();
|
|
17211
18067
|
init_prompts();
|
|
18068
|
+
init_picocolors();
|
|
17212
18069
|
init_simple_git();
|
|
17213
18070
|
init_xdg_basedir();
|
|
17214
18071
|
init_detect_agent();
|
|
@@ -17221,7 +18078,7 @@ var init_cli = __esmMin((() => {
|
|
|
17221
18078
|
SIMPLE_ESC_RE = /\x1b[\x20-\x7e]/g;
|
|
17222
18079
|
C1_RE = /[\x80-\x9f]/g;
|
|
17223
18080
|
CONTROL_RE = /[\x00-\x06\x07\x08\x0b\x0c\x0d-\x1a\x1c-\x1f\x7f]/g;
|
|
17224
|
-
silentOutput = new Writable
|
|
18081
|
+
silentOutput = new Writable({ write(_chunk, _encoding, callback) {
|
|
17225
18082
|
callback();
|
|
17226
18083
|
} });
|
|
17227
18084
|
S_STEP_ACTIVE = import_picocolors.default.green("◆");
|
|
@@ -17286,6 +18143,7 @@ var init_cli = __esmMin((() => {
|
|
|
17286
18143
|
".roo/skills",
|
|
17287
18144
|
".trae/skills",
|
|
17288
18145
|
".windsurf/skills",
|
|
18146
|
+
".zcode/skills",
|
|
17289
18147
|
".zencoder/skills"
|
|
17290
18148
|
];
|
|
17291
18149
|
home = homedir();
|
|
@@ -17888,6 +18746,15 @@ var init_cli = __esmMin((() => {
|
|
|
17888
18746
|
return existsSync(join(configHome, "zed")) || !!zedAppDataHome && existsSync(join(zedAppDataHome, "Zed")) || !!zedFlatpakConfigHome && existsSync(join(zedFlatpakConfigHome, "zed"));
|
|
17889
18747
|
}
|
|
17890
18748
|
},
|
|
18749
|
+
zcode: {
|
|
18750
|
+
name: "zcode",
|
|
18751
|
+
displayName: "ZCode",
|
|
18752
|
+
skillsDir: ".zcode/skills",
|
|
18753
|
+
globalSkillsDir: join(home, ".zcode/skills"),
|
|
18754
|
+
detectInstalled: async () => {
|
|
18755
|
+
return isZCodeInstalled();
|
|
18756
|
+
}
|
|
18757
|
+
},
|
|
17891
18758
|
zencoder: {
|
|
17892
18759
|
name: "zencoder",
|
|
17893
18760
|
displayName: "Zencoder",
|
|
@@ -18488,9 +19355,10 @@ var init_cli = __esmMin((() => {
|
|
|
18488
19355
|
".roo/skills/",
|
|
18489
19356
|
".trae/skills/",
|
|
18490
19357
|
".windsurf/skills/",
|
|
19358
|
+
".zcode/skills/",
|
|
18491
19359
|
".zencoder/skills/"
|
|
18492
19360
|
];
|
|
18493
|
-
version$1 = "1.5.
|
|
19361
|
+
version$1 = "1.5.16";
|
|
18494
19362
|
isCancelled$1 = (value) => typeof value === "symbol";
|
|
18495
19363
|
EVE_AGENT_LABEL = "eve agent";
|
|
18496
19364
|
setVersion(version$1);
|
|
@@ -18563,10 +19431,10 @@ var init_cli = __esmMin((() => {
|
|
|
18563
19431
|
"\x1B[38;5;240m",
|
|
18564
19432
|
"\x1B[38;5;238m"
|
|
18565
19433
|
];
|
|
18566
|
-
main().finally(() => flushTelemetry().then(() => process.exit(0)));
|
|
19434
|
+
main().finally(() => flushTelemetry().then(() => process.exit(process.exitCode ?? 0)));
|
|
18567
19435
|
}));
|
|
18568
19436
|
//#endregion
|
|
18569
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
19437
|
+
//#region ../../node_modules/.pnpm/skills@1.5.16/node_modules/skills/bin/cli.mjs
|
|
18570
19438
|
if (module.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) try {
|
|
18571
19439
|
module.enableCompileCache();
|
|
18572
19440
|
} catch {}
|