@qawolf/cli 1.7.4 → 1.8.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/cli.js CHANGED
@@ -3285,7 +3285,7 @@ var require_atomic_sleep = __commonJS((exports, module) => {
3285
3285
 
3286
3286
  // node_modules/sonic-boom/index.js
3287
3287
  var require_sonic_boom = __commonJS((exports, module) => {
3288
- var fs2 = __require("fs");
3288
+ var fs3 = __require("fs");
3289
3289
  var EventEmitter = __require("events");
3290
3290
  var inherits = __require("util").inherits;
3291
3291
  var path2 = __require("path");
@@ -3343,21 +3343,21 @@ var require_sonic_boom = __commonJS((exports, module) => {
3343
3343
  if (sonic.sync) {
3344
3344
  try {
3345
3345
  if (sonic.mkdir)
3346
- fs2.mkdirSync(path2.dirname(file2), { recursive: true });
3347
- const fd = fs2.openSync(file2, flags, mode);
3346
+ fs3.mkdirSync(path2.dirname(file2), { recursive: true });
3347
+ const fd = fs3.openSync(file2, flags, mode);
3348
3348
  fileOpened(null, fd);
3349
3349
  } catch (err) {
3350
3350
  fileOpened(err);
3351
3351
  throw err;
3352
3352
  }
3353
3353
  } else if (sonic.mkdir) {
3354
- fs2.mkdir(path2.dirname(file2), { recursive: true }, (err) => {
3354
+ fs3.mkdir(path2.dirname(file2), { recursive: true }, (err) => {
3355
3355
  if (err)
3356
3356
  return fileOpened(err);
3357
- fs2.open(file2, flags, mode, fileOpened);
3357
+ fs3.open(file2, flags, mode, fileOpened);
3358
3358
  });
3359
3359
  } else {
3360
- fs2.open(file2, flags, mode, fileOpened);
3360
+ fs3.open(file2, flags, mode, fileOpened);
3361
3361
  }
3362
3362
  }
3363
3363
  function SonicBoom(opts) {
@@ -3398,8 +3398,8 @@ var require_sonic_boom = __commonJS((exports, module) => {
3398
3398
  this.flush = flushBuffer;
3399
3399
  this.flushSync = flushBufferSync;
3400
3400
  this._actualWrite = actualWriteBuffer;
3401
- fsWriteSync = () => fs2.writeSync(this.fd, this._writingBuf);
3402
- fsWrite = () => fs2.write(this.fd, this._writingBuf, this.release);
3401
+ fsWriteSync = () => fs3.writeSync(this.fd, this._writingBuf);
3402
+ fsWrite = () => fs3.write(this.fd, this._writingBuf, this.release);
3403
3403
  } else if (contentMode === undefined || contentMode === kContentModeUtf8) {
3404
3404
  this._writingBuf = "";
3405
3405
  this.write = write;
@@ -3408,15 +3408,15 @@ var require_sonic_boom = __commonJS((exports, module) => {
3408
3408
  this._actualWrite = actualWrite;
3409
3409
  fsWriteSync = () => {
3410
3410
  if (Buffer.isBuffer(this._writingBuf)) {
3411
- return fs2.writeSync(this.fd, this._writingBuf);
3411
+ return fs3.writeSync(this.fd, this._writingBuf);
3412
3412
  }
3413
- return fs2.writeSync(this.fd, this._writingBuf, "utf8");
3413
+ return fs3.writeSync(this.fd, this._writingBuf, "utf8");
3414
3414
  };
3415
3415
  fsWrite = () => {
3416
3416
  if (Buffer.isBuffer(this._writingBuf)) {
3417
- return fs2.write(this.fd, this._writingBuf, this.release);
3417
+ return fs3.write(this.fd, this._writingBuf, this.release);
3418
3418
  }
3419
- return fs2.write(this.fd, this._writingBuf, "utf8", this.release);
3419
+ return fs3.write(this.fd, this._writingBuf, "utf8", this.release);
3420
3420
  };
3421
3421
  } else {
3422
3422
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
@@ -3473,7 +3473,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3473
3473
  }
3474
3474
  }
3475
3475
  if (this._fsync) {
3476
- fs2.fsyncSync(this.fd);
3476
+ fs3.fsyncSync(this.fd);
3477
3477
  }
3478
3478
  const len = this._len;
3479
3479
  if (this._reopening) {
@@ -3588,7 +3588,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3588
3588
  const onDrain = () => {
3589
3589
  if (!this._fsync) {
3590
3590
  try {
3591
- fs2.fsync(this.fd, (err) => {
3591
+ fs3.fsync(this.fd, (err) => {
3592
3592
  this._flushPending = false;
3593
3593
  cb(err);
3594
3594
  });
@@ -3690,7 +3690,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3690
3690
  const fd = this.fd;
3691
3691
  this.once("ready", () => {
3692
3692
  if (fd !== this.fd) {
3693
- fs2.close(fd, (err) => {
3693
+ fs3.close(fd, (err) => {
3694
3694
  if (err) {
3695
3695
  return this.emit("error", err);
3696
3696
  }
@@ -3739,7 +3739,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3739
3739
  buf = this._bufs[0];
3740
3740
  }
3741
3741
  try {
3742
- const n = Buffer.isBuffer(buf) ? fs2.writeSync(this.fd, buf) : fs2.writeSync(this.fd, buf, "utf8");
3742
+ const n = Buffer.isBuffer(buf) ? fs3.writeSync(this.fd, buf) : fs3.writeSync(this.fd, buf, "utf8");
3743
3743
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
3744
3744
  buf = releasedBufObj.writingBuf;
3745
3745
  this._len = releasedBufObj.len;
@@ -3755,7 +3755,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3755
3755
  }
3756
3756
  }
3757
3757
  try {
3758
- fs2.fsyncSync(this.fd);
3758
+ fs3.fsyncSync(this.fd);
3759
3759
  } catch {}
3760
3760
  }
3761
3761
  function flushBufferSync() {
@@ -3775,7 +3775,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3775
3775
  buf = mergeBuf(this._bufs[0], this._lens[0]);
3776
3776
  }
3777
3777
  try {
3778
- const n = fs2.writeSync(this.fd, buf);
3778
+ const n = fs3.writeSync(this.fd, buf);
3779
3779
  buf = buf.subarray(n);
3780
3780
  this._len = Math.max(this._len - n, 0);
3781
3781
  if (buf.length <= 0) {
@@ -3803,13 +3803,13 @@ var require_sonic_boom = __commonJS((exports, module) => {
3803
3803
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
3804
3804
  if (this.sync) {
3805
3805
  try {
3806
- const written = Buffer.isBuffer(this._writingBuf) ? fs2.writeSync(this.fd, this._writingBuf) : fs2.writeSync(this.fd, this._writingBuf, "utf8");
3806
+ const written = Buffer.isBuffer(this._writingBuf) ? fs3.writeSync(this.fd, this._writingBuf) : fs3.writeSync(this.fd, this._writingBuf, "utf8");
3807
3807
  release(null, written);
3808
3808
  } catch (err) {
3809
3809
  release(err);
3810
3810
  }
3811
3811
  } else {
3812
- fs2.write(this.fd, this._writingBuf, release);
3812
+ fs3.write(this.fd, this._writingBuf, release);
3813
3813
  }
3814
3814
  }
3815
3815
  function actualWriteBuffer() {
@@ -3818,7 +3818,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3818
3818
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
3819
3819
  if (this.sync) {
3820
3820
  try {
3821
- const written = fs2.writeSync(this.fd, this._writingBuf);
3821
+ const written = fs3.writeSync(this.fd, this._writingBuf);
3822
3822
  release(null, written);
3823
3823
  } catch (err) {
3824
3824
  release(err);
@@ -3827,7 +3827,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
3827
3827
  if (kCopyBuffer) {
3828
3828
  this._writingBuf = Buffer.from(this._writingBuf);
3829
3829
  }
3830
- fs2.write(this.fd, this._writingBuf, release);
3830
+ fs3.write(this.fd, this._writingBuf, release);
3831
3831
  }
3832
3832
  }
3833
3833
  function actualClose(sonic) {
@@ -3843,11 +3843,11 @@ var require_sonic_boom = __commonJS((exports, module) => {
3843
3843
  sonic._lens = [];
3844
3844
  assert2(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
3845
3845
  try {
3846
- fs2.fsync(sonic.fd, closeWrapped);
3846
+ fs3.fsync(sonic.fd, closeWrapped);
3847
3847
  } catch {}
3848
3848
  function closeWrapped() {
3849
3849
  if (sonic.fd !== 1 && sonic.fd !== 2) {
3850
- fs2.close(sonic.fd, done);
3850
+ fs3.close(sonic.fd, done);
3851
3851
  } else {
3852
3852
  done();
3853
3853
  }
@@ -17258,14 +17258,14 @@ var require_load = __commonJS((exports, module) => {
17258
17258
  zipEntries.load(data2);
17259
17259
  return zipEntries;
17260
17260
  }).then(function checkCRC32(zipEntries) {
17261
- var promises2 = [external2.Promise.resolve(zipEntries)];
17261
+ var promises3 = [external2.Promise.resolve(zipEntries)];
17262
17262
  var files = zipEntries.files;
17263
17263
  if (options.checkCRC32) {
17264
17264
  for (var i2 = 0;i2 < files.length; i2++) {
17265
- promises2.push(checkEntryCRC32(files[i2]));
17265
+ promises3.push(checkEntryCRC32(files[i2]));
17266
17266
  }
17267
17267
  }
17268
- return external2.Promise.all(promises2);
17268
+ return external2.Promise.all(promises3);
17269
17269
  }).then(function addFiles(results) {
17270
17270
  var zipEntries = results.shift();
17271
17271
  var files = zipEntries.files;
@@ -18963,7 +18963,7 @@ var init_strip_ansi = __esm(() => {
18963
18963
  });
18964
18964
 
18965
18965
  // node_modules/@wdio/logger/build/index.js
18966
- import fs3 from "node:fs";
18966
+ import fs4 from "node:fs";
18967
18967
  import util from "node:util";
18968
18968
  function getLogger(name) {
18969
18969
  if (loggers[name]) {
@@ -19042,7 +19042,7 @@ var import_safe_regex2, import_loglevel, import_loglevel_plugin_prefix, SENSITIV
19042
19042
  const rawMethod = originalFactory(methodName, logLevel, loggerName);
19043
19043
  return (...args) => {
19044
19044
  if (!logFile && process.env.WDIO_LOG_PATH) {
19045
- logFile = fs3.createWriteStream(process.env.WDIO_LOG_PATH);
19045
+ logFile = fs4.createWriteStream(process.env.WDIO_LOG_PATH);
19046
19046
  }
19047
19047
  const match = Object.values(matches).filter((x) => args[0].endsWith(`: ${x}`))[0];
19048
19048
  if (match) {
@@ -20043,13 +20043,13 @@ var require_minimatch = __commonJS((exports, module) => {
20043
20043
  // node_modules/readdir-glob/index.js
20044
20044
  var require_readdir_glob = __commonJS((exports, module) => {
20045
20045
  module.exports = readdirGlob;
20046
- var fs4 = __require("fs");
20046
+ var fs5 = __require("fs");
20047
20047
  var { EventEmitter } = __require("events");
20048
20048
  var { Minimatch } = require_minimatch();
20049
20049
  var { resolve: resolve10 } = __require("path");
20050
20050
  function readdir3(dir, strict) {
20051
20051
  return new Promise((resolve11, reject) => {
20052
- fs4.readdir(dir, { withFileTypes: true }, (err, files) => {
20052
+ fs5.readdir(dir, { withFileTypes: true }, (err, files) => {
20053
20053
  if (err) {
20054
20054
  switch (err.code) {
20055
20055
  case "ENOTDIR":
@@ -20078,7 +20078,7 @@ var require_readdir_glob = __commonJS((exports, module) => {
20078
20078
  }
20079
20079
  function stat2(file2, followSymlinks) {
20080
20080
  return new Promise((resolve11, reject) => {
20081
- const statFunc = followSymlinks ? fs4.stat : fs4.lstat;
20081
+ const statFunc = followSymlinks ? fs5.stat : fs5.lstat;
20082
20082
  statFunc(file2, (err, stats) => {
20083
20083
  if (err) {
20084
20084
  switch (err.code) {
@@ -22202,54 +22202,54 @@ var require_polyfills = __commonJS((exports, module) => {
22202
22202
  }
22203
22203
  var chdir;
22204
22204
  module.exports = patch;
22205
- function patch(fs4) {
22205
+ function patch(fs5) {
22206
22206
  if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
22207
- patchLchmod(fs4);
22208
- }
22209
- if (!fs4.lutimes) {
22210
- patchLutimes(fs4);
22211
- }
22212
- fs4.chown = chownFix(fs4.chown);
22213
- fs4.fchown = chownFix(fs4.fchown);
22214
- fs4.lchown = chownFix(fs4.lchown);
22215
- fs4.chmod = chmodFix(fs4.chmod);
22216
- fs4.fchmod = chmodFix(fs4.fchmod);
22217
- fs4.lchmod = chmodFix(fs4.lchmod);
22218
- fs4.chownSync = chownFixSync(fs4.chownSync);
22219
- fs4.fchownSync = chownFixSync(fs4.fchownSync);
22220
- fs4.lchownSync = chownFixSync(fs4.lchownSync);
22221
- fs4.chmodSync = chmodFixSync(fs4.chmodSync);
22222
- fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
22223
- fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
22224
- fs4.stat = statFix(fs4.stat);
22225
- fs4.fstat = statFix(fs4.fstat);
22226
- fs4.lstat = statFix(fs4.lstat);
22227
- fs4.statSync = statFixSync(fs4.statSync);
22228
- fs4.fstatSync = statFixSync(fs4.fstatSync);
22229
- fs4.lstatSync = statFixSync(fs4.lstatSync);
22230
- if (fs4.chmod && !fs4.lchmod) {
22231
- fs4.lchmod = function(path3, mode, cb) {
22207
+ patchLchmod(fs5);
22208
+ }
22209
+ if (!fs5.lutimes) {
22210
+ patchLutimes(fs5);
22211
+ }
22212
+ fs5.chown = chownFix(fs5.chown);
22213
+ fs5.fchown = chownFix(fs5.fchown);
22214
+ fs5.lchown = chownFix(fs5.lchown);
22215
+ fs5.chmod = chmodFix(fs5.chmod);
22216
+ fs5.fchmod = chmodFix(fs5.fchmod);
22217
+ fs5.lchmod = chmodFix(fs5.lchmod);
22218
+ fs5.chownSync = chownFixSync(fs5.chownSync);
22219
+ fs5.fchownSync = chownFixSync(fs5.fchownSync);
22220
+ fs5.lchownSync = chownFixSync(fs5.lchownSync);
22221
+ fs5.chmodSync = chmodFixSync(fs5.chmodSync);
22222
+ fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
22223
+ fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
22224
+ fs5.stat = statFix(fs5.stat);
22225
+ fs5.fstat = statFix(fs5.fstat);
22226
+ fs5.lstat = statFix(fs5.lstat);
22227
+ fs5.statSync = statFixSync(fs5.statSync);
22228
+ fs5.fstatSync = statFixSync(fs5.fstatSync);
22229
+ fs5.lstatSync = statFixSync(fs5.lstatSync);
22230
+ if (fs5.chmod && !fs5.lchmod) {
22231
+ fs5.lchmod = function(path3, mode, cb) {
22232
22232
  if (cb)
22233
22233
  process.nextTick(cb);
22234
22234
  };
22235
- fs4.lchmodSync = function() {};
22235
+ fs5.lchmodSync = function() {};
22236
22236
  }
22237
- if (fs4.chown && !fs4.lchown) {
22238
- fs4.lchown = function(path3, uid, gid, cb) {
22237
+ if (fs5.chown && !fs5.lchown) {
22238
+ fs5.lchown = function(path3, uid, gid, cb) {
22239
22239
  if (cb)
22240
22240
  process.nextTick(cb);
22241
22241
  };
22242
- fs4.lchownSync = function() {};
22242
+ fs5.lchownSync = function() {};
22243
22243
  }
22244
22244
  if (platform === "win32") {
22245
- fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
22245
+ fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : function(fs$rename) {
22246
22246
  function rename(from, to2, cb) {
22247
22247
  var start = Date.now();
22248
22248
  var backoff = 0;
22249
22249
  fs$rename(from, to2, function CB(er2) {
22250
22250
  if (er2 && (er2.code === "EACCES" || er2.code === "EPERM" || er2.code === "EBUSY") && Date.now() - start < 60000) {
22251
22251
  setTimeout(function() {
22252
- fs4.stat(to2, function(stater, st2) {
22252
+ fs5.stat(to2, function(stater, st2) {
22253
22253
  if (stater && stater.code === "ENOENT")
22254
22254
  fs$rename(from, to2, CB);
22255
22255
  else
@@ -22267,9 +22267,9 @@ var require_polyfills = __commonJS((exports, module) => {
22267
22267
  if (Object.setPrototypeOf)
22268
22268
  Object.setPrototypeOf(rename, fs$rename);
22269
22269
  return rename;
22270
- }(fs4.rename);
22270
+ }(fs5.rename);
22271
22271
  }
22272
- fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
22272
+ fs5.read = typeof fs5.read !== "function" ? fs5.read : function(fs$read) {
22273
22273
  function read(fd, buffer, offset, length, position, callback_) {
22274
22274
  var callback2;
22275
22275
  if (callback_ && typeof callback_ === "function") {
@@ -22277,23 +22277,23 @@ var require_polyfills = __commonJS((exports, module) => {
22277
22277
  callback2 = function(er2, _4, __) {
22278
22278
  if (er2 && er2.code === "EAGAIN" && eagCounter < 10) {
22279
22279
  eagCounter++;
22280
- return fs$read.call(fs4, fd, buffer, offset, length, position, callback2);
22280
+ return fs$read.call(fs5, fd, buffer, offset, length, position, callback2);
22281
22281
  }
22282
22282
  callback_.apply(this, arguments);
22283
22283
  };
22284
22284
  }
22285
- return fs$read.call(fs4, fd, buffer, offset, length, position, callback2);
22285
+ return fs$read.call(fs5, fd, buffer, offset, length, position, callback2);
22286
22286
  }
22287
22287
  if (Object.setPrototypeOf)
22288
22288
  Object.setPrototypeOf(read, fs$read);
22289
22289
  return read;
22290
- }(fs4.read);
22291
- fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : function(fs$readSync) {
22290
+ }(fs5.read);
22291
+ fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : function(fs$readSync) {
22292
22292
  return function(fd, buffer, offset, length, position) {
22293
22293
  var eagCounter = 0;
22294
22294
  while (true) {
22295
22295
  try {
22296
- return fs$readSync.call(fs4, fd, buffer, offset, length, position);
22296
+ return fs$readSync.call(fs5, fd, buffer, offset, length, position);
22297
22297
  } catch (er2) {
22298
22298
  if (er2.code === "EAGAIN" && eagCounter < 10) {
22299
22299
  eagCounter++;
@@ -22303,90 +22303,90 @@ var require_polyfills = __commonJS((exports, module) => {
22303
22303
  }
22304
22304
  }
22305
22305
  };
22306
- }(fs4.readSync);
22307
- function patchLchmod(fs5) {
22308
- fs5.lchmod = function(path3, mode, callback2) {
22309
- fs5.open(path3, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
22306
+ }(fs5.readSync);
22307
+ function patchLchmod(fs6) {
22308
+ fs6.lchmod = function(path3, mode, callback2) {
22309
+ fs6.open(path3, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
22310
22310
  if (err) {
22311
22311
  if (callback2)
22312
22312
  callback2(err);
22313
22313
  return;
22314
22314
  }
22315
- fs5.fchmod(fd, mode, function(err2) {
22316
- fs5.close(fd, function(err22) {
22315
+ fs6.fchmod(fd, mode, function(err2) {
22316
+ fs6.close(fd, function(err22) {
22317
22317
  if (callback2)
22318
22318
  callback2(err2 || err22);
22319
22319
  });
22320
22320
  });
22321
22321
  });
22322
22322
  };
22323
- fs5.lchmodSync = function(path3, mode) {
22324
- var fd = fs5.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
22323
+ fs6.lchmodSync = function(path3, mode) {
22324
+ var fd = fs6.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
22325
22325
  var threw = true;
22326
22326
  var ret;
22327
22327
  try {
22328
- ret = fs5.fchmodSync(fd, mode);
22328
+ ret = fs6.fchmodSync(fd, mode);
22329
22329
  threw = false;
22330
22330
  } finally {
22331
22331
  if (threw) {
22332
22332
  try {
22333
- fs5.closeSync(fd);
22333
+ fs6.closeSync(fd);
22334
22334
  } catch (er2) {}
22335
22335
  } else {
22336
- fs5.closeSync(fd);
22336
+ fs6.closeSync(fd);
22337
22337
  }
22338
22338
  }
22339
22339
  return ret;
22340
22340
  };
22341
22341
  }
22342
- function patchLutimes(fs5) {
22343
- if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
22344
- fs5.lutimes = function(path3, at2, mt2, cb) {
22345
- fs5.open(path3, constants.O_SYMLINK, function(er2, fd) {
22342
+ function patchLutimes(fs6) {
22343
+ if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
22344
+ fs6.lutimes = function(path3, at2, mt2, cb) {
22345
+ fs6.open(path3, constants.O_SYMLINK, function(er2, fd) {
22346
22346
  if (er2) {
22347
22347
  if (cb)
22348
22348
  cb(er2);
22349
22349
  return;
22350
22350
  }
22351
- fs5.futimes(fd, at2, mt2, function(er3) {
22352
- fs5.close(fd, function(er22) {
22351
+ fs6.futimes(fd, at2, mt2, function(er3) {
22352
+ fs6.close(fd, function(er22) {
22353
22353
  if (cb)
22354
22354
  cb(er3 || er22);
22355
22355
  });
22356
22356
  });
22357
22357
  });
22358
22358
  };
22359
- fs5.lutimesSync = function(path3, at2, mt2) {
22360
- var fd = fs5.openSync(path3, constants.O_SYMLINK);
22359
+ fs6.lutimesSync = function(path3, at2, mt2) {
22360
+ var fd = fs6.openSync(path3, constants.O_SYMLINK);
22361
22361
  var ret;
22362
22362
  var threw = true;
22363
22363
  try {
22364
- ret = fs5.futimesSync(fd, at2, mt2);
22364
+ ret = fs6.futimesSync(fd, at2, mt2);
22365
22365
  threw = false;
22366
22366
  } finally {
22367
22367
  if (threw) {
22368
22368
  try {
22369
- fs5.closeSync(fd);
22369
+ fs6.closeSync(fd);
22370
22370
  } catch (er2) {}
22371
22371
  } else {
22372
- fs5.closeSync(fd);
22372
+ fs6.closeSync(fd);
22373
22373
  }
22374
22374
  }
22375
22375
  return ret;
22376
22376
  };
22377
- } else if (fs5.futimes) {
22378
- fs5.lutimes = function(_a3, _b, _c, cb) {
22377
+ } else if (fs6.futimes) {
22378
+ fs6.lutimes = function(_a3, _b, _c, cb) {
22379
22379
  if (cb)
22380
22380
  process.nextTick(cb);
22381
22381
  };
22382
- fs5.lutimesSync = function() {};
22382
+ fs6.lutimesSync = function() {};
22383
22383
  }
22384
22384
  }
22385
22385
  function chmodFix(orig) {
22386
22386
  if (!orig)
22387
22387
  return orig;
22388
22388
  return function(target, mode, cb) {
22389
- return orig.call(fs4, target, mode, function(er2) {
22389
+ return orig.call(fs5, target, mode, function(er2) {
22390
22390
  if (chownErOk(er2))
22391
22391
  er2 = null;
22392
22392
  if (cb)
@@ -22399,7 +22399,7 @@ var require_polyfills = __commonJS((exports, module) => {
22399
22399
  return orig;
22400
22400
  return function(target, mode) {
22401
22401
  try {
22402
- return orig.call(fs4, target, mode);
22402
+ return orig.call(fs5, target, mode);
22403
22403
  } catch (er2) {
22404
22404
  if (!chownErOk(er2))
22405
22405
  throw er2;
@@ -22410,7 +22410,7 @@ var require_polyfills = __commonJS((exports, module) => {
22410
22410
  if (!orig)
22411
22411
  return orig;
22412
22412
  return function(target, uid, gid, cb) {
22413
- return orig.call(fs4, target, uid, gid, function(er2) {
22413
+ return orig.call(fs5, target, uid, gid, function(er2) {
22414
22414
  if (chownErOk(er2))
22415
22415
  er2 = null;
22416
22416
  if (cb)
@@ -22423,7 +22423,7 @@ var require_polyfills = __commonJS((exports, module) => {
22423
22423
  return orig;
22424
22424
  return function(target, uid, gid) {
22425
22425
  try {
22426
- return orig.call(fs4, target, uid, gid);
22426
+ return orig.call(fs5, target, uid, gid);
22427
22427
  } catch (er2) {
22428
22428
  if (!chownErOk(er2))
22429
22429
  throw er2;
@@ -22448,14 +22448,14 @@ var require_polyfills = __commonJS((exports, module) => {
22448
22448
  if (cb)
22449
22449
  cb.apply(this, arguments);
22450
22450
  }
22451
- return options ? orig.call(fs4, target, options, callback2) : orig.call(fs4, target, callback2);
22451
+ return options ? orig.call(fs5, target, options, callback2) : orig.call(fs5, target, callback2);
22452
22452
  };
22453
22453
  }
22454
22454
  function statFixSync(orig) {
22455
22455
  if (!orig)
22456
22456
  return orig;
22457
22457
  return function(target, options) {
22458
- var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
22458
+ var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
22459
22459
  if (stats) {
22460
22460
  if (stats.uid < 0)
22461
22461
  stats.uid += 4294967296;
@@ -22484,7 +22484,7 @@ var require_polyfills = __commonJS((exports, module) => {
22484
22484
  var require_legacy_streams = __commonJS((exports, module) => {
22485
22485
  var Stream = __require("stream").Stream;
22486
22486
  module.exports = legacy;
22487
- function legacy(fs4) {
22487
+ function legacy(fs5) {
22488
22488
  return {
22489
22489
  ReadStream: ReadStream2,
22490
22490
  WriteStream
@@ -22529,7 +22529,7 @@ var require_legacy_streams = __commonJS((exports, module) => {
22529
22529
  });
22530
22530
  return;
22531
22531
  }
22532
- fs4.open(this.path, this.flags, this.mode, function(err, fd) {
22532
+ fs5.open(this.path, this.flags, this.mode, function(err, fd) {
22533
22533
  if (err) {
22534
22534
  self2.emit("error", err);
22535
22535
  self2.readable = false;
@@ -22569,7 +22569,7 @@ var require_legacy_streams = __commonJS((exports, module) => {
22569
22569
  this.busy = false;
22570
22570
  this._queue = [];
22571
22571
  if (this.fd === null) {
22572
- this._open = fs4.open;
22572
+ this._open = fs5.open;
22573
22573
  this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
22574
22574
  this.flush();
22575
22575
  }
@@ -22599,7 +22599,7 @@ var require_clone = __commonJS((exports, module) => {
22599
22599
 
22600
22600
  // node_modules/graceful-fs/graceful-fs.js
22601
22601
  var require_graceful_fs = __commonJS((exports, module) => {
22602
- var fs4 = __require("fs");
22602
+ var fs5 = __require("fs");
22603
22603
  var polyfills = require_polyfills();
22604
22604
  var legacy = require_legacy_streams();
22605
22605
  var clone2 = require_clone();
@@ -22631,12 +22631,12 @@ var require_graceful_fs = __commonJS((exports, module) => {
22631
22631
  GFS4: `);
22632
22632
  console.error(m4);
22633
22633
  };
22634
- if (!fs4[gracefulQueue]) {
22634
+ if (!fs5[gracefulQueue]) {
22635
22635
  queue = global[gracefulQueue] || [];
22636
- publishQueue(fs4, queue);
22637
- fs4.close = function(fs$close) {
22636
+ publishQueue(fs5, queue);
22637
+ fs5.close = function(fs$close) {
22638
22638
  function close(fd, cb) {
22639
- return fs$close.call(fs4, fd, function(err) {
22639
+ return fs$close.call(fs5, fd, function(err) {
22640
22640
  if (!err) {
22641
22641
  resetQueue();
22642
22642
  }
@@ -22648,40 +22648,40 @@ GFS4: `);
22648
22648
  value: fs$close
22649
22649
  });
22650
22650
  return close;
22651
- }(fs4.close);
22652
- fs4.closeSync = function(fs$closeSync) {
22651
+ }(fs5.close);
22652
+ fs5.closeSync = function(fs$closeSync) {
22653
22653
  function closeSync(fd) {
22654
- fs$closeSync.apply(fs4, arguments);
22654
+ fs$closeSync.apply(fs5, arguments);
22655
22655
  resetQueue();
22656
22656
  }
22657
22657
  Object.defineProperty(closeSync, previousSymbol, {
22658
22658
  value: fs$closeSync
22659
22659
  });
22660
22660
  return closeSync;
22661
- }(fs4.closeSync);
22661
+ }(fs5.closeSync);
22662
22662
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
22663
22663
  process.on("exit", function() {
22664
- debug(fs4[gracefulQueue]);
22665
- __require("assert").equal(fs4[gracefulQueue].length, 0);
22664
+ debug(fs5[gracefulQueue]);
22665
+ __require("assert").equal(fs5[gracefulQueue].length, 0);
22666
22666
  });
22667
22667
  }
22668
22668
  }
22669
22669
  var queue;
22670
22670
  if (!global[gracefulQueue]) {
22671
- publishQueue(global, fs4[gracefulQueue]);
22672
- }
22673
- module.exports = patch(clone2(fs4));
22674
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
22675
- module.exports = patch(fs4);
22676
- fs4.__patched = true;
22677
- }
22678
- function patch(fs5) {
22679
- polyfills(fs5);
22680
- fs5.gracefulify = patch;
22681
- fs5.createReadStream = createReadStream2;
22682
- fs5.createWriteStream = createWriteStream;
22683
- var fs$readFile = fs5.readFile;
22684
- fs5.readFile = readFile;
22671
+ publishQueue(global, fs5[gracefulQueue]);
22672
+ }
22673
+ module.exports = patch(clone2(fs5));
22674
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
22675
+ module.exports = patch(fs5);
22676
+ fs5.__patched = true;
22677
+ }
22678
+ function patch(fs6) {
22679
+ polyfills(fs6);
22680
+ fs6.gracefulify = patch;
22681
+ fs6.createReadStream = createReadStream2;
22682
+ fs6.createWriteStream = createWriteStream;
22683
+ var fs$readFile = fs6.readFile;
22684
+ fs6.readFile = readFile;
22685
22685
  function readFile(path3, options, cb) {
22686
22686
  if (typeof options === "function")
22687
22687
  cb = options, options = null;
@@ -22697,8 +22697,8 @@ GFS4: `);
22697
22697
  });
22698
22698
  }
22699
22699
  }
22700
- var fs$writeFile = fs5.writeFile;
22701
- fs5.writeFile = writeFile;
22700
+ var fs$writeFile = fs6.writeFile;
22701
+ fs6.writeFile = writeFile;
22702
22702
  function writeFile(path3, data, options, cb) {
22703
22703
  if (typeof options === "function")
22704
22704
  cb = options, options = null;
@@ -22714,9 +22714,9 @@ GFS4: `);
22714
22714
  });
22715
22715
  }
22716
22716
  }
22717
- var fs$appendFile = fs5.appendFile;
22717
+ var fs$appendFile = fs6.appendFile;
22718
22718
  if (fs$appendFile)
22719
- fs5.appendFile = appendFile;
22719
+ fs6.appendFile = appendFile;
22720
22720
  function appendFile(path3, data, options, cb) {
22721
22721
  if (typeof options === "function")
22722
22722
  cb = options, options = null;
@@ -22732,9 +22732,9 @@ GFS4: `);
22732
22732
  });
22733
22733
  }
22734
22734
  }
22735
- var fs$copyFile = fs5.copyFile;
22735
+ var fs$copyFile = fs6.copyFile;
22736
22736
  if (fs$copyFile)
22737
- fs5.copyFile = copyFile;
22737
+ fs6.copyFile = copyFile;
22738
22738
  function copyFile(src, dest, flags, cb) {
22739
22739
  if (typeof flags === "function") {
22740
22740
  cb = flags;
@@ -22752,8 +22752,8 @@ GFS4: `);
22752
22752
  });
22753
22753
  }
22754
22754
  }
22755
- var fs$readdir = fs5.readdir;
22756
- fs5.readdir = readdir3;
22755
+ var fs$readdir = fs6.readdir;
22756
+ fs6.readdir = readdir3;
22757
22757
  var noReaddirOptionVersions = /^v[0-5]\./;
22758
22758
  function readdir3(path3, options, cb) {
22759
22759
  if (typeof options === "function")
@@ -22784,21 +22784,21 @@ GFS4: `);
22784
22784
  }
22785
22785
  }
22786
22786
  if (process.version.substr(0, 4) === "v0.8") {
22787
- var legStreams = legacy(fs5);
22787
+ var legStreams = legacy(fs6);
22788
22788
  ReadStream2 = legStreams.ReadStream;
22789
22789
  WriteStream = legStreams.WriteStream;
22790
22790
  }
22791
- var fs$ReadStream = fs5.ReadStream;
22791
+ var fs$ReadStream = fs6.ReadStream;
22792
22792
  if (fs$ReadStream) {
22793
22793
  ReadStream2.prototype = Object.create(fs$ReadStream.prototype);
22794
22794
  ReadStream2.prototype.open = ReadStream$open;
22795
22795
  }
22796
- var fs$WriteStream = fs5.WriteStream;
22796
+ var fs$WriteStream = fs6.WriteStream;
22797
22797
  if (fs$WriteStream) {
22798
22798
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
22799
22799
  WriteStream.prototype.open = WriteStream$open;
22800
22800
  }
22801
- Object.defineProperty(fs5, "ReadStream", {
22801
+ Object.defineProperty(fs6, "ReadStream", {
22802
22802
  get: function() {
22803
22803
  return ReadStream2;
22804
22804
  },
@@ -22808,7 +22808,7 @@ GFS4: `);
22808
22808
  enumerable: true,
22809
22809
  configurable: true
22810
22810
  });
22811
- Object.defineProperty(fs5, "WriteStream", {
22811
+ Object.defineProperty(fs6, "WriteStream", {
22812
22812
  get: function() {
22813
22813
  return WriteStream;
22814
22814
  },
@@ -22819,7 +22819,7 @@ GFS4: `);
22819
22819
  configurable: true
22820
22820
  });
22821
22821
  var FileReadStream = ReadStream2;
22822
- Object.defineProperty(fs5, "FileReadStream", {
22822
+ Object.defineProperty(fs6, "FileReadStream", {
22823
22823
  get: function() {
22824
22824
  return FileReadStream;
22825
22825
  },
@@ -22830,7 +22830,7 @@ GFS4: `);
22830
22830
  configurable: true
22831
22831
  });
22832
22832
  var FileWriteStream = WriteStream;
22833
- Object.defineProperty(fs5, "FileWriteStream", {
22833
+ Object.defineProperty(fs6, "FileWriteStream", {
22834
22834
  get: function() {
22835
22835
  return FileWriteStream;
22836
22836
  },
@@ -22879,13 +22879,13 @@ GFS4: `);
22879
22879
  });
22880
22880
  }
22881
22881
  function createReadStream2(path3, options) {
22882
- return new fs5.ReadStream(path3, options);
22882
+ return new fs6.ReadStream(path3, options);
22883
22883
  }
22884
22884
  function createWriteStream(path3, options) {
22885
- return new fs5.WriteStream(path3, options);
22885
+ return new fs6.WriteStream(path3, options);
22886
22886
  }
22887
- var fs$open = fs5.open;
22888
- fs5.open = open;
22887
+ var fs$open = fs6.open;
22888
+ fs6.open = open;
22889
22889
  function open(path3, flags, mode, cb) {
22890
22890
  if (typeof mode === "function")
22891
22891
  cb = mode, mode = null;
@@ -22901,20 +22901,20 @@ GFS4: `);
22901
22901
  });
22902
22902
  }
22903
22903
  }
22904
- return fs5;
22904
+ return fs6;
22905
22905
  }
22906
22906
  function enqueue(elem) {
22907
22907
  debug("ENQUEUE", elem[0].name, elem[1]);
22908
- fs4[gracefulQueue].push(elem);
22908
+ fs5[gracefulQueue].push(elem);
22909
22909
  retry();
22910
22910
  }
22911
22911
  var retryTimer;
22912
22912
  function resetQueue() {
22913
22913
  var now = Date.now();
22914
- for (var i2 = 0;i2 < fs4[gracefulQueue].length; ++i2) {
22915
- if (fs4[gracefulQueue][i2].length > 2) {
22916
- fs4[gracefulQueue][i2][3] = now;
22917
- fs4[gracefulQueue][i2][4] = now;
22914
+ for (var i2 = 0;i2 < fs5[gracefulQueue].length; ++i2) {
22915
+ if (fs5[gracefulQueue][i2].length > 2) {
22916
+ fs5[gracefulQueue][i2][3] = now;
22917
+ fs5[gracefulQueue][i2][4] = now;
22918
22918
  }
22919
22919
  }
22920
22920
  retry();
@@ -22922,9 +22922,9 @@ GFS4: `);
22922
22922
  function retry() {
22923
22923
  clearTimeout(retryTimer);
22924
22924
  retryTimer = undefined;
22925
- if (fs4[gracefulQueue].length === 0)
22925
+ if (fs5[gracefulQueue].length === 0)
22926
22926
  return;
22927
- var elem = fs4[gracefulQueue].shift();
22927
+ var elem = fs5[gracefulQueue].shift();
22928
22928
  var fn2 = elem[0];
22929
22929
  var args = elem[1];
22930
22930
  var err = elem[2];
@@ -22946,7 +22946,7 @@ GFS4: `);
22946
22946
  debug("RETRY", fn2.name, args);
22947
22947
  fn2.apply(null, args.concat([startTime]));
22948
22948
  } else {
22949
- fs4[gracefulQueue].push(elem);
22949
+ fs5[gracefulQueue].push(elem);
22950
22950
  }
22951
22951
  }
22952
22952
  if (retryTimer === undefined) {
@@ -31598,7 +31598,7 @@ var require_stream = __commonJS((exports, module) => {
31598
31598
  var { pipeline } = require_pipeline();
31599
31599
  var { destroyer } = require_destroy3();
31600
31600
  var eos = require_end_of_stream();
31601
- var promises2 = require_promises();
31601
+ var promises3 = require_promises();
31602
31602
  var utils = require_utils3();
31603
31603
  var Stream = module.exports = require_legacy().Stream;
31604
31604
  Stream.isDestroyed = utils.isDestroyed;
@@ -31672,21 +31672,21 @@ var require_stream = __commonJS((exports, module) => {
31672
31672
  configurable: true,
31673
31673
  enumerable: true,
31674
31674
  get() {
31675
- return promises2;
31675
+ return promises3;
31676
31676
  }
31677
31677
  });
31678
31678
  ObjectDefineProperty(pipeline, customPromisify, {
31679
31679
  __proto__: null,
31680
31680
  enumerable: true,
31681
31681
  get() {
31682
- return promises2.pipeline;
31682
+ return promises3.pipeline;
31683
31683
  }
31684
31684
  });
31685
31685
  ObjectDefineProperty(eos, customPromisify, {
31686
31686
  __proto__: null,
31687
31687
  enumerable: true,
31688
31688
  get() {
31689
- return promises2.finished;
31689
+ return promises3.finished;
31690
31690
  }
31691
31691
  });
31692
31692
  Stream.Stream = Stream;
@@ -31702,7 +31702,7 @@ var require_stream = __commonJS((exports, module) => {
31702
31702
  var require_ours = __commonJS((exports, module) => {
31703
31703
  var Stream = __require("stream");
31704
31704
  if (Stream && process.env.READABLE_STREAM === "disable") {
31705
- const promises2 = Stream.promises;
31705
+ const promises3 = Stream.promises;
31706
31706
  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer;
31707
31707
  module.exports._isUint8Array = Stream._isUint8Array;
31708
31708
  module.exports.isDisturbed = Stream.isDisturbed;
@@ -31722,13 +31722,13 @@ var require_ours = __commonJS((exports, module) => {
31722
31722
  configurable: true,
31723
31723
  enumerable: true,
31724
31724
  get() {
31725
- return promises2;
31725
+ return promises3;
31726
31726
  }
31727
31727
  });
31728
31728
  module.exports.Stream = Stream.Stream;
31729
31729
  } else {
31730
31730
  const CustomStream = require_stream();
31731
- const promises2 = require_promises();
31731
+ const promises3 = require_promises();
31732
31732
  const originalDestroy = CustomStream.Readable.destroy;
31733
31733
  module.exports = CustomStream.Readable;
31734
31734
  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer;
@@ -31751,7 +31751,7 @@ var require_ours = __commonJS((exports, module) => {
31751
31751
  configurable: true,
31752
31752
  enumerable: true,
31753
31753
  get() {
31754
- return promises2;
31754
+ return promises3;
31755
31755
  }
31756
31756
  });
31757
31757
  module.exports.Stream = CustomStream.Stream;
@@ -36757,8 +36757,8 @@ var require_commonjs4 = __commonJS((exports) => {
36757
36757
  #children;
36758
36758
  nocase;
36759
36759
  #fs;
36760
- constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs4 = defaultFS } = {}) {
36761
- this.#fs = fsFromOption(fs4);
36760
+ constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs5 = defaultFS } = {}) {
36761
+ this.#fs = fsFromOption(fs5);
36762
36762
  if (cwd instanceof URL || cwd.startsWith("file://")) {
36763
36763
  cwd = (0, node_url_1.fileURLToPath)(cwd);
36764
36764
  }
@@ -37121,14 +37121,14 @@ var require_commonjs4 = __commonJS((exports) => {
37121
37121
  if (er2)
37122
37122
  return results.emit("error", er2);
37123
37123
  if (follow && !didRealpaths) {
37124
- const promises2 = [];
37124
+ const promises3 = [];
37125
37125
  for (const e of entries) {
37126
37126
  if (e.isSymbolicLink()) {
37127
- promises2.push(e.realpath().then((r2) => r2?.isUnknown() ? r2.lstat() : r2));
37127
+ promises3.push(e.realpath().then((r2) => r2?.isUnknown() ? r2.lstat() : r2));
37128
37128
  }
37129
37129
  }
37130
- if (promises2.length) {
37131
- Promise.all(promises2).then(() => onReaddir(null, entries, true));
37130
+ if (promises3.length) {
37131
+ Promise.all(promises3).then(() => onReaddir(null, entries, true));
37132
37132
  return;
37133
37133
  }
37134
37134
  }
@@ -37235,8 +37235,8 @@ var require_commonjs4 = __commonJS((exports) => {
37235
37235
  parseRootPath(dir) {
37236
37236
  return node_path_1.win32.parse(dir).root.toUpperCase();
37237
37237
  }
37238
- newRoot(fs4) {
37239
- return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs4 });
37238
+ newRoot(fs5) {
37239
+ return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs5 });
37240
37240
  }
37241
37241
  isAbsolute(p3) {
37242
37242
  return p3.startsWith("/") || p3.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p3);
@@ -37254,8 +37254,8 @@ var require_commonjs4 = __commonJS((exports) => {
37254
37254
  parseRootPath(_dir) {
37255
37255
  return "/";
37256
37256
  }
37257
- newRoot(fs4) {
37258
- return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs4 });
37257
+ newRoot(fs5) {
37258
+ return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs5 });
37259
37259
  }
37260
37260
  isAbsolute(p3) {
37261
37261
  return p3.startsWith("/");
@@ -38341,7 +38341,7 @@ var require_commonjs5 = __commonJS((exports) => {
38341
38341
 
38342
38342
  // node_modules/archiver-utils/file.js
38343
38343
  var require_file = __commonJS((exports, module) => {
38344
- var fs4 = require_graceful_fs();
38344
+ var fs5 = require_graceful_fs();
38345
38345
  var path3 = __require("path");
38346
38346
  var flatten = require_flatten();
38347
38347
  var difference = require_difference();
@@ -38368,7 +38368,7 @@ var require_file = __commonJS((exports, module) => {
38368
38368
  };
38369
38369
  file2.exists = function() {
38370
38370
  var filepath = path3.join.apply(path3, arguments);
38371
- return fs4.existsSync(filepath);
38371
+ return fs5.existsSync(filepath);
38372
38372
  };
38373
38373
  file2.expand = function(...args) {
38374
38374
  var options = isPlainObject4(args[0]) ? args.shift() : {};
@@ -38386,7 +38386,7 @@ var require_file = __commonJS((exports, module) => {
38386
38386
  if (typeof options.filter === "function") {
38387
38387
  return options.filter(filepath);
38388
38388
  } else {
38389
- return fs4.statSync(filepath)[options.filter]();
38389
+ return fs5.statSync(filepath)[options.filter]();
38390
38390
  }
38391
38391
  } catch (e) {
38392
38392
  return false;
@@ -38492,7 +38492,7 @@ var require_file = __commonJS((exports, module) => {
38492
38492
 
38493
38493
  // node_modules/archiver-utils/index.js
38494
38494
  var require_archiver_utils = __commonJS((exports, module) => {
38495
- var fs4 = require_graceful_fs();
38495
+ var fs5 = require_graceful_fs();
38496
38496
  var path3 = __require("path");
38497
38497
  var isStream = require_is_stream();
38498
38498
  var lazystream = require_lazystream();
@@ -38541,7 +38541,7 @@ var require_archiver_utils = __commonJS((exports, module) => {
38541
38541
  };
38542
38542
  utils.lazyReadStream = function(filepath) {
38543
38543
  return new lazystream.Readable(function() {
38544
- return fs4.createReadStream(filepath);
38544
+ return fs5.createReadStream(filepath);
38545
38545
  });
38546
38546
  };
38547
38547
  utils.normalizeInputSource = function(source) {
@@ -38569,7 +38569,7 @@ var require_archiver_utils = __commonJS((exports, module) => {
38569
38569
  callback2 = base;
38570
38570
  base = dirpath;
38571
38571
  }
38572
- fs4.readdir(dirpath, function(err, list) {
38572
+ fs5.readdir(dirpath, function(err, list) {
38573
38573
  var i2 = 0;
38574
38574
  var file2;
38575
38575
  var filepath;
@@ -38582,7 +38582,7 @@ var require_archiver_utils = __commonJS((exports, module) => {
38582
38582
  return callback2(null, results);
38583
38583
  }
38584
38584
  filepath = path3.join(dirpath, file2);
38585
- fs4.stat(filepath, function(err2, stats) {
38585
+ fs5.stat(filepath, function(err2, stats) {
38586
38586
  results.push({
38587
38587
  path: filepath,
38588
38588
  relative: path3.relative(base, filepath).replace(/\\/g, "/"),
@@ -43829,7 +43829,7 @@ var require_stream2 = __commonJS((exports, module) => {
43829
43829
  var { pipeline } = require_pipeline2();
43830
43830
  var { destroyer } = require_destroy4();
43831
43831
  var eos = require_end_of_stream2();
43832
- var promises2 = require_promises2();
43832
+ var promises3 = require_promises2();
43833
43833
  var utils = require_utils4();
43834
43834
  var Stream = module.exports = require_legacy2().Stream;
43835
43835
  Stream.isDestroyed = utils.isDestroyed;
@@ -43903,21 +43903,21 @@ var require_stream2 = __commonJS((exports, module) => {
43903
43903
  configurable: true,
43904
43904
  enumerable: true,
43905
43905
  get() {
43906
- return promises2;
43906
+ return promises3;
43907
43907
  }
43908
43908
  });
43909
43909
  ObjectDefineProperty(pipeline, customPromisify, {
43910
43910
  __proto__: null,
43911
43911
  enumerable: true,
43912
43912
  get() {
43913
- return promises2.pipeline;
43913
+ return promises3.pipeline;
43914
43914
  }
43915
43915
  });
43916
43916
  ObjectDefineProperty(eos, customPromisify, {
43917
43917
  __proto__: null,
43918
43918
  enumerable: true,
43919
43919
  get() {
43920
- return promises2.finished;
43920
+ return promises3.finished;
43921
43921
  }
43922
43922
  });
43923
43923
  Stream.Stream = Stream;
@@ -43933,7 +43933,7 @@ var require_stream2 = __commonJS((exports, module) => {
43933
43933
  var require_ours2 = __commonJS((exports, module) => {
43934
43934
  var Stream = __require("stream");
43935
43935
  if (Stream && process.env.READABLE_STREAM === "disable") {
43936
- const promises2 = Stream.promises;
43936
+ const promises3 = Stream.promises;
43937
43937
  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer;
43938
43938
  module.exports._isUint8Array = Stream._isUint8Array;
43939
43939
  module.exports.isDisturbed = Stream.isDisturbed;
@@ -43953,13 +43953,13 @@ var require_ours2 = __commonJS((exports, module) => {
43953
43953
  configurable: true,
43954
43954
  enumerable: true,
43955
43955
  get() {
43956
- return promises2;
43956
+ return promises3;
43957
43957
  }
43958
43958
  });
43959
43959
  module.exports.Stream = Stream.Stream;
43960
43960
  } else {
43961
43961
  const CustomStream = require_stream2();
43962
- const promises2 = require_promises2();
43962
+ const promises3 = require_promises2();
43963
43963
  const originalDestroy = CustomStream.Readable.destroy;
43964
43964
  module.exports = CustomStream.Readable;
43965
43965
  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer;
@@ -43982,7 +43982,7 @@ var require_ours2 = __commonJS((exports, module) => {
43982
43982
  configurable: true,
43983
43983
  enumerable: true,
43984
43984
  get() {
43985
- return promises2;
43985
+ return promises3;
43986
43986
  }
43987
43987
  });
43988
43988
  module.exports.Stream = CustomStream.Stream;
@@ -43992,7 +43992,7 @@ var require_ours2 = __commonJS((exports, module) => {
43992
43992
 
43993
43993
  // node_modules/archiver/lib/core.js
43994
43994
  var require_core = __commonJS((exports, module) => {
43995
- var fs4 = __require("fs");
43995
+ var fs5 = __require("fs");
43996
43996
  var glob2 = require_readdir_glob();
43997
43997
  var async = require_async();
43998
43998
  var path3 = __require("path");
@@ -44056,7 +44056,7 @@ var require_core = __commonJS((exports, module) => {
44056
44056
  data.sourcePath = filepath;
44057
44057
  task.data = data;
44058
44058
  this._entriesCount++;
44059
- if (data.stats && data.stats instanceof fs4.Stats) {
44059
+ if (data.stats && data.stats instanceof fs5.Stats) {
44060
44060
  task = this._updateQueueTaskWithStats(task, data.stats);
44061
44061
  if (task) {
44062
44062
  if (data.stats.size) {
@@ -44227,7 +44227,7 @@ var require_core = __commonJS((exports, module) => {
44227
44227
  callback2();
44228
44228
  return;
44229
44229
  }
44230
- fs4.lstat(task.filepath, function(err, stats) {
44230
+ fs5.lstat(task.filepath, function(err, stats) {
44231
44231
  if (this._state.aborted) {
44232
44232
  setImmediate(callback2);
44233
44233
  return;
@@ -44270,7 +44270,7 @@ var require_core = __commonJS((exports, module) => {
44270
44270
  task.data.sourceType = "buffer";
44271
44271
  task.source = Buffer.concat([]);
44272
44272
  } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) {
44273
- var linkPath = fs4.readlinkSync(task.filepath);
44273
+ var linkPath = fs5.readlinkSync(task.filepath);
44274
44274
  var dirName = path3.dirname(task.filepath);
44275
44275
  task.data.type = "symlink";
44276
44276
  task.data.linkname = path3.relative(dirName, path3.resolve(dirName, linkPath));
@@ -50092,7 +50092,7 @@ var require_stream3 = __commonJS((exports, module) => {
50092
50092
  var { pipeline } = require_pipeline3();
50093
50093
  var { destroyer } = require_destroy5();
50094
50094
  var eos = require_end_of_stream3();
50095
- var promises2 = require_promises3();
50095
+ var promises3 = require_promises3();
50096
50096
  var utils = require_utils5();
50097
50097
  var Stream = module.exports = require_legacy3().Stream;
50098
50098
  Stream.isDestroyed = utils.isDestroyed;
@@ -50166,21 +50166,21 @@ var require_stream3 = __commonJS((exports, module) => {
50166
50166
  configurable: true,
50167
50167
  enumerable: true,
50168
50168
  get() {
50169
- return promises2;
50169
+ return promises3;
50170
50170
  }
50171
50171
  });
50172
50172
  ObjectDefineProperty(pipeline, customPromisify, {
50173
50173
  __proto__: null,
50174
50174
  enumerable: true,
50175
50175
  get() {
50176
- return promises2.pipeline;
50176
+ return promises3.pipeline;
50177
50177
  }
50178
50178
  });
50179
50179
  ObjectDefineProperty(eos, customPromisify, {
50180
50180
  __proto__: null,
50181
50181
  enumerable: true,
50182
50182
  get() {
50183
- return promises2.finished;
50183
+ return promises3.finished;
50184
50184
  }
50185
50185
  });
50186
50186
  Stream.Stream = Stream;
@@ -50196,7 +50196,7 @@ var require_stream3 = __commonJS((exports, module) => {
50196
50196
  var require_ours3 = __commonJS((exports, module) => {
50197
50197
  var Stream = __require("stream");
50198
50198
  if (Stream && process.env.READABLE_STREAM === "disable") {
50199
- const promises2 = Stream.promises;
50199
+ const promises3 = Stream.promises;
50200
50200
  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer;
50201
50201
  module.exports._isUint8Array = Stream._isUint8Array;
50202
50202
  module.exports.isDisturbed = Stream.isDisturbed;
@@ -50216,13 +50216,13 @@ var require_ours3 = __commonJS((exports, module) => {
50216
50216
  configurable: true,
50217
50217
  enumerable: true,
50218
50218
  get() {
50219
- return promises2;
50219
+ return promises3;
50220
50220
  }
50221
50221
  });
50222
50222
  module.exports.Stream = Stream.Stream;
50223
50223
  } else {
50224
50224
  const CustomStream = require_stream3();
50225
- const promises2 = require_promises3();
50225
+ const promises3 = require_promises3();
50226
50226
  const originalDestroy = CustomStream.Readable.destroy;
50227
50227
  module.exports = CustomStream.Readable;
50228
50228
  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer;
@@ -50245,7 +50245,7 @@ var require_ours3 = __commonJS((exports, module) => {
50245
50245
  configurable: true,
50246
50246
  enumerable: true,
50247
50247
  get() {
50248
- return promises2;
50248
+ return promises3;
50249
50249
  }
50250
50250
  });
50251
50251
  module.exports.Stream = CustomStream.Stream;
@@ -55649,7 +55649,7 @@ var require_stream4 = __commonJS((exports, module) => {
55649
55649
  var { pipeline } = require_pipeline4();
55650
55650
  var { destroyer } = require_destroy6();
55651
55651
  var eos = require_end_of_stream4();
55652
- var promises2 = require_promises4();
55652
+ var promises3 = require_promises4();
55653
55653
  var utils = require_utils6();
55654
55654
  var Stream = module.exports = require_legacy4().Stream;
55655
55655
  Stream.isDestroyed = utils.isDestroyed;
@@ -55723,21 +55723,21 @@ var require_stream4 = __commonJS((exports, module) => {
55723
55723
  configurable: true,
55724
55724
  enumerable: true,
55725
55725
  get() {
55726
- return promises2;
55726
+ return promises3;
55727
55727
  }
55728
55728
  });
55729
55729
  ObjectDefineProperty(pipeline, customPromisify, {
55730
55730
  __proto__: null,
55731
55731
  enumerable: true,
55732
55732
  get() {
55733
- return promises2.pipeline;
55733
+ return promises3.pipeline;
55734
55734
  }
55735
55735
  });
55736
55736
  ObjectDefineProperty(eos, customPromisify, {
55737
55737
  __proto__: null,
55738
55738
  enumerable: true,
55739
55739
  get() {
55740
- return promises2.finished;
55740
+ return promises3.finished;
55741
55741
  }
55742
55742
  });
55743
55743
  Stream.Stream = Stream;
@@ -55753,7 +55753,7 @@ var require_stream4 = __commonJS((exports, module) => {
55753
55753
  var require_ours4 = __commonJS((exports, module) => {
55754
55754
  var Stream = __require("stream");
55755
55755
  if (Stream && process.env.READABLE_STREAM === "disable") {
55756
- const promises2 = Stream.promises;
55756
+ const promises3 = Stream.promises;
55757
55757
  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer;
55758
55758
  module.exports._isUint8Array = Stream._isUint8Array;
55759
55759
  module.exports.isDisturbed = Stream.isDisturbed;
@@ -55773,13 +55773,13 @@ var require_ours4 = __commonJS((exports, module) => {
55773
55773
  configurable: true,
55774
55774
  enumerable: true,
55775
55775
  get() {
55776
- return promises2;
55776
+ return promises3;
55777
55777
  }
55778
55778
  });
55779
55779
  module.exports.Stream = Stream.Stream;
55780
55780
  } else {
55781
55781
  const CustomStream = require_stream4();
55782
- const promises2 = require_promises4();
55782
+ const promises3 = require_promises4();
55783
55783
  const originalDestroy = CustomStream.Readable.destroy;
55784
55784
  module.exports = CustomStream.Readable;
55785
55785
  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer;
@@ -55802,7 +55802,7 @@ var require_ours4 = __commonJS((exports, module) => {
55802
55802
  configurable: true,
55803
55803
  enumerable: true,
55804
55804
  get() {
55805
- return promises2;
55805
+ return promises3;
55806
55806
  }
55807
55807
  });
55808
55808
  module.exports.Stream = CustomStream.Stream;
@@ -59364,7 +59364,7 @@ function mitt_default(n2) {
59364
59364
  }
59365
59365
 
59366
59366
  // node_modules/@wdio/utils/build/index.js
59367
- import fs4 from "node:fs/promises";
59367
+ import fs5 from "node:fs/promises";
59368
59368
  import path3 from "node:path";
59369
59369
  function overwriteElementCommands(propertiesObject) {
59370
59370
  const elementOverrides = propertiesObject.__elementOverrides__ ? propertiesObject.__elementOverrides__.value : {};
@@ -59497,7 +59497,7 @@ async function enableFileLogging(outputDir) {
59497
59497
  if (!outputDir) {
59498
59498
  return;
59499
59499
  }
59500
- await fs4.mkdir(path3.join(outputDir), { recursive: true });
59500
+ await fs5.mkdir(path3.join(outputDir), { recursive: true });
59501
59501
  process.env.WDIO_LOG_PATH = path3.join(outputDir, "wdio.log");
59502
59502
  }
59503
59503
  function WebDriver(options, modifier, propertiesObject = {}) {
@@ -88613,19 +88613,19 @@ async function connectWebsocket(candidateUrls, options) {
88613
88613
  }
88614
88614
  return;
88615
88615
  }
88616
- function firstResolved(promises2, errorMessages = []) {
88617
- if (promises2.length === 0) {
88616
+ function firstResolved(promises3, errorMessages = []) {
88617
+ if (promises3.length === 0) {
88618
88618
  const sep5 = `
88619
88619
  - `;
88620
88620
  const errorMessage2 = errorMessages.length > 0 ? sep5 + errorMessages.join(sep5) : "";
88621
88621
  log6.error("Could not connect to Bidi protocol" + errorMessage2);
88622
88622
  return Promise.resolve(undefined);
88623
88623
  }
88624
- return Promise.race(promises2.map(({ promise: promise3 }) => promise3)).then((result) => {
88624
+ return Promise.race(promises3.map(({ promise: promise3 }) => promise3)).then((result) => {
88625
88625
  if (result.isConnected) {
88626
88626
  return result;
88627
88627
  }
88628
- return firstResolved(promises2.filter(({ index }) => index !== result.index), [...errorMessages, result.errorMessage || "unknown error"]);
88628
+ return firstResolved(promises3.filter(({ index }) => index !== result.index), [...errorMessages, result.errorMessage || "unknown error"]);
88629
88629
  });
88630
88630
  }
88631
88631
  function killDriverProcess(capabilities, shutdownDriver) {
@@ -131304,18 +131304,18 @@ var require_proxy_agent2 = __commonJS((exports, module) => {
131304
131304
  }
131305
131305
  }
131306
131306
  [kClose]() {
131307
- const promises2 = [this[kAgent].close()];
131307
+ const promises3 = [this[kAgent].close()];
131308
131308
  if (this[kClient]) {
131309
- promises2.push(this[kClient].close());
131309
+ promises3.push(this[kClient].close());
131310
131310
  }
131311
- return Promise.all(promises2);
131311
+ return Promise.all(promises3);
131312
131312
  }
131313
131313
  [kDestroy]() {
131314
- const promises2 = [this[kAgent].destroy()];
131314
+ const promises3 = [this[kAgent].destroy()];
131315
131315
  if (this[kClient]) {
131316
- promises2.push(this[kClient].destroy());
131316
+ promises3.push(this[kClient].destroy());
131317
131317
  }
131318
- return Promise.all(promises2);
131318
+ return Promise.all(promises3);
131319
131319
  }
131320
131320
  }
131321
131321
  function buildHeaders(headers) {
@@ -144419,7 +144419,7 @@ __export(exports_node, {
144419
144419
  import os5 from "node:os";
144420
144420
  import fs8 from "node:fs";
144421
144421
  import process22 from "node:process";
144422
- import fs5 from "node:fs";
144422
+ import fs6 from "node:fs";
144423
144423
  import path4 from "node:path";
144424
144424
  import fs32 from "node:fs";
144425
144425
  import path32 from "node:path";
@@ -144429,7 +144429,7 @@ import fs42 from "node:fs";
144429
144429
  import path42 from "node:path";
144430
144430
  import fs52 from "node:fs";
144431
144431
  import path5 from "node:path";
144432
- import fs6 from "node:fs/promises";
144432
+ import fs62 from "node:fs/promises";
144433
144433
  import path6 from "node:path";
144434
144434
  import fs7 from "node:fs/promises";
144435
144435
  import path7 from "node:path";
@@ -144445,12 +144445,12 @@ async function downloadFile(fileName, targetDirectory) {
144445
144445
  if (!targetDirectory.endsWith("/")) {
144446
144446
  targetDirectory += "/";
144447
144447
  }
144448
- fs5.mkdirSync(targetDirectory, { recursive: true });
144448
+ fs6.mkdirSync(targetDirectory, { recursive: true });
144449
144449
  const zipFilePath = path4.join(targetDirectory, `${fileName}.zip`);
144450
144450
  const binaryString = atob(base64Content);
144451
144451
  const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));
144452
- fs5.writeFileSync(zipFilePath, bytes);
144453
- const zipData = fs5.readFileSync(zipFilePath);
144452
+ fs6.writeFileSync(zipFilePath, bytes);
144453
+ const zipData = fs6.readFileSync(zipFilePath);
144454
144454
  const filesData = [];
144455
144455
  try {
144456
144456
  const zip2 = await import_jszip.default.loadAsync(zipData);
@@ -144458,7 +144458,7 @@ async function downloadFile(fileName, targetDirectory) {
144458
144458
  for (let i2 = 0;i2 < keys2.length; i2++) {
144459
144459
  const fileData = await zip2.files[keys2[i2]].async("nodebuffer");
144460
144460
  const dir = path4.resolve(targetDirectory, keys2[i2]);
144461
- fs5.writeFileSync(dir, fileData);
144461
+ fs6.writeFileSync(dir, fileData);
144462
144462
  log8.info(`File extracted: ${keys2[i2]}`);
144463
144463
  filesData.push(dir);
144464
144464
  }
@@ -144580,7 +144580,7 @@ async function saveScreenshot(filepath, options) {
144580
144580
  await assertDirectoryExists(absoluteFilepath);
144581
144581
  const screenBuffer = this.isBidi ? await takeScreenshotBidi.call(this, filepath, options) : await takeScreenshotClassic.call(this, filepath, options);
144582
144582
  const screenshot = Buffer.from(screenBuffer, "base64");
144583
- await fs6.writeFile(absoluteFilepath, screenshot);
144583
+ await fs62.writeFile(absoluteFilepath, screenshot);
144584
144584
  return screenshot;
144585
144585
  }
144586
144586
  function takeScreenshotClassic(filepath, options) {
@@ -155198,7 +155198,7 @@ var authMessages = {
155198
155198
  linkExpired: "The flow bundle download link has expired. Please run `qawolf flows pull` again to refresh.",
155199
155199
  failedWithStatus: (status) => `Could not download the flow bundle (HTTP ${status}).`,
155200
155200
  networkUnreachable: "Could not reach the flow bundle storage. Check your network connection and try again.",
155201
- timedOut: (timeoutMs) => `Downloading the flow bundle timed out after ${formatSeconds(timeoutMs)}. Please try again.`,
155201
+ timedOut: (timeoutMs) => `Downloading the flow bundle stalled — no data arrived for ${formatSeconds(timeoutMs)}. Please try again.`,
155202
155202
  malformed: "The flow bundle download was malformed. Please run `qawolf flows pull` again."
155203
155203
  }
155204
155204
  },
@@ -155345,6 +155345,7 @@ var flowsMessages = {
155345
155345
  aborted: "Aborted; no changes.",
155346
155346
  extractingBundle: "Extracting bundle",
155347
155347
  downloadingTeamStorageAssets: "Downloading team-storage assets",
155348
+ downloadingTeamStorageAssetsProgress: (current, total) => `Downloading team-storage assets (${String(current)}/${String(total)})`,
155348
155349
  teamStorageRequiresTeamKey: "Team storage requires a team API key; organization keys are not supported here.",
155349
155350
  summary: (result, assetsAbs) => {
155350
155351
  const flows = pluralize(result.flowCount, "flow");
@@ -155639,10 +155640,33 @@ function flushAndExit(code, proc = process, scheduleBackstop = (fn) => {
155639
155640
  }
155640
155641
 
155641
155642
  // src/shell/fs.ts
155643
+ import * as fs2 from "node:fs";
155644
+
155645
+ // src/shell/fsWriteHandle.ts
155642
155646
  import * as fs from "node:fs";
155647
+ async function openFsWriteHandle(path2) {
155648
+ const handle = await fs.promises.open(path2, "w");
155649
+ return {
155650
+ async write(chunk) {
155651
+ let remaining = chunk;
155652
+ while (remaining.length > 0) {
155653
+ const { bytesWritten } = await handle.write(remaining);
155654
+ if (bytesWritten === 0) {
155655
+ throw new Error(`write returned 0 bytes for '${path2}'`);
155656
+ }
155657
+ remaining = remaining.subarray(bytesWritten);
155658
+ }
155659
+ },
155660
+ close() {
155661
+ return handle.close();
155662
+ }
155663
+ };
155664
+ }
155665
+
155666
+ // src/shell/fs.ts
155643
155667
  async function pathExists(p) {
155644
155668
  try {
155645
- await fs.promises.stat(p);
155669
+ await fs2.promises.stat(p);
155646
155670
  return true;
155647
155671
  } catch (err) {
155648
155672
  if (isNoEntError(err))
@@ -155653,66 +155677,67 @@ async function pathExists(p) {
155653
155677
  function makeDefaultFs() {
155654
155678
  return {
155655
155679
  async mkdir(path2, options) {
155656
- await fs.promises.mkdir(path2, options);
155680
+ await fs2.promises.mkdir(path2, options);
155657
155681
  },
155658
155682
  pathExists,
155659
155683
  readFile(path2) {
155660
- return fs.promises.readFile(path2, "utf-8");
155684
+ return fs2.promises.readFile(path2, "utf-8");
155661
155685
  },
155662
155686
  async rm(path2, options) {
155663
- await fs.promises.rm(path2, options);
155687
+ await fs2.promises.rm(path2, options);
155664
155688
  },
155665
155689
  stat(path2) {
155666
- return fs.promises.stat(path2);
155690
+ return fs2.promises.stat(path2);
155667
155691
  },
155668
155692
  async unlink(path2) {
155669
- await fs.promises.unlink(path2);
155693
+ await fs2.promises.unlink(path2);
155670
155694
  },
155671
155695
  async writeFile(path2, data, options) {
155672
155696
  if (typeof data === "string") {
155673
- await fs.promises.writeFile(path2, data, {
155697
+ await fs2.promises.writeFile(path2, data, {
155674
155698
  encoding: "utf8",
155675
155699
  mode: options?.mode
155676
155700
  });
155677
155701
  } else {
155678
- await fs.promises.writeFile(path2, data, options ?? undefined);
155702
+ await fs2.promises.writeFile(path2, data, options ?? undefined);
155679
155703
  }
155680
155704
  },
155705
+ openWriteHandle: openFsWriteHandle,
155681
155706
  readdir(path2) {
155682
- return fs.promises.readdir(path2);
155707
+ return fs2.promises.readdir(path2);
155683
155708
  },
155684
155709
  readdirWithTypes(path2) {
155685
- return fs.promises.readdir(path2, {
155710
+ return fs2.promises.readdir(path2, {
155686
155711
  withFileTypes: true
155687
155712
  });
155688
155713
  },
155689
155714
  rename(oldPath, newPath) {
155690
- return fs.promises.rename(oldPath, newPath);
155715
+ return fs2.promises.rename(oldPath, newPath);
155691
155716
  },
155692
155717
  utimes(path2, atime, mtime) {
155693
- return fs.promises.utimes(path2, atime, mtime);
155718
+ return fs2.promises.utimes(path2, atime, mtime);
155694
155719
  },
155695
155720
  createReadStream(path2) {
155696
- if (!fs.existsSync(path2)) {
155721
+ if (!fs2.existsSync(path2)) {
155697
155722
  const err = Object.assign(new Error(`ENOENT: no such file or directory, open '${path2}'`), { code: "ENOENT", errno: -2 });
155698
155723
  throw err;
155699
155724
  }
155700
- return fs.createReadStream(path2);
155725
+ return fs2.createReadStream(path2);
155701
155726
  },
155702
155727
  async copyFile(source, destination) {
155703
- await fs.promises.copyFile(source, destination);
155728
+ await fs2.promises.copyFile(source, destination);
155704
155729
  },
155705
155730
  existsSync(path2) {
155706
- return fs.existsSync(path2);
155731
+ return fs2.existsSync(path2);
155707
155732
  },
155708
155733
  readFileSync(path2) {
155709
- return fs.readFileSync(path2, "utf-8");
155734
+ return fs2.readFileSync(path2, "utf-8");
155710
155735
  },
155711
155736
  writeFileSync(path2, data) {
155712
- fs.writeFileSync(path2, data, "utf8");
155737
+ fs2.writeFileSync(path2, data, "utf8");
155713
155738
  },
155714
155739
  mkdirSync(path2, options) {
155715
- fs.mkdirSync(path2, options);
155740
+ fs2.mkdirSync(path2, options);
155716
155741
  }
155717
155742
  };
155718
155743
  }
@@ -155747,18 +155772,18 @@ function deleteFromKeychain() {
155747
155772
  return "unavailable";
155748
155773
  }
155749
155774
  }
155750
- async function deleteFromFile(configDir, fs2) {
155775
+ async function deleteFromFile(configDir, fs3) {
155751
155776
  try {
155752
- await fs2.unlink(join2(configDir, credentialsFile));
155777
+ await fs3.unlink(join2(configDir, credentialsFile));
155753
155778
  return "deleted";
155754
155779
  } catch {
155755
155780
  return "not-found";
155756
155781
  }
155757
155782
  }
155758
- async function deleteApiKey(configDir, fs2) {
155783
+ async function deleteApiKey(configDir, fs3) {
155759
155784
  const [keychain, file] = await Promise.all([
155760
155785
  Promise.resolve(deleteFromKeychain()),
155761
- deleteFromFile(configDir, fs2)
155786
+ deleteFromFile(configDir, fs3)
155762
155787
  ]);
155763
155788
  return { keychain, file };
155764
155789
  }
@@ -156536,8 +156561,8 @@ function getElementAtPath(obj, path2) {
156536
156561
  }
156537
156562
  function promiseAllObject(promisesObj) {
156538
156563
  const keys = Object.keys(promisesObj);
156539
- const promises2 = keys.map((key) => promisesObj[key]);
156540
- return Promise.all(promises2).then((results) => {
156564
+ const promises3 = keys.map((key) => promisesObj[key]);
156565
+ return Promise.all(promises3).then((results) => {
156541
156566
  const resolvedObj = {};
156542
156567
  for (let i = 0;i < keys.length; i++) {
156543
156568
  resolvedObj[keys[i]] = results[i];
@@ -170072,30 +170097,30 @@ async function loadApiKey(configDir, deps) {
170072
170097
  // src/domains/auth/store/save.ts
170073
170098
  import { join as join4 } from "node:path";
170074
170099
  import { Entry as Entry2 } from "@napi-rs/keyring";
170075
- async function saveToFile(configDir, key, fs2) {
170100
+ async function saveToFile(configDir, key, fs3) {
170076
170101
  const payload = { apiKey: key };
170077
- await fs2.mkdir(configDir, { recursive: true, mode: 448 });
170078
- await fs2.writeFile(join4(configDir, credentialsFile), JSON.stringify(payload, undefined, 2), { mode: 384 });
170102
+ await fs3.mkdir(configDir, { recursive: true, mode: 448 });
170103
+ await fs3.writeFile(join4(configDir, credentialsFile), JSON.stringify(payload, undefined, 2), { mode: 384 });
170079
170104
  }
170080
- async function saveApiKey(configDir, key, fs2) {
170105
+ async function saveApiKey(configDir, key, fs3) {
170081
170106
  try {
170082
170107
  const entry = new Entry2(service, account);
170083
170108
  entry.setPassword(key);
170084
170109
  return { stored: "keychain" };
170085
170110
  } catch (err) {
170086
- await saveToFile(configDir, key, fs2);
170111
+ await saveToFile(configDir, key, fs3);
170087
170112
  return { stored: "file", keychainError: errorMessage(err) };
170088
170113
  }
170089
170114
  }
170090
170115
  // src/domains/auth/resolve.ts
170091
- function makeDefaultDeps(fs2) {
170116
+ function makeDefaultDeps(fs3) {
170092
170117
  return {
170093
- loadApiKey: (configDir) => loadApiKey(configDir, { EntryClass: Entry3, fs: fs2 }),
170118
+ loadApiKey: (configDir) => loadApiKey(configDir, { EntryClass: Entry3, fs: fs3 }),
170094
170119
  env: process.env
170095
170120
  };
170096
170121
  }
170097
- async function resolveApiKey(configDir, fs2, deps) {
170098
- const resolvedDeps = deps ?? makeDefaultDeps(fs2);
170122
+ async function resolveApiKey(configDir, fs3, deps) {
170123
+ const resolvedDeps = deps ?? makeDefaultDeps(fs3);
170099
170124
  const envKey = resolvedDeps.env["QAWOLF_API_KEY"];
170100
170125
  if (envKey?.trim()) {
170101
170126
  return { key: envKey.trim(), source: "env" };
@@ -170106,8 +170131,8 @@ async function resolveApiKey(configDir, fs2, deps) {
170106
170131
  }
170107
170132
  return;
170108
170133
  }
170109
- async function requireApiKey(configDir, fs2, deps) {
170110
- const result = await resolveApiKey(configDir, fs2, deps);
170134
+ async function requireApiKey(configDir, fs3, deps) {
170135
+ const result = await resolveApiKey(configDir, fs3, deps);
170111
170136
  if (!result) {
170112
170137
  throw new Error("QAWOLF_API_KEY is not set. Set it in your environment, or run 'qawolf auth login'. See 'qawolf doctor'.");
170113
170138
  }
@@ -170298,7 +170323,7 @@ function describeTeamStorageDownloadError(path2, err) {
170298
170323
  return `Could not reach team-storage while downloading ${path2}. Check your network connection and try again.`;
170299
170324
  }
170300
170325
  if (err.kind === "timeout") {
170301
- return `Downloading the team-storage asset ${path2} timed out after ${formatSeconds(err.timeoutMs)}. Please try again.`;
170326
+ return `Downloading the team-storage asset ${path2} stalled — no data arrived for ${formatSeconds(err.timeoutMs)}. Please try again.`;
170302
170327
  }
170303
170328
  return `The team-storage download for ${path2} was malformed. Please run \`qawolf flows pull\` again.`;
170304
170329
  }
@@ -171242,47 +171267,87 @@ import { tmpdir as tmpdir2 } from "node:os";
171242
171267
  import { join as join6 } from "node:path";
171243
171268
 
171244
171269
  // src/shell/platform/fetchSignedUrl.ts
171245
- var timeoutMs = 30000;
171270
+ var defaultStallTimeoutMs = 30000;
171246
171271
  async function fetchSignedUrl(args, deps = { fetch: globalThis.fetch }) {
171247
- let response;
171272
+ const timeoutMs = deps.stallTimeoutMs ?? defaultStallTimeoutMs;
171273
+ const fs3 = deps.fs ?? makeDefaultFs();
171274
+ const partPath = `${args.dest}.part`;
171275
+ const controller = new AbortController;
171276
+ let stallTimer;
171277
+ const armStallTimer = () => {
171278
+ clearTimeout(stallTimer);
171279
+ stallTimer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), timeoutMs);
171280
+ };
171248
171281
  try {
171249
- response = await deps.fetch(args.url, {
171250
- signal: AbortSignal.timeout(timeoutMs)
171251
- });
171252
- } catch (error51) {
171253
- if (isTimeoutError(error51)) {
171254
- return { ok: false, error: { kind: "timeout", timeoutMs } };
171282
+ armStallTimer();
171283
+ let response;
171284
+ try {
171285
+ response = await deps.fetch(args.url, { signal: controller.signal });
171286
+ } catch (error51) {
171287
+ if (isTimeoutError(error51)) {
171288
+ return { ok: false, error: { kind: "timeout", timeoutMs } };
171289
+ }
171290
+ return { ok: false, error: { cause: toError(error51), kind: "network" } };
171255
171291
  }
171256
- return { ok: false, error: { cause: toError(error51), kind: "network" } };
171257
- }
171258
- if (!response.ok) {
171259
- const body = await response.text().catch(() => "");
171260
- return {
171261
- ok: false,
171262
- error: { body, kind: "http", status: response.status }
171263
- };
171264
- }
171265
- if (!response.body) {
171266
- return {
171267
- ok: false,
171268
- error: { cause: new Error("response had no body"), kind: "network" }
171292
+ if (!response.ok) {
171293
+ const body = await response.text().catch(() => "");
171294
+ return {
171295
+ ok: false,
171296
+ error: { body, kind: "http", status: response.status }
171297
+ };
171298
+ }
171299
+ if (!response.body) {
171300
+ return {
171301
+ ok: false,
171302
+ error: { cause: new Error("response had no body"), kind: "network" }
171303
+ };
171304
+ }
171305
+ let handle;
171306
+ try {
171307
+ handle = await fs3.openWriteHandle(partPath);
171308
+ } catch (error51) {
171309
+ controller.abort(toError(error51));
171310
+ return { ok: false, error: { cause: toError(error51), kind: "network" } };
171311
+ }
171312
+ const discardPart = async () => {
171313
+ await handle.close().catch(() => {});
171314
+ await fs3.unlink(partPath).catch(() => {});
171269
171315
  };
171270
- }
171271
- let downloaded;
171272
- try {
171273
- downloaded = await response.arrayBuffer();
171274
- } catch (error51) {
171275
- if (isTimeoutError(error51)) {
171276
- return { ok: false, error: { kind: "timeout", timeoutMs } };
171316
+ const reader = response.body.getReader();
171317
+ for (;; ) {
171318
+ let result;
171319
+ try {
171320
+ result = await reader.read();
171321
+ } catch (error51) {
171322
+ await discardPart();
171323
+ if (isTimeoutError(error51)) {
171324
+ return { ok: false, error: { kind: "timeout", timeoutMs } };
171325
+ }
171326
+ return { ok: false, error: { cause: toError(error51), kind: "network" } };
171327
+ }
171328
+ if (result.done)
171329
+ break;
171330
+ clearTimeout(stallTimer);
171331
+ try {
171332
+ await handle.write(result.value);
171333
+ } catch (error51) {
171334
+ controller.abort(toError(error51));
171335
+ await discardPart();
171336
+ return { ok: false, error: { cause: toError(error51), kind: "network" } };
171337
+ }
171338
+ armStallTimer();
171277
171339
  }
171278
- return { ok: false, error: { cause: toError(error51), kind: "network" } };
171279
- }
171280
- try {
171281
- await (deps.fs ?? makeDefaultFs()).writeFile(args.dest, new Uint8Array(downloaded));
171282
- } catch (error51) {
171283
- return { ok: false, error: { cause: toError(error51), kind: "network" } };
171340
+ try {
171341
+ await handle.close();
171342
+ await fs3.rename(partPath, args.dest);
171343
+ } catch (error51) {
171344
+ await fs3.unlink(partPath).catch(() => {});
171345
+ return { ok: false, error: { cause: toError(error51), kind: "network" } };
171346
+ }
171347
+ return { ok: true, data: undefined };
171348
+ } finally {
171349
+ clearTimeout(stallTimer);
171284
171350
  }
171285
- return { ok: true, data: undefined };
171286
171351
  }
171287
171352
 
171288
171353
  // src/shell/platform/downloadBundle.ts
@@ -171325,6 +171390,7 @@ var identityResponse = exports_external.union([
171325
171390
  ]);
171326
171391
  // node_modules/@qawolf/api-contracts/dist/v1/ids.js
171327
171392
  var defaultIdSchemas = {
171393
+ aiTask: exports_external.string().min(1).describe("The id of the AI task."),
171328
171394
  automation: exports_external.string().min(1).describe("The id of the automation."),
171329
171395
  environment: exports_external.string().min(1).describe("The id of the environment."),
171330
171396
  environmentRef: exports_external.string().min(1).describe("The id or alias of the environment. Aliases require a team API key."),
@@ -171353,6 +171419,7 @@ var makeFlowSelectionSchema = (ids) => exports_external.object({
171353
171419
  // node_modules/@qawolf/api-contracts/dist/v1/run/index.js
171354
171420
  var makeCreateRunContract = (ids) => {
171355
171421
  const input = exports_external.object({
171422
+ aiTaskId: ids.aiTask.describe("The AI task whose conversation should receive run status updates.").optional(),
171356
171423
  environmentId: ids.environmentRef,
171357
171424
  environmentVariables: exports_external.record(exports_external.string(), exports_external.string()).optional(),
171358
171425
  ignoreRules: exports_external.boolean().default(false),
@@ -171369,6 +171436,64 @@ var makeCreateRunContract = (ids) => {
171369
171436
  };
171370
171437
  };
171371
171438
 
171439
+ // node_modules/@qawolf/api-contracts/dist/v1/runner/browserAction.js
171440
+ var maxScreenCoordinate = 20000;
171441
+ var screenCoordinateSchema = exports_external.int().min(0).max(maxScreenCoordinate);
171442
+ var screenPointSchema = exports_external.strictObject({
171443
+ x: screenCoordinateSchema,
171444
+ y: screenCoordinateSchema
171445
+ });
171446
+ var maxScrollDelta = 5000;
171447
+ var scrollDeltaSchema = exports_external.int().min(-maxScrollDelta).max(maxScrollDelta);
171448
+ var maxTypedTextLength = 200;
171449
+ var maxKeypressKeys = 10;
171450
+ var maxKeyNameLength = 32;
171451
+ var minDragPathPoints = 2;
171452
+ var maxDragPathPoints = 100;
171453
+ var maxNavigateUrlLength = 2048;
171454
+ var navigableUrlSchema = exports_external.url({ protocol: /^https?$/ }).max(maxNavigateUrlLength);
171455
+ var browserActionSchema = exports_external.discriminatedUnion("type", [
171456
+ exports_external.strictObject({
171457
+ button: exports_external.literal(["left", "right", "wheel", "back", "forward"]),
171458
+ type: exports_external.literal("click"),
171459
+ x: screenCoordinateSchema,
171460
+ y: screenCoordinateSchema
171461
+ }),
171462
+ exports_external.strictObject({
171463
+ type: exports_external.literal("double_click"),
171464
+ x: screenCoordinateSchema,
171465
+ y: screenCoordinateSchema
171466
+ }),
171467
+ exports_external.strictObject({
171468
+ scroll_x: scrollDeltaSchema,
171469
+ scroll_y: scrollDeltaSchema,
171470
+ type: exports_external.literal("scroll"),
171471
+ x: screenCoordinateSchema,
171472
+ y: screenCoordinateSchema
171473
+ }),
171474
+ exports_external.strictObject({
171475
+ type: exports_external.literal("move"),
171476
+ x: screenCoordinateSchema,
171477
+ y: screenCoordinateSchema
171478
+ }),
171479
+ exports_external.strictObject({
171480
+ path: exports_external.array(screenPointSchema).min(minDragPathPoints).max(maxDragPathPoints),
171481
+ type: exports_external.literal("drag")
171482
+ }),
171483
+ exports_external.strictObject({
171484
+ keys: exports_external.array(exports_external.string().min(1).max(maxKeyNameLength)).min(1).max(maxKeypressKeys),
171485
+ type: exports_external.literal("keypress")
171486
+ }),
171487
+ exports_external.strictObject({
171488
+ type: exports_external.literal("navigate"),
171489
+ url: navigableUrlSchema
171490
+ }),
171491
+ exports_external.strictObject({
171492
+ text: exports_external.string().min(1).max(maxTypedTextLength),
171493
+ type: exports_external.literal("type")
171494
+ })
171495
+ ]);
171496
+
171372
171497
  // node_modules/@qawolf/api-contracts/dist/v1/runner/environment.js
171373
171498
  var reservedRunEnvironmentVariablePrefix = "QAWOLF_";
171374
171499
  function refusalForRunEnvironmentVariableName(name) {
@@ -171502,6 +171627,54 @@ var runFilesSchema = exports_external.record(exports_external.string(), exports_
171502
171627
  error: `The files in one request may carry at most ${maxRunFilesByteLength} bytes in total.`
171503
171628
  });
171504
171629
 
171630
+ // node_modules/@qawolf/api-contracts/dist/v1/runner/screen.js
171631
+ var runnerScreenNotReadySchema = exports_external.object({
171632
+ outcome: exports_external.literal("screen-not-ready")
171633
+ });
171634
+ var screenNotReadyDescription = "`screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it.";
171635
+ var runnerScreenNeedsARunSchema = exports_external.object({
171636
+ outcome: exports_external.literal("screen-needs-a-run")
171637
+ });
171638
+ var screenNeedsARunDescription = "`screen-needs-a-run` if the runner has not run anything yet, so its virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` on the runner, then ask for the screen again. Evaluating a snippet does not start the desktop.";
171639
+ var runnerHasNoScreenSchema = exports_external.object({
171640
+ outcome: exports_external.literal("runner-has-no-screen")
171641
+ });
171642
+ var runnerHasNoScreenDescription = "`runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `node20WithPlaywright` runner instead.";
171643
+
171644
+ // node_modules/@qawolf/api-contracts/dist/v1/runner/unreachable.js
171645
+ var runnerUnreachableSchema = exports_external.object({
171646
+ outcome: exports_external.literal("runner-unreachable")
171647
+ });
171648
+ var retryableRunnerUnreachableDescription = "`runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
171649
+
171650
+ // node_modules/@qawolf/api-contracts/dist/v1/runner/performAction.js
171651
+ var unreachableDescription = "`runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
171652
+ var maxActionErrorMessageLength = 1000;
171653
+ var makePerformActionOnRunnerContract = () => {
171654
+ const input = exports_external.object({
171655
+ action: browserActionSchema.describe("The action to perform. Coordinates are pixels on the screenshot's own coordinate space."),
171656
+ id: runnerIdSchema.describe("Id of the runner to act on.")
171657
+ });
171658
+ const output = exports_external.discriminatedUnion("outcome", [
171659
+ exports_external.object({ outcome: exports_external.literal("performed") }),
171660
+ exports_external.object({
171661
+ errorMessage: exports_external.string().max(maxActionErrorMessageLength).describe("What stopped the action from taking effect."),
171662
+ outcome: exports_external.literal("action-failed")
171663
+ }),
171664
+ runnerScreenNeedsARunSchema,
171665
+ runnerScreenNotReadySchema,
171666
+ runnerHasNoScreenSchema,
171667
+ runnerUnreachableSchema
171668
+ ]);
171669
+ return {
171670
+ description: `Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). \`performed\` if the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. ${screenNeedsARunDescription} ${screenNotReadyDescription} A \`navigate\` does not go through the screen, so a screen that is not ready does not stop it — but it still needs the runner to have run something, and until then it answers \`action-failed\` rather than \`screen-needs-a-run\`. ${runnerHasNoScreenDescription} ${unreachableDescription}`,
171671
+ input,
171672
+ kind: "write",
171673
+ name: "runner.performAction",
171674
+ output
171675
+ };
171676
+ };
171677
+
171505
171678
  // node_modules/@qawolf/api-contracts/dist/v1/automate/index.js
171506
171679
  var makeAutomateContract = (ids) => {
171507
171680
  const input = exports_external.object({
@@ -171977,12 +172150,6 @@ var makeGetRunContract = (ids) => {
171977
172150
  };
171978
172151
  };
171979
172152
 
171980
- // node_modules/@qawolf/api-contracts/dist/v1/runner/unreachable.js
171981
- var runnerUnreachableSchema = exports_external.object({
171982
- outcome: exports_external.literal("runner-unreachable")
171983
- });
171984
- var retryableRunnerUnreachableDescription = "`runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
171985
-
171986
172153
  // node_modules/@qawolf/api-contracts/dist/v1/runner/evaluateSnippet.js
171987
172154
  var maxSnippetCodeLength = 64 * 1024;
171988
172155
  var makeEvaluateSnippetOnRunnerContract = () => {
@@ -172100,6 +172267,30 @@ var makeRunFlowOnRunnerContract = () => {
172100
172267
  };
172101
172268
  };
172102
172269
 
172270
+ // node_modules/@qawolf/api-contracts/dist/v1/runner/takeScreenshot.js
172271
+ var makeTakeScreenshotOnRunnerContract = () => {
172272
+ const input = exports_external.object({
172273
+ id: runnerIdSchema.describe("Id of the runner to take a screenshot of.")
172274
+ });
172275
+ const output = exports_external.discriminatedUnion("outcome", [
172276
+ exports_external.object({
172277
+ imageJpegBase64: exports_external.string().min(1).describe("The screenshot, as a base64-encoded JPEG. Decode it and write the bytes to a `.jpg` file — writing this string to the file leaves you with base64 text rather than an image."),
172278
+ outcome: exports_external.literal("captured")
172279
+ }),
172280
+ runnerScreenNeedsARunSchema,
172281
+ runnerScreenNotReadySchema,
172282
+ runnerHasNoScreenSchema,
172283
+ runnerUnreachableSchema
172284
+ ]);
172285
+ return {
172286
+ description: `Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. ${screenNeedsARunDescription} ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
172287
+ input,
172288
+ kind: "read",
172289
+ name: "runner.takeScreenshot",
172290
+ output
172291
+ };
172292
+ };
172293
+
172103
172294
  // node_modules/@qawolf/api-contracts/dist/v1/tag/list.js
172104
172295
  var makeListTagsContract = (ids) => {
172105
172296
  const input = exports_external.object({
@@ -172156,9 +172347,11 @@ var makeContractsV1 = (ids) => {
172156
172347
  runner: {
172157
172348
  evaluateSnippet: makeEvaluateSnippetOnRunnerContract(),
172158
172349
  launch: makeLaunchRunnerContract(),
172350
+ performAction: makePerformActionOnRunnerContract(),
172159
172351
  readJournal: makeReadRunnerJournalContract(),
172160
172352
  runFlow: makeRunFlowOnRunnerContract(),
172161
- stop: makeStopRunnerContract()
172353
+ stop: makeStopRunnerContract(),
172354
+ takeScreenshot: makeTakeScreenshotOnRunnerContract()
172162
172355
  },
172163
172356
  tag: {
172164
172357
  create: makeCreateTagContract(),
@@ -172169,18 +172362,18 @@ var makeContractsV1 = (ids) => {
172169
172362
  var publicContractsV1 = makeContractsV1(defaultIdSchemas);
172170
172363
 
172171
172364
  // src/shell/platform/getIdentity.ts
172172
- var timeoutMs2 = 1e4;
172365
+ var timeoutMs = 1e4;
172173
172366
  async function getIdentity(apiKey, deps) {
172174
172367
  const url2 = `${deps.baseUrl}/api/v0/identity`;
172175
172368
  let response;
172176
172369
  try {
172177
172370
  response = await deps.fetch(url2, {
172178
172371
  headers: { Authorization: `Bearer ${apiKey}` },
172179
- signal: AbortSignal.timeout(timeoutMs2)
172372
+ signal: AbortSignal.timeout(timeoutMs)
172180
172373
  });
172181
172374
  } catch (error51) {
172182
172375
  if (isTimeoutError(error51)) {
172183
- return { ok: false, error: { kind: "timeout", timeoutMs: timeoutMs2 } };
172376
+ return { ok: false, error: { kind: "timeout", timeoutMs } };
172184
172377
  }
172185
172378
  return {
172186
172379
  ok: false,
@@ -172199,7 +172392,7 @@ async function getIdentity(apiKey, deps) {
172199
172392
  json2 = await response.json();
172200
172393
  } catch (error51) {
172201
172394
  if (isTimeoutError(error51)) {
172202
- return { ok: false, error: { kind: "timeout", timeoutMs: timeoutMs2 } };
172395
+ return { ok: false, error: { kind: "timeout", timeoutMs } };
172203
172396
  }
172204
172397
  json2 = undefined;
172205
172398
  }
@@ -172262,9 +172455,6 @@ async function listTeamStorageFiles(trpc, args, deps) {
172262
172455
  return { ok: true, value: files };
172263
172456
  }
172264
172457
 
172265
- // src/shell/platform/teamStorageAssets.ts
172266
- import { dirname as dirname3, join as join9 } from "node:path";
172267
-
172268
172458
  // src/shell/platform/teamStorageAssetManifest.ts
172269
172459
  import { dirname as dirname2 } from "node:path";
172270
172460
  var assetManifestSchema = exports_external.object({
@@ -172279,10 +172469,10 @@ var assetManifestSchema = exports_external.object({
172279
172469
  function assetManifestPath(assetsAbs) {
172280
172470
  return `${assetsAbs}.manifest.json`;
172281
172471
  }
172282
- async function readAssetManifest(assetsAbs, fs2) {
172472
+ async function readAssetManifest(assetsAbs, fs3) {
172283
172473
  let raw;
172284
172474
  try {
172285
- raw = await fs2.readFile(assetManifestPath(assetsAbs));
172475
+ raw = await fs3.readFile(assetManifestPath(assetsAbs));
172286
172476
  } catch (err) {
172287
172477
  if (isNoEntError(err))
172288
172478
  return new Map;
@@ -172299,7 +172489,7 @@ async function readAssetManifest(assetsAbs, fs2) {
172299
172489
  return new Map;
172300
172490
  return new Map(result.data.files.map((file2) => [file2.path, file2]));
172301
172491
  }
172302
- async function writeAssetManifest(assetsAbs, files, fs2) {
172492
+ async function writeAssetManifest(assetsAbs, files, fs3) {
172303
172493
  const manifest = {
172304
172494
  version: 1,
172305
172495
  files: files.map((file2) => ({
@@ -172310,8 +172500,8 @@ async function writeAssetManifest(assetsAbs, files, fs2) {
172310
172500
  }))
172311
172501
  };
172312
172502
  const path2 = assetManifestPath(assetsAbs);
172313
- await fs2.mkdir(dirname2(path2), { recursive: true });
172314
- await fs2.writeFile(path2, `${JSON.stringify(manifest, undefined, 2)}
172503
+ await fs3.mkdir(dirname2(path2), { recursive: true });
172504
+ await fs3.writeFile(path2, `${JSON.stringify(manifest, undefined, 2)}
172315
172505
  `);
172316
172506
  }
172317
172507
  function serializeDate(value) {
@@ -172344,19 +172534,19 @@ import { join as join7, sep as sep2 } from "node:path";
172344
172534
  function mintAssetSnapshotPath(assetsAbs, label) {
172345
172535
  return `${assetsAbs}.${label}-${randomBytes2(8).toString("hex")}`;
172346
172536
  }
172347
- async function replaceAssetsDir(assetsAbs, tmpAssets, fs2) {
172537
+ async function replaceAssetsDir(assetsAbs, tmpAssets, fs3) {
172348
172538
  const oldAssets = mintAssetSnapshotPath(assetsAbs, "old");
172349
172539
  let movedOldAssets = false;
172350
172540
  try {
172351
- if (await fs2.pathExists(assetsAbs)) {
172352
- await fs2.rename(assetsAbs, oldAssets);
172541
+ if (await fs3.pathExists(assetsAbs)) {
172542
+ await fs3.rename(assetsAbs, oldAssets);
172353
172543
  movedOldAssets = true;
172354
172544
  }
172355
- await fs2.rename(tmpAssets, assetsAbs);
172545
+ await fs3.rename(tmpAssets, assetsAbs);
172356
172546
  } catch (error51) {
172357
172547
  if (movedOldAssets) {
172358
172548
  try {
172359
- await fs2.rename(oldAssets, assetsAbs);
172549
+ await fs3.rename(oldAssets, assetsAbs);
172360
172550
  } catch (rollbackError) {
172361
172551
  throw new Error(`Failed to replace team-storage assets and rollback also failed; previous assets may remain at ${oldAssets}. Replace error: ${errorMessage(error51)}. Rollback error: ${errorMessage(rollbackError)}`, { cause: rollbackError });
172362
172552
  }
@@ -172364,18 +172554,18 @@ async function replaceAssetsDir(assetsAbs, tmpAssets, fs2) {
172364
172554
  throw error51;
172365
172555
  }
172366
172556
  if (movedOldAssets) {
172367
- await cleanupAssetSnapshot(oldAssets, fs2);
172557
+ await cleanupAssetSnapshot(oldAssets, fs3);
172368
172558
  }
172369
172559
  }
172370
- async function cleanupAssetSnapshot(absPath, fs2) {
172371
- await fs2.rm(absPath, { recursive: true, force: true }).catch(() => {});
172560
+ async function cleanupAssetSnapshot(absPath, fs3) {
172561
+ await fs3.rm(absPath, { recursive: true, force: true }).catch(() => {});
172372
172562
  }
172373
- async function hasExactAssetSnapshot(assetsAbs, filePaths, fs2) {
172563
+ async function hasExactAssetSnapshot(assetsAbs, filePaths, fs3) {
172374
172564
  const expected = expectedEntries(filePaths);
172375
- if (!await fs2.pathExists(assetsAbs))
172565
+ if (!await fs3.pathExists(assetsAbs))
172376
172566
  return expected.size === 0;
172377
172567
  const actual = new Set;
172378
- await collectEntries(assetsAbs, "", actual, fs2);
172568
+ await collectEntries(assetsAbs, "", actual, fs3);
172379
172569
  return setsEqual(actual, expected);
172380
172570
  }
172381
172571
  function expectedEntries(filePaths) {
@@ -172389,13 +172579,13 @@ function expectedEntries(filePaths) {
172389
172579
  }
172390
172580
  return entries;
172391
172581
  }
172392
- async function collectEntries(root, relDir, out, fs2) {
172582
+ async function collectEntries(root, relDir, out, fs3) {
172393
172583
  const current = relDir ? join7(root, relDir) : root;
172394
- for (const entry of await fs2.readdirWithTypes(current)) {
172584
+ for (const entry of await fs3.readdirWithTypes(current)) {
172395
172585
  const relPath = relDir ? join7(relDir, entry.name) : entry.name;
172396
172586
  out.add(relPath);
172397
172587
  if (entry.isDirectory()) {
172398
- await collectEntries(root, relPath, out, fs2);
172588
+ await collectEntries(root, relPath, out, fs3);
172399
172589
  }
172400
172590
  }
172401
172591
  }
@@ -172407,22 +172597,45 @@ function setsEqual(left, right) {
172407
172597
 
172408
172598
  // src/shell/platform/teamStorageAssetReuse.ts
172409
172599
  import { join as join8 } from "node:path";
172410
- async function reusableAssetPaths(assetsAbs, safeFiles, manifest, fs2) {
172600
+ async function reusableAssetPaths(assetsAbs, safeFiles, manifest, fs3) {
172411
172601
  const reusable = new Set;
172412
172602
  for (const { file: file2, relativePath } of safeFiles) {
172413
- if (await canReuseAsset(assetsAbs, relativePath, file2, manifest, fs2)) {
172603
+ if (await canReuseAsset(assetsAbs, relativePath, file2, manifest, fs3)) {
172414
172604
  reusable.add(relativePath);
172415
172605
  }
172416
172606
  }
172417
172607
  return reusable;
172418
172608
  }
172419
- async function canReuseAsset(assetsAbs, relativePath, file2, manifest, fs2) {
172609
+ async function canReuseAsset(assetsAbs, relativePath, file2, manifest, fs3) {
172420
172610
  if (file2.etag === undefined)
172421
172611
  return false;
172422
172612
  const previous = manifest.get(relativePath);
172423
172613
  if (previous?.etag !== file2.etag)
172424
172614
  return false;
172425
- return fs2.pathExists(join8(assetsAbs, relativePath));
172615
+ return fs3.pathExists(join8(assetsAbs, relativePath));
172616
+ }
172617
+
172618
+ // src/shell/platform/writeAssetSnapshot.ts
172619
+ import { dirname as dirname3, join as join9 } from "node:path";
172620
+ async function writeAssetSnapshot(args) {
172621
+ let downloadedCount = 0;
172622
+ const total = args.safeFiles.filter(({ relativePath }) => !args.reusable.has(relativePath)).length;
172623
+ await args.deps.fs.mkdir(args.tmpAssets, { recursive: true });
172624
+ for (const { file: file2, relativePath } of args.safeFiles) {
172625
+ const dest = join9(args.tmpAssets, relativePath);
172626
+ await args.deps.fs.mkdir(dirname3(dest), { recursive: true });
172627
+ if (args.reusable.has(relativePath)) {
172628
+ await args.deps.fs.copyFile(join9(args.assetsAbs, relativePath), dest);
172629
+ continue;
172630
+ }
172631
+ args.deps.onProgress?.({ current: downloadedCount + 1, total });
172632
+ const result = await fetchSignedUrl({ url: file2.signedUrl, dest }, { fetch: args.deps.fetch, fs: args.deps.fs });
172633
+ if (!result.ok) {
172634
+ throw new Error(describeTeamStorageDownloadError(file2.path, result.error));
172635
+ }
172636
+ downloadedCount++;
172637
+ }
172638
+ return downloadedCount;
172426
172639
  }
172427
172640
 
172428
172641
  // src/shell/platform/teamStorageAssets.ts
@@ -172437,9 +172650,9 @@ async function downloadTeamStorageAssets(args, deps = { fetch: globalThis.fetch
172437
172650
  }
172438
172651
  }
172439
172652
  async function writeTeamStorageAssets(args, deps) {
172440
- const fs2 = deps.fs ?? makeDefaultFs();
172653
+ const fs3 = deps.fs ?? makeDefaultFs();
172441
172654
  const tmpAssets = mintAssetSnapshotPath(args.assetsAbs, "pull");
172442
- const manifest = await readAssetManifest(args.assetsAbs, fs2);
172655
+ const manifest = await readAssetManifest(args.assetsAbs, fs3);
172443
172656
  const safeFiles = [];
172444
172657
  for (const file2 of args.files) {
172445
172658
  const relativePath = safeAssetPath(file2.path);
@@ -172447,54 +172660,36 @@ async function writeTeamStorageAssets(args, deps) {
172447
172660
  safeFiles.push({ file: file2, relativePath });
172448
172661
  }
172449
172662
  const skippedCount = args.files.length - safeFiles.length;
172450
- const reusable = await reusableAssetPaths(args.assetsAbs, safeFiles, manifest, fs2);
172663
+ const reusable = await reusableAssetPaths(args.assetsAbs, safeFiles, manifest, fs3);
172451
172664
  const reusedCount = reusable.size;
172452
- if (reusedCount === safeFiles.length && await hasExactAssetSnapshot(args.assetsAbs, safeFiles.map((file2) => file2.relativePath), fs2)) {
172665
+ if (reusedCount === safeFiles.length && await hasExactAssetSnapshot(args.assetsAbs, safeFiles.map((file2) => file2.relativePath), fs3)) {
172453
172666
  return { downloadedCount: 0, reusedCount, skippedCount };
172454
172667
  }
172455
172668
  try {
172456
172669
  const downloadedCount = await writeAssetSnapshot({
172457
172670
  assetsAbs: args.assetsAbs,
172458
- deps: { fetch: deps.fetch, fs: fs2 },
172671
+ deps: { fetch: deps.fetch, fs: fs3, onProgress: deps.onProgress },
172459
172672
  reusable,
172460
172673
  safeFiles,
172461
172674
  tmpAssets
172462
172675
  });
172463
- await replaceAssetsDir(args.assetsAbs, tmpAssets, fs2);
172676
+ await replaceAssetsDir(args.assetsAbs, tmpAssets, fs3);
172464
172677
  await writeAssetManifest(args.assetsAbs, safeFiles.map(({ file: file2, relativePath }) => ({
172465
172678
  ...file2,
172466
172679
  path: relativePath
172467
- })), fs2);
172680
+ })), fs3);
172468
172681
  return { downloadedCount, reusedCount, skippedCount };
172469
172682
  } catch (error51) {
172470
- await cleanupAssetSnapshot(tmpAssets, fs2);
172683
+ await cleanupAssetSnapshot(tmpAssets, fs3);
172471
172684
  throw error51;
172472
172685
  }
172473
172686
  }
172474
- async function writeAssetSnapshot(args) {
172475
- let downloadedCount = 0;
172476
- await args.deps.fs.mkdir(args.tmpAssets, { recursive: true });
172477
- for (const { file: file2, relativePath } of args.safeFiles) {
172478
- const dest = join9(args.tmpAssets, relativePath);
172479
- await args.deps.fs.mkdir(dirname3(dest), { recursive: true });
172480
- if (args.reusable.has(relativePath)) {
172481
- await args.deps.fs.copyFile(join9(args.assetsAbs, relativePath), dest);
172482
- continue;
172483
- }
172484
- const result = await fetchSignedUrl({ url: file2.signedUrl, dest }, { fetch: args.deps.fetch, fs: args.deps.fs });
172485
- if (!result.ok) {
172486
- throw new Error(describeTeamStorageDownloadError(file2.path, result.error));
172487
- }
172488
- downloadedCount++;
172489
- }
172490
- return downloadedCount;
172491
- }
172492
172687
 
172493
172688
  // src/shell/platform/createPlatformClient.ts
172494
172689
  var requestBackoffMs2 = [500, 1500];
172495
172690
  function createPlatformClient(apiKey, deps) {
172496
172691
  const trpc = createTrpcClient(apiKey, deps);
172497
- const fs2 = deps.fs ?? makeDefaultFs();
172692
+ const fs3 = deps.fs ?? makeDefaultFs();
172498
172693
  async function getFlowsBundleUrlImpl(envId) {
172499
172694
  const result = await requestWithRetry({
172500
172695
  call: () => trpc.mutation("gitwolf.getFlowsBundleUrl", { environmentId: envId }, flowsBundleResponseSchema),
@@ -172540,11 +172735,11 @@ function createPlatformClient(apiKey, deps) {
172540
172735
  }
172541
172736
  return listTeamStorageFiles(trpc, { teamId: identity.value.team.id }, deps);
172542
172737
  },
172543
- async syncTeamStorageAssets(assetsAbs) {
172738
+ async syncTeamStorageAssets(assetsAbs, opts) {
172544
172739
  const files = await this.listTeamStorageFiles();
172545
172740
  if (!files.ok)
172546
172741
  return files;
172547
- return downloadTeamStorageAssets({ assetsAbs, files: files.value }, { fetch: deps.fetch, fs: fs2 });
172742
+ return downloadTeamStorageAssets({ assetsAbs, files: files.value }, { fetch: deps.fetch, fs: fs3, onProgress: opts?.onProgress });
172548
172743
  },
172549
172744
  async downloadBundle(envId) {
172550
172745
  const urlResult = await getFlowsBundleUrlImpl(envId);
@@ -172552,7 +172747,7 @@ function createPlatformClient(apiKey, deps) {
172552
172747
  return urlResult;
172553
172748
  return downloadBundle(urlResult.value.signedUrl, {
172554
172749
  fetch: deps.fetch,
172555
- fs: fs2
172750
+ fs: fs3
172556
172751
  });
172557
172752
  }
172558
172753
  };
@@ -174386,8 +174581,9 @@ function createAgentRenderers() {
174386
174581
  const results = [];
174387
174582
  const total = steps.length;
174388
174583
  for (const [i2, step] of steps.entries()) {
174389
- writeStderrLine(`[${String(i2 + 1)}/${String(total)}] ${step.message}`);
174390
- results.push(await step.task());
174584
+ const label = (message) => `[${String(i2 + 1)}/${String(total)}] ${message}`;
174585
+ writeStderrLine(label(step.message));
174586
+ results.push(await step.task((message) => writeStderrLine(label(message))));
174391
174587
  }
174392
174588
  const { typed, doneMessage } = finalizeResults(results, done);
174393
174589
  writeStderrLine(doneMessage);
@@ -174424,9 +174620,13 @@ ${body}` : ""));
174424
174620
  let currentLabel2 = "";
174425
174621
  try {
174426
174622
  for (const [i2, step] of steps.entries()) {
174427
- currentLabel2 = `[${String(i2 + 1)}/${String(total)}] ${step.message}`;
174623
+ const label = (message) => `[${String(i2 + 1)}/${String(total)}] ${message}`;
174624
+ currentLabel2 = label(step.message);
174428
174625
  clack.log.step(currentLabel2);
174429
- results.push(await step.task());
174626
+ results.push(await step.task((message) => {
174627
+ currentLabel2 = label(message);
174628
+ clack.log.step(currentLabel2);
174629
+ }));
174430
174630
  }
174431
174631
  const { typed, doneMessage } = finalizeResults(results, done);
174432
174632
  clack.log.success(doneMessage);
@@ -174440,13 +174640,17 @@ ${body}` : ""));
174440
174640
  let currentLabel = "";
174441
174641
  try {
174442
174642
  for (const [i2, step] of steps.entries()) {
174443
- currentLabel = `[${String(i2 + 1)}/${String(total)}] ${step.message}`;
174643
+ const label = (message) => `[${String(i2 + 1)}/${String(total)}] ${message}`;
174644
+ currentLabel = label(step.message);
174444
174645
  if (i2 === 0) {
174445
174646
  s.start(currentLabel);
174446
174647
  } else {
174447
174648
  s.message(currentLabel);
174448
174649
  }
174449
- results.push(await step.task());
174650
+ results.push(await step.task((message) => {
174651
+ currentLabel = label(message);
174652
+ s.message(currentLabel);
174653
+ }));
174450
174654
  }
174451
174655
  const { typed, doneMessage } = finalizeResults(results, done);
174452
174656
  s.stop(doneMessage);
@@ -174491,7 +174695,7 @@ function createJsonRenderers() {
174491
174695
  step: i2 + 1,
174492
174696
  total
174493
174697
  });
174494
- results.push(await step.task());
174698
+ results.push(await step.task(() => {}));
174495
174699
  }
174496
174700
  const { typed, doneMessage } = finalizeResults(results, done);
174497
174701
  writeJsonDiagnostic({ type: "success", message: doneMessage });
@@ -174578,12 +174782,12 @@ function createVerboseContext(outputMode, isVerbose) {
174578
174782
 
174579
174783
  // src/shell/npmRegistry.ts
174580
174784
  var registryUrl = "https://registry.npmjs.org";
174581
- var timeoutMs3 = 3000;
174785
+ var timeoutMs2 = 3000;
174582
174786
  async function fetchLatestVersion(packageName, deps = {}) {
174583
174787
  const fetchFn = deps.fetchFn ?? globalThis.fetch;
174584
174788
  try {
174585
174789
  const response = await fetchFn(`${registryUrl}/${packageName}/latest`, {
174586
- signal: AbortSignal.timeout(timeoutMs3)
174790
+ signal: AbortSignal.timeout(timeoutMs2)
174587
174791
  });
174588
174792
  if (!response.ok)
174589
174793
  return;
@@ -174666,7 +174870,7 @@ function startUpdateCheck(deps) {
174666
174870
  // package.json
174667
174871
  var package_default = {
174668
174872
  name: "@qawolf/cli",
174669
- version: "1.7.4",
174873
+ version: "1.8.0",
174670
174874
  description: "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
174671
174875
  keywords: [
174672
174876
  "automation",
@@ -174726,7 +174930,7 @@ var package_default = {
174726
174930
  "@clack/prompts": "1.5.1",
174727
174931
  "@napi-rs/keyring": "1.3.0",
174728
174932
  "@oxc-node/core": "0.1.0",
174729
- "@qawolf/api-contracts": "0.22.0",
174933
+ "@qawolf/api-contracts": "0.24.0",
174730
174934
  "@qawolf/emails": "1.1.1",
174731
174935
  "@qawolf/flow-targets": "1.0.0",
174732
174936
  "@qawolf/flows": "0.1.4",
@@ -174781,7 +174985,7 @@ function buildBaseContext(command, signals) {
174781
174985
  ...verboseWrite ? { verboseWrite } : {}
174782
174986
  });
174783
174987
  const apiBaseUrl = resolveHostUrl(env2);
174784
- const fs2 = makeDefaultFs();
174988
+ const fs3 = makeDefaultFs();
174785
174989
  const ui = createUI(outputMode, {
174786
174990
  clack,
174787
174991
  ...verboseTarget ? { verboseTarget } : {}
@@ -174790,7 +174994,7 @@ function buildBaseContext(command, signals) {
174790
174994
  env: env2,
174791
174995
  currentVersion: package_default.version,
174792
174996
  configDir: getConfigDir(),
174793
- fs: fs2,
174997
+ fs: fs3,
174794
174998
  fetchLatestVersion: () => fetchLatestVersion(package_default.name),
174795
174999
  renderNotice: (body, title) => ui.note(body, title)
174796
175000
  });
@@ -174806,7 +175010,7 @@ function buildBaseContext(command, signals) {
174806
175010
  apiBaseUrl,
174807
175011
  signals,
174808
175012
  log: (scope) => loggingSystem.createLogger(scope),
174809
- fs: fs2
175013
+ fs: fs3
174810
175014
  },
174811
175015
  apiBaseUrl,
174812
175016
  loggingSystem,
@@ -175291,12 +175495,12 @@ async function checkApiKey(deps) {
175291
175495
 
175292
175496
  // src/domains/doctor/checks/apiUrl.ts
175293
175497
  async function checkApiUrl(deps) {
175294
- const timeoutMs4 = deps.timeoutMs ?? 5000;
175498
+ const timeoutMs3 = deps.timeoutMs ?? 5000;
175295
175499
  let response;
175296
175500
  try {
175297
175501
  response = await deps.fetch(deps.apiBaseUrl, {
175298
175502
  method: "HEAD",
175299
- signal: AbortSignal.timeout(timeoutMs4)
175503
+ signal: AbortSignal.timeout(timeoutMs3)
175300
175504
  });
175301
175505
  } catch (error51) {
175302
175506
  return {
@@ -175610,10 +175814,10 @@ function renderResults(ui, results) {
175610
175814
 
175611
175815
  // src/domains/flows/ensureDeps.ts
175612
175816
  import { dirname as dirname4, join as join14 } from "node:path";
175613
- function findEnvDir(flowPath, fs2) {
175817
+ function findEnvDir(flowPath, fs3) {
175614
175818
  let dir = dirname4(flowPath);
175615
175819
  while (true) {
175616
- if (fs2.existsSync(join14(dir, "package.json")))
175820
+ if (fs3.existsSync(join14(dir, "package.json")))
175617
175821
  return dir;
175618
175822
  const parent = dirname4(dir);
175619
175823
  if (parent === dir)
@@ -175621,8 +175825,8 @@ function findEnvDir(flowPath, fs2) {
175621
175825
  dir = parent;
175622
175826
  }
175623
175827
  }
175624
- function resolveUniqueEnvDir(files, fs2) {
175625
- const dirs = new Set(files.map((f2) => findEnvDir(f2, fs2)).filter((d) => d !== undefined));
175828
+ function resolveUniqueEnvDir(files, fs3) {
175829
+ const dirs = new Set(files.map((f2) => findEnvDir(f2, fs3)).filter((d) => d !== undefined));
175626
175830
  if (dirs.size > 1) {
175627
175831
  const listed = [...dirs].map((d) => ` - ${d}`).join(`
175628
175832
  `);
@@ -175630,9 +175834,9 @@ function resolveUniqueEnvDir(files, fs2) {
175630
175834
  }
175631
175835
  return dirs.size === 1 ? [...dirs][0] : undefined;
175632
175836
  }
175633
- function resolveProjectDirSafe(files, fs2) {
175837
+ function resolveProjectDirSafe(files, fs3) {
175634
175838
  try {
175635
- return resolveUniqueEnvDir(files, fs2);
175839
+ return resolveUniqueEnvDir(files, fs3);
175636
175840
  } catch {
175637
175841
  return;
175638
175842
  }
@@ -175775,12 +175979,12 @@ function build$3(options) {
175775
175979
  return options.group ? groupFiles : empty;
175776
175980
  }
175777
175981
  var resolveSymlinksAsync = function(path2, state, callback$1) {
175778
- const { queue, fs: fs2, options: { suppressErrors } } = state;
175982
+ const { queue, fs: fs3, options: { suppressErrors } } = state;
175779
175983
  queue.enqueue();
175780
- fs2.realpath(path2, (error51, resolvedPath) => {
175984
+ fs3.realpath(path2, (error51, resolvedPath) => {
175781
175985
  if (error51)
175782
175986
  return queue.dequeue(suppressErrors ? null : error51, state);
175783
- fs2.stat(resolvedPath, (error$1, stat) => {
175987
+ fs3.stat(resolvedPath, (error$1, stat) => {
175784
175988
  if (error$1)
175785
175989
  return queue.dequeue(suppressErrors ? null : error$1, state);
175786
175990
  if (stat.isDirectory() && isRecursive(path2, resolvedPath, state))
@@ -175791,11 +175995,11 @@ var resolveSymlinksAsync = function(path2, state, callback$1) {
175791
175995
  });
175792
175996
  };
175793
175997
  var resolveSymlinks = function(path2, state, callback$1) {
175794
- const { queue, fs: fs2, options: { suppressErrors } } = state;
175998
+ const { queue, fs: fs3, options: { suppressErrors } } = state;
175795
175999
  queue.enqueue();
175796
176000
  try {
175797
- const resolvedPath = fs2.realpathSync(path2);
175798
- const stat = fs2.statSync(resolvedPath);
176001
+ const resolvedPath = fs3.realpathSync(path2);
176002
+ const stat = fs3.statSync(resolvedPath);
175799
176003
  if (stat.isDirectory() && isRecursive(path2, resolvedPath, state))
175800
176004
  return;
175801
176005
  callback$1(stat, resolvedPath);
@@ -175878,23 +176082,23 @@ var walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
175878
176082
  state.queue.enqueue();
175879
176083
  if (currentDepth < 0)
175880
176084
  return state.queue.dequeue(null, state);
175881
- const { fs: fs2 } = state;
176085
+ const { fs: fs3 } = state;
175882
176086
  state.visited.push(crawlPath);
175883
176087
  state.counts.directories++;
175884
- fs2.readdir(crawlPath || ".", readdirOpts, (error51, entries = []) => {
176088
+ fs3.readdir(crawlPath || ".", readdirOpts, (error51, entries = []) => {
175885
176089
  callback$1(entries, directoryPath, currentDepth);
175886
176090
  state.queue.dequeue(state.options.suppressErrors ? null : error51, state);
175887
176091
  });
175888
176092
  };
175889
176093
  var walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
175890
- const { fs: fs2 } = state;
176094
+ const { fs: fs3 } = state;
175891
176095
  if (currentDepth < 0)
175892
176096
  return;
175893
176097
  state.visited.push(crawlPath);
175894
176098
  state.counts.directories++;
175895
176099
  let entries = [];
175896
176100
  try {
175897
- entries = fs2.readdirSync(crawlPath || ".", readdirOpts);
176101
+ entries = fs3.readdirSync(crawlPath || ".", readdirOpts);
175898
176102
  } catch (e) {
175899
176103
  if (!state.options.suppressErrors)
175900
176104
  throw e;
@@ -176523,25 +176727,25 @@ function extractFlowMeta(source) {
176523
176727
  }
176524
176728
 
176525
176729
  // src/domains/flows/expand.ts
176526
- function makePeekFlowMeta(fs2) {
176730
+ function makePeekFlowMeta(fs3) {
176527
176731
  return async (filePath) => {
176528
- const source = await fs2.readFile(filePath);
176732
+ const source = await fs3.readFile(filePath);
176529
176733
  return extractFlowMeta(source);
176530
176734
  };
176531
176735
  }
176532
- async function resolveGlobRoots(cwd, fs2) {
176736
+ async function resolveGlobRoots(cwd, fs3) {
176533
176737
  const qawolfPath = join15(cwd, ".qawolf");
176534
176738
  let envDirs = [];
176535
176739
  try {
176536
- const entries = await fs2.readdirWithTypes(qawolfPath);
176740
+ const entries = await fs3.readdirWithTypes(qawolfPath);
176537
176741
  envDirs = entries.filter((e) => e.isDirectory()).map((e) => join15(qawolfPath, e.name));
176538
176742
  } catch {}
176539
176743
  return [cwd, ...envDirs];
176540
176744
  }
176541
- async function expandPatterns(patterns, cwd, logger, fs2) {
176745
+ async function expandPatterns(patterns, cwd, logger, fs3) {
176542
176746
  logger?.debug(`expandPatterns: ${patterns.join(", ")}`);
176543
176747
  const effectivePatterns = patterns.length > 0 ? patterns : ["**/*.flow.{ts,js}"];
176544
- const roots = await resolveGlobRoots(cwd, fs2);
176748
+ const roots = await resolveGlobRoots(cwd, fs3);
176545
176749
  const seen = new Set;
176546
176750
  for (const root of roots) {
176547
176751
  const matches = await glob(effectivePatterns, {
@@ -176604,40 +176808,40 @@ function runStagingRoot() {
176604
176808
  function managedEnvDir() {
176605
176809
  return join16(managedEnvBaseDir(), managedEnvHash());
176606
176810
  }
176607
- async function scaffoldManagedEnv(dir, fs2) {
176608
- await fs2.mkdir(dir, { recursive: true });
176811
+ async function scaffoldManagedEnv(dir, fs3) {
176812
+ await fs3.mkdir(dir, { recursive: true });
176609
176813
  const dependencies = Object.fromEntries(pinnedPackages.map(({ name, version: version2 }) => [name, version2]));
176610
- await fs2.writeFile(join16(dir, "package.json"), JSON.stringify({ name: "qawolf-runtime", private: true, dependencies }, undefined, 2));
176611
- await fs2.writeFile(join16(dir, ".npmrc"), `@qawolf:registry=https://registry.npmjs.org/
176814
+ await fs3.writeFile(join16(dir, "package.json"), JSON.stringify({ name: "qawolf-runtime", private: true, dependencies }, undefined, 2));
176815
+ await fs3.writeFile(join16(dir, ".npmrc"), `@qawolf:registry=https://registry.npmjs.org/
176612
176816
  `);
176613
176817
  }
176614
176818
 
176615
176819
  // src/domains/runtimeEnv/clearRuntimeEnv.ts
176616
176820
  var runtimeSentinel = "qawolf-runtime";
176617
- async function clearRuntimeEnv(fs2) {
176821
+ async function clearRuntimeEnv(fs3) {
176618
176822
  const dir = managedEnvBaseDir();
176619
- const existed = await fs2.pathExists(dir);
176823
+ const existed = await fs3.pathExists(dir);
176620
176824
  if (!existed)
176621
176825
  return { dir, existed };
176622
- if (!await isManagedRuntimeBase(dir, fs2)) {
176826
+ if (!await isManagedRuntimeBase(dir, fs3)) {
176623
176827
  throw new Error(`Refusing to delete ${dir}: it does not look like a QA Wolf managed ` + `runtime directory (expected only ${runtimeSentinel} hash dirs). ` + `Check your QAWOLF_RUNTIME_DIR override.`);
176624
176828
  }
176625
- await fs2.rm(dir, { recursive: true, force: true });
176829
+ await fs3.rm(dir, { recursive: true, force: true });
176626
176830
  return { dir, existed };
176627
176831
  }
176628
- async function isManagedRuntimeBase(dir, fs2) {
176629
- const entries = await fs2.readdirWithTypes(dir);
176832
+ async function isManagedRuntimeBase(dir, fs3) {
176833
+ const entries = await fs3.readdirWithTypes(dir);
176630
176834
  for (const entry of entries) {
176631
176835
  if (!entry.isDirectory())
176632
176836
  return false;
176633
- if (!await hasRuntimeSentinel(join17(dir, entry.name), fs2))
176837
+ if (!await hasRuntimeSentinel(join17(dir, entry.name), fs3))
176634
176838
  return false;
176635
176839
  }
176636
176840
  return true;
176637
176841
  }
176638
- async function hasRuntimeSentinel(hashDir, fs2) {
176842
+ async function hasRuntimeSentinel(hashDir, fs3) {
176639
176843
  try {
176640
- const pkg = JSON.parse(await fs2.readFile(join17(hashDir, "package.json")));
176844
+ const pkg = JSON.parse(await fs3.readFile(join17(hashDir, "package.json")));
176641
176845
  return pkg.name === runtimeSentinel;
176642
176846
  } catch {
176643
176847
  return false;
@@ -176712,10 +176916,10 @@ function spawnNpmInstall(cwd, spawn2 = spawn) {
176712
176916
 
176713
176917
  // src/domains/runtimeEnv/resolvePinned.ts
176714
176918
  import { join as join18 } from "node:path";
176715
- function readInstalledVersion(dir, pkgName, fs2) {
176919
+ function readInstalledVersion(dir, pkgName, fs3) {
176716
176920
  try {
176717
176921
  const pkgPath = join18(dir, "node_modules", ...pkgName.split("/"), "package.json");
176718
- const raw = JSON.parse(fs2.readFileSync(pkgPath));
176922
+ const raw = JSON.parse(fs3.readFileSync(pkgPath));
176719
176923
  const { version: version2 } = raw;
176720
176924
  return typeof version2 === "string" ? version2 : undefined;
176721
176925
  } catch {
@@ -176736,16 +176940,16 @@ var shims = [
176736
176940
  candidates: appiumCliCandidates
176737
176941
  }
176738
176942
  ];
176739
- function pinnedResolutionFailures(dir, fs2, platform) {
176943
+ function pinnedResolutionFailures(dir, fs3, platform) {
176740
176944
  const failures = [];
176741
176945
  for (const { name, version: version2 } of pinnedPackages) {
176742
- const installed = readInstalledVersion(dir, name, fs2);
176946
+ const installed = readInstalledVersion(dir, name, fs3);
176743
176947
  if (installed !== version2) {
176744
176948
  failures.push({ kind: "package", name, pinned: version2, installed });
176745
176949
  }
176746
176950
  }
176747
176951
  for (const { name, display, candidates } of shims) {
176748
- if (!candidates(dir, platform).some((p2) => fs2.existsSync(p2))) {
176952
+ if (!candidates(dir, platform).some((p2) => fs3.existsSync(p2))) {
176749
176953
  failures.push({ kind: "shim", name, display });
176750
176954
  }
176751
176955
  }
@@ -176757,8 +176961,8 @@ function describePinnedFailure(failure) {
176757
176961
  }
176758
176962
  return failure.installed === undefined ? `${failure.name} (missing, pinned ${failure.pinned})` : `${failure.name} ${failure.installed} (pinned ${failure.pinned})`;
176759
176963
  }
176760
- function allPinnedResolved(dir, fs2, platform) {
176761
- return pinnedResolutionFailures(dir, fs2, platform).length === 0;
176964
+ function allPinnedResolved(dir, fs3, platform) {
176965
+ return pinnedResolutionFailures(dir, fs3, platform).length === 0;
176762
176966
  }
176763
176967
 
176764
176968
  // src/domains/runtimeEnv/shimDeps.ts
@@ -176790,7 +176994,7 @@ function normalizeExports(exports) {
176790
176994
  }
176791
176995
  return;
176792
176996
  }
176793
- function resolveFromEnvDir(envDir, specifier, preference = "esm", fs2 = makeDefaultFs()) {
176997
+ function resolveFromEnvDir(envDir, specifier, preference = "esm", fs3 = makeDefaultFs()) {
176794
176998
  const isScoped = specifier.startsWith("@");
176795
176999
  const parts = specifier.split("/");
176796
177000
  const pkgPartCount = isScoped ? 2 : 1;
@@ -176800,7 +177004,7 @@ function resolveFromEnvDir(envDir, specifier, preference = "esm", fs2 = makeDefa
176800
177004
  const pkgDir = join19(envDir, "node_modules", ...pkgName.split("/"));
176801
177005
  let pkg;
176802
177006
  try {
176803
- pkg = JSON.parse(fs2.readFileSync(join19(pkgDir, "package.json")));
177007
+ pkg = JSON.parse(fs3.readFileSync(join19(pkgDir, "package.json")));
176804
177008
  } catch (err) {
176805
177009
  if (isNoEntError(err))
176806
177010
  throw new Error(`Package '${pkgName}' not found in ${join19(envDir, "node_modules")}`, { cause: err });
@@ -176816,9 +177020,9 @@ function resolveFromEnvDir(envDir, specifier, preference = "esm", fs2 = makeDefa
176816
177020
  }
176817
177021
 
176818
177022
  // src/domains/runtimeEnv/shimDeps.ts
176819
- function readShimMarker(shimDir, fs2) {
177023
+ function readShimMarker(shimDir, fs3) {
176820
177024
  try {
176821
- const pkg = JSON.parse(fs2.readFileSync(join20(shimDir, "package.json")));
177025
+ const pkg = JSON.parse(fs3.readFileSync(join20(shimDir, "package.json")));
176822
177026
  if (pkg._qawolf_format) {
176823
177027
  return {
176824
177028
  _qawolf_version: pkg._qawolf_version ?? "",
@@ -176833,42 +177037,42 @@ function resolveBunBuild(bunBuild) {
176833
177037
  return globalThis.Bun;
176834
177038
  return bunBuild === false ? undefined : { build: bunBuild };
176835
177039
  }
176836
- async function removeStaleShims(flowsDir, flowsDeps, fs2) {
177040
+ async function removeStaleShims(flowsDir, flowsDeps, fs3) {
176837
177041
  const shimsDir = join20(flowsDir, "node_modules");
176838
- if (!fs2.existsSync(shimsDir))
177042
+ if (!fs3.existsSync(shimsDir))
176839
177043
  return;
176840
177044
  for (const dep of flowsDeps) {
176841
177045
  const shimDepDir = join20(shimsDir, ...dep.split("/"));
176842
- if (readShimMarker(shimDepDir, fs2)) {
176843
- await fs2.rm(shimDepDir, { recursive: true, force: true });
177046
+ if (readShimMarker(shimDepDir, fs3)) {
177047
+ await fs3.rm(shimDepDir, { recursive: true, force: true });
176844
177048
  }
176845
177049
  }
176846
177050
  }
176847
177051
  async function buildDepShim(args) {
176848
- const { envDir, flowsDir, dep, fs: fs2, build: build2 } = args;
177052
+ const { envDir, flowsDir, dep, fs: fs3, build: build2 } = args;
176849
177053
  const depParts = dep.split("/");
176850
177054
  const depDir = join20(envDir, "node_modules", ...depParts);
176851
- if (!fs2.existsSync(depDir))
177055
+ if (!fs3.existsSync(depDir))
176852
177056
  return;
176853
177057
  let depVersion;
176854
177058
  try {
176855
- const pkg = JSON.parse(fs2.readFileSync(join20(depDir, "package.json")));
177059
+ const pkg = JSON.parse(fs3.readFileSync(join20(depDir, "package.json")));
176856
177060
  depVersion = pkg.version ?? "unknown";
176857
177061
  } catch {
176858
177062
  depVersion = "unknown";
176859
177063
  }
176860
177064
  const shimDir = join20(flowsDir, "node_modules", ...depParts);
176861
- if (fs2.existsSync(shimDir)) {
176862
- const marker = readShimMarker(shimDir, fs2);
177065
+ if (fs3.existsSync(shimDir)) {
177066
+ const marker = readShimMarker(shimDir, fs3);
176863
177067
  if (!marker)
176864
177068
  return;
176865
177069
  if (marker._qawolf_version === depVersion && marker._qawolf_format === "bun-build-v1")
176866
177070
  return;
176867
- await fs2.rm(shimDir, { recursive: true, force: true });
177071
+ await fs3.rm(shimDir, { recursive: true, force: true });
176868
177072
  }
176869
177073
  let entry;
176870
177074
  try {
176871
- entry = resolveFromEnvDir(envDir, dep, "cjs", fs2);
177075
+ entry = resolveFromEnvDir(envDir, dep, "cjs", fs3);
176872
177076
  } catch {
176873
177077
  return;
176874
177078
  }
@@ -176883,32 +177087,32 @@ async function buildDepShim(args) {
176883
177087
  throw new Error(`bun.build failed to shim ${dep}: ${logs}`);
176884
177088
  }
176885
177089
  const shimCode = await output.text();
176886
- await fs2.mkdir(shimDir, { recursive: true });
176887
- await fs2.writeFile(join20(shimDir, "package.json"), JSON.stringify({
177090
+ await fs3.mkdir(shimDir, { recursive: true });
177091
+ await fs3.writeFile(join20(shimDir, "package.json"), JSON.stringify({
176888
177092
  name: dep,
176889
177093
  _qawolf_version: depVersion,
176890
177094
  _qawolf_format: "bun-build-v1"
176891
177095
  }));
176892
- await fs2.writeFile(join20(shimDir, "index.js"), shimCode);
177096
+ await fs3.writeFile(join20(shimDir, "index.js"), shimCode);
176893
177097
  }
176894
- async function shimFlowsDeps(envDir, fs2 = makeDefaultFs(), bunBuild) {
177098
+ async function shimFlowsDeps(envDir, fs3 = makeDefaultFs(), bunBuild) {
176895
177099
  const flowsDir = join20(envDir, "node_modules", "@qawolf", "flows");
176896
- if (!fs2.existsSync(flowsDir))
177100
+ if (!fs3.existsSync(flowsDir))
176897
177101
  return;
176898
177102
  let flowsDeps;
176899
177103
  try {
176900
- const flowsPkg = JSON.parse(fs2.readFileSync(join20(flowsDir, "package.json")));
177104
+ const flowsPkg = JSON.parse(fs3.readFileSync(join20(flowsDir, "package.json")));
176901
177105
  flowsDeps = Object.keys(flowsPkg.dependencies ?? {});
176902
177106
  } catch {
176903
177107
  return;
176904
177108
  }
176905
177109
  const bun = resolveBunBuild(bunBuild);
176906
177110
  if (!bun) {
176907
- await removeStaleShims(flowsDir, flowsDeps, fs2);
177111
+ await removeStaleShims(flowsDir, flowsDeps, fs3);
176908
177112
  return;
176909
177113
  }
176910
177114
  for (const dep of flowsDeps) {
176911
- await buildDepShim({ envDir, flowsDir, dep, fs: fs2, build: bun.build });
177115
+ await buildDepShim({ envDir, flowsDir, dep, fs: fs3, build: bun.build });
176912
177116
  }
176913
177117
  }
176914
177118
 
@@ -176941,15 +177145,15 @@ async function installPinned(targetDir, deps) {
176941
177145
 
176942
177146
  // src/domains/runtimeEnv/ensureRuntimeEnv.ts
176943
177147
  async function ensureRuntimeEnv(args, deps = {}) {
176944
- const fs2 = deps.fs ?? makeDefaultFs();
177148
+ const fs3 = deps.fs ?? makeDefaultFs();
176945
177149
  const resolveManagedDir = deps.resolveManagedDir ?? managedEnvDir;
176946
177150
  const install = deps.install ?? ((t2) => installPinned(t2, {
176947
- fs: fs2,
177151
+ fs: fs3,
176948
177152
  spawnInstall: defaultSpawnInstall,
176949
177153
  platform: args.platform
176950
177154
  }));
176951
177155
  if (args.overrideDir !== undefined) {
176952
- const failures = pinnedResolutionFailures(args.overrideDir, fs2, args.platform);
177156
+ const failures = pinnedResolutionFailures(args.overrideDir, fs3, args.platform);
176953
177157
  if (failures.length === 0) {
176954
177158
  return {
176955
177159
  depsRoot: args.overrideDir,
@@ -176959,27 +177163,27 @@ async function ensureRuntimeEnv(args, deps = {}) {
176959
177163
  }
176960
177164
  throw new Error(runnerMessages.depsDirIncomplete(args.overrideDir, failures.map(describePinnedFailure)));
176961
177165
  }
176962
- if (args.projectDir !== undefined && allPinnedResolved(args.projectDir, fs2, args.platform)) {
177166
+ if (args.projectDir !== undefined && allPinnedResolved(args.projectDir, fs3, args.platform)) {
176963
177167
  return { depsRoot: args.projectDir, source: "project", installed: false };
176964
177168
  }
176965
177169
  const managed = resolveManagedDir();
176966
- if (allPinnedResolved(managed, fs2, args.platform)) {
177170
+ if (allPinnedResolved(managed, fs3, args.platform)) {
176967
177171
  return { depsRoot: managed, source: "managed", installed: false };
176968
177172
  }
176969
177173
  await install(managed);
176970
- if (!allPinnedResolved(managed, fs2, args.platform)) {
177174
+ if (!allPinnedResolved(managed, fs3, args.platform)) {
176971
177175
  throw new Error(`Managed runtime is incomplete after install at ${managed}.`);
176972
177176
  }
176973
177177
  return { depsRoot: managed, source: "managed", installed: true };
176974
177178
  }
176975
177179
  // src/domains/runtimeEnv/resolveDepsRootIfPresent.ts
176976
- function resolveDepsRootIfPresent(args, fs2 = makeDefaultFs()) {
176977
- if (args.overrideDir !== undefined && allPinnedResolved(args.overrideDir, fs2, args.platform))
177180
+ function resolveDepsRootIfPresent(args, fs3 = makeDefaultFs()) {
177181
+ if (args.overrideDir !== undefined && allPinnedResolved(args.overrideDir, fs3, args.platform))
176978
177182
  return args.overrideDir;
176979
- if (args.projectDir !== undefined && allPinnedResolved(args.projectDir, fs2, args.platform))
177183
+ if (args.projectDir !== undefined && allPinnedResolved(args.projectDir, fs3, args.platform))
176980
177184
  return args.projectDir;
176981
177185
  const managed = managedEnvDir();
176982
- if (allPinnedResolved(managed, fs2, args.platform))
177186
+ if (allPinnedResolved(managed, fs3, args.platform))
176983
177187
  return managed;
176984
177188
  return;
176985
177189
  }
@@ -177001,16 +177205,16 @@ async function collectRequiredAvds(files, peekFlowMeta) {
177001
177205
  return [...seen];
177002
177206
  }
177003
177207
  async function handleDoctor(ctx, opts) {
177004
- const { fs: fs2 } = ctx;
177208
+ const { fs: fs3 } = ctx;
177005
177209
  const cwd = process.cwd();
177006
- const flowFiles = await expandPatterns([], cwd, undefined, fs2);
177007
- const projectDir = resolveProjectDirSafe([...flowFiles], fs2);
177210
+ const flowFiles = await expandPatterns([], cwd, undefined, fs3);
177211
+ const projectDir = resolveProjectDirSafe([...flowFiles], fs3);
177008
177212
  const envDir = resolveDepsRootIfPresent({
177009
177213
  platform: process.platform,
177010
177214
  ...projectDir !== undefined ? { projectDir } : {}
177011
- }, fs2);
177012
- const resolved = await resolveApiKey(ctx.configDir, fs2);
177013
- const requiredAvds = await collectRequiredAvds(flowFiles, makePeekFlowMeta(fs2));
177215
+ }, fs3);
177216
+ const resolved = await resolveApiKey(ctx.configDir, fs3);
177217
+ const requiredAvds = await collectRequiredAvds(flowFiles, makePeekFlowMeta(fs3));
177014
177218
  const runAndroidChecks = opts.all || requiredAvds.length > 0;
177015
177219
  const cliCheck = {
177016
177220
  name: "qawolf",
@@ -177114,11 +177318,11 @@ async function flowsList(ctx, pattern, deps) {
177114
177318
  ctx.ui.outro(flowsMessages.flowCount(items.length));
177115
177319
  }
177116
177320
  function handleFlowsList(ctx, pattern) {
177117
- const { fs: fs2 } = ctx;
177321
+ const { fs: fs3 } = ctx;
177118
177322
  return flowsList(ctx, pattern, {
177119
177323
  cwd: process.cwd(),
177120
- expandPatterns: (patterns, cwd) => expandPatterns(patterns, cwd, undefined, fs2),
177121
- peekFlowMeta: makePeekFlowMeta(fs2)
177324
+ expandPatterns: (patterns, cwd) => expandPatterns(patterns, cwd, undefined, fs3),
177325
+ peekFlowMeta: makePeekFlowMeta(fs3)
177122
177326
  });
177123
177327
  }
177124
177328
 
@@ -177183,10 +177387,10 @@ var manifestSchema = exports_external.object({
177183
177387
  qawolfCommittedAt: exports_external.string().optional(),
177184
177388
  flows: exports_external.array(flowEntrySchema)
177185
177389
  });
177186
- async function readManifest(envDir, fs2 = makeDefaultFs()) {
177390
+ async function readManifest(envDir, fs3 = makeDefaultFs()) {
177187
177391
  let raw;
177188
177392
  try {
177189
- raw = await fs2.readFile(join21(envDir, manifestFilename));
177393
+ raw = await fs3.readFile(join21(envDir, manifestFilename));
177190
177394
  } catch (err) {
177191
177395
  if (isNoEntError(err))
177192
177396
  return "missing";
@@ -177212,15 +177416,15 @@ async function readManifest(envDir, fs2 = makeDefaultFs()) {
177212
177416
  flows: result.data.flows
177213
177417
  };
177214
177418
  }
177215
- async function writeManifest(envDir, manifest, fs2 = makeDefaultFs()) {
177419
+ async function writeManifest(envDir, manifest, fs3 = makeDefaultFs()) {
177216
177420
  const body = JSON.stringify(manifest, undefined, 2);
177217
- await fs2.writeFile(join21(envDir, manifestFilename), `${body}
177421
+ await fs3.writeFile(join21(envDir, manifestFilename), `${body}
177218
177422
  `);
177219
177423
  }
177220
- function hashFile(absPath, fs2 = makeDefaultFs()) {
177424
+ function hashFile(absPath, fs3 = makeDefaultFs()) {
177221
177425
  return new Promise((resolve5, reject) => {
177222
177426
  const hash2 = createHash2("sha256");
177223
- const stream = fs2.createReadStream(absPath);
177427
+ const stream = fs3.createReadStream(absPath);
177224
177428
  stream.on("data", (chunk) => hash2.update(chunk));
177225
177429
  stream.on("end", () => resolve5(hash2.digest("hex")));
177226
177430
  stream.on("error", reject);
@@ -177350,25 +177554,25 @@ async function checkSafety(args) {
177350
177554
 
177351
177555
  // src/domains/flows/pull/bundle.ts
177352
177556
  import { join as join22, relative as relative4 } from "node:path";
177353
- async function flattenSingleWrapper(dir, fs2 = makeDefaultFs()) {
177354
- const entries = await fs2.readdir(dir);
177557
+ async function flattenSingleWrapper(dir, fs3 = makeDefaultFs()) {
177558
+ const entries = await fs3.readdir(dir);
177355
177559
  if (entries.length !== 1)
177356
177560
  return;
177357
177561
  const innerName = entries[0];
177358
177562
  if (!innerName)
177359
177563
  return;
177360
177564
  const inner = join22(dir, innerName);
177361
- const innerStat = await fs2.stat(inner);
177565
+ const innerStat = await fs3.stat(inner);
177362
177566
  if (!innerStat.isDirectory())
177363
177567
  return;
177364
- for (const e of await fs2.readdir(inner)) {
177365
- await fs2.rename(join22(inner, e), join22(dir, e));
177568
+ for (const e of await fs3.readdir(inner)) {
177569
+ await fs3.rename(join22(inner, e), join22(dir, e));
177366
177570
  }
177367
- const leftovers = await fs2.readdir(inner);
177571
+ const leftovers = await fs3.readdir(inner);
177368
177572
  if (leftovers.length > 0) {
177369
177573
  throw new Error(`flattenSingleWrapper: ${leftovers.length} unexpected item(s) remain in wrapper dir`);
177370
177574
  }
177371
- await fs2.rm(inner, { recursive: true });
177575
+ await fs3.rm(inner, { recursive: true });
177372
177576
  return innerName;
177373
177577
  }
177374
177578
  function extractQawolfCommitSha(wrapperName) {
@@ -177377,11 +177581,11 @@ function extractQawolfCommitSha(wrapperName) {
177377
177581
  return /-([0-9a-f]{40})$/i.exec(wrapperName)?.[1];
177378
177582
  }
177379
177583
  var flowExtensions = [".flow.ts", ".flow.js"];
177380
- async function buildManifest(args, fs2 = makeDefaultFs()) {
177381
- const flowPaths = await walkForFlows(args.bundleDir, fs2);
177584
+ async function buildManifest(args, fs3 = makeDefaultFs()) {
177585
+ const flowPaths = await walkForFlows(args.bundleDir, fs3);
177382
177586
  const flows = await Promise.all(flowPaths.map(async (rel) => ({
177383
177587
  path: rel,
177384
- contentHash: await hashFile(join22(args.bundleDir, rel), fs2)
177588
+ contentHash: await hashFile(join22(args.bundleDir, rel), fs3)
177385
177589
  })));
177386
177590
  return {
177387
177591
  envId: args.envId,
@@ -177394,28 +177598,28 @@ async function buildManifest(args, fs2 = makeDefaultFs()) {
177394
177598
  flows
177395
177599
  };
177396
177600
  }
177397
- async function walkForFlows(root, fs2) {
177601
+ async function walkForFlows(root, fs3) {
177398
177602
  const out = [];
177399
- await walk(root, root, out, fs2);
177603
+ await walk(root, root, out, fs3);
177400
177604
  return out.sort();
177401
177605
  }
177402
- async function walk(current, root, out, fs2) {
177403
- const entries = await fs2.readdirWithTypes(current);
177606
+ async function walk(current, root, out, fs3) {
177607
+ const entries = await fs3.readdirWithTypes(current);
177404
177608
  for (const e of entries) {
177405
177609
  const abs = join22(current, e.name);
177406
177610
  if (e.isDirectory()) {
177407
- await walk(abs, root, out, fs2);
177611
+ await walk(abs, root, out, fs3);
177408
177612
  } else if (e.isFile() && flowExtensions.some((ext) => e.name.endsWith(ext))) {
177409
177613
  out.push(relative4(root, abs));
177410
177614
  }
177411
177615
  }
177412
177616
  }
177413
- async function sampleQawolfCommittedAt(bundleDir, fs2 = makeDefaultFs()) {
177414
- const flowPaths = await walkForFlows(bundleDir, fs2);
177617
+ async function sampleQawolfCommittedAt(bundleDir, fs3 = makeDefaultFs()) {
177618
+ const flowPaths = await walkForFlows(bundleDir, fs3);
177415
177619
  const sample = flowPaths[0];
177416
177620
  if (!sample)
177417
177621
  return;
177418
- return (await fs2.stat(join22(bundleDir, sample))).mtime.toISOString();
177622
+ return (await fs3.stat(join22(bundleDir, sample))).mtime.toISOString();
177419
177623
  }
177420
177624
 
177421
177625
  // src/domains/flows/pull/applyTeamStorageRewrite.ts
@@ -177452,26 +177656,26 @@ function isSourceFile(name) {
177452
177656
  function isFlowFile(name) {
177453
177657
  return flowExtensions2.some((ext) => name.endsWith(ext));
177454
177658
  }
177455
- async function walk2(dir, out, fs2) {
177456
- const entries = await fs2.readdirWithTypes(dir);
177659
+ async function walk2(dir, out, fs3) {
177660
+ const entries = await fs3.readdirWithTypes(dir);
177457
177661
  for (const e of entries) {
177458
177662
  const abs = join23(dir, e.name);
177459
177663
  if (e.isDirectory()) {
177460
- await walk2(abs, out, fs2);
177664
+ await walk2(abs, out, fs3);
177461
177665
  } else if (e.isFile() && isSourceFile(e.name)) {
177462
177666
  out.push(abs);
177463
177667
  }
177464
177668
  }
177465
177669
  }
177466
- async function applyTeamStorageRewrite(rootDir, fs2 = makeDefaultFs()) {
177670
+ async function applyTeamStorageRewrite(rootDir, fs3 = makeDefaultFs()) {
177467
177671
  const files = [];
177468
- await walk2(rootDir, files, fs2);
177672
+ await walk2(rootDir, files, fs3);
177469
177673
  const results = await Promise.all(files.map(async (file2) => {
177470
- const source = await fs2.readFile(file2);
177674
+ const source = await fs3.readFile(file2);
177471
177675
  const result = rewriteTeamStorage(source);
177472
177676
  const finalSource = result.rewrites > 0 ? result.source : source;
177473
177677
  if (result.rewrites > 0) {
177474
- await fs2.writeFile(file2, finalSource);
177678
+ await fs3.writeFile(file2, finalSource);
177475
177679
  }
177476
177680
  if (isFlowFile(file2) && finalSource.includes("process.env.TEAM_STORAGE_DIR")) {
177477
177681
  return relative5(rootDir, file2);
@@ -177545,10 +177749,10 @@ function unquote(escaped) {
177545
177749
  }
177546
177750
 
177547
177751
  // src/domains/flows/pull/envVars.ts
177548
- async function writeEnvFile(envDir, vars, fs2 = makeDefaultFs()) {
177752
+ async function writeEnvFile(envDir, vars, fs3 = makeDefaultFs()) {
177549
177753
  if (Object.keys(vars).length === 0)
177550
177754
  return;
177551
- await fs2.writeFile(join24(envDir, ".env"), serializeDotenv(vars), {
177755
+ await fs3.writeFile(join24(envDir, ".env"), serializeDotenv(vars), {
177552
177756
  mode: 384
177553
177757
  });
177554
177758
  }
@@ -179585,7 +179789,7 @@ var hs = Symbol("jobDone");
179585
179789
  var li = Symbol("addFSEntry");
179586
179790
  var sr = Symbol("addTarEntry");
179587
179791
  var cs = Symbol("stat");
179588
- var fs2 = Symbol("readdir");
179792
+ var fs3 = Symbol("readdir");
179589
179793
  var ci = Symbol("onreaddir");
179590
179794
  var fi = Symbol("pipe");
179591
179795
  var rr = Symbol("entry");
@@ -179680,7 +179884,7 @@ var wt = class extends A2 {
179680
179884
  }
179681
179885
  this[Ct]();
179682
179886
  }
179683
- [fs2](t2) {
179887
+ [fs3](t2) {
179684
179888
  t2.pending = true, this[G] += 1, ui.readdir(t2.absolute, (e, i2) => {
179685
179889
  if (t2.pending = false, this[G] -= 1, e)
179686
179890
  return this.emit("error", e);
@@ -179730,7 +179934,7 @@ var wt = class extends A2 {
179730
179934
  if (t2.stat && !t2.ignore) {
179731
179935
  if (!this.noDirRecurse && t2.stat.isDirectory() && !t2.readdir) {
179732
179936
  let e = this.readdirCache.get(t2.absolute);
179733
- if (e ? this[ci](t2, e) : this[fs2](t2), !t2.readdir)
179937
+ if (e ? this[ci](t2, e) : this[fs3](t2), !t2.readdir)
179734
179938
  return;
179735
179939
  }
179736
179940
  if (t2.entry = this[rr](t2), !t2.entry) {
@@ -179787,7 +179991,7 @@ var kt = class extends wt {
179787
179991
  let e = this.follow ? "statSync" : "lstatSync";
179788
179992
  this[ai](t2, ui[e](t2.absolute));
179789
179993
  }
179790
- [fs2](t2) {
179994
+ [fs3](t2) {
179791
179995
  this[ci](t2, ui.readdirSync(t2.absolute));
179792
179996
  }
179793
179997
  [fi](t2) {
@@ -180748,16 +180952,16 @@ function checkEntrySize(args) {
180748
180952
  // src/domains/flows/pull/extract.ts
180749
180953
  var defaultMaxEntryBytes = 50 * 1024 * 1024;
180750
180954
  var defaultMaxTotalBytes = 500 * 1024 * 1024;
180751
- async function extractTarGz(tgzPath, destDir, opts = {}, fs3 = makeDefaultFs()) {
180955
+ async function extractTarGz(tgzPath, destDir, opts = {}, fs4 = makeDefaultFs()) {
180752
180956
  const maxEntryBytes = opts.maxEntryBytes ?? defaultMaxEntryBytes;
180753
180957
  const maxTotalBytes = opts.maxTotalBytes ?? defaultMaxTotalBytes;
180754
- await fs3.mkdir(destDir, { recursive: true });
180958
+ await fs4.mkdir(destDir, { recursive: true });
180755
180959
  const destResolved = resolve7(destDir);
180756
180960
  return new Promise((resolveOuter, rejectOuter) => {
180757
180961
  let total = 0;
180758
180962
  let aborted2 = false;
180759
180963
  const pending = [];
180760
- const rs2 = fs3.createReadStream(tgzPath);
180964
+ const rs2 = fs4.createReadStream(tgzPath);
180761
180965
  const gz = createGunzip();
180762
180966
  const parser = new st({ strict: true });
180763
180967
  const abort = (err) => {
@@ -180781,7 +180985,7 @@ async function extractTarGz(tgzPath, destDir, opts = {}, fs3 = makeDefaultFs())
180781
180985
  maxTotalBytes,
180782
180986
  addTotal: (n2) => total += n2,
180783
180987
  getTotal: () => total,
180784
- fs: fs3
180988
+ fs: fs4
180785
180989
  }).catch((err) => {
180786
180990
  abort(err instanceof Error ? err : new Error(String(err)));
180787
180991
  });
@@ -180846,7 +181050,7 @@ function mintTempPath(destAbs, kind, registry2) {
180846
181050
  registry2.minted.add(path3);
180847
181051
  return path3;
180848
181052
  }
180849
- async function removeTempDir(absPath, registry2, fs3 = makeDefaultFs()) {
181053
+ async function removeTempDir(absPath, registry2, fs4 = makeDefaultFs()) {
180850
181054
  if (!absPath || !isAbsolute4(absPath)) {
180851
181055
  throw new Error(`removeTempDir refused: not an absolute path (${absPath})`);
180852
181056
  }
@@ -180856,24 +181060,24 @@ async function removeTempDir(absPath, registry2, fs3 = makeDefaultFs()) {
180856
181060
  if (!registry2.minted.has(absPath)) {
180857
181061
  throw new Error(`removeTempDir refused: not minted in this registry`);
180858
181062
  }
180859
- await fs3.rm(absPath, { recursive: true, force: true });
181063
+ await fs4.rm(absPath, { recursive: true, force: true });
180860
181064
  registry2.minted.delete(absPath);
180861
181065
  }
180862
181066
 
180863
181067
  // src/domains/flows/pull/stage.ts
180864
- async function stageBundle(args, fs3 = makeDefaultFs()) {
181068
+ async function stageBundle(args, fs4 = makeDefaultFs()) {
180865
181069
  const registry2 = createTempPathRegistry();
180866
181070
  const tmpDir = mintTempPath(args.destAbs, "pull", registry2);
180867
181071
  try {
180868
- await extractTarGz(args.tmpArchive, tmpDir, {}, fs3);
180869
- const wrapperName = await flattenSingleWrapper(tmpDir, fs3);
180870
- const qawolfCommittedAt = await sampleQawolfCommittedAt(tmpDir, fs3);
180871
- const { flowsWithTeamStorageRefs } = await applyTeamStorageRewrite(tmpDir, fs3);
181072
+ await extractTarGz(args.tmpArchive, tmpDir, {}, fs4);
181073
+ const wrapperName = await flattenSingleWrapper(tmpDir, fs4);
181074
+ const qawolfCommittedAt = await sampleQawolfCommittedAt(tmpDir, fs4);
181075
+ const { flowsWithTeamStorageRefs } = await applyTeamStorageRewrite(tmpDir, fs4);
180872
181076
  const effectiveEnvVars = {
180873
181077
  ...args.envVars,
180874
181078
  TEAM_STORAGE_DIR: args.assetsAbs
180875
181079
  };
180876
- await writeEnvFile(tmpDir, effectiveEnvVars, fs3);
181080
+ await writeEnvFile(tmpDir, effectiveEnvVars, fs4);
180877
181081
  const manifest = await buildManifest({
180878
181082
  envId: args.envId,
180879
181083
  bundleDir: tmpDir,
@@ -180882,22 +181086,22 @@ async function stageBundle(args, fs3 = makeDefaultFs()) {
180882
181086
  envVarsFetchedAt: args.envVarsFetchedAt,
180883
181087
  wrapperName,
180884
181088
  qawolfCommittedAt
180885
- }, fs3);
180886
- await writeManifest(tmpDir, manifest, fs3);
181089
+ }, fs4);
181090
+ await writeManifest(tmpDir, manifest, fs4);
180887
181091
  let oldDir;
180888
181092
  try {
180889
- if (await fs3.pathExists(args.destAbs)) {
181093
+ if (await fs4.pathExists(args.destAbs)) {
180890
181094
  oldDir = mintTempPath(args.destAbs, "old", registry2);
180891
- await fs3.rename(args.destAbs, oldDir);
181095
+ await fs4.rename(args.destAbs, oldDir);
180892
181096
  }
180893
- await fs3.rename(tmpDir, args.destAbs);
181097
+ await fs4.rename(tmpDir, args.destAbs);
180894
181098
  } catch (err) {
180895
181099
  if (oldDir)
180896
- await fs3.rename(oldDir, args.destAbs).catch(() => {});
181100
+ await fs4.rename(oldDir, args.destAbs).catch(() => {});
180897
181101
  throw err;
180898
181102
  }
180899
181103
  if (oldDir)
180900
- await removeTempDir(oldDir, registry2, fs3).catch(() => {});
181104
+ await removeTempDir(oldDir, registry2, fs4).catch(() => {});
180901
181105
  return {
180902
181106
  envDir: args.destAbs,
180903
181107
  flowCount: manifest.flows.length,
@@ -180905,7 +181109,7 @@ async function stageBundle(args, fs3 = makeDefaultFs()) {
180905
181109
  flowsWithTeamStorageRefs
180906
181110
  };
180907
181111
  } catch (err) {
180908
- await removeTempDir(tmpDir, registry2, fs3).catch(() => {});
181112
+ await removeTempDir(tmpDir, registry2, fs4).catch(() => {});
180909
181113
  throw err;
180910
181114
  }
180911
181115
  }
@@ -180963,8 +181167,10 @@ async function handleFlowsPull(ctx, opts, deps) {
180963
181167
  },
180964
181168
  {
180965
181169
  message: flowsMessages.pull.downloadingTeamStorageAssets,
180966
- task: async () => {
180967
- const result2 = await ctx.platformClient.syncTeamStorageAssets(assetsAbs);
181170
+ task: async (update) => {
181171
+ const result2 = await ctx.platformClient.syncTeamStorageAssets(assetsAbs, {
181172
+ onProgress: ({ current, total }) => update(flowsMessages.pull.downloadingTeamStorageAssetsProgress(current, total))
181173
+ });
180968
181174
  if (!result2.ok)
180969
181175
  throw new Error(result2.error);
180970
181176
  return result2.value;
@@ -181689,16 +181895,16 @@ import { join as join26 } from "node:path";
181689
181895
  var flowSubpathImports = { "#playwright": "playwright" };
181690
181896
  var packageJsonSchema = exports_external.looseObject({ imports: exports_external.record(exports_external.string(), exports_external.unknown()).catch({}) }).catch({ imports: {} });
181691
181897
  async function writeExecSubpathImports(args) {
181692
- const { execDir, fs: fs3 } = args;
181898
+ const { execDir, fs: fs4 } = args;
181693
181899
  const pkgPath = join26(execDir, "package.json");
181694
- const pkg = packageJsonSchema.parse(await readPackageJson(pkgPath, fs3));
181900
+ const pkg = packageJsonSchema.parse(await readPackageJson(pkgPath, fs4));
181695
181901
  const merged = { ...pkg, imports: { ...pkg.imports, ...flowSubpathImports } };
181696
- await fs3.writeFile(pkgPath, JSON.stringify(merged, undefined, 2));
181902
+ await fs4.writeFile(pkgPath, JSON.stringify(merged, undefined, 2));
181697
181903
  }
181698
- async function readPackageJson(pkgPath, fs3) {
181904
+ async function readPackageJson(pkgPath, fs4) {
181699
181905
  let content;
181700
181906
  try {
181701
- content = await fs3.readFile(pkgPath);
181907
+ content = await fs4.readFile(pkgPath);
181702
181908
  } catch (err) {
181703
181909
  if (isNoEntError(err))
181704
181910
  return {};
@@ -181726,27 +181932,27 @@ async function createDirSymlink(source, target) {
181726
181932
 
181727
181933
  // src/domains/runtimeEnv/linkPinnedPackages.ts
181728
181934
  async function linkPinnedPackages(args) {
181729
- const { depsRoot, nodeModulesDir, fs: fs3 } = args;
181935
+ const { depsRoot, nodeModulesDir, fs: fs4 } = args;
181730
181936
  const managedModules = join27(depsRoot, "node_modules");
181731
- await fs3.mkdir(nodeModulesDir, { recursive: true });
181937
+ await fs4.mkdir(nodeModulesDir, { recursive: true });
181732
181938
  for (const { name } of pinnedPackages) {
181733
181939
  const segments = name.split("/");
181734
181940
  const target = join27(nodeModulesDir, ...segments);
181735
181941
  if (segments.length > 1) {
181736
- await fs3.mkdir(dirname8(target), { recursive: true });
181942
+ await fs4.mkdir(dirname8(target), { recursive: true });
181737
181943
  }
181738
- await fs3.rm(target, { recursive: true, force: true });
181944
+ await fs4.rm(target, { recursive: true, force: true });
181739
181945
  await createDirSymlink(join27(managedModules, ...segments), target);
181740
181946
  }
181741
181947
  }
181742
181948
 
181743
181949
  // src/domains/runtimeEnv/innerHop.ts
181744
181950
  async function populateInnerHop(args) {
181745
- const { depsRoot, execDir, fs: fs3 } = args;
181951
+ const { depsRoot, execDir, fs: fs4 } = args;
181746
181952
  await linkPinnedPackages({
181747
181953
  depsRoot,
181748
181954
  nodeModulesDir: join28(execDir, "node_modules"),
181749
- fs: fs3
181955
+ fs: fs4
181750
181956
  });
181751
181957
  }
181752
181958
 
@@ -181755,12 +181961,12 @@ import { lstat } from "node:fs/promises";
181755
181961
  import { dirname as dirname9, join as join29 } from "node:path";
181756
181962
  var executorPackageNames = new Set(pinnedPackages.map((p3) => p3.name));
181757
181963
  async function populateOuterHop(args) {
181758
- const { projectDir, runDir, fs: fs3 } = args;
181964
+ const { projectDir, runDir, fs: fs4 } = args;
181759
181965
  if (projectDir === undefined)
181760
181966
  return { mode: "none" };
181761
- const installableDeps = await readInstallableDeps(projectDir, fs3);
181967
+ const installableDeps = await readInstallableDeps(projectDir, fs4);
181762
181968
  const depNames = Object.keys(installableDeps);
181763
- const { satisfying, rejected } = await findSatisfyingNodeModulesDir(projectDir, depNames, fs3);
181969
+ const { satisfying, rejected } = await findSatisfyingNodeModulesDir(projectDir, depNames, fs4);
181764
181970
  if (satisfying !== undefined) {
181765
181971
  await createDirSymlink(satisfying, join29(runDir, "node_modules"));
181766
181972
  return { mode: "symlink", nodeModulesDir: satisfying };
@@ -181768,22 +181974,22 @@ async function populateOuterHop(args) {
181768
181974
  if (depNames.length === 0)
181769
181975
  return { mode: "none" };
181770
181976
  args.onInstallStart?.(depNames.length);
181771
- await installOuterDeps(runDir, installableDeps, fs3, args.install ?? spawnNpmInstall);
181977
+ await installOuterDeps(runDir, installableDeps, fs4, args.install ?? spawnNpmInstall);
181772
181978
  await linkPinnedPackages({
181773
181979
  depsRoot: args.depsRoot,
181774
181980
  nodeModulesDir: join29(runDir, "node_modules"),
181775
- fs: fs3
181981
+ fs: fs4
181776
181982
  });
181777
181983
  return { mode: "install", depCount: depNames.length, rejected };
181778
181984
  }
181779
- async function findSatisfyingNodeModulesDir(startDir, depNames, fs3) {
181985
+ async function findSatisfyingNodeModulesDir(startDir, depNames, fs4) {
181780
181986
  const rejected = [];
181781
181987
  let dir = startDir;
181782
181988
  while (true) {
181783
181989
  const candidate = join29(dir, "node_modules");
181784
181990
  const stats = await lstatSafe(candidate);
181785
181991
  if (stats !== undefined && stats.isDirectory() && !stats.isSymbolicLink()) {
181786
- const missing = depNames.filter((name) => !fs3.existsSync(join29(candidate, name, "package.json")));
181992
+ const missing = depNames.filter((name) => !fs4.existsSync(join29(candidate, name, "package.json")));
181787
181993
  if (missing.length === 0)
181788
181994
  return { satisfying: candidate, rejected };
181789
181995
  rejected.push({ dir: candidate, missing });
@@ -181801,10 +182007,10 @@ async function lstatSafe(path3) {
181801
182007
  return;
181802
182008
  }
181803
182009
  }
181804
- async function readInstallableDeps(projectDir, fs3) {
182010
+ async function readInstallableDeps(projectDir, fs4) {
181805
182011
  let content;
181806
182012
  try {
181807
- content = await fs3.readFile(join29(projectDir, "package.json"));
182013
+ content = await fs4.readFile(join29(projectDir, "package.json"));
181808
182014
  } catch {
181809
182015
  return {};
181810
182016
  }
@@ -181821,9 +182027,9 @@ async function readInstallableDeps(projectDir, fs3) {
181821
182027
  return {};
181822
182028
  return Object.fromEntries(Object.entries(rawDeps).filter(([name]) => !executorPackageNames.has(name)).filter((entry) => typeof entry[1] === "string"));
181823
182029
  }
181824
- async function installOuterDeps(runDir, deps, fs3, install) {
181825
- await fs3.writeFile(join29(runDir, "package.json"), JSON.stringify({ name: "qawolf-run", private: true, dependencies: deps }, undefined, 2));
181826
- await fs3.writeFile(join29(runDir, ".npmrc"), `@qawolf:registry=https://registry.npmjs.org/
182030
+ async function installOuterDeps(runDir, deps, fs4, install) {
182031
+ await fs4.writeFile(join29(runDir, "package.json"), JSON.stringify({ name: "qawolf-run", private: true, dependencies: deps }, undefined, 2));
182032
+ await fs4.writeFile(join29(runDir, ".npmrc"), `@qawolf:registry=https://registry.npmjs.org/
181827
182033
  `);
181828
182034
  const result = await install(runDir);
181829
182035
  if (result.exitCode !== 0) {
@@ -181849,23 +182055,23 @@ async function copyDirExcluding(source, destination, excludedNames) {
181849
182055
  // src/domains/runtimeEnv/stageFlowFiles.ts
181850
182056
  var excludedDirs = new Set(["node_modules", ".git", ".qawolf"]);
181851
182057
  async function stageFlowFiles(args) {
181852
- const { files, projectDir, execDir, fs: fs3 } = args;
182058
+ const { files, projectDir, execDir, fs: fs4 } = args;
181853
182059
  if (projectDir !== undefined) {
181854
182060
  await copyDirExcluding(projectDir, execDir, excludedDirs);
181855
- return Promise.all(files.map(async (f3) => remapPath(f3, projectDir, execDir) ?? stageOneFile(f3, execDir, fs3)));
182061
+ return Promise.all(files.map(async (f3) => remapPath(f3, projectDir, execDir) ?? stageOneFile(f3, execDir, fs4)));
181856
182062
  }
181857
182063
  if (files.length > 1) {
181858
- return Promise.all(files.map((f3) => stageOneFile(f3, execDir, fs3)));
182064
+ return Promise.all(files.map((f3) => stageOneFile(f3, execDir, fs4)));
181859
182065
  }
181860
- await Promise.all(files.map((f3) => fs3.copyFile(f3, join31(execDir, basename4(f3)))));
182066
+ await Promise.all(files.map((f3) => fs4.copyFile(f3, join31(execDir, basename4(f3)))));
181861
182067
  return files.map((f3) => join31(execDir, basename4(f3)));
181862
182068
  }
181863
- async function stageOneFile(file2, execDir, fs3) {
182069
+ async function stageOneFile(file2, execDir, fs4) {
181864
182070
  const dirHash = createHash3("sha256").update(dirname10(file2)).digest("hex").slice(0, 8);
181865
182071
  const subDir = join31(execDir, dirHash);
181866
- await fs3.mkdir(subDir, { recursive: true });
182072
+ await fs4.mkdir(subDir, { recursive: true });
181867
182073
  const dest = join31(subDir, basename4(file2));
181868
- await fs3.copyFile(file2, dest);
182074
+ await fs4.copyFile(file2, dest);
181869
182075
  return dest;
181870
182076
  }
181871
182077
  function remapPath(file2, projectDir, execDir) {
@@ -181880,30 +182086,30 @@ function remapPath(file2, projectDir, execDir) {
181880
182086
  // src/domains/runtimeEnv/prepareRunDir.ts
181881
182087
  async function prepareRunDir(args) {
181882
182088
  const { files, projectDir, depsRoot, runRoot } = args;
181883
- const fs3 = args.fs ?? makeDefaultFs();
182089
+ const fs4 = args.fs ?? makeDefaultFs();
181884
182090
  const runId = buildRunId(projectDir, files);
181885
182091
  const runDir = join32(runRoot, runId);
181886
- await fs3.rm(runDir, { recursive: true, force: true });
181887
- await fs3.mkdir(runDir, { recursive: true });
182092
+ await fs4.rm(runDir, { recursive: true, force: true });
182093
+ await fs4.mkdir(runDir, { recursive: true });
181888
182094
  const execDir = join32(runDir, "exec");
181889
- await fs3.mkdir(execDir, { recursive: true });
181890
- await populateInnerHop({ depsRoot, execDir, fs: fs3 });
181891
- const stagedFiles = await stageFlowFiles({ files, projectDir, execDir, fs: fs3 });
182095
+ await fs4.mkdir(execDir, { recursive: true });
182096
+ await populateInnerHop({ depsRoot, execDir, fs: fs4 });
182097
+ const stagedFiles = await stageFlowFiles({ files, projectDir, execDir, fs: fs4 });
181892
182098
  if (projectDir !== undefined) {
181893
- await writeExecSubpathImports({ execDir, fs: fs3 });
182099
+ await writeExecSubpathImports({ execDir, fs: fs4 });
181894
182100
  }
181895
182101
  const outerHop = await populateOuterHop({
181896
182102
  projectDir,
181897
182103
  runDir,
181898
182104
  depsRoot,
181899
- fs: fs3,
182105
+ fs: fs4,
181900
182106
  ...args.onInstallStart !== undefined ? { onInstallStart: args.onInstallStart } : {}
181901
182107
  });
181902
182108
  return {
181903
182109
  files: stagedFiles,
181904
182110
  runDir,
181905
182111
  outerHop,
181906
- cleanup: () => fs3.rm(runDir, { recursive: true, force: true })
182112
+ cleanup: () => fs4.rm(runDir, { recursive: true, force: true })
181907
182113
  };
181908
182114
  }
181909
182115
  function buildRunId(projectDir, files) {
@@ -181950,13 +182156,13 @@ async function configureTestkit(cwd, deps) {
181950
182156
 
181951
182157
  // src/commands/resolveDepsRoot.ts
181952
182158
  function resolveDepsRoot(args) {
181953
- const fs3 = args.fs ?? makeDefaultFs();
181954
- const projectDir = resolveProjectDirSafe(args.files, fs3);
182159
+ const fs4 = args.fs ?? makeDefaultFs();
182160
+ const projectDir = resolveProjectDirSafe(args.files, fs4);
181955
182161
  return ensureRuntimeEnv({
181956
182162
  platform: args.platform,
181957
182163
  ...projectDir !== undefined ? { projectDir } : {},
181958
182164
  ...args.overrideDir !== undefined ? { overrideDir: args.overrideDir } : {}
181959
- }, { fs: fs3 });
182165
+ }, { fs: fs4 });
181960
182166
  }
181961
182167
 
181962
182168
  // src/domains/emails/configureEmails.ts
@@ -181988,31 +182194,31 @@ import { join as join34 } from "node:path";
181988
182194
  function envFilePath(envDir) {
181989
182195
  return join34(envDir, ".env");
181990
182196
  }
181991
- async function readEnv(envDir, fs3) {
182197
+ async function readEnv(envDir, fs4) {
181992
182198
  try {
181993
- return parseDotenv(await fs3.readFile(envFilePath(envDir)));
182199
+ return parseDotenv(await fs4.readFile(envFilePath(envDir)));
181994
182200
  } catch (err) {
181995
182201
  if (isNoEntError(err))
181996
182202
  return {};
181997
182203
  throw err;
181998
182204
  }
181999
182205
  }
182000
- async function writeEnv(envDir, fs3, vars) {
182206
+ async function writeEnv(envDir, fs4, vars) {
182001
182207
  const target = envFilePath(envDir);
182002
182208
  const tmp = `${target}.${process.pid}.tmp`;
182003
- await fs3.writeFile(tmp, serializeDotenv(vars), { mode: 384 });
182004
- await fs3.rename(tmp, target);
182209
+ await fs4.writeFile(tmp, serializeDotenv(vars), { mode: 384 });
182210
+ await fs4.rename(tmp, target);
182005
182211
  }
182006
- function makeEnvVarDeps(envDir, fs3) {
182212
+ function makeEnvVarDeps(envDir, fs4) {
182007
182213
  return {
182008
182214
  setEnvironmentVariable: async (key, value) => {
182009
- const vars = await readEnv(envDir, fs3);
182215
+ const vars = await readEnv(envDir, fs4);
182010
182216
  vars[key] = value;
182011
- await writeEnv(envDir, fs3, vars);
182217
+ await writeEnv(envDir, fs4, vars);
182012
182218
  process.env[key] = value;
182013
182219
  },
182014
182220
  fetchLatestEnvironmentVariables: async () => {
182015
- const vars = await readEnv(envDir, fs3);
182221
+ const vars = await readEnv(envDir, fs4);
182016
182222
  for (const [key, value] of Object.entries(vars)) {
182017
182223
  process.env[key] = value;
182018
182224
  }
@@ -182134,7 +182340,7 @@ var defaultSpawnAppium = (bin, args, platform, env2) => {
182134
182340
  var readyBanner = "Appium REST http interface listener started on";
182135
182341
  var defaultStartTimeoutMs = 30000;
182136
182342
  var bannerBufferMaxBytes = 1024;
182137
- function waitForBanner(output, exitCode, timeoutMs4) {
182343
+ function waitForBanner(output, exitCode, timeoutMs3) {
182138
182344
  return new Promise((resolve10, reject) => {
182139
182345
  let done = false;
182140
182346
  function cleanup() {
@@ -182158,8 +182364,8 @@ function waitForBanner(output, exitCode, timeoutMs4) {
182158
182364
  };
182159
182365
  const timer = setTimeout(() => {
182160
182366
  cleanup();
182161
- reject(new Error(`Appium server did not start within ${timeoutMs4 / 1000}s`));
182162
- }, timeoutMs4);
182367
+ reject(new Error(`Appium server did not start within ${timeoutMs3 / 1000}s`));
182368
+ }, timeoutMs3);
182163
182369
  output.on("data", onData);
182164
182370
  const fail = (err) => {
182165
182371
  if (done)
@@ -182175,7 +182381,7 @@ async function createAppiumServer(envDir, signals, params) {
182175
182381
  const findFreePortFn = params?.deps?.findFreePort ?? findFreePort;
182176
182382
  const checkExists = params?.deps?.checkExists ?? existsSync2;
182177
182383
  const appiumHome = params?.options?.appiumHome ?? getAppiumHome();
182178
- const timeoutMs4 = params?.options?.startTimeoutMs ?? defaultStartTimeoutMs;
182384
+ const timeoutMs3 = params?.options?.startTimeoutMs ?? defaultStartTimeoutMs;
182179
182385
  const platform = params?.options?.platform ?? process.platform;
182180
182386
  const candidates = appiumCliCandidates(envDir, platform);
182181
182387
  const bin = candidates.find(checkExists);
@@ -182192,7 +182398,7 @@ async function createAppiumServer(envDir, signals, params) {
182192
182398
  proc.kill();
182193
182399
  };
182194
182400
  const unregister = signals.register(stop);
182195
- await waitForBanner(proc.output, proc.exitCode, timeoutMs4).catch((err) => {
182401
+ await waitForBanner(proc.output, proc.exitCode, timeoutMs3).catch((err) => {
182196
182402
  unregister();
182197
182403
  stop();
182198
182404
  throw err;
@@ -182243,13 +182449,13 @@ async function bootSequence(adb, serial, cancelled) {
182243
182449
  await new Promise((r2) => setTimeout(r2, pollIntervalMs));
182244
182450
  }
182245
182451
  }
182246
- function waitForBoot(adb, serial, timeoutMs4) {
182452
+ function waitForBoot(adb, serial, timeoutMs3) {
182247
182453
  return new Promise((resolve10, reject) => {
182248
182454
  let done = false;
182249
182455
  const timer = setTimeout(() => {
182250
182456
  done = true;
182251
- reject(new Error(`Android emulator did not finish booting within ${timeoutMs4 / 1000}s`));
182252
- }, timeoutMs4);
182457
+ reject(new Error(`Android emulator did not finish booting within ${timeoutMs3 / 1000}s`));
182458
+ }, timeoutMs3);
182253
182459
  bootSequence(adb, serial, () => done).then(() => {
182254
182460
  if (!done) {
182255
182461
  done = true;
@@ -182269,7 +182475,7 @@ async function createAndroidEmulator(params) {
182269
182475
  const { avdName, port } = params;
182270
182476
  const spawnFn = params.deps?.spawn ?? defaultSpawnEmulator;
182271
182477
  const adbFn = params.deps?.adb ?? defaultAdb;
182272
- const timeoutMs4 = params.options?.bootTimeoutMs ?? defaultBootTimeoutMs;
182478
+ const timeoutMs3 = params.options?.bootTimeoutMs ?? defaultBootTimeoutMs;
182273
182479
  const serial = `emulator-${port}`;
182274
182480
  const proc = spawnFn(emulatorBin(androidSdkHome(), process.platform), [
182275
182481
  "-avd",
@@ -182280,7 +182486,7 @@ async function createAndroidEmulator(params) {
182280
182486
  String(port)
182281
182487
  ]);
182282
182488
  try {
182283
- await waitForBoot(adbFn, serial, timeoutMs4);
182489
+ await waitForBoot(adbFn, serial, timeoutMs3);
182284
182490
  } catch (err) {
182285
182491
  proc.stop();
182286
182492
  throw err;
@@ -184889,4 +185095,4 @@ createProgram({ signals }).parseAsync().catch(() => {
184889
185095
  process.exitCode = 1;
184890
185096
  }).finally(() => flushAndExit(typeof process.exitCode === "number" ? process.exitCode : 0));
184891
185097
 
184892
- //# debugId=6CBE0567ED2CC02E64756E2164756E21
185098
+ //# debugId=E21CB4505E563EFF64756E2164756E21