@socketsecurity/cli 0.14.39 → 0.14.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/cli.js +12 -6
- package/dist/{module-sync/constants.d.ts → constants.d.ts} +13 -2
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +24 -10
- package/dist/module-sync/cli.js +426 -329
- package/dist/module-sync/debug.d.ts +3 -0
- package/dist/module-sync/errors.d.ts +3 -1
- package/dist/module-sync/logging.d.ts +16 -0
- package/dist/module-sync/npm-injection.js +1148 -1075
- package/dist/module-sync/path-resolve.d.ts +1 -1
- package/dist/module-sync/path-resolve.js +50 -5
- package/dist/module-sync/shadow-bin.d.ts +2 -2
- package/dist/module-sync/shadow-bin.js +23 -40
- package/dist/module-sync/socket-url.d.ts +24 -0
- package/dist/module-sync/socket-url.js +222 -0
- package/dist/require/cli.js +425 -326
- package/dist/require/npm-injection.js +2 -1511
- package/dist/require/path-resolve.js +2 -200
- package/dist/require/shadow-bin.js +2 -102
- package/dist/require/socket-url.js +3 -0
- package/dist/require/vendor.js +53 -400
- package/package.json +27 -25
- package/dist/module-sync/color-or-markdown.d.ts +0 -23
- package/dist/module-sync/constants.d.ts.map +0 -1
- package/dist/module-sync/sdk.d.ts +0 -8
- package/dist/module-sync/sdk.js +0 -214
- package/dist/require/constants.d.ts.map +0 -1
- package/dist/require/sdk.js +0 -212
package/dist/require/vendor.js
CHANGED
|
@@ -10,14 +10,12 @@ function _socketInterop(e) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
var fs$1 = require('node:fs');
|
|
13
|
-
var os$
|
|
13
|
+
var os$3 = require('node:os');
|
|
14
14
|
var path$1 = require('node:path');
|
|
15
15
|
var colors = _socketInterop(require('yoctocolors-cjs'));
|
|
16
16
|
var process$2 = require('node:process');
|
|
17
17
|
var require$$0$1 = require('node:util');
|
|
18
18
|
var require$$0 = require('node:url');
|
|
19
|
-
var require$$1$4 = require('node:tty');
|
|
20
|
-
var require$$2$1 = _socketInterop(require('has-flag'));
|
|
21
19
|
var node_buffer = require('node:buffer');
|
|
22
20
|
var childProcess = require('node:child_process');
|
|
23
21
|
var fs$2 = require('node:fs/promises');
|
|
@@ -96,12 +94,12 @@ class NodeStore extends AbstractStore {
|
|
|
96
94
|
id,
|
|
97
95
|
backend: {
|
|
98
96
|
read: id => {
|
|
99
|
-
const filePath = path$1.join(os$
|
|
97
|
+
const filePath = path$1.join(os$3.tmpdir(), `ionstore_${id}.json`);
|
|
100
98
|
const content = fs$1.readFileSync(filePath, 'utf8');
|
|
101
99
|
return JSON.parse(content);
|
|
102
100
|
},
|
|
103
101
|
write: (id, data) => {
|
|
104
|
-
const filePath = path$1.join(os$
|
|
102
|
+
const filePath = path$1.join(os$3.tmpdir(), `ionstore_${id}.json`);
|
|
105
103
|
const content = JSON.stringify(Array.from(data));
|
|
106
104
|
return fs$1.writeFileSync(filePath, content);
|
|
107
105
|
}
|
|
@@ -4492,7 +4490,7 @@ var _tls_legacy = ">= 0.11.3 && < 10";
|
|
|
4492
4490
|
var _tls_wrap = ">= 0.11.3";
|
|
4493
4491
|
var tls = true;
|
|
4494
4492
|
var trace_events = ">= 10";
|
|
4495
|
-
var tty
|
|
4493
|
+
var tty = true;
|
|
4496
4494
|
var url$1 = true;
|
|
4497
4495
|
var util$1 = true;
|
|
4498
4496
|
var v8 = ">= 1";
|
|
@@ -4632,7 +4630,7 @@ const require$$1$1 = {
|
|
|
4632
4630
|
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
4633
4631
|
trace_events: trace_events,
|
|
4634
4632
|
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
4635
|
-
tty: tty
|
|
4633
|
+
tty: tty,
|
|
4636
4634
|
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
4637
4635
|
url: url$1,
|
|
4638
4636
|
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
@@ -6683,13 +6681,13 @@ var hasFlag$3 = (flag, argv) => {
|
|
|
6683
6681
|
const terminatorPos = argv.indexOf('--');
|
|
6684
6682
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
6685
6683
|
};
|
|
6686
|
-
const os$1 = os$
|
|
6687
|
-
const hasFlag$2
|
|
6684
|
+
const os$1 = os$3;
|
|
6685
|
+
const hasFlag$2 = hasFlag$3;
|
|
6688
6686
|
const env$1 = process.env;
|
|
6689
6687
|
let forceColor$1;
|
|
6690
|
-
if (hasFlag$2
|
|
6688
|
+
if (hasFlag$2('no-color') || hasFlag$2('no-colors') || hasFlag$2('color=false')) {
|
|
6691
6689
|
forceColor$1 = false;
|
|
6692
|
-
} else if (hasFlag$2
|
|
6690
|
+
} else if (hasFlag$2('color') || hasFlag$2('colors') || hasFlag$2('color=true') || hasFlag$2('color=always')) {
|
|
6693
6691
|
forceColor$1 = true;
|
|
6694
6692
|
}
|
|
6695
6693
|
if ('FORCE_COLOR' in env$1) {
|
|
@@ -6706,14 +6704,14 @@ function translateLevel$1(level) {
|
|
|
6706
6704
|
has16m: level >= 3
|
|
6707
6705
|
};
|
|
6708
6706
|
}
|
|
6709
|
-
function supportsColor$1
|
|
6707
|
+
function supportsColor$1(stream) {
|
|
6710
6708
|
if (forceColor$1 === false) {
|
|
6711
6709
|
return 0;
|
|
6712
6710
|
}
|
|
6713
|
-
if (hasFlag$2
|
|
6711
|
+
if (hasFlag$2('color=16m') || hasFlag$2('color=full') || hasFlag$2('color=truecolor')) {
|
|
6714
6712
|
return 3;
|
|
6715
6713
|
}
|
|
6716
|
-
if (hasFlag$2
|
|
6714
|
+
if (hasFlag$2('color=256')) {
|
|
6717
6715
|
return 2;
|
|
6718
6716
|
}
|
|
6719
6717
|
if (stream && !stream.isTTY && forceColor$1 !== true) {
|
|
@@ -6763,7 +6761,7 @@ function supportsColor$1$1(stream) {
|
|
|
6763
6761
|
return min;
|
|
6764
6762
|
}
|
|
6765
6763
|
function getSupportLevel$1(stream) {
|
|
6766
|
-
const level = supportsColor$1
|
|
6764
|
+
const level = supportsColor$1(stream);
|
|
6767
6765
|
return translateLevel$1(level);
|
|
6768
6766
|
}
|
|
6769
6767
|
var supportsColor_1$1 = {
|
|
@@ -7302,26 +7300,26 @@ ansiStyles.exports;
|
|
|
7302
7300
|
});
|
|
7303
7301
|
})(ansiStyles);
|
|
7304
7302
|
var ansiStylesExports = ansiStyles.exports;
|
|
7305
|
-
var hasFlag$1
|
|
7303
|
+
var hasFlag$1 = (flag, argv) => {
|
|
7306
7304
|
argv = argv || process.argv;
|
|
7307
7305
|
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
7308
7306
|
const pos = argv.indexOf(prefix + flag);
|
|
7309
7307
|
const terminatorPos = argv.indexOf('--');
|
|
7310
7308
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
7311
7309
|
};
|
|
7312
|
-
const os
|
|
7313
|
-
const hasFlag
|
|
7314
|
-
const env
|
|
7315
|
-
let forceColor
|
|
7316
|
-
if (hasFlag
|
|
7317
|
-
forceColor
|
|
7318
|
-
} else if (hasFlag
|
|
7319
|
-
forceColor
|
|
7310
|
+
const os = os$3;
|
|
7311
|
+
const hasFlag = hasFlag$1;
|
|
7312
|
+
const env = process.env;
|
|
7313
|
+
let forceColor;
|
|
7314
|
+
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
|
|
7315
|
+
forceColor = false;
|
|
7316
|
+
} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
|
|
7317
|
+
forceColor = true;
|
|
7320
7318
|
}
|
|
7321
|
-
if ('FORCE_COLOR' in env
|
|
7322
|
-
forceColor
|
|
7319
|
+
if ('FORCE_COLOR' in env) {
|
|
7320
|
+
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
7323
7321
|
}
|
|
7324
|
-
function translateLevel
|
|
7322
|
+
function translateLevel(level) {
|
|
7325
7323
|
if (level === 0) {
|
|
7326
7324
|
return false;
|
|
7327
7325
|
}
|
|
@@ -7332,70 +7330,70 @@ function translateLevel$2(level) {
|
|
|
7332
7330
|
has16m: level >= 3
|
|
7333
7331
|
};
|
|
7334
7332
|
}
|
|
7335
|
-
function supportsColor
|
|
7336
|
-
if (forceColor
|
|
7333
|
+
function supportsColor(stream) {
|
|
7334
|
+
if (forceColor === false) {
|
|
7337
7335
|
return 0;
|
|
7338
7336
|
}
|
|
7339
|
-
if (hasFlag
|
|
7337
|
+
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
|
|
7340
7338
|
return 3;
|
|
7341
7339
|
}
|
|
7342
|
-
if (hasFlag
|
|
7340
|
+
if (hasFlag('color=256')) {
|
|
7343
7341
|
return 2;
|
|
7344
7342
|
}
|
|
7345
|
-
if (stream && !stream.isTTY && forceColor
|
|
7343
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
7346
7344
|
return 0;
|
|
7347
7345
|
}
|
|
7348
|
-
const min = forceColor
|
|
7346
|
+
const min = forceColor ? 1 : 0;
|
|
7349
7347
|
if (process.platform === 'win32') {
|
|
7350
|
-
const osRelease = os
|
|
7348
|
+
const osRelease = os.release().split('.');
|
|
7351
7349
|
if (Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
7352
7350
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
7353
7351
|
}
|
|
7354
7352
|
return 1;
|
|
7355
7353
|
}
|
|
7356
|
-
if ('CI' in env
|
|
7357
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env
|
|
7354
|
+
if ('CI' in env) {
|
|
7355
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
7358
7356
|
return 1;
|
|
7359
7357
|
}
|
|
7360
7358
|
return min;
|
|
7361
7359
|
}
|
|
7362
|
-
if ('TEAMCITY_VERSION' in env
|
|
7363
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env
|
|
7360
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
7361
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
7364
7362
|
}
|
|
7365
|
-
if (env
|
|
7363
|
+
if (env.COLORTERM === 'truecolor') {
|
|
7366
7364
|
return 3;
|
|
7367
7365
|
}
|
|
7368
|
-
if ('TERM_PROGRAM' in env
|
|
7369
|
-
const version = parseInt((env
|
|
7370
|
-
switch (env
|
|
7366
|
+
if ('TERM_PROGRAM' in env) {
|
|
7367
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
7368
|
+
switch (env.TERM_PROGRAM) {
|
|
7371
7369
|
case 'iTerm.app':
|
|
7372
7370
|
return version >= 3 ? 3 : 2;
|
|
7373
7371
|
case 'Apple_Terminal':
|
|
7374
7372
|
return 2;
|
|
7375
7373
|
}
|
|
7376
7374
|
}
|
|
7377
|
-
if (/-256(color)?$/i.test(env
|
|
7375
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
7378
7376
|
return 2;
|
|
7379
7377
|
}
|
|
7380
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env
|
|
7378
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
7381
7379
|
return 1;
|
|
7382
7380
|
}
|
|
7383
|
-
if ('COLORTERM' in env
|
|
7381
|
+
if ('COLORTERM' in env) {
|
|
7384
7382
|
return 1;
|
|
7385
7383
|
}
|
|
7386
|
-
if (env
|
|
7384
|
+
if (env.TERM === 'dumb') {
|
|
7387
7385
|
return min;
|
|
7388
7386
|
}
|
|
7389
7387
|
return min;
|
|
7390
7388
|
}
|
|
7391
|
-
function getSupportLevel
|
|
7392
|
-
const level = supportsColor
|
|
7393
|
-
return translateLevel
|
|
7389
|
+
function getSupportLevel(stream) {
|
|
7390
|
+
const level = supportsColor(stream);
|
|
7391
|
+
return translateLevel(level);
|
|
7394
7392
|
}
|
|
7395
|
-
var supportsColor_1
|
|
7396
|
-
supportsColor: getSupportLevel
|
|
7397
|
-
stdout: getSupportLevel
|
|
7398
|
-
stderr: getSupportLevel
|
|
7393
|
+
var supportsColor_1 = {
|
|
7394
|
+
supportsColor: getSupportLevel,
|
|
7395
|
+
stdout: getSupportLevel(process.stdout),
|
|
7396
|
+
stderr: getSupportLevel(process.stderr)
|
|
7399
7397
|
};
|
|
7400
7398
|
const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
7401
7399
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
@@ -7496,7 +7494,7 @@ var templates = (chalk, tmp) => {
|
|
|
7496
7494
|
(function (module) {
|
|
7497
7495
|
const escapeStringRegexp$1 = escapeStringRegexp;
|
|
7498
7496
|
const ansiStyles = ansiStylesExports;
|
|
7499
|
-
const stdoutColor = supportsColor_1
|
|
7497
|
+
const stdoutColor = supportsColor_1.stdout;
|
|
7500
7498
|
const template = templates;
|
|
7501
7499
|
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
|
7502
7500
|
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
|
|
@@ -8671,348 +8669,6 @@ const meow = (helpText, options = {}) => {
|
|
|
8671
8669
|
return result;
|
|
8672
8670
|
};
|
|
8673
8671
|
|
|
8674
|
-
function isUnicodeSupported() {
|
|
8675
|
-
const {
|
|
8676
|
-
env
|
|
8677
|
-
} = process$2;
|
|
8678
|
-
const {
|
|
8679
|
-
TERM,
|
|
8680
|
-
TERM_PROGRAM
|
|
8681
|
-
} = env;
|
|
8682
|
-
if (process$2.platform !== 'win32') {
|
|
8683
|
-
return TERM !== 'linux'; // Linux console (kernel)
|
|
8684
|
-
}
|
|
8685
|
-
return Boolean(env.WT_SESSION) // Windows Terminal
|
|
8686
|
-
|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
|
|
8687
|
-
|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|
|
8688
|
-
|| TERM_PROGRAM === 'Terminus-Sublime' || TERM_PROGRAM === 'vscode' || TERM === 'xterm-256color' || TERM === 'alacritty' || TERM === 'rxvt-unicode' || TERM === 'rxvt-unicode-256color' || env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
|
|
8689
|
-
}
|
|
8690
|
-
|
|
8691
|
-
const ESC = '\u001B[';
|
|
8692
|
-
const OSC = '\u001B]';
|
|
8693
|
-
const BEL = '\u0007';
|
|
8694
|
-
const SEP = ';';
|
|
8695
|
-
const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
|
|
8696
|
-
const ansiEscapes = {};
|
|
8697
|
-
ansiEscapes.cursorTo = (x, y) => {
|
|
8698
|
-
if (typeof x !== 'number') {
|
|
8699
|
-
throw new TypeError('The `x` argument is required');
|
|
8700
|
-
}
|
|
8701
|
-
if (typeof y !== 'number') {
|
|
8702
|
-
return ESC + (x + 1) + 'G';
|
|
8703
|
-
}
|
|
8704
|
-
return ESC + (y + 1) + ';' + (x + 1) + 'H';
|
|
8705
|
-
};
|
|
8706
|
-
ansiEscapes.cursorMove = (x, y) => {
|
|
8707
|
-
if (typeof x !== 'number') {
|
|
8708
|
-
throw new TypeError('The `x` argument is required');
|
|
8709
|
-
}
|
|
8710
|
-
let returnValue = '';
|
|
8711
|
-
if (x < 0) {
|
|
8712
|
-
returnValue += ESC + -x + 'D';
|
|
8713
|
-
} else if (x > 0) {
|
|
8714
|
-
returnValue += ESC + x + 'C';
|
|
8715
|
-
}
|
|
8716
|
-
if (y < 0) {
|
|
8717
|
-
returnValue += ESC + -y + 'A';
|
|
8718
|
-
} else if (y > 0) {
|
|
8719
|
-
returnValue += ESC + y + 'B';
|
|
8720
|
-
}
|
|
8721
|
-
return returnValue;
|
|
8722
|
-
};
|
|
8723
|
-
ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';
|
|
8724
|
-
ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';
|
|
8725
|
-
ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';
|
|
8726
|
-
ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';
|
|
8727
|
-
ansiEscapes.cursorLeft = ESC + 'G';
|
|
8728
|
-
ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
|
|
8729
|
-
ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
|
|
8730
|
-
ansiEscapes.cursorGetPosition = ESC + '6n';
|
|
8731
|
-
ansiEscapes.cursorNextLine = ESC + 'E';
|
|
8732
|
-
ansiEscapes.cursorPrevLine = ESC + 'F';
|
|
8733
|
-
ansiEscapes.cursorHide = ESC + '?25l';
|
|
8734
|
-
ansiEscapes.cursorShow = ESC + '?25h';
|
|
8735
|
-
ansiEscapes.eraseLines = count => {
|
|
8736
|
-
let clear = '';
|
|
8737
|
-
for (let i = 0; i < count; i++) {
|
|
8738
|
-
clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
|
|
8739
|
-
}
|
|
8740
|
-
if (count) {
|
|
8741
|
-
clear += ansiEscapes.cursorLeft;
|
|
8742
|
-
}
|
|
8743
|
-
return clear;
|
|
8744
|
-
};
|
|
8745
|
-
ansiEscapes.eraseEndLine = ESC + 'K';
|
|
8746
|
-
ansiEscapes.eraseStartLine = ESC + '1K';
|
|
8747
|
-
ansiEscapes.eraseLine = ESC + '2K';
|
|
8748
|
-
ansiEscapes.eraseDown = ESC + 'J';
|
|
8749
|
-
ansiEscapes.eraseUp = ESC + '1J';
|
|
8750
|
-
ansiEscapes.eraseScreen = ESC + '2J';
|
|
8751
|
-
ansiEscapes.scrollUp = ESC + 'S';
|
|
8752
|
-
ansiEscapes.scrollDown = ESC + 'T';
|
|
8753
|
-
ansiEscapes.clearScreen = '\u001Bc';
|
|
8754
|
-
ansiEscapes.clearTerminal = process.platform === 'win32' ? `${ansiEscapes.eraseScreen}${ESC}0f` :
|
|
8755
|
-
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
8756
|
-
// 2. Erases the whole screen including scrollback buffer
|
|
8757
|
-
// 3. Moves cursor to the top-left position
|
|
8758
|
-
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
8759
|
-
`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
|
|
8760
|
-
ansiEscapes.beep = BEL;
|
|
8761
|
-
ansiEscapes.link = (text, url) => {
|
|
8762
|
-
return [OSC, '8', SEP, SEP, url, BEL, text, OSC, '8', SEP, SEP, BEL].join('');
|
|
8763
|
-
};
|
|
8764
|
-
ansiEscapes.image = (buffer, options = {}) => {
|
|
8765
|
-
let returnValue = `${OSC}1337;File=inline=1`;
|
|
8766
|
-
if (options.width) {
|
|
8767
|
-
returnValue += `;width=${options.width}`;
|
|
8768
|
-
}
|
|
8769
|
-
if (options.height) {
|
|
8770
|
-
returnValue += `;height=${options.height}`;
|
|
8771
|
-
}
|
|
8772
|
-
if (options.preserveAspectRatio === false) {
|
|
8773
|
-
returnValue += ';preserveAspectRatio=0';
|
|
8774
|
-
}
|
|
8775
|
-
return returnValue + ':' + buffer.toString('base64') + BEL;
|
|
8776
|
-
};
|
|
8777
|
-
ansiEscapes.iTerm = {
|
|
8778
|
-
setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
8779
|
-
annotation: (message, options = {}) => {
|
|
8780
|
-
let returnValue = `${OSC}1337;`;
|
|
8781
|
-
const hasX = typeof options.x !== 'undefined';
|
|
8782
|
-
const hasY = typeof options.y !== 'undefined';
|
|
8783
|
-
if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {
|
|
8784
|
-
throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
|
|
8785
|
-
}
|
|
8786
|
-
message = message.replace(/\|/g, '');
|
|
8787
|
-
returnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
|
|
8788
|
-
if (options.length > 0) {
|
|
8789
|
-
returnValue += (hasX ? [message, options.length, options.x, options.y] : [options.length, message]).join('|');
|
|
8790
|
-
} else {
|
|
8791
|
-
returnValue += message;
|
|
8792
|
-
}
|
|
8793
|
-
return returnValue + BEL;
|
|
8794
|
-
}
|
|
8795
|
-
};
|
|
8796
|
-
|
|
8797
|
-
const os = os$4;
|
|
8798
|
-
const tty = require$$1$4;
|
|
8799
|
-
const hasFlag$2 = require$$2$1;
|
|
8800
|
-
const {
|
|
8801
|
-
env
|
|
8802
|
-
} = process;
|
|
8803
|
-
let forceColor;
|
|
8804
|
-
if (hasFlag$2('no-color') || hasFlag$2('no-colors') || hasFlag$2('color=false') || hasFlag$2('color=never')) {
|
|
8805
|
-
forceColor = 0;
|
|
8806
|
-
} else if (hasFlag$2('color') || hasFlag$2('colors') || hasFlag$2('color=true') || hasFlag$2('color=always')) {
|
|
8807
|
-
forceColor = 1;
|
|
8808
|
-
}
|
|
8809
|
-
if ('FORCE_COLOR' in env) {
|
|
8810
|
-
if (env.FORCE_COLOR === 'true') {
|
|
8811
|
-
forceColor = 1;
|
|
8812
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
8813
|
-
forceColor = 0;
|
|
8814
|
-
} else {
|
|
8815
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
8816
|
-
}
|
|
8817
|
-
}
|
|
8818
|
-
function translateLevel(level) {
|
|
8819
|
-
if (level === 0) {
|
|
8820
|
-
return false;
|
|
8821
|
-
}
|
|
8822
|
-
return {
|
|
8823
|
-
level,
|
|
8824
|
-
hasBasic: true,
|
|
8825
|
-
has256: level >= 2,
|
|
8826
|
-
has16m: level >= 3
|
|
8827
|
-
};
|
|
8828
|
-
}
|
|
8829
|
-
function supportsColor$1(haveStream, streamIsTTY) {
|
|
8830
|
-
if (forceColor === 0) {
|
|
8831
|
-
return 0;
|
|
8832
|
-
}
|
|
8833
|
-
if (hasFlag$2('color=16m') || hasFlag$2('color=full') || hasFlag$2('color=truecolor')) {
|
|
8834
|
-
return 3;
|
|
8835
|
-
}
|
|
8836
|
-
if (hasFlag$2('color=256')) {
|
|
8837
|
-
return 2;
|
|
8838
|
-
}
|
|
8839
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
8840
|
-
return 0;
|
|
8841
|
-
}
|
|
8842
|
-
const min = forceColor || 0;
|
|
8843
|
-
if (env.TERM === 'dumb') {
|
|
8844
|
-
return min;
|
|
8845
|
-
}
|
|
8846
|
-
if (process.platform === 'win32') {
|
|
8847
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
8848
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
8849
|
-
const osRelease = os.release().split('.');
|
|
8850
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
8851
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
8852
|
-
}
|
|
8853
|
-
return 1;
|
|
8854
|
-
}
|
|
8855
|
-
if ('CI' in env) {
|
|
8856
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
8857
|
-
return 1;
|
|
8858
|
-
}
|
|
8859
|
-
return min;
|
|
8860
|
-
}
|
|
8861
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
8862
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
8863
|
-
}
|
|
8864
|
-
if (env.COLORTERM === 'truecolor') {
|
|
8865
|
-
return 3;
|
|
8866
|
-
}
|
|
8867
|
-
if ('TERM_PROGRAM' in env) {
|
|
8868
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
8869
|
-
switch (env.TERM_PROGRAM) {
|
|
8870
|
-
case 'iTerm.app':
|
|
8871
|
-
return version >= 3 ? 3 : 2;
|
|
8872
|
-
case 'Apple_Terminal':
|
|
8873
|
-
return 2;
|
|
8874
|
-
// No default
|
|
8875
|
-
}
|
|
8876
|
-
}
|
|
8877
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
8878
|
-
return 2;
|
|
8879
|
-
}
|
|
8880
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
8881
|
-
return 1;
|
|
8882
|
-
}
|
|
8883
|
-
if ('COLORTERM' in env) {
|
|
8884
|
-
return 1;
|
|
8885
|
-
}
|
|
8886
|
-
return min;
|
|
8887
|
-
}
|
|
8888
|
-
function getSupportLevel(stream) {
|
|
8889
|
-
const level = supportsColor$1(stream, stream && stream.isTTY);
|
|
8890
|
-
return translateLevel(level);
|
|
8891
|
-
}
|
|
8892
|
-
var supportsColor_1 = {
|
|
8893
|
-
supportsColor: getSupportLevel,
|
|
8894
|
-
stdout: translateLevel(supportsColor$1(true, tty.isatty(1))),
|
|
8895
|
-
stderr: translateLevel(supportsColor$1(true, tty.isatty(2)))
|
|
8896
|
-
};
|
|
8897
|
-
|
|
8898
|
-
var hasFlag$1 = (flag, argv = process.argv) => {
|
|
8899
|
-
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
8900
|
-
const position = argv.indexOf(prefix + flag);
|
|
8901
|
-
const terminatorPosition = argv.indexOf('--');
|
|
8902
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
8903
|
-
};
|
|
8904
|
-
|
|
8905
|
-
const supportsColor = supportsColor_1;
|
|
8906
|
-
const hasFlag = hasFlag$1;
|
|
8907
|
-
function parseVersion(versionString) {
|
|
8908
|
-
if (/^\d{3,4}$/.test(versionString)) {
|
|
8909
|
-
// Env var doesn't always use dots. example: 4601 => 46.1.0
|
|
8910
|
-
const m = /(\d{1,2})(\d{2})/.exec(versionString);
|
|
8911
|
-
return {
|
|
8912
|
-
major: 0,
|
|
8913
|
-
minor: parseInt(m[1], 10),
|
|
8914
|
-
patch: parseInt(m[2], 10)
|
|
8915
|
-
};
|
|
8916
|
-
}
|
|
8917
|
-
const versions = (versionString || '').split('.').map(n => parseInt(n, 10));
|
|
8918
|
-
return {
|
|
8919
|
-
major: versions[0],
|
|
8920
|
-
minor: versions[1],
|
|
8921
|
-
patch: versions[2]
|
|
8922
|
-
};
|
|
8923
|
-
}
|
|
8924
|
-
function supportsHyperlink(stream) {
|
|
8925
|
-
const {
|
|
8926
|
-
env
|
|
8927
|
-
} = process;
|
|
8928
|
-
if ('FORCE_HYPERLINK' in env) {
|
|
8929
|
-
return !(env.FORCE_HYPERLINK.length > 0 && parseInt(env.FORCE_HYPERLINK, 10) === 0);
|
|
8930
|
-
}
|
|
8931
|
-
if (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {
|
|
8932
|
-
return false;
|
|
8933
|
-
}
|
|
8934
|
-
if (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) {
|
|
8935
|
-
return true;
|
|
8936
|
-
}
|
|
8937
|
-
|
|
8938
|
-
// Netlify does not run a TTY, it does not need `supportsColor` check
|
|
8939
|
-
if ('NETLIFY' in env) {
|
|
8940
|
-
return true;
|
|
8941
|
-
}
|
|
8942
|
-
|
|
8943
|
-
// If they specify no colors, they probably don't want hyperlinks.
|
|
8944
|
-
if (!supportsColor.supportsColor(stream)) {
|
|
8945
|
-
return false;
|
|
8946
|
-
}
|
|
8947
|
-
if (stream && !stream.isTTY) {
|
|
8948
|
-
return false;
|
|
8949
|
-
}
|
|
8950
|
-
if (process.platform === 'win32') {
|
|
8951
|
-
return false;
|
|
8952
|
-
}
|
|
8953
|
-
if ('CI' in env) {
|
|
8954
|
-
return false;
|
|
8955
|
-
}
|
|
8956
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
8957
|
-
return false;
|
|
8958
|
-
}
|
|
8959
|
-
if ('TERM_PROGRAM' in env) {
|
|
8960
|
-
const version = parseVersion(env.TERM_PROGRAM_VERSION);
|
|
8961
|
-
switch (env.TERM_PROGRAM) {
|
|
8962
|
-
case 'iTerm.app':
|
|
8963
|
-
if (version.major === 3) {
|
|
8964
|
-
return version.minor >= 1;
|
|
8965
|
-
}
|
|
8966
|
-
return version.major > 3;
|
|
8967
|
-
case 'WezTerm':
|
|
8968
|
-
return version.major >= 20200620;
|
|
8969
|
-
case 'vscode':
|
|
8970
|
-
return version.major > 1 || version.major === 1 && version.minor >= 72;
|
|
8971
|
-
// No default
|
|
8972
|
-
}
|
|
8973
|
-
}
|
|
8974
|
-
if ('VTE_VERSION' in env) {
|
|
8975
|
-
// 0.50.0 was supposed to support hyperlinks, but throws a segfault
|
|
8976
|
-
if (env.VTE_VERSION === '0.50.0') {
|
|
8977
|
-
return false;
|
|
8978
|
-
}
|
|
8979
|
-
const version = parseVersion(env.VTE_VERSION);
|
|
8980
|
-
return version.major > 0 || version.minor >= 50;
|
|
8981
|
-
}
|
|
8982
|
-
return false;
|
|
8983
|
-
}
|
|
8984
|
-
var supportsHyperlinks = {
|
|
8985
|
-
supportsHyperlink,
|
|
8986
|
-
stdout: supportsHyperlink(process.stdout),
|
|
8987
|
-
stderr: supportsHyperlink(process.stderr)
|
|
8988
|
-
};
|
|
8989
|
-
|
|
8990
|
-
function terminalLink(text, url, {
|
|
8991
|
-
target = 'stdout',
|
|
8992
|
-
...options
|
|
8993
|
-
} = {}) {
|
|
8994
|
-
if (!supportsHyperlinks[target]) {
|
|
8995
|
-
// If the fallback has been explicitly disabled, don't modify the text itself.
|
|
8996
|
-
if (options.fallback === false) {
|
|
8997
|
-
return text;
|
|
8998
|
-
}
|
|
8999
|
-
return typeof options.fallback === 'function' ? options.fallback(text, url) : `${text} (\u200B${url}\u200B)`;
|
|
9000
|
-
}
|
|
9001
|
-
return ansiEscapes.link(text, url);
|
|
9002
|
-
}
|
|
9003
|
-
terminalLink.isSupported = supportsHyperlinks.stdout;
|
|
9004
|
-
terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {
|
|
9005
|
-
target: 'stderr',
|
|
9006
|
-
...options
|
|
9007
|
-
});
|
|
9008
|
-
terminalLink.stderr.isSupported = supportsHyperlinks.stderr;
|
|
9009
|
-
|
|
9010
|
-
function isInteractive({
|
|
9011
|
-
stream = process.stdout
|
|
9012
|
-
} = {}) {
|
|
9013
|
-
return Boolean(stream && stream.isTTY && process.env.TERM !== 'dumb' && !('CI' in process.env));
|
|
9014
|
-
}
|
|
9015
|
-
|
|
9016
8672
|
let isDockerCached;
|
|
9017
8673
|
function hasDockerEnv() {
|
|
9018
8674
|
try {
|
|
@@ -9060,7 +8716,7 @@ const isWsl = () => {
|
|
|
9060
8716
|
if (process$2.platform !== 'linux') {
|
|
9061
8717
|
return false;
|
|
9062
8718
|
}
|
|
9063
|
-
if (os$
|
|
8719
|
+
if (os$3.release().toLowerCase().includes('microsoft')) {
|
|
9064
8720
|
if (isInsideContainer()) {
|
|
9065
8721
|
return false;
|
|
9066
8722
|
}
|
|
@@ -9495,9 +9151,6 @@ defineLazyProperty(apps, 'edge', () => detectPlatformBinary({
|
|
|
9495
9151
|
defineLazyProperty(apps, 'browser', () => 'browser');
|
|
9496
9152
|
defineLazyProperty(apps, 'browserPrivate', () => 'browserPrivate');
|
|
9497
9153
|
|
|
9498
|
-
exports.isInteractive = isInteractive;
|
|
9499
|
-
exports.isUnicodeSupported = isUnicodeSupported;
|
|
9500
9154
|
exports.meow = meow;
|
|
9501
9155
|
exports.open = open;
|
|
9502
|
-
exports.terminalLink = terminalLink;
|
|
9503
9156
|
exports.updater = updater;
|