@atlashub/smartstack-cli 3.53.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -973,8 +973,8 @@ var require_command = __commonJS({
973
973
  "use strict";
974
974
  var EventEmitter2 = require("events").EventEmitter;
975
975
  var childProcess2 = require("child_process");
976
- var path5 = require("path");
977
- var fs17 = require("fs");
976
+ var path4 = require("path");
977
+ var fs20 = require("fs");
978
978
  var process17 = require("process");
979
979
  var { Argument: Argument2, humanReadableArgName } = require_argument();
980
980
  var { CommanderError: CommanderError2 } = require_error();
@@ -1906,11 +1906,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
1906
1906
  let launchWithNode = false;
1907
1907
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1908
1908
  function findFile(baseDir, baseName) {
1909
- const localBin = path5.resolve(baseDir, baseName);
1910
- if (fs17.existsSync(localBin)) return localBin;
1911
- if (sourceExt.includes(path5.extname(baseName))) return void 0;
1909
+ const localBin = path4.resolve(baseDir, baseName);
1910
+ if (fs20.existsSync(localBin)) return localBin;
1911
+ if (sourceExt.includes(path4.extname(baseName))) return void 0;
1912
1912
  const foundExt = sourceExt.find(
1913
- (ext2) => fs17.existsSync(`${localBin}${ext2}`)
1913
+ (ext2) => fs20.existsSync(`${localBin}${ext2}`)
1914
1914
  );
1915
1915
  if (foundExt) return `${localBin}${foundExt}`;
1916
1916
  return void 0;
@@ -1922,21 +1922,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
1922
1922
  if (this._scriptPath) {
1923
1923
  let resolvedScriptPath;
1924
1924
  try {
1925
- resolvedScriptPath = fs17.realpathSync(this._scriptPath);
1925
+ resolvedScriptPath = fs20.realpathSync(this._scriptPath);
1926
1926
  } catch (err) {
1927
1927
  resolvedScriptPath = this._scriptPath;
1928
1928
  }
1929
- executableDir = path5.resolve(
1930
- path5.dirname(resolvedScriptPath),
1929
+ executableDir = path4.resolve(
1930
+ path4.dirname(resolvedScriptPath),
1931
1931
  executableDir
1932
1932
  );
1933
1933
  }
1934
1934
  if (executableDir) {
1935
1935
  let localFile = findFile(executableDir, executableFile);
1936
1936
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
1937
- const legacyName = path5.basename(
1937
+ const legacyName = path4.basename(
1938
1938
  this._scriptPath,
1939
- path5.extname(this._scriptPath)
1939
+ path4.extname(this._scriptPath)
1940
1940
  );
1941
1941
  if (legacyName !== this._name) {
1942
1942
  localFile = findFile(
@@ -1947,7 +1947,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1947
1947
  }
1948
1948
  executableFile = localFile || executableFile;
1949
1949
  }
1950
- launchWithNode = sourceExt.includes(path5.extname(executableFile));
1950
+ launchWithNode = sourceExt.includes(path4.extname(executableFile));
1951
1951
  let proc2;
1952
1952
  if (process17.platform !== "win32") {
1953
1953
  if (launchWithNode) {
@@ -2787,7 +2787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2787
2787
  * @return {Command}
2788
2788
  */
2789
2789
  nameFromFilename(filename) {
2790
- this._name = path5.basename(filename, path5.extname(filename));
2790
+ this._name = path4.basename(filename, path4.extname(filename));
2791
2791
  return this;
2792
2792
  }
2793
2793
  /**
@@ -2801,9 +2801,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2801
2801
  * @param {string} [path]
2802
2802
  * @return {(string|null|Command)}
2803
2803
  */
2804
- executableDir(path6) {
2805
- if (path6 === void 0) return this._executableDir;
2806
- this._executableDir = path6;
2804
+ executableDir(path5) {
2805
+ if (path5 === void 0) return this._executableDir;
2806
+ this._executableDir = path5;
2807
2807
  return this;
2808
2808
  }
2809
2809
  /**
@@ -3069,7 +3069,7 @@ var require_polyfills = __commonJS({
3069
3069
  var constants = require("constants");
3070
3070
  var origCwd = process.cwd;
3071
3071
  var cwd = null;
3072
- var platform3 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
3072
+ var platform4 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
3073
3073
  process.cwd = function() {
3074
3074
  if (!cwd)
3075
3075
  cwd = origCwd.call(process);
@@ -3089,54 +3089,54 @@ var require_polyfills = __commonJS({
3089
3089
  }
3090
3090
  var chdir;
3091
3091
  module2.exports = patch;
3092
- function patch(fs17) {
3092
+ function patch(fs20) {
3093
3093
  if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
3094
- patchLchmod(fs17);
3095
- }
3096
- if (!fs17.lutimes) {
3097
- patchLutimes(fs17);
3098
- }
3099
- fs17.chown = chownFix(fs17.chown);
3100
- fs17.fchown = chownFix(fs17.fchown);
3101
- fs17.lchown = chownFix(fs17.lchown);
3102
- fs17.chmod = chmodFix(fs17.chmod);
3103
- fs17.fchmod = chmodFix(fs17.fchmod);
3104
- fs17.lchmod = chmodFix(fs17.lchmod);
3105
- fs17.chownSync = chownFixSync(fs17.chownSync);
3106
- fs17.fchownSync = chownFixSync(fs17.fchownSync);
3107
- fs17.lchownSync = chownFixSync(fs17.lchownSync);
3108
- fs17.chmodSync = chmodFixSync(fs17.chmodSync);
3109
- fs17.fchmodSync = chmodFixSync(fs17.fchmodSync);
3110
- fs17.lchmodSync = chmodFixSync(fs17.lchmodSync);
3111
- fs17.stat = statFix(fs17.stat);
3112
- fs17.fstat = statFix(fs17.fstat);
3113
- fs17.lstat = statFix(fs17.lstat);
3114
- fs17.statSync = statFixSync(fs17.statSync);
3115
- fs17.fstatSync = statFixSync(fs17.fstatSync);
3116
- fs17.lstatSync = statFixSync(fs17.lstatSync);
3117
- if (fs17.chmod && !fs17.lchmod) {
3118
- fs17.lchmod = function(path5, mode, cb) {
3094
+ patchLchmod(fs20);
3095
+ }
3096
+ if (!fs20.lutimes) {
3097
+ patchLutimes(fs20);
3098
+ }
3099
+ fs20.chown = chownFix(fs20.chown);
3100
+ fs20.fchown = chownFix(fs20.fchown);
3101
+ fs20.lchown = chownFix(fs20.lchown);
3102
+ fs20.chmod = chmodFix(fs20.chmod);
3103
+ fs20.fchmod = chmodFix(fs20.fchmod);
3104
+ fs20.lchmod = chmodFix(fs20.lchmod);
3105
+ fs20.chownSync = chownFixSync(fs20.chownSync);
3106
+ fs20.fchownSync = chownFixSync(fs20.fchownSync);
3107
+ fs20.lchownSync = chownFixSync(fs20.lchownSync);
3108
+ fs20.chmodSync = chmodFixSync(fs20.chmodSync);
3109
+ fs20.fchmodSync = chmodFixSync(fs20.fchmodSync);
3110
+ fs20.lchmodSync = chmodFixSync(fs20.lchmodSync);
3111
+ fs20.stat = statFix(fs20.stat);
3112
+ fs20.fstat = statFix(fs20.fstat);
3113
+ fs20.lstat = statFix(fs20.lstat);
3114
+ fs20.statSync = statFixSync(fs20.statSync);
3115
+ fs20.fstatSync = statFixSync(fs20.fstatSync);
3116
+ fs20.lstatSync = statFixSync(fs20.lstatSync);
3117
+ if (fs20.chmod && !fs20.lchmod) {
3118
+ fs20.lchmod = function(path4, mode, cb) {
3119
3119
  if (cb) process.nextTick(cb);
3120
3120
  };
3121
- fs17.lchmodSync = function() {
3121
+ fs20.lchmodSync = function() {
3122
3122
  };
3123
3123
  }
3124
- if (fs17.chown && !fs17.lchown) {
3125
- fs17.lchown = function(path5, uid, gid, cb) {
3124
+ if (fs20.chown && !fs20.lchown) {
3125
+ fs20.lchown = function(path4, uid, gid, cb) {
3126
3126
  if (cb) process.nextTick(cb);
3127
3127
  };
3128
- fs17.lchownSync = function() {
3128
+ fs20.lchownSync = function() {
3129
3129
  };
3130
3130
  }
3131
- if (platform3 === "win32") {
3132
- fs17.rename = typeof fs17.rename !== "function" ? fs17.rename : (function(fs$rename) {
3131
+ if (platform4 === "win32") {
3132
+ fs20.rename = typeof fs20.rename !== "function" ? fs20.rename : (function(fs$rename) {
3133
3133
  function rename(from3, to, cb) {
3134
3134
  var start = Date.now();
3135
3135
  var backoff = 0;
3136
3136
  fs$rename(from3, to, function CB(er) {
3137
3137
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
3138
3138
  setTimeout(function() {
3139
- fs17.stat(to, function(stater, st) {
3139
+ fs20.stat(to, function(stater, st) {
3140
3140
  if (stater && stater.code === "ENOENT")
3141
3141
  fs$rename(from3, to, CB);
3142
3142
  else
@@ -3152,9 +3152,9 @@ var require_polyfills = __commonJS({
3152
3152
  }
3153
3153
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
3154
3154
  return rename;
3155
- })(fs17.rename);
3155
+ })(fs20.rename);
3156
3156
  }
3157
- fs17.read = typeof fs17.read !== "function" ? fs17.read : (function(fs$read) {
3157
+ fs20.read = typeof fs20.read !== "function" ? fs20.read : (function(fs$read) {
3158
3158
  function read(fd, buffer, offset, length, position, callback_) {
3159
3159
  var callback;
3160
3160
  if (callback_ && typeof callback_ === "function") {
@@ -3162,22 +3162,22 @@ var require_polyfills = __commonJS({
3162
3162
  callback = function(er, _3, __) {
3163
3163
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
3164
3164
  eagCounter++;
3165
- return fs$read.call(fs17, fd, buffer, offset, length, position, callback);
3165
+ return fs$read.call(fs20, fd, buffer, offset, length, position, callback);
3166
3166
  }
3167
3167
  callback_.apply(this, arguments);
3168
3168
  };
3169
3169
  }
3170
- return fs$read.call(fs17, fd, buffer, offset, length, position, callback);
3170
+ return fs$read.call(fs20, fd, buffer, offset, length, position, callback);
3171
3171
  }
3172
3172
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
3173
3173
  return read;
3174
- })(fs17.read);
3175
- fs17.readSync = typeof fs17.readSync !== "function" ? fs17.readSync : /* @__PURE__ */ (function(fs$readSync) {
3174
+ })(fs20.read);
3175
+ fs20.readSync = typeof fs20.readSync !== "function" ? fs20.readSync : /* @__PURE__ */ (function(fs$readSync) {
3176
3176
  return function(fd, buffer, offset, length, position) {
3177
3177
  var eagCounter = 0;
3178
3178
  while (true) {
3179
3179
  try {
3180
- return fs$readSync.call(fs17, fd, buffer, offset, length, position);
3180
+ return fs$readSync.call(fs20, fd, buffer, offset, length, position);
3181
3181
  } catch (er) {
3182
3182
  if (er.code === "EAGAIN" && eagCounter < 10) {
3183
3183
  eagCounter++;
@@ -3187,11 +3187,11 @@ var require_polyfills = __commonJS({
3187
3187
  }
3188
3188
  }
3189
3189
  };
3190
- })(fs17.readSync);
3191
- function patchLchmod(fs18) {
3192
- fs18.lchmod = function(path5, mode, callback) {
3193
- fs18.open(
3194
- path5,
3190
+ })(fs20.readSync);
3191
+ function patchLchmod(fs21) {
3192
+ fs21.lchmod = function(path4, mode, callback) {
3193
+ fs21.open(
3194
+ path4,
3195
3195
  constants.O_WRONLY | constants.O_SYMLINK,
3196
3196
  mode,
3197
3197
  function(err, fd) {
@@ -3199,80 +3199,80 @@ var require_polyfills = __commonJS({
3199
3199
  if (callback) callback(err);
3200
3200
  return;
3201
3201
  }
3202
- fs18.fchmod(fd, mode, function(err2) {
3203
- fs18.close(fd, function(err22) {
3202
+ fs21.fchmod(fd, mode, function(err2) {
3203
+ fs21.close(fd, function(err22) {
3204
3204
  if (callback) callback(err2 || err22);
3205
3205
  });
3206
3206
  });
3207
3207
  }
3208
3208
  );
3209
3209
  };
3210
- fs18.lchmodSync = function(path5, mode) {
3211
- var fd = fs18.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
3210
+ fs21.lchmodSync = function(path4, mode) {
3211
+ var fd = fs21.openSync(path4, constants.O_WRONLY | constants.O_SYMLINK, mode);
3212
3212
  var threw = true;
3213
3213
  var ret;
3214
3214
  try {
3215
- ret = fs18.fchmodSync(fd, mode);
3215
+ ret = fs21.fchmodSync(fd, mode);
3216
3216
  threw = false;
3217
3217
  } finally {
3218
3218
  if (threw) {
3219
3219
  try {
3220
- fs18.closeSync(fd);
3220
+ fs21.closeSync(fd);
3221
3221
  } catch (er) {
3222
3222
  }
3223
3223
  } else {
3224
- fs18.closeSync(fd);
3224
+ fs21.closeSync(fd);
3225
3225
  }
3226
3226
  }
3227
3227
  return ret;
3228
3228
  };
3229
3229
  }
3230
- function patchLutimes(fs18) {
3231
- if (constants.hasOwnProperty("O_SYMLINK") && fs18.futimes) {
3232
- fs18.lutimes = function(path5, at, mt, cb) {
3233
- fs18.open(path5, constants.O_SYMLINK, function(er, fd) {
3230
+ function patchLutimes(fs21) {
3231
+ if (constants.hasOwnProperty("O_SYMLINK") && fs21.futimes) {
3232
+ fs21.lutimes = function(path4, at, mt, cb) {
3233
+ fs21.open(path4, constants.O_SYMLINK, function(er, fd) {
3234
3234
  if (er) {
3235
3235
  if (cb) cb(er);
3236
3236
  return;
3237
3237
  }
3238
- fs18.futimes(fd, at, mt, function(er2) {
3239
- fs18.close(fd, function(er22) {
3238
+ fs21.futimes(fd, at, mt, function(er2) {
3239
+ fs21.close(fd, function(er22) {
3240
3240
  if (cb) cb(er2 || er22);
3241
3241
  });
3242
3242
  });
3243
3243
  });
3244
3244
  };
3245
- fs18.lutimesSync = function(path5, at, mt) {
3246
- var fd = fs18.openSync(path5, constants.O_SYMLINK);
3245
+ fs21.lutimesSync = function(path4, at, mt) {
3246
+ var fd = fs21.openSync(path4, constants.O_SYMLINK);
3247
3247
  var ret;
3248
3248
  var threw = true;
3249
3249
  try {
3250
- ret = fs18.futimesSync(fd, at, mt);
3250
+ ret = fs21.futimesSync(fd, at, mt);
3251
3251
  threw = false;
3252
3252
  } finally {
3253
3253
  if (threw) {
3254
3254
  try {
3255
- fs18.closeSync(fd);
3255
+ fs21.closeSync(fd);
3256
3256
  } catch (er) {
3257
3257
  }
3258
3258
  } else {
3259
- fs18.closeSync(fd);
3259
+ fs21.closeSync(fd);
3260
3260
  }
3261
3261
  }
3262
3262
  return ret;
3263
3263
  };
3264
- } else if (fs18.futimes) {
3265
- fs18.lutimes = function(_a, _b, _c, cb) {
3264
+ } else if (fs21.futimes) {
3265
+ fs21.lutimes = function(_a, _b, _c, cb) {
3266
3266
  if (cb) process.nextTick(cb);
3267
3267
  };
3268
- fs18.lutimesSync = function() {
3268
+ fs21.lutimesSync = function() {
3269
3269
  };
3270
3270
  }
3271
3271
  }
3272
3272
  function chmodFix(orig) {
3273
3273
  if (!orig) return orig;
3274
3274
  return function(target, mode, cb) {
3275
- return orig.call(fs17, target, mode, function(er) {
3275
+ return orig.call(fs20, target, mode, function(er) {
3276
3276
  if (chownErOk(er)) er = null;
3277
3277
  if (cb) cb.apply(this, arguments);
3278
3278
  });
@@ -3282,7 +3282,7 @@ var require_polyfills = __commonJS({
3282
3282
  if (!orig) return orig;
3283
3283
  return function(target, mode) {
3284
3284
  try {
3285
- return orig.call(fs17, target, mode);
3285
+ return orig.call(fs20, target, mode);
3286
3286
  } catch (er) {
3287
3287
  if (!chownErOk(er)) throw er;
3288
3288
  }
@@ -3291,7 +3291,7 @@ var require_polyfills = __commonJS({
3291
3291
  function chownFix(orig) {
3292
3292
  if (!orig) return orig;
3293
3293
  return function(target, uid, gid, cb) {
3294
- return orig.call(fs17, target, uid, gid, function(er) {
3294
+ return orig.call(fs20, target, uid, gid, function(er) {
3295
3295
  if (chownErOk(er)) er = null;
3296
3296
  if (cb) cb.apply(this, arguments);
3297
3297
  });
@@ -3301,7 +3301,7 @@ var require_polyfills = __commonJS({
3301
3301
  if (!orig) return orig;
3302
3302
  return function(target, uid, gid) {
3303
3303
  try {
3304
- return orig.call(fs17, target, uid, gid);
3304
+ return orig.call(fs20, target, uid, gid);
3305
3305
  } catch (er) {
3306
3306
  if (!chownErOk(er)) throw er;
3307
3307
  }
@@ -3321,13 +3321,13 @@ var require_polyfills = __commonJS({
3321
3321
  }
3322
3322
  if (cb) cb.apply(this, arguments);
3323
3323
  }
3324
- return options ? orig.call(fs17, target, options, callback) : orig.call(fs17, target, callback);
3324
+ return options ? orig.call(fs20, target, options, callback) : orig.call(fs20, target, callback);
3325
3325
  };
3326
3326
  }
3327
3327
  function statFixSync(orig) {
3328
3328
  if (!orig) return orig;
3329
3329
  return function(target, options) {
3330
- var stats = options ? orig.call(fs17, target, options) : orig.call(fs17, target);
3330
+ var stats = options ? orig.call(fs20, target, options) : orig.call(fs20, target);
3331
3331
  if (stats) {
3332
3332
  if (stats.uid < 0) stats.uid += 4294967296;
3333
3333
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -3357,16 +3357,16 @@ var require_legacy_streams = __commonJS({
3357
3357
  "use strict";
3358
3358
  var Stream2 = require("stream").Stream;
3359
3359
  module2.exports = legacy;
3360
- function legacy(fs17) {
3360
+ function legacy(fs20) {
3361
3361
  return {
3362
3362
  ReadStream,
3363
3363
  WriteStream
3364
3364
  };
3365
- function ReadStream(path5, options) {
3366
- if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
3365
+ function ReadStream(path4, options) {
3366
+ if (!(this instanceof ReadStream)) return new ReadStream(path4, options);
3367
3367
  Stream2.call(this);
3368
3368
  var self2 = this;
3369
- this.path = path5;
3369
+ this.path = path4;
3370
3370
  this.fd = null;
3371
3371
  this.readable = true;
3372
3372
  this.paused = false;
@@ -3400,7 +3400,7 @@ var require_legacy_streams = __commonJS({
3400
3400
  });
3401
3401
  return;
3402
3402
  }
3403
- fs17.open(this.path, this.flags, this.mode, function(err, fd) {
3403
+ fs20.open(this.path, this.flags, this.mode, function(err, fd) {
3404
3404
  if (err) {
3405
3405
  self2.emit("error", err);
3406
3406
  self2.readable = false;
@@ -3411,10 +3411,10 @@ var require_legacy_streams = __commonJS({
3411
3411
  self2._read();
3412
3412
  });
3413
3413
  }
3414
- function WriteStream(path5, options) {
3415
- if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
3414
+ function WriteStream(path4, options) {
3415
+ if (!(this instanceof WriteStream)) return new WriteStream(path4, options);
3416
3416
  Stream2.call(this);
3417
- this.path = path5;
3417
+ this.path = path4;
3418
3418
  this.fd = null;
3419
3419
  this.writable = true;
3420
3420
  this.flags = "w";
@@ -3439,7 +3439,7 @@ var require_legacy_streams = __commonJS({
3439
3439
  this.busy = false;
3440
3440
  this._queue = [];
3441
3441
  if (this.fd === null) {
3442
- this._open = fs17.open;
3442
+ this._open = fs20.open;
3443
3443
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
3444
3444
  this.flush();
3445
3445
  }
@@ -3475,7 +3475,7 @@ var require_clone = __commonJS({
3475
3475
  var require_graceful_fs = __commonJS({
3476
3476
  "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
3477
3477
  "use strict";
3478
- var fs17 = require("fs");
3478
+ var fs20 = require("fs");
3479
3479
  var polyfills = require_polyfills();
3480
3480
  var legacy = require_legacy_streams();
3481
3481
  var clone = require_clone();
@@ -3507,12 +3507,12 @@ var require_graceful_fs = __commonJS({
3507
3507
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
3508
3508
  console.error(m);
3509
3509
  };
3510
- if (!fs17[gracefulQueue]) {
3510
+ if (!fs20[gracefulQueue]) {
3511
3511
  queue = global[gracefulQueue] || [];
3512
- publishQueue(fs17, queue);
3513
- fs17.close = (function(fs$close) {
3512
+ publishQueue(fs20, queue);
3513
+ fs20.close = (function(fs$close) {
3514
3514
  function close(fd, cb) {
3515
- return fs$close.call(fs17, fd, function(err) {
3515
+ return fs$close.call(fs20, fd, function(err) {
3516
3516
  if (!err) {
3517
3517
  resetQueue();
3518
3518
  }
@@ -3524,48 +3524,48 @@ var require_graceful_fs = __commonJS({
3524
3524
  value: fs$close
3525
3525
  });
3526
3526
  return close;
3527
- })(fs17.close);
3528
- fs17.closeSync = (function(fs$closeSync) {
3527
+ })(fs20.close);
3528
+ fs20.closeSync = (function(fs$closeSync) {
3529
3529
  function closeSync(fd) {
3530
- fs$closeSync.apply(fs17, arguments);
3530
+ fs$closeSync.apply(fs20, arguments);
3531
3531
  resetQueue();
3532
3532
  }
3533
3533
  Object.defineProperty(closeSync, previousSymbol, {
3534
3534
  value: fs$closeSync
3535
3535
  });
3536
3536
  return closeSync;
3537
- })(fs17.closeSync);
3537
+ })(fs20.closeSync);
3538
3538
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
3539
3539
  process.on("exit", function() {
3540
- debug(fs17[gracefulQueue]);
3541
- require("assert").equal(fs17[gracefulQueue].length, 0);
3540
+ debug(fs20[gracefulQueue]);
3541
+ require("assert").equal(fs20[gracefulQueue].length, 0);
3542
3542
  });
3543
3543
  }
3544
3544
  }
3545
3545
  var queue;
3546
3546
  if (!global[gracefulQueue]) {
3547
- publishQueue(global, fs17[gracefulQueue]);
3548
- }
3549
- module2.exports = patch(clone(fs17));
3550
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs17.__patched) {
3551
- module2.exports = patch(fs17);
3552
- fs17.__patched = true;
3553
- }
3554
- function patch(fs18) {
3555
- polyfills(fs18);
3556
- fs18.gracefulify = patch;
3557
- fs18.createReadStream = createReadStream;
3558
- fs18.createWriteStream = createWriteStream;
3559
- var fs$readFile = fs18.readFile;
3560
- fs18.readFile = readFile2;
3561
- function readFile2(path5, options, cb) {
3547
+ publishQueue(global, fs20[gracefulQueue]);
3548
+ }
3549
+ module2.exports = patch(clone(fs20));
3550
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs20.__patched) {
3551
+ module2.exports = patch(fs20);
3552
+ fs20.__patched = true;
3553
+ }
3554
+ function patch(fs21) {
3555
+ polyfills(fs21);
3556
+ fs21.gracefulify = patch;
3557
+ fs21.createReadStream = createReadStream;
3558
+ fs21.createWriteStream = createWriteStream;
3559
+ var fs$readFile = fs21.readFile;
3560
+ fs21.readFile = readFile;
3561
+ function readFile(path4, options, cb) {
3562
3562
  if (typeof options === "function")
3563
3563
  cb = options, options = null;
3564
- return go$readFile(path5, options, cb);
3565
- function go$readFile(path6, options2, cb2, startTime) {
3566
- return fs$readFile(path6, options2, function(err) {
3564
+ return go$readFile(path4, options, cb);
3565
+ function go$readFile(path5, options2, cb2, startTime) {
3566
+ return fs$readFile(path5, options2, function(err) {
3567
3567
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3568
- enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
3568
+ enqueue([go$readFile, [path5, options2, cb2], err, startTime || Date.now(), Date.now()]);
3569
3569
  else {
3570
3570
  if (typeof cb2 === "function")
3571
3571
  cb2.apply(this, arguments);
@@ -3573,16 +3573,16 @@ var require_graceful_fs = __commonJS({
3573
3573
  });
3574
3574
  }
3575
3575
  }
3576
- var fs$writeFile = fs18.writeFile;
3577
- fs18.writeFile = writeFile2;
3578
- function writeFile2(path5, data, options, cb) {
3576
+ var fs$writeFile = fs21.writeFile;
3577
+ fs21.writeFile = writeFile;
3578
+ function writeFile(path4, data, options, cb) {
3579
3579
  if (typeof options === "function")
3580
3580
  cb = options, options = null;
3581
- return go$writeFile(path5, data, options, cb);
3582
- function go$writeFile(path6, data2, options2, cb2, startTime) {
3583
- return fs$writeFile(path6, data2, options2, function(err) {
3581
+ return go$writeFile(path4, data, options, cb);
3582
+ function go$writeFile(path5, data2, options2, cb2, startTime) {
3583
+ return fs$writeFile(path5, data2, options2, function(err) {
3584
3584
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3585
- enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3585
+ enqueue([go$writeFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3586
3586
  else {
3587
3587
  if (typeof cb2 === "function")
3588
3588
  cb2.apply(this, arguments);
@@ -3590,17 +3590,17 @@ var require_graceful_fs = __commonJS({
3590
3590
  });
3591
3591
  }
3592
3592
  }
3593
- var fs$appendFile = fs18.appendFile;
3593
+ var fs$appendFile = fs21.appendFile;
3594
3594
  if (fs$appendFile)
3595
- fs18.appendFile = appendFile;
3596
- function appendFile(path5, data, options, cb) {
3595
+ fs21.appendFile = appendFile;
3596
+ function appendFile(path4, data, options, cb) {
3597
3597
  if (typeof options === "function")
3598
3598
  cb = options, options = null;
3599
- return go$appendFile(path5, data, options, cb);
3600
- function go$appendFile(path6, data2, options2, cb2, startTime) {
3601
- return fs$appendFile(path6, data2, options2, function(err) {
3599
+ return go$appendFile(path4, data, options, cb);
3600
+ function go$appendFile(path5, data2, options2, cb2, startTime) {
3601
+ return fs$appendFile(path5, data2, options2, function(err) {
3602
3602
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3603
- enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3603
+ enqueue([go$appendFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3604
3604
  else {
3605
3605
  if (typeof cb2 === "function")
3606
3606
  cb2.apply(this, arguments);
@@ -3608,9 +3608,9 @@ var require_graceful_fs = __commonJS({
3608
3608
  });
3609
3609
  }
3610
3610
  }
3611
- var fs$copyFile = fs18.copyFile;
3611
+ var fs$copyFile = fs21.copyFile;
3612
3612
  if (fs$copyFile)
3613
- fs18.copyFile = copyFile;
3613
+ fs21.copyFile = copyFile;
3614
3614
  function copyFile(src, dest, flags, cb) {
3615
3615
  if (typeof flags === "function") {
3616
3616
  cb = flags;
@@ -3628,34 +3628,34 @@ var require_graceful_fs = __commonJS({
3628
3628
  });
3629
3629
  }
3630
3630
  }
3631
- var fs$readdir = fs18.readdir;
3632
- fs18.readdir = readdir2;
3631
+ var fs$readdir = fs21.readdir;
3632
+ fs21.readdir = readdir2;
3633
3633
  var noReaddirOptionVersions = /^v[0-5]\./;
3634
- function readdir2(path5, options, cb) {
3634
+ function readdir2(path4, options, cb) {
3635
3635
  if (typeof options === "function")
3636
3636
  cb = options, options = null;
3637
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
3638
- return fs$readdir(path6, fs$readdirCallback(
3639
- path6,
3637
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path5, options2, cb2, startTime) {
3638
+ return fs$readdir(path5, fs$readdirCallback(
3639
+ path5,
3640
3640
  options2,
3641
3641
  cb2,
3642
3642
  startTime
3643
3643
  ));
3644
- } : function go$readdir2(path6, options2, cb2, startTime) {
3645
- return fs$readdir(path6, options2, fs$readdirCallback(
3646
- path6,
3644
+ } : function go$readdir2(path5, options2, cb2, startTime) {
3645
+ return fs$readdir(path5, options2, fs$readdirCallback(
3646
+ path5,
3647
3647
  options2,
3648
3648
  cb2,
3649
3649
  startTime
3650
3650
  ));
3651
3651
  };
3652
- return go$readdir(path5, options, cb);
3653
- function fs$readdirCallback(path6, options2, cb2, startTime) {
3652
+ return go$readdir(path4, options, cb);
3653
+ function fs$readdirCallback(path5, options2, cb2, startTime) {
3654
3654
  return function(err, files) {
3655
3655
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3656
3656
  enqueue([
3657
3657
  go$readdir,
3658
- [path6, options2, cb2],
3658
+ [path5, options2, cb2],
3659
3659
  err,
3660
3660
  startTime || Date.now(),
3661
3661
  Date.now()
@@ -3670,21 +3670,21 @@ var require_graceful_fs = __commonJS({
3670
3670
  }
3671
3671
  }
3672
3672
  if (process.version.substr(0, 4) === "v0.8") {
3673
- var legStreams = legacy(fs18);
3673
+ var legStreams = legacy(fs21);
3674
3674
  ReadStream = legStreams.ReadStream;
3675
3675
  WriteStream = legStreams.WriteStream;
3676
3676
  }
3677
- var fs$ReadStream = fs18.ReadStream;
3677
+ var fs$ReadStream = fs21.ReadStream;
3678
3678
  if (fs$ReadStream) {
3679
3679
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
3680
3680
  ReadStream.prototype.open = ReadStream$open;
3681
3681
  }
3682
- var fs$WriteStream = fs18.WriteStream;
3682
+ var fs$WriteStream = fs21.WriteStream;
3683
3683
  if (fs$WriteStream) {
3684
3684
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
3685
3685
  WriteStream.prototype.open = WriteStream$open;
3686
3686
  }
3687
- Object.defineProperty(fs18, "ReadStream", {
3687
+ Object.defineProperty(fs21, "ReadStream", {
3688
3688
  get: function() {
3689
3689
  return ReadStream;
3690
3690
  },
@@ -3694,7 +3694,7 @@ var require_graceful_fs = __commonJS({
3694
3694
  enumerable: true,
3695
3695
  configurable: true
3696
3696
  });
3697
- Object.defineProperty(fs18, "WriteStream", {
3697
+ Object.defineProperty(fs21, "WriteStream", {
3698
3698
  get: function() {
3699
3699
  return WriteStream;
3700
3700
  },
@@ -3705,7 +3705,7 @@ var require_graceful_fs = __commonJS({
3705
3705
  configurable: true
3706
3706
  });
3707
3707
  var FileReadStream = ReadStream;
3708
- Object.defineProperty(fs18, "FileReadStream", {
3708
+ Object.defineProperty(fs21, "FileReadStream", {
3709
3709
  get: function() {
3710
3710
  return FileReadStream;
3711
3711
  },
@@ -3716,7 +3716,7 @@ var require_graceful_fs = __commonJS({
3716
3716
  configurable: true
3717
3717
  });
3718
3718
  var FileWriteStream = WriteStream;
3719
- Object.defineProperty(fs18, "FileWriteStream", {
3719
+ Object.defineProperty(fs21, "FileWriteStream", {
3720
3720
  get: function() {
3721
3721
  return FileWriteStream;
3722
3722
  },
@@ -3726,7 +3726,7 @@ var require_graceful_fs = __commonJS({
3726
3726
  enumerable: true,
3727
3727
  configurable: true
3728
3728
  });
3729
- function ReadStream(path5, options) {
3729
+ function ReadStream(path4, options) {
3730
3730
  if (this instanceof ReadStream)
3731
3731
  return fs$ReadStream.apply(this, arguments), this;
3732
3732
  else
@@ -3746,7 +3746,7 @@ var require_graceful_fs = __commonJS({
3746
3746
  }
3747
3747
  });
3748
3748
  }
3749
- function WriteStream(path5, options) {
3749
+ function WriteStream(path4, options) {
3750
3750
  if (this instanceof WriteStream)
3751
3751
  return fs$WriteStream.apply(this, arguments), this;
3752
3752
  else
@@ -3764,22 +3764,22 @@ var require_graceful_fs = __commonJS({
3764
3764
  }
3765
3765
  });
3766
3766
  }
3767
- function createReadStream(path5, options) {
3768
- return new fs18.ReadStream(path5, options);
3767
+ function createReadStream(path4, options) {
3768
+ return new fs21.ReadStream(path4, options);
3769
3769
  }
3770
- function createWriteStream(path5, options) {
3771
- return new fs18.WriteStream(path5, options);
3770
+ function createWriteStream(path4, options) {
3771
+ return new fs21.WriteStream(path4, options);
3772
3772
  }
3773
- var fs$open = fs18.open;
3774
- fs18.open = open2;
3775
- function open2(path5, flags, mode, cb) {
3773
+ var fs$open = fs21.open;
3774
+ fs21.open = open2;
3775
+ function open2(path4, flags, mode, cb) {
3776
3776
  if (typeof mode === "function")
3777
3777
  cb = mode, mode = null;
3778
- return go$open(path5, flags, mode, cb);
3779
- function go$open(path6, flags2, mode2, cb2, startTime) {
3780
- return fs$open(path6, flags2, mode2, function(err, fd) {
3778
+ return go$open(path4, flags, mode, cb);
3779
+ function go$open(path5, flags2, mode2, cb2, startTime) {
3780
+ return fs$open(path5, flags2, mode2, function(err, fd) {
3781
3781
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3782
- enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
3782
+ enqueue([go$open, [path5, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
3783
3783
  else {
3784
3784
  if (typeof cb2 === "function")
3785
3785
  cb2.apply(this, arguments);
@@ -3787,20 +3787,20 @@ var require_graceful_fs = __commonJS({
3787
3787
  });
3788
3788
  }
3789
3789
  }
3790
- return fs18;
3790
+ return fs21;
3791
3791
  }
3792
3792
  function enqueue(elem) {
3793
3793
  debug("ENQUEUE", elem[0].name, elem[1]);
3794
- fs17[gracefulQueue].push(elem);
3794
+ fs20[gracefulQueue].push(elem);
3795
3795
  retry();
3796
3796
  }
3797
3797
  var retryTimer;
3798
3798
  function resetQueue() {
3799
3799
  var now = Date.now();
3800
- for (var i = 0; i < fs17[gracefulQueue].length; ++i) {
3801
- if (fs17[gracefulQueue][i].length > 2) {
3802
- fs17[gracefulQueue][i][3] = now;
3803
- fs17[gracefulQueue][i][4] = now;
3800
+ for (var i = 0; i < fs20[gracefulQueue].length; ++i) {
3801
+ if (fs20[gracefulQueue][i].length > 2) {
3802
+ fs20[gracefulQueue][i][3] = now;
3803
+ fs20[gracefulQueue][i][4] = now;
3804
3804
  }
3805
3805
  }
3806
3806
  retry();
@@ -3808,9 +3808,9 @@ var require_graceful_fs = __commonJS({
3808
3808
  function retry() {
3809
3809
  clearTimeout(retryTimer);
3810
3810
  retryTimer = void 0;
3811
- if (fs17[gracefulQueue].length === 0)
3811
+ if (fs20[gracefulQueue].length === 0)
3812
3812
  return;
3813
- var elem = fs17[gracefulQueue].shift();
3813
+ var elem = fs20[gracefulQueue].shift();
3814
3814
  var fn = elem[0];
3815
3815
  var args = elem[1];
3816
3816
  var err = elem[2];
@@ -3832,7 +3832,7 @@ var require_graceful_fs = __commonJS({
3832
3832
  debug("RETRY", fn.name, args);
3833
3833
  fn.apply(null, args.concat([startTime]));
3834
3834
  } else {
3835
- fs17[gracefulQueue].push(elem);
3835
+ fs20[gracefulQueue].push(elem);
3836
3836
  }
3837
3837
  }
3838
3838
  if (retryTimer === void 0) {
@@ -3847,7 +3847,7 @@ var require_fs = __commonJS({
3847
3847
  "node_modules/fs-extra/lib/fs/index.js"(exports2) {
3848
3848
  "use strict";
3849
3849
  var u = require_universalify().fromCallback;
3850
- var fs17 = require_graceful_fs();
3850
+ var fs20 = require_graceful_fs();
3851
3851
  var api = [
3852
3852
  "access",
3853
3853
  "appendFile",
@@ -3888,26 +3888,26 @@ var require_fs = __commonJS({
3888
3888
  "utimes",
3889
3889
  "writeFile"
3890
3890
  ].filter((key) => {
3891
- return typeof fs17[key] === "function";
3891
+ return typeof fs20[key] === "function";
3892
3892
  });
3893
- Object.assign(exports2, fs17);
3893
+ Object.assign(exports2, fs20);
3894
3894
  api.forEach((method) => {
3895
- exports2[method] = u(fs17[method]);
3895
+ exports2[method] = u(fs20[method]);
3896
3896
  });
3897
3897
  exports2.exists = function(filename, callback) {
3898
3898
  if (typeof callback === "function") {
3899
- return fs17.exists(filename, callback);
3899
+ return fs20.exists(filename, callback);
3900
3900
  }
3901
3901
  return new Promise((resolve) => {
3902
- return fs17.exists(filename, resolve);
3902
+ return fs20.exists(filename, resolve);
3903
3903
  });
3904
3904
  };
3905
3905
  exports2.read = function(fd, buffer, offset, length, position, callback) {
3906
3906
  if (typeof callback === "function") {
3907
- return fs17.read(fd, buffer, offset, length, position, callback);
3907
+ return fs20.read(fd, buffer, offset, length, position, callback);
3908
3908
  }
3909
3909
  return new Promise((resolve, reject) => {
3910
- fs17.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
3910
+ fs20.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
3911
3911
  if (err) return reject(err);
3912
3912
  resolve({ bytesRead, buffer: buffer2 });
3913
3913
  });
@@ -3915,10 +3915,10 @@ var require_fs = __commonJS({
3915
3915
  };
3916
3916
  exports2.write = function(fd, buffer, ...args) {
3917
3917
  if (typeof args[args.length - 1] === "function") {
3918
- return fs17.write(fd, buffer, ...args);
3918
+ return fs20.write(fd, buffer, ...args);
3919
3919
  }
3920
3920
  return new Promise((resolve, reject) => {
3921
- fs17.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
3921
+ fs20.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
3922
3922
  if (err) return reject(err);
3923
3923
  resolve({ bytesWritten, buffer: buffer2 });
3924
3924
  });
@@ -3926,10 +3926,10 @@ var require_fs = __commonJS({
3926
3926
  };
3927
3927
  exports2.readv = function(fd, buffers, ...args) {
3928
3928
  if (typeof args[args.length - 1] === "function") {
3929
- return fs17.readv(fd, buffers, ...args);
3929
+ return fs20.readv(fd, buffers, ...args);
3930
3930
  }
3931
3931
  return new Promise((resolve, reject) => {
3932
- fs17.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
3932
+ fs20.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
3933
3933
  if (err) return reject(err);
3934
3934
  resolve({ bytesRead, buffers: buffers2 });
3935
3935
  });
@@ -3937,17 +3937,17 @@ var require_fs = __commonJS({
3937
3937
  };
3938
3938
  exports2.writev = function(fd, buffers, ...args) {
3939
3939
  if (typeof args[args.length - 1] === "function") {
3940
- return fs17.writev(fd, buffers, ...args);
3940
+ return fs20.writev(fd, buffers, ...args);
3941
3941
  }
3942
3942
  return new Promise((resolve, reject) => {
3943
- fs17.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
3943
+ fs20.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
3944
3944
  if (err) return reject(err);
3945
3945
  resolve({ bytesWritten, buffers: buffers2 });
3946
3946
  });
3947
3947
  });
3948
3948
  };
3949
- if (typeof fs17.realpath.native === "function") {
3950
- exports2.realpath.native = u(fs17.realpath.native);
3949
+ if (typeof fs20.realpath.native === "function") {
3950
+ exports2.realpath.native = u(fs20.realpath.native);
3951
3951
  } else {
3952
3952
  process.emitWarning(
3953
3953
  "fs.realpath.native is not a function. Is fs being monkey-patched?",
@@ -3962,10 +3962,10 @@ var require_fs = __commonJS({
3962
3962
  var require_utils = __commonJS({
3963
3963
  "node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
3964
3964
  "use strict";
3965
- var path5 = require("path");
3965
+ var path4 = require("path");
3966
3966
  module2.exports.checkPath = function checkPath(pth) {
3967
3967
  if (process.platform === "win32") {
3968
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
3968
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path4.parse(pth).root, ""));
3969
3969
  if (pathHasInvalidWinCharacters) {
3970
3970
  const error = new Error(`Path contains invalid characters: ${pth}`);
3971
3971
  error.code = "EINVAL";
@@ -3980,7 +3980,7 @@ var require_utils = __commonJS({
3980
3980
  var require_make_dir = __commonJS({
3981
3981
  "node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
3982
3982
  "use strict";
3983
- var fs17 = require_fs();
3983
+ var fs20 = require_fs();
3984
3984
  var { checkPath } = require_utils();
3985
3985
  var getMode = (options) => {
3986
3986
  const defaults2 = { mode: 511 };
@@ -3989,14 +3989,14 @@ var require_make_dir = __commonJS({
3989
3989
  };
3990
3990
  module2.exports.makeDir = async (dir, options) => {
3991
3991
  checkPath(dir);
3992
- return fs17.mkdir(dir, {
3992
+ return fs20.mkdir(dir, {
3993
3993
  mode: getMode(options),
3994
3994
  recursive: true
3995
3995
  });
3996
3996
  };
3997
3997
  module2.exports.makeDirSync = (dir, options) => {
3998
3998
  checkPath(dir);
3999
- return fs17.mkdirSync(dir, {
3999
+ return fs20.mkdirSync(dir, {
4000
4000
  mode: getMode(options),
4001
4001
  recursive: true
4002
4002
  });
@@ -4028,13 +4028,13 @@ var require_path_exists = __commonJS({
4028
4028
  "node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
4029
4029
  "use strict";
4030
4030
  var u = require_universalify().fromPromise;
4031
- var fs17 = require_fs();
4032
- function pathExists2(path5) {
4033
- return fs17.access(path5).then(() => true).catch(() => false);
4031
+ var fs20 = require_fs();
4032
+ function pathExists(path4) {
4033
+ return fs20.access(path4).then(() => true).catch(() => false);
4034
4034
  }
4035
4035
  module2.exports = {
4036
- pathExists: u(pathExists2),
4037
- pathExistsSync: fs17.existsSync
4036
+ pathExists: u(pathExists),
4037
+ pathExistsSync: fs20.existsSync
4038
4038
  };
4039
4039
  }
4040
4040
  });
@@ -4043,16 +4043,16 @@ var require_path_exists = __commonJS({
4043
4043
  var require_utimes = __commonJS({
4044
4044
  "node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
4045
4045
  "use strict";
4046
- var fs17 = require_fs();
4046
+ var fs20 = require_fs();
4047
4047
  var u = require_universalify().fromPromise;
4048
- async function utimesMillis(path5, atime, mtime) {
4049
- const fd = await fs17.open(path5, "r+");
4048
+ async function utimesMillis(path4, atime, mtime) {
4049
+ const fd = await fs20.open(path4, "r+");
4050
4050
  let closeErr = null;
4051
4051
  try {
4052
- await fs17.futimes(fd, atime, mtime);
4052
+ await fs20.futimes(fd, atime, mtime);
4053
4053
  } finally {
4054
4054
  try {
4055
- await fs17.close(fd);
4055
+ await fs20.close(fd);
4056
4056
  } catch (e) {
4057
4057
  closeErr = e;
4058
4058
  }
@@ -4061,10 +4061,10 @@ var require_utimes = __commonJS({
4061
4061
  throw closeErr;
4062
4062
  }
4063
4063
  }
4064
- function utimesMillisSync(path5, atime, mtime) {
4065
- const fd = fs17.openSync(path5, "r+");
4066
- fs17.futimesSync(fd, atime, mtime);
4067
- return fs17.closeSync(fd);
4064
+ function utimesMillisSync(path4, atime, mtime) {
4065
+ const fd = fs20.openSync(path4, "r+");
4066
+ fs20.futimesSync(fd, atime, mtime);
4067
+ return fs20.closeSync(fd);
4068
4068
  }
4069
4069
  module2.exports = {
4070
4070
  utimesMillis: u(utimesMillis),
@@ -4077,11 +4077,11 @@ var require_utimes = __commonJS({
4077
4077
  var require_stat = __commonJS({
4078
4078
  "node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
4079
4079
  "use strict";
4080
- var fs17 = require_fs();
4081
- var path5 = require("path");
4080
+ var fs20 = require_fs();
4081
+ var path4 = require("path");
4082
4082
  var u = require_universalify().fromPromise;
4083
4083
  function getStats(src, dest, opts) {
4084
- const statFunc = opts.dereference ? (file) => fs17.stat(file, { bigint: true }) : (file) => fs17.lstat(file, { bigint: true });
4084
+ const statFunc = opts.dereference ? (file) => fs20.stat(file, { bigint: true }) : (file) => fs20.lstat(file, { bigint: true });
4085
4085
  return Promise.all([
4086
4086
  statFunc(src),
4087
4087
  statFunc(dest).catch((err) => {
@@ -4092,7 +4092,7 @@ var require_stat = __commonJS({
4092
4092
  }
4093
4093
  function getStatsSync(src, dest, opts) {
4094
4094
  let destStat;
4095
- const statFunc = opts.dereference ? (file) => fs17.statSync(file, { bigint: true }) : (file) => fs17.lstatSync(file, { bigint: true });
4095
+ const statFunc = opts.dereference ? (file) => fs20.statSync(file, { bigint: true }) : (file) => fs20.lstatSync(file, { bigint: true });
4096
4096
  const srcStat = statFunc(src);
4097
4097
  try {
4098
4098
  destStat = statFunc(dest);
@@ -4106,8 +4106,8 @@ var require_stat = __commonJS({
4106
4106
  const { srcStat, destStat } = await getStats(src, dest, opts);
4107
4107
  if (destStat) {
4108
4108
  if (areIdentical(srcStat, destStat)) {
4109
- const srcBaseName = path5.basename(src);
4110
- const destBaseName = path5.basename(dest);
4109
+ const srcBaseName = path4.basename(src);
4110
+ const destBaseName = path4.basename(dest);
4111
4111
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
4112
4112
  return { srcStat, destStat, isChangingCase: true };
4113
4113
  }
@@ -4129,8 +4129,8 @@ var require_stat = __commonJS({
4129
4129
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
4130
4130
  if (destStat) {
4131
4131
  if (areIdentical(srcStat, destStat)) {
4132
- const srcBaseName = path5.basename(src);
4133
- const destBaseName = path5.basename(dest);
4132
+ const srcBaseName = path4.basename(src);
4133
+ const destBaseName = path4.basename(dest);
4134
4134
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
4135
4135
  return { srcStat, destStat, isChangingCase: true };
4136
4136
  }
@@ -4149,12 +4149,12 @@ var require_stat = __commonJS({
4149
4149
  return { srcStat, destStat };
4150
4150
  }
4151
4151
  async function checkParentPaths(src, srcStat, dest, funcName) {
4152
- const srcParent = path5.resolve(path5.dirname(src));
4153
- const destParent = path5.resolve(path5.dirname(dest));
4154
- if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
4152
+ const srcParent = path4.resolve(path4.dirname(src));
4153
+ const destParent = path4.resolve(path4.dirname(dest));
4154
+ if (destParent === srcParent || destParent === path4.parse(destParent).root) return;
4155
4155
  let destStat;
4156
4156
  try {
4157
- destStat = await fs17.stat(destParent, { bigint: true });
4157
+ destStat = await fs20.stat(destParent, { bigint: true });
4158
4158
  } catch (err) {
4159
4159
  if (err.code === "ENOENT") return;
4160
4160
  throw err;
@@ -4165,12 +4165,12 @@ var require_stat = __commonJS({
4165
4165
  return checkParentPaths(src, srcStat, destParent, funcName);
4166
4166
  }
4167
4167
  function checkParentPathsSync(src, srcStat, dest, funcName) {
4168
- const srcParent = path5.resolve(path5.dirname(src));
4169
- const destParent = path5.resolve(path5.dirname(dest));
4170
- if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
4168
+ const srcParent = path4.resolve(path4.dirname(src));
4169
+ const destParent = path4.resolve(path4.dirname(dest));
4170
+ if (destParent === srcParent || destParent === path4.parse(destParent).root) return;
4171
4171
  let destStat;
4172
4172
  try {
4173
- destStat = fs17.statSync(destParent, { bigint: true });
4173
+ destStat = fs20.statSync(destParent, { bigint: true });
4174
4174
  } catch (err) {
4175
4175
  if (err.code === "ENOENT") return;
4176
4176
  throw err;
@@ -4184,8 +4184,8 @@ var require_stat = __commonJS({
4184
4184
  return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
4185
4185
  }
4186
4186
  function isSrcSubdir(src, dest) {
4187
- const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
4188
- const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
4187
+ const srcArr = path4.resolve(src).split(path4.sep).filter((i) => i);
4188
+ const destArr = path4.resolve(dest).split(path4.sep).filter((i) => i);
4189
4189
  return srcArr.every((cur, i) => destArr[i] === cur);
4190
4190
  }
4191
4191
  function errMsg(src, dest, funcName) {
@@ -4237,10 +4237,10 @@ var require_async = __commonJS({
4237
4237
  var require_copy = __commonJS({
4238
4238
  "node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
4239
4239
  "use strict";
4240
- var fs17 = require_fs();
4241
- var path5 = require("path");
4240
+ var fs20 = require_fs();
4241
+ var path4 = require("path");
4242
4242
  var { mkdirs } = require_mkdirs();
4243
- var { pathExists: pathExists2 } = require_path_exists();
4243
+ var { pathExists } = require_path_exists();
4244
4244
  var { utimesMillis } = require_utimes();
4245
4245
  var stat = require_stat();
4246
4246
  var { asyncIteratorConcurrentProcess } = require_async();
@@ -4261,8 +4261,8 @@ var require_copy = __commonJS({
4261
4261
  await stat.checkParentPaths(src, srcStat, dest, "copy");
4262
4262
  const include = await runFilter(src, dest, opts);
4263
4263
  if (!include) return;
4264
- const destParent = path5.dirname(dest);
4265
- const dirExists = await pathExists2(destParent);
4264
+ const destParent = path4.dirname(dest);
4265
+ const dirExists = await pathExists(destParent);
4266
4266
  if (!dirExists) {
4267
4267
  await mkdirs(destParent);
4268
4268
  }
@@ -4273,7 +4273,7 @@ var require_copy = __commonJS({
4273
4273
  return opts.filter(src, dest);
4274
4274
  }
4275
4275
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
4276
- const statFn = opts.dereference ? fs17.stat : fs17.lstat;
4276
+ const statFn = opts.dereference ? fs20.stat : fs20.lstat;
4277
4277
  const srcStat = await statFn(src);
4278
4278
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
4279
4279
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -4285,7 +4285,7 @@ var require_copy = __commonJS({
4285
4285
  async function onFile(srcStat, destStat, src, dest, opts) {
4286
4286
  if (!destStat) return copyFile(srcStat, src, dest, opts);
4287
4287
  if (opts.overwrite) {
4288
- await fs17.unlink(dest);
4288
+ await fs20.unlink(dest);
4289
4289
  return copyFile(srcStat, src, dest, opts);
4290
4290
  }
4291
4291
  if (opts.errorOnExist) {
@@ -4293,29 +4293,29 @@ var require_copy = __commonJS({
4293
4293
  }
4294
4294
  }
4295
4295
  async function copyFile(srcStat, src, dest, opts) {
4296
- await fs17.copyFile(src, dest);
4296
+ await fs20.copyFile(src, dest);
4297
4297
  if (opts.preserveTimestamps) {
4298
4298
  if (fileIsNotWritable(srcStat.mode)) {
4299
4299
  await makeFileWritable(dest, srcStat.mode);
4300
4300
  }
4301
- const updatedSrcStat = await fs17.stat(src);
4301
+ const updatedSrcStat = await fs20.stat(src);
4302
4302
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
4303
4303
  }
4304
- return fs17.chmod(dest, srcStat.mode);
4304
+ return fs20.chmod(dest, srcStat.mode);
4305
4305
  }
4306
4306
  function fileIsNotWritable(srcMode) {
4307
4307
  return (srcMode & 128) === 0;
4308
4308
  }
4309
4309
  function makeFileWritable(dest, srcMode) {
4310
- return fs17.chmod(dest, srcMode | 128);
4310
+ return fs20.chmod(dest, srcMode | 128);
4311
4311
  }
4312
4312
  async function onDir(srcStat, destStat, src, dest, opts) {
4313
4313
  if (!destStat) {
4314
- await fs17.mkdir(dest);
4314
+ await fs20.mkdir(dest);
4315
4315
  }
4316
- await asyncIteratorConcurrentProcess(await fs17.opendir(src), async (item) => {
4317
- const srcItem = path5.join(src, item.name);
4318
- const destItem = path5.join(dest, item.name);
4316
+ await asyncIteratorConcurrentProcess(await fs20.opendir(src), async (item) => {
4317
+ const srcItem = path4.join(src, item.name);
4318
+ const destItem = path4.join(dest, item.name);
4319
4319
  const include = await runFilter(srcItem, destItem, opts);
4320
4320
  if (include) {
4321
4321
  const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
@@ -4323,26 +4323,26 @@ var require_copy = __commonJS({
4323
4323
  }
4324
4324
  });
4325
4325
  if (!destStat) {
4326
- await fs17.chmod(dest, srcStat.mode);
4326
+ await fs20.chmod(dest, srcStat.mode);
4327
4327
  }
4328
4328
  }
4329
4329
  async function onLink(destStat, src, dest, opts) {
4330
- let resolvedSrc = await fs17.readlink(src);
4330
+ let resolvedSrc = await fs20.readlink(src);
4331
4331
  if (opts.dereference) {
4332
- resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
4332
+ resolvedSrc = path4.resolve(process.cwd(), resolvedSrc);
4333
4333
  }
4334
4334
  if (!destStat) {
4335
- return fs17.symlink(resolvedSrc, dest);
4335
+ return fs20.symlink(resolvedSrc, dest);
4336
4336
  }
4337
4337
  let resolvedDest = null;
4338
4338
  try {
4339
- resolvedDest = await fs17.readlink(dest);
4339
+ resolvedDest = await fs20.readlink(dest);
4340
4340
  } catch (e) {
4341
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs17.symlink(resolvedSrc, dest);
4341
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs20.symlink(resolvedSrc, dest);
4342
4342
  throw e;
4343
4343
  }
4344
4344
  if (opts.dereference) {
4345
- resolvedDest = path5.resolve(process.cwd(), resolvedDest);
4345
+ resolvedDest = path4.resolve(process.cwd(), resolvedDest);
4346
4346
  }
4347
4347
  if (resolvedSrc !== resolvedDest) {
4348
4348
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -4352,8 +4352,8 @@ var require_copy = __commonJS({
4352
4352
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
4353
4353
  }
4354
4354
  }
4355
- await fs17.unlink(dest);
4356
- return fs17.symlink(resolvedSrc, dest);
4355
+ await fs20.unlink(dest);
4356
+ return fs20.symlink(resolvedSrc, dest);
4357
4357
  }
4358
4358
  module2.exports = copy;
4359
4359
  }
@@ -4363,8 +4363,8 @@ var require_copy = __commonJS({
4363
4363
  var require_copy_sync = __commonJS({
4364
4364
  "node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
4365
4365
  "use strict";
4366
- var fs17 = require_graceful_fs();
4367
- var path5 = require("path");
4366
+ var fs20 = require_graceful_fs();
4367
+ var path4 = require("path");
4368
4368
  var mkdirsSync = require_mkdirs().mkdirsSync;
4369
4369
  var utimesMillisSync = require_utimes().utimesMillisSync;
4370
4370
  var stat = require_stat();
@@ -4385,12 +4385,12 @@ var require_copy_sync = __commonJS({
4385
4385
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
4386
4386
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
4387
4387
  if (opts.filter && !opts.filter(src, dest)) return;
4388
- const destParent = path5.dirname(dest);
4389
- if (!fs17.existsSync(destParent)) mkdirsSync(destParent);
4388
+ const destParent = path4.dirname(dest);
4389
+ if (!fs20.existsSync(destParent)) mkdirsSync(destParent);
4390
4390
  return getStats(destStat, src, dest, opts);
4391
4391
  }
4392
4392
  function getStats(destStat, src, dest, opts) {
4393
- const statSync = opts.dereference ? fs17.statSync : fs17.lstatSync;
4393
+ const statSync = opts.dereference ? fs20.statSync : fs20.lstatSync;
4394
4394
  const srcStat = statSync(src);
4395
4395
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
4396
4396
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -4405,14 +4405,14 @@ var require_copy_sync = __commonJS({
4405
4405
  }
4406
4406
  function mayCopyFile(srcStat, src, dest, opts) {
4407
4407
  if (opts.overwrite) {
4408
- fs17.unlinkSync(dest);
4408
+ fs20.unlinkSync(dest);
4409
4409
  return copyFile(srcStat, src, dest, opts);
4410
4410
  } else if (opts.errorOnExist) {
4411
4411
  throw new Error(`'${dest}' already exists`);
4412
4412
  }
4413
4413
  }
4414
4414
  function copyFile(srcStat, src, dest, opts) {
4415
- fs17.copyFileSync(src, dest);
4415
+ fs20.copyFileSync(src, dest);
4416
4416
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
4417
4417
  return setDestMode(dest, srcStat.mode);
4418
4418
  }
@@ -4427,10 +4427,10 @@ var require_copy_sync = __commonJS({
4427
4427
  return setDestMode(dest, srcMode | 128);
4428
4428
  }
4429
4429
  function setDestMode(dest, srcMode) {
4430
- return fs17.chmodSync(dest, srcMode);
4430
+ return fs20.chmodSync(dest, srcMode);
4431
4431
  }
4432
4432
  function setDestTimestamps(src, dest) {
4433
- const updatedSrcStat = fs17.statSync(src);
4433
+ const updatedSrcStat = fs20.statSync(src);
4434
4434
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
4435
4435
  }
4436
4436
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -4438,12 +4438,12 @@ var require_copy_sync = __commonJS({
4438
4438
  return copyDir(src, dest, opts);
4439
4439
  }
4440
4440
  function mkDirAndCopy(srcMode, src, dest, opts) {
4441
- fs17.mkdirSync(dest);
4441
+ fs20.mkdirSync(dest);
4442
4442
  copyDir(src, dest, opts);
4443
4443
  return setDestMode(dest, srcMode);
4444
4444
  }
4445
4445
  function copyDir(src, dest, opts) {
4446
- const dir = fs17.opendirSync(src);
4446
+ const dir = fs20.opendirSync(src);
4447
4447
  try {
4448
4448
  let dirent;
4449
4449
  while ((dirent = dir.readSync()) !== null) {
@@ -4454,29 +4454,29 @@ var require_copy_sync = __commonJS({
4454
4454
  }
4455
4455
  }
4456
4456
  function copyDirItem(item, src, dest, opts) {
4457
- const srcItem = path5.join(src, item);
4458
- const destItem = path5.join(dest, item);
4457
+ const srcItem = path4.join(src, item);
4458
+ const destItem = path4.join(dest, item);
4459
4459
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
4460
4460
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
4461
4461
  return getStats(destStat, srcItem, destItem, opts);
4462
4462
  }
4463
4463
  function onLink(destStat, src, dest, opts) {
4464
- let resolvedSrc = fs17.readlinkSync(src);
4464
+ let resolvedSrc = fs20.readlinkSync(src);
4465
4465
  if (opts.dereference) {
4466
- resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
4466
+ resolvedSrc = path4.resolve(process.cwd(), resolvedSrc);
4467
4467
  }
4468
4468
  if (!destStat) {
4469
- return fs17.symlinkSync(resolvedSrc, dest);
4469
+ return fs20.symlinkSync(resolvedSrc, dest);
4470
4470
  } else {
4471
4471
  let resolvedDest;
4472
4472
  try {
4473
- resolvedDest = fs17.readlinkSync(dest);
4473
+ resolvedDest = fs20.readlinkSync(dest);
4474
4474
  } catch (err) {
4475
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs17.symlinkSync(resolvedSrc, dest);
4475
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs20.symlinkSync(resolvedSrc, dest);
4476
4476
  throw err;
4477
4477
  }
4478
4478
  if (opts.dereference) {
4479
- resolvedDest = path5.resolve(process.cwd(), resolvedDest);
4479
+ resolvedDest = path4.resolve(process.cwd(), resolvedDest);
4480
4480
  }
4481
4481
  if (resolvedSrc !== resolvedDest) {
4482
4482
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -4490,8 +4490,8 @@ var require_copy_sync = __commonJS({
4490
4490
  }
4491
4491
  }
4492
4492
  function copyLink(resolvedSrc, dest) {
4493
- fs17.unlinkSync(dest);
4494
- return fs17.symlinkSync(resolvedSrc, dest);
4493
+ fs20.unlinkSync(dest);
4494
+ return fs20.symlinkSync(resolvedSrc, dest);
4495
4495
  }
4496
4496
  module2.exports = copySync;
4497
4497
  }
@@ -4513,16 +4513,16 @@ var require_copy2 = __commonJS({
4513
4513
  var require_remove = __commonJS({
4514
4514
  "node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
4515
4515
  "use strict";
4516
- var fs17 = require_graceful_fs();
4516
+ var fs20 = require_graceful_fs();
4517
4517
  var u = require_universalify().fromCallback;
4518
- function remove2(path5, callback) {
4519
- fs17.rm(path5, { recursive: true, force: true }, callback);
4518
+ function remove(path4, callback) {
4519
+ fs20.rm(path4, { recursive: true, force: true }, callback);
4520
4520
  }
4521
- function removeSync(path5) {
4522
- fs17.rmSync(path5, { recursive: true, force: true });
4521
+ function removeSync(path4) {
4522
+ fs20.rmSync(path4, { recursive: true, force: true });
4523
4523
  }
4524
4524
  module2.exports = {
4525
- remove: u(remove2),
4525
+ remove: u(remove),
4526
4526
  removeSync
4527
4527
  };
4528
4528
  }
@@ -4533,29 +4533,29 @@ var require_empty = __commonJS({
4533
4533
  "node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
4534
4534
  "use strict";
4535
4535
  var u = require_universalify().fromPromise;
4536
- var fs17 = require_fs();
4537
- var path5 = require("path");
4536
+ var fs20 = require_fs();
4537
+ var path4 = require("path");
4538
4538
  var mkdir = require_mkdirs();
4539
- var remove2 = require_remove();
4539
+ var remove = require_remove();
4540
4540
  var emptyDir = u(async function emptyDir2(dir) {
4541
4541
  let items;
4542
4542
  try {
4543
- items = await fs17.readdir(dir);
4543
+ items = await fs20.readdir(dir);
4544
4544
  } catch {
4545
4545
  return mkdir.mkdirs(dir);
4546
4546
  }
4547
- return Promise.all(items.map((item) => remove2.remove(path5.join(dir, item))));
4547
+ return Promise.all(items.map((item) => remove.remove(path4.join(dir, item))));
4548
4548
  });
4549
4549
  function emptyDirSync(dir) {
4550
4550
  let items;
4551
4551
  try {
4552
- items = fs17.readdirSync(dir);
4552
+ items = fs20.readdirSync(dir);
4553
4553
  } catch {
4554
4554
  return mkdir.mkdirsSync(dir);
4555
4555
  }
4556
4556
  items.forEach((item) => {
4557
- item = path5.join(dir, item);
4558
- remove2.removeSync(item);
4557
+ item = path4.join(dir, item);
4558
+ remove.removeSync(item);
4559
4559
  });
4560
4560
  }
4561
4561
  module2.exports = {
@@ -4572,52 +4572,52 @@ var require_file = __commonJS({
4572
4572
  "node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
4573
4573
  "use strict";
4574
4574
  var u = require_universalify().fromPromise;
4575
- var path5 = require("path");
4576
- var fs17 = require_fs();
4575
+ var path4 = require("path");
4576
+ var fs20 = require_fs();
4577
4577
  var mkdir = require_mkdirs();
4578
4578
  async function createFile(file) {
4579
4579
  let stats;
4580
4580
  try {
4581
- stats = await fs17.stat(file);
4581
+ stats = await fs20.stat(file);
4582
4582
  } catch {
4583
4583
  }
4584
4584
  if (stats && stats.isFile()) return;
4585
- const dir = path5.dirname(file);
4585
+ const dir = path4.dirname(file);
4586
4586
  let dirStats = null;
4587
4587
  try {
4588
- dirStats = await fs17.stat(dir);
4588
+ dirStats = await fs20.stat(dir);
4589
4589
  } catch (err) {
4590
4590
  if (err.code === "ENOENT") {
4591
4591
  await mkdir.mkdirs(dir);
4592
- await fs17.writeFile(file, "");
4592
+ await fs20.writeFile(file, "");
4593
4593
  return;
4594
4594
  } else {
4595
4595
  throw err;
4596
4596
  }
4597
4597
  }
4598
4598
  if (dirStats.isDirectory()) {
4599
- await fs17.writeFile(file, "");
4599
+ await fs20.writeFile(file, "");
4600
4600
  } else {
4601
- await fs17.readdir(dir);
4601
+ await fs20.readdir(dir);
4602
4602
  }
4603
4603
  }
4604
4604
  function createFileSync(file) {
4605
4605
  let stats;
4606
4606
  try {
4607
- stats = fs17.statSync(file);
4607
+ stats = fs20.statSync(file);
4608
4608
  } catch {
4609
4609
  }
4610
4610
  if (stats && stats.isFile()) return;
4611
- const dir = path5.dirname(file);
4611
+ const dir = path4.dirname(file);
4612
4612
  try {
4613
- if (!fs17.statSync(dir).isDirectory()) {
4614
- fs17.readdirSync(dir);
4613
+ if (!fs20.statSync(dir).isDirectory()) {
4614
+ fs20.readdirSync(dir);
4615
4615
  }
4616
4616
  } catch (err) {
4617
4617
  if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
4618
4618
  else throw err;
4619
4619
  }
4620
- fs17.writeFileSync(file, "");
4620
+ fs20.writeFileSync(file, "");
4621
4621
  }
4622
4622
  module2.exports = {
4623
4623
  createFile: u(createFile),
@@ -4631,50 +4631,50 @@ var require_link = __commonJS({
4631
4631
  "node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
4632
4632
  "use strict";
4633
4633
  var u = require_universalify().fromPromise;
4634
- var path5 = require("path");
4635
- var fs17 = require_fs();
4634
+ var path4 = require("path");
4635
+ var fs20 = require_fs();
4636
4636
  var mkdir = require_mkdirs();
4637
- var { pathExists: pathExists2 } = require_path_exists();
4637
+ var { pathExists } = require_path_exists();
4638
4638
  var { areIdentical } = require_stat();
4639
4639
  async function createLink(srcpath, dstpath) {
4640
4640
  let dstStat;
4641
4641
  try {
4642
- dstStat = await fs17.lstat(dstpath);
4642
+ dstStat = await fs20.lstat(dstpath);
4643
4643
  } catch {
4644
4644
  }
4645
4645
  let srcStat;
4646
4646
  try {
4647
- srcStat = await fs17.lstat(srcpath);
4647
+ srcStat = await fs20.lstat(srcpath);
4648
4648
  } catch (err) {
4649
4649
  err.message = err.message.replace("lstat", "ensureLink");
4650
4650
  throw err;
4651
4651
  }
4652
4652
  if (dstStat && areIdentical(srcStat, dstStat)) return;
4653
- const dir = path5.dirname(dstpath);
4654
- const dirExists = await pathExists2(dir);
4653
+ const dir = path4.dirname(dstpath);
4654
+ const dirExists = await pathExists(dir);
4655
4655
  if (!dirExists) {
4656
4656
  await mkdir.mkdirs(dir);
4657
4657
  }
4658
- await fs17.link(srcpath, dstpath);
4658
+ await fs20.link(srcpath, dstpath);
4659
4659
  }
4660
4660
  function createLinkSync(srcpath, dstpath) {
4661
4661
  let dstStat;
4662
4662
  try {
4663
- dstStat = fs17.lstatSync(dstpath);
4663
+ dstStat = fs20.lstatSync(dstpath);
4664
4664
  } catch {
4665
4665
  }
4666
4666
  try {
4667
- const srcStat = fs17.lstatSync(srcpath);
4667
+ const srcStat = fs20.lstatSync(srcpath);
4668
4668
  if (dstStat && areIdentical(srcStat, dstStat)) return;
4669
4669
  } catch (err) {
4670
4670
  err.message = err.message.replace("lstat", "ensureLink");
4671
4671
  throw err;
4672
4672
  }
4673
- const dir = path5.dirname(dstpath);
4674
- const dirExists = fs17.existsSync(dir);
4675
- if (dirExists) return fs17.linkSync(srcpath, dstpath);
4673
+ const dir = path4.dirname(dstpath);
4674
+ const dirExists = fs20.existsSync(dir);
4675
+ if (dirExists) return fs20.linkSync(srcpath, dstpath);
4676
4676
  mkdir.mkdirsSync(dir);
4677
- return fs17.linkSync(srcpath, dstpath);
4677
+ return fs20.linkSync(srcpath, dstpath);
4678
4678
  }
4679
4679
  module2.exports = {
4680
4680
  createLink: u(createLink),
@@ -4687,14 +4687,14 @@ var require_link = __commonJS({
4687
4687
  var require_symlink_paths = __commonJS({
4688
4688
  "node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
4689
4689
  "use strict";
4690
- var path5 = require("path");
4691
- var fs17 = require_fs();
4692
- var { pathExists: pathExists2 } = require_path_exists();
4690
+ var path4 = require("path");
4691
+ var fs20 = require_fs();
4692
+ var { pathExists } = require_path_exists();
4693
4693
  var u = require_universalify().fromPromise;
4694
4694
  async function symlinkPaths(srcpath, dstpath) {
4695
- if (path5.isAbsolute(srcpath)) {
4695
+ if (path4.isAbsolute(srcpath)) {
4696
4696
  try {
4697
- await fs17.lstat(srcpath);
4697
+ await fs20.lstat(srcpath);
4698
4698
  } catch (err) {
4699
4699
  err.message = err.message.replace("lstat", "ensureSymlink");
4700
4700
  throw err;
@@ -4704,9 +4704,9 @@ var require_symlink_paths = __commonJS({
4704
4704
  toDst: srcpath
4705
4705
  };
4706
4706
  }
4707
- const dstdir = path5.dirname(dstpath);
4708
- const relativeToDst = path5.join(dstdir, srcpath);
4709
- const exists = await pathExists2(relativeToDst);
4707
+ const dstdir = path4.dirname(dstpath);
4708
+ const relativeToDst = path4.join(dstdir, srcpath);
4709
+ const exists = await pathExists(relativeToDst);
4710
4710
  if (exists) {
4711
4711
  return {
4712
4712
  toCwd: relativeToDst,
@@ -4714,39 +4714,39 @@ var require_symlink_paths = __commonJS({
4714
4714
  };
4715
4715
  }
4716
4716
  try {
4717
- await fs17.lstat(srcpath);
4717
+ await fs20.lstat(srcpath);
4718
4718
  } catch (err) {
4719
4719
  err.message = err.message.replace("lstat", "ensureSymlink");
4720
4720
  throw err;
4721
4721
  }
4722
4722
  return {
4723
4723
  toCwd: srcpath,
4724
- toDst: path5.relative(dstdir, srcpath)
4724
+ toDst: path4.relative(dstdir, srcpath)
4725
4725
  };
4726
4726
  }
4727
4727
  function symlinkPathsSync(srcpath, dstpath) {
4728
- if (path5.isAbsolute(srcpath)) {
4729
- const exists2 = fs17.existsSync(srcpath);
4728
+ if (path4.isAbsolute(srcpath)) {
4729
+ const exists2 = fs20.existsSync(srcpath);
4730
4730
  if (!exists2) throw new Error("absolute srcpath does not exist");
4731
4731
  return {
4732
4732
  toCwd: srcpath,
4733
4733
  toDst: srcpath
4734
4734
  };
4735
4735
  }
4736
- const dstdir = path5.dirname(dstpath);
4737
- const relativeToDst = path5.join(dstdir, srcpath);
4738
- const exists = fs17.existsSync(relativeToDst);
4736
+ const dstdir = path4.dirname(dstpath);
4737
+ const relativeToDst = path4.join(dstdir, srcpath);
4738
+ const exists = fs20.existsSync(relativeToDst);
4739
4739
  if (exists) {
4740
4740
  return {
4741
4741
  toCwd: relativeToDst,
4742
4742
  toDst: srcpath
4743
4743
  };
4744
4744
  }
4745
- const srcExists = fs17.existsSync(srcpath);
4745
+ const srcExists = fs20.existsSync(srcpath);
4746
4746
  if (!srcExists) throw new Error("relative srcpath does not exist");
4747
4747
  return {
4748
4748
  toCwd: srcpath,
4749
- toDst: path5.relative(dstdir, srcpath)
4749
+ toDst: path4.relative(dstdir, srcpath)
4750
4750
  };
4751
4751
  }
4752
4752
  module2.exports = {
@@ -4760,13 +4760,13 @@ var require_symlink_paths = __commonJS({
4760
4760
  var require_symlink_type = __commonJS({
4761
4761
  "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
4762
4762
  "use strict";
4763
- var fs17 = require_fs();
4763
+ var fs20 = require_fs();
4764
4764
  var u = require_universalify().fromPromise;
4765
4765
  async function symlinkType(srcpath, type) {
4766
4766
  if (type) return type;
4767
4767
  let stats;
4768
4768
  try {
4769
- stats = await fs17.lstat(srcpath);
4769
+ stats = await fs20.lstat(srcpath);
4770
4770
  } catch {
4771
4771
  return "file";
4772
4772
  }
@@ -4776,7 +4776,7 @@ var require_symlink_type = __commonJS({
4776
4776
  if (type) return type;
4777
4777
  let stats;
4778
4778
  try {
4779
- stats = fs17.lstatSync(srcpath);
4779
+ stats = fs20.lstatSync(srcpath);
4780
4780
  } catch {
4781
4781
  return "file";
4782
4782
  }
@@ -4794,54 +4794,54 @@ var require_symlink = __commonJS({
4794
4794
  "node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
4795
4795
  "use strict";
4796
4796
  var u = require_universalify().fromPromise;
4797
- var path5 = require("path");
4798
- var fs17 = require_fs();
4797
+ var path4 = require("path");
4798
+ var fs20 = require_fs();
4799
4799
  var { mkdirs, mkdirsSync } = require_mkdirs();
4800
4800
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
4801
4801
  var { symlinkType, symlinkTypeSync } = require_symlink_type();
4802
- var { pathExists: pathExists2 } = require_path_exists();
4802
+ var { pathExists } = require_path_exists();
4803
4803
  var { areIdentical } = require_stat();
4804
4804
  async function createSymlink(srcpath, dstpath, type) {
4805
4805
  let stats;
4806
4806
  try {
4807
- stats = await fs17.lstat(dstpath);
4807
+ stats = await fs20.lstat(dstpath);
4808
4808
  } catch {
4809
4809
  }
4810
4810
  if (stats && stats.isSymbolicLink()) {
4811
4811
  const [srcStat, dstStat] = await Promise.all([
4812
- fs17.stat(srcpath),
4813
- fs17.stat(dstpath)
4812
+ fs20.stat(srcpath),
4813
+ fs20.stat(dstpath)
4814
4814
  ]);
4815
4815
  if (areIdentical(srcStat, dstStat)) return;
4816
4816
  }
4817
4817
  const relative2 = await symlinkPaths(srcpath, dstpath);
4818
4818
  srcpath = relative2.toDst;
4819
4819
  const toType = await symlinkType(relative2.toCwd, type);
4820
- const dir = path5.dirname(dstpath);
4821
- if (!await pathExists2(dir)) {
4820
+ const dir = path4.dirname(dstpath);
4821
+ if (!await pathExists(dir)) {
4822
4822
  await mkdirs(dir);
4823
4823
  }
4824
- return fs17.symlink(srcpath, dstpath, toType);
4824
+ return fs20.symlink(srcpath, dstpath, toType);
4825
4825
  }
4826
4826
  function createSymlinkSync(srcpath, dstpath, type) {
4827
4827
  let stats;
4828
4828
  try {
4829
- stats = fs17.lstatSync(dstpath);
4829
+ stats = fs20.lstatSync(dstpath);
4830
4830
  } catch {
4831
4831
  }
4832
4832
  if (stats && stats.isSymbolicLink()) {
4833
- const srcStat = fs17.statSync(srcpath);
4834
- const dstStat = fs17.statSync(dstpath);
4833
+ const srcStat = fs20.statSync(srcpath);
4834
+ const dstStat = fs20.statSync(dstpath);
4835
4835
  if (areIdentical(srcStat, dstStat)) return;
4836
4836
  }
4837
4837
  const relative2 = symlinkPathsSync(srcpath, dstpath);
4838
4838
  srcpath = relative2.toDst;
4839
4839
  type = symlinkTypeSync(relative2.toCwd, type);
4840
- const dir = path5.dirname(dstpath);
4841
- const exists = fs17.existsSync(dir);
4842
- if (exists) return fs17.symlinkSync(srcpath, dstpath, type);
4840
+ const dir = path4.dirname(dstpath);
4841
+ const exists = fs20.existsSync(dir);
4842
+ if (exists) return fs20.symlinkSync(srcpath, dstpath, type);
4843
4843
  mkdirsSync(dir);
4844
- return fs17.symlinkSync(srcpath, dstpath, type);
4844
+ return fs20.symlinkSync(srcpath, dstpath, type);
4845
4845
  }
4846
4846
  module2.exports = {
4847
4847
  createSymlink: u(createSymlink),
@@ -4910,9 +4910,9 @@ var require_jsonfile = __commonJS({
4910
4910
  if (typeof options === "string") {
4911
4911
  options = { encoding: options };
4912
4912
  }
4913
- const fs17 = options.fs || _fs;
4913
+ const fs20 = options.fs || _fs;
4914
4914
  const shouldThrow = "throws" in options ? options.throws : true;
4915
- let data = await universalify.fromCallback(fs17.readFile)(file, options);
4915
+ let data = await universalify.fromCallback(fs20.readFile)(file, options);
4916
4916
  data = stripBom(data);
4917
4917
  let obj;
4918
4918
  try {
@@ -4927,15 +4927,15 @@ var require_jsonfile = __commonJS({
4927
4927
  }
4928
4928
  return obj;
4929
4929
  }
4930
- var readFile2 = universalify.fromPromise(_readFile);
4930
+ var readFile = universalify.fromPromise(_readFile);
4931
4931
  function readFileSync5(file, options = {}) {
4932
4932
  if (typeof options === "string") {
4933
4933
  options = { encoding: options };
4934
4934
  }
4935
- const fs17 = options.fs || _fs;
4935
+ const fs20 = options.fs || _fs;
4936
4936
  const shouldThrow = "throws" in options ? options.throws : true;
4937
4937
  try {
4938
- let content = fs17.readFileSync(file, options);
4938
+ let content = fs20.readFileSync(file, options);
4939
4939
  content = stripBom(content);
4940
4940
  return JSON.parse(content, options.reviver);
4941
4941
  } catch (err) {
@@ -4948,20 +4948,20 @@ var require_jsonfile = __commonJS({
4948
4948
  }
4949
4949
  }
4950
4950
  async function _writeFile(file, obj, options = {}) {
4951
- const fs17 = options.fs || _fs;
4951
+ const fs20 = options.fs || _fs;
4952
4952
  const str = stringify2(obj, options);
4953
- await universalify.fromCallback(fs17.writeFile)(file, str, options);
4953
+ await universalify.fromCallback(fs20.writeFile)(file, str, options);
4954
4954
  }
4955
- var writeFile2 = universalify.fromPromise(_writeFile);
4955
+ var writeFile = universalify.fromPromise(_writeFile);
4956
4956
  function writeFileSync3(file, obj, options = {}) {
4957
- const fs17 = options.fs || _fs;
4957
+ const fs20 = options.fs || _fs;
4958
4958
  const str = stringify2(obj, options);
4959
- return fs17.writeFileSync(file, str, options);
4959
+ return fs20.writeFileSync(file, str, options);
4960
4960
  }
4961
4961
  module2.exports = {
4962
- readFile: readFile2,
4962
+ readFile,
4963
4963
  readFileSync: readFileSync5,
4964
- writeFile: writeFile2,
4964
+ writeFile,
4965
4965
  writeFileSync: writeFileSync3
4966
4966
  };
4967
4967
  }
@@ -4987,23 +4987,23 @@ var require_output_file = __commonJS({
4987
4987
  "node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
4988
4988
  "use strict";
4989
4989
  var u = require_universalify().fromPromise;
4990
- var fs17 = require_fs();
4991
- var path5 = require("path");
4990
+ var fs20 = require_fs();
4991
+ var path4 = require("path");
4992
4992
  var mkdir = require_mkdirs();
4993
- var pathExists2 = require_path_exists().pathExists;
4993
+ var pathExists = require_path_exists().pathExists;
4994
4994
  async function outputFile(file, data, encoding = "utf-8") {
4995
- const dir = path5.dirname(file);
4996
- if (!await pathExists2(dir)) {
4995
+ const dir = path4.dirname(file);
4996
+ if (!await pathExists(dir)) {
4997
4997
  await mkdir.mkdirs(dir);
4998
4998
  }
4999
- return fs17.writeFile(file, data, encoding);
4999
+ return fs20.writeFile(file, data, encoding);
5000
5000
  }
5001
5001
  function outputFileSync(file, ...args) {
5002
- const dir = path5.dirname(file);
5003
- if (!fs17.existsSync(dir)) {
5002
+ const dir = path4.dirname(file);
5003
+ if (!fs20.existsSync(dir)) {
5004
5004
  mkdir.mkdirsSync(dir);
5005
5005
  }
5006
- fs17.writeFileSync(file, ...args);
5006
+ fs20.writeFileSync(file, ...args);
5007
5007
  }
5008
5008
  module2.exports = {
5009
5009
  outputFile: u(outputFile),
@@ -5062,19 +5062,19 @@ var require_json = __commonJS({
5062
5062
  var require_move = __commonJS({
5063
5063
  "node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
5064
5064
  "use strict";
5065
- var fs17 = require_fs();
5066
- var path5 = require("path");
5065
+ var fs20 = require_fs();
5066
+ var path4 = require("path");
5067
5067
  var { copy } = require_copy2();
5068
- var { remove: remove2 } = require_remove();
5068
+ var { remove } = require_remove();
5069
5069
  var { mkdirp } = require_mkdirs();
5070
- var { pathExists: pathExists2 } = require_path_exists();
5070
+ var { pathExists } = require_path_exists();
5071
5071
  var stat = require_stat();
5072
5072
  async function move(src, dest, opts = {}) {
5073
5073
  const overwrite = opts.overwrite || opts.clobber || false;
5074
5074
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
5075
5075
  await stat.checkParentPaths(src, srcStat, dest, "move");
5076
- const destParent = path5.dirname(dest);
5077
- const parsedParentPath = path5.parse(destParent);
5076
+ const destParent = path4.dirname(dest);
5077
+ const parsedParentPath = path4.parse(destParent);
5078
5078
  if (parsedParentPath.root !== destParent) {
5079
5079
  await mkdirp(destParent);
5080
5080
  }
@@ -5083,13 +5083,13 @@ var require_move = __commonJS({
5083
5083
  async function doRename(src, dest, overwrite, isChangingCase) {
5084
5084
  if (!isChangingCase) {
5085
5085
  if (overwrite) {
5086
- await remove2(dest);
5087
- } else if (await pathExists2(dest)) {
5086
+ await remove(dest);
5087
+ } else if (await pathExists(dest)) {
5088
5088
  throw new Error("dest already exists.");
5089
5089
  }
5090
5090
  }
5091
5091
  try {
5092
- await fs17.rename(src, dest);
5092
+ await fs20.rename(src, dest);
5093
5093
  } catch (err) {
5094
5094
  if (err.code !== "EXDEV") {
5095
5095
  throw err;
@@ -5104,7 +5104,7 @@ var require_move = __commonJS({
5104
5104
  preserveTimestamps: true
5105
5105
  };
5106
5106
  await copy(src, dest, opts);
5107
- return remove2(src);
5107
+ return remove(src);
5108
5108
  }
5109
5109
  module2.exports = move;
5110
5110
  }
@@ -5114,8 +5114,8 @@ var require_move = __commonJS({
5114
5114
  var require_move_sync = __commonJS({
5115
5115
  "node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
5116
5116
  "use strict";
5117
- var fs17 = require_graceful_fs();
5118
- var path5 = require("path");
5117
+ var fs20 = require_graceful_fs();
5118
+ var path4 = require("path");
5119
5119
  var copySync = require_copy2().copySync;
5120
5120
  var removeSync = require_remove().removeSync;
5121
5121
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -5125,12 +5125,12 @@ var require_move_sync = __commonJS({
5125
5125
  const overwrite = opts.overwrite || opts.clobber || false;
5126
5126
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
5127
5127
  stat.checkParentPathsSync(src, srcStat, dest, "move");
5128
- if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));
5128
+ if (!isParentRoot(dest)) mkdirpSync(path4.dirname(dest));
5129
5129
  return doRename(src, dest, overwrite, isChangingCase);
5130
5130
  }
5131
5131
  function isParentRoot(dest) {
5132
- const parent = path5.dirname(dest);
5133
- const parsedPath = path5.parse(parent);
5132
+ const parent = path4.dirname(dest);
5133
+ const parsedPath = path4.parse(parent);
5134
5134
  return parsedPath.root === parent;
5135
5135
  }
5136
5136
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -5139,12 +5139,12 @@ var require_move_sync = __commonJS({
5139
5139
  removeSync(dest);
5140
5140
  return rename(src, dest, overwrite);
5141
5141
  }
5142
- if (fs17.existsSync(dest)) throw new Error("dest already exists.");
5142
+ if (fs20.existsSync(dest)) throw new Error("dest already exists.");
5143
5143
  return rename(src, dest, overwrite);
5144
5144
  }
5145
5145
  function rename(src, dest, overwrite) {
5146
5146
  try {
5147
- fs17.renameSync(src, dest);
5147
+ fs20.renameSync(src, dest);
5148
5148
  } catch (err) {
5149
5149
  if (err.code !== "EXDEV") throw err;
5150
5150
  return moveAcrossDevice(src, dest, overwrite);
@@ -11555,7 +11555,7 @@ var require_fromEvent = __commonJS({
11555
11555
  return function(handler) {
11556
11556
  return target[methodName](eventName, handler, options);
11557
11557
  };
11558
- }) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0], remove2 = _a[1];
11558
+ }) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0], remove = _a[1];
11559
11559
  if (!add) {
11560
11560
  if (isArrayLike_1.isArrayLike(target)) {
11561
11561
  return mergeMap_1.mergeMap(function(subTarget) {
@@ -11576,7 +11576,7 @@ var require_fromEvent = __commonJS({
11576
11576
  };
11577
11577
  add(handler);
11578
11578
  return function() {
11579
- return remove2(handler);
11579
+ return remove(handler);
11580
11580
  };
11581
11581
  });
11582
11582
  }
@@ -17562,15 +17562,15 @@ var require_route = __commonJS({
17562
17562
  };
17563
17563
  }
17564
17564
  function wrapConversion(toModel, graph) {
17565
- const path5 = [graph[toModel].parent, toModel];
17565
+ const path4 = [graph[toModel].parent, toModel];
17566
17566
  let fn = conversions[graph[toModel].parent][toModel];
17567
17567
  let cur = graph[toModel].parent;
17568
17568
  while (graph[cur].parent) {
17569
- path5.unshift(graph[cur].parent);
17569
+ path4.unshift(graph[cur].parent);
17570
17570
  fn = link(conversions[graph[cur].parent][cur], fn);
17571
17571
  cur = graph[cur].parent;
17572
17572
  }
17573
- fn.conversion = path5;
17573
+ fn.conversion = path4;
17574
17574
  return fn;
17575
17575
  }
17576
17576
  module2.exports = function(fromModel) {
@@ -17944,7 +17944,7 @@ var require_has_flag = __commonJS({
17944
17944
  var require_supports_color = __commonJS({
17945
17945
  "node_modules/supports-color/index.js"(exports2, module2) {
17946
17946
  "use strict";
17947
- var os5 = require("os");
17947
+ var os4 = require("os");
17948
17948
  var tty2 = require("tty");
17949
17949
  var hasFlag2 = require_has_flag();
17950
17950
  var { env: env2 } = process;
@@ -17992,7 +17992,7 @@ var require_supports_color = __commonJS({
17992
17992
  return min;
17993
17993
  }
17994
17994
  if (process.platform === "win32") {
17995
- const osRelease = os5.release().split(".");
17995
+ const osRelease = os4.release().split(".");
17996
17996
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
17997
17997
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
17998
17998
  }
@@ -18509,14 +18509,14 @@ var require_signal_exit = __commonJS({
18509
18509
  if (opts && opts.alwaysLast) {
18510
18510
  ev = "afterexit";
18511
18511
  }
18512
- var remove2 = function() {
18512
+ var remove = function() {
18513
18513
  emitter.removeListener(ev, cb);
18514
18514
  if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
18515
18515
  unload2();
18516
18516
  }
18517
18517
  };
18518
18518
  emitter.on(ev, cb);
18519
- return remove2;
18519
+ return remove;
18520
18520
  };
18521
18521
  unload2 = function unload3() {
18522
18522
  if (!loaded || !processOk2(global.process)) {
@@ -19200,7 +19200,7 @@ var require_buffer_list = __commonJS({
19200
19200
  }
19201
19201
  }, {
19202
19202
  key: "join",
19203
- value: function join16(s) {
19203
+ value: function join17(s) {
19204
19204
  if (this.length === 0) return "";
19205
19205
  var p = this.head;
19206
19206
  var ret = "" + p.data;
@@ -28077,10 +28077,10 @@ var require_lib2 = __commonJS({
28077
28077
  exports2.analyse = analyse;
28078
28078
  var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
28079
28079
  let fd;
28080
- const fs17 = (0, node_1.default)();
28080
+ const fs20 = (0, node_1.default)();
28081
28081
  const handler = (err, buffer) => {
28082
28082
  if (fd) {
28083
- fs17.closeSync(fd);
28083
+ fs20.closeSync(fd);
28084
28084
  }
28085
28085
  if (err) {
28086
28086
  reject(err);
@@ -28092,9 +28092,9 @@ var require_lib2 = __commonJS({
28092
28092
  };
28093
28093
  const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
28094
28094
  if (sampleSize > 0) {
28095
- fd = fs17.openSync(filepath, "r");
28095
+ fd = fs20.openSync(filepath, "r");
28096
28096
  let sample = Buffer.allocUnsafe(sampleSize);
28097
- fs17.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
28097
+ fs20.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
28098
28098
  if (err) {
28099
28099
  handler(err, null);
28100
28100
  } else {
@@ -28106,22 +28106,22 @@ var require_lib2 = __commonJS({
28106
28106
  });
28107
28107
  return;
28108
28108
  }
28109
- fs17.readFile(filepath, handler);
28109
+ fs20.readFile(filepath, handler);
28110
28110
  });
28111
28111
  exports2.detectFile = detectFile;
28112
28112
  var detectFileSync = (filepath, opts = {}) => {
28113
- const fs17 = (0, node_1.default)();
28113
+ const fs20 = (0, node_1.default)();
28114
28114
  if (opts && opts.sampleSize) {
28115
- const fd = fs17.openSync(filepath, "r");
28115
+ const fd = fs20.openSync(filepath, "r");
28116
28116
  let sample = Buffer.allocUnsafe(opts.sampleSize);
28117
- const bytesRead = fs17.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
28117
+ const bytesRead = fs20.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
28118
28118
  if (bytesRead < opts.sampleSize) {
28119
28119
  sample = sample.subarray(0, bytesRead);
28120
28120
  }
28121
- fs17.closeSync(fd);
28121
+ fs20.closeSync(fd);
28122
28122
  return (0, exports2.detect)(sample);
28123
28123
  }
28124
- return (0, exports2.detect)(fs17.readFileSync(filepath));
28124
+ return (0, exports2.detect)(fs20.readFileSync(filepath));
28125
28125
  };
28126
28126
  exports2.detectFileSync = detectFileSync;
28127
28127
  exports2.default = {
@@ -31800,7 +31800,7 @@ var require_lib3 = __commonJS({
31800
31800
  var trail = encoder.end();
31801
31801
  return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
31802
31802
  };
31803
- module2.exports.decode = function decode(buf, encoding, options) {
31803
+ module2.exports.decode = function decode2(buf, encoding, options) {
31804
31804
  if (typeof buf === "string") {
31805
31805
  if (!module2.exports.skipDecodeWarning) {
31806
31806
  console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
@@ -32455,7 +32455,7 @@ var require_has_flag2 = __commonJS({
32455
32455
  var require_supports_colors = __commonJS({
32456
32456
  "node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
32457
32457
  "use strict";
32458
- var os5 = require("os");
32458
+ var os4 = require("os");
32459
32459
  var hasFlag2 = require_has_flag2();
32460
32460
  var env2 = process.env;
32461
32461
  var forceColor = void 0;
@@ -32493,7 +32493,7 @@ var require_supports_colors = __commonJS({
32493
32493
  }
32494
32494
  var min = forceColor ? 1 : 0;
32495
32495
  if (process.platform === "win32") {
32496
- var osRelease = os5.release().split(".");
32496
+ var osRelease = os4.release().split(".");
32497
32497
  if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
32498
32498
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
32499
32499
  }
@@ -36709,7 +36709,7 @@ var require_verify = __commonJS({
36709
36709
  var JsonWebTokenError2 = require_JsonWebTokenError();
36710
36710
  var NotBeforeError = require_NotBeforeError();
36711
36711
  var TokenExpiredError2 = require_TokenExpiredError();
36712
- var decode = require_decode();
36712
+ var decode2 = require_decode();
36713
36713
  var timespan = require_timespan();
36714
36714
  var validateAsymmetricKey = require_validateAsymmetricKey();
36715
36715
  var PS_SUPPORTED = require_psSupported();
@@ -36763,7 +36763,7 @@ var require_verify = __commonJS({
36763
36763
  }
36764
36764
  let decodedToken;
36765
36765
  try {
36766
- decodedToken = decode(jwtString, { complete: true });
36766
+ decodedToken = decode2(jwtString, { complete: true });
36767
36767
  } catch (err) {
36768
36768
  return done(err);
36769
36769
  }
@@ -38927,7 +38927,7 @@ var require_Pool = __commonJS({
38927
38927
  return resource;
38928
38928
  }).catch((err) => {
38929
38929
  this._executeEventHandlers("acquireFail", eventId, err);
38930
- remove2(this.pendingAcquires, pendingAcquire);
38930
+ remove(this.pendingAcquires, pendingAcquire);
38931
38931
  return Promise.reject(err);
38932
38932
  });
38933
38933
  this._tryAcquireOrCreate();
@@ -39070,7 +39070,7 @@ var require_Pool = __commonJS({
39070
39070
  this._startReaping();
39071
39071
  pendingAcquire.resolve(free.resource);
39072
39072
  } else {
39073
- remove2(this.used, free);
39073
+ remove(this.used, free);
39074
39074
  if (!validationSuccess) {
39075
39075
  this._destroy(free.resource);
39076
39076
  setTimeout(() => {
@@ -39084,7 +39084,7 @@ var require_Pool = __commonJS({
39084
39084
  }
39085
39085
  }
39086
39086
  } finally {
39087
- remove2(this.pendingValidations, pendingAcquire);
39087
+ remove(this.pendingValidations, pendingAcquire);
39088
39088
  }
39089
39089
  });
39090
39090
  this._validateResource(free.resource).then((validationSuccess) => {
@@ -39128,7 +39128,7 @@ var require_Pool = __commonJS({
39128
39128
  this._executeEventHandlers("createRequest", eventId);
39129
39129
  const pendingCreate = new PendingOperation_1.PendingOperation(this.createTimeoutMillis);
39130
39130
  pendingCreate.promise = pendingCreate.promise.catch((err) => {
39131
- if (remove2(this.pendingCreates, pendingCreate)) {
39131
+ if (remove(this.pendingCreates, pendingCreate)) {
39132
39132
  this._executeEventHandlers("createFail", eventId, err);
39133
39133
  }
39134
39134
  throw err;
@@ -39139,7 +39139,7 @@ var require_Pool = __commonJS({
39139
39139
  this.destroyer(resource);
39140
39140
  return null;
39141
39141
  }
39142
- remove2(this.pendingCreates, pendingCreate);
39142
+ remove(this.pendingCreates, pendingCreate);
39143
39143
  this.free.push(new Resource_1.Resource(resource));
39144
39144
  pendingCreate.resolve(resource);
39145
39145
  this._executeEventHandlers("createSuccess", eventId, resource);
@@ -39148,7 +39148,7 @@ var require_Pool = __commonJS({
39148
39148
  if (pendingCreate.isRejected) {
39149
39149
  return null;
39150
39150
  }
39151
- if (remove2(this.pendingCreates, pendingCreate)) {
39151
+ if (remove(this.pendingCreates, pendingCreate)) {
39152
39152
  this._executeEventHandlers("createFail", eventId, err);
39153
39153
  }
39154
39154
  pendingCreate.reject(err);
@@ -39205,7 +39205,7 @@ var require_Pool = __commonJS({
39205
39205
  }
39206
39206
  };
39207
39207
  exports2.Pool = Pool;
39208
- function remove2(arr, item) {
39208
+ function remove(arr, item) {
39209
39209
  const idx = arr.indexOf(item);
39210
39210
  if (idx === -1) {
39211
39211
  return false;
@@ -39654,7 +39654,7 @@ var require_table2 = __commonJS({
39654
39654
  let cursor = -1;
39655
39655
  let buffer = "";
39656
39656
  let escaped = false;
39657
- const path5 = [];
39657
+ const path4 = [];
39658
39658
  while (++cursor < length) {
39659
39659
  const char = name.charAt(cursor);
39660
39660
  if (char === "[") {
@@ -39673,7 +39673,7 @@ var require_table2 = __commonJS({
39673
39673
  if (escaped) {
39674
39674
  buffer += char;
39675
39675
  } else {
39676
- path5.push(buffer);
39676
+ path4.push(buffer);
39677
39677
  buffer = "";
39678
39678
  }
39679
39679
  } else {
@@ -39681,26 +39681,26 @@ var require_table2 = __commonJS({
39681
39681
  }
39682
39682
  }
39683
39683
  if (buffer) {
39684
- path5.push(buffer);
39684
+ path4.push(buffer);
39685
39685
  }
39686
- switch (path5.length) {
39686
+ switch (path4.length) {
39687
39687
  case 1:
39688
39688
  return {
39689
- name: path5[0],
39689
+ name: path4[0],
39690
39690
  schema: null,
39691
39691
  database: null
39692
39692
  };
39693
39693
  case 2:
39694
39694
  return {
39695
- name: path5[1],
39696
- schema: path5[0],
39695
+ name: path4[1],
39696
+ schema: path4[0],
39697
39697
  database: null
39698
39698
  };
39699
39699
  case 3:
39700
39700
  return {
39701
- name: path5[2],
39702
- schema: path5[1],
39703
- database: path5[0]
39701
+ name: path4[2],
39702
+ schema: path4[1],
39703
+ database: path4[0]
39704
39704
  };
39705
39705
  default:
39706
39706
  throw new Error("Invalid table name.");
@@ -43384,13 +43384,13 @@ function __disposeResources(env2) {
43384
43384
  }
43385
43385
  return next();
43386
43386
  }
43387
- function __rewriteRelativeImportExtension(path5, preserveJsx) {
43388
- if (typeof path5 === "string" && /^\.\.?\//.test(path5)) {
43389
- return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) {
43387
+ function __rewriteRelativeImportExtension(path4, preserveJsx) {
43388
+ if (typeof path4 === "string" && /^\.\.?\//.test(path4)) {
43389
+ return path4.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) {
43390
43390
  return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext2 || !cm) ? m : d + ext2 + "." + cm.toLowerCase() + "js";
43391
43391
  });
43392
43392
  }
43393
- return path5;
43393
+ return path4;
43394
43394
  }
43395
43395
  var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
43396
43396
  var init_tslib_es6 = __esm({
@@ -43538,8 +43538,8 @@ var require_msalPlugins = __commonJS({
43538
43538
  }
43539
43539
  };
43540
43540
  exports2.msalNodeFlowVSCodeCredentialControl = {
43541
- setVSCodeAuthRecordPath(path5) {
43542
- exports2.vsCodeAuthRecordPath = path5;
43541
+ setVSCodeAuthRecordPath(path4) {
43542
+ exports2.vsCodeAuthRecordPath = path4;
43543
43543
  },
43544
43544
  setVSCodeBroker(broker) {
43545
43545
  exports2.vsCodeBrokerInfo = {
@@ -44463,16 +44463,16 @@ var require_chainedTokenCredential = __commonJS({
44463
44463
  // node_modules/uuid/dist/esm-node/rng.js
44464
44464
  function rng() {
44465
44465
  if (poolPtr > rnds8Pool.length - 16) {
44466
- import_crypto4.default.randomFillSync(rnds8Pool);
44466
+ import_crypto5.default.randomFillSync(rnds8Pool);
44467
44467
  poolPtr = 0;
44468
44468
  }
44469
44469
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
44470
44470
  }
44471
- var import_crypto4, rnds8Pool, poolPtr;
44471
+ var import_crypto5, rnds8Pool, poolPtr;
44472
44472
  var init_rng = __esm({
44473
44473
  "node_modules/uuid/dist/esm-node/rng.js"() {
44474
44474
  "use strict";
44475
- import_crypto4 = __toESM(require("crypto"));
44475
+ import_crypto5 = __toESM(require("crypto"));
44476
44476
  rnds8Pool = new Uint8Array(256);
44477
44477
  poolPtr = rnds8Pool.length;
44478
44478
  }
@@ -44677,13 +44677,13 @@ function md5(bytes) {
44677
44677
  } else if (typeof bytes === "string") {
44678
44678
  bytes = Buffer.from(bytes, "utf8");
44679
44679
  }
44680
- return import_crypto5.default.createHash("md5").update(bytes).digest();
44680
+ return import_crypto6.default.createHash("md5").update(bytes).digest();
44681
44681
  }
44682
- var import_crypto5, md5_default;
44682
+ var import_crypto6, md5_default;
44683
44683
  var init_md5 = __esm({
44684
44684
  "node_modules/uuid/dist/esm-node/md5.js"() {
44685
44685
  "use strict";
44686
- import_crypto5 = __toESM(require("crypto"));
44686
+ import_crypto6 = __toESM(require("crypto"));
44687
44687
  md5_default = md5;
44688
44688
  }
44689
44689
  });
@@ -44732,13 +44732,13 @@ function sha1(bytes) {
44732
44732
  } else if (typeof bytes === "string") {
44733
44733
  bytes = Buffer.from(bytes, "utf8");
44734
44734
  }
44735
- return import_crypto6.default.createHash("sha1").update(bytes).digest();
44735
+ return import_crypto7.default.createHash("sha1").update(bytes).digest();
44736
44736
  }
44737
- var import_crypto6, sha1_default;
44737
+ var import_crypto7, sha1_default;
44738
44738
  var init_sha1 = __esm({
44739
44739
  "node_modules/uuid/dist/esm-node/sha1.js"() {
44740
44740
  "use strict";
44741
- import_crypto6 = __toESM(require("crypto"));
44741
+ import_crypto7 = __toESM(require("crypto"));
44742
44742
  sha1_default = sha1;
44743
44743
  }
44744
44744
  });
@@ -45694,12 +45694,12 @@ var require_index_node_C6O_wJLi = __commonJS({
45694
45694
  static queryStringToObject(query) {
45695
45695
  const obj = {};
45696
45696
  const params = query.split("&");
45697
- const decode = (s) => decodeURIComponent(s.replace(/\+/g, " "));
45697
+ const decode2 = (s) => decodeURIComponent(s.replace(/\+/g, " "));
45698
45698
  params.forEach((pair) => {
45699
45699
  if (pair.trim()) {
45700
45700
  const [key, value] = pair.split(/=(.+)/g, 2);
45701
45701
  if (key && value) {
45702
- obj[decode(key)] = decode(value);
45702
+ obj[decode2(key)] = decode2(value);
45703
45703
  }
45704
45704
  }
45705
45705
  });
@@ -52395,8 +52395,8 @@ var require_msal_node = __commonJS({
52395
52395
  var crypto5 = require("crypto");
52396
52396
  var msalCommon = require_lib6();
52397
52397
  var jwt2 = require_jsonwebtoken();
52398
- var fs17 = require("fs");
52399
- var path5 = require("path");
52398
+ var fs20 = require("fs");
52399
+ var path4 = require("path");
52400
52400
  var Serializer = class {
52401
52401
  /**
52402
52402
  * serialize the JSON blob
@@ -53546,12 +53546,12 @@ var require_msal_node = __commonJS({
53546
53546
  static queryStringToObject(query) {
53547
53547
  const obj = {};
53548
53548
  const params = query.split("&");
53549
- const decode = (s) => decodeURIComponent(s.replace(/\+/g, " "));
53549
+ const decode2 = (s) => decodeURIComponent(s.replace(/\+/g, " "));
53550
53550
  params.forEach((pair) => {
53551
53551
  if (pair.trim()) {
53552
53552
  const [key, value] = pair.split(/=(.+)/g, 2);
53553
53553
  if (key && value) {
53554
- obj[decode(key)] = decode(value);
53554
+ obj[decode2(key)] = decode2(value);
53555
53555
  }
53556
53556
  }
53557
53557
  });
@@ -62094,7 +62094,7 @@ Headers: ${JSON.stringify(headers)}`
62094
62094
  if (!identityEndpoint || !imdsEndpoint) {
62095
62095
  const fileDetectionPath = AZURE_ARC_FILE_DETECTION[process.platform];
62096
62096
  try {
62097
- fs17.accessSync(fileDetectionPath, fs17.constants.F_OK | fs17.constants.R_OK);
62097
+ fs20.accessSync(fileDetectionPath, fs20.constants.F_OK | fs20.constants.R_OK);
62098
62098
  identityEndpoint = DEFAULT_AZURE_ARC_IDENTITY_ENDPOINT;
62099
62099
  imdsEndpoint = HIMDS_EXECUTABLE_HELPER_STRING;
62100
62100
  } catch (err) {
@@ -62197,7 +62197,7 @@ Headers: ${JSON.stringify(headers)}`
62197
62197
  throw createManagedIdentityError(platformNotSupported);
62198
62198
  }
62199
62199
  const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
62200
- const fileName = path5.basename(secretFilePath);
62200
+ const fileName = path4.basename(secretFilePath);
62201
62201
  if (!fileName.endsWith(".key")) {
62202
62202
  throw createManagedIdentityError(invalidFileExtension);
62203
62203
  }
@@ -62206,7 +62206,7 @@ Headers: ${JSON.stringify(headers)}`
62206
62206
  }
62207
62207
  let secretFileSize;
62208
62208
  try {
62209
- secretFileSize = await fs17.statSync(secretFilePath).size;
62209
+ secretFileSize = await fs20.statSync(secretFilePath).size;
62210
62210
  } catch (e) {
62211
62211
  throw createManagedIdentityError(unableToReadSecretFile);
62212
62212
  }
@@ -62215,7 +62215,7 @@ Headers: ${JSON.stringify(headers)}`
62215
62215
  }
62216
62216
  let secret;
62217
62217
  try {
62218
- secret = fs17.readFileSync(secretFilePath, EncodingTypes.UTF8);
62218
+ secret = fs20.readFileSync(secretFilePath, EncodingTypes.UTF8);
62219
62219
  } catch (e) {
62220
62220
  throw createManagedIdentityError(unableToReadSecretFile);
62221
62221
  }
@@ -62979,8 +62979,8 @@ var require_uuidUtils = __commonJS({
62979
62979
  "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/uuidUtils.js"(exports2) {
62980
62980
  "use strict";
62981
62981
  Object.defineProperty(exports2, "__esModule", { value: true });
62982
- exports2.randomUUID = randomUUID2;
62983
- function randomUUID2() {
62982
+ exports2.randomUUID = randomUUID3;
62983
+ function randomUUID3() {
62984
62984
  return crypto.randomUUID();
62985
62985
  }
62986
62986
  }
@@ -63421,7 +63421,7 @@ var require_commonjs4 = __commonJS({
63421
63421
  exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
63422
63422
  exports2.isError = isError;
63423
63423
  exports2.isObject = isObject;
63424
- exports2.randomUUID = randomUUID2;
63424
+ exports2.randomUUID = randomUUID3;
63425
63425
  exports2.uint8ArrayToString = uint8ArrayToString;
63426
63426
  exports2.stringToUint8Array = stringToUint8Array;
63427
63427
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
@@ -63470,7 +63470,7 @@ var require_commonjs4 = __commonJS({
63470
63470
  function isObject(input) {
63471
63471
  return tspRuntime.isObject(input);
63472
63472
  }
63473
- function randomUUID2() {
63473
+ function randomUUID3() {
63474
63474
  return tspRuntime.randomUUID();
63475
63475
  }
63476
63476
  exports2.isBrowser = tspRuntime.isBrowser;
@@ -63513,7 +63513,7 @@ var require_utils7 = __commonJS({
63513
63513
  exports2.getAuthority = getAuthority;
63514
63514
  exports2.getKnownAuthorities = getKnownAuthorities;
63515
63515
  exports2.getMSALLogLevel = getMSALLogLevel;
63516
- exports2.randomUUID = randomUUID2;
63516
+ exports2.randomUUID = randomUUID3;
63517
63517
  exports2.handleMsalError = handleMsalError;
63518
63518
  exports2.publicToMsal = publicToMsal;
63519
63519
  exports2.msalToPublic = msalToPublic;
@@ -63572,22 +63572,22 @@ var require_utils7 = __commonJS({
63572
63572
  }
63573
63573
  return [];
63574
63574
  }
63575
- var defaultLoggerCallback = (credLogger, platform3 = core_util_1.isNode ? "Node" : "Browser") => (level, message, containsPii) => {
63575
+ var defaultLoggerCallback = (credLogger, platform4 = core_util_1.isNode ? "Node" : "Browser") => (level, message, containsPii) => {
63576
63576
  if (containsPii) {
63577
63577
  return;
63578
63578
  }
63579
63579
  switch (level) {
63580
63580
  case msal_js_1.msalCommon.LogLevel.Error:
63581
- credLogger.info(`MSAL ${platform3} V2 error: ${message}`);
63581
+ credLogger.info(`MSAL ${platform4} V2 error: ${message}`);
63582
63582
  return;
63583
63583
  case msal_js_1.msalCommon.LogLevel.Info:
63584
- credLogger.info(`MSAL ${platform3} V2 info message: ${message}`);
63584
+ credLogger.info(`MSAL ${platform4} V2 info message: ${message}`);
63585
63585
  return;
63586
63586
  case msal_js_1.msalCommon.LogLevel.Verbose:
63587
- credLogger.info(`MSAL ${platform3} V2 verbose message: ${message}`);
63587
+ credLogger.info(`MSAL ${platform4} V2 verbose message: ${message}`);
63588
63588
  return;
63589
63589
  case msal_js_1.msalCommon.LogLevel.Warning:
63590
- credLogger.info(`MSAL ${platform3} V2 warning: ${message}`);
63590
+ credLogger.info(`MSAL ${platform4} V2 warning: ${message}`);
63591
63591
  return;
63592
63592
  }
63593
63593
  };
@@ -63606,7 +63606,7 @@ var require_utils7 = __commonJS({
63606
63606
  return msal_js_1.msalCommon.LogLevel.Info;
63607
63607
  }
63608
63608
  }
63609
- function randomUUID2() {
63609
+ function randomUUID3() {
63610
63610
  return (0, core_util_1.randomUUID)();
63611
63611
  }
63612
63612
  function handleMsalError(scopes, error, getTokenOptions) {
@@ -66410,8 +66410,8 @@ var require_dist3 = __commonJS({
66410
66410
  setRequestProps(req, opts) {
66411
66411
  const { proxy } = this;
66412
66412
  const protocol = opts.secureEndpoint ? "https:" : "http:";
66413
- const hostname = req.getHeader("host") || "localhost";
66414
- const base = `${protocol}//${hostname}`;
66413
+ const hostname2 = req.getHeader("host") || "localhost";
66414
+ const base = `${protocol}//${hostname2}`;
66415
66415
  const url = new url_1.URL(req.path, base);
66416
66416
  if (opts.port !== 80) {
66417
66417
  url.port = String(opts.port);
@@ -67559,8 +67559,8 @@ var require_getClient = __commonJS({
67559
67559
  }
67560
67560
  const { allowInsecureConnection, httpClient } = clientOptions;
67561
67561
  const endpointUrl = clientOptions.endpoint ?? endpoint;
67562
- const client = (path5, ...args) => {
67563
- const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path5, args, { allowInsecureConnection, ...requestOptions });
67562
+ const client = (path4, ...args) => {
67563
+ const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path4, args, { allowInsecureConnection, ...requestOptions });
67564
67564
  return {
67565
67565
  get: (requestOptions = {}) => {
67566
67566
  return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient);
@@ -69742,15 +69742,15 @@ var require_urlHelpers2 = __commonJS({
69742
69742
  let isAbsolutePath = false;
69743
69743
  let requestUrl = replaceAll(baseUri, urlReplacements);
69744
69744
  if (operationSpec.path) {
69745
- let path5 = replaceAll(operationSpec.path, urlReplacements);
69746
- if (operationSpec.path === "/{nextLink}" && path5.startsWith("/")) {
69747
- path5 = path5.substring(1);
69745
+ let path4 = replaceAll(operationSpec.path, urlReplacements);
69746
+ if (operationSpec.path === "/{nextLink}" && path4.startsWith("/")) {
69747
+ path4 = path4.substring(1);
69748
69748
  }
69749
- if (isAbsoluteUrl(path5)) {
69750
- requestUrl = path5;
69749
+ if (isAbsoluteUrl(path4)) {
69750
+ requestUrl = path4;
69751
69751
  isAbsolutePath = true;
69752
69752
  } else {
69753
- requestUrl = appendPath(requestUrl, path5);
69753
+ requestUrl = appendPath(requestUrl, path4);
69754
69754
  }
69755
69755
  }
69756
69756
  const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
@@ -69796,9 +69796,9 @@ var require_urlHelpers2 = __commonJS({
69796
69796
  }
69797
69797
  const searchStart = pathToAppend.indexOf("?");
69798
69798
  if (searchStart !== -1) {
69799
- const path5 = pathToAppend.substring(0, searchStart);
69799
+ const path4 = pathToAppend.substring(0, searchStart);
69800
69800
  const search = pathToAppend.substring(searchStart + 1);
69801
- newPath = newPath + path5;
69801
+ newPath = newPath + path4;
69802
69802
  if (search) {
69803
69803
  parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
69804
69804
  }
@@ -71098,22 +71098,22 @@ function detectArchBinary(binary) {
71098
71098
  if (typeof binary === "string" || Array.isArray(binary)) {
71099
71099
  return binary;
71100
71100
  }
71101
- const { [arch]: archBinary } = binary;
71101
+ const { [arch2]: archBinary } = binary;
71102
71102
  if (!archBinary) {
71103
- throw new Error(`${arch} is not supported`);
71103
+ throw new Error(`${arch2} is not supported`);
71104
71104
  }
71105
71105
  return archBinary;
71106
71106
  }
71107
- function detectPlatformBinary({ [platform2]: platformBinary }, { wsl }) {
71107
+ function detectPlatformBinary({ [platform3]: platformBinary }, { wsl }) {
71108
71108
  if (wsl && is_wsl_default) {
71109
71109
  return detectArchBinary(wsl);
71110
71110
  }
71111
71111
  if (!platformBinary) {
71112
- throw new Error(`${platform2} is not supported`);
71112
+ throw new Error(`${platform3} is not supported`);
71113
71113
  }
71114
71114
  return detectArchBinary(platformBinary);
71115
71115
  }
71116
- var import_node_process14, import_node_buffer, import_node_path3, import_node_url3, import_node_util5, import_node_child_process5, import_promises3, import_meta, execFile5, __dirname2, localXdgOpenPath, platform2, arch, pTryEach, baseOpen, open, openApp, apps, open_default;
71116
+ var import_node_process14, import_node_buffer, import_node_path3, import_node_url3, import_node_util5, import_node_child_process5, import_promises3, import_meta, execFile5, __dirname2, localXdgOpenPath, platform3, arch2, pTryEach, baseOpen, open, openApp, apps, open_default;
71117
71117
  var init_open = __esm({
71118
71118
  "node_modules/open/index.js"() {
71119
71119
  "use strict";
@@ -71132,7 +71132,7 @@ var init_open = __esm({
71132
71132
  execFile5 = (0, import_node_util5.promisify)(import_node_child_process5.default.execFile);
71133
71133
  __dirname2 = import_node_path3.default.dirname((0, import_node_url3.fileURLToPath)(import_meta.url));
71134
71134
  localXdgOpenPath = import_node_path3.default.join(__dirname2, "xdg-open");
71135
- ({ platform: platform2, arch } = import_node_process14.default);
71135
+ ({ platform: platform3, arch: arch2 } = import_node_process14.default);
71136
71136
  pTryEach = async (array, mapper) => {
71137
71137
  let latestError;
71138
71138
  for (const item of array) {
@@ -71206,7 +71206,7 @@ var init_open = __esm({
71206
71206
  let command;
71207
71207
  const cliArguments = [];
71208
71208
  const childProcessOptions = {};
71209
- if (platform2 === "darwin") {
71209
+ if (platform3 === "darwin") {
71210
71210
  command = "open";
71211
71211
  if (options.wait) {
71212
71212
  cliArguments.push("--wait-apps");
@@ -71220,7 +71220,7 @@ var init_open = __esm({
71220
71220
  if (app) {
71221
71221
  cliArguments.push("-a", app);
71222
71222
  }
71223
- } else if (platform2 === "win32" || is_wsl_default && !isInsideContainer() && !app) {
71223
+ } else if (platform3 === "win32" || is_wsl_default && !isInsideContainer() && !app) {
71224
71224
  command = await powerShellPath();
71225
71225
  cliArguments.push(
71226
71226
  "-NoProfile",
@@ -71260,7 +71260,7 @@ var init_open = __esm({
71260
71260
  exeLocalXdgOpen = true;
71261
71261
  } catch {
71262
71262
  }
71263
- const useSystemXdgOpen = import_node_process14.default.versions.electron ?? (platform2 === "android" || isBundled || !exeLocalXdgOpen);
71263
+ const useSystemXdgOpen = import_node_process14.default.versions.electron ?? (platform3 === "android" || isBundled || !exeLocalXdgOpen);
71264
71264
  command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
71265
71265
  }
71266
71266
  if (appArguments.length > 0) {
@@ -71271,7 +71271,7 @@ var init_open = __esm({
71271
71271
  childProcessOptions.detached = true;
71272
71272
  }
71273
71273
  }
71274
- if (platform2 === "darwin" && appArguments.length > 0) {
71274
+ if (platform3 === "darwin" && appArguments.length > 0) {
71275
71275
  cliArguments.push("--args", ...appArguments);
71276
71276
  }
71277
71277
  if (options.target) {
@@ -78307,7 +78307,7 @@ var require_abort_controller = __commonJS({
78307
78307
  }
78308
78308
  };
78309
78309
  eventTargetShim.defineEventAttribute(AbortSignal2.prototype, "abort");
78310
- function createAbortSignal() {
78310
+ function createAbortSignal2() {
78311
78311
  const signal = Object.create(AbortSignal2.prototype);
78312
78312
  eventTargetShim.EventTarget.call(signal);
78313
78313
  abortedFlags.set(signal, false);
@@ -78335,7 +78335,7 @@ var require_abort_controller = __commonJS({
78335
78335
  * Initialize this controller.
78336
78336
  */
78337
78337
  constructor() {
78338
- signals2.set(this, createAbortSignal());
78338
+ signals2.set(this, createAbortSignal2());
78339
78339
  }
78340
78340
  /**
78341
78341
  * Returns the `AbortSignal` object associated with this object.
@@ -83981,7 +83981,7 @@ var require_message_io = __commonJS({
83981
83981
  return this.outgoingMessageStream.packetSize;
83982
83982
  }
83983
83983
  // Negotiate TLS encryption.
83984
- startTls(credentialsDetails, hostname, trustServerCertificate) {
83984
+ startTls(credentialsDetails, hostname2, trustServerCertificate) {
83985
83985
  if (!credentialsDetails.maxVersion || !["TLSv1.2", "TLSv1.1", "TLSv1"].includes(credentialsDetails.maxVersion)) {
83986
83986
  credentialsDetails.maxVersion = "TLSv1.2";
83987
83987
  }
@@ -83991,7 +83991,7 @@ var require_message_io = __commonJS({
83991
83991
  const securePair = this.securePair = {
83992
83992
  cleartext: tls.connect({
83993
83993
  socket: duplexpair.socket1,
83994
- servername: hostname,
83994
+ servername: hostname2,
83995
83995
  secureContext,
83996
83996
  rejectUnauthorized: !trustServerCertificate
83997
83997
  }),
@@ -87253,7 +87253,7 @@ var init_js_joda_esm = __esm({
87253
87253
  this._map = map8;
87254
87254
  return this;
87255
87255
  };
87256
- _proto.remove = function remove2(key) {
87256
+ _proto.remove = function remove(key) {
87257
87257
  var keyName = key.name();
87258
87258
  var val = this._map[keyName];
87259
87259
  this._map[keyName] = void 0;
@@ -99457,7 +99457,7 @@ var require_lib7 = __commonJS({
99457
99457
  var trail = encoder.end();
99458
99458
  return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
99459
99459
  };
99460
- iconv2.decode = function decode(buf, encoding, options) {
99460
+ iconv2.decode = function decode2(buf, encoding, options) {
99461
99461
  if (typeof buf === "string") {
99462
99462
  if (!iconv2.skipDecodeWarning) {
99463
99463
  console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
@@ -112208,14 +112208,14 @@ var import_fs_extra = __toESM(require_lib());
112208
112208
  function getVsCodeSettingsPaths() {
112209
112209
  const paths = [];
112210
112210
  const home = (0, import_os.homedir)();
112211
- const os5 = (0, import_os.platform)();
112212
- if (os5 === "win32") {
112211
+ const os4 = (0, import_os.platform)();
112212
+ if (os4 === "win32") {
112213
112213
  const appdata = process.env.APPDATA || (0, import_path.join)(home, "AppData", "Roaming");
112214
112214
  paths.push(
112215
112215
  { path: (0, import_path.join)(appdata, "Code", "User", "settings.json"), variant: "Code" },
112216
112216
  { path: (0, import_path.join)(appdata, "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
112217
112217
  );
112218
- } else if (os5 === "darwin") {
112218
+ } else if (os4 === "darwin") {
112219
112219
  paths.push(
112220
112220
  { path: (0, import_path.join)(home, "Library", "Application Support", "Code", "User", "settings.json"), variant: "Code" },
112221
112221
  { path: (0, import_path.join)(home, "Library", "Application Support", "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
@@ -112787,8 +112787,8 @@ async function installCommands(options = {}) {
112787
112787
  version: getPackageVersion(),
112788
112788
  installedAt: now,
112789
112789
  updatedAt: now,
112790
- files: result.installedFiles.map((path5) => ({
112791
- path: path5,
112790
+ files: result.installedFiles.map((path4) => ({
112791
+ path: path4,
112792
112792
  installedAt: now
112793
112793
  }))
112794
112794
  };
@@ -115625,9 +115625,9 @@ var fetchAsyncQuestionProperty = function(question, prop, answers) {
115625
115625
 
115626
115626
  // node_modules/inquirer/lib/ui/prompt.js
115627
115627
  var _ = {
115628
- set: (obj, path5 = "", value) => {
115628
+ set: (obj, path4 = "", value) => {
115629
115629
  let pointer = obj;
115630
- path5.split(".").forEach((key, index, arr) => {
115630
+ path4.split(".").forEach((key, index, arr) => {
115631
115631
  if (key === "__proto__" || key === "constructor") return;
115632
115632
  if (index === arr.length - 1) {
115633
115633
  pointer[key] = value;
@@ -115637,8 +115637,8 @@ var _ = {
115637
115637
  pointer = pointer[key];
115638
115638
  });
115639
115639
  },
115640
- get: (obj, path5 = "", defaultValue) => {
115641
- const travel = (regexp) => String.prototype.split.call(path5, regexp).filter(Boolean).reduce(
115640
+ get: (obj, path4 = "", defaultValue) => {
115641
+ const travel = (regexp) => String.prototype.split.call(path4, regexp).filter(Boolean).reduce(
115642
115642
  // @ts-expect-error implicit any on res[key]
115643
115643
  (res, key) => res !== null && res !== void 0 ? res[key] : res,
115644
115644
  obj
@@ -116825,12 +116825,12 @@ EndGlobal
116825
116825
  appSettingsContent = appSettingsContent.replace(/\{\{ProjectName\}\}/g, projectName).replace(/\{\{ProjectDomain\}\}/g, `${projectName.toLowerCase()}.app`).replace(/\{\{ProjectNameLower\}\}/g, projectName.toLowerCase()).replace(/\{\{JwtSecret\}\}/g, jwtSecret);
116826
116826
  const appSettings = JSON.parse(appSettingsContent);
116827
116827
  appSettings.MultiTenant = {
116828
- Enabled: config.multiTenant.enabled,
116829
- EnableB2B: config.multiTenant.enableB2B,
116830
- EnableB2C: config.multiTenant.enableB2C,
116831
- SystemTenantSlug: config.multiTenant.systemTenantSlug,
116832
- SystemTenantName: config.multiTenant.systemTenantName,
116833
- AutoAssignUsersToSystemTenant: config.multiTenant.autoAssignUsersToSystemTenant
116828
+ Enabled: true,
116829
+ EnableB2B: true,
116830
+ EnableB2C: true,
116831
+ SystemTenantSlug: "default",
116832
+ SystemTenantName: "Default Workspace",
116833
+ AutoAssignUsersToSystemTenant: true
116834
116834
  };
116835
116835
  appSettings.Email.Provider = config.email.provider;
116836
116836
  if (config.email.provider === "Disabled") {
@@ -117601,7 +117601,7 @@ async function initializeGit(config, dryRun) {
117601
117601
  execCommand('git commit -m "chore: initial SmartStack project setup"', projectDir, dryRun);
117602
117602
  }
117603
117603
  }
117604
- var initCommand = new Command("init").description("Initialize a new SmartStack project").argument("[name]", "Project name (optional, uses current folder if not provided)").option("--dry-run", "Show what would be created without actually creating").option("-y, --yes", "Skip prompts and use defaults").option("--skip-mcp-check", "Skip MCP servers verification").option("--multi-tenant", "Enable multi-tenant mode").option("--b2b", "Enable B2B (organisation management)").option("--b2c", "Enable B2C (user tenant management)").option("--preview", "Use preview/prerelease versions (NuGet --prerelease + npm @next)").option("--here", "Initialize in current directory (use folder name as project name)").action(async (name, options) => {
117604
+ var initCommand = new Command("init").description("Initialize a new SmartStack project").argument("[name]", "Project name (optional, uses current folder if not provided)").option("--dry-run", "Show what would be created without actually creating").option("-y, --yes", "Skip prompts and use defaults").option("--skip-mcp-check", "Skip MCP servers verification").option("--preview", "Use preview/prerelease versions (NuGet --prerelease + npm @next)").option("--here", "Initialize in current directory (use folder name as project name)").action(async (name, options) => {
117605
117605
  logger.header("SmartStack Project Initialization");
117606
117606
  if (!options.skipMcpCheck) {
117607
117607
  logger.info("Checking MCP servers...");
@@ -117839,56 +117839,12 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
117839
117839
  database: "sqlserver",
117840
117840
  preview: options.preview ?? false,
117841
117841
  projectDir: finalProjectDir,
117842
- multiTenant: {
117843
- enabled: options.multiTenant ?? true,
117844
- enableB2B: options.b2b ?? true,
117845
- enableB2C: options.b2c ?? true,
117846
- systemTenantSlug: "default",
117847
- systemTenantName: "Default Workspace",
117848
- autoAssignUsersToSystemTenant: true
117849
- },
117850
117842
  email: {
117851
117843
  provider: "Development",
117852
117844
  setupMailPit: false
117853
117845
  }
117854
117846
  };
117855
117847
  } else {
117856
- const answers = await lib_default.prompt([
117857
- {
117858
- type: "confirm",
117859
- name: "multiTenantEnabled",
117860
- message: "Enable multi-tenant mode?",
117861
- default: true
117862
- },
117863
- {
117864
- type: "confirm",
117865
- name: "enableB2B",
117866
- message: "Enable B2B (organisation management)?",
117867
- default: true,
117868
- when: (answers2) => answers2.multiTenantEnabled
117869
- },
117870
- {
117871
- type: "confirm",
117872
- name: "enableB2C",
117873
- message: "Enable B2C (user tenant management)?",
117874
- default: true,
117875
- when: (answers2) => answers2.multiTenantEnabled
117876
- },
117877
- {
117878
- type: "input",
117879
- name: "systemTenantSlug",
117880
- message: "System tenant slug:",
117881
- default: "default",
117882
- when: (answers2) => answers2.multiTenantEnabled
117883
- },
117884
- {
117885
- type: "input",
117886
- name: "systemTenantName",
117887
- message: "System tenant name:",
117888
- default: "Default Workspace",
117889
- when: (answers2) => answers2.multiTenantEnabled
117890
- }
117891
- ]);
117892
117848
  const emailAnswers = await lib_default.prompt([
117893
117849
  {
117894
117850
  type: "list",
@@ -117916,14 +117872,6 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
117916
117872
  database: "sqlserver",
117917
117873
  preview: options.preview ?? false,
117918
117874
  projectDir: finalProjectDir,
117919
- multiTenant: {
117920
- enabled: answers.multiTenantEnabled ?? true,
117921
- enableB2B: answers.enableB2B ?? true,
117922
- enableB2C: answers.enableB2C ?? true,
117923
- systemTenantSlug: answers.systemTenantSlug || "default",
117924
- systemTenantName: answers.systemTenantName || "Default Workspace",
117925
- autoAssignUsersToSystemTenant: true
117926
- },
117927
117875
  email: {
117928
117876
  provider: emailAnswers.emailProvider || "Development",
117929
117877
  setupMailPit: emailAnswers.setupMailPit ?? false
@@ -117938,12 +117886,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
117938
117886
  logger.info(`Project: ${source_default.cyan(config.name)}`);
117939
117887
  logger.info(`Database: ${source_default.cyan("SQL Server")}`);
117940
117888
  logger.info(`Preview mode: ${config.preview ? source_default.yellow("Enabled (prerelease)") : source_default.gray("Disabled (stable)")}`);
117941
- logger.info(`Multi-Tenant: ${config.multiTenant.enabled ? source_default.green("Enabled") : source_default.gray("Disabled")}`);
117942
- if (config.multiTenant.enabled) {
117943
- logger.info(` B2B (Organisations): ${config.multiTenant.enableB2B ? source_default.green("Enabled") : source_default.gray("Disabled")}`);
117944
- logger.info(` B2C (User Tenants): ${config.multiTenant.enableB2C ? source_default.green("Enabled") : source_default.gray("Disabled")}`);
117945
- logger.info(` System Tenant: ${source_default.cyan(config.multiTenant.systemTenantSlug)} (${config.multiTenant.systemTenantName})`);
117946
- }
117889
+ logger.info(`Multi-Tenant: ${source_default.green("Enabled")} (personal tenant)`);
117947
117890
  const emailLabel = config.email.provider === "Development" ? `${source_default.green("Development")} (MailPit - SMTP :1025, Web :8025)` : config.email.provider === "Disabled" ? source_default.gray("Disabled") : source_default.cyan(config.email.provider);
117948
117891
  logger.info(`Email: ${emailLabel}`);
117949
117892
  console.log();
@@ -122248,12 +122191,12 @@ var PathBase = class {
122248
122191
  /**
122249
122192
  * Get the Path object referenced by the string path, resolved from this Path
122250
122193
  */
122251
- resolve(path5) {
122252
- if (!path5) {
122194
+ resolve(path4) {
122195
+ if (!path4) {
122253
122196
  return this;
122254
122197
  }
122255
- const rootPath = this.getRootString(path5);
122256
- const dir = path5.substring(rootPath.length);
122198
+ const rootPath = this.getRootString(path4);
122199
+ const dir = path4.substring(rootPath.length);
122257
122200
  const dirParts = dir.split(this.splitSep);
122258
122201
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
122259
122202
  return result;
@@ -123005,8 +122948,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
123005
122948
  /**
123006
122949
  * @internal
123007
122950
  */
123008
- getRootString(path5) {
123009
- return import_node_path2.win32.parse(path5).root;
122951
+ getRootString(path4) {
122952
+ return import_node_path2.win32.parse(path4).root;
123010
122953
  }
123011
122954
  /**
123012
122955
  * @internal
@@ -123052,8 +122995,8 @@ var PathPosix = class _PathPosix extends PathBase {
123052
122995
  /**
123053
122996
  * @internal
123054
122997
  */
123055
- getRootString(path5) {
123056
- return path5.startsWith("/") ? "/" : "";
122998
+ getRootString(path4) {
122999
+ return path4.startsWith("/") ? "/" : "";
123057
123000
  }
123058
123001
  /**
123059
123002
  * @internal
@@ -123102,8 +123045,8 @@ var PathScurryBase = class {
123102
123045
  *
123103
123046
  * @internal
123104
123047
  */
123105
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs17 = defaultFS } = {}) {
123106
- this.#fs = fsFromOption(fs17);
123048
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs20 = defaultFS } = {}) {
123049
+ this.#fs = fsFromOption(fs20);
123107
123050
  if (cwd instanceof URL || cwd.startsWith("file://")) {
123108
123051
  cwd = (0, import_node_url.fileURLToPath)(cwd);
123109
123052
  }
@@ -123142,11 +123085,11 @@ var PathScurryBase = class {
123142
123085
  /**
123143
123086
  * Get the depth of a provided path, string, or the cwd
123144
123087
  */
123145
- depth(path5 = this.cwd) {
123146
- if (typeof path5 === "string") {
123147
- path5 = this.cwd.resolve(path5);
123088
+ depth(path4 = this.cwd) {
123089
+ if (typeof path4 === "string") {
123090
+ path4 = this.cwd.resolve(path4);
123148
123091
  }
123149
- return path5.depth();
123092
+ return path4.depth();
123150
123093
  }
123151
123094
  /**
123152
123095
  * Return the cache of child entries. Exposed so subclasses can create
@@ -123633,9 +123576,9 @@ var PathScurryBase = class {
123633
123576
  process17();
123634
123577
  return results;
123635
123578
  }
123636
- chdir(path5 = this.cwd) {
123579
+ chdir(path4 = this.cwd) {
123637
123580
  const oldCwd = this.cwd;
123638
- this.cwd = typeof path5 === "string" ? this.cwd.resolve(path5) : path5;
123581
+ this.cwd = typeof path4 === "string" ? this.cwd.resolve(path4) : path4;
123639
123582
  this.cwd[setAsCwd](oldCwd);
123640
123583
  }
123641
123584
  };
@@ -123661,8 +123604,8 @@ var PathScurryWin32 = class extends PathScurryBase {
123661
123604
  /**
123662
123605
  * @internal
123663
123606
  */
123664
- newRoot(fs17) {
123665
- return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs17 });
123607
+ newRoot(fs20) {
123608
+ return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs20 });
123666
123609
  }
123667
123610
  /**
123668
123611
  * Return true if the provided path string is an absolute path
@@ -123690,8 +123633,8 @@ var PathScurryPosix = class extends PathScurryBase {
123690
123633
  /**
123691
123634
  * @internal
123692
123635
  */
123693
- newRoot(fs17) {
123694
- return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs17 });
123636
+ newRoot(fs20) {
123637
+ return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs20 });
123695
123638
  }
123696
123639
  /**
123697
123640
  * Return true if the provided path string is an absolute path
@@ -123724,7 +123667,7 @@ var Pattern = class _Pattern {
123724
123667
  #isUNC;
123725
123668
  #isAbsolute;
123726
123669
  #followGlobstar = true;
123727
- constructor(patternList, globList, index, platform3) {
123670
+ constructor(patternList, globList, index, platform4) {
123728
123671
  if (!isPatternList(patternList)) {
123729
123672
  throw new TypeError("empty pattern list");
123730
123673
  }
@@ -123741,7 +123684,7 @@ var Pattern = class _Pattern {
123741
123684
  this.#patternList = patternList;
123742
123685
  this.#globList = globList;
123743
123686
  this.#index = index;
123744
- this.#platform = platform3;
123687
+ this.#platform = platform4;
123745
123688
  if (this.#index === 0) {
123746
123689
  if (this.isUNC()) {
123747
123690
  const [p0, p1, p2, p3, ...prest] = this.#patternList;
@@ -123883,12 +123826,12 @@ var Ignore = class {
123883
123826
  absoluteChildren;
123884
123827
  platform;
123885
123828
  mmopts;
123886
- constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform3 = defaultPlatform2 }) {
123829
+ constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform4 = defaultPlatform2 }) {
123887
123830
  this.relative = [];
123888
123831
  this.absolute = [];
123889
123832
  this.relativeChildren = [];
123890
123833
  this.absoluteChildren = [];
123891
- this.platform = platform3;
123834
+ this.platform = platform4;
123892
123835
  this.mmopts = {
123893
123836
  dot: true,
123894
123837
  nobrace,
@@ -123896,7 +123839,7 @@ var Ignore = class {
123896
123839
  noext,
123897
123840
  noglobstar,
123898
123841
  optimizationLevel: 2,
123899
- platform: platform3,
123842
+ platform: platform4,
123900
123843
  nocomment: true,
123901
123844
  nonegate: true
123902
123845
  };
@@ -123991,8 +123934,8 @@ var MatchRecord = class {
123991
123934
  }
123992
123935
  // match, absolute, ifdir
123993
123936
  entries() {
123994
- return [...this.store.entries()].map(([path5, n]) => [
123995
- path5,
123937
+ return [...this.store.entries()].map(([path4, n]) => [
123938
+ path4,
123996
123939
  !!(n & 2),
123997
123940
  !!(n & 1)
123998
123941
  ]);
@@ -124197,9 +124140,9 @@ var GlobUtil = class {
124197
124140
  signal;
124198
124141
  maxDepth;
124199
124142
  includeChildMatches;
124200
- constructor(patterns, path5, opts) {
124143
+ constructor(patterns, path4, opts) {
124201
124144
  this.patterns = patterns;
124202
- this.path = path5;
124145
+ this.path = path4;
124203
124146
  this.opts = opts;
124204
124147
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
124205
124148
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -124218,11 +124161,11 @@ var GlobUtil = class {
124218
124161
  });
124219
124162
  }
124220
124163
  }
124221
- #ignored(path5) {
124222
- return this.seen.has(path5) || !!this.#ignore?.ignored?.(path5);
124164
+ #ignored(path4) {
124165
+ return this.seen.has(path4) || !!this.#ignore?.ignored?.(path4);
124223
124166
  }
124224
- #childrenIgnored(path5) {
124225
- return !!this.#ignore?.childrenIgnored?.(path5);
124167
+ #childrenIgnored(path4) {
124168
+ return !!this.#ignore?.childrenIgnored?.(path4);
124226
124169
  }
124227
124170
  // backpressure mechanism
124228
124171
  pause() {
@@ -124437,8 +124380,8 @@ var GlobUtil = class {
124437
124380
  };
124438
124381
  var GlobWalker = class extends GlobUtil {
124439
124382
  matches = /* @__PURE__ */ new Set();
124440
- constructor(patterns, path5, opts) {
124441
- super(patterns, path5, opts);
124383
+ constructor(patterns, path4, opts) {
124384
+ super(patterns, path4, opts);
124442
124385
  }
124443
124386
  matchEmit(e) {
124444
124387
  this.matches.add(e);
@@ -124475,8 +124418,8 @@ var GlobWalker = class extends GlobUtil {
124475
124418
  };
124476
124419
  var GlobStream = class extends GlobUtil {
124477
124420
  results;
124478
- constructor(patterns, path5, opts) {
124479
- super(patterns, path5, opts);
124421
+ constructor(patterns, path4, opts) {
124422
+ super(patterns, path4, opts);
124480
124423
  this.results = new Minipass({
124481
124424
  signal: this.signal,
124482
124425
  objectMode: true
@@ -124774,15 +124717,15 @@ var import_crypto3 = require("crypto");
124774
124717
  function addMissingKeys(target, template, prefix = "") {
124775
124718
  const added = [];
124776
124719
  for (const key of Object.keys(template)) {
124777
- const path5 = prefix ? `${prefix}.${key}` : key;
124720
+ const path4 = prefix ? `${prefix}.${key}` : key;
124778
124721
  if (!(key in target)) {
124779
124722
  target[key] = template[key];
124780
- added.push(path5);
124723
+ added.push(path4);
124781
124724
  } else if (isPlainObject(target[key]) && isPlainObject(template[key])) {
124782
124725
  const nested = addMissingKeys(
124783
124726
  target[key],
124784
124727
  template[key],
124785
- path5
124728
+ path4
124786
124729
  );
124787
124730
  added.push(...nested);
124788
124731
  }
@@ -125502,10 +125445,378 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
125502
125445
 
125503
125446
  // src/lib/license.ts
125504
125447
  var jwt = __toESM(require_jsonwebtoken());
125505
- var fs8 = __toESM(require_lib());
125506
- var path3 = __toESM(require("path"));
125507
- var os3 = __toESM(require("os"));
125508
- var PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
125448
+ var import_fs_extra11 = __toESM(require_lib());
125449
+
125450
+ // src/lib/license-paths.ts
125451
+ var import_path9 = require("path");
125452
+ var import_os4 = require("os");
125453
+ var SMARTSTACK_DIR2 = ".smartstack";
125454
+ function getSmartStackDir() {
125455
+ return (0, import_path9.join)((0, import_os4.homedir)(), SMARTSTACK_DIR2);
125456
+ }
125457
+ function getLicenseFilePath() {
125458
+ return (0, import_path9.join)(getSmartStackDir(), "license.key");
125459
+ }
125460
+ function getLicenseCachePath() {
125461
+ return (0, import_path9.join)(getSmartStackDir(), "license-cache.json");
125462
+ }
125463
+ function getApiKeyFilePath() {
125464
+ return (0, import_path9.join)(getSmartStackDir(), "api-key");
125465
+ }
125466
+ function getConfigFilePath() {
125467
+ return (0, import_path9.join)(getSmartStackDir(), "config.json");
125468
+ }
125469
+
125470
+ // src/lib/device-id.ts
125471
+ var import_crypto4 = require("crypto");
125472
+ var import_child_process7 = require("child_process");
125473
+ var import_os5 = require("os");
125474
+ var import_path10 = require("path");
125475
+ var import_fs_extra8 = __toESM(require_lib());
125476
+ function getStableMacAddresses() {
125477
+ const interfaces = (0, import_os5.networkInterfaces)();
125478
+ const macs = [];
125479
+ for (const [name, addrs] of Object.entries(interfaces)) {
125480
+ if (!addrs) continue;
125481
+ if (/^(veth|docker|br-|virbr|lo|vEthernet|isatap|Teredo)/i.test(name)) continue;
125482
+ for (const addr of addrs) {
125483
+ if (addr.mac && addr.mac !== "00:00:00:00:00:00" && !addr.internal) {
125484
+ macs.push(addr.mac);
125485
+ }
125486
+ }
125487
+ }
125488
+ return macs.sort();
125489
+ }
125490
+ function getPlatformId() {
125491
+ const os4 = (0, import_os5.platform)();
125492
+ try {
125493
+ if (os4 === "win32") {
125494
+ const output = (0, import_child_process7.execSync)("wmic csproduct get uuid", {
125495
+ encoding: "utf-8",
125496
+ timeout: 5e3,
125497
+ stdio: ["pipe", "pipe", "pipe"]
125498
+ });
125499
+ const uuid = output.split("\n").map((l) => l.trim()).filter((l) => l && l !== "UUID")[0];
125500
+ if (uuid) return uuid;
125501
+ } else if (os4 === "linux") {
125502
+ const machineId = import_fs_extra8.default.readFileSync("/etc/machine-id", "utf-8").trim();
125503
+ if (machineId) return machineId;
125504
+ } else if (os4 === "darwin") {
125505
+ const output = (0, import_child_process7.execSync)(
125506
+ "ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { print $3 }'",
125507
+ { encoding: "utf-8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] }
125508
+ );
125509
+ const uuid = output.trim().replace(/"/g, "");
125510
+ if (uuid) return uuid;
125511
+ }
125512
+ } catch {
125513
+ }
125514
+ return "";
125515
+ }
125516
+ function generateMachineFingerprint() {
125517
+ const cpu = (0, import_os5.cpus)()[0];
125518
+ const components = [
125519
+ (0, import_os5.platform)(),
125520
+ (0, import_os5.arch)(),
125521
+ cpu?.model || "unknown-cpu",
125522
+ String((0, import_os5.totalmem)()),
125523
+ ...getStableMacAddresses(),
125524
+ getPlatformId()
125525
+ ];
125526
+ return (0, import_crypto4.createHash)("sha256").update(components.join("|")).digest("hex");
125527
+ }
125528
+ async function getOrCreateInstanceId() {
125529
+ const deviceFile = (0, import_path10.join)(getSmartStackDir(), "device.json");
125530
+ if (await import_fs_extra8.default.pathExists(deviceFile)) {
125531
+ try {
125532
+ const data = await import_fs_extra8.default.readJSON(deviceFile);
125533
+ if (data?.instanceId) return data.instanceId;
125534
+ } catch {
125535
+ }
125536
+ }
125537
+ const instanceId = (0, import_crypto4.randomUUID)();
125538
+ await import_fs_extra8.default.ensureDir(getSmartStackDir());
125539
+ await import_fs_extra8.default.writeJSON(deviceFile, { instanceId, createdAt: (/* @__PURE__ */ new Date()).toISOString() }, { spaces: 2 });
125540
+ return instanceId;
125541
+ }
125542
+ async function getMachineIdentity() {
125543
+ const [fingerprint, instanceId] = await Promise.all([
125544
+ Promise.resolve(generateMachineFingerprint()),
125545
+ getOrCreateInstanceId()
125546
+ ]);
125547
+ return {
125548
+ fingerprint,
125549
+ machineName: (0, import_os5.hostname)(),
125550
+ instanceId
125551
+ };
125552
+ }
125553
+
125554
+ // src/lib/license-cache.ts
125555
+ var import_fs_extra9 = __toESM(require_lib());
125556
+ function createEmptyCache() {
125557
+ return {
125558
+ version: 1,
125559
+ lastValidation: null,
125560
+ lastHeartbeat: null,
125561
+ lastValidationResult: null,
125562
+ activation: null,
125563
+ signingKey: null
125564
+ };
125565
+ }
125566
+ async function loadCache() {
125567
+ const cachePath = getLicenseCachePath();
125568
+ if (!await import_fs_extra9.default.pathExists(cachePath)) {
125569
+ return createEmptyCache();
125570
+ }
125571
+ try {
125572
+ const data = await import_fs_extra9.default.readJSON(cachePath);
125573
+ if (data?.version === 1) return data;
125574
+ return createEmptyCache();
125575
+ } catch {
125576
+ return createEmptyCache();
125577
+ }
125578
+ }
125579
+ async function saveCache(cache) {
125580
+ await import_fs_extra9.default.ensureDir(getSmartStackDir());
125581
+ await import_fs_extra9.default.writeJSON(getLicenseCachePath(), cache, { spaces: 2 });
125582
+ }
125583
+ async function clearCache() {
125584
+ const cachePath = getLicenseCachePath();
125585
+ if (await import_fs_extra9.default.pathExists(cachePath)) {
125586
+ await import_fs_extra9.default.remove(cachePath);
125587
+ }
125588
+ }
125589
+ function isCacheValid(cache, maxAgeMinutes = 60) {
125590
+ if (!cache.lastValidation || !cache.lastValidationResult) return false;
125591
+ const lastValidation = new Date(cache.lastValidation);
125592
+ const ageMs = Date.now() - lastValidation.getTime();
125593
+ return ageMs < maxAgeMinutes * 60 * 1e3;
125594
+ }
125595
+ function isHeartbeatDue(cache) {
125596
+ if (!cache.activation) return false;
125597
+ if (!cache.lastHeartbeat) return true;
125598
+ const lastHeartbeat = new Date(cache.lastHeartbeat);
125599
+ const intervalMs = (cache.activation.heartbeatIntervalHours || 168) * 60 * 60 * 1e3;
125600
+ return Date.now() - lastHeartbeat.getTime() >= intervalMs;
125601
+ }
125602
+ function isInGracePeriod(expiresAt, gracePeriodDays) {
125603
+ const expiry = new Date(expiresAt);
125604
+ const now = Date.now();
125605
+ const graceEndMs = expiry.getTime() + gracePeriodDays * 24 * 60 * 60 * 1e3;
125606
+ if (now <= expiry.getTime()) {
125607
+ return { inGrace: false, daysLeft: gracePeriodDays };
125608
+ }
125609
+ if (now <= graceEndMs) {
125610
+ const daysLeft = Math.ceil((graceEndMs - now) / (24 * 60 * 60 * 1e3));
125611
+ return { inGrace: true, daysLeft };
125612
+ }
125613
+ return { inGrace: false, daysLeft: 0 };
125614
+ }
125615
+ function isGraceExpired(expiresAt, gracePeriodDays) {
125616
+ const expiry = new Date(expiresAt);
125617
+ const graceEndMs = expiry.getTime() + gracePeriodDays * 24 * 60 * 60 * 1e3;
125618
+ return Date.now() > graceEndMs;
125619
+ }
125620
+ function isSigningKeyCacheValid(cache) {
125621
+ if (!cache.signingKey?.pem || !cache.signingKey?.fetchedAt) return false;
125622
+ const fetchedAt = new Date(cache.signingKey.fetchedAt);
125623
+ const ageMs = Date.now() - fetchedAt.getTime();
125624
+ return ageMs < 24 * 60 * 60 * 1e3;
125625
+ }
125626
+
125627
+ // src/lib/license-client.ts
125628
+ var import_path11 = require("path");
125629
+ var import_fs_extra10 = __toESM(require_lib());
125630
+ var DEFAULT_LICENSE_URL = "https://license.atlashub.ch";
125631
+ var REQUEST_TIMEOUT_MS = 1e4;
125632
+ async function getLicenseServerUrl() {
125633
+ const envUrl = process.env.SMARTSTACK_LICENSE_URL;
125634
+ if (envUrl) return envUrl.replace(/\/+$/, "");
125635
+ try {
125636
+ const configPath = getConfigFilePath();
125637
+ if (await import_fs_extra10.default.pathExists(configPath)) {
125638
+ const config = await import_fs_extra10.default.readJSON(configPath);
125639
+ if (config?.licenseServerUrl) return config.licenseServerUrl.replace(/\/+$/, "");
125640
+ }
125641
+ } catch {
125642
+ }
125643
+ return DEFAULT_LICENSE_URL;
125644
+ }
125645
+ async function getApiKey() {
125646
+ const envKey = process.env.SMARTSTACK_API_KEY;
125647
+ if (envKey) return envKey.trim();
125648
+ try {
125649
+ const keyPath = getApiKeyFilePath();
125650
+ if (await import_fs_extra10.default.pathExists(keyPath)) {
125651
+ return (await import_fs_extra10.default.readFile(keyPath, "utf-8")).trim();
125652
+ }
125653
+ } catch {
125654
+ }
125655
+ return null;
125656
+ }
125657
+ async function saveApiKey(apiKey) {
125658
+ const keyPath = getApiKeyFilePath();
125659
+ await import_fs_extra10.default.ensureDir((0, import_path11.dirname)(keyPath));
125660
+ await import_fs_extra10.default.writeFile(keyPath, apiKey.trim(), "utf-8");
125661
+ }
125662
+ async function removeApiKey() {
125663
+ const keyPath = getApiKeyFilePath();
125664
+ if (await import_fs_extra10.default.pathExists(keyPath)) {
125665
+ await import_fs_extra10.default.remove(keyPath);
125666
+ }
125667
+ }
125668
+ function createAbortSignal() {
125669
+ return AbortSignal.timeout(REQUEST_TIMEOUT_MS);
125670
+ }
125671
+ async function handleResponse(response) {
125672
+ if (response.ok) {
125673
+ return await response.json();
125674
+ }
125675
+ let message;
125676
+ try {
125677
+ const body = await response.json();
125678
+ message = body.message || body.detail || response.statusText;
125679
+ } catch {
125680
+ message = response.statusText;
125681
+ }
125682
+ const error = { status: response.status, message };
125683
+ switch (response.status) {
125684
+ case 404:
125685
+ error.message = `License not found: ${message}`;
125686
+ break;
125687
+ case 409:
125688
+ error.message = `Conflict: ${message}`;
125689
+ break;
125690
+ case 410:
125691
+ error.message = `License revoked or expired: ${message}`;
125692
+ break;
125693
+ case 429:
125694
+ error.message = `Rate limited: ${message}`;
125695
+ break;
125696
+ }
125697
+ throw error;
125698
+ }
125699
+ var LicenseClient = class {
125700
+ constructor(baseUrl) {
125701
+ this.baseUrl = baseUrl;
125702
+ }
125703
+ /**
125704
+ * GET /api/v1/public/signing-key — fetch the RSA public key (PEM)
125705
+ */
125706
+ async fetchSigningKey() {
125707
+ const response = await fetch(`${this.baseUrl}/api/v1/public/signing-key`, {
125708
+ signal: createAbortSignal()
125709
+ });
125710
+ if (!response.ok) {
125711
+ throw { status: response.status, message: "Failed to fetch signing key" };
125712
+ }
125713
+ const contentType = response.headers.get("content-type") || "";
125714
+ if (contentType.includes("application/json")) {
125715
+ const body = await response.json();
125716
+ return body.publicKey;
125717
+ }
125718
+ return response.text();
125719
+ }
125720
+ /**
125721
+ * GET /api/v1/public/health — check server availability
125722
+ */
125723
+ async healthCheck() {
125724
+ try {
125725
+ const response = await fetch(`${this.baseUrl}/api/v1/public/health`, {
125726
+ signal: createAbortSignal()
125727
+ });
125728
+ return response.ok;
125729
+ } catch {
125730
+ return false;
125731
+ }
125732
+ }
125733
+ /**
125734
+ * POST /api/v1/public/trial — self-service trial registration
125735
+ */
125736
+ async registerTrial(data) {
125737
+ const response = await fetch(`${this.baseUrl}/api/v1/public/trial`, {
125738
+ method: "POST",
125739
+ headers: { "Content-Type": "application/json" },
125740
+ body: JSON.stringify(data),
125741
+ signal: createAbortSignal()
125742
+ });
125743
+ return handleResponse(response);
125744
+ }
125745
+ /**
125746
+ * POST /api/v1/machine/activate — activate a machine (Bearer JWT auth)
125747
+ */
125748
+ async activate(jwt2, data) {
125749
+ const response = await fetch(`${this.baseUrl}/api/v1/machine/activate`, {
125750
+ method: "POST",
125751
+ headers: {
125752
+ "Content-Type": "application/json",
125753
+ Authorization: `Bearer ${jwt2}`
125754
+ },
125755
+ body: JSON.stringify(data),
125756
+ signal: createAbortSignal()
125757
+ });
125758
+ return handleResponse(response);
125759
+ }
125760
+ /**
125761
+ * POST /api/v1/machine/heartbeat — send heartbeat (Bearer JWT auth)
125762
+ */
125763
+ async heartbeat(jwt2, data) {
125764
+ const response = await fetch(`${this.baseUrl}/api/v1/machine/heartbeat`, {
125765
+ method: "POST",
125766
+ headers: {
125767
+ "Content-Type": "application/json",
125768
+ Authorization: `Bearer ${jwt2}`
125769
+ },
125770
+ body: JSON.stringify(data),
125771
+ signal: createAbortSignal()
125772
+ });
125773
+ return handleResponse(response);
125774
+ }
125775
+ /**
125776
+ * GET /api/v1/machine/validate — validate license status (Bearer JWT auth)
125777
+ */
125778
+ async validate(jwt2) {
125779
+ const response = await fetch(`${this.baseUrl}/api/v1/machine/validate`, {
125780
+ headers: { Authorization: `Bearer ${jwt2}` },
125781
+ signal: createAbortSignal()
125782
+ });
125783
+ return handleResponse(response);
125784
+ }
125785
+ // ── API Key variants (for CI/CD) ───────────────────────────────────────
125786
+ /**
125787
+ * POST /api/v1/machine/activate/key — activate via API key
125788
+ */
125789
+ async activateWithApiKey(apiKey, licenseJwt, data) {
125790
+ const response = await fetch(`${this.baseUrl}/api/v1/machine/activate/key`, {
125791
+ method: "POST",
125792
+ headers: {
125793
+ "Content-Type": "application/json",
125794
+ "X-Api-Key": apiKey
125795
+ },
125796
+ body: JSON.stringify({ licenseJwt, ...data }),
125797
+ signal: createAbortSignal()
125798
+ });
125799
+ return handleResponse(response);
125800
+ }
125801
+ /**
125802
+ * POST /api/v1/machine/heartbeat/key — heartbeat via API key
125803
+ */
125804
+ async heartbeatWithApiKey(apiKey, licenseJwt, data) {
125805
+ const response = await fetch(`${this.baseUrl}/api/v1/machine/heartbeat/key`, {
125806
+ method: "POST",
125807
+ headers: {
125808
+ "Content-Type": "application/json",
125809
+ "X-Api-Key": apiKey
125810
+ },
125811
+ body: JSON.stringify({ licenseJwt, ...data }),
125812
+ signal: createAbortSignal()
125813
+ });
125814
+ return handleResponse(response);
125815
+ }
125816
+ };
125817
+
125818
+ // src/lib/license.ts
125819
+ var LEGACY_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
125509
125820
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3Rgy76bx4SPse6vSnduR
125510
125821
  OSv8YOk/8lGSK6/a+1cxyppsymCR8p/+yxzLl+phbCtm4qPhrp4K8BFVyyCw0uhG
125511
125822
  xWyHzXvlbVfEO0YG5Ug5B3NVFr9/QaAHV1lVHgahxVFCglJZj7yVbFOY4uSpWNNg
@@ -125514,86 +125825,251 @@ csxveQKoRdG8wCb3BY4//8F0qLz21lqwPIM+cGZhUM1+ycYvC7HEke5xMxy6cCAS
125514
125825
  6Xwvxno/Ml8D2sXTBLNMt8JVFwoAuDohz3xdpxjfJDvzgwSH0bCLF7TOzEGRJF+s
125515
125826
  GwIDAQAB
125516
125827
  -----END PUBLIC KEY-----`;
125517
- var ISSUER = "atlashub.io";
125518
- var PRODUCT_ID = "smartstack-cli";
125519
- function getLicenseFilePath() {
125520
- const configDir = path3.join(os3.homedir(), ".smartstack");
125521
- return path3.join(configDir, "license.key");
125828
+ var LEGACY_ISSUER = "atlashub.io";
125829
+ var NEW_ISSUER = "license.smartstack.com";
125830
+ var LEGACY_PRODUCT_IDS = ["smartstack-cli", "smartstackcli"];
125831
+ var NEW_PRODUCT_TIERS = ["standard", "plus", "premium"];
125832
+ function detectJwtFormat(token) {
125833
+ try {
125834
+ const headerB64 = token.split(".")[0];
125835
+ const header = JSON.parse(Buffer.from(headerB64, "base64url").toString());
125836
+ if (header.alg === "RS512") return "new";
125837
+ } catch {
125838
+ }
125839
+ return "legacy";
125522
125840
  }
125523
125841
  async function saveLicenseKey(licenseKey) {
125524
125842
  const licensePath = getLicenseFilePath();
125525
- await fs8.ensureDir(path3.dirname(licensePath));
125526
- await fs8.writeFile(licensePath, licenseKey.trim(), "utf-8");
125843
+ await import_fs_extra11.default.ensureDir(getSmartStackDir());
125844
+ await import_fs_extra11.default.writeFile(licensePath, licenseKey.trim(), "utf-8");
125527
125845
  }
125528
125846
  async function loadLicenseKey() {
125529
125847
  const licensePath = getLicenseFilePath();
125530
- if (await fs8.pathExists(licensePath)) {
125531
- return (await fs8.readFile(licensePath, "utf-8")).trim();
125848
+ if (await import_fs_extra11.default.pathExists(licensePath)) {
125849
+ return (await import_fs_extra11.default.readFile(licensePath, "utf-8")).trim();
125532
125850
  }
125533
125851
  return null;
125534
125852
  }
125535
125853
  async function removeLicenseKey() {
125536
125854
  const licensePath = getLicenseFilePath();
125537
- if (await fs8.pathExists(licensePath)) {
125538
- await fs8.remove(licensePath);
125855
+ if (await import_fs_extra11.default.pathExists(licensePath)) {
125856
+ await import_fs_extra11.default.remove(licensePath);
125539
125857
  }
125540
125858
  }
125541
- function validateLicenseKey(licenseKey) {
125542
- if (!licenseKey || licenseKey.trim().length === 0) {
125543
- return { valid: false, error: "License key is empty" };
125859
+ function normalizeFeatures(decoded) {
125860
+ if (decoded.ft && Array.isArray(decoded.ft)) {
125861
+ const features = decoded.ft.map((scope) => ({
125862
+ applicationId: scope.aid || null,
125863
+ applicationCode: scope.app || "*",
125864
+ modules: (scope.modules || []).map((m) => ({
125865
+ moduleId: m.mid || "",
125866
+ moduleCode: m.mod || ""
125867
+ }))
125868
+ }));
125869
+ return { features };
125870
+ }
125871
+ if (decoded.features) {
125872
+ const raw = typeof decoded.features === "string" ? JSON.parse(decoded.features) : decoded.features;
125873
+ if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === "string") {
125874
+ return {
125875
+ features: [{ applicationId: null, applicationCode: "*", modules: [] }],
125876
+ legacyFeatures: raw
125877
+ };
125878
+ }
125879
+ }
125880
+ return {
125881
+ features: [{ applicationId: null, applicationCode: "*", modules: [] }],
125882
+ legacyFeatures: ["*"]
125883
+ };
125884
+ }
125885
+ function extractLicenseInfo(decoded) {
125886
+ const now = /* @__PURE__ */ new Date();
125887
+ const expiresAt = decoded.exp ? new Date(decoded.exp * 1e3) : new Date(now.getTime() + 365 * 24 * 60 * 60 * 1e3);
125888
+ const issuedAt = decoded.iat ? new Date(decoded.iat * 1e3) : now;
125889
+ const isPerpetual = (decoded.perp ?? decoded.perpetual) === true;
125890
+ const isExpired = !isPerpetual && expiresAt < now;
125891
+ const daysRemaining = isPerpetual ? Infinity : Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
125892
+ const { features, legacyFeatures } = normalizeFeatures(decoded);
125893
+ const bnd = decoded.bnd || decoded.bind;
125894
+ const bind = bnd ? {
125895
+ machineHash: bnd.mh ?? bnd.machine_hash,
125896
+ offline: bnd.ofl ?? bnd.offline
125897
+ } : void 0;
125898
+ return {
125899
+ companyId: decoded.sub || "unknown",
125900
+ clientName: decoded.cn ?? decoded.client_name,
125901
+ edition: decoded.prd ?? decoded.edition ?? "standard",
125902
+ product: decoded.prd ?? decoded.product ?? decoded.aud,
125903
+ jti: decoded.jti,
125904
+ environment: decoded.env ?? decoded.environment,
125905
+ features,
125906
+ legacyFeatures,
125907
+ maxInstances: decoded.mi ?? decoded.max_instances,
125908
+ maxUsers: decoded.mu ?? decoded.max_users,
125909
+ issuedAt,
125910
+ expiresAt,
125911
+ renewalDate: decoded.rnd ?? decoded.renewal_date,
125912
+ daysRemaining,
125913
+ isValid: !isExpired,
125914
+ isExpired,
125915
+ isPerpetual,
125916
+ gracePeriodDays: decoded.gp ?? decoded.grace_period_days ?? 15,
125917
+ bind
125918
+ };
125919
+ }
125920
+ function validateLegacyLicenseKey(licenseKey) {
125921
+ if (!licenseKey?.trim()) {
125922
+ return { valid: false, error: "License key is empty", warnings: [], source: "legacy" };
125544
125923
  }
125545
125924
  try {
125546
- const decoded = jwt.verify(licenseKey, PUBLIC_KEY, {
125925
+ const decoded = jwt.verify(licenseKey, LEGACY_PUBLIC_KEY, {
125547
125926
  algorithms: ["RS256"],
125548
- issuer: ISSUER
125927
+ issuer: LEGACY_ISSUER
125549
125928
  });
125550
- const productId = decoded.product_id || decoded.aud;
125551
- if (productId !== PRODUCT_ID) {
125929
+ const productId = decoded.product_id || decoded.product || decoded.aud;
125930
+ if (!LEGACY_PRODUCT_IDS.includes(productId)) {
125552
125931
  return {
125553
125932
  valid: false,
125554
- error: `Invalid license: This license is for "${productId}", not "${PRODUCT_ID}"`
125555
- };
125556
- }
125557
- const now = /* @__PURE__ */ new Date();
125558
- const expiresAt = decoded.exp ? new Date(decoded.exp * 1e3) : new Date(now.getTime() + 365 * 24 * 60 * 60 * 1e3);
125559
- const issuedAt = decoded.iat ? new Date(decoded.iat * 1e3) : now;
125560
- const isExpired = expiresAt < now;
125561
- const daysRemaining = Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
125562
- let features = ["*"];
125563
- if (decoded.features) {
125564
- features = typeof decoded.features === "string" ? JSON.parse(decoded.features) : decoded.features;
125565
- }
125566
- let limits = {};
125567
- if (decoded.limits) {
125568
- limits = typeof decoded.limits === "string" ? JSON.parse(decoded.limits) : decoded.limits;
125569
- }
125570
- const license = {
125571
- companyId: decoded.sub || "unknown",
125572
- edition: decoded.edition || "starter",
125573
- features,
125574
- limits,
125575
- issuedAt,
125576
- expiresAt,
125577
- daysRemaining,
125578
- isValid: !isExpired,
125579
- isExpired
125580
- };
125581
- if (isExpired) {
125933
+ error: `Invalid license: This license is for "${productId}", not "smartstack-cli"`,
125934
+ warnings: [],
125935
+ source: "legacy"
125936
+ };
125937
+ }
125938
+ const license = extractLicenseInfo(decoded);
125939
+ const warnings = [
125940
+ "This license uses the legacy format (RS256). It will continue to work but please upgrade to a new license for enhanced features."
125941
+ ];
125942
+ if (license.isExpired) {
125582
125943
  return {
125583
125944
  valid: false,
125584
- error: `License expired on ${expiresAt.toISOString().split("T")[0]}`,
125585
- license
125945
+ error: `License expired on ${license.expiresAt.toISOString().split("T")[0]}`,
125946
+ license,
125947
+ warnings,
125948
+ source: "legacy"
125586
125949
  };
125587
125950
  }
125588
- return { valid: true, license };
125951
+ return { valid: true, license, warnings, source: "legacy" };
125589
125952
  } catch (error) {
125590
125953
  if (error instanceof jwt.JsonWebTokenError) {
125591
- return { valid: false, error: `Invalid license signature: ${error.message}` };
125954
+ return { valid: false, error: `Invalid license signature: ${error.message}`, warnings: [], source: "legacy" };
125592
125955
  }
125593
125956
  if (error instanceof jwt.TokenExpiredError) {
125594
- return { valid: false, error: "License has expired" };
125957
+ return { valid: false, error: "License has expired", warnings: [], source: "legacy" };
125595
125958
  }
125596
- return { valid: false, error: `License validation failed: ${error.message}` };
125959
+ return { valid: false, error: `License validation failed: ${error.message}`, warnings: [], source: "legacy" };
125960
+ }
125961
+ }
125962
+ function validateNewLicenseKey(licenseKey, signingKeyPem) {
125963
+ if (!licenseKey?.trim()) {
125964
+ return { valid: false, error: "License key is empty", warnings: [], source: "offline" };
125965
+ }
125966
+ try {
125967
+ const decoded = jwt.verify(licenseKey, signingKeyPem, {
125968
+ algorithms: ["RS512"],
125969
+ issuer: NEW_ISSUER
125970
+ });
125971
+ const productId = decoded.prd || decoded.product || decoded.aud;
125972
+ const allValid = [...NEW_PRODUCT_TIERS, ...LEGACY_PRODUCT_IDS];
125973
+ if (!allValid.includes(productId)) {
125974
+ return {
125975
+ valid: false,
125976
+ error: `Invalid license: unrecognized product "${productId}"`,
125977
+ warnings: [],
125978
+ source: "offline"
125979
+ };
125980
+ }
125981
+ const license = extractLicenseInfo(decoded);
125982
+ if (license.isExpired && !license.isPerpetual) {
125983
+ const graceDays = license.gracePeriodDays ?? 15;
125984
+ if (isGraceExpired(license.expiresAt.toISOString(), graceDays)) {
125985
+ return {
125986
+ valid: false,
125987
+ error: `License expired on ${license.expiresAt.toISOString().split("T")[0]} (grace period ended)`,
125988
+ license,
125989
+ warnings: [],
125990
+ source: "offline"
125991
+ };
125992
+ }
125993
+ const grace = isInGracePeriod(license.expiresAt.toISOString(), graceDays);
125994
+ if (grace.inGrace) {
125995
+ return {
125996
+ valid: true,
125997
+ license,
125998
+ warnings: [`License expired but within grace period (${grace.daysLeft} day(s) remaining)`],
125999
+ source: "offline"
126000
+ };
126001
+ }
126002
+ }
126003
+ return { valid: true, license, warnings: [], source: "offline" };
126004
+ } catch (error) {
126005
+ if (error instanceof jwt.JsonWebTokenError) {
126006
+ return { valid: false, error: `Invalid license signature: ${error.message}`, warnings: [], source: "offline" };
126007
+ }
126008
+ if (error instanceof jwt.TokenExpiredError) {
126009
+ return { valid: false, error: "License has expired", warnings: [], source: "offline" };
126010
+ }
126011
+ return { valid: false, error: `License validation failed: ${error.message}`, warnings: [], source: "offline" };
126012
+ }
126013
+ }
126014
+ function validateOfflineLicense(licenseKey, signingKeyPem, fingerprint) {
126015
+ const result = validateNewLicenseKey(licenseKey, signingKeyPem);
126016
+ if (!result.valid) return result;
126017
+ const bind = result.license?.bind;
126018
+ if (bind?.machineHash && bind.machineHash !== fingerprint) {
126019
+ return {
126020
+ valid: false,
126021
+ error: "Machine fingerprint mismatch. This license is bound to a different machine.",
126022
+ warnings: [],
126023
+ source: "offline"
126024
+ };
126025
+ }
126026
+ return result;
126027
+ }
126028
+ function validateLicenseKey(licenseKey) {
126029
+ if (!licenseKey?.trim()) {
126030
+ return { valid: false, error: "License key is empty", warnings: [], source: "legacy" };
126031
+ }
126032
+ const format = detectJwtFormat(licenseKey);
126033
+ if (format === "legacy") {
126034
+ return validateLegacyLicenseKey(licenseKey);
126035
+ }
126036
+ try {
126037
+ const decoded = jwt.decode(licenseKey);
126038
+ if (!decoded) {
126039
+ return { valid: false, error: "Invalid JWT token", warnings: [], source: "offline" };
126040
+ }
126041
+ const productId = decoded.prd || decoded.product || decoded.aud;
126042
+ const allValid = [...NEW_PRODUCT_TIERS, ...LEGACY_PRODUCT_IDS];
126043
+ if (!allValid.includes(productId)) {
126044
+ return {
126045
+ valid: false,
126046
+ error: `Invalid license: unrecognized product "${productId}"`,
126047
+ warnings: [],
126048
+ source: "offline"
126049
+ };
126050
+ }
126051
+ const license = extractLicenseInfo(decoded);
126052
+ return {
126053
+ valid: true,
126054
+ license,
126055
+ warnings: ["License signature not verified (signing key unavailable). Run a command to trigger online validation."],
126056
+ source: "offline"
126057
+ };
126058
+ } catch {
126059
+ return { valid: false, error: "Invalid JWT token", warnings: [], source: "offline" };
126060
+ }
126061
+ }
126062
+ async function getSigningKey(cache, client) {
126063
+ if (isSigningKeyCacheValid(cache)) {
126064
+ return cache.signingKey.pem;
126065
+ }
126066
+ try {
126067
+ const pem = await client.fetchSigningKey();
126068
+ cache.signingKey = { pem, fetchedAt: (/* @__PURE__ */ new Date()).toISOString() };
126069
+ await saveCache(cache);
126070
+ return pem;
126071
+ } catch {
126072
+ return cache.signingKey?.pem || null;
125597
126073
  }
125598
126074
  }
125599
126075
  async function validateCurrentLicense() {
@@ -125601,44 +126077,359 @@ async function validateCurrentLicense() {
125601
126077
  if (!licenseKey) {
125602
126078
  return {
125603
126079
  valid: false,
125604
- error: "No license found. Please activate with: smartstack license activate <key>"
126080
+ error: "No license found. Please activate with: smartstack license activate <key>",
126081
+ warnings: [],
126082
+ source: "offline"
126083
+ };
126084
+ }
126085
+ const format = detectJwtFormat(licenseKey);
126086
+ if (format === "legacy") {
126087
+ return validateLegacyLicenseKey(licenseKey);
126088
+ }
126089
+ const cache = await loadCache();
126090
+ const baseUrl = await getLicenseServerUrl();
126091
+ const client = new LicenseClient(baseUrl);
126092
+ const decoded = jwt.decode(licenseKey);
126093
+ const bndClaim = decoded?.bnd || decoded?.bind;
126094
+ if (bndClaim?.ofl === true || bndClaim?.offline === true) {
126095
+ const signingKey = await getSigningKey(cache, client);
126096
+ if (!signingKey) {
126097
+ return {
126098
+ valid: false,
126099
+ error: "Cannot validate offline license: signing key unavailable. Connect to the internet at least once.",
126100
+ warnings: [],
126101
+ source: "offline"
126102
+ };
126103
+ }
126104
+ const fingerprint = generateMachineFingerprint();
126105
+ return validateOfflineLicense(licenseKey, signingKey, fingerprint);
126106
+ }
126107
+ if (isCacheValid(cache)) {
126108
+ const cached = cache.lastValidationResult;
126109
+ const warnings = [];
126110
+ if (cached.revoked) {
126111
+ return { valid: false, error: "License has been revoked", warnings: [], source: "cache" };
126112
+ }
126113
+ if (!cached.isPerpetual && isGraceExpired(cached.expiresAt, cached.gracePeriodDays)) {
126114
+ return { valid: false, error: "License expired (grace period ended)", warnings: [], source: "cache" };
126115
+ }
126116
+ if (!cached.isPerpetual) {
126117
+ const grace = isInGracePeriod(cached.expiresAt, cached.gracePeriodDays);
126118
+ if (grace.inGrace) {
126119
+ warnings.push(`License expired but within grace period (${grace.daysLeft} day(s) remaining)`);
126120
+ }
126121
+ }
126122
+ if (isHeartbeatDue(cache)) {
126123
+ await performHeartbeat(licenseKey, cache, client);
126124
+ }
126125
+ const license = buildLicenseInfoFromCache(cached, decoded);
126126
+ return { valid: true, license, warnings, source: "cache" };
126127
+ }
126128
+ try {
126129
+ const serverResult = await client.validate(licenseKey);
126130
+ return await handleOnlineValidation(serverResult, licenseKey, cache, client, decoded);
126131
+ } catch (err) {
126132
+ if (cache.lastValidationResult) {
126133
+ const cached = cache.lastValidationResult;
126134
+ const warnings = ["License server unreachable. Using cached validation result."];
126135
+ if (cached.revoked) {
126136
+ return { valid: false, error: "License has been revoked (cached)", warnings, source: "cache" };
126137
+ }
126138
+ if (!cached.isPerpetual && isGraceExpired(cached.expiresAt, cached.gracePeriodDays)) {
126139
+ return { valid: false, error: "License expired (cached, grace period ended)", warnings, source: "cache" };
126140
+ }
126141
+ const license = buildLicenseInfoFromCache(cached, decoded);
126142
+ return { valid: true, license, warnings, source: "cache" };
126143
+ }
126144
+ const signingKey = await getSigningKey(cache, client);
126145
+ if (signingKey) {
126146
+ const result = validateNewLicenseKey(licenseKey, signingKey);
126147
+ result.warnings.push("License server unreachable. Validated offline with cached signing key.");
126148
+ return result;
126149
+ }
126150
+ const apiErr = err;
126151
+ return {
126152
+ valid: false,
126153
+ error: apiErr?.message || "Unable to validate license: server unreachable and no cached data.",
126154
+ warnings: [],
126155
+ source: "offline"
125605
126156
  };
125606
126157
  }
125607
- return validateLicenseKey(licenseKey);
126158
+ }
126159
+ async function handleOnlineValidation(serverResult, licenseKey, cache, client, decoded) {
126160
+ const warnings = [];
126161
+ cache.lastValidation = (/* @__PURE__ */ new Date()).toISOString();
126162
+ const normalizedFeatures = Array.isArray(serverResult.features) ? serverResult.features.map((f) => ({
126163
+ applicationId: f.application_id || null,
126164
+ applicationCode: f.application_code || "*",
126165
+ modules: (f.modules || []).map((m) => ({
126166
+ moduleId: m.module_id || "",
126167
+ moduleCode: m.module_code || ""
126168
+ }))
126169
+ })) : [{ applicationId: null, applicationCode: "*", modules: [] }];
126170
+ cache.lastValidationResult = {
126171
+ valid: serverResult.valid,
126172
+ revoked: serverResult.revoked,
126173
+ environment: serverResult.environment,
126174
+ features: normalizedFeatures,
126175
+ maxInstances: serverResult.maxInstances,
126176
+ maxUsers: serverResult.maxUsers,
126177
+ expiresAt: serverResult.expiresAt,
126178
+ gracePeriodDays: serverResult.gracePeriodDays,
126179
+ isPerpetual: serverResult.isPerpetual,
126180
+ renewalDate: serverResult.renewalDate || null
126181
+ };
126182
+ await saveCache(cache);
126183
+ if (serverResult.revoked) {
126184
+ return { valid: false, error: "License has been revoked", warnings: [], source: "online" };
126185
+ }
126186
+ if (!serverResult.valid && !serverResult.isPerpetual) {
126187
+ const graceDays = serverResult.gracePeriodDays ?? 15;
126188
+ if (isGraceExpired(serverResult.expiresAt, graceDays)) {
126189
+ return {
126190
+ valid: false,
126191
+ error: `License expired on ${serverResult.expiresAt.split("T")[0]} (grace period ended)`,
126192
+ warnings: [],
126193
+ source: "online"
126194
+ };
126195
+ }
126196
+ const grace = isInGracePeriod(serverResult.expiresAt, graceDays);
126197
+ if (grace.inGrace) {
126198
+ warnings.push(`License expired but within grace period (${grace.daysLeft} day(s) remaining)`);
126199
+ }
126200
+ }
126201
+ if (isHeartbeatDue(cache)) {
126202
+ await performHeartbeat(licenseKey, cache, client);
126203
+ }
126204
+ const license = buildLicenseInfoFromValidateResponse(serverResult, decoded);
126205
+ return { valid: true, license, warnings, source: "online" };
126206
+ }
126207
+ async function performHeartbeat(licenseKey, cache, client) {
126208
+ try {
126209
+ const identity = await getMachineIdentity();
126210
+ const apiKey = await getApiKey();
126211
+ let response;
126212
+ if (apiKey) {
126213
+ response = await client.heartbeatWithApiKey(apiKey, licenseKey, {
126214
+ machineFingerprint: identity.fingerprint,
126215
+ instanceId: identity.instanceId
126216
+ });
126217
+ } else {
126218
+ response = await client.heartbeat(licenseKey, {
126219
+ machineFingerprint: identity.fingerprint,
126220
+ instanceId: identity.instanceId
126221
+ });
126222
+ }
126223
+ cache.lastHeartbeat = (/* @__PURE__ */ new Date()).toISOString();
126224
+ await saveCache(cache);
126225
+ if (response.newJwtToken) {
126226
+ await saveLicenseKey(response.newJwtToken);
126227
+ logger.debug("License JWT updated from heartbeat response");
126228
+ }
126229
+ } catch {
126230
+ logger.debug("Heartbeat failed (will retry later)");
126231
+ }
126232
+ }
126233
+ async function activateLicense(licenseKey) {
126234
+ if (!licenseKey?.trim()) {
126235
+ return { valid: false, error: "License key is empty", warnings: [], source: "offline" };
126236
+ }
126237
+ const format = detectJwtFormat(licenseKey);
126238
+ if (format === "legacy") {
126239
+ const result = validateLegacyLicenseKey(licenseKey);
126240
+ if (result.valid) {
126241
+ await saveLicenseKey(licenseKey);
126242
+ }
126243
+ return result;
126244
+ }
126245
+ const baseUrl = await getLicenseServerUrl();
126246
+ const client = new LicenseClient(baseUrl);
126247
+ const cache = await loadCache();
126248
+ const identity = await getMachineIdentity();
126249
+ const signingKey = await getSigningKey(cache, client);
126250
+ try {
126251
+ const apiKey = await getApiKey();
126252
+ let activation;
126253
+ if (apiKey) {
126254
+ activation = await client.activateWithApiKey(apiKey, licenseKey, {
126255
+ machineFingerprint: identity.fingerprint,
126256
+ machineName: identity.machineName,
126257
+ instanceId: identity.instanceId
126258
+ });
126259
+ } else {
126260
+ activation = await client.activate(licenseKey, {
126261
+ machineFingerprint: identity.fingerprint,
126262
+ machineName: identity.machineName,
126263
+ instanceId: identity.instanceId
126264
+ });
126265
+ }
126266
+ await saveLicenseKey(licenseKey);
126267
+ cache.activation = {
126268
+ activated: activation.activated,
126269
+ activatedAt: activation.activatedAt || (/* @__PURE__ */ new Date()).toISOString(),
126270
+ machineFingerprint: identity.fingerprint,
126271
+ instanceId: identity.instanceId,
126272
+ heartbeatIntervalHours: activation.heartbeatIntervalHours,
126273
+ gracePeriodDays: activation.gracePeriodDays
126274
+ };
126275
+ cache.lastHeartbeat = (/* @__PURE__ */ new Date()).toISOString();
126276
+ await saveCache(cache);
126277
+ if (signingKey) {
126278
+ const result = validateNewLicenseKey(licenseKey, signingKey);
126279
+ result.source = "online";
126280
+ return result;
126281
+ }
126282
+ const decoded = jwt.decode(licenseKey);
126283
+ if (decoded) {
126284
+ return {
126285
+ valid: true,
126286
+ license: extractLicenseInfo(decoded),
126287
+ warnings: [],
126288
+ source: "online"
126289
+ };
126290
+ }
126291
+ return { valid: true, warnings: ["Activated but could not decode license details"], source: "online" };
126292
+ } catch (err) {
126293
+ const apiErr = err;
126294
+ let error = apiErr?.message || "Activation failed";
126295
+ if (apiErr?.status === 409) {
126296
+ error = "Maximum number of machine activations reached. Deactivate another machine first.";
126297
+ } else if (apiErr?.status === 410) {
126298
+ error = "This license has been revoked or has expired.";
126299
+ } else if (apiErr?.status === 404) {
126300
+ error = "License not found on the server.";
126301
+ }
126302
+ return { valid: false, error, warnings: [], source: "online" };
126303
+ }
126304
+ }
126305
+ async function deactivateLicense() {
126306
+ try {
126307
+ const cache = await loadCache();
126308
+ if (cache.activation) {
126309
+ logger.debug("Clearing local license activation");
126310
+ }
126311
+ } catch {
126312
+ }
126313
+ await removeLicenseKey();
126314
+ await clearCache();
126315
+ }
126316
+ function buildLicenseInfoFromCache(cached, decoded) {
126317
+ const expiresAt = new Date(cached.expiresAt);
126318
+ const now = /* @__PURE__ */ new Date();
126319
+ const daysRemaining = cached.isPerpetual ? Infinity : Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
126320
+ return {
126321
+ companyId: decoded?.sub || "unknown",
126322
+ clientName: decoded?.cn ?? decoded?.client_name,
126323
+ edition: decoded?.prd ?? decoded?.edition ?? "standard",
126324
+ product: decoded?.prd ?? decoded?.product,
126325
+ jti: decoded?.jti,
126326
+ environment: cached.environment,
126327
+ features: cached.features,
126328
+ maxInstances: cached.maxInstances,
126329
+ maxUsers: cached.maxUsers,
126330
+ issuedAt: decoded?.iat ? new Date(decoded.iat * 1e3) : now,
126331
+ expiresAt,
126332
+ renewalDate: cached.renewalDate ?? void 0,
126333
+ daysRemaining,
126334
+ isValid: cached.valid && !cached.revoked,
126335
+ isExpired: !cached.isPerpetual && expiresAt < now,
126336
+ isPerpetual: cached.isPerpetual,
126337
+ gracePeriodDays: cached.gracePeriodDays
126338
+ };
126339
+ }
126340
+ function buildLicenseInfoFromValidateResponse(response, decoded) {
126341
+ const expiresAt = new Date(response.expiresAt);
126342
+ const now = /* @__PURE__ */ new Date();
126343
+ const daysRemaining = response.isPerpetual ? Infinity : Math.max(0, Math.ceil((expiresAt.getTime() - now.getTime()) / (24 * 60 * 60 * 1e3)));
126344
+ const features = Array.isArray(response.features) ? response.features.map((f) => ({
126345
+ applicationId: f.application_id || null,
126346
+ applicationCode: f.application_code || "*",
126347
+ modules: (f.modules || []).map((m) => ({
126348
+ moduleId: m.module_id || "",
126349
+ moduleCode: m.module_code || ""
126350
+ }))
126351
+ })) : [{ applicationId: null, applicationCode: "*", modules: [] }];
126352
+ return {
126353
+ companyId: response.clientId,
126354
+ clientName: response.clientName,
126355
+ edition: response.product || decoded?.prd || "standard",
126356
+ product: response.product,
126357
+ jti: decoded?.jti,
126358
+ environment: response.environment,
126359
+ features,
126360
+ maxInstances: response.maxInstances,
126361
+ maxUsers: response.maxUsers,
126362
+ issuedAt: decoded?.iat ? new Date(decoded.iat * 1e3) : now,
126363
+ expiresAt,
126364
+ renewalDate: response.renewalDate ?? void 0,
126365
+ daysRemaining,
126366
+ isValid: response.valid && !response.revoked,
126367
+ isExpired: !response.isPerpetual && expiresAt < now,
126368
+ isPerpetual: response.isPerpetual,
126369
+ gracePeriodDays: response.gracePeriodDays
126370
+ };
125608
126371
  }
125609
126372
  async function getLicenseInfo() {
125610
126373
  const result = await validateCurrentLicense();
125611
126374
  return result.valid ? result.license : null;
125612
126375
  }
125613
- function formatLicenseInfo(license) {
125614
- const status = license.isExpired ? "\u{1F534} EXPIRED" : license.daysRemaining <= 30 ? `\u{1F7E1} ${license.daysRemaining} days remaining` : `\u{1F7E2} Valid (${license.daysRemaining} days)`;
126376
+ function formatLicenseInfo(license, source) {
126377
+ const status = license.isExpired ? "\u{1F534} EXPIRED" : license.daysRemaining <= 30 ? `\u{1F7E1} ${license.daysRemaining} days remaining` : license.isPerpetual ? "\u{1F7E2} Perpetual" : `\u{1F7E2} Valid (${license.daysRemaining} days)`;
126378
+ const edition = license.edition.toUpperCase();
126379
+ const env2 = license.environment ? ` (${license.environment})` : "";
126380
+ const sourceLabel = source ? ` [${source}]` : "";
126381
+ let featuresDisplay;
126382
+ if (license.legacyFeatures) {
126383
+ featuresDisplay = license.legacyFeatures.join(", ");
126384
+ } else {
126385
+ const parts = [];
126386
+ for (const scope of license.features) {
126387
+ if (scope.applicationCode === "*") {
126388
+ parts.push("All applications");
126389
+ } else if (scope.modules.length > 0) {
126390
+ const mods = scope.modules.map((m) => m.moduleCode).join(", ");
126391
+ parts.push(`${scope.applicationCode} (${mods})`);
126392
+ } else {
126393
+ parts.push(scope.applicationCode);
126394
+ }
126395
+ }
126396
+ featuresDisplay = parts.join(", ") || "N/A";
126397
+ }
126398
+ const limitsLine = license.maxInstances || license.maxUsers ? `\u2551 Limits: ${`${license.maxInstances ?? "\u221E"} instances, ${license.maxUsers ?? "\u221E"} users`.padEnd(45)}\u2551
126399
+ ` : "";
125615
126400
  return `
125616
126401
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
125617
126402
  \u2551 SMARTSTACK CLI LICENSE \u2551
125618
126403
  \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
125619
- \u2551 Status: ${status.padEnd(45)}\u2551
125620
- \u2551 Company: ${license.companyId.padEnd(45)}\u2551
125621
- \u2551 Edition: ${license.edition.toUpperCase().padEnd(45)}\u2551
125622
- \u2551 Expires: ${license.expiresAt.toISOString().split("T")[0].padEnd(45)}\u2551
126404
+ \u2551 Status: ${(status + sourceLabel).padEnd(45)}\u2551
126405
+ \u2551 Company: ${(license.clientName || license.companyId).padEnd(45)}\u2551
126406
+ \u2551 Edition: ${(edition + env2).padEnd(45)}\u2551
126407
+ \u2551 Expires: ${(license.isPerpetual ? "Never" : license.expiresAt.toISOString().split("T")[0]).padEnd(45)}\u2551
125623
126408
  \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
125624
- \u2551 Features: ${license.features.join(", ").padEnd(45)}\u2551
125625
- \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
126409
+ \u2551 Features: ${featuresDisplay.padEnd(45)}\u2551
126410
+ ${limitsLine}\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
125626
126411
  `;
125627
126412
  }
125628
126413
 
125629
126414
  // src/commands/license.ts
125630
126415
  function createLicenseCommand() {
125631
126416
  const license = new Command("license").description("Manage SmartStack CLI license");
125632
- license.command("activate <key>").description("Activate a license key").action(async (key) => {
125633
- logger.info("Validating license key...\n");
125634
- const result = validateLicenseKey(key);
126417
+ license.command("activate <key>").description("Activate a license key on this machine").action(async (key) => {
126418
+ logger.info("Activating license...\n");
126419
+ const result = await activateLicense(key);
125635
126420
  if (!result.valid) {
125636
- logger.error(`License Activation Failed: ${result.error || "Invalid license"}`);
126421
+ logger.error(`Activation Failed: ${result.error || "Invalid license"}`);
125637
126422
  process.exit(1);
125638
126423
  }
125639
- await saveLicenseKey(key);
125640
126424
  logger.success("License activated successfully!");
125641
- console.log(formatLicenseInfo(result.license));
126425
+ console.log(formatLicenseInfo(result.license, result.source));
126426
+ const identity = await getMachineIdentity();
126427
+ console.log(source_default.gray(` Machine: ${identity.machineName}`));
126428
+ console.log(source_default.gray(` Fingerprint: ${identity.fingerprint.substring(0, 12)}...`));
126429
+ console.log(source_default.gray(` Instance: ${identity.instanceId}`));
126430
+ for (const warning of result.warnings) {
126431
+ logger.warning(warning);
126432
+ }
125642
126433
  });
125643
126434
  license.command("status").description("Show current license status").action(async () => {
125644
126435
  const result = await validateCurrentLicense();
@@ -125646,34 +126437,162 @@ function createLicenseCommand() {
125646
126437
  logger.error(`No Valid License: ${result.error || "License not found"}`);
125647
126438
  logger.info("\nTo activate a license:");
125648
126439
  logger.info(" smartstack license activate <your-license-key>");
126440
+ logger.info("\nTo request a trial:");
126441
+ logger.info(" smartstack license trial");
125649
126442
  logger.info("\nTo purchase a license:");
125650
126443
  logger.info(" https://atlashub.io/products/smartstack-cli");
125651
126444
  process.exit(1);
125652
126445
  }
125653
- console.log(formatLicenseInfo(result.license));
125654
- if (result.license.daysRemaining <= 30) {
126446
+ console.log(formatLicenseInfo(result.license, result.source));
126447
+ const licenseKey = await loadLicenseKey();
126448
+ const format = licenseKey ? detectJwtFormat(licenseKey) : "unknown";
126449
+ const cache = await loadCache();
126450
+ console.log(source_default.cyan(" Extended Info:"));
126451
+ console.log(source_default.gray(` Format: ${format === "legacy" ? "Legacy (RS256)" : "New (RS512)"}`));
126452
+ console.log(source_default.gray(` Environment: ${result.license.environment || "N/A"}`));
126453
+ console.log(source_default.gray(` Source: ${result.source}`));
126454
+ if (cache.activation) {
126455
+ console.log(source_default.gray(` Activated: ${cache.activation.activatedAt?.split("T")[0] || "N/A"}`));
126456
+ console.log(source_default.gray(` Heartbeat: every ${cache.activation.heartbeatIntervalHours}h`));
126457
+ console.log(source_default.gray(` Grace Period: ${cache.activation.gracePeriodDays} days`));
126458
+ }
126459
+ if (cache.lastHeartbeat) {
126460
+ console.log(source_default.gray(` Last Beat: ${cache.lastHeartbeat}`));
126461
+ }
126462
+ console.log();
126463
+ for (const warning of result.warnings) {
126464
+ logger.warning(warning);
126465
+ }
126466
+ if (result.license.daysRemaining <= 30 && !result.license.isPerpetual) {
125655
126467
  logger.warning(`License expires in ${result.license.daysRemaining} days`);
125656
126468
  logger.info("Renew at: https://atlashub.io/products/smartstack-cli");
125657
126469
  }
125658
126470
  });
125659
- license.command("deactivate").description("Remove the current license").action(async () => {
126471
+ license.command("deactivate").description("Remove the current license from this machine").action(async () => {
125660
126472
  const key = await loadLicenseKey();
125661
126473
  if (!key) {
125662
126474
  logger.warning("No license is currently active");
125663
126475
  return;
125664
126476
  }
125665
- await removeLicenseKey();
126477
+ const { confirm } = await lib_default.prompt([
126478
+ {
126479
+ type: "confirm",
126480
+ name: "confirm",
126481
+ message: "Are you sure you want to deactivate the license on this machine?",
126482
+ default: false
126483
+ }
126484
+ ]);
126485
+ if (!confirm) {
126486
+ logger.info("Deactivation cancelled");
126487
+ return;
126488
+ }
126489
+ await deactivateLicense();
125666
126490
  logger.success("License deactivated successfully");
125667
126491
  });
125668
126492
  license.command("verify <key>").description("Verify a license key without activating it").action(async (key) => {
125669
126493
  logger.info("Verifying license key...\n");
126494
+ const format = detectJwtFormat(key);
125670
126495
  const result = validateLicenseKey(key);
125671
126496
  if (!result.valid) {
125672
126497
  logger.error(`License Invalid: ${result.error || "Unknown error"}`);
125673
126498
  process.exit(1);
125674
126499
  }
125675
- logger.success("License is valid!");
125676
- console.log(formatLicenseInfo(result.license));
126500
+ logger.success(`License is valid! (format: ${format === "legacy" ? "Legacy RS256" : "New RS512"})`);
126501
+ console.log(formatLicenseInfo(result.license, result.source));
126502
+ for (const warning of result.warnings) {
126503
+ logger.warning(warning);
126504
+ }
126505
+ });
126506
+ license.command("trial").description("Request a free trial license").action(async () => {
126507
+ logger.info("SmartStack CLI Trial Registration\n");
126508
+ const answers = await lib_default.prompt([
126509
+ {
126510
+ type: "input",
126511
+ name: "fullName",
126512
+ message: "Your full name:",
126513
+ validate: (v) => v.trim().length > 0 || "Name is required"
126514
+ },
126515
+ {
126516
+ type: "input",
126517
+ name: "email",
126518
+ message: "Your email address:",
126519
+ validate: (v) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) || "Valid email required"
126520
+ },
126521
+ {
126522
+ type: "input",
126523
+ name: "company",
126524
+ message: "Company name:",
126525
+ validate: (v) => v.trim().length > 0 || "Company is required"
126526
+ },
126527
+ {
126528
+ type: "list",
126529
+ name: "teamSize",
126530
+ message: "Team size:",
126531
+ choices: ["1-5", "6-20", "21-50", "51-200", "200+"]
126532
+ }
126533
+ ]);
126534
+ const spinner = logger.spinner("Registering trial...");
126535
+ try {
126536
+ const baseUrl = await getLicenseServerUrl();
126537
+ const client = new LicenseClient(baseUrl);
126538
+ const response = await client.registerTrial(answers);
126539
+ spinner.succeed("Trial registered!");
126540
+ const cliLicense = response.licenses.find(
126541
+ (l) => ["smartstack-cli", "smartstackcli", "SmartStackCli", "standard", "Standard"].includes(l.product)
126542
+ );
126543
+ if (!cliLicense) {
126544
+ logger.error("No CLI license found in trial response");
126545
+ process.exit(1);
126546
+ }
126547
+ logger.info("\nActivating trial license...");
126548
+ const activationResult = await activateLicense(cliLicense.token);
126549
+ if (activationResult.valid) {
126550
+ logger.success("Trial license activated!");
126551
+ console.log(formatLicenseInfo(activationResult.license, activationResult.source));
126552
+ console.log(source_default.gray(` Trial expires: ${response.expiresAt.split("T")[0]}`));
126553
+ } else {
126554
+ await saveLicenseKey(cliLicense.token);
126555
+ logger.warning(`Trial created but activation failed: ${activationResult.error}`);
126556
+ logger.info("The license key has been saved. Try running any command to trigger online validation.");
126557
+ }
126558
+ } catch (err) {
126559
+ spinner.fail("Trial registration failed");
126560
+ const apiErr = err;
126561
+ if (apiErr?.status === 429) {
126562
+ logger.error("Rate limited. A trial has already been created for this email or IP.");
126563
+ } else {
126564
+ logger.error(apiErr?.message || "Unknown error");
126565
+ }
126566
+ process.exit(1);
126567
+ }
126568
+ });
126569
+ const apiKeyCmd = license.command("api-key").description("Manage API key for CI/CD authentication");
126570
+ apiKeyCmd.command("set <key>").description("Configure an API key for machine-to-machine authentication").action(async (key) => {
126571
+ if (!key.startsWith("sk_")) {
126572
+ logger.error('Invalid API key format. Keys should start with "sk_"');
126573
+ process.exit(1);
126574
+ }
126575
+ await saveApiKey(key);
126576
+ logger.success("API key configured successfully");
126577
+ console.log(source_default.gray(` Key prefix: ${key.substring(0, 10)}...`));
126578
+ });
126579
+ apiKeyCmd.command("remove").description("Remove the stored API key").action(async () => {
126580
+ const existing = await getApiKey();
126581
+ if (!existing) {
126582
+ logger.warning("No API key is currently configured");
126583
+ return;
126584
+ }
126585
+ await removeApiKey();
126586
+ logger.success("API key removed");
126587
+ });
126588
+ apiKeyCmd.command("status").description("Check if an API key is configured").action(async () => {
126589
+ const existing = await getApiKey();
126590
+ if (existing) {
126591
+ logger.success(`API key configured: ${existing.substring(0, 10)}...`);
126592
+ } else {
126593
+ logger.info("No API key configured");
126594
+ logger.info(" Set one with: smartstack license api-key set <key>");
126595
+ }
125677
126596
  });
125678
126597
  return license;
125679
126598
  }
@@ -125784,24 +126703,24 @@ var checkMcpCommand = new Command("check-mcp").description("Check MCP servers st
125784
126703
 
125785
126704
  // src/commands/ralph.ts
125786
126705
  var import_cli_table33 = __toESM(require_cli_table3());
125787
- var import_fs_extra8 = __toESM(require_lib());
125788
- var import_path9 = require("path");
126706
+ var import_fs_extra12 = __toESM(require_lib());
126707
+ var import_path12 = require("path");
125789
126708
  function getRalphDir() {
125790
- return (0, import_path9.join)(process.cwd(), ".ralph");
126709
+ return (0, import_path12.join)(process.cwd(), ".ralph");
125791
126710
  }
125792
126711
  async function readRalphLogs(limit = 50) {
125793
- const logsDir = (0, import_path9.join)(getRalphDir(), "logs");
125794
- if (!await import_fs_extra8.default.pathExists(logsDir)) {
126712
+ const logsDir = (0, import_path12.join)(getRalphDir(), "logs");
126713
+ if (!await import_fs_extra12.default.pathExists(logsDir)) {
125795
126714
  return [];
125796
126715
  }
125797
126716
  try {
125798
- const files = await import_fs_extra8.default.readdir(logsDir);
126717
+ const files = await import_fs_extra12.default.readdir(logsDir);
125799
126718
  const logFiles = files.filter((f) => f.endsWith(".log")).sort().reverse();
125800
126719
  if (logFiles.length === 0) {
125801
126720
  return [];
125802
126721
  }
125803
- const latestLog = (0, import_path9.join)(logsDir, logFiles[0]);
125804
- const content = await import_fs_extra8.default.readFile(latestLog, "utf-8");
126722
+ const latestLog = (0, import_path12.join)(logsDir, logFiles[0]);
126723
+ const content = await import_fs_extra12.default.readFile(latestLog, "utf-8");
125805
126724
  const lines = content.split("\n");
125806
126725
  return lines.slice(-limit);
125807
126726
  } catch {
@@ -125809,17 +126728,17 @@ async function readRalphLogs(limit = 50) {
125809
126728
  }
125810
126729
  }
125811
126730
  async function listReports() {
125812
- const reportsDir = (0, import_path9.join)(getRalphDir(), "reports");
125813
- if (!await import_fs_extra8.default.pathExists(reportsDir)) {
126731
+ const reportsDir = (0, import_path12.join)(getRalphDir(), "reports");
126732
+ if (!await import_fs_extra12.default.pathExists(reportsDir)) {
125814
126733
  return [];
125815
126734
  }
125816
126735
  try {
125817
- const files = await import_fs_extra8.default.readdir(reportsDir);
126736
+ const files = await import_fs_extra12.default.readdir(reportsDir);
125818
126737
  const reports = [];
125819
126738
  for (const file of files) {
125820
126739
  if (file.endsWith(".md") || file.endsWith(".json")) {
125821
- const filePath = (0, import_path9.join)(reportsDir, file);
125822
- const stat = await import_fs_extra8.default.stat(filePath);
126740
+ const filePath = (0, import_path12.join)(reportsDir, file);
126741
+ const stat = await import_fs_extra12.default.stat(filePath);
125823
126742
  reports.push({
125824
126743
  name: file,
125825
126744
  date: stat.mtime,
@@ -125904,19 +126823,19 @@ ralphCommand.command("start").description("Verify prerequisites and prepare Ralp
125904
126823
  }
125905
126824
  }
125906
126825
  logger.step(4, 5, "Checking logs directory...");
125907
- const logsDir = (0, import_path9.join)(getRalphDir(), "logs");
125908
- if (await import_fs_extra8.default.pathExists(logsDir)) {
126826
+ const logsDir = (0, import_path12.join)(getRalphDir(), "logs");
126827
+ if (await import_fs_extra12.default.pathExists(logsDir)) {
125909
126828
  logger.success("Logs directory ready");
125910
126829
  } else {
125911
- await import_fs_extra8.default.ensureDir(logsDir);
126830
+ await import_fs_extra12.default.ensureDir(logsDir);
125912
126831
  logger.success("Logs directory created");
125913
126832
  }
125914
126833
  logger.step(5, 5, "Checking reports directory...");
125915
- const reportsDir = (0, import_path9.join)(getRalphDir(), "reports");
125916
- if (await import_fs_extra8.default.pathExists(reportsDir)) {
126834
+ const reportsDir = (0, import_path12.join)(getRalphDir(), "reports");
126835
+ if (await import_fs_extra12.default.pathExists(reportsDir)) {
125917
126836
  logger.success("Reports directory ready");
125918
126837
  } else {
125919
- await import_fs_extra8.default.ensureDir(reportsDir);
126838
+ await import_fs_extra12.default.ensureDir(reportsDir);
125920
126839
  logger.success("Reports directory created");
125921
126840
  }
125922
126841
  console.log();
@@ -125972,9 +126891,9 @@ ralphCommand.command("status").description("Show Ralph status and configuration"
125972
126891
  }
125973
126892
  console.log();
125974
126893
  }
125975
- const logsDir = (0, import_path9.join)(getRalphDir(), "logs");
125976
- if (await import_fs_extra8.default.pathExists(logsDir)) {
125977
- const logFiles = (await import_fs_extra8.default.readdir(logsDir)).filter((f) => f.endsWith(".log"));
126894
+ const logsDir = (0, import_path12.join)(getRalphDir(), "logs");
126895
+ if (await import_fs_extra12.default.pathExists(logsDir)) {
126896
+ const logFiles = (await import_fs_extra12.default.readdir(logsDir)).filter((f) => f.endsWith(".log"));
125978
126897
  if (logFiles.length > 0) {
125979
126898
  console.log(source_default.bold("Logs:"));
125980
126899
  console.log(` ${logFiles.length} log file(s)`);
@@ -126051,7 +126970,7 @@ ralphCommand.command("report").description("List or view feature reports").optio
126051
126970
  logger.header(`Report: ${reportToShow.name}`);
126052
126971
  console.log(source_default.gray(`Date: ${reportToShow.date.toLocaleString()}`));
126053
126972
  console.log(source_default.gray("\u2500".repeat(60)));
126054
- const content = await import_fs_extra8.default.readFile(reportToShow.path, "utf-8");
126973
+ const content = await import_fs_extra12.default.readFile(reportToShow.path, "utf-8");
126055
126974
  console.log(content);
126056
126975
  });
126057
126976
  ralphCommand.command("init").description("Initialize Ralph in the current project").option("-f, --force", "Overwrite existing configuration").action(async (options) => {
@@ -126083,15 +127002,15 @@ ralphCommand.command("init").description("Initialize Ralph in the current projec
126083
127002
 
126084
127003
  // src/commands/doctor.ts
126085
127004
  var import_cli_table34 = __toESM(require_cli_table3());
126086
- var import_child_process7 = require("child_process");
126087
- var import_fs_extra9 = __toESM(require_lib());
126088
- var import_path10 = require("path");
127005
+ var import_child_process8 = require("child_process");
127006
+ var import_fs_extra13 = __toESM(require_lib());
127007
+ var import_path13 = require("path");
126089
127008
  function getNodeVersion() {
126090
127009
  return process.version;
126091
127010
  }
126092
127011
  function getDotNetVersion() {
126093
127012
  try {
126094
- const output = (0, import_child_process7.execSync)("dotnet --version", {
127013
+ const output = (0, import_child_process8.execSync)("dotnet --version", {
126095
127014
  encoding: "utf-8",
126096
127015
  timeout: 5e3,
126097
127016
  stdio: ["pipe", "pipe", "pipe"]
@@ -126103,7 +127022,7 @@ function getDotNetVersion() {
126103
127022
  }
126104
127023
  function getGitVersion() {
126105
127024
  try {
126106
- const output = (0, import_child_process7.execSync)("git --version", {
127025
+ const output = (0, import_child_process8.execSync)("git --version", {
126107
127026
  encoding: "utf-8",
126108
127027
  timeout: 5e3,
126109
127028
  stdio: ["pipe", "pipe", "pipe"]
@@ -126115,7 +127034,7 @@ function getGitVersion() {
126115
127034
  }
126116
127035
  function getNpmVersion() {
126117
127036
  try {
126118
- const output = (0, import_child_process7.execSync)("npm --version", {
127037
+ const output = (0, import_child_process8.execSync)("npm --version", {
126119
127038
  encoding: "utf-8",
126120
127039
  timeout: 5e3,
126121
127040
  stdio: ["pipe", "pipe", "pipe"]
@@ -126127,7 +127046,7 @@ function getNpmVersion() {
126127
127046
  }
126128
127047
  var doctorCommand = new Command("doctor").description("Run diagnostics and check SmartStack health").option("--json", "Output as JSON").option("-v, --verbose", "Show detailed information").action(async (options) => {
126129
127048
  const diagnostics = [];
126130
- const pkg2 = JSON.parse(await import_fs_extra9.default.readFile((0, import_path10.join)(__dirname, "..", "package.json"), "utf-8"));
127049
+ const pkg2 = JSON.parse(await import_fs_extra13.default.readFile((0, import_path13.join)(__dirname, "..", "package.json"), "utf-8"));
126131
127050
  if (!options.json) {
126132
127051
  console.log(source_default.cyan(`
126133
127052
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
@@ -126155,6 +127074,47 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
126155
127074
  fix: "smartstack license activate <key>"
126156
127075
  });
126157
127076
  }
127077
+ try {
127078
+ const baseUrl = await getLicenseServerUrl();
127079
+ const client = new LicenseClient(baseUrl);
127080
+ const healthy = await client.healthCheck();
127081
+ diagnostics.push({
127082
+ name: "License Server",
127083
+ status: healthy ? "ok" : "warning",
127084
+ message: healthy ? `Reachable (${baseUrl})` : "Unreachable",
127085
+ details: !healthy ? "License server is not responding. Online validation will use cache." : void 0
127086
+ });
127087
+ } catch {
127088
+ diagnostics.push({
127089
+ name: "License Server",
127090
+ status: "warning",
127091
+ message: "Could not check server health"
127092
+ });
127093
+ }
127094
+ const cache = await loadCache();
127095
+ if (cache.activation) {
127096
+ diagnostics.push({
127097
+ name: "Activation",
127098
+ status: "ok",
127099
+ message: `Active since ${cache.activation.activatedAt?.split("T")[0] || "unknown"}`,
127100
+ details: `Fingerprint: ${cache.activation.machineFingerprint?.substring(0, 12)}...`
127101
+ });
127102
+ const heartbeatDue = isHeartbeatDue(cache);
127103
+ diagnostics.push({
127104
+ name: "Heartbeat",
127105
+ status: heartbeatDue ? "warning" : "ok",
127106
+ message: heartbeatDue ? `Overdue (last: ${cache.lastHeartbeat || "never"})` : `OK (last: ${cache.lastHeartbeat?.split("T")[0] || "N/A"})`,
127107
+ details: `Interval: ${cache.activation.heartbeatIntervalHours}h`,
127108
+ fix: heartbeatDue ? "Run any command to trigger a heartbeat" : void 0
127109
+ });
127110
+ } else {
127111
+ diagnostics.push({
127112
+ name: "Activation",
127113
+ status: licenseResult.valid ? "warning" : "info",
127114
+ message: "Not activated on this machine",
127115
+ fix: "smartstack license activate <key>"
127116
+ });
127117
+ }
126158
127118
  const nodeVersion = getNodeVersion();
126159
127119
  const nodeVersionNum = parseInt(nodeVersion.replace("v", "").split(".")[0], 10);
126160
127120
  diagnostics.push({
@@ -126233,8 +127193,8 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
126233
127193
  status: installation.gitflow.configExists ? "ok" : "info",
126234
127194
  message: installation.gitflow.configExists ? "Configured" : "Not configured"
126235
127195
  });
126236
- const ralphSkillPath = (0, import_path10.join)(installation.location, "skills", "ralph-loop", "SKILL.md");
126237
- const ralphSkillExists = await import_fs_extra9.default.pathExists(ralphSkillPath);
127196
+ const ralphSkillPath = (0, import_path13.join)(installation.location, "skills", "ralph-loop", "SKILL.md");
127197
+ const ralphSkillExists = await import_fs_extra13.default.pathExists(ralphSkillPath);
126238
127198
  diagnostics.push({
126239
127199
  name: "Ralph Skill",
126240
127200
  status: ralphSkillExists ? "ok" : "warning",
@@ -126243,7 +127203,7 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
126243
127203
  fix: !ralphSkillExists ? "smartstack install" : void 0
126244
127204
  });
126245
127205
  const ralphStatus = await checkRalphInstallation();
126246
- const isSmartStackProject = await import_fs_extra9.default.pathExists((0, import_path10.join)(process.cwd(), ".smartstack", "config.json"));
127206
+ const isSmartStackProject = await import_fs_extra13.default.pathExists((0, import_path13.join)(process.cwd(), ".smartstack", "config.json"));
126247
127207
  const ralphConfigStatus = ralphStatus.configExists ? "ok" : isSmartStackProject ? "warning" : "info";
126248
127208
  diagnostics.push({
126249
127209
  name: "Ralph Config",
@@ -126345,8 +127305,8 @@ ${source_default.gray(item.details)}`;
126345
127305
  var import_mssql = __toESM(require_mssql());
126346
127306
  var import_bcryptjs = __toESM(require_bcryptjs());
126347
127307
  var import_fs4 = require("fs");
126348
- var import_path11 = require("path");
126349
- var import_child_process8 = require("child_process");
127308
+ var import_path14 = require("path");
127309
+ var import_child_process9 = require("child_process");
126350
127310
  function tryLoadNativeDriver() {
126351
127311
  try {
126352
127312
  return require("mssql/msnodesqlv8");
@@ -126373,7 +127333,7 @@ function findAppSettings(apiFolder) {
126373
127333
  return [];
126374
127334
  }
126375
127335
  const files = (0, import_fs4.readdirSync)(apiFolder);
126376
- return files.filter((f) => f.startsWith("appsettings") && f.endsWith(".json")).map((f) => (0, import_path11.join)(apiFolder, f));
127336
+ return files.filter((f) => f.startsWith("appsettings") && f.endsWith(".json")).map((f) => (0, import_path14.join)(apiFolder, f));
126377
127337
  }
126378
127338
  function extractConnectionString(filePath) {
126379
127339
  try {
@@ -126402,7 +127362,7 @@ function executeSqlCmd(server, database, query, sqlAuth) {
126402
127362
  const sqlServer = server === "(local)" ? "." : server;
126403
127363
  const authFlag = sqlAuth ? `-U "${sqlAuth.user}" -P "${sqlAuth.password}"` : "-E";
126404
127364
  const cmd = `sqlcmd -S "${sqlServer}" -d "${database}" ${authFlag} -I -C -Q "${query.replace(/"/g, '\\"')}" -h -1 -W`;
126405
- return (0, import_child_process8.execSync)(cmd, { encoding: "utf-8", timeout: 15e3 }).trim();
127365
+ return (0, import_child_process9.execSync)(cmd, { encoding: "utf-8", timeout: 15e3 }).trim();
126406
127366
  }
126407
127367
  function isLoginFailure(error) {
126408
127368
  const msg = error instanceof Error ? error.message : String(error);
@@ -126442,12 +127402,12 @@ async function promptSqlCredentials() {
126442
127402
  }
126443
127403
  function detectSmartStackApp() {
126444
127404
  const cwd = process.cwd();
126445
- const srcDir = (0, import_path11.join)(cwd, "src");
127405
+ const srcDir = (0, import_path14.join)(cwd, "src");
126446
127406
  if ((0, import_fs4.existsSync)(srcDir)) {
126447
127407
  const folders = (0, import_fs4.readdirSync)(srcDir);
126448
127408
  const apiFolder = folders.find((f) => f.endsWith(".Api"));
126449
127409
  if (apiFolder) {
126450
- return (0, import_path11.join)(srcDir, apiFolder);
127410
+ return (0, import_path14.join)(srcDir, apiFolder);
126451
127411
  }
126452
127412
  }
126453
127413
  const possiblePaths = [
@@ -126482,14 +127442,14 @@ adminCommand.command("reset").description("Reset the localAdmin account password
126482
127442
  process.exit(1);
126483
127443
  }
126484
127444
  let selectedFile;
126485
- const localFile = appSettingsFiles.find((f) => (0, import_path11.basename)(f) === "appsettings.Local.json");
127445
+ const localFile = appSettingsFiles.find((f) => (0, import_path14.basename)(f) === "appsettings.Local.json");
126486
127446
  if (localFile && extractConnectionString(localFile)) {
126487
127447
  selectedFile = localFile;
126488
127448
  } else if (appSettingsFiles.length === 1) {
126489
127449
  selectedFile = appSettingsFiles[0];
126490
127450
  } else {
126491
127451
  const choices = appSettingsFiles.map((f) => ({
126492
- name: (0, import_path11.basename)(f),
127452
+ name: (0, import_path14.basename)(f),
126493
127453
  value: f
126494
127454
  }));
126495
127455
  const { file } = await lib_default.prompt([
@@ -126505,7 +127465,7 @@ adminCommand.command("reset").description("Reset the localAdmin account password
126505
127465
  }
126506
127466
  connectionString = extractConnectionString(selectedFile);
126507
127467
  if (!connectionString) {
126508
- logger.error(`No connection string found in ${(0, import_path11.basename)(selectedFile)}`);
127468
+ logger.error(`No connection string found in ${(0, import_path14.basename)(selectedFile)}`);
126509
127469
  process.exit(1);
126510
127470
  }
126511
127471
  }
@@ -126681,8 +127641,8 @@ adminCommand.command("reset").description("Reset the localAdmin account password
126681
127641
 
126682
127642
  // src/commands/mcp.ts
126683
127643
  var import_cli_table35 = __toESM(require_cli_table3());
126684
- var import_child_process9 = require("child_process");
126685
- var import_os4 = require("os");
127644
+ var import_child_process10 = require("child_process");
127645
+ var import_os6 = require("os");
126686
127646
  var mcpCommand = new Command("mcp").description("MCP server management (CLI + VS Code)").action(() => {
126687
127647
  console.log(source_default.cyan(`
126688
127648
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
@@ -126712,7 +127672,7 @@ mcpCommand.command("install").description("Register MCP servers in Claude Code C
126712
127672
  }));
126713
127673
  currentStep++;
126714
127674
  logger.step(currentStep, totalSteps, "Registering in ~/.claude/settings.json...");
126715
- logger.debug(`Home directory: ${(0, import_os4.homedir)()}`);
127675
+ logger.debug(`Home directory: ${(0, import_os6.homedir)()}`);
126716
127676
  logger.debug(`Target: ${getClaudeSettingsPath()}`);
126717
127677
  const claudeResult = await registerMcpInClaudeSettings(servers);
126718
127678
  if (claudeResult.success) {
@@ -126746,7 +127706,7 @@ mcpCommand.command("install").description("Register MCP servers in Claude Code C
126746
127706
  const serversToInstall = options.force ? REQUIRED_MCP_SERVERS : REQUIRED_MCP_SERVERS.filter((s) => cliResult.missingServers.includes(s.name));
126747
127707
  for (const server of serversToInstall) {
126748
127708
  const spinner = logger.spinner(`Registering ${server.name} in CLI...`);
126749
- const result = (0, import_child_process9.spawnSync)(
127709
+ const result = (0, import_child_process10.spawnSync)(
126750
127710
  "claude",
126751
127711
  ["mcp", "add", "--scope", "user", server.name, "--", server.command, ...server.args],
126752
127712
  { encoding: "utf-8", shell: true, timeout: 15e3 }
@@ -126904,7 +127864,7 @@ mcpCommand.command("remove").description("Unregister MCP servers from CLI and VS
126904
127864
  if (!options.vscodeOnly) {
126905
127865
  logger.info("Removing from Claude Code CLI...");
126906
127866
  for (const server of REQUIRED_MCP_SERVERS) {
126907
- const result = (0, import_child_process9.spawnSync)("claude", ["mcp", "remove", server.name], {
127867
+ const result = (0, import_child_process10.spawnSync)("claude", ["mcp", "remove", server.name], {
126908
127868
  encoding: "utf-8",
126909
127869
  shell: true,
126910
127870
  timeout: 1e4
@@ -126936,8 +127896,8 @@ mcpCommand.command("remove").description("Unregister MCP servers from CLI and VS
126936
127896
  });
126937
127897
 
126938
127898
  // src/commands/derive-prd.ts
126939
- var import_fs_extra10 = __toESM(require_lib());
126940
- var import_path12 = require("path");
127899
+ var import_fs_extra14 = __toESM(require_lib());
127900
+ var import_path15 = require("path");
126941
127901
 
126942
127902
  // src/utils/task-generator.ts
126943
127903
  var LAYER_ORDER = [
@@ -127516,9 +128476,9 @@ function getPrdFileCounts(prd) {
127516
128476
  // src/commands/derive-prd.ts
127517
128477
  function readSmartStackNamespace() {
127518
128478
  try {
127519
- const configPath = (0, import_path12.join)(process.cwd(), ".smartstack", "config.json");
127520
- if (import_fs_extra10.default.existsSync(configPath)) {
127521
- const config = import_fs_extra10.default.readJsonSync(configPath);
128479
+ const configPath = (0, import_path15.join)(process.cwd(), ".smartstack", "config.json");
128480
+ if (import_fs_extra14.default.existsSync(configPath)) {
128481
+ const config = import_fs_extra14.default.readJsonSync(configPath);
127522
128482
  return config.baseNamespace;
127523
128483
  }
127524
128484
  } catch {
@@ -127526,14 +128486,14 @@ function readSmartStackNamespace() {
127526
128486
  return void 0;
127527
128487
  }
127528
128488
  async function findModuleFeatureFiles(masterPath) {
127529
- const master = await import_fs_extra10.default.readJson(masterPath);
127530
- const masterDir = (0, import_path12.dirname)(masterPath);
128489
+ const master = await import_fs_extra14.default.readJson(masterPath);
128490
+ const masterDir = (0, import_path15.dirname)(masterPath);
127531
128491
  const paths = [];
127532
128492
  if (master.modules) {
127533
128493
  for (const mod of master.modules) {
127534
128494
  if (mod.featureJsonPath) {
127535
- const fullPath = (0, import_path12.join)(masterDir, "..", "..", mod.featureJsonPath);
127536
- if (await import_fs_extra10.default.pathExists(fullPath)) {
128495
+ const fullPath = (0, import_path15.join)(masterDir, "..", "..", mod.featureJsonPath);
128496
+ if (await import_fs_extra14.default.pathExists(fullPath)) {
127537
128497
  paths.push(fullPath);
127538
128498
  }
127539
128499
  }
@@ -127547,12 +128507,12 @@ var derivePrdCommand = new Command("derive-prd").description("Extract prd.json p
127547
128507
  process.exit(1);
127548
128508
  }
127549
128509
  const namespace = readSmartStackNamespace();
127550
- const ralphDir = (0, import_path12.join)(process.cwd(), ".ralph");
127551
- await import_fs_extra10.default.ensureDir(ralphDir);
128510
+ const ralphDir = (0, import_path15.join)(process.cwd(), ".ralph");
128511
+ await import_fs_extra14.default.ensureDir(ralphDir);
127552
128512
  let featurePaths = [];
127553
128513
  if (options.application) {
127554
- const appPath = (0, import_path12.join)(process.cwd(), options.application);
127555
- if (!await import_fs_extra10.default.pathExists(appPath)) {
128514
+ const appPath = (0, import_path15.join)(process.cwd(), options.application);
128515
+ if (!await import_fs_extra14.default.pathExists(appPath)) {
127556
128516
  console.log(source_default.red(`Application feature.json not found: ${appPath}`));
127557
128517
  process.exit(1);
127558
128518
  }
@@ -127564,8 +128524,8 @@ var derivePrdCommand = new Command("derive-prd").description("Extract prd.json p
127564
128524
  featurePaths = modulePaths.map((p) => ({ path: p, isApplicationMode: true }));
127565
128525
  console.log(source_default.cyan(`Found ${featurePaths.length} module(s) to process`));
127566
128526
  } else if (options.feature) {
127567
- const featurePath = (0, import_path12.join)(process.cwd(), options.feature);
127568
- if (!await import_fs_extra10.default.pathExists(featurePath)) {
128527
+ const featurePath = (0, import_path15.join)(process.cwd(), options.feature);
128528
+ if (!await import_fs_extra14.default.pathExists(featurePath)) {
127569
128529
  console.log(source_default.red(`Feature.json not found: ${featurePath}`));
127570
128530
  process.exit(1);
127571
128531
  }
@@ -127574,7 +128534,7 @@ var derivePrdCommand = new Command("derive-prd").description("Extract prd.json p
127574
128534
  let totalGenerated = 0;
127575
128535
  let totalErrors = 0;
127576
128536
  for (const entry of featurePaths) {
127577
- const featureJson = await import_fs_extra10.default.readJson(entry.path);
128537
+ const featureJson = await import_fs_extra14.default.readJson(entry.path);
127578
128538
  const moduleName = featureJson.metadata?.module ?? "unknown";
127579
128539
  console.log(source_default.cyan(`
127580
128540
  Processing module: ${source_default.bold(moduleName)}`));
@@ -127592,20 +128552,20 @@ Processing module: ${source_default.bold(moduleName)}`));
127592
128552
  }
127593
128553
  let cliVersion = "unknown";
127594
128554
  try {
127595
- const pkg2 = import_fs_extra10.default.readJsonSync((0, import_path12.join)(__dirname, "..", "..", "package.json"));
128555
+ const pkg2 = import_fs_extra14.default.readJsonSync((0, import_path15.join)(__dirname, "..", "..", "package.json"));
127596
128556
  cliVersion = pkg2.version ?? "unknown";
127597
128557
  } catch {
127598
128558
  }
127599
- const relativePath = (0, import_path12.relative)(process.cwd(), entry.path);
128559
+ const relativePath = (0, import_path15.relative)(process.cwd(), entry.path);
127600
128560
  const unified = extractUnifiedPrd(featureJson, relativePath, namespace, cliVersion);
127601
128561
  const prd = extractPrd(featureJson, relativePath, namespace);
127602
128562
  let outputPath;
127603
128563
  if (options.output && !entry.isApplicationMode) {
127604
- outputPath = (0, import_path12.join)(process.cwd(), options.output);
128564
+ outputPath = (0, import_path15.join)(process.cwd(), options.output);
127605
128565
  } else {
127606
- outputPath = (0, import_path12.join)(ralphDir, `prd-${moduleName}.json`);
128566
+ outputPath = (0, import_path15.join)(ralphDir, `prd-${moduleName}.json`);
127607
128567
  }
127608
- await import_fs_extra10.default.writeJson(outputPath, unified, { spaces: 2 });
128568
+ await import_fs_extra14.default.writeJson(outputPath, unified, { spaces: 2 });
127609
128569
  totalGenerated++;
127610
128570
  const completenessWarnings = validatePrdCompleteness(prd, featureJson);
127611
128571
  if (completenessWarnings.length > 0) {
@@ -127626,7 +128586,7 @@ Processing module: ${source_default.bold(moduleName)}`));
127626
128586
  console.log(source_default.yellow(` - ${te}`));
127627
128587
  }
127628
128588
  }
127629
- const relOutput = (0, import_path12.relative)(process.cwd(), outputPath);
128589
+ const relOutput = (0, import_path15.relative)(process.cwd(), outputPath);
127630
128590
  console.log(source_default.green(` Generated: ${relOutput} (unified v3)`));
127631
128591
  console.log(source_default.gray(` UCs: ${prd.requirements.useCases.length} | FRs: ${prd.requirements.functionalRequirements.length} | BRs: ${prd.businessRules.length}`));
127632
128592
  console.log(source_default.gray(` Endpoints: ${prd.architecture.apiEndpoints.length} | Sections: ${prd.architecture.sections.length}`));
@@ -127654,12 +128614,12 @@ Processing module: ${source_default.bold(moduleName)}`));
127654
128614
  var import_cli_table36 = __toESM(require_cli_table3());
127655
128615
 
127656
128616
  // src/lib/wsl-provisioner.ts
127657
- var import_child_process10 = require("child_process");
128617
+ var import_child_process11 = require("child_process");
127658
128618
  var import_fs5 = require("fs");
127659
- var import_path13 = require("path");
128619
+ var import_path16 = require("path");
127660
128620
  function wslExec(command, timeout = 1e4) {
127661
128621
  try {
127662
- const output = (0, import_child_process10.execSync)(`wsl -e bash -c "${command.replace(/"/g, '\\"')}"`, {
128622
+ const output = (0, import_child_process11.execSync)(`wsl -e bash -c "${command.replace(/"/g, '\\"')}"`, {
127663
128623
  encoding: "utf-8",
127664
128624
  timeout,
127665
128625
  stdio: ["pipe", "pipe", "pipe"]
@@ -127671,7 +128631,7 @@ function wslExec(command, timeout = 1e4) {
127671
128631
  }
127672
128632
  function wslInstall(command, timeout = 12e4) {
127673
128633
  try {
127674
- const output = (0, import_child_process10.execSync)(`wsl -e bash -c "${command.replace(/"/g, '\\"')}"`, {
128634
+ const output = (0, import_child_process11.execSync)(`wsl -e bash -c "${command.replace(/"/g, '\\"')}"`, {
127675
128635
  encoding: "utf-8",
127676
128636
  timeout,
127677
128637
  stdio: ["pipe", "pipe", "pipe"]
@@ -127688,7 +128648,7 @@ function parseWslList(raw) {
127688
128648
  }
127689
128649
  function checkWsl() {
127690
128650
  try {
127691
- const statusRaw = (0, import_child_process10.execSync)("wsl --status", {
128651
+ const statusRaw = (0, import_child_process11.execSync)("wsl --status", {
127692
128652
  encoding: "utf-8",
127693
128653
  timeout: 1e4,
127694
128654
  stdio: ["pipe", "pipe", "pipe"]
@@ -127698,7 +128658,7 @@ function checkWsl() {
127698
128658
  if (versionMatch) version2 = parseInt(versionMatch[1], 10);
127699
128659
  let defaultDistro = null;
127700
128660
  try {
127701
- const listRaw = (0, import_child_process10.execSync)("wsl --list --verbose", {
128661
+ const listRaw = (0, import_child_process11.execSync)("wsl --list --verbose", {
127702
128662
  encoding: "utf-8",
127703
128663
  timeout: 1e4,
127704
128664
  stdio: ["pipe", "pipe", "pipe"]
@@ -127949,7 +128909,7 @@ var SMARTSTACK_PROFILE_NAME = "SmartStack Dev";
127949
128909
  var SMARTSTACK_PROFILE_GUID = "{17ce5bfe-17ed-5f3a-ab15-5cd5baafed5b}";
127950
128910
  function checkWindowsTerminal() {
127951
128911
  try {
127952
- (0, import_child_process10.execSync)("where wt", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 5e3 });
128912
+ (0, import_child_process11.execSync)("where wt", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 5e3 });
127953
128913
  return { installed: true, version: "installed" };
127954
128914
  } catch {
127955
128915
  return { installed: false, version: null };
@@ -127960,7 +128920,7 @@ async function installWindowsTerminal() {
127960
128920
  if (status.installed) return { success: true, version: "installed", skipped: true };
127961
128921
  const spinner = logger.spinner("Installing Windows Terminal via winget...");
127962
128922
  try {
127963
- (0, import_child_process10.execSync)("winget install Microsoft.WindowsTerminal --accept-source-agreements --accept-package-agreements", {
128923
+ (0, import_child_process11.execSync)("winget install Microsoft.WindowsTerminal --accept-source-agreements --accept-package-agreements", {
127964
128924
  encoding: "utf-8",
127965
128925
  timeout: 12e4,
127966
128926
  stdio: ["pipe", "pipe", "pipe"]
@@ -127985,11 +128945,11 @@ async function installWindowsTerminal() {
127985
128945
  function getWtSettingsPath() {
127986
128946
  const localAppData = process.env.LOCALAPPDATA;
127987
128947
  if (!localAppData) return null;
127988
- const standardPath = (0, import_path13.join)(localAppData, "Packages", "Microsoft.WindowsTerminal_8wekyb3d8bbwe", "LocalState", "settings.json");
128948
+ const standardPath = (0, import_path16.join)(localAppData, "Packages", "Microsoft.WindowsTerminal_8wekyb3d8bbwe", "LocalState", "settings.json");
127989
128949
  if ((0, import_fs5.existsSync)(standardPath)) return standardPath;
127990
- const previewPath = (0, import_path13.join)(localAppData, "Packages", "Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe", "LocalState", "settings.json");
128950
+ const previewPath = (0, import_path16.join)(localAppData, "Packages", "Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe", "LocalState", "settings.json");
127991
128951
  if ((0, import_fs5.existsSync)(previewPath)) return previewPath;
127992
- const unpackagedPath = (0, import_path13.join)(localAppData, "Microsoft", "Windows Terminal", "settings.json");
128952
+ const unpackagedPath = (0, import_path16.join)(localAppData, "Microsoft", "Windows Terminal", "settings.json");
127993
128953
  if ((0, import_fs5.existsSync)(unpackagedPath)) return unpackagedPath;
127994
128954
  return null;
127995
128955
  }
@@ -128030,7 +128990,7 @@ function configureWindowsTerminal() {
128030
128990
  }
128031
128991
  function launchWindowsTerminal() {
128032
128992
  try {
128033
- (0, import_child_process10.spawn)("wt", ["-p", SMARTSTACK_PROFILE_NAME], {
128993
+ (0, import_child_process11.spawn)("wt", ["-p", SMARTSTACK_PROFILE_NAME], {
128034
128994
  detached: true,
128035
128995
  stdio: "ignore"
128036
128996
  }).unref();
@@ -128302,9 +129262,9 @@ tmuxCommand.command("status").description("Show WSL development environment stat
128302
129262
 
128303
129263
  // src/index.ts
128304
129264
  var import_fs6 = require("fs");
128305
- var import_path14 = require("path");
128306
- var pkg = JSON.parse((0, import_fs6.readFileSync)((0, import_path14.join)(__dirname, "..", "package.json"), "utf-8"));
128307
- var LICENSE_FREE_COMMANDS = ["license", "help", "--help", "-h", "--version", "-v"];
129265
+ var import_path17 = require("path");
129266
+ var pkg = JSON.parse((0, import_fs6.readFileSync)((0, import_path17.join)(__dirname, "..", "package.json"), "utf-8"));
129267
+ var LICENSE_FREE_COMMANDS = ["license", "doctor", "help", "--help", "-h", "--version", "-v"];
128308
129268
  async function main2() {
128309
129269
  const program2 = new Command();
128310
129270
  program2.name("smartstack").description(source_default.cyan("SmartStack Claude Code automation toolkit")).version(pkg.version, "-v, --version");
@@ -128341,6 +129301,9 @@ async function main2() {
128341
129301
  \u2551 To activate a license: \u2551
128342
129302
  \u2551 ${source_default.cyan("smartstack license activate <your-key>")} \u2551
128343
129303
  \u2551 \u2551
129304
+ \u2551 To request a free trial: \u2551
129305
+ \u2551 ${source_default.cyan("smartstack license trial")} \u2551
129306
+ \u2551 \u2551
128344
129307
  \u2551 To purchase a license: \u2551
128345
129308
  \u2551 ${source_default.cyan("https://atlashub.io/products/smartstack-cli")} \u2551
128346
129309
  \u2551 \u2551
@@ -128348,6 +129311,11 @@ async function main2() {
128348
129311
  `));
128349
129312
  process.exit(1);
128350
129313
  }
129314
+ if (result.warnings?.length) {
129315
+ for (const warning of result.warnings) {
129316
+ console.log(source_default.yellow(`\u26A0 ${warning}`));
129317
+ }
129318
+ }
128351
129319
  }
128352
129320
  program2.action(() => {
128353
129321
  console.log(source_default.cyan(`