@302ai/media-studio-cli 0.1.0-beta.5 → 0.1.0-beta.7

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.
Files changed (3) hide show
  1. package/README.md +26 -2
  2. package/dist/index.js +2212 -82
  3. package/package.json +3 -1
package/dist/index.js CHANGED
@@ -923,6 +923,1850 @@ var require_src = __commonJS(function(exports, module) {
923
923
  module.exports = { cursor, scroll, erase, beep };
924
924
  });
925
925
 
926
+ // ../../node_modules/semver/internal/constants.js
927
+ var require_constants = __commonJS(function(exports, module) {
928
+ var SEMVER_SPEC_VERSION = "2.0.0";
929
+ var MAX_LENGTH = 256;
930
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
931
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
932
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
933
+ var RELEASE_TYPES = [
934
+ "major",
935
+ "premajor",
936
+ "minor",
937
+ "preminor",
938
+ "patch",
939
+ "prepatch",
940
+ "prerelease"
941
+ ];
942
+ module.exports = {
943
+ MAX_LENGTH,
944
+ MAX_SAFE_COMPONENT_LENGTH,
945
+ MAX_SAFE_BUILD_LENGTH,
946
+ MAX_SAFE_INTEGER,
947
+ RELEASE_TYPES,
948
+ SEMVER_SPEC_VERSION,
949
+ FLAG_INCLUDE_PRERELEASE: 1,
950
+ FLAG_LOOSE: 2
951
+ };
952
+ });
953
+
954
+ // ../../node_modules/semver/internal/debug.js
955
+ var require_debug = __commonJS(function(exports, module) {
956
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
957
+ module.exports = debug;
958
+ });
959
+
960
+ // ../../node_modules/semver/internal/re.js
961
+ var require_re = __commonJS(function(exports, module) {
962
+ var {
963
+ MAX_SAFE_COMPONENT_LENGTH,
964
+ MAX_SAFE_BUILD_LENGTH,
965
+ MAX_LENGTH
966
+ } = require_constants();
967
+ var debug = require_debug();
968
+ exports = module.exports = {};
969
+ var re = exports.re = [];
970
+ var safeRe = exports.safeRe = [];
971
+ var src = exports.src = [];
972
+ var safeSrc = exports.safeSrc = [];
973
+ var t = exports.t = {};
974
+ var R = 0;
975
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
976
+ var safeRegexReplacements = [
977
+ ["\\s", 1],
978
+ ["\\d", MAX_LENGTH],
979
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
980
+ ];
981
+ var makeSafeRegex = (value) => {
982
+ for (const [token, max] of safeRegexReplacements) {
983
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
984
+ }
985
+ return value;
986
+ };
987
+ var createToken = (name, value, isGlobal) => {
988
+ const safe = makeSafeRegex(value);
989
+ const index = R++;
990
+ debug(name, index, value);
991
+ t[name] = index;
992
+ src[index] = value;
993
+ safeSrc[index] = safe;
994
+ re[index] = new RegExp(value, isGlobal ? "g" : undefined);
995
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : undefined);
996
+ };
997
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
998
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
999
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
1000
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`);
1001
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
1002
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
1003
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
1004
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
1005
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
1006
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
1007
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
1008
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
1009
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
1010
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
1011
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
1012
+ createToken("GTLT", "((?:<|>)?=?)");
1013
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
1014
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
1015
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + `)?)?`);
1016
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + `)?)?`);
1017
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
1018
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
1019
+ createToken("COERCEPLAIN", `${"(^|[^\\d])" + "(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
1020
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
1021
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + `(?:$|[^\\d])`);
1022
+ createToken("COERCERTL", src[t.COERCE], true);
1023
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
1024
+ createToken("LONETILDE", "(?:~>?)");
1025
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
1026
+ exports.tildeTrimReplace = "$1~";
1027
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
1028
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
1029
+ createToken("LONECARET", "(?:\\^)");
1030
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
1031
+ exports.caretTrimReplace = "$1^";
1032
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
1033
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
1034
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
1035
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
1036
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
1037
+ exports.comparatorTrimReplace = "$1$2$3";
1038
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`);
1039
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`);
1040
+ createToken("STAR", "(<|>)?=?\\s*\\*");
1041
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
1042
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
1043
+ });
1044
+
1045
+ // ../../node_modules/semver/internal/parse-options.js
1046
+ var require_parse_options = __commonJS(function(exports, module) {
1047
+ var looseOption = Object.freeze({ loose: true });
1048
+ var emptyOpts = Object.freeze({});
1049
+ var parseOptions = (options) => {
1050
+ if (!options) {
1051
+ return emptyOpts;
1052
+ }
1053
+ if (typeof options !== "object") {
1054
+ return looseOption;
1055
+ }
1056
+ return options;
1057
+ };
1058
+ module.exports = parseOptions;
1059
+ });
1060
+
1061
+ // ../../node_modules/semver/internal/identifiers.js
1062
+ var require_identifiers = __commonJS(function(exports, module) {
1063
+ var numeric = /^[0-9]+$/;
1064
+ var compareIdentifiers = (a, b) => {
1065
+ if (typeof a === "number" && typeof b === "number") {
1066
+ return a === b ? 0 : a < b ? -1 : 1;
1067
+ }
1068
+ const anum = numeric.test(a);
1069
+ const bnum = numeric.test(b);
1070
+ if (anum && bnum) {
1071
+ a = +a;
1072
+ b = +b;
1073
+ }
1074
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
1075
+ };
1076
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
1077
+ module.exports = {
1078
+ compareIdentifiers,
1079
+ rcompareIdentifiers
1080
+ };
1081
+ });
1082
+
1083
+ // ../../node_modules/semver/classes/semver.js
1084
+ var require_semver = __commonJS(function(exports, module) {
1085
+ var debug = require_debug();
1086
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
1087
+ var { safeRe: re, t } = require_re();
1088
+ var parseOptions = require_parse_options();
1089
+ var { compareIdentifiers } = require_identifiers();
1090
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
1091
+ const identifiers = identifier.split(".");
1092
+ if (identifiers.length > prerelease.length) {
1093
+ return false;
1094
+ }
1095
+ for (let i = 0;i < identifiers.length; i++) {
1096
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
1097
+ return false;
1098
+ }
1099
+ }
1100
+ return true;
1101
+ };
1102
+
1103
+ class SemVer {
1104
+ constructor(version, options) {
1105
+ options = parseOptions(options);
1106
+ if (version instanceof SemVer) {
1107
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
1108
+ return version;
1109
+ } else {
1110
+ version = version.version;
1111
+ }
1112
+ } else if (typeof version !== "string") {
1113
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
1114
+ }
1115
+ if (version.length > MAX_LENGTH) {
1116
+ throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
1117
+ }
1118
+ debug("SemVer", version, options);
1119
+ this.options = options;
1120
+ this.loose = !!options.loose;
1121
+ this.includePrerelease = !!options.includePrerelease;
1122
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
1123
+ if (!m) {
1124
+ throw new TypeError(`Invalid Version: ${version}`);
1125
+ }
1126
+ this.raw = version;
1127
+ this.major = +m[1];
1128
+ this.minor = +m[2];
1129
+ this.patch = +m[3];
1130
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
1131
+ throw new TypeError("Invalid major version");
1132
+ }
1133
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
1134
+ throw new TypeError("Invalid minor version");
1135
+ }
1136
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
1137
+ throw new TypeError("Invalid patch version");
1138
+ }
1139
+ if (!m[4]) {
1140
+ this.prerelease = [];
1141
+ } else {
1142
+ this.prerelease = m[4].split(".").map((id) => {
1143
+ if (/^[0-9]+$/.test(id)) {
1144
+ const num = +id;
1145
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
1146
+ return num;
1147
+ }
1148
+ }
1149
+ return id;
1150
+ });
1151
+ }
1152
+ this.build = m[5] ? m[5].split(".") : [];
1153
+ this.format();
1154
+ }
1155
+ format() {
1156
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
1157
+ if (this.prerelease.length) {
1158
+ this.version += `-${this.prerelease.join(".")}`;
1159
+ }
1160
+ return this.version;
1161
+ }
1162
+ toString() {
1163
+ return this.version;
1164
+ }
1165
+ compare(other) {
1166
+ debug("SemVer.compare", this.version, this.options, other);
1167
+ if (!(other instanceof SemVer)) {
1168
+ if (typeof other === "string" && other === this.version) {
1169
+ return 0;
1170
+ }
1171
+ other = new SemVer(other, this.options);
1172
+ }
1173
+ if (other.version === this.version) {
1174
+ return 0;
1175
+ }
1176
+ return this.compareMain(other) || this.comparePre(other);
1177
+ }
1178
+ compareMain(other) {
1179
+ if (!(other instanceof SemVer)) {
1180
+ other = new SemVer(other, this.options);
1181
+ }
1182
+ if (this.major < other.major) {
1183
+ return -1;
1184
+ }
1185
+ if (this.major > other.major) {
1186
+ return 1;
1187
+ }
1188
+ if (this.minor < other.minor) {
1189
+ return -1;
1190
+ }
1191
+ if (this.minor > other.minor) {
1192
+ return 1;
1193
+ }
1194
+ if (this.patch < other.patch) {
1195
+ return -1;
1196
+ }
1197
+ if (this.patch > other.patch) {
1198
+ return 1;
1199
+ }
1200
+ return 0;
1201
+ }
1202
+ comparePre(other) {
1203
+ if (!(other instanceof SemVer)) {
1204
+ other = new SemVer(other, this.options);
1205
+ }
1206
+ if (this.prerelease.length && !other.prerelease.length) {
1207
+ return -1;
1208
+ } else if (!this.prerelease.length && other.prerelease.length) {
1209
+ return 1;
1210
+ } else if (!this.prerelease.length && !other.prerelease.length) {
1211
+ return 0;
1212
+ }
1213
+ let i = 0;
1214
+ do {
1215
+ const a = this.prerelease[i];
1216
+ const b = other.prerelease[i];
1217
+ debug("prerelease compare", i, a, b);
1218
+ if (a === undefined && b === undefined) {
1219
+ return 0;
1220
+ } else if (b === undefined) {
1221
+ return 1;
1222
+ } else if (a === undefined) {
1223
+ return -1;
1224
+ } else if (a === b) {
1225
+ continue;
1226
+ } else {
1227
+ return compareIdentifiers(a, b);
1228
+ }
1229
+ } while (++i);
1230
+ }
1231
+ compareBuild(other) {
1232
+ if (!(other instanceof SemVer)) {
1233
+ other = new SemVer(other, this.options);
1234
+ }
1235
+ let i = 0;
1236
+ do {
1237
+ const a = this.build[i];
1238
+ const b = other.build[i];
1239
+ debug("build compare", i, a, b);
1240
+ if (a === undefined && b === undefined) {
1241
+ return 0;
1242
+ } else if (b === undefined) {
1243
+ return 1;
1244
+ } else if (a === undefined) {
1245
+ return -1;
1246
+ } else if (a === b) {
1247
+ continue;
1248
+ } else {
1249
+ return compareIdentifiers(a, b);
1250
+ }
1251
+ } while (++i);
1252
+ }
1253
+ inc(release, identifier, identifierBase) {
1254
+ if (release.startsWith("pre")) {
1255
+ if (!identifier && identifierBase === false) {
1256
+ throw new Error("invalid increment argument: identifier is empty");
1257
+ }
1258
+ if (identifier) {
1259
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
1260
+ if (!match || match[1] !== identifier) {
1261
+ throw new Error(`invalid identifier: ${identifier}`);
1262
+ }
1263
+ }
1264
+ }
1265
+ switch (release) {
1266
+ case "premajor":
1267
+ this.prerelease.length = 0;
1268
+ this.patch = 0;
1269
+ this.minor = 0;
1270
+ this.major++;
1271
+ this.inc("pre", identifier, identifierBase);
1272
+ break;
1273
+ case "preminor":
1274
+ this.prerelease.length = 0;
1275
+ this.patch = 0;
1276
+ this.minor++;
1277
+ this.inc("pre", identifier, identifierBase);
1278
+ break;
1279
+ case "prepatch":
1280
+ this.prerelease.length = 0;
1281
+ this.inc("patch", identifier, identifierBase);
1282
+ this.inc("pre", identifier, identifierBase);
1283
+ break;
1284
+ case "prerelease":
1285
+ if (this.prerelease.length === 0) {
1286
+ this.inc("patch", identifier, identifierBase);
1287
+ }
1288
+ this.inc("pre", identifier, identifierBase);
1289
+ break;
1290
+ case "release":
1291
+ if (this.prerelease.length === 0) {
1292
+ throw new Error(`version ${this.raw} is not a prerelease`);
1293
+ }
1294
+ this.prerelease.length = 0;
1295
+ break;
1296
+ case "major":
1297
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
1298
+ this.major++;
1299
+ }
1300
+ this.minor = 0;
1301
+ this.patch = 0;
1302
+ this.prerelease = [];
1303
+ break;
1304
+ case "minor":
1305
+ if (this.patch !== 0 || this.prerelease.length === 0) {
1306
+ this.minor++;
1307
+ }
1308
+ this.patch = 0;
1309
+ this.prerelease = [];
1310
+ break;
1311
+ case "patch":
1312
+ if (this.prerelease.length === 0) {
1313
+ this.patch++;
1314
+ }
1315
+ this.prerelease = [];
1316
+ break;
1317
+ case "pre": {
1318
+ const base = Number(identifierBase) ? 1 : 0;
1319
+ if (this.prerelease.length === 0) {
1320
+ this.prerelease = [base];
1321
+ } else {
1322
+ let i = this.prerelease.length;
1323
+ while (--i >= 0) {
1324
+ if (typeof this.prerelease[i] === "number") {
1325
+ this.prerelease[i]++;
1326
+ i = -2;
1327
+ }
1328
+ }
1329
+ if (i === -1) {
1330
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
1331
+ throw new Error("invalid increment argument: identifier already exists");
1332
+ }
1333
+ this.prerelease.push(base);
1334
+ }
1335
+ }
1336
+ if (identifier) {
1337
+ let prerelease = [identifier, base];
1338
+ if (identifierBase === false) {
1339
+ prerelease = [identifier];
1340
+ }
1341
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
1342
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
1343
+ if (isNaN(prereleaseBase)) {
1344
+ this.prerelease = prerelease;
1345
+ }
1346
+ } else {
1347
+ this.prerelease = prerelease;
1348
+ }
1349
+ }
1350
+ break;
1351
+ }
1352
+ default:
1353
+ throw new Error(`invalid increment argument: ${release}`);
1354
+ }
1355
+ this.raw = this.format();
1356
+ if (this.build.length) {
1357
+ this.raw += `+${this.build.join(".")}`;
1358
+ }
1359
+ return this;
1360
+ }
1361
+ }
1362
+ module.exports = SemVer;
1363
+ });
1364
+
1365
+ // ../../node_modules/semver/functions/parse.js
1366
+ var require_parse = __commonJS(function(exports, module) {
1367
+ var SemVer = require_semver();
1368
+ var parse = (version, options, throwErrors = false) => {
1369
+ if (version instanceof SemVer) {
1370
+ return version;
1371
+ }
1372
+ try {
1373
+ return new SemVer(version, options);
1374
+ } catch (er) {
1375
+ if (!throwErrors) {
1376
+ return null;
1377
+ }
1378
+ throw er;
1379
+ }
1380
+ };
1381
+ module.exports = parse;
1382
+ });
1383
+
1384
+ // ../../node_modules/semver/functions/valid.js
1385
+ var require_valid = __commonJS(function(exports, module) {
1386
+ var parse = require_parse();
1387
+ var valid = (version, options) => {
1388
+ const v = parse(version, options);
1389
+ return v ? v.version : null;
1390
+ };
1391
+ module.exports = valid;
1392
+ });
1393
+
1394
+ // ../../node_modules/semver/functions/clean.js
1395
+ var require_clean = __commonJS(function(exports, module) {
1396
+ var parse = require_parse();
1397
+ var clean = (version, options) => {
1398
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
1399
+ return s ? s.version : null;
1400
+ };
1401
+ module.exports = clean;
1402
+ });
1403
+
1404
+ // ../../node_modules/semver/functions/inc.js
1405
+ var require_inc = __commonJS(function(exports, module) {
1406
+ var SemVer = require_semver();
1407
+ var inc = (version, release, options, identifier, identifierBase) => {
1408
+ if (typeof options === "string") {
1409
+ identifierBase = identifier;
1410
+ identifier = options;
1411
+ options = undefined;
1412
+ }
1413
+ try {
1414
+ return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
1415
+ } catch (er) {
1416
+ return null;
1417
+ }
1418
+ };
1419
+ module.exports = inc;
1420
+ });
1421
+
1422
+ // ../../node_modules/semver/functions/diff.js
1423
+ var require_diff = __commonJS(function(exports, module) {
1424
+ var parse = require_parse();
1425
+ var diff = (version1, version2) => {
1426
+ const v1 = parse(version1, null, true);
1427
+ const v2 = parse(version2, null, true);
1428
+ const comparison = v1.compare(v2);
1429
+ if (comparison === 0) {
1430
+ return null;
1431
+ }
1432
+ const v1Higher = comparison > 0;
1433
+ const highVersion = v1Higher ? v1 : v2;
1434
+ const lowVersion = v1Higher ? v2 : v1;
1435
+ const highHasPre = !!highVersion.prerelease.length;
1436
+ const lowHasPre = !!lowVersion.prerelease.length;
1437
+ if (lowHasPre && !highHasPre) {
1438
+ if (!lowVersion.patch && !lowVersion.minor) {
1439
+ return "major";
1440
+ }
1441
+ if (lowVersion.compareMain(highVersion) === 0) {
1442
+ if (lowVersion.minor && !lowVersion.patch) {
1443
+ return "minor";
1444
+ }
1445
+ return "patch";
1446
+ }
1447
+ }
1448
+ const prefix = highHasPre ? "pre" : "";
1449
+ if (v1.major !== v2.major) {
1450
+ return prefix + "major";
1451
+ }
1452
+ if (v1.minor !== v2.minor) {
1453
+ return prefix + "minor";
1454
+ }
1455
+ if (v1.patch !== v2.patch) {
1456
+ return prefix + "patch";
1457
+ }
1458
+ return "prerelease";
1459
+ };
1460
+ module.exports = diff;
1461
+ });
1462
+
1463
+ // ../../node_modules/semver/functions/major.js
1464
+ var require_major = __commonJS(function(exports, module) {
1465
+ var SemVer = require_semver();
1466
+ var major = (a, loose) => new SemVer(a, loose).major;
1467
+ module.exports = major;
1468
+ });
1469
+
1470
+ // ../../node_modules/semver/functions/minor.js
1471
+ var require_minor = __commonJS(function(exports, module) {
1472
+ var SemVer = require_semver();
1473
+ var minor = (a, loose) => new SemVer(a, loose).minor;
1474
+ module.exports = minor;
1475
+ });
1476
+
1477
+ // ../../node_modules/semver/functions/patch.js
1478
+ var require_patch = __commonJS(function(exports, module) {
1479
+ var SemVer = require_semver();
1480
+ var patch = (a, loose) => new SemVer(a, loose).patch;
1481
+ module.exports = patch;
1482
+ });
1483
+
1484
+ // ../../node_modules/semver/functions/prerelease.js
1485
+ var require_prerelease = __commonJS(function(exports, module) {
1486
+ var parse = require_parse();
1487
+ var prerelease = (version, options) => {
1488
+ const parsed = parse(version, options);
1489
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
1490
+ };
1491
+ module.exports = prerelease;
1492
+ });
1493
+
1494
+ // ../../node_modules/semver/functions/compare.js
1495
+ var require_compare = __commonJS(function(exports, module) {
1496
+ var SemVer = require_semver();
1497
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
1498
+ module.exports = compare;
1499
+ });
1500
+
1501
+ // ../../node_modules/semver/functions/rcompare.js
1502
+ var require_rcompare = __commonJS(function(exports, module) {
1503
+ var compare = require_compare();
1504
+ var rcompare = (a, b, loose) => compare(b, a, loose);
1505
+ module.exports = rcompare;
1506
+ });
1507
+
1508
+ // ../../node_modules/semver/functions/compare-loose.js
1509
+ var require_compare_loose = __commonJS(function(exports, module) {
1510
+ var compare = require_compare();
1511
+ var compareLoose = (a, b) => compare(a, b, true);
1512
+ module.exports = compareLoose;
1513
+ });
1514
+
1515
+ // ../../node_modules/semver/functions/compare-build.js
1516
+ var require_compare_build = __commonJS(function(exports, module) {
1517
+ var SemVer = require_semver();
1518
+ var compareBuild = (a, b, loose) => {
1519
+ const versionA = new SemVer(a, loose);
1520
+ const versionB = new SemVer(b, loose);
1521
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
1522
+ };
1523
+ module.exports = compareBuild;
1524
+ });
1525
+
1526
+ // ../../node_modules/semver/functions/sort.js
1527
+ var require_sort = __commonJS(function(exports, module) {
1528
+ var compareBuild = require_compare_build();
1529
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
1530
+ module.exports = sort;
1531
+ });
1532
+
1533
+ // ../../node_modules/semver/functions/rsort.js
1534
+ var require_rsort = __commonJS(function(exports, module) {
1535
+ var compareBuild = require_compare_build();
1536
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
1537
+ module.exports = rsort;
1538
+ });
1539
+
1540
+ // ../../node_modules/semver/functions/gt.js
1541
+ var require_gt = __commonJS(function(exports, module) {
1542
+ var compare = require_compare();
1543
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
1544
+ module.exports = gt;
1545
+ });
1546
+
1547
+ // ../../node_modules/semver/functions/lt.js
1548
+ var require_lt = __commonJS(function(exports, module) {
1549
+ var compare = require_compare();
1550
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
1551
+ module.exports = lt;
1552
+ });
1553
+
1554
+ // ../../node_modules/semver/functions/eq.js
1555
+ var require_eq = __commonJS(function(exports, module) {
1556
+ var compare = require_compare();
1557
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
1558
+ module.exports = eq;
1559
+ });
1560
+
1561
+ // ../../node_modules/semver/functions/neq.js
1562
+ var require_neq = __commonJS(function(exports, module) {
1563
+ var compare = require_compare();
1564
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
1565
+ module.exports = neq;
1566
+ });
1567
+
1568
+ // ../../node_modules/semver/functions/gte.js
1569
+ var require_gte = __commonJS(function(exports, module) {
1570
+ var compare = require_compare();
1571
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
1572
+ module.exports = gte;
1573
+ });
1574
+
1575
+ // ../../node_modules/semver/functions/lte.js
1576
+ var require_lte = __commonJS(function(exports, module) {
1577
+ var compare = require_compare();
1578
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
1579
+ module.exports = lte;
1580
+ });
1581
+
1582
+ // ../../node_modules/semver/functions/cmp.js
1583
+ var require_cmp = __commonJS(function(exports, module) {
1584
+ var eq = require_eq();
1585
+ var neq = require_neq();
1586
+ var gt = require_gt();
1587
+ var gte = require_gte();
1588
+ var lt = require_lt();
1589
+ var lte = require_lte();
1590
+ var cmp = (a, op, b, loose) => {
1591
+ switch (op) {
1592
+ case "===":
1593
+ if (typeof a === "object") {
1594
+ a = a.version;
1595
+ }
1596
+ if (typeof b === "object") {
1597
+ b = b.version;
1598
+ }
1599
+ return a === b;
1600
+ case "!==":
1601
+ if (typeof a === "object") {
1602
+ a = a.version;
1603
+ }
1604
+ if (typeof b === "object") {
1605
+ b = b.version;
1606
+ }
1607
+ return a !== b;
1608
+ case "":
1609
+ case "=":
1610
+ case "==":
1611
+ return eq(a, b, loose);
1612
+ case "!=":
1613
+ return neq(a, b, loose);
1614
+ case ">":
1615
+ return gt(a, b, loose);
1616
+ case ">=":
1617
+ return gte(a, b, loose);
1618
+ case "<":
1619
+ return lt(a, b, loose);
1620
+ case "<=":
1621
+ return lte(a, b, loose);
1622
+ default:
1623
+ throw new TypeError(`Invalid operator: ${op}`);
1624
+ }
1625
+ };
1626
+ module.exports = cmp;
1627
+ });
1628
+
1629
+ // ../../node_modules/semver/functions/coerce.js
1630
+ var require_coerce = __commonJS(function(exports, module) {
1631
+ var SemVer = require_semver();
1632
+ var parse = require_parse();
1633
+ var { safeRe: re, t } = require_re();
1634
+ var coerce = (version, options) => {
1635
+ if (version instanceof SemVer) {
1636
+ return version;
1637
+ }
1638
+ if (typeof version === "number") {
1639
+ version = String(version);
1640
+ }
1641
+ if (typeof version !== "string") {
1642
+ return null;
1643
+ }
1644
+ options = options || {};
1645
+ let match = null;
1646
+ if (!options.rtl) {
1647
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
1648
+ } else {
1649
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
1650
+ let next;
1651
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
1652
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
1653
+ match = next;
1654
+ }
1655
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
1656
+ }
1657
+ coerceRtlRegex.lastIndex = -1;
1658
+ }
1659
+ if (match === null) {
1660
+ return null;
1661
+ }
1662
+ const major = match[2];
1663
+ const minor = match[3] || "0";
1664
+ const patch = match[4] || "0";
1665
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
1666
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
1667
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
1668
+ };
1669
+ module.exports = coerce;
1670
+ });
1671
+
1672
+ // ../../node_modules/semver/functions/truncate.js
1673
+ var require_truncate = __commonJS(function(exports, module) {
1674
+ var parse = require_parse();
1675
+ var constants = require_constants();
1676
+ var SemVer = require_semver();
1677
+ var truncate = (version, truncation, options) => {
1678
+ if (!constants.RELEASE_TYPES.includes(truncation)) {
1679
+ return null;
1680
+ }
1681
+ const clonedVersion = cloneInputVersion(version, options);
1682
+ return clonedVersion && doTruncation(clonedVersion, truncation);
1683
+ };
1684
+ var cloneInputVersion = (version, options) => {
1685
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
1686
+ return parse(versionStringToParse, options);
1687
+ };
1688
+ var doTruncation = (version, truncation) => {
1689
+ if (isPrerelease(truncation)) {
1690
+ return version.version;
1691
+ }
1692
+ version.prerelease = [];
1693
+ switch (truncation) {
1694
+ case "major":
1695
+ version.minor = 0;
1696
+ version.patch = 0;
1697
+ break;
1698
+ case "minor":
1699
+ version.patch = 0;
1700
+ break;
1701
+ }
1702
+ return version.format();
1703
+ };
1704
+ var isPrerelease = (type) => {
1705
+ return type.startsWith("pre");
1706
+ };
1707
+ module.exports = truncate;
1708
+ });
1709
+
1710
+ // ../../node_modules/semver/internal/lrucache.js
1711
+ var require_lrucache = __commonJS(function(exports, module) {
1712
+ class LRUCache {
1713
+ constructor() {
1714
+ this.max = 1000;
1715
+ this.map = new Map;
1716
+ }
1717
+ get(key) {
1718
+ const value = this.map.get(key);
1719
+ if (value === undefined) {
1720
+ return;
1721
+ } else {
1722
+ this.map.delete(key);
1723
+ this.map.set(key, value);
1724
+ return value;
1725
+ }
1726
+ }
1727
+ delete(key) {
1728
+ return this.map.delete(key);
1729
+ }
1730
+ set(key, value) {
1731
+ const deleted = this.delete(key);
1732
+ if (!deleted && value !== undefined) {
1733
+ if (this.map.size >= this.max) {
1734
+ const firstKey = this.map.keys().next().value;
1735
+ this.delete(firstKey);
1736
+ }
1737
+ this.map.set(key, value);
1738
+ }
1739
+ return this;
1740
+ }
1741
+ }
1742
+ module.exports = LRUCache;
1743
+ });
1744
+
1745
+ // ../../node_modules/semver/classes/range.js
1746
+ var require_range = __commonJS(function(exports, module) {
1747
+ var SPACE_CHARACTERS = /\s+/g;
1748
+
1749
+ class Range {
1750
+ constructor(range, options) {
1751
+ options = parseOptions(options);
1752
+ if (range instanceof Range) {
1753
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
1754
+ return range;
1755
+ } else {
1756
+ return new Range(range.raw, options);
1757
+ }
1758
+ }
1759
+ if (range instanceof Comparator) {
1760
+ this.raw = range.value;
1761
+ this.set = [[range]];
1762
+ this.formatted = undefined;
1763
+ return this;
1764
+ }
1765
+ this.options = options;
1766
+ this.loose = !!options.loose;
1767
+ this.includePrerelease = !!options.includePrerelease;
1768
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
1769
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
1770
+ if (!this.set.length) {
1771
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
1772
+ }
1773
+ if (this.set.length > 1) {
1774
+ const first = this.set[0];
1775
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
1776
+ if (this.set.length === 0) {
1777
+ this.set = [first];
1778
+ } else if (this.set.length > 1) {
1779
+ for (const c of this.set) {
1780
+ if (c.length === 1 && isAny(c[0])) {
1781
+ this.set = [c];
1782
+ break;
1783
+ }
1784
+ }
1785
+ }
1786
+ }
1787
+ this.formatted = undefined;
1788
+ }
1789
+ get range() {
1790
+ if (this.formatted === undefined) {
1791
+ this.formatted = "";
1792
+ for (let i = 0;i < this.set.length; i++) {
1793
+ if (i > 0) {
1794
+ this.formatted += "||";
1795
+ }
1796
+ const comps = this.set[i];
1797
+ for (let k = 0;k < comps.length; k++) {
1798
+ if (k > 0) {
1799
+ this.formatted += " ";
1800
+ }
1801
+ this.formatted += comps[k].toString().trim();
1802
+ }
1803
+ }
1804
+ }
1805
+ return this.formatted;
1806
+ }
1807
+ format() {
1808
+ return this.range;
1809
+ }
1810
+ toString() {
1811
+ return this.range;
1812
+ }
1813
+ parseRange(range) {
1814
+ range = range.replace(BUILDSTRIPRE, "");
1815
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
1816
+ const memoKey = memoOpts + ":" + range;
1817
+ const cached = cache.get(memoKey);
1818
+ if (cached) {
1819
+ return cached;
1820
+ }
1821
+ const loose = this.options.loose;
1822
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1823
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1824
+ debug("hyphen replace", range);
1825
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1826
+ debug("comparator trim", range);
1827
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1828
+ debug("tilde trim", range);
1829
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1830
+ debug("caret trim", range);
1831
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1832
+ if (loose) {
1833
+ rangeList = rangeList.filter((comp) => {
1834
+ debug("loose invalid filter", comp, this.options);
1835
+ return !!comp.match(re[t.COMPARATORLOOSE]);
1836
+ });
1837
+ }
1838
+ debug("range list", rangeList);
1839
+ const rangeMap = new Map;
1840
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
1841
+ for (const comp of comparators) {
1842
+ if (isNullSet(comp)) {
1843
+ return [comp];
1844
+ }
1845
+ rangeMap.set(comp.value, comp);
1846
+ }
1847
+ if (rangeMap.size > 1 && rangeMap.has("")) {
1848
+ rangeMap.delete("");
1849
+ }
1850
+ const result = [...rangeMap.values()];
1851
+ cache.set(memoKey, result);
1852
+ return result;
1853
+ }
1854
+ intersects(range, options) {
1855
+ if (!(range instanceof Range)) {
1856
+ throw new TypeError("a Range is required");
1857
+ }
1858
+ return this.set.some((thisComparators) => {
1859
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
1860
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
1861
+ return rangeComparators.every((rangeComparator) => {
1862
+ return thisComparator.intersects(rangeComparator, options);
1863
+ });
1864
+ });
1865
+ });
1866
+ });
1867
+ }
1868
+ test(version) {
1869
+ if (!version) {
1870
+ return false;
1871
+ }
1872
+ if (typeof version === "string") {
1873
+ try {
1874
+ version = new SemVer(version, this.options);
1875
+ } catch (er) {
1876
+ return false;
1877
+ }
1878
+ }
1879
+ for (let i = 0;i < this.set.length; i++) {
1880
+ if (testSet(this.set[i], version, this.options)) {
1881
+ return true;
1882
+ }
1883
+ }
1884
+ return false;
1885
+ }
1886
+ }
1887
+ module.exports = Range;
1888
+ var LRU = require_lrucache();
1889
+ var cache = new LRU;
1890
+ var parseOptions = require_parse_options();
1891
+ var Comparator = require_comparator();
1892
+ var debug = require_debug();
1893
+ var SemVer = require_semver();
1894
+ var {
1895
+ safeRe: re,
1896
+ src,
1897
+ t,
1898
+ comparatorTrimReplace,
1899
+ tildeTrimReplace,
1900
+ caretTrimReplace
1901
+ } = require_re();
1902
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1903
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
1904
+ var isNullSet = (c) => c.value === "<0.0.0-0";
1905
+ var isAny = (c) => c.value === "";
1906
+ var isSatisfiable = (comparators, options) => {
1907
+ let result = true;
1908
+ const remainingComparators = comparators.slice();
1909
+ let testComparator = remainingComparators.pop();
1910
+ while (result && remainingComparators.length) {
1911
+ result = remainingComparators.every((otherComparator) => {
1912
+ return testComparator.intersects(otherComparator, options);
1913
+ });
1914
+ testComparator = remainingComparators.pop();
1915
+ }
1916
+ return result;
1917
+ };
1918
+ var parseComparator = (comp, options) => {
1919
+ comp = comp.replace(re[t.BUILD], "");
1920
+ debug("comp", comp, options);
1921
+ comp = replaceCarets(comp, options);
1922
+ debug("caret", comp);
1923
+ comp = replaceTildes(comp, options);
1924
+ debug("tildes", comp);
1925
+ comp = replaceXRanges(comp, options);
1926
+ debug("xrange", comp);
1927
+ comp = replaceStars(comp, options);
1928
+ debug("stars", comp);
1929
+ return comp;
1930
+ };
1931
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1932
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
1933
+ var replaceTildes = (comp, options) => {
1934
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1935
+ };
1936
+ var replaceTilde = (comp, options) => {
1937
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1938
+ const z = options.includePrerelease ? "-0" : "";
1939
+ return comp.replace(r, (_, M, m, p, pr) => {
1940
+ debug("tilde", comp, _, M, m, p, pr);
1941
+ let ret;
1942
+ if (isX(M)) {
1943
+ ret = "";
1944
+ } else if (isX(m)) {
1945
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1946
+ } else if (isX(p)) {
1947
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1948
+ } else if (pr) {
1949
+ debug("replaceTilde pr", pr);
1950
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1951
+ } else {
1952
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1953
+ }
1954
+ debug("tilde return", ret);
1955
+ return ret;
1956
+ });
1957
+ };
1958
+ var replaceCarets = (comp, options) => {
1959
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1960
+ };
1961
+ var replaceCaret = (comp, options) => {
1962
+ debug("caret", comp, options);
1963
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1964
+ const z = options.includePrerelease ? "-0" : "";
1965
+ return comp.replace(r, (_, M, m, p, pr) => {
1966
+ debug("caret", comp, _, M, m, p, pr);
1967
+ let ret;
1968
+ if (isX(M)) {
1969
+ ret = "";
1970
+ } else if (isX(m)) {
1971
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1972
+ } else if (isX(p)) {
1973
+ if (M === "0") {
1974
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1975
+ } else {
1976
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1977
+ }
1978
+ } else if (pr) {
1979
+ debug("replaceCaret pr", pr);
1980
+ if (M === "0") {
1981
+ if (m === "0") {
1982
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1983
+ } else {
1984
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1985
+ }
1986
+ } else {
1987
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1988
+ }
1989
+ } else {
1990
+ debug("no pr");
1991
+ if (M === "0") {
1992
+ if (m === "0") {
1993
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
1994
+ } else {
1995
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1996
+ }
1997
+ } else {
1998
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1999
+ }
2000
+ }
2001
+ debug("caret return", ret);
2002
+ return ret;
2003
+ });
2004
+ };
2005
+ var replaceXRanges = (comp, options) => {
2006
+ debug("replaceXRanges", comp, options);
2007
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
2008
+ };
2009
+ var replaceXRange = (comp, options) => {
2010
+ comp = comp.trim();
2011
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2012
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2013
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
2014
+ if (invalidXRangeOrder(M, m, p)) {
2015
+ return comp;
2016
+ }
2017
+ const xM = isX(M);
2018
+ const xm = xM || isX(m);
2019
+ const xp = xm || isX(p);
2020
+ const anyX = xp;
2021
+ if (gtlt === "=" && anyX) {
2022
+ gtlt = "";
2023
+ }
2024
+ pr = options.includePrerelease ? "-0" : "";
2025
+ if (xM) {
2026
+ if (gtlt === ">" || gtlt === "<") {
2027
+ ret = "<0.0.0-0";
2028
+ } else {
2029
+ ret = "*";
2030
+ }
2031
+ } else if (gtlt && anyX) {
2032
+ if (xm) {
2033
+ m = 0;
2034
+ }
2035
+ p = 0;
2036
+ if (gtlt === ">") {
2037
+ gtlt = ">=";
2038
+ if (xm) {
2039
+ M = +M + 1;
2040
+ m = 0;
2041
+ p = 0;
2042
+ } else {
2043
+ m = +m + 1;
2044
+ p = 0;
2045
+ }
2046
+ } else if (gtlt === "<=") {
2047
+ gtlt = "<";
2048
+ if (xm) {
2049
+ M = +M + 1;
2050
+ } else {
2051
+ m = +m + 1;
2052
+ }
2053
+ }
2054
+ if (gtlt === "<") {
2055
+ pr = "-0";
2056
+ }
2057
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
2058
+ } else if (xm) {
2059
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
2060
+ } else if (xp) {
2061
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
2062
+ }
2063
+ debug("xRange return", ret);
2064
+ return ret;
2065
+ });
2066
+ };
2067
+ var replaceStars = (comp, options) => {
2068
+ debug("replaceStars", comp, options);
2069
+ return comp.trim().replace(re[t.STAR], "");
2070
+ };
2071
+ var replaceGTE0 = (comp, options) => {
2072
+ debug("replaceGTE0", comp, options);
2073
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
2074
+ };
2075
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
2076
+ if (isX(fM)) {
2077
+ from = "";
2078
+ } else if (isX(fm)) {
2079
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
2080
+ } else if (isX(fp)) {
2081
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
2082
+ } else if (fpr) {
2083
+ from = `>=${from}`;
2084
+ } else {
2085
+ from = `>=${from}${incPr ? "-0" : ""}`;
2086
+ }
2087
+ if (isX(tM)) {
2088
+ to = "";
2089
+ } else if (isX(tm)) {
2090
+ to = `<${+tM + 1}.0.0-0`;
2091
+ } else if (isX(tp)) {
2092
+ to = `<${tM}.${+tm + 1}.0-0`;
2093
+ } else if (tpr) {
2094
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
2095
+ } else if (incPr) {
2096
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
2097
+ } else {
2098
+ to = `<=${to}`;
2099
+ }
2100
+ return `${from} ${to}`.trim();
2101
+ };
2102
+ var testSet = (set, version, options) => {
2103
+ for (let i = 0;i < set.length; i++) {
2104
+ if (!set[i].test(version)) {
2105
+ return false;
2106
+ }
2107
+ }
2108
+ if (version.prerelease.length && !options.includePrerelease) {
2109
+ for (let i = 0;i < set.length; i++) {
2110
+ debug(set[i].semver);
2111
+ if (set[i].semver === Comparator.ANY) {
2112
+ continue;
2113
+ }
2114
+ if (set[i].semver.prerelease.length > 0) {
2115
+ const allowed = set[i].semver;
2116
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
2117
+ return true;
2118
+ }
2119
+ }
2120
+ }
2121
+ return false;
2122
+ }
2123
+ return true;
2124
+ };
2125
+ });
2126
+
2127
+ // ../../node_modules/semver/classes/comparator.js
2128
+ var require_comparator = __commonJS(function(exports, module) {
2129
+ var ANY = Symbol("SemVer ANY");
2130
+
2131
+ class Comparator {
2132
+ static get ANY() {
2133
+ return ANY;
2134
+ }
2135
+ constructor(comp, options) {
2136
+ options = parseOptions(options);
2137
+ if (comp instanceof Comparator) {
2138
+ if (comp.loose === !!options.loose) {
2139
+ return comp;
2140
+ } else {
2141
+ comp = comp.value;
2142
+ }
2143
+ }
2144
+ comp = comp.trim().split(/\s+/).join(" ");
2145
+ debug("comparator", comp, options);
2146
+ this.options = options;
2147
+ this.loose = !!options.loose;
2148
+ this.parse(comp);
2149
+ if (this.semver === ANY) {
2150
+ this.value = "";
2151
+ } else {
2152
+ this.value = this.operator + this.semver.version;
2153
+ }
2154
+ debug("comp", this);
2155
+ }
2156
+ parse(comp) {
2157
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
2158
+ const m = comp.match(r);
2159
+ if (!m) {
2160
+ throw new TypeError(`Invalid comparator: ${comp}`);
2161
+ }
2162
+ this.operator = m[1] !== undefined ? m[1] : "";
2163
+ if (this.operator === "=") {
2164
+ this.operator = "";
2165
+ }
2166
+ if (!m[2]) {
2167
+ this.semver = ANY;
2168
+ } else {
2169
+ this.semver = new SemVer(m[2], this.options.loose);
2170
+ }
2171
+ }
2172
+ toString() {
2173
+ return this.value;
2174
+ }
2175
+ test(version) {
2176
+ debug("Comparator.test", version, this.options.loose);
2177
+ if (this.semver === ANY || version === ANY) {
2178
+ return true;
2179
+ }
2180
+ if (typeof version === "string") {
2181
+ try {
2182
+ version = new SemVer(version, this.options);
2183
+ } catch (er) {
2184
+ return false;
2185
+ }
2186
+ }
2187
+ return cmp(version, this.operator, this.semver, this.options);
2188
+ }
2189
+ intersects(comp, options) {
2190
+ if (!(comp instanceof Comparator)) {
2191
+ throw new TypeError("a Comparator is required");
2192
+ }
2193
+ if (this.operator === "") {
2194
+ if (this.value === "") {
2195
+ return true;
2196
+ }
2197
+ return new Range(comp.value, options).test(this.value);
2198
+ } else if (comp.operator === "") {
2199
+ if (comp.value === "") {
2200
+ return true;
2201
+ }
2202
+ return new Range(this.value, options).test(comp.semver);
2203
+ }
2204
+ options = parseOptions(options);
2205
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
2206
+ return false;
2207
+ }
2208
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
2209
+ return false;
2210
+ }
2211
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
2212
+ return true;
2213
+ }
2214
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
2215
+ return true;
2216
+ }
2217
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
2218
+ return true;
2219
+ }
2220
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
2221
+ return true;
2222
+ }
2223
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
2224
+ return true;
2225
+ }
2226
+ return false;
2227
+ }
2228
+ }
2229
+ module.exports = Comparator;
2230
+ var parseOptions = require_parse_options();
2231
+ var { safeRe: re, t } = require_re();
2232
+ var cmp = require_cmp();
2233
+ var debug = require_debug();
2234
+ var SemVer = require_semver();
2235
+ var Range = require_range();
2236
+ });
2237
+
2238
+ // ../../node_modules/semver/functions/satisfies.js
2239
+ var require_satisfies = __commonJS(function(exports, module) {
2240
+ var Range = require_range();
2241
+ var satisfies = (version, range, options) => {
2242
+ try {
2243
+ range = new Range(range, options);
2244
+ } catch (er) {
2245
+ return false;
2246
+ }
2247
+ return range.test(version);
2248
+ };
2249
+ module.exports = satisfies;
2250
+ });
2251
+
2252
+ // ../../node_modules/semver/ranges/to-comparators.js
2253
+ var require_to_comparators = __commonJS(function(exports, module) {
2254
+ var Range = require_range();
2255
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
2256
+ module.exports = toComparators;
2257
+ });
2258
+
2259
+ // ../../node_modules/semver/ranges/max-satisfying.js
2260
+ var require_max_satisfying = __commonJS(function(exports, module) {
2261
+ var SemVer = require_semver();
2262
+ var Range = require_range();
2263
+ var maxSatisfying = (versions, range, options) => {
2264
+ let max = null;
2265
+ let maxSV = null;
2266
+ let rangeObj = null;
2267
+ try {
2268
+ rangeObj = new Range(range, options);
2269
+ } catch (er) {
2270
+ return null;
2271
+ }
2272
+ versions.forEach((v) => {
2273
+ if (rangeObj.test(v)) {
2274
+ if (!max || maxSV.compare(v) === -1) {
2275
+ max = v;
2276
+ maxSV = new SemVer(max, options);
2277
+ }
2278
+ }
2279
+ });
2280
+ return max;
2281
+ };
2282
+ module.exports = maxSatisfying;
2283
+ });
2284
+
2285
+ // ../../node_modules/semver/ranges/min-satisfying.js
2286
+ var require_min_satisfying = __commonJS(function(exports, module) {
2287
+ var SemVer = require_semver();
2288
+ var Range = require_range();
2289
+ var minSatisfying = (versions, range, options) => {
2290
+ let min = null;
2291
+ let minSV = null;
2292
+ let rangeObj = null;
2293
+ try {
2294
+ rangeObj = new Range(range, options);
2295
+ } catch (er) {
2296
+ return null;
2297
+ }
2298
+ versions.forEach((v) => {
2299
+ if (rangeObj.test(v)) {
2300
+ if (!min || minSV.compare(v) === 1) {
2301
+ min = v;
2302
+ minSV = new SemVer(min, options);
2303
+ }
2304
+ }
2305
+ });
2306
+ return min;
2307
+ };
2308
+ module.exports = minSatisfying;
2309
+ });
2310
+
2311
+ // ../../node_modules/semver/ranges/min-version.js
2312
+ var require_min_version = __commonJS(function(exports, module) {
2313
+ var SemVer = require_semver();
2314
+ var Range = require_range();
2315
+ var gt = require_gt();
2316
+ var minVersion = (range, loose) => {
2317
+ range = new Range(range, loose);
2318
+ let minver = new SemVer("0.0.0");
2319
+ if (range.test(minver)) {
2320
+ return minver;
2321
+ }
2322
+ minver = new SemVer("0.0.0-0");
2323
+ if (range.test(minver)) {
2324
+ return minver;
2325
+ }
2326
+ minver = null;
2327
+ for (let i = 0;i < range.set.length; ++i) {
2328
+ const comparators = range.set[i];
2329
+ let setMin = null;
2330
+ comparators.forEach((comparator) => {
2331
+ const compver = new SemVer(comparator.semver.version);
2332
+ switch (comparator.operator) {
2333
+ case ">":
2334
+ if (compver.prerelease.length === 0) {
2335
+ compver.patch++;
2336
+ } else {
2337
+ compver.prerelease.push(0);
2338
+ }
2339
+ compver.raw = compver.format();
2340
+ case "":
2341
+ case ">=":
2342
+ if (!setMin || gt(compver, setMin)) {
2343
+ setMin = compver;
2344
+ }
2345
+ break;
2346
+ case "<":
2347
+ case "<=":
2348
+ break;
2349
+ default:
2350
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
2351
+ }
2352
+ });
2353
+ if (setMin && (!minver || gt(minver, setMin))) {
2354
+ minver = setMin;
2355
+ }
2356
+ }
2357
+ if (minver && range.test(minver)) {
2358
+ return minver;
2359
+ }
2360
+ return null;
2361
+ };
2362
+ module.exports = minVersion;
2363
+ });
2364
+
2365
+ // ../../node_modules/semver/ranges/valid.js
2366
+ var require_valid2 = __commonJS(function(exports, module) {
2367
+ var Range = require_range();
2368
+ var validRange = (range, options) => {
2369
+ try {
2370
+ return new Range(range, options).range || "*";
2371
+ } catch (er) {
2372
+ return null;
2373
+ }
2374
+ };
2375
+ module.exports = validRange;
2376
+ });
2377
+
2378
+ // ../../node_modules/semver/ranges/outside.js
2379
+ var require_outside = __commonJS(function(exports, module) {
2380
+ var SemVer = require_semver();
2381
+ var Comparator = require_comparator();
2382
+ var { ANY } = Comparator;
2383
+ var Range = require_range();
2384
+ var satisfies = require_satisfies();
2385
+ var gt = require_gt();
2386
+ var lt = require_lt();
2387
+ var lte = require_lte();
2388
+ var gte = require_gte();
2389
+ var outside = (version, range, hilo, options) => {
2390
+ version = new SemVer(version, options);
2391
+ range = new Range(range, options);
2392
+ let gtfn, ltefn, ltfn, comp, ecomp;
2393
+ switch (hilo) {
2394
+ case ">":
2395
+ gtfn = gt;
2396
+ ltefn = lte;
2397
+ ltfn = lt;
2398
+ comp = ">";
2399
+ ecomp = ">=";
2400
+ break;
2401
+ case "<":
2402
+ gtfn = lt;
2403
+ ltefn = gte;
2404
+ ltfn = gt;
2405
+ comp = "<";
2406
+ ecomp = "<=";
2407
+ break;
2408
+ default:
2409
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
2410
+ }
2411
+ if (satisfies(version, range, options)) {
2412
+ return false;
2413
+ }
2414
+ for (let i = 0;i < range.set.length; ++i) {
2415
+ const comparators = range.set[i];
2416
+ let high = null;
2417
+ let low = null;
2418
+ comparators.forEach((comparator) => {
2419
+ if (comparator.semver === ANY) {
2420
+ comparator = new Comparator(">=0.0.0");
2421
+ }
2422
+ high = high || comparator;
2423
+ low = low || comparator;
2424
+ if (gtfn(comparator.semver, high.semver, options)) {
2425
+ high = comparator;
2426
+ } else if (ltfn(comparator.semver, low.semver, options)) {
2427
+ low = comparator;
2428
+ }
2429
+ });
2430
+ if (high.operator === comp || high.operator === ecomp) {
2431
+ return false;
2432
+ }
2433
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
2434
+ return false;
2435
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
2436
+ return false;
2437
+ }
2438
+ }
2439
+ return true;
2440
+ };
2441
+ module.exports = outside;
2442
+ });
2443
+
2444
+ // ../../node_modules/semver/ranges/gtr.js
2445
+ var require_gtr = __commonJS(function(exports, module) {
2446
+ var outside = require_outside();
2447
+ var gtr = (version, range, options) => outside(version, range, ">", options);
2448
+ module.exports = gtr;
2449
+ });
2450
+
2451
+ // ../../node_modules/semver/ranges/ltr.js
2452
+ var require_ltr = __commonJS(function(exports, module) {
2453
+ var outside = require_outside();
2454
+ var ltr = (version, range, options) => outside(version, range, "<", options);
2455
+ module.exports = ltr;
2456
+ });
2457
+
2458
+ // ../../node_modules/semver/ranges/intersects.js
2459
+ var require_intersects = __commonJS(function(exports, module) {
2460
+ var Range = require_range();
2461
+ var intersects = (r1, r2, options) => {
2462
+ r1 = new Range(r1, options);
2463
+ r2 = new Range(r2, options);
2464
+ return r1.intersects(r2, options);
2465
+ };
2466
+ module.exports = intersects;
2467
+ });
2468
+
2469
+ // ../../node_modules/semver/ranges/simplify.js
2470
+ var require_simplify = __commonJS(function(exports, module) {
2471
+ var satisfies = require_satisfies();
2472
+ var compare = require_compare();
2473
+ module.exports = (versions, range, options) => {
2474
+ const set = [];
2475
+ let first = null;
2476
+ let prev = null;
2477
+ const v = versions.sort((a, b) => compare(a, b, options));
2478
+ for (const version of v) {
2479
+ const included = satisfies(version, range, options);
2480
+ if (included) {
2481
+ prev = version;
2482
+ if (!first) {
2483
+ first = version;
2484
+ }
2485
+ } else {
2486
+ if (prev) {
2487
+ set.push([first, prev]);
2488
+ }
2489
+ prev = null;
2490
+ first = null;
2491
+ }
2492
+ }
2493
+ if (first) {
2494
+ set.push([first, null]);
2495
+ }
2496
+ const ranges = [];
2497
+ for (const [min, max] of set) {
2498
+ if (min === max) {
2499
+ ranges.push(min);
2500
+ } else if (!max && min === v[0]) {
2501
+ ranges.push("*");
2502
+ } else if (!max) {
2503
+ ranges.push(`>=${min}`);
2504
+ } else if (min === v[0]) {
2505
+ ranges.push(`<=${max}`);
2506
+ } else {
2507
+ ranges.push(`${min} - ${max}`);
2508
+ }
2509
+ }
2510
+ const simplified = ranges.join(" || ");
2511
+ const original = typeof range.raw === "string" ? range.raw : String(range);
2512
+ return simplified.length < original.length ? simplified : range;
2513
+ };
2514
+ });
2515
+
2516
+ // ../../node_modules/semver/ranges/subset.js
2517
+ var require_subset = __commonJS(function(exports, module) {
2518
+ var Range = require_range();
2519
+ var Comparator = require_comparator();
2520
+ var { ANY } = Comparator;
2521
+ var satisfies = require_satisfies();
2522
+ var compare = require_compare();
2523
+ var subset = (sub, dom, options = {}) => {
2524
+ if (sub === dom) {
2525
+ return true;
2526
+ }
2527
+ sub = new Range(sub, options);
2528
+ dom = new Range(dom, options);
2529
+ let sawNonNull = false;
2530
+ OUTER:
2531
+ for (const simpleSub of sub.set) {
2532
+ for (const simpleDom of dom.set) {
2533
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
2534
+ sawNonNull = sawNonNull || isSub !== null;
2535
+ if (isSub) {
2536
+ continue OUTER;
2537
+ }
2538
+ }
2539
+ if (sawNonNull) {
2540
+ return false;
2541
+ }
2542
+ }
2543
+ return true;
2544
+ };
2545
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
2546
+ var minimumVersion = [new Comparator(">=0.0.0")];
2547
+ var simpleSubset = (sub, dom, options) => {
2548
+ if (sub === dom) {
2549
+ return true;
2550
+ }
2551
+ if (sub.length === 1 && sub[0].semver === ANY) {
2552
+ if (dom.length === 1 && dom[0].semver === ANY) {
2553
+ return true;
2554
+ } else if (options.includePrerelease) {
2555
+ sub = minimumVersionWithPreRelease;
2556
+ } else {
2557
+ sub = minimumVersion;
2558
+ }
2559
+ }
2560
+ if (dom.length === 1 && dom[0].semver === ANY) {
2561
+ if (options.includePrerelease) {
2562
+ return true;
2563
+ } else {
2564
+ dom = minimumVersion;
2565
+ }
2566
+ }
2567
+ const eqSet = new Set;
2568
+ let gt, lt;
2569
+ for (const c of sub) {
2570
+ if (c.operator === ">" || c.operator === ">=") {
2571
+ gt = higherGT(gt, c, options);
2572
+ } else if (c.operator === "<" || c.operator === "<=") {
2573
+ lt = lowerLT(lt, c, options);
2574
+ } else {
2575
+ eqSet.add(c.semver);
2576
+ }
2577
+ }
2578
+ if (eqSet.size > 1) {
2579
+ return null;
2580
+ }
2581
+ let gtltComp;
2582
+ if (gt && lt) {
2583
+ gtltComp = compare(gt.semver, lt.semver, options);
2584
+ if (gtltComp > 0) {
2585
+ return null;
2586
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
2587
+ return null;
2588
+ }
2589
+ }
2590
+ for (const eq of eqSet) {
2591
+ if (gt && !satisfies(eq, String(gt), options)) {
2592
+ return null;
2593
+ }
2594
+ if (lt && !satisfies(eq, String(lt), options)) {
2595
+ return null;
2596
+ }
2597
+ for (const c of dom) {
2598
+ if (!satisfies(eq, String(c), options)) {
2599
+ return false;
2600
+ }
2601
+ }
2602
+ return true;
2603
+ }
2604
+ let higher, lower;
2605
+ let hasDomLT, hasDomGT;
2606
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
2607
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
2608
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
2609
+ needDomLTPre = false;
2610
+ }
2611
+ for (const c of dom) {
2612
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
2613
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
2614
+ if (gt) {
2615
+ if (needDomGTPre) {
2616
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
2617
+ needDomGTPre = false;
2618
+ }
2619
+ }
2620
+ if (c.operator === ">" || c.operator === ">=") {
2621
+ higher = higherGT(gt, c, options);
2622
+ if (higher === c && higher !== gt) {
2623
+ return false;
2624
+ }
2625
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) {
2626
+ return false;
2627
+ }
2628
+ }
2629
+ if (lt) {
2630
+ if (needDomLTPre) {
2631
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
2632
+ needDomLTPre = false;
2633
+ }
2634
+ }
2635
+ if (c.operator === "<" || c.operator === "<=") {
2636
+ lower = lowerLT(lt, c, options);
2637
+ if (lower === c && lower !== lt) {
2638
+ return false;
2639
+ }
2640
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) {
2641
+ return false;
2642
+ }
2643
+ }
2644
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
2645
+ return false;
2646
+ }
2647
+ }
2648
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
2649
+ return false;
2650
+ }
2651
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
2652
+ return false;
2653
+ }
2654
+ if (needDomGTPre || needDomLTPre) {
2655
+ return false;
2656
+ }
2657
+ return true;
2658
+ };
2659
+ var higherGT = (a, b, options) => {
2660
+ if (!a) {
2661
+ return b;
2662
+ }
2663
+ const comp = compare(a.semver, b.semver, options);
2664
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
2665
+ };
2666
+ var lowerLT = (a, b, options) => {
2667
+ if (!a) {
2668
+ return b;
2669
+ }
2670
+ const comp = compare(a.semver, b.semver, options);
2671
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
2672
+ };
2673
+ module.exports = subset;
2674
+ });
2675
+
2676
+ // ../../node_modules/semver/index.js
2677
+ var require_semver2 = __commonJS(function(exports, module) {
2678
+ var internalRe = require_re();
2679
+ var constants = require_constants();
2680
+ var SemVer = require_semver();
2681
+ var identifiers = require_identifiers();
2682
+ var parse = require_parse();
2683
+ var valid = require_valid();
2684
+ var clean = require_clean();
2685
+ var inc = require_inc();
2686
+ var diff = require_diff();
2687
+ var major = require_major();
2688
+ var minor = require_minor();
2689
+ var patch = require_patch();
2690
+ var prerelease = require_prerelease();
2691
+ var compare = require_compare();
2692
+ var rcompare = require_rcompare();
2693
+ var compareLoose = require_compare_loose();
2694
+ var compareBuild = require_compare_build();
2695
+ var sort = require_sort();
2696
+ var rsort = require_rsort();
2697
+ var gt = require_gt();
2698
+ var lt = require_lt();
2699
+ var eq = require_eq();
2700
+ var neq = require_neq();
2701
+ var gte = require_gte();
2702
+ var lte = require_lte();
2703
+ var cmp = require_cmp();
2704
+ var coerce = require_coerce();
2705
+ var truncate = require_truncate();
2706
+ var Comparator = require_comparator();
2707
+ var Range = require_range();
2708
+ var satisfies = require_satisfies();
2709
+ var toComparators = require_to_comparators();
2710
+ var maxSatisfying = require_max_satisfying();
2711
+ var minSatisfying = require_min_satisfying();
2712
+ var minVersion = require_min_version();
2713
+ var validRange = require_valid2();
2714
+ var outside = require_outside();
2715
+ var gtr = require_gtr();
2716
+ var ltr = require_ltr();
2717
+ var intersects = require_intersects();
2718
+ var simplifyRange = require_simplify();
2719
+ var subset = require_subset();
2720
+ module.exports = {
2721
+ parse,
2722
+ valid,
2723
+ clean,
2724
+ inc,
2725
+ diff,
2726
+ major,
2727
+ minor,
2728
+ patch,
2729
+ prerelease,
2730
+ compare,
2731
+ rcompare,
2732
+ compareLoose,
2733
+ compareBuild,
2734
+ sort,
2735
+ rsort,
2736
+ gt,
2737
+ lt,
2738
+ eq,
2739
+ neq,
2740
+ gte,
2741
+ lte,
2742
+ cmp,
2743
+ coerce,
2744
+ truncate,
2745
+ Comparator,
2746
+ Range,
2747
+ satisfies,
2748
+ toComparators,
2749
+ maxSatisfying,
2750
+ minSatisfying,
2751
+ minVersion,
2752
+ validRange,
2753
+ outside,
2754
+ gtr,
2755
+ ltr,
2756
+ intersects,
2757
+ simplifyRange,
2758
+ subset,
2759
+ SemVer,
2760
+ re: internalRe.re,
2761
+ src: internalRe.src,
2762
+ tokens: internalRe.t,
2763
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
2764
+ RELEASE_TYPES: constants.RELEASE_TYPES,
2765
+ compareIdentifiers: identifiers.compareIdentifiers,
2766
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
2767
+ };
2768
+ });
2769
+
926
2770
  // ../../node_modules/citty/dist/_chunks/libs/scule.mjs
927
2771
  var NUMBER_CHAR_RE = /\d/;
928
2772
  var STR_SPLITTERS = [
@@ -2440,7 +4284,7 @@ var consola = createConsola2();
2440
4284
  // package.json
2441
4285
  var package_default = {
2442
4286
  name: "@302ai/media-studio-cli",
2443
- version: "0.1.0-beta.5",
4287
+ version: "0.1.0-beta.7",
2444
4288
  description: "CLI for AI Media Studio — let external agents drive the core media-studio features",
2445
4289
  author: "302.AI",
2446
4290
  license: "Apache-2.0",
@@ -2483,6 +4327,7 @@ var package_default = {
2483
4327
  "@302ai/media-studio-contract": "workspace:*",
2484
4328
  "@clack/prompts": "^1.7.0",
2485
4329
  "@types/node": "^26.4.0",
4330
+ "@types/semver": "^7.8.0",
2486
4331
  citty: "^0.2.2",
2487
4332
  consola: "^3.4.2",
2488
4333
  "es-toolkit": "^1.46.1",
@@ -2490,6 +4335,7 @@ var package_default = {
2490
4335
  nanoid: "^5.1.11",
2491
4336
  open: "^11.0.2",
2492
4337
  picocolors: "^1.1.1",
4338
+ semver: "^7.8.5",
2493
4339
  "ts-pattern": "^5.9.0",
2494
4340
  zod: "^4.5.4"
2495
4341
  }
@@ -7246,6 +9092,9 @@ var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
7246
9092
  $ZodURL.init(inst, def);
7247
9093
  ZodStringFormat.init(inst, def);
7248
9094
  });
9095
+ function url(params) {
9096
+ return _url(ZodURL, params);
9097
+ }
7249
9098
  var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
7250
9099
  $ZodEmoji.init(inst, def);
7251
9100
  ZodStringFormat.init(inst, def);
@@ -7797,6 +9646,83 @@ var ArtifactItemSchema = object({
7797
9646
  productIdx: number2().optional()
7798
9647
  });
7799
9648
  var ArtifactItemsSchema = array(ArtifactItemSchema);
9649
+
9650
+ // ../media-studio-contract/src/attachments/constants.ts
9651
+ var MAX_ATTACHMENT_COUNT = 5;
9652
+ var MAX_ATTACHMENT_BYTES = 50 * 1024 * 1024;
9653
+ var ATTACHMENT_MIME_BY_EXTENSION = {
9654
+ png: "image/png",
9655
+ jpg: "image/jpeg",
9656
+ jpeg: "image/jpeg",
9657
+ gif: "image/gif",
9658
+ webp: "image/webp",
9659
+ avif: "image/avif",
9660
+ bmp: "image/bmp",
9661
+ svg: "image/svg+xml",
9662
+ ico: "image/x-icon",
9663
+ tif: "image/tiff",
9664
+ tiff: "image/tiff",
9665
+ heic: "image/heic",
9666
+ mp4: "video/mp4",
9667
+ webm: "video/webm",
9668
+ mov: "video/quicktime",
9669
+ m4v: "video/mp4",
9670
+ avi: "video/x-msvideo",
9671
+ mkv: "video/x-matroska",
9672
+ mp3: "audio/mpeg",
9673
+ wav: "audio/wav",
9674
+ m4a: "audio/mp4",
9675
+ aac: "audio/aac",
9676
+ ogg: "audio/ogg",
9677
+ flac: "audio/flac",
9678
+ opus: "audio/opus",
9679
+ pdf: "application/pdf",
9680
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
9681
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
9682
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
9683
+ txt: "text/plain",
9684
+ log: "text/plain",
9685
+ srt: "text/plain",
9686
+ vtt: "text/plain",
9687
+ ini: "text/plain",
9688
+ toml: "text/plain",
9689
+ jsonl: "text/plain",
9690
+ md: "text/markdown",
9691
+ markdown: "text/markdown",
9692
+ html: "text/html",
9693
+ htm: "text/html",
9694
+ csv: "text/csv",
9695
+ tsv: "text/tab-separated-values",
9696
+ json: "application/json",
9697
+ yaml: "text/yaml",
9698
+ yml: "text/yaml",
9699
+ xml: "text/xml"
9700
+ };
9701
+
9702
+ // ../media-studio-contract/src/attachments/markers.ts
9703
+ var ATTACHMENT_MARKER = "&&";
9704
+ function formatAttachmentMarker(remoteUrl) {
9705
+ return `${ATTACHMENT_MARKER}${remoteUrl}${ATTACHMENT_MARKER}`;
9706
+ }
9707
+
9708
+ // ../media-studio-contract/src/attachments/wire.ts
9709
+ var AttachmentKindSchema = _enum([
9710
+ "image",
9711
+ "video",
9712
+ "audio",
9713
+ "text",
9714
+ "file"
9715
+ ]);
9716
+ var UploadedAttachmentItemSchema = object({
9717
+ id: string2(),
9718
+ name: string2(),
9719
+ type: AttachmentKindSchema,
9720
+ size: number2(),
9721
+ remoteUrl: url()
9722
+ });
9723
+ var AttachmentUploadResponseSchema = object({
9724
+ files: array(UploadedAttachmentItemSchema)
9725
+ });
7800
9726
  // ../../node_modules/es-toolkit/dist/compat/predicate/isObject.mjs
7801
9727
  function isObject2(value) {
7802
9728
  return value !== null && (typeof value === "object" || typeof value === "function");
@@ -8433,6 +10359,41 @@ function extractUpstreamErrorMessage(body) {
8433
10359
  }
8434
10360
  return M(body).with({ error: { message: z2.select(z2.string) } }, (msg) => msg.trim() || null).with({ message: z2.select(z2.string) }, (msg) => msg !== ERR_SESSION_EXPIRED ? msg.trim() || null : null).with({ error: z2.select(z2.string) }, (msg) => msg !== ERR_SESSION_EXPIRED ? msg.trim() || null : null).with(z2._, () => null).exhaustive();
8435
10361
  }
10362
+
10363
+ // src/client/http.ts
10364
+ async function requestJson(fetchFn, url, init, schema, fallbackMessage) {
10365
+ const response = await fetchFn(url, init);
10366
+ if (!response.ok) {
10367
+ const rawBody = await response.text();
10368
+ throw new ChatUpstreamError(extractUpstreamErrorMessage(rawBody) || fallbackMessage(response.status), response.status, rawBody);
10369
+ }
10370
+ return schema.parse(await response.json());
10371
+ }
10372
+
10373
+ // src/client/attachments.ts
10374
+ class ClientAttachments {
10375
+ baseUrl;
10376
+ apiKey;
10377
+ customFetch;
10378
+ constructor(baseUrl, apiKey, customFetch) {
10379
+ this.baseUrl = baseUrl;
10380
+ this.apiKey = apiKey;
10381
+ this.customFetch = customFetch ?? fetch;
10382
+ }
10383
+ async upload(items) {
10384
+ const formData = new FormData;
10385
+ for (const item of items) {
10386
+ formData.append("files", item.file, item.file.name);
10387
+ formData.append("attachmentIds", item.id);
10388
+ }
10389
+ const response = await requestJson(this.customFetch, `${this.baseUrl}/api/chat/attachments`, {
10390
+ method: "POST",
10391
+ headers: { Authorization: `Bearer ${this.apiKey}` },
10392
+ body: formData
10393
+ }, AttachmentUploadResponseSchema, (status) => `Attachment upload failed with status ${status}`);
10394
+ return response.files;
10395
+ }
10396
+ }
8436
10397
  // ../../node_modules/eventsource-parser/dist/errors.js
8437
10398
  class ParseError extends Error {
8438
10399
  constructor(message, options) {
@@ -14760,7 +16721,12 @@ var AuthDataSchema = object2({
14760
16721
  updated_at: string4().optional()
14761
16722
  });
14762
16723
  var ConfigFileSchema = object2({
14763
- lastSessionId: string4().optional()
16724
+ lastSessionId: string4().optional(),
16725
+ updateCheck: object2({
16726
+ checkedAt: number4(),
16727
+ beta: string4().optional(),
16728
+ latest: string4().optional()
16729
+ }).optional()
14764
16730
  });
14765
16731
  function readAuthFile() {
14766
16732
  try {
@@ -14813,14 +16779,11 @@ function readLastSessionId() {
14813
16779
  function saveLastSessionId(sessionId) {
14814
16780
  writeConfigFile({ lastSessionId: sessionId });
14815
16781
  }
14816
- function clearLastSessionId(ifMatchesId) {
14817
- const current = readConfigFile();
14818
- if (!current?.lastSessionId)
14819
- return;
14820
- if (ifMatchesId && current.lastSessionId !== ifMatchesId)
14821
- return;
14822
- const { lastSessionId: _removed, ...rest } = current;
14823
- saveConfigFile(rest);
16782
+ function readUpdateCheck() {
16783
+ return readConfigFile()?.updateCheck;
16784
+ }
16785
+ function saveUpdateCheck(check) {
16786
+ writeConfigFile({ updateCheck: check });
14824
16787
  }
14825
16788
  function resolveApiKey() {
14826
16789
  const token = readAuthFile()?.token;
@@ -14841,16 +16804,6 @@ function resolveApiBaseUrl(flag) {
14841
16804
  return getDefaultApiBaseUrl();
14842
16805
  }
14843
16806
 
14844
- // src/client/http.ts
14845
- async function requestJson(fetchFn, url, init, schema, fallbackMessage) {
14846
- const response = await fetchFn(url, init);
14847
- if (!response.ok) {
14848
- const rawBody = await response.text();
14849
- throw new ChatUpstreamError(extractUpstreamErrorMessage(rawBody) || fallbackMessage(response.status), response.status, rawBody);
14850
- }
14851
- return schema.parse(await response.json());
14852
- }
14853
-
14854
16807
  // src/client/session-types.ts
14855
16808
  var SessionSourceSchema = _enum2(["web", "cli"]);
14856
16809
  var ApiResponseBaseSchema = object2({
@@ -14939,7 +16892,6 @@ var ListArtifactsQuerySchema = object2({
14939
16892
  var ListArtifactsResponseSchema = ApiResponseBaseSchema.extend({
14940
16893
  data: ArtifactItemsSchema
14941
16894
  });
14942
- var DeleteSessionResponseSchema = ApiResponseBaseSchema;
14943
16895
  var PrewarmSessionReadySchema = object2({
14944
16896
  session_id: string4(),
14945
16897
  note: string4().nullable(),
@@ -15015,10 +16967,6 @@ class ClientSessions {
15015
16967
  const url = `${this.baseUrl}/api/sessions/tasks?${params.toString()}`;
15016
16968
  return requestJson(this.customFetch, url, { method: "GET", headers: this.authHeaders() }, ListArtifactsResponseSchema, (status) => `Failed to fetch session artifacts with status ${status}`);
15017
16969
  }
15018
- async remove(sessionId) {
15019
- const url = `${this.baseUrl}/api/sessions?sessionId=${encodeURIComponent(sessionId)}`;
15020
- await requestJson(this.customFetch, url, { method: "DELETE", headers: this.authHeaders() }, DeleteSessionResponseSchema, (status) => `Failed to delete session with status ${status}`);
15021
- }
15022
16970
  async prewarm(options) {
15023
16971
  const { onStageChange, onSessionReady } = options;
15024
16972
  const timeoutController = new AbortController;
@@ -15287,6 +17235,7 @@ class MediaStudioClient {
15287
17235
  chat;
15288
17236
  sessions;
15289
17237
  skills;
17238
+ attachments;
15290
17239
  customFetch;
15291
17240
  get apiKey() {
15292
17241
  return this._apiKey;
@@ -15325,6 +17274,7 @@ class MediaStudioClient {
15325
17274
  this.chat = new ClientChat(this.baseUrl, this._apiKey, interceptingFetch);
15326
17275
  this.sessions = new ClientSessions(this.baseUrl, this._apiKey, interceptingFetch);
15327
17276
  this.skills = new ClientSkills(this.baseUrl, this._apiKey, interceptingFetch);
17277
+ this.attachments = new ClientAttachments(this.baseUrl, this._apiKey, interceptingFetch);
15328
17278
  }
15329
17279
  async getMe() {
15330
17280
  return requestJson(this.customFetch, `${this.baseUrl}/api/auth/me`, {
@@ -15718,6 +17668,144 @@ class AgentSpinner {
15718
17668
  }
15719
17669
  }
15720
17670
 
17671
+ // src/services/attachments.ts
17672
+ import { readFile, stat } from "node:fs/promises";
17673
+ import { basename, extname, resolve } from "node:path";
17674
+
17675
+ // src/lib/attachment-refs.ts
17676
+ var PATH_LIKE_RE = /[/\\]|\.[A-Za-z0-9]{1,10}$/;
17677
+ var REF_RE = /(^|(?<=\s))@(?:"([^"]+)"|([^\s@]+))/g;
17678
+ function findAttachmentRefs(prompt) {
17679
+ const refs = [];
17680
+ for (const match of prompt.matchAll(REF_RE)) {
17681
+ const start = match.index;
17682
+ const quoted = match[2];
17683
+ const bare = match[3];
17684
+ const path = quoted ?? bare;
17685
+ if (path === undefined || path.length === 0)
17686
+ continue;
17687
+ if (!PATH_LIKE_RE.test(path))
17688
+ continue;
17689
+ refs.push({ start, end: start + match[0].length, path });
17690
+ }
17691
+ return refs;
17692
+ }
17693
+ function composeAttachmentPrompt(prompt, urlByPath) {
17694
+ const refs = findAttachmentRefs(prompt);
17695
+ if (refs.length === 0)
17696
+ return prompt;
17697
+ const segments = [];
17698
+ let cursor = 0;
17699
+ for (const ref of refs) {
17700
+ segments.push(prompt.slice(cursor, ref.start));
17701
+ const url = urlByPath[ref.path];
17702
+ segments.push(url ? formatAttachmentMarker(url) : prompt.slice(ref.start, ref.end));
17703
+ cursor = ref.end;
17704
+ }
17705
+ segments.push(prompt.slice(cursor));
17706
+ return segments.join("");
17707
+ }
17708
+
17709
+ // src/services/attachments.ts
17710
+ class AttachmentResolutionError extends Error {
17711
+ }
17712
+ function formatBytes(size) {
17713
+ if (size < 1024)
17714
+ return `${size} B`;
17715
+ if (size < 1024 * 1024)
17716
+ return `${(size / 1024).toFixed(1)} KB`;
17717
+ return `${(size / (1024 * 1024)).toFixed(1)} MB`;
17718
+ }
17719
+ async function readAttachment(typedPath, absPath) {
17720
+ let stats;
17721
+ try {
17722
+ stats = await stat(absPath);
17723
+ } catch {
17724
+ throw new AttachmentResolutionError(`@${typedPath}: no such file (${absPath})`);
17725
+ }
17726
+ if (!stats.isFile()) {
17727
+ throw new AttachmentResolutionError(`@${typedPath}: not a regular file`);
17728
+ }
17729
+ const ext = extname(absPath).slice(1).toLowerCase();
17730
+ const mime = ext ? ATTACHMENT_MIME_BY_EXTENSION[ext] : undefined;
17731
+ if (!mime) {
17732
+ throw new AttachmentResolutionError(`@${typedPath}: unsupported attachment type${ext ? ` .${ext}` : ""}`);
17733
+ }
17734
+ if (stats.size === 0) {
17735
+ throw new AttachmentResolutionError(`@${typedPath}: file is empty`);
17736
+ }
17737
+ if (stats.size > MAX_ATTACHMENT_BYTES) {
17738
+ throw new AttachmentResolutionError(`@${typedPath}: ${formatBytes(stats.size)} exceeds the ` + `${formatBytes(MAX_ATTACHMENT_BYTES)} attachment limit`);
17739
+ }
17740
+ let file;
17741
+ try {
17742
+ const buffer = await readFile(absPath);
17743
+ const data = new Uint8Array(buffer.byteLength);
17744
+ data.set(buffer);
17745
+ file = new File([data], basename(absPath), { type: mime });
17746
+ } catch {
17747
+ throw new AttachmentResolutionError(`@${typedPath}: file is not readable (${absPath})`);
17748
+ }
17749
+ return file;
17750
+ }
17751
+ async function resolvePromptAttachments(options) {
17752
+ const refs = findAttachmentRefs(options.prompt);
17753
+ if (refs.length === 0) {
17754
+ return { text: options.prompt, attachments: [] };
17755
+ }
17756
+ const typedByResolved = {};
17757
+ for (const ref of refs) {
17758
+ const abs = resolve(ref.path);
17759
+ if (!(abs in typedByResolved))
17760
+ typedByResolved[abs] = ref.path;
17761
+ }
17762
+ const resolvedPaths = Object.keys(typedByResolved);
17763
+ if (resolvedPaths.length > MAX_ATTACHMENT_COUNT) {
17764
+ throw new AttachmentResolutionError(`Too many attachments: ${resolvedPaths.length} unique files referenced, ` + `the limit is ${MAX_ATTACHMENT_COUNT} (same as the web composer)`);
17765
+ }
17766
+ const prepared = await Promise.all(resolvedPaths.map(async (abs) => ({
17767
+ abs,
17768
+ typed: typedByResolved[abs] ?? abs,
17769
+ file: await readAttachment(typedByResolved[abs] ?? abs, abs)
17770
+ })));
17771
+ const client = new MediaStudioClient({
17772
+ baseUrl: options.apiBaseUrl,
17773
+ apiKey: options.apiKey
17774
+ });
17775
+ const urlByResolved = {};
17776
+ const attachments = [];
17777
+ const total = prepared.length;
17778
+ for (let i = 0;i < prepared.length; i++) {
17779
+ const item = prepared[i];
17780
+ if (!item)
17781
+ continue;
17782
+ options.onProgress?.(i + 1, total, item.file.name);
17783
+ const [uploaded] = await client.attachments.upload([
17784
+ { id: nanoid3(), file: item.file }
17785
+ ]);
17786
+ if (!uploaded) {
17787
+ throw new AttachmentResolutionError(`@${item.typed}: upload returned no file`);
17788
+ }
17789
+ urlByResolved[item.abs] = uploaded.remoteUrl;
17790
+ attachments.push({
17791
+ name: uploaded.name,
17792
+ type: uploaded.type,
17793
+ size: uploaded.size,
17794
+ remoteUrl: uploaded.remoteUrl
17795
+ });
17796
+ }
17797
+ const urlByTyped = {};
17798
+ for (const ref of refs) {
17799
+ const url = urlByResolved[resolve(ref.path)];
17800
+ if (url !== undefined)
17801
+ urlByTyped[ref.path] = url;
17802
+ }
17803
+ return {
17804
+ text: composeAttachmentPrompt(options.prompt, urlByTyped),
17805
+ attachments
17806
+ };
17807
+ }
17808
+
15721
17809
  // src/services/session.ts
15722
17810
  function isSessionGoneError(err) {
15723
17811
  if (!(err instanceof ChatUpstreamError))
@@ -15900,7 +17988,7 @@ async function resolveChatSession(options) {
15900
17988
  return { sessionId, recreateOnGone: false };
15901
17989
  }
15902
17990
  async function streamTurn(options) {
15903
- const { args, sessionId, spinner, autoEnabled } = options;
17991
+ const { args, sessionId, spinner, autoEnabled, attachments } = options;
15904
17992
  if (!args.json) {
15905
17993
  spinner.start("Connecting to Media Studio...");
15906
17994
  }
@@ -15981,6 +18069,7 @@ async function streamTurn(options) {
15981
18069
  text: fullText,
15982
18070
  steps,
15983
18071
  media: mediaAssets,
18072
+ ...attachments.length > 0 ? { attachments } : {},
15984
18073
  ...autoEnabled.length > 0 ? { autoEnabled } : {},
15985
18074
  ...args["show-reasoning"] && reasoning ? { reasoning } : {}
15986
18075
  };
@@ -16002,6 +18091,7 @@ async function streamTurn(options) {
16002
18091
  text: fullText,
16003
18092
  steps,
16004
18093
  media: mediaAssets,
18094
+ ...attachments.length > 0 ? { attachments } : {},
16005
18095
  ...autoEnabled.length > 0 ? { autoEnabled } : {},
16006
18096
  ...args["show-reasoning"] && reasoning ? { reasoning } : {}
16007
18097
  };
@@ -16043,7 +18133,7 @@ var chatCommand = defineCommand({
16043
18133
  prompt: {
16044
18134
  type: "positional",
16045
18135
  required: true,
16046
- description: "The message to send. Reference a skill by leading the prompt with /name or %%/name%% - see `msc skills`"
18136
+ description: 'The message to send. Reference a skill by leading the prompt with /name or %%/name%% (see `msc skills`); attach a local file with @path or @"path with spaces"'
16047
18137
  },
16048
18138
  json: {
16049
18139
  type: "boolean",
@@ -16072,6 +18162,14 @@ var chatCommand = defineCommand({
16072
18162
  if (autoEnabled.length > 0 && args.json !== true) {
16073
18163
  consola.info(`Auto-enabled for this turn: ${autoEnabled.join(", ")}`);
16074
18164
  }
18165
+ const { text: promptWithAttachments, attachments } = await resolvePromptAttachments({
18166
+ prompt: text,
18167
+ apiBaseUrl,
18168
+ apiKey: resolveApiKey(),
18169
+ ...args.json ? {} : {
18170
+ onProgress: (index, total, name) => spinner.start(`Uploading attachment ${index}/${total}: ${name}`)
18171
+ }
18172
+ });
16075
18173
  const resolved = await resolveChatSession({
16076
18174
  sessionFlag: args.session,
16077
18175
  apiBaseUrl,
@@ -16081,13 +18179,14 @@ var chatCommand = defineCommand({
16081
18179
  });
16082
18180
  await runTurn({
16083
18181
  args,
16084
- prompt: text,
18182
+ prompt: promptWithAttachments,
16085
18183
  sessionId: resolved.sessionId,
16086
18184
  recreateOnGone: resolved.recreateOnGone,
16087
18185
  apiBaseUrl,
16088
18186
  apiKey: resolveApiKey(),
16089
18187
  spinner,
16090
18188
  skillUrls,
18189
+ attachments,
16091
18190
  autoEnabled
16092
18191
  });
16093
18192
  } catch (err) {
@@ -16159,11 +18258,25 @@ ${getAvailableRegions().map((r) => ` ${r.key.padEnd(8)} - ${r.url} (${r.des
16159
18258
  Pass \`-r\` or \`--show-reasoning\` to stream the model's planning and
16160
18259
  thinking process before the final generation steps.
16161
18260
 
18261
+ Attaching Files (@path):
18262
+ Attach local images, videos, audio, or documents by typing \`@path\` or
18263
+ \`@"path with spaces"\` anywhere in the prompt:
18264
+ msc chat "analyze @cover.png"
18265
+ msc chat "summarize @/abs/path/notes.pdf"
18266
+ msc chat 'compare @"my docs/report.docx" with @"my docs/summary.docx"'
18267
+
18268
+ The CLI validates files locally (existence, supported format, under 50 MB),
18269
+ uploads them with progress indication, and inlines remote URLs into the prompt.
18270
+ Up to 5 attachments per turn. Referencing the same file multiple times
18271
+ uploads it only once. Plain prose mentions (@team) and emails are ignored.
18272
+
18273
+ @path is local-filesystem-only: @https://example.com/a.png fails with
18274
+ "no such file". Remote URLs are not attachments and there is no @url form.
18275
+
16162
18276
  Session Switching:
16163
18277
  Pass \`--session <id>\` to direct a prompt to a specific existing session
16164
18278
  and make it your new active session.
16165
18279
 
16166
-
16167
18280
  4. USING SKILLS
16168
18281
 
16169
18282
  Skills allow prompts to trigger specialized models, pipelines, and workflows
@@ -16205,9 +18318,12 @@ ${getAvailableRegions().map((r) => ` ${r.key.padEnd(8)} - ${r.url} (${r.des
16205
18318
  msc sessions use <session-id>
16206
18319
  Switch your active session pointer without sending a prompt.
16207
18320
 
16208
- msc sessions rm <session-id> [-y]
16209
- Delete a session and its server-side history.
18321
+ Session deletion is not available in the CLI. Open the corresponding session
18322
+ in the Media Studio web app and delete it there manually.
16210
18323
 
18324
+ Web app (open the region matching your CLI login):
18325
+ ${getAvailableRegions().map((r) => ` ${r.key.padEnd(8)} - ${r.url}`).join(`
18326
+ `)}
16211
18327
 
16212
18328
  6. AUTOMATION & SCRIPTING (--json)
16213
18329
 
@@ -16230,6 +18346,14 @@ ${getAvailableRegions().map((r) => ` ${r.key.padEnd(8)} - ${r.url} (${r.des
16230
18346
  "taskId": "string"
16231
18347
  }
16232
18348
  ],
18349
+ "attachments": [ // present if local files were attached
18350
+ {
18351
+ "name": "string",
18352
+ "type": "string", // "image" | "video" | "audio" | "file"
18353
+ "size": 1024,
18354
+ "remoteUrl": "https://..."
18355
+ }
18356
+ ],
16233
18357
  "reasoning": "string?" // present if --show-reasoning was passed
16234
18358
  }
16235
18359
 
@@ -18110,11 +20234,6 @@ var logoutCommand = defineCommand({
18110
20234
  }
18111
20235
  });
18112
20236
 
18113
- // src/lib/confirm.ts
18114
- function needsConfirmationRefusal(yes) {
18115
- return !yes && !process.stdin.isTTY && true;
18116
- }
18117
-
18118
20237
  // src/commands/sessions.ts
18119
20238
  function formatLastActive(iso) {
18120
20239
  return iso.replace("T", " ").slice(0, 19);
@@ -18256,65 +20375,28 @@ var useSessionCommand = defineCommand({
18256
20375
  consola.success(`Switched default session to ${args.sessionId}`);
18257
20376
  }
18258
20377
  });
18259
- var rmSessionCommand = defineCommand({
18260
- meta: {
18261
- name: "rm",
18262
- description: "Delete a session server-side"
18263
- },
18264
- args: {
18265
- sessionId: {
18266
- type: "positional",
18267
- required: true,
18268
- description: "Session id to delete"
18269
- },
18270
- yes: {
18271
- type: "boolean",
18272
- alias: "y",
18273
- description: "Skip confirmation prompt"
18274
- }
18275
- },
18276
- run: async ({ args }) => {
18277
- try {
18278
- if (needsConfirmationRefusal(args.yes === true)) {
18279
- consola.error("Confirmation required. Pass --yes to confirm deletion non-interactively.");
18280
- process.exit(1);
18281
- return;
18282
- }
18283
- if (!args.yes) {
18284
- const confirmed = await confirm({
18285
- message: `Delete session "${args.sessionId}"? Upstream conversation memory will be destroyed.`,
18286
- initialValue: false
18287
- });
18288
- if (isCancel(confirmed) || !confirmed) {
18289
- consola.info("Session deletion cancelled.");
18290
- return;
18291
- }
18292
- }
18293
- const client = resolveClient();
18294
- await client.sessions.remove(args.sessionId);
18295
- clearLastSessionId(args.sessionId);
18296
- consola.success(`Session "${args.sessionId}" deleted.`);
18297
- } catch (err) {
18298
- reportCommandError(err);
18299
- }
18300
- }
18301
- });
18302
20378
  var sessionsCommand = defineCommand({
18303
20379
  meta: {
18304
20380
  name: "sessions",
18305
- description: "Manage Media Studio chat sessions"
20381
+ description: "Manage Media Studio chat sessions; deletion is available in the web app"
18306
20382
  },
18307
20383
  default: "list",
18308
20384
  subCommands: {
18309
20385
  list: listSessionsCommand,
18310
20386
  artifacts: artifactsCommand,
18311
- use: useSessionCommand,
18312
- rm: rmSessionCommand
20387
+ use: useSessionCommand
18313
20388
  }
18314
20389
  });
18315
20390
 
18316
20391
  // src/commands/skills.ts
18317
20392
  var import_picocolors2 = __toESM(require_picocolors(), 1);
20393
+
20394
+ // src/lib/confirm.ts
20395
+ function needsConfirmationRefusal(yes) {
20396
+ return !yes && !process.stdin.isTTY && true;
20397
+ }
20398
+
20399
+ // src/commands/skills.ts
18318
20400
  function resolveClient2() {
18319
20401
  return new MediaStudioClient({
18320
20402
  baseUrl: resolveApiBaseUrl(),
@@ -18615,6 +20697,51 @@ var whoamiCommand = defineCommand({
18615
20697
  }
18616
20698
  });
18617
20699
 
20700
+ // src/lib/update-check.ts
20701
+ var import_semver = __toESM(require_semver2(), 1);
20702
+ var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
20703
+ var encodedPkgName = package_default.name.startsWith("@") ? `@${encodeURIComponent(package_default.name.slice(1))}` : encodeURIComponent(package_default.name);
20704
+ var REGISTRY_URL = `https://registry.npmjs.org/-/package/${encodedPkgName}/dist-tags`;
20705
+ function updateNotices(current, tags) {
20706
+ const notices = [];
20707
+ if (!import_semver.valid(current))
20708
+ return notices;
20709
+ const beta = Boolean(import_semver.prerelease(current));
20710
+ if (tags.latest && import_semver.valid(tags.latest) && !import_semver.prerelease(tags.latest) && (beta || import_semver.gt(tags.latest, current))) {
20711
+ const action = import_semver.gt(tags.latest, current) ? "Update to" : "Switch to";
20712
+ notices.push(`${action} stable ${tags.latest} (current ${current}): npm install -g ${package_default.name}@latest`);
20713
+ }
20714
+ if (beta && tags.beta && import_semver.prerelease(tags.beta) && import_semver.gt(tags.beta, current)) {
20715
+ notices.push(`Beta ${tags.beta} available (current ${current}). Update: npm install -g ${package_default.name}@beta`);
20716
+ }
20717
+ return notices;
20718
+ }
20719
+ async function notifyOfUpdates() {
20720
+ try {
20721
+ const cached = readUpdateCheck();
20722
+ let tags;
20723
+ if (cached && Date.now() - cached.checkedAt < CHECK_INTERVAL_MS) {
20724
+ tags = cached;
20725
+ } else {
20726
+ const response = await fetch(REGISTRY_URL, {
20727
+ signal: AbortSignal.timeout(1500)
20728
+ });
20729
+ if (!response.ok)
20730
+ return;
20731
+ const { beta, latest } = await response.json().catch(() => ({}));
20732
+ tags = { beta, latest };
20733
+ try {
20734
+ saveUpdateCheck({ ...tags, checkedAt: Date.now() });
20735
+ } catch {}
20736
+ }
20737
+ for (const notice of updateNotices(package_default.version, tags)) {
20738
+ process.stderr.write(`
20739
+ msc: ${notice}
20740
+ `);
20741
+ }
20742
+ } catch {}
20743
+ }
20744
+
18618
20745
  // src/index.ts
18619
20746
  consola.options.formatOptions.date = false;
18620
20747
  applyInsecureTlsIfRequested();
@@ -18654,3 +20781,6 @@ await runMain({
18654
20781
  whoami: whoamiCommand
18655
20782
  }
18656
20783
  });
20784
+ if (!process.exitCode && process.stdout.isTTY && process.stderr.isTTY && process.argv.length > 2 && !process.argv.slice(2).some((arg) => ["--json", "-j", "--help", "-h", "--version", "-v"].includes(arg))) {
20785
+ await notifyOfUpdates();
20786
+ }