@lousy-agents/mcp 5.2.4 → 5.3.0
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/116.js +298 -0
- package/dist/116.js.map +1 -0
- package/dist/mcp-server.js +1578 -18
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -16550,7 +16550,7 @@ __webpack_require__.d(regexes_namespaceObject, {
|
|
|
16550
16550
|
cidrv6: () => (cidrv6),
|
|
16551
16551
|
cuid: () => (cuid),
|
|
16552
16552
|
cuid2: () => (cuid2),
|
|
16553
|
-
date: () => (
|
|
16553
|
+
date: () => (regexes_date),
|
|
16554
16554
|
datetime: () => (datetime),
|
|
16555
16555
|
domain: () => (domain),
|
|
16556
16556
|
duration: () => (duration),
|
|
@@ -17903,7 +17903,7 @@ const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$
|
|
|
17903
17903
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
17904
17904
|
// const dateSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
17905
17905
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
17906
|
-
const
|
|
17906
|
+
const regexes_date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
17907
17907
|
function timeSource(args) {
|
|
17908
17908
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
17909
17909
|
const regex = typeof args.precision === "number"
|
|
@@ -18875,7 +18875,7 @@ const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def
|
|
|
18875
18875
|
$ZodStringFormat.init(inst, def);
|
|
18876
18876
|
});
|
|
18877
18877
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
18878
|
-
def.pattern ?? (def.pattern =
|
|
18878
|
+
def.pattern ?? (def.pattern = regexes_date);
|
|
18879
18879
|
$ZodStringFormat.init(inst, def);
|
|
18880
18880
|
});
|
|
18881
18881
|
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
@@ -45514,9 +45514,11 @@ const CopilotSetupConfigSchema = schemas_object({
|
|
|
45514
45514
|
/**
|
|
45515
45515
|
* Loads the copilot-setup configuration using c12.
|
|
45516
45516
|
* Falls back to defaults if no configuration is found.
|
|
45517
|
-
|
|
45517
|
+
* @param cwd Optional working directory to load config from (defaults to process.cwd())
|
|
45518
|
+
*/ async function loadCopilotSetupConfig(cwd) {
|
|
45518
45519
|
const { config } = await loadConfig({
|
|
45519
45520
|
name: "lousy-agents",
|
|
45521
|
+
cwd,
|
|
45520
45522
|
defaults: DEFAULT_COPILOT_SETUP_CONFIG,
|
|
45521
45523
|
packageJson: "copilotSetup"
|
|
45522
45524
|
});
|
|
@@ -45568,6 +45570,7 @@ const CopilotSetupConfigSchema = schemas_object({
|
|
|
45568
45570
|
|
|
45569
45571
|
|
|
45570
45572
|
|
|
45573
|
+
|
|
45571
45574
|
const MAX_VERSION_FILE_BYTES = 16 * 1024;
|
|
45572
45575
|
async function readVersionFileContent(filePath) {
|
|
45573
45576
|
await file_system_utils_assertFileSizeWithinLimit(filePath, MAX_VERSION_FILE_BYTES, `Version file '${filePath}'`);
|
|
@@ -45577,10 +45580,14 @@ async function readVersionFileContent(filePath) {
|
|
|
45577
45580
|
/**
|
|
45578
45581
|
* File system implementation of the environment gateway.
|
|
45579
45582
|
*/ class FileSystemEnvironmentGateway {
|
|
45583
|
+
cwd;
|
|
45580
45584
|
config = null;
|
|
45585
|
+
constructor(cwd){
|
|
45586
|
+
this.cwd = cwd;
|
|
45587
|
+
}
|
|
45581
45588
|
async getConfig() {
|
|
45582
45589
|
if (!this.config) {
|
|
45583
|
-
this.config = await loadCopilotSetupConfig();
|
|
45590
|
+
this.config = await loadCopilotSetupConfig(this.cwd !== undefined ? (0,external_node_path_.resolve)(this.cwd) : undefined);
|
|
45584
45591
|
}
|
|
45585
45592
|
return this.config;
|
|
45586
45593
|
}
|
|
@@ -45711,8 +45718,9 @@ async function readVersionFileContent(filePath) {
|
|
|
45711
45718
|
}
|
|
45712
45719
|
/**
|
|
45713
45720
|
* Creates and returns the default environment gateway.
|
|
45714
|
-
|
|
45715
|
-
|
|
45721
|
+
* @param cwd Optional working directory for config loading (defaults to process.cwd())
|
|
45722
|
+
*/ function createEnvironmentGateway(cwd) {
|
|
45723
|
+
return new FileSystemEnvironmentGateway(cwd);
|
|
45716
45724
|
}
|
|
45717
45725
|
|
|
45718
45726
|
// EXTERNAL MODULE: external "node:child_process"
|
|
@@ -46018,15 +46026,1556 @@ function defaultExec(command, args, options) {
|
|
|
46018
46026
|
return new FileSystemInstructionAnalysisGateway();
|
|
46019
46027
|
}
|
|
46020
46028
|
|
|
46029
|
+
;// CONCATENATED MODULE: ../../node_modules/consola/dist/core.mjs
|
|
46030
|
+
const LogLevels = {
|
|
46031
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
46032
|
+
fatal: 0,
|
|
46033
|
+
error: 0,
|
|
46034
|
+
warn: 1,
|
|
46035
|
+
log: 2,
|
|
46036
|
+
info: 3,
|
|
46037
|
+
success: 3,
|
|
46038
|
+
fail: 3,
|
|
46039
|
+
ready: 3,
|
|
46040
|
+
start: 3,
|
|
46041
|
+
box: 3,
|
|
46042
|
+
debug: 4,
|
|
46043
|
+
trace: 5,
|
|
46044
|
+
verbose: Number.POSITIVE_INFINITY
|
|
46045
|
+
};
|
|
46046
|
+
const LogTypes = {
|
|
46047
|
+
// Silent
|
|
46048
|
+
silent: {
|
|
46049
|
+
level: -1
|
|
46050
|
+
},
|
|
46051
|
+
// Level 0
|
|
46052
|
+
fatal: {
|
|
46053
|
+
level: LogLevels.fatal
|
|
46054
|
+
},
|
|
46055
|
+
error: {
|
|
46056
|
+
level: LogLevels.error
|
|
46057
|
+
},
|
|
46058
|
+
// Level 1
|
|
46059
|
+
warn: {
|
|
46060
|
+
level: LogLevels.warn
|
|
46061
|
+
},
|
|
46062
|
+
// Level 2
|
|
46063
|
+
log: {
|
|
46064
|
+
level: LogLevels.log
|
|
46065
|
+
},
|
|
46066
|
+
// Level 3
|
|
46067
|
+
info: {
|
|
46068
|
+
level: LogLevels.info
|
|
46069
|
+
},
|
|
46070
|
+
success: {
|
|
46071
|
+
level: LogLevels.success
|
|
46072
|
+
},
|
|
46073
|
+
fail: {
|
|
46074
|
+
level: LogLevels.fail
|
|
46075
|
+
},
|
|
46076
|
+
ready: {
|
|
46077
|
+
level: LogLevels.info
|
|
46078
|
+
},
|
|
46079
|
+
start: {
|
|
46080
|
+
level: LogLevels.info
|
|
46081
|
+
},
|
|
46082
|
+
box: {
|
|
46083
|
+
level: LogLevels.info
|
|
46084
|
+
},
|
|
46085
|
+
// Level 4
|
|
46086
|
+
debug: {
|
|
46087
|
+
level: LogLevels.debug
|
|
46088
|
+
},
|
|
46089
|
+
// Level 5
|
|
46090
|
+
trace: {
|
|
46091
|
+
level: LogLevels.trace
|
|
46092
|
+
},
|
|
46093
|
+
// Verbose
|
|
46094
|
+
verbose: {
|
|
46095
|
+
level: LogLevels.verbose
|
|
46096
|
+
}
|
|
46097
|
+
};
|
|
46098
|
+
|
|
46099
|
+
function isPlainObject$1(value) {
|
|
46100
|
+
if (value === null || typeof value !== "object") {
|
|
46101
|
+
return false;
|
|
46102
|
+
}
|
|
46103
|
+
const prototype = Object.getPrototypeOf(value);
|
|
46104
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
46105
|
+
return false;
|
|
46106
|
+
}
|
|
46107
|
+
if (Symbol.iterator in value) {
|
|
46108
|
+
return false;
|
|
46109
|
+
}
|
|
46110
|
+
if (Symbol.toStringTag in value) {
|
|
46111
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
46112
|
+
}
|
|
46113
|
+
return true;
|
|
46114
|
+
}
|
|
46115
|
+
|
|
46116
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
46117
|
+
if (!isPlainObject$1(defaults)) {
|
|
46118
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
46119
|
+
}
|
|
46120
|
+
const object = Object.assign({}, defaults);
|
|
46121
|
+
for (const key in baseObject) {
|
|
46122
|
+
if (key === "__proto__" || key === "constructor") {
|
|
46123
|
+
continue;
|
|
46124
|
+
}
|
|
46125
|
+
const value = baseObject[key];
|
|
46126
|
+
if (value === null || value === void 0) {
|
|
46127
|
+
continue;
|
|
46128
|
+
}
|
|
46129
|
+
if (merger && merger(object, key, value, namespace)) {
|
|
46130
|
+
continue;
|
|
46131
|
+
}
|
|
46132
|
+
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
46133
|
+
object[key] = [...value, ...object[key]];
|
|
46134
|
+
} else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
|
|
46135
|
+
object[key] = _defu(
|
|
46136
|
+
value,
|
|
46137
|
+
object[key],
|
|
46138
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
46139
|
+
merger
|
|
46140
|
+
);
|
|
46141
|
+
} else {
|
|
46142
|
+
object[key] = value;
|
|
46143
|
+
}
|
|
46144
|
+
}
|
|
46145
|
+
return object;
|
|
46146
|
+
}
|
|
46147
|
+
function createDefu(merger) {
|
|
46148
|
+
return (...arguments_) => (
|
|
46149
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
46150
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
46151
|
+
);
|
|
46152
|
+
}
|
|
46153
|
+
const core_defu = createDefu();
|
|
46154
|
+
|
|
46155
|
+
function core_isPlainObject(obj) {
|
|
46156
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
46157
|
+
}
|
|
46158
|
+
function isLogObj(arg) {
|
|
46159
|
+
if (!core_isPlainObject(arg)) {
|
|
46160
|
+
return false;
|
|
46161
|
+
}
|
|
46162
|
+
if (!arg.message && !arg.args) {
|
|
46163
|
+
return false;
|
|
46164
|
+
}
|
|
46165
|
+
if (arg.stack) {
|
|
46166
|
+
return false;
|
|
46167
|
+
}
|
|
46168
|
+
return true;
|
|
46169
|
+
}
|
|
46170
|
+
|
|
46171
|
+
let paused = false;
|
|
46172
|
+
const queue = [];
|
|
46173
|
+
class Consola {
|
|
46174
|
+
options;
|
|
46175
|
+
_lastLog;
|
|
46176
|
+
_mockFn;
|
|
46177
|
+
/**
|
|
46178
|
+
* Creates an instance of Consola with specified options or defaults.
|
|
46179
|
+
*
|
|
46180
|
+
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
46181
|
+
*/
|
|
46182
|
+
constructor(options = {}) {
|
|
46183
|
+
const types = options.types || LogTypes;
|
|
46184
|
+
this.options = core_defu(
|
|
46185
|
+
{
|
|
46186
|
+
...options,
|
|
46187
|
+
defaults: { ...options.defaults },
|
|
46188
|
+
level: _normalizeLogLevel(options.level, types),
|
|
46189
|
+
reporters: [...options.reporters || []]
|
|
46190
|
+
},
|
|
46191
|
+
{
|
|
46192
|
+
types: LogTypes,
|
|
46193
|
+
throttle: 1e3,
|
|
46194
|
+
throttleMin: 5,
|
|
46195
|
+
formatOptions: {
|
|
46196
|
+
date: true,
|
|
46197
|
+
colors: false,
|
|
46198
|
+
compact: true
|
|
46199
|
+
}
|
|
46200
|
+
}
|
|
46201
|
+
);
|
|
46202
|
+
for (const type in types) {
|
|
46203
|
+
const defaults = {
|
|
46204
|
+
type,
|
|
46205
|
+
...this.options.defaults,
|
|
46206
|
+
...types[type]
|
|
46207
|
+
};
|
|
46208
|
+
this[type] = this._wrapLogFn(defaults);
|
|
46209
|
+
this[type].raw = this._wrapLogFn(
|
|
46210
|
+
defaults,
|
|
46211
|
+
true
|
|
46212
|
+
);
|
|
46213
|
+
}
|
|
46214
|
+
if (this.options.mockFn) {
|
|
46215
|
+
this.mockTypes();
|
|
46216
|
+
}
|
|
46217
|
+
this._lastLog = {};
|
|
46218
|
+
}
|
|
46219
|
+
/**
|
|
46220
|
+
* Gets the current log level of the Consola instance.
|
|
46221
|
+
*
|
|
46222
|
+
* @returns {number} The current log level.
|
|
46223
|
+
*/
|
|
46224
|
+
get level() {
|
|
46225
|
+
return this.options.level;
|
|
46226
|
+
}
|
|
46227
|
+
/**
|
|
46228
|
+
* Sets the minimum log level that will be output by the instance.
|
|
46229
|
+
*
|
|
46230
|
+
* @param {number} level - The new log level to set.
|
|
46231
|
+
*/
|
|
46232
|
+
set level(level) {
|
|
46233
|
+
this.options.level = _normalizeLogLevel(
|
|
46234
|
+
level,
|
|
46235
|
+
this.options.types,
|
|
46236
|
+
this.options.level
|
|
46237
|
+
);
|
|
46238
|
+
}
|
|
46239
|
+
/**
|
|
46240
|
+
* Displays a prompt to the user and returns the response.
|
|
46241
|
+
* Throw an error if `prompt` is not supported by the current configuration.
|
|
46242
|
+
*
|
|
46243
|
+
* @template T
|
|
46244
|
+
* @param {string} message - The message to display in the prompt.
|
|
46245
|
+
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
46246
|
+
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
46247
|
+
*/
|
|
46248
|
+
prompt(message, opts) {
|
|
46249
|
+
if (!this.options.prompt) {
|
|
46250
|
+
throw new Error("prompt is not supported!");
|
|
46251
|
+
}
|
|
46252
|
+
return this.options.prompt(message, opts);
|
|
46253
|
+
}
|
|
46254
|
+
/**
|
|
46255
|
+
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
46256
|
+
*
|
|
46257
|
+
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
46258
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
46259
|
+
*/
|
|
46260
|
+
create(options) {
|
|
46261
|
+
const instance = new Consola({
|
|
46262
|
+
...this.options,
|
|
46263
|
+
...options
|
|
46264
|
+
});
|
|
46265
|
+
if (this._mockFn) {
|
|
46266
|
+
instance.mockTypes(this._mockFn);
|
|
46267
|
+
}
|
|
46268
|
+
return instance;
|
|
46269
|
+
}
|
|
46270
|
+
/**
|
|
46271
|
+
* Creates a new Consola instance with the specified default log object properties.
|
|
46272
|
+
*
|
|
46273
|
+
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
46274
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
46275
|
+
*/
|
|
46276
|
+
withDefaults(defaults) {
|
|
46277
|
+
return this.create({
|
|
46278
|
+
...this.options,
|
|
46279
|
+
defaults: {
|
|
46280
|
+
...this.options.defaults,
|
|
46281
|
+
...defaults
|
|
46282
|
+
}
|
|
46283
|
+
});
|
|
46284
|
+
}
|
|
46285
|
+
/**
|
|
46286
|
+
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
46287
|
+
*
|
|
46288
|
+
* @param {string} tag - The tag to include in each log of the new instance.
|
|
46289
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
46290
|
+
*/
|
|
46291
|
+
withTag(tag) {
|
|
46292
|
+
return this.withDefaults({
|
|
46293
|
+
tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
|
|
46294
|
+
});
|
|
46295
|
+
}
|
|
46296
|
+
/**
|
|
46297
|
+
* Adds a custom reporter to the Consola instance.
|
|
46298
|
+
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
46299
|
+
*
|
|
46300
|
+
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
46301
|
+
* @returns {Consola} The current Consola instance.
|
|
46302
|
+
*/
|
|
46303
|
+
addReporter(reporter) {
|
|
46304
|
+
this.options.reporters.push(reporter);
|
|
46305
|
+
return this;
|
|
46306
|
+
}
|
|
46307
|
+
/**
|
|
46308
|
+
* Removes a custom reporter from the Consola instance.
|
|
46309
|
+
* If no reporter is specified, all reporters will be removed.
|
|
46310
|
+
*
|
|
46311
|
+
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
46312
|
+
* @returns {Consola} The current Consola instance.
|
|
46313
|
+
*/
|
|
46314
|
+
removeReporter(reporter) {
|
|
46315
|
+
if (reporter) {
|
|
46316
|
+
const i = this.options.reporters.indexOf(reporter);
|
|
46317
|
+
if (i !== -1) {
|
|
46318
|
+
return this.options.reporters.splice(i, 1);
|
|
46319
|
+
}
|
|
46320
|
+
} else {
|
|
46321
|
+
this.options.reporters.splice(0);
|
|
46322
|
+
}
|
|
46323
|
+
return this;
|
|
46324
|
+
}
|
|
46325
|
+
/**
|
|
46326
|
+
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
46327
|
+
*
|
|
46328
|
+
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
46329
|
+
* @returns {Consola} The current Consola instance.
|
|
46330
|
+
*/
|
|
46331
|
+
setReporters(reporters) {
|
|
46332
|
+
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
46333
|
+
return this;
|
|
46334
|
+
}
|
|
46335
|
+
wrapAll() {
|
|
46336
|
+
this.wrapConsole();
|
|
46337
|
+
this.wrapStd();
|
|
46338
|
+
}
|
|
46339
|
+
restoreAll() {
|
|
46340
|
+
this.restoreConsole();
|
|
46341
|
+
this.restoreStd();
|
|
46342
|
+
}
|
|
46343
|
+
/**
|
|
46344
|
+
* Overrides console methods with Consola logging methods for consistent logging.
|
|
46345
|
+
*/
|
|
46346
|
+
wrapConsole() {
|
|
46347
|
+
for (const type in this.options.types) {
|
|
46348
|
+
if (!console["__" + type]) {
|
|
46349
|
+
console["__" + type] = console[type];
|
|
46350
|
+
}
|
|
46351
|
+
console[type] = this[type].raw;
|
|
46352
|
+
}
|
|
46353
|
+
}
|
|
46354
|
+
/**
|
|
46355
|
+
* Restores the original console methods, removing Consola overrides.
|
|
46356
|
+
*/
|
|
46357
|
+
restoreConsole() {
|
|
46358
|
+
for (const type in this.options.types) {
|
|
46359
|
+
if (console["__" + type]) {
|
|
46360
|
+
console[type] = console["__" + type];
|
|
46361
|
+
delete console["__" + type];
|
|
46362
|
+
}
|
|
46363
|
+
}
|
|
46364
|
+
}
|
|
46365
|
+
/**
|
|
46366
|
+
* Overrides standard output and error streams to redirect them through Consola.
|
|
46367
|
+
*/
|
|
46368
|
+
wrapStd() {
|
|
46369
|
+
this._wrapStream(this.options.stdout, "log");
|
|
46370
|
+
this._wrapStream(this.options.stderr, "log");
|
|
46371
|
+
}
|
|
46372
|
+
_wrapStream(stream, type) {
|
|
46373
|
+
if (!stream) {
|
|
46374
|
+
return;
|
|
46375
|
+
}
|
|
46376
|
+
if (!stream.__write) {
|
|
46377
|
+
stream.__write = stream.write;
|
|
46378
|
+
}
|
|
46379
|
+
stream.write = (data) => {
|
|
46380
|
+
this[type].raw(String(data).trim());
|
|
46381
|
+
};
|
|
46382
|
+
}
|
|
46383
|
+
/**
|
|
46384
|
+
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
46385
|
+
*/
|
|
46386
|
+
restoreStd() {
|
|
46387
|
+
this._restoreStream(this.options.stdout);
|
|
46388
|
+
this._restoreStream(this.options.stderr);
|
|
46389
|
+
}
|
|
46390
|
+
_restoreStream(stream) {
|
|
46391
|
+
if (!stream) {
|
|
46392
|
+
return;
|
|
46393
|
+
}
|
|
46394
|
+
if (stream.__write) {
|
|
46395
|
+
stream.write = stream.__write;
|
|
46396
|
+
delete stream.__write;
|
|
46397
|
+
}
|
|
46398
|
+
}
|
|
46399
|
+
/**
|
|
46400
|
+
* Pauses logging, queues incoming logs until resumed.
|
|
46401
|
+
*/
|
|
46402
|
+
pauseLogs() {
|
|
46403
|
+
paused = true;
|
|
46404
|
+
}
|
|
46405
|
+
/**
|
|
46406
|
+
* Resumes logging, processing any queued logs.
|
|
46407
|
+
*/
|
|
46408
|
+
resumeLogs() {
|
|
46409
|
+
paused = false;
|
|
46410
|
+
const _queue = queue.splice(0);
|
|
46411
|
+
for (const item of _queue) {
|
|
46412
|
+
item[0]._logFn(item[1], item[2]);
|
|
46413
|
+
}
|
|
46414
|
+
}
|
|
46415
|
+
/**
|
|
46416
|
+
* Replaces logging methods with mocks if a mock function is provided.
|
|
46417
|
+
*
|
|
46418
|
+
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
46419
|
+
*/
|
|
46420
|
+
mockTypes(mockFn) {
|
|
46421
|
+
const _mockFn = mockFn || this.options.mockFn;
|
|
46422
|
+
this._mockFn = _mockFn;
|
|
46423
|
+
if (typeof _mockFn !== "function") {
|
|
46424
|
+
return;
|
|
46425
|
+
}
|
|
46426
|
+
for (const type in this.options.types) {
|
|
46427
|
+
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
46428
|
+
this[type].raw = this[type];
|
|
46429
|
+
}
|
|
46430
|
+
}
|
|
46431
|
+
_wrapLogFn(defaults, isRaw) {
|
|
46432
|
+
return (...args) => {
|
|
46433
|
+
if (paused) {
|
|
46434
|
+
queue.push([this, defaults, args, isRaw]);
|
|
46435
|
+
return;
|
|
46436
|
+
}
|
|
46437
|
+
return this._logFn(defaults, args, isRaw);
|
|
46438
|
+
};
|
|
46439
|
+
}
|
|
46440
|
+
_logFn(defaults, args, isRaw) {
|
|
46441
|
+
if ((defaults.level || 0) > this.level) {
|
|
46442
|
+
return false;
|
|
46443
|
+
}
|
|
46444
|
+
const logObj = {
|
|
46445
|
+
date: /* @__PURE__ */ new Date(),
|
|
46446
|
+
args: [],
|
|
46447
|
+
...defaults,
|
|
46448
|
+
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
46449
|
+
};
|
|
46450
|
+
if (!isRaw && args.length === 1 && isLogObj(args[0])) {
|
|
46451
|
+
Object.assign(logObj, args[0]);
|
|
46452
|
+
} else {
|
|
46453
|
+
logObj.args = [...args];
|
|
46454
|
+
}
|
|
46455
|
+
if (logObj.message) {
|
|
46456
|
+
logObj.args.unshift(logObj.message);
|
|
46457
|
+
delete logObj.message;
|
|
46458
|
+
}
|
|
46459
|
+
if (logObj.additional) {
|
|
46460
|
+
if (!Array.isArray(logObj.additional)) {
|
|
46461
|
+
logObj.additional = logObj.additional.split("\n");
|
|
46462
|
+
}
|
|
46463
|
+
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
46464
|
+
delete logObj.additional;
|
|
46465
|
+
}
|
|
46466
|
+
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
46467
|
+
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
46468
|
+
const resolveLog = (newLog = false) => {
|
|
46469
|
+
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
46470
|
+
if (this._lastLog.object && repeated > 0) {
|
|
46471
|
+
const args2 = [...this._lastLog.object.args];
|
|
46472
|
+
if (repeated > 1) {
|
|
46473
|
+
args2.push(`(repeated ${repeated} times)`);
|
|
46474
|
+
}
|
|
46475
|
+
this._log({ ...this._lastLog.object, args: args2 });
|
|
46476
|
+
this._lastLog.count = 1;
|
|
46477
|
+
}
|
|
46478
|
+
if (newLog) {
|
|
46479
|
+
this._lastLog.object = logObj;
|
|
46480
|
+
this._log(logObj);
|
|
46481
|
+
}
|
|
46482
|
+
};
|
|
46483
|
+
clearTimeout(this._lastLog.timeout);
|
|
46484
|
+
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
46485
|
+
this._lastLog.time = logObj.date;
|
|
46486
|
+
if (diffTime < this.options.throttle) {
|
|
46487
|
+
try {
|
|
46488
|
+
const serializedLog = JSON.stringify([
|
|
46489
|
+
logObj.type,
|
|
46490
|
+
logObj.tag,
|
|
46491
|
+
logObj.args
|
|
46492
|
+
]);
|
|
46493
|
+
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
46494
|
+
this._lastLog.serialized = serializedLog;
|
|
46495
|
+
if (isSameLog) {
|
|
46496
|
+
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
46497
|
+
if (this._lastLog.count > this.options.throttleMin) {
|
|
46498
|
+
this._lastLog.timeout = setTimeout(
|
|
46499
|
+
resolveLog,
|
|
46500
|
+
this.options.throttle
|
|
46501
|
+
);
|
|
46502
|
+
return;
|
|
46503
|
+
}
|
|
46504
|
+
}
|
|
46505
|
+
} catch {
|
|
46506
|
+
}
|
|
46507
|
+
}
|
|
46508
|
+
resolveLog(true);
|
|
46509
|
+
}
|
|
46510
|
+
_log(logObj) {
|
|
46511
|
+
for (const reporter of this.options.reporters) {
|
|
46512
|
+
reporter.log(logObj, {
|
|
46513
|
+
options: this.options
|
|
46514
|
+
});
|
|
46515
|
+
}
|
|
46516
|
+
}
|
|
46517
|
+
}
|
|
46518
|
+
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
46519
|
+
if (input === void 0) {
|
|
46520
|
+
return defaultLevel;
|
|
46521
|
+
}
|
|
46522
|
+
if (typeof input === "number") {
|
|
46523
|
+
return input;
|
|
46524
|
+
}
|
|
46525
|
+
if (types[input] && types[input].level !== void 0) {
|
|
46526
|
+
return types[input].level;
|
|
46527
|
+
}
|
|
46528
|
+
return defaultLevel;
|
|
46529
|
+
}
|
|
46530
|
+
Consola.prototype.add = Consola.prototype.addReporter;
|
|
46531
|
+
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
46532
|
+
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
46533
|
+
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
46534
|
+
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
46535
|
+
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
46536
|
+
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
46537
|
+
function createConsola(options = {}) {
|
|
46538
|
+
return new Consola(options);
|
|
46539
|
+
}
|
|
46540
|
+
|
|
46541
|
+
|
|
46542
|
+
|
|
46543
|
+
;// CONCATENATED MODULE: ../../node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
46544
|
+
|
|
46545
|
+
|
|
46546
|
+
|
|
46547
|
+
function parseStack(stack, message) {
|
|
46548
|
+
const cwd = process.cwd() + external_node_path_.sep;
|
|
46549
|
+
const lines = stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
46550
|
+
return lines;
|
|
46551
|
+
}
|
|
46552
|
+
|
|
46553
|
+
function writeStream(data, stream) {
|
|
46554
|
+
const write = stream.__write || stream.write;
|
|
46555
|
+
return write.call(stream, data);
|
|
46556
|
+
}
|
|
46557
|
+
|
|
46558
|
+
const bracket = (x) => x ? `[${x}]` : "";
|
|
46559
|
+
class BasicReporter {
|
|
46560
|
+
formatStack(stack, message, opts) {
|
|
46561
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
46562
|
+
return indent + parseStack(stack, message).join(`
|
|
46563
|
+
${indent}`);
|
|
46564
|
+
}
|
|
46565
|
+
formatError(err, opts) {
|
|
46566
|
+
const message = err.message ?? (0,external_node_util_.formatWithOptions)(opts, err);
|
|
46567
|
+
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
46568
|
+
const level = opts?.errorLevel || 0;
|
|
46569
|
+
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
46570
|
+
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
|
|
46571
|
+
return causedPrefix + message + "\n" + stack + causedError;
|
|
46572
|
+
}
|
|
46573
|
+
formatArgs(args, opts) {
|
|
46574
|
+
const _args = args.map((arg) => {
|
|
46575
|
+
if (arg && typeof arg.stack === "string") {
|
|
46576
|
+
return this.formatError(arg, opts);
|
|
46577
|
+
}
|
|
46578
|
+
return arg;
|
|
46579
|
+
});
|
|
46580
|
+
return (0,external_node_util_.formatWithOptions)(opts, ..._args);
|
|
46581
|
+
}
|
|
46582
|
+
formatDate(date, opts) {
|
|
46583
|
+
return opts.date ? date.toLocaleTimeString() : "";
|
|
46584
|
+
}
|
|
46585
|
+
filterAndJoin(arr) {
|
|
46586
|
+
return arr.filter(Boolean).join(" ");
|
|
46587
|
+
}
|
|
46588
|
+
formatLogObj(logObj, opts) {
|
|
46589
|
+
const message = this.formatArgs(logObj.args, opts);
|
|
46590
|
+
if (logObj.type === "box") {
|
|
46591
|
+
return "\n" + [
|
|
46592
|
+
bracket(logObj.tag),
|
|
46593
|
+
logObj.title && logObj.title,
|
|
46594
|
+
...message.split("\n")
|
|
46595
|
+
].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
|
|
46596
|
+
}
|
|
46597
|
+
return this.filterAndJoin([
|
|
46598
|
+
bracket(logObj.type),
|
|
46599
|
+
bracket(logObj.tag),
|
|
46600
|
+
message
|
|
46601
|
+
]);
|
|
46602
|
+
}
|
|
46603
|
+
log(logObj, ctx) {
|
|
46604
|
+
const line = this.formatLogObj(logObj, {
|
|
46605
|
+
columns: ctx.options.stdout.columns || 0,
|
|
46606
|
+
...ctx.options.formatOptions
|
|
46607
|
+
});
|
|
46608
|
+
return writeStream(
|
|
46609
|
+
line + "\n",
|
|
46610
|
+
logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
|
|
46611
|
+
);
|
|
46612
|
+
}
|
|
46613
|
+
}
|
|
46614
|
+
|
|
46615
|
+
|
|
46616
|
+
|
|
46617
|
+
// EXTERNAL MODULE: external "node:tty"
|
|
46618
|
+
var external_node_tty_ = __webpack_require__(7066);
|
|
46619
|
+
var external_node_tty_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_node_tty_, 2);
|
|
46620
|
+
;// CONCATENATED MODULE: ../../node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
|
|
46621
|
+
|
|
46622
|
+
|
|
46623
|
+
const {
|
|
46624
|
+
env: consola_DXBYu_KD_env = {},
|
|
46625
|
+
argv = [],
|
|
46626
|
+
platform = ""
|
|
46627
|
+
} = typeof process === "undefined" ? {} : process;
|
|
46628
|
+
const isDisabled = "NO_COLOR" in consola_DXBYu_KD_env || argv.includes("--no-color");
|
|
46629
|
+
const isForced = "FORCE_COLOR" in consola_DXBYu_KD_env || argv.includes("--color");
|
|
46630
|
+
const consola_DXBYu_KD_isWindows = platform === "win32";
|
|
46631
|
+
const isDumbTerminal = consola_DXBYu_KD_env.TERM === "dumb";
|
|
46632
|
+
const isCompatibleTerminal = external_node_tty_namespaceObject && external_node_tty_.isatty && external_node_tty_.isatty(1) && consola_DXBYu_KD_env.TERM && !isDumbTerminal;
|
|
46633
|
+
const isCI = "CI" in consola_DXBYu_KD_env && ("GITHUB_ACTIONS" in consola_DXBYu_KD_env || "GITLAB_CI" in consola_DXBYu_KD_env || "CIRCLECI" in consola_DXBYu_KD_env);
|
|
46634
|
+
const isColorSupported = !isDisabled && (isForced || consola_DXBYu_KD_isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
46635
|
+
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
46636
|
+
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
46637
|
+
}
|
|
46638
|
+
function clearBleed(index, string, open, close, replace) {
|
|
46639
|
+
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
46640
|
+
}
|
|
46641
|
+
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
46642
|
+
return (string) => string || !(string === "" || string === void 0) ? clearBleed(
|
|
46643
|
+
("" + string).indexOf(close, at),
|
|
46644
|
+
string,
|
|
46645
|
+
open,
|
|
46646
|
+
close,
|
|
46647
|
+
replace
|
|
46648
|
+
) : "";
|
|
46649
|
+
}
|
|
46650
|
+
function consola_DXBYu_KD_init(open, close, replace) {
|
|
46651
|
+
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
46652
|
+
}
|
|
46653
|
+
const colorDefs = {
|
|
46654
|
+
reset: consola_DXBYu_KD_init(0, 0),
|
|
46655
|
+
bold: consola_DXBYu_KD_init(1, 22, "\x1B[22m\x1B[1m"),
|
|
46656
|
+
dim: consola_DXBYu_KD_init(2, 22, "\x1B[22m\x1B[2m"),
|
|
46657
|
+
italic: consola_DXBYu_KD_init(3, 23),
|
|
46658
|
+
underline: consola_DXBYu_KD_init(4, 24),
|
|
46659
|
+
inverse: consola_DXBYu_KD_init(7, 27),
|
|
46660
|
+
hidden: consola_DXBYu_KD_init(8, 28),
|
|
46661
|
+
strikethrough: consola_DXBYu_KD_init(9, 29),
|
|
46662
|
+
black: consola_DXBYu_KD_init(30, 39),
|
|
46663
|
+
red: consola_DXBYu_KD_init(31, 39),
|
|
46664
|
+
green: consola_DXBYu_KD_init(32, 39),
|
|
46665
|
+
yellow: consola_DXBYu_KD_init(33, 39),
|
|
46666
|
+
blue: consola_DXBYu_KD_init(34, 39),
|
|
46667
|
+
magenta: consola_DXBYu_KD_init(35, 39),
|
|
46668
|
+
cyan: consola_DXBYu_KD_init(36, 39),
|
|
46669
|
+
white: consola_DXBYu_KD_init(37, 39),
|
|
46670
|
+
gray: consola_DXBYu_KD_init(90, 39),
|
|
46671
|
+
bgBlack: consola_DXBYu_KD_init(40, 49),
|
|
46672
|
+
bgRed: consola_DXBYu_KD_init(41, 49),
|
|
46673
|
+
bgGreen: consola_DXBYu_KD_init(42, 49),
|
|
46674
|
+
bgYellow: consola_DXBYu_KD_init(43, 49),
|
|
46675
|
+
bgBlue: consola_DXBYu_KD_init(44, 49),
|
|
46676
|
+
bgMagenta: consola_DXBYu_KD_init(45, 49),
|
|
46677
|
+
bgCyan: consola_DXBYu_KD_init(46, 49),
|
|
46678
|
+
bgWhite: consola_DXBYu_KD_init(47, 49),
|
|
46679
|
+
blackBright: consola_DXBYu_KD_init(90, 39),
|
|
46680
|
+
redBright: consola_DXBYu_KD_init(91, 39),
|
|
46681
|
+
greenBright: consola_DXBYu_KD_init(92, 39),
|
|
46682
|
+
yellowBright: consola_DXBYu_KD_init(93, 39),
|
|
46683
|
+
blueBright: consola_DXBYu_KD_init(94, 39),
|
|
46684
|
+
magentaBright: consola_DXBYu_KD_init(95, 39),
|
|
46685
|
+
cyanBright: consola_DXBYu_KD_init(96, 39),
|
|
46686
|
+
whiteBright: consola_DXBYu_KD_init(97, 39),
|
|
46687
|
+
bgBlackBright: consola_DXBYu_KD_init(100, 49),
|
|
46688
|
+
bgRedBright: consola_DXBYu_KD_init(101, 49),
|
|
46689
|
+
bgGreenBright: consola_DXBYu_KD_init(102, 49),
|
|
46690
|
+
bgYellowBright: consola_DXBYu_KD_init(103, 49),
|
|
46691
|
+
bgBlueBright: consola_DXBYu_KD_init(104, 49),
|
|
46692
|
+
bgMagentaBright: consola_DXBYu_KD_init(105, 49),
|
|
46693
|
+
bgCyanBright: consola_DXBYu_KD_init(106, 49),
|
|
46694
|
+
bgWhiteBright: consola_DXBYu_KD_init(107, 49)
|
|
46695
|
+
};
|
|
46696
|
+
function createColors(useColor = isColorSupported) {
|
|
46697
|
+
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
46698
|
+
}
|
|
46699
|
+
const colors = createColors();
|
|
46700
|
+
function getColor(color, fallback = "reset") {
|
|
46701
|
+
return colors[color] || colors[fallback];
|
|
46702
|
+
}
|
|
46703
|
+
function colorize(color, text) {
|
|
46704
|
+
return getColor(color)(text);
|
|
46705
|
+
}
|
|
46706
|
+
|
|
46707
|
+
const ansiRegex = [
|
|
46708
|
+
String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
|
|
46709
|
+
String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
|
|
46710
|
+
].join("|");
|
|
46711
|
+
function stripAnsi(text) {
|
|
46712
|
+
return text.replace(new RegExp(ansiRegex, "g"), "");
|
|
46713
|
+
}
|
|
46714
|
+
function centerAlign(str, len, space = " ") {
|
|
46715
|
+
const free = len - str.length;
|
|
46716
|
+
if (free <= 0) {
|
|
46717
|
+
return str;
|
|
46718
|
+
}
|
|
46719
|
+
const freeLeft = Math.floor(free / 2);
|
|
46720
|
+
let _str = "";
|
|
46721
|
+
for (let i = 0; i < len; i++) {
|
|
46722
|
+
_str += i < freeLeft || i >= freeLeft + str.length ? space : str[i - freeLeft];
|
|
46723
|
+
}
|
|
46724
|
+
return _str;
|
|
46725
|
+
}
|
|
46726
|
+
function rightAlign(str, len, space = " ") {
|
|
46727
|
+
const free = len - str.length;
|
|
46728
|
+
if (free <= 0) {
|
|
46729
|
+
return str;
|
|
46730
|
+
}
|
|
46731
|
+
let _str = "";
|
|
46732
|
+
for (let i = 0; i < len; i++) {
|
|
46733
|
+
_str += i < free ? space : str[i - free];
|
|
46734
|
+
}
|
|
46735
|
+
return _str;
|
|
46736
|
+
}
|
|
46737
|
+
function leftAlign(str, len, space = " ") {
|
|
46738
|
+
let _str = "";
|
|
46739
|
+
for (let i = 0; i < len; i++) {
|
|
46740
|
+
_str += i < str.length ? str[i] : space;
|
|
46741
|
+
}
|
|
46742
|
+
return _str;
|
|
46743
|
+
}
|
|
46744
|
+
function align(alignment, str, len, space = " ") {
|
|
46745
|
+
switch (alignment) {
|
|
46746
|
+
case "left": {
|
|
46747
|
+
return leftAlign(str, len, space);
|
|
46748
|
+
}
|
|
46749
|
+
case "right": {
|
|
46750
|
+
return rightAlign(str, len, space);
|
|
46751
|
+
}
|
|
46752
|
+
case "center": {
|
|
46753
|
+
return centerAlign(str, len, space);
|
|
46754
|
+
}
|
|
46755
|
+
default: {
|
|
46756
|
+
return str;
|
|
46757
|
+
}
|
|
46758
|
+
}
|
|
46759
|
+
}
|
|
46760
|
+
|
|
46761
|
+
const boxStylePresets = {
|
|
46762
|
+
solid: {
|
|
46763
|
+
tl: "\u250C",
|
|
46764
|
+
tr: "\u2510",
|
|
46765
|
+
bl: "\u2514",
|
|
46766
|
+
br: "\u2518",
|
|
46767
|
+
h: "\u2500",
|
|
46768
|
+
v: "\u2502"
|
|
46769
|
+
},
|
|
46770
|
+
double: {
|
|
46771
|
+
tl: "\u2554",
|
|
46772
|
+
tr: "\u2557",
|
|
46773
|
+
bl: "\u255A",
|
|
46774
|
+
br: "\u255D",
|
|
46775
|
+
h: "\u2550",
|
|
46776
|
+
v: "\u2551"
|
|
46777
|
+
},
|
|
46778
|
+
doubleSingle: {
|
|
46779
|
+
tl: "\u2553",
|
|
46780
|
+
tr: "\u2556",
|
|
46781
|
+
bl: "\u2559",
|
|
46782
|
+
br: "\u255C",
|
|
46783
|
+
h: "\u2500",
|
|
46784
|
+
v: "\u2551"
|
|
46785
|
+
},
|
|
46786
|
+
doubleSingleRounded: {
|
|
46787
|
+
tl: "\u256D",
|
|
46788
|
+
tr: "\u256E",
|
|
46789
|
+
bl: "\u2570",
|
|
46790
|
+
br: "\u256F",
|
|
46791
|
+
h: "\u2500",
|
|
46792
|
+
v: "\u2551"
|
|
46793
|
+
},
|
|
46794
|
+
singleThick: {
|
|
46795
|
+
tl: "\u250F",
|
|
46796
|
+
tr: "\u2513",
|
|
46797
|
+
bl: "\u2517",
|
|
46798
|
+
br: "\u251B",
|
|
46799
|
+
h: "\u2501",
|
|
46800
|
+
v: "\u2503"
|
|
46801
|
+
},
|
|
46802
|
+
singleDouble: {
|
|
46803
|
+
tl: "\u2552",
|
|
46804
|
+
tr: "\u2555",
|
|
46805
|
+
bl: "\u2558",
|
|
46806
|
+
br: "\u255B",
|
|
46807
|
+
h: "\u2550",
|
|
46808
|
+
v: "\u2502"
|
|
46809
|
+
},
|
|
46810
|
+
singleDoubleRounded: {
|
|
46811
|
+
tl: "\u256D",
|
|
46812
|
+
tr: "\u256E",
|
|
46813
|
+
bl: "\u2570",
|
|
46814
|
+
br: "\u256F",
|
|
46815
|
+
h: "\u2550",
|
|
46816
|
+
v: "\u2502"
|
|
46817
|
+
},
|
|
46818
|
+
rounded: {
|
|
46819
|
+
tl: "\u256D",
|
|
46820
|
+
tr: "\u256E",
|
|
46821
|
+
bl: "\u2570",
|
|
46822
|
+
br: "\u256F",
|
|
46823
|
+
h: "\u2500",
|
|
46824
|
+
v: "\u2502"
|
|
46825
|
+
}
|
|
46826
|
+
};
|
|
46827
|
+
const defaultStyle = {
|
|
46828
|
+
borderColor: "white",
|
|
46829
|
+
borderStyle: "rounded",
|
|
46830
|
+
valign: "center",
|
|
46831
|
+
padding: 2,
|
|
46832
|
+
marginLeft: 1,
|
|
46833
|
+
marginTop: 1,
|
|
46834
|
+
marginBottom: 1
|
|
46835
|
+
};
|
|
46836
|
+
function box(text, _opts = {}) {
|
|
46837
|
+
const opts = {
|
|
46838
|
+
..._opts,
|
|
46839
|
+
style: {
|
|
46840
|
+
...defaultStyle,
|
|
46841
|
+
..._opts.style
|
|
46842
|
+
}
|
|
46843
|
+
};
|
|
46844
|
+
const textLines = text.split("\n");
|
|
46845
|
+
const boxLines = [];
|
|
46846
|
+
const _color = getColor(opts.style.borderColor);
|
|
46847
|
+
const borderStyle = {
|
|
46848
|
+
...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
|
|
46849
|
+
};
|
|
46850
|
+
if (_color) {
|
|
46851
|
+
for (const key in borderStyle) {
|
|
46852
|
+
borderStyle[key] = _color(
|
|
46853
|
+
borderStyle[key]
|
|
46854
|
+
);
|
|
46855
|
+
}
|
|
46856
|
+
}
|
|
46857
|
+
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
46858
|
+
const height = textLines.length + paddingOffset;
|
|
46859
|
+
const width = Math.max(
|
|
46860
|
+
...textLines.map((line) => stripAnsi(line).length),
|
|
46861
|
+
opts.title ? stripAnsi(opts.title).length : 0
|
|
46862
|
+
) + paddingOffset;
|
|
46863
|
+
const widthOffset = width + paddingOffset;
|
|
46864
|
+
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
46865
|
+
if (opts.style.marginTop > 0) {
|
|
46866
|
+
boxLines.push("".repeat(opts.style.marginTop));
|
|
46867
|
+
}
|
|
46868
|
+
if (opts.title) {
|
|
46869
|
+
const title = _color ? _color(opts.title) : opts.title;
|
|
46870
|
+
const left = borderStyle.h.repeat(
|
|
46871
|
+
Math.floor((width - stripAnsi(opts.title).length) / 2)
|
|
46872
|
+
);
|
|
46873
|
+
const right = borderStyle.h.repeat(
|
|
46874
|
+
width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
|
|
46875
|
+
);
|
|
46876
|
+
boxLines.push(
|
|
46877
|
+
`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
|
|
46878
|
+
);
|
|
46879
|
+
} else {
|
|
46880
|
+
boxLines.push(
|
|
46881
|
+
`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
|
|
46882
|
+
);
|
|
46883
|
+
}
|
|
46884
|
+
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
46885
|
+
for (let i = 0; i < height; i++) {
|
|
46886
|
+
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
46887
|
+
boxLines.push(
|
|
46888
|
+
`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
|
|
46889
|
+
);
|
|
46890
|
+
} else {
|
|
46891
|
+
const line = textLines[i - valignOffset];
|
|
46892
|
+
const left = " ".repeat(paddingOffset);
|
|
46893
|
+
const right = " ".repeat(width - stripAnsi(line).length);
|
|
46894
|
+
boxLines.push(
|
|
46895
|
+
`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
|
|
46896
|
+
);
|
|
46897
|
+
}
|
|
46898
|
+
}
|
|
46899
|
+
boxLines.push(
|
|
46900
|
+
`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
|
|
46901
|
+
);
|
|
46902
|
+
if (opts.style.marginBottom > 0) {
|
|
46903
|
+
boxLines.push("".repeat(opts.style.marginBottom));
|
|
46904
|
+
}
|
|
46905
|
+
return boxLines.join("\n");
|
|
46906
|
+
}
|
|
46907
|
+
|
|
46908
|
+
|
|
46909
|
+
|
|
46910
|
+
;// CONCATENATED MODULE: ../../node_modules/consola/dist/index.mjs
|
|
46911
|
+
|
|
46912
|
+
|
|
46913
|
+
|
|
46914
|
+
|
|
46915
|
+
|
|
46916
|
+
|
|
46917
|
+
|
|
46918
|
+
|
|
46919
|
+
|
|
46920
|
+
const dist_r=Object.create(null),dist_i=e=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?dist_r:globalThis),dist_o=new Proxy(dist_r,{get(e,s){return dist_i()[s]??dist_r[s]},has(e,s){const E=dist_i();return s in E||s in dist_r},set(e,s,E){const B=dist_i(true);return B[s]=E,true},deleteProperty(e,s){if(!s)return false;const E=dist_i(true);return delete E[s],true},ownKeys(){const e=dist_i(true);return Object.keys(e)}}),dist_t=typeof process<"u"&&process.env&&"production"||"",dist_f=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:true}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:true}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:false}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:false}],["VERCEL","VERCEL_ENV",{ci:false}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:false}],["CODESANDBOX","CODESANDBOX_HOST",{ci:false}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:true}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:true}]];function dist_b(){if(globalThis.process?.env)for(const e of dist_f){const s=e[1]||e[0];if(globalThis.process?.env[s])return {name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:false}:{name:"",ci:false}}const dist_l=dist_b();dist_l.name;function dist_n(e){return e?e!=="false":false}const I=globalThis.process?.platform||"",T=dist_n(dist_o.CI)||dist_l.ci!==false,dist_a=dist_n(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),g=dist_n(dist_o.DEBUG),R=dist_t==="test"||dist_n(dist_o.TEST);dist_n(dist_o.MINIMAL)||T||R||!dist_a;const A=/^win/i.test(I);!dist_n(dist_o.NO_COLOR)&&(dist_n(dist_o.FORCE_COLOR)||(dist_a||A)&&dist_o.TERM!=="dumb"||T);const C=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(C?.split(".")[0])||null;const y=globalThis.process||Object.create(null),dist_={versions:{}};new Proxy(y,{get(e,s){if(s==="env")return dist_o;if(s in e)return e[s];if(s in dist_)return dist_[s]}});const dist_c=globalThis.process?.release?.name==="node",O=!!globalThis.Bun||!!globalThis.process?.versions?.bun,D=!!globalThis.Deno,L=!!globalThis.fastly,S=!!globalThis.Netlify,dist_u=!!globalThis.EdgeRuntime,N=globalThis.navigator?.userAgent==="Cloudflare-Workers",dist_F=[[S,"netlify"],[dist_u,"edge-light"],[N,"workerd"],[L,"fastly"],[D,"deno"],[O,"bun"],[dist_c,"node"]];function G(){const e=dist_F.find(s=>s[0]);if(e)return {name:e[1]}}const P=G();P?.name||"";
|
|
46921
|
+
|
|
46922
|
+
function dist_ansiRegex({onlyFirst = false} = {}) {
|
|
46923
|
+
// Valid string terminator sequences are BEL, ESC\, and 0x9c
|
|
46924
|
+
const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
|
|
46925
|
+
const pattern = [
|
|
46926
|
+
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
|
|
46927
|
+
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
|
|
46928
|
+
].join('|');
|
|
46929
|
+
|
|
46930
|
+
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
46931
|
+
}
|
|
46932
|
+
|
|
46933
|
+
const dist_regex = dist_ansiRegex();
|
|
46934
|
+
|
|
46935
|
+
function dist_stripAnsi(string) {
|
|
46936
|
+
if (typeof string !== 'string') {
|
|
46937
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
46938
|
+
}
|
|
46939
|
+
|
|
46940
|
+
// Even though the regex is global, we don't need to reset the `.lastIndex`
|
|
46941
|
+
// because unlike `.exec()` and `.test()`, `.replace()` does it automatically
|
|
46942
|
+
// and doing it manually has a performance penalty.
|
|
46943
|
+
return string.replace(dist_regex, '');
|
|
46944
|
+
}
|
|
46945
|
+
|
|
46946
|
+
// Generated code.
|
|
46947
|
+
|
|
46948
|
+
function isAmbiguous(x) {
|
|
46949
|
+
return x === 0xA1
|
|
46950
|
+
|| x === 0xA4
|
|
46951
|
+
|| x === 0xA7
|
|
46952
|
+
|| x === 0xA8
|
|
46953
|
+
|| x === 0xAA
|
|
46954
|
+
|| x === 0xAD
|
|
46955
|
+
|| x === 0xAE
|
|
46956
|
+
|| x >= 0xB0 && x <= 0xB4
|
|
46957
|
+
|| x >= 0xB6 && x <= 0xBA
|
|
46958
|
+
|| x >= 0xBC && x <= 0xBF
|
|
46959
|
+
|| x === 0xC6
|
|
46960
|
+
|| x === 0xD0
|
|
46961
|
+
|| x === 0xD7
|
|
46962
|
+
|| x === 0xD8
|
|
46963
|
+
|| x >= 0xDE && x <= 0xE1
|
|
46964
|
+
|| x === 0xE6
|
|
46965
|
+
|| x >= 0xE8 && x <= 0xEA
|
|
46966
|
+
|| x === 0xEC
|
|
46967
|
+
|| x === 0xED
|
|
46968
|
+
|| x === 0xF0
|
|
46969
|
+
|| x === 0xF2
|
|
46970
|
+
|| x === 0xF3
|
|
46971
|
+
|| x >= 0xF7 && x <= 0xFA
|
|
46972
|
+
|| x === 0xFC
|
|
46973
|
+
|| x === 0xFE
|
|
46974
|
+
|| x === 0x101
|
|
46975
|
+
|| x === 0x111
|
|
46976
|
+
|| x === 0x113
|
|
46977
|
+
|| x === 0x11B
|
|
46978
|
+
|| x === 0x126
|
|
46979
|
+
|| x === 0x127
|
|
46980
|
+
|| x === 0x12B
|
|
46981
|
+
|| x >= 0x131 && x <= 0x133
|
|
46982
|
+
|| x === 0x138
|
|
46983
|
+
|| x >= 0x13F && x <= 0x142
|
|
46984
|
+
|| x === 0x144
|
|
46985
|
+
|| x >= 0x148 && x <= 0x14B
|
|
46986
|
+
|| x === 0x14D
|
|
46987
|
+
|| x === 0x152
|
|
46988
|
+
|| x === 0x153
|
|
46989
|
+
|| x === 0x166
|
|
46990
|
+
|| x === 0x167
|
|
46991
|
+
|| x === 0x16B
|
|
46992
|
+
|| x === 0x1CE
|
|
46993
|
+
|| x === 0x1D0
|
|
46994
|
+
|| x === 0x1D2
|
|
46995
|
+
|| x === 0x1D4
|
|
46996
|
+
|| x === 0x1D6
|
|
46997
|
+
|| x === 0x1D8
|
|
46998
|
+
|| x === 0x1DA
|
|
46999
|
+
|| x === 0x1DC
|
|
47000
|
+
|| x === 0x251
|
|
47001
|
+
|| x === 0x261
|
|
47002
|
+
|| x === 0x2C4
|
|
47003
|
+
|| x === 0x2C7
|
|
47004
|
+
|| x >= 0x2C9 && x <= 0x2CB
|
|
47005
|
+
|| x === 0x2CD
|
|
47006
|
+
|| x === 0x2D0
|
|
47007
|
+
|| x >= 0x2D8 && x <= 0x2DB
|
|
47008
|
+
|| x === 0x2DD
|
|
47009
|
+
|| x === 0x2DF
|
|
47010
|
+
|| x >= 0x300 && x <= 0x36F
|
|
47011
|
+
|| x >= 0x391 && x <= 0x3A1
|
|
47012
|
+
|| x >= 0x3A3 && x <= 0x3A9
|
|
47013
|
+
|| x >= 0x3B1 && x <= 0x3C1
|
|
47014
|
+
|| x >= 0x3C3 && x <= 0x3C9
|
|
47015
|
+
|| x === 0x401
|
|
47016
|
+
|| x >= 0x410 && x <= 0x44F
|
|
47017
|
+
|| x === 0x451
|
|
47018
|
+
|| x === 0x2010
|
|
47019
|
+
|| x >= 0x2013 && x <= 0x2016
|
|
47020
|
+
|| x === 0x2018
|
|
47021
|
+
|| x === 0x2019
|
|
47022
|
+
|| x === 0x201C
|
|
47023
|
+
|| x === 0x201D
|
|
47024
|
+
|| x >= 0x2020 && x <= 0x2022
|
|
47025
|
+
|| x >= 0x2024 && x <= 0x2027
|
|
47026
|
+
|| x === 0x2030
|
|
47027
|
+
|| x === 0x2032
|
|
47028
|
+
|| x === 0x2033
|
|
47029
|
+
|| x === 0x2035
|
|
47030
|
+
|| x === 0x203B
|
|
47031
|
+
|| x === 0x203E
|
|
47032
|
+
|| x === 0x2074
|
|
47033
|
+
|| x === 0x207F
|
|
47034
|
+
|| x >= 0x2081 && x <= 0x2084
|
|
47035
|
+
|| x === 0x20AC
|
|
47036
|
+
|| x === 0x2103
|
|
47037
|
+
|| x === 0x2105
|
|
47038
|
+
|| x === 0x2109
|
|
47039
|
+
|| x === 0x2113
|
|
47040
|
+
|| x === 0x2116
|
|
47041
|
+
|| x === 0x2121
|
|
47042
|
+
|| x === 0x2122
|
|
47043
|
+
|| x === 0x2126
|
|
47044
|
+
|| x === 0x212B
|
|
47045
|
+
|| x === 0x2153
|
|
47046
|
+
|| x === 0x2154
|
|
47047
|
+
|| x >= 0x215B && x <= 0x215E
|
|
47048
|
+
|| x >= 0x2160 && x <= 0x216B
|
|
47049
|
+
|| x >= 0x2170 && x <= 0x2179
|
|
47050
|
+
|| x === 0x2189
|
|
47051
|
+
|| x >= 0x2190 && x <= 0x2199
|
|
47052
|
+
|| x === 0x21B8
|
|
47053
|
+
|| x === 0x21B9
|
|
47054
|
+
|| x === 0x21D2
|
|
47055
|
+
|| x === 0x21D4
|
|
47056
|
+
|| x === 0x21E7
|
|
47057
|
+
|| x === 0x2200
|
|
47058
|
+
|| x === 0x2202
|
|
47059
|
+
|| x === 0x2203
|
|
47060
|
+
|| x === 0x2207
|
|
47061
|
+
|| x === 0x2208
|
|
47062
|
+
|| x === 0x220B
|
|
47063
|
+
|| x === 0x220F
|
|
47064
|
+
|| x === 0x2211
|
|
47065
|
+
|| x === 0x2215
|
|
47066
|
+
|| x === 0x221A
|
|
47067
|
+
|| x >= 0x221D && x <= 0x2220
|
|
47068
|
+
|| x === 0x2223
|
|
47069
|
+
|| x === 0x2225
|
|
47070
|
+
|| x >= 0x2227 && x <= 0x222C
|
|
47071
|
+
|| x === 0x222E
|
|
47072
|
+
|| x >= 0x2234 && x <= 0x2237
|
|
47073
|
+
|| x === 0x223C
|
|
47074
|
+
|| x === 0x223D
|
|
47075
|
+
|| x === 0x2248
|
|
47076
|
+
|| x === 0x224C
|
|
47077
|
+
|| x === 0x2252
|
|
47078
|
+
|| x === 0x2260
|
|
47079
|
+
|| x === 0x2261
|
|
47080
|
+
|| x >= 0x2264 && x <= 0x2267
|
|
47081
|
+
|| x === 0x226A
|
|
47082
|
+
|| x === 0x226B
|
|
47083
|
+
|| x === 0x226E
|
|
47084
|
+
|| x === 0x226F
|
|
47085
|
+
|| x === 0x2282
|
|
47086
|
+
|| x === 0x2283
|
|
47087
|
+
|| x === 0x2286
|
|
47088
|
+
|| x === 0x2287
|
|
47089
|
+
|| x === 0x2295
|
|
47090
|
+
|| x === 0x2299
|
|
47091
|
+
|| x === 0x22A5
|
|
47092
|
+
|| x === 0x22BF
|
|
47093
|
+
|| x === 0x2312
|
|
47094
|
+
|| x >= 0x2460 && x <= 0x24E9
|
|
47095
|
+
|| x >= 0x24EB && x <= 0x254B
|
|
47096
|
+
|| x >= 0x2550 && x <= 0x2573
|
|
47097
|
+
|| x >= 0x2580 && x <= 0x258F
|
|
47098
|
+
|| x >= 0x2592 && x <= 0x2595
|
|
47099
|
+
|| x === 0x25A0
|
|
47100
|
+
|| x === 0x25A1
|
|
47101
|
+
|| x >= 0x25A3 && x <= 0x25A9
|
|
47102
|
+
|| x === 0x25B2
|
|
47103
|
+
|| x === 0x25B3
|
|
47104
|
+
|| x === 0x25B6
|
|
47105
|
+
|| x === 0x25B7
|
|
47106
|
+
|| x === 0x25BC
|
|
47107
|
+
|| x === 0x25BD
|
|
47108
|
+
|| x === 0x25C0
|
|
47109
|
+
|| x === 0x25C1
|
|
47110
|
+
|| x >= 0x25C6 && x <= 0x25C8
|
|
47111
|
+
|| x === 0x25CB
|
|
47112
|
+
|| x >= 0x25CE && x <= 0x25D1
|
|
47113
|
+
|| x >= 0x25E2 && x <= 0x25E5
|
|
47114
|
+
|| x === 0x25EF
|
|
47115
|
+
|| x === 0x2605
|
|
47116
|
+
|| x === 0x2606
|
|
47117
|
+
|| x === 0x2609
|
|
47118
|
+
|| x === 0x260E
|
|
47119
|
+
|| x === 0x260F
|
|
47120
|
+
|| x === 0x261C
|
|
47121
|
+
|| x === 0x261E
|
|
47122
|
+
|| x === 0x2640
|
|
47123
|
+
|| x === 0x2642
|
|
47124
|
+
|| x === 0x2660
|
|
47125
|
+
|| x === 0x2661
|
|
47126
|
+
|| x >= 0x2663 && x <= 0x2665
|
|
47127
|
+
|| x >= 0x2667 && x <= 0x266A
|
|
47128
|
+
|| x === 0x266C
|
|
47129
|
+
|| x === 0x266D
|
|
47130
|
+
|| x === 0x266F
|
|
47131
|
+
|| x === 0x269E
|
|
47132
|
+
|| x === 0x269F
|
|
47133
|
+
|| x === 0x26BF
|
|
47134
|
+
|| x >= 0x26C6 && x <= 0x26CD
|
|
47135
|
+
|| x >= 0x26CF && x <= 0x26D3
|
|
47136
|
+
|| x >= 0x26D5 && x <= 0x26E1
|
|
47137
|
+
|| x === 0x26E3
|
|
47138
|
+
|| x === 0x26E8
|
|
47139
|
+
|| x === 0x26E9
|
|
47140
|
+
|| x >= 0x26EB && x <= 0x26F1
|
|
47141
|
+
|| x === 0x26F4
|
|
47142
|
+
|| x >= 0x26F6 && x <= 0x26F9
|
|
47143
|
+
|| x === 0x26FB
|
|
47144
|
+
|| x === 0x26FC
|
|
47145
|
+
|| x === 0x26FE
|
|
47146
|
+
|| x === 0x26FF
|
|
47147
|
+
|| x === 0x273D
|
|
47148
|
+
|| x >= 0x2776 && x <= 0x277F
|
|
47149
|
+
|| x >= 0x2B56 && x <= 0x2B59
|
|
47150
|
+
|| x >= 0x3248 && x <= 0x324F
|
|
47151
|
+
|| x >= 0xE000 && x <= 0xF8FF
|
|
47152
|
+
|| x >= 0xFE00 && x <= 0xFE0F
|
|
47153
|
+
|| x === 0xFFFD
|
|
47154
|
+
|| x >= 0x1F100 && x <= 0x1F10A
|
|
47155
|
+
|| x >= 0x1F110 && x <= 0x1F12D
|
|
47156
|
+
|| x >= 0x1F130 && x <= 0x1F169
|
|
47157
|
+
|| x >= 0x1F170 && x <= 0x1F18D
|
|
47158
|
+
|| x === 0x1F18F
|
|
47159
|
+
|| x === 0x1F190
|
|
47160
|
+
|| x >= 0x1F19B && x <= 0x1F1AC
|
|
47161
|
+
|| x >= 0xE0100 && x <= 0xE01EF
|
|
47162
|
+
|| x >= 0xF0000 && x <= 0xFFFFD
|
|
47163
|
+
|| x >= 0x100000 && x <= 0x10FFFD;
|
|
47164
|
+
}
|
|
47165
|
+
|
|
47166
|
+
function isFullWidth(x) {
|
|
47167
|
+
return x === 0x3000
|
|
47168
|
+
|| x >= 0xFF01 && x <= 0xFF60
|
|
47169
|
+
|| x >= 0xFFE0 && x <= 0xFFE6;
|
|
47170
|
+
}
|
|
47171
|
+
|
|
47172
|
+
function isWide(x) {
|
|
47173
|
+
return x >= 0x1100 && x <= 0x115F
|
|
47174
|
+
|| x === 0x231A
|
|
47175
|
+
|| x === 0x231B
|
|
47176
|
+
|| x === 0x2329
|
|
47177
|
+
|| x === 0x232A
|
|
47178
|
+
|| x >= 0x23E9 && x <= 0x23EC
|
|
47179
|
+
|| x === 0x23F0
|
|
47180
|
+
|| x === 0x23F3
|
|
47181
|
+
|| x === 0x25FD
|
|
47182
|
+
|| x === 0x25FE
|
|
47183
|
+
|| x === 0x2614
|
|
47184
|
+
|| x === 0x2615
|
|
47185
|
+
|| x >= 0x2630 && x <= 0x2637
|
|
47186
|
+
|| x >= 0x2648 && x <= 0x2653
|
|
47187
|
+
|| x === 0x267F
|
|
47188
|
+
|| x >= 0x268A && x <= 0x268F
|
|
47189
|
+
|| x === 0x2693
|
|
47190
|
+
|| x === 0x26A1
|
|
47191
|
+
|| x === 0x26AA
|
|
47192
|
+
|| x === 0x26AB
|
|
47193
|
+
|| x === 0x26BD
|
|
47194
|
+
|| x === 0x26BE
|
|
47195
|
+
|| x === 0x26C4
|
|
47196
|
+
|| x === 0x26C5
|
|
47197
|
+
|| x === 0x26CE
|
|
47198
|
+
|| x === 0x26D4
|
|
47199
|
+
|| x === 0x26EA
|
|
47200
|
+
|| x === 0x26F2
|
|
47201
|
+
|| x === 0x26F3
|
|
47202
|
+
|| x === 0x26F5
|
|
47203
|
+
|| x === 0x26FA
|
|
47204
|
+
|| x === 0x26FD
|
|
47205
|
+
|| x === 0x2705
|
|
47206
|
+
|| x === 0x270A
|
|
47207
|
+
|| x === 0x270B
|
|
47208
|
+
|| x === 0x2728
|
|
47209
|
+
|| x === 0x274C
|
|
47210
|
+
|| x === 0x274E
|
|
47211
|
+
|| x >= 0x2753 && x <= 0x2755
|
|
47212
|
+
|| x === 0x2757
|
|
47213
|
+
|| x >= 0x2795 && x <= 0x2797
|
|
47214
|
+
|| x === 0x27B0
|
|
47215
|
+
|| x === 0x27BF
|
|
47216
|
+
|| x === 0x2B1B
|
|
47217
|
+
|| x === 0x2B1C
|
|
47218
|
+
|| x === 0x2B50
|
|
47219
|
+
|| x === 0x2B55
|
|
47220
|
+
|| x >= 0x2E80 && x <= 0x2E99
|
|
47221
|
+
|| x >= 0x2E9B && x <= 0x2EF3
|
|
47222
|
+
|| x >= 0x2F00 && x <= 0x2FD5
|
|
47223
|
+
|| x >= 0x2FF0 && x <= 0x2FFF
|
|
47224
|
+
|| x >= 0x3001 && x <= 0x303E
|
|
47225
|
+
|| x >= 0x3041 && x <= 0x3096
|
|
47226
|
+
|| x >= 0x3099 && x <= 0x30FF
|
|
47227
|
+
|| x >= 0x3105 && x <= 0x312F
|
|
47228
|
+
|| x >= 0x3131 && x <= 0x318E
|
|
47229
|
+
|| x >= 0x3190 && x <= 0x31E5
|
|
47230
|
+
|| x >= 0x31EF && x <= 0x321E
|
|
47231
|
+
|| x >= 0x3220 && x <= 0x3247
|
|
47232
|
+
|| x >= 0x3250 && x <= 0xA48C
|
|
47233
|
+
|| x >= 0xA490 && x <= 0xA4C6
|
|
47234
|
+
|| x >= 0xA960 && x <= 0xA97C
|
|
47235
|
+
|| x >= 0xAC00 && x <= 0xD7A3
|
|
47236
|
+
|| x >= 0xF900 && x <= 0xFAFF
|
|
47237
|
+
|| x >= 0xFE10 && x <= 0xFE19
|
|
47238
|
+
|| x >= 0xFE30 && x <= 0xFE52
|
|
47239
|
+
|| x >= 0xFE54 && x <= 0xFE66
|
|
47240
|
+
|| x >= 0xFE68 && x <= 0xFE6B
|
|
47241
|
+
|| x >= 0x16FE0 && x <= 0x16FE4
|
|
47242
|
+
|| x === 0x16FF0
|
|
47243
|
+
|| x === 0x16FF1
|
|
47244
|
+
|| x >= 0x17000 && x <= 0x187F7
|
|
47245
|
+
|| x >= 0x18800 && x <= 0x18CD5
|
|
47246
|
+
|| x >= 0x18CFF && x <= 0x18D08
|
|
47247
|
+
|| x >= 0x1AFF0 && x <= 0x1AFF3
|
|
47248
|
+
|| x >= 0x1AFF5 && x <= 0x1AFFB
|
|
47249
|
+
|| x === 0x1AFFD
|
|
47250
|
+
|| x === 0x1AFFE
|
|
47251
|
+
|| x >= 0x1B000 && x <= 0x1B122
|
|
47252
|
+
|| x === 0x1B132
|
|
47253
|
+
|| x >= 0x1B150 && x <= 0x1B152
|
|
47254
|
+
|| x === 0x1B155
|
|
47255
|
+
|| x >= 0x1B164 && x <= 0x1B167
|
|
47256
|
+
|| x >= 0x1B170 && x <= 0x1B2FB
|
|
47257
|
+
|| x >= 0x1D300 && x <= 0x1D356
|
|
47258
|
+
|| x >= 0x1D360 && x <= 0x1D376
|
|
47259
|
+
|| x === 0x1F004
|
|
47260
|
+
|| x === 0x1F0CF
|
|
47261
|
+
|| x === 0x1F18E
|
|
47262
|
+
|| x >= 0x1F191 && x <= 0x1F19A
|
|
47263
|
+
|| x >= 0x1F200 && x <= 0x1F202
|
|
47264
|
+
|| x >= 0x1F210 && x <= 0x1F23B
|
|
47265
|
+
|| x >= 0x1F240 && x <= 0x1F248
|
|
47266
|
+
|| x === 0x1F250
|
|
47267
|
+
|| x === 0x1F251
|
|
47268
|
+
|| x >= 0x1F260 && x <= 0x1F265
|
|
47269
|
+
|| x >= 0x1F300 && x <= 0x1F320
|
|
47270
|
+
|| x >= 0x1F32D && x <= 0x1F335
|
|
47271
|
+
|| x >= 0x1F337 && x <= 0x1F37C
|
|
47272
|
+
|| x >= 0x1F37E && x <= 0x1F393
|
|
47273
|
+
|| x >= 0x1F3A0 && x <= 0x1F3CA
|
|
47274
|
+
|| x >= 0x1F3CF && x <= 0x1F3D3
|
|
47275
|
+
|| x >= 0x1F3E0 && x <= 0x1F3F0
|
|
47276
|
+
|| x === 0x1F3F4
|
|
47277
|
+
|| x >= 0x1F3F8 && x <= 0x1F43E
|
|
47278
|
+
|| x === 0x1F440
|
|
47279
|
+
|| x >= 0x1F442 && x <= 0x1F4FC
|
|
47280
|
+
|| x >= 0x1F4FF && x <= 0x1F53D
|
|
47281
|
+
|| x >= 0x1F54B && x <= 0x1F54E
|
|
47282
|
+
|| x >= 0x1F550 && x <= 0x1F567
|
|
47283
|
+
|| x === 0x1F57A
|
|
47284
|
+
|| x === 0x1F595
|
|
47285
|
+
|| x === 0x1F596
|
|
47286
|
+
|| x === 0x1F5A4
|
|
47287
|
+
|| x >= 0x1F5FB && x <= 0x1F64F
|
|
47288
|
+
|| x >= 0x1F680 && x <= 0x1F6C5
|
|
47289
|
+
|| x === 0x1F6CC
|
|
47290
|
+
|| x >= 0x1F6D0 && x <= 0x1F6D2
|
|
47291
|
+
|| x >= 0x1F6D5 && x <= 0x1F6D7
|
|
47292
|
+
|| x >= 0x1F6DC && x <= 0x1F6DF
|
|
47293
|
+
|| x === 0x1F6EB
|
|
47294
|
+
|| x === 0x1F6EC
|
|
47295
|
+
|| x >= 0x1F6F4 && x <= 0x1F6FC
|
|
47296
|
+
|| x >= 0x1F7E0 && x <= 0x1F7EB
|
|
47297
|
+
|| x === 0x1F7F0
|
|
47298
|
+
|| x >= 0x1F90C && x <= 0x1F93A
|
|
47299
|
+
|| x >= 0x1F93C && x <= 0x1F945
|
|
47300
|
+
|| x >= 0x1F947 && x <= 0x1F9FF
|
|
47301
|
+
|| x >= 0x1FA70 && x <= 0x1FA7C
|
|
47302
|
+
|| x >= 0x1FA80 && x <= 0x1FA89
|
|
47303
|
+
|| x >= 0x1FA8F && x <= 0x1FAC6
|
|
47304
|
+
|| x >= 0x1FACE && x <= 0x1FADC
|
|
47305
|
+
|| x >= 0x1FADF && x <= 0x1FAE9
|
|
47306
|
+
|| x >= 0x1FAF0 && x <= 0x1FAF8
|
|
47307
|
+
|| x >= 0x20000 && x <= 0x2FFFD
|
|
47308
|
+
|| x >= 0x30000 && x <= 0x3FFFD;
|
|
47309
|
+
}
|
|
47310
|
+
|
|
47311
|
+
function validate(codePoint) {
|
|
47312
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
47313
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
47314
|
+
}
|
|
47315
|
+
}
|
|
47316
|
+
|
|
47317
|
+
function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {
|
|
47318
|
+
validate(codePoint);
|
|
47319
|
+
|
|
47320
|
+
if (
|
|
47321
|
+
isFullWidth(codePoint)
|
|
47322
|
+
|| isWide(codePoint)
|
|
47323
|
+
|| (ambiguousAsWide && isAmbiguous(codePoint))
|
|
47324
|
+
) {
|
|
47325
|
+
return 2;
|
|
47326
|
+
}
|
|
47327
|
+
|
|
47328
|
+
return 1;
|
|
47329
|
+
}
|
|
47330
|
+
|
|
47331
|
+
const dist_emojiRegex = () => {
|
|
47332
|
+
// https://mths.be/emoji
|
|
47333
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
47334
|
+
};
|
|
47335
|
+
|
|
47336
|
+
const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split('') };
|
|
47337
|
+
|
|
47338
|
+
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
47339
|
+
|
|
47340
|
+
function stringWidth$1(string, options = {}) {
|
|
47341
|
+
if (typeof string !== 'string' || string.length === 0) {
|
|
47342
|
+
return 0;
|
|
47343
|
+
}
|
|
47344
|
+
|
|
47345
|
+
const {
|
|
47346
|
+
ambiguousIsNarrow = true,
|
|
47347
|
+
countAnsiEscapeCodes = false,
|
|
47348
|
+
} = options;
|
|
47349
|
+
|
|
47350
|
+
if (!countAnsiEscapeCodes) {
|
|
47351
|
+
string = dist_stripAnsi(string);
|
|
47352
|
+
}
|
|
47353
|
+
|
|
47354
|
+
if (string.length === 0) {
|
|
47355
|
+
return 0;
|
|
47356
|
+
}
|
|
47357
|
+
|
|
47358
|
+
let width = 0;
|
|
47359
|
+
const eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};
|
|
47360
|
+
|
|
47361
|
+
for (const {segment: character} of segmenter.segment(string)) {
|
|
47362
|
+
const codePoint = character.codePointAt(0);
|
|
47363
|
+
|
|
47364
|
+
// Ignore control characters
|
|
47365
|
+
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
|
|
47366
|
+
continue;
|
|
47367
|
+
}
|
|
47368
|
+
|
|
47369
|
+
// Ignore zero-width characters
|
|
47370
|
+
if (
|
|
47371
|
+
(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
|
|
47372
|
+
|| codePoint === 0xFE_FF // Zero-width no-break space
|
|
47373
|
+
) {
|
|
47374
|
+
continue;
|
|
47375
|
+
}
|
|
47376
|
+
|
|
47377
|
+
// Ignore combining characters
|
|
47378
|
+
if (
|
|
47379
|
+
(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks
|
|
47380
|
+
|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended
|
|
47381
|
+
|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement
|
|
47382
|
+
|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols
|
|
47383
|
+
|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks
|
|
47384
|
+
) {
|
|
47385
|
+
continue;
|
|
47386
|
+
}
|
|
47387
|
+
|
|
47388
|
+
// Ignore surrogate pairs
|
|
47389
|
+
if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
|
|
47390
|
+
continue;
|
|
47391
|
+
}
|
|
47392
|
+
|
|
47393
|
+
// Ignore variation selectors
|
|
47394
|
+
if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
|
|
47395
|
+
continue;
|
|
47396
|
+
}
|
|
47397
|
+
|
|
47398
|
+
// This covers some of the above cases, but we still keep them for performance reasons.
|
|
47399
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
47400
|
+
continue;
|
|
47401
|
+
}
|
|
47402
|
+
|
|
47403
|
+
// TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
|
|
47404
|
+
if (dist_emojiRegex().test(character)) {
|
|
47405
|
+
width += 2;
|
|
47406
|
+
continue;
|
|
47407
|
+
}
|
|
47408
|
+
|
|
47409
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
47410
|
+
}
|
|
47411
|
+
|
|
47412
|
+
return width;
|
|
47413
|
+
}
|
|
47414
|
+
|
|
47415
|
+
function isUnicodeSupported() {
|
|
47416
|
+
const {env} = external_node_process_;
|
|
47417
|
+
const {TERM, TERM_PROGRAM} = env;
|
|
47418
|
+
|
|
47419
|
+
if (external_node_process_.platform !== 'win32') {
|
|
47420
|
+
return TERM !== 'linux'; // Linux console (kernel)
|
|
47421
|
+
}
|
|
47422
|
+
|
|
47423
|
+
return Boolean(env.WT_SESSION) // Windows Terminal
|
|
47424
|
+
|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
|
|
47425
|
+
|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|
|
47426
|
+
|| TERM_PROGRAM === 'Terminus-Sublime'
|
|
47427
|
+
|| TERM_PROGRAM === 'vscode'
|
|
47428
|
+
|| TERM === 'xterm-256color'
|
|
47429
|
+
|| TERM === 'alacritty'
|
|
47430
|
+
|| TERM === 'rxvt-unicode'
|
|
47431
|
+
|| TERM === 'rxvt-unicode-256color'
|
|
47432
|
+
|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
|
|
47433
|
+
}
|
|
47434
|
+
|
|
47435
|
+
const TYPE_COLOR_MAP = {
|
|
47436
|
+
info: "cyan",
|
|
47437
|
+
fail: "red",
|
|
47438
|
+
success: "green",
|
|
47439
|
+
ready: "green",
|
|
47440
|
+
start: "magenta"
|
|
47441
|
+
};
|
|
47442
|
+
const LEVEL_COLOR_MAP = {
|
|
47443
|
+
0: "red",
|
|
47444
|
+
1: "yellow"
|
|
47445
|
+
};
|
|
47446
|
+
const unicode = isUnicodeSupported();
|
|
47447
|
+
const dist_s = (c, fallback) => unicode ? c : fallback;
|
|
47448
|
+
const TYPE_ICONS = {
|
|
47449
|
+
error: dist_s("\u2716", "\xD7"),
|
|
47450
|
+
fatal: dist_s("\u2716", "\xD7"),
|
|
47451
|
+
ready: dist_s("\u2714", "\u221A"),
|
|
47452
|
+
warn: dist_s("\u26A0", "\u203C"),
|
|
47453
|
+
info: dist_s("\u2139", "i"),
|
|
47454
|
+
success: dist_s("\u2714", "\u221A"),
|
|
47455
|
+
debug: dist_s("\u2699", "D"),
|
|
47456
|
+
trace: dist_s("\u2192", "\u2192"),
|
|
47457
|
+
fail: dist_s("\u2716", "\xD7"),
|
|
47458
|
+
start: dist_s("\u25D0", "o"),
|
|
47459
|
+
log: ""
|
|
47460
|
+
};
|
|
47461
|
+
function stringWidth(str) {
|
|
47462
|
+
const hasICU = typeof Intl === "object";
|
|
47463
|
+
if (!hasICU || !Intl.Segmenter) {
|
|
47464
|
+
return stripAnsi(str).length;
|
|
47465
|
+
}
|
|
47466
|
+
return stringWidth$1(str);
|
|
47467
|
+
}
|
|
47468
|
+
class FancyReporter extends BasicReporter {
|
|
47469
|
+
formatStack(stack, message, opts) {
|
|
47470
|
+
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
47471
|
+
return `
|
|
47472
|
+
${indent}` + parseStack(stack, message).map(
|
|
47473
|
+
(line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)
|
|
47474
|
+
).join(`
|
|
47475
|
+
${indent}`);
|
|
47476
|
+
}
|
|
47477
|
+
formatType(logObj, isBadge, opts) {
|
|
47478
|
+
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
47479
|
+
if (isBadge) {
|
|
47480
|
+
return getBgColor(typeColor)(
|
|
47481
|
+
colors.black(` ${logObj.type.toUpperCase()} `)
|
|
47482
|
+
);
|
|
47483
|
+
}
|
|
47484
|
+
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
47485
|
+
return _type ? dist_getColor(typeColor)(_type) : "";
|
|
47486
|
+
}
|
|
47487
|
+
formatLogObj(logObj, opts) {
|
|
47488
|
+
const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
|
|
47489
|
+
"\n"
|
|
47490
|
+
);
|
|
47491
|
+
if (logObj.type === "box") {
|
|
47492
|
+
return box(
|
|
47493
|
+
characterFormat(
|
|
47494
|
+
message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
|
|
47495
|
+
),
|
|
47496
|
+
{
|
|
47497
|
+
title: logObj.title ? characterFormat(logObj.title) : void 0,
|
|
47498
|
+
style: logObj.style
|
|
47499
|
+
}
|
|
47500
|
+
);
|
|
47501
|
+
}
|
|
47502
|
+
const date = this.formatDate(logObj.date, opts);
|
|
47503
|
+
const coloredDate = date && colors.gray(date);
|
|
47504
|
+
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
47505
|
+
const type = this.formatType(logObj, isBadge, opts);
|
|
47506
|
+
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
47507
|
+
let line;
|
|
47508
|
+
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
47509
|
+
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
47510
|
+
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
47511
|
+
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
47512
|
+
line += characterFormat(
|
|
47513
|
+
additional.length > 0 ? "\n" + additional.join("\n") : ""
|
|
47514
|
+
);
|
|
47515
|
+
if (logObj.type === "trace") {
|
|
47516
|
+
const _err = new Error("Trace: " + logObj.message);
|
|
47517
|
+
line += this.formatStack(_err.stack || "", _err.message);
|
|
47518
|
+
}
|
|
47519
|
+
return isBadge ? "\n" + line + "\n" : line;
|
|
47520
|
+
}
|
|
47521
|
+
}
|
|
47522
|
+
function characterFormat(str) {
|
|
47523
|
+
return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
|
|
47524
|
+
}
|
|
47525
|
+
function dist_getColor(color = "white") {
|
|
47526
|
+
return colors[color] || colors.white;
|
|
47527
|
+
}
|
|
47528
|
+
function getBgColor(color = "bgWhite") {
|
|
47529
|
+
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
47530
|
+
}
|
|
47531
|
+
|
|
47532
|
+
function dist_createConsola(options = {}) {
|
|
47533
|
+
let level = _getDefaultLogLevel();
|
|
47534
|
+
if (process.env.CONSOLA_LEVEL) {
|
|
47535
|
+
level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
47536
|
+
}
|
|
47537
|
+
const consola2 = createConsola({
|
|
47538
|
+
level,
|
|
47539
|
+
defaults: { level },
|
|
47540
|
+
stdout: process.stdout,
|
|
47541
|
+
stderr: process.stderr,
|
|
47542
|
+
prompt: (...args) => __webpack_require__.e(/* import() */ "116").then(__webpack_require__.bind(__webpack_require__, 8711)).then((m) => m.prompt(...args)),
|
|
47543
|
+
reporters: options.reporters || [
|
|
47544
|
+
options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()
|
|
47545
|
+
],
|
|
47546
|
+
...options
|
|
47547
|
+
});
|
|
47548
|
+
return consola2;
|
|
47549
|
+
}
|
|
47550
|
+
function _getDefaultLogLevel() {
|
|
47551
|
+
if (g) {
|
|
47552
|
+
return LogLevels.debug;
|
|
47553
|
+
}
|
|
47554
|
+
if (R) {
|
|
47555
|
+
return LogLevels.warn;
|
|
47556
|
+
}
|
|
47557
|
+
return LogLevels.info;
|
|
47558
|
+
}
|
|
47559
|
+
const dist_consola = dist_createConsola();
|
|
47560
|
+
|
|
47561
|
+
|
|
47562
|
+
|
|
46021
47563
|
;// CONCATENATED MODULE: ../core/src/gateways/npmrc-gateway.ts
|
|
46022
47564
|
/**
|
|
46023
47565
|
* Gateway for reading and writing `.npmrc` configuration files.
|
|
46024
47566
|
*/
|
|
46025
47567
|
|
|
47568
|
+
|
|
46026
47569
|
const MAX_NPMRC_BYTES = (/* unused pure expression or super */ null && (64 * 1024));
|
|
46027
47570
|
/**
|
|
46028
47571
|
* File system implementation of the NpmrcGateway.
|
|
46029
47572
|
*/ class FileSystemNpmrcGateway {
|
|
47573
|
+
logger;
|
|
47574
|
+
dryRun;
|
|
47575
|
+
constructor(logger = consola, dryRun = false){
|
|
47576
|
+
this.logger = logger;
|
|
47577
|
+
this.dryRun = dryRun;
|
|
47578
|
+
}
|
|
46030
47579
|
async readNpmrc(targetDir) {
|
|
46031
47580
|
const npmrcPath = await resolveSafePath(targetDir, ".npmrc");
|
|
46032
47581
|
if (!await fileExists(npmrcPath)) {
|
|
@@ -46037,13 +47586,17 @@ const MAX_NPMRC_BYTES = (/* unused pure expression or super */ null && (64 * 102
|
|
|
46037
47586
|
}
|
|
46038
47587
|
async writeNpmrc(targetDir, content) {
|
|
46039
47588
|
const npmrcPath = await resolveSafePath(targetDir, ".npmrc");
|
|
47589
|
+
if (this.dryRun) {
|
|
47590
|
+
this.logger.info(`[DRY-RUN] Would write to: ${npmrcPath}\n${content}`);
|
|
47591
|
+
return;
|
|
47592
|
+
}
|
|
46040
47593
|
await writeFile(npmrcPath, content, "utf-8");
|
|
46041
47594
|
}
|
|
46042
47595
|
}
|
|
46043
47596
|
/**
|
|
46044
47597
|
* Creates and returns the default NpmrcGateway.
|
|
46045
|
-
*/ function createNpmrcGateway() {
|
|
46046
|
-
return new FileSystemNpmrcGateway();
|
|
47598
|
+
*/ function createNpmrcGateway(logger = consola, dryRun = false) {
|
|
47599
|
+
return new FileSystemNpmrcGateway(logger, dryRun);
|
|
46047
47600
|
}
|
|
46048
47601
|
|
|
46049
47602
|
;// CONCATENATED MODULE: ../core/src/entities/feedback-loop.ts
|
|
@@ -46688,16 +48241,21 @@ var yaml_dist = __webpack_require__(3519);
|
|
|
46688
48241
|
|
|
46689
48242
|
|
|
46690
48243
|
|
|
48244
|
+
|
|
46691
48245
|
const COPILOT_SETUP_WORKFLOW_FILENAMES = [
|
|
46692
48246
|
"copilot-setup-steps.yml",
|
|
46693
48247
|
"copilot-setup-steps.yaml"
|
|
46694
48248
|
];
|
|
46695
48249
|
const MAX_WORKFLOW_FILE_BYTES = 1024 * 1024;
|
|
46696
48250
|
class FileSystemWorkflowGateway {
|
|
48251
|
+
cwd;
|
|
46697
48252
|
config = null;
|
|
48253
|
+
constructor(cwd){
|
|
48254
|
+
this.cwd = cwd;
|
|
48255
|
+
}
|
|
46698
48256
|
async getConfig() {
|
|
46699
48257
|
if (!this.config) {
|
|
46700
|
-
this.config = await loadCopilotSetupConfig();
|
|
48258
|
+
this.config = await loadCopilotSetupConfig(this.cwd !== undefined ? (0,external_node_path_.resolve)(this.cwd) : undefined);
|
|
46701
48259
|
}
|
|
46702
48260
|
return this.config;
|
|
46703
48261
|
}
|
|
@@ -46759,8 +48317,8 @@ class FileSystemWorkflowGateway {
|
|
|
46759
48317
|
await (0,promises_.writeFile)(workflowPath, content, "utf-8");
|
|
46760
48318
|
}
|
|
46761
48319
|
}
|
|
46762
|
-
function createWorkflowGateway() {
|
|
46763
|
-
return new FileSystemWorkflowGateway();
|
|
48320
|
+
function createWorkflowGateway(cwd) {
|
|
48321
|
+
return new FileSystemWorkflowGateway(cwd);
|
|
46764
48322
|
}
|
|
46765
48323
|
|
|
46766
48324
|
;// CONCATENATED MODULE: ../core/src/gateways/workflow-gateway.ts
|
|
@@ -60338,7 +61896,7 @@ function looksLikeANode(value) {
|
|
|
60338
61896
|
* @param {string} d
|
|
60339
61897
|
* @returns {string}
|
|
60340
61898
|
*/
|
|
60341
|
-
function
|
|
61899
|
+
function color_node_color(d) {
|
|
60342
61900
|
return '\u001B[33m' + d + '\u001B[39m'
|
|
60343
61901
|
}
|
|
60344
61902
|
|
|
@@ -60671,7 +62229,7 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
60671
62229
|
|
|
60672
62230
|
Object.defineProperty(visit, 'name', {
|
|
60673
62231
|
value:
|
|
60674
|
-
'node (' +
|
|
62232
|
+
'node (' + color_node_color(node.type + (name ? '<' + name + '>' : '')) + ')'
|
|
60675
62233
|
})
|
|
60676
62234
|
}
|
|
60677
62235
|
|
|
@@ -66989,7 +68547,7 @@ function buildInstallCandidatesFromPackageManagers(packageManagers, config) {
|
|
|
66989
68547
|
}
|
|
66990
68548
|
const stepName = getInstallStepName(pm.type);
|
|
66991
68549
|
candidates.push({
|
|
66992
|
-
action:
|
|
68550
|
+
action: `run:${pm.type}`,
|
|
66993
68551
|
source: "version-file",
|
|
66994
68552
|
name: stepName,
|
|
66995
68553
|
run: pmConfig.installCommand
|
|
@@ -67465,8 +69023,8 @@ const workflow_generator_defaultActionVersionPort = createActionVersionPort(work
|
|
|
67465
69023
|
* @returns A typed Step object
|
|
67466
69024
|
*/ function buildStepFromCandidate(candidate, options) {
|
|
67467
69025
|
// Handle run steps (install commands)
|
|
67468
|
-
// Run steps have a 'run' field and
|
|
67469
|
-
if (candidate.run &&
|
|
69026
|
+
// Run steps have a 'run' field and use the 'run:' action prefix (e.g., 'run:npm')
|
|
69027
|
+
if (candidate.run && candidate.action.startsWith("run:")) {
|
|
67470
69028
|
const stepProps = {
|
|
67471
69029
|
name: candidate.name || "Run command",
|
|
67472
69030
|
run: candidate.run
|
|
@@ -67543,9 +69101,11 @@ const workflow_generator_defaultActionVersionPort = createActionVersionPort(work
|
|
|
67543
69101
|
const job = new NormalJob("copilot-setup-steps", {
|
|
67544
69102
|
"runs-on": "ubuntu-latest",
|
|
67545
69103
|
"timeout-minutes": 30,
|
|
67546
|
-
permissions: {
|
|
69104
|
+
permissions: options?.includeIdTokenPermission ? {
|
|
67547
69105
|
"id-token": "write",
|
|
67548
69106
|
contents: "read"
|
|
69107
|
+
} : {
|
|
69108
|
+
contents: "read"
|
|
67549
69109
|
}
|
|
67550
69110
|
}).addSteps(steps);
|
|
67551
69111
|
const workflow = new Workflow("copilot-setup-steps.yml", {
|